Changeset 49 for trunk/src/gl/gl_enum.cc
- Timestamp:
- 05/28/13 22:19:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_enum.cc
r45 r49 134 134 } 135 135 136 unsigned int nv:: texture_format_to_enum( texture2d::format format )136 unsigned int nv::image_format_to_enum( image_format format ) 137 137 { 138 138 switch( format ) 139 139 { 140 case texture2d::RGB : return GL_RGB; 141 case texture2d::RGBA : return GL_RGBA; 142 default : return 0; // TODO: throw! 143 } 144 } 145 146 unsigned int nv::texture_datatype_to_enum( texture2d::datatype datatype ) 147 { 148 switch( datatype ) 149 { 150 case texture2d::UINT : return GL_UNSIGNED_INT; 151 case texture2d::UBYTE : return GL_UNSIGNED_BYTE; 152 case texture2d::FLOAT : return GL_FLOAT; 153 default : return 0; // TODO: throw! 154 } 155 } 156 157 unsigned int nv::texture_filter_to_enum( texture2d_sampler::filter filter ) 140 case RGB : return GL_RGB; 141 case RGBA : return GL_RGBA; 142 default : return 0; // TODO: throw! 143 } 144 } 145 146 unsigned int nv::sampler_filter_to_enum( sampler::filter filter ) 158 147 { 159 148 switch( filter ) 160 149 { 161 case texture2d_sampler::LINEAR : return GL_LINEAR;162 case texture2d_sampler::NEAREST : return GL_NEAREST;163 case texture2d_sampler::NEAREST_MIPMAP_NEAREST : return GL_NEAREST_MIPMAP_NEAREST;164 case texture2d_sampler::LINEAR_MIPMAP_NEAREST : return GL_LINEAR_MIPMAP_NEAREST;165 case texture2d_sampler::NEAREST_MIPMAP_LINEAR : return GL_NEAREST_MIPMAP_LINEAR;166 case texture2d_sampler::LINEAR_MIPMAP_LINEAR : return GL_LINEAR_MIPMAP_LINEAR;167 default : return 0; // TODO: throw! 168 } 169 } 170 171 unsigned int nv:: texture_wrap_to_enum( texture2d_sampler::wrap wrap )150 case sampler::LINEAR : return GL_LINEAR; 151 case sampler::NEAREST : return GL_NEAREST; 152 case sampler::NEAREST_MIPMAP_NEAREST : return GL_NEAREST_MIPMAP_NEAREST; 153 case sampler::LINEAR_MIPMAP_NEAREST : return GL_LINEAR_MIPMAP_NEAREST; 154 case sampler::NEAREST_MIPMAP_LINEAR : return GL_NEAREST_MIPMAP_LINEAR; 155 case sampler::LINEAR_MIPMAP_LINEAR : return GL_LINEAR_MIPMAP_LINEAR; 156 default : return 0; // TODO: throw! 157 } 158 } 159 160 unsigned int nv::sampler_wrap_to_enum( sampler::wrap wrap ) 172 161 { 173 162 switch( wrap ) 174 163 { 175 case texture2d_sampler::CLAMP_TO_EDGE : return GL_CLAMP_TO_EDGE;176 case texture2d_sampler::CLAMP_TO_BORDER : return GL_CLAMP_TO_BORDER;177 case texture2d_sampler::MIRRORED_REPEAT : return GL_MIRRORED_REPEAT;178 case texture2d_sampler::REPEAT : return GL_REPEAT;164 case sampler::CLAMP_TO_EDGE : return GL_CLAMP_TO_EDGE; 165 case sampler::CLAMP_TO_BORDER : return GL_CLAMP_TO_BORDER; 166 case sampler::MIRRORED_REPEAT : return GL_MIRRORED_REPEAT; 167 case sampler::REPEAT : return GL_REPEAT; 179 168 default : return 0; // TODO: throw! 180 169 }
Note: See TracChangeset
for help on using the changeset viewer.