line abstraction for entity class

This commit is contained in:
plane000
2018-09-29 16:03:27 +01:00
parent 6a470f4457
commit d0d649df9d
7 changed files with 41 additions and 36 deletions

View File

@@ -19,6 +19,10 @@ int main(int argc, char** argv) {
outlineBox.SetDrawColour(Vec4(0x00, 0xFF, 0x00, 0xFF));
outlineBox.SetRect(Vec2(SCREEN_WIDTH / 6, SCREEN_HEIGHT / 6), Vec2(SCREEN_WIDTH * 2 / 3, SCREEN_HEIGHT * 2 / 3));
Entity lineMesh("line mesh", game.SDLRenderer, PolyDrawType::DRAW_LINES);
lineMesh.SetDrawColour(Vec4(0x00, 0x00, 0xFF, 0xFF));
lineMesh.AddVecPoint(Vec4(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
while (!game.IsDisplayClosed()) {
game.PollEvents();
@@ -28,6 +32,7 @@ int main(int argc, char** argv) {
game.RenderEntity(&box);
game.RenderEntity(&outlineBox);
game.RenderEntity(&lineMesh);
game.RenderUpdate();
}