Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
C_Texture.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL.h>
4 #include <SDL_image.h>
5 #include <string>
6 #include "C_Vec2.h"
7 #include "C_Utilities.h"
8 
13 class C_Texture
14 {
15 public:
23  C_Texture(SDL_Renderer* renderer, int r, int g, int b);
24 
30  C_Texture(SDL_Renderer* renderer, SDL_Colour colour);
31 
37  C_Texture(std::string fileLocation, SDL_Renderer* renderer);
38 
45  C_Texture(std::string fileLocation, SDL_Renderer* renderer, bool magentaAlpha);
46 
50  ~C_Texture();
51 
56  SDL_Texture* getTexture();
57 
63 
69  void pushToScreen(SDL_Renderer* renderer, C_Vec2 pos);
70 
78  void pushToScreen(SDL_Renderer* renderer, C_Vec2 pos, C_Vec2 scale);
79 
88  void pushSpriteToScreen(SDL_Renderer* renderer, C_Vec2 pos, C_Vec2 spritePos, C_Vec2 spriteDimensions);
89 
100  void pushSpriteToScreen(SDL_Renderer* renderer, C_Vec2 pos, C_Vec2 scale, C_Vec2 spritePos, C_Vec2 spriteDimensions);
101 
108  void setColourTint(int r, int g, int b);
109 
114  void setColourTint(SDL_Colour colour);
115 
116 private:
118  SDL_Texture* textureData;
121 };
void pushSpriteToScreen(SDL_Renderer *renderer, C_Vec2 pos, C_Vec2 spritePos, C_Vec2 spriteDimensions)
Pushes the image to the Renderer at the XY Coordinates. Only displays the source rectangle inputed...
Definition: C_Texture.cpp:136
C_Texture(SDL_Renderer *renderer, int r, int g, int b)
Constructs the Texture using an RGB value. This will create a 1x1 rectangle of that colour that can b...
Definition: C_Texture.cpp:3
C_Vec2 getDimensions()
Gets the Texture dimensions.
Definition: C_Texture.cpp:105
Contains the Vec2 structure with functions and overloaded operators.
Definition: C_Vec2.h:7
~C_Texture()
Destructs Texture.
Definition: C_Texture.cpp:94
C_Vec2 dimensions
The Texture dimensions.
Definition: C_Texture.h:120
SDL_Texture * getTexture()
Gets a pointer to the Texture.
Definition: C_Texture.cpp:100
void setColourTint(int r, int g, int b)
Tints the texture with the inputed colour.
Definition: C_Texture.cpp:176
SDL_Texture * textureData
The Texture data.
Definition: C_Texture.h:118
void pushToScreen(SDL_Renderer *renderer, C_Vec2 pos)
Pushes the image to the Renderer at the XY Coordinates.
Definition: C_Texture.cpp:110
Creates a Texture for use with a renderer.
Definition: C_Texture.h:13