Page 1 of 1

CEGUI and OpenGL

Posted: Mon Jul 10, 2006 09:02
by SidRaven
Hi guys, i'm having some problems, after my attempt to try getting CEGUI working in a directx game (by injected a dll) i decided to try OpenGl with Quake 3.

My problem is though, when using:

Code: Select all

CEGUI::System::getSingleton().renderGUI()


It crashes the game, but, when commenting it out, it looks like the CEGUI stuff is being created sucessfully. Here is the log. When the "RenderGUI" is not commented out, it doesn't create a log.

10/07/2006 09:57:34 (InfL1) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10/07/2006 09:57:34 (InfL1) + Crazy Eddie's GUI System - Event log +
10/07/2006 09:57:34 (InfL1) + (http://www.cegui.org.uk/) +
10/07/2006 09:57:34 (InfL1) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

10/07/2006 09:57:34 (InfL1) CEGUI::Logger singleton created.
10/07/2006 09:57:34 (InfL1) ---- Begining CEGUI System initialisation ----
10/07/2006 09:57:34 (InfL1) CEGUI::ImagesetManager singleton created
10/07/2006 09:57:34 (InfL1) CEGUI::FontManager singleton created.
10/07/2006 09:57:34 (InfL1) CEGUI::WindowFactoryManager singleton created
10/07/2006 09:57:34 (InfL1) CEGUI::WindowManager singleton created
10/07/2006 09:57:34 (InfL1) CEGUI::SchemeManager singleton created.
10/07/2006 09:57:34 (InfL1) CEGUI::MouseCursor singleton created.
10/07/2006 09:57:34 (InfL1) CEGUI::GlobalEventSet singleton created.
10/07/2006 09:57:34 (InfL1) CEGUI::WidgetLookManager singleton created.
10/07/2006 09:57:34 (InfL1) WindowFactory for 'DefaultWindow' windows added.
10/07/2006 09:57:34 (InfL1) WindowFactory for 'DragContainer' windows added.
10/07/2006 09:57:34 (InfL1) WindowFactory for 'ScrolledContainer' windows added.
10/07/2006 09:57:34 (InfL1) Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
10/07/2006 09:57:34 (InfL1) CEGUI::System singleton created.
10/07/2006 09:57:34 (InfL1) ---- CEGUI System initialisation completed ----
10/07/2006 09:57:34 (InfL1) ---- Version 0.4.1 ----
10/07/2006 09:57:34 (InfL1) ---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based renderer module for CEGUI ----
10/07/2006 09:57:34 (InfL1) ---- XML Parser module is: CEGUI::TinyXMLParser - Official tinyXML based parser module for CEGUI ----
10/07/2006 09:57:34 (InfL1) ---- Scripting module is: None ----


I've tried placing "RenderGUI" in glViewport and glEnable but both crash. I'm injecting a dll which hooks opengl rendering functions. If you could help it would be greatly appreciated.

Also, is it possible to use CEGUI without having to place "CEGUIBase.dll" and "OpenGLGUIRenderer.dll" in the game directory?

Re: CEGUI and OpenGL

Posted: Tue Jul 11, 2006 04:49
by MacMan45
SidRaven wrote:I've tried placing "RenderGUI" in glViewport and glEnable but both crash. I'm injecting a dll which hooks opengl rendering functions. If you could help it would be greatly appreciated.


My OpenGL is a little rusty these days, but you arn't doing the rendergui between a glBegin & an glEnd are you?

Maybe you could hook glClear (and call the original clear & then renderGUI) or a glFlush (and call renderGUI before the real glFlush).

SidRaven wrote:Also, is it possible to use CEGUI without having to place "CEGUIBase.dll" and "OpenGLGUIRenderer.dll" in the game directory?


I'm sure there are ways, i can't think of any good ones right now though, if i solve the problem for my own hack, i'll try to get back to you :P

Posted: Tue Jul 11, 2006 06:41
by scriptkid
Hi,

about the DLLs: do you mean that you'd like to have them in a different location? Or would you like to link statically so that you don't have any DLLs? You can add the CEGUI's bin folder to your PATH, so each CEGUI application can find the most recent DLL's. You may link statically as of version 0.5, which is not released yet.

For the rendering you might also check this code from the layout editor, which uses OpenGl in a non-cegui application:
http://svn.sourceforge.net/viewcvs.cgi/ ... p&rev=1153

The method "void EditorCanvas::Render()" might give some insights. Althouth "glBegin()" and "glEnd()" are wrapped by the wxWidgets methods presumably.

Good luck!

Posted: Thu Jul 13, 2006 04:37
by MacMan45
scriptkid wrote:Hi,

about the DLLs: do you mean that you'd like to have them in a different location? Or would you like to link statically so that you don't have any DLLs? You can add the CEGUI's bin folder to your PATH, so each CEGUI application can find the most recent DLL's. You may link statically as of version 0.5, which is not released yet.


Hey, now there is some good thinking!
The PATH hadn't even occured to me, although, static linking sounds like a good option as well.

When i finally figure out the slowdown i'm having, i'll implement one of the two (depending ofcourse on when 0.5 comes out ;) )