1) SDL_gfx for Delphi, 2) alpha in hw


At first execuse for my english and for my wrong stylized questions too.

  1. exists sdl_gfx library for delphi (or similar lib)? I can’t find this
    library (Google can’t help me :frowning: ), please if you know about sdl_gfx (or
    anything similar) for delphi write me link pls.

  2. My second question is about displaying images with alpha channel to
    hardware surface, it’s too slow. I know, in archive of this forum are much
    answers for this question but i misunderstand. Please can me anybody here
    write (in basic english if it possible :smiley: ) how can i fast blit image with
    alpha to hw surface?
    My (delphi) code is:
    screen := SDL_SetVideoMode(w, h, bpp, SDL_HWSURFACE or SDL_DOUBLEBUF or

Image := LoadImage(‘my-image.png’);
SDL_MapRGB(Image.format, 255, 0, 228));
SDL_SetAlpha(Image, SDL_SRCALPHA, 128);
Image := SDL_DisplayFormat(Image);

SDL_BlitSurface(Image, @SrcRect, Screen, @DstRect);
I use png images without alpha. This code is function but to slow. When i
use sw surface blit alpha image is faster, but all other is slowly :frowning: Can i
fast blit alpha image to hw surface?

Thanks :slight_smile:

Image := LoadImage(‘my-image.png’);

oh, LoadImage is my procedure… LoadImage is only IMG_Load procedure