Browse Source

Renamed OpenGL Win32Window since a more general Win32Window class was added

BearishSun 10 years ago
parent
commit
7d97de6dda

+ 2 - 0
BansheeCore/BansheeCore.vcxproj

@@ -450,6 +450,7 @@
     <ClInclude Include="Include\BsVertexDeclarationRTTI.h" />
     <ClInclude Include="Include\BsVertexDeclarationRTTI.h" />
     <ClInclude Include="Include\BsTechnique.h" />
     <ClInclude Include="Include\BsTechnique.h" />
     <ClInclude Include="Include\BsViewportRTTI.h" />
     <ClInclude Include="Include\BsViewportRTTI.h" />
+    <ClInclude Include="Include\Win32\BsWin32Window.h" />
     <ClInclude Include="Include\Win32\BsWin32Defs.h" />
     <ClInclude Include="Include\Win32\BsWin32Defs.h" />
     <ClInclude Include="Include\Win32\BsWin32Platform.h" />
     <ClInclude Include="Include\Win32\BsWin32Platform.h" />
     <ClInclude Include="Include\Win32\BsWin32DropTarget.h" />
     <ClInclude Include="Include\Win32\BsWin32DropTarget.h" />
@@ -568,6 +569,7 @@
     <ClCompile Include="Source\BsComponent.cpp" />
     <ClCompile Include="Source\BsComponent.cpp" />
     <ClCompile Include="Source\Win32\BsWin32Platform.cpp" />
     <ClCompile Include="Source\Win32\BsWin32Platform.cpp" />
     <ClCompile Include="Source\Win32\BsWin32FolderMonitor.cpp" />
     <ClCompile Include="Source\Win32\BsWin32FolderMonitor.cpp" />
+    <ClCompile Include="Source\Win32\BsWin32Window.cpp" />
   </ItemGroup>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   <ImportGroup Label="ExtensionTargets">

+ 9 - 0
BansheeCore/BansheeCore.vcxproj.filters

@@ -90,6 +90,9 @@
     <Filter Include="Source Files\Localization">
     <Filter Include="Source Files\Localization">
       <UniqueIdentifier>{f8c05475-0bc9-44d9-9702-985ec016f0ba}</UniqueIdentifier>
       <UniqueIdentifier>{f8c05475-0bc9-44d9-9702-985ec016f0ba}</UniqueIdentifier>
     </Filter>
     </Filter>
+    <Filter Include="Source Files\Win32">
+      <UniqueIdentifier>{86aae89f-a09f-469d-bc37-60c7decba0cb}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClInclude Include="Include\BsRenderStats.h">
     <ClInclude Include="Include\BsRenderStats.h">
@@ -572,6 +575,9 @@
     <ClInclude Include="Include\BsIconUtility.h">
     <ClInclude Include="Include\BsIconUtility.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
+    <ClInclude Include="Include\Win32\BsWin32Window.h">
+      <Filter>Header Files\Win32</Filter>
+    </ClInclude>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClCompile Include="Source\BsCoreApplication.cpp">
     <ClCompile Include="Source\BsCoreApplication.cpp">
@@ -904,5 +910,8 @@
     <ClCompile Include="Source\BsIconUtility.cpp">
     <ClCompile Include="Source\BsIconUtility.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
+    <ClCompile Include="Source\Win32\BsWin32Window.cpp">
+      <Filter>Source Files\Win32</Filter>
+    </ClCompile>
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 10 - 0
BansheeCore/Include/BsCommonTypes.h

@@ -330,6 +330,16 @@ namespace BansheeEngine
 		Transparent = 0x1 /**< Signifies that the shader is rendering a transparent object. */
 		Transparent = 0x1 /**< Signifies that the shader is rendering a transparent object. */
 	};
 	};
 
 
+	/**
+	 * @brief	Enum that defines possible window border styles.
+	 */
+	enum class WindowBorder
+	{
+		Normal,
+		None,
+		Fixed
+	};
+
 	/**
 	/**
 	 * @brief	Texture addressing mode, per component.
 	 * @brief	Texture addressing mode, per component.
 	 */
 	 */

+ 2 - 12
BansheeCore/Include/BsRenderWindow.h

@@ -8,16 +8,6 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	/**
-	 * @brief	Enum that defines possible window border styles.
-	 */
-	enum class WindowBorder
-	{
-		Normal,
-		None,
-		Fixed
-	};
-
 	/**
 	/**
 	 * @brief	Structure that is used for initializing a render window.
 	 * @brief	Structure that is used for initializing a render window.
 	 */
 	 */
@@ -34,7 +24,7 @@ namespace BansheeEngine
 		bool fullscreen; /**< Should the window be opened in fullscreen mode. */
 		bool fullscreen; /**< Should the window be opened in fullscreen mode. */
 		bool vsync; /**< Should the window wait for vertical sync before swapping buffers. */
 		bool vsync; /**< Should the window wait for vertical sync before swapping buffers. */
 		UINT32 vsyncInterval; /**< Determines how many vsync intervals occur per frame. FPS = refreshRate/interval. Usually 1 when vsync active. */
 		UINT32 vsyncInterval; /**< Determines how many vsync intervals occur per frame. FPS = refreshRate/interval. Usually 1 when vsync active. */
