shithub: tinygl

ref: 1e31558458e269e127ae6a168086bffaed12fe3c
dir: /src/zpostprocess.c/

View raw version
#include "../include/GL/gl.h"
#include "../include/zbuffer.h"
#include "zgl.h"

void glPostProcess(GLuint (*postprocess)(GLint x, GLint y, GLuint pixel, GLushort z)){
	GLContext* c = gl_get_context();
#pragma omp parallel for collapse(2)
	for(GLint j = 0; j < c->zb->ysize; j++)
	for(GLint i = 0; i < c->zb->xsize; i++)
		c->zb->pbuf[i+j*(c->zb->xsize)] = postprocess(i,j,c->zb->pbuf[i+j*(c->zb->xsize)],c->zb->zbuf[i+j*(c->zb->xsize)]);
}