26 #ifndef vtkTextureObject_h
27 #define vtkTextureObject_h
29 #include "vtkRenderingOpenGLModule.h"
55 NumberOfDepthTextureCompareFunctions
64 NumberOfDepthTextureModes
87 NumberOfMinificationModes
121 vtkGetMacro(Width,
unsigned int);
122 vtkGetMacro(Height,
unsigned int);
123 vtkGetMacro(Depth,
unsigned int);
124 vtkGetMacro(Components,
int);
126 {
return this->Width*this->Height*this->Depth; }
129 vtkGetMacro(NumberOfDimensions,
int);
135 vtkGetMacro(Target,
unsigned int);
142 vtkGetMacro(Handle,
unsigned int);
179 vtkGetMacro(AutoParameters,
int);
194 bool shaderSupportsTextureInt);
204 bool shaderSupportsTextureInt);
235 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
249 unsigned int depth,
int numComps,
261 bool shaderSupportsTextureInt);
272 bool shaderSupportsTextureInt);
274 int numComps,
int vtktype,
275 bool shaderSupportsTextureInt);
292 bool shaderSupportsTextureInt);
294 bool shaderSupportsTextureInt);
304 vtkGetMacro(RequireDepthBufferFloat,
bool);
305 vtkGetMacro(SupportsDepthBufferFloat,
bool);
316 vtkGetMacro(RequireTextureFloat,
bool);
317 vtkGetMacro(SupportsTextureFloat,
bool);
328 vtkGetMacro(RequireTextureInteger,
bool);
329 vtkGetMacro(SupportsTextureInteger,
bool);
343 vtkGetMacro(WrapS,
int);
358 vtkGetMacro(WrapT,
int);
373 vtkGetMacro(WrapR,
int);
391 vtkGetMacro(MinificationFilter,
int);
403 vtkGetMacro(MagnificationFilter,
int);
412 { this->SetMagnificationFilter(val?Linear:Nearest); }
415 {
return this->MagnificationFilter==Linear; }
423 vtkSetVector4Macro(BorderColor,
float);
424 vtkGetVector4Macro(BorderColor,
float);
434 vtkGetMacro(Priority,
float);
443 vtkGetMacro(MinLOD,
float);
452 vtkGetMacro(MaxLOD,
float);
462 vtkGetMacro(BaseLevel,
int);
472 vtkGetMacro(MaxLevel,
int);
486 vtkGetMacro(DepthTextureCompare,
bool);
511 vtkGetMacro(DepthTextureCompareFunction,
int);
525 vtkGetMacro(DepthTextureMode,
int);
535 vtkGetMacro(GenerateMipmap,
bool);
546 bool requireTexFloat,
547 bool requireDepthFloat,
654 float BorderColor[4];
dynamic, self-adjusting array of float
a simple class to control print indentation
abstract base class for most VTK objects
Interface class for querying and using OpenGL extensions.
abstracts an OpenGL pixel buffer object.
create a window for renderers to draw into
abstracts an OpenGL texture object.
void Deactivate(unsigned int texUnit)
bool AllocateDepth(unsigned int width, unsigned int height, int internalFormat)
Create a 2D depth texture but does not initialize its values.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
int GetDataType()
Get the data type for the texture as a vtk type int i.e.
bool IsBound()
Tells if the texture object is bound to the active texture image unit.
bool Allocate1D(unsigned int width, int numComps, int vtkType)
Create a 1D color texture but does not initialize its values.
bool Create1D(int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 1D texture using the PBO.
unsigned int GetFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
void DestroyTexture()
Destroy the texture.
void SetLinearMagnification(bool val)
Tells if the magnification mode is linear (true) or nearest (false).
bool SupportsTextureInteger
vtkTimeStamp SendParametersTime
void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int width, int height)
Copy a sub-part of the texture (src) in the current framebuffer at location (dstXmin,...
static vtkTextureObject * New()
void CreateTexture()
Creates a texture handle if not already created.
bool SupportsDepthBufferFloat
bool RequireTextureInteger
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 3D texture using the PBO.
bool CreateDepthFromRaw(unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
Create a 2D depth texture using a raw pointer.
unsigned int GetInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
bool LoadRequiredExtensions(vtkRenderWindow *renWin)
Load all necessary extensions.
bool SupportsTextureFloat
static bool IsSupported(vtkRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
Returns if the context supports the required extensions.
vtkWeakPointer< vtkRenderWindow > Context
bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 2D texture using the PBO.
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool shaderSupportsTextureInt)
int DepthTextureCompareFunction
bool Allocate3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtkType)
Create a 3D color texture but does not initialize its values.
bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool shaderSupportsTextureInt)
Create texture without uploading any data.
void Activate(unsigned int texUnit)
Set the active tex unit and bind (using our bind).
static bool IsSupported(vtkRenderWindow *renWin)
Check for feature support, without any optional features.
bool CreateDepth(unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
Create a 2D depth texture using a PBO.
void CopyFromFrameBuffer(int srcXmin, int srcYmin, int dstXmin, int dstYmin, int width, int height)
Copy a sub-part of a logical buffer of the framebuffer (color or depth) to the texture object.
bool GetLinearMagnification()
vtkRenderWindow * GetContext()
void SendParameters()
Send all the texture object parameters to the hardware if not done yet.
void Bind()
Activate the texture.
void SetContext(vtkRenderWindow *)
Get/Set the context.
bool Allocate2D(unsigned int width, unsigned int height, int numComps, int vtkType)
Create a 2D color texture but does not initialize its values.
bool RequireDepthBufferFloat
vtkPixelBufferObject * Download()
This is used to download raw data from the texture into a pixel bufer.
record modification and/or execution time
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.