Euphoria
eu::render Namespace Reference

Namespaces

 attributes2d
 
 attributes3d
 
 gl
 

Classes

struct  MaterialOverride
 
struct  Actor
 
struct  VertexBuffer
 Stores vertices, uv, etc. More...
 
struct  PointLayout
 Stores what the data in the vertex_buffer is and how it is laid out/used Represents a OpenGL Vertex Array Object (VAO). More...
 
struct  IndexBuffer
 Reuses points. More...
 
struct  Buffer2d
 
struct  CompiledLines
 
struct  CompiledMeshPart
 
struct  CompiledMeshMaterial
 
struct  CompiledMesh
 A collection of parts making up a mesh. More...
 
struct  UiTextCompileVisitor
 
struct  Glyph
 
struct  TextDrawCommand
 
struct  ListOfTextDrawCommands
 
struct  DrawableText
 
struct  DrawableFont
 
struct  FontCache
 
struct  Id
 
struct  Init
 
struct  Instance
 
struct  LightAttenuation
 
struct  Light
 
struct  MaterialShaderDefaultTexture
 
struct  MaterialShaderBinding
 
struct  MaterialShader
 Extends a regular Shader with uniform bindings for 3d rendering. More...
 
struct  MaterialShaderCache
 
struct  PositionedLines
 
struct  ScalableSprite
 
struct  ShaderId
 
struct  ShaderProgram
 
struct  ShaderAttribute
 Represents a shader attribute like vertex, normal or uv coord. More...
 
struct  ShaderUniform
 
struct  Sprite
 
struct  Layer
 
struct  SpriteBatch
 
struct  DrawData
 
struct  SpriteRenderer
 
struct  Texture2dLoadData
 
struct  TextureId
 
struct  Texture2
 
struct  TextureCache
 
struct  ViewportHandler
 
struct  World
 

Typedefs

using CharToGlyphMap = std::map< int, std::shared_ptr< Glyph > >
 
using LoaderFunction = void *(*)(const char *name)
 

Enumerations

enum class  RenderMode { lines , triangles }
 
enum class  Align {
  top_left , top_center , top_right , baseline_left ,
  baseline_center , baseline_right , bottom_left , bottom_center ,
  bottom_right
}
 
enum class  ShaderAttributeType {
  float1 , float2 , float3 , float4 ,
  float33 , float44
}
 
enum class  ShaderAttributeSource {
  unknown , vertex , normal , uv ,
  color
}
 
enum class  TextureWrap { repeat , mirrored_repeat , clamp_to_edge }
 
enum class  FilterMagnification { nearest , linear }
 
enum class  FilterMinification { nearest , linear }
 
enum class  ViewportType { screen_pixel , fit_with_black_bars , extend }
 

Functions

void bind_attributes (const std::vector< ShaderAttribute > &attributes, PointLayout *layout)
 
void convert_lines_to_index_buffer (const std::vector< core::Lines::FromToIndices > &lines, IndexBuffer *buffer)
 
void convert_points_to_vertex_buffer (const std::vector< core::LinePoint > &points, const std::vector< ShaderAttribute > &attributes, VertexBuffer *vb)
 
std::shared_ptr< CompiledLinescompile (MaterialShaderCache *shader_cache, const core::Lines &lines)
 
void convert_points_to_vertex_buffer (const std::vector< core::MeshPoint > &points, const std::vector< ShaderAttribute > &attributes, VertexBuffer *vb)
 
void convert_tris_to_index_buffer (const std::vector< core::MeshFace > &faces, IndexBuffer *b)
 
std::shared_ptr< CompiledMeshcompile_mesh (const core::Mesh &mesh, MaterialShaderCache *shader_cache, TextureCache *texture_cache, const io::DirPath &texture_folder, const std::string &debug_name)
 
std::string from_opengl_error_to_string (GLenum error_code)
 
void print_all_opengl_errors (const char *file, int line)
 
void APIENTRY on_opengl_error (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei, const GLchar *message, const GLvoid *)
 
void setup_opengl_debug ()
 
void setup_default_files (std::shared_ptr< io::ReadRootCatalog > catalog)
 
core::LoadedFont get_characters_from_single_image (io::FileSystem *fs, const files::font::SingleImage &img)
 
