Index: trunk/nv/gl/gl_context.hh
===================================================================
--- trunk/nv/gl/gl_context.hh	(revision 534)
+++ trunk/nv/gl/gl_context.hh	(revision 535)
@@ -42,10 +42,10 @@
 		virtual void release( vertex_array va );
 		virtual void release( framebuffer f );
-		virtual image_data* dump_image( image_format f, image_data* reuse );
+		virtual image_data* dump_image( pixel_format f, image_data* reuse );
 		virtual const framebuffer_info* get_framebuffer_info( framebuffer f ) const;
 
 		using context::create_texture;
-		virtual texture create_texture( texture_type type, ivec2 size, image_format aformat, sampler asampler, const void* data = nullptr );
-		virtual texture create_texture( texture_type type, ivec3 size, image_format aformat, sampler asampler, const void* data = nullptr );
+		virtual texture create_texture( texture_type type, ivec2 size, pixel_format aformat, sampler asampler, const void* data = nullptr );
+		virtual texture create_texture( texture_type type, ivec3 size, pixel_format aformat, sampler asampler, const void* data = nullptr );
 
 		virtual buffer create_buffer( buffer_type type, buffer_hint hint, uint32 size, const void* source = nullptr );
Index: trunk/nv/image/png_loader.hh
===================================================================
--- trunk/nv/image/png_loader.hh	(revision 534)
+++ trunk/nv/image/png_loader.hh	(revision 535)
@@ -20,8 +20,8 @@
 	public:
 		png_loader();
-		virtual bool get_info( stream&, image_format& format, ivec2& size );
+		virtual bool get_info( stream&, pixel_format& format, ivec2& size );
 		virtual bool test( stream& );
 		virtual image_data* load( stream& );
-		virtual image_data* load( stream&, image_format format );
+		virtual image_data* load( stream&, pixel_format format );
 	};
 
Index: trunk/nv/interface/context.hh
===================================================================
--- trunk/nv/interface/context.hh	(revision 534)
+++ trunk/nv/interface/context.hh	(revision 535)
@@ -160,11 +160,12 @@
 		virtual void release( buffer b ) { m_device->release( b ); }
 
-		virtual image_data* dump_image( image_format f, image_data* reuse ) = 0;
-
-		virtual texture create_texture( texture_type type, ivec2 size, image_format aformat, sampler asampler, const void* data = nullptr ) = 0;
-		virtual texture create_texture( texture_type type, ivec3 size, image_format aformat, sampler asampler, const void* data = nullptr ) = 0;
+		virtual image_data* dump_image( pixel_format f, image_data* reuse ) = 0;
+
+
+		virtual texture create_texture( texture_type type, ivec2 size, pixel_format aformat, sampler asampler, const void* data = nullptr ) = 0;
+		virtual texture create_texture( texture_type type, ivec3 size, pixel_format aformat, sampler asampler, const void* data = nullptr ) = 0;
 		virtual texture create_texture( texture_type type, pixel_format format ) { return m_device->create_texture( type, format ); }
 		// TODO: remove?
-		texture create_texture( ivec2 size, image_format aformat, sampler asampler, const void* data = nullptr )
+		texture create_texture( ivec2 size, pixel_format aformat, sampler asampler, const void* data = nullptr )
 		{ 
 			return create_texture( TEXTURE_2D, size, aformat, asampler, data );
Index: trunk/nv/interface/device.hh
===================================================================
--- trunk/nv/interface/device.hh	(revision 534)
+++ trunk/nv/interface/device.hh	(revision 535)
@@ -173,5 +173,5 @@
 		texture_type type;
 		ivec3        size;
-		image_format format;
+		pixel_format format;
 		sampler      tsampler;
 	};
