comparison pytouhou/ui/opengl/backend.pyx @ 612:73f134f84c7f

Request a RGB888 context, since SDL2’s default of RGB332 sucks. On X11/GLX, it will select the first config available, that is the best one, while on EGL it will iterate over them to select the one closest to what the application requested. Of course, anything lower than RGB888 looks bad and we really don’t want that.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 26 Mar 2015 20:20:37 +0100
parents a6a191e371c7
children a6af3ff86612
comparison
equal deleted inserted replaced
611:a6a191e371c7 612:73f134f84c7f
92 '''Create a window (using SDL) and an OpenGL context.''' 92 '''Create a window (using SDL) and an OpenGL context.'''
93 93
94 sdl.gl_set_attribute(sdl.GL_CONTEXT_PROFILE_MASK, profile) 94 sdl.gl_set_attribute(sdl.GL_CONTEXT_PROFILE_MASK, profile)
95 sdl.gl_set_attribute(sdl.GL_CONTEXT_MAJOR_VERSION, major) 95 sdl.gl_set_attribute(sdl.GL_CONTEXT_MAJOR_VERSION, major)
96 sdl.gl_set_attribute(sdl.GL_CONTEXT_MINOR_VERSION, minor) 96 sdl.gl_set_attribute(sdl.GL_CONTEXT_MINOR_VERSION, minor)
97 sdl.gl_set_attribute(sdl.GL_RED_SIZE, 8)
98 sdl.gl_set_attribute(sdl.GL_GREEN_SIZE, 8)
99 sdl.gl_set_attribute(sdl.GL_BLUE_SIZE, 8)
97 sdl.gl_set_attribute(sdl.GL_DEPTH_SIZE, 24 if is_legacy else 0) 100 sdl.gl_set_attribute(sdl.GL_DEPTH_SIZE, 24 if is_legacy else 0)
98 if double_buffer >= 0: 101 if double_buffer >= 0:
99 sdl.gl_set_attribute(sdl.GL_DOUBLEBUFFER, double_buffer) 102 sdl.gl_set_attribute(sdl.GL_DOUBLEBUFFER, double_buffer)
100 103
101 flags = sdl.WINDOW_SHOWN | sdl.WINDOW_OPENGL 104 flags = sdl.WINDOW_SHOWN | sdl.WINDOW_OPENGL