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:
beno
2025-07-03 01:26:25 +02:00
commit 6c125fb35e
85 changed files with 91688 additions and 0 deletions

View 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();
};

View File

@@ -0,0 +1,3 @@
#include <GLES2/gl2.h>
GLuint loadImg(const char* path);

View 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);
};

View 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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff