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 {
|
2017-05-26 00:25:14 +00:00
|
|
|
float m_nearPlane;
|
|
|
|
float m_farPlane;
|
2016-04-27 03:47:10 +00:00
|
|
|
virtual ~IShader();
|
|
|
|
virtual Vec4f vertex(int iface, int nthvert) = 0;
|
|
|
|
virtual bool fragment(Vec3f bar, TGAColor &color) = 0;
|
|
|
|
};
|
|
|
|
|
2016-08-12 21:18:46 +00:00
|
|
|
void triangle(mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer, const Matrix& viewPortMatrix);
|
2016-08-11 21:55:30 +00:00
|
|
|
void triangle(mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer, int* segmentationMaskBuffer, const Matrix& viewPortMatrix, int objectIndex);
|
2017-04-06 21:31:34 +00:00
|
|
|
void triangleClipped(mat<4,3,float> &clippedPts, mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer, const Matrix& viewPortMatrix);
|
|
|
|
void triangleClipped(mat<4,3,float> &clippedPts, mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer, int* segmentationMaskBuffer, const Matrix& viewPortMatrix, int objectIndex);
|
|
|
|
|
2016-04-27 03:47:10 +00:00
|
|
|
#endif //__OUR_GL_H__
|
|
|
|
|