Index: trunk/nv/gl/gl_context.hh
===================================================================
--- trunk/nv/gl/gl_context.hh	(revision 156)
+++ trunk/nv/gl/gl_context.hh	(revision 157)
@@ -20,5 +20,5 @@
 	{
 	public:
-		gl_context();
+		gl_context( device* a_device );
 		virtual void clear( const clear_state& cs );
 		// temporary
Index: trunk/nv/interface/context.hh
===================================================================
--- trunk/nv/interface/context.hh	(revision 156)
+++ trunk/nv/interface/context.hh	(revision 157)
@@ -32,7 +32,9 @@
 	};
 
+	class device;
 	class context
 	{
 	public:
+		context( device* a_device ) { m_device = a_device; }
 		virtual void clear( const clear_state& cs ) = 0;
 		// temporary
@@ -41,6 +43,8 @@
 		virtual const ivec4& get_viewport() = 0;
 		virtual void set_viewport( const ivec4& viewport ) = 0;
+		virtual device* get_device() { return m_device; }
 		virtual ~context() {}
 	protected:
+		device*      m_device;
 		clear_state  m_clear_state;
 		render_state m_render_state;
Index: trunk/src/gl/gl_context.cc
===================================================================
--- trunk/src/gl/gl_context.cc	(revision 156)
+++ trunk/src/gl/gl_context.cc	(revision 157)
@@ -349,5 +349,6 @@
 
 
-gl_context::gl_context()
+gl_context::gl_context( device* a_device )
+	: context( a_device )
 {
 	// TODO: do we really need this?
Index: trunk/src/gl/gl_window.cc
===================================================================
--- trunk/src/gl/gl_window.cc	(revision 156)
+++ trunk/src/gl/gl_window.cc	(revision 157)
@@ -167,5 +167,5 @@
 	NV_LOG( LOG_INFO, "OpenGL GLSL Version : " << glGetString(GL_SHADING_LANGUAGE_VERSION) );
 
-	m_context = new gl_context();
+	m_context = new gl_context( m_device );
 	m_context->set_viewport( nv::ivec4( 0, 0, m_width, m_height ) );
 }
