Project Alice
Loading...
Searching...
No Matches
ogl Namespace Reference

Namespaces

namespace  parameters
 

Classes

struct  color3f
 
struct  data
 
class  data_texture
 
struct  DDS_header
 
struct  font_texture_result
 
struct  image
 
class  lines
 
class  texture
 

Typedefs

typedef void(APIENTRYP_SOIL_GLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
 

Enumerations

enum class  color_modification { none , disabled , interactable , interactable_disabled }
 
enum  { SOIL_CAPABILITY_UNKNOWN = -1 , SOIL_CAPABILITY_NONE = 0 , SOIL_CAPABILITY_PRESENT = 1 }
 
enum  { SOIL_FLAG_TEXTURE_REPEATS = 4 }
 

Functions

constexpr uint32_t color_from_hash (uint32_t color)
 
uint32_t color_gradient (float percent, uint32_t top_color, uint32_t bot_color)
 
template<class T >
uint32_t get_ui_color (sys::state &state, T id)
 
template<>
uint32_t get_ui_color (sys::state &state, dcon::political_party_id id)
 
template<>
uint32_t get_ui_color (sys::state &state, dcon::issue_option_id id)
 
template<>
uint32_t get_ui_color (sys::state &state, dcon::crime_id id)
 
std::string_view opengl_get_error_name (GLenum t)
 
void notify_user_of_fatal_opengl_error (std::string message)
 
GLint compile_shader (std::string_view source, GLenum type)
 
GLuint create_program (std::string_view vertex_shader, std::string_view fragment_shader)
 
void load_special_icons (sys::state &state)
 
std::string_view framebuffer_error (GLenum e)
 
void initialize_msaa (sys::state &state, int32_t size_x, int32_t size_y)
 
void deinitialize_msaa (sys::state &state)
 
void initialize_opengl (sys::state &state)
 
void load_shaders (sys::state &state)
 
void load_global_squares (sys::state &state)
 
auto map_color_modification_to_index (color_modification e)
 
void bind_vertices_by_rotation (sys::state const &state, ui::rotation r, bool flipped, bool rtl)
 
void render_simple_rect (sys::state const &state, float x, float y, float width, float height, ui::rotation r, bool flipped, bool rtl)
 
void render_textured_rect (sys::state const &state, color_modification enabled, float x, float y, float width, float height, GLuint texture_handle, ui::rotation r, bool flipped, bool rtl)
 
void render_textured_rect_direct (sys::state const &state, float x, float y, float width, float height, uint32_t handle)
 
void render_linegraph (sys::state const &state, color_modification enabled, float x, float y, float width, float height, lines &l)
 
void render_linegraph (sys::state const &state, color_modification enabled, float x, float y, float width, float height, float r, float g, float b, lines &l)
 
void render_barchart (sys::state const &state, color_modification enabled, float x, float y, float width, float height, data_texture &t, ui::rotation r, bool flipped, bool rtl)
 
void render_piechart (sys::state const &state, color_modification enabled, float x, float y, float size, data_texture &t)
 
void render_bordered_rect (sys::state const &state, color_modification enabled, float border_size, float x, float y, float width, float height, GLuint texture_handle, ui::rotation r, bool flipped, bool rtl)
 
void render_masked_rect (sys::state const &state, color_modification enabled, float x, float y, float width, float height, GLuint texture_handle, GLuint mask_texture_handle, ui::rotation r, bool flipped, bool rtl)
 
void render_progress_bar (sys::state const &state, color_modification enabled, float progress, float x, float y, float width, float height, GLuint left_texture_handle, GLuint right_texture_handle, ui::rotation r, bool flipped, bool rtl)
 
void render_tinted_textured_rect (sys::state const &state, float x, float y, float width, float height, float r, float g, float b, GLuint texture_handle, ui::rotation rot, bool flipped, bool rtl)
 
void render_tinted_rect (sys::state const &state, float x, float y, float width, float height, float r, float g, float b, ui::rotation rot, bool flipped, bool rtl)
 
void render_tinted_subsprite (sys::state const &state, int frame, int total_frames, float x, float y, float width, float height, float r, float g, float b, GLuint texture_handle, ui::rotation rot, bool flipped, bool rtl)
 
void render_subsprite (sys::state const &state, color_modification enabled, int frame, int total_frames, float x, float y, float width, float height, GLuint texture_handle, ui::rotation r, bool flipped, bool rtl)
 
GLuint get_flag_texture_handle_from_tag (sys::state &state, const char tag[3])
 
bool display_tag_is_valid (sys::state &state, char tag[3])
 
void render_text_icon (sys::state &state, text::embedded_icon ico, float x, float baseline_y, float font_size, text::font &f, ogl::color_modification cmod)
 
void render_text_flag (sys::state &state, text::embedded_flag ico, float x, float baseline_y, float font_size, text::font &f, ogl::color_modification cmod)
 
void render_text_unit_icon (sys::state &state, text::embedded_unit_icon ico, float x, float baseline_y, float font_size, text::font &f, ogl::color_modification cmod)
 
void internal_text_render (sys::state &state, text::stored_glyphs const &txt, float x, float baseline_y, float size, text::font &f)
 
void render_classic_text (sys::state &state, text::stored_glyphs const &txt, float x, float y, float size, color_modification enabled, color3f const &c, text::bm_font const &font, text::font &base_font)
 
void render_new_text (sys::state &state, text::stored_glyphs const &txt, color_modification enabled, float x, float y, float size, color3f const &c, text::font &f)
 
void render_text (sys::state &state, text::stored_glyphs const &txt, color_modification enabled, float x, float y, color3f const &c, uint16_t font_id)
 
bool msaa_enabled (sys::state const &state)
 
image load_stb_image (simple_fs::file &file)
 
GLuint make_gl_texture (uint8_t *data, uint32_t size_x, uint32_t size_y, uint32_t channels)
 
GLuint make_gl_texture (simple_fs::directory const &dir, native_string_view file_name)
 
void set_gltex_parameters (GLuint texture_handle, GLuint texture_type, GLuint filter, GLuint wrap)
 
GLuint load_texture_array_from_file (simple_fs::file &file, int32_t tiles_x, int32_t tiles_y)
 
void debug_callback (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei, GLchar const *message, void const *)
 
void create_opengl_context (sys::state &state)
 
void shutdown_opengl (sys::state &state)
 
void render_simple_rect (sys::state const &state, float x, float y, float width, float height, ui::rotation r, bool flipped)
 
void render_new_text (sys::state const &state, text::stored_glyphs const &txt, color_modification enabled, float x, float y, float size, color3f const &c, text::font &f)
 
int query_DXT_capability (void)
 
GLuint SOIL_direct_load_DDS_from_memory (unsigned char const *const buffer, uint32_t buffer_length, uint32_t &width, uint32_t &height, int soil_flags)
 
GLuint load_file_and_return_handle (native_string const &native_name, simple_fs::file_system const &fs, texture &asset_texture, bool keep_data)
 
native_string flag_type_to_name (sys::state &state, culture::flag_type type)
 
GLuint get_flag_handle (sys::state &state, dcon::national_identity_id nat_id, culture::flag_type type)
 
GLuint get_texture_handle (sys::state &state, dcon::texture_id id, bool keep_data)
 
font_texture_result make_font_texture (simple_fs::file &f)
 
template<>
uint32_t get_ui_color (sys::state &state, dcon::pop_satisfaction_wrapper_id id)
 

Typedef Documentation

◆ P_SOIL_GLCOMPRESSEDTEXIMAGE2DPROC

typedef void(APIENTRY * ogl::P_SOIL_GLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)

Definition at line 110 of file texture.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SOIL_CAPABILITY_UNKNOWN 
SOIL_CAPABILITY_NONE 
SOIL_CAPABILITY_PRESENT 

Definition at line 100 of file texture.cpp.

◆ anonymous enum

anonymous enum
Enumerator
SOIL_FLAG_TEXTURE_REPEATS 

Definition at line 19 of file texture.hpp.

◆ color_modification

enum class ogl::color_modification
strong
Enumerator
none 
disabled 
interactable 
interactable_disabled 

Definition at line 47 of file opengl_wrapper.hpp.

Function Documentation

◆ bind_vertices_by_rotation()

void ogl::bind_vertices_by_rotation ( sys::state const &  state,
ui::rotation  r,
bool  flipped,
bool  rtl 
)

Definition at line 518 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ color_from_hash()

constexpr uint32_t ogl::color_from_hash ( uint32_t  color)
inlineconstexpr

Definition at line 9 of file color.hpp.

Here is the caller graph for this function:

◆ color_gradient()

uint32_t ogl::color_gradient ( float  percent,
uint32_t  top_color,
uint32_t  bot_color 
)
inline

Definition at line 42 of file color.hpp.

Here is the caller graph for this function:

◆ compile_shader()

GLint ogl::compile_shader ( std::string_view  source,
GLenum  type 
)

Definition at line 40 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_opengl_context()

void ogl::create_opengl_context ( sys::state state)

Definition at line 6 of file opengl_wrapper_nix.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_program()

GLuint ogl::create_program ( std::string_view  vertex_shader,
std::string_view  fragment_shader 
)

Definition at line 75 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug_callback()

void ogl::debug_callback ( GLenum  source,
GLenum  type,
GLuint  id,
GLenum  severity,
GLsizei  ,
GLchar const *  message,
void const *   
)
inline

Definition at line 98 of file opengl_wrapper.hpp.

Here is the caller graph for this function:

◆ deinitialize_msaa()

void ogl::deinitialize_msaa ( sys::state state)

Definition at line 264 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ display_tag_is_valid()

bool ogl::display_tag_is_valid ( sys::state state,
char  tag[3] 
)

Definition at line 840 of file opengl_wrapper.cpp.

Here is the call graph for this function:

◆ flag_type_to_name()

native_string ogl::flag_type_to_name ( sys::state state,
culture::flag_type  type 
)

Definition at line 544 of file texture.cpp.

◆ framebuffer_error()

std::string_view ogl::framebuffer_error ( GLenum  e)

Definition at line 158 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ get_flag_handle()

GLuint ogl::get_flag_handle ( sys::state state,
dcon::national_identity_id  nat_id,
culture::flag_type  type 
)

Definition at line 632 of file texture.cpp.

Here is the caller graph for this function:

◆ get_flag_texture_handle_from_tag()

GLuint ogl::get_flag_texture_handle_from_tag ( sys::state state,
const char  tag[3] 
)

Definition at line 813 of file opengl_wrapper.cpp.

Here is the call graph for this function:

◆ get_texture_handle()

GLuint ogl::get_texture_handle ( sys::state state,
dcon::texture_id  id,
bool  keep_data 
)

Definition at line 665 of file texture.cpp.

Here is the caller graph for this function:

◆ get_ui_color() [1/5]

template<>
uint32_t ogl::get_ui_color ( sys::state state,
dcon::crime_id  id 
)
inline

Definition at line 64 of file color.hpp.

Here is the call graph for this function:

◆ get_ui_color() [2/5]

template<>
uint32_t ogl::get_ui_color ( sys::state state,
dcon::issue_option_id  id 
)
inline

Definition at line 60 of file color.hpp.

Here is the call graph for this function:

◆ get_ui_color() [3/5]

template<>
uint32_t ogl::get_ui_color ( sys::state state,
dcon::political_party_id  id 
)
inline

Definition at line 56 of file color.hpp.

Here is the call graph for this function:

◆ get_ui_color() [4/5]

template<>
uint32_t ogl::get_ui_color ( sys::state state,
dcon::pop_satisfaction_wrapper_id  id 
)
inline

Definition at line 51 of file gui_budget_window.hpp.

Here is the call graph for this function:

◆ get_ui_color() [5/5]

template<class T >
uint32_t ogl::get_ui_color ( sys::state state,
id 
)
inline

Definition at line 52 of file color.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize_msaa()

void ogl::initialize_msaa ( sys::state state,
int32_t  size_x,
int32_t  size_y 
)

Definition at line 182 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize_opengl()

void ogl::initialize_opengl ( sys::state state)

Definition at line 288 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_text_render()

void ogl::internal_text_render ( sys::state state,
text::stored_glyphs const &  txt,
float  x,
float  baseline_y,
float  size,
text::font f 
)

Definition at line 948 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_file_and_return_handle()

GLuint ogl::load_file_and_return_handle ( native_string const &  native_name,
simple_fs::file_system const &  fs,
texture asset_texture,
bool  keep_data 
)

Definition at line 459 of file texture.cpp.

Here is the caller graph for this function:

◆ load_global_squares()

void ogl::load_global_squares ( sys::state state)

Definition at line 427 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ load_shaders()

void ogl::load_shaders ( sys::state state)

Definition at line 402 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_special_icons()

void ogl::load_special_icons ( sys::state state)

Definition at line 106 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_stb_image()

image ogl::load_stb_image ( simple_fs::file file)

Definition at line 1078 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_texture_array_from_file()

GLuint ogl::load_texture_array_from_file ( simple_fs::file file,
int32_t  tiles_x,
int32_t  tiles_y 
)

Definition at line 1124 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_font_texture()

font_texture_result ogl::make_font_texture ( simple_fs::file f)

Definition at line 745 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_gl_texture() [1/2]

GLuint ogl::make_gl_texture ( simple_fs::directory const &  dir,
native_string_view  file_name 
)

Definition at line 1101 of file opengl_wrapper.cpp.

Here is the call graph for this function:

◆ make_gl_texture() [2/2]

GLuint ogl::make_gl_texture ( uint8_t data,
uint32_t  size_x,
uint32_t  size_y,
uint32_t  channels 
)

Definition at line 1087 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ map_color_modification_to_index()

auto ogl::map_color_modification_to_index ( color_modification  e)
inline

Definition at line 504 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ msaa_enabled()

bool ogl::msaa_enabled ( sys::state const &  state)

Definition at line 1074 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ notify_user_of_fatal_opengl_error()

void ogl::notify_user_of_fatal_opengl_error ( std::string  message)

Definition at line 32 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ opengl_get_error_name()

std::string_view ogl::opengl_get_error_name ( GLenum  t)

Definition at line 9 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ query_DXT_capability()

int ogl::query_DXT_capability ( void  )

Definition at line 112 of file texture.cpp.

Here is the caller graph for this function:

◆ render_barchart()

void ogl::render_barchart ( sys::state const &  state,
color_modification  enabled,
float  x,
float  y,
float  width,
float  height,
data_texture t,
ui::rotation  r,
bool  flipped,
bool  rtl 
)

Definition at line 641 of file opengl_wrapper.cpp.

Here is the call graph for this function:

◆ render_bordered_rect()

void ogl::render_bordered_rect ( sys::state const &  state,
color_modification  enabled,
float  border_size,
float  x,
float  y,
float  width,
float  height,
GLuint  texture_handle,
ui::rotation  r,
bool  flipped,
bool  rtl 
)

Definition at line 676 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_classic_text()

void ogl::render_classic_text ( sys::state state,
text::stored_glyphs const &  txt,
float  x,
float  y,
float  size,
color_modification  enabled,
color3f const &  c,
text::bm_font const &  font,
text::font base_font 
)

Definition at line 972 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_linegraph() [1/2]

void ogl::render_linegraph ( sys::state const &  state,
color_modification  enabled,
float  x,
float  y,
float  width,
float  height,
float  r,
float  g,
float  b,
lines l 
)

Definition at line 619 of file opengl_wrapper.cpp.

Here is the call graph for this function:

◆ render_linegraph() [2/2]

void ogl::render_linegraph ( sys::state const &  state,
color_modification  enabled,
float  x,
float  y,
float  width,
float  height,
lines l 
)

Definition at line 589 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_masked_rect()

void ogl::render_masked_rect ( sys::state const &  state,
color_modification  enabled,
float  x,
float  y,
float  width,
float  height,
GLuint  texture_handle,
GLuint  mask_texture_handle,
ui::rotation  r,
bool  flipped,
bool  rtl 
)

Definition at line 695 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_new_text() [1/2]

void ogl::render_new_text ( sys::state state,
text::stored_glyphs const &  txt,
color_modification  enabled,
float  x,
float  y,
float  size,
color3f const &  c,
text::font f 
)

Definition at line 1023 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_new_text() [2/2]

void ogl::render_new_text ( sys::state const &  state,
text::stored_glyphs const &  txt,
color_modification  enabled,
float  x,
float  y,
float  size,
color3f const &  c,
text::font f 
)

◆ render_piechart()

void ogl::render_piechart ( sys::state const &  state,
color_modification  enabled,
float  x,
float  y,
float  size,
data_texture t 
)

Definition at line 659 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_progress_bar()

void ogl::render_progress_bar ( sys::state const &  state,
color_modification  enabled,
float  progress,
float  x,
float  y,
float  width,
float  height,
GLuint  left_texture_handle,
GLuint  right_texture_handle,
ui::rotation  r,
bool  flipped,
bool  rtl 
)

Definition at line 715 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_simple_rect() [1/2]

void ogl::render_simple_rect ( sys::state const &  state,
float  x,
float  y,
float  width,
float  height,
ui::rotation  r,
bool  flipped 
)

◆ render_simple_rect() [2/2]

void ogl::render_simple_rect ( sys::state const &  state,
float  x,
float  y,
float  width,
float  height,
ui::rotation  r,
bool  flipped,
bool  rtl 
)

Definition at line 541 of file opengl_wrapper.cpp.

Here is the call graph for this function:

◆ render_subsprite()

void ogl::render_subsprite ( sys::state const &  state,
color_modification  enabled,
int  frame,
int  total_frames,
float  x,
float  y,
float  width,
float  height,
GLuint  texture_handle,
ui::rotation  r,
bool  flipped,
bool  rtl 
)

Definition at line 792 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_text()

void ogl::render_text ( sys::state state,
text::stored_glyphs const &  txt,
color_modification  enabled,
float  x,
float  y,
color3f const &  c,
uint16_t  font_id 
)

Definition at line 1029 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_text_flag()

void ogl::render_text_flag ( sys::state state,
text::embedded_flag  ico,
float  x,
float  baseline_y,
float  font_size,
text::font f,
ogl::color_modification  cmod 
)

Definition at line 892 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_text_icon()

void ogl::render_text_icon ( sys::state state,
text::embedded_icon  ico,
float  x,
float  baseline_y,
float  font_size,
text::font f,
ogl::color_modification  cmod 
)

Definition at line 853 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_text_unit_icon()

void ogl::render_text_unit_icon ( sys::state state,
text::embedded_unit_icon  ico,
float  x,
float  baseline_y,
float  font_size,
text::font f,
ogl::color_modification  cmod 
)

Definition at line 916 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_textured_rect()

void ogl::render_textured_rect ( sys::state const &  state,
color_modification  enabled,
float  x,
float  y,
float  width,
float  height,
GLuint  texture_handle,
ui::rotation  r,
bool  flipped,
bool  rtl 
)

Definition at line 553 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_textured_rect_direct()

void ogl::render_textured_rect_direct ( sys::state const &  state,
float  x,
float  y,
float  width,
float  height,
uint32_t  handle 
)

Definition at line 572 of file opengl_wrapper.cpp.

◆ render_tinted_rect()

void ogl::render_tinted_rect ( sys::state const &  state,
float  x,
float  y,
float  width,
float  height,
float  r,
float  g,
float  b,
ui::rotation  rot,
bool  flipped,
bool  rtl 
)

Definition at line 755 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_tinted_subsprite()

void ogl::render_tinted_subsprite ( sys::state const &  state,
int  frame,
int  total_frames,
float  x,
float  y,
float  width,
float  height,
float  r,
float  g,
float  b,
GLuint  texture_handle,
ui::rotation  rot,
bool  flipped,
bool  rtl 
)

Definition at line 770 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_tinted_textured_rect()

void ogl::render_tinted_textured_rect ( sys::state const &  state,
float  x,
float  y,
float  width,
float  height,
float  r,
float  g,
float  b,
GLuint  texture_handle,
ui::rotation  rot,
bool  flipped,
bool  rtl 
)

Definition at line 736 of file opengl_wrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_gltex_parameters()

void ogl::set_gltex_parameters ( GLuint  texture_handle,
GLuint  texture_type,
GLuint  filter,
GLuint  wrap 
)

Definition at line 1109 of file opengl_wrapper.cpp.

Here is the caller graph for this function:

◆ shutdown_opengl()

void ogl::shutdown_opengl ( sys::state state)

Definition at line 23 of file opengl_wrapper_nix.cpp.

Here is the caller graph for this function:

◆ SOIL_direct_load_DDS_from_memory()

GLuint ogl::SOIL_direct_load_DDS_from_memory ( unsigned char const *const  buffer,
uint32_t  buffer_length,
uint32_t width,
uint32_t height,
int  soil_flags 
)

Definition at line 180 of file texture.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: