Untitled Game engine no.5  1.0
Public Member Functions | List of all members
Engine::GLTexture2D Class Reference

#include <GLTexture.hpp>

Inheritance diagram for Engine::GLTexture2D:
Inheritance graph
[legend]
Collaboration diagram for Engine::GLTexture2D:
Collaboration graph
[legend]

Public Member Functions

 GLTexture2D (const std::string &path)
 
 GLTexture2D (stbi_uc *data, const int &w, const int &h)
 
uint32_t getID () const override
 Texture id - an id link to the texture.
 
float getWidth () const override
 visual width of the texture in game dimensions
 
float getHeight () const override
 visual height of the texture in game dimensions
 
void setWidth (float width) override
 visual width of the texture in game dimensions
 
void setHeight (float height) override
 visual height of the texture in game dimensions
 
void setSize (float width, float height) override
 visual size of the texture in game dimensions
 
void setID (uint32_t id) override
 set texture id
 
void Bind (uint32_t slot=0) const override
 
Ref< TextureMapgetDefaultMapping () const override
 Get the texture mapping.
 
void loadTextureData (stbi_uc *data, int w, int h, uint type=GL_RGBA) override
 
- Public Member Functions inherited from Engine::Texture2D
virtual Ref< TexturegenClip (uint32_t width, uint32_t height, uint32_t x, uint32_t y) const
 generate a clipped texture from texture coordinates
 

Additional Inherited Members

- Static Public Member Functions inherited from Engine::Texture2D
static Ref< Texture2DCreate (const std::string &path)
 Generate a texture from a string path.
 
static Ref< Texture2DCreate ()
 
- Public Attributes inherited from Engine::Texture
int renderSlot = -1
 

Detailed Description

OpenGl wrapper for a 2D texture.

Constructor & Destructor Documentation

◆ GLTexture2D()

Engine::GLTexture2D::GLTexture2D ( const std::string &  path)

Creates a texture from an image

Parameters
pathto the image to use

Member Function Documentation

◆ Bind()

void Engine::GLTexture2D::Bind ( uint32_t  slot = 0) const
overridevirtual

Bind texture data using the id and a current slot

Parameters
slotto bind texture to

Reimplemented from Engine::Texture.


The documentation for this class was generated from the following files: