Index: /trunk/nv/gfx/keyframed_mesh.hh
===================================================================
--- /trunk/nv/gfx/keyframed_mesh.hh	(revision 160)
+++ /trunk/nv/gfx/keyframed_mesh.hh	(revision 161)
@@ -33,7 +33,5 @@
 
 		int m_loc_next_position;
-		int m_loc_last_position;
 		int m_loc_next_normal;
-		int m_loc_last_normal;
 
 		uint32 m_last_frame;
Index: /trunk/nv/interface/program.hh
===================================================================
--- /trunk/nv/interface/program.hh	(revision 160)
+++ /trunk/nv/interface/program.hh	(revision 161)
@@ -22,4 +22,13 @@
 namespace nv
 {
+	enum slot
+	{
+		POSITION = 0,
+		TEXCOORD = 1,
+		NORMAL   = 2,
+		COLOR    = 3,
+		TANGENT  = 4,
+	};
+
 	class attribute
 	{
Index: /trunk/src/formats/md3_loader.cc
===================================================================
--- /trunk/src/formats/md3_loader.cc	(revision 160)
+++ /trunk/src/formats/md3_loader.cc	(revision 161)
@@ -313,7 +313,7 @@
 	}
 
-	vertex_attribute< vec3 >* position = m->add_attribute<vec3>("position");
-	vertex_attribute< vec3 >* normal   = m->add_attribute<vec3>("normal");
-	vertex_attribute< vec2 >* texcoord = m->add_attribute<vec2>("texcoord");
+	vertex_attribute< vec3 >* position = m->add_attribute<vec3>("nv_position");
+	vertex_attribute< vec3 >* normal   = m->add_attribute<vec3>("nv_normal");
+	vertex_attribute< vec2 >* texcoord = m->add_attribute<vec2>("nv_texcoord");
 	vertex_attribute< uint16 >* indices  = m->add_indices<uint16>();
 
Index: /trunk/src/formats/obj_loader.cc
===================================================================
--- /trunk/src/formats/obj_loader.cc	(revision 160)
+++ /trunk/src/formats/obj_loader.cc	(revision 161)
@@ -140,13 +140,13 @@
 	if ( m_position == nullptr )
 	{
-		m_position  = m_mesh->add_attribute< vec3 >( "position" );
+		m_position  = m_mesh->add_attribute< vec3 >( "nv_position" );
 	}
 	if ( m_tex_coord == nullptr )
 	{
-		m_tex_coord = m_mesh->add_attribute< vec2 >( "texcoord" );
+		m_tex_coord = m_mesh->add_attribute< vec2 >( "nv_texcoord" );
 	}
 	if ( m_normal == nullptr && ni != nullptr )
 	{
-		m_normal = m_mesh->add_attribute< vec3 >( "normal" );
+		m_normal = m_mesh->add_attribute< vec3 >( "nv_normal" );
 	}
 
@@ -174,5 +174,5 @@
 void mesh_obj_reader::calculate_tangents()
 {
-	m_tangent = m_mesh->add_attribute< vec4 >( "tangent" );
+	m_tangent = m_mesh->add_attribute< vec4 >( "nv_tangent" );
 
 	std::vector< vec3 >& vp = m_position->get();
Index: /trunk/src/gfx/keyframed_mesh.cc
===================================================================
--- /trunk/src/gfx/keyframed_mesh.cc	(revision 160)
+++ /trunk/src/gfx/keyframed_mesh.cc	(revision 161)
@@ -21,7 +21,5 @@
 	, m_va( nullptr )
 	, m_loc_next_position( 0 )
-	, m_loc_last_position( 0 )
 	, m_loc_next_normal( 0 )
-	, m_loc_last_normal( 0 )
 	, m_last_frame( 0 )
 	, m_next_frame( 0 )
@@ -37,19 +35,17 @@
 
 	nv::vertex_buffer* vb;
-	m_loc_next_position = m_program->get_attribute( "next_position" )->get_location();
-	m_loc_last_position = m_program->get_attribute( "last_position" )->get_location();
-	m_loc_next_normal   = m_program->get_attribute( "next_normal" )->get_location();
-	m_loc_last_normal   = m_program->get_attribute( "last_normal" )->get_location();
+	m_loc_next_position = m_program->get_attribute( "nv_next_position" )->get_location();
+	m_loc_next_normal   = m_program->get_attribute( "nv_next_normal" )->get_location();
 
 	vb = m_context->get_device()->create_vertex_buffer( nv::STATIC_DRAW, m_data->get_vertex_count() * sizeof( nv::vec3 ) * m_data->get_frame_count(), (void*)m_data->get_positions().data() );
 	m_va->add_vertex_buffer( m_loc_next_position, vb, nv::FLOAT, 3, 0, 0, false );
-	m_va->add_vertex_buffer( m_loc_last_position, vb, nv::FLOAT, 3 );
+	m_va->add_vertex_buffer( nv::POSITION, vb, nv::FLOAT, 3 );
 
 	vb = m_context->get_device()->create_vertex_buffer( nv::STATIC_DRAW, m_data->get_vertex_count() * sizeof( nv::vec3 ) * m_data->get_frame_count(), (void*)m_data->get_normals().data() );
 	m_va->add_vertex_buffer( m_loc_next_normal, vb, nv::FLOAT, 3, 0, 0, false );
-	m_va->add_vertex_buffer( m_loc_last_normal, vb, nv::FLOAT, 3 );
+	m_va->add_vertex_buffer( nv::NORMAL, vb, nv::FLOAT, 3 );
 
 	vb = m_context->get_device()->create_vertex_buffer( nv::STATIC_DRAW, m_data->get_vertex_count() * sizeof( nv::vec2 ), (void*)m_data->get_texcoords().data() );
-	m_va->add_vertex_buffer( m_program->get_attribute( "texcoord" )->get_location(), vb, nv::FLOAT, 2 );
+	m_va->add_vertex_buffer( nv::slot::TEXCOORD, vb, nv::FLOAT, 2 );
 	nv::index_buffer* ib = m_context->get_device()->create_index_buffer( nv::STATIC_DRAW, m_data->get_index_count() * sizeof( nv::uint16 ), (void*)m_data->get_indices().data() );
 	m_va->set_index_buffer( ib, nv::USHORT, true );
@@ -129,6 +125,6 @@
 	if ( m_gpu_last_frame != m_last_frame )
 	{
-		m_va->update_vertex_buffer( m_loc_last_position, m_last_frame * vtx_count * sizeof( nv::vec3 ) );
-		m_va->update_vertex_buffer( m_loc_last_normal,   m_last_frame * vtx_count * sizeof( nv::vec3 ) );
+		m_va->update_vertex_buffer( slot::POSITION, m_last_frame * vtx_count * sizeof( nv::vec3 ) );
+		m_va->update_vertex_buffer( slot::NORMAL,   m_last_frame * vtx_count * sizeof( nv::vec3 ) );
 		m_gpu_last_frame = m_last_frame;
 	}
@@ -139,5 +135,5 @@
 		m_gpu_next_frame = m_next_frame;
 	}
-	m_program->set_uniform( "interpolate", m_interpolation );
+	m_program->set_uniform( "nv_interpolate", m_interpolation );
 	m_context->draw( nv::TRIANGLES, rstate, m_program, m_va, m_data->get_index_count() );
 }
