HGE:OO FrameFunc/RenderFunc

简介:
#pragma once 
None.gif
None.gif#include  < hge.h >  
None.gif
None.gif  class  CGlobal 
ExpandedBlockStart.gif 
InBlock.gif public : 
InBlock.gif   CGlobal( void ); 
InBlock.gif    ~ CGlobal( void ); 
InBlock.gif    static   bool  FrameFunction( void ); 
InBlock.gif    static  CGlobal *  g_pGlobal;
InBlock.gif   HGE *  hge; 
InBlock.gif // private:  
InBlock.gif 
    bool  InitHGE( void ); 
InBlock.gif    void  DestroyHGE( void ); 
ExpandedBlockEnd.gif
;
Global.h 


Global.cpp 
None.gif#include ".\global.h" 
None.gif
None.gifCGlobal::CGlobal( void
ExpandedBlockStart.gif {
InBlock.gif   g_pGlobal = this
InBlock.gif   hge = hgeCreate(HGE_VERSION); 
ExpandedBlockEnd.gif}
 
None.gif
None.gifCGlobal::~CGlobal( void
ExpandedBlockStart.gif
ExpandedBlockEnd.gif}
 
None.gif
None.gif bool CGlobal::InitHGE( void
ExpandedBlockStart.gif
InBlock.gif   hge->System_SetState(HGE_LOGFILE, "global.log"); 
InBlock.gif   hge->System_SetState(HGE_FRAMEFUNC, this->FrameFunction); 
InBlock.gif   hge->System_SetState(HGE_TITLE, "Global Test"); 
InBlock.gif   hge->System_SetState(HGE_WINDOWED, true); 
InBlock.gif   hge->System_SetState(HGE_SCREENWIDTH, 1024); 
InBlock.gif   hge->System_SetState(HGE_SCREENHEIGHT, 768); 
InBlock.gif   hge->System_SetState(HGE_SCREENBPP, 32); 
InBlock.gif
InBlock.gif   try 
ExpandedSubBlockStart.gif   
InBlock.gif      hge->System_Initiate(); 
InBlock.gif      return true
ExpandedSubBlockEnd.gif   }
 
InBlock.gif   catch(dot.gif
ExpandedSubBlockStart.gif   
InBlock.gif      return false
ExpandedSubBlockEnd.gif   }
 
ExpandedBlockEnd.gif}
 
None.gif
None.gif void CGlobal::DestroyHGE( void
ExpandedBlockStart.gif
InBlock.gif   hge->System_Shutdown(); 
InBlock.gif   hge->Release(); 
ExpandedBlockEnd.gif}
 
None.gif
None.gif bool CGlobal::FrameFunction( void
ExpandedBlockStart.gif
InBlock.gif   if (hge->Input_GetKeyState(HGEK_ESCAPE)) 
InBlock.gif      return true
InBlock.gif   return false
ExpandedBlockEnd.gif}


Main.cpp 
None.gif#include "Global.h" 
None.gif
None.gifCGlobal* Main; 
None.gif
None.gif int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR,  int
ExpandedBlockStart.gif
InBlock.gif   Main = new CGlobal(); 
InBlock.gif   if(!Main->InitHGE()) PostQuitMessage(1); 
InBlock.gif   Main->DestroyHGE(); 
InBlock.gif   delete Main; 
InBlock.gif   return 0; 
ExpandedBlockEnd.gif}

目录
相关文章
|
编译器 Scala
spinal HDL - 08 - 赋值
spinal HDL - 08 - 赋值
180 0
spinal HDL - 08 - 赋值
使用ABAP调用BRF+ function
使用ABAP调用BRF+ function
183 0
使用ABAP调用BRF+ function
|
设计模式 关系型数据库
|
Shell 数据安全/隐私保护