83 lines
1.0 KiB
Plaintext
83 lines
1.0 KiB
Plaintext
|
|
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
|