le2d v0.4.3
2D game engine framework
 
Loading...
Searching...
No Matches
le Namespace Reference

Namespaces

namespace  anim
 
namespace  console
 
namespace  detail
 
namespace  drawable
 
namespace  event
 
namespace  input
 
namespace  ndc
 
namespace  shape
 
namespace  tweak
 
namespace  util
 
namespace  uv
 
namespace  viewport
 
namespace  window
 

Classes

class  AssetLoader
 Set of AssetTypeLoaders mapped to their corrseponding AssetTypes. More...
 
class  AudioBufferLoader
 
class  BasicRandom
 Stateful random number generator. More...
 
class  Context
 Central API for most of the engine / framework. More...
 
struct  ContextCreateInfo
 Context creation parameters. More...
 
class  Error
 
class  FileDataLoader
 Concrete IDataLoader that uses the filesystem. More...
 
class  FlipbookAnimationLoader
 
class  FontLoader
 
struct  FrameStats
 
struct  FullscreenInfo
 Fullscreen window parameters. More...
 
class  IAsset
 Interface for asset types. More...
 
class  IAssetTypeLoader
 Interface for a particular AssetType loader. More...
 
class  IAssetTypeLoaderCommon
 
class  IAudioBuffer
 Opaque interface for an Audio Buffer. More...
 
class  IAudioMixer
 Opaque audio mixer interface. More...
 
class  IDataLoader
 Interface for loading bytes from a data source (usually the filesystem). More...
 
class  IDrawable
 Interface for drawable types. More...
 
class  IDrawPrimitive
 Interface for drawable primitives. More...
 
class  IFont
 Opaque interface for a Font. More...
 
class  IFontAtlas
 Opaque interface for a Font Atlas. More...
 
class  IGeometry
 Interface for drawable geometry. More...
 
struct  InputTextParams
 Input Text creation parameters. More...
 
class  InstancedDrawPrimitive
 Base class for Draw Primitives using a vector of Render Instances. More...
 
class  IRenderer
 
class  IRenderPass
 Opaque interface for 2D render pass, owns a multi-sampled color RenderTarget. More...
 
class  IResource
 Interface for all shared resources in the engine. More...
 
class  IResourceFactory
 Factory for IResource derived types. More...
 
class  IShader
 Opaque interface for a Shader program. More...
 
class  ITexture
 Concrete drawable Texture. More...
 
class  ITextureBase
 Interface for drawable texture. More...
 
class  ITileSheet
 Texture with a TileSet. More...
 
class  ITweakable
 Interface for concrete Tweakables. More...
 
class  LineInput
 Interactive text input for a single line. More...
 
class  nvec2
 Normalized 2D vector. More...
 
struct  PipelineFixedState
 
struct  Primitive
 Draw primitive. More...
 
struct  RenderInstance
 Instance data for instanced rendering. More...
 
struct  RenderStats
 
class  RenderTexture
 Wraps a RenderTarget as a texture. More...
 
class  ServiceLocator
 
class  ShaderLoader
 
class  SingleDrawPrimitive
 Base class for Draw Primitives using a single Render Instance. More...
 
class  TextBuffer
 Wall of text as a single Primitive. More...
 
class  TextGeometry
 Drawable geometry for text. More...
 
class  TextureLoader
 
struct  TextureSampler
 Texture Sampler metadata. More...
 
struct  Tile
 Tile in a sprite sheet. More...
 
class  TileSet
 Sorted set of Tiles. More...
 
class  TileSetLoader
 
class  TileSheetLoader
 
struct  Transform
 2D transformation. More...
 
class  TransformAnimationLoader
 
class  Tweakable
 Tweakable wrapper over a Type value. More...
 
class  Unprojector
 
class  Uri
 
struct  UserDrawData
 
struct  Vertex
 Drawable vertex. More...
 
struct  VertexArray
 Drawable vertex array. More...
 
struct  WindowInfo
 Windowed window parameters. More...
 

Typedefs

using TransformAnimation = anim::Animation< Transform >
 
using FlipbookAnimation = anim::Animation< TileId >
 
using TransformAnimator = anim::Animator< Transform, anim::TransformSampler >
 
using FlipbookAnimator = anim::Animator< TileId, anim::FlipbookSampler >
 
using WindowCreateInfo = std::variant< WindowInfo, FullscreenInfo >
 Window creation parameters.
 
using Event = event::Event
 
using Random = BasicRandom< std::mt19937 >
 
using Viewport = std::variant< viewport::Dynamic, viewport::Letterbox >
 

Enumerations

enum class  PlatformFlag : std::uint8_t { None = 0 , ForceX11 , NoLibdecor }
 Platform flags (GLFW init hints). More...
 
enum class  WindowFlag : std::uint8_t {
  None = 0 , Decorated = 1 << 0 , Resizeable = 1 << 1 , Visible = 1 << 2 ,
  Maximized = 1 << 3 , FocusOnShow = 1 << 4 , ScaleToMonitor = 1 << 5 , ScaleFramebuffer = 1 << 6
}
 Window creation flags (GLFW window hints). More...
 
enum struct  TextHeight : std::uint8_t { Min = 8 , Default = 40 , Max = 200 }
 Strongly typed integer for text height. More...
 
enum struct  TileId : std::int32_t { None = 0 }
 Unique identifier for a Tile. More...
 
enum class  Vsync : std::int8_t {
  Strict , Adaptive , MultiBuffer , Off ,
  COUNT_
}
 

Functions

auto get_json_type_name (dj::Json const &json) -> std::string_view
 
void set_json_type_name (dj::Json &json, std::string_view type_name)
 
auto json_type_name_match (dj::Json const &json, std::string_view type_name) -> bool
 
template<typename Type >
auto is_json_type (dj::Json const &json, Type const &) -> bool
 
template<typename Type >
auto is_json_type (dj::Json const &json) -> bool
 
template<typename Type >
void set_json_type (dj::Json &json, Type const &)
 
template<typename Type >
void set_json_type (dj::Json &json)
 
template<typename Type , glm::length_t Length>
void from_json (dj::Json const &json, glm::vec< Length, Type > &vec)
 
template<typename Type , glm::length_t Length>
void to_json (dj::Json &json, glm::vec< Length, Type > const &vec)
 
template<typename Type >
void from_json (dj::Json const &json, kvf::Rect< Type > &rect)
 
template<typename Type >
void to_json (dj::Json &json, kvf::Rect< Type > const &rect)
 
void from_json (dj::Json const &json, Uri &uri)
 
void to_json (dj::Json &json, Uri const &uri)
 
void from_json (dj::Json const &json, kvf::Seconds &seconds)
 
void to_json (dj::Json &json, kvf::Seconds const &seconds)
 
void from_json (dj::Json const &json, TileId &tile_id)
 
void to_json (dj::Json &json, TileId const &tile_id)
 
void from_json (dj::Json const &json, Tile &tile)
 
void to_json (dj::Json &json, Tile const &tile)
 
void from_json (dj::Json const &json, Transform &transform)
 
void to_json (dj::Json &json, Transform const &transform)
 
void from_json (dj::Json const &json, TileSet &tile_set)
 
void to_json (dj::Json &json, TileSet const &tile_set)
 
void from_json (dj::Json const &json, anim::Keyframe< Transform > &keyframe)
 
void to_json (dj::Json &json, anim::Keyframe< Transform > const &keyframe)
 
void from_json (dj::Json const &json, anim::Timeline< Transform > &timeline)
 
void to_json (dj::Json &json, anim::Timeline< Transform > const &timeline)
 
void from_json (dj::Json const &json, anim::Animation< Transform > &animation)
 
void to_json (dj::Json &json, anim::Animation< Transform > const &animation)
 
void from_json (dj::Json const &json, anim::Keyframe< TileId > &keyframe)
 
void to_json (dj::Json &json, anim::Keyframe< TileId > const &keyframe)
 
void from_json (dj::Json const &json, anim::Timeline< TileId > &timeline)
 
void to_json (dj::Json &json, anim::Timeline< TileId > const &timeline)
 
void from_json (dj::Json const &json, anim::Animation< TileId > &animation)
 
void to_json (dj::Json &json, anim::Animation< TileId > const &animation)
 
constexpr auto uv_to_world (kvf::UvRect const &uv, glm::vec2 const target_size) -> kvf::Rect<>
 
constexpr auto world_to_uv (kvf::Rect<> const &rect) -> kvf::UvRect
 
auto vertex_bounds (std::span< Vertex const > vertices, glm::mat4 const &model) -> kvf::Rect<>
 
constexpr auto parse_vsync (std::string_view const in) -> std::optional< Vsync >
 

Variables

constexpr auto default_window_flags_v = WindowFlag::Decorated | WindowFlag::Resizeable | WindowFlag::Visible
 Default Window creation flags.
 
template<typename Type >
constexpr auto json_type_name_v = std::string_view{}
 
template<>
constexpr auto json_type_name_v< IShader > = std::string_view{"Shader"}
 
template<>
constexpr auto json_type_name_v< TileSet > = std::string_view{"TileSet"}
 
template<>
constexpr auto json_type_name_v< ITexture > = std::string_view{"Texture"}
 
template<>
constexpr auto json_type_name_v< ITileSheet > = std::string_view{"TileSheet"}
 
constexpr auto right_v = glm::vec2{1.0f, 0.0f}
 
constexpr auto up_v = glm::vec2{0.0f, 1.0f}
 
constexpr auto vsync_str_v = klib::EnumArray<Vsync, std::string_view>{"strict", "adaptive", "multi", "off"}
 

Typedef Documentation

◆ Event

using le::Event = typedef event::Event

◆ FlipbookAnimation

◆ FlipbookAnimator

◆ Random

using le::Random = typedef BasicRandom<std::mt19937>

◆ TransformAnimation

◆ TransformAnimator

◆ Viewport

using le::Viewport = typedef std::variant<viewport::Dynamic, viewport::Letterbox>

◆ WindowCreateInfo

using le::WindowCreateInfo = typedef std::variant<WindowInfo, FullscreenInfo>

Window creation parameters.

Enumeration Type Documentation

◆ PlatformFlag

enum class le::PlatformFlag : std::uint8_t
strong

Platform flags (GLFW init hints).

Enumerator
None 
ForceX11 

Force X11 backend instead of Wayland (only relevant on Linux).

NoLibdecor 

Disable libdecor (only relevant on Wayland).

◆ TextHeight

enum struct le::TextHeight : std::uint8_t
strong

Strongly typed integer for text height.

Enumerator
Min 
Default 
Max 

◆ TileId

enum struct le::TileId : std::int32_t
strong

Unique identifier for a Tile.

Enumerator
None 

◆ Vsync

enum class le::Vsync : std::int8_t
strong
Enumerator
Strict 
Adaptive 
MultiBuffer 
Off 
COUNT_ 

◆ WindowFlag

enum class le::WindowFlag : std::uint8_t
strong

Window creation flags (GLFW window hints).

Enumerator
None 
Decorated 

Window is decorated (has title bar, close button, etc).

Resizeable 

Window is resizable.

Visible 

Window is visible on creation.

Maximized 

Window is maximized on creation.

FocusOnShow 

Window is given input focus when shown.

ScaleToMonitor 

Content area is resized based on content scale changes.

ScaleFramebuffer 

Framebuffer is resized based on content scale changes.

Function Documentation

◆ from_json() [1/14]

void le::from_json ( dj::Json const &  json,
anim::Animation< TileId > &  animation 
)

◆ from_json() [2/14]

void le::from_json ( dj::Json const &  json,
anim::Animation< Transform > &  animation 
)

◆ from_json() [3/14]

void le::from_json ( dj::Json const &  json,
anim::Keyframe< TileId > &  keyframe 
)

◆ from_json() [4/14]

void le::from_json ( dj::Json const &  json,
anim::Keyframe< Transform > &  keyframe 
)

◆ from_json() [5/14]

void le::from_json ( dj::Json const &  json,
anim::Timeline< TileId > &  timeline 
)

◆ from_json() [6/14]

void le::from_json ( dj::Json const &  json,
anim::Timeline< Transform > &  timeline 
)

◆ from_json() [7/14]

template<typename Type , glm::length_t Length>
void le::from_json ( dj::Json const &  json,
glm::vec< Length, Type > &  vec 
)

◆ from_json() [8/14]

template<typename Type >
void le::from_json ( dj::Json const &  json,
kvf::Rect< Type > &  rect 
)

◆ from_json() [9/14]

void le::from_json ( dj::Json const &  json,
kvf::Seconds &  seconds 
)

◆ from_json() [10/14]

void le::from_json ( dj::Json const &  json,
Tile tile 
)

◆ from_json() [11/14]

void le::from_json ( dj::Json const &  json,
TileId tile_id 
)

◆ from_json() [12/14]

void le::from_json ( dj::Json const &  json,
TileSet tile_set 
)

◆ from_json() [13/14]

void le::from_json ( dj::Json const &  json,
Transform transform 
)

◆ from_json() [14/14]

void le::from_json ( dj::Json const &  json,
Uri uri 
)

◆ get_json_type_name()

auto le::get_json_type_name ( dj::Json const &  json) -> std::string_view

◆ is_json_type() [1/2]

template<typename Type >
auto le::is_json_type ( dj::Json const &  json) -> bool

◆ is_json_type() [2/2]

template<typename Type >
auto le::is_json_type ( dj::Json const &  json,
Type const &   
) -> bool

◆ json_type_name_match()

auto le::json_type_name_match ( dj::Json const &  json,
std::string_view  type_name 
) -> bool

◆ parse_vsync()

constexpr auto le::parse_vsync ( std::string_view const  in) -> std::optional<Vsync>
constexpr

◆ set_json_type() [1/2]

template<typename Type >
void le::set_json_type ( dj::Json &  json)

◆ set_json_type() [2/2]

template<typename Type >
void le::set_json_type ( dj::Json &  json,
Type const &   
)

◆ set_json_type_name()

void le::set_json_type_name ( dj::Json &  json,
std::string_view  type_name 
)

◆ to_json() [1/14]

void le::to_json ( dj::Json &  json,
anim::Animation< TileId > const &  animation 
)

◆ to_json() [2/14]

void le::to_json ( dj::Json &  json,
anim::Animation< Transform > const &  animation 
)

◆ to_json() [3/14]

void le::to_json ( dj::Json &  json,
anim::Keyframe< TileId > const &  keyframe 
)

◆ to_json() [4/14]

void le::to_json ( dj::Json &  json,
anim::Keyframe< Transform > const &  keyframe 
)

◆ to_json() [5/14]

void le::to_json ( dj::Json &  json,
anim::Timeline< TileId > const &  timeline 
)

◆ to_json() [6/14]

void le::to_json ( dj::Json &  json,
anim::Timeline< Transform > const &  timeline 
)

◆ to_json() [7/14]

template<typename Type , glm::length_t Length>
void le::to_json ( dj::Json &  json,
glm::vec< Length, Type > const &  vec 
)

◆ to_json() [8/14]

template<typename Type >
void le::to_json ( dj::Json &  json,
kvf::Rect< Type > const &  rect 
)

◆ to_json() [9/14]

void le::to_json ( dj::Json &  json,
kvf::Seconds const &  seconds 
)

◆ to_json() [10/14]

void le::to_json ( dj::Json &  json,
Tile const &  tile 
)

◆ to_json() [11/14]

void le::to_json ( dj::Json &  json,
TileId const &  tile_id 
)

◆ to_json() [12/14]

void le::to_json ( dj::Json &  json,
TileSet const &  tile_set 
)

◆ to_json() [13/14]

void le::to_json ( dj::Json &  json,
Transform const &  transform 
)

◆ to_json() [14/14]

void le::to_json ( dj::Json &  json,
Uri const &  uri 
)

◆ uv_to_world()

constexpr auto le::uv_to_world ( kvf::UvRect const &  uv,
glm::vec2 const  target_size 
) -> kvf::Rect<>
constexpr

◆ vertex_bounds()

auto le::vertex_bounds ( std::span< Vertex const >  vertices,
glm::mat4 const &  model 
) -> kvf::Rect<>

◆ world_to_uv()

constexpr auto le::world_to_uv ( kvf::Rect<> const &  rect) -> kvf::UvRect
constexpr

Variable Documentation

◆ default_window_flags_v

constexpr auto le::default_window_flags_v = WindowFlag::Decorated | WindowFlag::Resizeable | WindowFlag::Visible
inlineconstexpr

Default Window creation flags.

◆ json_type_name_v

template<typename Type >
constexpr auto le::json_type_name_v = std::string_view{}
constexpr

◆ json_type_name_v< IShader >

template<>
constexpr auto le::json_type_name_v< IShader > = std::string_view{"Shader"}
inlineconstexpr

◆ json_type_name_v< ITexture >

template<>
constexpr auto le::json_type_name_v< ITexture > = std::string_view{"Texture"}
inlineconstexpr

◆ json_type_name_v< ITileSheet >

template<>
constexpr auto le::json_type_name_v< ITileSheet > = std::string_view{"TileSheet"}
inlineconstexpr

◆ json_type_name_v< TileSet >

template<>
constexpr auto le::json_type_name_v< TileSet > = std::string_view{"TileSet"}
inlineconstexpr

◆ right_v

constexpr auto le::right_v = glm::vec2{1.0f, 0.0f}
inlineconstexpr

◆ up_v

constexpr auto le::up_v = glm::vec2{0.0f, 1.0f}
inlineconstexpr

◆ vsync_str_v

constexpr auto le::vsync_str_v = klib::EnumArray<Vsync, std::string_view>{"strict", "adaptive", "multi", "off"}
inlineconstexpr