BARE2D
BARE2D::GLContext Class Reference

#include <GLContextManager.hpp>

+ Collaboration diagram for BARE2D::GLContext:

Public Member Functions

 GLContext ()
 
 ~GLContext ()
 
void setActiveTexture (GLenum texture)
 Sets the active texture "slot". This can be GL_TEXTURE0 to GL_TEXTURE8 (I think. Check the literature) More...
 
void bindTexture (GLenum target, GLenum texture)
 Binds a texture to target in the currently active texture slot. More...
 
void unbindTexture (GLenum target, GLenum textureslot)
 Unbinds a texture. More...
 
GLuint getBoundTexture ()
 

Private Attributes

GLenum m_activeTexture = GL_TEXTURE0
 
GLuint * m_boundTextureIDs = nullptr
 

Detailed Description

Definition at line 7 of file GLContextManager.hpp.

Constructor & Destructor Documentation

◆ GLContext()

BARE2D::GLContext::GLContext ( )

Definition at line 5 of file GLContextManager.cpp.

References m_boundTextureIDs.

◆ ~GLContext()

BARE2D::GLContext::~GLContext ( )

Definition at line 9 of file GLContextManager.cpp.

References m_boundTextureIDs.

Member Function Documentation

◆ bindTexture()

void BARE2D::GLContext::bindTexture ( GLenum  target,
GLenum  texture 
)

Binds a texture to target in the currently active texture slot.

Parameters
targetThe target to bind to
textureThe id of a texture.

Definition at line 22 of file GLContextManager.cpp.

References m_activeTexture, and m_boundTextureIDs.

Referenced by BARE2D::FBORenderer::bind(), BARE2D::ResourceManager::createMutableTexture(), BARE2D::FBORenderer::createTextures(), BARE2D::TexturelessRenderer::init(), BARE2D::Font::init(), BARE2D::ResourceManager::loadTexture(), BARE2D::FBORenderer::preRender(), BARE2D::BumpyRenderer::render(), BARE2D::Renderer::render(), BARE2D::MutableTexture::setData(), and unbindTexture().

+ Here is the caller graph for this function:

◆ getBoundTexture()

GLuint BARE2D::GLContext::getBoundTexture ( )

Definition at line 37 of file GLContextManager.cpp.

References m_activeTexture, and m_boundTextureIDs.

◆ setActiveTexture()

void BARE2D::GLContext::setActiveTexture ( GLenum  texture)

Sets the active texture "slot". This can be GL_TEXTURE0 to GL_TEXTURE8 (I think. Check the literature)

Parameters
textureThe texture slot to tell OpenGL is "active"

Definition at line 13 of file GLContextManager.cpp.

References m_activeTexture.

Referenced by BARE2D::FBORenderer::bind(), BARE2D::FBORenderer::createTextures(), BARE2D::FBORenderer::preRender(), BARE2D::BumpyRenderer::render(), BARE2D::FBORenderer::render(), BARE2D::Renderer::render(), BARE2D::DebugRenderer::render(), and unbindTexture().

+ Here is the caller graph for this function:

◆ unbindTexture()

void BARE2D::GLContext::unbindTexture ( GLenum  target,
GLenum  textureslot 
)

Unbinds a texture.

Parameters
targetThe target (GL_TEXTURE_2D generally)
textureslotThe texture to be unbound (GL_TEXTURE0-8)

Definition at line 32 of file GLContextManager.cpp.

References bindTexture(), and setActiveTexture().

Referenced by BARE2D::FBORenderer::unbind().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ m_activeTexture

GLenum BARE2D::GLContext::m_activeTexture = GL_TEXTURE0
private

Definition at line 35 of file GLContextManager.hpp.

Referenced by bindTexture(), getBoundTexture(), and setActiveTexture().

◆ m_boundTextureIDs

GLuint* BARE2D::GLContext::m_boundTextureIDs = nullptr
private

Definition at line 38 of file GLContextManager.hpp.

Referenced by bindTexture(), getBoundTexture(), GLContext(), and ~GLContext().


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