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

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

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

Go to the source code of this file.

Data Structures

struct  kore_framebuffer_parameters
struct  kore_window_parameters

Macros

#define KORE_WINDOW_FEATURE_RESIZEABLE   1
#define KORE_WINDOW_FEATURE_MINIMIZABLE   2
#define KORE_WINDOW_FEATURE_MAXIMIZABLE   4
#define KORE_WINDOW_FEATURE_BORDERLESS   8
#define KORE_WINDOW_FEATURE_ON_TOP   16

Typedefs

typedef struct kore_framebuffer_parameters kore_framebuffer_parameters
typedef struct kore_window_parameters kore_window_parameters

Enumerations

enum  kore_window_mode { KORE_WINDOW_MODE_WINDOW , KORE_WINDOW_MODE_FULLSCREEN , KORE_WINDOW_MODE_EXCLUSIVE_FULLSCREEN }

Functions

KORE_FUNC int kore_window_create (kore_window_parameters *win, kore_framebuffer_parameters *frame)
 Creates a window.
KORE_FUNC void kore_window_destroy (int window)
 Closes and destroys a window.
KORE_FUNC void kore_window_options_set_defaults (kore_window_parameters *win)
KORE_FUNC void kore_framebuffer_options_set_defaults (kore_framebuffer_parameters *frame)
KORE_FUNC int kore_count_windows (void)
 Counts all windows the program created, including the initial window created by kore_init.
KORE_FUNC void kore_window_resize (int window, int width, int height)
 Resizes a window.
KORE_FUNC void kore_window_move (int window, int x, int y)
 Moves a window.
KORE_FUNC void kore_window_change_mode (int window, kore_window_mode mode)
 Switches between window and fullscreen-modes.
KORE_FUNC void kore_window_change_features (int window, int features)
 Applies an or-ed combination of KORE_WINDOW_FEATURE values.
KORE_FUNC void kore_window_change_framebuffer (int window, kore_framebuffer_parameters *frame)
 Changes the framebuffer-options of a window.
KORE_FUNC int kore_window_x (int window)
 Returns the x position of a window.
KORE_FUNC int kore_window_y (int window)
 Returns the y position of a window.
KORE_FUNC int kore_window_width (int window)
 Returns the width of a window.
KORE_FUNC int kore_window_height (int window)
 Returns the height of a window.
KORE_FUNC int kore_window_display (int window)
 Returns the id of the display the window currently is on.
KORE_FUNC kore_window_mode kore_window_get_mode (int window)
 Returns the current window-mode.
KORE_FUNC void kore_window_show (int window)
 Makes the window visible.
KORE_FUNC void kore_window_hide (int window)
 Hides a window.
KORE_FUNC void kore_window_set_title (int window, const char *title)
 Sets the title of a window.
KORE_FUNC void kore_window_set_resize_callback (int window, void(*callback)(int x, int y, void *data), void *data)
 Sets a resize callback that's called whenever the window is resized.
KORE_FUNC void kore_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.
KORE_FUNC void kore_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.
KORE_FUNC bool kore_window_vsynced (int window)
 Returns whether the window is vsynced or not.

Detailed Description

Provides functionality for creating and handling windows.

Function Documentation

◆ kore_count_windows()

KORE_FUNC int kore_count_windows ( void )

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

Returns
The number of windows

◆ kore_window_create()

KORE_FUNC int kore_window_create ( kore_window_parameters * win,
kore_framebuffer_parameters * frame )

Creates a window.

Returns
The id of the created window

◆ kore_window_display()

KORE_FUNC int kore_window_display ( int window)

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

Returns
The display-id

◆ kore_window_get_mode()

KORE_FUNC kore_window_mode kore_window_get_mode ( int window)

Returns the current window-mode.

Returns
The window-mode

◆ kore_window_height()

KORE_FUNC int kore_window_height ( int window)

Returns the height of a window.

Returns
The window-height

◆ kore_window_vsynced()

KORE_FUNC bool kore_window_vsynced ( int window)

Returns whether the window is vsynced or not.

Returns
Whether the window is vsynced or not

◆ kore_window_width()

KORE_FUNC int kore_window_width ( int window)

Returns the width of a window.

Returns
The window-width

◆ kore_window_x()

KORE_FUNC int kore_window_x ( int window)

Returns the x position of a window.

Returns
The x-position

◆ kore_window_y()

KORE_FUNC int kore_window_y ( int window)

Returns the y position of a window.

Returns
The y-position