Mercurial > hg > orthanc-stone
comparison Samples/Sdl/BasicScene.cpp @ 611:e3f21a265be5
Added version directive to GLSL shader code + glew init function in sample code
AND commented-out glew init function in StoneInitialize
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 30 Apr 2019 16:07:48 +0200 |
parents | 0c4c0693b97c |
children | 412a2d01a189 |
comparison
equal
deleted
inserted
replaced
610:0c4c0693b97c | 611:e3f21a265be5 |
---|---|
272 } | 272 } |
273 | 273 |
274 | 274 |
275 void Run(OrthancStone::Scene2D& scene) | 275 void Run(OrthancStone::Scene2D& scene) |
276 { | 276 { |
277 | |
277 OrthancStone::SdlOpenGLWindow window("Hello", 1024, 768); | 278 OrthancStone::SdlOpenGLWindow window("Hello", 1024, 768); |
279 | |
280 GLenum err = glewInit(); | |
281 if (GLEW_OK != err) | |
282 { | |
283 throw std::runtime_error("GLEW_OK != err"); | |
284 } | |
285 | |
278 scene.FitContent(window.GetCanvasWidth(), window.GetCanvasHeight()); | 286 scene.FitContent(window.GetCanvasWidth(), window.GetCanvasHeight()); |
279 | 287 |
288 | |
280 glEnable(GL_DEBUG_OUTPUT); | 289 glEnable(GL_DEBUG_OUTPUT); |
281 glDebugMessageCallback(OpenGLMessageCallback, 0 ); | 290 glDebugMessageCallback(OpenGLMessageCallback, 0 ); |
282 | 291 |
283 OrthancStone::OpenGLCompositor compositor(window, scene); | 292 OrthancStone::OpenGLCompositor compositor(window, scene); |
284 compositor.SetFont(0, Orthanc::EmbeddedResources::UBUNTU_FONT, | 293 compositor.SetFont(0, Orthanc::EmbeddedResources::UBUNTU_FONT, |