Index: trunk/nv/interface/image_data.hh
===================================================================
--- trunk/nv/interface/image_data.hh	(revision 534)
+++ trunk/nv/interface/image_data.hh	(revision 535)
@@ -20,15 +20,16 @@
 namespace nv
 {
-	enum pixel_format
+
+	enum pixel_format : uint8
 	{
-		RGB,
-		RGBA,
+		RGB8,
+		RGBA8,
+		BGR8,
+		BGRA8,
+		R8,
+		RGB16F,
+		RGBA16F,
 		RGB32F,
 		RGBA32F,
-		RGB16F,
-		RGBA16F,
-		BGR,
-		BGRA,
-		RED,
 		R16F,
 		R32F,
@@ -48,19 +49,50 @@
 		RGBA32I,
 		RGBA32UI,
+		PIXEL_FORMAT_COUNT,
 	};
-	
-	struct image_format
+
+	struct pixel_format_info
 	{
-		pixel_format format;
-		datatype     type;
+		datatype type;
+		uint32   elements;
+	};
 
-		image_format( pixel_format f = RGB, datatype d = UBYTE ) 
-			: format( f ), type( d )  {}
-	};
+	inline const pixel_format_info& get_pixel_format_info( pixel_format dt )
+	{
+		static pixel_format_info info[PIXEL_FORMAT_COUNT] = {
+			{ UBYTE, 3 }, // RGB8,
+			{ UBYTE, 4 }, // RGBA8,
+			{ UBYTE, 3 }, // BGR8  
+			{ UBYTE, 4 }, // BGRA8,
+			{ UBYTE, 1 }, // R8,
+			{ FLOAT, 3 }, // RGB16F, 
+			{ FLOAT, 4 }, // RGBA16F, // HALF-FLOAT
+			{ FLOAT, 3 }, // RGB32F,
+			{ FLOAT, 4 }, // RGBA32F,
+			{ FLOAT, 1 }, // R16F  // HALF-FLOAT
+			{ FLOAT, 1 }, // R32F,
+			{ USHORT,1 }, // DEPTH16,
+			{ UINT,  1 }, // DEPTH24,
+			{ UINT,  1 }, // DEPTH32,
+			{ BYTE,  1 }, // R8I,
+			{ UBYTE, 1 }, // R8UI,
+			{ SHORT, 1 }, // R16I,
+			{ USHORT,1 }, // R16UI,
+			{ INT,   1 }, // R32I,
+			{ UINT,  1 }, // R32UI,
+			{ BYTE,  4 }, // RGBA8I,
+			{ UBYTE, 4 }, // RGBA8UI,
+			{ SHORT, 4 }, // RGBA16I,
+			{ USHORT,4 }, // RGBA16UI,
+			{ INT,   4 }, // RGBA32I,
+			{ UINT,  4 }, // RGBA32UI,
+		};
+		return info[dt];
+	}
 
 	class image_data
 	{
 	public:
-		image_data( image_format format, ivec2 size, const uint8 * data ) 
+		image_data( pixel_format format, ivec2 size, const uint8 * data ) 
 			: m_format( format ), m_size( size ), m_data( nullptr )
 		{
@@ -68,5 +100,5 @@
 			initialize( data );
 		}
-		image_data( image_format format, ivec2 size )
+		image_data( pixel_format format, ivec2 size )
 			: m_format( format ), m_size( size ), m_data( nullptr )
 		{
@@ -81,7 +113,13 @@
 		const uint8 * get_data()    const { return m_data; }
 		const ivec2 get_size() const { return m_size; }
-		// TODO : better depth check (template?)
-		uint32 get_depth() const { return m_format.format == RGB || m_format.format == BGR ? 3 : ( m_format.format == RED || m_format.format == R32F || m_format.format == R16F ? 1 : 4 ); }
-		image_format get_format() const { return m_format; }
+		uint32 get_depth() const
+		{
+			return get_pixel_format_info( m_format ).elements;
+		}
+		datatype get_type() const
+		{
+			return get_pixel_format_info( m_format ).type;
+		}
+		pixel_format get_format() const { return m_format; }
 		~image_data() {	if (m_data) delete[] m_data; }
 	private:
@@ -94,5 +132,5 @@
 		}
 
-		image_format m_format;
+		pixel_format m_format;
 		ivec2  m_size;  //!< Defines the size of the image as a vector
 		uint8* m_data;  //!< Holder for data
Index: trunk/nv/interface/image_loader.hh
===================================================================
--- trunk/nv/interface/image_loader.hh	(revision 534)
+++ trunk/nv/interface/image_loader.hh	(revision 535)
@@ -24,8 +24,8 @@
 	{
 	public:
-		virtual bool get_info( stream&, image_format& format, ivec2& size ) = 0;
+		virtual bool get_info( stream&, pixel_format& format, ivec2& size ) = 0;
 		virtual bool test( stream& ) = 0;
 		virtual image_data* load( stream& ) = 0;
-		virtual image_data* load( stream&, image_format format ) = 0;
+		virtual image_data* load( stream&, pixel_format format ) = 0;
 		virtual ~image_loader() {}
 	};
Index: trunk/nv/stl/math.hh
===================================================================
--- trunk/nv/stl/math.hh	(revision 534)
+++ trunk/nv/stl/math.hh	(revision 535)
@@ -136,12 +136,12 @@
 	template < datatype EnumType > struct enum_to_type {};
 
-	template <> struct enum_to_type< NONE >  { typedef void type; };
-	template <> struct enum_to_type< INT >   { typedef int type; };
-	template <> struct enum_to_type< UINT >  { typedef unsigned int type; };
-	template <> struct enum_to_type< SHORT > { typedef short type; };
-	template <> struct enum_to_type< USHORT >{ typedef unsigned short type; };
-	template <> struct enum_to_type< BYTE >  { typedef char type; };
-	template <> struct enum_to_type< UBYTE > { typedef unsigned char type; };
-	template <> struct enum_to_type< FLOAT > { typedef f32 type; };
+	template <> struct enum_to_type< NONE >   { typedef void type; };
+	template <> struct enum_to_type< INT >    { typedef int type; };
+	template <> struct enum_to_type< UINT >   { typedef unsigned int type; };
+	template <> struct enum_to_type< SHORT >  { typedef short type; };
+	template <> struct enum_to_type< USHORT > { typedef unsigned short type; };
+	template <> struct enum_to_type< BYTE >   { typedef char type; };
+	template <> struct enum_to_type< UBYTE >  { typedef unsigned char type; };
+	template <> struct enum_to_type< FLOAT >  { typedef f32 type; };
 
 	template <> struct enum_to_type< FLOAT_VECTOR_2 > { typedef vec2 type; };
Index: trunk/src/engine/material_manager.cc
===================================================================
--- trunk/src/engine/material_manager.cc	(revision 534)
+++ trunk/src/engine/material_manager.cc	(revision 535)
@@ -19,5 +19,5 @@
 	uint8 data[2 * 2 * 4];
 	nv::raw_fill_n( data, 2 * 2 * 4, 0 );
-	m_default = m_context->create_texture( ivec2(2,2), nv::image_format( nv::RGBA ), nv::sampler(), data );
+	m_default = m_context->create_texture( ivec2(2,2), nv::RGBA8, nv::sampler(), data );
 }
 
Index: trunk/src/engine/shadow.cc
===================================================================
--- trunk/src/engine/shadow.cc	(revision 534)
+++ trunk/src/engine/shadow.cc	(revision 535)
@@ -12,5 +12,5 @@
 {
 	m_map_size = map_size;
-	m_maps = context->create_texture( TEXTURE_2D_ARRAY, ivec3( map_size, map_size, count ), image_format( DEPTH24, UINT ), sampler( sampler::LINEAR, sampler::CLAMP_TO_EDGE ), nullptr );
+	m_maps = context->create_texture( TEXTURE_2D_ARRAY, ivec3( map_size, map_size, count ), DEPTH24, sampler( sampler::LINEAR, sampler::CLAMP_TO_EDGE ), nullptr );
 	m_passes.resize( count );
 	for ( uint32 i = 0; i < count; ++i )
@@ -32,5 +32,5 @@
 void nv::shadow_data::initialize( context* context, uint32 count, uint32 map_size, const render_pass& pass_base, const render_pass& color_base )
 {
-	m_color_maps = context->create_texture( TEXTURE_2D_ARRAY, ivec3( map_size, map_size, count ), image_format( RGBA16F, FLOAT ), sampler( sampler::LINEAR, sampler::CLAMP_TO_EDGE ), nullptr );
+	m_color_maps = context->create_texture( TEXTURE_2D_ARRAY, ivec3( map_size, map_size, count ), RGBA16F, sampler( sampler::LINEAR, sampler::CLAMP_TO_EDGE ), nullptr );
 
 	initialize( context, count, map_size, pass_base );
Index: trunk/src/gl/gl_context.cc
===================================================================
--- trunk/src/gl/gl_context.cc	(revision 534)
+++ trunk/src/gl/gl_context.cc	(revision 535)
@@ -126,12 +126,12 @@
 }
 
-nv::image_data* nv::gl_context::dump_image( image_format f, image_data* reuse )
-{
-	NV_ASSERT_ALWAYS( f.type   == nv::UBYTE, "Bad format passed to dump" );
-	NV_ASSERT_ALWAYS( f.format == nv::RGB || f.format == nv::RGBA, "Bad format passed to dump" );
+nv::image_data* nv::gl_context::dump_image( pixel_format format, image_data* reuse )
+{
+	NV_ASSERT_ALWAYS( format == nv::RGB8 || format == nv::RGBA8, "Bad format passed to dump" );
 	glPixelStorei( GL_PACK_ALIGNMENT, 1 );
 	image_data* result = reuse;
-	if ( !result ) result = new image_data( f, ivec2( m_viewport.z, m_viewport.w ) );
-	glReadPixels( 0, 0, m_viewport.z, m_viewport.w, f.format == nv::RGB ? GL_RGB : GL_RGBA, datatype_to_gl_enum( f.type ), const_cast< uint8* >( result->get_data() ) );
+	datatype type = get_pixel_format_info( format ).type;
+	if ( !result ) result = new image_data( format, ivec2( m_viewport.z, m_viewport.w ) );
+	glReadPixels( 0, 0, m_viewport.z, m_viewport.w, format == nv::RGB8 ? GL_RGB : GL_RGBA, datatype_to_gl_enum( type ), const_cast< uint8* >( result->get_data() ) );
 	return result;
 }
@@ -307,5 +307,5 @@
 		NV_ASSERT_ALWAYS( binfo->type == TEXTURE_BUFFER && tinfo->type == TEXTURE_1D_BUFFER, "bad texture or buffer type!" );
 		bind( t, TEXTURE_0 );
-		glTexBuffer( GL_TEXTURE_BUFFER, image_format_to_internal_enum( tinfo->format.format ), binfo->glid );
+		glTexBuffer( GL_TEXTURE_BUFFER, image_format_to_internal_enum( tinfo->format ), binfo->glid );
 	}
 }
@@ -451,5 +451,6 @@
 	if ( info )
 	{
-		image_format format  = info->format;
+		pixel_format format  = info->format;
+		datatype     type    = get_pixel_format_info( format ).type;
 		ivec3        size    = info->size;
 		unsigned     gl_type = texture_type_to_enum( info->type );
@@ -457,9 +458,9 @@
 		bind( t, texture_slot::TEXTURE_0 );
 		if ( info->type == TEXTURE_3D || info->type == TEXTURE_2D_ARRAY )
-//			glTexImage3D( gl_type, 0, static_cast<GLint>( nv::image_format_to_internal_enum( format.format ) ), size.x, size.y, size.z, 0, nv::image_format_to_enum( format.format ), nv::datatype_to_gl_enum( format.type ), data );
-			glTexSubImage3D( gl_type, 0, 0, 0, 0, size.x, size.y, size.z, nv::image_format_to_enum( format.format ), nv::datatype_to_gl_enum( format.type ), data );
+//			glTexImage3D( gl_type, 0, static_cast<GLint>( nv::image_format_to_internal_enum( format ) ), size.x, size.y, size.z, 0, nv::image_format_to_enum( format ), nv::datatype_to_gl_enum( type ), data );
+			glTexSubImage3D( gl_type, 0, 0, 0, 0, size.x, size.y, size.z, nv::image_format_to_enum( format ), nv::datatype_to_gl_enum( type ), data );
 		else
-//			glTexImage2D( gl_type, 0, static_cast<GLint>( nv::image_format_to_internal_enum(format.format) ), size.x, size.y, 0, nv::image_format_to_enum(format.format), nv::datatype_to_gl_enum(format.type), data );
-			glTexSubImage2D( gl_type, 0, 0, 0, size.x, size.y, nv::image_format_to_enum( format.format ), nv::datatype_to_gl_enum( format.type ), data );
+//			glTexImage2D( gl_type, 0, static_cast<GLint>( nv::image_format_to_internal_enum(format) ), size.x, size.y, 0, nv::image_format_to_enum(format), nv::datatype_to_gl_enum(type), data );
+			glTexSubImage2D( gl_type, 0, 0, 0, size.x, size.y, nv::image_format_to_enum( format ), nv::datatype_to_gl_enum( type ), data );
 	}
 }
