Changeset 49 for trunk/src/gl/gl_texture2d.cc
- Timestamp:
- 05/28/13 22:19:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_texture2d.cc
r43 r49 10 10 using namespace nv; 11 11 12 nv::gl_texture2d::gl_texture2d( ivec2 size, format aformat, datatype adatatype, texture2d_samplersampler, void* data /*= nullptr */ )13 : texture2d( size, aformat, adatatype, sampler ), m_name()12 nv::gl_texture2d::gl_texture2d( ivec2 size, image_format aformat, type adatatype, sampler asampler, void* data /*= nullptr */ ) 13 : texture2d( size, aformat, adatatype, asampler ), m_name() 14 14 { 15 15 glBindTexture( GL_TEXTURE_2D, m_name.get_value() ); 16 16 17 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, nv:: texture_filter_to_enum( m_sampler.filter_min ) );18 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, nv:: texture_filter_to_enum( m_sampler.filter_max ) );19 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, nv:: texture_wrap_to_enum( m_sampler.wrap_s) );20 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, nv:: texture_wrap_to_enum( m_sampler.wrap_t) );17 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, nv::sampler_filter_to_enum( m_sampler.filter_min ) ); 18 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, nv::sampler_filter_to_enum( m_sampler.filter_max ) ); 19 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, nv::sampler_wrap_to_enum( m_sampler.wrap_s) ); 20 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, nv::sampler_wrap_to_enum( m_sampler.wrap_t) ); 21 21 22 22 glBindTexture( GL_TEXTURE_2D, 0 ); … … 31 31 { 32 32 glBindTexture( GL_TEXTURE_2D, m_name.get_value() ); 33 glTexImage2D( GL_TEXTURE_2D, 0, nv:: texture_format_to_enum(m_format), m_size.x, m_size.y, 0, nv::texture_format_to_enum(m_format), nv::texture_datatype_to_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::type_to_gl_enum(m_datatype), data ); 34 34 glBindTexture( GL_TEXTURE_2D, 0 ); 35 35 }
Note: See TracChangeset
for help on using the changeset viewer.