File: glew.cpp

package info (click to toggle)
glbinding 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,848 kB
  • ctags: 30,258
  • sloc: cpp: 255,369; xml: 46,343; python: 7,876; sh: 599; makefile: 494
file content (47 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (3)
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
37
38
39
40
41
42
43
44
45
46
47

#include "glew.h"

#include <GL/glew.h>

#include <iostream>


namespace
{
    #include "gltest_data.inl"

    bool errors = false;
}


void glew_init()
{
    glewExperimental = GL_TRUE;
    glewInit();
    glGetError();
}


inline void glError()
{
    GLenum error = glGetError();
    if (error != GL_NO_ERROR)
        std::cout << "Error: " << error << std::endl;
}

void glew_test()
{
    if (errors)
    {
        #include "gltest_error.inl"
    }
    else
    {
        #include "gltest.inl"
    }
}

void glew_error(bool enable)
{
    errors = enable;
}