ported the University CGI demo from WINDOWS + GLUT + GLEW + GLU + OpenGL 4 to LINUX WAYLAND + EGL + GLES 2 with minimal cuts
This commit is contained in:
12
GL_STUFF/HEADERS/UTILS/ClockIterator.hpp
Executable file
12
GL_STUFF/HEADERS/UTILS/ClockIterator.hpp
Executable file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
class ClockIterator {
|
||||
private:
|
||||
unsigned int max;
|
||||
unsigned int counter;
|
||||
public:
|
||||
ClockIterator(unsigned int loopMillis);
|
||||
unsigned int step(unsigned int millis);
|
||||
float getPercentage();
|
||||
unsigned int getPosition();
|
||||
void reset();
|
||||
};
|
||||
3
GL_STUFF/HEADERS/UTILS/OnlyOnce.hpp
Executable file
3
GL_STUFF/HEADERS/UTILS/OnlyOnce.hpp
Executable file
@@ -0,0 +1,3 @@
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
GLuint loadImg(const char* path);
|
||||
21
GL_STUFF/HEADERS/UTILS/ResourceCache.h
Executable file
21
GL_STUFF/HEADERS/UTILS/ResourceCache.h
Executable file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "../UTILS/OnlyOnce.hpp"
|
||||
using namespace std;
|
||||
|
||||
class ResourceCache {
|
||||
|
||||
private:
|
||||
ResourceCache ();
|
||||
map<string, GLuint> images;
|
||||
map<string, GLuint> shaders;
|
||||
public:
|
||||
static ResourceCache& get() {
|
||||
static ResourceCache instance;
|
||||
return instance;
|
||||
}
|
||||
GLuint getImage(string path);
|
||||
GLuint getShader(string vertPath, string fragPath);
|
||||
};
|
||||
12
GL_STUFF/HEADERS/UTILS/ShaderMaker.h
Executable file
12
GL_STUFF/HEADERS/UTILS/ShaderMaker.h
Executable file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
class ShaderMaker
|
||||
{
|
||||
public:
|
||||
static GLuint createProgram(char* vertexfilename, char *fragmentfilename);
|
||||
static char* readShaderSource(const char* shaderFile);
|
||||
|
||||
private:
|
||||
ShaderMaker() { }
|
||||
};
|
||||
7462
GL_STUFF/HEADERS/UTILS/stb_image.h
Executable file
7462
GL_STUFF/HEADERS/UTILS/stb_image.h
Executable file
File diff suppressed because it is too large
Load Diff
2598
GL_STUFF/HEADERS/UTILS/stb_image_resize.h
Executable file
2598
GL_STUFF/HEADERS/UTILS/stb_image_resize.h
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user