Refactored, and added separate constructor for custom shader.
This commit is contained in:
@@ -17,7 +17,7 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
{
|
||||
private WindowContext window;
|
||||
private Camera2D camera;
|
||||
private MeshBatch batch;
|
||||
private MeshBatchRenderer renderer;
|
||||
private BitmapFont font;
|
||||
private Texture logoTexture, fillerTexture;
|
||||
private RectangleMesh logo, textureTester, untextured;
|
||||
@@ -40,7 +40,7 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
logoTexture.Dispose();
|
||||
fillerTexture.Dispose();
|
||||
font.Dispose();
|
||||
batch.Dispose();
|
||||
renderer.Dispose();
|
||||
window.Dispose();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
Vector2 drawableDimensions = window.GetDrawableDimensions();
|
||||
float ratio = drawableDimensions.Y / drawableDimensions.X;
|
||||
camera = new Camera2D(2f, ratio * 2f);
|
||||
batch = new MeshBatch(camera, BatchVertexSize: 2048);
|
||||
renderer = new MeshBatchRenderer(camera, BatchVertexSize: 2048);
|
||||
|
||||
logoTexture = TextureLoader.Load2DTexture("Resources/Playground/yhdnbgnc.png");
|
||||
logo = new RectangleMesh(logoTexture, Color.White);
|
||||
@@ -84,12 +84,12 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
|
||||
public void Render(double delta)
|
||||
{
|
||||
batch.Begin(Matrix4x4.Identity, delta);
|
||||
batch.Draw(logo);
|
||||
batch.Draw(textureTester);
|
||||
batch.Draw(untextured);
|
||||
font.WriteLine(batch, 0.25f, -0.35f, "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n1234567890", Color.White);
|
||||
batch.End();
|
||||
renderer.Begin(Matrix4x4.Identity, delta);
|
||||
renderer.Draw(logo);
|
||||
renderer.Draw(textureTester);
|
||||
renderer.Draw(untextured);
|
||||
font.WriteLine(renderer, 0.25f, -0.35f, "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n1234567890", Color.White);
|
||||
renderer.End();
|
||||
}
|
||||
|
||||
public void Update(double timeStep)
|
||||
|
Reference in New Issue
Block a user