-
Notifications
You must be signed in to change notification settings - Fork 0
/
video.hh
36 lines (32 loc) · 1.3 KB
/
video.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef VIDEOINITHH
#define VIDEOINITHH
#include "teg.hh"
namespace Video {
/* This value will change every time a new OpenGL context is made. */
extern uint32_t opengl_context_cookie;
/* The above value will be set to this value until the first OpenGL context
is made, and never* again after.
* except if the user makes a LOT of contexts... */
extern const uint32_t uninitialized_context_cookie;
extern int32_t fullscreen_width, fullscreen_height;
extern int32_t windowed_width, windowed_height;
extern bool fullscreen_mode, vsync;
void Init(); // can be called repeatedly, if you want
void Kill();
void ReadConfig(); // should be called once, when the program starts
void WriteConfig(); // should be called if changed values are to be saved
uint32_t GetScreenWidth();
uint32_t GetScreenHeight();
double GetAspect(); // return aspect ratio of screen
void Swap(); // swap buffers
/* Returns false if the screen is not currently being displayed to the user.
Rendering isn't worthwhile unless this returns true. */
bool IsScreenActive();
/* Returns true if the event was fully handled. Returns false if the event
(possibly modified) should be handled by the caller. */
bool HandleEvent(SDL_Event& evt);
};
#ifndef TEG_PIXEL_PACK
#define TEG_PIXEL_PACK 8
#endif
#endif