Changeset 516668e in opengl-game
- Timestamp:
- Jul 19, 2017, 4:08:45 AM (8 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 644a2e4
- Parents:
- 5272b6b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
r5272b6b r516668e 31 31 glEnable(GL_DEPTH_TEST); 32 32 glDepthFunc(GL_LESS); 33 34 GLfloat points[] = { 35 0.0f, 0.5f, 0.0f, 36 0.5f, -0.5f, 0.0f, 37 -0.5f, -0.5f, 0.0f, 38 }; 39 40 GLuint vbo = 0; 41 glGenBuffers(1, &vbo); 42 glBindBuffer(GL_ARRAY_BUFFER, vbo); 43 glBufferData(GL_ARRAY_BUFFER, sizeof(points), points, GL_STATIC_DRAW); 44 45 GLuint vao=0; 46 glGenVertexArrays(1, &vao); 47 glBindVertexArray(vao); 48 glEnableVertexAttribArray(0); 49 glBindBuffer(GL_ARRAY_BUFFER, vbo); 50 glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL); 51 33 52 glfwTerminate(); 34 53 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.