Linearity problem?

hi again
i try to animate a text with linear motion but result is not good enough. first it looked like an easy task,but then it became a disaster.because it is a linear motion, any small problem in the motion is sensible. what should i do to catch a better result (what should i do to better sync of vertical retrace. actually only thing i did is double buffering. i am a bit newbie :slight_smile: ) )

I must say that that post isn’t very clear.

You say you’re using linear motion.

Do you mean you’re moving by a fixed amount per frame or by a fixed amount per second?

Proper motion would come from measuring the time between the start of the last loop and the start of the current loop, then moving by the speed times the elapsed time.

I think you want a nice smooth text scroller, like end credits etc.
Under Linux go for glXSwapInterval(1) or something like that to enable vsync.

yeah i mean that (like end credits…). i hope it helps me. otherwise i will come again :slight_smile:

i found two functions
glXGetVideoSyncSGI and glXWaitVideoSyncSGI
when i use get function it should return the counter value for vertical retrace but it returns 0. and when i use glXWaitVideoSyncSGI function with parameter other then 0 it cause segmentation fault.
when use it with 0,naturally nothing change.
by the way, if you have any idea,other then this please tell. i am stuck!!!

To me you should really use glXSwapInterval, more details and code here :
http://dburns.dhs.org/OSG/Articles/FrameRate/FrameRate.html

EDIT:typo in function name.

yes!!!
glxSwapIntervalSGI seems really helps me i saw the windows version executable. however when i tried to compile it in linux everything goes fine except this function :frowning: ( . i couldn’t get rid of an error:" ‘glXSwapIntervalSGI’ undeclared (first use this function)" whatever i did .
as header i use
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glu.h>
and link
-lglut -lX11
so what is the problem???
what am i miss???

Ensure your drivers are up to date. This function is declared in my glx.h header file (on nv drivers).

glXSwapIntervalSGI is part of the GLX_SGI_swap_control extension, is not widely supported on Linux. You might also want to try GLX_OML_sync_control or GLX_MESA_swap_control . Of the three, the Mesa extension is probably the most widely supported on Linux, but even that is only supported by a few of the open-source drivers.

As always, you must check the extension string, as reported by glXQueryExtensionsString, is available on your implementation.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.