glarea in Windows?



I'm trying to write a cross platform open gl app with a gui, and I thought I would use gtk with glarea.  This may have been a mistake.  My code, which runs fine in linux, and compile with 3 warnings (about strings which I don't believe are relevant) produces the following error on execution:
 
"The exception unkown software exception (0xc000000fd) occured in the application at location 0x00435bf7"
 
yes, I know that's terribly informative.  If I comment out the glarea stuff, if runs okay, so it looks like it's glarea specific.  I looked at the glarea site and readme, and there is a bit of info saying
>>Inner workings of win32 gtkglarea is quite different form glx version, therefore

you should only use GtkGLArea widget (gtk_gl_*) functions, no gdk_gl_* functions.

>>

but the attribute list has a some GDK enum types, do these have an effect?  there doesn't seem to be a way to get rid of them.

 

Also, I have a call in the "expose" callback:

gint sources_draw (GtkWidget* widget, GdkEventExpose* event) {
  // Draw only on the last expose event.
  if (event->count > 0) {
    return(TRUE);
  }
  g_print ("Expose Event\n");
  // gtk_gl_area_make_current MUST be called before rendering
  // into the GtkGLArea.                                     
  if (gtk_gl_area_make_current(GTK_GL_AREA(widget))) {
     glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();
    //  gluPerspective(60.0,1.0,-50, 600);
    //  glDepthFunc(GL_ALWAYS);
    fscene.draw_faces();
    glMatrixMode(GL_PROJECTION);
    glMatrixMode(GL_MODELVIEW);
    glFlush();
    }
  return (TRUE);

I don't know what this GdkEvenExpose* event is, but could this be the trouble?  note that the message "expose Event" never shows.

If anyone has any expoerience with this I'd be very grateful.

 

glen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]