ReShade
A generic post-processing injector for games and video software.
Public Member Functions | List of all members
reshade::api::api_object Struct Referenceabstract

The base class for objects provided by the ReShade API. More...

#include <reshade_api_device.hpp>

Inheritance diagram for reshade::api::api_object:
reshade::api::device reshade::api::device_object reshade::api::command_list reshade::api::command_queue reshade::api::swapchain reshade::api::effect_runtime

Public Member Functions

virtual uint64_t get_native () const =0
 Gets the underlying native object for this API object. More...
 
virtual void get_private_data (const uint8_t guid[16], uint64_t *data) const =0
 Gets a user-defined 64-bit value from the object that was previously set via set_private_data, or zero if none associated with the specified guid exists. More...
 
virtual void set_private_data (const uint8_t guid[16], const uint64_t data)=0
 Stores a user-defined 64-bit value in the object and associates it with the specified guid . More...
 
template<typename T >
T & get_private_data () const
 Gets a reference to user-defined data from the object that was previously allocated via create_private_data. More...
 
template<typename T >
T & create_private_data ()
 Allocates user-defined data and stores it in the object. More...
 
template<typename T >
void destroy_private_data ()
 Frees user-defined data that was previously allocated via create_private_data. More...
 

Detailed Description

The base class for objects provided by the ReShade API.

This lets you store and retrieve custom data with objects, e.g. to be able to communicate persistent information between event callbacks.

Member Function Documentation

◆ create_private_data()

template<typename T >
T& reshade::api::api_object::create_private_data ( )
inline

Allocates user-defined data and stores it in the object.

◆ destroy_private_data()

template<typename T >
void reshade::api::api_object::destroy_private_data ( )
inline

Frees user-defined data that was previously allocated via create_private_data.

◆ get_native()

virtual uint64_t reshade::api::api_object::get_native ( ) const
pure virtual

Gets the underlying native object for this API object.

For device this will be be a pointer to a 'IDirect3DDevice9', 'ID3D10Device', 'ID3D11Device' or 'ID3D12Device' object or a 'HGLRC' or 'VkDevice' handle.
For command_list this will be a pointer to a 'ID3D11DeviceContext' (when recording), 'ID3D11CommandList' (when executing) or 'ID3D12GraphicsCommandList' object or a 'VkCommandBuffer' handle.
For command_queue this will be a pointer to a 'ID3D11DeviceContext' or 'ID3D12CommandQueue' object or a 'VkQueue' handle.
For swapchain this will be a pointer to a 'IDirect3DSwapChain9' or 'IDXGISwapChain' object or a 'HDC' or 'VkSwapchainKHR' handle.

◆ get_private_data() [1/2]

template<typename T >
T& reshade::api::api_object::get_private_data ( ) const
inline

Gets a reference to user-defined data from the object that was previously allocated via create_private_data.

◆ get_private_data() [2/2]

virtual void reshade::api::api_object::get_private_data ( const uint8_t  guid[16],
uint64_t *  data 
) const
pure virtual

Gets a user-defined 64-bit value from the object that was previously set via set_private_data, or zero if none associated with the specified guid exists.

◆ set_private_data()

virtual void reshade::api::api_object::set_private_data ( const uint8_t  guid[16],
const uint64_t  data 
)
pure virtual

Stores a user-defined 64-bit value in the object and associates it with the specified guid .

This function may NOT be called concurrently from multiple threads!


The documentation for this struct was generated from the following file: