winmain.cpp
来自「一本关于OPenGL的很好的电子书」· C++ 代码 · 共 57 行
CPP
57 行
#define WIN32_MEAN_AND_LEAN
#define WIN32_EXTRA_LEAN
/*
WINMAIN.CPP
Contains WinMain, the main windows function
Author: Kevin Hawkins
Date: 3/19/2001
Description:
*/
#include <windows.h>
#include "oglwindow.h" // the OpenGL window class
#include "vector.h"
#include "engine.h" // the engine's main class
#include "simpengine.h"
WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, int nCmdShow)
{
int loopRet;
CoInitialize(NULL);
if (!COGLWindow::RegisterWindow(hInst))
{
MessageBox(NULL, "Failed to register window class", "Error", MB_OK);
return -1;
}
CSimpEngine *engine = NULL;
try
{
engine = new CSimpEngine("OpenGL Game", FALSE, 800, 600, 16);
loopRet = engine->EnterMessageLoop();
delete engine;
return loopRet;
}
catch(char *sz)
{
MessageBox(NULL, sz, 0, 0);
delete engine;
}
CoUninitialize();
return -1;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?