#include <ivf/IvfTexture.h>
Inheritance diagram for CIvfTexture:
Public Member Functions | |
CIvfTexture () | |
virtual | ~CIvfTexture () |
IvfClassInfo ("CIvfTexture", CIvfObject) | |
void | setTextureEnvColor (float red, float green, float blue, float alfa) |
void | setEnvColor (float red, float green, float blue, float alfa) |
void | getTextureEnvColor (float &red, float &green, float &blue, float &alfa) |
void | getEnvColor (float &red, float &green, float &blue, float &alfa) |
void | setGenerateMipmaps (bool flag) |
void | setTextureMode (GLenum mode) |
void | setMode (GLenum mode) |
void | setFilters (GLenum minFilter, GLenum magFilter) |
void | setTextureRepeat (GLenum repeatS, GLenum repeatT) |
void | setRepeat (GLenum repeatS, GLenum repeatT) |
void | setTextureModifier (double scaleX, double scaleY, double rotate) |
void | setModifier (double scaleX, double scaleY, double rotate) |
void | setTextureTranslate (double x, double y) |
void | setTranslate (double x, double y) |
void | setImage (CIvfImage *image) |
void | setImageMap (void *imageMap) |
void | setSize (int width, int height) |
void | getSize (int &width, int &height) |
bool | isBound () |
void | apply () |
void | bind () |
GLuint | getName () |
void | setLoadImages (bool flag) |
void | setGenerateName (bool flag) |
void | setName (GLuint name) |
void | activate () |
void | deactivate () |
bool | isActive () |
The IvfTexture class manages a texture in OpenGL. All shape nodes can be assigned a IvfTexture. To be able to see a texture on a shape it must also render texture coordinates. An example of how a texture is used is shown below:
CIvfJpegImage* image = new CIvfJpegImage(); image->setFileName("textures/architecture8.jpg"); image->read(); CIvfTexture* texture = new CIvfTexture(); texture->setImage(image); texture->setFilters(GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR); texture->setGenerateMipmaps(true); . . CIvfSphere* sphere = new CIvfSphere(); sphere->setMaterial(...) sphere->setTexture(texture);
advgeom.cpp, and textures.cpp.
Definition at line 62 of file IvfTexture.h.
|
Constructor |
|
Destructor |
|
Activates texture If active, the texture will be applied in the rendering process. |
|
Applies the texture Sets the texture as the current texture in OpenGL. The bind() method must be called before the apply() method is called. |
|
Binds texture in OpenGL Binds a texture image to a texture name in OpenGL. Must be called before apply(). |
|
Activates texture If active, the texture will be applied in the rendering process. |
|
Return texture environment color |
|
Texture name This name is used in conjunction with the OpenGL command glBindTexture, to bind the texture with the geometry. Reimplemented from CIvfObject. |
|
Returns the size of the current loaded image or imagemap. |
|
Return texture environment color (Obsolete! Use getEnvColor() instead) |
|
Returns texture active state |
|
Returns true if a texture is bound |
|
Set texture environment color Corresponds to an OpenGL glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, ...); |
|
Set magnification and minification filters Values for
Values for
|
|
Mipmap generation flag |
|
Name generation flag if set to true (default) texture names will be automatically generated. If false the texture name set with setName() will be used. |
|
Sets texture image (required) Assigns an image to the texture. An image can be loaded using the ivfimage library. |
|
Set raw image map If the image has been loaded using other methods than the IvfImage class a pointer to the image can be set using this method. |
|
Image loading flag if set to true textures are not bound using glTexImage2D or glBuild2dMipmaps |
|
Set texture mode Sets the OpenGL texture function used. Values are GL_MODULATE, GL_BLEND, GL_DECAL |
|
Set texture modifiers This method sets additional texture modifiers such as scaling and rotation, which are applied using the glMatrixMode(GL_TEXTURE) |
|
Set texture name If automatic texture generation is not used this method specifies the name to use instead. |
|
Set texture repeat mode If a parameter is set to GL_CLAMP texture coordinates are clamped to [0,1] if set to GL_REPEAT OpenGL uses only the fractional part, see OpenGL reference.
|
|
Set texture image size This method should be used if a raw image map is used, to set the image size information. |
|
Set texture environment color (Obsolete! Use setEnvColor() instead) Corresponds to an OpenGL glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, ...); |
|
Set texture mode (Obsolete! Use setMode() instead) Sets the OpenGL texture function used. Values are GL_MODULATE, GL_BLEND, GL_DECAL |
|
Set texture modifiers (Obsolete! Use setModifier() instead) This method sets additional texture modifiers such as scaling and rotation, which are applied using the glMatrixMode(GL_TEXTURE) |
|
Set texture repeat mode (Obsolete! Use setRepeat instead.) If a parameter is set to GL_CLAMP texture coordinates are clamped to [0,1] if set to GL_REPEAT OpenGL uses only the fractional part, see OpenGL reference.
|
|
Set texture translation (Obsolete! use setTranslate() instead) This method sets additional texture modifiers translation, which are applied using the glMatrixMode(GL_TEXTURE) |
|
Set texture translation This method sets additional texture modifiers translation, which are applied using the glMatrixMode(GL_TEXTURE) |