std::pair< Rectf, Rectfconstruct_character_rects (const stbrp_rect &src_rect, const core::LoadedGlyph &src_char, int image_width, int image_height)
 
vec2f get_offset (Align alignment, const Rectf &extent)
 
mat4f calc_model_matrix (const vec3f &position, const quatf &rotation)
 
void post_build (MaterialShader *sh, const files::materialshader::MaterialShader &file, const io::FilePath &path)
 
void use (const ShaderProgram *shader)
 
void report_shader_error (const std::string &log, const std::string &type)
 
void report_error_program (GLuint program)
 
void report_error_shader (GLuint shader, const std::string &type)
 
GLuint compile_shader (GLuint type, const GLchar *source, const std::string &name)
 
void bind_texture_to_shader (Texture2 *texture, ShaderProgram *shader, const ShaderUniform &attribute, gl::Int index)
 
bool operator== (const ShaderAttribute &lhs, const ShaderAttribute &rhs)
 
bool operator== (const ShaderUniform &lhs, const ShaderUniform &rhs)
 
void use (const TextureId *texture)
 
void activate (const core::Viewport &vp)
 Sets the gl viewport. More...
 

Variables

constexpr int quad_cont = 10
 
constexpr int stride = 2 * 4 + 2 * 4 + 4 * 4
 

Typedef Documentation

◆ CharToGlyphMap

using eu::render::CharToGlyphMap = typedef std::map<int, std::shared_ptr<Glyph> >

Definition at line 48 of file font.h.

◆ LoaderFunction

using eu::render::LoaderFunction = typedef void* (*)(const char* name)

Definition at line 9 of file init.h.

Enumeration Type Documentation

◆ Align

enum eu::render::Align
strong
Enumerator
top_left 
top_center 
top_right 
baseline_left 
baseline_center 
baseline_right 
bottom_left 
bottom_center 
bottom_right 

Definition at line 52 of file font.h.

◆ FilterMagnification

Enumerator
nearest 
linear 

Definition at line 22 of file texture.h.

◆ FilterMinification

Enumerator
nearest 
linear 

Definition at line 28 of file texture.h.

◆ RenderMode

Enumerator
lines 
triangles 

Definition at line 53 of file buffer.h.

◆ ShaderAttributeSource

Enumerator
unknown 
vertex 
normal 
uv 
color 

Definition at line 18 of file shaderattribute.h.

◆ ShaderAttributeType

Enumerator
float1 
float2 
float3 
float4 
float33 
float44 

Definition at line 8 of file shaderattribute.h.

◆ TextureWrap

Enumerator
repeat 
mirrored_repeat 
clamp_to_edge 

Definition at line 15 of file texture.h.

◆ ViewportType

Enumerator
screen_pixel 
fit_with_black_bars 
extend 

Definition at line 14 of file viewporthandler.h.

Function Documentation

◆ activate()

void eu::render::activate ( const core::Viewport vp)

Sets the gl viewport.

Definition at line 11 of file viewport.cc.

◆ bind_attributes()

void eu::render::bind_attributes ( const std::vector< ShaderAttribute > &  attributes,
PointLayout layout 
)

Definition at line 10 of file attributebinder.cc.

◆ bind_texture_to_shader()

void eu::render::bind_texture_to_shader ( Texture2 texture,
ShaderProgram shader,
const ShaderUniform attribute,
gl::Int  index 
)

Definition at line 487 of file shader.cc.

◆ calc_model_matrix()

mat4f eu::render::calc_model_matrix ( const vec3f position,
const quatf rotation 
)

Definition at line 18 of file instance.cc.

◆ compile()

std::shared_ptr< CompiledLines > eu::render::compile ( MaterialShaderCache shader_cache,
const core::Lines lines 
)

Definition at line 115 of file compiledlines.cc.

◆ compile_mesh()

std::shared_ptr< CompiledMesh > eu::render::compile_mesh ( const core::Mesh mesh,
MaterialShaderCache shader_cache,
TextureCache texture_cache,
const io::DirPath texture_folder,
const std::string &  debug_name 
)

Definition at line 230 of file compiledmesh.cc.

◆ compile_shader()

GLuint eu::render::compile_shader ( GLuint  type,
const GLchar *  source,
const std::string &  name 
)

