AGL  0
3D graphics library
util.h
Go to the documentation of this file.
1 #ifndef UTIL_H
2 #define UTIL_H
3 
4 #include<GLES3/gl32.h>
5 #include<iostream>
6 
7 namespace agl {
17 GLuint loadShaders(std::string vertShader, std::string fragShader);
26 GLuint loadShadersFromFile(const char* vsPath, const char* fsPath);
32 std::string readTextFile(const char* path);
42 void saveImage(const char* path, int w, int h);
43 }
44 
45 #define AGL_PI 3.141592653589793238462643383279502884197169399375105820974
46 
47 
52 #define AGL_SAMPLE_SIZE 4
53 #define AGL_GLVERSION_MAJOR 3
54 #define AGL_GLVERSION_MINOR 3
55 
56 #define AGL_GLFW_INIT_ERROR 1
57 #define AGL_GLFW_CREATE_WINDOW_ERROR 2
58 
65 #define AGL_POINTS 1
66 #define AGL_LINES 2
67 #define AGL_TRIGS 4
68 
69 #define AGL_SHADING_FLAT 1
70 #define AGL_SHADING_GOURAUD 2
71 #define AGL_SHADING_PHONG 3
72 
79 #define AGL_COLOR_POS2RGB -1
80 #define AGL_COLOR_NORM2RGB -2
81 #define AGL_COLOR_CHECKER -3
82 
84 #endif // UTIL_H
GLuint loadShadersFromFile(const char *vsPath, const char *fsPath)
Load shaders from files.
Definition: util.cpp:55
GLuint loadShaders(std::string vertShader, std::string fragShader)
Load a pair of shaders.
Definition: util.cpp:6
void saveImage(const char *path, int w, int h)
Save the current render as a ppm image.
Definition: util.cpp:70
Definition: create_shader.cpp:4
std::string readTextFile(const char *path)
Reads a text file.
Definition: util.cpp:59