Browse Source

last push before architecture rework

mikymod 12 years ago
parent
commit
501087d894

+ 1 - 1
engine/Device.h

@@ -52,7 +52,7 @@ class BundleCompiler;
 class ResourcePackage;
 
 typedef void (*cb)(float);
-void nothing(float);
+CE_EXPORT void nothing(float);
 
 /// The Engine.
 /// It is the place where to look for accessing all of

+ 25 - 32
engine/os/win/OsWindow.cpp

@@ -206,6 +206,31 @@ void OsWindow::move(uint32_t x, uint32_t y)
 	SetWindowPos(m_window_handle, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);	
 }
 
+//-----------------------------------------------------------------------------
+void OsWindow::minimize()
+{
+
+}
+
+//-----------------------------------------------------------------------------
+void OsWindow::restore()
+{
+
+}
+
+//-----------------------------------------------------------------------------
+bool OsWindow::is_resizable() const
+{
+	return true;
+}
+
+//-----------------------------------------------------------------------------
+void OsWindow::set_resizable(bool resizable)
+{
+
+}
+
+
 //-----------------------------------------------------------------------------
 void OsWindow::show_cursor(bool show)
 {
@@ -232,38 +257,6 @@ void OsWindow::set_cursor_xy(int32_t x, int32_t y)
 	SetCursorPos(x, y);
 }
 
-//-----------------------------------------------------------------------------
-void OsWindow::set_fullscreen(bool fs)
-{
-	if (m_fullscreen)
-	{
-		memset(&m_screen_setting, 0, sizeof(m_screen_setting)); // Makes Sure Memory's Cleared
-		m_screen_setting.dmSize = sizeof(m_screen_setting); // Size Of The Devmode Structure
-		m_screen_setting.dmPelsWidth = m_width; // Selected Screen Width
-		m_screen_setting.dmPelsHeight = m_height; // Selected Screen Height
-		m_screen_setting.dmBitsPerPel = 32; // Selected Bits Per Pixel
-		m_screen_setting.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
-
-		// Try To Set Selected Mode And Get Results.  NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
-		if (ChangeDisplaySettings(&m_screen_setting, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
-		{
-			m_fullscreen = false;
-			Log::i("Fullscreen resolution not supported, switching to windowed mode.");
-		}
-		else
-		{
-			m_fullscreen = true;
-			m_window_handle = CreateWindowEx(0, m_window_name, "", WS_POPUP, 0, 0, m_width, m_height, NULL, NULL, GetModuleHandle(NULL), NULL);
-		}
-	}
-}
-
-bool OsWindow::fullscreen()
-{
-	return m_fullscreen;
-}
-
-
 //-----------------------------------------------------------------------------
 char* OsWindow::title()
 {

+ 6 - 3
engine/os/win/OsWindow.h

@@ -48,14 +48,17 @@ public:
 	void			resize(uint32_t width, uint32_t height);
 	void			move(uint32_t x, uint32_t y);
 
+	void			minimize();
+	void			restore();
+
+	bool			is_resizable() const;
+	void			set_resizable(bool resizable);
+
 	void			show_cursor(bool show);
 
 	void			get_cursor_xy(int32_t& x, int32_t& y);
 	void			set_cursor_xy(int32_t x, int32_t y);
 
-	void			set_fullscreen(bool fs);
-	bool			fullscreen();
-
 	char*			title();
 	void			set_title(const char* title);
 

+ 12 - 12
engine/renderers/DebugRenderer.cpp

@@ -71,11 +71,11 @@ void DebugRenderer::add_sphere(const Vec3& center, const float radius, const Col
 	// XZ plane
 	for (uint32_t deg = 0; deg < 360; deg += deg_step)
 	{
-		float rad0 = math::deg_to_rad(deg);
-		float rad1 = math::deg_to_rad(deg + deg_step);
+		float rad_0 = math::deg_to_rad(deg);
+		float rad_1 = math::deg_to_rad(deg + deg_step);
 
-		Vec3 start(math::cos(rad0) * radius, 0, -math::sin(rad0) * radius);
-		Vec3 end  (math::cos(rad1) * radius, 0, -math::sin(rad1) * radius);
+		Vec3 start(math::cos(rad_0) * radius, 0, -math::sin(rad_0) * radius);
+		Vec3 end  (math::cos(rad_1) * radius, 0, -math::sin(rad_1) * radius);
 
 		add_line(center + start, center + end, color, depth_write);
 	}
@@ -83,11 +83,11 @@ void DebugRenderer::add_sphere(const Vec3& center, const float radius, const Col
 	// XY plane
 	for (uint32_t deg = 0; deg < 360; deg += deg_step)
 	{
-		float rad0 = math::deg_to_rad(deg);
-		float rad1 = math::deg_to_rad(deg + deg_step);
+		float rad_0 = math::deg_to_rad(deg);
+		float rad_1 = math::deg_to_rad(deg + deg_step);
 
-		Vec3 start(math::cos(rad0) * radius, math::sin(rad0) * radius, 0);
-		Vec3 end  (math::cos(rad1) * radius, math::sin(rad1) * radius, 0);
+		Vec3 start(math::cos(rad_0) * radius, math::sin(rad_0) * radius, 0);
+		Vec3 end  (math::cos(rad_1) * radius, math::sin(rad_1) * radius, 0);
 
 		add_line(center + start, center + end, color, depth_write);
 	}
@@ -95,11 +95,11 @@ void DebugRenderer::add_sphere(const Vec3& center, const float radius, const Col
 	// YZ plane
 	for (uint32_t deg = 0; deg < 360; deg += deg_step)
 	{
-		float rad0 = math::deg_to_rad(deg);
-		float rad1 = math::deg_to_rad(deg + deg_step);
+		float rad_0 = math::deg_to_rad(deg);
+		float rad_1 = math::deg_to_rad(deg + deg_step);
 
-		Vec3 start(0, math::sin(rad0) * radius, -math::cos(rad0) * radius);
-		Vec3 end  (0, math::sin(rad1) * radius, -math::cos(rad1) * radius);
+		Vec3 start(0, math::sin(rad_0) * radius, -math::cos(rad_0) * radius);
+		Vec3 end  (0, math::sin(rad_1) * radius, -math::cos(rad_1) * radius);
 
 		add_line(center + start, center + end, color, depth_write);
 	}

+ 2 - 2
engine/renderers/Renderer.h

@@ -32,7 +32,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "VertexFormat.h"
 #include "StringUtils.h"
 #include "RenderContext.h"
-#include "Thread.h"
+#include "OsThread.h"
 #include "OS.h"
 
 namespace crown
@@ -686,7 +686,7 @@ protected:
 	Allocator& m_allocator;
 	RendererImplementation* m_impl;
 
-	Thread m_thread;
+	OsThread m_thread;
 	Semaphore m_render_wait;
 	Semaphore m_main_wait;