您好,欢迎光临本网站![请登录][注册会员]  
文件名称: HGE引擎及实例,可以下载学习
  所属分类: C++
  开发工具:
  文件大小: 3mb
  下载次数: 0
  上传时间: 2011-03-25
  提 供 者: tcd***
 详细说明: HGE引挚 CRect rs; GetClientRect(pWnd->GetSafeHwnd(),&rs); hge = hgeCreate(HGE_VERSION); hge->System_SetState(HGE_LOGFILE, "hge_tut07.log"); //hge->System_SetState(HGE_FRAMEFUNC, FrameFunc); hge->System_SetState(HGE_RENDERFUNC, RenderFunc); hge->System_SetState(HGE_TITLE, "HGE Tutorial 07 - Thousand of Hares"); hge->System_SetState(HGE_USESOUND, false); hge->System_SetState(HGE_WINDOWED, true); hge->System_SetState(HGE_SCREENWIDTH, SCREEN_WIDTH); hge->System_SetState(HGE _SCREENHEIGHT, SCREEN_HEIGHT); hge->System_SetState(HGE_SCREENBPP, 32); hge->System_SetState(HGE_HWNDPARENT, pWnd->GetSafeHwnd()); if(hge->System_Initiate()) { // Load textures bgtex=hge->Texture_Load("bg2.png"); tex=hge->Texture_Load("zazaka.png"); if(!bgtex || !tex) { // If one of the data files is not found, // display an error message and shutdown // MessageBox(NULL, "Can't load BG2.PNG or ZAZAKA.PNG", "Error", MB_OK | MB_ICONERROR | MB_APPLMODAL); hge->System_Shutdown(); hge->Release(); return ; } // Load font, create sprites fnt=new hgeFont("font2.fnt"); spr=new hgeSprite(tex,0,0,64,64); spr->SetHotSpot(32,32); bgspr=new hgeSprite(bgtex,0,0,800,600); bgspr->SetBlendMode(BLEND_COLORADD | BLEND_ALPHABLEND | BLEND_NOZWRITE); bgspr->SetColor(0xFF000000,0); bgspr->SetColor(0xFF000000,1); bgspr->SetColor(0xFF000040,2); bgspr->SetColor(0xFF000040,3); // Initialize objects list pObjects=new sprObject[MAX_OBJECTS]; nObjects=1000; for(int i=0;iRandom_Float(0,SCREEN_WIDTH); pObjects[i].y=hge->Random_Float(0,SCREEN_HEIGHT); pObjects[i].dx=hge->Random_Float(-200,200); pObjects[i].dy=hge->Random_Float(-200,200); pObjects[i].scale=hge->Random_Float(0.5f,2.0f); pObjects[i].dscale=hge->Random_Float(-1.0f,1.0f); pObjects[i].rot=hge->Random_Float(0,M_PI*2); pObjects[i].drot=hge->Random_Float(-1.0f,1.0f); } SetBlend(0); // Let's rock now! hge->System_Start(); // Delete created objects and free loaded resources delete[] pObjects; delete fnt; delete spr; delete bgspr; hge->Texture_Free(tex); hge->Texture_Free(bgtex); } // Clean up and shutdown hge->System_Shutdown(); hge->Release(); ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: HGE
 输入关键字,在本站1000多万海量源码库中尽情搜索: