# HG changeset patch # User Thibaut Girka # Date 1377898356 -7200 # Node ID 17a7f3b028f314146fe9bb281599675ba5b69d8d # Parent 1f5156093785849a6712e36fadba19761c9f3e01 Raise an exception if GL context creation fails instead of failing silently. diff --git a/pytouhou/lib/sdl.pyx b/pytouhou/lib/sdl.pyx --- a/pytouhou/lib/sdl.pyx +++ b/pytouhou/lib/sdl.pyx @@ -58,6 +58,8 @@ cdef class Window: def gl_create_context(self): self.context = SDL_GL_CreateContext(self.window) + if self.context == NULL: + raise SDLError(SDL_GetError()) def gl_swap_window(self): SDL_GL_SwapWindow(self.window)