Index: trunk/src/gui/gui_renderer.cc
===================================================================
--- trunk/src/gui/gui_renderer.cc	(revision 301)
+++ trunk/src/gui/gui_renderer.cc	(revision 302)
@@ -21,36 +21,36 @@
 	{
 		set_color( color );
-		vtx[0].coord = coorda;
-		vtx[1].coord = nv::ivec2( coorda.x, coordb.y );
-		vtx[2].coord = coordb;
-		vtx[3].coord = coordb;
-		vtx[4].coord = nv::ivec2( coordb.x, coorda.y );
-		vtx[5].coord = coorda;
+		vtx[0].position = coorda;
+		vtx[1].position = nv::ivec2( coorda.x, coordb.y );
+		vtx[2].position = coordb;
+		vtx[3].position = coordb;
+		vtx[4].position = nv::ivec2( coordb.x, coorda.y );
+		vtx[5].position = coorda;
 	}
 	gui_quad( const nv::ivec2& coorda, const nv::ivec2& coordb, const nv::vec4& color, const nv::vec2& tcoorda, const nv::vec2& tcoordb )
 	{
 		set_color( color );
-		vtx[0].coord = coorda;
-		vtx[1].coord = nv::ivec2( coorda.x, coordb.y );
-		vtx[2].coord = coordb;
-		vtx[3].coord = coordb;
-		vtx[4].coord = nv::ivec2( coordb.x, coorda.y );
-		vtx[5].coord = coorda;
-		vtx[0].tcoord = tcoorda;
-		vtx[1].tcoord = nv::vec2( tcoorda.x, tcoordb.y );
-		vtx[2].tcoord = tcoordb;
-		vtx[3].tcoord = tcoordb;
-		vtx[4].tcoord = nv::vec2( tcoordb.x, tcoorda.y );
-		vtx[5].tcoord = tcoorda;
+		vtx[0].position = coorda;
+		vtx[1].position = nv::ivec2( coorda.x, coordb.y );
+		vtx[2].position = coordb;
+		vtx[3].position = coordb;
+		vtx[4].position = nv::ivec2( coordb.x, coorda.y );
+		vtx[5].position = coorda;
+		vtx[0].texcoord = tcoorda;
+		vtx[1].texcoord = nv::vec2( tcoorda.x, tcoordb.y );
+		vtx[2].texcoord = tcoordb;
+		vtx[3].texcoord = tcoordb;
+		vtx[4].texcoord = nv::vec2( tcoordb.x, tcoorda.y );
+		vtx[5].texcoord = tcoorda;
 	}
 	gui_quad( const nv::ivec2& coorda, const nv::ivec2& coordb, const nv::ivec2& coordc, const nv::ivec2& coordd, const nv::vec4& color )
 	{
 		set_color( color );
-		vtx[0].coord = coorda;
-		vtx[1].coord = coordb;
-		vtx[2].coord = coordc;
-		vtx[3].coord = coordc;
-		vtx[4].coord = coordd;
-		vtx[5].coord = coorda;
+		vtx[0].position = coorda;
+		vtx[1].position = coordb;
+		vtx[2].position = coordc;
+		vtx[3].position = coordc;
+		vtx[4].position = coordd;
+		vtx[5].position = coorda;
 	}
 	inline void set_color( const nv::vec4& color )
@@ -66,5 +66,5 @@
 public:
 	screen_render_data( context* actx, size_t initial_size )
-		: buffer( actx, nv::DYNAMIC_DRAW, initial_size ), varray( nullptr ), shader(nullptr)
+		: buffer( actx, VERTEX_BUFFER, DYNAMIC_DRAW, initial_size ), ctx( actx ), varray(), shader(nullptr)
 	{
 
@@ -73,10 +73,11 @@
 	{ 
 		delete shader; 
-		delete varray; 
+		ctx->get_device()->release( varray ); 
 	}
 
 	nv::sliced_buffer<gui_quad> buffer;
+	nv::context*      ctx;
 	nv::texture       tex;
-	nv::vertex_array* varray;
+	nv::vertex_array  varray;
 	nv::program*      shader;
 };
@@ -110,12 +111,10 @@
 	m_render_data = sr;
 	// ** EXTREMELY TEMPORARY!
-	sr->varray     = m_window->get_device()->create_vertex_array();
 	sr->shader     = m_window->get_device()->create_program( nv::slurp( shader_path + ".vert" ), nv::slurp( shader_path + ".frag" ) );
 	m_scene_state.get_camera().set_ortho( 0.0f, float( m_window->get_width() ), float( m_window->get_height() ), 0.0f );
 
-	vertex_buffer* vb = (vertex_buffer*)sr->buffer.get_buffer();
-	sr->varray->add_vertex_buffer( slot::POSITION, vb, nv::INT,   2, 0, sizeof( vertex ), false );
-	sr->varray->add_vertex_buffer( slot::TEXCOORD, vb, nv::FLOAT, 2, offset_of( &vertex::tcoord ), sizeof( vertex ), false );
-	sr->varray->add_vertex_buffer( slot::COLOR,    vb, nv::FLOAT, 4, offset_of( &vertex::color ), sizeof( vertex ), false );
+	sr->varray     = m_window->get_device()->create_vertex_array();
+	buffer vb      = sr->buffer.get_buffer();
+	m_window->get_device()->add_vertex_buffers< vertex >( sr->varray, vb );
 
 	nv::sampler sampler( nv::sampler::LINEAR, nv::sampler::CLAMP_TO_EDGE );
@@ -267,8 +266,6 @@
 	if ( sr->buffer.commit() )
 	{
-		nv::vertex_buffer* vb = (nv::vertex_buffer*)sr->buffer.get_buffer();
-		sr->varray->update_vertex_buffer( nv::slot::POSITION, vb, false );
-		sr->varray->update_vertex_buffer( nv::slot::TEXCOORD, vb, false );
-		sr->varray->update_vertex_buffer( nv::slot::COLOR,    vb, false );
+		buffer vb = sr->buffer.get_buffer();
+		m_context->get_device()->replace_vertex_buffer( sr->varray, vb, false );
 	}
 	m_context->bind( sr->tex, TEX_DIFFUSE );
@@ -284,5 +281,5 @@
 	if ( m_render_data )
 	{
-		m_context->get_device()->release_texture( ((screen_render_data*)m_render_data)->tex );
+		m_context->get_device()->release( ((screen_render_data*)m_render_data)->tex );
 		delete m_render_data;
 	}
