Guest User

Untitled

a guest
Jan 23rd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <hge.h>
  2.  
  3. HGE *hge = 0;
  4.  
  5. bool FrameFunc()
  6. {
  7.   if (hge->Input_GetKeyState(HGEK_ESCAPE)) return true;
  8.   return false;
  9. }
  10.  
  11. int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
  12. {
  13.   hge = hgeCreate(HGE_VERSION);
  14.   hge->System_SetState(HGE_FRAMEFUNC, FrameFunc);
  15.   hge->System_SetState(HGE_WINDOWED, true);
  16.   hge->System_SetState(HGE_USESOUND, false);
  17.   hge->System_SetState(HGE_TITLE,
  18.                  "HGE Tutorial 01 - Minimal HGE application");
  19.                  
  20.   if(hge->System_Initiate())
  21.   {
  22.     hge->System_Start();
  23.   }
  24.   else
  25.   {
  26.     MessageBox(NULL, hge->System_GetErrorMessage(), "Error",
  27.                MB_OK | MB_ICONERROR | MB_APPLMODAL);
  28.   }
  29.  
  30.     hge->System_Shutdown();
  31.   hge->Release();
  32.  
  33.   return 0;
  34. }
Add Comment
Please, Sign In to add comment