Changeset 3d96d13 in opengl-game
- Timestamp:
- Oct 24, 2018, 2:45:42 AM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- e1eec78
- Parents:
- 1e3dddf (diff), 446e55d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
r1e3dddf r3d96d13 265 265 glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); 266 266 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 267 #else 268 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); 269 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); 267 270 #endif 268 271 … … 270 273 GLFWmonitor* mon = NULL; 271 274 272 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);273 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);274 275 glfwWindowHint(GLFW_SAMPLES, 16); 275 276 glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, true); … … 300 301 glDebugMessageCallback((GLDEBUGPROC)debugGlCallback, nullptr); 301 302 cout << "Bound debug callback" << endl; 303 } else { 304 cout << "OpenGL debugg message callback is not supported" << endl; 302 305 } 303 306 … … 796 799 797 800 // this code moves the asteroids 798 for ( int i = 0; i < objects.size(); i++) {801 for (unsigned int i = 0; i < objects.size(); i++) { 799 802 if (objects[i]->type == TYPE_ASTEROID && !objects[i]->deleted) { 800 803 transformObject(*objects[i], translate(mat4(1.0f), vec3(0.0f, 0.0f, 0.04f)), ubo); … … 1244 1247 1245 1248 obj->normals.reserve(obj->points.size()); 1246 for ( int i = 0; i < obj->points.size(); i += 9) {1249 for (unsigned int i = 0; i < obj->points.size(); i += 9) { 1247 1250 vec3 point1 = vec3(obj->points[i], obj->points[i + 1], obj->points[i + 2]); 1248 1251 vec3 point2 = vec3(obj->points[i + 3], obj->points[i + 4], obj->points[i + 5]); … … 1332 1335 1333 1336 // start from the second point 1334 for ( int i = 3; i < obj->points.size(); i += 3) {1337 for (unsigned int i = 3; i < obj->points.size(); i += 3) { 1335 1338 if (min_x > obj->points[i]) { 1336 1339 min_x = obj->points[i]; … … 1369 1372 obj->bounding_radius = radius_z; 1370 1373 1371 for ( int i = 0; i < obj->points.size(); i += 3) {1374 for (unsigned int i = 0; i < obj->points.size(); i += 3) { 1372 1375 obj->points[i] -= obj->bounding_center.x; 1373 1376 obj->points[i + 1] -= obj->bounding_center.y; … … 2024 2027 2025 2028 glBindBuffer(GL_ARRAY_BUFFER, model_mat_idx_vbo); 2026 for ( int i = 0; i < obj.num_points; i++) {2029 for (unsigned int i = 0; i < obj.num_points; i++) { 2027 2030 glBufferSubData(GL_ARRAY_BUFFER, (obj.vertex_vbo_offset + i) * sizeof(GLuint), sizeof(GLuint), &obj.ubo_offset); 2028 2031 } … … 2070 2073 // TODO: A lot of the values calculated here can be calculated once and saved when the laser is created, 2071 2074 // and then re-used here 2072 2073 mat4 new_model_transform = translate(mat4(1.0f), translation) * laser->model_transform;2074 2075 2075 2076 vec3 start = vec3(laser->model_transform * vec4(0.0f, 0.0f, 0.0f, 1.0f)); … … 2297 2298 ImGuiWindowFlags_NoResize | 2298 2299 ImGuiWindowFlags_NoMove); 2300 <<<<<<< HEAD 2299 2301 ImGui::Text(ssScore.str().c_str()); 2300 2302 ImGui::Text(ssFps.str().c_str()); 2303 ======= 2304 ImGui::Text("Score: ???"); 2305 ImGui::Text("FPS: %f", fps); 2306 >>>>>>> 446e55df316c547047dc0eb5c46189c6958dba21 2301 2307 ImGui::End(); 2302 2308 }
Note:
See TracChangeset
for help on using the changeset viewer.