22 #ifndef GRAPHICS_TINYGL_ZRECT_H 23 #define GRAPHICS_TINYGL_ZRECT_H 25 #include "common/types.h" 26 #include "common/rect.h" 27 #include "common/array.h" 29 #include "graphics/tinygl/zblit.h" 34 void *allocateFrame(
int size);
45 DrawCall_Rasterization,
50 DrawCall(DrawCallType type) : _type(type) { }
52 bool operator==(
const DrawCall &other)
const;
53 bool operator!=(
const DrawCall &other)
const {
54 return !(*
this == other);
56 virtual void execute(
bool restoreState)
const = 0;
57 virtual void execute(
const Common::Rect &clippingRectangle,
bool restoreState)
const = 0;
58 DrawCallType getType()
const {
return _type; }
59 virtual const Common::Rect getDirtyRegion()
const {
return _dirtyRegion; }
68 ClearBufferDrawCall(
bool clearZBuffer,
int zValue,
bool clearColorBuffer,
int rValue,
int gValue,
int bValue,
bool clearStencilBuffer,
int stencilValue);
71 virtual void execute(
bool restoreState)
const;
72 virtual void execute(
const Common::Rect &clippingRectangle,
bool restoreState)
const;
74 void *
operator new(
size_t size) {
75 return Internal::allocateFrame(size);
78 void operator delete(
void *p) { }
80 bool _clearZBuffer, _clearColorBuffer, _clearStencilBuffer;
81 int _rValue, _gValue, _bValue, _zValue, _stencilValue;
90 virtual void execute(
bool restoreState)
const;
91 virtual void execute(
const Common::Rect &clippingRectangle,
bool restoreState)
const;
93 void *
operator new(
size_t size) {
94 return Internal::allocateFrame(size);
97 void operator delete(
void *p) { }
99 void computeDirtyRegion();
103 gl_draw_triangle_func_ptr _drawTriangleFront, _drawTriangleBack;
105 struct RasterizationState {
107 int currentFrontFace;
113 bool depthTestEnabled;
116 bool texture2DEnabled;
117 int currentShadeModel;
119 int polygonModeFront;
128 float viewportTranslation[3];
129 float viewportScaling[3];
130 bool alphaTestEnabled;
133 bool stencilTestEnabled;
137 uint stencilWriteMask;
141 bool polygonStippleEnabled;
142 byte polygonStipplePattern[128];
150 bool operator==(
const RasterizationState &other)
const;
153 RasterizationState _state;
155 RasterizationState captureState()
const;
156 void applyState(
const RasterizationState &state)
const;
171 virtual void execute(
bool restoreState)
const;
172 virtual void execute(
const Common::Rect &clippingRectangle,
bool restoreState)
const;
174 BlittingMode getBlittingMode()
const {
return _mode; }
176 void *
operator new(
size_t size) {
177 return Internal::allocateFrame(size);
180 void operator delete(
void *p) { }
182 void computeDirtyRegion();
188 struct BlittingState {
190 int sfactor, dfactor;
192 int alphaFunc, alphaRefValue;
193 int depthTestEnabled;
195 bool operator==(
const BlittingState &other)
const {
197 enableBlending == other.enableBlending &&
198 sfactor == other.sfactor &&
199 dfactor == other.dfactor &&
200 alphaTest == other.alphaTest &&
201 alphaFunc == other.alphaFunc &&
202 alphaRefValue == other.alphaRefValue &&
203 depthTestEnabled == other.depthTestEnabled;
207 BlittingState captureState()
const;
208 void applyState(
const BlittingState &state)
const;
210 BlittingState _blitState;
Definition: zdirtyrect.h:160
Definition: zdirtyrect.h:41
Definition: zdirtyrect.h:85
Definition: colormasks.h:27
Definition: zdirtyrect.h:66
Definition: ios7_video.h:39