LCOV - code coverage report
Current view: top level - engine/render - rendergl.h (source / functions) Hit Total Coverage
Test: Libprimis Test Coverage Lines: 0 6 0.0 %
Date: 2024-11-22 05:07:59 Functions: 0 1 0.0 %

          Line data    Source code
       1             : #ifndef RENDERGL_H_
       2             : #define RENDERGL_H_
       3             : 
       4             : extern int xtraverts, xtravertsva;
       5             : extern int renderw();
       6             : extern int renderh();
       7             : extern vec worldpos;
       8             : extern bool hasFBMSBS, hasTQ, hasDBT, hasES3, hasCI;
       9             : extern int glversion, glslversion;
      10             : extern int mesa_swap_bug;
      11             : extern int maxdualdrawbufs;
      12             : extern physent *camera1;                // special ent that acts as camera, same object as player1 in FPS mode
      13             : 
      14             : extern int hudw();
      15             : extern int hudh();
      16             : 
      17             : extern vec camdir();
      18             : extern vec camright();
      19             : extern vec camup();
      20             : 
      21             : enum
      22             : {
      23             :     Draw_TexNone = 0, //unused
      24             :     Draw_TexMinimap,
      25             :     Draw_TexModelPreview,
      26             : };
      27             : 
      28             : extern float forceaspect;
      29             : extern float nearplane;
      30             : extern int farplane;
      31             : extern int drawtex;
      32             : extern const matrix4 viewmatrix;
      33             : 
      34             : inline const matrix4 viewmatrix(vec(-1, 0, 0), vec(0, 0, 1), vec(0, -1, 0));
      35             : 
      36             : extern matrix4 cammatrix, projmatrix, camprojmatrix;
      37             : extern int wireframe;
      38             : extern int usetexgather;
      39             : 
      40             : extern int glerr;
      41             : extern int intel_texalpha_bug;
      42             : extern void glerror(const char *file, int line, GLenum error);
      43             : 
      44           0 : inline void glerror()
      45             : {
      46           0 :     if(glerr)
      47             :     {
      48           0 :         GLenum error = glGetError();
      49           0 :         if(error != GL_NO_ERROR)
      50             :         {
      51           0 :             glerror(__FILE__, __LINE__, error);
      52             :         }
      53             :     }
      54           0 : }
      55             : extern void mousemove(int dx, int dy);
      56             : extern void gl_init();
      57             : extern void gl_resize();
      58             : extern void gl_setupframe(bool force = false);
      59             : extern void cleanupgl();
      60             : extern void enablepolygonoffset(GLenum type);
      61             : extern void disablepolygonoffset(GLenum type);
      62             : extern bool calcspherescissor(const vec &center, float size, float &sx1, float &sy1, float &sx2, float &sy2, float &sz1, float &sz2);
      63             : extern bool calcbbscissor(const ivec &bbmin, const ivec &bbmax, float &sx1, float &sy1, float &sx2, float &sy2);
      64             : extern bool calcspotscissor(const vec &origin, float radius, const vec &dir, int spot, const vec &spotx, const vec &spoty, float &sx1, float &sy1, float &sx2, float &sy2, float &sz1, float &sz2);
      65             : extern void screenquad();
      66             : extern void screenquad(float sw, float sh);
      67             : extern void screenquad(float sw, float sh, float sw2, float sh2);
      68             : extern void screenquadoffset(float x, float y, float w, float h);
      69             : extern void hudquad(float x, float y, float w, float h, float tx = 0, float ty = 0, float tw = 1, float th = 1);
      70             : extern void debugquad(float x, float y, float w, float h, float tx = 0, float ty = 0, float tw = 1, float th = 1);
      71             : extern float calcfrustumboundsphere(float nearplane, float farplane,  const vec &pos, const vec &view, vec &center);
      72             : extern void zerofogcolor();
      73             : extern void resetfogcolor();
      74             : extern float calcfogdensity(float dist);
      75             : extern float calcfogcull();
      76             : extern vec calcmodelpreviewpos(const vec &radius, float &yaw);
      77             : 
      78             : extern matrix4 hudmatrix;
      79             : extern void resethudmatrix();
      80             : extern void pushhudmatrix();
      81             : extern void flushhudmatrix(bool flushparams = true);
      82             : extern void pophudmatrix(bool flush = true, bool flushparams = true);
      83             : extern void pushhudscale(float scale);
      84             : extern void pushhudtranslate(float tx, float ty, float sx = 0, float sy = 0);
      85             : 
      86             : class ModelPreview
      87             : {
      88             :     public:
      89             :         void start(int x, int y, int w, int h, bool background, bool scissor);
      90             :         void end();
      91             :     private:
      92             :         physent *oldcamera;
      93             :         physent camera;
      94             : 
      95             :         float oldaspect, oldfovy, oldfov, oldldrscale;
      96             :         int oldfarplane, oldvieww, oldviewh;
      97             :         matrix4 oldprojmatrix;
      98             : 
      99             :         int x, y, w, h;
     100             :         bool background, scissor;
     101             : };
     102             : 
     103             : extern void masktiles(uint *tiles, float sx1, float sy1, float sx2, float sy2);
     104             : #endif

Generated by: LCOV version 1.14