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

📄 game.cpp

📁 基本的DirectX + MFC 游戏工程模板
💻 CPP
字号:
// Game.cpp: implementation of the CGame class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "basic.h"
#include "Game.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CGame::CGame()
{

}

CGame::~CGame()
{

}

//////////////////////////////////////////////////////////////////////

bool CGame::Init()
{

// HERE insert DirectDraw, DirectInput, DirectSound initialization

  AfxMessageBox("Game initialization");
  return true;
}

//////////////////////////////////////////////////////////////////////

bool CGame::UpdateFrame()
{

// HERE insert main game loop
// You should wait here for vertical blank

  AfxMessageBox("Game loop");
  return true;
}

//////////////////////////////////////////////////////////////////////

void CGame::Activate()
{

// HERE restore the screen

}

//////////////////////////////////////////////////////////////////////

bool CGame::Finish()
{

// HERE release all DirectX objects

  AfxMessageBox("Game over");
  return true;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -