
#include "../int.h"

#include "../array.h"

#include "./renderPasses/renderPass.h"

#include "./vector.h"

#include "../classConfiguration.h"



reflect
class pipeline{
	
	array * renderPasses	= new array();

	vector<int> * classIndices			= new vector();

	vector<int> * methodIndices			= new vector();

	addRenderPass( ... ) {

		va_list args;

		va_start( args, count );

		int classIndex 			= datatypes[0];

		this->classIndices->add( classIndex );



		void * voidPointer		= va_arg( args,  void * );

		int methodIndex			= getMethodIndexByPropertyName( classIndex, "prepare" );

		int renderMethodIndex	= getMethodIndexByPropertyName( classIndex, "render" );


		this->methodIndices->add( renderMethodIndex );



		int classIndexTest   = this->classIndices->get( 0 );

		//printf("\n\n\n\n%i\n\n\n\n", classIndexTest);

		callMethodOfClass( classIndex, methodIndex, voidPointer );

		printf("\n");

		va_end( args );


		this->renderPasses->add( voidPointer );

	}

	render() {

		array * renderPasses	= this->renderPasses;

		int renderPassCount 	= renderPasses->length();

		for (int i = 0; i < renderPassCount; ++i)
		{
			
			int classIndex			= this->classIndices->get( i );

			void * voidPointer		= renderPasses->get( i );

			int methodIndex			= this->methodIndices->get( i );

			callMethodOfClass( classIndex, methodIndex, voidPointer );

		}
		
	}

}
