marciano wrote:
@AcidFaucet: Great that you are giving GUI integration a try. But I think we shouldn't add functions as your clearBinds to the API since the API acts on a much higher abstraction level. What we could do instead is setting all states to good default values after the rendering has finished. The best place for this is in Renderer::finishRendering.
Am I right in assuming all I need to do is add
Code:
glBindBuffer( GL_ARRAY_BUFFER, 0);
to Render::finishRendering to get CEGUI's openGL renderer working? I have CEGUI::System::getSingleton().renderGUI(); right after Horde3D::render( _cam ); and before Horde3D::finalizeFrame(); in my main loop. Currently I am using the glBindBuffer line in my finishRendering() function,but my CEGUI window is not appearing. Here's my init code for CEGUI:
Code:
myRenderer =
new CEGUI::OpenGLRenderer( 0, 800,600 );
new CEGUI::System( myRenderer );
rp = static_cast<CEGUI::DefaultResourceProvider*>(
CEGUI::System::getSingleton().getResourceProvider());
//absolute paths
rp->setResourceGroupDirectory("schemes", "C:/Users/Tyler/Documents/UCD/Computer_Animation/Muse/Data/CEGUI/datafiles/schemes/");
rp->setResourceGroupDirectory("imagesets", "C:/Users/Tyler/Documents/UCD/Computer_Animation/Muse/Data/CEGUI/datafiles/imagesets/");
rp->setResourceGroupDirectory("fonts", "C:/Users/Tyler/Documents/UCD/Computer_Animation/Muse/Data/CEGUI/datafiles/fonts/");
rp->setResourceGroupDirectory("layouts", "C:/Users/Tyler/Documents/UCD/Computer_Animation/Muse/Data/CEGUI/datafiles/layouts/");
rp->setResourceGroupDirectory("looknfeels", "C:/Users/Tyler/Documents/UCD/Computer_Animation/Muse/Data/CEGUI/datafiles/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "C:/Users/Tyler/Documents/UCD/Computer_Animation/Muse/Data/CEGUI/datafiles/lua_scripts/");
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
// load in the scheme file, which auto-loads the TaharezLook imageset
CEGUI::SchemeManager::getSingleton().loadScheme( "TaharezLook.scheme" );
// load in a font. The first font loaded automatically becomes the default font.
if(! CEGUI::FontManager::getSingleton().isFontPresent( "Commonwealth-10" ) )
CEGUI::FontManager::getSingleton().createFont( "Commonwealth-10.font" );
CEGUI::System::getSingleton().setDefaultFont( "Commonwealth-10" );
CEGUI::System::getSingleton().setDefaultMouseCursor( "TaharezLook", "MouseArrow" );
CEGUI::System::getSingleton().setDefaultTooltip( "TaharezLook/Tooltip" );
CEGUI::WindowManager& wmgr = WindowManager::getSingleton();
myRoot = wmgr.createWindow( "DefaultWindow", "root" );
System::getSingleton().setGUISheet( myRoot );
fWnd = (FrameWindow*)wmgr.createWindow( "TaharezLook/FrameWindow", "testWindow" );
myRoot->addChildWindow( fWnd );
// position a quarter of the way in from the top-left of parent.
fWnd->setPosition( UVector2( UDim( 0.25f, 0 ), UDim( 0.25f, 0 ) ) );
// set size to be half the size of the parent
fWnd->setSize( UVector2( UDim( 0.5f, 0 ), UDim( 0.5f, 0 ) ) );
fWnd->setText( "Hello World!" );
The above code comes before Horde3D::init()