1 // BEGIN_COPYRIGHT -*- glean -*-
3 // Copyright (C) 2000 Allen Akin All Rights Reserved.
5 // Permission is hereby granted, free of charge, to any person
6 // obtaining a copy of this software and associated documentation
7 // files (the "Software"), to deal in the Software without
8 // restriction, including without limitation the rights to use,
9 // copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the
11 // Software is furnished to do so, subject to the following
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 // KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ALLEN AKIN BE
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 // OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 // DEALINGS IN THE SOFTWARE.
29 // torthpos.h: Test positioning of primitives in orthographic projection.
30 // Apps that require precise 2D rasterization depend on these semantics.
32 #ifndef __torthpos_h__
33 #define __torthpos_h__
39 #define drawingSize 256
40 #define windowSize (drawingSize + 2)
42 // Auxiliary struct for holding a test result:
43 class OPResult
: public BaseResult
{
45 bool pass
; // not saved in results file
46 bool hasGaps
; // true if gaps between prims were detected
47 bool hasOverlaps
; // true if overlaps were detected
48 bool hasBadEdges
; // true if edge-conditions were incorrect
51 hasGaps
= hasOverlaps
= hasBadEdges
= false;
53 void putresults(ostream
& s
) const {
59 bool getresults(istream
& s
) {
60 s
>> hasGaps
>> hasOverlaps
>> hasBadEdges
;
65 class OrthoPosPoints
: public BaseTest
<OPResult
> {
67 GLEAN_CLASS_WH(OrthoPosPoints
, OPResult
, windowSize
, windowSize
);
68 void logStats(OPResult
& r
);
69 }; // class OrthoPosPoints
71 class OrthoPosVLines
: public BaseTest
<OPResult
> {
73 GLEAN_CLASS_WH(OrthoPosVLines
, OPResult
, windowSize
, windowSize
);
74 void logStats(OPResult
& r
);
75 }; // class OrthoPosVLines
77 class OrthoPosHLines
: public BaseTest
<OPResult
> {
79 GLEAN_CLASS_WH(OrthoPosHLines
, OPResult
, windowSize
, windowSize
);
80 void logStats(OPResult
& r
);
81 }; // class OrthoPosHLines
83 class OrthoPosTinyQuads
: public BaseTest
<OPResult
> {
85 GLEAN_CLASS_WH(OrthoPosTinyQuads
, OPResult
, windowSize
, windowSize
);
86 void logStats(OPResult
& r
);
87 }; // class OrthoPosTinyQuads
89 class OrthoPosRandRects
: public BaseTest
<OPResult
> {
91 GLEAN_CLASS_WH(OrthoPosRandRects
, OPResult
, windowSize
, windowSize
);
92 void logStats(OPResult
& r
);
93 }; // class OrthoPosRandRects
95 class OrthoPosRandTris
: public BaseTest
<OPResult
> {
97 GLEAN_CLASS_WH(OrthoPosRandTris
, OPResult
, windowSize
, windowSize
);
98 void logStats(OPResult
& r
);
99 }; // class OrthoPosRandTris
103 #endif // __torthpos_h__