ported the University CGI demo from WINDOWS + GLUT + GLEW + GLU + OpenGL 4 to LINUX WAYLAND + EGL + GLES 2 with minimal cuts

This commit is contained in:
beno
2025-07-03 01:26:25 +02:00
commit 6c125fb35e
85 changed files with 91688 additions and 0 deletions

82
COMPATIBILITY Normal file
View File

@@ -0,0 +1,82 @@
in molte unità si usano delle chiamate disponibili solo da GL4 / GLES3.1
# include <GL/glew.h>
diventa
# include <GLES2/gl2.h>
più l'opzionale
# include <GLES2/gl2ext.h>
anzichè riscrivere le funzioni mancanti rinominandole alla precedente versione d'estensione, si introducano delle macro da aliasing
ma si potrebbe anche usare la guardia per racchiudere delle semplici definizioni
void glDrawBuffers(GLsizei n, const GLenum *bufs){
glDrawBuffersEXT( n, bufs);
}
#define GL_GLEXT_PROTOTYPES
#include <GLES2/gl2ext.h>
#ifndef glGenVertexArrays
#define glGenVertexArrays( n, arrays_ptr) { \
glGenVertexArraysOES( n, arrays_ptr); \
}
#endif
#ifndef glBindVertexArray
#define glBindVertexArray( array_ptr) { \
glBindVertexArrayOES( array_ptr); \
}
#endif
ifndef glDrawBuffers
define glDrawBuffers ( n, buffers_ptr) { \
glDrawBuffersEXT( n, bufs); \
}
#endif
sarebbe ancora meglio wrappare tutto attorno a (o un test più sofisticato per dire GL4 o GLES3.1)
#ifndef GL_ES_VERSION_3_1
...
#endif