scg3  0.6
scg::CubeMapCore Class Reference

Cube map textue core. More...

#include "CubeMapCore.h"

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

Public Member Functions

 CubeMapCore ()
 
virtual ~CubeMapCore ()
 
void setCubeMap (GLsizei width, GLsizei height, const std::vector< unsigned char * > &rgbaData)
 
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 CubeMapCoreSP create ()
 

Additional Inherited Members

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

Detailed Description

Cube map textue core.

To be used in conjunction with cube map or skybox shader.

Definition at line 40 of file CubeMapCore.h.

Constructor & Destructor Documentation

◆ CubeMapCore()

scg::CubeMapCore::CubeMapCore ( )

Constructor.

◆ ~CubeMapCore()

virtual scg::CubeMapCore::~CubeMapCore ( )
virtual

Destructor.

Member Function Documentation

◆ create()

static CubeMapCoreSP scg::CubeMapCore::create ( )
static

Create shared pointer.

◆ render()

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

Render core, i.e., bind texture and post-multiply current texture matrix by local texture matrix. Pass inverse view matrix and skybox matrix (i.e., model-view-projection matrix without camera translation) to shader program.

Reimplemented from scg::TextureCore.

◆ renderPost()

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

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

Reimplemented from scg::TextureCore.

◆ setCubeMap()

void scg::CubeMapCore::setCubeMap ( GLsizei  width,
GLsizei  height,
const std::vector< unsigned char * > &  rgbaData 
)

Create cube map texture from RGBA images with given parameters.

Parameters
widthtexture width
heighttexture height
rgbaDatavector of 6 arrays of RGBA values for textures in directions +x, -x, +y, -y, +z, -z

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