Libprimis
Imprimis' 3D destroyable world engine
Loading...
Searching...
No Matches
Slot Struct Reference

A representation of a texture inside the engine. More...

#include <slot.h>

Inheritance diagram for Slot:
DecalSlot

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 VSlotemptyvslot ()
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< Texsts
Shader * shader
std::vector< SlotShaderParamparams
VSlotvariants
bool loaded
uint texmask
char * grass
Texture * grasstex
Texture * thumbnail

Detailed Description

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.

Member Function Documentation

◆ findtextype()

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.

Parameters
typethe type to seach for
lastthe last index to not look at
Returns
the index where the type was found

◆ loadthumbnail()

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.

Returns
a pointer to the generated Texture containing the thumbnail

The documentation for this struct was generated from the following file:
  • /github/workspace/src/libprimis-headers/slot.h