⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winmain.cpp

📁 一本关于OPenGL的很好的电子书
💻 CPP
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -