Index: trunk/tests/cachebuf_test/nv_cachebuf_test.cc
===================================================================
--- trunk/tests/cachebuf_test/nv_cachebuf_test.cc	(revision 304)
+++ trunk/tests/cachebuf_test/nv_cachebuf_test.cc	(revision 319)
@@ -1,16 +1,12 @@
-#include <nv/interface/vertex_buffer.hh>
 #include <nv/gl/gl_device.hh>
 #include <nv/gfx/image.hh>
 #include <nv/interface/context.hh>
 #include <nv/interface/window.hh>
-#include <nv/interface/program.hh>
-#include <nv/interface/texture2d.hh>
-#include <nv/logging.hh>
-#include <nv/logger.hh>
+#include <nv/core/logging.hh>
+#include <nv/core/logger.hh>
 #include <glm/glm.hpp>
 #include <glm/gtc/matrix_transform.hpp>
 #include <glm/gtc/type_ptr.hpp>
-#include <nv/string.hh>
-#include <nv/interface/mesh.hh>
+#include <nv/core/string.hh>
 #include <cstdlib> // rand
 #include <ctime> // time
@@ -222,6 +218,7 @@
 	~application();
 protected:
-	nv::device* m_device;
-	nv::window* m_window;
+	nv::device*  m_device;
+	nv::context* m_context;
+	nv::window*  m_window;
 	nv::clear_state m_clear_state;
 	nv::render_state m_render_state;
@@ -230,6 +227,6 @@
 	std::vector<app_window>  m_windows;
 
-	nv::program* m_program;
-	nv::vertex_array* m_va;
+	nv::program       m_program;
+	nv::vertex_array  m_va;
 	unsigned int m_count;
 };
@@ -237,6 +234,7 @@
 application::application()
 {
-	m_device = new nv::gl_device();
-	m_window = m_device->create_window( 800, 600 );
+	m_device  = new nv::gl_device();
+	m_window  = m_device->create_window( 800, 600, false );
+	m_context = m_window->get_context();
 
 	m_clear_state.buffers = nv::clear_state::COLOR_AND_DEPTH_BUFFER;
@@ -254,17 +252,17 @@
 	{ 
 		m_program   = m_device->create_program( nv::slurp( "cachebuf.vert" ), nv::slurp( "cachebuf.frag" ) );
-		m_va        = m_device->create_vertex_array();
-
-		#ifdef INDEXED_TEST
-		m_quad_cache = new gcache( m_device, nv::DYNAMIC_DRAW, 200, 200 );
-		m_va->set_index_buffer( m_quad_cache->get_index_buffer(), nv::USHORT, false );
-		nv::vertex_buffer* buffer = m_quad_cache->get_vertex_buffer();
-		#else
-		m_quad_cache = new gcache( m_device, nv::DYNAMIC_DRAW, 20, true );
-		nv::vertex_buffer* buffer = (nv::vertex_buffer*)m_quad_cache->get_buffer();
-		#endif
-
-		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 );
+		m_va        = m_context->create_vertex_array();
+
+		#ifdef INDEXED_TEST
+		m_quad_cache = new gcache( m_context, nv::DYNAMIC_DRAW, 200, 200 );
+		m_context->set_index_buffer( m_va, m_quad_cache->get_index_buffer(), nv::USHORT, false );
+		nv::buffer buffer = m_quad_cache->get_vertex_buffer();
+		#else
+		m_quad_cache = new gcache( m_context, nv::DYNAMIC_DRAW, 20, true );
+		nv::buffer buffer = m_quad_cache->get_buffer();
+		#endif
+
+		m_context->add_vertex_buffer( m_va, nv::slot::POSITION, buffer, nv::INT,   2, 0, sizeof( vertex ), false );
+		m_context->add_vertex_buffer( m_va, nv::slot::COLOR,    buffer, nv::FLOAT, 4, offset_of( &vertex::color ), sizeof( vertex ), false );
 	}
 	return true;
@@ -274,7 +272,6 @@
 {
 	int keypress = 0;
-	m_program->bind();
 	glm::mat4 projection = glm::ortho( 0.0f, 800.0f, 600.0f, 0.0f, -1.0f, 1.0f );
-	m_program->set_uniform( "nv_projection", glm::mat4(projection) );
+	m_device->set_uniform( m_program, "nv_projection", glm::mat4(projection) );
 
 	while(!keypress) 
@@ -287,15 +284,12 @@
 		{
 			#ifdef INDEXED_TEST
-			m_va->set_index_buffer( m_quad_cache->get_index_buffer() );
-			nv::vertex_buffer* buffer = m_quad_cache->get_vertex_buffer();
+			m_context->set_index_buffer( m_va, m_quad_cache->get_index_buffer(), nv::USHORT, false );
+			nv::buffer buffer = m_quad_cache->get_vertex_buffer();
 			#else
-			nv::vertex_buffer* buffer = (nv::vertex_buffer*)m_quad_cache->get_buffer();
+			nv::buffer buffer = m_quad_cache->get_buffer();
 			#endif
-			m_va->update_vertex_buffer( nv::slot::POSITION, buffer, false );
-			m_va->update_vertex_buffer( nv::slot::COLOR,    buffer, false );
 		}
 
 		m_window->get_context()->clear( m_clear_state );
-		m_program->bind();
 //		m_program->set_uniform( "tex", 0 );
 		#ifdef INDEXED_TEST
@@ -369,6 +363,6 @@
 	delete m_quad_cache;
 
-	delete m_program;
-	delete m_va;
+	m_device->release( m_program );
+	m_context->release( m_va );
 	delete m_window;
 	delete m_device;
Index: trunk/tests/gui_test/nv_gui_test.cc
===================================================================
--- trunk/tests/gui_test/nv_gui_test.cc	(revision 304)
+++ trunk/tests/gui_test/nv_gui_test.cc	(revision 319)
@@ -2,6 +2,6 @@
 #include <nv/gui/gui_environment.hh>
 #include <nv/interface/context.hh>
-#include <nv/logging.hh>
-#include <nv/logger.hh>
+#include <nv/core/logging.hh>
+#include <nv/core/logger.hh>
 #include <cstdlib> // rand
 #include <ctime> // time
Index: trunk/tests/md3_test/md3_test.cc
===================================================================
--- trunk/tests/md3_test/md3_test.cc	(revision 304)
+++ trunk/tests/md3_test/md3_test.cc	(revision 319)
@@ -1,6 +1,5 @@
-#include <nv/common.hh>
+#include <nv/core/common.hh>
 #include <iomanip>
 #include <nv/gfx/keyframed_mesh.hh>
-#include <nv/interface/vertex_buffer.hh>
 #include <nv/gl/gl_device.hh>
 #include <nv/gfx/image.hh>
@@ -10,10 +9,10 @@
 #include <nv/io/c_file_system.hh>
 #include <nv/formats/md3_loader.hh>
-#include <nv/profiler.hh>
-#include <nv/logging.hh>
-#include <nv/logger.hh>
-#include <nv/math.hh>
-#include <nv/time.hh>
-#include <nv/string.hh>
+#include <nv/core/profiler.hh>
+#include <nv/core/logging.hh>
+#include <nv/core/logger.hh>
+#include <nv/core/math.hh>
+#include <nv/core/time.hh>
+#include <nv/core/string.hh>
 #include <glm/gtx/rotate_vector.hpp>
 #include <glm/gtc/matrix_access.hpp>
@@ -68,5 +67,4 @@
 	void update( nv::uint32 ms, nv::program program )
 	{
-		m_mesh->update( ms );
 		m_mesh->update_animation( m_entry, ms );
 		m_mesh->update( program );
@@ -206,19 +204,19 @@
 
 			m_scene_state.set_model( model );
-			m_window->get_context()->draw( m_render_state, m_scene_state, m_program, m_legs->get_mesh() );
+			m_window->get_context()->draw( nv::TRIANGLES, m_render_state, m_scene_state, m_program, m_legs->get_mesh()->get_vertex_array(), m_legs->get_mesh()->get_index_count() );
 
 			//model = m_legs->get_transform( "tag_torso", last_legs_frame, legs_frame, legs_interpolate );
 			model = m_legs->get_transform( 0 );
 			m_scene_state.set_model( model );
-			m_window->get_context()->draw( m_render_state, m_scene_state, m_program, m_torso->get_mesh() );
+			m_window->get_context()->draw( nv::TRIANGLES, m_render_state, m_scene_state, m_program, m_torso->get_mesh()->get_vertex_array(), m_torso->get_mesh()->get_index_count() );
 
 			glm::mat4 head = model * m_torso->get_transform( 0 ); //, last_torso_frame, torso_frame, torso_interpolate );
 			m_scene_state.set_model( head );
-			m_window->get_context()->draw( m_render_state, m_scene_state, m_program, m_head->get_mesh() );
+			m_window->get_context()->draw( nv::TRIANGLES, m_render_state, m_scene_state, m_program, m_head->get_mesh()->get_vertex_array(), m_head->get_mesh()->get_index_count() );
 
 			glm::mat4 weapon = model * m_torso->get_transform( 2 ); //, last_torso_frame, torso_frame, torso_interpolate );
 			m_scene_state.set_model( weapon );
 			m_context->bind( m_diffuse_weapon, nv::TEX_DIFFUSE );
-			m_context->draw( m_render_state, m_scene_state, m_program, m_weapon->get_mesh() );
+			m_context->draw( nv::TRIANGLES, m_render_state, m_scene_state, m_program, m_weapon->get_mesh()->get_vertex_array(), m_weapon->get_mesh()->get_index_count() );
 
 		}
