48 std::shared_ptr<Ship::ConsoleVariable> consoleVariables =
nullptr,
49 std::shared_ptr<Ship::ControlDeck> controlDeck =
nullptr);
50 Fast3dWindow(std::vector<std::shared_ptr<Ship::GuiWindow>> guiWindows,
51 std::shared_ptr<Ship::Config> config =
nullptr,
52 std::shared_ptr<Ship::ConsoleVariable> consoleVariables =
nullptr,
53 std::shared_ptr<Ship::ControlDeck> controlDeck =
nullptr);
54 Fast3dWindow(std::shared_ptr<Ship::Gui> gui, std::shared_ptr<Ship::Config> config =
nullptr,
55 std::shared_ptr<Ship::ConsoleVariable> consoleVariables =
nullptr,
56 std::shared_ptr<Ship::ControlDeck> controlDeck =
nullptr);
57 Fast3dWindow(std::shared_ptr<Ship::Gui> gui, std::shared_ptr<FastMouseStateManager> mouseStateManager,
58 std::shared_ptr<Ship::Config> config =
nullptr,
59 std::shared_ptr<Ship::ConsoleVariable> consoleVariables =
nullptr,
60 std::shared_ptr<Ship::ControlDeck> controlDeck =
nullptr);
98 void SetCurrentDimensions(
bool isFullscreen, uint32_t width, uint32_t height, int32_t posX, int32_t posY)
override;
118 void OnInit(
const nlohmann::json& initArgs = nlohmann::json::object())
override;
121 static bool KeyUp(int32_t scancode);
130 std::shared_ptr<Interpreter> mInterpreter =
nullptr;
131 std::shared_ptr<Ship::ConsoleVariable> mConsoleVariables;
132 mutable std::shared_ptr<Ship::ControlDeck> mControlDeck;
133 std::shared_ptr<GfxDebugger> mGfxDebugger;
136 std::shared_ptr<Ship::ConsoleVariable> GetConsoleVariables()
const;
138 std::shared_ptr<Ship::ControlDeck> GetControlDeck()
const;
Fast3D-based window and rendering context.
Definition Fast3dWindow.h:45
uint32_t GetWidth() override
Returns the current width of the window client area in pixels.
std::weak_ptr< Interpreter > GetInterpreterWeak() const
uintptr_t GetGfxFrameBuffer() override
Returns a handle to the graphics API framebuffer object.
Ship::CoordsF GetMouseWheel() override
Returns the mouse wheel scroll delta for the current frame.
void EndFrame() override
Ends the current render frame and presents it to the display.
void Close() override
Requests that the window and application close.
uint16_t GetPixelDepth(float x, float y)
uint32_t GetHeight() override
Returns the current height of the window client area in pixels.
void SetResolutionMultiplier(float multiplier) override
Sets the internal rendering resolution multiplier.
Fast3dWindow(std::shared_ptr< Ship::Gui > gui, std::shared_ptr< FastMouseStateManager > mouseStateManager, std::shared_ptr< Ship::Config > config=nullptr, std::shared_ptr< Ship::ConsoleVariable > consoleVariables=nullptr, std::shared_ptr< Ship::ControlDeck > controlDeck=nullptr)
static bool KeyDown(int32_t scancode)
void StartFrame() override
Begins a new render frame; clears the back buffer and sets up state.
bool CanDisableVerticalSync() override
Returns true if vertical sync can be disabled on this backend.
uint32_t GetCurrentRefreshRate() override
Returns the display's current refresh rate in Hz.
Ship::Coords GetMousePos() override
Returns the current mouse cursor position relative to the window.
const char * GetKeyName(int32_t scancode) override
Returns the human-readable name for a keyboard scancode.
bool IsFrameReady() override
Returns true if the renderer is ready to begin a new frame.
void HandleEvents() override
Processes pending OS/input events.
void RunGuiOnly() override
Runs a single GUI-only tick without executing game logic.
void SetTargetFps(int32_t fps)
void SetMousePos(Ship::Coords pos) override
Moves the mouse cursor to the given window-relative coordinates.
Ship::Coords GetMouseDelta() override
Returns the mouse movement delta since the last frame.
void SetCurrentDimensions(bool isFullscreen, uint32_t width, uint32_t height, int32_t posX, int32_t posY) override
Switches fullscreen state and sets the window dimensions and position.
void SetMouseCapture(bool capture) override
Enables or disables mouse capture (relative/locked mouse mode).
bool GetMouseState(Ship::MouseBtn btn) override
Returns whether the given mouse button is currently pressed.
Fast3dWindow(std::shared_ptr< Ship::Gui > gui, std::shared_ptr< Ship::Config > config=nullptr, std::shared_ptr< Ship::ConsoleVariable > consoleVariables=nullptr, std::shared_ptr< Ship::ControlDeck > controlDeck=nullptr)
bool IsRunning() override
Returns true while the window / render loop is running.
Fast3dWindow(std::vector< std::shared_ptr< Ship::GuiWindow > > guiWindows, std::shared_ptr< Ship::Config > config=nullptr, std::shared_ptr< Ship::ConsoleVariable > consoleVariables=nullptr, std::shared_ptr< Ship::ControlDeck > controlDeck=nullptr)
std::string GetWindowBackendName() override
Returns a human-readable name for the current window backend.
static bool MouseButtonDown(int button)
void SetCursorVisibility(bool visible) override
Shows or hides the OS mouse cursor over the window.
bool SupportsWindowedFullscreen() override
Returns true if the backend supports a windowed-fullscreen (borderless) mode.
void SetCurrentDimensions(uint32_t width, uint32_t height) override
Sets the window dimensions (size and position) and applies them immediately.
static bool MouseButtonUp(int button)
float GetAspectRatio() override
Returns the current aspect ratio (width / height) of the window.
void SetMaximumFrameLatency(int32_t latency)
Ship::WindowRect GetPrimaryMonitorRect() override
Returns the bounding rectangle of the primary monitor.
void SetTextureFilter(FilteringMode filteringMode)
void OnInit(const nlohmann::json &initArgs=nlohmann::json::object()) override
Override this to implement component-specific initialization logic.
int32_t GetPosX() override
Returns the X position of the window's top-left corner on the desktop.
int32_t GetPosY() override
Returns the Y position of the window's top-left corner on the desktop.
static void OnFullscreenChanged(bool isNowFullscreen)
bool IsMouseCaptured() override
Returns true if the mouse is currently captured.
std::shared_ptr< GfxDebugger > GetGfxDebugger() const
Returns the graphics debugger for this Fast3D window.
static bool KeyUp(int32_t scancode)
void SetCurrentDimensions(uint32_t width, uint32_t height, int32_t posX, int32_t posY) override
Sets the window dimensions and position and applies them immediately.
void SetCurrentDimensions(bool isFullscreen, uint32_t width, uint32_t height) override
Switches fullscreen state and sets the window dimensions.
bool DrawAndRunGraphicsCommands(Gfx *commands, const std::unordered_map< Mtx *, MtxF > &mtxReplacements)
void SetFullscreen(bool isFullscreen) override
Switches between fullscreen and windowed mode.
bool IsFullscreen() override
Returns true if the window is currently in fullscreen mode.
void SetRendererUCode(UcodeHandlers ucode)
void GetPixelDepthPrepare(float x, float y)
Fast3dWindow(std::shared_ptr< Ship::Config > config=nullptr, std::shared_ptr< Ship::ConsoleVariable > consoleVariables=nullptr, std::shared_ptr< Ship::ControlDeck > controlDeck=nullptr)
void SetMsaaLevel(uint32_t value) override
Sets the MSAA sample count.
Definition gfx_rendering_api.h:30
Definition gfx_window_manager_api.h:7
Abstract base class for the application window and rendering surface.
Definition Window.h:62
Definition gfx_direct3d_common.h:19
FilteringMode
Definition gfx_rendering_api.h:17
WindowBackend
Identifies the graphics/windowing backend used by Fast3dWindow.
Definition Fast3dWindow.h:27
@ FAST3D_SDL_OPENGL
Definition Fast3dWindow.h:29
@ FAST3D_DXGI_DX11
Definition Fast3dWindow.h:28
@ FAST3D_SDL_METAL
Definition Fast3dWindow.h:30
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
MouseBtn
Identifies a mouse button delivered to the input mapping system.
Definition KeyboardScancodes.h:136
Floating-point pixel coordinates.
Definition Window.h:32
Identifies the graphics/windowing backend in use.
Definition Window.h:26
Screen-space rectangle in integer pixels.
Definition Window.h:38
UcodeHandlers
Definition ucodehandlers.h:3