NWengine 0.9
Loading...
Searching...
No Matches
Context.h
1#pragma once
2
6class Context {
7public:
11 static void* window; //Should be converted to GLFWwindow* to be used
12
19 static void* InitContext(int scrWidth, int scrHeight);
20
25 static bool ShouldClose();
26
30 static void Update();
31
36 static void EnableBlend(bool status = true);
37
42 static void EnableWireframe(bool status = true);
43
48 static void EnableDepthTest(bool status = true);
49
57 static void Clear(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f);
58
66 static void SetViewPort(int x, int y, int sizeX, int sizeY);
67
72 static void SetFullscreen(bool state = true);
73
78 static void SetTitle(const char* title);
79
83 static void Destroy();
84
88 static int vSync;
89
93 static int NATIVE_WIDTH;
94
98 static int NATIVE_HEIGHT;
99
103 static int WINDOW_WIDTH;
104
108 static int WINDOW_HEIGHT;
109};
The Context class represents the application context.
Definition Context.h:6
static void Clear(float r=0.0f, float g=0.0f, float b=0.0f, float a=1.0f)
Clears the screen with the specified color.
Definition Context.cpp:116
static void SetViewPort(int x, int y, int sizeX, int sizeY)
Sets the viewport.
Definition Context.cpp:27
static void * window
The window handle.
Definition Context.h:11
static void EnableDepthTest(bool status=true)
Enables or disables depth testing.
Definition Context.cpp:97
static void SetFullscreen(bool state=true)
Sets the application to fullscreen mode or windowed mode.
Definition Context.cpp:31
static int WINDOW_HEIGHT
The height of the application window.
Definition Context.h:108
static void * InitContext(int scrWidth, int scrHeight)
Initializes the application context.
Definition Context.cpp:41
static void Update()
Updates the application context.
Definition Context.cpp:79
static int WINDOW_WIDTH
The width of the application window.
Definition Context.h:103
static int NATIVE_WIDTH
The native width of the application window.
Definition Context.h:93
static void SetTitle(const char *title)
Sets the title of the application window.
Definition Context.cpp:122
static void EnableWireframe(bool status=true)
Enables or disables wireframe rendering.
Definition Context.cpp:105
static int vSync
The vertical synchronization value.
Definition Context.h:88
static void Destroy()
Destroys the application context.
Definition Context.cpp:125
static int NATIVE_HEIGHT
The native height of the application window.
Definition Context.h:98
static void EnableBlend(bool status=true)
Enables or disables blending.
Definition Context.cpp:86
static bool ShouldClose()
Checks if the application should close.
Definition Context.cpp:75