galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::resource Namespace Reference

Classes

class  Cache
 Cache for resources such as audio, fonts, etc. More...
 
struct  Loader
 Loads resources for a resource cache. More...
 
struct  MusicLoader
 Loads resources for the music cache. More...
 
struct  SoundLoader
 Loads resources for the sound cache. More...
 
struct  VoiceLoader
 Loads resources for the voice cache. More...
 

Typedefs

using Animations = Cache<graphics::Animation, Loader<graphics::Animation>>
 Abbreviation for animation cache.
 
using Fonts = Cache<graphics::Font, Loader<graphics::Font>>
 Abbreviation for font cache.
 
using SoundCache = Cache<media::Sound, SoundLoader>
 Abbreviation for sound cache.
 
using MusicCache = Cache<media::Sound, MusicLoader>
 Abbreviation for sound cache.
 
using VoiceCache = Cache<media::Sound, VoiceLoader>
 Abbreviation for sound cache.
 
using VideoCache = Cache<media::Video, Loader<media::Video>>
 Abbreviation for video cache.
 
using Prefabs = Cache<core::Prefab, Loader<core::Prefab>>
 Abbreviation for prefab cache.
 
using Scripts = Cache<lua::Script, Loader<lua::Script>>
 Abbreviation for lua scripts cache.
 
using Shaders = Cache<graphics::Shader, Loader<graphics::Shader>>
 Abbreviation for font cache.
 
using Textures = Cache<graphics::Texture2D, Loader<graphics::Texture2D>>
 Abbreviation for texture cache.
 

Variables

constexpr const auto r2d_vert_shader
 Vertex shader for the 2d renderer.
 
constexpr const auto r2d_frag_shader
 Fragment shader for the 2d renderer.
 
constexpr const auto render_texture_shader_vert
 Render To Texture vertex shader.
 
constexpr const auto render_texture_shader_frag
 Render To Texture fragment shader.
 
static unsigned char roboto_light []
 
static constexpr const unsigned int roboto_light_len = 167000
 
constexpr const auto video_vert_shader
 Video vertex shader.
 
constexpr const auto video_frag_shader
 Video frag shader.
 

Typedef Documentation

◆ Animations

using galaxy::resource::Animations = Cache<graphics::Animation, Loader<graphics::Animation>>

Abbreviation for animation cache.

Definition at line 22 of file Animations.hpp.

◆ Fonts

using galaxy::resource::Fonts = Cache<graphics::Font, Loader<graphics::Font>>

Abbreviation for font cache.

Definition at line 22 of file Fonts.hpp.

◆ SoundCache

Abbreviation for sound cache.

Definition at line 79 of file Media.hpp.

◆ MusicCache

Abbreviation for sound cache.

Definition at line 84 of file Media.hpp.

◆ VoiceCache

Abbreviation for sound cache.

Definition at line 89 of file Media.hpp.

◆ VideoCache

using galaxy::resource::VideoCache = Cache<media::Video, Loader<media::Video>>

Abbreviation for video cache.

Definition at line 94 of file Media.hpp.

◆ Prefabs

Abbreviation for prefab cache.

Definition at line 22 of file Prefabs.hpp.

◆ Scripts

Abbreviation for lua scripts cache.

Definition at line 22 of file Scripts.hpp.

◆ Shaders

using galaxy::resource::Shaders = Cache<graphics::Shader, Loader<graphics::Shader>>

Abbreviation for font cache.

Definition at line 22 of file Shaders.hpp.

◆ Textures

using galaxy::resource::Textures = Cache<graphics::Texture2D, Loader<graphics::Texture2D>>

Abbreviation for texture cache.

Definition at line 22 of file Textures.hpp.

Variable Documentation

◆ r2d_vert_shader

const auto galaxy::resource::r2d_vert_shader
constexpr

Vertex shader for the 2d renderer.

Definition at line 18 of file R2DShader.hpp.

◆ r2d_frag_shader

const auto galaxy::resource::r2d_frag_shader
constexpr

Fragment shader for the 2d renderer.

Definition at line 60 of file R2DShader.hpp.

◆ render_texture_shader_vert

const auto galaxy::resource::render_texture_shader_vert
constexpr
Initial value:
= R"(
layout(location = 0) in vec2 l_pos;
layout(location = 1) in vec2 l_texels;
out vec2 io_texels;
uniform mat4 u_projection;
uniform mat4 u_transform;
void main()
{
gl_Position = u_projection * u_transform * vec4(l_pos, 0.0, 1.0);
io_texels = l_texels;
io_texels.y = 1.0 - io_texels.y;
}
)"

Render To Texture vertex shader.

Definition at line 18 of file RenderTextureShader.hpp.

◆ render_texture_shader_frag

const auto galaxy::resource::render_texture_shader_frag
constexpr
Initial value:
= R"(
in vec2 io_texels;
out vec4 io_frag_colour;
uniform sampler2D u_texture;
void main()
{
io_frag_colour = texture(u_texture, io_texels);
}
)"

Render To Texture fragment shader.

Definition at line 39 of file RenderTextureShader.hpp.

◆ roboto_light

unsigned char galaxy::resource::roboto_light[]
inlinestatic

Definition at line 214 of file RobotoLight.hpp.

◆ roboto_light_len

const unsigned int galaxy::resource::roboto_light_len = 167000
inlinestaticconstexpr

Definition at line 14134 of file RobotoLight.hpp.

◆ video_vert_shader

const auto galaxy::resource::video_vert_shader
constexpr
Initial value:
= R"(
layout(location = 0) in vec2 vertex;
out vec2 io_texels;
void main()
{
io_texels = vertex;
gl_Position = vec4((vertex * 2.0 - 1.0) * vec2(1, -1), 0.0, 1.0);
}
)"

Video vertex shader.

Definition at line 18 of file VideoShader.hpp.

◆ video_frag_shader

const auto galaxy::resource::video_frag_shader
constexpr
Initial value:
= R"(
in vec2 io_texels;
out vec4 io_frag;
uniform sampler2D u_texture_y;
uniform sampler2D u_texture_cb;
uniform sampler2D u_texture_cr;
mat4 rec601 = mat4(
1.16438, 0.00000, 1.59603, -0.87079,
1.16438, -0.39176, -0.81297, 0.52959,
1.16438, 2.01723, 0.00000, -1.08139,
0, 0, 0, 1
);
void main()
{
float y = texture2D(texture_y, tex_coord).r;
float cb = texture2D(texture_cb, tex_coord).r;
float cr = texture2D(texture_cr, tex_coord).r;
io_frag = vec4(y, cb, cr, 1.0) * rec601;
}
)"

Video frag shader.

Definition at line 34 of file VideoShader.hpp.