Hi, it seems that I really don’t have a clear understanding of
theses topics.
Where (a web page) could I find a tutorial about :
RGB & RGBA formats
Dunno. The behavior of SDL_BlitSurface() is documented, though, but
you may have to read up on the terms used if you’re not into low
level computer graphics.
How transparency if handled in 16 & 24 bits modes ?
If you’re referring to display video modes, there’s no difference
between 24 and 32 bpp, except that in 32 bpp modes, each pixel has an
extra padding byte to avoid the nasty 3 byte addressing.
In 16 bpp modes, everything has to be scaled down to the lower color
depth, but that’s about it. Note that SDL_DisplayFormatAlpha()
generates 32 bpp RGBA surfaces for anything with an alpha channel,
regardless of the display mode.
How surfaces are handled when in hardware video ?
Alpha blending is done in software on all backends but DirectFB and
(soon) glSDL, AFAIK. Very few 2D APIs support alpha blending.
This is why, if you’re doing a lot of alpha blending and the backend
doesn’t provide accelerated alpha, you should render into a s/w
shadow surface (RGB - not RGBA!) that is then blitted to the display
surface. Alpha blending is a read-modify-write operation, and reading
from VRAM with the CPU is insanely slow on most current hardware.
What are the different pixel formats of several surfaces (the one
of a fresh bmp loaded bitmap, the one of the screen)…
Could be anything… Not sure I understand the question.
Anyway, don’t worry too much about this unless you’re going to touch
pixels directly, ie (application side) software rendering. It’s
relatively easy to make SDL do the Right Thing™ in most cases,
regardless of pixel formats.
I’m not talking about SDL API calls but a good introduction about
2D computer graphics…
Well, in that case, you really need two or three tutorials; something
like:
* The Basics of 2D Software Rendering
* Pixel Formats and RGB Colors
* Alpha Blending
* Pixel Addressing and Alignment
* Video Subsystems: Accessing VRAM
* Video Subsystems: Acceleration
* SDL Internals: How is Rendering Done?
* Display Buffer Management
* Software Blitting
* RLE Acceleration
* Hardware Acceleration
* Advanced Software Rendering with SDL
* Custom Blitters
* Procedural Surfaces
* Dealing with Different Targets
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Thursday 27 November 2003 20.35, kandjidev at yahoo.fr wrote: