#include <Sampler.h>

Public Member Functions | |
| Sampler (GLuint width, GLuint height, GLubyte *data=0) | |
| Sampler (void) | |
| virtual | ~Sampler (void) |
| virtual void | createProperties (void) |
| virtual const string | getTypeName (bool ofComponent=false) const |
| virtual void | onInitialize (void) |
| virtual void | onBind (int unit) |
| virtual void | onUnbind (int unit) |
| void | setTexEnv (void) |
| void | setData (const void *data) |
| void | clear (void) |
| void | download (string filename="") |
| void | setDefaultColor (const Vec4 &color) |
| const Vec4 & | getDefaultColor (void) const |
| GLuint | getWidth (void) const |
| GLuint | getHeight (void) const |
| GLuint | getWidth2 (void) const |
| GLuint | getHeight2 (void) const |
| Vec2 | getSize (void) const |
| Vec2 | getSize2 (void) const |
| GLuint | getID (void) const |
| GLenum | getInternalFormat (void) const |
| GLenum | getTarget (void) const |
| GLenum | getMode (void) const |
| GLenum | getWrap (void) const |
| GLenum | getFilter (void) const |
| GLboolean | isResident (void) const |
Static Public Member Functions | |
| static PropertyPtr | create (const XMLNodePtr &xml=XMLNodePtr()) |
Protected Attributes | |
| GLuint | m_w2 |
| power of two width | |
| GLuint | m_h2 |
| power of 2 height | |
| GLuint | m_id |
| sampler object id ( glGenSamplers ) | |
| GLenum | m_internal |
| GLenum | m_target |
| depending on m_makePOT being true or false, resp. | |
| GLenum | m_mode |
| GL_MODULATE, GL_DECAL, GL_BLEND, or GL_REPLACE. | |
| GLenum | m_wrap |
| GL_CLAMP, GL_CLAMP_TO_EDGE, or GL_REPEAT. | |
| GLenum | m_filter |
| GLuint | m_formatGL |
| GLuint | m_typeGL |
| GLboolean | m_makePOT |
| if true, sampler is forced to be Power of Two | |
| GLboolean | m_doMipMap |
| if true, mipmaps are generated before upload | |
| GLboolean | m_doCleanup |
| if set, all datablocks are freed after construction | |
| Vec4 | m_defaultColor |
| bool | m_overrideDefaultColor |
Definition at line 23 of file Sampler.h.
| Sampler::Sampler | ( | GLuint | width, | |
| GLuint | height, | |||
| GLubyte * | data = 0 | |||
| ) |
Definition at line 14 of file Sampler.cpp.
| Sampler::Sampler | ( | void | ) |
Definition at line 34 of file Sampler.cpp.
| Sampler::~Sampler | ( | void | ) | [virtual] |
| void Sampler::clear | ( | void | ) |
| PropertyPtr Sampler::create | ( | const XMLNodePtr & | xml = XMLNodePtr() |
) | [static] |
| void Sampler::createProperties | ( | void | ) | [virtual] |
| void Sampler::download | ( | string | filename = "" |
) |
Definition at line 628 of file Sampler.cpp.
| const Vec4 & Sampler::getDefaultColor | ( | void | ) | const |
Definition at line 354 of file Sampler.cpp.
| GLenum Sampler::getFilter | ( | void | ) | const |
Definition at line 406 of file Sampler.cpp.
| GLuint Sampler::getHeight | ( | void | ) | const |
| GLuint Sampler::getHeight2 | ( | void | ) | const |
Definition at line 374 of file Sampler.cpp.
| GLuint Sampler::getID | ( | void | ) | const |
Definition at line 386 of file Sampler.cpp.
| GLenum Sampler::getInternalFormat | ( | void | ) | const |
Definition at line 390 of file Sampler.cpp.
| GLenum Sampler::getMode | ( | void | ) | const |
Definition at line 398 of file Sampler.cpp.
| Vec2 Sampler::getSize | ( | void | ) | const |
Definition at line 378 of file Sampler.cpp.
| Vec2 Sampler::getSize2 | ( | void | ) | const |
Definition at line 382 of file Sampler.cpp.
| GLenum Sampler::getTarget | ( | void | ) | const |
Definition at line 394 of file Sampler.cpp.
| const string Sampler::getTypeName | ( | bool | ofComponent = false |
) | const [virtual] |
| GLuint Sampler::getWidth | ( | void | ) | const |
| GLuint Sampler::getWidth2 | ( | void | ) | const |
Definition at line 370 of file Sampler.cpp.
| GLenum Sampler::getWrap | ( | void | ) | const |
Definition at line 402 of file Sampler.cpp.
| GLboolean Sampler::isResident | ( | void | ) | const |
returns wether or not the Texture is resident
Definition at line 814 of file Sampler.cpp.
| void Sampler::onBind | ( | int | unit | ) | [virtual] |
| void Sampler::onInitialize | ( | void | ) | [virtual] |
checks if the image data is already power of two and then uploads. if not power-of-two, allocates a new datablock and copies the image data into it. The image data and texture power-of-two data are detroyed after the upload.
copy the internal format from the format set by image
set default if no file was specified OR if it could not be found
if we dont have an initial buffer, create one.
we have non-power-of-two width & height, but no RECTANGLE_EXT,
TODO:FIXME bug in reading .tif ? crashes here -presumably on wrong data
oopsie. this happens when the image reads a different format than specified by the Sampler
DEBUG 0XDE1 = GL_TEXTURE_2D
Reimplemented from RenderTools::Image.
Definition at line 416 of file Sampler.cpp.
| void Sampler::onUnbind | ( | int | unit | ) | [virtual] |
i > 7 results in a GL_INVALID_VALUE error, contradicting http://www.opengl.org/sdk/docs/man/xhtml/glActiveTexture.xml resolved by taking the smaller of GL_MAX_TEXTURE_COORDS and GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS instead of the documented larger
Implements RenderTools::BindingInterface.
Definition at line 772 of file Sampler.cpp.
| void Sampler::setData | ( | const void * | data | ) |
Definition at line 711 of file Sampler.cpp.
| void Sampler::setDefaultColor | ( | const Vec4 & | color | ) |
Definition at line 358 of file Sampler.cpp.
| void Sampler::setTexEnv | ( | void | ) |
Definition at line 735 of file Sampler.cpp.
Vec4 RenderTools::Sampler::m_defaultColor [protected] |
GLboolean RenderTools::Sampler::m_doCleanup [protected] |
GLboolean RenderTools::Sampler::m_doMipMap [protected] |
GLenum RenderTools::Sampler::m_filter [protected] |
GLuint RenderTools::Sampler::m_formatGL [protected] |
GLuint RenderTools::Sampler::m_h2 [protected] |
GLuint RenderTools::Sampler::m_id [protected] |
GLenum RenderTools::Sampler::m_internal [protected] |
internal GL mode, one of the following : GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16, GL_RGB, GL_R3_G3_B2, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, GL_RGBA16, GL_RGBA32F_ARB, GL_RGB32F_ARB, GL_ALPHA32F_ARB, GL_INTENSITY32F_ARB, GL_LUMINANCE32F_ARB, GL_LUMINANCE_ALPHA32F_ARB, GL_RGBA16F_ARB, GL_RGB16F_ARB, GL_ALPHA16F_ARB, GL_INTENSITY16F_ARB, GL_LUMINANCE16F_ARB, GL_LUMINANCE_ALPHA16F_ARB GL_STENCIL_INDEX1, GL_STENCIL_INDEX4, GL_STENCIL_INDEX8, GL_STENCIL_INDEX16, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT32 GL_DEPTH_COMPONENT32F_NV, GL_DEPTH_BUFFER_FLOAT_MODE_NV
GLboolean RenderTools::Sampler::m_makePOT [protected] |
GLenum RenderTools::Sampler::m_mode [protected] |
bool RenderTools::Sampler::m_overrideDefaultColor [protected] |
GLenum RenderTools::Sampler::m_target [protected] |
GLuint RenderTools::Sampler::m_typeGL [protected] |
GLuint RenderTools::Sampler::m_w2 [protected] |
GLenum RenderTools::Sampler::m_wrap [protected] |
1.5.8