|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
DXGI/Win32 window backend used by the Fast3D renderer on Windows. More...
#include <gfx_dxgi.h>
Public Member Functions | |
| GfxWindowBackendDXGI (std::shared_ptr< Ship::Config > config=nullptr, std::shared_ptr< Ship::FileDrop > fileDrop=nullptr, std::shared_ptr< Ship::ConsoleVariable > consoleVariable=nullptr, std::shared_ptr< Fast::Fast3dGui > fast3dGui=nullptr) | |
| Constructs the backend with optional shared engine dependencies. | |
| ~GfxWindowBackendDXGI () override | |
| HWND | GetWindowHandle () |
| Returns the native Win32 window handle. | |
| IDXGISwapChain1 * | GetSwapChain () |
| Returns the active DXGI swap chain. | |
| void | CreateSwapChain (IUnknown *mDevice, std::function< void()> &&before_destroy_fn) |
| Creates/recreates the swap chain and runs a pre-destroy callback when replacing it. | |
| void | CreateFactoryAndDevice (bool debug, int d3d_version, class GfxRenderingAPIDX11 *self, bool(*createFunc)(class GfxRenderingAPIDX11 *self, bool SoftwareRenderer)) |
| Creates the DXGI factory/device and invokes the renderer-side creation callback. | |
| void | OnKeydown (WPARAM wParam, LPARAM lParam) |
| void | OnKeyup (WPARAM wParam, LPARAM lParam) |
| void | OnMouseButtonDown (int btn) |
| void | OnMouseButtonUp (int btn) |
| void | HandleRawInputBuffered () |
| void | UpdateMousePrevPos () |
| void | ApplyMouseCaptureClip () |
GfxWindowBackend implementation | |
| void | Init (const char *gameName, const char *apiName, bool startFullScreen, uint32_t width, uint32_t height, int32_t posX, int32_t posY) override |
| void | Close () override |
| void | SetKeyboardCallbacks (bool(*onKeyDown)(int scancode), bool(*onKeyUp)(int scancode), void(*onnAllKeysUp)()) override |
| void | SetMouseCallbacks (bool(*onMouseButtonDown)(int btn), bool(*onnMouseButtonUp)(int btn)) override |
| void | SetFullscreenChangedCallback (void(*onnFullscreenChanged)(bool is_now_fullscreen)) override |
| void | SetFullscreen (bool fullscreen) override |
| void | GetActiveWindowRefreshRate (uint32_t *refreshRate) override |
| void | SetCursorVisibility (bool visability) override |
| void | SetMousePos (int32_t posX, int32_t posY) override |
| void | GetMousePos (int32_t *x, int32_t *y) override |
| void | GetMouseDelta (int32_t *x, int32_t *y) override |
| void | GetMouseWheel (float *x, float *y) override |
| bool | GetMouseState (uint32_t btn) override |
| void | SetMouseCapture (bool capture) override |
| bool | IsMouseCaptured () override |
| void | GetDimensions (uint32_t *width, uint32_t *height, int32_t *posX, int32_t *posY) override |
| void | SetDimensions (uint32_t width, uint32_t height, int32_t posX, int32_t posY) override |
| Ship::WindowRect | GetPrimaryMonitorRect () override |
| void | HandleEvents () override |
| bool | IsFrameReady () override |
| void | SwapBuffersBegin () override |
| void | SwapBuffersEnd () override |
| double | GetTime () override |
| int | GetTargetFps () |
| void | SetTargetFps (int fps) override |
| void | SetMaxFrameLatency (int latency) override |
| const char * | GetKeyName (int scancode) override |
| bool | CanDisableVsync () override |
| bool | IsRunning () override |
| void | Destroy () override |
| bool | IsFullscreen () override |
Public Member Functions inherited from Fast::GfxWindowBackend | |
| virtual | ~GfxWindowBackend ()=default |
Public Attributes | |
| std::tuple< HMONITOR, RECT, BOOL > | mMonitor |
| uint32_t | current_width |
| uint32_t | current_height |
| std::vector< std::tuple< HMONITOR, RECT, BOOL > > | monitor_list |
| int32_t | mPosX |
| int32_t | mPosY |
| double | mDetectedHz |
| double | mDisplayPeriod |
| void(* | mOnAllKeysUp )(void) |
| POINT | mRawMouseDeltaBuf |
| float | mMouseWheel [2] |
| bool | mIsMouseCaptured |
| bool | mIsMouseHovered |
| bool | mInFocus |
| bool | mHasMousePosition |
| std::shared_ptr< Ship::FileDrop > | mFileDrop |
| std::shared_ptr< Ship::ConsoleVariable > | mConsoleVariable |
| std::shared_ptr< Fast::Fast3dGui > | mFast3dGui |
Additional Inherited Members | |
Protected Attributes inherited from Fast::GfxWindowBackend | |
| void(* | mOnFullscreenChanged )(bool isNowFullscreen) |
| bool(* | mOnKeyDown )(int scancode) |
| bool(* | mOnKeyUp )(int scancode) |
| bool(* | mOnMouseButtonDown )(int btn) |
| bool(* | mOnMouseButtonUp )(int btn) |
| uint32_t | mTargetFps = 60 |
| bool | mFullScreen |
| bool | mIsRunning = true |
| bool | mVsyncEnabled = true |
DXGI/Win32 window backend used by the Fast3D renderer on Windows.
Implements the GfxWindowBackend interface for input, timing, swap-chain management, and fullscreen/windowed transitions.
| Fast::GfxWindowBackendDXGI::GfxWindowBackendDXGI | ( | std::shared_ptr< Ship::Config > | config = nullptr, |
| std::shared_ptr< Ship::FileDrop > | fileDrop = nullptr, |
||
| std::shared_ptr< Ship::ConsoleVariable > | consoleVariable = nullptr, |
||
| std::shared_ptr< Fast::Fast3dGui > | fast3dGui = nullptr |
||
| ) |
Constructs the backend with optional shared engine dependencies.
|
override |
| void Fast::GfxWindowBackendDXGI::ApplyMouseCaptureClip | ( | ) |
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
| void Fast::GfxWindowBackendDXGI::CreateFactoryAndDevice | ( | bool | debug, |
| int | d3d_version, | ||
| class GfxRenderingAPIDX11 * | self, | ||
| bool(*)(class GfxRenderingAPIDX11 *self, bool SoftwareRenderer) | createFunc | ||
| ) |
Creates the DXGI factory/device and invokes the renderer-side creation callback.
| void Fast::GfxWindowBackendDXGI::CreateSwapChain | ( | IUnknown * | mDevice, |
| std::function< void()> && | before_destroy_fn | ||
| ) |
Creates/recreates the swap chain and runs a pre-destroy callback when replacing it.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
| IDXGISwapChain1 * Fast::GfxWindowBackendDXGI::GetSwapChain | ( | ) |
Returns the active DXGI swap chain.
|
virtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
| HWND Fast::GfxWindowBackendDXGI::GetWindowHandle | ( | ) |
Returns the native Win32 window handle.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
| void Fast::GfxWindowBackendDXGI::HandleRawInputBuffered | ( | ) |
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
| void Fast::GfxWindowBackendDXGI::OnKeydown | ( | WPARAM | wParam, |
| LPARAM | lParam | ||
| ) |
| void Fast::GfxWindowBackendDXGI::OnKeyup | ( | WPARAM | wParam, |
| LPARAM | lParam | ||
| ) |
| void Fast::GfxWindowBackendDXGI::OnMouseButtonDown | ( | int | btn | ) |
| void Fast::GfxWindowBackendDXGI::OnMouseButtonUp | ( | int | btn | ) |
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
|
overridevirtual |
Implements Fast::GfxWindowBackend.
| void Fast::GfxWindowBackendDXGI::UpdateMousePrevPos | ( | ) |
| uint32_t Fast::GfxWindowBackendDXGI::current_height |
| uint32_t Fast::GfxWindowBackendDXGI::current_width |
| std::shared_ptr<Ship::ConsoleVariable> Fast::GfxWindowBackendDXGI::mConsoleVariable |
| double Fast::GfxWindowBackendDXGI::mDetectedHz |
| double Fast::GfxWindowBackendDXGI::mDisplayPeriod |
| std::shared_ptr<Fast::Fast3dGui> Fast::GfxWindowBackendDXGI::mFast3dGui |
| std::shared_ptr<Ship::FileDrop> Fast::GfxWindowBackendDXGI::mFileDrop |
| bool Fast::GfxWindowBackendDXGI::mHasMousePosition |
| bool Fast::GfxWindowBackendDXGI::mInFocus |
| bool Fast::GfxWindowBackendDXGI::mIsMouseCaptured |
| bool Fast::GfxWindowBackendDXGI::mIsMouseHovered |
| std::tuple<HMONITOR, RECT, BOOL> Fast::GfxWindowBackendDXGI::mMonitor |
| float Fast::GfxWindowBackendDXGI::mMouseWheel[2] |
| void(* Fast::GfxWindowBackendDXGI::mOnAllKeysUp) (void) |
| std::vector<std::tuple<HMONITOR, RECT, BOOL> > Fast::GfxWindowBackendDXGI::monitor_list |
| int32_t Fast::GfxWindowBackendDXGI::mPosX |
| int32_t Fast::GfxWindowBackendDXGI::mPosY |
| POINT Fast::GfxWindowBackendDXGI::mRawMouseDeltaBuf |