-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the way objects were stored making it easier for the user.
- Loading branch information
Showing
6 changed files
with
90 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Drawing; | ||
using Vanilla3DEngine.Classes; | ||
using Vanilla3DEngine.Structs; | ||
|
||
namespace Vanilla3DEngine { | ||
public class BasicExample : Engine{ | ||
public BasicExample(Size screenSize, string title) : base(screenSize, title) { | ||
} | ||
|
||
private readonly GameObject sphere = new GameObject(Mesh.SphereHighPoly) { | ||
Transform = new Transform() { Pos = new Vector3(2.5f, 0f, 0f) }, | ||
Dynamic = false | ||
}; | ||
private readonly GameObject cube = new GameObject(Mesh.Cube) { | ||
Transform = new Transform() { Pos = new Vector3(-2.5f, 0f, 0f) }, | ||
Dynamic = false | ||
}; | ||
|
||
// You can either instantiate an object and have it stored and rendered until | ||
// you remove it, or just Draw a certain object. | ||
public override void Awake() { | ||
Instantiate(cube, 0); | ||
} | ||
|
||
public override void Update(Graphics g, float deltaTime) { | ||
HandleInput(); | ||
g.DrawString("Press F to show a sphere", ScreenTextFont, ScreenTextBrush, 0, 0); | ||
if (Input.GetKeyDown('F')) DrawObject(sphere); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters