Page 1 of 1
[Solved] CEGUI in wireframe mode after setting glPolygonMode
Posted: Wed Jul 06, 2016 23:54
by bitxue
I need to display a model in wireframe mode by calling
Code: Select all
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
However, after this call, the entire CEGUI interface also turn into wireframe mode.
Is there anyway to prevent CEGUI interface from being affected by this call?
Re: CEGUI in wireframe mode after setting glPolygonMode
Posted: Thu Jul 07, 2016 00:06
by YaronCT
@bitxue: Simply change it back b4 calling "CEGUI::System::renderAllGUIContexts()".
Re: CEGUI in wireframe mode after setting glPolygonMode
Posted: Thu Jul 07, 2016 04:33
by bitxue
YaronCT wrote:@bitxue: Simply change it back b4 calling "CEGUI::System::renderAllGUIContexts()".
Thanks! But it still cannot work.
Code: Select all
bool onWireFrame(const CEGUI::EventArgs& e)
{
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
CEGUI::System::getSingleton().renderAllGUIContexts();
return true;
}
Re: CEGUI in wireframe mode after setting glPolygonMode
Posted: Thu Jul 07, 2016 06:36
by bitxue
Got a workaround by calling glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) before CEGUI rendering.
Code: Select all
drawFrame()
{
...
if (wireFrameMode)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
RenderScene();
...
if (wireFrameMode)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
CEGUI::System::getSingleton().renderAllGUIContexts();
...
}
Re: [Solved] CEGUI in wireframe mode after setting glPolygonMode
Posted: Thu Jul 07, 2016 08:40
by YaronCT
@bitxue: Yes, that's what I meant..
Re: [Solved] CEGUI in wireframe mode after setting glPolygonMode
Posted: Thu Jul 07, 2016 08:46
by bitxue
YaronCT wrote:@bitxue: Yes, that's what I meant..
@YaronCT: Thanks!
Any idea on another post I opened?
viewtopic.php?f=10&t=7201&p=34914#p34914
Re: [Solved] CEGUI in wireframe mode after setting glPolygonMode
Posted: Thu Jul 07, 2016 08:50
by YaronCT
@bitxue: I see all threads, no need to refer me.
Re: [Solved] CEGUI in wireframe mode after setting glPolygonMode
Posted: Thu Jul 07, 2016 08:52
by bitxue
YaronCT wrote:@bitxue: I see all threads, no need to refer me.
OK
