10 #ifndef SLBACKGROUND_H
11 #define SLBACKGROUND_H
50 const SLCol4f& bottomRightColor);
static SLbool fixAspectRatio
Flag if wnd aspect ratio should be fixed.
Wrapper class around OpenGL Vertex Array Objects (VAO)
vector< SLCol4f > SLVCol4f
Defines a 2D-Background for the OpenGL framebuffer background.
SLint _resY
Background resolution in y-dir.
SLCol4f _avgColor
Average color of all 4 corner colors.
SLGLProgram * _colorAttributeProgram
SLVCol4f _colors
Vector of 4 corner colors {TL,BL,TR,BR}.
SLBackground(SLstring shaderDir)
The constructor initializes to a uniform BLACK background color.
SLGLProgram * _textureOnlyProgram
SLGLTexture * _texture
Pointer to a background texture.
const SLRectf & rect() const
SLGLVertexArray _vao
OpenGL Vertex Array Object for drawing.
void render(SLint widthPX, SLint heightPX)
Draws the background as 2D rectangle with OpenGL buffers.
SLRectf _rect
Background rect (it may be different to viewport size)
SLCol4f colorAtPos(SLfloat x, SLfloat y, SLfloat width, SLfloat height)
Returns the interpolated color at the pixel position p[x,y] used in raytracing.
bool _fixAspectRatio
if true, the background is centered and stretched to the screen boarders while keeping the textures a...
SLGLTexture * _textureError
Pointer to a error texture if background texture is not available.
SLbool _isUniform
Flag if background has uniform color.
SLint _resX
Background resolution in x-dir.
void renderInScene(const SLMat4f &wm, const SLVec3f <, const SLVec3f &LB, const SLVec3f &RT, const SLVec3f &RB)
Draws the background as a quad on the far clipping plane.
Encapsulation of an OpenGL shader program object.
Texture object for OpenGL texturing.
SLGLVertexArray encapsulates the core OpenGL drawing.
void clearAttribs()
Clears the attribute definition.
Base class for all other classes.