3f09354f2512f6b0a0acccdc15cb166d4f8361d0
[libgliar] / tests / glinfo / glinfo.c
1 /*
2 libgliar - a library that can fake the OpenGL context info returned by
3 the glGet OpenGL calls
4
5 Copyright (C) 2013 Canonical Ltd
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20 Author: Eleni Maria Stea <elene.mst@gmail.com>
21 */
22
23 #include <stdio.h>
24 #include <GL/glut.h>
25
26 #define GET_INTEGER(x)  (glGetIntegerv(x, &val), val)
27
28 int main(int argc, char **argv)
29 {
30         int val;
31
32         glutInit(&argc, argv);
33         glutCreateWindow("glinfo");
34
35         printf("vendor: %s\n", glGetString(GL_VENDOR));
36         printf("renderer: %s\n", glGetString(GL_RENDERER));
37         printf("version: %s\n", glGetString(GL_VERSION));
38         printf("shading language version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
39
40         printf("texture units: %d\n", GET_INTEGER(GL_MAX_TEXTURE_UNITS));
41         printf("max texture size: %d\n", GET_INTEGER(GL_MAX_TEXTURE_SIZE));
42         return 0;
43 }