Libprimis
Imprimis' 3D destroyable world engine
|
A representation of a texture inside the engine. More...
#include <slot.h>
Classes | |
struct | Tex |
Public Types | |
enum | { SlotType_Octa , SlotType_Material , SlotType_Decal } |
Public Member Functions | |
Slot (int index=-1) | |
virtual int | type () const |
virtual const char * | name () const |
virtual const char * | texturedir () const |
virtual VSlot & | emptyvslot () |
virtual int | cancombine (int type) const |
virtual bool | shouldpremul (int) const |
int | findtextype (int type, int last=-1) const |
Attempts to find a tex with index type. | |
void | load (int index, Slot::Tex &t) |
void | load () |
Texture * | loadthumbnail () |
Returns a new texture that is a thumbnail of the slot's texture. | |
void | reset () |
void | cleanup () |
Public Attributes | |
int | index |
int | smooth |
std::vector< Tex > | sts |
Shader * | shader |
std::vector< SlotShaderParam > | params |
VSlot * | variants |
bool | loaded |
uint | texmask |
char * | grass |
Texture * | grasstex |
Texture * | thumbnail |
A representation of a texture inside the engine.
A texture slot represents the texture and shader information for a single application onto an octree face. This includes a diffuse texture, as well as other shader-defined textures such as normal, parallax, and specular maps if they are part of the shader configuration of the slot object.
int Slot::findtextype | ( | int | type, |
int | last = -1 ) const |
Attempts to find a tex with index type.
Searches for a tex with the type passed, searching only for the part of the sts vector after last
. If none is found, returns -1.
type | the type to seach for |
last | the last index to not look at |
Texture * Slot::loadthumbnail | ( | ) |
Returns a new texture that is a thumbnail of the slot's texture.
Creates a new texture on the heap representing a scaled-down version of the slot's diffuse map.