Changeset de53394 in opengl-game for new-game.cpp
- Timestamp:
- Mar 22, 2019, 5:15:59 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- b05e2b5
- Parents:
- b220f78
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
rb220f78 rde53394 200 200 GLuint* texcoords_vbo, 201 201 GLuint* normals_vbo, 202 GLuint* time_vbo, 203 GLuint* velocity_vbo, 202 204 GLuint* ubo, 203 205 GLuint* model_mat_idx_vbo); … … 210 212 GLuint texcoords_vbo, 211 213 GLuint normals_vbo, 214 GLuint time_vbo, 215 GLuint velocity_vbo, 212 216 GLuint ubo, 213 217 GLuint model_mat_idx_vbo); … … 482 486 GLfloat curTime, prevTime, elapsedTime; 483 487 484 GLuint points_vbo, colors_vbo, texcoords_vbo, normals_vbo, ubo, model_mat_idx_vbo; 488 GLuint 489 points_vbo, 490 colors_vbo, 491 texcoords_vbo, 492 normals_vbo, 493 time_vbo, 494 velocity_vbo, 495 ubo, 496 model_mat_idx_vbo; 485 497 486 498 initializeBuffers( … … 489 501 &texcoords_vbo, 490 502 &normals_vbo, 503 &time_vbo, 504 &velocity_vbo, 491 505 &ubo, 492 506 &model_mat_idx_vbo); … … 625 639 initModelGroupAttribs(modelGroups[TYPE_EXPLOSION]); 626 640 641 glBindBuffer(GL_ARRAY_BUFFER, velocity_vbo); 642 glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL); 643 644 glBindBuffer(GL_ARRAY_BUFFER, time_vbo); 645 glVertexAttribPointer(1, 1, GL_FLOAT, GL_FALSE, 0, NULL); 646 627 647 cam_pos = vec3(0.0f, 0.0f, 2.0f); 628 648 float cam_yaw = 0.0f * 2.0f * 3.14159f / 360.0f; … … 683 703 texcoords_vbo, 684 704 normals_vbo, 705 time_vbo, 706 velocity_vbo, 685 707 ubo, 686 708 model_mat_idx_vbo); … … 2115 2137 GLuint* texcoords_vbo, 2116 2138 GLuint* normals_vbo, 2139 GLuint* time_vbo, 2140 GLuint* velocity_vbo, 2117 2141 GLuint* ubo, 2118 2142 GLuint* model_mat_idx_vbo) { … … 2128 2152 *normals_vbo = 0; 2129 2153 glGenBuffers(1, normals_vbo); 2154 2155 *velocity_vbo = 0; 2156 glGenBuffers(1, velocity_vbo); 2157 2158 *time_vbo = 0; 2159 glGenBuffers(1, time_vbo); 2130 2160 2131 2161 *ubo = 0; … … 2143 2173 GLuint texcoords_vbo, 2144 2174 GLuint normals_vbo, 2175 GLuint time_vbo, 2176 GLuint velocity_vbo, 2145 2177 GLuint ubo, 2146 2178 GLuint model_mat_idx_vbo) { … … 2168 2200 bindUniformData(modelGroups[TYPE_EXPLOSION].attribs["model_mat"], value_ptr(model_mat)); 2169 2201 2170 GLuint velocity_vbo; 2171 glGenBuffers(1, &velocity_vbo); 2172 2173 GLuint time_vbo; 2174 glGenBuffers(1, &time_vbo); 2175 2176 glBindVertexArray(modelGroups[TYPE_EXPLOSION].vao); 2177 2178 // the glBufferData and glVertexAttribPointer need to stay here while the corresponding arrays 2202 // the glBufferData calls need to stay here while the corresponding arrays 2179 2203 // are local to this function. Once they're made part of the explosion object, I might be able 2180 2204 // to move this code out of here … … 2182 2206 glBindBuffer(GL_ARRAY_BUFFER, velocity_vbo); 2183 2207 glBufferData(GL_ARRAY_BUFFER, sizeof(vv), vv, GL_STATIC_DRAW); 2184 glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL);2185 2208 2186 2209 glBindBuffer(GL_ARRAY_BUFFER, time_vbo); 2187 2210 glBufferData(GL_ARRAY_BUFFER, sizeof(vt), vt, GL_STATIC_DRAW); 2188 glVertexAttribPointer(1, 1, GL_FLOAT, GL_FALSE, 0, NULL);2189 2211 2190 2212 objExplosion = createExplosion();
Note:
See TracChangeset
for help on using the changeset viewer.