SDL中screenSurface->format是什么意思?

What is the meaning of screenSurface->format in SDL?

最近开始学习SDL,想好好了解一下。我遵循了 Lazy Foo' Productions' 的教程,但有一个说法我不明白。以下示例中 gScreenSurface->formatscreenSurface->format 背后的含义是什么?

SDL_ConvertSurface( screenSurface, gScreenSurface->format, 0 );
SDL_FillRect( screenSurface, NULL, SDL_MapRGB( screenSurface->format, 0xFF, 0xFF, 0xFF ));

希望有人能解释一下,只需要简单的解释。谢谢!

你看过documentation了吗?该格式是一种 SDL 像素格式,详细说明了像素在内存中的设置方式。

不太确定你在问什么,但 gScreenSurface->format 表示 "dereference the pointer in gScreenSurface to get the value format in whatever it points to"。这有什么不清楚的?这是基本的指针使用。