WinMain.cpp
上传用户:jalin138
上传日期:2022-02-12
资源大小:5720k
文件大小:1k
- /*****************************************************
- **
- ** File: WinMain.cpp
- ** Function : 窗口入口函数
- ** Author: Wei
- ** Date : 2009.12.20
- **
- ******************************************************/
- #include <Windows.h>
- #include "Frame.h"
- #pragma comment( lib,"lib/hge.lib" )
- #pragma comment( lib,"lib/hgehelp.lib")
- #define _CRTDBG_MAP_ALLOC
- #include <crtdbg.h>
- #ifdef _DEBUG
- #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
- #endif
- CFrame *g_pFrame = NULL;
- hgeResourceManager *g_Res = NULL;
- HGE *g_Hge = NULL;
- GfxFont *g_Font = NULL;
- bool tm_FrameFunc()
- {
- //贞函数设置
- return g_pFrame->FrameFunc();
- }
- bool tm_RenderFunc()
- {
- //渲染函数设置
- return g_pFrame->RenderFunc();
- }
- int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
- {
- int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
- tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
- _CrtSetDbgFlag( tmpFlag );
- g_Font = new GfxFont( "宋体", 15 );
- SAFE_CHECK( g_Font );
- g_Font->SetColor( 0xffff0000 );
- g_pFrame = new CFrame();
- SAFE_CHECK( g_pFrame );
- if ( !g_pFrame->Init( "Game.ini", tm_FrameFunc, tm_RenderFunc ) )
- {
- SAFE_DELETE( g_pFrame );
- MessageBox( NULL,"Game Can not Init !", "Error" ,MB_OK );
- return 0;
- }
- SAFE_DELETE( g_Font );
- SAFE_DELETE( g_pFrame );
- return 0;
- }