Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / tstencil2.h
blob8c332cda20597b395a95e8d730a1ccdfc9f60b95
1 // BEGIN_COPYRIGHT -*- glean -*-
2 //
3 // Copyright (C) 2009 VMware, Inc. All Rights Reserved.
4 //
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
12 // conditions:
13 //
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the
16 // Software.
17 //
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 VMWARE 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.
26 //
27 // END_COPYRIGHT
29 // tstencil2.h: Test two-sided stencil features
31 #ifndef __tstencil2_h__
32 #define __tstencil2_h__
34 #include "tbase.h"
36 namespace GLEAN {
38 #define windowSize 100
40 class Stencil2Result: public BaseResult
42 public:
43 bool pass;
45 Stencil2Result();
47 virtual void putresults(ostream& s) const;
48 virtual bool getresults(istream& s);
52 class Stencil2Test: public BaseTest<Stencil2Result>
54 public:
55 GLEAN_CLASS_WH(Stencil2Test, Stencil2Result,
56 windowSize, windowSize);
58 bool isApplicable() const;
60 private:
61 GLint stencilBits, stencilMax;
63 void get_ext_functions();
65 bool have_ATI_separate_stencil(void) const;
66 bool have_EXT_stencil_two_side(void) const;
67 bool have_GL2_stencil_two_side(void) const;
68 bool have_stencil_wrap(void) const;
70 bool render_test(GLuint expectedFront, GLuint expectedBack);
72 bool compare_state(int method, GLenum found, GLenum expected, const char *msg);
74 bool set_stencil_state(int method,
75 GLenum frontStencilFail,
76 GLenum backStencilFail,
77 GLenum frontZFail,
78 GLenum backZFail,
79 GLenum frontZPass,
80 GLenum backZPass,
81 GLenum frontFunc,
82 GLenum backFunc,
83 GLint ref,
84 GLuint mask);
86 void reset_stencil_state(int method);
88 bool test_stencil(GLint method);
92 } // namespace GLEAN
94 #endif // __tstencil2_h__