
SDL
文章平均质量分 78
绿野耕夫
一无所有时,还有编程
展开
-
SDL2.0学习笔记1---开发环境搭建
本系列文章基于SDL2.0及Visual C_原创 2014-08-12 22:08:37 · 9705 阅读 · 0 评论 -
SDL2.0学习笔记2---基于SDL的基本游戏架构
#include "SDL.h"/******************************************************************************game strtucture: initialise | | ----get input | | | | | do physics | | | | ----原创 2014-08-12 23:01:32 · 4403 阅读 · 0 评论 -
SDL2.0学习笔记3——用SDL画图
#include "SDL.h"class Game2{public: Game2():m_pWindow(NULL),m_pRenderer(NULL), m_bRunning(false){}; ~Game2(){}; bool init(const char* title, int xpos, int ypos, int width, int height, int flag原创 2014-08-14 22:22:10 · 12120 阅读 · 0 评论 -
SDL2.0学习笔记6--用SDL播放音频wave文件
#include "SDL.h"struct { Uint8 *sound; // pointer to wave data Uint32 soundlen; // length of wave data int soundpos; // current play position}wave;int done;static voi原创 2014-11-25 11:42:51 · 3201 阅读 · 0 评论 -
SDL2.0学习笔记4--用SDL画图(SDL_Surface)
#include "SDL.h"#include #include void example04(){ SDL_Window *pWindow = NULL; SDL_Renderer *pRenderer = NULL; SDL_Texture *pTexture; SDL_Rect原创 2014-08-16 08:54:34 · 9473 阅读 · 0 评论 -
SDL学习笔记7--用SDL显示图像数据
这篇文章实际和学习笔记3和4差不多,未来需要深入理解window, render, texture, surface等概念。#include "SDL.h"struct{ Uint32 pixformat; int w, h; Uint8 *data;}frame;int screen_width = 0;int screen_height原创 2014-11-26 14:25:39 · 2969 阅读 · 0 评论 -
SDL2.0学习笔记5——定时器模块
定时器API(timer.h):1. Uint32 SDL_GetTicks(): 获取从SDL库初始化(定时器模块初始化)开始到当前的运行时间(ms);2. Uint64 SDL_GetPerformanceCounter(): 获取高精度定时器的当前值;3. Uint64 SDL_GetPerformanceFrequency(): 获取高进度定时器频率(每秒钟高精度定时器的次数)原创 2014-10-23 09:20:52 · 5403 阅读 · 0 评论