本文整理汇总了C#中GraphicsDeviceManager类的典型用法代码示例。如果您正苦于以下问题:C# GraphicsDeviceManager类的具体用法?C# GraphicsDeviceManager怎么用?C# GraphicsDeviceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GraphicsDeviceManager类属于命名空间,在下文中一共展示了GraphicsDeviceManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
public void LoadContent(ContentManager content, GraphicsDeviceManager graphicsDeviceManager)
{
texture = content.Load<Texture2D>("brick_texture_map");
wall = new VertexPositionTexture[22];
wall[0] = new VertexPositionTexture(new Vector3(200, 0, 200), new Vector2(0, 0));
wall[1] = new VertexPositionTexture(new Vector3(200, 200, 200), new Vector2(2, 0));
wall[2] = new VertexPositionTexture(new Vector3(0, 0, 200), new Vector2(0, 2));
wall[3] = new VertexPositionTexture(new Vector3(0, 200, 200), new Vector2(2, 2));
wall[4] = new VertexPositionTexture(new Vector3(0, 0, 220), new Vector2(0, 0));
wall[5] = new VertexPositionTexture(new Vector3(0, 200, 220), new Vector2(2, 0));
wall[6] = new VertexPositionTexture(new Vector3(200, 0, 220), new Vector2(0, 2));
wall[7] = new VertexPositionTexture(new Vector3(200, 200, 220), new Vector2(2, 2));
wall[8] = new VertexPositionTexture(new Vector3(200, 0, 200), new Vector2(0, 0));
wall[9] = new VertexPositionTexture(new Vector3(200, 200, 220), new Vector2(2, 0));
wall[10] = new VertexPositionTexture(new Vector3(200, 200, 200), new Vector2(2, 2));
wall[11] = new VertexPositionTexture(new Vector3(0, 200, 220), new Vector2(0, 2));
wall[12] = new VertexPositionTexture(new Vector3(0, 200, 200), new Vector2(0, 0));
// Set vertex data in VertexBuffer
vertexBuffer = new VertexBuffer(graphicsDeviceManager.GraphicsDevice, typeof(VertexPositionTexture), wall.Length, BufferUsage.None);
vertexBuffer.SetData(wall);
// Initialize the BasicEffect
effect = new BasicEffect(graphicsDeviceManager.GraphicsDevice);
}
示例2: TrueCraftGame
public TrueCraftGame(MultiplayerClient client, IPEndPoint endPoint)
{
Window.Title = "TrueCraft";
Content.RootDirectory = "Content";
Graphics = new GraphicsDeviceManager(this);
Graphics.SynchronizeWithVerticalRetrace = false;
Graphics.IsFullScreen = UserSettings.Local.IsFullscreen;
Graphics.PreferredBackBufferWidth = UserSettings.Local.WindowResolution.Width;
Graphics.PreferredBackBufferHeight = UserSettings.Local.WindowResolution.Height;
Client = client;
EndPoint = endPoint;
NextPhysicsUpdate = DateTime.MinValue;
ChunkMeshes = new List<Mesh>();
IncomingChunks = new ConcurrentBag<Mesh>();
PendingMainThreadActions = new ConcurrentBag<Action>();
MouseCaptured = true;
var keyboardComponent = new KeyboardComponent(this);
KeyboardComponent = keyboardComponent;
Components.Add(keyboardComponent);
var mouseComponent = new MouseComponent(this);
MouseComponent = mouseComponent;
Components.Add(mouseComponent);
}
示例3: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = 835;
graphics.PreferredBackBufferHeight = 480;
Content.RootDirectory = "Content";
}
示例4: FieldPong
public FieldPong()
{
graphics = new GraphicsDeviceManager(this);
content = new ContentManager(Services);
graphics.PreferredBackBufferWidth = 1024;
graphics.PreferredBackBufferHeight = 768;
graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0;
graphics.SynchronizeWithVerticalRetrace = true;
physicsSimulator = new PhysicsSimulator(new Vector2(0));
physicsSimulator.AllowedPenetration = 0.3f;
physicsSimulator.BiasFactor = 1.0f;
Services.AddService(typeof(PhysicsSimulator), physicsSimulator);
screenManager = new ScreenManager(this);
Components.Add(screenManager);
bloomProcessor = new BloomPostProcessor(this);
Components.Add(bloomProcessor);
// Uncomment this to monitor the FPS:
//fpsCounter = new FrameRateCounter(this);
//Components.Add(fpsCounter);
audioEngine = new AudioEngine("Content\\Audio\\FieldPongAudio.xgs");
waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");
backgroundMusic = soundBank.GetCue("GameSong0010 16 Bit");
backgroundMusic.Play();
}
示例5: Game1
public Game1(IntPtr drawSurface)
{
Logger.Instance.log("Game1 creation started.");
Instance = this;
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = 800;
graphics.PreferredBackBufferHeight = 600;
Content.RootDirectory = "Content";
Logger.Instance.log("Creating Winform.");
this.drawSurface = drawSurface;
graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
winform = (Forms.Form)Forms.Form.FromHandle(Window.Handle);
winform.VisibleChanged += new EventHandler(Game1_VisibleChanged);
winform.Size = new System.Drawing.Size(10, 10);
Mouse.WindowHandle = drawSurface;
resizebackbuffer(MainForm.Instance.pictureBox1.Width, MainForm.Instance.pictureBox1.Height);
winform.Hide();
Logger.Instance.log("Winform created.");
Logger.Instance.log("Game1 creation ended.");
}
示例6: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
Components.Add(new GamerServicesComponent(this));
}
示例7: Limak
public Limak()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredBackBufferWidth = 820;
graphics.PreferredBackBufferHeight = 460;
}
示例8: TTRGame
public TTRGame()
{
Content.RootDirectory = "Content";
// create the TTengine for this game
TTengineMaster.Create(this);
// basic XNA graphics init here (before Initialize() and LoadContent() )
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = preferredWindowWidth;
graphics.PreferredBackBufferHeight = preferredWindowHeight;
#if RELEASE
graphics.IsFullScreen = true;
#else
graphics.IsFullScreen = false;
#endif
//this.TargetElapsedTime = TimeSpan.FromMilliseconds(10);
#if PROFILE
this.IsFixedTimeStep = false;
graphics.SynchronizeWithVerticalRetrace = false;
#else
this.IsFixedTimeStep = false;
graphics.SynchronizeWithVerticalRetrace = true;
#endif
}
示例9: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = screenWidth;
graphics.PreferredBackBufferHeight = screenHeight;
ScreenRectangle = new Rectangle(
0,
0,
screenWidth,
screenHeight);
Content.RootDirectory = "Content";
Components.Add(new InputHandler(this));
stateManager = new GameStateManager(this);
Components.Add(stateManager);
TitleScreen = new TitleScreen(this, stateManager);
StartMenuScreen = new StartMenuScreen(this, stateManager);
GamePlayScreen = new GamePlayScreen(this, stateManager);
CharacterGeneratorScreen = new CharacterGeneratorScreen(this, stateManager);
LoadGameScreen = new LoadGameScreen(this, stateManager);
SkillScreen = new GameScreens.SkillScreen(this, stateManager);
stateManager.ChangeState(TitleScreen);
this.IsFixedTimeStep = false;
graphics.SynchronizeWithVerticalRetrace = false;
}
示例10: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
map.Open(@"C:\Users\Stephen\Dropbox\Map Editor\New Maps\Fried.adm");
}
示例11: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
IsMouseVisible = true;
}
示例12: BalloonFW
public BalloonFW()
{
Content.RootDirectory = "Content";
graphics = new GraphicsDeviceManager(this);
inputHelper = new InputHelper();
this.IsMouseVisible = true;
}
示例13: Game1
public Game1()
: base()
{
graphics = new GraphicsDeviceManager(this);
scene = new GameScene(this);
Content.RootDirectory = "Content";
}
示例14: MainGame
public MainGame()
{
this.IsMouseVisible = true;
graphics = new GraphicsDeviceManager(this);
this.graphics.PreparingDeviceSettings += this.GraphicsDevicePreparingDeviceSettings;
Content.RootDirectory = "Content";
this.chooser = new Kinect(this, ColorImageFormat.RgbResolution640x480Fps30, DepthImageFormat.Resolution640x480Fps30);
this.Services.AddService(typeof(Kinect), this.chooser);
this.Components.Add(this.chooser);
this.statusCheck = new KinectStatusCheck(this);
this.Components.Add(this.statusCheck);
this.depthComponent = new DepthStreamRenderer(this);
this.plane = new Plane(this);
this.Components.Add(this.plane);
UpdateStreamSizeAndLocation();
// Obliczenia
a = 7;
b = 3;
sum1 = Add(true);
b1 = BasicTest();
sum2 = Add(false);
b2 = BasicTest();
}
示例15: Camera
public Camera(GraphicsDeviceManager grph)
{
zoom = 1.0f;
rotation = 0.0f;
pos = Vector2.Zero;
graphics = grph;
}