Broken/missing fonts and widgets on windows
Posted: Tue May 03, 2005 22:09
So I've managed to get CEGUI compiled and running, and I even see a window -- but fonts and widgets aren't being drawn (see attachment for screenshot). The scheme, imageset, and font all get found and loaded, so I'm not sure what I'm forgetting here? (I know the files are found OK because no exceptions occur, whereas it'd crash in the loaders when they weren't in place before.) This is pretty much copied from <a href="http://www.cegui.org.uk/modules/newbb/viewtopic.php?topic_id=470&forum=2">this thread</a>. I'm using an OpenGLRenderer, and I change dir to the data folder right before this snippet:
<code>
CEGUI::SchemeManager::getSingleton().loadScheme("WindowsLook.scheme");
CEGUI::System::getSingleton().setDefaultMouseCursor("WindowsLook", "MouseArrow");
CEGUI::Font *font = CEGUI::FontManager::getSingleton().createFont("Commonwealth-10.font");
CEGUI::System::getSingleton().setDefaultFont(font);
// Create the windows
wm = CEGUI::WindowManager::getSingletonPtr();
sheet = wm->createWindow("DefaultGUISheet", "root");
CEGUI::System::getSingleton().setGUISheet(sheet);
fw = (CEGUI::FrameWindow *)wm->createWindow("WindowsLook/FrameWindow", "mainWindow");
fw->setText("Test Window");
fw->setMinimumSize(CEGUI::Size(.25f, .25f));
fw->setMaximumSize(CEGUI::Size(.75f, .75f));
fw->setSize(CEGUI::Size(.5f, .5f));
fw->setPosition(CEGUI::Point(.2f, .2f));
fw->setCloseButtonEnabled(false);
sheet->addChildWindow(fw);
</code>
And then I just call renderGUI() on the System singleton. Happens with both WindowsLook and Taharez. I'm using VC++ 7.1 on Xp. Looked through the forum but can't find a similar problem -- anyone seen this before or have any ideas?
<b>Update</b>: It works now. I have no idea why, I was poking at non-CEGUI code and suddenly it looked alright. Nevermind ;)
<code>
CEGUI::SchemeManager::getSingleton().loadScheme("WindowsLook.scheme");
CEGUI::System::getSingleton().setDefaultMouseCursor("WindowsLook", "MouseArrow");
CEGUI::Font *font = CEGUI::FontManager::getSingleton().createFont("Commonwealth-10.font");
CEGUI::System::getSingleton().setDefaultFont(font);
// Create the windows
wm = CEGUI::WindowManager::getSingletonPtr();
sheet = wm->createWindow("DefaultGUISheet", "root");
CEGUI::System::getSingleton().setGUISheet(sheet);
fw = (CEGUI::FrameWindow *)wm->createWindow("WindowsLook/FrameWindow", "mainWindow");
fw->setText("Test Window");
fw->setMinimumSize(CEGUI::Size(.25f, .25f));
fw->setMaximumSize(CEGUI::Size(.75f, .75f));
fw->setSize(CEGUI::Size(.5f, .5f));
fw->setPosition(CEGUI::Point(.2f, .2f));
fw->setCloseButtonEnabled(false);
sheet->addChildWindow(fw);
</code>
And then I just call renderGUI() on the System singleton. Happens with both WindowsLook and Taharez. I'm using VC++ 7.1 on Xp. Looked through the forum but can't find a similar problem -- anyone seen this before or have any ideas?
<b>Update</b>: It works now. I have no idea why, I was poking at non-CEGUI code and suddenly it looked alright. Nevermind ;)