Index: trunk/src/gl/gl_context.cc
===================================================================
--- trunk/src/gl/gl_context.cc	(revision 62)
+++ trunk/src/gl/gl_context.cc	(revision 64)
@@ -49,5 +49,5 @@
 	if ( viewport.z < 0 || viewport.w < 0 )
 	{
-		throw new logic_error("viewport width and height must be greater than zero!");
+		NV_THROW( logic_error, "viewport width and height must be greater than zero!");
 	}
 
@@ -126,5 +126,5 @@
 	if ( scissor.dim.x < 0 || scissor.dim.y < 0 )
 	{
-		throw new logic_error("scissor_test.rect width and height must be greater than zero!");
+		NV_THROW( logic_error, "scissor_test.rect width and height must be greater than zero!" );
 	}
 
@@ -174,9 +174,9 @@
 	if ( range.near < 0.0 || range.near > 1.0 )
 	{
-		throw new logic_error("render_state.depth_range.near must be between zero and one!");
+		NV_THROW( logic_error, "render_state.depth_range.near must be between zero and one!");
 	}
 	if ( range.far < 0.0 || range.far > 1.0 )
 	{
-		throw new logic_error("render_state.depth_range.far must be between zero and one!");
+		NV_THROW( logic_error, "render_state.depth_range.far must be between zero and one!");
 	}
 
Index: trunk/src/gl/texture_font.cc
===================================================================
--- trunk/src/gl/texture_font.cc	(revision 62)
+++ trunk/src/gl/texture_font.cc	(revision 64)
@@ -44,11 +44,11 @@
 	 
 	error = FT_Init_FreeType( (FT_Library*)(&m_rlibrary) );
-	if ( error ) throw std::runtime_error( "FT_Error" );
+	if ( error ) NV_THROW( std::runtime_error, "FT_Error" );
 
 	error = FT_New_Face( (FT_Library)(m_rlibrary), filename, 0, (FT_Face*)(&m_rface) );
-	if ( error ) throw std::runtime_error( "FT_Error" );
+	if ( error ) NV_THROW( std::runtime_error, "FT_Error" );
 
 	error = FT_Set_Char_Size( (FT_Face)(m_rface), (int)(size*64), 0, 72*64, 72 ); 
-	if ( error ) throw std::runtime_error( "FT_Error" );
+	if ( error ) NV_THROW( std::runtime_error, "FT_Error" );
 
     FT_Set_Transform( (FT_Face)(m_rface), &matrix, NULL );
@@ -106,5 +106,5 @@
 			error_msg << "FT_Error while loading glyphs, error: "
 				<< error << " code: " << c; 
-			throw std::runtime_error( error_msg.str().c_str() );
+			NV_THROW( std::runtime_error, error_msg.str().c_str() );
 		}
 
@@ -124,5 +124,5 @@
 				<< "r.pos.x: " << r.pos.x << " code: "
 				<< c; 
-			throw std::runtime_error( error_msg.str().c_str() );
+			NV_THROW( std::runtime_error, error_msg.str().c_str() );
 		}
 		r.size.x -= 1;
Index: trunk/src/library.cc
===================================================================
--- trunk/src/library.cc	(revision 62)
+++ trunk/src/library.cc	(revision 64)
@@ -75,5 +75,5 @@
     if ( m_handle == NULL )
     {
-        throw library_error( "Can't load library!", name );
+        NV_THROW( library_error, "Can't load library!", name );
     }
     NV_LOG( LOG_NOTICE, "library : '" + name + "' loaded." );
@@ -85,5 +85,5 @@
     if ( !result )
     {
-        throw library_error( "Can't find symbol " + symbol + "!", m_name );
+        NV_THROW( library_error, "Can't find symbol " + symbol + "!", m_name );
     }
 	return result;
Index: trunk/src/logger.cc
===================================================================
--- trunk/src/logger.cc	(revision 62)
+++ trunk/src/logger.cc	(revision 64)
@@ -5,4 +5,5 @@
 #include "nv/logger.hh"
 
+#include "nv/common.hh"
 #include <iostream>
 #include <utility>
@@ -208,5 +209,5 @@
 	{
 		// throw if not open
-		throw runtime_error( "Could not open file \""+file_name+"\" for logging!" );
+		NV_THROW( runtime_error, "Could not open file \""+file_name+"\" for logging!" );
 	}
 
Index: trunk/src/object.cc
===================================================================
--- trunk/src/object.cc	(revision 62)
+++ trunk/src/object.cc	(revision 64)
@@ -7,4 +7,5 @@
 #include "nv/object.hh"
 
+#include "nv/root.hh"
 #include "nv/types.hh"
 
@@ -12,5 +13,5 @@
 
 object::object()
-	: m_id(), m_name(), m_uid(0), m_lua_index(-2), m_parent( nullptr ), m_children(), m_child_count(0)
+	: m_root( nullptr ), m_id(), m_name(), m_uid(0), m_lua_index(-2), m_parent( nullptr ), m_children(), m_child_count(0)
 {
 //	m_uid = uid_store::get_free_uid();
@@ -18,6 +19,6 @@
 }
 
-object::object( string aid, uid auid )
-	: m_id(aid), m_name(), m_uid( auid ), m_lua_index(-2), m_parent( nullptr ), m_children(), m_child_count(0)
+object::object( root* aroot, const string& aid, uid auid )
+	: m_root( aroot ), m_id(aid), m_name(), m_uid( auid ), m_lua_index(-2), m_parent( nullptr ), m_children(), m_child_count(0)
 {
 	//	uid_store::register_object( this, auid );
