一、基本游戏架构
二、示例
1. example01---基于基本游戏架构的example00:
/******************************************************************************
game strtucture:
initialise
|
|
----get input
| |
| |
| do physics
| |
| |
-----render
|
|
exit
base on game strture, modify example00
******************************************************************************/
SDL_Window *g_pWindow = NULL;
SDL_Renderer*g_pRenderer = NULL;
bool g_bRunning = false;
Uint8 g_r = 0, g_g = 0, g_b = 0;
bool init(const char *title, int xpos, int ypos, int height, int width, int flags)
{
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) return false;

本文介绍了使用SDL2.0进行游戏开发的基础知识,包括构建基本的游戏架构,并通过一个简单的example01示例来展示如何基于这个框架实现一个基本的游戏程序。
最低0.47元/天 解锁文章
5311

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



