2
0
Эх сурвалжийг харах

Switch to lowercase namespace

Daniele Bartolini 13 жил өмнө
parent
commit
a514186ce4
100 өөрчлөгдсөн 655 нэмэгдсэн , 767 устгасан
  1. 0 5
      src/CMakeLists.txt
  2. 2 2
      src/Camera.cpp
  3. 2 2
      src/Camera.h
  4. 0 1
      src/Crown.h
  5. 2 2
      src/Data.h
  6. 56 83
      src/Device.cpp
  7. 2 5
      src/Device.h
  8. 2 2
      src/EventBuffer.cpp
  9. 2 2
      src/EventBuffer.h
  10. 6 6
      src/EventLoop.cpp
  11. 2 2
      src/EventLoop.h
  12. 13 13
      src/Filesystem.cpp
  13. 2 2
      src/Filesystem.h
  14. 2 2
      src/Font.cpp
  15. 2 2
      src/Font.h
  16. 2 2
      src/FontManager.cpp
  17. 2 2
      src/FontManager.h
  18. 2 2
      src/Glyph.h
  19. 2 2
      src/Image.cpp
  20. 2 2
      src/Image.h
  21. 1 1
      src/ImageLoader.cpp
  22. 2 2
      src/ImageLoader.h
  23. 1 1
      src/IndexBuffer.h
  24. 6 6
      src/Log.cpp
  25. 2 2
      src/Log.h
  26. 2 2
      src/Material.cpp
  27. 2 2
      src/Material.h
  28. 2 2
      src/MaterialManager.cpp
  29. 2 2
      src/MaterialManager.h
  30. 2 2
      src/Mesh.cpp
  31. 2 2
      src/Mesh.h
  32. 2 2
      src/MeshChunk.cpp
  33. 2 2
      src/MeshChunk.h
  34. 2 2
      src/MeshLoader.h
  35. 2 2
      src/MeshManager.cpp
  36. 2 2
      src/MeshManager.h
  37. 10 10
      src/MovableCamera.cpp
  38. 2 2
      src/MovableCamera.h
  39. 2 2
      src/OcclusionQuery.h
  40. 2 2
      src/ParticleEmitter.cpp
  41. 2 2
      src/ParticleEmitter.h
  42. 2 2
      src/ParticleManager.cpp
  43. 2 2
      src/ParticleManager.h
  44. 1 1
      src/PhysicNode.cpp
  45. 1 1
      src/PhysicNode.h
  46. 1 1
      src/PhysicsManager.cpp
  47. 1 1
      src/PhysicsManager.h
  48. 1 1
      src/PhysicsSystem.cpp
  49. 2 2
      src/PhysicsSystem.h
  50. 2 2
      src/Pixel.cpp
  51. 2 2
      src/Pixel.h
  52. 2 2
      src/Renderer.cpp
  53. 2 2
      src/Renderer.h
  54. 2 2
      src/Resource.h
  55. 2 2
      src/ResourceManager.cpp
  56. 2 2
      src/ResourceManager.h
  57. 2 2
      src/Skybox.cpp
  58. 2 2
      src/Skybox.h
  59. 2 2
      src/SpriteAnimator.cpp
  60. 2 2
      src/SpriteAnimator.h
  61. 2 2
      src/System.h
  62. 2 2
      src/Terrain.cpp
  63. 2 2
      src/Terrain.h
  64. 2 2
      src/TextRenderer.cpp
  65. 2 2
      src/TextRenderer.h
  66. 2 2
      src/Texture.h
  67. 2 2
      src/TextureManager.h
  68. 1 1
      src/VertexBuffer.h
  69. 2 2
      src/World.h
  70. 5 4
      src/os/OS.cpp
  71. 51 21
      src/os/OS.h
  72. 2 2
      src/os/android/AndroidInputManager.cpp
  73. 2 2
      src/os/android/AndroidInputManager.h
  74. 2 2
      src/os/android/AndroidOS.cpp
  75. 2 2
      src/os/android/AndroidRenderWindow.cpp
  76. 2 2
      src/os/android/AndroidRenderWindow.h
  77. 2 2
      src/os/android/AndroidTimer.cpp
  78. 2 2
      src/os/android/AndroidTimer.h
  79. 2 2
      src/os/android/AndroidTouch.cpp
  80. 1 1
      src/os/android/AndroidTouch.h
  81. 2 2
      src/os/linux/EGLRenderWindow.cpp
  82. 2 2
      src/os/linux/EGLRenderWindow.h
  83. 208 163
      src/os/linux/GLXRenderWindow.cpp
  84. 50 40
      src/os/linux/LinuxOS.cpp
  85. 2 2
      src/os/linux/LinuxTimer.cpp
  86. 2 2
      src/os/linux/LinuxTimer.h
  87. 32 120
      src/os/linux/X11Keyboard.cpp
  88. 2 5
      src/os/linux/X11Keyboard.h
  89. 53 121
      src/os/linux/X11Mouse.cpp
  90. 2 5
      src/os/linux/X11Mouse.h
  91. 2 2
      src/os/win/WGLRenderWindow.cpp
  92. 2 2
      src/os/win/WGLRenderWindow.h
  93. 2 2
      src/os/win/WinInputManager.cpp
  94. 2 2
      src/os/win/WinInputManager.h
  95. 2 2
      src/os/win/WinKeyboard.cpp
  96. 2 2
      src/os/win/WinKeyboard.h
  97. 2 2
      src/os/win/WinMouse.cpp
  98. 2 2
      src/os/win/WinMouse.h
  99. 2 2
      src/os/win/WinOS.cpp
  100. 2 2
      src/os/win/WinTimer.cpp

+ 0 - 5
src/CMakeLists.txt

@@ -17,7 +17,6 @@ set (SRC
 	MovableCamera.cpp
 	MovableCamera.cpp
 	Pixel.cpp
 	Pixel.cpp
 	Renderer.cpp
 	Renderer.cpp
-	RenderWindow.cpp
 	ResourceManager.cpp
 	ResourceManager.cpp
 	Skybox.cpp
 	Skybox.cpp
 	Terrain.cpp
 	Terrain.cpp
@@ -51,7 +50,6 @@ set (HEADERS
 	OcclusionQuery.h
 	OcclusionQuery.h
 	Pixel.h
 	Pixel.h
 	Renderer.h
 	Renderer.h
-	RenderWindow.h
 	Resource.h
 	Resource.h
 	ResourceManager.h
 	ResourceManager.h
 	Skybox.h
 	Skybox.h
@@ -227,16 +225,13 @@ set (LINUX_SRC
 	os/linux/GLXRenderWindow.cpp
 	os/linux/GLXRenderWindow.cpp
 	os/linux/LinuxOS.cpp
 	os/linux/LinuxOS.cpp
 	os/linux/LinuxTimer.cpp
 	os/linux/LinuxTimer.cpp
-	os/linux/X11InputManager.cpp
 	os/linux/X11Keyboard.cpp
 	os/linux/X11Keyboard.cpp
 	os/linux/X11Mouse.cpp
 	os/linux/X11Mouse.cpp
 )
 )
 
 
 set (LINUX_HEADERS
 set (LINUX_HEADERS
 #	os/linux/EGLRenderWindow.h
 #	os/linux/EGLRenderWindow.h
-	os/linux/GLXRenderWindow.h
 	os/linux/LinuxTimer.h
 	os/linux/LinuxTimer.h
-	os/linux/X11InputManager.h
 	os/linux/X11Keyboard.h
 	os/linux/X11Keyboard.h
 	os/linux/X11Mouse.h
 	os/linux/X11Mouse.h
 )
 )

+ 2 - 2
src/Camera.cpp

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Types.h"
 #include "Types.h"
 #include "Renderer.h"
 #include "Renderer.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Camera::Camera(const Vec3& position, const Angles& axis,
 Camera::Camera(const Vec3& position, const Angles& axis,
@@ -173,5 +173,5 @@ void Camera::UpdateFrustum()
 	mFrustum.from_matrix(mProjection * mView);
 	mFrustum.from_matrix(mProjection * mView);
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Camera.h

@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Mat4.h"
 #include "Mat4.h"
 #include "Vec3.h"
 #include "Vec3.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Camera
 class Camera
@@ -131,5 +131,5 @@ protected:
 	bool mAutoAspect	: 1;
 	bool mAutoAspect	: 1;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 0 - 1
src/Crown.h

@@ -100,7 +100,6 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "PhysicsManager.h"
 #include "PhysicsManager.h"
 #include "PhysicNode.h"
 #include "PhysicNode.h"
 #include "Pixel.h"
 #include "Pixel.h"
-#include "RenderWindow.h"
 #include "Renderer.h"
 #include "Renderer.h"
 #include "ResourceManager.h"
 #include "ResourceManager.h"
 #include "Skybox.h"
 #include "Skybox.h"

+ 2 - 2
src/Data.h

@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Vec3.h"
 #include "Vec3.h"
 #include "Color4.h"
 #include "Color4.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 struct VertexData
 struct VertexData
@@ -74,5 +74,5 @@ struct FaceData
 	ushort vertex[3];
 	ushort vertex[3];
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 56 - 83
src/Device.cpp

@@ -31,15 +31,14 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "InputManager.h"
 #include "InputManager.h"
 #include "Log.h"
 #include "Log.h"
 #include "Renderer.h"
 #include "Renderer.h"
-#include "RenderWindow.h"
 #include "GarbageBin.h"
 #include "GarbageBin.h"
-#include "RenderWindow.h"
 #include "Config.h"
 #include "Config.h"
 #include "Filesystem.h"
 #include "Filesystem.h"
 #include "Timer.h"
 #include "Timer.h"
 #include "OS.h"
 #include "OS.h"
+#include <cstdlib>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 const ushort Device::CROWN_MAJOR = 0;
 const ushort Device::CROWN_MAJOR = 0;
@@ -55,7 +54,6 @@ Device::Device() :
 	mPreferredUserPath(Str::EMPTY),
 	mPreferredUserPath(Str::EMPTY),
 	mIsInit(false),
 	mIsInit(false),
 	mIsRunning(false),
 	mIsRunning(false),
-	mMainWindow(NULL),
 	mInputManager(NULL),
 	mInputManager(NULL),
 	mRenderer(NULL),
 	mRenderer(NULL),
 	mGarbageBin(NULL)
 	mGarbageBin(NULL)
@@ -76,7 +74,7 @@ bool Device::Init(int argc, char** argv)
 	}
 	}
 
 
 	// Initialize
 	// Initialize
