this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Removed VAO from 3d-demo, since it is a GL 2.1+ extension and is not good for GL 1 compatibility.

+4 -11
+4 -11
demos/3d/main.c
··· 1 1 #include "SDL.h" 2 2 #include "SDL_gpu.h" 3 3 #include "SDL_gpu_OpenGL_1.h" 4 + #include "glew.h" 5 + #include <stdlib.h> 4 6 5 7 6 8 7 - 8 - GLuint VAO; 9 9 GLuint VBO; 10 10 GLuint modelViewProjection_loc; 11 11 GLuint vertex_loc; ··· 65 65 gldata[20] = 1.0f; 66 66 67 67 68 - glUseProgram(p); 69 - 70 - glBindVertexArray(VAO); 68 + glUseProgram(p); 71 69 72 70 GPU_GetModelViewProjection(mvp); 73 71 glUniformMatrix4fv(modelViewProjection_loc, 1, 0, mvp); ··· 100 98 glDrawArrays(GL_TRIANGLES, 0, 3); 101 99 102 100 glDisableVertexAttribArray(color_loc); 103 - glDisableVertexAttribArray(vertex_loc); 104 - 105 - glBindVertexArray(0); 101 + glDisableVertexAttribArray(vertex_loc); 106 102 } 107 103 108 104 void draw_3d_stuff(GPU_Target* screen) ··· 162 158 vertex_loc = GPU_GetAttributeLocation(p, "gpu_Vertex"); 163 159 color_loc = GPU_GetAttributeLocation(p, "gpu_Color"); 164 160 modelViewProjection_loc = GPU_GetUniformLocation(p, "gpu_ModelViewProjectionMatrix"); 165 - 166 - glGenVertexArrays(1, &VAO); 167 - glBindVertexArray(VAO); 168 161 169 162 glGenBuffers(1, &VBO); 170 163 glBindBuffer(GL_ARRAY_BUFFER, VBO);