Changeset 8e8aed6 in opengl-game for new-game.cpp
- Timestamp:
- Oct 17, 2018, 4:58:33 AM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 446e55d
- Parents:
- 25b47d7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
r25b47d7 r8e8aed6 795 795 796 796 // this code moves the asteroids 797 for ( int i = 0; i < objects.size(); i++) {797 for (unsigned int i = 0; i < objects.size(); i++) { 798 798 if (objects[i]->type == TYPE_ASTEROID && !objects[i]->deleted) { 799 799 transformObject(*objects[i], translate(mat4(1.0f), vec3(0.0f, 0.0f, 0.04f)), ubo); … … 1242 1242 1243 1243 obj->normals.reserve(obj->points.size()); 1244 for ( int i = 0; i < obj->points.size(); i += 9) {1244 for (unsigned int i = 0; i < obj->points.size(); i += 9) { 1245 1245 vec3 point1 = vec3(obj->points[i], obj->points[i + 1], obj->points[i + 2]); 1246 1246 vec3 point2 = vec3(obj->points[i + 3], obj->points[i + 4], obj->points[i + 5]); … … 1330 1330 1331 1331 // start from the second point 1332 for ( int i = 3; i < obj->points.size(); i += 3) {1332 for (unsigned int i = 3; i < obj->points.size(); i += 3) { 1333 1333 if (min_x > obj->points[i]) { 1334 1334 min_x = obj->points[i]; … … 1367 1367 obj->bounding_radius = radius_z; 1368 1368 1369 for ( int i = 0; i < obj->points.size(); i += 3) {1369 for (unsigned int i = 0; i < obj->points.size(); i += 3) { 1370 1370 obj->points[i] -= obj->bounding_center.x; 1371 1371 obj->points[i + 1] -= obj->bounding_center.y; … … 2022 2022 2023 2023 glBindBuffer(GL_ARRAY_BUFFER, model_mat_idx_vbo); 2024 for ( int i = 0; i < obj.num_points; i++) {2024 for (unsigned int i = 0; i < obj.num_points; i++) { 2025 2025 glBufferSubData(GL_ARRAY_BUFFER, (obj.vertex_vbo_offset + i) * sizeof(GLuint), sizeof(GLuint), &obj.ubo_offset); 2026 2026 } … … 2068 2068 // TODO: A lot of the values calculated here can be calculated once and saved when the laser is created, 2069 2069 // and then re-used here 2070 2071 mat4 new_model_transform = translate(mat4(1.0f), translation) * laser->model_transform;2072 2070 2073 2071 vec3 start = vec3(laser->model_transform * vec4(0.0f, 0.0f, 0.0f, 1.0f)); … … 2284 2282 */ 2285 2283 2286 stringstream ss;2287 ss << "FPS: " << fps;2288 2289 2284 { 2290 2285 ImGui::SetNextWindowSize(ImVec2(95, 46), ImGuiCond_Once); … … 2295 2290 ImGuiWindowFlags_NoMove); 2296 2291 ImGui::Text("Score: ???"); 2297 ImGui::Text( ss.str().c_str());2292 ImGui::Text("FPS: %f", fps); 2298 2293 ImGui::End(); 2299 2294 }
Note:
See TracChangeset
for help on using the changeset viewer.