40 #ifndef GEOGRAM_GFX_BASIC_GL
41 #define GEOGRAM_GFX_BASIC_GL
51 #if defined(GEO_OS_EMSCRIPTEN)
52 # define GLFW_INCLUDE_ES2
53 # include <GLFW/glfw3.h>
54 # define GL_GLEXT_PROTOTYPES
55 # include <GLES2/gl2ext.h>
56 # define GL_INVALID_INDEX GLuint(-1)
57 typedef double GLdouble;
58 # define glGenVertexArrays glGenVertexArraysOES
59 # define glBindVertexArray glBindVertexArrayOES
60 # define glDeleteVertexArrays glDeleteVertexArraysOES
62 # define GEO_GL_NO_DOUBLES
63 #elif defined(GEO_OS_ANDROID)
64 # include <GLES3/gl3.h>
65 # include <GLES3/gl31.h>
66 # include <GLES3/gl32.h>
67 # define GEO_GL_TEXTURE_3D
70 # define GEO_GL_NO_DOUBLES
72 # include <geogram_gfx/third_party/glad/glad.h>
73 # define GEO_GL_TEXTURE_3D
83 #if defined(GEO_OS_EMSCRIPTEN) || defined(GEO_OS_ANDROID)
85 # define GL_RGB8 0x8051
89 # define GL_RGBA8 0x8058
93 # define GL_R16F 0x822D
97 # define GL_R32F 0x822E
101 # define GL_RED 0x1903
105 # define GL_R8 0x8229
109 # define GL_R16 0x822A
112 # ifndef GL_DEPTH_COMPONENT24
113 # define GL_DEPTH_COMPONENT24 0x81A6
145 glupVertex2dv(v.
data());
153 glupVertex3dv(v.data());
162 glupVertex4dv(v.data());
170 glupColor3dv(v.
data());
178 glupColor4dv(v.data());
187 glupTexCoord2dv(v.
data());
195 glupTexCoord3dv(v.data());
203 glupTexCoord4dv(v.data());
211 glupTranslated(v.x, v.y, v.z);
273 GLuint& buffer_id, GLenum target,
size_t new_size,
const void* data
294 GLuint& buffer_id, GLenum target,
size_t new_size,
const void* data
318 GLuint& buffer_id, GLenum target,
size_t new_size,
const void* data,
330 const char* file,
int line,
bool warning_only=
false
363 # define GEO_CHECK_GL() ::GEO::check_gl(__FILE__,__LINE__)
365 # define GEO_CHECK_GL()
GLUP: GL Useful Primitives.
T * data()
Gets modifiable vector data.
Geometric functions in 2d and 3d.
Common include file, providing basic definitions. Should be included before anything else by all head...
Basic definitions for the Geogram C API.
#define GEOGRAM_GFX_API
Linkage declaration for geogram symbols.
Global Vorpaline namespace.
void glupLoadMatrix(const mat4 &m)
Replaces the current GLUP matrix with a user defined one.
void terminate()
Cleans up Geogram.
void update_or_check_buffer_object(GLuint &buffer_id, GLenum target, size_t new_size, const void *data, bool update)
Updates the content of an OpenGL buffer object, and resizes it if need be, or tests whether it has th...
vecng< 3, Numeric::float64 > vec3
Represents points and vectors in 3d.
GLint64 get_size_of_bound_buffer_object(GLenum target)
Gets the size (in bytes) of the OpenGL buffer bound to a specified target.
void glupVertex(const vec2 &v)
Sends a vertex to OpenGL.
geo_index_t index_t
The type for storing and manipulating indices.
vecng< 4, Numeric::float64 > vec4
Represents points and vectors in 4d.
void glupTexCoord(const vec2 &v)
Sends 2d texture coordinates to OpenGL.
void clear_gl_error_flags(const char *file, int line)
Clears all error flags set by previous OpenGL calls.
void initialize(int flags=GEOGRAM_INSTALL_NONE)
Initialize Geogram.
void glupTranslate(const vec3 &v)
Applies a translation.
void glupMapTexCoords1d(double minval, double maxval, index_t mult=1)
Maps texture coordinates from a specified interval to the unit interval.
void update_buffer_object(GLuint &buffer_id, GLenum target, size_t new_size, const void *data)
Updates the content of an OpenGL buffer object, and resizes it if need be.
void draw_unit_textured_quad(bool BW=false)
Draws a textured quad.
void check_gl(const char *file, int line, bool warning_only=false)
Tests for OpenGL errors and displays a message if OpenGL errors were encountered.
void glupColor(const vec3 &v)
Sends a RGB color to OpenGL.
void glupMultMatrix(const mat4 &m)
Multiplies the current GLUP matrix with another one.
vecng< DIM, FT > mult(const Matrix< DIM, FT > &M, const vecng< DIM, FT > &x)
Computes a matrix vector product.
void stream_buffer_object(GLuint &buffer_id, GLenum target, size_t new_size, const void *data)
Updates the content of an OpenGL buffer object in streaming mode.