crystalspace.jbind.interfaces.iengine.texture
Interface iTextureWrapper

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csTextureWrapper

public interface iTextureWrapper
extends iBase

A texture wrapper is an engine-level object that wraps around an actual texture (iTextureHandle). Every texture in the engine is represented by a texture wrapper, which keeps the pointer to the texture handle, its name, and possibly the base image object.

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiTextureWrapper.php

Method Summary
 iTextureWrapper Clone()
          Create a clone this texture wrapper, using the same texture handle.
 int getFlags()
          Return the flags which are used to register the texture.
 iImage getImageFile()
          Get the iImage.
 int[] getKeyColor()
          Query the transparent color.
 iTextureHandle getTextureHandle()
          Get the texture handle.
 iTextureCallback getUseCallback()
          Get the use callback.
 boolean isVisitRequired()
          Return true if it is needed to call Visit();.
 boolean keepImage()
          If this flag is true then the image will be kept even after calling Register.
 iObject queryObject()
          Get the iObject for this texture.
 void register(iTextureManager txtmng)
          Register the texture with the texture manager.
 void setFlags(int flags)
          Set the flags which are used to register the texture.
 void setImageFile(iImage Image)
          Change the base iImage.
 void setKeepImage(boolean k)
          Set the keep image flag.
 void setKeyColor(int red, int green, int blue)
          Set the transparent color.
 void setTextureHandle(iTextureHandle tex)
          Change the texture handle.
 void setUseCallback(iTextureCallback callback)
          Set a callback which is called just before the texture is used.
 void visit()
          Visit this texture.
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

Clone

public iTextureWrapper Clone()
Create a clone this texture wrapper, using the same texture handle.

Returns:

getFlags

public int getFlags()
Return the flags which are used to register the texture.

Returns:

getImageFile

public iImage getImageFile()
Get the iImage.

Returns:

getKeyColor

public int[] getKeyColor()
Query the transparent color.

Returns:

getTextureHandle

public iTextureHandle getTextureHandle()
Get the texture handle. Referenced by csShaderVariable::SetValue();.

Returns:

getUseCallback

public iTextureCallback getUseCallback()
Get the use callback. If there are multiple use callbacks you can use this function to chain.

Returns:

isVisitRequired

public boolean isVisitRequired()
Return true if it is needed to call Visit();.

Returns:

keepImage

public boolean keepImage()
If this flag is true then the image will be kept even after calling Register. If this flag is false then Register(); will remove the image pointer from this texture wrapper. False by default.

Returns:

queryObject

public iObject queryObject()
Get the iObject for this texture.

Returns:

register

public void register(iTextureManager txtmng)
Register the texture with the texture manager.

Parameters:
txtmng -

setFlags

public void setFlags(int flags)
Set the flags which are used to register the texture.

Parameters:
flags -

setImageFile

public void setImageFile(iImage Image)
Change the base iImage. The changes will not be visible until the texture is registered again.

Parameters:
Image -

setKeepImage

public void setKeepImage(boolean k)
Set the keep image flag. See KeepImage(); function for explanation.

Parameters:
k -

setKeyColor

public void setKeyColor(int red,
                        int green,
                        int blue)
Set the transparent color.

Parameters:
red -
green -
blue -

setTextureHandle

public void setTextureHandle(iTextureHandle tex)
Change the texture handle. The changes will immediatly be visible. This will also change the key color and registration flags to those of the new texture and the iImage to 0.

Parameters:
tex -

setUseCallback

public void setUseCallback(iTextureCallback callback)
Set a callback which is called just before the texture is used. This is mainly useful for procedural textures which can then choose to update their image.

Parameters:
callback -

visit

public void visit()
Visit this texture. This should be called by the engine right before using the texture. It is responsible for calling the use callback if there is one.