diff --git a/Engine.cpp b/Engine.cpp index 46fdfef..7544826 100644 --- a/Engine.cpp +++ b/Engine.cpp @@ -99,7 +99,11 @@ void Engine::checkResize() Engine::Engine() { - m_Device = createDevice( EDT_OPENGL, dimension2d( 1024, 768 ), 32, false, false, false, 0 ); +#if WIN32 + m_Device = createDevice( EDT_DIRECT3D9, dimension2d( 1024, 768 ), 32, false, false, false, 0 ); +#else + m_Device = createDevice( EDT_OPENGL, dimension2d( 1024, 768 ), 32, false, false, false, 0 ); +#endif m_Device->setResizable( true ); m_EventHandler = new EventHandler( m_Device ); @@ -108,7 +112,9 @@ Engine::Engine() m_Driver = m_Device->getVideoDriver(); m_Scene = m_Device->getSceneManager(); - m_Device->setWindowCaption( L"Blitz3D Viewer" ); + wstringstream windowTitle; + windowTitle << L"Blitz3D Viewer [" << m_Driver->getName() << L"]"; + m_Device->setWindowCaption( windowTitle.str().c_str() ); setupScene(); diff --git a/Engine.h b/Engine.h index 9063906..f2422b1 100644 --- a/Engine.h +++ b/Engine.h @@ -6,6 +6,7 @@ class UserInterface; class View; #include +#include #include #include @@ -16,6 +17,7 @@ class View; using std::cout; using std::endl; using std::wstring; +using std::wstringstream; using namespace irr; using namespace irr::core; diff --git a/EventHandler.cpp b/EventHandler.cpp index 6137c7f..8dcc756 100644 --- a/EventHandler.cpp +++ b/EventHandler.cpp @@ -15,6 +15,7 @@ EventHandler::~EventHandler() bool EventHandler::addEventReceiver( EventReceiverType type, IEventReceiver *receiver ) { m_EventReceivers->insert( make_pair( type, receiver )); + return true; } // IEventReceiver diff --git a/main.cpp b/main.cpp index 0f963d3..efeb046 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,15 @@ #include "Engine.h" +#ifdef WIN32 +#include +int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) +#else int main( int argc, char **argv ) +#endif { Engine *engine = new Engine(); engine->run(); delete engine; } + diff --git a/win32/b3view.sln b/win32/b3view.sln new file mode 100644 index 0000000..d5afe3a --- /dev/null +++ b/win32/b3view.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "b3view", "b3view.vcxproj", "{639364D9-A57B-4B61-90D8-7974B3FA3435}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {639364D9-A57B-4B61-90D8-7974B3FA3435}.Debug|Win32.ActiveCfg = Debug|Win32 + {639364D9-A57B-4B61-90D8-7974B3FA3435}.Debug|Win32.Build.0 = Debug|Win32 + {639364D9-A57B-4B61-90D8-7974B3FA3435}.Release|Win32.ActiveCfg = Release|Win32 + {639364D9-A57B-4B61-90D8-7974B3FA3435}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/b3view.suo b/win32/b3view.suo new file mode 100644 index 0000000..d5987bf Binary files /dev/null and b/win32/b3view.suo differ diff --git a/win32/b3view.vcxproj b/win32/b3view.vcxproj new file mode 100644 index 0000000..3abcd4c --- /dev/null +++ b/win32/b3view.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {639364D9-A57B-4B61-90D8-7974B3FA3435} + Win32Proj + win32 + b3view + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + $(SolutionDir)\..\win32_build\ + $(SolutionDir)\..\win32_build\ + + + false + $(SolutionDir)\..\win32_build\ + $(SolutionDir)\..\win32_build\ + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + D:\Prj\irrlicht-1.7.1\include;%(AdditionalIncludeDirectories) + + + Windows + true + D:\Prj\irrlicht-1.7.1\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Irrlicht.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + D:\Prj\irrlicht-1.7.1\include;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + D:\Prj\irrlicht-1.7.1\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Irrlicht.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/win32/b3view.vcxproj.filters b/win32/b3view.vcxproj.filters new file mode 100644 index 0000000..1c57014 --- /dev/null +++ b/win32/b3view.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/win32/b3view.vcxproj.user b/win32/b3view.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/win32/b3view.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file