~ubuntu-branches/ubuntu/precise/flightgear/precise

« back to all changes in this revision

Viewing changes to tests/gl-info.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Ove Kaaven
  • Date: 2011-01-30 15:46:35 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110130154635-rlynmg9n5hzxq5xe
Tags: 2.0.0-3
* Recommend fgfs-aircraft-base and fgfs-models-base.
  Closes. #610276.
* Added note about scenery SharedModels.tgz to README.Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
From: Steve Baker <sbaker@link.com>
 
3
Sender: root@fatcity.com
 
4
To: OPENGL-GAMEDEV-L <OPENGL-GAMEDEV-L@fatcity.com>
 
5
Subject: Re: Win32 OpenGL Resource Page
 
6
Date: Fri, 24 Apr 1998 07:33:51 -0800
 
7
*/
 
8
 
 
9
 
 
10
#ifdef HAVE_CONFIG_H
 
11
#  include <config.h>
 
12
#endif
 
13
 
 
14
#ifdef HAVE_WINDOWS_H
 
15
#  include <windows.h>
 
16
#endif
 
17
 
 
18
#include <stdio.h>
 
19
#include <stdlib.h>
 
20
 
 
21
#include <simgear/compiler.h>
 
22
#if defined( __APPLE__)
 
23
# include <OpenGL/OpenGL.h>
 
24
# include <GLUT/glut.h>
 
25
#else
 
26
# include <GL/gl.h>
 
27
# ifdef HAVE_GLUT_H
 
28
#  include <GL/glut.h>
 
29
# endif
 
30
#endif
 
31
 
 
32
 
 
33
void getPrints ( GLenum token, char *string )
 
34
{
 
35
  printf ( "%s = \"%s\"\n", string, glGetString ( token ) ) ;
 
36
}
 
37
 
 
38
void getPrint2f ( GLenum token, char *string )
 
39
{
 
40
  GLfloat f[2] ;
 
41
  glGetFloatv ( token, f ) ;
 
42
  printf ( "%s = %g,%g\n", string, f[0],f[1] ) ;
 
43
}
 
44
 
 
45
void getPrintf ( GLenum token, char *string )
 
46
{
 
47
  GLfloat f ;
 
48
  glGetFloatv ( token, &f ) ;
 
49
  printf ( "%s = %g\n", string, f ) ;
 
50
}
 
51
 
 
52
void getPrint2i ( GLenum token, char *string )
 
53
{
 
54
  GLint i[2] ;
 
55
  glGetIntegerv ( token, i ) ;
 
56
  printf ( "%s = %d,%d\n", string, i[0],i[1] ) ;
 
57
}
 
58
 
 
59
void getPrinti ( GLenum token, char *string )
 
60
{
 
61
  GLint i ;
 
62
  glGetIntegerv ( token, &i ) ;
 
63
  printf ( "%s = %d\n", string, i ) ;
 
64
}
 
65
 
 
66
int main ( int argc, char **argv )
 
67
{
 
68
#ifdef HAVE_GLUT_H
 
69
  glutInit            ( &argc, argv ) ;
 
70
  glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ;
 
71
  glutCreateWindow    ( "You should never see this window!"  ) ;
 
72
 
 
73
  getPrints ( GL_VENDOR      , "GL_VENDOR"     ) ;
 
74
  getPrints ( GL_RENDERER    , "GL_RENDERER"   ) ;
 
75
  getPrints ( GL_VERSION     , "GL_VERSION"    ) ;
 
76
  getPrints ( GL_EXTENSIONS  , "GL_EXTENSIONS" ) ;
 
77
 
 
78
  getPrinti ( GL_RED_BITS    , "GL_RED_BITS"   ) ;
 
79
  getPrinti ( GL_GREEN_BITS  , "GL_GREEN_BITS" ) ;
 
80
  getPrinti ( GL_BLUE_BITS   , "GL_BLUE_BITS"  ) ;
 
81
  getPrinti ( GL_ALPHA_BITS  , "GL_ALPHA_BITS" ) ;
 
82
  getPrinti ( GL_DEPTH_BITS  , "GL_DEPTH_BITS" ) ;
 
83
  getPrinti ( GL_INDEX_BITS  , "GL_INDEX_BITS" ) ;
 
84
  getPrinti ( GL_STENCIL_BITS, "GL_STENCIL_BITS" ) ;
 
85
 
 
86
  getPrinti ( GL_ACCUM_RED_BITS  , "GL_ACCUM_RED_BITS"   ) ;
 
87
  getPrinti ( GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS" ) ;
 
88
  getPrinti ( GL_ACCUM_BLUE_BITS , "GL_ACCUM_BLUE_BITS"  ) ;
 
89
  getPrinti ( GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS" ) ;
 
90
 
 
91
  getPrinti ( GL_AUX_BUFFERS, "GL_AUX_BUFFERS" ) ;
 
92
 
 
93
  getPrinti ( GL_MAX_ATTRIB_STACK_DEPTH    , "GL_MAX_ATTRIB_STACK_DEPTH"     ) ;
 
94
  getPrinti ( GL_MAX_NAME_STACK_DEPTH      , "GL_MAX_NAME_STACK_DEPTH"       ) ;
 
95
  getPrinti ( GL_MAX_TEXTURE_STACK_DEPTH   , "GL_MAX_TEXTURE_STACK_DEPTH"    ) ;
 
96
  getPrinti ( GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH" ) ;
 
97
  getPrinti ( GL_MAX_MODELVIEW_STACK_DEPTH , "GL_MAX_MODELVIEW_STACK_DEPTH"  ) ;
 
98
 
 
99
  getPrinti ( GL_MAX_CLIP_PLANES    , "GL_MAX_CLIP_PLANES"     ) ;
 
100
  getPrinti ( GL_MAX_EVAL_ORDER     , "GL_MAX_EVAL_ORDER"      ) ;
 
101
  getPrinti ( GL_MAX_LIGHTS         , "GL_MAX_LIGHTS"          ) ;
 
102
  getPrinti ( GL_MAX_LIST_NESTING   , "GL_MAX_LIST_NESTING"    ) ;
 
103
  getPrinti ( GL_MAX_TEXTURE_SIZE   , "GL_MAX_TEXTURE_SIZE"    ) ;
 
104
  getPrint2i( GL_MAX_VIEWPORT_DIMS  , "GL_MAX_VIEWPORT_DIMS"   ) ;
 
105
 
 
106
  getPrintf ( GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY" ) ;
 
107
  getPrint2f( GL_POINT_SIZE_RANGE      , "GL_POINT_SIZE_RANGE" ) ;
 
108
 
 
109
  printf("Default values:\n\n");
 
110
 
 
111
  getPrinti( GL_UNPACK_ALIGNMENT  , "GL_UNPACK_ALIGNMENT"   ) ;
 
112
  getPrinti( GL_UNPACK_ROW_LENGTH  , "GL_UNPACK_ROW_LENGTH"   ) ;
 
113
  getPrinti( GL_UNPACK_SKIP_PIXELS  , "GL_UNPACK_SKIP_PIXELS"   ) ;
 
114
  getPrinti( GL_UNPACK_SKIP_ROWS  , "GL_UNPACK_SKIP_ROWS"   ) ;
 
115
  getPrinti( GL_BLEND_SRC  , "GL_BLEND_SRC"   ) ;
 
116
  getPrinti( GL_BLEND_DST  , "GL_BLEND_DST"   ) ;
 
117
#else
 
118
 
 
119
  printf("GL Utility Toolkit (glut) was not found on this system.\n");
 
120
#endif
 
121
 
 
122
  return 0 ;
 
123
}