15 #ifndef FPLBASE_ENVIRONMENT_H
16 #define FPLBASE_ENVIRONMENT_H
20 #include "fplbase/config.h"
22 #include "mathfu/glsl_mappings.h"
36 kWindowModeWindowedNative,
40 kWindowModeWindowedScaled,
43 kWindowModeFullscreenNative,
46 kWindowModeFullscreenScaled,
59 : feature_level_(kFeatureLevel20),
60 window_size_(mathfu::vec2i(800, 600))
65 bool Initialize(
const mathfu::vec2i &window_size,
const char *window_title,
66 WindowMode window_mode = kWindowModeWindowedScaled);
68 void AdvanceFrame(
bool minimized);
72 void SetWindowSize(
const mathfu::vec2i &window_size) {
73 window_size_ = window_size;
76 mathfu::vec2i GetViewportSize()
const;
78 FeatureLevel feature_level()
const {
return feature_level_; }
80 const mathfu::vec2i &window_size()
const {
return window_size_; }
81 mathfu::vec2i &window_size() {
return window_size_; }
83 const std::string &last_error()
const {
return last_error_; }
86 FeatureLevel feature_level_;
87 mathfu::vec2i window_size_;
88 std::string last_error_;
89 std::unique_ptr<EnvironmentHandles> handles_;
92 #define LOOKUP_GL_FUNCTION(type, name, required, lookup_fn) \
96 } data_function_union_##name; \
97 data_function_union_##name.data = (void *)lookup_fn(#name); \
98 if (required && !data_function_union_##name.data) { \
99 last_error_ = "could not retrieve GL function pointer " #name; \
102 name = data_function_union_##name.function;
107 #endif // FPLBASE_ENVIRONMENT_H
Definition: environment.h:50
Definition: environment.h:56