Index: /trunk/src/gl/gl_device.cc
===================================================================
--- /trunk/src/gl/gl_device.cc	(revision 160)
+++ /trunk/src/gl/gl_device.cc	(revision 161)
@@ -44,6 +44,10 @@
 	SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
 	SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
-	SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+	SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24 );
 	SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+
+	SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 );
+	SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, 4 );
+
 }
 
Index: /trunk/src/gl/gl_program.cc
===================================================================
--- /trunk/src/gl/gl_program.cc	(revision 160)
+++ /trunk/src/gl/gl_program.cc	(revision 161)
@@ -105,4 +105,10 @@
 	if (!vertex_shader.compile( vertex_program )) { return false; }
 	if (!fragment_shader.compile( fragment_program )) { return false; }
+
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::POSITION ), "nv_position" );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::TEXCOORD ), "nv_texcoord" );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::NORMAL   ), "nv_normal"   );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::COLOR    ), "nv_color"    );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::TANGENT  ), "nv_tangent"  );
 
 	glAttachShader( m_name.get_value(), fragment_shader.get_id() );
Index: /trunk/src/gui/gui_renderer.cc
===================================================================
--- /trunk/src/gui/gui_renderer.cc	(revision 160)
+++ /trunk/src/gui/gui_renderer.cc	(revision 161)
@@ -81,8 +81,4 @@
 	nv::program*      shader;
 	nv::texture2d*    texture;
