Compiling 2.0 Without DirectX

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
primesoftware
Gnoblar
Posts: 3
Joined: Wed Sep 09, 2015 3:24 pm

Compiling 2.0 Without DirectX

Post by primesoftware »

Hi everyone,
I am new to the Ogre community and would like to compile the 2.0 branch for Windows using OpenGL, not DirectX. Is this possible? I've been trying to compile, but I keep getting DirectX errors despite having the paths set. The June2010 DirectX SDK won't install, but I read Windows 7 has it installed already so I pointed to those files. It seems though the newer DirectX isn't using the same API as the old (i.e. looking for error functions / classes) that don't exist.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4211
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 802
Contact:

Re: Compiling 2.0 Without DirectX

Post by dark_sylinc »

Hi,

Just untick the RS_D3D9 checkbox in CMake (sorry don't have the exact name now as I'm on the tablet). This will avoid building the D3D9 rendersystem.

To install the June 2010 SDK you need to temporarily remove a KB update, install the SDK, then reinstall that KB update again. See http://blogs.msdn.com/b/chuckw/archive/ ... error.aspx

primesoftware
Gnoblar
Posts: 3
Joined: Wed Sep 09, 2015 3:24 pm

Re: Compiling 2.0 Without DirectX

Post by primesoftware »

Thanks! I got Ogre to compile without DX, but when trying to run the SampleBrowser.exe on windows I get the following error:

OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library .\RenderSystem_Direct3D9. System Error: The specified module could not be found. in DynLin::load at \path\to\OgreDynLib.cpp

I assume that is b/c I did not compile DirectX in. I would like to use OpenGL all the way. Is the SampleBrowser.exe only compatible with DirectX?

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4211
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 802
Contact:

Re: Compiling 2.0 Without DirectX

Post by dark_sylinc »

That error is due to some missconfiguration.

The file "plugins.cfg" (and plugins_d.cfg for debug builds) determine which plugins are loaded.
D3D9 is definitely there so Ogre tries to load it but it fails. If you remove it from the file, the error will go away but D3D9 won't be available as an option for you.

Possible reasons for failing to load the D3D9 plugin are:
  • RenderSystem_Direct3D9.dll is missing (RenderSystem_Direct3D9_d.dll in debug). Probably because it wasn't compiled or there was a compile error, or it was accidentally deleted.
  • x86 vs x64 missmatches (rare). You can rule this out quickly using Depedency Walker.
  • You're missing some dll like d3dx9_43.dll or similarly named dll. Use Dependency Walker to find out. If that's the problem, find that file in your Windows system folder and copy paste the file into the folder where your exe is (make sure you grab the correct x86/x64 one).
  • You don't have a complete DirectX installation. Run the web setup to ensure you're on the latest version.

primesoftware
Gnoblar
Posts: 3
Joined: Wed Sep 09, 2015 3:24 pm

Re: Compiling 2.0 Without DirectX

Post by primesoftware »

I commented out DirectX9 in the .cfg and that error went away. Now it is complaining about GLES2. I built with GLES2, although I did notice errors along the way and the appropriate files were not in the Ogre RenderSystem directory from the repo.

Error 79 error C1083: Cannot open include file: 'EGL/egl.h': No such file or directory (C:\OgreSDK\src\v2.0\RenderSystems\GLES2\src\OgreGLES2Context.cpp) \path\to\rendersystems\gles2\include\OgreGLES2Prerequisites.h 103 1 RenderSystem_GLES2

When I ran CMake I did tell it where to look for the EGL and GLSL2 libs I downloaded.....

Post Reply