mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Added irrKlang.dll and ikpMP2.dll to dlls folder. Added irrKlang as a sub-folder under includes. Added irrKlang.lib to lib folder. At this point running cmake gave an error it couldn't find source files under 2d_game. Moved 2d_game source up one folder level, then cmake found the files.
21 lines
987 B
C++
21 lines
987 B
C++
/*******************************************************************
|
|
** This code is part of Breakout.
|
|
**
|
|
** Breakout is free software: you can redistribute it and/or modify
|
|
** it under the terms of the CC BY 4.0 license as published by
|
|
** Creative Commons, either version 4 of the License, or (at your
|
|
** option) any later version.
|
|
******************************************************************/
|
|
#include "game_object.h"
|
|
|
|
|
|
GameObject::GameObject()
|
|
: Position(0.0f, 0.0f), Size(1.0f, 1.0f), Velocity(0.0f), Color(1.0f), Rotation(0.0f), Sprite(), IsSolid(false), Destroyed(false) { }
|
|
|
|
GameObject::GameObject(glm::vec2 pos, glm::vec2 size, Texture2D sprite, glm::vec3 color, glm::vec2 velocity)
|
|
: Position(pos), Size(size), Velocity(velocity), Color(color), Rotation(0.0f), Sprite(sprite), IsSolid(false), Destroyed(false) { }
|
|
|
|
void GameObject::Draw(SpriteRenderer &renderer)
|
|
{
|
|
renderer.DrawSprite(this->Sprite, this->Position, this->Size, this->Rotation, this->Color);
|
|
} |