Skip to content

Commit

Permalink
19 files: Implement vegastrike#851 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengtuggy committed May 5, 2024
1 parent 9552c18 commit 1338ed9
Show file tree
Hide file tree
Showing 19 changed files with 48 additions and 56 deletions.
10 changes: 3 additions & 7 deletions engine/objconv/basemaker/base_maker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,9 @@
#include <sys/stat.h> //for mkdir
#include <sys/types.h>

#if defined(__APPLE__) && defined(__MACH__)
# include <glut.h>
# include <glext.h>
#else
# include <glut.h>
# include <glext.h>
#endif
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glut.h>
#include <glext.h>

/*
* Globals
Expand Down
10 changes: 3 additions & 7 deletions engine/objconv/basemaker/sprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@
#include "gfx/hud.h"
#include "vs_globals.h"

#if defined(__APPLE__) && defined(__MACH__)
# include <glut.h>
# include <glext.h>
#else
# include <glut.h>
# include <glext.h>
#endif
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glut.h>
#include <glext.h>

#include <iostream>
//#include <stdlib>
Expand Down
10 changes: 7 additions & 3 deletions engine/objconv/varray.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* varray.cpp
*
* Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* and other Vega Strike contributors.
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
Expand All @@ -21,10 +23,12 @@
*/

#include <stdlib.h>
#include <GL/glut.h>
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glut.h>
#include <vector>
#undef GL_ARB_vertex_buffer_object
#include <GL/glext.h>
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glext.h>
#include <stdio.h>
PFNGLBINDBUFFERARBPROC glBindBufferARB_p = 0;
PFNGLGENBUFFERSARBPROC glGenBuffersARB_p = 0;
Expand Down
5 changes: 3 additions & 2 deletions engine/src/cg_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@

#if defined (UNIX)

// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#define GLX_GLXEXT_PROTOTYPES 1
#include <GL/glx.h>
#include <glx.h>
#include "gldrv/glx_undefined_extensions.h"
#include <GL/glxext.h>
#include <glxext.h>

#endif //defined (UNIX)

Expand Down
5 changes: 1 addition & 4 deletions engine/src/cmd/ai/flykeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@
#define VEGA_STRIKE_ENGINE_CMD_AI_FLY_KEYBOARD_H

#include "in.h"
#if defined(__APPLE__) && defined(__MACH__)
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glut.h>
#else
#include <glut.h>
#endif
#include "flybywire.h"

class FlyByKeyboard : public FlyByWire {
Expand Down
5 changes: 1 addition & 4 deletions engine/src/gfx/screenshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@
#include "vs_globals.h"
#include "xml_support.h"
#include "vsimage.h"
#ifndef __APPLE__
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glut.h>
#else
#include <glut.h>
#endif

using namespace VSFileSystem;

Expand Down
1 change: 1 addition & 0 deletions engine/src/gfx/star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "universe.h"
#include "vs_logging.h"

// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#if defined(__APPLE__) && defined(__MACH__)
# include <gl.h>
#elif defined (_WIN32) || defined (__CYGWIN__)
Expand Down
10 changes: 3 additions & 7 deletions engine/src/gfx/vsimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@

#include "vsimage.h"

#if defined(__APPLE__) && defined(__MACH__)
# include <GLUT/glut.h>
# include <OpenGL/glext.h>
#else
# include <GL/glut.h>
# include <GL/glext.h>
#endif
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glut.h>
#include <glext.h>

#include "cmd/unit_generic.h"

Expand Down
2 changes: 2 additions & 0 deletions engine/src/gldrv/gl_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ struct GFXStats
//#define GL_GLEXT_PROTOTYPES
#endif

// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#if defined (_WIN32) || defined (__CYGWIN__)
#ifndef NOMINMAX
#define NOMINMAX
Expand All @@ -103,6 +104,7 @@ struct GFXStats
#include <gl.h>
#endif

// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#if defined(__APPLE__) && defined(__MACH__)
#include <glut.h>
//#if defined( GL_INIT_CPP) || defined( GL_MISC_CPP) || defined( GL_STATE_CPP)
Expand Down
7 changes: 2 additions & 5 deletions engine/src/gldrv/gl_include.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
#ifndef VEGA_STRIKE_ENGINE_GLDRV_GL_INCLUDE_H
#define VEGA_STRIKE_ENGINE_GLDRV_GL_INCLUDE_H

#if defined(__APPLE__) && defined(__MACH__)
# include <glut.h>
#else
# include <glut.h>
#endif
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glut.h>

#endif //VEGA_STRIKE_ENGINE_GLDRV_GL_INCLUDE_H
1 change: 1 addition & 0 deletions engine/src/gldrv/gl_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_PROTOTYPES 1
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#if defined(__APPLE__) && defined(__MACH__)
# include <gl.h>
# include <glext.h>
Expand Down
11 changes: 4 additions & 7 deletions engine/src/gldrv/gl_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,16 @@ extern "C"
* count on that... */

#if defined (IRIX)
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <gl.h>
#include <glut.h>
typedef void (*PFNGLLOCKARRAYSEXTPROC)( GLint first, GLsizei count );
typedef void (*PFNGLUNLOCKARRAYSEXTPROC)( void );

#elif !defined (_WIN32)
#if defined(__APPLE__) && defined(__MACH__)
# include <glut.h>
# include <glext.h>
#else
# include <glut.h>
# include <glext.h>
#endif
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#include <glut.h>
#include <glext.h>

#if !defined (GL_GLEXT_VERSION) || GL_GLEXT_VERSION < 6
# error "*** You need a more recent copy of glext.h. You can get one at http: //oss.sgi.com/projects/ogl-sample/ABI/glext.h ; it goes in /usr/include/GL. ***"
Expand Down
9 changes: 6 additions & 3 deletions engine/src/gldrv/gl_matrix_hack.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* Copyright (C) 2001-2022 Daniel Horn, Alan Shieh, pyramid3d,
* gl_matrix_hack.cpp
*
* Copyright (C) 2001-2024 Daniel Horn, Alan Shieh, pyramid3d,
* Stephen G. Tuggy, and other Vega Strike contributors.
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
Expand All @@ -13,7 +15,7 @@
*
* Vega Strike is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
Expand Down Expand Up @@ -43,7 +45,8 @@
#include "vsfilesystem.h"
#include "vs_logging.h"

//#include <GL/glu.h>
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
//#include <glu.h>

inline void Zero(float matrix[]) {
matrix[0] = 0;
Expand Down
7 changes: 5 additions & 2 deletions engine/src/gldrv/gl_pick.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* gl_pick.cpp
*
* Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* and other Vega Strike contributors.
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
Expand All @@ -23,7 +25,8 @@
/* GL selection buffer code
*/

//#include <GL/gl.h>
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
//#include <gl.h>
#include "gl_globals.h"
#include "gfxlib.h"
#include "gl_matrix.h"
Expand Down
1 change: 1 addition & 0 deletions engine/src/gldrv/winsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <SDL2/SDL.h>

// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#if defined(__APPLE__) && defined(__MACH__)
# include <gl.h>
#elif defined (_WIN32) || defined (__CYGWIN__)
Expand Down
7 changes: 2 additions & 5 deletions engine/src/gldrv/winsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@
#if defined( SDL_WINDOWING ) && defined (HAVE_SDL)
# include "SDL2/SDL.h"
#elif defined( HAVE_GLUT )
#if defined(__APPLE__) && defined(__MACH__)
#include <glut.h>
#else
#include <glut.h>
#endif
// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
# include <glut.h>
#else
# error "Neither SDL nor GLUT are present."
#endif
Expand Down
1 change: 1 addition & 0 deletions engine/src/gui/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* The only external functions it requires that aren't provided by system libs are in glut_support.h
*/

// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#if defined(__APPLE__) && defined(__MACH__)
#include <gl.h>
#include <glut.h>
Expand Down
1 change: 1 addition & 0 deletions engine/src/gui/text_area.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
//There are places where a float is converted to an int. This define takes extra steps to convert without a warning (float -> char -> int)
#define NO_WARNINGS

// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#if defined(__APPLE__) && defined(__MACH__)
#include <gl.h>
#include <glut.h>
Expand Down
1 change: 1 addition & 0 deletions engine/src/vegastrike.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ extern float AUDIO_ATOM;
//#include "command.h"
#endif //defined (WIN32) || defined (__CYGWIN__)

// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766
#ifndef NO_GFX
# if defined(__APPLE__) && defined(__MACH__)
# include <gl.h>
Expand Down

0 comments on commit 1338ed9

Please sign in to comment.