17struct ID3D12RootSignature;
18struct ID3D12CommandQueue;
21struct D3D12_CPU_DESCRIPTOR_HANDLE;
26using D3D12_RECT = tagRECT;
91 return this->draw_scene;
100 this->draw_scene = new_scene;
112 return *this->device;
121 return *this->root_signature;
130 return *this->command_queue;
139 return *this->render_target_view;
148 return *this->depth_stencil_view;
157 return *this->viewport;
166 return *this->scissor_rect;
175 return this->delta_time;
184 return this->times_called;
188 void ref_for_callback() noexcept {
189 if (!std::exchange(this->callback_referenced,
true))
193 void unref_after_callback() noexcept {
194 if (std::exchange(this->callback_referenced,
false))
198 LIBERAPI
void eztask_execute(FD4::FD4TaskData* data)
override final;
200 friend bool liber_draw_callback(uintptr_t device_context, GXDrawTask* task);
202 ID3D12Device* device =
nullptr;
203 ID3D12RootSignature* root_signature =
nullptr;
204 ID3D12CommandQueue* command_queue =
nullptr;
205 D3D12_CPU_DESCRIPTOR_HANDLE* render_target_view =
nullptr;
206 D3D12_CPU_DESCRIPTOR_HANDLE* depth_stencil_view =
nullptr;
207 D3D12_VIEWPORT* viewport =
nullptr;
208 D3D12_RECT* scissor_rect =
nullptr;
209 scene draw_scene = HDR_SCENE;
210 bool callback_referenced =
false;
211 float delta_time = 0.0f;
212 int times_called = 0;
Inherit from this minimal task interface to create a custom task.
Definition task.hpp:51
virtual LIBERAPI void register_task(CSTaskGroup task_group)
Register a task to be called in a specified task group.
Class for implementing reference counting garbage collection.
Definition utility.hpp:47
void ref() noexcept
Increment the object's reference count.
Definition utility.hpp:75
void unref()
Unreference object; there cannot be more ref() calls than unref() calls.
Definition utility.hpp:86
Abstract graphics draw task base.
Definition draw.hpp:48
scene get_scene() const noexcept
Get the scene, which selects the layer to draw on.
Definition draw.hpp:90
virtual void draw()=0
The abstract method that is called whenever the task executes after being registered by from::GXBS::G...
void set_scene(scene new_scene) noexcept
Set the scene object, which selects the layer to draw on.
Definition draw.hpp:99
int get_times_called() noexcept
Get how many times this draw task has been called.
Definition draw.hpp:183
scene
Whether the task should draw on top of the UI.
Definition draw.hpp:60
const D3D12_VIEWPORT & get_viewport() noexcept
Get the current viewport dimensions.
Definition draw.hpp:156
D3D12_CPU_DESCRIPTOR_HANDLE & get_render_target_view() noexcept
Get the render target view handle.
Definition draw.hpp:138
D3D12_CPU_DESCRIPTOR_HANDLE & get_depth_stencil_view() noexcept
Get the depth stencil view handle.
Definition draw.hpp:147
ID3D12CommandQueue & get_command_queue() noexcept
Get the ID3D12CommandQueue interface.
Definition draw.hpp:129
ID3D12RootSignature & get_root_signature() noexcept
Get the ID3D12RootSignature interface.
Definition draw.hpp:120
void register_task()
Register the draw task, i.e. start its execution.
Definition draw.hpp:71
float get_delta_time() noexcept
Get the delta time of this frame.
Definition draw.hpp:174
ID3D12Device & get_device() noexcept
Get the ID3D12Device interface.
Definition draw.hpp:111
const D3D12_RECT & get_scissor_rect() noexcept
Get the scissor rect dimensions.
Definition draw.hpp:165
Namespace CS task interface.