our_gl.h 697 B

12345678910111213141516171819202122
  1. #ifndef __OUR_GL_H__
  2. #define __OUR_GL_H__
  3. #include "tgaimage.h"
  4. #include "geometry.h"
  5. Matrix viewport(int x, int y, int w, int h);
  6. Matrix projection(float coeff=0.f); // coeff = -1/c
  7. Matrix lookat(Vec3f eye, Vec3f center, Vec3f up);
  8. struct IShader {
  9. virtual ~IShader();
  10. virtual Vec4f vertex(int iface, int nthvert) = 0;
  11. virtual bool fragment(Vec3f bar, TGAColor &color) = 0;
  12. };
  13. void triangle(mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer, const Matrix& viewPortMatrix);
  14. void triangle(mat<4,3,float> &pts, IShader &shader, TGAImage &image, float *zbuffer, int* segmentationMaskBuffer, const Matrix& viewPortMatrix, int objectIndex);
  15. #endif //__OUR_GL_H__