@@ -898,15 +899,15 @@
 }
 
-nv::texture nv::gl_context::create_texture( texture_type type, ivec2 size, image_format aformat, sampler asampler, const void* data /*= nullptr */ )
-{
-	texture result = create_texture( type, aformat.format );
+nv::texture nv::gl_context::create_texture( texture_type type, ivec2 size, pixel_format aformat, sampler asampler, const void* data /*= nullptr */ )
+{
+	texture result = create_texture( type, aformat );
 	gl_texture_info* info = static_cast<gl_device*>( m_device )->get_full_texture_info( result );
 	bind( result, texture_slot::TEXTURE_0 );
 	unsigned glid = info->glid;
 	unsigned gl_type = texture_type_to_enum( type );
-	GLenum gl_internal = GLenum( image_format_to_internal_enum( aformat.format ) );
-	unsigned gl_enum = image_format_to_enum( aformat.format );
-
-	bool is_depth = aformat.format == DEPTH16 || aformat.format == DEPTH24 || aformat.format == DEPTH32;
+	GLenum gl_internal = GLenum( image_format_to_internal_enum( aformat ) );
+	unsigned gl_enum = image_format_to_enum( aformat );
+
+	bool is_depth = aformat == DEPTH16 || aformat == DEPTH24 || aformat == DEPTH32;
 
 	// Detect if mipmapping was requested
@@ -953,5 +954,5 @@
 
 	if ( gl_type != GL_TEXTURE_2D_MULTISAMPLE )
-		glTexImage2D( gl_type, 0, gl_internal, size.x, size.y, 0, gl_enum, nv::datatype_to_gl_enum( aformat.type ), data );
+		glTexImage2D( gl_type, 0, gl_internal, size.x, size.y, 0, gl_enum, nv::datatype_to_gl_enum( get_pixel_format_info( aformat ).type ), data );
 	else
 		glTexImage2DMultisample( gl_type, 4, gl_internal, size.x, size.y, 1 );
@@ -974,7 +975,7 @@
 }
 
-nv::texture nv::gl_context::create_texture( texture_type type, ivec3 size, image_format aformat, sampler asampler, const void* data /*= nullptr */ )
-{
-	texture result = create_texture( type, aformat.format );
+nv::texture nv::gl_context::create_texture( texture_type type, ivec3 size, pixel_format aformat, sampler asampler, const void* data /*= nullptr */ )
+{
+	texture result = create_texture( type, aformat );
 	gl_texture_info* info = static_cast<gl_device*>( m_device )->get_full_texture_info( result );
 	bind( result, texture_slot::TEXTURE_0 );
@@ -983,5 +984,5 @@
 	unsigned gl_type = texture_type_to_enum( type );
 
-	bool is_depth = aformat.format == DEPTH16 || aformat.format == DEPTH24 || aformat.format == DEPTH32;
+	bool is_depth = aformat == DEPTH16 || aformat == DEPTH24 || aformat == DEPTH32;
 
 	if ( asampler.filter_max != sampler::NEAREST )
@@ -1007,5 +1008,5 @@
 
 	//glTexStorage3D( GL_TEXTURE_2D_ARRAY, mipLevelCount, GL_RGBA8, width, height, layerCount );
-	glTexImage3D( gl_type, 0, GLint( nv::image_format_to_internal_enum( aformat.format ) ), size.x, size.y, size.z, 0, nv::image_format_to_enum( aformat.format ), nv::datatype_to_gl_enum( aformat.type ), data );
+	glTexImage3D( gl_type, 0, GLint( nv::image_format_to_internal_enum( aformat ) ), size.x, size.y, size.z, 0, nv::image_format_to_enum( aformat ), nv::datatype_to_gl_enum( get_pixel_format_info( aformat ).type ), data );
 
 	bind( texture(), texture_slot::TEXTURE_0 );
Index: trunk/src/gl/gl_device.cc
===================================================================
--- trunk/src/gl/gl_device.cc	(revision 534)
+++ trunk/src/gl/gl_device.cc	(revision 535)
@@ -36,14 +36,13 @@
 	}
 	// TODO: BGR vs RGB, single channel
-	pixel_format pformat = RGBA;
+	pixel_format pformat = RGBA8;
 	switch ( image->format->BytesPerPixel )
 	{
-	case 4: pformat = RGBA; break;
-	case 3: pformat = RGB; break;
-	case 1: pformat = RED; break;
+	case 4: pformat = RGBA8; break;
+	case 3: pformat = RGB8; break;
+	case 1: pformat = R8; break;
 	default: NV_ASSERT( false, "BytesPerPixel != 4,3 or 1!" );
 	}
-	image_format format( pformat, UBYTE );
-	image_data* data = new image_data( format, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) );
+	image_data* data = new image_data( pformat, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) );
 	return data;
 }
