AGL  0
3D graphics library
util.h File Reference
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 agl
 

Macros

#define AGL_PI   3.141592653589793238462643383279502884197169399375105820974
 \(\pi\). What else? More...
 
Internal constants

These values are used by AGL internally while creating the GLFW window.

#define AGL_SAMPLE_SIZE   4
 Samples to take per pixel for anti-aliasing. More...
 
#define AGL_GLVERSION_MAJOR   3
 OpenGL major version. More...
 
#define AGL_GLVERSION_MINOR   3
 OpenGL minor version. More...
 
#define AGL_GLFW_INIT_ERROR   1
 Error if GLFW was not initialised. More...
 
#define AGL_GLFW_CREATE_WINDOW_ERROR   2
 Error if window was not created. More...
 
Types of shading

These values are used to define how entities will be shaded. These are currently unused.

#define AGL_POINTS   1
 Display each vertex as a point. More...
 
#define AGL_LINES   2
 Display each edge as a line. More...
 
#define AGL_TRIGS   4
 Display each face; this is default. More...
 
#define AGL_SHADING_FLAT   1
 Each face will be shaded with a single color. More...
 
#define AGL_SHADING_GOURAUD   2
 Each vertex will be shaded. More...
 
#define AGL_SHADING_PHONG   3
 Each point (fragment) will be shaded. More...
 
Special colors

These are constants for special colors for materials.

#define AGL_COLOR_POS2RGB   -1
 Position based color. More...
 
#define AGL_COLOR_NORM2RGB   -2
 Normal based color. More...
 
#define AGL_COLOR_CHECKER   -3
 Checker board pattern. More...
 

Functions

GLuint loadShaders (std::string vertShader, std::string fragShader)
 Load a pair of shaders. More...
 
GLuint loadShadersFromFile (const char *vsPath, const char *fsPath)
 Load shaders from files. More...
 
std::string readTextFile (const char *path)
 Reads a text file. More...
 
void saveImage (const char *path, int w, int h)
 Save the current render as a ppm image. More...
 

Macro Definition Documentation

◆ AGL_COLOR_CHECKER

#define AGL_COLOR_CHECKER   -3

Checker board pattern.

◆ AGL_COLOR_NORM2RGB

#define AGL_COLOR_NORM2RGB   -2

Normal based color.

◆ AGL_COLOR_POS2RGB

#define AGL_COLOR_POS2RGB   -1

Position based color.

◆ AGL_GLFW_CREATE_WINDOW_ERROR

#define AGL_GLFW_CREATE_WINDOW_ERROR   2

Error if window was not created.

◆ AGL_GLFW_INIT_ERROR

#define AGL_GLFW_INIT_ERROR   1

Error if GLFW was not initialised.

◆ AGL_GLVERSION_MAJOR

#define AGL_GLVERSION_MAJOR   3

OpenGL major version.

◆ AGL_GLVERSION_MINOR

#define AGL_GLVERSION_MINOR   3

OpenGL minor version.

◆ AGL_LINES

#define AGL_LINES   2

Display each edge as a line.

◆ AGL_PI

#define AGL_PI   3.141592653589793238462643383279502884197169399375105820974

\(\pi\). What else?

◆ AGL_POINTS

#define AGL_POINTS   1

Display each vertex as a point.

◆ AGL_SAMPLE_SIZE

#define AGL_SAMPLE_SIZE   4

Samples to take per pixel for anti-aliasing.

◆ AGL_SHADING_FLAT

#define AGL_SHADING_FLAT   1

Each face will be shaded with a single color.

◆ AGL_SHADING_GOURAUD

#define AGL_SHADING_GOURAUD   2

Each vertex will be shaded.

◆ AGL_SHADING_PHONG

#define AGL_SHADING_PHONG   3

Each point (fragment) will be shaded.

◆ AGL_TRIGS

#define AGL_TRIGS   4

Display each face; this is default.