winmain.cpp
上传用户:zhj2929
上传日期:2022-07-23
资源大小:28772k
文件大小:1k
- #include <math.h>
- #include "../../JGE/HGE/include/hge.h"
- #include "../../JGE/HGE/include/hgefont.h"
- #include "../../JGE/include/JGE.h"
- #include "../src/GameApp.h"
- #define GAMESCREEN_WIDTH 512
- #define GAMESCREEN_HEIGHT 480
- GameApp *game = NULL;
- JGE *engine = NULL;
- HGE *hge = NULL;
- bool FrameFunc()
- {
- JGEControl();
-
- if (game != NULL && engine != NULL)
- {
- game->Update();
-
- hge->Gfx_BeginScene();
- game->Render();
- hge->Gfx_EndScene();
- if (engine->IsDone())
- return true;
- }
-
- return false;
- }
- int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
- {
- hge = hgeCreate(HGE_VERSION);
- hge->System_SetState(HGE_LOGFILE, "mario.log");
- hge->System_SetState(HGE_FRAMEFUNC, FrameFunc);
- hge->System_SetState(HGE_TITLE, "爱情问题'砖'移");
- hge->System_SetState(HGE_WINDOWED, true);
- hge->System_SetState(HGE_SCREENWIDTH, GAMESCREEN_WIDTH);
- hge->System_SetState(HGE_SCREENHEIGHT, GAMESCREEN_HEIGHT);
- hge->System_SetState(HGE_SCREENBPP, 32);
- hge->System_SetState(HGE_USESOUND, true);
- hge->System_SetState(HGE_ZBUFFER, false);
- hge->System_SetState(HGE_FPS, 60);
-
- if(hge->System_Initiate())
- {
- engine = JGECreate();
-
- game = new GameApp(engine);
- game->Create();
- hge->System_Start();
-
- game->Destroy();
- delete game;
- game = NULL;
-
- JGERelease();
- }
- hge->System_Shutdown();
- hge->Release();
- return 0;
- }