Commit 87d1d0db authored by Christopher Tenter's avatar Christopher Tenter
Browse files

More uninitialized state context.

Removed redundant func. argument. refs #373

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13734 383ad7c9-94d9-4d36-a494-682f7c89f535
parent afebe262
......@@ -98,6 +98,16 @@ int GLState::maxDrawBuffers_ = 0;
int GLState::num_texture_units_ = 0;
GLStateContext::GLStateContext()
{
activeTexture_ = GL_TEXTURE0;
activeDrawBuffer_ = 0;
framebuffers_[0] = framebuffers_[1] = 0;
memset(drawBufferState_, GL_BACK, sizeof(drawBufferState_));
drawBufferSingle_ = GL_BACK;
program_ = 0;
}
GLState::GLState(bool _updateGL)
: render_pass_(1),
max_render_passes_(1),
......@@ -1930,12 +1940,14 @@ void GLState::drawBuffers(GLsizei _n, const GLenum* _bufs)
}
/// get current framebuffer of a target
GLuint GLState::getFramebufferDraw(GLenum _target) {
GLuint GLState::getFramebufferDraw()
{
return stateStack_.back().framebuffers_[0];
}
/// get current framebuffer of a target
GLuint GLState::getFramebufferRead(GLenum _target) {
GLuint GLState::getFramebufferRead()
{
return stateStack_.back().framebuffers_[1];
}
......
......@@ -118,7 +118,8 @@ struct GLStateContext
// it contains a copy of the OpenGL state machine
public:
GLStateContext() { activeTexture_ = GL_TEXTURE0; activeDrawBuffer_ = 0;}
GLStateContext();
// glEnable / glDisable states
// iff a bit is set for a state, it is enabled in OpenGL
......@@ -524,9 +525,9 @@ public:
/// replaces glBindFramebuffer, supports locking
static void bindFramebuffer(GLenum _target, GLuint _framebuffer);
/// get current draw framebuffer of a target
static GLuint getFramebufferDraw(GLenum _target);
static GLuint getFramebufferDraw();
/// get current read framebuffer of a target
static GLuint getFramebufferRead(GLenum _target);
static GLuint getFramebufferRead();
/// lock a framebuffer target
static void lockFramebuffer(GLenum _target);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment