Ignore:
Timestamp:
07/15/13 02:48:06 (12 years ago)
Author:
epyon
Message:
  • unified naming of attributes in nv
  • predefined attribute bindings based on unified names
  • unified naming of attributes in all tests
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/cachebuf_test/nv_cachebuf_test.cc

    r152 r161  
    234234        nv::vertex_array* m_va;
    235235        unsigned int m_count;
    236         int m_coord_loc;
    237         int m_color_loc;
    238236};
    239237
     
    257255        {
    258256                m_program   = m_device->create_program( nv::slurp( "cachebuf.vert" ), nv::slurp( "cachebuf.frag" ) );
    259                 m_coord_loc = m_program->get_attribute("coord")->get_location();
    260                 m_color_loc = m_program->get_attribute("color")->get_location();
    261257                m_va        = m_device->create_vertex_array();
    262258
     
    270266                #endif
    271267
    272                 m_va->add_vertex_buffer( m_coord_loc, buffer, nv::INT,   2, 0, sizeof( vertex ), false );
    273                 m_va->add_vertex_buffer( m_color_loc, buffer, nv::FLOAT, 4, offset_of( &vertex::color ), sizeof( vertex ), false );
     268                m_va->add_vertex_buffer( nv::slot::POSITION, buffer, nv::INT,   2, 0, sizeof( vertex ), false );
     269                m_va->add_vertex_buffer( nv::slot::COLOR,    buffer, nv::FLOAT, 4, offset_of( &vertex::color ), sizeof( vertex ), false );
    274270        }
    275271        return true;
     
    281277        m_program->bind();
    282278        glm::mat4 projection = glm::ortho( 0.0f, 800.0f, 600.0f, 0.0f, -1.0f, 1.0f );
    283         m_program->set_uniform( "projection", glm::mat4(projection) );
     279        m_program->set_uniform( "nv_projection", glm::mat4(projection) );
    284280
    285281        while(!keypress)
     
    297293                        nv::vertex_buffer* buffer = (nv::vertex_buffer*)m_quad_cache->get_buffer();
    298294                        #endif
    299                         m_va->update_vertex_buffer( m_coord_loc, buffer, false );
    300                         m_va->update_vertex_buffer( m_color_loc, buffer, false );
     295                        m_va->update_vertex_buffer( nv::slot::POSITION, buffer, false );
     296                        m_va->update_vertex_buffer( nv::slot::COLOR,    buffer, false );
    301297                }
    302298
Note: See TracChangeset for help on using the changeset viewer.