Definition at line 166 of file shader.cc.

◆ construct_character_rects()

std::pair<Rectf, Rectf> eu::render::construct_character_rects ( const stbrp_rect &  src_rect,
const core::LoadedGlyph src_char,
int  image_width,
int  image_height 
)

Definition at line 77 of file font.cc.

◆ convert_lines_to_index_buffer()

void eu::render::convert_lines_to_index_buffer ( const std::vector< core::Lines::FromToIndices > &  lines,
IndexBuffer buffer 
)

Definition at line 16 of file compiledlines.cc.

◆ convert_points_to_vertex_buffer() [1/2]

void eu::render::convert_points_to_vertex_buffer ( const std::vector< core::LinePoint > &  points,
const std::vector< ShaderAttribute > &  attributes,
VertexBuffer vb 
)

Definition at line 35 of file compiledlines.cc.

◆ convert_points_to_vertex_buffer() [2/2]

void eu::render::convert_points_to_vertex_buffer ( const std::vector< core::MeshPoint > &  points,
const std::vector< ShaderAttribute > &  attributes,
VertexBuffer vb 
)

Definition at line 161 of file compiledmesh.cc.

◆ convert_tris_to_index_buffer()

void eu::render::convert_tris_to_index_buffer ( const std::vector< core::MeshFace > &  faces,
IndexBuffer b 
)

Definition at line 216 of file compiledmesh.cc.

◆ from_opengl_error_to_string()

std::string eu::render::from_opengl_error_to_string ( GLenum  error_code)

Definition at line 58 of file debuggl.cc.

◆ get_characters_from_single_image()

core::LoadedFont eu::render::get_characters_from_single_image ( io::FileSystem fs,
const files::font::SingleImage img 
)

Definition at line 49 of file font.cc.

◆ get_offset()

vec2f eu::render::get_offset ( Align  alignment,
const Rectf extent 
)

Definition at line 561 of file font.cc.

◆ on_opengl_error()

void APIENTRY eu::render::on_opengl_error ( GLenum  source,
GLenum  type,
GLuint  id,
GLenum  severity,
GLsizei  ,
const GLchar *  message,
const GLvoid *   
)

Definition at line 91 of file debuggl.cc.

◆ operator==() [1/2]

bool eu::render::operator== ( const ShaderAttribute lhs,
const ShaderAttribute rhs 
)

Definition at line 46 of file shaderattribute.cc.

◆ operator==() [2/2]

bool eu::render::operator== ( const ShaderUniform lhs,
const ShaderUniform rhs 
)

Definition at line 34 of file shaderuniform.cc.

◆ post_build()

void eu::render::post_build ( MaterialShader sh,
const files::materialshader::MaterialShader file,
const io::FilePath path 
)

Definition at line 68 of file materialshader.cc.

◆ print_all_opengl_errors()

void eu::render::print_all_opengl_errors ( const char *  file,
int  line 
)

Definition at line 79 of file debuggl.cc.

◆ report_error_program()

void eu::render::report_error_program ( GLuint  program)

Definition at line 150 of file shader.cc.

◆ report_error_shader()

void eu::render::report_error_shader ( GLuint  shader,
const std::string &  type 
)

Definition at line 158 of file shader.cc.

◆ report_shader_error()

void eu::render::report_shader_error ( const std::string &  log,
const std::string &  type 
)

Definition at line 136 of file shader.cc.

◆ setup_default_files()

void eu::render::setup_default_files ( std::shared_ptr< io::ReadRootCatalog catalog)

Definition at line 9 of file defaultfiles.cc.

◆ setup_opengl_debug()

void eu::render::setup_opengl_debug ( )

Definition at line 130 of file debuggl.cc.

◆ use() [1/2]

void eu::render::use ( const ShaderProgram shader)

Definition at line 114 of file shader.cc.

◆ use() [2/2]

void eu::render::use ( const TextureId texture)

Definition at line 132 of file texture.cc.

Variable Documentation

◆ quad_cont

constexpr int eu::render::quad_cont = 10
constexpr

Definition at line 10 of file spritebatch.cc.

◆ stride

constexpr int eu::render::stride = 2 * 4 + 2 * 4 + 4 * 4
constexpr

Definition at line 11 of file spritebatch.cc.