Hello, I’m having some problems turning on vsync on fedora 7. I wrote
the following test program:
#include <SDL/SDL.h>
#include
#include
int main()
{
assert(SDL_Init(SDL_INIT_VIDEO) == 0);
int retval = SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
if (retval == 0)
{
std::cout << "Successfully requested swap control to be turned
on." << std::endl;
}
else if (retval == -1)
{
std::cout << “SDL_GL_SetAttribute() failed.” << std::endl;
std::cout << "SDL_GetError() returns: " << SDL_GetError() <<
std::endl;
}
else
{
std::cout << “Unknown return value " << retval << " from
SDL_GL_SetAttribute().” << std::endl;
}
assert(SDL_SetVideoMode(640, 480, 0, SDL_OPENGL) != NULL);
int check = 0;
retval = SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &check);
if (retval == 0)
{
std::cout << "Status of SDL_GL_SWAP_CONTROL after calling
SDL_SetVideoMode(): " << check << std::endl;
}
else if (retval == -1)
{
std::cout << “SDL_GL_GetAttribute() failed.” << std::endl;
std::cout << "SDL_GetError() returns: " << SDL_GetError() <<
std::endl;
}
else
{
std::cout << “Unknown return value " << retval << " from
SDL_GL_GetAttribute().” << std::endl;
}
SDL_Quit();
}
Under windows, the output is:
Successfully requested swap control to be turned on.
Status of SDL_GL_SWAP_CONTROL after calling SDL_SetVideoMode(): 1
Very good. Under fedora 7, however, the output is:
Successfully requested swap control to be turned on.
SDL_GL_GetAttribute() failed.
SDL_GetError() returns: Failed loading DPMSDisable:
/usr/lib/libX11.so.6: undefined symbol: DPMSDisable
It was not actually not until I wrote this test program that I noticed
that the call to SDL_GL_GetAttribute() fails under fedora 7. I did
notice that my sdl/opengl project was not vsynced under fedora and
that’s what prompted me to write the test program.
I thought that moving from Cygwin to fedora 7 would make things easier,
not harder, hehe. I really need to solve this one if I’m to continue
using fedora 7 for this developement project comfortably. Let me know of
any more information you need for you to help me. I’m a newbie with SDL
and especially a linux newbie.
I’m not sure if this belongs in a fedora forum or in a SDL forum, but I
thought I might try here first. I suspect several gurus are using linux
here and I don’t have the skillset to determine where the solution might
lie.
I have the same problem on both my laptop and my stationary computer,
the output from the test program is from the laptop. Going to run it now
on my main computer. Both have nvidia graphics cards with latest livna
drivers.
- Eric