-
-	int loc_coord;
-	int loc_color;
-	int loc_tcoord;
 };
 
@@ -116,15 +112,12 @@
 	sr->varray     = m_window->get_device()->create_vertex_array();
 	sr->shader     = m_window->get_device()->create_program( nv::slurp( "gui.vert" ), nv::slurp( "gui.frag" ) );
-	sr->loc_coord  = sr->shader->get_attribute("coord")->get_location();
-	sr->loc_tcoord = sr->shader->get_attribute("tcoord")->get_location();
-	sr->loc_color  = sr->shader->get_attribute("color")->get_location();
 	sr->shader->set_uniform( "tex", 0 );
 	glm::mat4 projection = glm::ortho( 0.0f, float( m_window->get_width() ), float( m_window->get_height() ), 0.0f, -1.0f, 1.0f );
-	sr->shader->set_uniform( "projection", projection );
+	sr->shader->set_uniform( "nv_projection", projection );
 
 	vertex_buffer* vb = (vertex_buffer*)sr->buffer.get_buffer();
-	sr->varray->add_vertex_buffer( sr->loc_coord,  vb, nv::INT,   2, 0, sizeof( vertex ), false );
-	sr->varray->add_vertex_buffer( sr->loc_tcoord, vb, nv::FLOAT, 2, offset_of( &vertex::tcoord ), sizeof( vertex ), false );
-	sr->varray->add_vertex_buffer( sr->loc_color,  vb, nv::FLOAT, 4, offset_of( &vertex::color ), sizeof( vertex ), false );
+	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 );
 
 	nv::sampler sampler( nv::sampler::LINEAR, nv::sampler::CLAMP_TO_EDGE );
@@ -277,7 +270,7 @@
 	{
 		nv::vertex_buffer* vb = (nv::vertex_buffer*)sr->buffer.get_buffer();
-		sr->varray->update_vertex_buffer( sr->loc_coord,  vb, false );
-		sr->varray->update_vertex_buffer( sr->loc_tcoord, vb, false );
-		sr->varray->update_vertex_buffer( sr->loc_color,  vb, false );
+		sr->varray->update_vertex_buffer( nv::POSITION, vb, false );
+		sr->varray->update_vertex_buffer( nv::TEXCOORD, vb, false );
+		sr->varray->update_vertex_buffer( nv::COLOR,    vb, false );
 	}
 	sr->texture->bind( 0 );
Index: /trunk/tests/cachebuf_test/cachebuf.vert
===================================================================
--- /trunk/tests/cachebuf_test/cachebuf.vert	(revision 160)
+++ /trunk/tests/cachebuf_test/cachebuf.vert	(revision 161)
@@ -1,10 +1,10 @@
 #version 120
-attribute vec2 coord;
-attribute vec4 color;
-uniform mat4 projection;
+attribute vec2 nv_position;
+attribute vec4 nv_color;
+uniform mat4 nv_projection;
 varying vec4 f_color;
 
 void main(void) {
-	f_color = color;
-	gl_Position = projection * vec4( coord.x, coord.y, 0.0, 1.0 );
+	f_color = nv_color;
+	gl_Position = nv_projection * vec4( nv_position.x, nv_position.y, 0.0, 1.0 );
 }
Index: /trunk/tests/cachebuf_test/nv_cachebuf_test.cc
===================================================================
--- /trunk/tests/cachebuf_test/nv_cachebuf_test.cc	(revision 160)
+++ /trunk/tests/cachebuf_test/nv_cachebuf_test.cc	(revision 161)
@@ -234,6 +234,4 @@
 	nv::vertex_array* m_va;
 	unsigned int m_count;
-	int m_coord_loc;
-	int m_color_loc;
 };
 
@@ -257,6 +255,4 @@
 	{ 
 		m_program   = m_device->create_program( nv::slurp( "cachebuf.vert" ), nv::slurp( "cachebuf.frag" ) );
-		m_coord_loc = m_program->get_attribute("coord")->get_location();
-		m_color_loc = m_program->get_attribute("color")->get_location();
 		m_va        = m_device->create_vertex_array();
 
@@ -270,6 +266,6 @@
 		#endif
 
-		m_va->add_vertex_buffer( m_coord_loc, buffer, nv::INT,   2, 0, sizeof( vertex ), false );
-		m_va->add_vertex_buffer( m_color_loc, buffer, nv::FLOAT, 4, offset_of( &vertex::color ), sizeof( vertex ), false );
+		m_va->add_vertex_buffer( nv::slot::POSITION, buffer, nv::INT,   2, 0, sizeof( vertex ), false );
+		m_va->add_vertex_buffer( nv::slot::COLOR,    buffer, nv::FLOAT, 4, offset_of( &vertex::color ), sizeof( vertex ), false );
 	}
 	return true;
@@ -281,5 +277,5 @@
 	m_program->bind();
 	glm::mat4 projection = glm::ortho( 0.0f, 800.0f, 600.0f, 0.0f, -1.0f, 1.0f );
-	m_program->set_uniform( "projection", glm::mat4(projection) );
+	m_program->set_uniform( "nv_projection", glm::mat4(projection) );
 
 	while(!keypress) 
@@ -297,6 +293,6 @@
 			nv::vertex_buffer* buffer = (nv::vertex_buffer*)m_quad_cache->get_buffer();
 			#endif
-			m_va->update_vertex_buffer( m_coord_loc, buffer, false );
-			m_va->update_vertex_buffer( m_color_loc, buffer, false );
+			m_va->update_vertex_buffer( nv::slot::POSITION, buffer, false );
+			m_va->update_vertex_buffer( nv::slot::COLOR,    buffer, false );
 		}
 
Index: /trunk/tests/gui_test/gui.frag
===================================================================
--- /trunk/tests/gui_test/gui.frag	(revision 160)
+++ /trunk/tests/gui_test/gui.frag	(revision 161)
@@ -1,9 +1,9 @@
 #version 120
-varying vec4 f_color;
-varying vec2 f_tcoord;
+varying vec4 v_color;
+varying vec2 v_texcoord;
 uniform sampler2D tex;
  
 void main(void) {
-	vec4 texture = texture2D(tex,f_tcoord);
-	gl_FragColor = f_color * texture;
+	vec4 texture = texture2D(tex,v_texcoord);
+	gl_FragColor = v_color * texture;
 }
Index: /trunk/tests/gui_test/gui.vert
===================================================================
--- /trunk/tests/gui_test/gui.vert	(revision 160)
+++ /trunk/tests/gui_test/gui.vert	(revision 161)
@@ -1,13 +1,13 @@
 #version 120
-attribute vec2 coord;
-attribute vec2 tcoord;
-attribute vec4 color;
-uniform mat4 projection;
-varying vec4 f_color;
-varying vec2 f_tcoord;
+attribute vec2 nv_position;
+attribute vec2 nv_texcoord;
+attribute vec4 nv_color;
+uniform mat4 nv_projection;
+varying vec4 v_color;
+varying vec2 v_texcoord;
 
 void main(void) {
-	f_color  = color;
-	f_tcoord = tcoord;
-	gl_Position = projection * vec4( coord.x, coord.y, 0.0, 1.0 );
+	v_color     = nv_color;
+	v_texcoord  = nv_texcoord;
+	gl_Position = nv_projection * vec4( nv_position.x, nv_position.y, 0.0, 1.0 );
 }
Index: /trunk/tests/objload_test/obj.vert
===================================================================
--- /trunk/tests/objload_test/obj.vert	(revision 160)
+++ /trunk/tests/objload_test/obj.vert	(revision 161)
@@ -1,7 +1,7 @@
 #version 120
 
-attribute vec3 position;
-attribute vec2 texcoord;
-attribute vec3 normal;
+attribute vec3 nv_position;
+attribute vec2 nv_texcoord;
+attribute vec3 nv_normal;
 
 varying vec3 v_normal;
@@ -17,11 +17,11 @@
 
 void main(void) {
-	vec4 vertex     = vec4( position, 1.0 );
+	vec4 vertex     = vec4( nv_position, 1.0 );
 	vec3 eye_pos    = vec3( nv_m_modelview * vertex );
-	v_normal        = normalize( nv_m_normal * normal );
+	v_normal        = normalize( nv_m_normal * nv_normal );
 	v_light_vector  = vec3( normalize( light_position - eye_pos ) );
 	v_view_vector   = vec3( normalize( -eye_pos ) );
 
-	v_texcoord      = texcoord;
+	v_texcoord      = nv_texcoord;
 	gl_Position     = matrix_mvp * vertex;
 }
