|
srp
software rendering pipeline
|
Texture mapping. More...

Files | |
| file | texture.h |
| enum | SRPTextureWrappingMode { TW_REPEAT , TW_CLAMP_TO_EDGE } |
| enum | SRPTextureParameter { SRP_TEXTURE_WRAPPING_MODE_X , SRP_TEXTURE_WRAPPING_MODE_Y } |
| typedef struct SRPTexture | SRPTexture |
| typedef enum SRPTextureParameter | SRPTextureParameter |
| SRPTexture * | srpNewTexture (const char *image, SRPTextureWrappingMode wrappingModeX, SRPTextureWrappingMode wrappingModeY) |
| void | srpFreeTexture (SRPTexture *this) |
| void | srpTextureGetFilteredColor (const SRPTexture *this, float u, float v, float out[4]) |
| int | srpTextureGet (SRPTexture *this, SRPTextureParameter parameter) |
| void | srpTextureSet (SRPTexture *this, SRPTextureParameter parameter, int data) |
Texture mapping.
| typedef struct SRPTexture SRPTexture |
A structure to represent a texture
| typedef enum SRPTextureParameter SRPTextureParameter |
Holds all possible arguments to SRPTexture getters and setters
| enum SRPTextureParameter |
Holds all possible arguments to SRPTexture getters and setters
Holds texture wrapping modes
| Enumerator | |
|---|---|
| TW_REPEAT | Repeat the texture when it's wrapped |
| TW_CLAMP_TO_EDGE | Clamp the texture to the edge when it's wrapped |
| void srpFreeTexture | ( | SRPTexture * | this | ) |
Free a texture
| [in] | this | A pointer to the texture, as returned by srpNewTexture() |
| SRPTexture * srpNewTexture | ( | const char * | image, |
| SRPTextureWrappingMode | wrappingModeX, | ||
| SRPTextureWrappingMode | wrappingModeY | ||
| ) |
Initialize a texture by loading an image
| [in] | image | A filesystem path to an image. Most popular image types are supported |
| [in] | wrappingModeX,wrappingModeY | Wrapping modes to use in X and Y axes |
| int srpTextureGet | ( | SRPTexture * | this, |
| SRPTextureParameter | parameter | ||
| ) |
Get a parameter from existing SRPTexture
| [in] | this | A pointer to texture |
| [in] | parameter | A struct member to get |
| void srpTextureGetFilteredColor | ( | const SRPTexture * | this, |
| float | u, | ||
| float | v, | ||
| float | out[4] | ||
| ) |
Get a texel color at u, v by filtering the texture using specified modes
| [in] | this | A pointer to the texture, as returned by srpNewTexture() |
| [in] | u,v | Coordinates of the requested texel |
| [out] | out | An array of 4 values each in [0, 1] interval, representing RGBA8888 color (0.0 = 0x0; 1.0 = 0xFF) |
| void srpTextureSet | ( | SRPTexture * | this, |
| SRPTextureParameter | parameter, | ||
| int | data | ||
| ) |
Set a parameter to existing SRPTexture
| [in] | this | A pointer to texture |
| [in] | parameter | A struct member to set to |
| [in] | data | A value to set |