SDL-Simple DirectMedia Layer

2018-01-24 10:31:24来源:网络收集作者:程序诗人人点击

分享

[var1]

C语言实现的可跨平台的,针对audio, keyboard, mouse, joystick, and graphics hardware底层基于OpenGL和DirectX的开源开发库。
SDL -> http://www.libsdl.org/


SDL 最新2.0.7 Windows,MacOS,Android,IOS,Linux


SDL2-devel-2.0.7-VC.zip (Visual C++ 32/64-bit)
SDL2-devel-2.0.7-mingw.tar.gz (MinGW 32/64-bit)


SDL-Simple DirectMedia Layer


将include和lib加入工程引用即可。


#include "SDL.h"
// 这里为什么要加上 main(int argc, char* argv[]) 不然会出现链接错误。SDL也有自己的main入口,查看源码
int main(int argc, char* argv[])
{
SDL_Init(SDL_INIT_EVERYTHING);
return 0;
}

/**
*/file SDL_main.h
*
*The application's main() function must be called with C linkage,
*and should be declared like this:
*/code
*#ifdef __cplusplus
*extern "C"
*#endif
*int main(int argc, char *argv[])
*{
*}
*/endcode
*/
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
#define mainSDL_main
#endif
/**
*The prototype for the application's main() function
*/
extern C_LINKAGE DECLSPEC int SDL_main(int argc, char *argv[]);

最新文章

123

最新摄影

闪念基因

微信扫一扫

第七城市微信公众平台