Window - 18moyesjer/PVHS-OpenGl-Game-Engine GitHub Wiki

Window.java

The window class creates, manages, and controls an opengl window.

Package
Variables
Functions

##Package pvhs.lib

Variables

long window

is the window id

int window_res_x

is the window's resolution in the window's x direction.

The default is 640

int window_res_y

is the window's resolution in the window's y direction.

The default is 480

String window_title

is the window's title.

The default is "LWJGL 3 Window"

int window_quit_key

is the key the, when pressed, kills the window.

The default is GLFW_KEY_ESCAPE

float window_color_red

is the window's background red color. 0f is no red, 1f is red at full.

The default is 0f

float window_color_green

is the window's background green color. 0f is no green, 1f is green at full.

The default is 0f

float window_color_blue

is the window's background blue color. 0f is no blue, 1f is blue at full.

The default is 0f

int window_gl_major

is the major version of opengl. For example, if it is 3 then we will use opengl version 3.x

The default is 3

int window_gl_minor

is the minor version of opengl. For example, if it is 2 then we will use opengl version x.2

The default is 3

Functions

void window_init()

creates the window and stores the newly created window's id in the window variable

Boolean window_should_close()

returns true when the window should close

void draw_window()

will draw the current frame on the window.

double update_window()

will update the back frame so we can draw to it.
It will return how much time has passed since the last update call

void close_window()

closes the window when called