Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_Flip doesn't wait vsync under X11 #286

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

SDL_Flip doesn't wait vsync under X11 #286

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Labels
wontfix This will not be worked on

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.11
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2007-03-03 22:00:46 +0000, Antony wrote:

http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fFlip says

If your display mode is using the flags pygame.HWSURFACE and pygame.DOUBLEBUF, this will wait for a vertical retrace and swap the surfaces. If you are using a different type of display mode, it will simply update the entire contents of the surface.

It doesn't work with SDL under X11, wich mean that every SDL applications runs with tearing artefacts under X11. IMHO it is a critical bug. I know it's due to X11, but a solution must be found NOW ! It's amazing to imagine that simple graphical applications that could be done on a C64 cannot be done under Linux/X11 in 2007 :).

With pygame installed, you can easily test it (if you like to take risks) by typing on a terminal:

python -c "curl http://lesuisse.net/vsynctest.py "

or run the following python code

#!/usr/bin/python
import math,sys,time,pygame
pygame.init()
screen = pygame.display.set_mode((640,480),pygame.FULLSCREEN|pygame.DOUBLEBUF|pygame.HWSURFACE)
c=0
while 1:
c=((c+1)%2)*255
for event in pygame.event.get():
if event.type in [2,5,6,12]:
sys.exit()
screen.fill((c,c,c))
pygame.display.flip()

On 2007-03-03 22:02:23 +0000, Antony wrote:

Created attachment 196
Test SDL_Flip() vsync, by filling black then white

On 2007-07-03 03:24:29 +0000, Ryan C. Gordon wrote:

This can't be fixed at this time, as there's no way to sync to vblank in 2D X11 (OpenGL has a few methods, though, so SDL 1.3's OpenGL backend for 2D rendering should make this possible).

Using 2D rendering without OpenGL, we would need someone to develop an X11 extension.

--ryan.

On 2009-05-29 20:37:08 +0000, Rene Dudfield wrote:

Many other 2d programs work with vsync in a window on X11 without opengl.

So there must be some way to do it.

This is a very common bug report we get at pygame.

Reopening this bug so we can research a fix/workaround.

On 2009-05-29 21:15:09 +0000, Rene Dudfield wrote:

The XVideo extension appears to let you flip a buffer on vertical sync(vsync).

So perhaps the SDL overlay code can be used for this. Since it already uses Xvideo.

The idea would be to create a buffer, and then feed the buffer to the overlay instead of flipping/updating.

Trying this out using pygame to test the performance.

On 2009-05-30 00:44:05 +0000, Rene Dudfield wrote:

Another option for python SDL users is to use the Lamina module which lets you draw using pygame in software, and then it updates opengl in the background.
However that's not all that fast for some types of games - but it will allow you to vsync - assuming your X11 supports opengl.

http://pypi.python.org/pypi/Lamina

On 2009-09-13 16:33:31 +0000, Ryan C. Gordon wrote:

Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.

On 2009-09-14 10:44:49 +0000, Patrice Mandin wrote:

*** Bug 583 has been marked as a duplicate of this bug. ***

On 2009-09-20 22:46:38 +0000, Sam Lantinga wrote:

It's not likely that we'll do anything with this for SDL 1.2, but I've put it on the list for SDL 1.3 since it uses OpenGL when available.

@SDLBugzilla SDLBugzilla added bug wontfix This will not be worked on labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant