Index: trunk/src/gl/gl_device.cc
===================================================================
--- trunk/src/gl/gl_device.cc	(revision 246)
+++ trunk/src/gl/gl_device.cc	(revision 292)
@@ -81,9 +81,12 @@
 		return nullptr;
 	}
-	image_data* data = new image_data( glm::ivec2( image->w, image->h ), image->format->BytesPerPixel, (nv::uint8*)image->pixels );
+	// TODO: BGR vs RGB, single channel
+	assert( image->format->BytesPerPixel > 2 );
+	image_format format(image->format->BytesPerPixel == 3 ? RGB : RGBA, UBYTE );
+	image_data* data = new image_data( format, glm::ivec2( image->w, image->h ), (nv::uint8*)image->pixels );
 	return data;
 }
 
-texture2d* gl_device::create_texture2d( ivec2 size, image_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
+texture2d* gl_device::create_texture2d( ivec2 size, pixel_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
 {
 	return new gl_texture2d( size, aformat, adatatype, asampler, data );
Index: trunk/src/gl/gl_enum.cc
===================================================================
--- trunk/src/gl/gl_enum.cc	(revision 246)
+++ trunk/src/gl/gl_enum.cc	(revision 292)
@@ -147,5 +147,5 @@
 }
 
-unsigned int nv::image_format_to_enum( image_format format )
+unsigned int nv::image_format_to_enum( pixel_format format )
 {
 	switch( format )
Index: trunk/src/gl/gl_texture2d.cc
===================================================================
--- trunk/src/gl/gl_texture2d.cc	(revision 246)
+++ trunk/src/gl/gl_texture2d.cc	(revision 292)
@@ -10,5 +10,5 @@
 using namespace nv;
 
-nv::gl_texture2d::gl_texture2d( ivec2 size, image_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
+nv::gl_texture2d::gl_texture2d( ivec2 size, pixel_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
 	: texture2d( size, aformat, adatatype, asampler ), m_name()
 {
@@ -38,5 +38,5 @@
 {
 	glBindTexture( GL_TEXTURE_2D, m_name.get_value() );
-	glTexImage2D( GL_TEXTURE_2D, 0, (GLint)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 );
+	glTexImage2D( GL_TEXTURE_2D, 0, (GLint)nv::image_format_to_enum(m_format.format), m_size.x, m_size.y, 0, nv::image_format_to_enum(m_format.format), nv::datatype_to_gl_enum(m_format.type), data );
 	glBindTexture( GL_TEXTURE_2D, 0 );
 }
