38inline constexpr GLuint
tint = 12;
98inline void debug_callback(GLenum source, GLenum type, GLuint
id, GLenum severity,
100 GLchar
const* message,
void const*) {
102 std::string source_str;
104 case GL_DEBUG_SOURCE_API:
105 source_str =
"OpenGL API call";
107 case GL_DEBUG_SOURCE_WINDOW_SYSTEM:
108 source_str =
"Window system API";
110 case GL_DEBUG_SOURCE_SHADER_COMPILER:
111 source_str =
"Shading language compiler";
113 case GL_DEBUG_SOURCE_THIRD_PARTY:
114 source_str =
"Application associated with OpenGL";
116 case GL_DEBUG_SOURCE_APPLICATION:
117 source_str =
"User generated";
119 case GL_DEBUG_SOURCE_OTHER:
120 source_str =
"Unknown source";
125 std::string error_type;
127 case GL_DEBUG_TYPE_ERROR:
128 error_type =
"General error";
130 case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
131 error_type =
"Deprecated behavior";
133 case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
134 error_type =
"Undefined behavior";
136 case GL_DEBUG_TYPE_PORTABILITY:
137 error_type =
"Portability issue";
139 case GL_DEBUG_TYPE_PERFORMANCE:
140 error_type =
"Performance issue";
142 case GL_DEBUG_TYPE_MARKER:
143 error_type =
"Command stream annotation";
145 case GL_DEBUG_TYPE_PUSH_GROUP:
146 error_type =
"Error group push";
148 case GL_DEBUG_TYPE_POP_GROUP:
149 error_type =
"Error group pop";
151 case GL_DEBUG_TYPE_OTHER:
152 error_type =
"Uknown error type";
157 std::string severity_str;
159 case GL_DEBUG_SEVERITY_HIGH:
160 severity_str =
"High";
162 case GL_DEBUG_SEVERITY_MEDIUM:
163 severity_str =
"Medium";
165 case GL_DEBUG_SEVERITY_LOW:
166 severity_str =
"Low";
168 case GL_DEBUG_SEVERITY_NOTIFICATION:
169 severity_str =
"Notification";
174 std::string full_message(
"OpenGL error ");
175 full_message += std::to_string(
id);
177 full_message +=
"; Source: ";
178 full_message += source_str;
179 full_message +=
" ; Type: ";
180 full_message += error_type;
181 full_message +=
"; Severity: ";
182 full_message += severity_str;
183 full_message +=
"; ";
184 full_message += message;
185 full_message +=
"\n";
188 OutputDebugStringA(full_message.c_str());
190 printf(
"%s", full_message.c_str());
259GLuint
create_program(std::string_view vertex_shader, std::string_view fragment_shader);
265 float* buffer =
nullptr;
266 GLuint buffer_handle = 0;
267 bool pending_data_update =
true;
273 buffer =
new float[
count * 4];
277 : buffer(o.buffer), buffer_handle(o.buffer_handle), pending_data_update(o.pending_data_update),
count(o.count) {
283 buffer_handle = o.buffer_handle;
284 pending_data_update = o.pending_data_update;
293 void set_y(
float* v);
298 GLuint texture_handle,
ui::rotation r,
bool flipped,
bool rtl);
306 float height, GLuint texture_handle,
ui::rotation r,
bool flipped,
bool rtl);
308 GLuint texture_handle, GLuint mask_texture_handle,
ui::rotation r,
bool flipped,
bool rtl);
310 float height, GLuint left_texture_handle, GLuint right_texture_handle,
ui::rotation r,
bool flipped,
bool rtl);
312 GLuint texture_handle,
ui::rotation rot,
bool flipped,
bool rtl);
314 float width,
float height, GLuint texture_handle,
ui::rotation r,
bool flipped,
bool rtl);
316 float r,
float g,
float b,
ui::rotation rot,
bool flipped,
bool rtl);
318 float width,
float height,
float r,
float g,
float b, GLuint texture_handle,
ui::rotation rot,
bool flipped,
bool rtl);
322 color3f const& c, uint16_t font_id);
334void set_gltex_parameters(GLuint texture_handle, GLuint texture_type, GLuint filter, GLuint wrap);
lines(lines &&o) noexcept
lines & operator=(lines &&o) noexcept
constexpr GLuint piechart
constexpr GLuint interactable
constexpr GLuint frame_stretch
constexpr GLuint no_filter
constexpr GLuint transparent_color
constexpr GLuint progress_bar
constexpr GLuint use_mask
constexpr GLuint screen_width
constexpr GLuint subsprite_b
constexpr GLuint barchart
constexpr GLuint inner_color
constexpr GLuint disabled
constexpr GLuint screen_height
constexpr GLuint drawing_rectangle
constexpr GLuint border_size
constexpr GLuint linegraph
constexpr GLuint alternate_tint
constexpr GLuint interactable_disabled
constexpr GLuint border_filter
constexpr GLuint sub_sprite
constexpr GLuint linegraph_color
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 initialize_opengl(sys::state &state)
GLuint make_gl_texture(uint8_t *data, uint32_t size_x, uint32_t size_y, uint32_t channels)
void create_opengl_context(sys::state &state)
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 initialize_msaa(sys::state &state, int32_t size_x, int32_t size_y)
bool msaa_enabled(sys::state const &state)
void load_shaders(sys::state &state)
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_piechart(sys::state const &state, color_modification enabled, float x, float y, float size, data_texture &t)
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 load_global_squares(sys::state &state)
void deinitialize_msaa(sys::state &state)
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_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)
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)
void render_linegraph(sys::state const &state, color_modification enabled, float x, float y, float width, float height, lines &l)
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)
GLuint load_texture_array_from_file(simple_fs::file &file, int32_t tiles_x, int32_t tiles_y)
void render_simple_rect(sys::state const &state, float x, float y, float width, float height, ui::rotation r, bool flipped, bool rtl)
void shutdown_opengl(sys::state &state)
void debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei, GLchar const *message, void const *)
void set_gltex_parameters(GLuint texture_handle, GLuint texture_type, GLuint filter, GLuint wrap)
image load_stb_image(simple_fs::file &file)
GLuint create_program(std::string_view vertex_shader, std::string_view fragment_shader)
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)
bool display_tag_is_valid(sys::state &state, char tag[3])
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_text_icon(sys::state &state, text::embedded_icon ico, float x, float baseline_y, float font_size, text::font &f, ogl::color_modification cmod)
GLint compile_shader(std::string_view source, GLenum type)
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_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 render_textured_rect_direct(sys::state const &state, float x, float y, float width, float height, uint32_t handle)
void notify_user_of_fatal_opengl_error(std::string message)
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)
std::string_view native_string_view
GLuint global_square_flipped_buffer
GLuint color_blind_cross_icon_tex
GLuint ui_shader_screen_height_uniform
GLuint global_square_right_buffer
tagged_vector< texture, dcon::texture_id > asset_textures
GLuint checkmark_icon_tex
GLuint global_rtl_square_left_flipped_buffer
GLuint ui_shader_border_size_uniform
GLuint msaa_uniform_gaussian_blur
GLuint ui_shader_subroutines_index_uniform
GLuint ui_shader_inner_color_uniform
GLuint global_rtl_square_left_buffer
GLuint ui_shader_d_rect_uniform
GLuint global_rtl_square_right_buffer
GLuint global_rtl_square_buffer
GLuint global_rtl_square_flipped_buffer
GLuint msaa_uniform_screen_size
GLuint msaa_shader_program
GLuint ui_shader_secondary_texture_sampler_uniform
GLuint sub_square_buffers[64]
GLuint global_square_left_flipped_buffer
GLuint global_square_left_buffer
GLuint ui_shader_screen_width_uniform
GLuint global_square_buffer
GLuint ui_shader_texture_sampler_uniform
GLuint ui_shader_subrect_uniform
GLuint global_square_right_flipped_buffer
GLuint ui_shader_gamma_uniform
GLuint global_rtl_square_right_flipped_buffer
GLuint msaa_texcolorbuffer
image(image &&other) noexcept
image & operator=(image &&other) noexcept
image(uint8_t *data, int32_t size_x, int32_t size_y, int32_t channels)
image & operator=(image const &other)=delete
image(image const &other)=delete