1 // BEGIN_COPYRIGHT -*- glean -*-
3 // Copyright (C) 1999 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 // 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.
42 #define windowWidth 200
43 #define windowHeight 850
45 #define windowWidth 100
46 #define windowHeight 100
50 #include "tmultitest.h"
59 const char *progString
;
60 GLfloat expectedColor
[4];
65 class FragmentProgramTest
: public MultiTest
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
);
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;
91 #endif // __tfragprog_h__