-	Log::D("Device::Init() called.");
+	Log::D("Initializing Device...");
 
 
 	if (IsInit())
 	if (IsInit())
 	{
 	{
@@ -87,48 +85,52 @@ bool Device::Init(int argc, char** argv)
 	// Sets the root path
 	// Sets the root path
 	GetFilesystem()->Init(mPreferredRootPath.c_str(), mPreferredUserPath.c_str());
 	GetFilesystem()->Init(mPreferredRootPath.c_str(), mPreferredUserPath.c_str());
 
 
-	if (!(mMainWindow = RenderWindow::CreateWindow(0, 0, mPreferredWindowWidth, mPreferredWindowHeight, 32, mPreferredWindowFullscreen)))
+	// Creates the main window
+	if (!os::create_render_window(0, 0, mPreferredWindowWidth, mPreferredWindowHeight, mPreferredWindowFullscreen))
 	{
 	{
 		Log::E("Unuble to create the main window.");
 		Log::E("Unuble to create the main window.");
 		return false;
 		return false;
 	}
 	}
+	Log::D("Window created.");
 
 
+	// Creates the garbage bin
 	mGarbageBin = new GarbageBin();
 	mGarbageBin = new GarbageBin();
 
 
-	Log::D("Window created.");
-
+	// Creates the renderer
 	if (!mRenderer)
 	if (!mRenderer)
 	{
 	{
 		mRenderer = Renderer::CreateRenderer();
 		mRenderer = Renderer::CreateRenderer();
 	}
 	}
 	Log::D("Renderer created.");
 	Log::D("Renderer created.");
 
 
-	mInputManager = InputManager::CreateInputManager(mMainWindow);
-
-	Mouse* mouse = NULL;
-	Keyboard* keyboard = NULL;
-	Touch* touch = NULL;
-
-	if (mInputManager)
-	{
-		keyboard = mInputManager->GetKeyboard();
-		mouse = mInputManager->GetMouse();
-		touch = mInputManager->GetTouch();
-	}
-
-	if (mouse)
-	{
-		mouse->SetListener(mInputManager->GetEventDispatcher());
-	}
-	if (keyboard)
-	{
-		keyboard->SetListener(mInputManager->GetEventDispatcher());
-	}
-	if (touch)
-	{
-		touch->SetListener(mInputManager->GetEventDispatcher());
-	}
-	Log::D("Input created.");
+	
+//	// Creates the input manager
+//	mInputManager = GetInputManager();
+
+//	Mouse* mouse = NULL;
+//	Keyboard* keyboard = NULL;
+//	Touch* touch = NULL;
+
+//	if (mInputManager)
+//	{
+//		keyboard = mInputManager->GetKeyboard();
+//		mouse = mInputManager->GetMouse();
+//		touch = mInputManager->GetTouch();
+//	}
+
+//	if (mouse)
+//	{
+//		mouse->SetListener(mInputManager->GetEventDispatcher());
+//	}
+//	if (keyboard)
+//	{
+//		keyboard->SetListener(mInputManager->GetEventDispatcher());
+//	}
+//	if (touch)
+//	{
+//		touch->SetListener(mInputManager->GetEventDispatcher());
+//	}
+	Log::D("InputManager created.");
 
 
 	mIsInit = true;
 	mIsInit = true;
 
 
@@ -172,16 +174,11 @@ void Device::Shutdown()
 	Log::I("Releasing InputManager...");
 	Log::I("Releasing InputManager...");
 	if (mInputManager)
 	if (mInputManager)
 	{
 	{
-		InputManager::DestroyInputManager(mInputManager);
+		// do nothing
 	}
 	}
 
 
-	Log::I("Releasing Main Window...");
-
-	if (mMainWindow)
-	{
-		mMainWindow->_SetMain(false);
-		RenderWindow::DestroyWindow(mMainWindow);
-	}
+	Log::I("Releasing Render Window...");
+	os::destroy_render_window();
 
 
 	mIsInit = false;
 	mIsInit = false;
 }
 }
@@ -198,12 +195,6 @@ Renderer* Device::GetRenderer()
 	return mRenderer;
 	return mRenderer;
 }
 }
 
 
