ReXGlue SDK
Loading...
Searching...
No Matches
rex::gpu::IGraphicsDriver Class Referenceabstract

#include <rex/gpu/graphics_driver.h>

Inheritance diagram for rex::gpu::IGraphicsDriver:
[legend]

Public Member Functions

virtual IXenosGraphicsDriver * AsXenos ()
virtual Result< void > SetSurface (const NativeWindow &window)
virtual Result< void > AttachTitle (const TitleInfo &info, IPhysicalMemory &memory, IPhysicalWriteWatch &watch, IGuestInterrupts &interrupts)
virtual void DetachTitle ()
virtual FrameStatus WaitForFrame (u32 timeout_ms)=0
virtual void ResizeSurface (u32 width, u32 height)=0
virtual bool BeginPresent ()=0
virtual void EndPresent ()=0
Public Member Functions inherited from rex::IDriver
virtual std::string_view GetName () const =0
virtual Result< void > Initialize (IDriverContext &context)=0
virtual void Shutdown ()=0
Public Member Functions inherited from rex::IOverlayRenderer
virtual void RenderOverlays (ImDrawData &draw_data)=0

Detailed Description

A GPU that presents to the window. GraphicsSystem makes every call on its present thread. A present is WaitForFrame, BeginPresent, the overlays through IOverlayRenderer, then EndPresent.

Member Function Documentation

◆ AsXenos()

virtual IXenosGraphicsDriver * rex::gpu::IGraphicsDriver::AsXenos ( )
inlinevirtual

Casts to the Xenos driver. Works across a module boundary where dynamic_cast does not.

Returns
The Xenos driver, or nullptr for a native driver.

Reimplemented in rex::gpu::IXenosGraphicsDriver.

◆ AttachTitle()

virtual Result< void > rex::gpu::IGraphicsDriver::AttachTitle ( const TitleInfo & info,
IPhysicalMemory & memory,
IPhysicalWriteWatch & watch,
IGuestInterrupts & interrupts )
inlinenodiscardvirtual

Called when a title launches. The driver takes what it uses from the title here.

Returns
Ok, or an error that stops the launch.

◆ BeginPresent()

virtual bool rex::gpu::IGraphicsDriver::BeginPresent ( )
nodiscardpure virtual

Starts a present by drawing the latest title frame, scaled to the window, into the next swap chain image.

Returns
True when there is an image to draw to, false while minimized or the surface is lost, and the present is skipped.

◆ DetachTitle()

virtual void rex::gpu::IGraphicsDriver::DetachTitle ( )
inlinevirtual

The title is stopping. On return the driver holds no memory spans, listeners or threads.

◆ EndPresent()

virtual void rex::gpu::IGraphicsDriver::EndPresent ( )
pure virtual

Finishes the present started by a BeginPresent that returned true.

◆ ResizeSurface()

virtual void rex::gpu::IGraphicsDriver::ResizeSurface ( u32 width,
u32 height )
pure virtual

Resizes the swap chain. Called before BeginPresent after the window changed size.

◆ SetSurface()

virtual Result< void > rex::gpu::IGraphicsDriver::SetSurface ( const NativeWindow & window)
inlinenodiscardvirtual

Gives the driver the window to present to. Called after Initialize and before the first present, only when the app has a window.

Returns
Ok, or the failure of the provider or presenter, which stops the graphics start.

◆ WaitForFrame()

virtual FrameStatus rex::gpu::IGraphicsDriver::WaitForFrame ( u32 timeout_ms)
pure virtual

Waits until the title finishes a frame or the time runs out.


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