wxglCanvas display problem



  • 1. framebuffer and VideoPlayer question
    Hi all I want to integrate/port a videoplayer which is based on SDL into a wxWidgets-application. For most SDL specific stuff like threads and windows there is something equivalent in wxWidgets or there are good additional libraries (PortAudio), but for VideoMemory Access, I haven't found anything like that. (SDL is just a wrapper for DirectX or the Linux-Equivalent). I was thinking about creating a framebuffer based on wxDc, Blit and forced UI refresh triggered by timer events to control the framerate. Does anybody know whether there exists a better way of doing this kind of stuff in wxWidgets ? Or is it posssible (and does it make sense) to integrate SDL into wxWidgets (like it can be done with OpenGL) ? regards Roberto --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM
  • 2. Build warning in compiling samples.
    I am using Mandrake 10 Linux and gcc 3.3.2. In compiling any wxWidgets 2.5.2 sample, I get the following linker warning: /usr/bin/ld: warning: libstdc++.so.5, needed by ../../lib/libwx_based-2.5.so, may conflict with libstdc++.so.6 Is this warning serious? How do I fix it? --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM
  • 3. configure script problem in CVS trunk.
    I've just updated my wxWidgets CVS code set, in attempting to run configure, I get this: ./configure: line 11783: syntax error near unexpected token `<<<' ./configure: line 11783: `<<<<<<< configure' ./configWithParms: line 6: --enable-debug_flag: command not found ./configWithParms: line 11: --enable-logwin: command not found Looks like some rcsdiff drible or something similiar. --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM
  • 4. wxFileType::GetIcon() -> wxIconLocation / wxPython
    Hi, I found out that wxFileType::GetIcon(...) changed in wxWidgets 2.5.1: "bool GetIcon(wxIconLocation * iconLoc) Windows: The function returns the icon shown by Explorer for the files of the specified type." I assume "the icon shown by Explorer" has the dimensions 16 x 16? In wxWidgets 2.4.x the function allowed you to retrieve a wxIcon with the dimensions 32 x 32. In wxPython 2.5.x, however, the function seems to be the old function from wxWidgets 2.4.x, it still returns a wx.Icon instance (with the undesirable size of 32 x 32). Could someone please confirm that the new function returns/retrieves (under Windows) an icon of the size 16 x 16 and that there is no equivalent function in wxPython 2.5.x that does the same? Thank you, -Lars --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM

wxglCanvas display problem

Postby emedlin » Thu, 14 Aug 2003 06:50:39 GMT

My program will allow the user to load a tiff and display it as a
texture on a polygon that fills the entire glCanvas.  However the
glCanvas does not redraw correctly.  The only parts that are redrawn
are where the open dialog box was.  If I slide a another window across
it, it refreshes the pixels correctly where the window I am slide
across was.  It will redraw everything if I resize it.  How can I make
it redraw everthing after the tiff is loaded?  The whole interface
flashes when resized also.  Even before the tiff is loaded and just
one colored quad is drawn.  What could be causing this?  Here is what
my events look like.

void TiffGLCanvas::onPaint(wxPaintEvent& event){
    /* must always be here */
    wxPaintDC dc(this);

#ifndef __WXMOTIF__
    if (!GetContext()) return;

    /* clear */

    /* draw object */

    glBindTexture(GL_TEXTURE_2D, tiffs.tiff[0].texName);

    glColor3f(0.0, 0.0, 0.5);
    glTexCoord2f(0.0, 1.0); glVertex3f(0.0, 100.0 , 0.0);
    glTexCoord2f(0.0, 0.0); glVertex3f(0.0, 0.0, 0.0);
    glTexCoord2f(1.0, 0.0); glVertex3f(100.0, 0.0, 0.0);
    glTexCoord2f(1.0, 1.0); glVertex3f(100.0, 100.0, 0.0);
    /* flush */

    /* swap */

void TiffGLCanvas::onSize(wxSizeEvent& event){
    // this is also necessary to update the context on some platforms
    // set GL viewport (not called by wxGLCanvas::OnSize on all
    int w, h;
    GetClientSize(&w, &h);
#ifndef __WXMOTIF__
    if (GetContext())
        glViewport(0, 0, (GLint) w, (GLint) h);
        gluOrtho2D(0, 100, 0, 100);        

void TiffGLCanvas::onEraseBackground(wxEraseEvent& event){
    /* Do nothing, to avoid flashing on MSW */

void TiffGLCanvas::initGL(){
    glClearColor( 0.0, 0.0, 0.0, 0.0 );

    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);


Similar Threads:

1.Getting wxGLCanvas to display Bold Times New Roman fonts

Hi all,

 I need to display Times New Roman fonts in bold for my project and I need 
to way to do this using wxGLCanvas. I know about the Opengl tutorial in Nehe 
but it doesn't seem to fit into wxGLCanvas. Any hints?

Thuan Seah 

2.wxGLCanvas and display lists

3.wxGLCanvas and related problems

Newbie to wxWindows,
I'm using wxWindows-2.4.2 on linux as well as windows,
I'm using wxGLCanvas, and i'm drawing some thing on the GLCanvas.
Now i wanted to export that drawing on GLCanvas to some image (say png

So i did this 
wxInitAllImageHandlers() ;
wxSize sz (GetClientSize()) ;
wxImage grab( sz.x, sz.y );
glReadPixels(0, 0, sz.x, sz.y, GL_RGB, GL_UNSIGNED_BYTE,
grab.GetData() );
grab.SaveFile( "file.png", wxBITMAP_TYPE_BMP);
whats happening was 
01.) GetClientSize returns the size of the entire application window,
instead of GLCanvas alone. (Not to mention i'm having so many buttons
and check boxes in the application window apart from the GLCanvas

02.) The image i'm getting was the flipped one of the one on the
drawing canvas.

03.) I'm trying to get the GLCanvas size alone, so trying to get its
ContainingSizer using GetContainingSizer(). (I've added the GLCanvas
widget to a wxSizer object).
the return value i'm getting from GetContainingSizer() was NULL,
saying that there's no container.

How can i get rid of the above 3 problems.

Thanks in advance,

4.wxGLCanvas Thread update refresh problem


some time ago I asked here how to refresh a wxGLCanvas from a Thread and
someone answered Refresh(). It seemes to work and then I hadn't time to
test it. Now I started to work again on this application. And I've some
problems. If I do a Refresh() in the wgGLCanvas triggered by a Thread
with 25fps the text in the wxMenu of my application isn't displayed, but
I could use it. And the xwGLCanvas is only redisplayed if I move around
with the mouse on it or click into the wxGLCanvas. But I've not
registered any Callbacks in xwGLCanvas.

What is the problem?

wgGTK 2.4.2


5.Problem linking wxGLCanvas

Hi everyone.

I'm running Debian Linux, I'm using Kdevelop3 and I want to use wxGLCanvas in my
wxWidgets programs. I installed all the package (.deb for debian) related to
wxWidgets. When I compile a programs without wxGLCanvas, everything is fine.
But when I add a wxGLCanvas, I get this linking error :

undefined reference to `wxGLCanvas::wxGLCanvas[in-charge](wxWindow*, int,
wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)'

Can someone help me?
Jean-Franis Lefebvre
ole Polytechnique de Montrl
udiant la marise gie ergique

To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 

6. Screen capture problem with wxGLCanvas under Vista

7. wxGLCanvas and wxFrame size problem?

8. wxGLCanvas problem

Return to wxWindows


Who is online

Users browsing this forum: No registered users and 96 guest