Problem with CEGUI integration - what's missing?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

cybersphinx
Just popping in
Just popping in
Posts: 3
Joined: Mon Mar 06, 2006 22:37

Problem with CEGUI integration - what's missing?

Postby cybersphinx » Wed Mar 08, 2006 23:03

Hello there,

I am currently trying to integrate CEGUI into an existing project. I started with the OpenGL/SDL example in the wiki, which I can run flawlessly. Then I tried to integrate that into my code. For simplicity, I just took the function drawing the menu and added the CEGUI calls to that.

The code looks like this:

Code: Select all

#include <CEGUI/CEGUI.h>
#include <CEGUI/renderers/OpenGLGUIRenderer/openglrenderer.h>

int cegui_initialized = 0;
static CEGUI::OpenGLRenderer* ce_renderer;
static CEGUI::Window* ce_window;
static double last_time_pulse;

void runmenu(void) {
   if (!cegui_initialized) {
      ce_renderer = new CEGUI::OpenGLRenderer(0);
      new CEGUI::System(ce_renderer);
      CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Insane);
      CEGUI::SchemeManager::getSingleton().loadScheme("../datafiles/schemes/TaharezLook.scheme");
      CEGUI::FontManager::getSingleton().createFont("../datafiles/fonts/Commonwealth-10.font");
      CEGUI::System::getSingleton().setDefaultFont("Commonwealth-10");
      CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
      ce_window = CEGUI::WindowManager::getSingleton().loadWindowLayout("../datafiles/test.layout");
      CEGUI::System::getSingleton().setGUISheet(ce_window);

      last_time_pulse = 0.001 * static_cast<double>(SDL_GetTicks());

      cegui_initialized = 1;
   }

// do old menu stuff

   {
      double t = 0.001 * SDL_GetTicks();
      CEGUI::System::getSingleton().injectTimePulse(float(t - last_time_pulse));
      last_time_pulse = t;
   }

// draw old menu

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

Everything loads OK, the old menu works as before, but CEGUI just doesn't show anything. Are there some OpenGL states that have to be set for CEGUI to work in addition to those in the initPerFrameStates method? Or what else could it be?

cybersphinx
Just popping in
Just popping in
Posts: 3
Joined: Mon Mar 06, 2006 22:37

Postby cybersphinx » Wed Mar 15, 2006 15:31

Hello again,

Seems like a difficult problem, or perhaps the subject line was misleading - I've changed it now. Well, anyway, I still haven't found a solution, so I'd appreciate any clues.

cybersphinx

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Thu Mar 16, 2006 06:51

sounds a bit strange, as your code looks ok.
you may want to try getting the v0-4 branch from CVS as it contains some (pretty serious) bugfixes to the openglrenderer.

cybersphinx
Just popping in
Just popping in
Posts: 3
Joined: Mon Mar 06, 2006 22:37

Postby cybersphinx » Sun Mar 19, 2006 19:10

Hm, I did that (rebuilt the Debian package with the source from 'cvs co -rv0_4'), but it still doesn't work.

I guess there's something in OpenGL set in a way CEGUI doesn't expect, but I have no clue what...


Return to “Help”

Who is online

Users browsing this forum: No registered users and 20 guests