Textures Class
The mainTextures class handles texture loading, binding, and management.
Constructor
TexturePackRepository*
Texture pack repository
Options*
Game options for anaglyph mode, etc.
Texture Loading
loadTexture (by name)
TEXTURE_NAME
Texture ID enum value
const wstring&
Resource path (e.g., “terrain/sun”)
loadTexture (by index)
int
Pre-loaded texture index
getTexture
BufferedImage*
Source image
C4JRender::eTextureFormat
default:"TEXTURE_FORMAT_RxGyBzAw"
Texture format
bool
default:"true"
Generate mipmaps
Texture Binding
bindTexture (by name)
const wstring&
Resource path
bindTexture (by ID)
int
Texture ID
bind
int
OpenGL texture ID
clearLastBoundId
Dynamic Textures
loadHttpTexture
const wstring&
HTTP URL to load texture from
const wstring& or int
Fallback texture (resource name or ID)
addHttpTexture
const wstring&
HTTP URL
HttpTextureProcessor*
Custom texture processor
removeHttpTexture
hasHttpTexture
Memory Textures (Console-specific)
loadMemTexture
addMemTexture
removeMemTexture
Texture Updates
replaceTexture
intArray
Raw ARGB pixel data
int
Texture width
int
Texture height
int
OpenGL texture ID
replaceTextureDirect
releaseTexture
int
OpenGL texture ID to release
Texture Pack Management
reloadAll
stitch
tick
bool
Whether to update texture data
bool
default:"true"
Whether to tick dynamic textures (water, lava)
Utility Methods
readImage
TEXTURE_NAME
Texture ID
const wstring&
Resource name
getMissingIcon
int
Icon type (0 = block, 1 = item)
IsTUImage / IsOriginalImage
Static Settings
TexturePackRepository Class
Manages available texture packs and texture pack selection.Constructor
File
Directory containing texture packs
Minecraft*
Minecraft instance
Texture Pack Selection
selectSkin
TexturePack*
Texture pack to select
true if successful.
selectTexturePackById
DWORD
Texture pack ID
getSelected
isUsingDefaultSkin
Texture Pack Management
updateList
getAll
getTexturePackById
DWORD
Texture pack ID
getTexturePackCount
getTexturePackByIndex
addTexturePackFromDLC
DLCPack*
DLC pack containing texture pack
DWORD
Texture pack ID
Constants
AbstractTexturePack Class
Base class for texture pack implementations.Constructor
DWORD
Unique texture pack ID
File*
Texture pack file or directory
const wstring&
Texture pack name
TexturePack*
Fallback texture pack for missing resources
Resource Access
getResource
const wstring&
Resource path (e.g., “terrain.png”)
bool
Whether to use fallback pack if resource not found
hasFile
getImageResource
Pack Information
getId
getName
getDesc1 / getDesc2
getWorldName
Loading/Unloading
load
unload
loadUI / unloadUI
loadColourTable
getColourTable
Pack Icon
getPackIcon
DWORD&
Output: size of image data in bytes
Texture Name Enum
Pre-defined texture IDs:Example Usage
Basic Texture Loading
Changing Texture Packs
Loading Player Skins
Animated Textures
Custom Texture Replacement
Texture Pack Information
Performance Considerations
- Texture atlases (stitched terrain/items) reduce draw calls
- Mipmaps improve rendering quality but use more VRAM
- HTTP textures are cached to avoid repeated downloads
- Anaglyph processing is expensive; only enable when needed