3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Tester Core
5 * ----------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief EGL common defines and types
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
28 #define EGLU_CHECK(EGLW) eglu::checkError((EGLW).getError(), DE_NULL, __FILE__, __LINE__)
29 #define EGLU_CHECK_MSG(EGLW, MSG) eglu::checkError((EGLW).getError(), MSG, __FILE__, __LINE__)
30 #define EGLU_CHECK_CALL(EGLW, CALL) do { (EGLW).CALL; eglu::checkError((EGLW).getError(), #CALL, __FILE__, __LINE__); } while (deGetFalse())
31 #define EGLU_CHECK_CALL_FPTR(EGLW, CALL) do { CALL; eglu::checkError((EGLW).getError(), #CALL, __FILE__, __LINE__); } while (deGetFalse())
33 /*--------------------------------------------------------------------*//*!
34 * \brief EGL utilities
35 *//*--------------------------------------------------------------------*/
39 class Error : public tcu::TestError
42 Error (deUint32 errCode, const char* errStr);
43 Error (deUint32 errCode, const char* message, const char* expr, const char* file, int line);
44 ~Error (void) throw() {}
46 deUint32 getError (void) const { return m_error; }
52 class BadAllocError : public tcu::ResourceError
55 BadAllocError (const char* errStr);
56 BadAllocError (const char* message, const char* expr, const char* file, int line);
57 ~BadAllocError (void) throw() {}
60 void checkError (deUint32 err, const char* msg, const char* file, int line);
65 Version (int major, int minor) : m_major(major), m_minor(minor) {}
67 int getMajor (void) const { return m_major; }
68 int getMinor (void) const { return m_minor; }
70 bool operator< (const Version& v) const;
71 bool operator== (const Version& v) const;
73 bool operator!= (const Version& v) const;
74 bool operator> (const Version& v) const;
75 bool operator<= (const Version& v) const;
76 bool operator>= (const Version& v) const;
85 #endif // _EGLUDEFS_HPP