le3d - LightEngine 3D
A straightforward C++ 3D software engine for real-time graphics
rasterizer_integer.h
Go to the documentation of this file.
1 
35 #ifndef LE_RASTERIZER_INTEGER_H
36 #define LE_RASTERIZER_INTEGER_H
37 
38 #include "global.h"
39 #include "config.h"
40 
41 #include "draw.h"
42 #include "geometry.h"
43 #include "trilist.h"
44 #include "simd.h"
45 
46 /*****************************************************************************/
51 class LeRasterizer
52 {
53 public:
54  LeRasterizer(int width = LE_RESOX_DEFAULT, int height = LE_RESOY_DEFAULT);
55  ~LeRasterizer();
56 
57  void rasterList(LeTriList * trilist);
58  const void * getPixels() {return pixels;}
59  void flush();
60 
61  LeBitmap frame;
64 private:
65  inline void fillTriangleZC(int vi1, int vi2, int vi3, bool top);
66  inline void fillFlatTexZC(int y, int x1, int x2, int w1, int w2, int u1, int u2, int v1, int v2);
67  inline void fillFlatTexZCFog(int y, int x1, int x2, int w1, int w2, int u1, int u2, int v1, int v2);
68  inline void fillFlatTexAlphaZC(int y, int x1, int x2, int w1, int w2, int u1, int u2, int v1, int v2);
69  inline void fillFlatTexAlphaZCFog(int y, int x1, int x2, int w1, int w2, int u1, int u2, int v1, int v2);
70 
71  LeColor * pixels;
72  LeColor * texDiffusePixels;
73  uint32_t texSizeU;
74  uint32_t texSizeV;
75  uint32_t texMaskU;
76  uint32_t texMaskV;
78  LeTriangle * curTriangle;
79  LeTriList * curTrilist;
81 #if LE_USE_SIMD == 1 && LE_USE_SSE2 == 1
82  __m128i color_4;
83 #endif // LE_USE_SIMD && LE_USE_SSE2
84 
85  int32_t xs[4], ys[4], ws[4];
86  int32_t us[4], vs[4];
87 };
88 
89 #endif // LE_RASTERIZER_INTEGER_H
LightEngine 3D: Native OS graphic context.
Represent a rasterizable triangle.
Definition: trilist.h:75
LightEngine 3D: General engine configuration file.
LightEngine 3D: Triangle lists.
LightEngine 3D: Global helpers and definitions.
Rasterize triangle lists.
Definition: rasterizer_float.h:51
Contain and manage triangle lists.
Definition: trilist.h:93
LeBitmap frame
Definition: rasterizer_float.h:61
Contain and manage a RGB or RGBA 32bit bitmap image.
Definition: bitmap.h:58
#define LE_RESOX_DEFAULT
Definition: config.h:37
Represent an RGBA color.
Definition: color.h:42
#define LE_RESOY_DEFAULT
Definition: config.h:38
void flush()
Fill the frame buffer with the background color.
Definition: rasterizer_float.cpp:97
LightEngine 3D: Vertex / axis / plane / matrix objects.
void rasterList(LeTriList *trilist)
Rasterize the given triangle list.
Definition: rasterizer_float.cpp:108
LightEngine 3D: SIMD constants / types and intrinsic definitions.
LeRasterizer(int width=LE_RESOX_DEFAULT, int height=LE_RESOY_DEFAULT)
Definition: rasterizer_float.cpp:68
LeColor background
Definition: rasterizer_float.h:62
const void * getPixels()
Definition: rasterizer_integer.h:58
~LeRasterizer()
Definition: rasterizer_float.cpp:87