]> git.mxchange.org Git - flightgear.git/commitdiff
John Denker:
authorehofman <ehofman>
Tue, 8 Dec 2009 09:48:00 +0000 (09:48 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 9 Dec 2009 07:15:09 +0000 (08:15 +0100)
Suggestion:  It might be helpful to promote each of
 the .c files to .cxx.

 Rationale:
 -- The configure/makefile system handles CFLAGS
    differently from CXXFLAGS.
 -- It is important for the *info programs to
    compiled and run in exactly the same environment
    as the main fgfs program.  Some users depend on
    compiler or linker flags such as rpath that
    strongly affect the results of the *info programs.
 -- There is no downside;  you code compiles just
    fine as-is under the c++ compiler.

timoore split the original patch so that alcinfo.cxx can be commited to
the ehofman/sound branch seperately.

tests/Makefile.am
tests/est-epsilon.c [deleted file]
tests/est-epsilon.cxx [new file with mode: 0644]
tests/gl-info.c [deleted file]
tests/gl-info.cxx [new file with mode: 0644]

index 46db97225306222530bfaf018bc994c26e26209c..c3e2dc57070d070b4f3a21cad51e6906d5227f69 100644 (file)
@@ -8,10 +8,10 @@ else
 test_up_PLIB_LIBS = -lplibsg -lplibul
 endif
 
-est_epsilon_SOURCES = est-epsilon.c
+est_epsilon_SOURCES = est-epsilon.cxx
 est_epsilon_LDADD =  $(opengl_LIBS)
 
-gl_info_SOURCES = gl-info.c
+gl_info_SOURCES = gl-info.cxx
 gl_info_LDADD = $(opengl_LIBS)
 
 al_info_SOURCES = al-info.c
diff --git a/tests/est-epsilon.c b/tests/est-epsilon.c
deleted file mode 100644 (file)
index 5ff0a8a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#include <stdio.h>
-
-#include <simgear/compiler.h>
-#if defined( __APPLE__)
-# include <OpenGL/OpenGL.h>
-#else
-# include <GL/gl.h>
-#endif
-
-int main() {
-    GLfloat a, t;
-
-    a = 1.0;
-
-    do {
-       printf("a = %.10f\n", a);
-       a = a / 2.0;
-       t = 1.0 + a;
-    } while ( t > 1.0 );
-
-    a = a + a;
-
-    printf("Estimated GLfloat epsilon = %.10f\n", a);
-
-    return(0);
-}
diff --git a/tests/est-epsilon.cxx b/tests/est-epsilon.cxx
new file mode 100644 (file)
index 0000000..5ff0a8a
--- /dev/null
@@ -0,0 +1,34 @@
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
+#include <stdio.h>
+
+#include <simgear/compiler.h>
+#if defined( __APPLE__)
+# include <OpenGL/OpenGL.h>
+#else
+# include <GL/gl.h>
+#endif
+
+int main() {
+    GLfloat a, t;
+
+    a = 1.0;
+
+    do {
+       printf("a = %.10f\n", a);
+       a = a / 2.0;
+       t = 1.0 + a;
+    } while ( t > 1.0 );
+
+    a = a + a;
+
+    printf("Estimated GLfloat epsilon = %.10f\n", a);
+
+    return(0);
+}
diff --git a/tests/gl-info.c b/tests/gl-info.c
deleted file mode 100644 (file)
index 7d5be7d..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-From: Steve Baker <sbaker@link.com>
-Sender: root@fatcity.com
-To: OPENGL-GAMEDEV-L <OPENGL-GAMEDEV-L@fatcity.com>
-Subject: Re: Win32 OpenGL Resource Page
-Date: Fri, 24 Apr 1998 07:33:51 -0800
-*/
-
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <simgear/compiler.h>
-#if defined( __APPLE__)
-# include <OpenGL/OpenGL.h>
-# include <GLUT/glut.h>
-#else
-# include <GL/gl.h>
-# ifdef HAVE_GLUT_H
-#  include <GL/glut.h>
-# endif
-#endif
-
-
-void getPrints ( GLenum token, char *string )
-{
-  printf ( "%s = \"%s\"\n", string, glGetString ( token ) ) ;
-}
-
-void getPrint2f ( GLenum token, char *string )
-{
-  GLfloat f[2] ;
-  glGetFloatv ( token, f ) ;
-  printf ( "%s = %g,%g\n", string, f[0],f[1] ) ;
-}
-
-void getPrintf ( GLenum token, char *string )
-{
-  GLfloat f ;
-  glGetFloatv ( token, &f ) ;
-  printf ( "%s = %g\n", string, f ) ;
-}
-
-void getPrint2i ( GLenum token, char *string )
-{
-  GLint i[2] ;
-  glGetIntegerv ( token, i ) ;
-  printf ( "%s = %d,%d\n", string, i[0],i[1] ) ;
-}
-
-void getPrinti ( GLenum token, char *string )
-{
-  GLint i ;
-  glGetIntegerv ( token, &i ) ;
-  printf ( "%s = %d\n", string, i ) ;
-}
-
-int main ( int argc, char **argv )
-{
-#ifdef HAVE_GLUT_H
-  glutInit            ( &argc, argv ) ;
-  glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ;
-  glutCreateWindow    ( "You should never see this window!"  ) ;
-
-  getPrints ( GL_VENDOR      , "GL_VENDOR"     ) ;
-  getPrints ( GL_RENDERER    , "GL_RENDERER"   ) ;
-  getPrints ( GL_VERSION     , "GL_VERSION"    ) ;
-  getPrints ( GL_EXTENSIONS  , "GL_EXTENSIONS" ) ;
-
-  getPrinti ( GL_RED_BITS    , "GL_RED_BITS"   ) ;
-  getPrinti ( GL_GREEN_BITS  , "GL_GREEN_BITS" ) ;
-  getPrinti ( GL_BLUE_BITS   , "GL_BLUE_BITS"  ) ;
-  getPrinti ( GL_ALPHA_BITS  , "GL_ALPHA_BITS" ) ;
-  getPrinti ( GL_DEPTH_BITS  , "GL_DEPTH_BITS" ) ;
-  getPrinti ( GL_INDEX_BITS  , "GL_INDEX_BITS" ) ;
-  getPrinti ( GL_STENCIL_BITS, "GL_STENCIL_BITS" ) ;
-
-  getPrinti ( GL_ACCUM_RED_BITS  , "GL_ACCUM_RED_BITS"   ) ;
-  getPrinti ( GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS" ) ;
-  getPrinti ( GL_ACCUM_BLUE_BITS , "GL_ACCUM_BLUE_BITS"  ) ;
-  getPrinti ( GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS" ) ;
-
-  getPrinti ( GL_AUX_BUFFERS, "GL_AUX_BUFFERS" ) ;
-
-  getPrinti ( GL_MAX_ATTRIB_STACK_DEPTH    , "GL_MAX_ATTRIB_STACK_DEPTH"     ) ;
-  getPrinti ( GL_MAX_NAME_STACK_DEPTH      , "GL_MAX_NAME_STACK_DEPTH"       ) ;
-  getPrinti ( GL_MAX_TEXTURE_STACK_DEPTH   , "GL_MAX_TEXTURE_STACK_DEPTH"    ) ;
-  getPrinti ( GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH" ) ;
-  getPrinti ( GL_MAX_MODELVIEW_STACK_DEPTH , "GL_MAX_MODELVIEW_STACK_DEPTH"  ) ;
-
-  getPrinti ( GL_MAX_CLIP_PLANES    , "GL_MAX_CLIP_PLANES"     ) ;
-  getPrinti ( GL_MAX_EVAL_ORDER     , "GL_MAX_EVAL_ORDER"      ) ;
-  getPrinti ( GL_MAX_LIGHTS         , "GL_MAX_LIGHTS"          ) ;
-  getPrinti ( GL_MAX_LIST_NESTING   , "GL_MAX_LIST_NESTING"    ) ;
-  getPrinti ( GL_MAX_TEXTURE_SIZE   , "GL_MAX_TEXTURE_SIZE"    ) ;
-  getPrint2i( GL_MAX_VIEWPORT_DIMS  , "GL_MAX_VIEWPORT_DIMS"   ) ;
-
-  getPrintf ( GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY" ) ;
-  getPrint2f( GL_POINT_SIZE_RANGE      , "GL_POINT_SIZE_RANGE" ) ;
-
-  printf("Default values:\n\n");
-
-  getPrinti( GL_UNPACK_ALIGNMENT  , "GL_UNPACK_ALIGNMENT"   ) ;
-  getPrinti( GL_UNPACK_ROW_LENGTH  , "GL_UNPACK_ROW_LENGTH"   ) ;
-  getPrinti( GL_UNPACK_SKIP_PIXELS  , "GL_UNPACK_SKIP_PIXELS"   ) ;
-  getPrinti( GL_UNPACK_SKIP_ROWS  , "GL_UNPACK_SKIP_ROWS"   ) ;
-  getPrinti( GL_BLEND_SRC  , "GL_BLEND_SRC"   ) ;
-  getPrinti( GL_BLEND_DST  , "GL_BLEND_DST"   ) ;
-#else
-
-  printf("GL Utility Toolkit (glut) was not found on this system.\n");
-#endif
-
-  return 0 ;
-}
diff --git a/tests/gl-info.cxx b/tests/gl-info.cxx
new file mode 100644 (file)
index 0000000..7d5be7d
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+From: Steve Baker <sbaker@link.com>
+Sender: root@fatcity.com
+To: OPENGL-GAMEDEV-L <OPENGL-GAMEDEV-L@fatcity.com>
+Subject: Re: Win32 OpenGL Resource Page
+Date: Fri, 24 Apr 1998 07:33:51 -0800
+*/
+
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <simgear/compiler.h>
+#if defined( __APPLE__)
+# include <OpenGL/OpenGL.h>
+# include <GLUT/glut.h>
+#else
+# include <GL/gl.h>
+# ifdef HAVE_GLUT_H
+#  include <GL/glut.h>
+# endif
+#endif
+
+
+void getPrints ( GLenum token, char *string )
+{
+  printf ( "%s = \"%s\"\n", string, glGetString ( token ) ) ;
+}
+
+void getPrint2f ( GLenum token, char *string )
+{
+  GLfloat f[2] ;
+  glGetFloatv ( token, f ) ;
+  printf ( "%s = %g,%g\n", string, f[0],f[1] ) ;
+}
+
+void getPrintf ( GLenum token, char *string )
+{
+  GLfloat f ;
+  glGetFloatv ( token, &f ) ;
+  printf ( "%s = %g\n", string, f ) ;
+}
+
+void getPrint2i ( GLenum token, char *string )
+{
+  GLint i[2] ;
+  glGetIntegerv ( token, i ) ;
+  printf ( "%s = %d,%d\n", string, i[0],i[1] ) ;
+}
+
+void getPrinti ( GLenum token, char *string )
+{
+  GLint i ;
+  glGetIntegerv ( token, &i ) ;
+  printf ( "%s = %d\n", string, i ) ;
+}
+
+int main ( int argc, char **argv )
+{
+#ifdef HAVE_GLUT_H
+  glutInit            ( &argc, argv ) ;
+  glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ;
+  glutCreateWindow    ( "You should never see this window!"  ) ;
+
+  getPrints ( GL_VENDOR      , "GL_VENDOR"     ) ;
+  getPrints ( GL_RENDERER    , "GL_RENDERER"   ) ;
+  getPrints ( GL_VERSION     , "GL_VERSION"    ) ;
+  getPrints ( GL_EXTENSIONS  , "GL_EXTENSIONS" ) ;
+
+  getPrinti ( GL_RED_BITS    , "GL_RED_BITS"   ) ;
+  getPrinti ( GL_GREEN_BITS  , "GL_GREEN_BITS" ) ;
+  getPrinti ( GL_BLUE_BITS   , "GL_BLUE_BITS"  ) ;
+  getPrinti ( GL_ALPHA_BITS  , "GL_ALPHA_BITS" ) ;
+  getPrinti ( GL_DEPTH_BITS  , "GL_DEPTH_BITS" ) ;
+  getPrinti ( GL_INDEX_BITS  , "GL_INDEX_BITS" ) ;
+  getPrinti ( GL_STENCIL_BITS, "GL_STENCIL_BITS" ) ;
+
+  getPrinti ( GL_ACCUM_RED_BITS  , "GL_ACCUM_RED_BITS"   ) ;
+  getPrinti ( GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS" ) ;
+  getPrinti ( GL_ACCUM_BLUE_BITS , "GL_ACCUM_BLUE_BITS"  ) ;
+  getPrinti ( GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS" ) ;
+
+  getPrinti ( GL_AUX_BUFFERS, "GL_AUX_BUFFERS" ) ;
+
+  getPrinti ( GL_MAX_ATTRIB_STACK_DEPTH    , "GL_MAX_ATTRIB_STACK_DEPTH"     ) ;
+  getPrinti ( GL_MAX_NAME_STACK_DEPTH      , "GL_MAX_NAME_STACK_DEPTH"       ) ;
+  getPrinti ( GL_MAX_TEXTURE_STACK_DEPTH   , "GL_MAX_TEXTURE_STACK_DEPTH"    ) ;
+  getPrinti ( GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH" ) ;
+  getPrinti ( GL_MAX_MODELVIEW_STACK_DEPTH , "GL_MAX_MODELVIEW_STACK_DEPTH"  ) ;
+
+  getPrinti ( GL_MAX_CLIP_PLANES    , "GL_MAX_CLIP_PLANES"     ) ;
+  getPrinti ( GL_MAX_EVAL_ORDER     , "GL_MAX_EVAL_ORDER"      ) ;
+  getPrinti ( GL_MAX_LIGHTS         , "GL_MAX_LIGHTS"          ) ;
+  getPrinti ( GL_MAX_LIST_NESTING   , "GL_MAX_LIST_NESTING"    ) ;
+  getPrinti ( GL_MAX_TEXTURE_SIZE   , "GL_MAX_TEXTURE_SIZE"    ) ;
+  getPrint2i( GL_MAX_VIEWPORT_DIMS  , "GL_MAX_VIEWPORT_DIMS"   ) ;
+
+  getPrintf ( GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY" ) ;
+  getPrint2f( GL_POINT_SIZE_RANGE      , "GL_POINT_SIZE_RANGE" ) ;
+
+  printf("Default values:\n\n");
+
+  getPrinti( GL_UNPACK_ALIGNMENT  , "GL_UNPACK_ALIGNMENT"   ) ;
+  getPrinti( GL_UNPACK_ROW_LENGTH  , "GL_UNPACK_ROW_LENGTH"   ) ;
+  getPrinti( GL_UNPACK_SKIP_PIXELS  , "GL_UNPACK_SKIP_PIXELS"   ) ;
+  getPrinti( GL_UNPACK_SKIP_ROWS  , "GL_UNPACK_SKIP_ROWS"   ) ;
+  getPrinti( GL_BLEND_SRC  , "GL_BLEND_SRC"   ) ;
+  getPrinti( GL_BLEND_DST  , "GL_BLEND_DST"   ) ;
+#else
+
+  printf("GL Utility Toolkit (glut) was not found on this system.\n");
+#endif
+
+  return 0 ;
+}