|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include "backend_opengl_private.h"#include "graphics_private.h"#include <dttr_log.h>#include <dttr_config.h>#include <math.h>#include <stdlib.h>#include <string.h>#include "gen/opengl_shaders.h"Go to the source code of this file.
Macros | |
| #define | DRIVER_DISPLAY_OPENGL "OpenGL 3.3" |
Variables | |
| static const DTTR_RendererVtbl | renderer |
| #define DRIVER_DISPLAY_OPENGL "OpenGL 3.3" |
Definition at line 11 of file backend_opengl.c.
Referenced by get_driver_name().
|
static |
Definition at line 554 of file backend_opengl.c.
References dttr_graphics_mod_frame_begin(), release_deferred_gl_destroys(), state, upload_pending_textures_gl(), and opengl_backend_data::vertex_staging.
|
static |
Definition at line 904 of file backend_opengl.c.
References destroy_fbo(), destroy_msaa_fbo(), DTTR_MAX_STAGED_TEXTURES, DTTR_SAMPLER_COUNT, opengl_backend_data::dummy_texture, free, opengl_backend_data::gl_context, opengl_backend_data::gl_samplers, opengl_backend_data::gl_textures, NULL, opengl_backend_data::program, release_deferred_gl_destroys(), state, opengl_backend_data::vao, opengl_backend_data::vbo, opengl_backend_data::vertex_staging, and opengl_backend_data::video_texture.
Referenced by DTTR_Hook_WinMainCallback(), dttr_launcher_main(), DTTR_PCDOGS_PatchGroup_Install(), and test_pcdogs_generated_function_patch_specs_name_current_hooks().
|
static |
Definition at line 26 of file backend_opengl.c.
References DTTR_LOG_ERROR, NULL, source, and type.
Referenced by create_program().
|
static |
Definition at line 85 of file backend_opengl.c.
References DTTR_LOG_ERROR, opengl_backend_data::fbo, opengl_backend_data::fbo_color_tex, opengl_backend_data::fbo_depth_rbo, opengl_backend_data::fbo_height, opengl_backend_data::fbo_width, and NULL.
Referenced by dttr_graphics_opengl_init(), and resize_fbo().
|
static |
Definition at line 193 of file backend_opengl.c.
References DTTR_LOG_ERROR, h, opengl_backend_data::msaa_color_rbo, opengl_backend_data::msaa_depth_rbo, opengl_backend_data::msaa_fbo, opengl_backend_data::msaa_samples, samples, and w.
Referenced by dttr_graphics_opengl_init(), and resize_fbo().
|
static |
Definition at line 49 of file backend_opengl.c.
References compile_shader(), DTTR_LOG_ERROR, and NULL.
Referenced by dttr_graphics_opengl_init().
|
static |
Definition at line 152 of file backend_opengl.c.
References dttr_config, DTTR_SAMPLER_COUNT, and opengl_backend_data::gl_samplers.
Referenced by dttr_graphics_opengl_init().
|
static |
Definition at line 269 of file backend_opengl.c.
References opengl_backend_data::deferred_gl_destroy_count, opengl_backend_data::deferred_gl_destroys, DTTR_MAX_STAGED_TEXTURES, opengl_backend_data::gl_textures, and state.
|
static |
Definition at line 135 of file backend_opengl.c.
References opengl_backend_data::fbo, opengl_backend_data::fbo_color_tex, and opengl_backend_data::fbo_depth_rbo.
Referenced by cleanup(), and resize_fbo().
|
static |
Definition at line 229 of file backend_opengl.c.
References opengl_backend_data::msaa_color_rbo, opengl_backend_data::msaa_depth_rbo, opengl_backend_data::msaa_fbo, and opengl_backend_data::msaa_samples.
Referenced by cleanup(), dttr_graphics_opengl_init(), and resize_fbo().
| bool dttr_graphics_opengl_init | ( | DTTR_BackendState * | state | ) |
Definition at line 288 of file backend_opengl.c.
References create_fbo(), create_msaa_fbo(), create_program(), create_samplers(), destroy_msaa_fbo(), DTTR_BACKEND_OPENGL, DTTR_LOG_ERROR, DTTR_LOG_INFO, DTTR_LOG_WARN, DTTR_MAX_FRAME_VERTICES, DTTR_VERTEX_SIZE, opengl_backend_data::dummy_texture, free, opengl_backend_data::gl_context, opengl_backend_data::loc_alpha_arg1, opengl_backend_data::loc_alpha_arg2, opengl_backend_data::loc_alpha_op, opengl_backend_data::loc_color_arg1, opengl_backend_data::loc_color_arg2, opengl_backend_data::loc_color_op, opengl_backend_data::loc_has_texture, opengl_backend_data::loc_is_2d, opengl_backend_data::loc_mvp, opengl_backend_data::loc_screen_size, opengl_backend_data::loc_texture, NULL, opengl_backend_data::program, renderer, select_gl_msaa_samples(), state, stride, opengl_backend_data::vao, opengl_backend_data::vbo, and opengl_backend_data::vertex_staging.
|
static |
Definition at line 705 of file backend_opengl.c.
References dttr_config, dttr_graphics_compute_present_rect(), dttr_graphics_mod_after_game_frame(), dttr_graphics_mod_before_game_frame(), dttr_graphics_mod_frame_end(), dttr_graphics_mod_present_rect_after(), dttr_graphics_mod_present_rect_before(), dttr_imgui_render_game_opengl(), dttr_imgui_render_opengl(), DTTR_SCALING_METHOD_LOGICAL, DTTR_SCALING_MODE_INTEGER, DTTR_SCALING_MODE_STRETCH, DTTR_VERTEX_SIZE, opengl_backend_data::fbo, opengl_backend_data::fbo_height, opengl_backend_data::fbo_width, DTTR_PresentRect::h, opengl_backend_data::msaa_fbo, opengl_backend_data::msaa_samples, NULL, replay_batch_records_gl(), state, opengl_backend_data::vbo, opengl_backend_data::vertex_staging, DTTR_PresentRect::w, DTTR_PresentRect::x, and DTTR_PresentRect::y.
|
static |
Definition at line 951 of file backend_opengl.c.
References DRIVER_DISPLAY_OPENGL, and state.
|
static |
Definition at line 814 of file backend_opengl.c.
References DTTR_D3DTA_DIFFUSE, DTTR_D3DTA_TEXTURE, DTTR_D3DTOP_MODULATE, DTTR_D3DTOP_SELECTARG1, dttr_graphics_compute_present_rect(), dttr_graphics_mat4_identity(), float, DTTR_PresentRect::h, opengl_backend_data::loc_alpha_arg1, opengl_backend_data::loc_alpha_arg2, opengl_backend_data::loc_alpha_op, opengl_backend_data::loc_color_arg1, opengl_backend_data::loc_color_arg2, opengl_backend_data::loc_color_op, opengl_backend_data::loc_has_texture, opengl_backend_data::loc_is_2d, opengl_backend_data::loc_mvp, opengl_backend_data::loc_screen_size, opengl_backend_data::loc_texture, opengl_backend_data::program, state, stride, upload_video_texture(), opengl_backend_data::vao, opengl_backend_data::vbo, opengl_backend_data::video_texture, DTTR_PresentRect::w, DTTR_PresentRect::x, and DTTR_PresentRect::y.
|
static |
Definition at line 248 of file backend_opengl.c.
References opengl_backend_data::deferred_gl_destroy_count, opengl_backend_data::deferred_gl_destroys, and state.
Referenced by begin_frame(), and cleanup().
|
static |
Definition at line 573 of file backend_opengl.c.
References DTTR_Uniforms::alpha_arg1, DTTR_Uniforms::alpha_arg2, DTTR_Uniforms::alpha_op, DTTR_BatchRecord::blend_mode, DTTR_BatchRecord::clear, DTTR_BatchRecord::color, DTTR_Uniforms::color_arg1, DTTR_Uniforms::color_arg2, DTTR_Uniforms::color_op, DTTR_BatchRecord::depth, DTTR_BatchRecord::depth_test, DTTR_BatchRecord::depth_write, DTTR_BatchRecord::draw, DTTR_BATCH_CLEAR, DTTR_BLEND_ADDITIVE, DTTR_BLEND_OFF, DTTR_CLEAR_COLOR, DTTR_CLEAR_DEPTH, DTTR_MAX_STAGED_TEXTURES, opengl_backend_data::dummy_texture, opengl_backend_data::fbo, opengl_backend_data::fbo_height, opengl_backend_data::fbo_width, DTTR_BatchRecord::first_vertex, DTTR_BatchRecord::flags, opengl_backend_data::gl_samplers, opengl_backend_data::gl_textures, DTTR_Uniforms::has_texture, DTTR_Uniforms::is_2d, opengl_backend_data::loc_alpha_arg1, opengl_backend_data::loc_alpha_arg2, opengl_backend_data::loc_alpha_op, opengl_backend_data::loc_color_arg1, opengl_backend_data::loc_color_arg2, opengl_backend_data::loc_color_op, opengl_backend_data::loc_has_texture, opengl_backend_data::loc_is_2d, opengl_backend_data::loc_mvp, opengl_backend_data::loc_screen_size, opengl_backend_data::loc_texture, opengl_backend_data::msaa_fbo, opengl_backend_data::msaa_samples, DTTR_Uniforms::mvp, opengl_backend_data::program, DTTR_BatchRecord::sampler_index, DTTR_Uniforms::screen_size, state, DTTR_BatchRecord::texture_index, DTTR_BatchRecord::type, DTTR_BatchRecord::uniforms, opengl_backend_data::vao, and DTTR_BatchRecord::vertex_count.
Referenced by end_frame().
|
static |
Definition at line 418 of file backend_opengl.c.
References create_fbo(), create_msaa_fbo(), destroy_fbo(), destroy_msaa_fbo(), DTTR_LOG_ERROR, DTTR_LOG_INFO, DTTR_LOG_WARN, opengl_backend_data::fbo_height, opengl_backend_data::fbo_width, opengl_backend_data::msaa_samples, and state.
|
static |
Definition at line 172 of file backend_opengl.c.
References dttr_config.
Referenced by dttr_graphics_opengl_init().
|
static |
Definition at line 452 of file backend_opengl.c.
References dttr_config, free, opengl_backend_data::gl_textures, NULL, opengl_backend_data::pending_mipmap_count, opengl_backend_data::pending_mipmap_textures, st, and state.
Referenced by begin_frame().
|
static |
Definition at line 523 of file backend_opengl.c.
References opengl_backend_data::video_height, opengl_backend_data::video_texture, and opengl_backend_data::video_width.
Referenced by present_video_frame_bgra().
|
static |
Definition at line 22 of file backend_opengl.c.
Referenced by dttr_graphics_opengl_init(), and dttr_graphics_sdl3gpu_init().