Index: /trunk/nv/core/array2d.hh
===================================================================
--- /trunk/nv/core/array2d.hh	(revision 326)
+++ /trunk/nv/core/array2d.hh	(revision 327)
@@ -87,13 +87,8 @@
 			if (new_size == m_size) return; // Don't do anything if the sizes are the same.
 
-			pointer new_data = new value_type[ new_size.x * new_size.y ];
+			pointer new_data = ( (new_size.x * new_size.y != 0) ? new value_type[ new_size.x * new_size.y ] : nullptr );
 			if ( m_data != nullptr )
 			{
-				if (!preserve)
-				{
-					// Just delete the data.
-					delete[] m_data;
-				}
-				else
+				if ( new_data && preserve )
 				{
 					// Copy the data.  Truncates the bottom or right side of the data if destination is smaller.
@@ -102,7 +97,6 @@
 						std::copy( m_data + m_size.x * i, m_data + m_size.x * i + min( new_size.x, m_size.x ), new_data + m_size.x * i );
 					}
-					// ...then delete the original data.
-					delete[] m_data;
 				}
+				delete[] m_data;
 			}
 			m_data = new_data;
Index: /trunk/tests/planet_test/nv_planet_test.cc
===================================================================
--- /trunk/tests/planet_test/nv_planet_test.cc	(revision 326)
+++ /trunk/tests/planet_test/nv_planet_test.cc	(revision 327)
@@ -1,4 +1,5 @@
 #include <nv/gfx/keyframed_mesh.hh>
 #include <nv/gl/gl_device.hh>
+#include <nv/sdl/sdl_window_manager.hh>
 #include <nv/gfx/image.hh>
 #include <nv/gfx/debug_draw.hh>
@@ -23,5 +24,5 @@
 	nv::mesh_data* generate_box();
 	nv::mesh_data* generate_subdiv_sphere( int levels );
-
+	nv::window_manager* m_wm;
 	nv::device*      m_device;
 	nv::window*      m_window;
@@ -103,6 +104,7 @@
 {
 	NV_PROFILE( "app_construct" );
+	m_wm      = new nv::sdl::window_manager;
 	m_device  = new nv::gl_device();
-	m_window  = m_device->create_window( 800, 600, false );
+	m_window  = m_wm->create_window( m_device, 1024, 800, false );
 	m_context = m_window->get_context();
 
@@ -142,5 +144,5 @@
 	int keypress = 0;
 
-	nv::uint32 ticks   = m_device->get_ticks();
+	nv::uint32 ticks   = m_wm->get_ticks();
 	nv::uint32 last_ticks;
 	nv::fps_counter_class< nv::system_us_timer > fps_counter;
@@ -150,8 +152,8 @@
 	{
 		last_ticks = ticks;
-		ticks      = m_device->get_ticks();
+		ticks      = m_wm->get_ticks();
 		nv::uint32 elapsed = ticks - last_ticks;
 		m_context->clear( m_clear_state );
-		glm::vec3 eye = glm::rotate( glm::vec3( 2.0f, 0.0f, 0.0f ), (ticks / 20.f), glm::vec3( 0.0,1.0,0.0 ) );
+		glm::vec3 eye = glm::rotate( glm::vec3( 3.0f, 0.0f, 0.0f ), (ticks / 20.f), glm::vec3( 0.0,1.0,0.0 ) );
 //		eye = glm::vec3( 3.0f, 0.0f, 0.0f );
 		m_scene_state.set_model( nv::mat4(1.0f) );
Index: /trunk/tests/planet_test/planet_test.lua
===================================================================
--- /trunk/tests/planet_test/planet_test.lua	(revision 326)
+++ /trunk/tests/planet_test/planet_test.lua	(revision 327)
@@ -4,5 +4,5 @@
 	includedirs { "../../" }
 	targetname "nv_planet_test"
-	links { "nv-core", "nv-gl", "nv-formats" }
+	links { "nv-core", "nv-gl", "nv-formats", "nv-sdl" }
 	targetdir "../../bin"	
   
