scg3  0.6
scg::Texture2DCore Class Reference

2D texture core. More...

#include "Texture2DCore.h"

Inheritance diagram for scg::Texture2DCore:
[legend]
Collaboration diagram for scg::Texture2DCore:
[legend]

Public Member Functions

 Texture2DCore ()
 
virtual ~Texture2DCore ()
 
void setTexture (GLsizei width, GLsizei height, const unsigned char *rgbaData, GLenum wrapModeS, GLenum wrapModeT, GLenum minFilter, GLenum magFilter)
 
void rotate2D (GLfloat angleDeg)
 
void scale2D (glm::vec2 scaling)
 
virtual void render (RenderState *renderState)
 
virtual void renderPost (RenderState *renderState)
 
- Public Member Functions inherited from scg::TextureCore
 TextureCore ()
 
virtual ~TextureCore ()=0
 
TextureCorerotate (GLfloat angleDeg, glm::vec3 axis)
 
TextureCorescale (glm::vec3 scaling)
 
TextureCoresetMatrix (glm::mat4 matrix)
 
- Public Member Functions inherited from scg::Core
 Core ()
 
virtual ~Core ()=0
 

Static Public Member Functions

static Texture2DCoreSP create ()
 

Additional Inherited Members

- Protected Attributes inherited from scg::TextureCore
GLuint tex_
 
GLint texOld_
 
glm::mat4 matrix_
 

Detailed Description

2D texture core.

Definition at line 39 of file Texture2DCore.h.

Constructor & Destructor Documentation

◆ Texture2DCore()

scg::Texture2DCore::Texture2DCore ( )

Constructor.

◆ ~Texture2DCore()

virtual scg::Texture2DCore::~Texture2DCore ( )
virtual

Destructor.

Member Function Documentation

◆ create()

static Texture2DCoreSP scg::Texture2DCore::create ( )
static

Create shared pointer.

◆ render()

virtual void scg::Texture2DCore::render ( RenderState renderState)
virtual

Render core, i.e., bind texture and post-multiply current texture matrix by local texture matrix.

Reimplemented from scg::TextureCore.

Reimplemented in scg::BumpMapCore.

◆ renderPost()

virtual void scg::Texture2DCore::renderPost ( RenderState renderState)
virtual

Render core after traversing sub-tree, i.e., restore previous texture matrix and bind previous texture.

Reimplemented from scg::TextureCore.

Reimplemented in scg::BumpMapCore.

◆ rotate2D()

void scg::Texture2DCore::rotate2D ( GLfloat  angleDeg)

Rotate texture around (0,0,1) axis (post-multiply local texture matrix by transformation).

Parameters
angleDegrotation angle (degrees)

◆ scale2D()

void scg::Texture2DCore::scale2D ( glm::vec2  scaling)

Scale texture in s and t direction (post-multiply local texture matrix by transformation).

Parameters
scalingscaling factors in s and t direction

◆ setTexture()

void scg::Texture2DCore::setTexture ( GLsizei  width,
GLsizei  height,
const unsigned char *  rgbaData,
GLenum  wrapModeS,
GLenum  wrapModeT,
GLenum  minFilter,
GLenum  magFilter 
)

Create texture from RGBA image with given parameters. If minFilter is GL_*_MIPMAP_* (see below), a mipmap is created from the given image.

Parameters
widthtexture width
heighttexture height
rgbaDataarray of RGBA values
wrapModeSGL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT
wrapModeTsee wrapModeS
minFilterGL_NEAREST, GL_LINEAR,
GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR
magFilterGL_NEAREST or GL_LINEAR

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