-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngine.cs
More file actions
62 lines (51 loc) · 1.63 KB
/
Copy pathEngine.cs
File metadata and controls
62 lines (51 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using CubeRender.Models;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace CubeRender;
public class Engine : Game
{
private GraphicsDeviceManager _graphics;
private SpriteBatch _spriteBatch;
//private Triangle _triangle;
//private Quad _quad;
private Cube _cube;
public Engine()
{
_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
IsMouseVisible = true;
Window.AllowAltF4 = true;
//_graphics.PreferredBackBufferWidth = _graphics.GraphicsDevice.Viewport.Width;
//_graphics.PreferredBackBufferHeight = _graphics.GraphicsDevice.Viewport.Height;
}
protected override void Initialize()
{
// TODO: Add your initialization logic here
base.Initialize();
}
protected override void LoadContent()
{
_spriteBatch = new SpriteBatch(GraphicsDevice);
//_triangle = new Triangle(this);
//_quad = new Quad(this);
_cube = new Cube(this);
// TODO: use this.Content to load your game content here
}
protected override void Update(GameTime gameTime)
{
// TODO: Add your update logic here
Window.Title = $"CubeRender | FPS: {1 / gameTime.ElapsedGameTime.TotalSeconds:0.00}";
//_triangle.Update(gameTime);
_cube.Update(gameTime);
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.Black);
//_triangle.Draw();
//_quad.Draw();
_cube.Draw();
// TODO: Add your drawing code here
base.Draw(gameTime);
}
}