2016-04-27 03:47:10 +00:00
|
|
|
#ifndef __OUR_GL_H__
|
|
|
|
#define __OUR_GL_H__
|
|
|
|
#include "tgaimage.h"
|
|
|
|
#include "geometry.h"
|
|
|
|
|
|
|
|
|
2016-04-27 03:52:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
Matrix viewport(int x, int y, int w, int h);
|
|
|
|
Matrix projection(float coeff=0.f); // coeff = -1/c
|
|
|
|
Matrix lookat(Vec3f eye, Vec3f center, Vec3f up);
|
2016-04-27 03:47:10 +00:00
|
|
|
|
|
|
|
struct IShader {
|
|
|
|
virtual ~IShader();
|
|
|
|
virtual Vec4f vertex(int iface, int nthvert) = 0;
|
|
|
|
virtual bool fragment(Vec3f bar, TGAColor &color) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
//void triangle(Vec4f *pts, IShader &shader, TGAImage &image, float *zbuffer);
|
2016-04-27 03:52:52 +00:00
|
|
|
void triangle(mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer, const Matrix& viewPortMatrix);
|
2016-04-27 03:47:10 +00:00
|
|
|
#endif //__OUR_GL_H__
|
|
|
|
|