Browse code

Standardize OpenGL-related #includes and #defines

We use glXGetProcAddress to load glXCreateContextAttribsARB ourselves,
so GLX_GLXEXT_PROTOTYPES is not needed.

Robert Cranston authored on 27/02/2024 02:27:47
Showing 1 changed files
... ...
@@ -5,17 +5,16 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-#ifdef __APPLE__
8
+#if defined(__APPLE__)
9 9
 	#define GL_SILENCE_DEPRECATION
10 10
 	#include <OpenGL/gl3.h>
11
+#elif defined(_WIN32)
12
+	#include "glew.h"
11 13
 #else
12
-	#if defined(_WIN32)
13
-		#include "glew.h"
14
-		#include <GL/gl.h>
15
-	#else
16
-		#include <GL/gl.h>
17
-	#endif
14
+	#define GL_GLEXT_PROTOTYPES
15
+	#include <GL/gl.h>
18 16
 #endif
17
+
19 18
 #include <stdlib.h>
20 19
 
21 20
 void printError(const char *functionName);
Browse code

Remove executable bit on files

find . -type f -exec chmod -x {} +

Robert Cranston authored on 27/02/2024 02:27:27
Showing 1 changed files
1 1
old mode 100755
2 2
new mode 100644
Browse code

Add cpp-v1

Ingemar Ragnemalm authored on 21/02/2024 20:24:28 • Robert Cranston committed on 21/02/2024 20:24:28
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,53 @@
1
+#ifndef _GL_UTILITIES_
2
+#define _GL_UTILITIES_
3
+
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
8
+#ifdef __APPLE__
9
+	#define GL_SILENCE_DEPRECATION
10
+	#include <OpenGL/gl3.h>
11
+#else
12
+	#if defined(_WIN32)
13
+		#include "glew.h"
14
+		#include <GL/gl.h>
15
+	#else
16
+		#include <GL/gl.h>
17
+	#endif
18
+#endif
19
+#include <stdlib.h>
20
+
21
+void printError(const char *functionName);
22
+GLuint loadShaders(const char *vertFileName, const char *fragFileName);
23
+GLuint loadShadersG(const char *vertFileName, const char *fragFileName, const char *geomFileName);
24
+GLuint loadShadersGT(const char *vertFileName, const char *fragFileName, const char *geomFileName,
25
+						const char *tcFileName, const char *teFileName);
26
+void dumpInfo(void);
27
+
28
+// This is obsolete! Use the functions in MicroGlut instead!
29
+//void initKeymapManager();
30
+//char keyIsDown(unsigned char c);
31
+
32
+// FBO support
33
+
34
+//------------a structure for FBO information-------------------------------------
35
+typedef struct
36
+{
37
+	GLuint texid;
38
+	GLuint fb;
39
+	GLuint rb;
40
+	GLuint depth;
41
+	int width, height;
42
+} FBOstruct;
43
+
44
+FBOstruct *initFBO(int width, int height, int int_method);
45
+FBOstruct *initFBO2(int width, int height, int int_method, int create_depthimage);
46
+void useFBO(FBOstruct *out, FBOstruct *in1, FBOstruct *in2);
47
+void updateScreenSizeForFBOHandler(int w, int h); // Temporary workaround to inform useFBO of screen size changes
48
+
49
+#ifdef __cplusplus
50
+}
51
+#endif
52
+
53
+#endif