-//-----------------------------------------------------------------------------
-RenderWindow* Device::GetMainWindow()
-{
-	return mMainWindow;
-}
-
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 GarbageBin* Device::GetGarbageBin()
 GarbageBin* Device::GetGarbageBin()
 {
 {
@@ -241,32 +232,14 @@ bool Device::IsRunning() const
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void Device::Frame()
 void Device::Frame()
 {
 {
-	// TODO Replace this mess
-	if (mInputManager)
-	{
-		if (mInputManager->IsMouseAvailable())
-		{
-			if (mInputManager->IsMouseAvailable())
-			{
-				mInputManager->GetMouse()->EventLoop();
-			}
-			if (mInputManager->IsKeyboardAvailable())
-			{
-				mInputManager->GetKeyboard()->EventLoop();
-			}
-			if (mInputManager->IsTouchAvailable())
-			{
-				mInputManager->GetTouch()->EventLoop();
-			}
-		}
-	}
+	os::event_loop();
 
 
-	mMainWindow->EventLoop();
+	mInputManager->EventLoop();
 
 
-	mRenderer->_BeginFrame();
-	mRenderer->_EndFrame();
+		mRenderer->_BeginFrame();
+		mRenderer->_EndFrame();
 
 
-	mMainWindow->Update();
+	os::swap_buffers();
 
 
 	mGarbageBin->Empty();
 	mGarbageBin->Empty();
 }
 }
@@ -276,15 +249,15 @@ bool Device::ParseCommandLine(int argc, char** argv)
 {
 {
 	if (argc == 2 && Str::StrCmp(argv[1], "-help") == 0)
 	if (argc == 2 && Str::StrCmp(argv[1], "-help") == 0)
 	{
 	{
-		OS::Printf("Usage: %s [options]\n", argv[0]);
-		OS::Printf("Options:\n\n");
-		OS::Printf("All of the following options take precedence over\nenvironment variables and configuration files.\n\n");
+		os::printf("Usage: %s [options]\n", argv[0]);
+		os::printf("Options:\n\n");
+		os::printf("All of the following options take precedence over\nenvironment variables and configuration files.\n\n");
 		// Print options
 		// Print options
-		OS::Printf("  -help\t\t\t\t\tShow this help\n");
-		OS::Printf("  -root-path <path>\t\t\tUse <path> as the filesystem root path\n");
-		OS::Printf("  -user-path <path>\t\t\tUse <path> as the filesystem user path\n");
-		OS::Printf("  -metrics <width> <height>\t\tSet the <width> and <height> of the render window\n");
-		OS::Printf("  -fullscreen\t\t\t\tStart in fullscreen\n");
+		os::printf("  -help\t\t\t\t\tShow this help\n");
+		os::printf("  -root-path <path>\t\t\tUse <path> as the filesystem root path\n");
+		os::printf("  -user-path <path>\t\t\tUse <path> as the filesystem user path\n");
+		os::printf("  -metrics <width> <height>\t\tSet the <width> and <height> of the render window\n");
+		os::printf("  -fullscreen\t\t\t\tStart in fullscreen\n");
 
 
 		return false;
 		return false;
 	}
 	}
@@ -297,7 +270,7 @@ bool Device::ParseCommandLine(int argc, char** argv)
 		{
 		{
 			if (argc < i + 2)
 			if (argc < i + 2)
 			{
 			{
-				OS::Printf("%s: error: missing absolute path after `-root-path`\n", argv[0]);
+				os::printf("%s: error: missing absolute path after `-root-path`\n", argv[0]);
 				return false;
 				return false;
 			}
 			}
 			mPreferredRootPath = argv[i + 1];
 			mPreferredRootPath = argv[i + 1];
@@ -309,7 +282,7 @@ bool Device::ParseCommandLine(int argc, char** argv)
 		{
 		{
 			if (argc < i + 2)
 			if (argc < i + 2)
 			{
 			{
-				OS::Printf("%s: error: missing absolute path after `-user-path`\n", argv[0]);
+				os::printf("%s: error: missing absolute path after `-user-path`\n", argv[0]);
 				return false;
 				return false;
 			}
 			}
 			mPreferredUserPath = argv[i + 1];
 			mPreferredUserPath = argv[i + 1];
@@ -321,7 +294,7 @@ bool Device::ParseCommandLine(int argc, char** argv)
 		{
 		{
 			if (argc < i + 3)
 			if (argc < i + 3)
 			{
 			{
-				OS::Printf("%s: error: wrong number of arguments after `-metrics`\n", argv[0]);
+				os::printf("%s: error: wrong number of arguments after `-metrics`\n", argv[0]);
 				return false;
 				return false;
 			}
 			}
 			mPreferredWindowWidth = atoi(argv[i + 1]);
 			mPreferredWindowWidth = atoi(argv[i + 1]);
@@ -351,5 +324,5 @@ Device* GetDevice()
 	return &device;
 	return &device;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 5
src/Device.h

@@ -31,11 +31,10 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Str.h"
 #include "Str.h"
 #include "EventLoop.h"
 #include "EventLoop.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Renderer;
 class Renderer;
-class RenderWindow;
 class InputManager;
 class InputManager;
 class GarbageBin;
 class GarbageBin;
 
 
@@ -50,7 +49,6 @@ public:
 							Device();
 							Device();
 							~Device();
 							~Device();
 
 
-	RenderWindow*			GetMainWindow();
 	InputManager*			GetInputManager();
 	InputManager*			GetInputManager();
 	Renderer*				GetRenderer();
 	Renderer*				GetRenderer();
 	GarbageBin*				GetGarbageBin();
 	GarbageBin*				GetGarbageBin();
@@ -81,7 +79,6 @@ private:
 	bool					mIsInit		: 1;
 	bool					mIsInit		: 1;
 	bool					mIsRunning	: 1;
 	bool					mIsRunning	: 1;
 
 
-	RenderWindow*			mMainWindow;
 	InputManager*			mInputManager;
 	InputManager*			mInputManager;
 	Renderer*				mRenderer;
 	Renderer*				mRenderer;
 
 
@@ -97,5 +94,5 @@ private:
 
 
 Device* GetDevice();
 Device* GetDevice();
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/EventBuffer.cpp

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <cstring>
 #include <cstring>
 #include <stdio.h>
 #include <stdio.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 EventBuffer::EventBuffer() : mBufferCount(0)
 EventBuffer::EventBuffer() : mBufferCount(0)
@@ -109,5 +109,5 @@ char* EventBuffer::GetBuffer()
 	return mBuffer;
 	return mBuffer;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/EventBuffer.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #define MAX_EVENT_QUEUE_SIZE 64 * 1024
 #define MAX_EVENT_QUEUE_SIZE 64 * 1024
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -62,5 +62,5 @@ public:
 	char		mBuffer[MAX_EVENT_QUEUE_SIZE];
 	char		mBuffer[MAX_EVENT_QUEUE_SIZE];
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 6 - 6
src/EventLoop.cpp

@@ -1,28 +1,28 @@
 #include "EventLoop.h"
 #include "EventLoop.h"
 #include "OS.h"
 #include "OS.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 void EventLoop::consume_events()
 void EventLoop::consume_events()
 {
 {
 	while (1)
 	while (1)
 	{
 	{
-		OS::OSEvent event;
+		os::OSEvent event;
 
 
-		event = OS::pop_event();
+		event = os::pop_event();
 
 
-		if (event.type == OS::OSET_NONE)
+		if (event.type == os::OSET_NONE)
 		{
 		{
 			break;
 			break;
 		}
 		}
 
 
-		if (event.type == OS::OSET_KEYBOARD)
+		if (event.type == os::OSET_KEYBOARD)
 		{
 		{
 
 
 		}
 		}
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/EventLoop.h

@@ -1,6 +1,6 @@
 #pragma once
 #pragma once
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -13,5 +13,5 @@ public:
 	void	consume_events();
 	void	consume_events();
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 13 - 13
src/Filesystem.cpp

@@ -34,7 +34,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #undef CreateDirectory
 #undef CreateDirectory
 #endif
 #endif
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -58,11 +58,11 @@ void Filesystem::Init(const char* rootPath, const char* userPath)
 	if (Str::StrCmp(rootPath, Str::EMPTY) == 0)
 	if (Str::StrCmp(rootPath, Str::EMPTY) == 0)
 	{
 	{
 		// Set working paths
 		// Set working paths
-		const char* envRootPath = OS::GetEnv("CROWN_ROOT_PATH");
+		const char* envRootPath = os::get_env("CROWN_ROOT_PATH");
 
 
 		if (envRootPath == Str::EMPTY)
 		if (envRootPath == Str::EMPTY)
 		{
 		{
-			mRootPath = OS::GetCWD();
+			mRootPath = os::get_cwd();
 		}
 		}
 		else
 		else
 		{
 		{
@@ -76,7 +76,7 @@ void Filesystem::Init(const char* rootPath, const char* userPath)
 
 
 	if (userPath == Str::EMPTY)
 	if (userPath == Str::EMPTY)
 	{
 	{
-		mUserPath = OS::GetHome();
+		mUserPath = os::get_home();
 	}
 	}
 	else
 	else
 	{
 	{
@@ -136,7 +136,7 @@ const char* Filesystem::BuildOSPath(const char* basePath, const char* relativePa
 	{
 	{
 		if (osPath[j] == '/')
 		if (osPath[j] == '/')
 		{
 		{
-			osPath[j] = OS::PATH_SEPARATOR;
+			osPath[j] = os::PATH_SEPARATOR;
 		}
 		}
 	}
 	}
 
 
@@ -151,7 +151,7 @@ bool Filesystem::GetInfo(const char* basePath, const char* relativePath, Filesys
 
 
 	const char* osPath = BuildOSPath(basePath, relativePath);
 	const char* osPath = BuildOSPath(basePath, relativePath);
 
 
-	if (OS::IsReg(osPath))
+	if (os::is_reg(osPath))
 	{
 	{
 		info.type			= FET_FILE;
 		info.type			= FET_FILE;
 		info.osPath			= osPath;
 		info.osPath			= osPath;
@@ -159,7 +159,7 @@ bool Filesystem::GetInfo(const char* basePath, const char* relativePath, Filesys
 		return true;
 		return true;
 	}
 	}
 
 
-	if (OS::IsDir(osPath))
+	if (os::is_dir(osPath))
 	{
 	{
 		info.type			= FET_DIR;
 		info.type			= FET_DIR;
 		info.osPath			= osPath;
 		info.osPath			= osPath;
@@ -209,7 +209,7 @@ bool Filesystem::CreateFile(const char* relativePath)
 {
 {
 	const char* osPath = BuildOSPath(mRootPath.c_str(), relativePath);
 	const char* osPath = BuildOSPath(mRootPath.c_str(), relativePath);
 
 
-	return OS::Mknod(osPath);
+	return os::mknod(osPath);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -217,7 +217,7 @@ bool Filesystem::CreateDir(const char* relativePath)
 {
 {
 	const char* osPath = BuildOSPath(mRootPath.c_str(), relativePath);
 	const char* osPath = BuildOSPath(mRootPath.c_str(), relativePath);
 
 
-	return OS::Mkdir(osPath);
+	return os::mkdir(osPath);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -225,7 +225,7 @@ bool Filesystem::DeleteFile(const char* relativePath)
 {
 {
 	const char* osPath = BuildOSPath(mRootPath.c_str(), relativePath);
 	const char* osPath = BuildOSPath(mRootPath.c_str(), relativePath);
 
 
-	return OS::Unlink(osPath);
+	return os::unlink(osPath);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -233,7 +233,7 @@ bool Filesystem::DeleteDir(const char* relativePath)
 {
 {
 	const char* osPath = BuildOSPath(mRootPath.c_str(), relativePath);
 	const char* osPath = BuildOSPath(mRootPath.c_str(), relativePath);
 
 
-	return OS::Rmdir(osPath);
+	return os::rmdir(osPath);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -420,7 +420,7 @@ void Filesystem::PrintReport()
 //		return false;
 //		return false;
 //	}
 //	}
 
 
-//	if (Str::IsAlpha(path[0]) && path[1] == ':' && path[2] == OS::PATH_SEPARATOR)
+//	if (Str::IsAlpha(path[0]) && path[1] == ':' && path[2] == os::PATH_SEPARATOR)
 //	{
 //	{
 //		return true;
 //		return true;
 //	}
 //	}
@@ -634,5 +634,5 @@ Filesystem* GetFilesystem()
 	return &filesystem;
 	return &filesystem;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Filesystem.h

@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Stream.h"
 #include "Stream.h"
 #include "Log.h"
 #include "Log.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -168,5 +168,5 @@ private:
 
 
 Filesystem* GetFilesystem();
 Filesystem* GetFilesystem();
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Font.cpp

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Filesystem.h"
 #include "Filesystem.h"
 #include "TextureManager.h"
 #include "TextureManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Font::Font() :
 Font::Font() :
@@ -109,5 +109,5 @@ void Font::SetCodeGlyphMetrics(uint code, float left, float right, float bottom,
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Font.h

@@ -32,7 +32,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Resource.h"
 #include "Resource.h"
 #include "Image.h"
 #include "Image.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Image;
 class Image;
@@ -76,5 +76,5 @@ private:
 	Texture*				mTexture;
 	Texture*				mTexture;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/FontManager.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "FontManager.h"
 #include "FontManager.h"
 #include "Log.h"
 #include "Log.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 FontManager::FontManager()
 FontManager::FontManager()
@@ -65,5 +65,5 @@ FontManager* GetFontManager()
 	return &fontMgr;
 	return &fontMgr;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/FontManager.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "ResourceManager.h"
 #include "ResourceManager.h"
 #include "Font.h"
 #include "Font.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -75,5 +75,5 @@ private:
 
 
 FontManager* GetFontManager();
 FontManager* GetFontManager();
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Glyph.h

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Glyph
 class Glyph
@@ -113,5 +113,5 @@ private:
 	float mBaseline;
 	float mBaseline;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Image.cpp

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Types.h"
 #include "Types.h"
 #include "Stream.h"
 #include "Stream.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Image::Image() :
 Image::Image() :
@@ -257,5 +257,5 @@ void Image::ConvertToRGBA8()
 	mPixelFormat = PF_RGBA_8;
 	mPixelFormat = PF_RGBA_8;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Image.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Color4.h"
 #include "Color4.h"
 #include "Pixel.h"
 #include "Pixel.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //! Holds an image
 //! Holds an image
@@ -114,5 +114,5 @@ private:
 	Image& operator=(const Image&);
 	Image& operator=(const Image&);
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 1 - 1
src/ImageLoader.cpp

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Image.h"
 #include "Image.h"
 #include "Str.h"
 #include "Str.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Image* ImageLoader::Load(const char* relativePath)
 Image* ImageLoader::Load(const char* relativePath)

+ 2 - 2
src/ImageLoader.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Types.h"
 #include "Types.h"
 #include "Str.h"
 #include "Str.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Image;
 class Image;
@@ -50,5 +50,5 @@ public:
 	static Image* Load(const char* relativePath);
 	static Image* Load(const char* relativePath);
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 1 - 1
src/IndexBuffer.h

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**

+ 6 - 6
src/Log.cpp

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "OS.h"
 #include "OS.h"
 #include <cstdarg>
 #include <cstdarg>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 LogLevel Log::mThreshold = LL_DEBUG;
 LogLevel Log::mThreshold = LL_DEBUG;
@@ -53,16 +53,16 @@ void Log::LogMessage(LogLevel level, const char* message, va_list arg)
 	switch (level)
 	switch (level)
 	{
 	{
 		case LL_DEBUG:
 		case LL_DEBUG:
-			OS::LogInfo(message, arg);
+			os::log_info(message, arg);
 			break;
 			break;
 		case LL_ERROR:
 		case LL_ERROR:
-			OS::LogError(message, arg);
+			os::log_error(message, arg);
 			break;
 			break;
 		case LL_WARN:
 		case LL_WARN:
-			OS::LogWarning(message, arg);
+			os::log_warning(message, arg);
 			break;
 			break;
 		case LL_INFO:
 		case LL_INFO:
-			OS::LogInfo(message, arg);
+			os::log_info(message, arg);
 			break;
 			break;
 		default:
 		default:
 			break;
 			break;
@@ -114,5 +114,5 @@ void Log::IndentOut()
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Log.h

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "Str.h"
 #include "Str.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -65,5 +65,5 @@ private:
 	static int			mIndentCount;
 	static int			mIndentCount;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Material.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Material.h"
 #include "Material.h"
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Material::Material() :
 Material::Material() :
@@ -476,5 +476,5 @@ void Material::SetTextureWrap(TextureWrap wrap)
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Material.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Texture.h"
 #include "Texture.h"
 #include "Vec3.h"
 #include "Vec3.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //! Max texture layers supported by the material.
 //! Max texture layers supported by the material.
@@ -403,5 +403,5 @@ public:
 	Texture* mTextureLayer[MAX_TEXTURE_LAYERS];
 	Texture* mTextureLayer[MAX_TEXTURE_LAYERS];
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/MaterialManager.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "MaterialManager.h"
 #include "MaterialManager.h"
 #include "Log.h"
 #include "Log.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Material* MaterialManager::Create(const char* name, bool& created)
 Material* MaterialManager::Create(const char* name, bool& created)
@@ -47,5 +47,5 @@ Material* MaterialManager::CreateSpecific(const char* name)
 	return new Material();
 	return new Material();
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/MaterialManager.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "ResourceManager.h"
 #include "ResourceManager.h"
 #include "Material.h"
 #include "Material.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class MaterialManager : public ResourceManager
 class MaterialManager : public ResourceManager
@@ -70,5 +70,5 @@ private:
 	MaterialManager& operator=(const MaterialManager&);
 	MaterialManager& operator=(const MaterialManager&);
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Mesh.cpp

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "IndexBuffer.h"
 #include "IndexBuffer.h"
 #include "Renderer.h"
 #include "Renderer.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Mesh::Mesh() :
 Mesh::Mesh() :
@@ -141,5 +141,5 @@ void Mesh::RecompileMesh()
 
 
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Mesh.h

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "MeshChunk.h"
 #include "MeshChunk.h"
 #include "Resource.h"
 #include "Resource.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class VertexBuffer;
 class VertexBuffer;
@@ -83,5 +83,5 @@ private:
 	uint					mGlobalVertexCount;
 	uint					mGlobalVertexCount;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/MeshChunk.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "MeshChunk.h"
 #include "MeshChunk.h"
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 MeshChunk::MeshChunk()
 MeshChunk::MeshChunk()
@@ -82,5 +82,5 @@ void MeshChunk::UpdateNormals()
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/MeshChunk.h

@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Data.h"
 #include "Data.h"
 #include "List.h"
 #include "List.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class MeshChunk
 class MeshChunk
@@ -70,5 +70,5 @@ public:
 	Box mBoundingBox;
 	Box mBoundingBox;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/MeshLoader.h

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Mesh;
 class Mesh;
@@ -47,5 +47,5 @@ public:
 	virtual Mesh* LoadFile(const char* name) = 0;
 	virtual Mesh* LoadFile(const char* name) = 0;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/MeshManager.cpp

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Log.h"
 #include "Log.h"
 #include "MathUtils.h"
 #include "MathUtils.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 MeshManager::MeshManager()
 MeshManager::MeshManager()
@@ -264,5 +264,5 @@ MeshManager* GetMeshManager()
 	return &meshMgr;
 	return &meshMgr;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/MeshManager.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "ResourceManager.h"
 #include "ResourceManager.h"
 #include "Mesh.h"
 #include "Mesh.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -105,5 +105,5 @@ private:
 
 
 MeshManager* GetMeshManager();
 MeshManager* GetMeshManager();
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 10 - 10
src/MovableCamera.cpp

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "MovableCamera.h"
 #include "MovableCamera.h"
 #include "InputManager.h"
 #include "InputManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 MovableCamera::MovableCamera(const Vec3& position, const Angles& axis,
 MovableCamera::MovableCamera(const Vec3& position, const Angles& axis,
@@ -48,7 +48,7 @@ MovableCamera::MovableCamera(const Vec3& position, const Angles& axis,
 	mAngleX = 0.0f;
 	mAngleX = 0.0f;
 	mAngleY = 0.0f;
 	mAngleY = 0.0f;
 
 
-	GetDevice()->GetInputManager()->GetMouse()->SetCursorRelativeXY(Vec2(0.5f, 0.5f));
+	//GetDevice()->GetInputManager()->GetMouse()->SetCursorRelativeXY(Vec2(0.5f, 0.5f));
 }
 }
 
 
 MovableCamera::~MovableCamera()
 MovableCamera::~MovableCamera()
@@ -63,7 +63,7 @@ float MovableCamera::GetMouseSensibility() const
 void MovableCamera::SetActive(bool active)
 void MovableCamera::SetActive(bool active)
 {
 {
 	Camera::SetActive(active);
 	Camera::SetActive(active);
-	GetDevice()->GetInputManager()->GetMouse()->SetCursorRelativeXY(Vec2(0.5f, 0.5f));
+	//GetDevice()->GetInputManager()->GetMouse()->SetCursorRelativeXY(Vec2(0.5f, 0.5f));
 }
 }
 
 
 void MovableCamera::SetMouseSensibility(float sensibility)
 void MovableCamera::SetMouseSensibility(float sensibility)
@@ -205,11 +205,11 @@ void MovableCamera::StrafeRight()
 
 
 void MovableCamera::SetViewByMouse()
 void MovableCamera::SetViewByMouse()
 {
 {
-	Mouse* mouse = GetDevice()->GetInputManager()->GetMouse();
+	//Mouse* mouse = GetDevice()->GetInputManager()->GetMouse();
 
 
-	static Vec2 lastPos = mouse->GetCursorRelativeXY();
-	Vec2 currentPos = mouse->GetCursorRelativeXY();
-	mouse->SetCursorRelativeXY(Vec2(0.5f, 0.5f));
+	static Vec2 lastPos = Vec2::ZERO;//mouse->GetCursorRelativeXY();
+	Vec2 currentPos = Vec2::ZERO;//mouse->GetCursorRelativeXY();
+	//mouse->SetCursorRelativeXY(Vec2(0.5f, 0.5f));
 
 
 	if (lastPos == currentPos)
 	if (lastPos == currentPos)
 	{
 	{
@@ -218,8 +218,8 @@ void MovableCamera::SetViewByMouse()
 
 
 	Vec2 delta = lastPos - currentPos;
 	Vec2 delta = lastPos - currentPos;
 
 
-	mouse->SetCursorRelativeXY(Vec2(0.5f, 0.5f));
-	lastPos = mouse->GetCursorRelativeXY();
+	//mouse->SetCursorRelativeXY(Vec2(0.5f, 0.5f));
+	lastPos = Vec2::ZERO;//mouse->GetCursorRelativeXY();
 
 
 	mAngleX += delta.y * mMouseSensibility;
 	mAngleX += delta.y * mMouseSensibility;
 	mAngleY += delta.x * mMouseSensibility;
 	mAngleY += delta.x * mMouseSensibility;
@@ -245,5 +245,5 @@ void MovableCamera::SetViewByMouse()
 	Camera::SetLookAt(look);
 	Camera::SetLookAt(look);
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/MovableCamera.h

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Mouse.h"
 #include "Mouse.h"
 #include "Keyboard.h"
 #include "Keyboard.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class MovableCamera : public Camera, public MouseListener, public KeyboardListener
 class MovableCamera : public Camera, public MouseListener, public KeyboardListener
@@ -87,5 +87,5 @@ protected:
 	bool mLeftPressed : 1;
 	bool mLeftPressed : 1;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/OcclusionQuery.h

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class OcclusionQuery
 class OcclusionQuery
@@ -54,5 +54,5 @@ public:
 	virtual bool IsResultAvailable() = 0;
 	virtual bool IsResultAvailable() = 0;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/ParticleEmitter.cpp

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Timer.h"
 #include "Timer.h"
 #include <GL/glew.h> // FIXME
 #include <GL/glew.h> // FIXME
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Random ParticleEmitterRandom(Timer().GetMicroseconds());
 Random ParticleEmitterRandom(Timer().GetMicroseconds());
@@ -174,4 +174,4 @@ void ParticleEmitter::Render()
 	////GetDevice()->GetRenderer()->RenderPointBuffer(mVertexBuffer);
 	////GetDevice()->GetRenderer()->RenderPointBuffer(mVertexBuffer);
 }
 }
 
 
-} //namespace Crown
+} //namespace crown

+ 2 - 2
src/ParticleEmitter.h

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "VertexBuffer.h"
 #include "VertexBuffer.h"
 #include "Texture.h"
 #include "Texture.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class ParticleManager;
 class ParticleManager;
@@ -74,4 +74,4 @@ private:
 	friend class ParticleManager;
 	friend class ParticleManager;
 };
 };
 
 
-} //namespace Crown
+} //namespace crown

+ 2 - 2
src/ParticleManager.cpp

@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "ParticleManager.h"
 #include "ParticleManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 ParticleManager::ParticleManager()
 ParticleManager::ParticleManager()
@@ -73,4 +73,4 @@ void ParticleManager::Render()
 	}
 	}
 }
 }
 
 
-} //namespace Crown
+} //namespace crown

+ 2 - 2
src/ParticleManager.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "List.h"
 #include "List.h"
 #include "ParticleEmitter.h"
 #include "ParticleEmitter.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class ParticleManager
 class ParticleManager
@@ -53,4 +53,4 @@ private:
 	List<ParticleEmitter*> mEmitters;
 	List<ParticleEmitter*> mEmitters;
 };
 };
 
 
-} //namespace Crown
+} //namespace crown

+ 1 - 1
src/PhysicNode.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "PhysicNode.h"
 #include "PhysicNode.h"
 #include "PhysicsManager.h"
 #include "PhysicsManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 PhysicNode::PhysicNode(const Vec3& position, const Angles& axis, bool visible, int collisionGroupId) :
 PhysicNode::PhysicNode(const Vec3& position, const Angles& axis, bool visible, int collisionGroupId) :

+ 1 - 1
src/PhysicNode.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Vec3.h"
 #include "Vec3.h"
 #include "Angles.h"
 #include "Angles.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class PhysicNode
 class PhysicNode

+ 1 - 1
src/PhysicsManager.cpp

@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "PhysicsManager.h"
 #include "PhysicsManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //PhysicsManager::PhysicsManager()
 //PhysicsManager::PhysicsManager()

+ 1 - 1
src/PhysicsManager.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 //#include "PhysicNode.h"
 //#include "PhysicNode.h"
 //#include "Dictionary.h"
 //#include "Dictionary.h"
 
 
-//namespace Crown
+//namespace crown
 //{
 //{
 
 
 //class Scene;
 //class Scene;

+ 1 - 1
src/PhysicsSystem.cpp

@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "PhysicsManager.h"
 #include "PhysicsManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 PhysicsManager::PhysicsManager()
 PhysicsManager::PhysicsManager()

+ 2 - 2
src/PhysicsSystem.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Types.h"
 #include "Types.h"
 #include "Shape.h"
 #include "Shape.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 struct PhysicBody
 struct PhysicBody
@@ -53,5 +53,5 @@ private:
 
 
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Pixel.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Pixel.h"
 #include "Pixel.h"
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 uint Pixel::GetBitsPerPixel(PixelFormat format)
 uint Pixel::GetBitsPerPixel(PixelFormat format)
@@ -113,5 +113,5 @@ uint Pixel::GetBytesPerPixel(PixelFormat format)
 	return GetBitsPerPixel(format) / 8;
 	return GetBitsPerPixel(format) / 8;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Pixel.h

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 // [0 - 2]		-> 8-bit
 // [0 - 2]		-> 8-bit
@@ -116,5 +116,5 @@ private:
 	Pixel();
 	Pixel();
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Renderer.cpp

@@ -33,7 +33,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 	#include "GLESRenderer.h"
 	#include "GLESRenderer.h"
 #endif
 #endif
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Renderer* Renderer::CreateRenderer()
 Renderer* Renderer::CreateRenderer()
@@ -59,5 +59,5 @@ void Renderer::DestroyRenderer(Renderer* renderer)
 	delete renderer;
 	delete renderer;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Renderer.h

@@ -32,7 +32,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Point2.h"
 #include "Point2.h"
 #include "Material.h"
 #include "Material.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Image;
 class Image;
@@ -362,5 +362,5 @@ public:
 	virtual void DrawDebugLines() = 0;
 	virtual void DrawDebugLines() = 0;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Resource.h

@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #pragma once
 #pragma once
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -105,5 +105,5 @@ protected:
 	size_t				mSize;			//!< The size in bytes
 	size_t				mSize;			//!< The size in bytes
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/ResourceManager.cpp

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "ResourceManager.h"
 #include "ResourceManager.h"
 #include "Str.h"
 #include "Str.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 ResourceManager::ResourceManager()
 ResourceManager::ResourceManager()
@@ -110,5 +110,5 @@ void ResourceManager::DestroySpecific(const char* name)
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/ResourceManager.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Dictionary.h"
 #include "Dictionary.h"
 #include "Resource.h"
 #include "Resource.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -115,5 +115,5 @@ protected:
 	NameToResourceDict	mNameToResourceDict;
 	NameToResourceDict	mNameToResourceDict;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Skybox.cpp

@@ -34,7 +34,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "IndexBuffer.h"
 #include "IndexBuffer.h"
 #include "Renderer.h"
 #include "Renderer.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Skybox::Skybox(const Vec3& position, const Angles& axis, bool visible)
 Skybox::Skybox(const Vec3& position, const Angles& axis, bool visible)
@@ -182,5 +182,5 @@ void Skybox::Render()
 	renderer->_SetTexturing(0, false);
 	renderer->_SetTexturing(0, false);
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Skybox.h

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Angles.h"
 #include "Angles.h"
 #include "Vec3.h"
 #include "Vec3.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Texture;
 class Texture;
@@ -75,5 +75,5 @@ private:
 	Texture* mSkyboxFace[6];
 	Texture* mSkyboxFace[6];
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/SpriteAnimator.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "SpriteAnimator.h"
 #include "SpriteAnimator.h"
 #include <cstdlib>
 #include <cstdlib>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 SpriteAnimator::SpriteAnimator():
 SpriteAnimator::SpriteAnimator():
@@ -107,4 +107,4 @@ void SpriteAnimator::Render()
 	}
 	}
 }
 }
 
 
-} //namespace Crown
+} //namespace crown

+ 2 - 2
src/SpriteAnimator.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Types.h"
 #include "Types.h"
 #include "Sprite.h"
 #include "Sprite.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class SpriteAnimator
 class SpriteAnimator
@@ -59,4 +59,4 @@ private:
 	real mScaleY;
 	real mScaleY;
 };
 };
 
 
-} //namespace Crown
+} //namespace crown

+ 2 - 2
src/System.h

@@ -37,7 +37,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Random.h"
 #include "Random.h"
 #include <ctime>
 #include <ctime>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 struct EntityId
 struct EntityId
@@ -165,5 +165,5 @@ void System::Update(uint dt)
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Terrain.cpp

@@ -36,7 +36,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "BMPImageLoader.h"
 #include "BMPImageLoader.h"
 #include <cmath>
 #include <cmath>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Terrain::Terrain() :
 Terrain::Terrain() :
@@ -413,5 +413,5 @@ void Terrain::ApplyBrush(const Vec3& xyz, float scale)
 	ApplyBrush(x, z, scale);
 	ApplyBrush(x, z, scale);
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Terrain.h

@@ -33,7 +33,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #define MAX_BRUSH_SIZE 256
 #define MAX_BRUSH_SIZE 256
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Terrain
 class Terrain
@@ -105,5 +105,5 @@ private:
 	float		mBrush[MAX_BRUSH_SIZE * MAX_BRUSH_SIZE];
 	float		mBrush[MAX_BRUSH_SIZE * MAX_BRUSH_SIZE];
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/TextRenderer.cpp

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Renderer.h"
 #include "Renderer.h"
 #include "Device.h"
 #include "Device.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -181,5 +181,5 @@ int TextRenderer::GetMaxTextHeight()
 //	return mFont->_GetMaxTextHeight();
 //	return mFont->_GetMaxTextHeight();
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/TextRenderer.h

@@ -32,7 +32,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Font.h"
 #include "Font.h"
 #include "Point2.h"
 #include "Point2.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 enum TextAlignment
 enum TextAlignment
@@ -77,5 +77,5 @@ private:
 	
 	
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/Texture.h

@@ -32,7 +32,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Str.h"
 #include "Str.h"
 #include "Image.h"
 #include "Image.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -212,5 +212,5 @@ protected:
 	Color4 mBlendColor;
 	Color4 mBlendColor;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/TextureManager.h

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Image.h"
 #include "Image.h"
 #include "Pixel.h"
 #include "Pixel.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -101,5 +101,5 @@ public:
 
 
 TextureManager* GetTextureManager();
 TextureManager* GetTextureManager();
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 1 - 1
src/VertexBuffer.h

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 enum VertexBufferMode
 enum VertexBufferMode

+ 2 - 2
src/World.h

@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #pragma once
 #pragma once
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -58,5 +58,5 @@ private:
 	Skybox		mSkybox;			// The skybox
 	Skybox		mSkybox;			// The skybox
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 5 - 4
src/os/OS.cpp

@@ -1,12 +1,13 @@
 #include "OS.h"
 #include "OS.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
-namespace OS
+namespace os
 {
 {
 
 
 #define				MAX_OS_EVENTS 256
 #define				MAX_OS_EVENTS 256
+
 static int			event_queue_count = 0;
 static int			event_queue_count = 0;
 static OSEvent		event_queue[MAX_OS_EVENTS];
 static OSEvent		event_queue[MAX_OS_EVENTS];
 
 
@@ -43,7 +44,7 @@ OSEvent& pop_event()
 	return event;
 	return event;
 }
 }
 
 
-} // namespace OS
+} // namespace os
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 51 - 21
src/os/OS.h

@@ -29,47 +29,66 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Str.h"
 #include "Str.h"
 #include "List.h"
 #include "List.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
 	OS-specific functions and parameters.
 	OS-specific functions and parameters.
 */
 */
-namespace OS
+namespace os
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 #ifdef LINUX
 #ifdef LINUX
+const size_t	MAX_OS_PATH_LENGTH = 1024;
 const char		PATH_SEPARATOR = '/';
 const char		PATH_SEPARATOR = '/';
 #endif
 #endif
 
 
 #ifdef WINDOWS
 #ifdef WINDOWS
+const size_t	MAX_OS_PATH_LENGTH = 1024;
 const char		PATH_SEPARATOR = '\\';
 const char		PATH_SEPARATOR = '\\';
 #endif
 #endif
 
 
-void			Printf(const char* string, ...);				//!< Printf wrapper
-void			Vprintf(const char* string, va_list arg);		//!< VPrintf wrapper
+//-----------------------------------------------------------------------------
+void			printf(const char* string, ...);				//!< Printf wrapper
+void			vprintf(const char* string, va_list arg);		//!< VPrintf wrapper
+
+void			log_debug(const char* string, va_list arg);		//!< Print debug message
+void			log_error(const char* string, va_list arg);		//!< Print error message
+void			log_warning(const char* string, va_list arg);	//!< Print warning message
+void			log_info(const char* string, va_list arg);		//!< Print info message
+
+bool			exists(const char* path);		//!< Returns whether the path is a file or directory on the disk
+
+bool			is_dir(const char* path);		//!< Returns whether the path is a directory. (May not resolve symlinks.)
+bool			is_reg(const char* path);		//!< Returns whether the path is a regular file. (May not resolve symlinks.)
+
+bool			mknod(const char* path);		//! Creates a regular file. Returns true if success, false if not
+bool			unlink(const char* path);		//! Deletes a regular file. Returns true if success, false if not
+bool			mkdir(const char* path);		//! Creates a directory. Returns true if success, false if not
+bool			rmdir(const char* path);		//! Deletes a directory. Returns true if success, false if not
 
 
-void			LogDebug(const char* string, va_list arg);		//!< Print debug message
-void			LogError(const char* string, va_list arg);		//!< Print error message
-void			LogWarning(const char* string, va_list arg);	//!< Print warning message
-void			LogInfo(const char* string, va_list arg);		//!< Print info message
+const char*		get_cwd();						//! Fills ret with the path of the current working directory. Returns true if success, false if not 
+const char*		get_home();						//! Fills ret with the path of the user home directory
+const char*		get_env(const char* env);		//! Returns the content of the 'env' environment variable or the empty string
 
 
-bool			Exists(const char* path);		//!< Returns whether the path is a file or directory on the disk
+bool			ls(const char* path, List<Str>& fileList);	//! Returns the list of filenames in a directory.
 
 
-bool			IsDir(const char* path);		//!< Returns whether the path is a directory. (May not resolve symlinks.)
-bool			IsReg(const char* path);		//!< Returns whether the path is a regular file. (May not resolve symlinks.)
+//-----------------------------------------------------------------------------
+void			init_os();
+
+bool			create_render_window(uint x, uint y, uint width, uint height, bool fullscreen);
+bool			destroy_render_window();
+void			swap_buffers();
 
 
-bool			Mknod(const char* path);		//! Creates a regular file. Returns true if success, false if not
-bool			Unlink(const char* path);		//! Deletes a regular file. Returns true if success, false if not
-bool			Mkdir(const char* path);		//! Creates a directory. Returns true if success, false if not
-bool			Rmdir(const char* path);		//! Deletes a directory. Returns true if success, false if not
+void			event_loop();
 
 
-const char*		GetCWD();						//! Fills ret with the path of the current working directory. Returns true if success, false if not 
-const char*		GetHome();						//! Fills ret with the path of the user home directory
-const char*		GetEnv(const char* env);		//! Returns the content of the 'env' environment variable or the empty string
+void			init_keyboard();
+void			init_mouse();
+void			init_touch();
 
 
-bool			Ls(const char* path, List<Str>& fileList);	//! Returns the list of filenames in a directory.
+void			hide_cursor();
+void			show_cursor();
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 enum OSEventType
 enum OSEventType
@@ -80,6 +99,17 @@ enum OSEventType
 	OSET_TOUCH		= 3
 	OSET_TOUCH		= 3
 };
 };
 
 
+enum OSMouseEventType
+{
+	OSMET_LEFT_PRESSED		= 0,
+	OSMET_MIDDLE_PRESSED	= 1,
+	OSMET_RIGHT_PRESSED		= 2,
+	OSMET_LEFT_RELEASED		= 3,
+	OSMET_MIDDLE_RELEASED	= 4,
+	OSMET_RIGHT_RELEASED	= 5,
+	OSMET_CURSOR_MOVED		= 6
+};
+
 struct OSEvent
 struct OSEvent
 {
 {
 	OSEventType		type;
 	OSEventType		type;
@@ -95,7 +125,7 @@ void				push_event(OSEventType type, int data_a, int data_b, int data_c, int dat
 //! Returns the event on top of the @a event_queue	
 //! Returns the event on top of the @a event_queue	
 OSEvent&			pop_event();
 OSEvent&			pop_event();
 
 
-} // namespace OS
+} // namespace os
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/android/AndroidInputManager.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "AndroidInputManager.h"
 #include "AndroidInputManager.h"
 #include "AndroidTouch.h"
 #include "AndroidTouch.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -66,5 +66,5 @@ void AndroidInputManager::Init(const EventSource& source)
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/android/AndroidInputManager.h

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "InputManager.h"
 #include "InputManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class AndroidInputManager : public InputManager
 class AndroidInputManager : public InputManager
@@ -84,5 +84,5 @@ private:
 	struct android_app* mAndroidApp;
 	struct android_app* mAndroidApp;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/android/AndroidOS.cpp

@@ -33,7 +33,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, "crown", __VA_ARGS__))
 #define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, "crown", __VA_ARGS__))
 #define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "crown", __VA_ARGS__))
 #define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "crown", __VA_ARGS__))
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 void OS::Printf(const char* string, ...)
 void OS::Printf(const char* string, ...)
@@ -115,5 +115,5 @@ bool OS::GetCWD(Str& ret)
 	return true;
 	return true;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/android/AndroidRenderWindow.cpp

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Config.h"
 #include "Config.h"
 #include <android_native_app_glue.h>
 #include <android_native_app_glue.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 AndroidRenderWindow::AndroidRenderWindow() :
 AndroidRenderWindow::AndroidRenderWindow() :
@@ -212,5 +212,5 @@ void AndroidRenderWindow::_SetTitleAndAdditionalTextToWindow()
 {
 {
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/android/AndroidRenderWindow.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Types.h"
 #include "Types.h"
 #include <EGL/egl.h>
 #include <EGL/egl.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class AndroidRenderWindow : public RenderWindow
 class AndroidRenderWindow : public RenderWindow
@@ -89,5 +89,5 @@ private:
 	EGLSurface mEGLWindow;
 	EGLSurface mEGLWindow;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/android/AndroidTimer.cpp

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Timer.h"
 #include "Timer.h"
 #include <sys/time.h>
 #include <sys/time.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Timer::Timer()
 Timer::Timer()
@@ -83,5 +83,5 @@ ulong Timer::StopMicroseconds() const
 	return (tmp.tv_sec - mStartTime.tv_sec) * 1000000 + (tmp.tv_nsec - mStartTime.tv_nsec) / 1000;
 	return (tmp.tv_sec - mStartTime.tv_sec) * 1000000 + (tmp.tv_nsec - mStartTime.tv_nsec) / 1000;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/android/AndroidTimer.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <sys/time.h>
 #include <sys/time.h>
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Timer
 class Timer
@@ -69,5 +69,5 @@ private:
 	timespec mStartTime;		// Time at Start* call
 	timespec mStartTime;		// Time at Start* call
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/android/AndroidTouch.cpp

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Log.h"
 #include "Log.h"
 #include "AndroidInputManager.h"
 #include "AndroidInputManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 AndroidTouch::AndroidTouch(InputManager* creator) :
 AndroidTouch::AndroidTouch(InputManager* creator) :
@@ -151,5 +151,5 @@ int32_t AndroidTouch::HandleTouchEvent(struct android_app* app, AInputEvent* eve
 	return 0;
 	return 0;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 1 - 1
src/os/android/AndroidTouch.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <android_native_app_glue.h>
 #include <android_native_app_glue.h>
 #include "Touch.h"
 #include "Touch.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class AndroidTouch : public Touch
 class AndroidTouch : public Touch

+ 2 - 2
src/os/linux/EGLRenderWindow.cpp

@@ -32,7 +32,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <X11/Xlib.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xutil.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 EGLRenderWindow::EGLRenderWindow() :
 EGLRenderWindow::EGLRenderWindow() :
@@ -304,5 +304,5 @@ void EGLRenderWindow::_SetTitleAndAdditionalTextToWindow()
 	XFree(textProperty.value);
 	XFree(textProperty.value);
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/linux/EGLRenderWindow.h

@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Types.h"
 #include "Types.h"
 #include <EGL/egl.h>
 #include <EGL/egl.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class EGLRenderWindow : public RenderWindow
 class EGLRenderWindow : public RenderWindow
@@ -97,5 +97,5 @@ private:
 	EGLSurface mEGLWindow;
 	EGLSurface mEGLWindow;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 208 - 163
src/os/linux/GLXRenderWindow.cpp

@@ -25,57 +25,31 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include <X11/Xutil.h>
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
 #include <X11/Xatom.h>
-#include "GLXRenderWindow.h"
+#include <X11/Xlib.h>
+#include <GL/glx.h>
+#include "Types.h"
 #include "Log.h"
 #include "Log.h"
+#include "OS.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
-//-----------------------------------------------------------------------------
-GLXRenderWindow::GLXRenderWindow() :
-	mXDisplay(NULL),
-	mXWindow(None),
-	mGLXContext(NULL),
-	mGLXWindow(None)
+namespace os
 {
 {
-	mXDisplay = XOpenDisplay(NULL);
-}
-
-//-----------------------------------------------------------------------------
-GLXRenderWindow::~GLXRenderWindow()
-{
-	if (mXDisplay)
-	{
-		if (mGLXWindow)
-		{
-			glXDestroyWindow(mXDisplay, mGLXWindow);
-		}
-
-		if (mGLXContext)
-		{
-			glXMakeContextCurrent(mXDisplay, None, None, NULL);
-			glXDestroyContext(mXDisplay, mGLXContext);
-		}
-
-		if (mXWindow)
-		{
-			XDestroyWindow(mXDisplay, mXWindow);
-		}
 
 
-		XCloseDisplay(mXDisplay);
-	}
-}
+Display*		mXDisplay = NULL;
+Window			mXWindow = None;
+GLXContext		mGLXContext = NULL;
+GLXDrawable		mGLXWindow = None;
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool GLXRenderWindow::Create(uint x, uint y, uint width, uint height, uint depth, bool /*fullscreen*/)
+bool create_render_window(uint x, uint y, uint width, uint height, bool fullscreen)
 {
 {
-	if (!width || !height)
-	{
-		Log::E("Width and height must differ from 0.");
-		return false;
-	}
+	assert(width != 0 && height != 0);
+
+	mXDisplay = XOpenDisplay(NULL);
 
 
-	if (!mXDisplay)
+	if (mXDisplay == NULL)
 	{
 	{
 		Log::E("Unable to open a display");
 		Log::E("Unable to open a display");
 		return false;
 		return false;
@@ -87,10 +61,10 @@ bool GLXRenderWindow::Create(uint x, uint y, uint width, uint height, uint depth
 	int fbAttribs[] =
 	int fbAttribs[] =
 	{
 	{
 		GLX_DOUBLEBUFFER,		True,			// Only double-buffered
 		GLX_DOUBLEBUFFER,		True,			// Only double-buffered
-		GLX_RED_SIZE,			(int)depth / 4,
-		GLX_GREEN_SIZE,			(int)depth / 4,
-		GLX_BLUE_SIZE,			(int)depth / 4,
-		GLX_ALPHA_SIZE,			(int)depth / 4,
+		GLX_RED_SIZE,			8,
+		GLX_GREEN_SIZE,			8,
+		GLX_BLUE_SIZE,			8,
+		GLX_ALPHA_SIZE,			8,
 		GLX_DEPTH_SIZE,			24,				// Depth buffer size
 		GLX_DEPTH_SIZE,			24,				// Depth buffer size
 		GLX_STENCIL_SIZE,		0,				// Stencil buffer size
 		GLX_STENCIL_SIZE,		0,				// Stencil buffer size
 		GLX_ACCUM_RED_SIZE,		0,
 		GLX_ACCUM_RED_SIZE,		0,
@@ -159,126 +133,36 @@ bool GLXRenderWindow::Create(uint x, uint y, uint width, uint height, uint depth
 	XFree(fbConfig);
 	XFree(fbConfig);
 	XFlush(mXDisplay);
 	XFlush(mXDisplay);
 
 
-	mX = x;
-	mY = y;
-	mWidth = width;
-	mHeight = height;
-	mCreated = true;
-
 	return true;
 	return true;
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void GLXRenderWindow::Destroy()
-{
-	// Main window can not be destroyed
-	if (!mCreated || mMain)
-	{
-		return;
-	}
-
-	if (mFull)
-	{
-		SetFullscreen(false);
-	}
-
-	mCreated = false;
-}
-
-//-----------------------------------------------------------------------------
-void GLXRenderWindow::SetVisible(bool visible)
-{
-	mVisible = visible;
-}
-
-//-----------------------------------------------------------------------------
-void GLXRenderWindow::Move(uint x, uint y)
-{
-	if (x == mX && y == mY)
-	{
-		return;
-	}
-
-	XMoveWindow(mXDisplay, mXWindow, x, y);
-}
-
-//-----------------------------------------------------------------------------
-void GLXRenderWindow::Resize(uint width, uint height)
-{
-	if (!width || !height)
-	{
-		return;
-	}
-
-	if (width == mWidth && height == mHeight)
-	{
-		return;
-	}
-
-	XResizeWindow(mXDisplay, mXWindow, width, height);
-}
-
-//-----------------------------------------------------------------------------
-void GLXRenderWindow::SetFullscreen(bool full)
-{
-	mFull = full;
-	XEvent xEvent;
-	Atom wmState = XInternAtom(mXDisplay, "_NET_WM_STATE", False);
-	Atom fullscreen = XInternAtom(mXDisplay, "_NET_WM_STATE_FULLSCREEN", False);
-	xEvent.type = ClientMessage;
-	xEvent.xclient.window = mXWindow;
-	xEvent.xclient.message_type = wmState;
-	xEvent.xclient.format = 32;
-	xEvent.xclient.data.l[0] = (mFull ? 1 : 0);
-	xEvent.xclient.data.l[1] = fullscreen;
-	xEvent.xclient.data.l[2] = 0;
-	XSendEvent(mXDisplay, DefaultRootWindow(mXDisplay), False, SubstructureNotifyMask, &xEvent);
-}
-
-//-----------------------------------------------------------------------------
-void GLXRenderWindow::Bind()
-{
-	glXMakeContextCurrent(mXDisplay, mGLXWindow, mGLXWindow, mGLXContext);
-}
-
-//-----------------------------------------------------------------------------
-void GLXRenderWindow::Unbind()
-{
-	glXMakeContextCurrent(mXDisplay, None, None, NULL);
-}
-
-//-----------------------------------------------------------------------------
-void GLXRenderWindow::Update()
-{
-	glXSwapBuffers(mXDisplay, mGLXWindow);
-}
-
-//-----------------------------------------------------------------------------
-void GLXRenderWindow::_NotifyMetricsChange(uint x, uint y, uint width, uint height)
+bool destroy_render_window()
 {
 {
-	if (x == mX && y == mY && width == mWidth && height == mHeight)
+	if (mXDisplay)
 	{
 	{
-		return;
-	}
+		if (mGLXWindow)
+		{
+			glXDestroyWindow(mXDisplay, mGLXWindow);
+		}
 
 
-	XWindowAttributes attribs;
-	XGetWindowAttributes(mXDisplay, mXWindow, &attribs);
+		if (mGLXContext)
+		{
+			glXMakeContextCurrent(mXDisplay, None, None, NULL);
+			glXDestroyContext(mXDisplay, mGLXContext);
+		}
 
 
-	if (attribs.x == (int)x && attribs.y == (int)y)
-	{
-		mX = x;
-		mY = y;
-	}
+		if (mXWindow)
+		{
+			XDestroyWindow(mXDisplay, mXWindow);
+		}
 
 
-	if (attribs.width == (int)width && attribs.height == (int)height)
-	{
-		mWidth = width;
-		mHeight = height;
+		XCloseDisplay(mXDisplay);
 	}
 	}
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void GLXRenderWindow::EventLoop()
+void event_loop()
 {
 {
 	XEvent event;
 	XEvent event;
 
 
@@ -288,10 +172,130 @@ void GLXRenderWindow::EventLoop()
 
 
 		switch (event.type)
 		switch (event.type)
 		{
 		{
-			case ConfigureNotify:
+//			case ConfigureNotify:
+//			{
+//				_NotifyMetricsChange(event.xconfigure.x, event.xconfigure.y,
+//										event.xconfigure.width, event.xconfigure.height);
+//				break;
+//			}
+			case ButtonPress:
+			{
+				switch (event.xbutton.button)
+				{
+					case Button1:
+					{
+						push_event(os::OSET_MOUSE, os::OSMET_LEFT_PRESSED, event.xbutton.x, event.xbutton.y, 0);
+						break;
+					}
+					case Button2:
+					{
+						push_event(os::OSET_MOUSE, os::OSMET_MIDDLE_PRESSED, event.xbutton.x, event.xbutton.y, 0);
+						break;
+					}
+					case Button3:
+					{
+						push_event(os::OSET_MOUSE, os::OSMET_RIGHT_PRESSED, event.xbutton.x, event.xbutton.y, 0);
+						break;
+					}
+				}
+
+				break;
+			}
+			case ButtonRelease:
+			{
+				switch (event.xbutton.button)
+				{
+					case Button1:
+					{
+						push_event(os::OSET_MOUSE, os::OSMET_LEFT_PRESSED, event.xbutton.x, event.xbutton.y, 0);
+						break;
+					}
+					case Button2:
+					{
+						push_event(os::OSET_MOUSE, os::OSMET_MIDDLE_PRESSED, event.xbutton.x, event.xbutton.y, 0);
+						break;
+					}
+					case Button3:
+					{
+						push_event(os::OSET_MOUSE, os::OSMET_RIGHT_PRESSED, event.xbutton.x, event.xbutton.y, 0);
+						break;
+					}
+				}
+
+				break;
+			}
+			case MotionNotify:
 			{
 			{
-				_NotifyMetricsChange(event.xconfigure.x, event.xconfigure.y,
-										event.xconfigure.width, event.xconfigure.height);
+				push_event(os::OSET_MOUSE, os::OSMET_CURSOR_MOVED, event.xbutton.x, event.xbutton.y, 0);
+				break;
+			}
+//			case KeyPress:
+//			case KeyRelease:
+//			{
+//				char string[4] = {0, 0, 0, 0};
+//				int len = -1;
+//				KeySym key;
+
+//				len = XLookupString(&event.xkey, string, 4, &key, NULL);
+
+//				Key kc = TranslateKey(key);
+
+//				// Check if any modifier key is pressed or released
+//				if (kc == KC_LSHIFT || kc == KC_RSHIFT)
+//				{
+//					(event.type == KeyPress) ? mModifierMask |= MK_SHIFT : mModifierMask &= ~MK_SHIFT;
+//				}
+//				else if (kc == KC_LCONTROL || kc == KC_RCONTROL)
+//				{
+//					(event.type == KeyPress) ? mModifierMask |= MK_CTRL : mModifierMask &= ~MK_CTRL;
+//				}
+//				else if (kc == KC_LALT || kc == KC_RALT)
+//				{
+//					(event.type == KeyPress) ? mModifierMask |= MK_ALT : mModifierMask &= ~MK_ALT;
+//				}
+
+//				mKeyState[kc] = (event.type == KeyPress) ? true : false;
+//				keyboardEvent.key = kc;
+
+//				if (mListener)
+//				{
+//					if (event.type == KeyPress)
+//					{
+//						mListener->KeyPressed(keyboardEvent);
+//					}
+//					else if (event.type == KeyRelease)
+//					{
+//						mListener->KeyReleased(keyboardEvent);
+//					}
+//				}
+
+//				if (event.type == KeyPress)
+//				{
+//					push_event(os::OSET_KEYBOARD, 1, 2, 3, 4);
+//				}
+//				else if (event.type == KeyRelease)
+//				{
+//					push_event(os::OSET_KEYBOARD, 55, 2, 3, 4);
+//				}
+
+//				// Text input part
+//				if (event.type == KeyPress && len > 0)
+//				{
+//					//crownEvent.event_type = ET_TEXT;
+//					//crownEvent.text.type = TET_TEXT_INPUT;
+//					strncpy(keyboardEvent.text, string, 4);
+
+//					if (mListener)
+//					{
+//						mListener->TextInput(keyboardEvent);
+//					}
+//				}
+
+//				break;
+//			}
+			case KeymapNotify:
+			{
+				XRefreshKeyboardMapping(&event.xmapping);
 				break;
 				break;
 			}
 			}
 			default:
 			default:
@@ -303,15 +307,56 @@ void GLXRenderWindow::EventLoop()
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void GLXRenderWindow::_SetTitleAndAdditionalTextToWindow()
+void swap_buffers()
 {
 {
-	Str tmp = GetDisplayedTitle();
-	const char* ctitle = tmp.c_str();
-	XTextProperty textProperty;
-	XStringListToTextProperty((char**)&ctitle, 1, &textProperty);
-	XSetWMName(mXDisplay, mXWindow, &textProperty);
-	XFree(textProperty.value);
+	glXSwapBuffers(mXDisplay, mGLXWindow);
 }
 }
 
 
-} // namespace Crown
+////-----------------------------------------------------------------------------
+//void GLXRenderWindow::Move(uint x, uint y)
+//{
+//	if (x == mX && y == mY)
+//	{
+//		return;
+//	}
+
+//	XMoveWindow(mXDisplay, mXWindow, x, y);
+//}
+
+////-----------------------------------------------------------------------------
+//void GLXRenderWindow::Resize(uint width, uint height)
+//{
+//	if (!width || !height)
+//	{
+//		return;
+//	}
+
+//	if (width == mWidth && height == mHeight)
+//	{
+//		return;
+//	}
+
+//	XResizeWindow(mXDisplay, mXWindow, width, height);
+//}
+
+////-----------------------------------------------------------------------------
+//void GLXRenderWindow::SetFullscreen(bool full)
+//{
+//	mFull = full;
+//	XEvent xEvent;
+//	Atom wmState = XInternAtom(mXDisplay, "_NET_WM_STATE", False);
+//	Atom fullscreen = XInternAtom(mXDisplay, "_NET_WM_STATE_FULLSCREEN", False);
+//	xEvent.type = ClientMessage;
+//	xEvent.xclient.window = mXWindow;
+//	xEvent.xclient.message_type = wmState;
+//	xEvent.xclient.format = 32;
+//	xEvent.xclient.data.l[0] = (mFull ? 1 : 0);
+//	xEvent.xclient.data.l[1] = fullscreen;
+//	xEvent.xclient.data.l[2] = 0;
+//	XSendEvent(mXDisplay, DefaultRootWindow(mXDisplay), False, SubstructureNotifyMask, &xEvent);
+//}
+
+} // namespace os
+
+} // namespace crown
 
 

+ 50 - 40
src/os/linux/LinuxOS.cpp

@@ -30,67 +30,70 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <unistd.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/types.h>
 #include <dirent.h>
 #include <dirent.h>
+#include <cstdlib>
 
 
-namespace Crown
+namespace crown
+{
+namespace os
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void OS::Printf(const char* string, ...)
+void printf(const char* string, ...)
 {
 {
 	va_list args;
 	va_list args;
 
 
 	va_start(args, string);
 	va_start(args, string);
-	vprintf(string, args);
+	::vprintf(string, args);
 	va_end(args);
 	va_end(args);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void OS::Vprintf(const char* string, va_list arg)
+void vprintf(const char* string, va_list arg)
 {
 {
-	vprintf(string, arg);
+	::vprintf(string, arg);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void OS::LogDebug(const char* string, va_list arg)
+void log_debug(const char* string, va_list arg)
 {
 {
-	Printf("D: ");
-	Vprintf(string, arg);
-	Printf("\n");
+	printf("D: ");
+	vprintf(string, arg);
+	printf("\n");
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void OS::LogError(const char* string, va_list arg)
+void log_error(const char* string, va_list arg)
 {
 {
-	Printf("E: ");
-	Vprintf(string, arg);
-	Printf("\n");
+	printf("E: ");
+	vprintf(string, arg);
+	printf("\n");
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void OS::LogWarning(const char* string, va_list arg)
+void log_warning(const char* string, va_list arg)
 {
 {
-	Printf("W: ");
-	Vprintf(string, arg);
-	Printf("\n");
+	printf("W: ");
+	vprintf(string, arg);
+	printf("\n");
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void OS::LogInfo(const char* string, va_list arg)
+void log_info(const char* string, va_list arg)
 {
 {
-	Printf("I: ");
-	Vprintf(string, arg);
-	Printf("\n");
+	printf("I: ");
+	vprintf(string, arg);
+	printf("\n");
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool OS::Exists(const char* path)
+bool exists(const char* path)
 {
 {
 	struct stat dummy;
 	struct stat dummy;
 	return (stat(path, &dummy) == 0);
 	return (stat(path, &dummy) == 0);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool OS::IsDir(const char* path)
+bool is_dir(const char* path)
 {
 {
 	struct stat info;
 	struct stat info;
 	memset(&info, 0, sizeof(struct stat));
 	memset(&info, 0, sizeof(struct stat));
@@ -99,7 +102,7 @@ bool OS::IsDir(const char* path)
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool OS::IsReg(const char* path)
+bool is_reg(const char* path)
 {
 {
 	struct stat info;
 	struct stat info;
 	memset(&info, 0, sizeof(struct stat));
 	memset(&info, 0, sizeof(struct stat));
@@ -108,36 +111,36 @@ bool OS::IsReg(const char* path)
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool OS::Mknod(const char* path)
+bool mknod(const char* path)
 {
 {
 	// Permission mask: rw-r--r--
 	// Permission mask: rw-r--r--
-	return mknod(path, S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, 0) == 0;
+	return ::mknod(path, S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, 0) == 0;
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool OS::Unlink(const char* path)
+bool unlink(const char* path)
 {
 {
-	return (unlink(path) == 0);
+	return (::unlink(path) == 0);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool OS::Mkdir(const char* path)
+bool mkdir(const char* path)
 {
 {
 	// rwxr-xr-x permission mask
 	// rwxr-xr-x permission mask
-	return (mkdir(path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0);
+	return (::mkdir(path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool OS::Rmdir(const char* path)
+bool rmdir(const char* path)
 {
 {
-	return (rmdir(path) == 0);
+	return (::rmdir(path) == 0);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-const char* OS::GetCWD()
+const char* get_cwd()
 {
 {
-	static char cwdBuf[1024];
-	if (getcwd(cwdBuf, 1024) == NULL)
+	static char cwdBuf[MAX_OS_PATH_LENGTH];
+	if (getcwd(cwdBuf, MAX_OS_PATH_LENGTH) == NULL)
 	{
 	{
 		return Str::EMPTY;
 		return Str::EMPTY;
 	}
 	}
@@ -146,7 +149,7 @@ const char* OS::GetCWD()
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-const char* OS::GetHome()
+const char* get_home()
 {
 {
 	char* envHome = NULL;
 	char* envHome = NULL;
 	envHome = getenv("HOME");
 	envHome = getenv("HOME");
@@ -160,7 +163,7 @@ const char* OS::GetHome()
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-const char* OS::GetEnv(const char* env)
+const char* get_env(const char* env)
 {
 {
 	char* envDevel = NULL;
 	char* envDevel = NULL;
 	envDevel = getenv(env);
 	envDevel = getenv(env);
@@ -174,7 +177,7 @@ const char* OS::GetEnv(const char* env)
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-bool OS::Ls(const char* path, List<Str>& fileList)
+bool ls(const char* path, List<Str>& fileList)
 {
 {
 	DIR *dir;
 	DIR *dir;
 	struct dirent *ent;
 	struct dirent *ent;
@@ -188,7 +191,7 @@ bool OS::Ls(const char* path, List<Str>& fileList)
 
 
 	while ((ent = readdir (dir)) != NULL)
 	while ((ent = readdir (dir)) != NULL)
 	{
 	{
-		fileList.Append(Str(ent->d_name));
+		fileList.push_back(Str(ent->d_name));
 	}
 	}
 
 
 	closedir (dir);
 	closedir (dir);
@@ -196,5 +199,12 @@ bool OS::Ls(const char* path, List<Str>& fileList)
 	return true;
 	return true;
 }
 }
 
 
-} // namespace Crown
+//-----------------------------------------------------------------------------
+void init_os()
+{
+
+}
+
+} // namespace os
+} // namespace crown
 
 

+ 2 - 2
src/os/linux/LinuxTimer.cpp

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Timer.h"
 #include "Timer.h"
 #include <sys/time.h>
 #include <sys/time.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Timer::Timer()
 Timer::Timer()
@@ -83,5 +83,5 @@ ulong Timer::StopMicroseconds() const
 	return (tmp.tv_sec - mStartTime.tv_sec) * 1000000 + (tmp.tv_nsec - mStartTime.tv_nsec) / 1000;
 	return (tmp.tv_sec - mStartTime.tv_sec) * 1000000 + (tmp.tv_nsec - mStartTime.tv_nsec) / 1000;
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/linux/LinuxTimer.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <time.h>
 #include <time.h>
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class Timer
 class Timer
@@ -69,5 +69,5 @@ private:
 	timespec mStartTime;		// Time at Start* call
 	timespec mStartTime;		// Time at Start* call
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 32 - 120
src/os/linux/X11Keyboard.cpp

@@ -29,11 +29,10 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <X11/keysymdef.h>
 #include <X11/keysymdef.h>
 #include <X11/XKBlib.h>
 #include <X11/XKBlib.h>
 #include "Exceptions.h"
 #include "Exceptions.h"
-#include "X11InputManager.h"
 #include "Log.h"
 #include "Log.h"
 #include "OS.h"
 #include "OS.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -49,46 +48,46 @@ X11Keyboard::X11Keyboard(InputManager* creator) :
 		mKeyState[i] = false;
 		mKeyState[i] = false;
 	}
 	}
 
 
-	// Connect to the X Server
-	mDisplay = XOpenDisplay(NULL);
+//	// Connect to the X Server
+//	mDisplay = XOpenDisplay(NULL);
 
 
-	if (!mDisplay)
-	{
-		throw InvalidOperationException("X11Keyboard::X11Keyboard: Unable to connect to the X Server.");
-	}
+//	if (!mDisplay)
+//	{
+//		throw InvalidOperationException("X11Keyboard::X11Keyboard: Unable to connect to the X Server.");
+//	}
 
 
-	if (mCreator)
-	{
-		mXWindow = static_cast<X11InputManager*>(mCreator)->GetXWindow();
-	}
+//	if (mCreator)
+//	{
+//		mXWindow = static_cast<X11InputManager*>(mCreator)->GetXWindow();
+//	}
 
 
-	// We want to track motion and button pressed/released events
-	if (XSelectInput(mDisplay, mXWindow, KeyPressMask | KeyReleaseMask) == BadWindow)
-	{
-		throw InvalidOperationException("X11Keyboard::X11Keyboard: Unable to select input, bad window.");
-	}
+//	// We want to track motion and button pressed/released events
+//	if (XSelectInput(mDisplay, mXWindow, KeyPressMask | KeyReleaseMask) == BadWindow)
+//	{
+//		throw InvalidOperationException("X11Keyboard::X11Keyboard: Unable to select input, bad window.");
+//	}
 
 
-	Bool detectable;
-	if ((mDetectableAutoRepeat = (bool) XkbSetDetectableAutoRepeat(mDisplay, true, &detectable)) == False)
-	{
-		Log::I("X11Keyboard::X11Keyboard: Detectable auto-repeat not supported.");
-	}
+//	Bool detectable;
+//	if ((mDetectableAutoRepeat = (bool) XkbSetDetectableAutoRepeat(mDisplay, true, &detectable)) == False)
+//	{
+//		Log::I("X11Keyboard::X11Keyboard: Detectable auto-repeat not supported.");
+//	}
 
 
-	static_cast<X11InputManager*>(mCreator)->SetKeyboardAvailable(true);
+//	static_cast<X11InputManager*>(mCreator)->SetKeyboardAvailable(true);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 X11Keyboard::~X11Keyboard()
 X11Keyboard::~X11Keyboard()
 {
 {
-	if (mCreator)
-	{
-		static_cast<X11InputManager*>(mCreator)->SetKeyboardAvailable(false);
-	}
-
-	if (mDisplay)
-	{
-		XCloseDisplay(mDisplay);
-	}
+//	if (mCreator)
+//	{
+//		static_cast<X11InputManager*>(mCreator)->SetKeyboardAvailable(false);
+//	}
+
+//	if (mDisplay)
+//	{
+//		XCloseDisplay(mDisplay);
+//	}
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -109,93 +108,6 @@ bool X11Keyboard::IsKeyReleased(KeyCode key) const
 	return mKeyState[key] == false;
 	return mKeyState[key] == false;
 }
 }
 
 
-//-----------------------------------------------------------------------------
-void X11Keyboard::EventLoop()
-{
-	XEvent event;
-	KeyboardEvent keyboardEvent;
-
-	while (XPending(mDisplay))
-	{
-		XNextEvent(mDisplay, &event);
-
-		switch (event.type)
-		{
-			case KeyPress:
-			case KeyRelease:
-			{
-				char string[4] = {0, 0, 0, 0};
-				int len = -1;
-				KeySym key;
-
-				len = XLookupString(&event.xkey, string, 4, &key, NULL);
-
-				Key kc = TranslateKey(key);
-
-				// Check if any modifier key is pressed or released
-				if (kc == KC_LSHIFT || kc == KC_RSHIFT)
-				{
-					(event.type == KeyPress) ? mModifierMask |= MK_SHIFT : mModifierMask &= ~MK_SHIFT;
-				}
-				else if (kc == KC_LCONTROL || kc == KC_RCONTROL)
-				{
-					(event.type == KeyPress) ? mModifierMask |= MK_CTRL : mModifierMask &= ~MK_CTRL;
-				}
-				else if (kc == KC_LALT || kc == KC_RALT)
-				{
-					(event.type == KeyPress) ? mModifierMask |= MK_ALT : mModifierMask &= ~MK_ALT;
-				}
-
-				mKeyState[kc] = (event.type == KeyPress) ? true : false;
-				keyboardEvent.key = kc;
-
-				if (mListener)
-				{
-					if (event.type == KeyPress)
-					{
-						mListener->KeyPressed(keyboardEvent);
-					}
-					else if (event.type == KeyRelease)
-					{
-						mListener->KeyReleased(keyboardEvent);
-					}
-				}
-
-				if (event.type == KeyPress)
-				{
-				push_event(OS::OSET_KEYBOARD, 1, 2, 3, 4);
-				}
-				else if (event.type == KeyRelease)
-				{
-				push_event(OS::OSET_KEYBOARD, 55, 2, 3, 4);
-				}
-
-
-				// Text input part
-				if (event.type == KeyPress && len > 0)
-				{
-					//crownEvent.event_type = ET_TEXT;
-					//crownEvent.text.type = TET_TEXT_INPUT;
-					strncpy(keyboardEvent.text, string, 4);
-
-					if (mListener)
-					{
-						mListener->TextInput(keyboardEvent);
-					}
-				}
-
-				break;
-			}
-			case KeymapNotify:
-			{
-				XRefreshKeyboardMapping(&event.xmapping);
-
-				break;
-			}
-		}
-	}
-}
-
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 Key X11Keyboard::TranslateKey(int x11Key)
 Key X11Keyboard::TranslateKey(int x11Key)
 {
 {
@@ -253,5 +165,5 @@ Key X11Keyboard::TranslateKey(int x11Key)
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 5
src/os/linux/X11Keyboard.h

@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 struct _XDisplay;
 struct _XDisplay;
 typedef struct _XDisplay Display;
 typedef struct _XDisplay Display;
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -56,9 +56,6 @@ public:
 	/** @copydoc Keyboard::IsKeyReleased() */
 	/** @copydoc Keyboard::IsKeyReleased() */
 	virtual bool IsKeyReleased(KeyCode key) const;
 	virtual bool IsKeyReleased(KeyCode key) const;
 
 
-	/** @copydoc Keyboard::EventLoop() */
-	virtual void EventLoop();
-
 	/**
 	/**
 		Returns whether DetectableAutoRepeat is set.
 		Returns whether DetectableAutoRepeat is set.
 	@return
 	@return
@@ -79,5 +76,5 @@ private:
 	bool mDetectableAutoRepeat;
 	bool mDetectableAutoRepeat;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 53 - 121
src/os/linux/X11Mouse.cpp

@@ -27,9 +27,8 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <X11/Xlib.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xutil.h>
 #include "Exceptions.h"
 #include "Exceptions.h"
-#include "X11InputManager.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -40,61 +39,61 @@ X11Mouse::X11Mouse(InputManager* creator) :
 	mXWindow(0),
 	mXWindow(0),
 	mHiddenCursor(0)
 	mHiddenCursor(0)
 {
 {
-	// Connect to the X Server
-	mDisplay = XOpenDisplay(NULL);
-
-	if (!mDisplay)
-	{
-		throw InvalidOperationException("X11Mouse::X11Mouse: Unable to connect to the X Server.");
-	}
-
-	if (mCreator)
-	{
-		mXWindow = static_cast<X11InputManager*>(mCreator)->GetXWindow();
-	}
-
-	// We want to track motion and button pressed/released events
-	if (XSelectInput(mDisplay, mXWindow, ButtonPressMask | ButtonReleaseMask | PointerMotionMask) == BadWindow)
-	{
-		throw InvalidOperationException("X11Mouse::X11Mouse: Unable to select input, bad window.");
-	}
-
-	// Build hidden cursor
-	Pixmap bm_no;
-	XColor black, dummy;
-	Colormap colormap;
-	static char no_data[] = { 0,0,0,0,0,0,0,0 };
-
-	colormap = DefaultColormap(mDisplay, DefaultScreen(mDisplay));
-	XAllocNamedColor(mDisplay, colormap, "black", &black, &dummy);
-	bm_no = XCreateBitmapFromData(mDisplay, mXWindow, no_data, 8, 8);
-	mHiddenCursor = XCreatePixmapCursor(mDisplay, bm_no, bm_no, &black, &black, 0, 0);
-
-	static_cast<X11InputManager*>(mCreator)->SetMouseAvailable(true);
+//	// Connect to the X Server
+//	mDisplay = XOpenDisplay(NULL);
+
+//	if (!mDisplay)
+//	{
+//		throw InvalidOperationException("X11Mouse::X11Mouse: Unable to connect to the X Server.");
+//	}
+
+//	if (mCreator)
+//	{
+//		mXWindow = static_cast<X11InputManager*>(mCreator)->GetXWindow();
+//	}
+
+//	// We want to track motion and button pressed/released events
+//	if (XSelectInput(mDisplay, mXWindow, ButtonPressMask | ButtonReleaseMask | PointerMotionMask) == BadWindow)
+//	{
+//		throw InvalidOperationException("X11Mouse::X11Mouse: Unable to select input, bad window.");
+//	}
+
+//	// Build hidden cursor
+//	Pixmap bm_no;
+//	XColor black, dummy;
+//	Colormap colormap;
+//	static char no_data[] = { 0,0,0,0,0,0,0,0 };
+
+//	colormap = DefaultColormap(mDisplay, DefaultScreen(mDisplay));
+//	XAllocNamedColor(mDisplay, colormap, "black", &black, &dummy);
+//	bm_no = XCreateBitmapFromData(mDisplay, mXWindow, no_data, 8, 8);
+//	mHiddenCursor = XCreatePixmapCursor(mDisplay, bm_no, bm_no, &black, &black, 0, 0);
+
+//	static_cast<X11InputManager*>(mCreator)->SetMouseAvailable(true);
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 X11Mouse::~X11Mouse()
 X11Mouse::~X11Mouse()
 {
 {
-	if (mCreator)
-	{
-		static_cast<X11InputManager*>(mCreator)->SetMouseAvailable(false);
-	}
-
-	if (!IsCursorVisible())
-	{
-		SetCursorVisible(true);
-	}
-
-	if (mHiddenCursor)
-	{
-		XFreeCursor(mDisplay, mHiddenCursor);
-	}
-
-	if (mDisplay)
-	{
-		XCloseDisplay(mDisplay);
-	}
+//	if (mCreator)
+//	{
+//		static_cast<X11InputManager*>(mCreator)->SetMouseAvailable(false);
+//	}
+
+//	if (!IsCursorVisible())
+//	{
+//		SetCursorVisible(true);
+//	}
+
+//	if (mHiddenCursor)
+//	{
+//		XFreeCursor(mDisplay, mHiddenCursor);
+//	}
+
+//	if (mDisplay)
+//	{
+//		XCloseDisplay(mDisplay);
+//	}
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -147,7 +146,7 @@ Vec2 X11Mouse::GetCursorRelativeXY() const
 	XWindowAttributes attribs;
 	XWindowAttributes attribs;
 	XGetWindowAttributes(mDisplay, mXWindow, &attribs);
 	XGetWindowAttributes(mDisplay, mXWindow, &attribs);
 
 
-	Vec2 pos = GetCursorXY().ToVec2();
+	Vec2 pos = GetCursorXY().to_vec2();
 
 
 	pos.x = pos.x / (float) attribs.width;
 	pos.x = pos.x / (float) attribs.width;
 	pos.y = pos.y / (float) attribs.height;
 	pos.y = pos.y / (float) attribs.height;
@@ -164,72 +163,5 @@ void X11Mouse::SetCursorRelativeXY(const Vec2& position)
 	SetCursorXY(Point2((int)(position.x * (float) attribs.width), (int)(position.y * (float) attribs.height)));
 	SetCursorXY(Point2((int)(position.x * (float) attribs.width), (int)(position.y * (float) attribs.height)));
 }
 }
 
 
-//-----------------------------------------------------------------------------
-void X11Mouse::EventLoop()
-{
-	XEvent event;
-	MouseEvent mouseEvent;
-
-	while (XPending(mDisplay))
-	{
-		XNextEvent(mDisplay, &event);
-
-		switch (event.type)
-		{
-			case ButtonPress:
-			case ButtonRelease:
-			{
-				switch (event.xbutton.button)
-				{
-					case Button1:
-					{
-						mouseEvent.button = MB_LEFT;
-						break;
-					}
-					case Button2:
-					{
-						mouseEvent.button = MB_MIDDLE;
-						break;
-					}
-					case Button3:
-					{
-						mouseEvent.button = MB_RIGHT;
-						break;
-					}
-				}
-
-				mouseEvent.x = event.xbutton.x;
-				mouseEvent.y = event.xbutton.y;
-
-				if (mListener)
-				{
-					if (event.type == ButtonPress)
-					{
-						mListener->ButtonPressed(mouseEvent);
-					}
-					else if (event.type == ButtonRelease)
-					{
-						mListener->ButtonReleased(mouseEvent);
-					}
-				}
-
-				break;
-			}
-			case MotionNotify:
-			{
-				mouseEvent.x = event.xbutton.x;
-				mouseEvent.y = event.xbutton.y;
-
-				if (mListener)
-				{
-					mListener->CursorMoved(mouseEvent);
-				}
-
-				break;
-			}
-		}
-	}
-}
-
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 5
src/os/linux/X11Mouse.h

@@ -32,7 +32,7 @@ typedef struct _XDisplay Display;
 typedef unsigned long XID;
 typedef unsigned long XID;
 typedef XID Cursor;
 typedef XID Cursor;
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -67,9 +67,6 @@ public:
 	/** @copydoc Mouse::SetCursorRelativeXY() */
 	/** @copydoc Mouse::SetCursorRelativeXY() */
 	virtual void SetCursorRelativeXY(const Vec2& position);
 	virtual void SetCursorRelativeXY(const Vec2& position);
 
 
-	/** @copydoc Mouse::EventLoop() */
-	virtual void EventLoop();
-
 private:
 private:
 
 
 	bool mIsCursorVisible;
 	bool mIsCursorVisible;
@@ -80,5 +77,5 @@ private:
 	Cursor mHiddenCursor;
 	Cursor mHiddenCursor;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WGLRenderWindow.cpp

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Log.h"
 #include "Log.h"
 #include "resources.h"
 #include "resources.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 char WGLRenderWindow::mWindowClassName[20] = "";
 char WGLRenderWindow::mWindowClassName[20] = "";
@@ -255,5 +255,5 @@ void WGLRenderWindow::Update()
 	SwapBuffers(mDC);
 	SwapBuffers(mDC);
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WGLRenderWindow.h

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "RenderWindow.h"
 #include "RenderWindow.h"
 #include "Types.h"
 #include "Types.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class WGLRenderWindow : public RenderWindow
 class WGLRenderWindow : public RenderWindow
@@ -99,5 +99,5 @@ private:
 	void EventLoopDo(unsigned int minMsg, unsigned int maxMsg);
 	void EventLoopDo(unsigned int minMsg, unsigned int maxMsg);
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WinInputManager.cpp

@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "WinMouse.h"
 #include "WinMouse.h"
 #include "WinKeyboard.h"
 #include "WinKeyboard.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -68,5 +68,5 @@ void WinInputManager::Init(const EventSource& source)
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WinInputManager.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "InputManager.h"
 #include "InputManager.h"
 #include <windows.h>
 #include <windows.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 class WinInputManager : public InputManager
 class WinInputManager : public InputManager
@@ -88,5 +88,5 @@ private:
 	HWND mWindowHandle;
 	HWND mWindowHandle;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WinKeyboard.cpp

@@ -31,7 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #undef MK_SHIFT
 #undef MK_SHIFT
 #undef MK_ALT
 #undef MK_ALT
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -198,5 +198,5 @@ Key WinKeyboard::TranslateKey(int winKey)
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WinKeyboard.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Keyboard.h"
 #include "Keyboard.h"
 #include <windows.h>
 #include <windows.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -76,5 +76,5 @@ private:
 	HWND mWindowHandle;
 	HWND mWindowHandle;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WinMouse.cpp

@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 // Undef functions to avoid conflicts
 // Undef functions to avoid conflicts
 #undef MB_RIGHT
 #undef MB_RIGHT
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -215,5 +215,5 @@ void WinMouse::EventLoop()
 	}
 	}
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WinMouse.h

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Mouse.h"
 #include "Mouse.h"
 #include <windows.h>
 #include <windows.h>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 /**
 /**
@@ -74,5 +74,5 @@ private:
 	HWND mWindowHandle;
 	HWND mWindowHandle;
 };
 };
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WinOS.cpp

@@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <cstdio>
 #include <cstdio>
 #include <cstdarg>
 #include <cstdarg>
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -171,5 +171,5 @@ bool OS::Ls(const char* path, List<Str>& fileList)
 	return false; // TODO
 	return false; // TODO
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

+ 2 - 2
src/os/win/WinTimer.cpp

@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <windows.h>
 #include <windows.h>
 #include "Timer.h"
 #include "Timer.h"
 
 
-namespace Crown
+namespace crown
 {
 {
 
 
 Timer::Timer()
 Timer::Timer()
@@ -155,5 +155,5 @@ ulong Timer::StopMicroseconds() const
 	return (ulong)((currentTime - mStartTime) / (mFrequency/1000000.0));
 	return (ulong)((currentTime - mStartTime) / (mFrequency/1000000.0));
 }
 }
 
 
-} // namespace Crown
+} // namespace crown
 
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно