![]() |
VR-Forces Developer's Guide
|
Interface for a texture. Used to pass in a texture to vrvGraphics.

Classes | |
| class | CpuBufferLoadCallback |
Public Member Functions | |
| DtOsgTextureWrapper (DtDe &, osg::Texture *node) | |
| virtual | ~DtOsgTextureWrapper () |
| DtOsgTextureWrapper ()=delete | |
| DtOsgTextureWrapper (const DtOsgTextureWrapper &)=delete | |
| DtOsgTextureWrapper & | operator= (const DtOsgTextureWrapper &)=delete |
| virtual bool | loadTextureFromFile (const std::string &fileName) override |
| virtual bool | loadTextureFromFile (const std::string &fileName, const DtFileCache::LoadFileOptions &loadFileOptions) override |
| virtual bool | getStipplePattern (char **stipplePattern) override |
| virtual bool | valid () const override |
| virtual void | releaseGLObjects () |
| virtual void | setMinFilter (osg::Texture::FilterMode) |
| virtual osg::Texture::FilterMode | minFilter () |
| virtual void | setMagFilter (osg::Texture::FilterMode) |
| virtual osg::Texture::FilterMode | magFilter () |
| virtual void | setWrapModeS (osg::Texture::WrapMode) |
| virtual osg::Texture::WrapMode | wrapModeS () |
| virtual void | setWrapModeT (osg::Texture::WrapMode) |
| virtual osg::Texture::WrapMode | wrapModeT () |
| virtual bool | allocateGpuStorage (const std::string &key, int width, int height) override |
| virtual void | setCpuBackingBuffer (const uint8_t *pixels) override |
| virtual bool | markCpuBackingBufferDirty () override |
| unsigned int | glHandle (unsigned int contextId=0) const |
| void | imageSize (int &width, int &height) const |
| virtual bool | loadTexture (const std::string &filename, osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter, osg::Texture::WrapMode s, osg::Texture::WrapMode t, const DtFileCache::LoadFileOptions &loadFileOptions) |
| virtual float | textureWidth () const override |
| virtual const std::string & | filename () const override |
| virtual void | scaleTexture (int w, int h) override |
| virtual DtVector4< float > | color (unsigned int x, unsigned int y) const override |
| virtual void | setTexture (const std::string fileName, osg::Texture *texture) |
| virtual osg::Texture * | texture () const |
Public Member Functions inherited from makVrv::DtTextureInterface | |
| DtTextureInterface () | |
| virtual | ~DtTextureInterface () |
| DtTextureInterface (const DtTextureInterface &)=delete | |
| DtTextureInterface & | operator= (const DtTextureInterface &)=delete |
| virtual bool | enqueueSubRegion (int x, int y, int width, int height, const uint8_t *rgbaPixels) |
Protected Attributes | |
| DtDe & | myDe |
| DtOsgFileCache * | myOsgFileCache |
| std::string | myFilename |
| osg::Texture::FilterMode | myMinFilter |
| osg::Texture::FilterMode | myMagFilter |
| osg::Texture::WrapMode | myWrapModeS |
| osg::Texture::WrapMode | myWrapModeT |
| osg::ref_ptr< osg::Texture > | myTexture |
| DtSignalConnectionManager | myConnectionManager |
Private Attributes | |
| osg::ref_ptr < CpuBufferLoadCallback > | myLoadCallback |
| makVrv::DtOsgTextureWrapper::DtOsgTextureWrapper | ( | DtDe & | , |
| osg::Texture * | node | ||
| ) |
Constructor.
|
virtual |
Destructor.
|
delete |
not allowed - default constructor
|
delete |
not allowed - copy constructor
|
delete |
not allowed - equals operator
|
overridevirtual |
Attempt to load a texture from file Returns true if loaded successfully Calls loadTexture with default params.
Implements makVrv::DtTextureInterface.
|
overridevirtual |
Implements makVrv::DtTextureInterface.
|
virtual |
Set/Get myTexture.
|
virtual |
Set/Get myTexture.
|
overridevirtual |
Get the 32x32 stipple pattern representation of this texture.
Implements makVrv::DtTextureInterface.
|
overridevirtual |
Returns whether or not this wrapper contains a valid texture.
Implements makVrv::DtTextureInterface.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
overridevirtual |
Allocate uninitialised GPU storage of the given dimensions and install the internal CpuBufferLoadCallback. After this call, attach a CPU pixel buffer with setCpuBackingBuffer() and trigger uploads with markCpuBackingBufferDirty().
Reimplemented from makVrv::DtTextureInterface.
|
overridevirtual |
Attach the CPU pixel buffer for a CpuBufferLoadCallback-backed texture. Forwards to the installed callback. No-op if no callback is installed.
| pixels | Non-owning pointer; caller retains ownership and must keep valid for the lifetime of this texture. |
Reimplemented from makVrv::DtTextureInterface.
|
overridevirtual |
Mark the CPU backing buffer dirty so it is re-uploaded on the next render frame. No-op if the texture was not created via allocateGpuStorage().
Reimplemented from makVrv::DtTextureInterface.
Return the GL texture handle for the given OSG context id. Returns 0 when the texture has not yet been uploaded to the GPU.
Return the pixel dimensions of the stored osg::Image (available before GL upload). Both are zero when no image is present.
|
virtual |
Attempt to load the texture file, returns true if success.
|
overridevirtual |
Implements makVrv::DtTextureInterface.
|
overridevirtual |
Returns the name of the file that the texture was created from. Returns "" by default, for example if the texture was not initialized.
Implements makVrv::DtTextureInterface.
Implements makVrv::DtTextureInterface.
|
overridevirtual |
overridden
Implements makVrv::DtTextureInterface.
|
protected |
|
protected |
|
protected |
|
protected |
Default NEAREST.
|
protected |
Default LINEAR.
|
protected |
Default REPEAT.
|
protected |
Default REPEAT.
|
protected |
|
protected |
|
private |