#include "stdafx.h"
#include <hge.h>
HGE *hge = 0;
hgeQuad quad;//矩形
HEFFECT snd;//音效
bool FrameFunc(){
if(hge ->Input_GetKeyState(HGEK_ESCAPE))
return true;//返回true表示函数调用结束
return false;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
hge = hgeCreate(HGE_VERSION);
hge -> System_SetState(HGE_FRAMEFUNC, FrameFunc);
hge -> System_SetState(HGE_WINDOWED, true);
hge -> System_SetState(HGE_USESOUND, false);
hge -> System_SetState(HGE_TITLE,
"HGE Tutorial 01 - Minimal HGE application");
if(hge -> System_Initiate()){
hge -> System_Start();
}else{
MessageBox(NULL, hge -> System_GetErrorMessage(),"Error",
MB_OK | MB_ICONERROR | MB_APPLMODAL);
}
hge -> System_Shutdown();
hge -> Release();
return 0;
}