Re: Problem gettting a smooth continous background scroll (SDL2)

Jonathan Dearborn <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <CA+DSiHY9srsQVd06YXfvZKJH7Fb3HGEHtFXTNeTyLZDZNCnBpg@mail.gmail.com>
I doubt that timers are going to get you any better response.  Timers with
SDL are just threaded callbacks set with SDL_AddTimer().  This starts a
thread which will fire your callback when the timer expires.

Also, vsync is a good thing.  It caps the framerate to 60 fps and makes
sure you hit the vertical refresh of your monitor to avoid
tearing/flickering.  It makes your GPU do less work by not rendering frames
that your monitor wouldn't be capable of displaying anyway.  Pretty much
the only time you need to disable vsync is when you want to measure
performance above 60 fps.

Jonny D


On Fri, Aug 19, 2016 at 2:12 PM, exerion <[email protected]> wrote:

> Which tutorial? Lazy foo's Timers? I still have to read it.
>
> I'm using a basic delta-time for timing.
>
> In these few hours I was guessing why the same code is smooth in the
> example I found (see link provided in previous posts), but not when
> compiled in my computer. So I wanted to check if the compiler can affect in
> some way and so evident.
>
> I installed Eclipse + Mingw + SLD2 -I have to say wasting 90% of time
> dealing with errors, problems detecting the toolchain, etc-. Finally I got
> it working and compiled my continous scroll example (because it's simplier
> and i know it). Performance is pretty similar to VS2013, with minimal
> differences in speed (there are some but for me, 1-2ms per frame is not
> relevant now). Images still are tearing (again I say tearing because I
> think this is the effect).
>
>
> Link with my code and the example i was talking about:
>
> https://mega.nz/#!DgVjVaYJ!OBSd3q4G44ex5EOUCAazjjGGuFl__bw4asMo4TzqVQU
>
> There are some .exe and dlls. All exes for VS2013 are compiled by me, the
> DLLs are from SDL official package. Anyother exe was compiled by third
> parties but I haven't found any wrong with them.
>
> I'll continue with this odissey...
>
> If anyone has some article, book or any other reference about SMOOTH
> scrolls (key here is smooth of course [image: Very Happy] ), I'd
> appreciate this. This has becomed something personal [image: Very Happy]
>
>
> ------------------------------
>
> Signature under construction.
>
> _______________________________________________
> SDL mailing list
> [email protected]
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.