i',尝试在屏幕上绘制一个像素并更改它的alpha,使其看起来更透明,显示,但透明度不会改变。请帮我改变透明度。
我有这个功能:
void PutPixel32_nolock(SDL_Surface * surface, int x, int y, Uint32 color)
{
Uint8 * pixel = (Uint8*)surface->pixels;
pixel += (y * surface->pitch) + (x * sizeof(Uint32));
*((Uint32*)pixel) = color;
}
这在主
中声明Uint32 pixel_white1= SDL_MapRGBA(screen->format,190,122,255,255);
并且这在循环中:
SDL_LockSurface(screen);
PutPixel32_nolock(screen,10,50,pixel_white1);
SDL_UnlockSurface(screen);