Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::resource Namespace Reference

Classes

class  Handle
 Type-safe resource handle. More...
class  SharedHandle
 RAII wrapper around Handle that auto-releases on destruction. More...
class  MeshArena
struct  ResourceStats
 Statistics about resource usage. More...
class  ResourceManager
 Central manager for GPU resources. More...
class  ResourcePoolBase
 Abstract base class for resource pools. More...
class  ResourcePool
 Typed resource pool with reference counting. More...
struct  SourceLine
 A (file, line) pair identifying an original source location. More...
struct  ShaderProperty
struct  ShaderSwitch
 A material-controlled static switch (#pragma switch): a boolean the material sets, selecting a compile-time shader permutation via a #define. Distinct from #pragma feature (an engine-chosen variant keyword) only in being material-facing + defaulted. More...
struct  ParsedShader
 Result of parsing an .esshader file. More...
class  ShaderParser
 Parser for .esshader unified shader format. More...
struct  SliceBorder
 Nine-slice border definition for UI sprites. More...
 Metadata associated with a texture resource. More...

Typedefs

using ShaderHandle = Handle<esengine::Shader>
 Handle to a shader resource.
using TextureHandle = Handle<esengine::Texture>
 Handle to a texture resource.
using VertexBufferHandle = Handle<esengine::VertexBuffer>
 Handle to a vertex buffer resource.
using IndexBufferHandle = Handle<esengine::IndexBuffer>
 Handle to an index buffer resource.
using MeshHandle = Handle<esengine::Mesh>
 Handle to GPU-resident geometry.
using EnvironmentHandle = Handle<esengine::Environment>
 Handle to a baked environment (irradiance + prefiltered reflection).
using ProbeVolumeHandle = Handle<esengine::ProbeVolume>
 Handle to a grid of baked irradiance.
using SpineDataHandle = Handle<esengine::spine::SpineSkeletonData>
 Handle to a Spine skeleton data resource (vestigial — see fwd decl).
using BitmapFontHandle = Handle<esengine::text::BitmapFont>
 Handle to a bitmap font resource.
using SharedShaderHandle = SharedHandle<esengine::Shader>
 RAII handle to a shader resource.
using SharedTextureHandle = SharedHandle<esengine::Texture>
 RAII handle to a texture resource.
using SharedBitmapFontHandle = SharedHandle<esengine::text::BitmapFont>
 RAII handle to a bitmap font resource.
using ShaderIncludeResolver = std::function<std::optional<std::string>(const std::string&)>
 Resolves an #include path to its file contents.

Enumerations

enum class  ResourceContent : u32 {
  Transient = 0 , Retained = 1 , Asset = 2 , Canvas = 3 ,
  Video = 4 , Mesh = 5 , GlyphPage = 6 , AtlasPage = 7 ,
  Composed = 8
}
 Who refills a resource's GPU content after a device loss. More...
enum class  ParseState {
  Global , Properties , Vertex , Fragment ,
  Variant , VertexHook
}
enum class  ShaderTargetLanguage : u8 { GLSL_ES300 = 0 , WGSL = 1 }
 Target language for stage assembly (REARCH_WGSL dual emission). More...
enum class  ShaderStage : u8 { Vertex , Fragment }
enum class  ShaderPropertyType : u8 {
  Float , Vec2 , Vec3 , Vec4 ,
  Color , Int , Texture , Unknown
}

Functions

f32 meshUvDensity (const u8 *vertexBytes, usize vertexByteCount, u32 vertexStride, u32 positionOffset, u32 uvOffset, const u32 *indices, usize indexCount)
GfxContent toGfxContent (ResourceContent content)
 The device's policy for a content code; unknown codes are Asset, the one that asks.

Typedef Documentation

◆ BitmapFontHandle

Handle to a bitmap font resource.

Definition at line 238 of file Handle.hpp.

◆ EnvironmentHandle

Handle to a baked environment (irradiance + prefiltered reflection).

Definition at line 229 of file Handle.hpp.

◆ IndexBufferHandle

Handle to an index buffer resource.

Definition at line 223 of file Handle.hpp.

◆ MeshHandle

Handle to GPU-resident geometry.

Definition at line 226 of file Handle.hpp.

◆ ProbeVolumeHandle

Handle to a grid of baked irradiance.

Definition at line 232 of file Handle.hpp.

◆ ShaderHandle

Handle to a shader resource.

Definition at line 214 of file Handle.hpp.

◆ ShaderIncludeResolver

using esengine::resource::ShaderIncludeResolver = std::function<std::optional<std::string>(const std::string&)>

Resolves an #include path to its file contents.

Return std::nullopt to signal "not found" — the parser will report a descriptive error. Resolvers are free to cache, normalize paths, or delegate to a virtual filesystem.

Definition at line 42 of file ShaderParser.hpp.

◆ SharedBitmapFontHandle

RAII handle to a bitmap font resource.

Definition at line 247 of file Handle.hpp.

◆ SharedShaderHandle

RAII handle to a shader resource.

Definition at line 241 of file Handle.hpp.

◆ SharedTextureHandle

RAII handle to a texture resource.

Definition at line 244 of file Handle.hpp.

◆ SpineDataHandle

using esengine::resource::SpineDataHandle = Handle<esengine::spine::SpineSkeletonData>

Handle to a Spine skeleton data resource (vestigial — see fwd decl).

Definition at line 235 of file Handle.hpp.

◆ TextureHandle

Handle to a texture resource.

Definition at line 217 of file Handle.hpp.

◆ VertexBufferHandle

Handle to a vertex buffer resource.

Definition at line 220 of file Handle.hpp.

Enumeration Type Documentation

◆ ParseState

enum class esengine::resource::ParseState
strong
Enumerator
Global 
Properties 
Vertex 
Fragment 
Variant 
VertexHook 

Definition at line 815 of file ShaderParser.cpp.

◆ ResourceContent

Who refills a resource's GPU content after a device loss.

Numbered for the host boundary, where a texture's creator states it: only the creator knows whether it can make the pixels again.

Enumerator
Transient 

Rewritten by its owner before every use (a video frame).

Retained 

The device keeps the bytes (a tile collection composed at load).

Asset 

The asset layer loads it again from its path.

Canvas 

Redrawn from the canvas it mirrors.

Video 

Refilled by the next decoded frame.

Mesh 

Geometry the asset layer replays (MeshRecovery::SourceReplayable).

GlyphPage 

Repainted from the glyphs placed on it.

AtlasPage 

A skeleton's atlas page, decoded again from its image.

Composed 

Composed again by its creator from its sources (a terrain's layer arrays).

Definition at line 50 of file ResourceManager.hpp.

◆ ShaderPropertyType

Enumerator
Float 
Vec2 
Vec3 
Vec4 
Color 
Int 
Texture 
Unknown 

Definition at line 85 of file ShaderParser.hpp.

◆ ShaderStage

enum class esengine::resource::ShaderStage : u8
strong
Enumerator
Vertex 
Fragment 

Definition at line 76 of file ShaderParser.hpp.

◆ ShaderTargetLanguage

Target language for stage assembly (REARCH_WGSL dual emission).

Both languages assemble from one ParsedShader: GLSL stages carry the authored GLSL bodies; WGSL stages carry the file's #pragma vertex wgsl / #pragma fragment wgsl twin sections. The injected headers (TimeConstants/MaterialConstants/texture params/Lit) and the canonical 2D vertex stage are emitted per language.

Enumerator
GLSL_ES300 
WGSL 

Definition at line 71 of file ShaderParser.hpp.

Function Documentation

◆ meshUvDensity()

f32 esengine::resource::meshUvDensity ( const u8 * vertexBytes,
usize vertexByteCount,
u32 vertexStride,
u32 positionOffset,
u32 uvOffset,
const u32 * indices,
usize indexCount )
inline

Definition at line 25 of file MeshUvDensity.hpp.

◆ toGfxContent()