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 
95  virtual void render_effects(command_list *cmd_list, resource_view rtv, resource_view rtv_srgb) = 0;
96 
101  virtual bool capture_screenshot(void *pixels) = 0;
102 
106  virtual void get_screenshot_width_and_height(uint32_t *out_width, uint32_t *out_height) const = 0;
107 
113  virtual bool is_key_down(uint32_t keycode) const = 0;
119  virtual bool is_key_pressed(uint32_t keycode) const = 0;
125  virtual bool is_key_released(uint32_t keycode) const = 0;
131  virtual bool is_mouse_button_down(uint32_t button) const = 0;
137  virtual bool is_mouse_button_pressed(uint32_t button) const = 0;
143  virtual bool is_mouse_button_released(uint32_t button) const = 0;
144 
151  virtual void get_mouse_cursor_position(uint32_t *out_x, uint32_t *out_y, int16_t *out_wheel_delta = nullptr) const = 0;
152 
159  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;
165  template <typename F>
166  inline void enumerate_uniform_variables(const char *effect_name, F lambda)
167  {
168  enumerate_uniform_variables(effect_name, [](effect_runtime *runtime, effect_uniform_variable variable, void *user_data) { static_cast<F *>(user_data)->operator()(runtime, variable); }, &lambda);
169  }
170 
180  virtual effect_uniform_variable find_uniform_variable(const char *effect_name, const char *variable_name) const = 0;
181 
190  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;
191 
198  virtual void get_uniform_variable_name(effect_uniform_variable variable, char *name, size_t *name_size) const = 0;
199  template <size_t SIZE>
200  inline void get_uniform_variable_name(effect_uniform_variable variable, char(&name)[SIZE]) const
201  {
202  size_t name_size = SIZE;
203  get_uniform_variable_name(variable, name, &name_size);
204  }
205 
215  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;
225  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;
235  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;
245  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;
254  virtual bool get_annotation_string_from_uniform_variable(effect_uniform_variable variable, const char *name, char *value, size_t *value_size) const = 0;
255  template <size_t SIZE>
256  inline bool get_annotation_string_from_uniform_variable(effect_uniform_variable variable, const char *name, char(&value)[SIZE]) const
257  {
258  size_t value_size = SIZE;
259  return get_annotation_string_from_uniform_variable(variable, name, value, &value_size);
260  }
261 
269  virtual void get_uniform_value_bool(effect_uniform_variable variable, bool *values, size_t count, size_t array_index = 0) const = 0;
277  virtual void get_uniform_value_float(effect_uniform_variable variable, float *values, size_t count, size_t array_index = 0) const = 0;
285  virtual void get_uniform_value_int(effect_uniform_variable variable, int32_t *values, size_t count, size_t array_index = 0) const = 0;
293  virtual void get_uniform_value_uint(effect_uniform_variable variable, uint32_t *values, size_t count, size_t array_index = 0) const = 0;
294 
306  virtual void set_uniform_value_bool(effect_uniform_variable variable, const bool *values, size_t count, size_t array_index = 0) = 0;
315  inline void set_uniform_value_bool(effect_uniform_variable variable, bool x, bool y = bool(0), bool z = bool(0), bool w = bool(0))
316  {
317  const bool values[4] = { x, y, z, w };
318  set_uniform_value_bool(variable, values, 4);
319  }
331  virtual void set_uniform_value_float(effect_uniform_variable variable, const float *values, size_t count, size_t array_index = 0) = 0;
340  inline void set_uniform_value_float(effect_uniform_variable variable, float x, float y = float(0), float z = float(0), float w = float(0))
341  {
342  const float values[4] = { x, y, z, w };
343  set_uniform_value_float(variable, values, 4);
344  }
356  virtual void set_uniform_value_int(effect_uniform_variable variable, const int32_t *values, size_t count, size_t array_index = 0) = 0;
365  inline 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))
366  {
367  const int32_t values[4] = { x, y, z, w };
368  set_uniform_value_int(variable, values, 4);
369  }
381  virtual void set_uniform_value_uint(effect_uniform_variable variable, const uint32_t *values, size_t count, size_t array_index = 0) = 0;
390  inline 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))
391  {
392  const uint32_t values[4] = { x, y, z, w };
393  set_uniform_value_uint(variable, values, 4);
394  }
395 
402  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;
408  template <typename F>
409  inline void enumerate_texture_variables(const char *effect_name, F lambda)
410  {
411  enumerate_texture_variables(effect_name, [](effect_runtime *runtime, effect_texture_variable variable, void *user_data) { static_cast<F *>(user_data)->operator()(runtime, variable); }, &lambda);
412  }
413 
420  virtual effect_texture_variable find_texture_variable(const char *effect_name, const char *variable_name) const = 0;
421 
428  virtual void get_texture_variable_name(effect_texture_variable variable, char *name, size_t *name_size) const = 0;
429  template <size_t SIZE>
430  inline void get_texture_variable_name(effect_texture_variable variable, char(&name)[SIZE]) const
431  {
432  size_t name_size = SIZE;
433  get_texture_variable_name(variable, name, &name_size);
434  }
435 
445  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;
455  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;
465  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;
475  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;
484  virtual bool get_annotation_string_from_texture_variable(effect_texture_variable variable, const char *name, char *value, size_t *value_size) const = 0;
485  template <size_t SIZE>
486  inline bool get_annotation_string_from_texture_variable(effect_texture_variable variable, const char *name, char(&value)[SIZE]) const
487  {
488  size_t value_size = SIZE;
489  return get_annotation_string_from_texture_variable(variable, name, value, &value_size);
490  }
491 
499  virtual void update_texture(effect_texture_variable variable, const uint32_t width, const uint32_t height, const void *pixels) = 0;
500 
507  virtual void get_texture_binding(effect_texture_variable variable, resource_view *out_srv, resource_view *out_srv_srgb) const = 0;
508 
518  virtual void update_texture_bindings(const char *semantic, resource_view srv, resource_view srv_srgb) = 0;
519 
526  virtual void enumerate_techniques(const char *effect_name, void(*callback)(effect_runtime *runtime, effect_technique technique, void *user_data), void *user_data) = 0;
532  template <typename F>
533  inline void enumerate_techniques(const char *effect_name, F lambda)
534  {
535  enumerate_techniques(effect_name, [](effect_runtime *runtime, effect_technique technique, void *user_data) { static_cast<F *>(user_data)->operator()(runtime, technique); }, &lambda);
536  }
537 
544  virtual effect_technique find_technique(const char *effect_name, const char *technique_name) = 0;
545 
552  virtual void get_technique_name(effect_technique technique, char *name, size_t *name_size) const = 0;
553  template <size_t SIZE>
554  inline void get_technique_name(effect_technique technique, char(&name)[SIZE]) const
555  {
556  size_t name_size = SIZE;
557  get_technique_name(technique, name, &name_size);
558  }
559 
569  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;
579  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;
589  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;
599  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;
608  virtual bool get_annotation_string_from_technique(effect_technique technique, const char *name, char *value, size_t *value_size) const = 0;
609  template <size_t SIZE>
610  inline bool get_annotation_string_from_technique(effect_technique technique, const char *name, char(&value)[SIZE]) const
611  {
612  size_t value_size = SIZE;
613  return get_annotation_string_from_technique(technique, name, value, &value_size);
614  }
615 
621  virtual bool get_technique_state(effect_technique technique) const = 0;
627  virtual void set_technique_state(effect_technique technique, bool enabled) = 0;
628 
636  virtual bool get_preprocessor_definition(const char *name, char *value, size_t *value_size) const = 0;
637  template <size_t SIZE>
638  inline bool get_preprocessor_definition(const char *name, char(&value)[SIZE]) const
639  {
640  size_t value_size = SIZE;
641  return get_preprocessor_definition(name, value, &value_size);
642  }
648  virtual void set_preprocessor_definition(const char *name, const char *value) = 0;
649 
662  virtual void render_technique(effect_technique technique, command_list *cmd_list, resource_view rtv, resource_view rtv_srgb = { 0 }) = 0;
663 
667  virtual bool get_effects_state() const = 0;
672  virtual void set_effects_state(bool enabled) = 0;
673 
679  virtual void get_current_preset_path(char *path, size_t *path_size) const = 0;
680  template <size_t SIZE>
681  inline void get_current_preset_path(char(&path)[SIZE]) const
682  {
683  size_t path_size = SIZE;
684  get_current_preset_path(path, &path_size);
685  }
690  virtual void set_current_preset_path(const char *path) = 0;
691 
697  virtual void reorder_techniques(size_t count, const effect_technique *techniques) = 0;
698 
703  virtual void block_input_next_frame() = 0;
704 
708  virtual uint32_t last_key_pressed() const = 0;
712  virtual uint32_t last_key_released() const = 0;
713 
720  virtual void get_uniform_variable_effect_name(effect_uniform_variable variable, char *effect_name, size_t *effect_name_size) const = 0;
721  template <size_t SIZE>
722  inline void get_uniform_variable_effect_name(effect_uniform_variable variable, char(&effect_name)[SIZE]) const
723  {
724  size_t effect_name_size = SIZE;
725  get_uniform_variable_effect_name(variable, effect_name, &effect_name_size);
726  }
727 
734  virtual void get_texture_variable_effect_name(effect_texture_variable variable, char *effect_name, size_t *effect_name_size) const = 0;
735  template <size_t SIZE>
736  inline void get_texture_variable_effect_name(effect_texture_variable variable, char(&effect_name)[SIZE]) const
737  {
738  size_t effect_name_size = SIZE;
739  get_texture_variable_effect_name(variable, effect_name, &effect_name_size);
740  }
741 
748  virtual void get_technique_effect_name(effect_technique technique, char *effect_name, size_t *effect_name_size) const = 0;
749  template <size_t SIZE>
750  inline void get_technique_effect_name(effect_technique technique, char(&effect_name)[SIZE]) const
751  {
752  size_t effect_name_size = SIZE;
753  get_technique_effect_name(technique, effect_name, &effect_name_size);
754  }
755 
759  virtual void save_current_preset() const = 0;
760 
769  virtual bool get_preprocessor_definition_for_effect(const char *effect_name, const char *name, char *value, size_t *value_size) const = 0;
770  template <size_t SIZE>
771  inline bool get_preprocessor_definition_for_effect(const char *effect_name, const char *name, char(&value)[SIZE]) const
772  {
773  size_t value_size = SIZE;
774  return get_preprocessor_definition_for_effect(effect_name, name, value, &value_size);
775  }
782  virtual void set_preprocessor_definition_for_effect(const char *effect_name, const char *name, const char *value) = 0;
783 
790  virtual bool open_overlay(bool open, input_source source) = 0;
791 
796 
801  virtual void reset_uniform_value(effect_uniform_variable variable) = 0;
802  };
803 } }
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:157
format
The available data and texture formats. This is mostly compatible with 'DXGI_FORMAT'.
Definition: reshade_api_format.hpp:18
Definition: reshade.hpp:51
#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:656
A command queue, used to execute command lists on the GPU.
Definition: reshade_api_device.hpp:1123
The base class for objects that are children to a logical render device.
Definition: reshade_api_device.hpp:628
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:166
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:610
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:365
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:554
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:409
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:638
bool get_annotation_string_from_texture_variable(effect_texture_variable variable, const char *name, char(&value)[SIZE]) const
Definition: reshade_api.hpp:486
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:315
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:771
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:681
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:750
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:340
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:390
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:722
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:533
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:256
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 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:736
void get_texture_variable_name(effect_texture_variable variable, char(&name)[SIZE]) const
Definition: reshade_api.hpp:430
void get_uniform_variable_name(effect_uniform_variable variable, char(&name)[SIZE]) const
Definition: reshade_api.hpp:200
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:416
An opaque handle to a resource object (buffer, texture, ...).
Definition: reshade_api_resource.hpp:320