📄 gamerendertest.cs
字号:
using System;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using Microsoft.Samples.DirectX.UtilityToolkit;
using System.Collections;
using TankGogogo.GameRenderer;
namespace TankGogogo.ConsoleTest
{
/// <summary>
/// GameRenderTest 的摘要说明。
/// </summary>
public class GameRenderTest
{
public GameRenderTest()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
/*
static int xxMain()
{
System.Windows.Forms.Application.EnableVisualStyles();
using (Framework sampleFramework = new Framework())
{
GameRenderer.GameRenderer sample = new GameRenderer.GameRenderer(sampleFramework);
// Set the callback functions. These functions allow the sample framework to notify
// the application about device changes, user input, and windows messages. The
// callbacks are optional so you need only set callbacks for events you're interested
// in. However, if you don't handle the device reset/lost callbacks then the sample
// framework won't be able to reset your device since the application must first
// release all device resources before resetting. Likewise, if you don't handle the
// device created/destroyed callbacks then the sample framework won't be able to
// recreate your device resources.
sampleFramework.Disposing += new EventHandler(sample.OnDestroyDevice);
sampleFramework.DeviceLost += new EventHandler(sample.OnLostDevice);
sampleFramework.DeviceCreated += new DeviceEventHandler(sample.OnCreateDevice);
sampleFramework.DeviceReset += new DeviceEventHandler(sample.OnResetDevice);
sampleFramework.SetWndProcCallback(new WndProcCallback(sample.OnMsgProc));
sampleFramework.SetCallbackInterface(sample);
try
{
// Show the cursor and clip it when in full screen
sampleFramework.SetCursorSettings(true, true);
// Initialize
sample.InitializeApplication();
// Initialize the sample framework and create the desired window and Direct3D
// device for the application. Calling each of these functions is optional, but they
// allow you to set several options which control the behavior of the sampleFramework.
sampleFramework.Initialize(true, true, true); // Parse the command line, handle the default hotkeys, and show msgboxes
sampleFramework.CreateWindow("SpriteSample");
// Hook the keyboard event
sampleFramework.Window.KeyDown += new System.Windows.Forms.KeyEventHandler(sample.OnKeyEvent);
sampleFramework.CreateDevice(0, true, Framework.DefaultSizeWidth, Framework.DefaultSizeHeight,
sample);
// Pass control to the sample framework for handling the message pump and
// dispatching render calls. The sample framework will call your FrameMove
// and FrameRender callback when there is idle time between handling window messages.
sampleFramework.MainLoop();
}
#if(DEBUG)
catch (Exception e)
{
// In debug mode show this error (maybe - depending on settings)
sampleFramework.DisplayErrorMessage(e);
#else
catch
{
// In release mode fail silently
#endif
// Ignore any exceptions here, they would have been handled by other areas
return (sampleFramework.ExitCode == 0) ? 1 : sampleFramework.ExitCode; // Return an error code here
}
// Perform any application-level cleanup here. Direct3D device resources are released within the
// appropriate callback functions and therefore don't require any cleanup code here.
return sampleFramework.ExitCode;
}
}
*/
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -