从1.2 到2.0 api 接口的部分变化如下 参考来自:
-
SDL_SetVideoMode(): 使用 SDL_CreateWindow() 替代。
-
SDL_ListModes(): 使用 SDL_GetDisplayMode() 或者 SDL_GetNumDisplayModes()替代。
-
SDL_UpdateRect()/SDL_Flip(): 使用SDL_RenderPresent()替代
-
SDL_Surface/2D rendering: surfaces still exist, but it is recommended that instead of using SDL_Surfaces, you use SDL_Textures with an 2D accelerated renderer (SDL_CreateRenderer()) where possible
-
SDL_VideoInfo: 使用 SDL_GetRendererInfo()/SDL_GetRenderDriverInfo() 替代。
-
SDL_GetCurrentVideoDisplay(): 使用 SDL_GetWindowDisplayIndex() 替代
-
SDL_VIDEORESIZE event:新的替代是 SDL_WINDOWEVENT_RESIZE
本文详细解析了SDL从1.2到2.0版本中API接口的变化,包括窗口创建、显示模式获取、渲染呈现等关键功能的替代方案,旨在帮助开发者顺利过渡到新版本。

2871

被折叠的 条评论
为什么被折叠?



