Skip to content

Commit

Permalink
Add a PYGAME_SDL2_AVOID_GL hint.
Browse files Browse the repository at this point in the history
This prevents the window from being initialized in a manner
compatible with OpenGL support.

Fixes #63, Fixes #64.
  • Loading branch information
renpytom committed Jan 8, 2017
1 parent a5bfe04 commit 0732c44
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pygame_sdl2/display.pyx
Expand Up @@ -152,10 +152,17 @@ cdef class Window:

self.create_flags = flags

# If we do not get the AVOID_GL hint, we always create a GL-compatible
# window. This lets us change the OPENGL flag later on.
if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")):
gl_flag = 0
else:
gl_flag = SDL_WINDOW_OPENGL

self.window = SDL_CreateWindow(
title,
pos[0], pos[1],
resolution[0], resolution[1], flags | SDL_WINDOW_OPENGL)
resolution[0], resolution[1], flags | gl_flag)

if not self.window:
raise error()
Expand Down

0 comments on commit 0732c44

Please sign in to comment.