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,80 @@
#include "renderPass.h"
#include "../event.h"
#include "../../vector2.h"
#include "../shader.h"
#include "../program.h"
#include "../../int.h"
#include "../sampler2D.h"
#include "stdbool.h"
#include "../block.h"
class compute2 extends renderPass{
struct program * program;
int active = true;
prepare() {
printf("\n\n\n Prepare renderPass Compute 2\n\n\n\n\n");
shader * computeShader = new shader( GL_COMPUTE_SHADER );
computeShader->loadFromFile( "assets/shaders/addition2.comp" );
this->program = new program();
this->program->addShader( computeShader );
this->program->create();
}
render() {
if( this->active ) {
this->program->use();
this->program->bindBlock( "outputBlock2" );
glDispatchCompute( 1, 1, 1 );
block * outputBlock = this->program->getBlock( "outputBlock2" );
vector<vector2> * output = outputBlock->getMemberArray( "array_d[0]" );
int count = output->length();
for (int i = 0; i < count; ++i)
{
vector2 currentVector = output->get( i );
printf("%i = %f %f \n", i, i, currentVector.x, currentVector.y );
}
printf("length: %i\n\n", count);
this->active = false;
}
}
}