-		bool hidden; /**< Should the window be hidden. */
+		bool hidden; /**< Should the window be hidden initially. */
 		bool depthBuffer; /**< Should the window be created with a depth/stencil buffer. */
 		bool depthBuffer; /**< Should the window be created with a depth/stencil buffer. */
 		UINT32 multisampleCount; /**< If higher than 1, texture containing multiple samples per pixel is created. */
 		UINT32 multisampleCount; /**< If higher than 1, texture containing multiple samples per pixel is created. */
 		String multisampleHint; /**< Hint about what kind of multisampling to use. Render system specific. */
 		String multisampleHint; /**< Hint about what kind of multisampling to use. Render system specific. */
@@ -361,7 +351,7 @@ namespace BansheeEngine
 		/**
 		/**
 		 * @copydoc	RenderTarget::createCore
 		 * @copydoc	RenderTarget::createCore
 		 */
 		 */
-		SPtr<CoreObjectCore> createCore() const;
+		SPtr<CoreObjectCore> createCore() const override;
 
 
 		/**
 		/**
 		 * @brief	Updates window properties from the synced property data.
 		 * @brief	Updates window properties from the synced property data.

+ 102 - 0
BansheeCore/Include/Win32/BsWin32Window.h

@@ -0,0 +1,102 @@
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsVector2I.h"
+#include "windows.h"
+
+namespace BansheeEngine
+{
+	/**
+	 * @brief	Descriptor used for creating a platform specific native window.
+	 */
+	struct BS_CORE_EXPORT WINDOW_DESC
+	{
+		WINDOW_DESC()
+			: monitor(nullptr), parent(nullptr), external(nullptr), width(0), height(0), fullscreen(false), hidden(false)
+			, left(-1), top(-1), title(""), border(WindowBorder::Normal), outerDimensions(false), enableDoubleClick(true)
+			, toolWindow(false)
+		{ }
+
+		HMONITOR monitor; /**< Handle ot the monitor onto which to display the window. */
+		HWND parent; /** Optional handle to the parent window if this window is to be a child of an existing window. */
+		HWND external; /** Optional external window handle if the window was created externally. */
+		UINT32 width; /**< Width of the window in pixels. */
+		UINT32 height; /**< Height of the window in pixels. */
+		bool fullscreen; /**< Should the window be opened in fullscreen mode. */
+		bool hidden; /**< Should the window be hidden initially. */
+		INT32 left; /**< Window origin on X axis in pixels. -1 == screen center. Relative to provided monitor. */
+		INT32 top; /**< Window origin on Y axis in pixels. -1 == screen center. Relative to provided monitor. */
+		String title; /**< Title of the window. */
+		WindowBorder border; /**< Type of border to create the window with. */
+		bool outerDimensions; /**< Do our dimensions include space for things like title-bar and border. */
+		bool enableDoubleClick; /**< Does window accept double-clicks. */
+		bool toolWindow; /**< Tool windows have a different style than normal windows and can be created with no border or title bar. */
+	};
+
+	/**
+	 * @brief	Represents a Windows native window.
+	 */
+	class BS_CORE_EXPORT Win32Window
+	{
+	public:
+		Win32Window(const WINDOW_DESC& desc);
+		~Win32Window();
+
+        /**
+         * @brief	Hide or show the window.
+         */
+        void setHidden(bool hidden);
+
+		/**
+		 * @brief	Restores or minimizes the window.
+		 */
+		void setActive(bool state);
+
+		/**
+		 * @brief	Minimizes the window to the taskbar.
+		 */
+		void minimize();
+
+		/**
+		 * @brief	Maximizes the window over the entire current screen.
+		 */
+		void maximize();
+
+		/**
+		 * @brief	Restores the window to original position and size if it is
+		 *			minimized or maximized.
+		 */
+		void restore();
+
+        /**
+         * @brief	Change the size of the window.
+         */
+        void resize(UINT32 width, UINT32 height);
+
+        /**
+         * @brief	Reposition the window.
+         */
+		void move(INT32 left, INT32 top);
+
+		/**
+		 * @brief	Converts screen position into window local position.
+		 */
+		Vector2I screenToWindowPos(const Vector2I& screenPos) const;
+
+		/**
+		 * @brief	Converts window local position to screen position.
+		 */
+		Vector2I windowToScreenPos(const Vector2I& windowPos) const;
+
+		/**
+		 * @brief	Called when window is moved or resized externally.
+		 *
+		 * @note	Internal method.
+		 */
+		void _windowMovedOrResized();
+
+	private:
+		struct Pimpl;
+		Pimpl* m;
+	};
+}

+ 275 - 0
BansheeCore/Source/Win32/BsWin32Window.cpp

@@ -0,0 +1,275 @@
+#include "Win32/BsWin32Window.h"
+#include "Win32/BsWin32Platform.h"
+
+namespace BansheeEngine
+{
+	struct Win32Window::Pimpl
+	{
+		HWND hWnd = nullptr;
+		INT32 left = 0;
+		INT32 top = 0;
+		UINT32 width = 0;
+		UINT32 height = 0;
+		bool isExternal = false;
+	};
+
+	Win32Window::Win32Window(const WINDOW_DESC& desc)
+	{
+		m = bs_new<Pimpl>();
+
+		HMONITOR hMonitor = desc.monitor;
+		if (!desc.external)
+		{
+			DWORD dwStyle = WS_CLIPCHILDREN;
+
+			if (!desc.hidden)
+				dwStyle |= WS_VISIBLE;
+
+			DWORD dwStyleEx = 0;
+			RECT rc;
+			MONITORINFO monitorInfo;
+
+			INT32 left = desc.left;
+			INT32 top = desc.top;
+
+			// If we didn't specified the adapter index, or if we didn't find it
+			if (hMonitor == nullptr)
+			{
+				POINT windowAnchorPoint;
+
+				// Fill in anchor point.
+				windowAnchorPoint.x = left;
+				windowAnchorPoint.y = top;
+
+				// Get the nearest monitor to this window.
+				hMonitor = MonitorFromPoint(windowAnchorPoint, MONITOR_DEFAULTTOPRIMARY);
+			}
+
+			// Get the target monitor info		
+			memset(&monitorInfo, 0, sizeof(MONITORINFO));
+			monitorInfo.cbSize = sizeof(MONITORINFO);
+			GetMonitorInfo(hMonitor, &monitorInfo);
+
+			UINT32 width = desc.width;
+			UINT32 height = desc.height;
+
+			// No specified top left -> Center the window in the middle of the monitor
+			if (left == -1 || top == -1)
+			{
+				int screenw = monitorInfo.rcWork.right - monitorInfo.rcWork.left;
+				int screenh = monitorInfo.rcWork.bottom - monitorInfo.rcWork.top;
+
+				// clamp window dimensions to screen size
+				int outerw = (int(width) < screenw) ? int(width) : screenw;
+				int outerh = (int(height) < screenh) ? int(height) : screenh;
+
+				if (left == -1)
+					left = monitorInfo.rcWork.left + (screenw - outerw) / 2;
+				else if (hMonitor != nullptr)
+					left += monitorInfo.rcWork.left;
+
+				if (top == -1)
+					top = monitorInfo.rcWork.top + (screenh - outerh) / 2;
+				else if (hMonitor != nullptr)
+					top += monitorInfo.rcWork.top;
+			}
+			else if (hMonitor != nullptr)
+			{
+				left += monitorInfo.rcWork.left;
+				top += monitorInfo.rcWork.top;
+			}
+
+			if (!desc.fullscreen)
+			{
+				if (desc.parent)
+				{
+					if (desc.toolWindow)
+						dwStyleEx = WS_EX_TOOLWINDOW;
+					else
+						dwStyle |= WS_CHILD;
+				}
+
+				if (!desc.parent || desc.toolWindow)
+				{
+					if (desc.border == WindowBorder::None)
+						dwStyle |= WS_POPUP;
+					else if (desc.border == WindowBorder::Fixed)
+						dwStyle |= WS_OVERLAPPED | WS_BORDER | WS_CAPTION |
+						WS_SYSMENU | WS_MINIMIZEBOX;
+					else
+						dwStyle |= WS_OVERLAPPEDWINDOW;
+				}
+
+				if (!desc.outerDimensions)
+				{
+					// Calculate window dimensions required to get the requested client area
+					SetRect(&rc, 0, 0, width, height);
+					AdjustWindowRect(&rc, dwStyle, false);
+					width = rc.right - rc.left;
+					height = rc.bottom - rc.top;
+
+					// Clamp width and height to the desktop dimensions
+					int screenw = GetSystemMetrics(SM_CXSCREEN);
+					int screenh = GetSystemMetrics(SM_CYSCREEN);
+
+					if ((int)width > screenw)
+						width = screenw;
+
+					if ((int)height > screenh)
+						height = screenh;
+
+					if (left < 0)
+						left = (screenw - width) / 2;
+
+					if (top < 0)
+						top = (screenh - height) / 2;
+				}
+			}
+			else
+			{
+				dwStyle |= WS_POPUP;
+				top = 0;
+				left = 0;
+			}
+
+			UINT classStyle = 0;
+			if (desc.enableDoubleClick)
+				classStyle |= CS_DBLCLKS;
+
+			HINSTANCE hInst = NULL;
+
+			// Register the window class
+			WNDCLASS wc = { classStyle, Win32Platform::_win32WndProc, 0, 0, hInst,
+				LoadIcon(nullptr, IDI_APPLICATION), LoadCursor(nullptr, IDC_ARROW),
+				(HBRUSH)GetStockObject(BLACK_BRUSH), 0, "Win32Wnd" };
+
+			RegisterClass(&wc);
+
+			// Create main window
+			m->hWnd = CreateWindowEx(dwStyleEx, "Win32Wnd", desc.title.c_str(), dwStyle,
+				left, top, width, height, desc.parent, nullptr, hInst, this);
+			m->isExternal = false;
+		}
+		else
+		{
+			m->hWnd = desc.external;
+			m->isExternal = true;
+		}
+
+		RECT rc;
+		GetWindowRect(m->hWnd, &rc);
+		m->top = rc.top;
+		m->left = rc.left;
+
+		GetClientRect(m->hWnd, &rc);
+		m->width = rc.right;
+		m->height = rc.bottom;
+	}
+
+	Win32Window::~Win32Window()
+	{
+		if (m->hWnd && !m->isExternal)
+			DestroyWindow(m->hWnd);
+
+		bs_delete(m);
+	}
+
+	void Win32Window::move(INT32 top, INT32 left)
+	{
+		if (m->hWnd)
+		{
+			m->top = top;
+			m->left = left;
+
+			SetWindowPos(m->hWnd, nullptr, left, top, m->width, m->height, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+		}
+	}
+
+	void Win32Window::resize(UINT32 width, UINT32 height)
+	{
+		if (m->hWnd)
+		{
+			RECT rc = { m->top, m->left, width, height };
+			AdjustWindowRect(&rc, GetWindowLong(m->hWnd, GWL_STYLE), false);
+			width = rc.right - rc.left;
+			height = rc.bottom - rc.top;
+
+			m->width = width;
+			m->height = height;
+
+			SetWindowPos(m->hWnd, nullptr, m->left, m->top, width, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
+		}
+	}
+
+	void Win32Window::setActive(bool state)
+	{
+		if (m->hWnd)
+		{
+			if (state)
+				ShowWindow(m->hWnd, SW_RESTORE);
+			else
+				ShowWindow(m->hWnd, SW_SHOWMINNOACTIVE);
+		}
+	}
+
+	void Win32Window::setHidden(bool hidden)
+	{
+		if (hidden)
+			ShowWindow(m->hWnd, SW_HIDE);
+		else
+			ShowWindow(m->hWnd, SW_SHOWNORMAL);
+	}
+
+	void Win32Window::minimize()
+	{
+		if (m->hWnd)
+			SendMessage(m->hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
+	}
+
+	void Win32Window::maximize()
+	{
+		if (m->hWnd)
+			SendMessage(m->hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
+	}
+
+	void Win32Window::restore()
+	{
+		if (m->hWnd)
+			SendMessage(m->hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
+	}
+
+	void Win32Window::_windowMovedOrResized()
+	{
+		if (!m->hWnd || IsIconic(m->hWnd))
+			return;
+
+		RECT rc;
+		GetWindowRect(m->hWnd, &rc);
+		m->top = rc.top;
+		m->left = rc.left;
+
+		GetClientRect(m->hWnd, &rc);
+		m->width = rc.right - rc.left;
+		m->height = rc.bottom - rc.top;
+	}
+
+	Vector2I Win32Window::screenToWindowPos(const Vector2I& screenPos) const
+	{
+		POINT pos;
+		pos.x = screenPos.x;
+		pos.y = screenPos.y;
+
+		ScreenToClient(m->hWnd, &pos);
+		return Vector2I(pos.x, pos.y);
+	}
+
+	Vector2I Win32Window::windowToScreenPos(const Vector2I& windowPos) const
+	{
+		POINT pos;
+		pos.x = windowPos.x;
+		pos.y = windowPos.y;
+
+		ClientToScreen(m->hWnd, &pos);
+		return Vector2I(pos.x, pos.y);
+	}
+}

+ 2 - 2
BansheeGLRenderAPI/BansheeGLRenderAPI.vcxproj

@@ -285,7 +285,7 @@
     <ClInclude Include="Include\BsWin32GLSupport.h" />
     <ClInclude Include="Include\BsWin32GLSupport.h" />
     <ClInclude Include="Include\BsWin32Prerequisites.h" />
     <ClInclude Include="Include\BsWin32Prerequisites.h" />
     <ClInclude Include="Include\BsWin32VideoModeInfo.h" />
     <ClInclude Include="Include\BsWin32VideoModeInfo.h" />
-    <ClInclude Include="Include\BsWin32Window.h" />
+    <ClInclude Include="Include\BsWin32RenderWindow.h" />
     <ClInclude Include="Source\GLSL\include\BsGLSLGpuProgram.h" />
     <ClInclude Include="Source\GLSL\include\BsGLSLGpuProgram.h" />
     <ClInclude Include="Source\GLSL\include\BsGLSLParamParser.h" />
     <ClInclude Include="Source\GLSL\include\BsGLSLParamParser.h" />
     <ClInclude Include="Source\GLSL\include\BsGLSLProgramFactory.h" />
     <ClInclude Include="Source\GLSL\include\BsGLSLProgramFactory.h" />
@@ -319,7 +319,7 @@
     <ClCompile Include="Source\BsGLTextureManager.cpp" />
     <ClCompile Include="Source\BsGLTextureManager.cpp" />
     <ClCompile Include="Source\BsWin32GLSupport.cpp" />
     <ClCompile Include="Source\BsWin32GLSupport.cpp" />
     <ClCompile Include="Source\BsWin32VideoModeInfo.cpp" />
     <ClCompile Include="Source\BsWin32VideoModeInfo.cpp" />
-    <ClCompile Include="Source\BsWin32Window.cpp" />
+    <ClCompile Include="Source\BsWin32RenderWindow.cpp" />
     <ClCompile Include="Source\glew.cpp" />
     <ClCompile Include="Source\glew.cpp" />
     <ClCompile Include="Source\GLSL\src\BsGLSLGpuProgram.cpp" />
     <ClCompile Include="Source\GLSL\src\BsGLSLGpuProgram.cpp" />
     <ClCompile Include="Source\GLSL\src\BsGLSLProgramFactory.cpp" />
     <ClCompile Include="Source\GLSL\src\BsGLSLProgramFactory.cpp" />

+ 6 - 6
BansheeGLRenderAPI/BansheeGLRenderAPI.vcxproj.filters

@@ -90,9 +90,6 @@
     <ClInclude Include="Include\BsGLContext.h">
     <ClInclude Include="Include\BsGLContext.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\BsWin32Window.h">
-      <Filter>Header Files\Win32</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsWin32VideoModeInfo.h">
     <ClInclude Include="Include\BsWin32VideoModeInfo.h">
       <Filter>Header Files\Win32</Filter>
       <Filter>Header Files\Win32</Filter>
     </ClInclude>
     </ClInclude>
@@ -126,6 +123,9 @@
     <ClInclude Include="Include\BsGLRenderAPIFactory.h">
     <ClInclude Include="Include\BsGLRenderAPIFactory.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
+    <ClInclude Include="Include\BsWin32RenderWindow.h">
+      <Filter>Header Files\Win32</Filter>
+    </ClInclude>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClCompile Include="Source\glew.cpp">
     <ClCompile Include="Source\glew.cpp">
@@ -194,9 +194,6 @@
     <ClCompile Include="Source\BsGLContext.cpp">
     <ClCompile Include="Source\BsGLContext.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="Source\BsWin32Window.cpp">
-      <Filter>Source Files\Win32</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsWin32VideoModeInfo.cpp">
     <ClCompile Include="Source\BsWin32VideoModeInfo.cpp">
       <Filter>Source Files\Win32</Filter>
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
     </ClCompile>
@@ -224,5 +221,8 @@
     <ClCompile Include="Source\BsGLRenderAPIFactory.cpp">
     <ClCompile Include="Source\BsGLRenderAPIFactory.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
+    <ClCompile Include="Source\BsWin32RenderWindow.cpp">
+      <Filter>Source Files\Win32</Filter>
+    </ClCompile>
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 1 - 1
BansheeGLRenderAPI/Include/BsWin32GLSupport.h

@@ -86,7 +86,7 @@ namespace BansheeEngine
 		static LRESULT CALLBACK dummyWndProc(HWND hwnd, UINT umsg, WPARAM wp, LPARAM lp);
 		static LRESULT CALLBACK dummyWndProc(HWND hwnd, UINT umsg, WPARAM wp, LPARAM lp);
 
 
 		Vector<DEVMODE> mDevModes;
 		Vector<DEVMODE> mDevModes;
-		Win32WindowCore *mInitialWindow;
+		Win32RenderWindowCore *mInitialWindow;
 		Vector<int> mMultisampleLevels;
 		Vector<int> mMultisampleLevels;
 		bool mHasPixelFormatARB;
 		bool mHasPixelFormatARB;
         bool mHasMultisample;
         bool mHasMultisample;

+ 2 - 2
BansheeGLRenderAPI/Include/BsWin32Prerequisites.h

@@ -6,9 +6,9 @@
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
     class Win32GLSupport;
     class Win32GLSupport;
-    class Win32Window;
+    class Win32RenderWindow;
     class Win32Context;
     class Win32Context;
-	class Win32WindowCore;
+	class Win32RenderWindowCore;
 
 
 	/**
 	/**
 	 * @brief	Retrieves last Windows API error and returns a description of it.
 	 * @brief	Retrieves last Windows API error and returns a description of it.

+ 12 - 12
BansheeGLRenderAPI/Include/BsWin32Window.h → BansheeGLRenderAPI/Include/BsWin32RenderWindow.h

@@ -5,7 +5,7 @@
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
-	class Win32Window;
+	class Win32RenderWindow;
 
 
 	/**
 	/**
 	 * @brief	Contains various properties that describe a render window.
 	 * @brief	Contains various properties that describe a render window.
@@ -17,8 +17,8 @@ namespace BansheeEngine
 		virtual ~Win32RenderWindowProperties() { }
 		virtual ~Win32RenderWindowProperties() { }
 
 
 	private:
 	private:
-		friend class Win32WindowCore;
-		friend class Win32Window;
+		friend class Win32RenderWindowCore;
+		friend class Win32RenderWindow;
 	};
 	};
 
 
 	/**
 	/**
@@ -26,11 +26,11 @@ namespace BansheeEngine
 	 *
 	 *
 	 * @note	Core thread only.
 	 * @note	Core thread only.
 	 */
 	 */
-    class BS_RSGL_EXPORT Win32WindowCore : public RenderWindowCore
+    class BS_RSGL_EXPORT Win32RenderWindowCore : public RenderWindowCore
     {
     {
     public:
     public:
-		Win32WindowCore(const RENDER_WINDOW_DESC& desc, UINT32 windowId, Win32GLSupport &glsupport);
-		~Win32WindowCore();
+		Win32RenderWindowCore(const RENDER_WINDOW_DESC& desc, UINT32 windowId, Win32GLSupport &glsupport);
+		~Win32RenderWindowCore();
 
 
 		/**
 		/**
 		 * @copydoc RenderWindowCore::setFullscreen(UINT32, UINT32, float, UINT32)
 		 * @copydoc RenderWindowCore::setFullscreen(UINT32, UINT32, float, UINT32)
@@ -141,7 +141,7 @@ namespace BansheeEngine
 		void syncProperties() override;
 		void syncProperties() override;
 
 
 	protected:
 	protected:
-		friend class Win32Window;
+		friend class Win32RenderWindow;
 
 
 		Win32GLSupport &mGLSupport;
 		Win32GLSupport &mGLSupport;
 		HDC	mHDC;
 		HDC	mHDC;
@@ -164,10 +164,10 @@ namespace BansheeEngine
 	 *
 	 *
 	 * @note	Sim thread only.
 	 * @note	Sim thread only.
 	 */
 	 */
-	class BS_RSGL_EXPORT Win32Window : public RenderWindow
+	class BS_RSGL_EXPORT Win32RenderWindow : public RenderWindow
 	{
 	{
 	public:
 	public:
-		~Win32Window() { }
+		~Win32RenderWindow() { }
 
 
 		/**
 		/**
 		 * @copydoc RenderWindow::screenToWindowPos
 		 * @copydoc RenderWindow::screenToWindowPos
@@ -187,14 +187,14 @@ namespace BansheeEngine
 		/**
 		/**
 		 * @copydoc	RenderWindow::getCore
 		 * @copydoc	RenderWindow::getCore
 		 */
 		 */
-		SPtr<Win32WindowCore> getCore() const;
+		SPtr<Win32RenderWindowCore> getCore() const;
 
 
 	protected:
 	protected:
 		friend class GLRenderWindowManager;
 		friend class GLRenderWindowManager;
 		friend class Win32GLSupport;
 		friend class Win32GLSupport;
-		friend class Win32WindowCore;
+		friend class Win32RenderWindowCore;
 
 
-		Win32Window(const RENDER_WINDOW_DESC& desc, UINT32 windowId, Win32GLSupport& glsupport);
+		Win32RenderWindow(const RENDER_WINDOW_DESC& desc, UINT32 windowId, Win32GLSupport& glsupport);
 
 
 		/**
 		/**
 		 * @copydoc	RenderWindow::getProperties
 		 * @copydoc	RenderWindow::getProperties

+ 5 - 5
BansheeGLRenderAPI/Source/BsWin32GLSupport.cpp

@@ -1,6 +1,6 @@
 #include "BsWin32GLSupport.h"
 #include "BsWin32GLSupport.h"
 #include "BsGLTexture.h"
 #include "BsGLTexture.h"
-#include "BsWin32Window.h"
+#include "BsWin32RenderWindow.h"
 #include "BsGLRenderAPI.h"
 #include "BsGLRenderAPI.h"
 #include "BsWin32Context.h"
 #include "BsWin32Context.h"
 #include "BsWin32VideoModeInfo.h"
 #include "BsWin32VideoModeInfo.h"
@@ -35,18 +35,18 @@ namespace BansheeEngine
 			desc.platformSpecific["parentWindowHandle"] = toString(hWnd);
 			desc.platformSpecific["parentWindowHandle"] = toString(hWnd);
 		}
 		}
 
 
-		Win32Window* window = new (bs_alloc<Win32Window>()) Win32Window(desc, windowId, *this);
-		return RenderWindowPtr(window, &CoreObject::_delete<Win32Window, GenAlloc>);
+		Win32RenderWindow* window = new (bs_alloc<Win32RenderWindow>()) Win32RenderWindow(desc, windowId, *this);
+		return RenderWindowPtr(window, &CoreObject::_delete<Win32RenderWindow, GenAlloc>);
 	}
 	}
 
 
 	SPtr<RenderWindowCore> Win32GLSupport::newWindowCore(RENDER_WINDOW_DESC& desc, UINT32 windowId)
 	SPtr<RenderWindowCore> Win32GLSupport::newWindowCore(RENDER_WINDOW_DESC& desc, UINT32 windowId)
 	{
 	{
-		Win32WindowCore* window = new (bs_alloc<Win32WindowCore>()) Win32WindowCore(desc, windowId, *this);
+		Win32RenderWindowCore* window = new (bs_alloc<Win32RenderWindowCore>()) Win32RenderWindowCore(desc, windowId, *this);
 
 
 		if (!mInitialWindow)
 		if (!mInitialWindow)
 			mInitialWindow = window;
 			mInitialWindow = window;
 
 
-		return bs_shared_ptr<Win32WindowCore>(window);
+		return bs_shared_ptr<Win32RenderWindowCore>(window);
 	}
 	}
 
 
 	void Win32GLSupport::start()
 	void Win32GLSupport::start()

+ 28 - 28
BansheeGLRenderAPI/Source/BsWin32Window.cpp → BansheeGLRenderAPI/Source/BsWin32RenderWindow.cpp

@@ -2,7 +2,7 @@
 #define _WIN32_WINNT 0x0500
 #define _WIN32_WINNT 0x0500
 #endif
 #endif
 
 
-#include "BsWin32Window.h"
+#include "BsWin32RenderWindow.h"
 #include "BsInput.h"
 #include "BsInput.h"
 #include "BsRenderAPI.h"
 #include "BsRenderAPI.h"
 #include "BsCoreThread.h"
 #include "BsCoreThread.h"
@@ -24,13 +24,13 @@ namespace BansheeEngine
 		:RenderWindowProperties(desc)
 		:RenderWindowProperties(desc)
 	{ }
 	{ }
 
 
-	Win32WindowCore::Win32WindowCore(const RENDER_WINDOW_DESC& desc, UINT32 windowId, Win32GLSupport& glsupport)
+	Win32RenderWindowCore::Win32RenderWindowCore(const RENDER_WINDOW_DESC& desc, UINT32 windowId, Win32GLSupport& glsupport)
 		: RenderWindowCore(desc, windowId), mProperties(desc), mSyncedProperties(desc), mGLSupport(glsupport), mContext(0), 
 		: RenderWindowCore(desc, windowId), mProperties(desc), mSyncedProperties(desc), mGLSupport(glsupport), mContext(0), 
 		mWindowedStyle(0), mWindowedStyleEx(0), mIsExternal(false), mIsExternalGLControl(false), mDisplayFrequency(0), 
 		mWindowedStyle(0), mWindowedStyleEx(0), mIsExternal(false), mIsExternalGLControl(false), mDisplayFrequency(0), 
 		mDeviceName(nullptr), mHWnd(0), mShowOnSwap(false)
 		mDeviceName(nullptr), mHWnd(0), mShowOnSwap(false)
 	{ }
 	{ }
 
 
-	Win32WindowCore::~Win32WindowCore()
+	Win32RenderWindowCore::~Win32RenderWindowCore()
 	{ 
 	{ 
 		Win32RenderWindowProperties& props = mProperties;
 		Win32RenderWindowProperties& props = mProperties;
 
 
@@ -60,7 +60,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void Win32WindowCore::initialize()
+	void Win32RenderWindowCore::initialize()
 	{
 	{
 		RenderWindowCore::initialize();
 		RenderWindowCore::initialize();
 
 
@@ -368,7 +368,7 @@ namespace BansheeEngine
 		RenderWindowManager::instance().notifySyncDataDirty(this);
 		RenderWindowManager::instance().notifySyncDataDirty(this);
 	}
 	}
 
 
-	void Win32WindowCore::setFullscreen(UINT32 width, UINT32 height, float refreshRate, UINT32 monitorIdx)
+	void Win32RenderWindowCore::setFullscreen(UINT32 width, UINT32 height, float refreshRate, UINT32 monitorIdx)
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -431,14 +431,14 @@ namespace BansheeEngine
 		RenderWindowManager::instance().notifyMovedOrResized(this);
 		RenderWindowManager::instance().notifyMovedOrResized(this);
 	}
 	}
 
 
-	void Win32WindowCore::setFullscreen(const VideoMode& mode)
+	void Win32RenderWindowCore::setFullscreen(const VideoMode& mode)
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
 		setFullscreen(mode.getWidth(), mode.getHeight(), mode.getRefreshRate(), mode.getOutputIdx());
 		setFullscreen(mode.getWidth(), mode.getHeight(), mode.getRefreshRate(), mode.getOutputIdx());
 	}
 	}
 
 
-	void Win32WindowCore::setWindowed(UINT32 width, UINT32 height)
+	void Win32RenderWindowCore::setWindowed(UINT32 width, UINT32 height)
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -486,7 +486,7 @@ namespace BansheeEngine
 		_windowMovedOrResized();
 		_windowMovedOrResized();
 	}
 	}
 
 
-	void Win32WindowCore::move(INT32 left, INT32 top)
+	void Win32RenderWindowCore::move(INT32 left, INT32 top)
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -509,7 +509,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void Win32WindowCore::resize(UINT32 width, UINT32 height)
+	void Win32RenderWindowCore::resize(UINT32 width, UINT32 height)
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -536,7 +536,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void Win32WindowCore::minimize()
+	void Win32RenderWindowCore::minimize()
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -544,7 +544,7 @@ namespace BansheeEngine
 			SendMessage(mHWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
 			SendMessage(mHWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
 	}
 	}
 
 
-	void Win32WindowCore::maximize()
+	void Win32RenderWindowCore::maximize()
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -552,7 +552,7 @@ namespace BansheeEngine
 			SendMessage(mHWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
 			SendMessage(mHWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
 	}
 	}
 
 
-	void Win32WindowCore::restore()
+	void Win32RenderWindowCore::restore()
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -560,7 +560,7 @@ namespace BansheeEngine
 			SendMessage(mHWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
 			SendMessage(mHWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
 	}
 	}
 
 
-	void Win32WindowCore::swapBuffers()
+	void Win32RenderWindowCore::swapBuffers()
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -572,7 +572,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void Win32WindowCore::copyToMemory(PixelData &dst, FrameBuffer buffer)
+	void Win32RenderWindowCore::copyToMemory(PixelData &dst, FrameBuffer buffer)
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -626,7 +626,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void Win32WindowCore::getCustomAttribute(const String& name, void* pData) const
+	void Win32RenderWindowCore::getCustomAttribute(const String& name, void* pData) const
 	{
 	{
 		if(name == "GLCONTEXT") 
 		if(name == "GLCONTEXT") 
 		{
 		{
@@ -642,7 +642,7 @@ namespace BansheeEngine
 		} 
 		} 
 	}
 	}
 
 
-	void Win32WindowCore::setActive(bool state)
+	void Win32RenderWindowCore::setActive(bool state)
 	{	
 	{	
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -659,7 +659,7 @@ namespace BansheeEngine
 		RenderWindowCore::setActive(state);
 		RenderWindowCore::setActive(state);
 	}
 	}
 
 
-	void Win32WindowCore::setHidden(bool hidden)
+	void Win32RenderWindowCore::setHidden(bool hidden)
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
@@ -678,7 +678,7 @@ namespace BansheeEngine
 		RenderWindowCore::setHidden(hidden);
 		RenderWindowCore::setHidden(hidden);
 	}
 	}
 
 
-	void Win32WindowCore::_windowMovedOrResized()
+	void Win32RenderWindowCore::_windowMovedOrResized()
 	{
 	{
 		Win32RenderWindowProperties& props = mProperties;
 		Win32RenderWindowProperties& props = mProperties;
 
 
@@ -697,7 +697,7 @@ namespace BansheeEngine
 		RenderWindowCore::_windowMovedOrResized();
 		RenderWindowCore::_windowMovedOrResized();
 	}
 	}
 
 
-	void Win32WindowCore::getAdjustedWindowSize(UINT32 clientWidth, UINT32 clientHeight, UINT32* winWidth, UINT32* winHeight)
+	void Win32RenderWindowCore::getAdjustedWindowSize(UINT32 clientWidth, UINT32 clientHeight, UINT32* winWidth, UINT32* winHeight)
 	{
 	{
 		Win32RenderWindowProperties& props = mProperties;
 		Win32RenderWindowProperties& props = mProperties;
 
 
@@ -727,19 +727,19 @@ namespace BansheeEngine
 			*winHeight = maxH;
 			*winHeight = maxH;
 	}
 	}
 
 
-	void Win32WindowCore::syncProperties()
+	void Win32RenderWindowCore::syncProperties()
 	{
 	{
 		ScopedSpinLock lock(mLock);
 		ScopedSpinLock lock(mLock);
 		mProperties = mSyncedProperties;
 		mProperties = mSyncedProperties;
 	}
 	}
 
 
-	Win32Window::Win32Window(const RENDER_WINDOW_DESC& desc, UINT32 windowId, Win32GLSupport &glsupport)
+	Win32RenderWindow::Win32RenderWindow(const RENDER_WINDOW_DESC& desc, UINT32 windowId, Win32GLSupport &glsupport)
 		:RenderWindow(desc, windowId), mGLSupport(glsupport), mProperties(desc)
 		:RenderWindow(desc, windowId), mGLSupport(glsupport), mProperties(desc)
 	{
 	{
 
 
 	}
 	}
 
 
-	void Win32Window::getCustomAttribute(const String& name, void* pData) const
+	void Win32RenderWindow::getCustomAttribute(const String& name, void* pData) const
 	{
 	{
 		if (name == "WINDOW")
 		if (name == "WINDOW")
 		{
 		{
@@ -749,7 +749,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	Vector2I Win32Window::screenToWindowPos(const Vector2I& screenPos) const
+	Vector2I Win32RenderWindow::screenToWindowPos(const Vector2I& screenPos) const
 	{
 	{
 		POINT pos;
 		POINT pos;
 		pos.x = screenPos.x;
 		pos.x = screenPos.x;
@@ -759,7 +759,7 @@ namespace BansheeEngine
 		return Vector2I(pos.x, pos.y);
 		return Vector2I(pos.x, pos.y);
 	}
 	}
 
 
-	Vector2I Win32Window::windowToScreenPos(const Vector2I& windowPos) const
+	Vector2I Win32RenderWindow::windowToScreenPos(const Vector2I& windowPos) const
 	{
 	{
 		POINT pos;
 		POINT pos;
 		pos.x = windowPos.x;
 		pos.x = windowPos.x;
@@ -769,18 +769,18 @@ namespace BansheeEngine
 		return Vector2I(pos.x, pos.y);
 		return Vector2I(pos.x, pos.y);
 	}
 	}
 
 
-	SPtr<Win32WindowCore> Win32Window::getCore() const
+	SPtr<Win32RenderWindowCore> Win32RenderWindow::getCore() const
 	{
 	{
-		return std::static_pointer_cast<Win32WindowCore>(mCoreSpecific);
+		return std::static_pointer_cast<Win32RenderWindowCore>(mCoreSpecific);
 	}
 	}
 
 
-	void Win32Window::syncProperties()
+	void Win32RenderWindow::syncProperties()
 	{
 	{
 		ScopedSpinLock lock(getCore()->mLock);
 		ScopedSpinLock lock(getCore()->mLock);
 		mProperties = getCore()->mSyncedProperties;
 		mProperties = getCore()->mSyncedProperties;
 	}
 	}
 
 
-	HWND Win32Window::getHWnd() const
+	HWND Win32RenderWindow::getHWnd() const
 	{
 	{
 		// HACK: I'm accessing core method from sim thread, which means an invalid handle
 		// HACK: I'm accessing core method from sim thread, which means an invalid handle
 		// could be returned here if requested too soon after initialization.
 		// could be returned here if requested too soon after initialization.

+ 0 - 8
TODO.txt

@@ -13,14 +13,6 @@ ProjectLibrary import
 I'm not sure if queued dependencies are handled properly. They're handled on an internal ProjectLibrary loop but perhaps I should
 I'm not sure if queued dependencies are handled properly. They're handled on an internal ProjectLibrary loop but perhaps I should
 return them in checkForModifications?
 return them in checkForModifications?
 
 
----------------------------------------------------------------------
-Prefab diff
-
- Test (likely later once I have more editor functionality working):
-  - Game object handle compare
-  - ID restore systems 
-  - Native+Managed diff (only the link between the two)
-
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 Polish
 Polish