Initial commit

This commit is contained in:
2025-11-17 10:28:09 +01:00
parent 7bff81691f
commit 6ee36e26be
391 changed files with 110253 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
#include "block.h"
#include "member.h"
#include "uniform.h"
#define GL_GLEXT_PROTOTYPES
#include <GL/glext.h>
#include <GL/gl.h> // GL 1.1 functions
#include <GL/glx.h>
#include <stdio.h>
#include "../fileSystem.h"
#include "../array.h"
#include "../char.h"
#include "sampler2D.h"
class attribute{
GLchar name[64];
GLint location;
GLenum type;
}
class shader{
GLuint glShader;
constructor( GLuint shaderType ) {
this->glShader = glCreateShader( shaderType );
}
loadFromFile( char * shaderPath ) {
text * shaderSource = filesystem->readFile( shaderPath, "utf8" );
glShaderSource( this->glShader, 1, &shaderSource->value, NULL );
glCompileShader( this->glShader );
this->checkShaderForErrors( this->glShader );
}
checkShaderForErrors( GLuint shader ) {
GLint isCompiled = 0;
glGetShaderiv( shader, GL_COMPILE_STATUS, &isCompiled );
if( isCompiled == GL_FALSE )
{
GLint maxLength = 0;
glGetShaderiv( shader, GL_INFO_LOG_LENGTH, &maxLength );
GLchar errorMessage[ maxLength ];
glGetShaderInfoLog( shader, maxLength, &maxLength, errorMessage );
printf("\n\n\n\n Error: %s\n\n\n\n\n\n", errorMessage);
glDeleteShader( shader );
exit( 0 );
return;
}
}
}