我有一个关于 SDL Surface 光标的理论问题。
如果我想在屏幕上显示 surface_A,我将使用通过 SDL_Rectcursor;
创建的光标,并将其与 SDL_BlitSurface();
一起使用。
光标将包含相对于窗口左上角的位置。
但是如果我想在surface_A内显示surface_B,我是否必须指示相对于窗口左上角或surface_A左上角的光标?
最佳答案
您可能对光标的相对位置做出了一些错误的假设。链接位置有一套非常好的、详细的教程,可以帮助您解决问题...
来自 HERE ...
Using the first tutorial as our base, we'll delve more into the world of SDL surfaces. As I attempted to explain in the last lesson, SDL Surfaces are basically images stored in memory. Imagine we have a blank 320x240 pixel surface. Illustrating the SDL coordinate system, we have something like this:
This coordinate system is quite different than the normal one you are familiar with. Notice how the Y coordinate increases going down, and the X coordinate increases going right. Understanding the SDL coordinate system is important in order to properly draw images on the screen.
一些可能有助于澄清的附加术语:
SDL Window :您可以将其视为物理像素,或您的显示器。
SDL Renderer :控制在该窗口中创建的内容的属性/设置。
关于c - SDL 相对位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50837849/