Coin
4.0.3
Coin3D core library
|
The SoGLCubeMapImage class is used to handle cube map textures. More...
#include <include/Inventor/misc/SoGLCubeMapImage.h>
Public Types | |
enum | Target { NEGATIVE_X = 0 , POSITIVE_X , NEGATIVE_Y , POSITIVE_Y , NEGATIVE_Z , POSITIVE_Z } |
Public Types inherited from SoGLImage | |
enum | Flags { SCALE_DOWN = 0x0001 , NO_MIPMAP = 0x0002 , LINEAR_MAG_FILTER = 0x0004 , LINEAR_MIN_FILTER = 0x0008 , LINEAR_MIPMAP_FILTER = 0x0010 , FORCE_TRANSPARENCY_TRUE = 0x0020 , FORCE_TRANSPARENCY_FALSE = 0x0040 , FORCE_ALPHA_TEST_TRUE = 0x0080 , FORCE_ALPHA_TEST_FALSE = 0x0100 , INVINCIBLE = 0x0200 , RECTANGLE = 0x0400 , COMPRESSED = 0x0800 , USE_QUALITY_VALUE = 0X8000 } |
enum | ResizeReason { IMAGE = 0 , SUBIMAGE , MIPMAP } |
typedef SbBool | SoGLImageResizeCB(SoState *state, const SbVec3s &newsize, unsigned char *destbuffer, ResizeReason reason, void *closure, class SoGLImage *image) |
enum | Wrap { REPEAT = 0 , CLAMP , CLAMP_TO_EDGE , CLAMP_TO_BORDER } |
Static Public Member Functions | |
static SoType | getClassTypeId (void) |
static void | initClass (void) |
Static Public Member Functions inherited from SoGLImage | |
static void | beginFrame (SoState *state) |
static void | endFrame (SoState *state) |
static void | freeAllImages (SoState *state=NULL) |
static SoType | getClassTypeId (void) |
static void | initClass (void) |
static void | setDisplayListMaxAge (const uint32_t maxage) |
static void | setResizeCallback (SoGLImageResizeCB *f, void *closure) |
static void | tagImage (SoState *state, SoGLImage *image) |
Additional Inherited Members | |
Protected Member Functions inherited from SoGLImage | |
virtual | ~SoGLImage () |
void | incAge (void) const |
void | resetAge (void) const |
virtual void | unrefOldDL (SoState *state, const uint32_t maxage) |
The SoGLCubeMapImage class is used to handle cube map textures.
Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
SoGLCubeMapImage::SoGLCubeMapImage | ( | void | ) |
Constructor.
This static method returns the SoType object associated with objects of this class.
|
virtual |
Returns or creates a SoGLDisplayList to be used for rendering. Returns NULL if no SoGLDisplayList could be created.
Reimplemented from SoGLImage.
This static method initializes static data for the SoGLCubeMapImage class.
|
virtual |
Sets the data for this GL image. Should only be called when one of the parameters have changed, since this will cause the GL texture object to be recreated. Caller is responsible for sending legal wrap values. CLAMP_TO_EDGE is only supported on OpenGL v1.2 implementations, and as an extension on some earlier SGI implementations (GL_SGIS_texture_edge_clamp).
For now, if quality > 0.5 when created, we create mipmaps, otherwise a regular texture is created. Be aware, if you for instance create a texture with texture quality 0.4, and then later try to apply the texture with a texture quality greater than 0.5, the texture object will be recreated as a mipmap texture object. This will happen only once though, of course.
If border != 0, the OpenGL texture will be created with this border size. Be aware that this might be extremely slow on most PC hardware.
Normally, the OpenGL texture object isn't created until the first time it is needed, but if createinstate is != NULL, the texture object is created immediately. This is useful if you use a temporary buffer to hold the texture data. Be careful when using this feature, since the texture data might be needed at a later stage (for instance to create a texture object for another context). It will not be possible to create texture objects for other cache contexts when createinstate is != NULL.
Also if createinstate is supplied, and all the attributes are the same as the current data in the image, glTexSubImage() will be used to insert the image data instead of creating a new texture object. This is much faster on most OpenGL drivers, and is very useful, for instance when doing animated textures.
If you supply NULL for image, the instance will be reset, causing all display lists and memory to be freed.
Reimplemented from SoGLImage.
This class has a private destructor since we want users to supply the current GL state when deleting the image. This is to make sure GL texture objects are freed as soon as possible. If you supply NULL to this method, the GL texture objects won't be deleted until the next time an GLRenderAction is applied in the image's cache context(s).
Reimplemented from SoGLImage.