-
Notifications
You must be signed in to change notification settings - Fork 1
/
glInfo.h
58 lines (51 loc) · 1.56 KB
/
glInfo.h
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
48
49
50
51
52
53
54
55
56
57
58
///////////////////////////////////////////////////////////////////////////////
// glInfo.h
// ========
// get GL vendor, version, supported extensions and other states using glGet*
// functions and store them glInfo struct variable
//
// To get valid OpenGL infos, OpenGL rendering context (RC) must be opened
// before calling glInfo::getInfo(). Otherwise it returns false.
//
// AUTHOR: Song Ho Ahn ([email protected])
// CREATED: 2005-10-04
// UPDATED: 2008-06-11
//
// Copyright (c) 2005 Song Ho Ahn
///////////////////////////////////////////////////////////////////////////////
#ifndef GLINFO_H
#define GLINFO_H
#include <string>
#include <vector>
#include "Singleton.h"
// struct variable to store OpenGL info
SINGLETON_BEGIN( glInfo )
public:
std::string vendor;
std::string renderer;
std::string version;
std::vector <std::string> extensions;
int redBits;
int greenBits;
int blueBits;
int alphaBits;
int depthBits;
int stencilBits;
int maxTextureSize;
int maxLights;
int maxAttribStacks;
int maxModelViewStacks;
int maxProjectionStacks;
int maxClipPlanes;
int maxTextureStacks;
// ctor, init all members
glInfo() : redBits(0), greenBits(0), blueBits(0), alphaBits(0), depthBits(0),
stencilBits(0), maxTextureSize(0), maxLights(0), maxAttribStacks(0),
maxModelViewStacks(0), maxClipPlanes(0), maxTextureStacks(0) {}
bool Init();
bool ExtractInfo();
void PrintInfo();
bool isExtensionSupported(const std::string& ext);
void CheckErrors();
SINGLETON_END()
#endif