Re: [GtkGLExt] Force Rendering



On 04.4.2 2:15 PM, "Matthew A Tobiasz" <matobias ucalgary ca> wrote:

> Hello,
> 
> I have a bunch of GtkDrawingArea's where I'm doing my openGL rendering, and I
> want to have things such that when a GtkButton is pressed  a specific window
> is render. What I'm doing is having this "zoom button" modify the projection
> matrix used for rendering the scene.
> 
> Here's what I've got:
> 
> void zoom_button_callback(GtkWidget *widget, gpointer ptr){
> da = GTK_WIDGET(ptr); // ptr points to a opengl capable drawing area
> 
> ... modify the projection matrix ...
> 
> gdk_window_invalidate_rect (da->window, &da->allocation, FALSE);
> gdk_window_process_updates (da->window, FALSE);
> }
> 
> Now this works for the first drawing area, but the not the other ones.

I think what you have to do is:

  gdk_window_invalidate_rect (da1->window, &da1->allocation, FALSE);
  gdk_window_invalidate_rect (da2->window, &da2->allocation, FALSE);
  gdk_window_invalidate_rect (da3->window, &da3->allocation, FALSE);
  ...

  gdk_window_process_all_updates ();
  (force expose events to be delivered immediately and synchronously)

Or

  gtk_widget_queue_draw (GTK_WIDGET (da1));
  gtk_widget_queue_draw (GTK_WIDGET (da2));
  gtk_widget_queue_draw (GTK_WIDGET (da3));
  ...
  (da's will receive expose events if main loop becomes idle)


Regards,
--Naofumi

Any 
> ideas.....
> 
> -Matthew
> 
> _______________________________________________
> gtkglext-list mailing list
> gtkglext-list gnome org
> http://lists.gnome.org/mailman/listinfo/gtkglext-list
> 




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