SDL_UpdateRect函数

来源:互联网 发布:linux gdb常用命令 编辑:程序博客网 时间:2024/05/14 17:02

SDL_UpdateRect函数

用这个函数来在指定屏幕区域进行更新。在更新之前,需要对表面进行解除锁定。


#include "SDL.h"

void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);



例子:

if (lpRect != NULL){dstrect.x = (SHORT)((INT)(lpRect->x) * gpScreenReal->w / gpScreen->w);dstrect.y = (SHORT)((INT)(screenRealY + lpRect->y) * screenRealHeight / gpScreen->h);dstrect.w = (WORD)((DWORD)(lpRect->w) * gpScreenReal->w / gpScreen->w);dstrect.h = (WORD)((DWORD)(lpRect->h) * screenRealHeight / gpScreen->h);SDL_SoftStretch(gpScreen, (SDL_Rect *)lpRect, gpScreenReal, &dstrect);if (SDL_MUSTLOCK(gpScreenReal)){SDL_UnlockSurface(gpScreenReal);}SDL_UpdateRect(gpScreenReal, dstrect.x, dstrect.y, dstrect.w, dstrect.h);}


1. C++标准模板库从入门到精通 

http://edu.csdn.net/course/detail/3324

2.跟老菜鸟学C++

http://edu.csdn.net/course/detail/2901

3. 跟老菜鸟学python

http://edu.csdn.net/course/detail/2592

4. 在VC2015里学会使用tinyxml库

http://edu.csdn.net/course/detail/2590

5. 在Windows下SVN的版本管理与实战 

 http://edu.csdn.net/course/detail/2579

6.Visual Studio 2015开发C++程序的基本使用 

http://edu.csdn.net/course/detail/2570

7.在VC2015里使用protobuf协议

http://edu.csdn.net/course/detail/2582

8.在VC2015里学会使用MySQL数据库

http://edu.csdn.net/course/detail/2672


0 0
原创粉丝点击