我想将我的函数收到的任何SDL_Surface转换为RGBA8888格式表面,做stuff,并在返回之前将其转换回原始格式。顺便说一句,我正在C工作。如何将任何SDL_Surface转换为RGBA8888格式并返回?
//------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
//------------------------------------------------
SDL_Surface* formattedSurf = SDL_ConvertSurfaceFormat(surf,
SDL_PIXELFORMAT_RGBA8888,
0);
收益率:从Eclipse CDT的和GCC类似rsponses: “问题描述符号 'SDL_PIXELFORMAT_RGBA8888' 无法解析”。
[Thu 13/09/26 14:40 PDT][pts/3][x86_64/linux-gnu/3.11.1-1-ARCH][5.0.2]
<[email protected]:/tmp>
zsh/2 1821 % pkg-config --cflags --libs sdl
-D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -lSDL -lpthread
什么是'RGBA8888'格式? – this
他意味着每个通道8位的32位RGBA – emartel
请参阅@ Zamallad的建议。这正是我想要做的。显然,无法获得包含的权利。 – justinzane