Kemena3D
Loading...
Searching...
No Matches
ktexture2d.h
Go to the documentation of this file.
1
5
6#ifndef KTEXTURE2D_H
7#define KTEXTURE2D_H
8
9#include "kexport.h"
10
11#include "ktexture.h"
12
13namespace kemena
14{
22 {
23 public:
28
32 virtual ~kTexture2D();
33
38 void setWidth(int newWidth);
39
44 int getWidth();
45
50 void setHeight(int newHeight);
51
56 int getHeight();
57
62 void setChannels(int newChannel);
63
69
74 void setData(unsigned char *newData);
75
80 unsigned char *getData();
81
82 protected:
83 private:
84 int width;
85 int height;
86 int channels;
87
88 GLuint textureID;
89 kString textureName;
90
91 unsigned char *data;
92 };
93}
94
95#endif // KTEXTURE2D_H
virtual ~kTexture2D()
Destroys the 2D texture and releases any retained CPU-side pixel data.
kTexture2D()
Constructs an empty 2D texture with zeroed metadata and no pixel data.
void setChannels(int newChannel)
Sets the number of colour channels.
unsigned char * getData()
Returns the CPU-side pixel data pointer.
int getChannels()
Returns the number of colour channels.
int getWidth()
Returns the texture width in pixels.
void setWidth(int newWidth)
Sets the texture width.
int getHeight()
Returns the texture height in pixels.
void setData(unsigned char *newData)
Stores a pointer to the CPU-side pixel data.
void setHeight(int newHeight)
Sets the texture height.
kTexture()
Constructs an empty texture with no GPU handle assigned.
Symbol visibility / linkage macro for the Kemena3D library.
#define KEMENA3D_API
Definition kexport.h:35
Base class for GPU texture objects.
Top-level Kemena3D engine namespace.
Definition kanimation.h:23
std::string kString
Standard string alias.
Definition kdatatype.h:42