Feel free to make a patch to find out...vincele wrote:...moving all those ifdeffery in a centralized header (fo_boost_compat.h ?)...
Should SDL be used as the GUI instead of Ogre?
Moderator: Committer
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Should SDL be used as the GUI instead of Ogre?
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Should SDL be used as the GUI instead of Ogre?
Here's what I was working on before realizing I'd be adding dependencies the old SDKs wouldn't meet. Probably won't immediately apply or compile...Geoff the Medio wrote:...I'll post some patches that go part way to turning on zipped xml serialization. This should add dependencies to zlib...
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
Re: Should SDL be used as the GUI instead of Ogre?
I managed to compile the branch against boost1.54, which is the default on the current ubuntu.
I used -DBOOST_SPIRIT_USE_PHOENIX_V3 and modified some #if conditions to fit that (made it use the new code in specific cases if the macro was defined). I'll see if I can figure out which of the things I did were actually necessary.
I used -DBOOST_SPIRIT_USE_PHOENIX_V3 and modified some #if conditions to fit that (made it use the new code in specific cases if the macro was defined). I'll see if I can figure out which of the things I did were actually necessary.
Any code by me in this post is released under GPL 2.0 or later.
Re: Should SDL be used as the GUI instead of Ogre?
Well, in that specific location (GG/Base.h starting at line 34), the code in trunk looks like this:Geoff the Medio wrote:This issue probably isn't new to the recent changes, as OpenGL has been in use prior to this. What does trunk do for equivalent includes?Vezzra wrote:Code: Select all
#include <GL/glew.h>
Code: Select all
// include OpenGL headers
#if defined(__APPLE__) && defined(__MACH__)
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
#else
# include <GL/gl.h>
# include <GL/glu.h>
#endif
#include <GG/glext.h>
Code: Select all
// GL headers
#include <GL/glew.h>
Code: Select all
#ifdef FREEORION_WIN32
#include <GL/glew.h>
#endif
Code: Select all
// GL headers
#if defined(_WIN32)
#include <GL/glew.h>
#elif defined(__APPLE__) && defined(__MACH__)
#include <SDL2/SDL_opengl.h>
#include <OpenGL/glu.h>
#else
// TODO: What to do on Linux...?
#endif
- adrian_broher
- Programmer
- Posts: 1156
- Joined: Fri Mar 01, 2013 9:52 am
- Location: Germany
Re: Should SDL be used as the GUI instead of Ogre?
#include GL/glew.hVezzra wrote:And replace the TODO with what needs to be included on Linux to get things working (Marcel? Dilvish?).
Also add GLEW as a dependency for MacOSX. It's easier to have one extension loader on all platforms instead of this #ifdef nonsense.
http://glew.sourceforge.net/
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz
Re: Should SDL be used as the GUI instead of Ogre?
Sorry, no luck. Using glew.h and linking with libGLEW.a lets me successfully build FO, but when I try to run a game FO crashes after universe generation, before the first turn, when calling the ShaderProgram ctor. Backtrace attached.adrian_broher wrote:Also add GLEW as a dependency for MacOSX. It's easier to have one extension loader on all platforms instead of this #ifdef nonsense.
- Attachments
-
- crash_using_glew.txt
- (48.26 KiB) Downloaded 113 times
- adrian_broher
- Programmer
- Posts: 1156
- Joined: Fri Mar 01, 2013 9:52 am
- Location: Germany
Re: Should SDL be used as the GUI instead of Ogre?
You need to call glewInit before using any glCalls. This is done for the window client only now http://sourceforge.net/p/freeorion/code ... entApp.cpp line 239. It should work you you remove the ifdef
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz
Re: Should SDL be used as the GUI instead of Ogre?
Yay! Victory at last! Thanks for the hintadrian_broher wrote:You need to call glewInit before using any glCalls. This is done for the window client only now http://sourceforge.net/p/freeorion/code ... entApp.cpp line 239. It should work you you remove the ifdef
To be able to build FO on OSX with glew I also removed all the other #ifdefs that caused glew.h to be only included on Windows in ShaderProgram.cpp, HumanClientApp.cpp, GLClientAndServerBuffer.cpp, MapWnd.cpp and SidePanel.cpp. Otherwise I get build errors that gl.h, glu.h etc. have been included before glew.h. Actually the only two that won't build in that case are ShaderProgram.cpp and GLClientAndServerBuffer.cpp, but I thought it's probably better to be thorough and remove those #ifdefs everywhere.
@Geoff: Can I commit these changes?
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Should SDL be used as the GUI instead of Ogre?
Why are you asking?Vezzra wrote:Can I commit these changes?
Re: Should SDL be used as the GUI instead of Ogre?
Probably because it has been a bit late yesterday, my brain wasn't working right anymore, and I wasn't sure if there might be reasons not to make these changesGeoff the Medio wrote:Why are you asking?
Anyway, I guess a got my answer. Committed.
Re: Should SDL be used as the GUI instead of Ogre?
I've uploaded an experimental new version of the OSX SDK (to FreeOrionSDK/Test on sourceforge) that should work with the SDL branch. The necessary updates to the Xcode project have been committed. So if anyone feels like experimenting...
Re: Should SDL be used as the GUI instead of Ogre?
I kinda got lost now - how far along is the boost 1.56 support in trunk?
Attached patches are released under GPL 2.0 or later.
Re: Should SDL be used as the GUI instead of Ogre?
In trunk? None. Switching to SDL and upgrade of dependencies is done in the SDL branch. And we're most likely not going to upgrade to boost 1.56, but 1.55, due to a bug in 1.56 that would require us to patch boost to be able to use it.Chriss wrote:I kinda got lost now - how far along is the boost 1.56 support in trunk?
Re: Should SDL be used as the GUI instead of Ogre?
Still no cleanup of CMakeLists in this branch?
Here is some. Removes references to removed files from CMakeLists and removes SerializePathingEngine, since pathing engine is gone. Pretty much the same as earlier, maybe cleaner.
Here is some. Removes references to removed files from CMakeLists and removes SerializePathingEngine, since pathing engine is gone. Pretty much the same as earlier, maybe cleaner.
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
Any code by me in this post is released under GPL 2.0 or later.
Re: Should SDL be used as the GUI instead of Ogre?
Let's say arch adds the missing includes for serialization to work. What are the chances of me being able to compile a FO branch with 1.56 in the near future? I am not sure if I can stay on 1.55 for months... It's not really a supported constellation in Arch. Boost versions seem to take a couple of months at least.Vezzra wrote:In trunk? None. Switching to SDL and upgrade of dependencies is done in the SDL branch. And we're most likely not going to upgrade to boost 1.56, but 1.55, due to a bug in 1.56 that would require us to patch boost to be able to use it.Chriss wrote:I kinda got lost now - how far along is the boost 1.56 support in trunk?
Attached patches are released under GPL 2.0 or later.