I use C++ and SDL to make a 2D Sidescroller Game.
But I have problems with the "Tearing", it looks fucking ugly when move sprites.
I already activated "SDL_DOUBLEBUF" and "SDL_FULLSCREEN".
I also switched "Doublebuffering" on, at my graphics card configs.
I even tried "SDL_SWSURFACE"(software renderer) instead of "SDL_HWSURFACE"(hardware renderer).
And of cource I use SDL_Flip instead of SDL_Update.
What am I doing wrong?
Name:
Anonymous2007-09-06 10:56 ID:imfj5abl
how about fixing the vsync
Name:
Anonymous2007-09-06 10:57 ID:imfj5abl
Apologies SDL_Flip should wait for vsync.
Name:
Anonymous2007-09-06 10:58 ID:hcGcMf+v
>2
Shouldn't the tearing go away when I do a small pause in the main loop?
Name:
Anonymous2007-09-06 11:00 ID:hcGcMf+v
I tried that but still the tearing :(
Name:
Anonymous2007-09-06 11:03 ID:hcGcMf+v
Hmm, or I should start using OpenGL for the rendering.
Name:
Anonymous2007-09-06 11:05 ID:czuzdG0e
Please post some sample code that illustrates the problem. Make sure it is the minimum amount of code required for us to look into it for you. That will help.
// finally, update the screen :)
SDL_Flip(screen);
} // end main loop
...
Name:
Anonymous2007-09-06 11:41 ID:hcGcMf+v
>9
So, how do I manage then, that the renderer is waiting until the graphics are drawn to the surface?
Doublebuffering seems not to work for me.
How can I realize a Vsync rendering, without Doublebuffering? Does that work?
Name:
Anonymous2007-09-06 11:42 ID:czuzdG0e
How does it compare when you initialise video mode with SDL_HWSURFACE? Double buffering doesn't work on software surfaces.
You should also check the SDL_Surface.flags after initialising to see if it actually took notice of your double buffering flag.
Name:
Anonymous2007-09-06 11:45 ID:hcGcMf+v
>12
Tried SDL_SWSURFACE. Didn't remove the tearing.
Just a shot in the dark, but is there a way to enable v-synching? with sdl?
Name:
Anonymous2007-09-06 13:21 ID:hcGcMf+v
>18
SDL_DOUBLEBUF should do that.
Name:
Anonymous2007-09-06 13:26 ID:hcGcMf+v
hw_available IS 0
Is it possible to create hardware surfaces?
wm_available IS 1
Is there a window manager available
blit_hw IS 0
Are hardware to hardware blits accelerated?
blit_hw_CC IS 0
Are hardware to hardware colorkey blits accelerated?
blit_hw_A IS 0
Are hardware to hardware alpha blits accelerated?
blit_sw IS 0
Are software to hardware blits accelerated?
blit_sw_CC IS 0
Are software to hardware colorkey blits accelerated?
blit_sw_A IS 0
Are software to hardware alpha blits accelerated?
blit_fill IS 0
Are color fills accelerated?
video_mem IS 0
Total amount of video memory in Kilobytes
vfmt (would take too long)
Pixel format of the video device
Name:
Anonymous2007-09-06 13:29 ID:hcGcMf+v
>>20
So why doesn't the hardware support work?
I got directX and DirectX compatible games work just fine.
>>When I reinstall my system I just download the newest nvidia driver.
I'm downloading 94.24_forceware_winxp_international_whql.exe.
Maybe it works with this.
Name:
Anonymous2007-09-07 12:04 ID:i0hnqPHc
Damn, what is this??
It says, the drivers are not compatible with any hardware I got.
Name:
Anonymous2007-09-07 12:11 ID:i0hnqPHc
I checked and right now I'm using the 93.71 driver of nvidia.
But can't install the new forceware crap version.
Maybe I should look out for some older drivers.
Name:
Anonymous2007-09-07 14:37 ID:i0hnqPHc
YAY!! I finally found something that works. (After hours of google)
Before I SDL_Init() the video mode, I have to wright SDL_putenv("SDL_VIDEODRIVER=directx");
Looks like it forces SDL to use DirectX, and so my Hardwaremode is finally enabled, and no shitty tearing anymore.
But still, would be good to know what that so is.
Does someone have an idea?