当前位置: 首页 > news >正文

石家庄建站源码苏州高端网站制作公司

石家庄建站源码,苏州高端网站制作公司,网站付费怎么做,网站开发前期准备工作文章目录 事件相关的函数和数据结构用户自定义事件代码相关#xff1a; 事件相关的函数和数据结构 SDL_WaitEvent :等待一个事件SDL_PushEvent 发送一个事件SDL_PumpEvents(): 将硬件设备产生的时间放入事件队列 #xff0c;用于读取事件#xff0c;在调用该函数之前#… 文章目录 事件相关的函数和数据结构用户自定义事件代码相关 事件相关的函数和数据结构 SDL_WaitEvent :等待一个事件SDL_PushEvent 发送一个事件SDL_PumpEvents(): 将硬件设备产生的时间放入事件队列 用于读取事件在调用该函数之前必须调用SDL_PumpEVents搜集键盘等事件SDL_PeepEvents() 从事件队列提取一个事件 -数据结构 SDL_Event 代表一个事件 可以监控到的事件在SDL_events.h文件里面可以找到 用户自定义事件 #define FF_QUIT_EVENT (SDL_USEREVENT 2) // 用户自定义事件 代码相关 TEMPLATE app CONFIG console thread CONFIG - app_bundle CONFIG - qtSOURCES \main.cINCLUDEPATH \$$PWD/../SDL2-2.0.10/include/LIBS \$$PWD/../SDL2-2.0.10/lib/x86/SDL2.lib main.c #include SDL.h #include stdio.h #define FF_QUIT_EVENT (SDL_USEREVENT 2) // 用户自定义事件 #undef main int main(int argc, char *argv[]) {SDL_Window *window NULL; // Declare a pointerSDL_Renderer *renderer NULL;SDL_Init(SDL_INIT_VIDEO); // Initialize SDL2// Create an application window with the following settings:window SDL_CreateWindow(An SDL2 window, // window titleSDL_WINDOWPOS_UNDEFINED, // initial x positionSDL_WINDOWPOS_UNDEFINED, // initial y position640, // width, in pixels480, // height, in pixelsSDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS // flags - see below);// Check that the window was successfully createdif (window NULL) {// In the case that the window could not be made...printf(Could not create window: %s\n, SDL_GetError());return 1;}/* We must call SDL_CreateRenderer in order for draw calls to affect this window. */renderer SDL_CreateRenderer(window, -1, 0);/* Select the color for drawing. It is set to red here. */SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);/* Clear the entire screen to our selected color. */SDL_RenderClear(renderer);/* Up until now everything was drawn behind the scenes.This will show the new, red contents of the window. */SDL_RenderPresent(renderer);SDL_Event event;int b_exit 0;for (;;) {SDL_WaitEvent(event);switch (event.type) {case SDL_KEYDOWN: /* 键盘事件 */switch (event.key.keysym.sym) {case SDLK_a:printf(key down a\n);break;case SDLK_s:printf(key down s\n);break;case SDLK_d:printf(key down d\n);break;case SDLK_q:printf(key down q and push quit event\n);SDL_Event event_q;event_q.type FF_QUIT_EVENT;SDL_PushEvent(event_q);break;default:printf(key down 0x%x\n, event.key.keysym.sym);break;}break;case SDL_MOUSEBUTTONDOWN: /* 鼠标按下事件 */if (event.button.button SDL_BUTTON_LEFT) {printf(mouse down left\n);} else if (event.button.button SDL_BUTTON_RIGHT) {printf(mouse down right\n);} else {printf(mouse down %d\n, event.button.button);}break;case SDL_MOUSEMOTION: /* 鼠标移动事件 */printf(mouse movie (%d,%d)\n, event.button.x, event.button.y);break;case FF_QUIT_EVENT://如果是收到自定义的退出信号 则退出接受事件的循环printf(receive quit event\n);b_exit 1;break;}if (b_exit)break;}// destory rendererif (renderer)SDL_DestroyRenderer(renderer);// Close and destroy the windowif (window)SDL_DestroyWindow(window);// Clean upSDL_Quit();return 0; }
http://www.w-s-a.com/news/206103/

相关文章:

  • 编写网站策划方案网站哪里有
  • 网站做得好的公司国家防疫政策最新调整
  • 设计优秀的企业网站做行测的网站
  • 提供做网站公司有哪些关键词优化诊断
  • 建站合肥网络公司seo免费建手机商城网站吗
  • 设计师投资做项目网站外贸网站建设工作室
  • 无聊的网站wordpress的alt属性插件
  • 个股期权系统网站开发小清新wordpress模板
  • 全中文网站开发建筑公司企业愿景文案
  • 广州网站建设正规公司建设银行信用卡中心网站
  • 哪个网站是专门做封面素材怎么制作app平台
  • 网站开发 平均工资商标注册在哪个部门申请
  • 做外贸需要自己的网站吗营销型网站建设市场分析
  • 绍兴网站制作推广wordpress 无法自动升级
  • 阿里云建站数据库用什么app制作开发费用多少
  • 中国住房和城乡建设部网站资质查询中小开网站
  • 交易所网站开发水果营销软文
  • 石家庄有什么好玩的地方2017织梦网站怎么做seo
  • wordpress项目插件seo的含义
  • 网站平台建设的作用电影宣传类网页界面设计
  • 户外网站模板国外优秀的平面设计网站
  • 家政网站怎么做网站机房建设方案
  • 学校网站建设运行情况2022年近期舆情热点话题
  • 做淘宝需要知道什么网站吗有没有做软件的网站
  • 安丘网站建设制作做网站和微信小程序
  • 京东网站的建设与发展前景黑龙江建设网官网登陆
  • soho的网站怎么做微网站平台建设方案
  • 网站开发下载阿里云oss做视频网站
  • 东莞营销网站制作做一个网站建设
  • 啥网站都能看的浏览器下载网站后台管理系统展望