fixed include, added width and height query for renderbuffer and texture2d.

This commit is contained in:
Marco Di Benedetto 2012-05-08 10:46:00 +00:00
parent 37acc0146a
commit 2131d6a681
3 changed files with 46 additions and 1 deletions

View File

@ -1,7 +1,7 @@
#ifndef GLW_FRAMEBUFFER_H
#define GLW_FRAMEBUFFER_H
#include "./texture2D.h"
#include "./texture2d.h"
#include "./renderbuffer.h"
#include <vector>

View File

@ -68,6 +68,16 @@ class Renderbuffer : public Renderable
return false;
}
GLsizei width(void) const
{
return this->m_width;
}
GLsizei height(void) const
{
return this->m_height;
}
void setStorage(GLenum target, GLint unit, GLenum format, GLsizei width, GLsizei height)
{
(void)unit;
@ -139,6 +149,16 @@ class SafeRenderbuffer : public SafeRenderable
;
}
GLsizei width(void) const
{
return this->object()->width();
}
GLsizei height(void) const
{
return this->object()->height();
}
protected:
SafeRenderbuffer(const RenderbufferPtr & renderbuffer)

View File

@ -61,6 +61,16 @@ class Texture2D : public Texture
return false;
}
GLsizei width(void) const
{
return this->m_width;
}
GLsizei height(void) const
{
return this->m_height;
}
void setImage(GLenum target, GLint unit, GLint level, GLsizei width, GLsizei height, GLenum dataFormat, GLenum dataType, const void * data)
{
(void)unit;
@ -154,6 +164,16 @@ class SafeTexture2D : public SafeTexture
;
}
GLsizei width(void) const
{
return this->object()->width();
}
GLsizei height(void) const
{
return this->object()->height();
}
protected:
SafeTexture2D(const Texture2DPtr & texture2D)
@ -223,6 +243,11 @@ class BoundTexture2D : public BoundTexture
return static_cast<Texture2DHandle &>(BaseType::handle());
}
void setSampleMode(const TextureSampleMode & sampler)
{
this->object()->setSampleMode(this->m_target, this->m_unit, sampler);
}
protected:
BoundTexture2D(const Texture2DHandle & handle, const Texture2DBindingParams & params)