Changeset fe5e3ca in opengl-game for new-game.cpp
- Timestamp:
- Jan 11, 2019, 4:10:11 PM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 646f3f2, c5fb958
- Parents:
- 8fbd34f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
r8fbd34f rfe5e3ca 157 157 GLuint* model_mat_idx_vbo); 158 158 159 GLuint initializeParticleEffectBuffers( );159 GLuint initializeParticleEffectBuffers(vec3 origin, mat4 proj, mat4 view, GLuint explosion_sp); 160 160 161 161 void populateBuffers(vector<SceneObject*>& objects, … … 565 565 glVertexAttribIPointer(2, 1, GL_UNSIGNED_INT, 0, 0); 566 566 567 GLuint explosion_vao = initializeParticleEffectBuffers();568 569 567 float cam_speed = 1.0f; 570 568 float cam_yaw_speed = 60.0f*ONE_DEG_IN_RAD; … … 598 596 }; 599 597 proj_mat = make_mat4(proj_arr); 598 599 GLuint explosion_vao = initializeParticleEffectBuffers(vec3(0.0f, -1.2f, 0.65f), proj_mat, view_mat, explosion_sp); 600 600 601 601 GLuint ub_binding_point = 0; … … 1912 1912 } 1913 1913 1914 GLuint initializeParticleEffectBuffers() { 1914 GLuint initializeParticleEffectBuffers(vec3 origin, mat4 proj, mat4 view, GLuint explosion_sp) { 1915 //unsigned int num_explosions = 1; 1916 1915 1917 float vv[EXPLOSION_PARTICLE_COUNT * 3]; // initial velocities vec3 1916 1918 float vt[EXPLOSION_PARTICLE_COUNT]; // initial times … … 1927 1929 vv[i*3 + 2] = 0.0f; 1928 1930 } 1931 1932 mat4 model_mat = translate(mat4(1.0f), origin); 1933 1934 glUseProgram(explosion_sp); 1935 1936 GLuint proj_mat_loc = glGetUniformLocation(explosion_sp, "proj"); 1937 GLuint view_mat_loc = glGetUniformLocation(explosion_sp, "view"); 1938 1939 glUniformMatrix4fv(proj_mat_loc, 1, GL_FALSE, value_ptr(proj)); 1940 glUniformMatrix4fv(view_mat_loc, 1, GL_FALSE, value_ptr(view)); 1941 1942 GLuint model_mat_loc = glGetUniformLocation(explosion_sp, "model_mat"); 1943 1944 glUniformMatrix4fv(model_mat_loc, 1, GL_FALSE, value_ptr(model_mat)); 1945 1946 /* 1947 GLuint model_ubo = 0; 1948 glGenBuffers(1, &model_ubo); 1949 1950 glBindBuffer(GL_UNIFORM_BUFFER, model_ubo); 1951 glBufferData(GL_UNIFORM_BUFFER, num_explosions * sizeof(mat4), NULL, GL_DYNAMIC_DRAW); 1952 1953 //glBindBuffer(GL_UNIFORM_BUFFER, ubo); 1954 glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(mat4), value_ptr(model_mat)); 1955 */ 1929 1956 1930 1957 GLuint velocity_vbo;
Note:
See TracChangeset
for help on using the changeset viewer.