-
Notifications
You must be signed in to change notification settings - Fork 0
Window system
A simple window system.
You can have only 1 window.
- glad (c/c++, core profile, generate loader)
- glfw 3.2.1
automata_const.h
The window system uses glad as OpenGL loader.
A window has an OpenGL context. The OpenGL version of this context is defined in automata_const.h
:
#define AUTOMATA_OPENGL_VERSION_MAJOR 3
#define AUTOMATA_OPENGL_VERSION_MINOR 3
All window structs and functions are defined in automata_window.h
.
struct AutomataWindow {
GLFWwindow *window;
unsigned int width;
unsigned int height;
const char *title;
};
Internal use only.
The window structure.
window
: the GLFW window.
width
: the window width.
height
: the window height.
title
: the window title.
void automataWindowInit()
Initializes the window system.
void automataWindowCreate(unsigned int width, unsigned int height, const char *title)
Creates the window.
width
: the window width.
height
: the window height.
title
: the window title.
void automataWindowClose()
Closes the window.
void automataWindowTerminate();
Terminates the window system.
int automataWindowIsAlive()
Returns if the window is alive.
void automataWindowUpdate()
Updates the window.
unsigned int automataWindowGetWidth()
Returns the current window width.
unsigned int automataWindowGetHeight()
Returns the current window height.
const char *automataWindowGetTitle();
Returns the current window title.
void automataWindowSetTitle(const char *title)
Changes the window title.
title
: the new window title
void automataWindowSetSize(unsigned int width, unsigned int height)
Resizes the window.
width
: the new window width.
height
: the new window height.
void automataWindowCallbackResize(GLFWwindow* glfwWindow, int width, int height)
Internal use only. Called when a window is resized.