aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/SDLContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/facade/SDLContext.h')
-rw-r--r--src/crepe/facade/SDLContext.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h
index 20e30b3..35d667d 100644
--- a/src/crepe/facade/SDLContext.h
+++ b/src/crepe/facade/SDLContext.h
@@ -9,9 +9,9 @@
#include <memory>
#include <string>
+#include "../api/Camera.h"
#include "../api/Sprite.h"
#include "../api/Transform.h"
-#include "api/Camera.h"
#include "types.h"
@@ -100,14 +100,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 & texture) const;
/**
* \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 & texture) const;
private:
//! Will use draw,clear_screen, present_screen, camera.
@@ -117,12 +117,21 @@ private:
* \brief Draws a sprite to the screen using the specified transform and camera.
* \param sprite Reference to the Sprite to draw.
* \param transform Reference to the Transform for positioning.
- * \param camera Reference to the Camera for view adjustments.
+ * \param cam camera of the current scene
*/
- void draw(const Sprite & sprite, const Transform & transform, const Camera & camera);
+ void draw(const Sprite & sprite, const Transform & transform, const Camera & cam);
+ /**
+ * \brief Draws a particle to the screen using the specified parameters
+ *
+ * \param sprite Referenceto the sprite to draw
+ * \param pos particle position in world units
+ * \param angle particle angle in degrees
+ * \param img_scale scalar multiplier to increase image size
+ * \param cam camera of the current scene
+ */
void draw_particle(const Sprite & sprite, const vec2 & pos, const double & angle,
- const double & scale, const Camera & camera);
+ const double & img_scale, const Camera & cam);
//! Clears the screen, preparing for a new frame.
void clear_screen();
@@ -144,18 +153,18 @@ private:
* \return sdl rectangle to draw a src image
*/
SDL_Rect get_src_rect(const Sprite & sprite) const;
+
/**
- * \brief calculates the sqaure size of the image for an destination
+ * \brief calculates the sqaure size of the image for destination
*
- * \param sprite Reference to the sprite to calculate the rectangle
- * \param pos the pos in pixel positions
- * \param scale the multiplier to increase of decrease for the specified sprite
- * \param cam Reference to the current camera in the scene to calculate the position based
- * on the camera
+ * \param sprite Reference to the sprite to calculate rectangle
+ * \param pos the pos in world units
+ * \param cam the camera of the current scene
+ * \param img_scale the image multiplier for increasing img size
* \return sdl rectangle to draw a dst image to draw on the screen
*/
- SDL_Rect get_dst_rect(const Sprite & sprite, const vec2 & pos, const double & scale,
- const Camera & cam) const;
+ SDL_Rect get_dst_rect(const Sprite & sprite, const vec2 & pos, const Camera & cam,
+ const double & img_scale) const;
private:
//! sdl Window
@@ -163,9 +172,6 @@ private:
//! renderer for the crepe engine
std::unique_ptr<SDL_Renderer, std::function<void(SDL_Renderer *)>> game_renderer;
-
- //! viewport for the camera window
- SDL_Rect viewport = {0, 0, 640, 480};
};
} // namespace crepe