Index: /trunk/nv/gui/gui_common.hh
===================================================================
--- /trunk/nv/gui/gui_common.hh	(revision 107)
+++ /trunk/nv/gui/gui_common.hh	(revision 108)
@@ -33,9 +33,10 @@
 		{
 		public:
-			~render_data(){}
+			virtual ~render_data(){}
 		};
 
 		class element;
 		class environment;
+		class renderer;
 
 	} // namespace gui
Index: /trunk/nv/position.hh
===================================================================
--- /trunk/nv/position.hh	(revision 107)
+++ /trunk/nv/position.hh	(revision 108)
@@ -59,6 +59,6 @@
 		rectangle& operator-=( const position& pos ) { ul -= pos; lr -= pos; return (*this); }
 		rectangle operator-( const position& pos ) const {	rectangle r(*this); return r -= pos; }
-		bool operator==( const rectangle& r ) { return r.ul == ul && r.lr == lr; }
-		bool operator!=( const rectangle& r ) { return r.ul != ul || r.lr != lr; }
+		bool operator==( const rectangle& r ) const { return r.ul == ul && r.lr == lr; }
+		bool operator!=( const rectangle& r ) const { return r.ul != ul || r.lr != lr; }
 
 		bool contains( const position& r ) const{ return y2 >= r.y && y1 <= r.y && x2 >= r.x && x1 <= r.x; }
Index: /trunk/src/gl/gl_context.cc
===================================================================
--- /trunk/src/gl/gl_context.cc	(revision 107)
+++ /trunk/src/gl/gl_context.cc	(revision 108)
@@ -351,4 +351,6 @@
 gl_context::gl_context()
 {
+	// TODO: do we really need this?
+	glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
 	force_apply_render_state( m_render_state );
 }
@@ -357,8 +359,11 @@
 {
 	apply_render_state( rs );
-	p->bind();
-	va->bind();
-	glDrawArrays( primitive_to_enum(prim), 0, count);
-	va->unbind();
-	p->unbind();
-}
+	if ( count > 0 )
+	{
+		p->bind();
+		va->bind();
+		glDrawArrays( primitive_to_enum(prim), 0, count);
+		va->unbind();
+		p->unbind();
+	}
+}
