cgv
Loading...
Searching...
No Matches
gl.h
1#pragma once
2
6#include <GL/glew.h>
7
8#include "lib_begin.h"
9
10namespace cgv {
11 namespace render {
12 namespace gl {
13
15template <typename T>
16struct gl_traits { static const unsigned type = GL_FALSE; static const bool valid_index = false; };
17template <>
18struct gl_traits<unsigned char> { static const unsigned type = GL_UNSIGNED_BYTE; static const bool valid_index = true; };
19template <>
20struct gl_traits<char> { static const unsigned type = GL_BYTE; static const bool valid_index = false; };
21template <>
22struct gl_traits<unsigned short> { static const unsigned type = GL_UNSIGNED_SHORT; static const bool valid_index = true; };
23template <>
24struct gl_traits<short> { static const unsigned type = GL_SHORT; static const bool valid_index = false; };
25template <>
26struct gl_traits<unsigned int> { static const unsigned type = GL_UNSIGNED_INT; static const bool valid_index = true; };
27template <>
28struct gl_traits<int> { static const unsigned type = GL_INT; static const bool valid_index = false; };
29template <>
30struct gl_traits<float> { static const unsigned type = GL_FLOAT; static const bool valid_index = false; };
31template <>
32struct gl_traits<double> { static const unsigned type = GL_DOUBLE; static const bool valid_index = false; };
33
34
36extern CGV_API bool ensure_glew_initialized();
37extern CGV_API bool is_glew_initialized();
38
39 }
40 }
41}
42
43#include <cgv/config/lib_end.h>
44
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
traits structure that maps a fundamental type to the Type enum.
Definition gl.h:16