comparison pytouhou/lib/sdl.pyx @ 453:17a7f3b028f3

Raise an exception if GL context creation fails instead of failing silently.
author Thibaut Girka <thib@sitedethib.com>
date Fri, 30 Aug 2013 23:32:36 +0200
parents 2a352118c55a
children 6864a38b2413
comparison
equal deleted inserted replaced
452:1f5156093785 453:17a7f3b028f3
56 def destroy_window(self): 56 def destroy_window(self):
57 SDL_DestroyWindow(self.window) 57 SDL_DestroyWindow(self.window)
58 58
59 def gl_create_context(self): 59 def gl_create_context(self):
60 self.context = SDL_GL_CreateContext(self.window) 60 self.context = SDL_GL_CreateContext(self.window)
61 if self.context == NULL:
62 raise SDLError(SDL_GetError())
61 63
62 def gl_swap_window(self): 64 def gl_swap_window(self):
63 SDL_GL_SwapWindow(self.window) 65 SDL_GL_SwapWindow(self.window)
64 66
65 def gl_delete_context(self): 67 def gl_delete_context(self):