23 #ifndef vtkTextureObject_h
24 #define vtkTextureObject_h
26 #include "vtkRenderingOpenGL2Module.h"
37 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
56 NumberOfDepthTextureCompareFunctions
61 #if GL_ES_VERSION_2_0 != 1
89 NumberOfMinificationModes
120 NumberOfDepthModeFormats
139 vtkGetMacro(Width,
unsigned int);
140 vtkGetMacro(Height,
unsigned int);
141 vtkGetMacro(Depth,
unsigned int);
142 vtkGetMacro(Components,
int);
144 {
return this->Width*this->Height*this->Depth; }
147 vtkGetMacro(NumberOfDimensions,
int);
151 vtkGetMacro(Target,
unsigned int);
156 vtkGetMacro(Handle,
unsigned int);
160 int GetTextureUnit();
177 void ReleaseGraphicsResources(
vtkWindow *win);
187 void SendParameters();
188 vtkSetMacro(AutoParameters,
int);
189 vtkGetMacro(AutoParameters,
int);
194 bool Create2DFromRaw(
unsigned int width,
unsigned int height,
195 int numComps,
int dataType,
void *
data);
201 bool CreateDepthFromRaw(
unsigned int width,
unsigned int height,
202 int internalFormat,
int rawType,
209 bool CreateTextureBuffer(
unsigned int numValues,
int numComps,
214 #if GL_ES_VERSION_2_0 != 1
224 bool Create1D(
int numComps,
226 bool shaderSupportsTextureInt);
231 bool Create1DFromRaw(
unsigned int width,
int numComps,
232 int dataType,
void *
data);
237 bool CreateAlphaFromRaw(
unsigned int width,
245 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
251 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
253 bool shaderSupportsTextureInt);
260 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
262 bool shaderSupportsTextureInt);
267 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
268 unsigned int depth,
int numComps,
269 int dataType,
void *
data);
281 bool CreateDepth(
unsigned int width,
291 bool AllocateDepth(
unsigned int width,
unsigned int height,
297 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
302 bool Allocate2D(
unsigned int width,
unsigned int height,
int numComps,
309 bool Allocate3D(
unsigned int width,
unsigned int height,
310 unsigned int depth,
int numComps,
317 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
318 int vtktype,
bool shaderSupportsTextureInt);
319 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
320 int numComps,
int vtktype,
bool shaderSupportsTextureInt);
324 int GetVTKDataType();
328 int GetDataType(
int vtk_scalar_type);
329 void SetDataType(
unsigned int glType);
335 unsigned int GetInternalFormat(
int vtktype,
int numComps,
336 bool shaderSupportsTextureInt);
337 void SetInternalFormat(
unsigned int glInternalFormat);
343 unsigned int GetFormat(
int vtktype,
int numComps,
344 bool shaderSupportsTextureInt);
345 void SetFormat(
unsigned int glFormat);
352 void ResetFormatAndType();
354 unsigned int GetDepthTextureModeFormat(
int vtktype);
355 unsigned int GetMinificationFilterMode(
int vtktype);
356 unsigned int GetMagnificationFilterMode(
int vtktype);
357 unsigned int GetWrapSMode(
int vtktype);
358 unsigned int GetWrapTMode(
int vtktype);
359 unsigned int GetWrapRMode(
int vtktype);
365 vtkSetMacro(RequireDepthBufferFloat,
bool);
366 vtkGetMacro(RequireDepthBufferFloat,
bool);
367 vtkGetMacro(SupportsDepthBufferFloat,
bool);
374 vtkSetMacro(RequireTextureFloat,
bool);
375 vtkGetMacro(RequireTextureFloat,
bool);
376 vtkGetMacro(SupportsTextureFloat,
bool);
383 vtkSetMacro(RequireTextureInteger,
bool);
384 vtkGetMacro(RequireTextureInteger,
bool);
385 vtkGetMacro(SupportsTextureInteger,
bool);
392 vtkGetMacro(WrapS,
int);
393 vtkSetMacro(WrapS,
int);
400 vtkGetMacro(WrapT,
int);
401 vtkSetMacro(WrapT,
int);
408 vtkGetMacro(WrapR,
int);
409 vtkSetMacro(WrapR,
int);
418 vtkGetMacro(MinificationFilter,
int);
419 vtkSetMacro(MinificationFilter,
int);
425 vtkGetMacro(MagnificationFilter,
int);
426 vtkSetMacro(MagnificationFilter,
int);
433 { this->SetMagnificationFilter(val?Linear:Nearest); }
437 {
return this->MagnificationFilter==Linear; }
443 vtkSetVector4Macro(BorderColor,
float);
444 vtkGetVector4Macro(BorderColor,
float);
450 vtkSetMacro(MinLOD,
float);
451 vtkGetMacro(MinLOD,
float);
457 vtkSetMacro(MaxLOD,
float);
458 vtkGetMacro(MaxLOD,
float);
465 vtkSetMacro(BaseLevel,
int);
466 vtkGetMacro(BaseLevel,
int);
473 vtkSetMacro(MaxLevel,
int);
474 vtkGetMacro(MaxLevel,
int);
484 vtkGetMacro(DepthTextureCompare,
bool);
485 vtkSetMacro(DepthTextureCompare,
bool);
499 vtkGetMacro(DepthTextureCompareFunction,
int);
500 vtkSetMacro(DepthTextureCompareFunction,
int);
506 vtkGetMacro(GenerateMipmap,
bool);
507 vtkSetMacro(GenerateMipmap,
bool);
514 static bool IsSupported(
516 bool requireTexFloat,
517 bool requireDepthFloat,
534 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
535 int srcXmax,
int srcYmax,
536 int dstXmin,
int dstYmin,
537 int dstXmax,
int dstYmax,
538 int dstSizeX,
int dstSizeY,
543 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
544 int srcXmax,
int srcYmax,
545 int dstXmin,
int dstYmin,
546 int dstSizeX,
int dstSizeY,
551 void CopyToFrameBuffer(
float *tcoords,
float *verts,
567 void CopyFromFrameBuffer(
int srcXmin,
585 void CreateTexture();
588 void DestroyTexture();
590 int NumberOfDimensions;
603 bool RequireTextureInteger;
604 bool SupportsTextureInteger;
605 bool RequireTextureFloat;
606 bool SupportsTextureFloat;
607 bool RequireDepthBufferFloat;
608 bool SupportsDepthBufferFloat;
613 int MinificationFilter;
614 int MagnificationFilter;
615 bool LinearMagnification;
621 float BorderColor[4];
623 bool DepthTextureCompare;
624 int DepthTextureCompareFunction;
static bool IsSupported(vtkOpenGLRenderWindow *renWin)
abstract base class for most VTK objects
vtkOpenGLHelper * ShaderProgram
bool GetLinearMagnification()
record modification and/or execution time
unsigned int InternalFormat
static bool IsSupported(vtkRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
window superclass for vtkRenderWindow
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
vtkWeakPointer< vtkOpenGLRenderWindow > Context
void SetLinearMagnification(bool val)
abstracts an OpenGL pixel buffer object.
vtkOpenGLBufferObject * BufferObject
abstracts an OpenGL texture object.
The ShaderProgram uses one or more Shader objects.