cgv
Loading...
Searching...
No Matches
gl.cxx
1#include "gl.h"
2#include <iostream>
3
4namespace cgv {
5 namespace render {
6 namespace gl {
7
8bool& ref_initialized()
9{
10 static bool is_initialized = false;
11 return is_initialized;
12}
13
14bool is_glew_initialized()
15{
16 return ref_initialized();
17}
18
20{
21 static bool called_init = false;
22 static bool result;
23 if (!called_init) {
24 GLenum err = glewInit();
25 result = err == GLEW_OK;
26 if (!result) {
27 std::cerr << "GLEW init error: " <<
28 glewGetErrorString(err) << std::endl;
29 }
30 else {
31 ref_initialized() = true;
32 called_init = true;
33 }
34 }
35 return result;
36}
37
38 }
39 }
40}
41
42#ifdef REGISTER_SHADER_FILES
43#include <cgv/base/register.h>
44#include <cgv_gl_shader_inc.h>
45#endif
bool ensure_glew_initialized()
initialize glew in the first call to this function and always return whether this was successful
Definition gl.cxx:19
the cgv namespace
Definition print.h:11