23 #ifndef vtkTextureObject_h 24 #define vtkTextureObject_h 26 #include "vtkRenderingOpenGL2Module.h" 35 class VertexArrayObject;
39 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1 58 NumberOfDepthTextureCompareFunctions
63 #if GL_ES_VERSION_2_0 != 1 91 NumberOfMinificationModes
122 NumberOfDepthModeFormats
127 void PrintSelf(ostream& os,
vtkIndent indent);
146 {
return this->Width*this->Height*this->Depth; }
162 int GetTextureUnit();
179 void ReleaseGraphicsResources(
vtkWindow *win);
189 void SendParameters();
196 bool Create2DFromRaw(
unsigned int width,
unsigned int height,
197 int numComps,
int dataType,
void *
data);
203 bool CreateDepthFromRaw(
unsigned int width,
unsigned int height,
209 #if GL_ES_VERSION_2_0 != 1 219 bool Create1D(
int numComps,
221 bool shaderSupportsTextureInt);
226 bool Create1DFromRaw(
unsigned int width,
int numComps,
227 int dataType,
void *data);
232 bool CreateAlphaFromRaw(
unsigned int width,
240 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1 246 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
248 bool shaderSupportsTextureInt);
255 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
257 bool shaderSupportsTextureInt);
262 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
263 unsigned int depth,
int numComps,
264 int dataType,
void *data);
276 bool CreateDepth(
unsigned int width,
286 bool AllocateDepth(
unsigned int width,
unsigned int height,
292 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
297 bool Allocate2D(
unsigned int width,
unsigned int height,
int numComps,
304 bool Allocate3D(
unsigned int width,
unsigned int height,
305 unsigned int depth,
int numComps,
312 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
313 int vtktype,
bool shaderSupportsTextureInt);
314 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
315 int numComps,
int vtktype,
bool shaderSupportsTextureInt);
320 int GetDataType(
int vtk_scalar_type);
321 void SetDataType(
unsigned int glType);
327 unsigned int GetInternalFormat(
int vtktype,
int numComps,
328 bool shaderSupportsTextureInt);
329 void SetInternalFormat(
unsigned int glInternalFormat);
335 unsigned int GetFormat(
int vtktype,
int numComps,
336 bool shaderSupportsTextureInt);
337 void SetFormat(
unsigned int glFormat);
344 void ResetFormatAndType();
346 unsigned int GetDepthTextureModeFormat(
int vtktype);
347 unsigned int GetMinificationFilterMode(
int vtktype);
348 unsigned int GetMagnificationFilterMode(
int vtktype);
349 unsigned int GetWrapSMode(
int vtktype);
350 unsigned int GetWrapTMode(
int vtktype);
351 unsigned int GetWrapRMode(
int vtktype);
425 { this->SetMagnificationFilter(val?Linear:Nearest); }
429 {
return this->MagnificationFilter==Linear; }
506 static bool IsSupported(
508 bool requireTexFloat,
509 bool requireDepthFloat,
526 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
527 int srcXmax,
int srcYmax,
528 int dstXmin,
int dstYmin,
529 int dstXmax,
int dstYmax,
530 int dstSizeX,
int dstSizeY,
535 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
536 int srcXmax,
int srcYmax,
537 int dstXmin,
int dstYmin,
538 int dstSizeX,
int dstSizeY,
543 void CopyToFrameBuffer(
float *tcoords,
float *verts,
559 void CopyFromFrameBuffer(
int srcXmin,
577 void CreateTexture();
580 void DestroyTexture();
582 int NumberOfDimensions;
595 bool RequireTextureInteger;
596 bool SupportsTextureInteger;
597 bool RequireTextureFloat;
598 bool SupportsTextureFloat;
599 bool RequireDepthBufferFloat;
600 bool SupportsDepthBufferFloat;
605 int MinificationFilter;
606 int MagnificationFilter;
607 bool LinearMagnification;
613 float BorderColor[4];
615 bool DepthTextureCompare;
616 int DepthTextureCompareFunction;
GLsizei GLsizei GLenum GLenum const GLvoid * data
static bool IsSupported(vtkOpenGLRenderWindow *renWin)
abstract base class for most VTK objects
bool GetLinearMagnification()
#define vtkGetMacro(name, type)
record modification and/or execution time
unsigned int InternalFormat
static bool IsSupported(vtkRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
#define vtkTypeMacro(thisClass, superclass)
vtkgl::CellBO * ShaderProgram
GLint GLint GLsizei GLsizei height
window superclass for vtkRenderWindow
GLint GLint GLsizei GLsizei GLsizei depth
#define vtkSetVector4Macro(name, type)
a simple class to control print indentation
GLint GLint GLsizei width
vtkWeakPointer< vtkOpenGLRenderWindow > Context
void SetLinearMagnification(bool val)
#define vtkGetVector4Macro(name, type)
abstracts an OpenGL pixel buffer object.
The VertexArrayObject class uses, or emulates, vertex array objects.
abstracts an OpenGL texture object.
VTKRENDERINGOPENGL_EXPORT PFNGLGENERATEMIPMAPPROC GenerateMipmap
GLclampf GLclampf GLclampf alpha
The ShaderProgram uses one or more Shader objects.
#define vtkSetMacro(name, type)