Class Window

Inheritance Relationships

Base Type

Class Documentation

class Window : public CE::Platform::Window

Declaration: final

Owns a GLFW window and its logical/framebuffer dimensions on the platform thread.

Native callbacks retain their first failure; normal polling and explicit resize/mode boundaries consume it through check_native_failure(). Size getters return cached observations updated by callbacks and explicit resize/mode queries; they neither pump events nor synchronize cross-thread reads. Input and graphics users release this borrowed native window before destruction.

Public Types

using ProcAddress = void (*)()

Native graphics procedure pointer; lifetime follows the native context/library.

Public Functions

virtual ~Window() override

Destroy the native window on platform after input and graphics owners release their borrowed handle/context use.

No external native reference may survive.

Window(const Window&) = delete
Window &operator=(const Window&) = delete
Window(Window&&) = delete
Window &operator=(Window&&) = delete
inline GLFWwindow *native_handle() const

Declaration: [[nodiscard]]

Borrow the native window until destruction.

Preserve its user pointer and installed callbacks; application replacement can invalidate Engine integration.

inline ::CE::Diagnostics::DomainId diagnostic_id() const noexcept

Declaration: [[nodiscard]]

Return this window’s diagnostic lifetime identity, not a stable monitor/window configuration ID.

inline virtual ::CE::Platform::Dimensions<int> logical_size() const override

Declaration: [[nodiscard]]

Copy cached logical window dimensions on platform; no event pump/native query or cross-thread synchronization occurs.

inline virtual ::CE::Platform::FramebufferSize framebuffer_size() const override

Declaration: [[nodiscard]]

Copy cached drawable pixel dimensions, distinct from logical size.

Callbacks/explicit boundaries refresh them; minimized windows may have zero extent.

inline virtual ::CE::Platform::WindowMode mode() const override

Declaration: [[nodiscard]]

Return selected mode; a subsequent callback failure does not roll it back.

virtual bool should_close() const override

Declaration: [[nodiscard]]

Query native close intent on platform; does not pump events or perform teardown.

inline virtual bool supports_close_intent() const noexcept override

Declaration: [[nodiscard]]

virtual bool consume_close_intent() override

Declaration: [[nodiscard]]

Consume and acknowledge one native intent on the platform owner.

virtual std::optional<bool> focused() const override

Declaration: [[nodiscard]]

Optional native focus observation, sampled on the platform owner.

virtual void check_native_failure() const override

Consume/rethrow the first retained callback failure at a normal engine boundary.

Callback failure capture avoids throwing through the native callback ABI; a second check does not rethrow the consumed exception.

virtual void resize(int width, int height) override

Request positive logical dimensions and refresh cached logical/framebuffer observations.

Invalid sizes reject; listeners/native callbacks may fail after dimensions have changed. This mutation is not atomic.

virtual void set_mode(::CE::Platform::WindowMode mode) override

NORMAL restores saved windowed placement; BORDERLESS uses it undecorated; FULLSCREEN attaches the selected monitor at captured dimensions.

Refresh observed sizes. Unknown modes/native errors fail; callback failure does not roll back mode/dimensions.

virtual void hide_cursor(bool hide) const override

Set native cursor hidden/normal mode on platform; this does not supply toolkit OS cursor services or relative pointer capture.

void make_context_current(int swap_interval = 1)

Bind this OpenGL context to the rendering owner and set nonnegative swap interval.

Negative interval or unsuccessful binding throws. Release from the prior thread before transfer; initial window creation remains platform-owned.

void release_context()

Unbind this context from the calling rendering owner; throws if it is not current on that thread.

bool context_current() const

Declaration: [[nodiscard]]

Return whether this native context is current on the calling thread; no transfer or synchronization is performed.

ProcAddress context_proc_address(const char *name) const

Declaration: [[nodiscard]]

Look up a native graphics procedure with this context current.

Null name or absent current context rejects; an unknown procedure can return null. The name is borrowed only during lookup.

void swap_buffers()

Present this window on its rendering owner with its context current; absent current context throws.

Framebuffer clearing/drawing is owned separately.

Friends

friend class ::CE::Platform::GLFW::DisplaySystem