Skip to content

Commit

Permalink
(macos) Create the VAO before compiling the shader program
Browse files Browse the repository at this point in the history
  • Loading branch information
tlecomte committed Mar 21, 2018
1 parent 636c359 commit 1a454d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions friture/plotting/glCanvasWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ def initializeGL(self):
fragment_shader_source = core_fragment_shader_source if self.is_core else legacy_fragment_shader_source
quad_fragment_shader = shaders.compileShader(fragment_shader_source, GL.GL_FRAGMENT_SHADER)

if self.is_core:
# on OpenGL 3 core, create a vertex array object (on non-core, there is one default VAO)
self.vao = GL.glGenVertexArrays(1)
# VAO needs to be bound before the program can be compiled
GL.glBindVertexArray(self.vao)

self.quad_shader = shaders.compileProgram(quad_vertex_shader, quad_fragment_shader)

vertices = np.array(
Expand All @@ -272,10 +278,6 @@ def initializeGL(self):
self.grid_vbo = vbo.VBO(vertices)
self.data_vbo = vbo.VBO(vertices)

if self.is_core:
# on OpenGL 3 core, create a vertex array object (on non-core, there is one default VAO)
self.vao = GL.glGenVertexArrays(1)

def setfmax(self, fmax):
self.fmax = fmax

Expand Down

0 comments on commit 1a454d3

Please sign in to comment.