[Solved] Stuck on tutorial - unable to display anything with CEGUI (OpenGL Renderer, Windows)
Posted: Sat Sep 05, 2015 18:52
Hi, there.
First of all - thanks to everyone involved in CEGUI development - it seems like truly universal GUI framework with amazing possibilities for configuration and customization.
Now for my trouble...
Setup:
OS: Windows 10
Compiler: MSVC v14 (Visual Studio 2015) x64
CEGUI version: 0.8.4
Renderer: OpenGL
Image codec: SILLY
XML parser: RapidXML
I am using GLFW to create OpenGL context and open a OpenGL window. I have very limited experience with OpenGL and for example I am not sure if I am requesting the window with the right parameters.
After that I am following the CEGUI in practice tutorial and trying to show a single image on the window, but there is nothing shown...
I get no error messages/exceptions and there is nothing suspicious in CEGUI.log (pastebin)
The CEGUI samples also seem to work just fine (except for some input glitches in Release but that's another story).
I would be very grateful for any advice you have to how to debug my problem.
First of all - thanks to everyone involved in CEGUI development - it seems like truly universal GUI framework with amazing possibilities for configuration and customization.
Now for my trouble...
Setup:
OS: Windows 10
Compiler: MSVC v14 (Visual Studio 2015) x64
CEGUI version: 0.8.4
Renderer: OpenGL
Image codec: SILLY
XML parser: RapidXML
I am using GLFW to create OpenGL context and open a OpenGL window. I have very limited experience with OpenGL and for example I am not sure if I am requesting the window with the right parameters.
After that I am following the CEGUI in practice tutorial and trying to show a single image on the window, but there is nothing shown...
Code: Select all
// init GLFW library
if (!glfwInit())
{
ReportErr(L"Can't init GLFW");
}
else
{
// create an OpenGL window
if (!glfwOpenWindow(windowWidth, widndowHeight, 8, 8, 8, 8, 0, 0, GLFW_WINDOW))
{
ReportErr(L"Unable to create window");
}
else
{
// set window title
glfwSetWindowTitle("Main window title");
CEGUI::OpenGLRenderer * HDTrenderer = &CEGUI::OpenGLRenderer::bootstrapSystem();
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(
CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "../../data/schemes/");
rp->setResourceGroupDirectory("imagesets", "../../data/imagesets/");
rp->setResourceGroupDirectory("fonts", "../../data/fonts/");
rp->setResourceGroupDirectory("layouts", "../../data/layouts/");
rp->setResourceGroupDirectory("looknfeels", "../../data/looknfeels/");
rp->setResourceGroupDirectory("lua_scripts", "../../data/lua_scripts/");
// set the default resource groups to be used
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
CEGUI::SchemeManager::getSingleton().createFromFile("TaharezLook.scheme");
// Set the defaults
CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultFont("DejaVuSans-12");
CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage("TaharezLook/MouseArrow");
CEGUI::Window* myRoot = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "_MasterRoot");
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(myRoot);
CEGUI::Window *myImageWindow = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticImage", "PrettyWindow");
myImageWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0.5, 0), CEGUI::UDim(0.5, 0)));
myImageWindow->setSize(CEGUI::USize(CEGUI::UDim(0, 150), CEGUI::UDim(0, 100)));
myImageWindow->setProperty("Image", "TaharezLook/CloseButtonNormal");
CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->addChild(myImageWindow);
}
}
I get no error messages/exceptions and there is nothing suspicious in CEGUI.log (pastebin)
The CEGUI samples also seem to work just fine (except for some input glitches in Release but that's another story).
I would be very grateful for any advice you have to how to debug my problem.