openGL and wxWidgets

Started by
3 comments, last by Aiea 15 years, 9 months ago
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
Mahalo,AieaLove them semicolons and equal signs...
Advertisement
Are you setup for double buffering?
It's the same result even if I only use the color buffer.
Mahalo,AieaLove them semicolons and equal signs...
Hi,

sounds like you are not calling the
wxGLCanvas::SwapBuffers

try that,
Peter Wraae Marino

www.osghelp.com

http://osghelp.com - great place to get OpenScenGraph help
Crisium,

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

Mahalo,
Aiea
Mahalo,AieaLove them semicolons and equal signs...

This topic is closed to new replies.

Advertisement