1 module prova.graphics.glcontext;
2 
3 import derelict.opengl,
4        derelict.sdl2.sdl,
5        std.conv;
6 
7 ///
8 final class GLContext
9 {
10   ///
11   SDL_GLContext handle;
12 
13   ///
14   this(SDL_Window* window)
15   {
16     handle = SDL_GL_CreateContext(window);
17 
18     if(!handle)
19       throw new Exception("Error initializing GL Context: " ~ to!string(SDL_GetError()));
20 
21     DerelictGL3.reload();
22   }
23 
24   ~this()
25   {
26     SDL_GL_DeleteContext(handle);
27   }
28 }