24 #ifndef vtkTextureObject_h
25 #define vtkTextureObject_h
27 #include "vtkRenderingOpenGL2Module.h"
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
148 vtkGetMacro(Width,
unsigned int);
149 vtkGetMacro(Height,
unsigned int);
150 vtkGetMacro(Depth,
unsigned int);
151 vtkGetMacro(Components,
int);
153 {
return this->Width*this->Height*this->Depth; }
156 vtkGetMacro(NumberOfDimensions,
int);
162 vtkGetMacro(Target,
unsigned int);
169 vtkGetMacro(Handle,
unsigned int);
175 int GetTextureUnit();
200 void ReleaseGraphicsResources(
vtkWindow *win);
215 void SendParameters();
217 vtkGetMacro(AutoParameters,
int);
224 bool Create2DFromRaw(
unsigned int width,
unsigned int height,
225 int numComps,
int dataType,
void *
data);
231 bool CreateDepthFromRaw(
unsigned int width,
unsigned int height,
232 int internalFormat,
int rawType,
239 bool CreateTextureBuffer(
unsigned int numValues,
int numComps,
247 bool CreateCubeFromRaw(
unsigned int width,
unsigned int height,
248 int numComps,
int dataType,
void *
data[6]);
251 #if GL_ES_VERSION_2_0 != 1
263 bool Create1D(
int numComps,
265 bool shaderSupportsTextureInt);
270 bool Create1DFromRaw(
unsigned int width,
int numComps,
271 int dataType,
void *
data);
276 bool CreateAlphaFromRaw(
unsigned int width,
283 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
291 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
293 bool shaderSupportsTextureInt);
301 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
303 bool shaderSupportsTextureInt);
309 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
310 unsigned int depth,
int numComps,
311 int dataType,
void *
data);
325 bool CreateDepth(
unsigned int width,
335 bool AllocateDepth(
unsigned int width,
unsigned int height,
342 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
348 bool Allocate2D(
unsigned int width,
unsigned int height,
int numComps,
355 bool Allocate3D(
unsigned int width,
unsigned int height,
356 unsigned int depth,
int numComps,
364 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
365 int vtktype,
bool shaderSupportsTextureInt);
366 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
367 int numComps,
int vtktype,
bool shaderSupportsTextureInt);
373 int GetVTKDataType();
379 int GetDataType(
int vtk_scalar_type);
380 void SetDataType(
unsigned int glType);
381 int GetDefaultDataType(
int vtk_scalar_type);
390 unsigned int GetInternalFormat(
int vtktype,
int numComps,
391 bool shaderSupportsTextureInt);
392 void SetInternalFormat(
unsigned int glInternalFormat);
393 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
394 bool shaderSupportsTextureInt);
403 unsigned int GetFormat(
int vtktype,
int numComps,
404 bool shaderSupportsTextureInt);
405 void SetFormat(
unsigned int glFormat);
406 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
407 bool shaderSupportsTextureInt);
418 void ResetFormatAndType();
420 unsigned int GetMinificationFilterMode(
int vtktype);
421 unsigned int GetMagnificationFilterMode(
int vtktype);
422 unsigned int GetWrapSMode(
int vtktype);
423 unsigned int GetWrapTMode(
int vtktype);
424 unsigned int GetWrapRMode(
int vtktype);
434 vtkGetMacro(RequireDepthBufferFloat,
bool);
435 vtkGetMacro(SupportsDepthBufferFloat,
bool);
446 vtkGetMacro(RequireTextureFloat,
bool);
447 vtkGetMacro(SupportsTextureFloat,
bool);
458 vtkGetMacro(RequireTextureInteger,
bool);
459 vtkGetMacro(SupportsTextureInteger,
bool);
473 vtkGetMacro(WrapS,
int);
488 vtkGetMacro(WrapT,
int);
503 vtkGetMacro(WrapR,
int);
521 vtkGetMacro(MinificationFilter,
int);
533 vtkGetMacro(MagnificationFilter,
int);
542 { this->SetMagnificationFilter(val?Linear:Nearest); }
545 {
return this->MagnificationFilter==Linear; }
553 vtkSetVector4Macro(BorderColor,
float);
554 vtkGetVector4Macro(BorderColor,
float);
563 vtkGetMacro(MinLOD,
float);
572 vtkGetMacro(MaxLOD,
float);
582 vtkGetMacro(BaseLevel,
int);
592 vtkGetMacro(MaxLevel,
int);
606 vtkGetMacro(DepthTextureCompare,
bool);
631 vtkGetMacro(DepthTextureCompareFunction,
int);
641 vtkGetMacro(GenerateMipmap,
bool);
661 static bool IsSupported(
663 bool requireTexFloat,
664 bool requireDepthFloat,
682 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
683 int srcXmax,
int srcYmax,
684 int dstXmin,
int dstYmin,
685 int dstXmax,
int dstYmax,
686 int dstSizeX,
int dstSizeY,
691 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
692 int srcXmax,
int srcYmax,
693 int dstXmin,
int dstYmin,
694 int dstSizeX,
int dstSizeY,
699 void CopyToFrameBuffer(
float *tcoords,
float *verts,
717 void CopyFromFrameBuffer(
int srcXmin,
736 void GetShiftAndScale(
float &shift,
float &
scale);
752 void CreateTexture();
757 void DestroyTexture();
759 int NumberOfDimensions;
772 bool RequireTextureInteger;
773 bool SupportsTextureInteger;
774 bool RequireTextureFloat;
775 bool SupportsTextureFloat;
776 bool RequireDepthBufferFloat;
777 bool SupportsDepthBufferFloat;
782 int MinificationFilter;
783 int MagnificationFilter;
789 float BorderColor[4];
791 bool DepthTextureCompare;
792 int DepthTextureCompareFunction;