Changeset b05e2b5 in opengl-game for new-game.cpp


Ignore:
Timestamp:
Mar 22, 2019, 5:45:02 PM (6 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
a926b79
Parents:
de53394
Message:

Initialize the explosion shader vertex attributes using the new generic shader system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • new-game.cpp

    rde53394 rb05e2b5  
    200200                  GLuint* texcoords_vbo,
    201201                  GLuint* normals_vbo,
    202                   GLuint* time_vbo,
    203                   GLuint* velocity_vbo,
    204202                  GLuint* ubo,
    205203                  GLuint* model_mat_idx_vbo);
     
    212210                  GLuint texcoords_vbo,
    213211                  GLuint normals_vbo,
    214                   GLuint time_vbo,
    215                   GLuint velocity_vbo,
    216212                  GLuint ubo,
    217213                  GLuint model_mat_idx_vbo);
     
    491487    texcoords_vbo,
    492488    normals_vbo,
    493     time_vbo,
    494     velocity_vbo,
    495489    ubo,
    496490    model_mat_idx_vbo;
     
    501495      &texcoords_vbo,
    502496      &normals_vbo,
    503       &time_vbo,
    504       &velocity_vbo,
    505497      &ubo,
    506498      &model_mat_idx_vbo);
     
    635627   defineModelGroupUniform(modelGroups[TYPE_EXPLOSION], "proj", ATTRIB_UNIFORM,
    636628      1, UNIFORM_MATRIX_4F, value_ptr(proj_mat));
    637    // Still need to do the model mat
    638 
    639   initModelGroupAttribs(modelGroups[TYPE_EXPLOSION]);
    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);
     629
     630   initModelGroupAttribs(modelGroups[TYPE_EXPLOSION]);
    646631
    647632   cam_pos = vec3(0.0f, 0.0f, 2.0f);
     
    703688      texcoords_vbo,
    704689      normals_vbo,
    705       time_vbo,
    706       velocity_vbo,
    707690      ubo,
    708691      model_mat_idx_vbo);
     
    21372120                  GLuint* texcoords_vbo,
    21382121                  GLuint* normals_vbo,
    2139                   GLuint* time_vbo,
    2140                   GLuint* velocity_vbo,
    21412122                  GLuint* ubo,
    21422123                  GLuint* model_mat_idx_vbo) {
     
    21522133   *normals_vbo = 0;
    21532134   glGenBuffers(1, normals_vbo);
    2154 
    2155    *velocity_vbo = 0;
    2156    glGenBuffers(1, velocity_vbo);
    2157 
    2158    *time_vbo = 0;
    2159    glGenBuffers(1, time_vbo);
    21602135
    21612136   *ubo = 0;
     
    21732148                  GLuint texcoords_vbo,
    21742149                  GLuint normals_vbo,
    2175                   GLuint time_vbo,
    2176                   GLuint velocity_vbo,
    21772150                  GLuint ubo,
    21782151                  GLuint model_mat_idx_vbo) {
     
    22042177   // to move this code out of here
    22052178
    2206    glBindBuffer(GL_ARRAY_BUFFER, velocity_vbo);
     2179   glBindBuffer(GL_ARRAY_BUFFER, modelGroups[TYPE_EXPLOSION].attribs["v_i"].buffer);
    22072180   glBufferData(GL_ARRAY_BUFFER, sizeof(vv), vv, GL_STATIC_DRAW);
    22082181
    2209    glBindBuffer(GL_ARRAY_BUFFER, time_vbo);
     2182   glBindBuffer(GL_ARRAY_BUFFER, modelGroups[TYPE_EXPLOSION].attribs["start_time"].buffer);
    22102183   glBufferData(GL_ARRAY_BUFFER, sizeof(vt), vt, GL_STATIC_DRAW);
    22112184
Note: See TracChangeset for help on using the changeset viewer.