Python binding

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
redvasily
Just popping in
Just popping in
Posts: 1
Joined: Mon Feb 28, 2005 19:00

Python binding

Postby redvasily » Mon Feb 28, 2005 19:40

I recently built python binding for CEGUI from pyogre CVS version of pycegui with OpenGL renderer. It works.

But there was a little problem with it.
gcc_xml which is used by Pyste produces following error:
[color=660000][font=Courier]In file included from include/cegui/CEGUIRenderer.h:32, from include/cegui/CEGUISystem.h:32, from include/cegui/CEGUIWindow.h:36, from include/cegui/elements/CEGUIButtonBase.h:30: include/cegui/CEGUIColourRect.h:41: error: syntax error before `__attribute__' In file included from include/cegui/CEGUISystem.h:32, from include/cegui/CEGUIWindow.h:36, from include/cegui/elements/CEGUIButtonBase.h:30: include/cegui/CEGUIRenderer.h:91: error: type specifier omitted for parameter ` QuadSplitMode' include/cegui/CEGUIRenderer.h:91: error: syntax error before `)' token[/font][/color]

It points to following line:
[color=006600][font=Courier]enum CEGUIBASE_API QuadSplitMode [/font][/color]

I wrote simple python script that replaced all occurencies of declarations of that kind to:
[color=006600][font=Courier]
enum
#ifndef __PYSTE__
CEGUIBASE_API
#endif
QuadSplitMode
[/font][/color]

and defined symbol __PYSTE__ for gcc_xml run.

And it worked. Perhaps you could integrate that fix to CEGUI source (Python script that makes changes is attached to this message).

Or is there some other way to workaround this problem that I am not aware of? :(

To those who interrested in python binding of CEGUI I can tell that it's complete and works pretty well, although it doesn't have pythonic feel 8)

Of course there were some causalities in API. I lost unicode support and subscribeEvent now is xxsubscribeEvent :(

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Python binding

Postby CrazyEddie » Mon Feb 28, 2005 20:01

Cool, glad you got pycegui working, I'll have to try this myself sometime, hehe ;)

The enum issue is really my fault, those 'CEGUIBASE_API' things should not have been put on the enums in the first place :oops:. I'll use a global search/replace and remove them all tomorrow, this should allow things to proceed properly :)

CE.

User avatar
Clay
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Sun Feb 13, 2005 04:20
Contact:

Re: Python binding

Postby Clay » Tue Mar 01, 2005 00:17

Wow, looks like we went after the same thing today (I'm one of the PyOgre developers). I just updated the PyCEGUI bindings to work with the Ogre renderer (http://www.cegui.org.uk/modules/newbb/v ... 07&forum=4). If you have it working with OpenGL in python I'd LOVE to see your codebase to get it working with OpenGL for the next release.

Mind sending me a patch or a set of files to use to get this working under OpenGL for Python? (clay AT bitshifters DOT org). It doesn't have to be complete or clean, just so I can see what you did. I'm not familiar with using OpenGL under python.

Which version of CEGUI did you use? 0.2.0 or CVS?

This would save me a ton of work later.

Thanks!
Clay

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Python binding

Postby CrazyEddie » Tue Mar 01, 2005 14:01

Just a note to say the issue with the enums has been fixed in CVS for both 0.2.0 and HEAD.

User avatar
baxissimo
Quite a regular
Quite a regular
Posts: 60
Joined: Tue Feb 22, 2005 08:04
Location: Tokyo, JAPAN
Contact:

Re: Python binding

Postby baxissimo » Fri Jul 08, 2005 01:13

Whats the status on this?
Seems two people had CEGUI bindings done back in February!? One OpenGL, one Ogre.
Where have these two projects gone since then?

It would be handy to have for implementing the "preview" button in Centipede's pyGTK-based skin editor.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Python binding

Postby CrazyEddie » Fri Jul 08, 2005 08:47

I've not heard anything on either of these. I think the one being done by Clay was being switched from Boost:: Python to SWIG, but that's the only news I have :?


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests