Mercurial > touhou
annotate pytouhou/ui/opengl/backend.pyx @ 583:47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 05 Oct 2014 20:38:06 +0200 |
parents | 6e79756b7f42 |
children | e0166cda75d5 |
rev | line source |
---|---|
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 from pytouhou.lib cimport sdl |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 from pytouhou.lib.sdl cimport Window |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 from pytouhou.lib.opengl cimport \ |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 (glEnable, glHint, glEnableClientState, GL_TEXTURE_2D, GL_BLEND, |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 GL_PERSPECTIVE_CORRECTION_HINT, GL_FOG_HINT, GL_NICEST, |
579
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
7 GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY, |
583
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
8 glPushDebugGroup, GL_DEBUG_SOURCE_APPLICATION, glPopDebugGroup, |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
9 epoxy_gl_version, epoxy_is_desktop_gl, epoxy_has_gl_extension) |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 GameRenderer = None |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
15 def init(options): |
583
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
16 ''' |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
17 Initialize the OpenGL module, and raise if something bad prevents it from |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
18 working. |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
19 ''' |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 |
583
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
21 global profile, major, minor, double_buffer, is_legacy, GameRenderer |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
22 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
23 flavor = options['flavor'] |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
24 assert flavor in ('core', 'es', 'compatibility', 'legacy') |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
25 profile = (sdl.GL_CONTEXT_PROFILE_CORE if flavor == 'core' else |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
26 sdl.GL_CONTEXT_PROFILE_ES if flavor == 'es' else |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
27 sdl.GL_CONTEXT_PROFILE_COMPATIBILITY) |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
28 |
556
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
29 version = str(options['version']) |
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
30 assert len(version) == 3 and version[1] == '.' |
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
31 major = int(version[0]) |
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
32 minor = int(version[2]) |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
33 |
554
653a9f087673
Make both double- and single-buffer available on the CLI, but default to SDL’s default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
34 maybe_double_buffer = options['double-buffer'] |
653a9f087673
Make both double- and single-buffer available on the CLI, but default to SDL’s default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
35 double_buffer = maybe_double_buffer if maybe_double_buffer is not None else -1 |
653a9f087673
Make both double- and single-buffer available on the CLI, but default to SDL’s default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
36 |
583
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
37 is_legacy = flavor == 'legacy' |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
38 is_gles = flavor == 'es' |
557
0f2af7552462
Don’t hardcode GLSL version in our shaders, instead make them dependent on GL version.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
556
diff
changeset
|
39 |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
40 #TODO: check for framebuffer/renderbuffer support. |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
41 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
42 from pytouhou.ui.opengl.gamerenderer import GameRenderer |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
43 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
44 |
583
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
45 def discover_features(): |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
46 '''Discover which features are supported by our context.''' |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
47 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
48 global use_debug_group, use_vao, shader_header |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
49 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
50 version = epoxy_gl_version() |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
51 is_desktop = epoxy_is_desktop_gl() |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
52 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
53 use_debug_group = (is_desktop and version >= 43) or epoxy_has_gl_extension('GL_KHR_debug') |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
54 use_vao = (is_desktop and version >= 30) or epoxy_has_gl_extension('GL_ARB_vertex_array_object') |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
55 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
56 if is_desktop: |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
57 # gl_FragColor isn’t supported anymore starting with GLSL 4.2. |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
58 if version >= 42: |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
59 version = 41 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
60 try: |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
61 glsl_version = {20: 110, 21: 120, 30: 130, 31: 140, 32: 150}[version] |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
62 except KeyError: |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
63 assert version >= 33 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
64 glsl_version = version * 10 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
65 shader_header = '#version %d\n\n' % glsl_version |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
66 else: |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
67 # The attribute keyword isn’t supported past GLSL ES 3.0. |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
68 if version >= 30: |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
69 version = 20 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
70 glsl_version = {20: '100', 30: '300 es'}[version] |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
71 shader_header = '#version %s\n\nprecision highp float;\n\n' % glsl_version |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
72 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
73 |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
74 def create_window(title, x, y, width, height): |
583
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
75 '''Create a window (using SDL) and an OpenGL context.''' |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
76 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
77 sdl.gl_set_attribute(sdl.GL_CONTEXT_PROFILE_MASK, profile) |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
78 sdl.gl_set_attribute(sdl.GL_CONTEXT_MAJOR_VERSION, major) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
79 sdl.gl_set_attribute(sdl.GL_CONTEXT_MINOR_VERSION, minor) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
80 sdl.gl_set_attribute(sdl.GL_DEPTH_SIZE, 24) |
554
653a9f087673
Make both double- and single-buffer available on the CLI, but default to SDL’s default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
81 if double_buffer >= 0: |
653a9f087673
Make both double- and single-buffer available on the CLI, but default to SDL’s default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
82 sdl.gl_set_attribute(sdl.GL_DOUBLEBUFFER, double_buffer) |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
83 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
84 flags = sdl.WINDOW_SHOWN | sdl.WINDOW_OPENGL |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
85 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
86 #TODO: legacy can support one of the framebuffer extensions. |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
87 if not is_legacy: |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
88 flags |= sdl.WINDOW_RESIZABLE |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
89 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
90 window = Window(title, x, y, width, height, flags) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
91 window.gl_create_context() |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
92 |
583
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
93 discover_features() |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
582
diff
changeset
|
94 |
582
6e79756b7f42
Don’t call gl*DebugGroup if it isn’t exposed by the driver.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
95 if use_debug_group: |
6e79756b7f42
Don’t call gl*DebugGroup if it isn’t exposed by the driver.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
96 glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "OpenGL initialisation") |
6e79756b7f42
Don’t call gl*DebugGroup if it isn’t exposed by the driver.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
97 |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
98 # Initialize OpenGL |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
99 glEnable(GL_BLEND) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
100 if is_legacy: |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
101 glEnable(GL_TEXTURE_2D) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
102 glHint(GL_FOG_HINT, GL_NICEST) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
103 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
104 glEnableClientState(GL_COLOR_ARRAY) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
105 glEnableClientState(GL_VERTEX_ARRAY) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
106 glEnableClientState(GL_TEXTURE_COORD_ARRAY) |
582
6e79756b7f42
Don’t call gl*DebugGroup if it isn’t exposed by the driver.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
107 |
6e79756b7f42
Don’t call gl*DebugGroup if it isn’t exposed by the driver.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
108 if use_debug_group: |
6e79756b7f42
Don’t call gl*DebugGroup if it isn’t exposed by the driver.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
109 glPopDebugGroup() |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
110 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
111 return window |