i attached a simple demo and i was wondering how i could make this run a
lot faster. thanks to anyone ahead of time.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: parallax.tar.gz
Type: application/x-compress
Size: 10240 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020406/6deb52a3/attachment.bin
On Sat, Apr 06, 2002 at 12:30:30AM -0800, Christopher Thielen wrote :
i attached a simple demo and i was wondering how i could make this run a
lot faster. thanks to anyone ahead of time.
Doesn't compile. Why are you declaring SDL_Rect in
draw_starfield() in the middle of the code and not right
after the parameter declaration? I wonder what compiler with
which setting supports this .. MSVC and gcc do not like it on
my systems.
- Markus--
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”
oops, yea, just move that sdl_rect declaration to the correct spot at
the top of the function. gcc 3.0.4 doesn’t complain about this, but
still, i should’ve placed it at the top. sorry there.
any ideas as to what the speed issues are?On Sat, 2002-04-06 at 01:27, Markus Fischer wrote:
On Sat, Apr 06, 2002 at 12:30:30AM -0800, Christopher Thielen wrote :
i attached a simple demo and i was wondering how i could make this run a
lot faster. thanks to anyone ahead of time.Doesn't compile. Why are you declaring SDL_Rect in draw_starfield() in the middle of the code and not right after the parameter declaration? I wonder what compiler with which setting supports this .. MSVC and gcc do not like it on my systems. - Markus
–
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”
C99…
like gcc3On 2002.04.06 12:27 Markus Fischer wrote:
On Sat, Apr 06, 2002 at 12:30:30AM -0800, Christopher Thielen wrote :
i attached a simple demo and i was wondering how i could make this
run a
lot faster. thanks to anyone ahead of time.Doesn't compile. Why are you declaring SDL_Rect in draw_starfield() in the middle of the code and not right after the parameter declaration? I wonder what compiler with which setting supports this .. MSVC and gcc do not like it on my systems.
Doesn't compile. Why are you declaring SDL_Rect in draw_starfield() in the middle of the code and not right after the parameter declaration? I wonder what compiler with which setting supports this .. MSVC and gcc do not like it on my systems.
C99…
like gcc3
Or compile it as C++ code.
–ryan.
Well, changing the SDL_DisplayFormatAlpha() for the background tile to
SDL_DisplayFormat() improves speed by a factor >2 here. (If you had been
using RLEACCEL with that, there would have been no difference, as the
encoder would have found no alpha information to encode - and you would
have achieved full speed despite this bug.)
Also, don’t try to force 16 bpp! It will only cause emulation to be used
if 16 bpp isn’t supported, or the driver cannot change depth. (The latter
would be the case with XFree86.)
Other than that, I think you’re out of luck, unless you can use a lower
resolution, and/or reduce the area that needs to be updated every frame.
The problem with the latter is that the platforms that would really need
it seem to have rather significant per rectangle overhead when using
SDL_UpdateRects()…
Oh, and then there’s OpenGL, of course, but then you lock out all systems
without h/w accelerated OpenGL. (Unless you still provide an SDL 2D mode
- dynamic loading of OpenGL, that is.)
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Saturday 06 April 2002 10:30, Christopher Thielen wrote:
i attached a simple demo and i was wondering how i could make this run
a lot faster. thanks to anyone ahead of time.