SDL implementation notes for 0.6a (comments?)

When using fullscreen DirectX in software surface mode, the cursor
can be drawn by the driver.

Hardware surfaces must be locked to be accessed.
Color keyed surfaces must be locked to be accessed.

Blit acceleration may be possible when the surface is either in
video memory or software memory, and depends on hardware caps.

Blit acceleration is always possible when both surfaces are the
same pixel format and colorkeying is used, either in hardare or
software.

This line performs accelerated blits (after clipping):

    if ( src->AccelBlit != NULL ) {
            (*src->AccelBlit)(src, srcrect, dst, dstrect);
    } else {
            /* Normal blit */
    }

(this logic will be in SDL_BlitSurface())

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/projects/SDL/

    if ( src->AccelBlit != NULL ) {
            (*src->AccelBlit)(src, srcrect, dst, dstrect);
    } else {
            /* Normal blit */
    }

Why can’t the library just override (*normalBlit) for this? surely there
are no situations where forcing a SW blit when a HW blit would work occur?

njhOn Sat, 4 Apr 1998, Sam Lantinga wrote:

    if ( src->AccelBlit != NULL ) {
            (*src->AccelBlit)(src, srcrect, dst, dstrect);
    } else {
            /* Normal blit */
    }

Why can’t the library just override (*normalBlit) for this? surely there
are no situations where forcing a SW blit when a HW blit would work occur?

Because the setup for the normal blit involves offsetting the framebuffer
pointers by the source and destination coordinates. This isn’t appropriate
in software accelerated colorkeying (done using RLE techniques)

It’s also not necessarily appropriate in other accelerated blits because
you can optimize sometimes by locking only the rectangle you are going to
touch.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/projects/SDL/