core::os::surface class

primitive object that create a surface we can render on.

create a surface we can render on, which, depending on the platform could be anything from a resizeable window to the sole surface we can present on (ex. mobile and console platforms).

member-functions

data
returns the window data that was used to initialize this window.
const public
terminate
marks the surface to be terminated.
public
open
const public
tick
ticks the input system and returns if the surface is still open() after.
public
focus
suggests the surface to become focused.
public
focused
const public
resize
suggests a new size for the surface.
public
input
the input instance associated with this surface.
const public noexcept
register_swapchain
this method will be called by the swapchain class, so that the surface knows who to notify of resize events, etc..
public
init_surface
platform specific method that initializes the surface and its resources.
private
deinit_surface
platform specific method that deinitializes the surface and its resources.
private
update_surface
platform specific method that updates the surface and checks for messages.
private
resize_surface
platform specific method that gets called on resize events.
private

Function documentation

const core::data::window& core::os::surface::data() const

Brief

returns the window data that was used to initialize this window.

Details

void core::os::surface::terminate()

Brief

marks the surface to be terminated.

Details

when invoking this method, the surface will be marked for destruction.

bool core::os::surface::open() const

Returns if the surface is "open" (i.e initialized and not-terminated)

bool core::os::surface::tick()

Brief

ticks the input system and returns if the surface is still open() after.

Returns if the surface has been terminated (false) or is still open (true).

void core::os::surface::focus(bool value)

Brief

suggests the surface to become focused.

Details

the strength of the focus suggestion is based on the platform specific implementation of focus.

Parameters
value in sets the focus value.

bool core::os::surface::focused() const

Returns if the platform considers this surface to be 'in focus'.

bool core::os::surface::resize(uint32_t width, uint32_t height)

Brief

suggests a new size for the surface.

Details

Parameters
width in the suggested width of the surface.
height in the suggested height of the surface.
Returns if the resize was successfull

core::systems::input& core::os::surface::input() const noexcept

Brief

the input instance associated with this surface.

Details

every surface has its own input system even though that some platforms cannot have multiple surfaces, or that their input systems boil down to a singleton. by returning a specific instance, regardless of this we ensure that all access and handling is uniform across the various platforms.

void core::os::surface::register_swapchain(core::resource::handle<core::ivk::swapchain> swapchain)

Brief

this method will be called by the swapchain class, so that the surface knows who to notify of resize events, etc..

Details