46 lines
842 B
C++
46 lines
842 B
C++
#ifndef __TEXTURE_H_INCLUDED__
|
|
#define __TEXTURE_H_INCLUDED__
|
|
|
|
#include<iostream>
|
|
#include<string>
|
|
|
|
#include<SDL.h>
|
|
#include<SDL_image.h>
|
|
#include<SDL_ttf.h>
|
|
|
|
class PSX_Texture{
|
|
public:
|
|
PSX_Texture();
|
|
PSX_Texture(SDL_Renderer* render);
|
|
//PSX_Texture(SDL_Renderer* render, std::string path);
|
|
~PSX_Texture();
|
|
|
|
void loadTexture(std::string path);
|
|
void loadText(std::string text, SDL_Color color, std::string path, int size);
|
|
|
|
void setRenderer(SDL_Renderer* renderer);
|
|
|
|
void render(SDL_Rect* quad, SDL_Rect* frame);
|
|
void render(SDL_Rect* quad);
|
|
void render(int x, int y);
|
|
|
|
int getW();
|
|
int getH();
|
|
std::string getPath();
|
|
private:
|
|
std::string imgPath;
|
|
|
|
SDL_Texture* texture;
|
|
SDL_Renderer* renderer;
|
|
|
|
void loadFromSurface(SDL_Surface* surface);
|
|
|
|
void free();
|
|
|
|
int w, h;
|
|
|
|
SDL_Color textColor;
|
|
};
|
|
|
|
#endif
|