-
Notifications
You must be signed in to change notification settings - Fork 51
Fixes for Windows #27
base: master
Are you sure you want to change the base?
Changes from all commits
a2d1252
1a62d46
7f9c1a8
cf6c0f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,16 +188,37 @@ void OgreSetup::createOgreSystem() { | |
mPluginLoader.loadPlugin("Codec_FreeImage"); | ||
mPluginLoader.loadPlugin("Plugin_ParticleFX"); | ||
mPluginLoader.loadPlugin("RenderSystem_GL3Plus"); //We'll use OpenGL on Windows too, to make it easier to develop | ||
mPluginLoader.loadPlugin("RenderSystem_Direct3D11"); | ||
mPluginLoader.loadPlugin("RenderSystem_Direct3D10"); | ||
mPluginLoader.loadPlugin("RenderSystem_Direct3D9"); | ||
#endif | ||
|
||
auto renderSystem = mRoot->getAvailableRenderers().front(); | ||
//auto renderSystem = mRoot->getAvailableRenderers().front(); | ||
const auto& renderers = mRoot->getAvailableRenderers(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We used to support both DirectX and OpenGL, but in the end it just became a huge hassle since it meant I had to provide shaders for both GLSL and HLSL. So in the end we decided on only supporting OpenGL. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I didn’t come here for a long time. Yes, I wanted to make the game work on DirectX. But as I understand it, this is not worth doing. You can apply changes without this code. |
||
if (renderers.size() == 0){ | ||
S_LOG_WARNING("\nFatal error: Empty renderer list!\n"); | ||
exit(1); | ||
} | ||
const char* envRenderName = getenv("OGRE_RENDER_SYSTEM"); | ||
if (envRenderName!= NULL) | ||
{ | ||
auto renderSystem = mRoot->getRenderSystemByName(envRenderName); | ||
if (renderSystem == NULL){ | ||
S_LOG_WARNING("\nmRoot->getRenderSystemByName() return NULL!Render name:\n"); | ||
S_LOG_WARNING(envRenderName); | ||
renderSystem = renderers.front(); | ||
} | ||
mRoot->setRenderSystem(renderSystem); | ||
}else{ | ||
auto renderSystem = renderers.front(); | ||
try { | ||
//Set the default resolution to 1280 x 720 unless overridden by the user. | ||
renderSystem->setConfigOption("Video Mode", "1280 x 720"); //OGRE stores the value with two spaces after "x". | ||
} catch (const std::exception& ex) { | ||
S_LOG_WARNING("Could not set default resolution." << ex); | ||
} | ||
mRoot->setRenderSystem(renderSystem); | ||
} | ||
|
||
if (chdir(configSrv.getEmberDataDirectory().generic_string().c_str())) { | ||
S_LOG_WARNING("Failed to change to the data directory '" << configSrv.getEmberDataDirectory().string() << "'."); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you getting errors without these? Normally Ember should run without having to load the DirectX-plugins.