yes, that is the patch for the Panda source to work with Cegui 0.6.x. I have it running with modified PythonOgre wrappers. I haven’t been working on this since.
They’ve added quad caching, which I was doing in my code (with limited success). The quad rendering got a bit more complicated, but it’s for the better, it seems. So the renderer code will have to be rewritten to work with 0.7+.
The next issue is the Python wrappers. PythonOgre is the best for this. They’ve moved on to Cegui 0.7.1. I don’t know if their Cegui wrapper still depends on the Ogre wrapper and hence on Ogre (that was the case in 0.6.x).
It would be nice if you could work on this. I’ll try to help.
This is for Linux and makepanda.
You’ll need CEGUI 0.7.1 (later ones might work too).
I’m using Python bindings from PythonOgre. Their CEGUI bindings don’t depend on Ogre any more.
Yeah I’m going to look into it this weekend, do I need the CEGUI binaries or source, and I don’t see a 0.7.1 for CEGUI I only see 0.7.4 (0.7.1 for the editors though)? And why would I need the Ogre3D stuff?
The patch has the file cegui.cxx to test this. It compiles into a binary that creates a GUI in C++.
For this you need to build the files in panda/src/cegui directory and link against the Cegui lib. I was using makepanda to do this.
Python wrappers
This is where PythonOgre is used. They have the Python wrappers for Ogre, which also includes Cegui. Their Cegui wrapper still has some dependencies on Ogre (I said earlier that it doesn’t, but it does). These can be removed, but for a start, try it with Ogre.
To test this, run python_test.py.
Here, we need PythonOgre to link to the same Cegui lib as Panda.
I was using CeguiPython 1.6.4 which has Cegui version 0.7.1
On Linux, there is the patch command for this (cd src; patch -p1 < file.diff). You can do that in Cygwin too. If you use a CVS client with a GUI, it should have something like that as well.
From main directory, call ‘python makepanda/makepanda.py --everything’.
You’ll need to have the Cegui lib and header somewhere where makepanda can find them - install or compile Cegui as usual to get these.
If it can’t, it’ll say “WARNING: Could not locate thirdparty package cegui, excluding from build”.
Need you to a bit more specific as to getting CEGUI to compile, it keeps complaining about not being able to find CEGUIRect.h which I assume is due to it not being able to locate the .lib with that file in it. I’ve tried copying the lib folder from the CEGUI zip file into various places and telling VS where to look but it doesn’t seem to find it.
Looks like you need to create a thirdparty\win-libs-vc9\cegui\include and …cegui\lib folders and put the headers (.h files) into the include folder, and libs (.dll or .lib) into the lib folder.
Also, you’ll need to add stuff to the Windows/VS section of makepanda.py. Look for “if (COMPILER==“MSVC”)” line there. Try to copy what some other library is doing, e.g. FCOLLADA.
This is more about how Panda’s thirdparty system should work on Windows, so I’m guessing here.
Yeah I got it all to compile, I need to figure out a way of defining NOMINMAX when using the makepanda.bat batch though because there’s a issue with windows already having min/max defined as macros and it causes compilation issues with CEGUI.
Don’t ask me why but even defining NOMINMAX in the CEGUIString.h file where it is causing the issue doesn’t fix it I had to go into the function with the error and add a specific check to undefine ‘min’ when it compiles like this (around line 1250):
size_type utf8_stream_len(size_type num = npos, size_type idx = 0) const
{
using namespace std;
if (d_cplength < idx)
CEGUI_THROW(out_of_range("Index was out of range for CEGUI::String object"));
size_type maxlen = d_cplength - idx;
#ifdef min
# undef min
#endif //min
return encoded_size(&ptr()[idx], ceguimin(num, maxlen));
}
And that moves me along to the next error (cross platform compilation sucks don’t it? lol)
1>panda/src/cegui/ceguiInputHandler.cxx(21) : error C2491: 'CeguiInputHandler::_type_handle' : definition of dllimport static data member not allowed
EDIT:
I found a better way around the min/max issue I just moved all the CEGUI includes into 1 file (like the physx integration does) and added #undef min / #undef max above them
Also the CeguiInputHandler error seems to be caused by the EXPCL_PANDA thing in the ceguiInputHandler, I changed it to EXPCL_PANDACEGUI and then in the config_cegui.h i changed that EXPCL_PANDAODE to EXPCL_PANDACEGUI and I got past that error.
Moving right along to the new error:
1>cegui.cxx
1>[ 48%] Building Interrogate database built/pandac/input/libpandacegui.in
1> *** Error in /c/SVN/Panda3D/thirdparty/win-libs-vc9/cegui/include/CEGUIString.h near line 92, column 45:
1> parse error
1>Error parsing file: 'ceguiSupport.h'
The line it complains about looks like this:
class iterator : public std::iterator<std::random_access_iterator_tag, utf32>
I think it should also be noted I’m using CEGUI 0.7.5 for my headers/libs
You must have been posting this while I had the thing open to edit my last post to explain what I had been changing to fix these things lol.
I’m in the IRC if you want to jump in there sometime to try to knock these out in a faster fashion rather than filling the thread with getting the windows version to compile.