File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,12 @@ def link_shader_program(vertex_shader, fragment_shader):
92
92
return program
93
93
94
94
def init_shader_program ():
95
+ versionString = gl .glGetString (gl .GL_VERSION ).split (" " )
96
+ openglVersionString = versionString [0 ]
97
+ openglVersionNums = map (int , openglVersionString .split ("." ))
98
+ if openglVersionNums [0 ] < 3 or (openglVersionNums [0 ] == 3 and openglVersionNums [1 ] < 3 ):
99
+ exit ("Requires opengl 3.3 or better, you have {0}" .format (openglVersionString ))
100
+
95
101
# background color
96
102
gl .glClearColor (0 , 0 , 0 , 0 )
97
103
# create a Vertex Buffer Object with the specified data
Original file line number Diff line number Diff line change 2
2
3
3
import OpenGL
4
4
from OpenGL .GL import *
5
+ import OpenGL .GL as gl
5
6
from OpenGL .GL .shaders import *
6
7
from OpenGL .GLU import *
7
8
from OpenGL .arrays import vbo
32
33
33
34
# initialization
34
35
def init ():
36
+ versionString = gl .glGetString (gl .GL_VERSION ).split (" " )
37
+ openglVersionString = versionString [0 ]
38
+ openglVersionNums = map (int , openglVersionString .split ("." ))
39
+ if openglVersionNums [0 ] < 3 or (openglVersionNums [0 ] == 3 and openglVersionNums [1 ] < 3 ):
40
+ exit ("Requires opengl 3.3 or better, you have {0}" .format (openglVersionString ))
41
+
35
42
out = {}
36
43
# create shader
37
44
vs = compileShader (strVS , GL_VERTEX_SHADER )
You can’t perform that action at this time.
0 commit comments