[SDL] Anyway around SDL_UpdateRect?
jeg at visi.net
Thu Aug 26 16:59:41 PDT 1999
> The best you'll be able to do is passing SDL_HWSURFACE to SDL_SetVideoMode().
> On systems that support it (DirectX, X11/DGA) you'll get direct access to
> video memory. This is not a limitation of SDL, as much as a limitation of
> the underlying driver capabilities.
Yeah I have added that in as well but still seem to be locked at 27fps.
Maybe it is just a hardware problem, maybe I see if a new Mach64 Xserver
is out as well I am using 220.127.116.11-1.1 Maybe there have been some
improvements? I don't know why an ATI Rage Pro wouldn't support hardware
> If you need to convert from a pixel format you expect, you need to
> draw to an internal buffer and convert that to the video format.
> There's no way around that. SDL provides this transparently, but
> if you pass SDL_ANYFORMAT in the flags to SDL_SetVideoMode(), SDL
> will not perform any conversions, it will give you the closest
> depth supported by the underlying driver.
SDL provide much more transparently too, I could use hermes or something
for just the pixel format but I would have to add transparency and alpha
and all sorts of stuff that you have already done better than I could
ever do anyway :) If I were to write my own it would probably end up
> > I realize that a dirty rectangles type situation would greatly
> > speed things up, but there are engines (tile based, voxel graphics, 3d
> > graphics) that have to update the entire screen everytime and being
> > stuck in a 27fps framerate with a 400mhz isn't very good.
> Unfortunately, until Linux has direct hardware acceleration, you'll
> have to live with it. 27 fps sounds a little slow, but you probably
> won't get more than 30-40 FPS on PentiumII 350 MHz class systems.
Is this the same type of direct hardware acceleration that is coming in
the next X-server release?
Actually 27fps was just my example program that moves a little 10,20
rectangle across the screen. The tile engine gives 13fps but is not
optimized, just some code a guy sent me and needed help on, I could
probably get it up to close to 27fps and I know I could get it playable
as the map doesn't constantly have to tile.
> Nope, it uses stock SDL. If you look closely, you'll see that the
> framerate isn't really that high, but it scrolls in large jumps.
Yeah, I realize that now I did a DOS tile engine and it moved one block
per frame so it appeared to be faster/smoother as well.
> > Does anybody have any examples of a doublebuffer implementation in SDL?
> If I get a chance, I'll whip up an example.
I had one but I had to use SDL_UpdateRects which locked me at that
> > All I want to to have people stop insulting that which have have
> > practically dedicated the past 2 and half months of my live to.
> I know the feeling. :)
I am sorry if I have came across as complaining and am sorry for getting
a little hostile with other members of the group this time, but I just
had a $60,000 a year job oppurtunity fall through (I don't know Cold
Fusion or Object Oriented Perl) and I really thought that the increased
visitors to my site would help me bolster my confidence back up a
little. They've done the opposite, and to be honest for quite a while
now I've been skipping right past sad to angry and tend to lash out when
maybe I shouldn't.
More information about the SDL