libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Fast::GfxWindowBackendSDL2 Class Referencefinal

SDL2 implementation of the Fast3D window/input backend. More...

#include <gfx_sdl.h>

Inheritance diagram for Fast::GfxWindowBackendSDL2:
[legend]
Collaboration diagram for Fast::GfxWindowBackendSDL2:
[legend]

Public Member Functions

 GfxWindowBackendSDL2 (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.
 
 ~GfxWindowBackendSDL2 () override
 
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(*onAllKeysUp)()) override
 
void SetMouseCallbacks (bool(*onMouseButtonDown)(int btn), bool(*onMouseButtonUp)(int btn)) override
 
void SetFullscreenChangedCallback (void(*onFullscreenChanged)(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
 

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
 

Detailed Description

SDL2 implementation of the Fast3D window/input backend.

Handles window creation, input polling, fullscreen transitions, framerate pacing, and callback forwarding to the renderer/runtime.

Constructor & Destructor Documentation

◆ GfxWindowBackendSDL2()

Fast::GfxWindowBackendSDL2::GfxWindowBackendSDL2 ( 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.

◆ ~GfxWindowBackendSDL2()

Fast::GfxWindowBackendSDL2::~GfxWindowBackendSDL2 ( )
override

Member Function Documentation

◆ CanDisableVsync()

bool Fast::GfxWindowBackendSDL2::CanDisableVsync ( )
overridevirtual

◆ Close()

void Fast::GfxWindowBackendSDL2::Close ( )
overridevirtual

◆ Destroy()

void Fast::GfxWindowBackendSDL2::Destroy ( )
overridevirtual

◆ GetActiveWindowRefreshRate()

void Fast::GfxWindowBackendSDL2::GetActiveWindowRefreshRate ( uint32_t *  refreshRate)
overridevirtual

◆ GetDimensions()

void Fast::GfxWindowBackendSDL2::GetDimensions ( uint32_t *  width,
uint32_t *  height,
int32_t *  posX,
int32_t *  posY 
)
overridevirtual

◆ GetKeyName()

const char * Fast::GfxWindowBackendSDL2::GetKeyName ( int  scancode)
overridevirtual

◆ GetMouseDelta()

void Fast::GfxWindowBackendSDL2::GetMouseDelta ( int32_t *  x,
int32_t *  y 
)
overridevirtual

◆ GetMousePos()

void Fast::GfxWindowBackendSDL2::GetMousePos ( int32_t *  x,
int32_t *  y 
)
overridevirtual

◆ GetMouseState()

bool Fast::GfxWindowBackendSDL2::GetMouseState ( uint32_t  btn)
overridevirtual

◆ GetMouseWheel()

void Fast::GfxWindowBackendSDL2::GetMouseWheel ( float *  x,
float *  y 
)
overridevirtual

◆ GetPrimaryMonitorRect()

Ship::WindowRect Fast::GfxWindowBackendSDL2::GetPrimaryMonitorRect ( )
overridevirtual

◆ GetTargetFps()

int Fast::GfxWindowBackendSDL2::GetTargetFps ( )
virtual

◆ GetTime()

double Fast::GfxWindowBackendSDL2::GetTime ( )
overridevirtual

◆ HandleEvents()

void Fast::GfxWindowBackendSDL2::HandleEvents ( )
overridevirtual

◆ Init()

void Fast::GfxWindowBackendSDL2::Init ( const char *  gameName,
const char *  apiName,
bool  startFullScreen,
uint32_t  width,
uint32_t  height,
int32_t  posX,
int32_t  posY 
)
overridevirtual

◆ IsFrameReady()

bool Fast::GfxWindowBackendSDL2::IsFrameReady ( )
overridevirtual

◆ IsFullscreen()

bool Fast::GfxWindowBackendSDL2::IsFullscreen ( )
overridevirtual

◆ IsMouseCaptured()

bool Fast::GfxWindowBackendSDL2::IsMouseCaptured ( )
overridevirtual

◆ IsRunning()

bool Fast::GfxWindowBackendSDL2::IsRunning ( )
overridevirtual

◆ SetCursorVisibility()

void Fast::GfxWindowBackendSDL2::SetCursorVisibility ( bool  visability)
overridevirtual

◆ SetDimensions()

void Fast::GfxWindowBackendSDL2::SetDimensions ( uint32_t  width,
uint32_t  height,
int32_t  posX,
int32_t  posY 
)
overridevirtual

◆ SetFullscreen()

void Fast::GfxWindowBackendSDL2::SetFullscreen ( bool  fullscreen)
overridevirtual

◆ SetFullscreenChangedCallback()

void Fast::GfxWindowBackendSDL2::SetFullscreenChangedCallback ( void(*)(bool is_now_fullscreen)  onFullscreenChanged)
overridevirtual

◆ SetKeyboardCallbacks()

void Fast::GfxWindowBackendSDL2::SetKeyboardCallbacks ( bool(*)(int scancode)  onKeyDown,
bool(*)(int scancode)  onKeyUp,
void(*)()  onAllKeysUp 
)
overridevirtual

◆ SetMaxFrameLatency()

void Fast::GfxWindowBackendSDL2::SetMaxFrameLatency ( int  latency)
overridevirtual

◆ SetMouseCallbacks()

void Fast::GfxWindowBackendSDL2::SetMouseCallbacks ( bool(*)(int btn)  onMouseButtonDown,
bool(*)(int btn)  onMouseButtonUp 
)
overridevirtual

◆ SetMouseCapture()

void Fast::GfxWindowBackendSDL2::SetMouseCapture ( bool  capture)
overridevirtual

◆ SetMousePos()

void Fast::GfxWindowBackendSDL2::SetMousePos ( int32_t  posX,
int32_t  posY 
)
overridevirtual

◆ SetTargetFps()

void Fast::GfxWindowBackendSDL2::SetTargetFps ( int  fps)
overridevirtual

◆ SwapBuffersBegin()

void Fast::GfxWindowBackendSDL2::SwapBuffersBegin ( )
overridevirtual

◆ SwapBuffersEnd()

void Fast::GfxWindowBackendSDL2::SwapBuffersEnd ( )
overridevirtual

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