Changeset e3ca955 in opengl-game
- Timestamp:
- May 26, 2018, 8:19:03 PM (7 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 0d5c100
- Parents:
- f9a242b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
rf9a242b re3ca955 955 955 SceneObject* selectedObject) { 956 956 957 vector<int> colored_objs, selected_objs, textured_objs , static_colored_objs, static_textured_objs;957 vector<int> colored_objs, selected_objs, textured_objs; 958 958 959 959 // group scene objects by shader and vbo … … 961 961 if (selectedObject == &objects[i]) { 962 962 selected_objs.push_back(i); 963 } else if (objects[i].shader_program == color_sp) { 963 } 964 if (objects[i].shader_program == color_sp) { 964 965 colored_objs.push_back(i); 965 966 } else if (objects[i].shader_program == texture_sp) { … … 973 974 glBindVertexArray(vao1); 974 975 976 glBindBuffer(GL_ARRAY_BUFFER, selected_colors_vbo); 977 glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0); 978 979 for (it = selected_objs.begin(); it != selected_objs.end(); it++) { 980 glDrawArrays(GL_TRIANGLES, objects[*it].vertex_vbo_offset, objects[*it].num_points); 981 } 982 975 983 glBindBuffer(GL_ARRAY_BUFFER, colors_vbo); 976 984 glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0); 977 985 978 986 for (it = colored_objs.begin(); it != colored_objs.end(); it++) { 979 glDrawArrays(GL_TRIANGLES, objects[*it].vertex_vbo_offset, objects[*it].num_points);980 }981 982 glBindBuffer(GL_ARRAY_BUFFER, selected_colors_vbo);983 glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0);984 985 for (it = selected_objs.begin(); it != selected_objs.end(); it++) {986 987 glDrawArrays(GL_TRIANGLES, objects[*it].vertex_vbo_offset, objects[*it].num_points); 987 988 }
Note:
See TracChangeset
for help on using the changeset viewer.