HyperRogue  11.3d
game/visualization engine based on non-Euclidean geometry
Classes | Namespaces | Macros | Functions | Variables
glhr.cpp File Reference

low-level OpenGL routines More...

#include "hyper.h"

Classes

struct  hr::glhr::glmatrix
 
struct  hr::glhr::colored_vertex
 
struct  hr::glhr::textured_vertex
 
struct  hr::glhr::ct_vertex
 
struct  hr::glhr::GLprogram
 

Namespaces

 hr
 

Macros

#define DEBUG_GL   0
 
#define CAP_VERTEXBUFFER   (ISWEB)
 
#define WITHSHADER(x, y)   if(glhr::noshaders) y else x
 
#define glMatrixMode   DISABLED
 
#define glLoadIdentity   DISABLED
 
#define glMultMatrixf   DISABLED
 
#define glScalef   DISABLED
 
#define glTranslatef   DISABLED
 
#define glPushMatrix   DISABLED
 
#define glPopMatrix   DISABLED
 

Functions

EX void hr::glError (const char *GLcall, const char *file, const int line)
 
glvertex hr::glhr::pointtogl (const hyperpoint &t)
 
glvertex hr::glhr::makevertex (GLfloat x, GLfloat y, GLfloat z)
 
void hr::glhr::display (const glmatrix &m)
 
glmatrix hr::glhr::operator* (glmatrix m1, glmatrix m2)
 
EX glmatrix hr::glhr::scale (ld x, ld y, ld z)
 
EX glmatrix hr::glhr::tmtogl (const transmatrix &T)
 
EX glmatrix hr::glhr::tmtogl_transpose (const transmatrix &T)
 
EX glmatrix hr::glhr::tmtogl_transpose3 (const transmatrix &T)
 
EX glmatrix hr::glhr::ortho (ld x, ld y, ld z)
 
EX glmatrix & hr::glhr::as_glmatrix (GLfloat o[16])
 
EX glmatrix hr::glhr::frustum (ld x, ld y, ld vnear IS(vnear_default), ld vfar IS(vfar_default))
 
EX glmatrix hr::glhr::translate (ld x, ld y, ld z)
 
EX void hr::glhr::new_projection ()
 
EX void hr::glhr::projection_multiply (const glmatrix &m)
 
EX void hr::glhr::init ()
 
EX int hr::glhr::compileShader (int type, const string &s)
 
EX void hr::glhr::set_index_sl (ld x)
 
EX void hr::glhr::set_sl_iterations (int steps)
 
EX void hr::glhr::set_solv_prec (int x, int y, int z)
 
bool hr::glhr::operator== (const glmatrix &m1, const glmatrix &m2)
 
bool hr::glhr::operator!= (const glmatrix &m1, const glmatrix &m2)
 
EX void hr::glhr::set_modelview (const glmatrix &modelview)
 
EX void hr::glhr::id_modelview ()
 
EX array< GLfloat, 4 > hr::glhr::acolor (color_t color, ld scale IS(1))
 
EX void hr::glhr::color2 (color_t color, ld scale IS(1))
 
EX void hr::glhr::colorClear (color_t color)
 
EX void hr::glhr::full_enable (shared_ptr< GLprogram > p)
 
EX void hr::glhr::fog_max (ld fogmax, color_t fogcolor)
 
EX void hr::glhr::set_fogbase (ld _fogbase)
 
EX void hr::glhr::set_ualpha (ld alpha)
 
EX hyperpoint hr::glhr::gltopoint (const glvertex &t)
 
EX void hr::glhr::vertices (const vector< glvertex > &v, int vshift IS(0))
 
EX void hr::glhr::vertices_texture (const vector< glvertex > &v, const vector< glvertex > &t, int vshift IS(0), int tshift IS(0))
 
EX void hr::glhr::prepare (vector< colored_vertex > &v)
 
EX void hr::glhr::prepare (vector< textured_vertex > &v)
 
EX void hr::glhr::prepare (vector< ct_vertex > &v)
 
EX void hr::glhr::store_in_buffer (vector< glvertex > &v)
 
EX void hr::glhr::set_depthtest (bool b)
 
EX void hr::glhr::set_depthwrite (bool b)
 
EX void hr::glhr::set_linewidth (ld lw)
 
EX void hr::glhr::switch_to_text (const vector< glvertex > &v, const vector< glvertex > &t)
 
EX void hr::glhr::be_nontextured ()
 
EX void hr::glhr::be_textured ()
 
EX void hr::texture_vertices (GLfloat *f, int qty, int stride IS(2))
 
EX void hr::oldvertices (GLfloat *f, int qty)
 

Variables

const typedef void * hr::glhr::constvoidptr
 
EX bool hr::glhr::noshaders = false
 
bool hr::glhr::glew = false
 
bool hr::glhr::current_depthtest
 
bool hr::glhr::current_depthwrite
 
ld hr::glhr::fogbase
 
EX constvoidptr hr::glhr::current_vertices
 
EX constvoidptr hr::glhr::buffered_vertices
 
EX ld hr::glhr::current_linewidth
 
GLuint hr::glhr::buf_current
 
GLuint hr::glhr::buf_buffered
 
EX glmatrix hr::glhr::id = {{{1,0,0,0}, {0,1,0,0}, {0,0,1,0}, {0,0,0,1}}}
 
constexpr ld hr::glhr::vnear_default = 1e-3
 
constexpr ld hr::glhr::vfar_default = 1e9
 
glmatrix hr::glhr::projection
 
EX shared_ptr< GLprogram > hr::glhr::current_glprogram = nullptr
 
EX bool hr::glhr::debug_gl
 
EX glmatrix hr::glhr::current_matrix
 
EX glmatrix hr::glhr::current_modelview
 
EX glmatrix hr::glhr::current_projection
 
EX glmatrix hr::glhr::eyeshift
 
EX bool hr::glhr::using_eyeshift
 
EX vector< glhr::textured_vertex > hr::text_vertices
 

Detailed Description

low-level OpenGL routines

If CAP_SHADER is 0, OpenGL 1.0 is used. If CAP_SHADER is 1, we are using GLSL shaders.