*** empty log message ***
This commit is contained in:
@@ -23,6 +23,11 @@ TextureRectangle::TextureRectangle():
|
||||
_textureWidth(0),
|
||||
_textureHeight(0)
|
||||
{
|
||||
setWrap(WRAP_S, CLAMP);
|
||||
setWrap(WRAP_T, CLAMP);
|
||||
|
||||
setFilter(MIN_FILTER, LINEAR);
|
||||
setFilter(MAG_FILTER, LINEAR);
|
||||
}
|
||||
|
||||
TextureRectangle::TextureRectangle(const TextureRectangle& text,const CopyOp& copyop):
|
||||
@@ -132,7 +137,7 @@ void TextureRectangle::apply(State& state) const
|
||||
|
||||
applyTexParameters(GL_TEXTURE_RECTANGLE_NV, state);
|
||||
|
||||
applyTexImageRectangle(GL_TEXTURE_RECTANGLE_NV, _image.get(), state, _textureWidth, _textureHeight);
|
||||
applyTexImage(GL_TEXTURE_RECTANGLE_NV, _image.get(), state, _textureWidth, _textureHeight);
|
||||
|
||||
// in theory the following line is redundant, but in practice
|
||||
// have found that the first frame drawn doesn't apply the textures
|
||||
@@ -146,7 +151,22 @@ void TextureRectangle::apply(State& state) const
|
||||
}
|
||||
}
|
||||
|
||||
void TextureRectangle::applyTexImageRectangle(GLenum target, Image* image, State& state, GLsizei& inwidth, GLsizei& inheight) const
|
||||
void TextureRectangle::applyTexParameters(GLenum target, State& state) const
|
||||
{
|
||||
// get the contextID (user defined ID of 0 upwards) for the
|
||||
// current OpenGL context.
|
||||
const unsigned int contextID = state.getContextID();
|
||||
|
||||
glTexParameteri( target, GL_TEXTURE_WRAP_S, _wrap_s );
|
||||
glTexParameteri( target, GL_TEXTURE_WRAP_T, _wrap_t );
|
||||
|
||||
glTexParameteri( target, GL_TEXTURE_MIN_FILTER, _min_filter);
|
||||
glTexParameteri( target, GL_TEXTURE_MAG_FILTER, _mag_filter);
|
||||
|
||||
getTextureParameterDirty(contextID) = false;
|
||||
}
|
||||
|
||||
void TextureRectangle::applyTexImage(GLenum target, Image* image, State& state, GLsizei& inwidth, GLsizei& inheight) const
|
||||
{
|
||||
// if we don't have a valid image we can't create a texture!
|
||||
if (!image || !image->data())
|
||||
|
||||
Reference in New Issue
Block a user