Kore
Loading...
Searching...
No Matches
window.h File Reference

Provides functionality for creating and handling windows. More...

#include <kinc/global.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  kinc_framebuffer_options
struct  kinc_window_options

Macros

#define KINC_WINDOW_FEATURE_RESIZEABLE   1
#define KINC_WINDOW_FEATURE_MINIMIZABLE   2
#define KINC_WINDOW_FEATURE_MAXIMIZABLE   4
#define KINC_WINDOW_FEATURE_BORDERLESS   8
#define KINC_WINDOW_FEATURE_ON_TOP   16

Typedefs

typedef struct kinc_framebuffer_options kinc_framebuffer_options_t
typedef struct kinc_window_options kinc_window_options_t

Enumerations

enum  kinc_window_mode_t { KINC_WINDOW_MODE_WINDOW , KINC_WINDOW_MODE_FULLSCREEN , KINC_WINDOW_MODE_EXCLUSIVE_FULLSCREEN }

Functions

KINC_FUNC int kinc_window_create (kinc_window_options_t *win, kinc_framebuffer_options_t *frame)
 Creates a window.
KINC_FUNC void kinc_window_destroy (int window)
 Closes and destroys a window.
KINC_FUNC void kinc_window_options_set_defaults (kinc_window_options_t *win)
KINC_FUNC void kinc_framebuffer_options_set_defaults (kinc_framebuffer_options_t *frame)
KINC_FUNC int kinc_count_windows (void)
 Counts all windows the program created, including the initial window created by kinc_init.
KINC_FUNC void kinc_window_resize (int window, int width, int height)
 Resizes a window.
KINC_FUNC void kinc_window_move (int window, int x, int y)
 Moves a window.
KINC_FUNC void kinc_window_change_mode (int window, kinc_window_mode_t mode)
 Switches between window and fullscreen-modes.
KINC_FUNC void kinc_window_change_features (int window, int features)
 Applies an or-ed combination of KINC_WINDOW_FEATURE values.
KINC_FUNC void kinc_window_change_framebuffer (int window, kinc_framebuffer_options_t *frame)
 Changes the framebuffer-options of a window.
KINC_FUNC int kinc_window_x (int window)
 Returns the x position of a window.
KINC_FUNC int kinc_window_y (int window)
 Returns the y position of a window.
KINC_FUNC int kinc_window_width (int window)
 Returns the width of a window.
KINC_FUNC int kinc_window_height (int window)
 Returns the height of a window.
KINC_FUNC int kinc_window_display (int window)
 Returns the id of the display the window currently is on.
KINC_FUNC kinc_window_mode_t kinc_window_get_mode (int window)
 Returns the current window-mode.
KINC_FUNC void kinc_window_show (int window)
 Makes the window visible.
KINC_FUNC void kinc_window_hide (int window)
 Hides a window.
KINC_FUNC void kinc_window_set_title (int window, const char *title)
 Sets the title of a window.
KINC_FUNC void kinc_window_set_resize_callback (int window, void(*callback)(int width, int height, void *data), void *data)
 Sets a resize callback that's called whenever the window is resized.
KINC_FUNC void kinc_window_set_ppi_changed_callback (int window, void(*callback)(int ppi, void *data), void *data)
 Sets a PPI callback that's called whenever the window moves to a display that uses a different PPI-setting.
KINC_FUNC void kinc_window_set_close_callback (int window, bool(*callback)(void *data), void *data)
 Sets a close callback that's called when the window is about to close. Returning false from the callback tries to stop the window from closing.
KINC_FUNC bool kinc_window_vsynced (int window)
 Returns whether the window is vsynced or not.

Detailed Description

Provides functionality for creating and handling windows.

Function Documentation

◆ kinc_count_windows()

KINC_FUNC int kinc_count_windows ( void )

Counts all windows the program created, including the initial window created by kinc_init.

Returns
The number of windows

◆ kinc_window_create()

KINC_FUNC int kinc_window_create ( kinc_window_options_t * win,
kinc_framebuffer_options_t * frame )

Creates a window.

Returns
The id of the created window

◆ kinc_window_display()

KINC_FUNC int kinc_window_display ( int window)

Returns the id of the display the window currently is on.

Returns
The display-id

◆ kinc_window_get_mode()

KINC_FUNC kinc_window_mode_t kinc_window_get_mode ( int window)

Returns the current window-mode.

Returns
The window-mode

◆ kinc_window_height()

KINC_FUNC int kinc_window_height ( int window)

Returns the height of a window.

Returns
The window-height

◆ kinc_window_vsynced()

KINC_FUNC bool kinc_window_vsynced ( int window)

Returns whether the window is vsynced or not.

Returns
Whether the window is vsynced or not

◆ kinc_window_width()

KINC_FUNC int kinc_window_width ( int window)

Returns the width of a window.

Returns
The window-width

◆ kinc_window_x()

KINC_FUNC int kinc_window_x ( int window)

Returns the x position of a window.

Returns
The x-position

◆ kinc_window_y()

KINC_FUNC int kinc_window_y ( int window)

Returns the y position of a window.

Returns
The y-position