diff --git a/examples/tetris/src/tetris.d b/examples/tetris/src/tetris.d index e9aad5bd..6d0922cc 100644 --- a/examples/tetris/src/tetris.d +++ b/examples/tetris/src/tetris.d @@ -25,9 +25,6 @@ mixin APP_ENTRY_POINT; /// entry point for dlangui based application extern (C) int UIAppMain(string[] args) { - //auto power2 = delegate(int X) { return X * X; }; - auto power2 = (int X) => X * X; - // embed resources listed in views/resources.list into executable embeddedResourceList.addResources(embedResourcesFromList!("resources.list")()); diff --git a/src/dlangui/platforms/sdl/sdlapp.d b/src/dlangui/platforms/sdl/sdlapp.d index dfec34f3..d9016227 100644 --- a/src/dlangui/platforms/sdl/sdlapp.d +++ b/src/dlangui/platforms/sdl/sdlapp.d @@ -1390,6 +1390,7 @@ int sdlmain(string[] args) { // we want OpenGL 3.3 SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION,3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION,2); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); // Set OpenGL attributes SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); diff --git a/src/dlangui/platforms/windows/winapp.d b/src/dlangui/platforms/windows/winapp.d index 41913ea5..f38a5366 100644 --- a/src/dlangui/platforms/windows/winapp.d +++ b/src/dlangui/platforms/windows/winapp.d @@ -1020,19 +1020,24 @@ int myWinMain(void* hInstance, void* hPrevInstance, char* lpCmdLine, int iCmdSho currentTheme = createDefaultTheme(); version (USE_OPENGL) { - import derelict.opengl3.gl3; - DerelictGL3.load(); + try { + import derelict.opengl3.gl3; + DerelictGL3.load(); - // just to check OpenGL context - Log.i("Trying to setup OpenGL context"); - Win32Window tmpWindow = new Win32Window(w32platform, ""d, null, 0); - destroy(tmpWindow); - if (openglEnabled) - Log.i("OpenGL support is enabled"); - else - Log.w("OpenGL support is disabled"); - // process messages - platform.enterMessageLoop(); + // just to check OpenGL context + Log.i("Trying to setup OpenGL context"); + Win32Window tmpWindow = new Win32Window(w32platform, ""d, null, 0); + destroy(tmpWindow); + if (openglEnabled) + Log.i("OpenGL support is enabled"); + else + Log.w("OpenGL support is disabled"); + // process messages + platform.enterMessageLoop(); + } catch (Exception e) { + Log.e("Exception while trying to init OpenGL", e); + openglEnabled = false; + } } // Load versions 1.2+ and all supported ARB and EXT extensions.