Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
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 
14 {
15 private:
17  SDL_Texture* textureData;
22 
23 public:
32  JAM_Texture(SDL_Renderer* renderer, int r, int g, int b);
33 
40  JAM_Texture(std::string fileLocation, SDL_Renderer* renderer);
41 
50  JAM_Texture(std::string fileLocation, SDL_Renderer* renderer, bool magentaAlpha);
51 
55  ~JAM_Texture();
56 
61  SDL_Texture* getTexture();
62 
67  int getWidth();
68 
73  int getHeight();
74 
81  void pushToScreen(SDL_Renderer* renderer, int x, int y);
82 
92  void pushToScreen(SDL_Renderer* renderer, int x, int y, int width, int height);
93 
104  void pushSpriteToScreen(SDL_Renderer* renderer, int x, int y, int srcX, int srcY, int srcWidth, int srcHeight);
105 
119  void pushSpriteToScreen(SDL_Renderer* renderer, int x, int y, int srcX, int srcY, int srcWidth, int srcHeight, int width, int height);
120 };
SDL_Texture * getTexture()
Definition: Texture.cpp:99
~JAM_Texture()
Definition: Texture.cpp:90
JAM_Texture(SDL_Renderer *renderer, int r, int g, int b)
Definition: Texture.cpp:6
SDL_Texture * textureData
Definition: Texture.h:17
Creates a Texture for use with a renderer. Creates a Texture from an image file, this can then be use...
Definition: Texture.h:13
int textureHeight
Definition: Texture.h:21
int getHeight()
Definition: Texture.cpp:117
int getWidth()
Definition: Texture.cpp:108
int textureWidth
Definition: Texture.h:19
void pushToScreen(SDL_Renderer *renderer, int x, int y)
Definition: Texture.cpp:126
void pushSpriteToScreen(SDL_Renderer *renderer, int x, int y, int srcX, int srcY, int srcWidth, int srcHeight)
Definition: Texture.cpp:160