Changeset 70 for trunk/src


Ignore:
Timestamp:
06/01/13 00:24:07 (12 years ago)
Author:
epyon
Message:
  • etype -> datatype
  • types clarifications, and datatype_traits
Location:
trunk/src/gl
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gl/gl_device.cc

    r62 r70  
    6767}
    6868
    69 texture2d* gl_device::create_texture2d( ivec2 size, image_format aformat, etype adatatype, sampler asampler, void* data /*= nullptr */ )
     69texture2d* gl_device::create_texture2d( ivec2 size, image_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
    7070{
    7171        return new gl_texture2d( size, aformat, adatatype, asampler, data );
  • trunk/src/gl/gl_enum.cc

    r68 r70  
    185185}
    186186
    187 unsigned int nv::type_to_gl_enum( etype type )
     187unsigned int nv::datatype_to_gl_enum( datatype type )
    188188{
    189189        switch( type )
     
    213213}
    214214
    215 nv::etype nv::gl_enum_to_type( unsigned int gl_enum )
     215nv::datatype nv::gl_enum_to_datatype( unsigned int gl_enum )
    216216{
    217217        switch( gl_enum )
     
    233233        case GL_INT_VEC3       : return INT_VECTOR_3;
    234234        case GL_INT_VEC4       : return INT_VECTOR_4;
    235         default : return etype(0); // TODO: throw!
    236         }
    237 }
     235        default : return datatype(0); // TODO: throw!
     236        }
     237}
  • trunk/src/gl/gl_program.cc

    r62 r70  
    156156                int attr_loc = glGetAttribLocation( m_name.get_value(), name.c_str() );
    157157
    158                 m_attribute_map[ name ] = new attribute( name, attr_loc, gl_enum_to_type( attr_type ), attr_len );
     158                m_attribute_map[ name ] = new attribute( name, attr_loc, gl_enum_to_datatype( attr_type ), attr_len );
    159159        }
    160160}
     
    180180
    181181                int uni_loc = glGetUniformLocation( m_name.get_value(), name.c_str() );
    182                 etype utype = gl_enum_to_type( uni_type );
     182                datatype utype = gl_enum_to_datatype( uni_type );
    183183                m_uniform_map[ name ] = create_uniform( utype, name, uni_loc, uni_len );
    184184        }
  • trunk/src/gl/gl_texture2d.cc

    r62 r70  
    1010using namespace nv;
    1111
    12 nv::gl_texture2d::gl_texture2d( ivec2 size, image_format aformat, etype adatatype, sampler asampler, void* data /*= nullptr */ )
     12nv::gl_texture2d::gl_texture2d( ivec2 size, image_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
    1313        : texture2d( size, aformat, adatatype, asampler ), m_name()
    1414{
     
    3131{
    3232        glBindTexture( GL_TEXTURE_2D, m_name.get_value() );
    33         glTexImage2D( GL_TEXTURE_2D, 0, nv::image_format_to_enum(m_format), m_size.x, m_size.y, 0, nv::image_format_to_enum(m_format), nv::type_to_gl_enum(m_datatype), data );
     33        glTexImage2D( GL_TEXTURE_2D, 0, nv::image_format_to_enum(m_format), m_size.x, m_size.y, 0, nv::image_format_to_enum(m_format), nv::datatype_to_gl_enum(m_datatype), data );
    3434        glBindTexture( GL_TEXTURE_2D, 0 );
    3535}
  • trunk/src/gl/gl_vertex_buffer.cc

    r44 r70  
    8989                        location,
    9090                        va->get_components(),
    91                         nv::type_to_gl_enum( va->get_datatype() ),
     91                        nv::datatype_to_gl_enum( va->get_datatype() ),
    9292                        GL_FALSE,
    9393                        va->get_stride(),
Note: See TracChangeset for help on using the changeset viewer.