ReShade
A generic post-processing injector for games and video software.
reshade_api.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Patrick Mours
3  * SPDX-License-Identifier: BSD-3-Clause OR MIT
4  */
5 
6 #pragma once
7 
8 #include "reshade_api_device.hpp"
9 
10 namespace reshade { namespace api
11 {
33 
37  enum class input_source
38  {
39  none = 0,
40  mouse = 1,
41  keyboard = 2,
42  gamepad = 3,
43  clipboard = 4,
44  };
45 
50  struct __declspec(novtable) effect_runtime : public device_object
51  {
55  virtual void *get_hwnd() const = 0;
56 
61  virtual resource get_back_buffer(uint32_t index) = 0;
62 
66  virtual uint32_t get_back_buffer_count() const = 0;
67 
75  virtual uint32_t get_current_back_buffer_index() const = 0;
76 
82 
96  virtual void render_effects(command_list *cmd_list, resource_view rtv, resource_view rtv_srgb) = 0;
97 
102  virtual bool capture_screenshot(void *pixels) = 0;
103 
107  virtual void get_screenshot_width_and_height(uint32_t *out_width, uint32_t *out_height) const = 0;
108 
114  virtual bool is_key_down(uint32_t keycode) const = 0;
120  virtual bool is_key_pressed(uint32_t keycode) const = 0;
126  virtual bool is_key_released(uint32_t keycode) const = 0;
132  virtual bool is_mouse_button_down(uint32_t button) const = 0;
138  virtual bool is_mouse_button_pressed(uint32_t button) const = 0;
144  virtual bool is_mouse_button_released(uint32_t button) const = 0;
145 
152  virtual void get_mouse_cursor_position(uint32_t *out_x, uint32_t *out_y, int16_t *out_wheel_delta = nullptr) const = 0;
153 
160  virtual void enumerate_uniform_variables(const char *effect_name, void(*callback)(effect_runtime *runtime, effect_uniform_variable variable, void *user_data), void *user_data) = 0;
166  template <typename F>
167  void enumerate_uniform_variables(const char *effect_name, F lambda)
168  {
169  enumerate_uniform_variables(effect_name, [](effect_runtime *runtime, effect_uniform_variable variable, void *user_data) { static_cast<F *>(user_data)->operator()(runtime, variable); }, &lambda);
170  }
171 
181  virtual effect_uniform_variable find_uniform_variable(const char *effect_name, const char *variable_name) const = 0;
182 
191  virtual void get_uniform_variable_type(effect_uniform_variable variable, format *out_base_type, uint32_t *out_rows = nullptr, uint32_t *out_columns = nullptr, uint32_t *out_array_length = nullptr) const = 0;
192 
199  virtual void get_uniform_variable_name(effect_uniform_variable variable, char *name, size_t *name_size) const = 0;
200  template <size_t SIZE>
201  void get_uniform_variable_name(effect_uniform_variable variable, char(&name)[SIZE]) const
202  {
203  size_t name_size = SIZE;
204  get_uniform_variable_name(variable, name, &name_size);
205  }
206 
216  virtual bool get_annotation_bool_from_uniform_variable(effect_uniform_variable variable, const char *name, bool *values, size_t count, size_t array_index = 0) const = 0;
226  virtual bool get_annotation_float_from_uniform_variable(effect_uniform_variable variable, const char *name, float *values, size_t count, size_t array_index = 0) const = 0;
236  virtual bool get_annotation_int_from_uniform_variable(effect_uniform_variable variable, const char *name, int32_t *values, size_t count, size_t array_index = 0) const = 0;
246  virtual bool get_annotation_uint_from_uniform_variable(effect_uniform_variable variable, const char *name, uint32_t *values, size_t count, size_t array_index = 0) const = 0;
255  virtual bool get_annotation_string_from_uniform_variable(effect_uniform_variable variable, const char *name, char *value, size_t *value_size) const = 0;
256  template <size_t SIZE>
257  bool get_annotation_string_from_uniform_variable(effect_uniform_variable variable, const char *name, char(&value)[SIZE]) const
258  {
259  size_t value_size = SIZE;
260  return get_annotation_string_from_uniform_variable(variable, name, value, &value_size);
261  }
262 
270  virtual void get_uniform_value_bool(effect_uniform_variable variable, bool *values, size_t count, size_t array_index = 0) const = 0;
278  virtual void get_uniform_value_float(effect_uniform_variable variable, float *values, size_t count, size_t array_index = 0) const = 0;
286  virtual void get_uniform_value_int(effect_uniform_variable variable, int32_t *values, size_t count, size_t array_index = 0) const = 0;
294  virtual void get_uniform_value_uint(effect_uniform_variable variable, uint32_t *values, size_t count, size_t array_index = 0) const = 0;
295 
308  virtual void set_uniform_value_bool(effect_uniform_variable variable, const bool *values, size_t count, size_t array_index = 0) = 0;
317  void set_uniform_value_bool(effect_uniform_variable variable, bool x, bool y = bool(0), bool z = bool(0), bool w = bool(0))
318  {
319  const bool values[4] = { x, y, z, w };
320  set_uniform_value_bool(variable, values, 4);
321  }
334  virtual void set_uniform_value_float(effect_uniform_variable variable, const float *values, size_t count, size_t array_index = 0) = 0;
343  void set_uniform_value_float(effect_uniform_variable variable, float x, float y = float(0), float z = float(0), float w = float(0))
344  {
345  const float values[4] = { x, y, z, w };
346  set_uniform_value_float(variable, values, 4);
347  }
360  virtual void set_uniform_value_int(effect_uniform_variable variable, const int32_t *values, size_t count, size_t array_index = 0) = 0;
369  void set_uniform_value_int(effect_uniform_variable variable, int32_t x, int32_t y = int32_t(0), int32_t z = int32_t(0), int32_t w = int32_t(0))
370  {
371  const int32_t values[4] = { x, y, z, w };
372  set_uniform_value_int(variable, values, 4);
373  }
386  virtual void set_uniform_value_uint(effect_uniform_variable variable, const uint32_t *values, size_t count, size_t array_index = 0) = 0;
395  void set_uniform_value_uint(effect_uniform_variable variable, uint32_t x, uint32_t y = uint32_t(0), uint32_t z = uint32_t(0), uint32_t w = uint32_t(0))
396  {
397  const uint32_t values[4] = { x, y, z, w };
398  set_uniform_value_uint(variable, values, 4);
399  }
400 
407  virtual void enumerate_texture_variables(const char *effect_name, void(*callback)(effect_runtime *runtime, effect_texture_variable variable, void *user_data), void *user_data) = 0;
413  template <typename F>
414  void enumerate_texture_variables(const char *effect_name, F lambda)
415  {
416  enumerate_texture_variables(effect_name, [](effect_runtime *runtime, effect_texture_variable variable, void *user_data) { static_cast<F *>(user_data)->operator()(runtime, variable); }, &lambda);
417  }
418 
425  virtual effect_texture_variable find_texture_variable(const char *effect_name, const char *variable_name) const = 0;
426 
433  virtual void get_texture_variable_name(effect_texture_variable variable, char *name, size_t *name_size) const = 0;
434  template <size_t SIZE>
435  void get_texture_variable_name(effect_texture_variable variable, char(&name)[SIZE]) const
436  {
437  size_t name_size = SIZE;
438  get_texture_variable_name(variable, name, &name_size);
439  }
440 
450  virtual bool get_annotation_bool_from_texture_variable(effect_texture_variable variable, const char *name, bool *values, size_t count, size_t array_index = 0) const = 0;
460  virtual bool get_annotation_float_from_texture_variable(effect_texture_variable variable, const char *name, float *values, size_t count, size_t array_index = 0) const = 0;
470  virtual bool get_annotation_int_from_texture_variable(effect_texture_variable variable, const char *name, int32_t *values, size_t count, size_t array_index = 0) const = 0;
480  virtual bool get_annotation_uint_from_texture_variable(effect_texture_variable variable, const char *name, uint32_t *values, size_t count, size_t array_index = 0) const = 0;
489  virtual bool get_annotation_string_from_texture_variable(effect_texture_variable variable, const char *name, char *value, size_t *value_size) const = 0;
490  template <size_t SIZE>
491  bool get_annotation_string_from_texture_variable(effect_texture_variable variable, const char *name, char(&value)[SIZE]) const
492  {
493  size_t value_size = SIZE;
494  return get_annotation_string_from_texture_variable(variable, name, value, &value_size);
495  }
496 
504  virtual void update_texture(effect_texture_variable variable, const uint32_t width, const uint32_t height, const void *pixels) = 0;
505 
512  virtual void get_texture_binding(effect_texture_variable variable, resource_view *out_srv, resource_view *out_srv_srgb) const = 0;
513 
523  virtual void update_texture_bindings(const char *semantic, resource_view srv, resource_view srv_srgb) = 0;
524 
531  virtual void enumerate_techniques(const char *effect_name, void(*callback)(effect_runtime *runtime, effect_technique technique, void *user_data), void *user_data) = 0;
537  template <typename F>
538  void enumerate_techniques(const char *effect_name, F lambda)
539  {
540  enumerate_techniques(effect_name, [](effect_runtime *runtime, effect_technique technique, void *user_data) { static_cast<F *>(user_data)->operator()(runtime, technique); }, &lambda);
541  }
542 
549  virtual effect_technique find_technique(const char *effect_name, const char *technique_name) = 0;
550 
557  virtual void get_technique_name(effect_technique technique, char *name, size_t *name_size) const = 0;
558  template <size_t SIZE>
559  void get_technique_name(effect_technique technique, char(&name)[SIZE]) const
560  {
561  size_t name_size = SIZE;
562  get_technique_name(technique, name, &name_size);
563  }
564 
574  virtual bool get_annotation_bool_from_technique(effect_technique technique, const char *name, bool *values, size_t count, size_t array_index = 0) const = 0;
584  virtual bool get_annotation_float_from_technique(effect_technique technique, const char *name, float *values, size_t count, size_t array_index = 0) const = 0;
594  virtual bool get_annotation_int_from_technique(effect_technique technique, const char *name, int32_t *values, size_t count, size_t array_index = 0) const = 0;
604  virtual bool get_annotation_uint_from_technique(effect_technique technique, const char *name, uint32_t *values, size_t count, size_t array_index = 0) const = 0;
613  virtual bool get_annotation_string_from_technique(effect_technique technique, const char *name, char *value, size_t *value_size) const = 0;
614  template <size_t SIZE>
615  bool get_annotation_string_from_technique(effect_technique technique, const char *name, char(&value)[SIZE]) const
616  {
617  size_t value_size = SIZE;
618  return get_annotation_string_from_technique(technique, name, value, &value_size);
619  }
620 
626  virtual bool get_technique_state(effect_technique technique) const = 0;
635  virtual void set_technique_state(effect_technique technique, bool enabled) = 0;
636 
644  virtual bool get_preprocessor_definition(const char *name, char *value, size_t *value_size) const = 0;
645  template <size_t SIZE>
646  bool get_preprocessor_definition(const char *name, char(&value)[SIZE]) const
647  {
648  size_t value_size = SIZE;
649  return get_preprocessor_definition(name, value, &value_size);
650  }
656  virtual void set_preprocessor_definition(const char *name, const char *value) = 0;
657 
671  virtual void render_technique(effect_technique technique, command_list *cmd_list, resource_view rtv, resource_view rtv_srgb = { 0 }) = 0;
672 
676  virtual bool get_effects_state() const = 0;
684  virtual void set_effects_state(bool enabled) = 0;
685 
691  virtual void get_current_preset_path(char *path, size_t *path_size) const = 0;
692  template <size_t SIZE>
693  void get_current_preset_path(char(&path)[SIZE]) const
694  {
695  size_t path_size = SIZE;
696  get_current_preset_path(path, &path_size);
697  }
705  virtual void set_current_preset_path(const char *path) = 0;
706 
715  virtual void reorder_techniques(size_t count, const effect_technique *techniques) = 0;
716 
721  virtual void block_input_next_frame() = 0;
722 
726  virtual uint32_t last_key_pressed() const = 0;
730  virtual uint32_t last_key_released() const = 0;
731 
738  virtual void get_uniform_variable_effect_name(effect_uniform_variable variable, char *effect_name, size_t *effect_name_size) const = 0;
739  template <size_t SIZE>
740  void get_uniform_variable_effect_name(effect_uniform_variable variable, char(&effect_name)[SIZE]) const
741  {
742  size_t effect_name_size = SIZE;
743  get_uniform_variable_effect_name(variable, effect_name, &effect_name_size);
744  }
745 
752  virtual void get_texture_variable_effect_name(effect_texture_variable variable, char *effect_name, size_t *effect_name_size) const = 0;
753  template <size_t SIZE>
754  void get_texture_variable_effect_name(effect_texture_variable variable, char(&effect_name)[SIZE]) const
755  {
756  size_t effect_name_size = SIZE;
757  get_texture_variable_effect_name(variable, effect_name, &effect_name_size);
758  }
759 
766  virtual void get_technique_effect_name(effect_technique technique, char *effect_name, size_t *effect_name_size) const = 0;
767  template <size_t SIZE>
768  void get_technique_effect_name(effect_technique technique, char(&effect_name)[SIZE]) const
769  {
770  size_t effect_name_size = SIZE;
771  get_technique_effect_name(technique, effect_name, &effect_name_size);
772  }
773 
777  virtual void save_current_preset() const = 0;
778 
787  virtual bool get_preprocessor_definition_for_effect(const char *effect_name, const char *name, char *value, size_t *value_size) const = 0;
788  template <size_t SIZE>
789  bool get_preprocessor_definition_for_effect(const char *effect_name, const char *name, char(&value)[SIZE]) const
790  {
791  size_t value_size = SIZE;
792  return get_preprocessor_definition_for_effect(effect_name, name, value, &value_size);
793  }
800  virtual void set_preprocessor_definition_for_effect(const char *effect_name, const char *name, const char *value) = 0;
801 
811  virtual bool open_overlay(bool open, input_source source) = 0;
812 
817 
825  virtual void reset_uniform_value(effect_uniform_variable variable) = 0;
826 
832  virtual void reload_effect_next_frame(const char *effect_name) = 0;
833 
838  virtual void export_current_preset(const char *path) const = 0;
839 
844  virtual void save_screenshot(const char *postfix = nullptr) = 0;
845  };
846 } }
input_source
Input source for events triggered by user input.
Definition: reshade_api.hpp:38
color_space
The available color space types for presentation.
Definition: reshade_api_format.hpp:186
format
Available data and texture formats. This is mostly compatible with 'DXGI_FORMAT'.
Definition: reshade_api_format.hpp:18
Definition: reshade.hpp:56
#define RESHADE_DEFINE_HANDLE(name)
Definition: reshade_api_resource.hpp:8
A command list, used to enqueue render commands on the CPU, before later executing them in a command ...
Definition: reshade_api_device.hpp:677
A command queue, used to execute command lists on the GPU.
Definition: reshade_api_device.hpp:1181
The base class for objects that are children to a device.
Definition: reshade_api_device.hpp:648
A post-processing effect runtime, used to control effects.
Definition: reshade_api.hpp:51
virtual bool get_annotation_string_from_uniform_variable(effect_uniform_variable variable, const char *name, char *value, size_t *value_size) const =0
Gets the value from a string annotation attached to the specified uniform variable .
virtual void set_uniform_value_float(effect_uniform_variable variable, const float *values, size_t count, size_t array_index=0)=0
Sets the value of the specified uniform variable as floating-point values.
void enumerate_uniform_variables(const char *effect_name, F lambda)
Enumerates all uniform variables of loaded effects and calls the specified callback function with a h...
Definition: reshade_api.hpp:167
virtual bool get_annotation_string_from_texture_variable(effect_texture_variable variable, const char *name, char *value, size_t *value_size) const =0
Gets the value from a string annotation attached to the specified texture variable .
virtual void get_technique_name(effect_technique technique, char *name, size_t *name_size) const =0
Gets the name of a technique .
virtual void get_technique_effect_name(effect_technique technique, char *effect_name, size_t *effect_name_size) const =0
Gets the effect file name of a technique .
bool get_annotation_string_from_technique(effect_technique technique, const char *name, char(&value)[SIZE]) const
Definition: reshade_api.hpp:615
virtual bool get_annotation_bool_from_technique(effect_technique technique, const char *name, bool *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified technique as boolean values.
virtual bool get_preprocessor_definition(const char *name, char *value, size_t *value_size) const =0
Gets the value of a preprocessor definition.
void set_uniform_value_int(effect_uniform_variable variable, int32_t x, int32_t y=int32_t(0), int32_t z=int32_t(0), int32_t w=int32_t(0))
Sets the value of the specified uniform variable as a vector of signed integer values.
Definition: reshade_api.hpp:369
virtual uint32_t get_back_buffer_count() const =0
Gets the number of back buffer resources in the swap chain associated with this effect runtime.
virtual bool is_key_down(uint32_t keycode) const =0
Gets the current status of the specified key.
void get_technique_name(effect_technique technique, char(&name)[SIZE]) const
Definition: reshade_api.hpp:559
virtual void export_current_preset(const char *path) const =0
Export the current preset with the current state of the loaded techniques and uniform variables.
virtual bool get_annotation_bool_from_texture_variable(effect_texture_variable variable, const char *name, bool *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified texture variable as boolean values.
void enumerate_texture_variables(const char *effect_name, F lambda)
Enumerates all texture variables of loaded effects and calls the specified callback function with a h...
Definition: reshade_api.hpp:414
resource get_current_back_buffer()
Gets the current back buffer resource.
Definition: reshade_api.hpp:71
virtual effect_uniform_variable find_uniform_variable(const char *effect_name, const char *variable_name) const =0
Finds a specific uniform variable in the loaded effects and returns a handle to it.
virtual bool is_mouse_button_released(uint32_t button) const =0
Gets whether the specified mouse button was released this frame.
virtual bool is_mouse_button_pressed(uint32_t button) const =0
Gets whether the specified mouse button was pressed this frame.
virtual void get_current_preset_path(char *path, size_t *path_size) const =0
Gets the file path to the currently active preset.
virtual bool get_effects_state() const =0
Gets whether rendering of effects is enabled or disabled.
bool get_preprocessor_definition(const char *name, char(&value)[SIZE]) const
Definition: reshade_api.hpp:646
bool get_annotation_string_from_texture_variable(effect_texture_variable variable, const char *name, char(&value)[SIZE]) const
Definition: reshade_api.hpp:491
virtual void get_screenshot_width_and_height(uint32_t *out_width, uint32_t *out_height) const =0
Gets the current buffer dimensions of the swap chain.
virtual resource get_back_buffer(uint32_t index)=0
Gets the back buffer resource at the specified index in the swap chain associated with this effect r...
virtual bool open_overlay(bool open, input_source source)=0
Open or close the ReShade overlay.
virtual void block_input_next_frame()=0
Makes ReShade block any keyboard and mouse input from reaching the game for the duration of the next ...
virtual void get_uniform_value_bool(effect_uniform_variable variable, bool *values, size_t count, size_t array_index=0) const =0
Gets the value of the specified uniform variable as boolean values.
void set_uniform_value_bool(effect_uniform_variable variable, bool x, bool y=bool(0), bool z=bool(0), bool w=bool(0))
Sets the value of the specified uniform variable as a vector of boolean values.
Definition: reshade_api.hpp:317
virtual void get_texture_binding(effect_texture_variable variable, resource_view *out_srv, resource_view *out_srv_srgb) const =0
Gets the shader resource view that is bound to the specified texture variable .
virtual bool get_annotation_float_from_uniform_variable(effect_uniform_variable variable, const char *name, float *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified uniform variable as floating-point value...
bool get_preprocessor_definition_for_effect(const char *effect_name, const char *name, char(&value)[SIZE]) const
Definition: reshade_api.hpp:789
virtual void set_technique_state(effect_technique technique, bool enabled)=0
Enables or disables the specified technique .
virtual void set_uniform_value_int(effect_uniform_variable variable, const int32_t *values, size_t count, size_t array_index=0)=0
Sets the value of the specified uniform variable as signed integer values.
virtual uint32_t last_key_released() const =0
Gets the virtual key code of the last key that was released.
virtual void get_uniform_value_uint(effect_uniform_variable variable, uint32_t *values, size_t count, size_t array_index=0) const =0
Gets the value of the specified uniform variable as unsigned integer values.
void get_current_preset_path(char(&path)[SIZE]) const
Definition: reshade_api.hpp:693
virtual void set_uniform_value_uint(effect_uniform_variable variable, const uint32_t *values, size_t count, size_t array_index=0)=0
Sets the value of the specified uniform variable as unsigned integer values.
void get_technique_effect_name(effect_technique technique, char(&effect_name)[SIZE]) const
Definition: reshade_api.hpp:768
virtual void set_uniform_value_bool(effect_uniform_variable variable, const bool *values, size_t count, size_t array_index=0)=0
Sets the value of the specified uniform variable as boolean values.
void set_uniform_value_float(effect_uniform_variable variable, float x, float y=float(0), float z=float(0), float w=float(0))
Sets the value of the specified uniform variable as a vector of floating-point values.
Definition: reshade_api.hpp:343
virtual void set_color_space(color_space color_space)=0
Overrides the color space used for presentation.
void set_uniform_value_uint(effect_uniform_variable variable, uint32_t x, uint32_t y=uint32_t(0), uint32_t z=uint32_t(0), uint32_t w=uint32_t(0))
Sets the value of the specified uniform variable as a vector of unsigned integer values.
Definition: reshade_api.hpp:395
virtual void reload_effect_next_frame(const char *effect_name)=0
Queues up the specified effect for reloading in the next frame. This can be called multiple times wit...
virtual void enumerate_techniques(const char *effect_name, void(*callback)(effect_runtime *runtime, effect_technique technique, void *user_data), void *user_data)=0
Enumerates all techniques of loaded effects and calls the specified callback function with a handle ...
virtual void enumerate_uniform_variables(const char *effect_name, void(*callback)(effect_runtime *runtime, effect_uniform_variable variable, void *user_data), void *user_data)=0
Enumerates all uniform variables of loaded effects and calls the specified callback function with a ...
virtual void save_current_preset() const =0
Saves the current preset with the current state of the loaded techniques and uniform variables.
virtual bool get_technique_state(effect_technique technique) const =0
Gets the state of a technique .
virtual void set_preprocessor_definition(const char *name, const char *value)=0
Defines a preprocessor definition to the specified value .
virtual void get_uniform_variable_type(effect_uniform_variable variable, format *out_base_type, uint32_t *out_rows=nullptr, uint32_t *out_columns=nullptr, uint32_t *out_array_length=nullptr) const =0
Gets information about the data type of a uniform variable .
virtual bool get_annotation_uint_from_technique(effect_technique technique, const char *name, uint32_t *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified technique as unsigned integer values.
virtual void render_effects(command_list *cmd_list, resource_view rtv, resource_view rtv_srgb)=0
Applies post-processing effects to the specified render targets and prevents the usual rendering of e...
virtual void get_texture_variable_name(effect_texture_variable variable, char *name, size_t *name_size) const =0
Gets the name of a texture variable .
void get_uniform_variable_effect_name(effect_uniform_variable variable, char(&effect_name)[SIZE]) const
Definition: reshade_api.hpp:740
virtual bool get_annotation_uint_from_texture_variable(effect_texture_variable variable, const char *name, uint32_t *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified texture variable as unsigned integer val...
virtual void get_uniform_value_int(effect_uniform_variable variable, int32_t *values, size_t count, size_t array_index=0) const =0
Gets the value of the specified uniform variable as signed integer values.
virtual void get_uniform_value_float(effect_uniform_variable variable, float *values, size_t count, size_t array_index=0) const =0
Gets the value of the specified uniform variable as floating-point values.
virtual bool get_annotation_bool_from_uniform_variable(effect_uniform_variable variable, const char *name, bool *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified uniform variable as boolean values.
virtual void render_technique(effect_technique technique, command_list *cmd_list, resource_view rtv, resource_view rtv_srgb={ 0 })=0
Applies a technique to the specified render targets (regardless of the state of this technique).
void enumerate_techniques(const char *effect_name, F lambda)
Enumerates all techniques of loaded effects and calls the specified callback function with a handle f...
Definition: reshade_api.hpp:538
virtual void get_uniform_variable_name(effect_uniform_variable variable, char *name, size_t *name_size) const =0
Gets the name of a uniform variable .
virtual bool get_preprocessor_definition_for_effect(const char *effect_name, const char *name, char *value, size_t *value_size) const =0
Gets the value of a preprocessor definition for the specified effect.
virtual void * get_hwnd() const =0
Gets the handle of the window associated with this effect runtime.
virtual uint32_t last_key_pressed() const =0
Gets the virtual key code of the last key that was pressed.
virtual bool is_mouse_button_down(uint32_t button) const =0
Gets the current status of the specified mouse button.
virtual bool get_annotation_int_from_technique(effect_technique technique, const char *name, int32_t *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified technique as signed integer values.
virtual bool get_annotation_string_from_technique(effect_technique technique, const char *name, char *value, size_t *value_size) const =0
Gets the value from a string annotation attached to the specified technique .
bool get_annotation_string_from_uniform_variable(effect_uniform_variable variable, const char *name, char(&value)[SIZE]) const
Definition: reshade_api.hpp:257
virtual bool is_key_pressed(uint32_t keycode) const =0
Gets whether the specified key was pressed this frame.
virtual void enumerate_texture_variables(const char *effect_name, void(*callback)(effect_runtime *runtime, effect_texture_variable variable, void *user_data), void *user_data)=0
Enumerates all texture variables of loaded effects and calls the specified callback function with a ...
virtual command_queue * get_command_queue()=0
Gets the main graphics command queue associated with this effect runtime. This may potentially be dif...
virtual bool get_annotation_int_from_texture_variable(effect_texture_variable variable, const char *name, int32_t *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified texture variable as signed integer value...
virtual bool get_annotation_uint_from_uniform_variable(effect_uniform_variable variable, const char *name, uint32_t *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified uniform variable as unsigned integer val...
virtual void save_screenshot(const char *postfix=nullptr)=0
Captures a screenshot of the current back buffer resource and saves it to an image file on disk.
virtual void set_preprocessor_definition_for_effect(const char *effect_name, const char *name, const char *value)=0
Defines a preprocessor definition for the specified effect to the specified value .
virtual uint32_t get_current_back_buffer_index() const =0
Gets the index of the back buffer resource that can currently be rendered into.
virtual bool get_annotation_int_from_uniform_variable(effect_uniform_variable variable, const char *name, int32_t *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified uniform variable as signed integer value...
virtual void set_current_preset_path(const char *path)=0
Saves the currently active preset and then switches to the specified new preset.
virtual bool is_key_released(uint32_t keycode) const =0
Gets whether the specified key was released this frame.
void get_texture_variable_effect_name(effect_texture_variable variable, char(&effect_name)[SIZE]) const
Definition: reshade_api.hpp:754
void get_texture_variable_name(effect_texture_variable variable, char(&name)[SIZE]) const
Definition: reshade_api.hpp:435
void get_uniform_variable_name(effect_uniform_variable variable, char(&name)[SIZE]) const
Definition: reshade_api.hpp:201
virtual effect_technique find_technique(const char *effect_name, const char *technique_name)=0
Finds a specific technique in the loaded effects and returns a handle to it.
virtual void get_texture_variable_effect_name(effect_texture_variable variable, char *effect_name, size_t *effect_name_size) const =0
Gets the effect file name of a texture variable .
virtual void update_texture_bindings(const char *semantic, resource_view srv, resource_view srv_srgb)=0
Binds new shader resource views to all texture variables that use the specified semantic .
virtual bool get_annotation_float_from_technique(effect_technique technique, const char *name, float *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified technique as floating-point values.
virtual void update_texture(effect_texture_variable variable, const uint32_t width, const uint32_t height, const void *pixels)=0
Uploads image data to the specified texture variable .
virtual effect_texture_variable find_texture_variable(const char *effect_name, const char *variable_name) const =0
Finds a specific texture variable in the loaded effects and returns a handle to it.
virtual void get_uniform_variable_effect_name(effect_uniform_variable variable, char *effect_name, size_t *effect_name_size) const =0
Gets the effect file name of a uniform variable .
virtual bool get_annotation_float_from_texture_variable(effect_texture_variable variable, const char *name, float *values, size_t count, size_t array_index=0) const =0
Gets the value from an annotation attached to the specified texture variable as floating-point value...
virtual void set_effects_state(bool enabled)=0
Enables or disables all effects.
virtual bool capture_screenshot(void *pixels)=0
Captures a screenshot of the current back buffer resource and returns its image data.
virtual void reorder_techniques(size_t count, const effect_technique *techniques)=0
Changes the rendering order of loaded techniques to that of the specified technique list.
virtual void reset_uniform_value(effect_uniform_variable variable)=0
Resets the value of the specified uniform variable .
virtual void get_mouse_cursor_position(uint32_t *out_x, uint32_t *out_y, int16_t *out_wheel_delta=nullptr) const =0
Gets the current absolute position of the mouse cursor in screen coordinates.
An opaque handle to a technique in an effect.
Definition: reshade_api.hpp:18
An opaque handle to a texture variable in an effect.
Definition: reshade_api.hpp:25
An opaque handle to a uniform variable in an effect.
Definition: reshade_api.hpp:32
An opaque handle to a resource view object (depth-stencil, render target, shader resource view,...
Definition: reshade_api_resource.hpp:462
An opaque handle to a resource object (buffer, texture, ...).
Definition: reshade_api_resource.hpp:356