H3D API  2.4.1
RenderTargetTexture.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // Any use, or distribution, of this file without permission from the
5 // copyright holders is strictly prohibited. Please contact SenseGraphics,
6 // www.sensegraphics.com, for more information.
7 //
8 //
12 //
14 #ifndef __RENDERTARGETTEXTURE_H__
15 #define __RENDERTARGETTEXTURE_H__
16 
17 #include <H3D/X3DTextureNode.h>
19 
20 namespace H3D {
21 
39  class H3DAPI_API RenderTargetTexture : public H3DSingleTextureNode {
40  public:
41 
43 
45  RenderTargetTexture( Inst< DisplayList > _displayList = 0,
46  Inst< SFNode > _metadata = 0,
47  Inst< SFFrameBufferTextureGenerator > _generator = 0,
48  Inst< SFInt32 > _index = 0);
49 
51  virtual ~RenderTargetTexture() {}
52 
55  virtual void render();
56 
59  virtual void postRender();
60 
63  virtual void preRender();
64 
67  virtual void enableTexturing();
68 
71  virtual void disableTexturing();
72 
75  virtual GLuint getTextureId();
76 
79  virtual GLuint getTextureUnit();
80 
83  virtual GLenum getTextureTarget();
84 
87  virtual int getTextureWidth();
88 
91  virtual int getTextureHeight();
92 
95  virtual int getTextureDepth();
96 
99  virtual void setTextureId( GLuint id );
102  virtual void setTextureUnit( GLint unit );
105  virtual void setTextureTarget( GLenum target );
106 
108  virtual bool makeResident ();
109 
111  virtual void makeNonResident ();
112 
114  virtual bool isResident ();
115 
117  virtual GLuint64 getTextureHandle();
118 
123  virtual void invalidateTextureHandle ();
124 
129  virtual void inUse ();
130 
135  H3DUniquePtr< SFFrameBufferTextureGenerator > generator;
136 
142  H3DUniquePtr< SFInt32 > index;
143 
146 
147  protected:
150  virtual std::pair<H3DInt32,H3DInt32> getDefaultSaveDimensions ();
151 
152  };
153 }
154 
155 #endif
Header file for FrameBufferTextureGenerator.
Header file for X3DTextureNode, X3D abstract texture scene-graph node.
This abstract node type is the base type for all texture nodes that is defined by a single texture.
Definition: H3DSingleTextureNode.h:45
The RenderTargetTexture is a wrapper node to use one of the render targets(color textures) from a Fra...
Definition: RenderTargetTexture.h:39
H3DUniquePtr< SFInt32 > index
The index field indicates which render target (color texture) to use from the FrameBufferTextureGener...
Definition: RenderTargetTexture.h:142
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: RenderTargetTexture.h:145
H3DUniquePtr< SFFrameBufferTextureGenerator > generator
The generator field contains the FrameBufferTextureGenerator node from which to use a render target (...
Definition: RenderTargetTexture.h:135
virtual ~RenderTargetTexture()
Destructor.
Definition: RenderTargetTexture.h:51
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194