#include <gl_texture.h>
Texture interface.
Definition at line 17 of file gl_texture.h.
◆ gl_texture_2d()
- OpenGL texture constructor by image container.
- Parameters
-
Image | - image container to get data from (pixels data can be null). |
Type | - texture type. |
- Returns
- created texture pointer.
Definition at line 56 of file gl_texture.cpp.
57{
58 this->
Width = Image.GetWidth();
59 this->
Height = Image.GetHeight();
60
61 switch (Type)
62 {
66 }
67
69}
#define SCL_CORE_ASSERT(expr,...)
#define SCL_CORE_SUCCES(...)
◆ ~gl_texture_2d()
scl::gl_texture_2d::~gl_texture_2d |
( |
| ) |
|
|
override |
◆ Bind()
void scl::gl_texture_2d::Bind |
( |
u32 |
Slot | ) |
const |
|
overridevirtual |
- Bind texture to current render stage function.
- Parameters
-
- Returns
- None.
Implements scl::texture_2d.
Definition at line 76 of file gl_texture.cpp.
77{
78 if (Id == 0) return;
79
80 this->Slot = Slot;
81 glActiveTexture(GL_TEXTURE0 + Slot);
82 glBindTexture(GL_TEXTURE_2D, Id);
83}
◆ Free()
void scl::gl_texture_2d::Free |
( |
| ) |
|
|
overridevirtual |
- Unload texture from GPU memory function.
- Parameters
-
- Returns
- None.
Implements scl::texture_2d.
Definition at line 91 of file gl_texture.cpp.
92{
93 if (Id == 0) return;
94
95 glDeleteTextures(1, &Id);
96 Id = 0;
97}
◆ GetHandle()
render_primitive::handle scl::gl_texture_2d::GetHandle |
( |
| ) |
const |
|
inlineoverride |
OpenGL texture getter/setter functions.
Backend api render primitive hadnle getter function.
Definition at line 25 of file gl_texture.h.
◆ GetImage()
- Load texture image from GPU memory function.
- Parameters
-
- Returns
- texture image.
Implements scl::texture_2d.
Definition at line 99 of file gl_texture.cpp.
100{
101
102 return image();
103}
◆ Unbind()
void scl::gl_texture_2d::Unbind |
( |
| ) |
const |
|
overridevirtual |
- Unbind texture from current render stage function.
- Parameters
-
- Returns
- None.
Implements scl::texture_2d.
Definition at line 85 of file gl_texture.cpp.
86{
87 glActiveTexture(GL_TEXTURE0 + this->Slot);
88 glBindTexture(GL_TEXTURE_2D, 0);
89}
The documentation for this class was generated from the following files: