[SDL] New Hardware Acceleration/Double buffering

Alan Wolfe atrix2 at cox.net
Thu Oct 14 01:38:49 PDT 2004


im not sure on your setup, im on windows and it's on by default w/ sdl

----- Original Message ----- 
From: "Paul Lowe" <pauls_lists at tetravista.net>
To: "A list for developers using the SDL library. (includes SDL-announce)"
<sdl at libsdl.org>
Sent: Thursday, October 14, 2004 12:43 AM
Subject: Re: [SDL] New Hardware Acceleration/Double buffering


> Just out of curiosity,
>
> How does one turn on vsync?
>
> Paul Lowe
> pauls_lists at tetravista.net
>
> On Wednesday 13 October 2004 04:06 pm, Alan Wolfe wrote:
> > you can turn on vsync, that limits the framerate to the
> > verticle refresh rate of your monitor, which in turn
> > makes the images look alot nicer because it gets rid of
> > tearing.
> >
> > there are other ways too im sure someone else will speak
> > up about (:
> >
> > ----- Original Message -----
> > From: "Walter Crowley" <waltc at fleetwoodgaming.com>
> > To: "A list for developers using the SDL library.
> > (includes SDL-announce)" <sdl at libsdl.org>
> > Sent: Wednesday, October 13, 2004 3:52 PM
> > Subject: Re: [SDL] New Hardware Acceleration/Double
> > buffering
> >
> > > Thank You.  That was the clue I needed.  I looked again
> > > at the doc and realized that you cannot Blit to a
> > > locked surface.  I changed that up and it worked.  Now
> > > I am getting fast speeds (125-1000fps), and this is way
> > > too fast for the monitor.  Do you or anyone else know
> > > an efficient way to lock the rate in at a specific
> > > speed, say 50fps?
> > >
> > > Thanks again,
> > > Walt
> > >
> > > On Wed, 2004-10-13 at 16:04, Jonathan Atkins wrote:
> > > > you only need to lock a surface when you are
> > > > accessing the
> >
> > surface->pixels
> >
> > > > array directly.  Don't lock it otherwise or you may
> > > > cause a performance
> >
> > hit.
> >
> > > > Also, if you are locking it to do some pixel access,
> > > > try to lock it only
> >
> > once
> >
> > > > and do all the work before unlocking and flipping the
> > > > buffer.
> > > >
> > > > -LIM-
> > > >
> > > > Walter Crowley wrote:
> > > > > I am new to the idea of using Hardware Buffers.  I
> > > > > am using Linux
> >
> > (FC2)
> >
> > > > > with a Transmeta 1gig cpu.  The Video is ATI Radeon
> > > > > 9001 Mobile with
> >
> > 64m
> >
> > > > > of memory.
> > > > >
> > > > > I have a simple program that displays some png
> > > > > graphics and moves them around.  It works fine
> > > > > withe Video Mode settings set to SDL_SWSURFACE and
> > > > > SDL_FULLSCREEN.  Using the DGA driver I can get a
> > > > > frame rate of about 54 frames per second.  I got
> > > > > this by doing
> > > > >
> > > > > fps=frames*1000/(end_time-start_time) where frames
> > > > > is a counter that increments while the animation is
> > > > > going.
> > > > >
> > > > > The Radeon driver seems to have a lot of overhead
> > > > > and slows things down.
> > > > >
> > > > > I wanted to push the speed more so I tried to use
> > > > > the setting SDL_HWSURFACE with SDL_DOUBLEBUF and
> > > > > SDL_FULLSCREEN.  I believe that
> >
> > you
> >
> > > > > have to lock the surface every time you want to use
> > > > > it so nothing else 'steals' it from the program.  I
> > > > > did this and unlocked it.  SDL initialized and the
> > > > > information I got back said that HW was there
> >
> > (using
> >
> > > > > SDL_GetVideo).  The only thing is that nothing is
> > > > > displayed on the screen.
> > > > >
> > > > > I am not sure what I need to do different when
> > > > > dealing with SW and HW surfaces.
> > > > >
> > > > > If anyone has a simple example, or direct me to a
> > > > > solution that would
> >
> > be
> >
> > > > > great.
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Walt
> > > > >
> > > > > _______________________________________________
> > > > > SDL mailing list
> > > > > SDL at libsdl.org
> > > > > http://www.libsdl.org/mailman/listinfo/sdl
> > > >
> > > > _______________________________________________
> > > > SDL mailing list
> > > > SDL at libsdl.org
> > > > http://www.libsdl.org/mailman/listinfo/sdl
> > >
> > > _______________________________________________
> > > SDL mailing list
> > > SDL at libsdl.org
> > > http://www.libsdl.org/mailman/listinfo/sdl
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at libsdl.org
> > http://www.libsdl.org/mailman/listinfo/sdl
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl





More information about the SDL mailing list