Here is my GUI file that initializes everything:
Code: Select all
void GUI::setDefaultDirectory(std::string directory)
{
//set a resource provider for loading CEGUI files
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
//define all the default values
rp->setResourceGroupDirectory("schemes", directory + "schemes/");
rp->setResourceGroupDirectory("imagesets", directory + "imagesets/");
rp->setResourceGroupDirectory("fonts", directory + "fonts/");
rp->setResourceGroupDirectory("layouts", directory + "layouts/");
rp->setResourceGroupDirectory("looknfeels", directory + "looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", directory + "lua_scripts/");
//apply them to respective subsystems
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");
}
void GUI::destroy()
{
CEGUI::System::destroy();
CEGUI::OpenGL3Renderer::destroy(*m_renderer);
}
void GUI::init()
{
//init CEGUI
m_renderer = &CEGUI::OpenGL3Renderer::bootstrapSystem();
}
I have a render loop for my program:
Code: Select all
m_currentScreen->render();
glBindTexture(GL_TEXTURE0, 0);
glUseProgram(0);
glActiveTexture(GL_TEXTURE0);
//render GUI
CEGUI::System::getSingleton().renderAllGUIContexts();
m_window.swapBuffers();
And here is where I set up what gui I want to display:
Code: Select all
GUI::getInstance().setDefaultDirectory("./resources/gui/");
//load a default scheme
CEGUI::SchemeManager::getSingleton().createFromFile("TaharezLook.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("Generic.scheme");
CEGUI::FontManager::getSingleton().createFromFile("DejaVuSans-10.font");
CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultFont("DejaVuSans-10");
//set a default mouse
CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage("TaharezLook/MouseArrow");
CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultTooltipType("TaharezLook/Tooltip");
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window* myRoot = wmgr.loadLayoutFromFile("TaharezLookOverview.layout");
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(myRoot);
I have remembered to do all the required input injection including the pulse every frame here:
Code: Select all
float time = (float)(SDL_GetTicks() - m_lastUpdate) / 1000.0f;
context.injectTimePulse(time);
CEGUI::System::getSingleton().injectTimePulse(time);
m_lastUpdate = SDL_GetTicks();
Any help would be greatly appreciated as to how the cursor is not rendering in any way.
Here is the log info as well:
Code: Select all
16/12/2019 14:10:56 (Std) ---- Version: 0.8.7 (Build: Dec 13 2019 Debug Microsoft Windows MSVC++ Unknown MSVC++ version 64 bit) ----
16/12/2019 14:10:56 (Std) ---- Renderer module is: CEGUI::OpenGL3Renderer - Official OpenGL 3.2 core based renderer module. TextureTarget support enabled via FBO OGL 3.2 core implementation. ----
16/12/2019 14:10:56 (Std) ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
16/12/2019 14:10:56 (Std) ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
16/12/2019 14:10:56 (Std) ---- Scripting module is: None ----