SDLGUL自定义事件处理函数的使用
sdlgui吧
全部回复
仅看楼主
level 10
twtfcu3 楼主
视频教学地址
网盘链接
2014年05月31日 04点05分 1
level 10
twtfcu3 楼主
#include <SDL2/SDL.h>
#include "sdlgui/sdlgui.h"
using namespace std;
int frame_event(sdl_frame* obj,SDL_Event* e)
{
switch(e->type)
{
case SDL_MOUSEMOTION:
obj->fill_rect(NULL,e->motion.x*e->motion.y*200);
break;
}
}
int main(int argc, char * argv[])
{
sdl_frame f("sdlgui",100,100,600,600,SDL_WINDOW_SHOWN);
f.event(frame_event);
return f.run();
}
2014年05月31日 04点05分 2
level 10
twtfcu3 楼主
我要叫了
2014年05月31日 04点05分 3
2014年05月31日 05点05分
2014年05月31日 05点05分
2014年05月31日 05点05分
2014年05月31日 05点05分
level 11
来了,顶。。。
2014年05月31日 05点05分 4
level 11
我觉得你可以写个窗体函数,而不是默认的,,太难看了,。。
2014年05月31日 05点05分 5
SDLGUI有这个功能,但我不能让SDLGUI自己的去实现,那样会让使用者感觉没有自由空间了,其实在创建顶级窗口就可以生成
2014年05月31日 05点05分
回复 twtfcu3 :sdl可以生成吗
2014年05月31日 05点05分
回复 蚯蚓翔龙 :SDLGUI是基于SDL2编写的
2014年05月31日 06点05分
回复 twtfcu3 :我觉得自己创建想要的窗口才自由。
2014年05月31日 08点05分
level 1
来了,顶
2014年05月31日 05点05分 6
level 1
建议你把项目放到git上,我马上申请账号
2014年05月31日 05点05分 7
level 1
GUI还没看,默默点个赞[酷]
2014年05月31日 05点05分 8
level 9
来了,顶
2014年05月31日 06点05分 9
level 1

2014年05月31日 08点05分 10
level 1
顶一个
   ——魔术,梦与艺术的结合······
2014年05月31日 08点05分 11
1