23 #ifndef vtkTextureObject_h
24 #define vtkTextureObject_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);
330 int GetDefaultDataType(
int vtk_scalar_type);
336 unsigned int GetInternalFormat(
int vtktype,
int numComps,
337 bool shaderSupportsTextureInt);
338 void SetInternalFormat(
unsigned int glInternalFormat);
339 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
340 bool shaderSupportsTextureInt);
346 unsigned int GetFormat(
int vtktype,
int numComps,
347 bool shaderSupportsTextureInt);
348 void SetFormat(
unsigned int glFormat);
349 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
350 bool shaderSupportsTextureInt);
357 void ResetFormatAndType();
359 unsigned int GetMinificationFilterMode(
int vtktype);
360 unsigned int GetMagnificationFilterMode(
int vtktype);
361 unsigned int GetWrapSMode(
int vtktype);
362 unsigned int GetWrapTMode(
int vtktype);
363 unsigned int GetWrapRMode(
int vtktype);
369 vtkSetMacro(RequireDepthBufferFloat,
bool);
370 vtkGetMacro(RequireDepthBufferFloat,
bool);
371 vtkGetMacro(SupportsDepthBufferFloat,
bool);
378 vtkSetMacro(RequireTextureFloat,
bool);
379 vtkGetMacro(RequireTextureFloat,
bool);
380 vtkGetMacro(SupportsTextureFloat,
bool);
387 vtkSetMacro(RequireTextureInteger,
bool);
388 vtkGetMacro(RequireTextureInteger,
bool);
389 vtkGetMacro(SupportsTextureInteger,
bool);
396 vtkGetMacro(WrapS,
int);
397 vtkSetMacro(WrapS,
int);
404 vtkGetMacro(WrapT,
int);
405 vtkSetMacro(WrapT,
int);
412 vtkGetMacro(WrapR,
int);
413 vtkSetMacro(WrapR,
int);
422 vtkGetMacro(MinificationFilter,
int);
423 vtkSetMacro(MinificationFilter,
int);
429 vtkGetMacro(MagnificationFilter,
int);
430 vtkSetMacro(MagnificationFilter,
int);
437 { this->SetMagnificationFilter(val?Linear:Nearest); }
441 {
return this->MagnificationFilter==Linear; }
447 vtkSetVector4Macro(BorderColor,
float);
448 vtkGetVector4Macro(BorderColor,
float);
454 vtkSetMacro(MinLOD,
float);
455 vtkGetMacro(MinLOD,
float);
461 vtkSetMacro(MaxLOD,
float);
462 vtkGetMacro(MaxLOD,
float);
469 vtkSetMacro(BaseLevel,
int);
470 vtkGetMacro(BaseLevel,
int);
477 vtkSetMacro(MaxLevel,
int);
478 vtkGetMacro(MaxLevel,
int);
488 vtkGetMacro(DepthTextureCompare,
bool);
489 vtkSetMacro(DepthTextureCompare,
bool);
503 vtkGetMacro(DepthTextureCompareFunction,
int);
504 vtkSetMacro(DepthTextureCompareFunction,
int);
510 vtkGetMacro(GenerateMipmap,
bool);
511 vtkSetMacro(GenerateMipmap,
bool);
518 static bool IsSupported(
520 bool requireTexFloat,
521 bool requireDepthFloat,
538 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
539 int srcXmax,
int srcYmax,
540 int dstXmin,
int dstYmin,
541 int dstXmax,
int dstYmax,
542 int dstSizeX,
int dstSizeY,
547 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
548 int srcXmax,
int srcYmax,
549 int dstXmin,
int dstYmin,
550 int dstSizeX,
int dstSizeY,
555 void CopyToFrameBuffer(
float *tcoords,
float *verts,
571 void CopyFromFrameBuffer(
int srcXmin,
589 void CreateTexture();
592 void DestroyTexture();
594 int NumberOfDimensions;
607 bool RequireTextureInteger;
608 bool SupportsTextureInteger;
609 bool RequireTextureFloat;
610 bool SupportsTextureFloat;
611 bool RequireDepthBufferFloat;
612 bool SupportsDepthBufferFloat;
617 int MinificationFilter;
618 int MagnificationFilter;
619 bool LinearMagnification;
625 float BorderColor[4];
627 bool DepthTextureCompare;
628 int DepthTextureCompareFunction;
static bool IsSupported(vtkOpenGLRenderWindow *renWin)
abstract base class for most VTK objects
vtkOpenGLHelper * ShaderProgram
bool GetLinearMagnification()
#define VTKRENDERINGOPENGL2_EXPORT
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.