@@ -62,5 +61,5 @@
 	// TODO: BGR vs RGB, single channel
 	NV_ASSERT( image->format->BytesPerPixel > 2, "bytes per pixel > 2!" );
-	image_format format( image->format->BytesPerPixel == 3 ? RGB : RGBA, UBYTE );
+	pixel_format format( image->format->BytesPerPixel == 3 ? RGB8 : RGBA8 );
 	image_data* idata = new image_data( format, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) );
 	return idata;
Index: trunk/src/gl/gl_enum.cc
===================================================================
--- trunk/src/gl/gl_enum.cc	(revision 534)
+++ trunk/src/gl/gl_enum.cc	(revision 535)
@@ -182,13 +182,13 @@
 	switch( format )
 	{
-	case RGB     : return GL_RGB;
-	case RGBA    : return GL_RGBA;
+	case RGB8    : return GL_RGB;
+	case RGBA8   : return GL_RGBA;
+	case R8      : return GL_RED;
 	case RGB32F  : return GL_RGB;
 	case RGBA32F : return GL_RGBA;
 	case RGB16F  : return GL_RGB;
 	case RGBA16F : return GL_RGBA;
-	case BGR     : return GL_BGR;
-	case BGRA    : return GL_BGRA;
-	case RED     : return GL_RED;
+	case BGR8    : return GL_BGR;
+	case BGRA8   : return GL_BGRA;
 	case R16F    : return GL_RED;
 	case R32F    : return GL_RED;
@@ -202,10 +202,10 @@
 	case R32I    : return GL_RED_INTEGER;
 	case R32UI   : return GL_RED_INTEGER;
-	case RGBA8I  : return GL_RGBA;
-	case RGBA8UI : return GL_RGBA;
-	case RGBA16I : return GL_RGBA;
-	case RGBA16UI: return GL_RGBA;
-	case RGBA32I : return GL_RGBA;
-	case RGBA32UI: return GL_RGBA;
+	case RGBA8I  : return GL_RGBA_INTEGER;
+	case RGBA8UI : return GL_RGBA_INTEGER;
+	case RGBA16I : return GL_RGBA_INTEGER;
+	case RGBA16UI: return GL_RGBA_INTEGER;
+	case RGBA32I : return GL_RGBA_INTEGER;
+	case RGBA32UI: return GL_RGBA_INTEGER;
 	NV_RETURN_COVERED_DEFAULT( 0 );
 	}
