diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-11 20:49:49 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-11 20:49:49 +0100 |
commit | 3d97f7c60536bf14f314cc703883f74345aacd21 (patch) | |
tree | 200fcd5cde2b30e0de262e9a3dcc223874d2bd28 /src/crepe/facade | |
parent | 141c4831be82654a692d03fdb0fbf87fa27dea88 (diff) |
rendering particle
Diffstat (limited to 'src/crepe/facade')
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 4 | ||||
-rw-r--r-- | src/crepe/facade/SDLContext.h | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index e87a2c5..cc2e2f8 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -181,12 +181,12 @@ SDLContext::texture_from_path(const std::string & path) { return img_texture; } -int SDLContext::get_width(const Texture & ctx) const { +int SDLContext::get_width(const Texture & ctx) { int w; SDL_QueryTexture(ctx.texture.get(), NULL, NULL, &w, NULL); return w; } -int SDLContext::get_height(const Texture & ctx) const { +int SDLContext::get_height(const Texture & ctx) { int h; SDL_QueryTexture(ctx.texture.get(), NULL, NULL, NULL, &h); return h; diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index e358c21..7329b74 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -10,6 +10,7 @@ #include "../api/Sprite.h" #include "../api/Transform.h" #include "api/Camera.h" +#include "api/Vector2.h" // FIXME: this needs to be removed const int SCREEN_WIDTH = 640; @@ -97,14 +98,14 @@ private: * \param texture Reference to the Texture object. * \return Width of the texture as an integer. */ - int get_width(const Texture &) const; + int get_width(const Texture &) ; /** * \brief Gets the height of a texture. * \param texture Reference to the Texture object. * \return Height of the texture as an integer. */ - int get_height(const Texture &) const; + int get_height(const Texture &) ; private: //! Will use draw,clear_screen, present_screen, camera. @@ -119,6 +120,8 @@ private: void draw(const Sprite & sprite, const Transform & transform, const Camera & camera); + void draw_particle(const Vector2 & pos, const Camera & camera); + //! Clears the screen, preparing for a new frame. void clear_screen(); |