Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
texture.h
1#pragma once
2#include <string>
3#include <meteorutils/vector2d.h>
4#include <rendering/renderer.h>
5#include <entities/entity.h>
6#include <SDL.h>
7
8namespace meteor {
12 class MTexture : public MEntity {
13 public:
18 MTexture(std::string path);
19 ~MTexture();
24 inline std::string getSrcPath() { return srcPath; }
29 inline SDL_Texture* getCoreTexture() { return coreTexture; }
34 inline SVector2 getSize() { return size; }
38 inline bool valid() { return isValid; }
50 static void setGenerationRenderer(MRenderer* renderer) { texGenRenderer = renderer; }
51 private:
52 SVector2 size;
53 std::string srcPath;
54 SDL_Texture* coreTexture;
55 static MRenderer* texGenRenderer;
56 bool isValid;
57 };
58}
An Entity is the base class for all data and behaviour oriented objects in meteor....
Definition entity.h:9
Renderer handles all render related tasks in meteor. Renderer uses the render-queue to render each co...
Definition renderer.h:11
This class holds an image that can be rendererd to the screen.
Definition texture.h:12
static void setGenerationRenderer(MRenderer *renderer)
Sets the internal renderer used for texture generation. DO NOT TOUCH or INVOKE!!
Definition texture.h:50
bool valid()
Definition texture.h:38
MTexture(std::string path)
Constructor.
std::string getSrcPath()
Gets the img source path in disk.
Definition texture.h:24
static bool initialiseTextureLoader()
Initialised the SDL texture loader DO NOT TOUCH or INVOKE!!
SDL_Texture * getCoreTexture()
get the internal SDL Texture implementation
Definition texture.h:29
SVector2 getSize()
returns the size of Texture in pixel
Definition texture.h:34
A structure representing a 2D Vector.
Definition vector2d.h:11