We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2267 - Same game works differently on different Macbooks
Summary: Same game works differently on different Macbooks
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.1
Hardware: x86_64 Mac OS X (All)
: P2 blocker
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-24 02:27 UTC by Ma Xiaojun
Modified: 2015-02-18 20:46 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ma Xiaojun 2013-11-24 02:27:02 UTC
I developed a simple snake game on my MacBook Pro (13-inch, Early 2011) with OS X Maverick:
https://github.com/maxiaojun/Snake-SDL
It works fine.

My friend downloaded and built my code, the game flickers badly. His machine is newer MacBook Air (exact model not known yet but I can ask) also with OS X Maverick.

In fact, if I move line 89-91 to the position between line 85 and 86, I can observe exact the same bad flickering on my machine.
https://github.com/maxiaojun/Snake-SDL/blob/master/Snake-SDL/main.c#L89
Comment 1 Sam Lantinga 2013-11-28 11:44:05 UTC
I tried this with a Mac Pro with OS X Maverick and it works fine here, even moving the lines the way you described.

How are you building SDL and SDL_mixer, or are you using the frameworks from the website?
Comment 2 Ma Xiaojun 2013-11-28 17:03:36 UTC
I'm using the frameworks from the website.
Comment 3 Ma Xiaojun 2013-11-28 17:44:28 UTC
Here is a video demonstrates the bug:
https://dl.dropboxusercontent.com/u/45139465/SDL-bug-2267.MOV

(The version shown is slightly different but it is still the same game essentially.)
Comment 4 raincomplex 2014-03-07 06:42:14 UTC
You aren't calling SDL_RenderClear() before drawing each frame, so you're seeing the double buffer. I'm pretty sure SDL doesn't make any guarantee about the contents of the video surface for fresh frames.

I've experienced this on Android if I forget to clear before redrawing---the borders are corrupted with parts of the last frame drawn (and I don't see it happen on my Linux box for whatever reason).
Comment 5 Ryan C. Gordon 2015-02-18 20:46:21 UTC
(In reply to raincomplex from comment #4)
> You aren't calling SDL_RenderClear() before drawing each frame, so you're
> seeing the double buffer. I'm pretty sure SDL doesn't make any guarantee
> about the contents of the video surface for fresh frames.

Closing this as an app bug.

--ryan.