简单2d引擎框架
#include "gmooby.h"
GM_Bool loopfunc (void)
{
return GM_FALSE;
}
int main()
{
GM_state ("%w %h %bpp %full", 800, 600, 32, GM_FALSE);
GM_state ("%bcur %title %bgc", GM_TRUE, "oh ye", 0xff0000ff);
GM_state ("%loopfunc", loopfunc);
if (GM_run () == 0) return 1;
return 0;
}
GM_Bool loopfunc (void)
{
return GM_FALSE;
}
int main()
{
GM_state ("%w %h %bpp %full", 800, 600, 32, GM_FALSE);
GM_state ("%bcur %title %bgc", GM_TRUE, "oh ye", 0xff0000ff);
GM_state ("%loopfunc", loopfunc);
if (GM_run () == 0) return 1;
return 0;
}
看,用两个函数就能启动一个窗口了. 挺简洁的吧:)
这是我正在写的一个游戏库,放到googlecode了,谁有兴趣可以帮着写点,框架就先这个样吧. 剩下都是比较独立的东西. 该写渲染部分了,用opengl.
http://code.google.com/p/gmooby/