開発環境 |
Microsoft Visual C++ 2010 Express (SP1) |
実行環境 |
Microsoft Windows XP Home Edition (SP3) |
プロジェクトの種類 |
空の CLR プロジェクト |
プロジェクト名 |
xnatest |
Microsoft XNA Game Studio 4.0 Refreshをインストール
インストールできなかったので、先にMicrosoft Visual C# 2010 Expressをインストール
Program.cpp
/*
プロジェクトに以下の.NET参照を追加
Microsoft.Xna.Framework
Microsoft.Xna.Framework.Game
Microsoft.Xna.Framework.Graphics
*/
#pragma comment(linker, "/subsystem:windows")
#pragma comment(linker, "/entry:Main")
using namespace Microsoft::Xna::Framework;
using namespace Microsoft::Xna::Framework::Graphics;
namespace DisplayWindow
{
public ref class GameMain : Game
{
private:
GraphicsDeviceManager^ graphics;
SpriteBatch^ spriteBatch;
public:
GameMain()
{
graphics = gcnew GraphicsDeviceManager(this);
Content->RootDirectory = "Content";
Window->Title = "ウィンドウのタイトル";
Window->AllowUserResizing = true;
}
protected:
virtual void Draw(GameTime^ gameTime) override
{
GraphicsDevice->Clear(Color::CornflowerBlue);
Game::Draw(gameTime);
}
};
ref class Program
{
static void Main()
{
GameMain^ game = gcnew GameMain();
game->Run();
}
};
}
最終更新:2012年09月17日 22:51