Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] How to synchtonize swap buffers with vertical retrace in lablgk/lablgtk, or labgl/labltk,
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Peter Ronnquist <pronnquist@y...>
Subject: Re: [Caml-list] How to synchtonize swap buffers with vertical retrace in lablgk/lablgtk, or labgl/labltk,

--- Sven LUTHER <luther@dpt-info.u-strasbg.fr> wrote:
> On Fri, May 04, 2001 at 02:30:28AM -0700, Peter
> Ronnquist wrote:
> > 
> > --- Sven LUTHER <luther@dpt-info.u-strasbg.fr>
> wrote:
> > > On Thu, May 03, 2001 at 11:11:50AM -0700, Chris
> > > Hecker wrote:
> > > > 
> > > > >I am looking for a way to synchronize
> swapbuffers
> > > with
> > > > >the vertical retrace using lablg and lablgtk
> or
> > > labltk
> > > > >for creating the window to draw the opengl
> > > graphics
> > > > >in.
> > > > >Does anyone know if this is possible?
> > > > 
> > > > You usually have to do this through an
> extension. 
> > > It's a windowing system issue (or at least,
> that's
> > > how OpenGL thinks of it).  So, on windows
> there's a
> > > SwapInterval extension, and I'm not sure about
> X,
> > > but it's probably the same.
> > > > 
> > > > You'll need to write a thunk to the extension
> in C
> > > to use it, because lablgl does not support
> > > extensions yet.  I hope to fix this at some
> point
> > > soon. 
> > > 
> > > Does X not do this by himself, at least if you
> use
> > > hardware accelerated mesa
> > > drivers (the dri version of them). Not sure
> though.
> > 
> > 
> > I have looked into the examples that are provided
> with
> > lablgl and lablgtk and comparared it with the C
> > version of gears.c. You can notice a small
> disruption
> > in the animation gears.ml and planet.ml (when the
> > planet is closer and is displayed big on the
> screen).
> > This is due to that the swap buffer is done when
> the
> > monitors ray gun is in the middle of the graphics.
> > 
> > There are also some small and good tutorial
> examples
> > that uses C and glx that does not have this
> problem.
> > Here there is no disruption of the animation at
> all.
> > I can provide you with the link to this webpage
> when I
> > get access to the link.
> > 
> > It seems that it is up to the library that you use
> for
> > handling the window for opengl. Appearantly gtk
> and tk
> > does not do this syncronization.
> > glut, glx do this and I am almost sure that sdl do
> > that as well. 
> 
> mmm, ...
> 
> lablgl + lablgtk uses the gtkglarea library, if i am
> not wrong. Did you try
> the gtkglarea examples for the same thing ? 
> 
> Also what openGL lib are you using, what X server,
> what OS, what graphic card
> ? All of this may have an impact on the openGL
> display. Also are you using
> software rendreing or hardware ? try glxinfo to be
> sure.
> 
> Do you have an idea of what the C example you speak
> about do that is not done
> by lablgl ? 
> 
> Or maybe it is just the garbage collector quicking
> in, and thus slowing the
> display ?
> 

I tried the examples under the directory GL in the
lablgtk debian package, I think they use gtkglarea.

I am using
mesa/dri/Xfree4/linux/g400/hardwarerendering.

Open gl synchs with the vertical retrace in those C
tutorial examples 

http://nehe.gamedev.net/opengl.asp
(I tried the Texture mapping example)

The difference is that the C examples uses glx for the
window handling, 
I hope that the garbage collection does not affect the
synchronization.
I plan to try the ocamlsdl and see if it works with
that.
Otherwise I think Chris is right regarding this
extension for X, I don't remeber the exact name of it
but it exists a syncronization extension. I am looking
forward for new versions of lablgl that support this.

Another way to go would be to try ocamlsdl with
lablgl.

BR
Peter Rönnquist






__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr