#include "shaders.h"
#include <string.h>
#include <stdlib.h>

#define MAX_SHADERS 200
/*
shader_data *shaders[MAX_MAX_SHADERS];
shader_data* running_shaders[MAX_MAX_SHADERS]

void set_shader(char *name, void *run, void *setup, void *cleanup)
{
	shaders[shader_num] = malloc(sizeof(shader_data));
	shaders[shader_num]->run = run;
	shaders[shader_num]->setup = setup;
	shaders[shader_num]->cleanup = cleanup;
}

void setup_shader(char* name)
{ }

void cleanup_shader(char* name)
{ }

void setup_all_shaders(char* name)
{ }

void cleanup_all_shaders(char* name)
{ }

void*[3] get_shader_ptrs(char* name)
{ }
*/

int number_of_shaders = 0;
shader_data* shaders[MAX_SHADERS];


void register_shader(shader_data *shader)
{
	shaders[number_of_shaders] = shader;
	number_of_shaders++;
}

char* list_shaders()
{
	int i;

	for(i=0; i<number_of_shaders; i++)
	{
		printd(NORMAL, "%s\n", shaders[i]->name);
	}
	
	return NULL;
}

shader_data* get_shader(char *name)
{
	int i = 0;

	for(i=0; i<number_of_shaders; i++)
	{
		if(strncmp(shaders[i]->name, name, 50) == 0)
			return shaders[i];
	}
	
	return NULL;
}

void setup_shaders()
{
//	register_shader((shader_data*)get_hilight());
//	register_shader((shader_data*)get_greyscale());
//	register_shader((shader_data*)get_invert());
//	register_shader((shader_data*)get_blur());
//	register_shader((shader_data*)get_convolve());
//	register_shader((shader_data*)get_bloom());
}
