[Solved] CEGUI in wireframe mode after setting glPolygonMode

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

bitxue
Just popping in
Just popping in
Posts: 9
Joined: Wed Jul 06, 2016 23:39

[Solved] CEGUI in wireframe mode after setting glPolygonMode

Postby bitxue » Wed Jul 06, 2016 23:54

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?
Last edited by bitxue on Thu Jul 07, 2016 06:40, edited 1 time in total.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: CEGUI in wireframe mode after setting glPolygonMode

Postby YaronCT » Thu Jul 07, 2016 00:06

@bitxue: Simply change it back b4 calling "CEGUI::System::renderAllGUIContexts()".

bitxue
Just popping in
Just popping in
Posts: 9
Joined: Wed Jul 06, 2016 23:39

Re: CEGUI in wireframe mode after setting glPolygonMode

Postby bitxue » Thu Jul 07, 2016 04:33

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;
}

bitxue
Just popping in
Just popping in
Posts: 9
Joined: Wed Jul 06, 2016 23:39

Re: CEGUI in wireframe mode after setting glPolygonMode

Postby bitxue » Thu Jul 07, 2016 06:36

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();
    ...
}

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: [Solved] CEGUI in wireframe mode after setting glPolygonMode

Postby YaronCT » Thu Jul 07, 2016 08:40

@bitxue: Yes, that's what I meant..

bitxue
Just popping in
Just popping in
Posts: 9
Joined: Wed Jul 06, 2016 23:39

Re: [Solved] CEGUI in wireframe mode after setting glPolygonMode

Postby bitxue » Thu Jul 07, 2016 08:46

YaronCT wrote:@bitxue: Yes, that's what I meant..


@YaronCT: Thanks! :D

Any idea on another post I opened?
viewtopic.php?f=10&t=7201&p=34914#p34914

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: [Solved] CEGUI in wireframe mode after setting glPolygonMode

Postby YaronCT » Thu Jul 07, 2016 08:50

@bitxue: I see all threads, no need to refer me.

bitxue
Just popping in
Just popping in
Posts: 9
Joined: Wed Jul 06, 2016 23:39

Re: [Solved] CEGUI in wireframe mode after setting glPolygonMode

Postby bitxue » Thu Jul 07, 2016 08:52

YaronCT wrote:@bitxue: I see all threads, no need to refer me.


OK :)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests