Jump to content
  • Advertisement
Sign in to follow this  
Aiea

OpenGL openGL and wxWidgets

This topic is 3637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, I'm having trouble using OpenGL on widgets. I have tried creating a canvas over a static box as well as a panel attempting to draw on it. When I do it over the static box I can see the canvas was indeed created since I could cover up the caption with it, but no matter what I do, I can't clear it or draw on it.
RenderTubes::RenderTubes(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
        :wxGLCanvas(parent,id,pos,size)
{
  SetUpGL();
}

RenderTubes::~RenderTubes() {
}

void RenderTubes::SetUpGL()
{
    wxSize temp = this->GetSize();
    glViewport(0,0,temp.GetWidth(),temp.GetHeight());
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

//
//    glMatrixMode(GL_MODELVIEW);
//    glLoadIdentity();
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
    glFinish();

}

This is only a snippet, I can post more upon request. Mahalo, Aiea

Share this post


Link to post
Share on other sites
Advertisement
Hi,

sounds like you are not calling the
wxGLCanvas::SwapBuffers

try that,
Peter Wraae Marino

www.osghelp.com

Share this post


Link to post
Share on other sites
Crisium,

That was exactly it, thank you so much now I can finally move on to bigger and better things =)

Mahalo,
Aiea

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!