Commit 12463081 authored by Ken Martin's avatar Ken Martin
Browse files

Fix compile warning in TextureObject

Texture object method was requiring the width and height of the
framebuffer as arguments.  It was doing error testing on these
arguments but there is no reason to.  Copying a texture where part of
the texture goes outside the framebuffer is fine. That can happen
and is not a problem. The extra texels just get discarded. This also
saves having to know the width and height of the frame buffer
to make this call.

Change-Id: I96cafda2ac900f1ecd247e6678e1e68cbccf033c
parent 386cfd4f
...@@ -172,7 +172,7 @@ vtkIdType vtkOpenGLContextBufferId::GetPickedItem(int x, int y) ...@@ -172,7 +172,7 @@ vtkIdType vtkOpenGLContextBufferId::GetPickedItem(int x, int y)
this->Texture->Bind(); this->Texture->Bind();
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE); glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
this->Texture->CopyToFrameBuffer(x,y,x,y,x,y,this->Width,this->Height); this->Texture->CopyToFrameBuffer(x,y,x,y,x,y);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); // restore glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); // restore
......
...@@ -1618,9 +1618,7 @@ void vtkTextureObject::CopyToFrameBuffer(int srcXmin, ...@@ -1618,9 +1618,7 @@ void vtkTextureObject::CopyToFrameBuffer(int srcXmin,
int srcXmax, int srcXmax,
int srcYmax, int srcYmax,
int dstXmin, int dstXmin,
int dstYmin, int dstYmin)
int width,
int height)
{ {
assert("pre: positive_srcXmin" && srcXmin>=0); assert("pre: positive_srcXmin" && srcXmin>=0);
assert("pre: max_srcXmax" && assert("pre: max_srcXmax" &&
...@@ -1632,10 +1630,6 @@ void vtkTextureObject::CopyToFrameBuffer(int srcXmin, ...@@ -1632,10 +1630,6 @@ void vtkTextureObject::CopyToFrameBuffer(int srcXmin,
assert("pre: increasing_y" && srcYmin<=srcYmax); assert("pre: increasing_y" && srcYmin<=srcYmax);
assert("pre: positive_dstXmin" && dstXmin>=0); assert("pre: positive_dstXmin" && dstXmin>=0);
assert("pre: positive_dstYmin" && dstYmin>=0); assert("pre: positive_dstYmin" && dstYmin>=0);
assert("pre: positive_width" && width>0);
assert("pre: positive_height" && height>0);
assert("pre: x_fit" && dstXmin+(srcXmax-srcXmin)<width);
assert("pre: y_fit" && dstYmin+(srcYmax-srcYmin)<height);
vtkOpenGLClearErrorMacro(); vtkOpenGLClearErrorMacro();
......
...@@ -433,8 +433,7 @@ public: ...@@ -433,8 +433,7 @@ public:
// Description: // Description:
// Copy a sub-part of the texture (src) in the current framebuffer // Copy a sub-part of the texture (src) in the current framebuffer
// at location (dstXmin,dstYmin). (dstXmin,dstYmin) is the location of the // at location (dstXmin,dstYmin). (dstXmin,dstYmin) is the location of the
// lower left corner of the rectangle. width and height are the dimensions // lower left corner of the rectangle.
// of the framebuffer.
// \pre positive_srcXmin: srcXmin>=0 // \pre positive_srcXmin: srcXmin>=0
// \pre max_srcXmax: srcXmax<this->GetWidth() // \pre max_srcXmax: srcXmax<this->GetWidth()
// \pre increasing_x: srcXmin<=srcXmax // \pre increasing_x: srcXmin<=srcXmax
...@@ -443,18 +442,12 @@ public: ...@@ -443,18 +442,12 @@ public:
// \pre increasing_y: srcYmin<=srcYmax // \pre increasing_y: srcYmin<=srcYmax
// \pre positive_dstXmin: dstXmin>=0 // \pre positive_dstXmin: dstXmin>=0
// \pre positive_dstYmin: dstYmin>=0 // \pre positive_dstYmin: dstYmin>=0
// \pre positive_width: width>0
// \pre positive_height: height>0
// \pre x_fit: destXmin+(srcXmax-srcXmin)<width
// \pre y_fit: destYmin+(srcYmax-srcYmin)<height
void CopyToFrameBuffer(int srcXmin, void CopyToFrameBuffer(int srcXmin,
int srcYmin, int srcYmin,
int srcXmax, int srcXmax,
int srcYmax, int srcYmax,
int dstXmin, int dstXmin,
int dstYmin, int dstYmin);
int width,
int height);
// Description: // Description:
......
Markdown is supported
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