TeaPacket v0.0.1
Multiplatform Game Engine
Loading...
Searching...
No Matches
Texture.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "Platform/Graphics/PlatformTexture.hpp"
6
8{
14
21
27
28
29 class Texture
30 {
31 public:
32 unsigned short width;
33 unsigned short height;
37
38
39 PlatformTexture platformTexture;
40
43 void Initialize(const unsigned char* data);
44 private:
45 void Pl_Initialize(const unsigned char* data);
46 public:
53 static Texture CreateTexture(const unsigned char* data, unsigned short width, unsigned short height,
55
56 static constexpr std::vector<unsigned char> GetFormatChannelSizes(TextureFormat format){
57 switch (format)
58 {
59 case TEXTURE_FORMAT_RGBA8: return {8,8,8,8};
60 case TEXTURE_FORMAT_RGB8: return {8,8,8};
61 }
62 throw std::exception();
63 }
64
65 private:
66 };
67}
Definition Texture.hpp:30
TextureFormat format
Definition Texture.hpp:36
void Initialize(const unsigned char *data)
static constexpr std::vector< unsigned char > GetFormatChannelSizes(TextureFormat format)
Definition Texture.hpp:56
TextureFilterType filterType
Definition Texture.hpp:34
unsigned short height
Definition Texture.hpp:33
static Texture CreateTexture(const unsigned char *data, unsigned short width, unsigned short height, TextureFilterType filterType=TEXTURE_FILTER_LINEAR, TextureWrapType wrapType=TEXTURE_WRAP_REPEAT)
unsigned short width
Definition Texture.hpp:32
TextureWrapType wrapType
Definition Texture.hpp:35
PlatformTexture platformTexture
Definition Texture.hpp:39
Functionality relating to drawing graphics to the screen.
Definition Display.hpp:9
TextureFormat
Definition Texture.hpp:23
@ TEXTURE_FORMAT_RGB8
Definition Texture.hpp:25
@ TEXTURE_FORMAT_RGBA8
Definition Texture.hpp:24
TextureWrapType
Definition Texture.hpp:16
@ TEXTURE_WRAP_MIRROR
Definition Texture.hpp:18
@ TEXTURE_WRAP_REPEAT
Definition Texture.hpp:17
@ TEXTURE_WRAP_CLAMP
Definition Texture.hpp:19
TextureFilterType
Definition Texture.hpp:10
@ TEXTURE_FILTER_LINEAR
Definition Texture.hpp:12
@ TEXTURE_FILTER_POINT
Definition Texture.hpp:11