@@ -216,18 +216,18 @@
 	switch( format )
 	{
-	case RGB     : return GL_RGB8;
-	case RGBA    : return GL_RGBA8;
+	case RGB8    : return GL_RGB8;
+	case RGBA8   : return GL_RGBA8;
+	case R8      : return GL_R8;
 	case RGB32F  : return GL_RGB32F;
 	case RGBA32F : return GL_RGBA32F;
 	case RGB16F  : return GL_RGBA16F;
 	case RGBA16F : return GL_RGBA16F;
-	case BGR     : return GL_RGB8;
-	case BGRA    : return GL_RGBA8;
-	case RED     : return GL_R8;
+	case BGR8    : return GL_RGB8;
+	case BGRA8   : return GL_RGBA8;
 	case R16F    : return GL_R16F;
 	case R32F    : return GL_R32F;
 	case DEPTH16 : return GL_DEPTH_COMPONENT16;
 	case DEPTH24 : return GL_DEPTH_COMPONENT24;
-	case DEPTH32:  return GL_DEPTH_COMPONENT32;
+	case DEPTH32 :  return GL_DEPTH_COMPONENT32;
 	case R8I     : return GL_R8I;
 	case R8UI    : return GL_R8UI;
Index: trunk/src/gui/gui_gfx_renderer.cc
===================================================================
--- trunk/src/gui/gui_gfx_renderer.cc	(revision 534)
+++ trunk/src/gui/gui_gfx_renderer.cc	(revision 535)
@@ -166,5 +166,5 @@
 
 	nv::sampler sampler( nv::sampler::LINEAR, nv::sampler::CLAMP_TO_EDGE );
-	sr->tex = m_window->get_context()->create_texture( m_atlas.get_size(), image_format( nv::RGBA, nv::UBYTE ), sampler, nullptr );
+	sr->tex = m_window->get_context()->create_texture( m_atlas.get_size(), nv::RGBA8, sampler, nullptr );
 
 	m_render_state.depth_test.enabled = false;
Index: trunk/src/image/png_loader.cc
===================================================================
--- trunk/src/image/png_loader.cc	(revision 534)
+++ trunk/src/image/png_loader.cc	(revision 535)
@@ -1015,5 +1015,5 @@
 png_loader::png_loader() {}
 
-bool nv::png_loader::get_info( stream& str, image_format& format, ivec2& size )
+bool nv::png_loader::get_info( stream& str, pixel_format& format, ivec2& size )
 {
 	size_t pos = str.tell();
@@ -1024,11 +1024,10 @@
 	{
 		str.seek( (long)pos, origin::SET );
-		format.type = UBYTE;
 		switch ( comp )
 		{
 		case 0: return false;
-		case 1: format.format = RED; break;
-		case 3: format.format = RGB; break;
-		case 4: format.format = RGBA; break;
+		case 1: format = R8; break;
+		case 3: format = RGB8; break;
+		case 4: format = RGBA8; break;
 		default: return false;
 		}
@@ -1057,12 +1056,11 @@
 		// need to 'unget' all the characters in the IO buffer
 		s.seek( -ctx.remaining(), origin::CUR );
-		image_format format;
+		pixel_format format;
 		ivec2 size;
-		format.type = UBYTE;
 		switch ( comp )
 		{
-		case 1: format.format = RED; break;
-		case 3: format.format = RGB; break;
-		case 4: format.format = RGBA; break;
+		case 1: format = R8; break;
+		case 3: format = RGB8; break;
+		case 4: format = RGBA8; break;
 		default: return nullptr;
 		}
@@ -1073,13 +1071,12 @@
 }
 
-image_data* nv::png_loader::load( stream& s, image_format format )
-{
-	NV_ASSERT( format.type == UBYTE, "!" );
+image_data* nv::png_loader::load( stream& s, pixel_format format )
+{
 	int rcomp = 0;
-	switch ( format.format )
-	{
-	case RED: rcomp = 1; break;
-	case RGB: rcomp = 3; break;
-	case RGBA: rcomp = 4; break;
+	switch ( format )
+	{
+	case R8: rcomp = 1; break;
+	case RGB8: rcomp = 3; break;
+	case RGBA8: rcomp = 4; break;
 	default: NV_ASSERT( false, "bad format requested!" ); return nullptr;
 	}
@@ -1091,12 +1088,11 @@
 	{
 		s.seek( -ctx.remaining(), origin::CUR );
-		image_format fmt;
+		pixel_format fmt;
 		ivec2 sz;
-		fmt.type = UBYTE;
 		switch ( comp )
 		{
-		case 1: fmt.format = RED; break;
-		case 3: fmt.format = RGB; break;
-		case 4: fmt.format = RGBA; break;
+		case 1: fmt = R8; break;
+		case 3: fmt = RGB8; break;
+		case 4: fmt = RGBA8; break;
 		default: NV_ASSERT( false, "UNKNOWN RESULT!" );
 		}
