Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / tfragprog1.h
blob37656eb0beba06f3f12606a1a30fe3d0e8fd8fd1
1 // BEGIN_COPYRIGHT -*- glean -*-
2 //
3 // Copyright (C) 1999 Allen Akin 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 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.
26 //
27 // END_COPYRIGHT
29 // tfragprog.h: Test GL_ARB_fragment_program extension.
30 // Brian Paul 22 October 2005
32 #ifndef __tfragprog_h__
33 #define __tfragprog_h__
35 // If DEVEL_MODE==1 we generate a tall window of color swatches, one per
36 // fragment program, which can be eyeballed against a reference image.
37 // Use this if glReadPixels functionality is not working yet.
38 #undef windowWidth
39 #undef windowHeight
40 #define DEVEL_MODE 0
41 #if DEVEL_MODE
42 #define windowWidth 200
43 #define windowHeight 850
44 #else
45 #define windowWidth 100
46 #define windowHeight 100
47 #endif
50 #include "tmultitest.h"
52 namespace GLEAN {
55 class FragmentProgram
57 public:
58 const char *name;
59 const char *progString;
60 GLfloat expectedColor[4];
61 GLfloat expectedZ;
65 class FragmentProgramTest: public MultiTest
67 public:
68 FragmentProgramTest(const char* testName, const char* filter,
69 const char *extensions, const char* description)
70 : MultiTest(testName, filter, extensions, description)
74 virtual void runOne(MultiTestResult &r, Window &w);
76 private:
77 GLfloat tolerance[5];
78 void setup(void);
79 bool equalColors(const GLfloat a[4], const GLfloat b[4]) const;
80 bool equalDepth(GLfloat z0, GLfloat z1) const;
81 bool testProgram(const FragmentProgram &p);
82 void reportFailure(const char *programName,
83 const GLfloat expectedColor[4],
84 const GLfloat actualColor[4] ) const;
85 void reportZFailure(const char *programName,
86 GLfloat expectedZ, GLfloat actualZ) const;
89 } // namespace GLEAN
91 #endif // __tfragprog_h__