diff --git a/src/common/Data.h b/src/common/Data.h index 33da435f8..fba07c9d3 100644 --- a/src/common/Data.h +++ b/src/common/Data.h @@ -1,58 +1,58 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_DATA_H -#define LOVE_DATA_H - -// LOVE -#include "config.h" -#include "Object.h" - -namespace love -{ - -/** - * This class is a simple abstraction over all objects which contain data. - **/ -class Data : public Object -{ -public: - - /** - * Destructor. - **/ - virtual ~Data() {}; - - /** - * Gets a pointer to the data. This pointer will obviously not - * be valid if the Data object is destroyed. - **/ - virtual void *getData() const = 0 ; - - /** - * Gets the size of the Data in bytes. - **/ - virtual int getSize() const = 0; - -}; // Data - -} // love - -#endif // LOVE_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_DATA_H +#define LOVE_DATA_H + +// LOVE +#include "config.h" +#include "Object.h" + +namespace love +{ + +/** + * This class is a simple abstraction over all objects which contain data. + **/ +class Data : public Object +{ +public: + + /** + * Destructor. + **/ + virtual ~Data() {}; + + /** + * Gets a pointer to the data. This pointer will obviously not + * be valid if the Data object is destroyed. + **/ + virtual void *getData() const = 0 ; + + /** + * Gets the size of the Data in bytes. + **/ + virtual int getSize() const = 0; + +}; // Data + +} // love + +#endif // LOVE_DATA_H diff --git a/src/common/EnumMap.h b/src/common/EnumMap.h index 8ac652d36..2c84484bf 100644 --- a/src/common/EnumMap.h +++ b/src/common/EnumMap.h @@ -1,100 +1,100 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_ENUM_MAP_H -#define LOVE_ENUM_MAP_H - -#include "Exception.h" - -namespace love -{ - -template -class EnumMap -{ -public: - - struct Entry - { - T t; - U u; - }; - - EnumMap(Entry *entries, unsigned size) - { - unsigned n = size/sizeof(Entry); - - for (unsigned i = 0; i +class EnumMap +{ +public: + + struct Entry + { + T t; + U u; + }; + + EnumMap(Entry *entries, unsigned size) + { + unsigned n = size/sizeof(Entry); + + for (unsigned i = 0; i - -using namespace std; - -namespace love -{ - -Exception::Exception(const char *fmt, ...) -{ - va_list args; - int size_buffer = 256, size_out; - char *buffer; - while (true) - { - buffer = new char[size_buffer]; - memset(buffer, 0, size_buffer); - - va_start(args, fmt); - size_out = vsnprintf(buffer, size_buffer, fmt, args); - va_end(args); - - // see http://perfec.to/vsnprintf/pasprintf.c - // if size_out ... - // == -1 --> output was truncated - // == size_buffer --> output was truncated - // == size_buffer-1 --> ambiguous, /may/ have been truncated - // > size_buffer --> output was truncated, and size_out - // bytes would have been written - if (size_out == size_buffer || size_out == -1 || size_out == size_buffer-1) - size_buffer *= 2; - else if (size_out > size_buffer) - size_buffer = size_out + 2; // to avoid the ambiguous case - else - break; - - delete[] buffer; - } - message = std::string(buffer); - delete[] buffer; -} - -} +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Exception.h" +#include "common/config.h" + +#include + +using namespace std; + +namespace love +{ + +Exception::Exception(const char *fmt, ...) +{ + va_list args; + int size_buffer = 256, size_out; + char *buffer; + while (true) + { + buffer = new char[size_buffer]; + memset(buffer, 0, size_buffer); + + va_start(args, fmt); + size_out = vsnprintf(buffer, size_buffer, fmt, args); + va_end(args); + + // see http://perfec.to/vsnprintf/pasprintf.c + // if size_out ... + // == -1 --> output was truncated + // == size_buffer --> output was truncated + // == size_buffer-1 --> ambiguous, /may/ have been truncated + // > size_buffer --> output was truncated, and size_out + // bytes would have been written + if (size_out == size_buffer || size_out == -1 || size_out == size_buffer-1) + size_buffer *= 2; + else if (size_out > size_buffer) + size_buffer = size_out + 2; // to avoid the ambiguous case + else + break; + + delete[] buffer; + } + message = std::string(buffer); + delete[] buffer; +} + +} diff --git a/src/common/Exception.h b/src/common/Exception.h index 34493919f..0086069c3 100644 --- a/src/common/Exception.h +++ b/src/common/Exception.h @@ -1,67 +1,67 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_EXCEPTION_H -#define LOVE_EXCEPTION_H - -#include -#include // vararg -#include // vsnprintf -#include // strncpy -#include - -namespace love -{ - -/** - * A convenient vararg-enabled exception class. - **/ -class Exception : public std::exception -{ -public: - - /** - * Creates a new Exception according to printf-rules. - * - * See: http://www.cplusplus.com/reference/clibrary/cstdio/printf/ - * - * @param fmt The format string (see printf). - **/ - Exception(const char *fmt, ...); - virtual ~Exception() throw() {} - - /** - * Returns a string containing reason for the exception. - * @return A description of the exception. - **/ - inline virtual const char *what() const throw() - { - return message.c_str(); - } - -private: - - std::string message; - -}; // Exception - -} // love - -#endif // LOVE_EXCEPTION_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_EXCEPTION_H +#define LOVE_EXCEPTION_H + +#include +#include // vararg +#include // vsnprintf +#include // strncpy +#include + +namespace love +{ + +/** + * A convenient vararg-enabled exception class. + **/ +class Exception : public std::exception +{ +public: + + /** + * Creates a new Exception according to printf-rules. + * + * See: http://www.cplusplus.com/reference/clibrary/cstdio/printf/ + * + * @param fmt The format string (see printf). + **/ + Exception(const char *fmt, ...); + virtual ~Exception() throw() {} + + /** + * Returns a string containing reason for the exception. + * @return A description of the exception. + **/ + inline virtual const char *what() const throw() + { + return message.c_str(); + } + +private: + + std::string message; + +}; // Exception + +} // love + +#endif // LOVE_EXCEPTION_H diff --git a/src/common/Matrix.cpp b/src/common/Matrix.cpp index 1547ae484..d329bd602 100644 --- a/src/common/Matrix.cpp +++ b/src/common/Matrix.cpp @@ -1,198 +1,198 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Matrix.h" - -// STD -#include // memcpy -#include - -namespace love -{ - -// | e0 e4 e8 e12 | -// | e1 e5 e9 e13 | -// | e2 e6 e10 e14 | -// | e3 e7 e11 e15 | - -Matrix::Matrix() -{ - setIdentity(); -} - -Matrix::~Matrix() -{ -} - -// | e0 e4 e8 e12 | -// | e1 e5 e9 e13 | -// | e2 e6 e10 e14 | -// | e3 e7 e11 e15 | -// | e0 e4 e8 e12 | -// | e1 e5 e9 e13 | -// | e2 e6 e10 e14 | -// | e3 e7 e11 e15 | - -Matrix Matrix::operator * (const Matrix &m) const -{ - Matrix t; - - t.e[0] = (e[0]*m.e[0]) + (e[4]*m.e[1]) + (e[8]*m.e[2]) + (e[12]*m.e[3]); - t.e[4] = (e[0]*m.e[4]) + (e[4]*m.e[5]) + (e[8]*m.e[6]) + (e[12]*m.e[7]); - t.e[8] = (e[0]*m.e[8]) + (e[4]*m.e[9]) + (e[8]*m.e[10]) + (e[12]*m.e[11]); - t.e[12] = (e[0]*m.e[12]) + (e[4]*m.e[13]) + (e[8]*m.e[14]) + (e[12]*m.e[15]); - - t.e[1] = (e[1]*m.e[0]) + (e[5]*m.e[1]) + (e[9]*m.e[2]) + (e[13]*m.e[3]); - t.e[5] = (e[1]*m.e[4]) + (e[5]*m.e[5]) + (e[9]*m.e[6]) + (e[13]*m.e[7]); - t.e[9] = (e[1]*m.e[8]) + (e[5]*m.e[9]) + (e[9]*m.e[10]) + (e[13]*m.e[11]); - t.e[13] = (e[1]*m.e[12]) + (e[5]*m.e[13]) + (e[9]*m.e[14]) + (e[13]*m.e[15]); - - t.e[2] = (e[2]*m.e[0]) + (e[6]*m.e[1]) + (e[10]*m.e[2]) + (e[14]*m.e[3]); - t.e[6] = (e[2]*m.e[4]) + (e[6]*m.e[5]) + (e[10]*m.e[6]) + (e[14]*m.e[7]); - t.e[10] = (e[2]*m.e[8]) + (e[6]*m.e[9]) + (e[10]*m.e[10]) + (e[14]*m.e[11]); - t.e[14] = (e[2]*m.e[12]) + (e[6]*m.e[13]) + (e[10]*m.e[14]) + (e[14]*m.e[15]); - - t.e[3] = (e[3]*m.e[0]) + (e[7]*m.e[1]) + (e[11]*m.e[2]) + (e[15]*m.e[3]); - t.e[7] = (e[3]*m.e[4]) + (e[7]*m.e[5]) + (e[11]*m.e[6]) + (e[15]*m.e[7]); - t.e[11] = (e[3]*m.e[8]) + (e[7]*m.e[9]) + (e[11]*m.e[10]) + (e[15]*m.e[11]); - t.e[15] = (e[3]*m.e[12]) + (e[7]*m.e[13]) + (e[11]*m.e[14]) + (e[15]*m.e[15]); - - return t; -} - -void Matrix::operator *= (const Matrix &m) -{ - Matrix t = (*this) * m; - memcpy((void *)this->e, (void *)t.e, sizeof(float)*16); -} - -const float *Matrix::getElements() const -{ - return e; -} - -void Matrix::setIdentity() -{ - memset(e, 0, sizeof(float)*16); - e[0] = e[5] = e[10] = e[15] = 1; -} - -void Matrix::setTranslation(float x, float y) -{ - setIdentity(); - e[12] = x; - e[13] = y; -} - -void Matrix::setRotation(float rad) -{ - setIdentity(); - float c = cos(rad), s = sin(rad); - e[0] = c; - e[4] = -s; - e[1] = s; - e[5] = c; -} - -void Matrix::setScale(float sx, float sy) -{ - setIdentity(); - e[0] = sx; - e[5] = sy; -} - -void Matrix::setShear(float kx, float ky) -{ - setIdentity(); - e[1] = ky; - e[4] = kx; -} - -void Matrix::setTransformation(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) -{ - memset(e, 0, sizeof(float)*16); // zero out matrix - float c = cos(angle), s = sin(angle); - // matrix multiplication carried out on paper: - // |1 x| |c -s | |sx | | 1 ky | |1 -ox| - // | 1 y| |s c | | sy | |kx 1 | | 1 -oy| - // | 1 | | 1 | | 1 | | 1 | | 1 | - // | 1| | 1| | 1| | 1| | 1 | - // move rotate scale skew origin - e[10] = e[15] = 1.0f; - e[0] = c * sx - ky * s * sy; // = a - e[1] = s * sx + ky * c * sy; // = b - e[4] = kx * c * sx - s * sy; // = c - e[5] = kx * s * sx + c * sy; // = d - e[12] = x - ox * e[0] - oy * e[4]; - e[13] = y - ox * e[1] - oy * e[5]; -} - -void Matrix::translate(float x, float y) -{ - Matrix t; - t.setTranslation(x, y); - this->operator *=(t); -} - -void Matrix::rotate(float rad) -{ - Matrix t; - t.setRotation(rad); - this->operator *=(t); -} - -void Matrix::scale(float sx, float sy) -{ - Matrix t; - t.setScale(sx, sy); - this->operator *=(t); -} - -void Matrix::shear(float kx, float ky) -{ - Matrix t; - t.setShear(kx,ky); - this->operator *=(t); -} - -// | x | -// | y | -// | 0 | -// | 1 | -// | e0 e4 e8 e12 | -// | e1 e5 e9 e13 | -// | e2 e6 e10 e14 | -// | e3 e7 e11 e15 | - -void Matrix::transform(vertex *dst, const vertex *src, int size) const -{ - for (int i = 0; i // memcpy +#include + +namespace love +{ + +// | e0 e4 e8 e12 | +// | e1 e5 e9 e13 | +// | e2 e6 e10 e14 | +// | e3 e7 e11 e15 | + +Matrix::Matrix() +{ + setIdentity(); +} + +Matrix::~Matrix() +{ +} + +// | e0 e4 e8 e12 | +// | e1 e5 e9 e13 | +// | e2 e6 e10 e14 | +// | e3 e7 e11 e15 | +// | e0 e4 e8 e12 | +// | e1 e5 e9 e13 | +// | e2 e6 e10 e14 | +// | e3 e7 e11 e15 | + +Matrix Matrix::operator * (const Matrix &m) const +{ + Matrix t; + + t.e[0] = (e[0]*m.e[0]) + (e[4]*m.e[1]) + (e[8]*m.e[2]) + (e[12]*m.e[3]); + t.e[4] = (e[0]*m.e[4]) + (e[4]*m.e[5]) + (e[8]*m.e[6]) + (e[12]*m.e[7]); + t.e[8] = (e[0]*m.e[8]) + (e[4]*m.e[9]) + (e[8]*m.e[10]) + (e[12]*m.e[11]); + t.e[12] = (e[0]*m.e[12]) + (e[4]*m.e[13]) + (e[8]*m.e[14]) + (e[12]*m.e[15]); + + t.e[1] = (e[1]*m.e[0]) + (e[5]*m.e[1]) + (e[9]*m.e[2]) + (e[13]*m.e[3]); + t.e[5] = (e[1]*m.e[4]) + (e[5]*m.e[5]) + (e[9]*m.e[6]) + (e[13]*m.e[7]); + t.e[9] = (e[1]*m.e[8]) + (e[5]*m.e[9]) + (e[9]*m.e[10]) + (e[13]*m.e[11]); + t.e[13] = (e[1]*m.e[12]) + (e[5]*m.e[13]) + (e[9]*m.e[14]) + (e[13]*m.e[15]); + + t.e[2] = (e[2]*m.e[0]) + (e[6]*m.e[1]) + (e[10]*m.e[2]) + (e[14]*m.e[3]); + t.e[6] = (e[2]*m.e[4]) + (e[6]*m.e[5]) + (e[10]*m.e[6]) + (e[14]*m.e[7]); + t.e[10] = (e[2]*m.e[8]) + (e[6]*m.e[9]) + (e[10]*m.e[10]) + (e[14]*m.e[11]); + t.e[14] = (e[2]*m.e[12]) + (e[6]*m.e[13]) + (e[10]*m.e[14]) + (e[14]*m.e[15]); + + t.e[3] = (e[3]*m.e[0]) + (e[7]*m.e[1]) + (e[11]*m.e[2]) + (e[15]*m.e[3]); + t.e[7] = (e[3]*m.e[4]) + (e[7]*m.e[5]) + (e[11]*m.e[6]) + (e[15]*m.e[7]); + t.e[11] = (e[3]*m.e[8]) + (e[7]*m.e[9]) + (e[11]*m.e[10]) + (e[15]*m.e[11]); + t.e[15] = (e[3]*m.e[12]) + (e[7]*m.e[13]) + (e[11]*m.e[14]) + (e[15]*m.e[15]); + + return t; +} + +void Matrix::operator *= (const Matrix &m) +{ + Matrix t = (*this) * m; + memcpy((void *)this->e, (void *)t.e, sizeof(float)*16); +} + +const float *Matrix::getElements() const +{ + return e; +} + +void Matrix::setIdentity() +{ + memset(e, 0, sizeof(float)*16); + e[0] = e[5] = e[10] = e[15] = 1; +} + +void Matrix::setTranslation(float x, float y) +{ + setIdentity(); + e[12] = x; + e[13] = y; +} + +void Matrix::setRotation(float rad) +{ + setIdentity(); + float c = cos(rad), s = sin(rad); + e[0] = c; + e[4] = -s; + e[1] = s; + e[5] = c; +} + +void Matrix::setScale(float sx, float sy) +{ + setIdentity(); + e[0] = sx; + e[5] = sy; +} + +void Matrix::setShear(float kx, float ky) +{ + setIdentity(); + e[1] = ky; + e[4] = kx; +} + +void Matrix::setTransformation(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) +{ + memset(e, 0, sizeof(float)*16); // zero out matrix + float c = cos(angle), s = sin(angle); + // matrix multiplication carried out on paper: + // |1 x| |c -s | |sx | | 1 ky | |1 -ox| + // | 1 y| |s c | | sy | |kx 1 | | 1 -oy| + // | 1 | | 1 | | 1 | | 1 | | 1 | + // | 1| | 1| | 1| | 1| | 1 | + // move rotate scale skew origin + e[10] = e[15] = 1.0f; + e[0] = c * sx - ky * s * sy; // = a + e[1] = s * sx + ky * c * sy; // = b + e[4] = kx * c * sx - s * sy; // = c + e[5] = kx * s * sx + c * sy; // = d + e[12] = x - ox * e[0] - oy * e[4]; + e[13] = y - ox * e[1] - oy * e[5]; +} + +void Matrix::translate(float x, float y) +{ + Matrix t; + t.setTranslation(x, y); + this->operator *=(t); +} + +void Matrix::rotate(float rad) +{ + Matrix t; + t.setRotation(rad); + this->operator *=(t); +} + +void Matrix::scale(float sx, float sy) +{ + Matrix t; + t.setScale(sx, sy); + this->operator *=(t); +} + +void Matrix::shear(float kx, float ky) +{ + Matrix t; + t.setShear(kx,ky); + this->operator *=(t); +} + +// | x | +// | y | +// | 0 | +// | 1 | +// | e0 e4 e8 e12 | +// | e1 e5 e9 e13 | +// | e2 e6 e10 e14 | +// | e3 e7 e11 e15 | + +void Matrix::transform(vertex *dst, const vertex *src, int size) const +{ + for (int i = 0; i - -namespace love -{ - -std::map Memoizer::objectMap; - -void Memoizer::add(void *key, void *val) -{ - objectMap[key] = val; -} - -void Memoizer::remove(void *key) -{ - objectMap.erase(key); -} - -void *Memoizer::find(void *key) -{ - if (objectMap.count(key)) return objectMap[key]; - return NULL; -} - -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Memoizer.h" +#include + +namespace love +{ + +std::map Memoizer::objectMap; + +void Memoizer::add(void *key, void *val) +{ + objectMap[key] = val; +} + +void Memoizer::remove(void *key) +{ + objectMap.erase(key); +} + +void *Memoizer::find(void *key) +{ + if (objectMap.count(key)) return objectMap[key]; + return NULL; +} + +} // love diff --git a/src/common/Memoizer.h b/src/common/Memoizer.h index 9944431f0..4522d35be 100644 --- a/src/common/Memoizer.h +++ b/src/common/Memoizer.h @@ -1,46 +1,46 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_MEMOIZER_H -#define LOVE_MEMOIZER_H - -#include - -namespace love -{ - -class Memoizer -{ -public: - - static void add(void *key, void *val); - - static void remove(void *key); - - static void *find(void *key); - -private: - - static std::map objectMap; -}; // Memoizer - -} // love - -#endif // LOVE_MEMOIZER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_MEMOIZER_H +#define LOVE_MEMOIZER_H + +#include + +namespace love +{ + +class Memoizer +{ +public: + + static void add(void *key, void *val); + + static void remove(void *key); + + static void *find(void *key); + +private: + + static std::map objectMap; +}; // Memoizer + +} // love + +#endif // LOVE_MEMOIZER_H diff --git a/src/common/Module.h b/src/common/Module.h index 8129cea4d..a1f98711a 100644 --- a/src/common/Module.h +++ b/src/common/Module.h @@ -1,55 +1,55 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_MODULE_H -#define LOVE_MODULE_H - -// LOVE -#include "runtime.h" -#include "Exception.h" -#include "Object.h" - -namespace love -{ -/** - * Abstract superclass for all modules. - **/ -class Module : public Object -{ -public: - - /** - * Destructor. - **/ - virtual ~Module() {}; - - /** - * Gets the name of the module. This is used in case of errors - * and other messages. - * - * @return The full name of the module, eg. love.graphics.opengl. - **/ - virtual const char *getName() const = 0; - -}; // Module - -} // love - -#endif // LOVE_MODULE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_MODULE_H +#define LOVE_MODULE_H + +// LOVE +#include "runtime.h" +#include "Exception.h" +#include "Object.h" + +namespace love +{ +/** + * Abstract superclass for all modules. + **/ +class Module : public Object +{ +public: + + /** + * Destructor. + **/ + virtual ~Module() {}; + + /** + * Gets the name of the module. This is used in case of errors + * and other messages. + * + * @return The full name of the module, eg. love.graphics.opengl. + **/ + virtual const char *getName() const = 0; + +}; // Module + +} // love + +#endif // LOVE_MODULE_H diff --git a/src/common/Object.cpp b/src/common/Object.cpp index b71ec096e..d227cbe5c 100644 --- a/src/common/Object.cpp +++ b/src/common/Object.cpp @@ -1,52 +1,52 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "Object.h" - -namespace love -{ - -Object::Object() - : count(1) -{ -} - -Object::~Object() -{ -} - -int Object::getReferenceCount() const -{ - return count; -} - -void Object::retain() -{ - ++count; -} - -void Object::release() -{ - if (--count <= 0) - delete this; -} - -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "Object.h" + +namespace love +{ + +Object::Object() + : count(1) +{ +} + +Object::~Object() +{ +} + +int Object::getReferenceCount() const +{ + return count; +} + +void Object::retain() +{ + ++count; +} + +void Object::release() +{ + if (--count <= 0) + delete this; +} + +} // love diff --git a/src/common/Object.h b/src/common/Object.h index 8bc8672bf..00ba9230a 100644 --- a/src/common/Object.h +++ b/src/common/Object.h @@ -1,76 +1,76 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_OBJECT_H -#define LOVE_OBJECT_H - -namespace love -{ - -/** - * Superclass for all object that should be able to cross the Lua/C border - * (this pertains to most objects). - * - * This class is an alternative to using smart pointers; it contains retain/release - * methods, and will delete itself with the reference count hits zero. The wrapper - * code assumes that all userdata inherits from this class. - **/ -class Object -{ -public: - - /** - * Constructor. Sets reference count to one. - **/ - Object(); - - /** - * Destructor. - **/ - virtual ~Object() = 0; - - /** - * Gets the reference count of this Object. - * @returns The reference count. - **/ - int getReferenceCount() const; - - /** - * Retains the Object, i.e. increases the - * reference count by one. - **/ - void retain(); - - /** - * Releases one reference to the Object, i.e. decrements the - * reference count by one, and potentially deletes the Object - * if there are no more references. - **/ - void release(); - -private: - - // The reference count. - int count; -}; // Object - -} // love - -#endif // LOVE_OBJECT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_OBJECT_H +#define LOVE_OBJECT_H + +namespace love +{ + +/** + * Superclass for all object that should be able to cross the Lua/C border + * (this pertains to most objects). + * + * This class is an alternative to using smart pointers; it contains retain/release + * methods, and will delete itself with the reference count hits zero. The wrapper + * code assumes that all userdata inherits from this class. + **/ +class Object +{ +public: + + /** + * Constructor. Sets reference count to one. + **/ + Object(); + + /** + * Destructor. + **/ + virtual ~Object() = 0; + + /** + * Gets the reference count of this Object. + * @returns The reference count. + **/ + int getReferenceCount() const; + + /** + * Retains the Object, i.e. increases the + * reference count by one. + **/ + void retain(); + + /** + * Releases one reference to the Object, i.e. decrements the + * reference count by one, and potentially deletes the Object + * if there are no more references. + **/ + void release(); + +private: + + // The reference count. + int count; +}; // Object + +} // love + +#endif // LOVE_OBJECT_H diff --git a/src/common/Reference.cpp b/src/common/Reference.cpp index c4861ab34..25b552d04 100644 --- a/src/common/Reference.cpp +++ b/src/common/Reference.cpp @@ -1,82 +1,82 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Reference.h" - -namespace love -{ - -const char REFERENCE_TABLE_NAME[] = "love-references"; - -Reference::Reference() - : L(0), idx(LUA_REFNIL) -{ -} - -Reference::Reference(lua_State *L) - : L(0), idx(LUA_REFNIL) -{ - ref(L); -} - -Reference::~Reference() -{ - unref(); -} - -void Reference::ref(lua_State *L) -{ - unref(); // Just to be safe. - this->L = L; - luax_insist(L, LUA_REGISTRYINDEX, REFERENCE_TABLE_NAME); - lua_insert(L, -2); // Move reference table behind value. - idx = luaL_ref(L, -2); - lua_pop(L, 1); -} - -void Reference::unref() -{ - if (idx != LUA_REFNIL) - { - luax_insist(L, LUA_REGISTRYINDEX, REFERENCE_TABLE_NAME); - luaL_unref(L, -1, idx); - lua_pop(L, 1); - idx = LUA_REFNIL; - } -} - -void Reference::push() -{ - if (idx != LUA_REFNIL) - { - luax_insist(L, LUA_REGISTRYINDEX, REFERENCE_TABLE_NAME); - lua_rawgeti(L, -1, idx); - lua_remove(L, -2); - } - else - lua_pushnil(L); -} - -lua_State *Reference::getL() -{ - return L; -} - -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Reference.h" + +namespace love +{ + +const char REFERENCE_TABLE_NAME[] = "love-references"; + +Reference::Reference() + : L(0), idx(LUA_REFNIL) +{ +} + +Reference::Reference(lua_State *L) + : L(0), idx(LUA_REFNIL) +{ + ref(L); +} + +Reference::~Reference() +{ + unref(); +} + +void Reference::ref(lua_State *L) +{ + unref(); // Just to be safe. + this->L = L; + luax_insist(L, LUA_REGISTRYINDEX, REFERENCE_TABLE_NAME); + lua_insert(L, -2); // Move reference table behind value. + idx = luaL_ref(L, -2); + lua_pop(L, 1); +} + +void Reference::unref() +{ + if (idx != LUA_REFNIL) + { + luax_insist(L, LUA_REGISTRYINDEX, REFERENCE_TABLE_NAME); + luaL_unref(L, -1, idx); + lua_pop(L, 1); + idx = LUA_REFNIL; + } +} + +void Reference::push() +{ + if (idx != LUA_REFNIL) + { + luax_insist(L, LUA_REGISTRYINDEX, REFERENCE_TABLE_NAME); + lua_rawgeti(L, -1, idx); + lua_remove(L, -2); + } + else + lua_pushnil(L); +} + +lua_State *Reference::getL() +{ + return L; +} + +} // love diff --git a/src/common/Reference.h b/src/common/Reference.h index e20e67d40..d4ba13c9e 100644 --- a/src/common/Reference.h +++ b/src/common/Reference.h @@ -1,88 +1,88 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_REFERENCE_H -#define LOVE_REFERENCE_H - -// LOVE -#include "runtime.h" - -namespace love -{ - -/** - * This class wraps the reference functionality built into - * Lua, which allows C++ code to refer to Lua variables. - **/ -class Reference -{ -public: - - /** - * Creates the reference object, but does not create - * the actual reference. - **/ - Reference(); - - /** - * Creates the object and a reference to the value - * on the top of the stack. - **/ - Reference(lua_State *L); - - /** - * Deletes the reference, if any. - **/ - virtual ~Reference(); - - /** - * Creates a reference to the value on the - * top of the stack. - **/ - void ref(lua_State *L); - - /** - * Unrefs the reference, if any. - **/ - void unref(); - - /** - * Pushes the referred value onto the stack. - **/ - void push(); - - /** - * Gets the Lua state associated with this - * reference. - **/ - lua_State *getL(); - -private: - - // The Lua state in which the reference resides. - lua_State *L; - - // Index to the Lua reference. - int idx; -}; - -} // love - -#endif // LOVE_REFERENCE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_REFERENCE_H +#define LOVE_REFERENCE_H + +// LOVE +#include "runtime.h" + +namespace love +{ + +/** + * This class wraps the reference functionality built into + * Lua, which allows C++ code to refer to Lua variables. + **/ +class Reference +{ +public: + + /** + * Creates the reference object, but does not create + * the actual reference. + **/ + Reference(); + + /** + * Creates the object and a reference to the value + * on the top of the stack. + **/ + Reference(lua_State *L); + + /** + * Deletes the reference, if any. + **/ + virtual ~Reference(); + + /** + * Creates a reference to the value on the + * top of the stack. + **/ + void ref(lua_State *L); + + /** + * Unrefs the reference, if any. + **/ + void unref(); + + /** + * Pushes the referred value onto the stack. + **/ + void push(); + + /** + * Gets the Lua state associated with this + * reference. + **/ + lua_State *getL(); + +private: + + // The Lua state in which the reference resides. + lua_State *L; + + // Index to the Lua reference. + int idx; +}; + +} // love + +#endif // LOVE_REFERENCE_H diff --git a/src/common/StringMap.h b/src/common/StringMap.h index 9d54d430a..f83bbc7b4 100644 --- a/src/common/StringMap.h +++ b/src/common/StringMap.h @@ -1,168 +1,168 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_STRING_MAP_H -#define LOVE_STRING_MAP_H - -#include "Exception.h" - -namespace love -{ - -template -class StringMap -{ -public: - - struct Entry - { - const char *key; - T value; - }; - - StringMap(Entry *entries, unsigned num) - { - - for (unsigned i = 0; i < SIZE; ++i) - reverse[i] = 0; - - unsigned n = num/sizeof(Entry); - - for (unsigned i = 0; i < n; ++i) - { - add(entries[i].key, entries[i].value); - } - } - - bool streq(const char *a, const char *b) - { - while (*a != 0 && *b != 0) - { - if (*a != *b) - return false; - ++a; - ++b; - } - - return (*a == 0 && *b == 0); - } - - bool find(const char *key, T &t) - { - unsigned str_hash = djb2(key); - - for (unsigned i = 0; i < MAX; ++i) - { - unsigned str_i = (str_hash + i) % MAX; //this isn't used, is this intentional? - - if (!records[str_i].set) - return false; - - if (streq(records[str_i].key, key)) - { - t = records[str_i].value; - return true; - } - } - - return false; - } - - bool find(T key, const char *&str) - { - unsigned index = (unsigned)key; - - if (index >= SIZE) - return false; - - if (reverse[index] != 0) - { - str = reverse[index]; - return true; - } - else - { - return false; - } - } - - bool add(const char *key, T value) - { - unsigned str_hash = djb2(key); - bool inserted = false; - - for (unsigned i = 0; i < MAX; ++i) - { - unsigned str_i = (str_hash + i) % MAX; - - if (!records[str_i].set) - { - inserted = true; - records[str_i].set = true; - records[str_i].key = key; - records[str_i].value = value; - break; - } - } - - unsigned index = (unsigned)value; - - if (index >= SIZE) - { - printf("\nConstant %s out of bounds with %i!\n", key, index); - return false; - } - - reverse[index] = key; - - return inserted; - } - - unsigned djb2(const char *key) - { - unsigned hash = 5381; - int c; - - while ((c = *key++)) - hash = ((hash << 5) + hash) + c; - - return hash; - } - -private: - - struct Record - { - const char *key; - T value; - bool set; - Record() : set(false) {} - }; - - const static unsigned MAX = SIZE*2; - - Record records[MAX]; - const char *reverse[SIZE]; - -}; // StringMap - -} // love - -#endif // LOVE_STRING_MAP_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_STRING_MAP_H +#define LOVE_STRING_MAP_H + +#include "Exception.h" + +namespace love +{ + +template +class StringMap +{ +public: + + struct Entry + { + const char *key; + T value; + }; + + StringMap(Entry *entries, unsigned num) + { + + for (unsigned i = 0; i < SIZE; ++i) + reverse[i] = 0; + + unsigned n = num/sizeof(Entry); + + for (unsigned i = 0; i < n; ++i) + { + add(entries[i].key, entries[i].value); + } + } + + bool streq(const char *a, const char *b) + { + while (*a != 0 && *b != 0) + { + if (*a != *b) + return false; + ++a; + ++b; + } + + return (*a == 0 && *b == 0); + } + + bool find(const char *key, T &t) + { + unsigned str_hash = djb2(key); + + for (unsigned i = 0; i < MAX; ++i) + { + unsigned str_i = (str_hash + i) % MAX; //this isn't used, is this intentional? + + if (!records[str_i].set) + return false; + + if (streq(records[str_i].key, key)) + { + t = records[str_i].value; + return true; + } + } + + return false; + } + + bool find(T key, const char *&str) + { + unsigned index = (unsigned)key; + + if (index >= SIZE) + return false; + + if (reverse[index] != 0) + { + str = reverse[index]; + return true; + } + else + { + return false; + } + } + + bool add(const char *key, T value) + { + unsigned str_hash = djb2(key); + bool inserted = false; + + for (unsigned i = 0; i < MAX; ++i) + { + unsigned str_i = (str_hash + i) % MAX; + + if (!records[str_i].set) + { + inserted = true; + records[str_i].set = true; + records[str_i].key = key; + records[str_i].value = value; + break; + } + } + + unsigned index = (unsigned)value; + + if (index >= SIZE) + { + printf("\nConstant %s out of bounds with %i!\n", key, index); + return false; + } + + reverse[index] = key; + + return inserted; + } + + unsigned djb2(const char *key) + { + unsigned hash = 5381; + int c; + + while ((c = *key++)) + hash = ((hash << 5) + hash) + c; + + return hash; + } + +private: + + struct Record + { + const char *key; + T value; + bool set; + Record() : set(false) {} + }; + + const static unsigned MAX = SIZE*2; + + Record records[MAX]; + const char *reverse[SIZE]; + +}; // StringMap + +} // love + +#endif // LOVE_STRING_MAP_H diff --git a/src/common/Variant.cpp b/src/common/Variant.cpp index 94dd45dae..ca73499a4 100644 --- a/src/common/Variant.cpp +++ b/src/common/Variant.cpp @@ -1,175 +1,175 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Variant.h" -#include "common/StringMap.h" - -namespace love -{ - -extern StringMap types; - -love::Type extractudatatype(lua_State *L, int idx) -{ - Type t = INVALID_ID; - if (!lua_isuserdata(L, idx)) - return t; - if (luaL_getmetafield(L, idx, "__tostring") == 0) - return t; - lua_pushvalue(L, idx); - int result = lua_pcall(L, 1, 1, 0); - if (result == 0) - types.find(lua_tostring(L, -1), t); - if (result == 0 || result == LUA_ERRRUN) - lua_pop(L, 1); - return t; -} - -Variant::Variant(bool boolean) -{ - type = BOOLEAN; - data.boolean = boolean; -} - -Variant::Variant(double number) -{ - type = NUMBER; - data.number = number; -} - -Variant::Variant(const char *string, size_t len) -{ - type = STRING; - char *buf = new char[len+1]; - memset(buf, 0, len+1); - memcpy(buf, string, len); - data.string.str = buf; - data.string.len = len; -} - -Variant::Variant(char c) -{ - type = CHARACTER; - data.character = c; -} - -Variant::Variant(void *userdata) -{ - type = LUSERDATA; - data.userdata = userdata; -} - -Variant::Variant(love::Type udatatype, void *userdata) -{ - type = FUSERDATA; - this->udatatype = udatatype; - if (udatatype != INVALID_ID) - { - Proxy *p = (Proxy *) userdata; - flags = p->flags; - data.userdata = p->data; - ((love::Object *) data.userdata)->retain(); - } - else - data.userdata = userdata; -} - -Variant::~Variant() -{ - switch (type) - { - case STRING: - delete[] data.string.str; - break; - case FUSERDATA: - ((love::Object *) data.userdata)->release(); - break; - default: - break; - } -} - -Variant *Variant::fromLua(lua_State *L, int n) -{ - Variant *v = NULL; - size_t len; - const char *str; - switch (lua_type(L, n)) - { - case LUA_TBOOLEAN: - v = new Variant(luax_toboolean(L, n)); - break; - case LUA_TNUMBER: - v = new Variant(lua_tonumber(L, n)); - break; - case LUA_TSTRING: - str = lua_tolstring(L, n, &len); - v = new Variant(str, len); - break; - case LUA_TLIGHTUSERDATA: - v = new Variant(lua_touserdata(L, n)); - break; - case LUA_TUSERDATA: - v = new Variant(extractudatatype(L, n), lua_touserdata(L, n)); - break; - } - return v; -} - -void Variant::toLua(lua_State *L) -{ - switch (type) - { - case BOOLEAN: - lua_pushboolean(L, data.boolean); - break; - case CHARACTER: - lua_pushlstring(L, &data.character, 1); - break; - case NUMBER: - lua_pushnumber(L, data.number); - break; - case STRING: - lua_pushlstring(L, data.string.str, data.string.len); - break; - case LUSERDATA: - lua_pushlightuserdata(L, data.userdata); - break; - case FUSERDATA: - if (udatatype != INVALID_ID) - { - const char *name = NULL; - love::types.find(udatatype, name); - ((love::Object *) data.userdata)->retain(); - luax_newtype(L, name, flags, data.userdata); - } - else - lua_pushlightuserdata(L, data.userdata); - // I know this is not the same - // sadly, however, it's the most - // I can do (at the moment). - break; - default: - lua_pushnil(L); - break; - } -} - -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Variant.h" +#include "common/StringMap.h" + +namespace love +{ + +extern StringMap types; + +love::Type extractudatatype(lua_State *L, int idx) +{ + Type t = INVALID_ID; + if (!lua_isuserdata(L, idx)) + return t; + if (luaL_getmetafield(L, idx, "__tostring") == 0) + return t; + lua_pushvalue(L, idx); + int result = lua_pcall(L, 1, 1, 0); + if (result == 0) + types.find(lua_tostring(L, -1), t); + if (result == 0 || result == LUA_ERRRUN) + lua_pop(L, 1); + return t; +} + +Variant::Variant(bool boolean) +{ + type = BOOLEAN; + data.boolean = boolean; +} + +Variant::Variant(double number) +{ + type = NUMBER; + data.number = number; +} + +Variant::Variant(const char *string, size_t len) +{ + type = STRING; + char *buf = new char[len+1]; + memset(buf, 0, len+1); + memcpy(buf, string, len); + data.string.str = buf; + data.string.len = len; +} + +Variant::Variant(char c) +{ + type = CHARACTER; + data.character = c; +} + +Variant::Variant(void *userdata) +{ + type = LUSERDATA; + data.userdata = userdata; +} + +Variant::Variant(love::Type udatatype, void *userdata) +{ + type = FUSERDATA; + this->udatatype = udatatype; + if (udatatype != INVALID_ID) + { + Proxy *p = (Proxy *) userdata; + flags = p->flags; + data.userdata = p->data; + ((love::Object *) data.userdata)->retain(); + } + else + data.userdata = userdata; +} + +Variant::~Variant() +{ + switch (type) + { + case STRING: + delete[] data.string.str; + break; + case FUSERDATA: + ((love::Object *) data.userdata)->release(); + break; + default: + break; + } +} + +Variant *Variant::fromLua(lua_State *L, int n) +{ + Variant *v = NULL; + size_t len; + const char *str; + switch (lua_type(L, n)) + { + case LUA_TBOOLEAN: + v = new Variant(luax_toboolean(L, n)); + break; + case LUA_TNUMBER: + v = new Variant(lua_tonumber(L, n)); + break; + case LUA_TSTRING: + str = lua_tolstring(L, n, &len); + v = new Variant(str, len); + break; + case LUA_TLIGHTUSERDATA: + v = new Variant(lua_touserdata(L, n)); + break; + case LUA_TUSERDATA: + v = new Variant(extractudatatype(L, n), lua_touserdata(L, n)); + break; + } + return v; +} + +void Variant::toLua(lua_State *L) +{ + switch (type) + { + case BOOLEAN: + lua_pushboolean(L, data.boolean); + break; + case CHARACTER: + lua_pushlstring(L, &data.character, 1); + break; + case NUMBER: + lua_pushnumber(L, data.number); + break; + case STRING: + lua_pushlstring(L, data.string.str, data.string.len); + break; + case LUSERDATA: + lua_pushlightuserdata(L, data.userdata); + break; + case FUSERDATA: + if (udatatype != INVALID_ID) + { + const char *name = NULL; + love::types.find(udatatype, name); + ((love::Object *) data.userdata)->retain(); + luax_newtype(L, name, flags, data.userdata); + } + else + lua_pushlightuserdata(L, data.userdata); + // I know this is not the same + // sadly, however, it's the most + // I can do (at the moment). + break; + default: + lua_pushnil(L); + break; + } +} + +} // love diff --git a/src/common/Variant.h b/src/common/Variant.h index b3f0f42e1..da9d11921 100644 --- a/src/common/Variant.h +++ b/src/common/Variant.h @@ -1,76 +1,76 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_VARIANT_H -#define LOVE_VARIANT_H - -#include "common/runtime.h" -#include "common/Object.h" - -#include - -namespace love -{ - -class Variant : public love::Object -{ -public: - - Variant(bool boolean); - Variant(double number); - Variant(const char *string, size_t len); - Variant(char c); - Variant(void *userdata); - Variant(love::Type udatatype, void *userdata); - virtual ~Variant(); - - static Variant *fromLua(lua_State *L, int n); - void toLua(lua_State *L); - -private: - enum Type - { - UNKNOWN = 0, - BOOLEAN, - NUMBER, - CHARACTER, - STRING, - LUSERDATA, - FUSERDATA - } type; - union - { - bool boolean; - char character; - double number; - struct - { - const char *str; - size_t len; - } string; - void *userdata; - } data; - love::Type udatatype; - bits flags; - -}; // Variant -} // love - -#endif // LOVE_VARIANT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_VARIANT_H +#define LOVE_VARIANT_H + +#include "common/runtime.h" +#include "common/Object.h" + +#include + +namespace love +{ + +class Variant : public love::Object +{ +public: + + Variant(bool boolean); + Variant(double number); + Variant(const char *string, size_t len); + Variant(char c); + Variant(void *userdata); + Variant(love::Type udatatype, void *userdata); + virtual ~Variant(); + + static Variant *fromLua(lua_State *L, int n); + void toLua(lua_State *L); + +private: + enum Type + { + UNKNOWN = 0, + BOOLEAN, + NUMBER, + CHARACTER, + STRING, + LUSERDATA, + FUSERDATA + } type; + union + { + bool boolean; + char character; + double number; + struct + { + const char *str; + size_t len; + } string; + void *userdata; + } data; + love::Type udatatype; + bits flags; + +}; // Variant +} // love + +#endif // LOVE_VARIANT_H diff --git a/src/common/Vector.cpp b/src/common/Vector.cpp index 77ac2e998..870fa737a 100644 --- a/src/common/Vector.cpp +++ b/src/common/Vector.cpp @@ -1,26 +1,26 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Vector.h" - -namespace love -{ -// Implementation in header. +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Vector.h" + +namespace love +{ +// Implementation in header. } \ No newline at end of file diff --git a/src/common/Vector.h b/src/common/Vector.h index 2aaa77fb2..86a677616 100644 --- a/src/common/Vector.h +++ b/src/common/Vector.h @@ -1,311 +1,311 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_VECTOR_H -#define LOVE_VECTOR_H - -// STD -#include - -// LOVE -#include "Matrix.h" - -namespace love -{ - -/** - * 2D Vector class. - * - * @author Anders Ruud - * @date 2006-05-13 - **/ -class Vector -{ -public: - - // The components. - float x, y; - - /** - * Creates a new (1,1) Vector. - **/ - Vector(); - - /** - * Creates a new Vector. - * @param x The x position/dimension. - * @param y The y position/dimension. - **/ - Vector(float x, float y); - - /** - * Gets the length of the Vector. - * @return The length of the Vector. - * - * This method requires sqrt() and should be used - * carefully. - **/ - float getLength() const; - - /** - * Normalizes the Vector. - * @return The old length of the Vector. - **/ - float normalize(); - - /** - * Gets a normal to the Vector. - * @return A normal to the Vector. - **/ - - Vector getNormal() const; - - /** - * Adds a Vector to this Vector. - * @param v The Vector we want to add to this Vector. - * @return The resulting Vector. - **/ - Vector operator + (const Vector &v) const; - - /** - * Substracts a Vector to this Vector. - * @param v The Vector we want to subtract to this Vector. - * @return The resulting Vector. - **/ - Vector operator - (const Vector &v) const; - - /** - * Resizes a Vector by a scalar. - * @param s The scalar with which to resize the Vector. - * @return The resulting Vector. - **/ - Vector operator * (float s) const; - - /** - * Resizes a Vector by a scalar. - * @param s The scalar with which to resize the Vector. - * @return The resulting Vector. - **/ - Vector operator / (float s) const; - - /** - * Reverses the Vector. - * @return The reversed Vector. - **/ - Vector operator - () const; - - /** - * Adds a Vector to this Vector, and also saves changes in the first Vector. - * @param v The Vector we want to add to this Vector. - **/ - void operator += (const Vector &v); - - /** - * Subtracts a Vector to this Vector, and also saves changes in the first Vector. - * @param v The Vector we want to subtract to this Vector. - **/ - void operator -= (const Vector &v); - - /** - * Resizes the Vector, and also saves changes in the first Vector. - * @param s The scalar by which we want to resize the Vector. - **/ - void operator *= (float s); - - /** - * Resizes the Vector, and also saves changes in the first Vector. - * @param s The scalar by which we want to resize the Vector. - **/ - void operator /= (float s); - - /** - * Calculates the dot product of two Vectors. - * @return The dot product of the two Vectors. - **/ - float operator * (const Vector &v) const; - - /** - * Calculates the cross product of two Vectors. - * @return The cross product of the two Vectors. - **/ - float operator ^ (const Vector &v) const; - - bool operator == (const Vector &v) const; - - bool operator < (const Vector &v) const; - /** - * Gets the x value of the Vector. - * @return The x value of the Vector. - **/ - float getX() const; - - /** - * Gets the x value of the Vector. - * @return The x value of the Vector. - **/ - float getY() const; - - /** - * Sets the x value of the Vector. - * @param The x value of the Vector. - **/ - void setX(float x); - - /** - * Sets the x value of the Vector. - * @param The x value of the Vector. - **/ - void setY(float y); - -}; - -inline float Vector::getLength() const -{ - return sqrt(x*x + y*y); -} - -inline Vector Vector::getNormal() const -{ - return Vector(-y, x); -} - -inline float Vector::normalize() -{ - - float len = getLength(); - - if (len > 0) - (*this) /= len; - - return len; -} - -/** - * Inline methods must have body in header. - **/ - -inline Vector::Vector() -{ - x = 1; - y = 1; -} - -inline Vector::Vector(float x, float y) -{ - this->x = x; - this->y = y; -} - -inline Vector Vector::operator + (const Vector &v) const -{ - return Vector(x + v.x, y + v.y); -} - -inline Vector Vector::operator - (const Vector &v) const -{ - return Vector(x - v.getX(), y - v.getY()); -} - -inline Vector Vector::operator * (float s) const -{ - return Vector(x*s, y*s); -} - -inline Vector Vector::operator / (float s) const -{ - return Vector(x/s, y/s); -} - -inline Vector Vector::operator - () const -{ - return Vector(-x, -y); -} - -inline void Vector::operator += (const Vector &v) -{ - x += v.getX(); - y += v.getY(); -} - -inline void Vector::operator -= (const Vector &v) -{ - x -= v.getX(); - y -= v.getY(); -} - -inline void Vector::operator *= (float s) -{ - x *= s; - y *= s; -} - -inline void Vector::operator /= (float s) -{ - x /= s; - y /= s; -} - -inline float Vector::operator * (const Vector &v) const -{ - return x * v.getX() + y * v.getY(); -} - -inline float Vector::operator ^ (const Vector &v) const -{ - return x * v.getY() - y * v.getX(); -} - -inline bool Vector::operator == (const Vector &v) const -{ - return getLength() == v.getLength(); -} - -inline bool Vector::operator < (const Vector &v) const -{ - return getLength() < v.getLength(); -} - -/** - * Accessor methods - **/ - -inline float Vector::getX() const -{ - return x; -} - -inline float Vector::getY() const -{ - return y; -} - -inline void Vector::setX(float x) -{ - this->x = x; -} - -inline void Vector::setY(float y) -{ - this->y = y; -} - -} //love - -#endif// LOVE_VECTOR_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_VECTOR_H +#define LOVE_VECTOR_H + +// STD +#include + +// LOVE +#include "Matrix.h" + +namespace love +{ + +/** + * 2D Vector class. + * + * @author Anders Ruud + * @date 2006-05-13 + **/ +class Vector +{ +public: + + // The components. + float x, y; + + /** + * Creates a new (1,1) Vector. + **/ + Vector(); + + /** + * Creates a new Vector. + * @param x The x position/dimension. + * @param y The y position/dimension. + **/ + Vector(float x, float y); + + /** + * Gets the length of the Vector. + * @return The length of the Vector. + * + * This method requires sqrt() and should be used + * carefully. + **/ + float getLength() const; + + /** + * Normalizes the Vector. + * @return The old length of the Vector. + **/ + float normalize(); + + /** + * Gets a normal to the Vector. + * @return A normal to the Vector. + **/ + + Vector getNormal() const; + + /** + * Adds a Vector to this Vector. + * @param v The Vector we want to add to this Vector. + * @return The resulting Vector. + **/ + Vector operator + (const Vector &v) const; + + /** + * Substracts a Vector to this Vector. + * @param v The Vector we want to subtract to this Vector. + * @return The resulting Vector. + **/ + Vector operator - (const Vector &v) const; + + /** + * Resizes a Vector by a scalar. + * @param s The scalar with which to resize the Vector. + * @return The resulting Vector. + **/ + Vector operator * (float s) const; + + /** + * Resizes a Vector by a scalar. + * @param s The scalar with which to resize the Vector. + * @return The resulting Vector. + **/ + Vector operator / (float s) const; + + /** + * Reverses the Vector. + * @return The reversed Vector. + **/ + Vector operator - () const; + + /** + * Adds a Vector to this Vector, and also saves changes in the first Vector. + * @param v The Vector we want to add to this Vector. + **/ + void operator += (const Vector &v); + + /** + * Subtracts a Vector to this Vector, and also saves changes in the first Vector. + * @param v The Vector we want to subtract to this Vector. + **/ + void operator -= (const Vector &v); + + /** + * Resizes the Vector, and also saves changes in the first Vector. + * @param s The scalar by which we want to resize the Vector. + **/ + void operator *= (float s); + + /** + * Resizes the Vector, and also saves changes in the first Vector. + * @param s The scalar by which we want to resize the Vector. + **/ + void operator /= (float s); + + /** + * Calculates the dot product of two Vectors. + * @return The dot product of the two Vectors. + **/ + float operator * (const Vector &v) const; + + /** + * Calculates the cross product of two Vectors. + * @return The cross product of the two Vectors. + **/ + float operator ^ (const Vector &v) const; + + bool operator == (const Vector &v) const; + + bool operator < (const Vector &v) const; + /** + * Gets the x value of the Vector. + * @return The x value of the Vector. + **/ + float getX() const; + + /** + * Gets the x value of the Vector. + * @return The x value of the Vector. + **/ + float getY() const; + + /** + * Sets the x value of the Vector. + * @param The x value of the Vector. + **/ + void setX(float x); + + /** + * Sets the x value of the Vector. + * @param The x value of the Vector. + **/ + void setY(float y); + +}; + +inline float Vector::getLength() const +{ + return sqrt(x*x + y*y); +} + +inline Vector Vector::getNormal() const +{ + return Vector(-y, x); +} + +inline float Vector::normalize() +{ + + float len = getLength(); + + if (len > 0) + (*this) /= len; + + return len; +} + +/** + * Inline methods must have body in header. + **/ + +inline Vector::Vector() +{ + x = 1; + y = 1; +} + +inline Vector::Vector(float x, float y) +{ + this->x = x; + this->y = y; +} + +inline Vector Vector::operator + (const Vector &v) const +{ + return Vector(x + v.x, y + v.y); +} + +inline Vector Vector::operator - (const Vector &v) const +{ + return Vector(x - v.getX(), y - v.getY()); +} + +inline Vector Vector::operator * (float s) const +{ + return Vector(x*s, y*s); +} + +inline Vector Vector::operator / (float s) const +{ + return Vector(x/s, y/s); +} + +inline Vector Vector::operator - () const +{ + return Vector(-x, -y); +} + +inline void Vector::operator += (const Vector &v) +{ + x += v.getX(); + y += v.getY(); +} + +inline void Vector::operator -= (const Vector &v) +{ + x -= v.getX(); + y -= v.getY(); +} + +inline void Vector::operator *= (float s) +{ + x *= s; + y *= s; +} + +inline void Vector::operator /= (float s) +{ + x /= s; + y /= s; +} + +inline float Vector::operator * (const Vector &v) const +{ + return x * v.getX() + y * v.getY(); +} + +inline float Vector::operator ^ (const Vector &v) const +{ + return x * v.getY() - y * v.getX(); +} + +inline bool Vector::operator == (const Vector &v) const +{ + return getLength() == v.getLength(); +} + +inline bool Vector::operator < (const Vector &v) const +{ + return getLength() < v.getLength(); +} + +/** + * Accessor methods + **/ + +inline float Vector::getX() const +{ + return x; +} + +inline float Vector::getY() const +{ + return y; +} + +inline void Vector::setX(float x) +{ + this->x = x; +} + +inline void Vector::setY(float y) +{ + this->y = y; +} + +} //love + +#endif// LOVE_VECTOR_H diff --git a/src/common/b64.cpp b/src/common/b64.cpp index f0343f89a..d77e069a9 100644 --- a/src/common/b64.cpp +++ b/src/common/b64.cpp @@ -1,80 +1,80 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "b64.h" - -namespace love -{ - -static const char cd64[]="|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\\]^_`abcdefghijklmnopq"; - -void b64_decode_block(char in[4], char out[3]) -{ - out[0] = (char)(in[0] << 2 | in[1] >> 4); - out[1] = (char)(in[1] << 4 | in[2] >> 2); - out[2] = (char)(((in[2] << 6) & 0xc0) | in[3]); -} - -char *b64_decode(const char *src, int slen, int &size) -{ - size = (slen / 4) * 3; - - char *dst = new char[size]; - char *d = dst; - - char in[4], out[3], v; - int i, len, pos = 0; - - while (pos <= slen) - { - for (len = 0, i = 0; i < 4 && pos <= slen; i++) - { - v = 0; - - while (pos <= slen && v == 0) - { - v = src[pos++]; - v = (char)((v < 43 || v > 122) ? 0 : cd64[v - 43]); - if (v) - v = (char)((v == '$') ? 0 : v - 61); - } - - if (pos <= slen) - { - len++; - if (v) - in[i] = (char)(v - 1); - } - else - in[i] = 0; - } - - if (len) - { - b64_decode_block(in, out); - for (i = 0; i < len - 1; i++) - *(d++) = out[i]; - } - } - - return dst; -} - -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "b64.h" + +namespace love +{ + +static const char cd64[]="|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\\]^_`abcdefghijklmnopq"; + +void b64_decode_block(char in[4], char out[3]) +{ + out[0] = (char)(in[0] << 2 | in[1] >> 4); + out[1] = (char)(in[1] << 4 | in[2] >> 2); + out[2] = (char)(((in[2] << 6) & 0xc0) | in[3]); +} + +char *b64_decode(const char *src, int slen, int &size) +{ + size = (slen / 4) * 3; + + char *dst = new char[size]; + char *d = dst; + + char in[4], out[3], v; + int i, len, pos = 0; + + while (pos <= slen) + { + for (len = 0, i = 0; i < 4 && pos <= slen; i++) + { + v = 0; + + while (pos <= slen && v == 0) + { + v = src[pos++]; + v = (char)((v < 43 || v > 122) ? 0 : cd64[v - 43]); + if (v) + v = (char)((v == '$') ? 0 : v - 61); + } + + if (pos <= slen) + { + len++; + if (v) + in[i] = (char)(v - 1); + } + else + in[i] = 0; + } + + if (len) + { + b64_decode_block(in, out); + for (i = 0; i < len - 1; i++) + *(d++) = out[i]; + } + } + + return dst; +} + +} // love diff --git a/src/common/b64.h b/src/common/b64.h index fa69bf6a2..b3e4d8e8d 100644 --- a/src/common/b64.h +++ b/src/common/b64.h @@ -1,41 +1,41 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "config.h" - -#ifndef LOVE_B64_H -#define LOVE_B64_H - -namespace love -{ - -/** - * Decode base64 encoded data. - * - * @param src The string containing the base64 data. - * @param slen The length of the string. - * @param size The size of the binary data is stored here. - * @return A chunk of memory containing the binary data (allocated with new[]). - */ -char *b64_decode(const char *src, int slen, int &size); - -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "config.h" + +#ifndef LOVE_B64_H +#define LOVE_B64_H + +namespace love +{ + +/** + * Decode base64 encoded data. + * + * @param src The string containing the base64 data. + * @param slen The length of the string. + * @param size The size of the binary data is stored here. + * @return A chunk of memory containing the binary data (allocated with new[]). + */ +char *b64_decode(const char *src, int slen, int &size); + +} // love + #endif // LOVE_B64_H \ No newline at end of file diff --git a/src/common/config.h b/src/common/config.h index 2de75ce5b..f1fddcb7b 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -1,93 +1,93 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_CONFIG_H -#define LOVE_CONFIG_H - -// Platform stuff. -#if defined(WIN32) || defined(_WIN32) -# define LOVE_WINDOWS 1 -#endif -#if defined(linux) || defined(__linux) || defined(__linux__) -# define LOVE_LINUX 1 -#endif -#if defined(__APPLE__) -# define LOVE_MACOSX 1 -#endif -#if defined(macintosh) -# define LOVE_MACOS 1 -#endif - -// Endianness. -#if defined(__i386__) || defined(__i386) -# define LOVE_LITTLE_ENDIAN 1 -#endif -#if defined(__ppc__) || defined(__ppc) || defined(__powerpc__) || defined(__powerpc) -# define LOVE_BIG_ENDIAN 1 -#endif - -// Warnings. -#ifndef _CRT_SECURE_NO_WARNINGS -# define _CRT_SECURE_NO_WARNINGS -#endif - -// Preferably, and ironically, this macro should go unused. -#ifndef LOVE_UNUSED -# define LOVE_UNUSED(x) (void)sizeof(x) -#endif - -#ifndef LOVE_BUILD -# define LOVE_BUILD -# define LOVE_BUILD_STANDALONE -# define LOVE_BUILD_EXE -//# define LOVE_BUILD_DLL -#endif - -// DLL-stuff. -#ifdef LOVE_WINDOWS -# define LOVE_EXPORT __declspec(dllexport) -#else -# define LOVE_EXPORT -#endif - -#if defined(LOVE_WINDOWS) -# define LOVE_LEGENDARY_UTF8_ARGV_HACK -# define LOVE_LEGENDARY_CONSOLE_IO_HACK -# define NOMINMAX -#endif - -#if defined(LOVE_MACOSX) -# define LOVE_LEGENDARY_LIBSTDCXX_HACK -#endif - -// Autotools config.h -#ifdef HAVE_CONFIG_H -# include <../config.h> -# undef VERSION -# ifdef WORDS_BIGENDIAN -# undef LOVE_LITTLE_ENDIAN -# define LOVE_BIG_ENDIAN 1 -# else -# undef LOVE_BIG_ENDIAN -# define LOVE_LITTLE_ENDIAN 1 -# endif -#endif - -#endif // LOVE_CONFIG_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_CONFIG_H +#define LOVE_CONFIG_H + +// Platform stuff. +#if defined(WIN32) || defined(_WIN32) +# define LOVE_WINDOWS 1 +#endif +#if defined(linux) || defined(__linux) || defined(__linux__) +# define LOVE_LINUX 1 +#endif +#if defined(__APPLE__) +# define LOVE_MACOSX 1 +#endif +#if defined(macintosh) +# define LOVE_MACOS 1 +#endif + +// Endianness. +#if defined(__i386__) || defined(__i386) +# define LOVE_LITTLE_ENDIAN 1 +#endif +#if defined(__ppc__) || defined(__ppc) || defined(__powerpc__) || defined(__powerpc) +# define LOVE_BIG_ENDIAN 1 +#endif + +// Warnings. +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + +// Preferably, and ironically, this macro should go unused. +#ifndef LOVE_UNUSED +# define LOVE_UNUSED(x) (void)sizeof(x) +#endif + +#ifndef LOVE_BUILD +# define LOVE_BUILD +# define LOVE_BUILD_STANDALONE +# define LOVE_BUILD_EXE +//# define LOVE_BUILD_DLL +#endif + +// DLL-stuff. +#ifdef LOVE_WINDOWS +# define LOVE_EXPORT __declspec(dllexport) +#else +# define LOVE_EXPORT +#endif + +#if defined(LOVE_WINDOWS) +# define LOVE_LEGENDARY_UTF8_ARGV_HACK +# define LOVE_LEGENDARY_CONSOLE_IO_HACK +# define NOMINMAX +#endif + +#if defined(LOVE_MACOSX) +# define LOVE_LEGENDARY_LIBSTDCXX_HACK +#endif + +// Autotools config.h +#ifdef HAVE_CONFIG_H +# include <../config.h> +# undef VERSION +# ifdef WORDS_BIGENDIAN +# undef LOVE_LITTLE_ENDIAN +# define LOVE_BIG_ENDIAN 1 +# else +# undef LOVE_BIG_ENDIAN +# define LOVE_LITTLE_ENDIAN 1 +# endif +#endif + +#endif // LOVE_CONFIG_H diff --git a/src/common/delay.cpp b/src/common/delay.cpp index 163091794..dbd072794 100644 --- a/src/common/delay.cpp +++ b/src/common/delay.cpp @@ -1,42 +1,42 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "delay.h" - -namespace love -{ - -void delay(unsigned int ms) -{ -#if LOVE_THREADS == LOVE_THREADS_POSIX - struct timespec ts1, ts2; - - ts1.tv_sec = ms / 1000; - ts1.tv_nsec = (ms % 1000) * 1000000; - // FIXME: handle signals - nanosleep(&ts1, &ts2); -#elif LOVE_THREADS == LOVE_THREADS_WIN32 - Sleep(ms); -#elif LOVE_THREADS == LOVE_THREADS_SDL - SDL_Delay(ms); -#endif -} - -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "delay.h" + +namespace love +{ + +void delay(unsigned int ms) +{ +#if LOVE_THREADS == LOVE_THREADS_POSIX + struct timespec ts1, ts2; + + ts1.tv_sec = ms / 1000; + ts1.tv_nsec = (ms % 1000) * 1000000; + // FIXME: handle signals + nanosleep(&ts1, &ts2); +#elif LOVE_THREADS == LOVE_THREADS_WIN32 + Sleep(ms); +#elif LOVE_THREADS == LOVE_THREADS_SDL + SDL_Delay(ms); +#endif +} + +} // love diff --git a/src/common/delay.h b/src/common/delay.h index 31e4cf127..a35b7668d 100644 --- a/src/common/delay.h +++ b/src/common/delay.h @@ -1,33 +1,33 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef DELAY_H_ -#define DELAY_H_ - -#include - -namespace love -{ - -void delay(unsigned int ms); - -}; // namespace love - -#endif // DELAY_H_ +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef DELAY_H_ +#define DELAY_H_ + +#include + +namespace love +{ + +void delay(unsigned int ms); + +}; // namespace love + +#endif // DELAY_H_ diff --git a/src/common/int.h b/src/common/int.h index c9ee9eda9..36c8baa3a 100644 --- a/src/common/int.h +++ b/src/common/int.h @@ -1,65 +1,65 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_INT_H -#define LOVE_INT_H - -#include "common/config.h" - -#ifndef LOVE_WINDOWS -#include -#endif - -#define LOVE_INT8_MAX 0x7F -#define LOVE_UINT8_MAX 0xFF -#define LOVE_INT16_MAX 0x7FFF -#define LOVE_UINT16_MAX 0xFFFF -#define LOVE_INT32_MAX 0x7FFFFFFF -#define LOVE_UINT32_MAX 0xFFFFFFFF -#define LOVE_INT64_MAX 0x7FFFFFFFFFFFFFFF -#define LOVE_UINT64_MAX 0xFFFFFFFFFFFFFFFF - -namespace love -{ - -// Blame Microsoft -#ifdef LOVE_WINDOWS - typedef __int8 int8; - typedef unsigned __int8 uint8; - typedef __int16 int16; - typedef unsigned __int16 uint16; - typedef __int32 int32; - typedef unsigned __int32 uint32; - typedef __int64 int64; - typedef unsigned __int64 uint64; -#else // LOVE_WINDOWS - typedef int8_t int8; - typedef uint8_t uint8; - typedef int16_t int16; - typedef uint16_t uint16; - typedef int32_t int32; - typedef uint32_t uint32; - typedef int64_t int64; - typedef uint64_t uint64; -#endif // LOVE_WINDOWS - -} // love - -#endif // LOVE_INT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_INT_H +#define LOVE_INT_H + +#include "common/config.h" + +#ifndef LOVE_WINDOWS +#include +#endif + +#define LOVE_INT8_MAX 0x7F +#define LOVE_UINT8_MAX 0xFF +#define LOVE_INT16_MAX 0x7FFF +#define LOVE_UINT16_MAX 0xFFFF +#define LOVE_INT32_MAX 0x7FFFFFFF +#define LOVE_UINT32_MAX 0xFFFFFFFF +#define LOVE_INT64_MAX 0x7FFFFFFFFFFFFFFF +#define LOVE_UINT64_MAX 0xFFFFFFFFFFFFFFFF + +namespace love +{ + +// Blame Microsoft +#ifdef LOVE_WINDOWS + typedef __int8 int8; + typedef unsigned __int8 uint8; + typedef __int16 int16; + typedef unsigned __int16 uint16; + typedef __int32 int32; + typedef unsigned __int32 uint32; + typedef __int64 int64; + typedef unsigned __int64 uint64; +#else // LOVE_WINDOWS + typedef int8_t int8; + typedef uint8_t uint8; + typedef int16_t int16; + typedef uint16_t uint16; + typedef int32_t int32; + typedef uint32_t uint32; + typedef int64_t int64; + typedef uint64_t uint64; +#endif // LOVE_WINDOWS + +} // love + +#endif // LOVE_INT_H diff --git a/src/common/math.h b/src/common/math.h index 282b1ffc3..44979d4b2 100644 --- a/src/common/math.h +++ b/src/common/math.h @@ -1,85 +1,85 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_MATH_H -#define LOVE_MATH_H - -#include // for CHAR_BIT - -/* Definitions of useful mathematical constants - * M_E - e - * M_LOG2E - log2(e) - * M_LOG10E - log10(e) - * M_LN2 - ln(2) - * M_LN10 - ln(10) - * M_PI - pi - * M_PI_2 - pi/2 - * M_PI_4 - pi/4 - * M_1_PI - 1/pi - * M_2_PI - 2/pi - * M_2_SQRTPI - 2/sqrt(pi) - * M_SQRT2 - sqrt(2) - * M_SQRT1_2 - 1/sqrt(2) - */ - -#define LOVE_M_E 2.71828182845904523536 -#define LOVE_M_LOG2E 1.44269504088896340736 -#define LOVE_M_LOG10E 0.434294481903251827651 -#define LOVE_M_LN2 0.693147180559945309417 -#define LOVE_M_LN10 2.30258509299404568402 -#define LOVE_M_PI 3.14159265358979323846 -#define LOVE_M_PI_2 1.57079632679489661923 -#define LOVE_M_PI_4 0.785398163397448309616 -#define LOVE_M_1_PI 0.318309886183790671538 -#define LOVE_M_2_PI 0.636619772367581343076 -#define LOVE_M_2_SQRTPI 1.12837916709551257390 -#define LOVE_M_SQRT2 1.41421356237309504880 -#define LOVE_M_SQRT1_2 0.707106781186547524401 -#define LOVE_M_TORAD (float)(LOVE_M_PI/180.0) -#define LOVE_M_TODEG (float)(180.0/LOVE_M_PI) -#define LOVE_TORAD(x) (float)(x*LOVE_M_TORAD) -#define LOVE_TODEG(x) (float)(x*LOVE_M_TODEG) - -namespace love -{ - -struct vertex -{ - unsigned char r, g, b, a; - float x, y; - float s, t; -}; - -inline int next_p2(int x) -{ - x += (x == 0); - x--; - for (unsigned int i = 1; i < sizeof(int)*CHAR_BIT; i <<= 1) x |= x >> i; - return ++x; -} - -inline float next_p2(float x) -{ - return static_cast(next_p2(static_cast(x))); -} - -} // love - -#endif // LOVE_MATH_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_MATH_H +#define LOVE_MATH_H + +#include // for CHAR_BIT + +/* Definitions of useful mathematical constants + * M_E - e + * M_LOG2E - log2(e) + * M_LOG10E - log10(e) + * M_LN2 - ln(2) + * M_LN10 - ln(10) + * M_PI - pi + * M_PI_2 - pi/2 + * M_PI_4 - pi/4 + * M_1_PI - 1/pi + * M_2_PI - 2/pi + * M_2_SQRTPI - 2/sqrt(pi) + * M_SQRT2 - sqrt(2) + * M_SQRT1_2 - 1/sqrt(2) + */ + +#define LOVE_M_E 2.71828182845904523536 +#define LOVE_M_LOG2E 1.44269504088896340736 +#define LOVE_M_LOG10E 0.434294481903251827651 +#define LOVE_M_LN2 0.693147180559945309417 +#define LOVE_M_LN10 2.30258509299404568402 +#define LOVE_M_PI 3.14159265358979323846 +#define LOVE_M_PI_2 1.57079632679489661923 +#define LOVE_M_PI_4 0.785398163397448309616 +#define LOVE_M_1_PI 0.318309886183790671538 +#define LOVE_M_2_PI 0.636619772367581343076 +#define LOVE_M_2_SQRTPI 1.12837916709551257390 +#define LOVE_M_SQRT2 1.41421356237309504880 +#define LOVE_M_SQRT1_2 0.707106781186547524401 +#define LOVE_M_TORAD (float)(LOVE_M_PI/180.0) +#define LOVE_M_TODEG (float)(180.0/LOVE_M_PI) +#define LOVE_TORAD(x) (float)(x*LOVE_M_TORAD) +#define LOVE_TODEG(x) (float)(x*LOVE_M_TODEG) + +namespace love +{ + +struct vertex +{ + unsigned char r, g, b, a; + float x, y; + float s, t; +}; + +inline int next_p2(int x) +{ + x += (x == 0); + x--; + for (unsigned int i = 1; i < sizeof(int)*CHAR_BIT; i <<= 1) x |= x >> i; + return ++x; +} + +inline float next_p2(float x) +{ + return static_cast(next_p2(static_cast(x))); +} + +} // love + +#endif // LOVE_MATH_H diff --git a/src/common/runtime.cpp b/src/common/runtime.cpp index f28cb2eda..5216890b6 100644 --- a/src/common/runtime.cpp +++ b/src/common/runtime.cpp @@ -1,481 +1,481 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "runtime.h" - -// LOVE -#include "Module.h" -#include "Object.h" -#include "Reference.h" -#include "StringMap.h" -#include "thread/threads.h" - -// STD -#include - -namespace love -{ - -static thread::Mutex *gcmutex = 0; -void *_gcmutex = 0; -unsigned int _gcthread = 0; -/** - * Called when an object is collected. The object is released - * once in this function, possibly deleting it. - **/ -static int w__gc(lua_State *L) -{ - if (!gcmutex) - { - gcmutex = new thread::Mutex(); - _gcmutex = (void *) gcmutex; - } - Proxy *p = (Proxy *)lua_touserdata(L, 1); - Object *t = (Object *)p->data; - if (p->own) - { - thread::Lock lock(gcmutex); - _gcthread = thread::ThreadBase::threadId(); - t->release(); - } - return 0; -} - -static int w__tostring(lua_State *L) -{ - lua_pushvalue(L, lua_upvalueindex(1)); - return 1; -} - -static int w__typeOf(lua_State *L) -{ - Proxy *p = (Proxy *)lua_touserdata(L, 1); - Type t = luax_type(L, 2); - luax_pushboolean(L, p->flags[t]); - return 1; -} - -static int w__eq(lua_State *L) -{ - Proxy *p1 = (Proxy *)lua_touserdata(L, 1); - Proxy *p2 = (Proxy *)lua_touserdata(L, 2); - luax_pushboolean(L, p1->data == p2->data); - return 1; -} - -Reference *luax_refif (lua_State *L, int type) -{ - Reference *r = 0; - - // Create a reference only if the test succeeds. - if (lua_type(L, -1) == type) - r = new Reference(L); - else // Pop the value even if it fails (but also if it succeeds). - lua_pop(L, 1); - - return r; -} - -void luax_printstack(lua_State *L) -{ - for (int i = 1; i<=lua_gettop(L); i++) - { - std::cout << i << " - " << luaL_typename(L, i) << std::endl; - } -} - -bool luax_toboolean(lua_State *L, int idx) -{ - return (lua_toboolean(L, idx) != 0); -} - -void luax_pushboolean(lua_State *L, bool b) -{ - lua_pushboolean(L, b ? 1 : 0); -} - -bool luax_optboolean(lua_State *L, int idx, bool b) -{ - if (lua_isboolean(L, idx) == 1) - return (lua_toboolean(L, idx) == 1 ? true : false); - return b; -} - -std::string luax_checkstring(lua_State *L, int idx) -{ - size_t len; - const char *str = luaL_checklstring(L, idx, &len); - return std::string(str, len); -} - -void luax_pushstring(lua_State *L, std::string str) -{ - lua_pushlstring(L, str.data(), str.size()); -} - -int luax_assert_argc(lua_State *L, int min) -{ - int argc = lua_gettop(L); - if (argc < min) - return luaL_error(L, "Incorrect number of arguments. Got [%d], expected at least [%d]", argc, min); - return 0; -} - -int luax_assert_argc(lua_State *L, int min, int max) -{ - int argc = lua_gettop(L); - if (argc < min || argc > max) - return luaL_error(L, "Incorrect number of arguments. Got [%d], expected [%d-%d]", argc, min, max); - return 0; -} - -int luax_assert_function(lua_State *L, int n) -{ - if (!lua_isfunction(L, n)) - return luaL_error(L, "Argument must be of type \"function\"."); - return 0; -} - -int luax_register_module(lua_State *L, const WrappedModule &m) -{ - // Put a reference to the C++ module in Lua. - luax_getregistry(L, REGISTRY_MODULES); - - Proxy *p = (Proxy *)lua_newuserdata(L, sizeof(Proxy)); - p->own = true; - p->data = m.module; - p->flags = m.flags; - - luaL_newmetatable(L, m.module->getName()); - lua_pushvalue(L, -1); - lua_setfield(L, -2, "__index"); - lua_pushcfunction(L, w__gc); - lua_setfield(L, -2, "__gc"); - - lua_setmetatable(L, -2); - lua_setfield(L, -2, m.name); // _modules[name] = proxy - lua_pop(L, 1); - - // Gets the love table. - luax_insistglobal(L, "love"); - - // Create new table for module. - lua_newtable(L); - - // Register all the functions. - luaL_register(L, 0, m.functions); - - // Register types. - if (m.types != 0) - for (const lua_CFunction *t = m.types; *t != 0; t++) - (*t)(L); - - lua_pushvalue(L, -1); - lua_setfield(L, -3, m.name); // love.graphics = table - lua_remove(L, -2); // love - - return 1; -} - -int luax_preload(lua_State *L, lua_CFunction f, const char *name) -{ - lua_getglobal(L, "package"); - lua_getfield(L, -1, "preload"); - lua_pushcfunction(L, f); - lua_setfield(L, -2, name); - lua_pop(L, 2); - return 0; -} - -int luax_register_type(lua_State *L, const char *tname, const luaL_Reg *f) -{ - luaL_newmetatable(L, tname); - - // m.__index = m - lua_pushvalue(L, -1); - lua_setfield(L, -2, "__index"); - - // setup gc - lua_pushcfunction(L, w__gc); - lua_setfield(L, -2, "__gc"); - - // Add equality - lua_pushcfunction(L, w__eq); - lua_setfield(L, -2, "__eq"); - - // Add tostring function. - lua_pushstring(L, tname); - lua_pushcclosure(L, w__tostring, 1); - lua_setfield(L, -2, "__tostring"); - - // Add tostring to as type() as well. - lua_pushstring(L, tname); - lua_pushcclosure(L, w__tostring, 1); - lua_setfield(L, -2, "type"); - - // Add typeOf - lua_pushcfunction(L, w__typeOf); - lua_setfield(L, -2, "typeOf"); - - if (f != 0) - luaL_register(L, 0, f); - - lua_pop(L, 1); // Pops metatable. - return 0; -} - -int luax_table_insert(lua_State *L, int tindex, int vindex, int pos) -{ - if (tindex < 0) - tindex = lua_gettop(L)+1+tindex; - if (vindex < 0) - vindex = lua_gettop(L)+1+vindex; - if (pos == -1) - { - lua_pushvalue(L, vindex); - lua_rawseti(L, tindex, lua_objlen(L, tindex)+1); - return 0; - } - else if (pos < 0) - pos = lua_objlen(L, tindex)+1+pos; - for (int i = lua_objlen(L, tindex)+1; i > pos; i--) - { - lua_rawgeti(L, tindex, i-1); - lua_rawseti(L, tindex, i); - } - lua_pushvalue(L, vindex); - lua_rawseti(L, tindex, pos); - return 0; -} - -int luax_register_searcher(lua_State *L, lua_CFunction f, int pos) -{ - // Add the package loader to the package.loaders table. - lua_getglobal(L, "package"); - - if (lua_isnil(L, -1)) - return luaL_error(L, "Can't register searcher: package table does not exist."); - - lua_getfield(L, -1, "loaders"); - - if (lua_isnil(L, -1)) - return luaL_error(L, "Can't register searcher: package.loaders table does not exist."); - - lua_pushcfunction(L, f); - luax_table_insert(L, -2, -1, pos); - lua_pop(L, 3); - return 0; -} - -void luax_newtype(lua_State *L, const char *name, bits flags, void *data, bool own) -{ - Proxy *u = (Proxy *)lua_newuserdata(L, sizeof(Proxy)); - - u->data = data; - u->flags = flags; - u->own = own; - - luaL_newmetatable(L, name); - lua_setmetatable(L, -2); -} - -bool luax_istype(lua_State *L, int idx, love::bits type) -{ - if (lua_isuserdata(L, idx) == 0) - return false; - - return ((((Proxy *)lua_touserdata(L, idx))->flags & type) == type); -} - -int luax_getfunction(lua_State *L, const char *mod, const char *fn) -{ - lua_getglobal(L, "love"); - if (lua_isnil(L, -1)) return luaL_error(L, "Could not find global love!"); - lua_getfield(L, -1, mod); - if (lua_isnil(L, -1)) return luaL_error(L, "Could not find love.%s!", mod); - lua_getfield(L, -1, fn); - if (lua_isnil(L, -1)) return luaL_error(L, "Could not find love.%s.%s!", mod, fn); - - lua_remove(L, -2); // remove mod - lua_remove(L, -2); // remove fn - return 0; -} - -int luax_convobj(lua_State *L, int idx, const char *mod, const char *fn) -{ - // Convert string to a file. - luax_getfunction(L, mod, fn); - lua_pushvalue(L, idx); // The initial argument. - lua_call(L, 1, 1); // Call the function, one arg, one return value. - lua_replace(L, idx); // Replace the initial argument with the new object. - return 0; -} - -int luax_convobj(lua_State *L, int idxs[], int n, const char *mod, const char *fn) -{ - luax_getfunction(L, mod, fn); - for (int i = 0; i < n; i++) - { - lua_pushvalue(L, idxs[i]); // The arguments. - } - lua_call(L, n, 1); // Call the function, n args, one return value. - lua_replace(L, idxs[0]); // Replace the initial argument with the new object. - return 0; -} - -int luax_strtofile(lua_State *L, int idx) -{ - return luax_convobj(L, idx, "filesystem", "newFile"); -} - -int luax_filetodata(lua_State *L, int idx) -{ - return luax_convobj(L, idx, "filesystem", "read"); -} - -int luax_insist(lua_State *L, int idx, const char *k) -{ - // Convert to absolute index if necessary. - if (idx < 0 && idx > LUA_REGISTRYINDEX) - idx = lua_gettop(L) + ++idx; - - lua_getfield(L, idx, k); - - // Create if necessary. - if (!lua_istable(L, -1)) - { - lua_pop(L, 1); // Pop the non-table. - lua_newtable(L); - lua_pushvalue(L, -1); // Duplicate the table to leave on top. - lua_setfield(L, idx, k); // lua_stack[idx][k] = lua_stack[-1] (table) - } - - return 1; -} - -int luax_insistglobal(lua_State *L, const char *k) -{ - lua_getglobal(L, k); - - if (!lua_istable(L, -1)) - { - lua_pop(L, 1); // Pop the non-table. - lua_newtable(L); - lua_pushvalue(L, -1); - lua_setglobal(L, k); - } - - return 1; -} - -int luax_insistlove(lua_State *L, const char *k) -{ - luax_insistglobal(L, "love"); - luax_insist(L, -1, k); - - // The love table should be replaced with the top stack - // item. Only the reqested table should remain on the stack. - lua_replace(L, -2); - - return 1; -} - -int luax_getregistry(lua_State *L, Registry r) -{ - switch (r) - { - case REGISTRY_GC: - return luax_insistlove(L, "_gc"); - case REGISTRY_MODULES: - return luax_insistlove(L, "_modules"); - default: - return luaL_error(L, "Attempted to use invalid registry."); - } -} - -StringMap::Entry typeEntries[] = -{ - {"Invalid", INVALID_ID}, - - {"Object", OBJECT_ID}, - {"Data", DATA_ID}, - {"Module", MODULE_ID}, - - // Filesystem - {"File", FILESYSTEM_FILE_ID}, - {"FileData", FILESYSTEM_FILE_DATA_ID}, - - // Font - {"GlyphData", FONT_GLYPH_DATA_ID}, - {"Rasterizer", FONT_RASTERIZER_ID}, - - // Graphics - {"Drawable", GRAPHICS_DRAWABLE_ID}, - {"Image", GRAPHICS_IMAGE_ID}, - {"Quad", GRAPHICS_QUAD_ID}, - {"Font", GRAPHICS_FONT_ID}, - {"ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_ID}, - {"SpriteBatch", GRAPHICS_SPRITE_BATCH_ID}, - {"Canvas", GRAPHICS_CANVAS_ID}, - - // Image - {"ImageData", IMAGE_IMAGE_DATA_ID}, - - // Audio - {"Source", AUDIO_SOURCE_ID}, - - // Sound - {"SoundData", SOUND_SOUND_DATA_ID}, - {"Decoder", SOUND_DECODER_ID}, - - // Physics - {"World", PHYSICS_WORLD_ID}, - {"Contact", PHYSICS_CONTACT_ID}, - {"Body", PHYSICS_BODY_ID}, - {"Shape", PHYSICS_SHAPE_ID}, - {"CircleShape", PHYSICS_CIRCLE_SHAPE_ID}, - {"PolygonShape", PHYSICS_POLYGON_SHAPE_ID}, - {"Joint", PHYSICS_JOINT_ID}, - {"MouseJoint", PHYSICS_MOUSE_JOINT_ID}, - {"DistanceJoint", PHYSICS_DISTANCE_JOINT_ID}, - {"PrismaticJoint", PHYSICS_PRISMATIC_JOINT_ID}, - {"RevoluteJoint", PHYSICS_REVOLUTE_JOINT_ID}, - {"PulleyJoint", PHYSICS_PULLEY_JOINT_ID}, - {"GearJoint", PHYSICS_GEAR_JOINT_ID}, - - // Thread - {"Thread", THREAD_THREAD_ID}, - - // The modules themselves. Only add abstracted modules here. - {"filesystem", MODULE_FILESYSTEM_ID}, - {"image", MODULE_IMAGE_ID}, - {"sound", MODULE_SOUND_ID}, -}; - -StringMap types(typeEntries, sizeof(typeEntries)); - -Type luax_type(lua_State *L, int idx) -{ - Type t = INVALID_ID; - types.find(luaL_checkstring(L, idx), t); - return t; -} - -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "runtime.h" + +// LOVE +#include "Module.h" +#include "Object.h" +#include "Reference.h" +#include "StringMap.h" +#include "thread/threads.h" + +// STD +#include + +namespace love +{ + +static thread::Mutex *gcmutex = 0; +void *_gcmutex = 0; +unsigned int _gcthread = 0; +/** + * Called when an object is collected. The object is released + * once in this function, possibly deleting it. + **/ +static int w__gc(lua_State *L) +{ + if (!gcmutex) + { + gcmutex = new thread::Mutex(); + _gcmutex = (void *) gcmutex; + } + Proxy *p = (Proxy *)lua_touserdata(L, 1); + Object *t = (Object *)p->data; + if (p->own) + { + thread::Lock lock(gcmutex); + _gcthread = thread::ThreadBase::threadId(); + t->release(); + } + return 0; +} + +static int w__tostring(lua_State *L) +{ + lua_pushvalue(L, lua_upvalueindex(1)); + return 1; +} + +static int w__typeOf(lua_State *L) +{ + Proxy *p = (Proxy *)lua_touserdata(L, 1); + Type t = luax_type(L, 2); + luax_pushboolean(L, p->flags[t]); + return 1; +} + +static int w__eq(lua_State *L) +{ + Proxy *p1 = (Proxy *)lua_touserdata(L, 1); + Proxy *p2 = (Proxy *)lua_touserdata(L, 2); + luax_pushboolean(L, p1->data == p2->data); + return 1; +} + +Reference *luax_refif (lua_State *L, int type) +{ + Reference *r = 0; + + // Create a reference only if the test succeeds. + if (lua_type(L, -1) == type) + r = new Reference(L); + else // Pop the value even if it fails (but also if it succeeds). + lua_pop(L, 1); + + return r; +} + +void luax_printstack(lua_State *L) +{ + for (int i = 1; i<=lua_gettop(L); i++) + { + std::cout << i << " - " << luaL_typename(L, i) << std::endl; + } +} + +bool luax_toboolean(lua_State *L, int idx) +{ + return (lua_toboolean(L, idx) != 0); +} + +void luax_pushboolean(lua_State *L, bool b) +{ + lua_pushboolean(L, b ? 1 : 0); +} + +bool luax_optboolean(lua_State *L, int idx, bool b) +{ + if (lua_isboolean(L, idx) == 1) + return (lua_toboolean(L, idx) == 1 ? true : false); + return b; +} + +std::string luax_checkstring(lua_State *L, int idx) +{ + size_t len; + const char *str = luaL_checklstring(L, idx, &len); + return std::string(str, len); +} + +void luax_pushstring(lua_State *L, std::string str) +{ + lua_pushlstring(L, str.data(), str.size()); +} + +int luax_assert_argc(lua_State *L, int min) +{ + int argc = lua_gettop(L); + if (argc < min) + return luaL_error(L, "Incorrect number of arguments. Got [%d], expected at least [%d]", argc, min); + return 0; +} + +int luax_assert_argc(lua_State *L, int min, int max) +{ + int argc = lua_gettop(L); + if (argc < min || argc > max) + return luaL_error(L, "Incorrect number of arguments. Got [%d], expected [%d-%d]", argc, min, max); + return 0; +} + +int luax_assert_function(lua_State *L, int n) +{ + if (!lua_isfunction(L, n)) + return luaL_error(L, "Argument must be of type \"function\"."); + return 0; +} + +int luax_register_module(lua_State *L, const WrappedModule &m) +{ + // Put a reference to the C++ module in Lua. + luax_getregistry(L, REGISTRY_MODULES); + + Proxy *p = (Proxy *)lua_newuserdata(L, sizeof(Proxy)); + p->own = true; + p->data = m.module; + p->flags = m.flags; + + luaL_newmetatable(L, m.module->getName()); + lua_pushvalue(L, -1); + lua_setfield(L, -2, "__index"); + lua_pushcfunction(L, w__gc); + lua_setfield(L, -2, "__gc"); + + lua_setmetatable(L, -2); + lua_setfield(L, -2, m.name); // _modules[name] = proxy + lua_pop(L, 1); + + // Gets the love table. + luax_insistglobal(L, "love"); + + // Create new table for module. + lua_newtable(L); + + // Register all the functions. + luaL_register(L, 0, m.functions); + + // Register types. + if (m.types != 0) + for (const lua_CFunction *t = m.types; *t != 0; t++) + (*t)(L); + + lua_pushvalue(L, -1); + lua_setfield(L, -3, m.name); // love.graphics = table + lua_remove(L, -2); // love + + return 1; +} + +int luax_preload(lua_State *L, lua_CFunction f, const char *name) +{ + lua_getglobal(L, "package"); + lua_getfield(L, -1, "preload"); + lua_pushcfunction(L, f); + lua_setfield(L, -2, name); + lua_pop(L, 2); + return 0; +} + +int luax_register_type(lua_State *L, const char *tname, const luaL_Reg *f) +{ + luaL_newmetatable(L, tname); + + // m.__index = m + lua_pushvalue(L, -1); + lua_setfield(L, -2, "__index"); + + // setup gc + lua_pushcfunction(L, w__gc); + lua_setfield(L, -2, "__gc"); + + // Add equality + lua_pushcfunction(L, w__eq); + lua_setfield(L, -2, "__eq"); + + // Add tostring function. + lua_pushstring(L, tname); + lua_pushcclosure(L, w__tostring, 1); + lua_setfield(L, -2, "__tostring"); + + // Add tostring to as type() as well. + lua_pushstring(L, tname); + lua_pushcclosure(L, w__tostring, 1); + lua_setfield(L, -2, "type"); + + // Add typeOf + lua_pushcfunction(L, w__typeOf); + lua_setfield(L, -2, "typeOf"); + + if (f != 0) + luaL_register(L, 0, f); + + lua_pop(L, 1); // Pops metatable. + return 0; +} + +int luax_table_insert(lua_State *L, int tindex, int vindex, int pos) +{ + if (tindex < 0) + tindex = lua_gettop(L)+1+tindex; + if (vindex < 0) + vindex = lua_gettop(L)+1+vindex; + if (pos == -1) + { + lua_pushvalue(L, vindex); + lua_rawseti(L, tindex, lua_objlen(L, tindex)+1); + return 0; + } + else if (pos < 0) + pos = lua_objlen(L, tindex)+1+pos; + for (int i = lua_objlen(L, tindex)+1; i > pos; i--) + { + lua_rawgeti(L, tindex, i-1); + lua_rawseti(L, tindex, i); + } + lua_pushvalue(L, vindex); + lua_rawseti(L, tindex, pos); + return 0; +} + +int luax_register_searcher(lua_State *L, lua_CFunction f, int pos) +{ + // Add the package loader to the package.loaders table. + lua_getglobal(L, "package"); + + if (lua_isnil(L, -1)) + return luaL_error(L, "Can't register searcher: package table does not exist."); + + lua_getfield(L, -1, "loaders"); + + if (lua_isnil(L, -1)) + return luaL_error(L, "Can't register searcher: package.loaders table does not exist."); + + lua_pushcfunction(L, f); + luax_table_insert(L, -2, -1, pos); + lua_pop(L, 3); + return 0; +} + +void luax_newtype(lua_State *L, const char *name, bits flags, void *data, bool own) +{ + Proxy *u = (Proxy *)lua_newuserdata(L, sizeof(Proxy)); + + u->data = data; + u->flags = flags; + u->own = own; + + luaL_newmetatable(L, name); + lua_setmetatable(L, -2); +} + +bool luax_istype(lua_State *L, int idx, love::bits type) +{ + if (lua_isuserdata(L, idx) == 0) + return false; + + return ((((Proxy *)lua_touserdata(L, idx))->flags & type) == type); +} + +int luax_getfunction(lua_State *L, const char *mod, const char *fn) +{ + lua_getglobal(L, "love"); + if (lua_isnil(L, -1)) return luaL_error(L, "Could not find global love!"); + lua_getfield(L, -1, mod); + if (lua_isnil(L, -1)) return luaL_error(L, "Could not find love.%s!", mod); + lua_getfield(L, -1, fn); + if (lua_isnil(L, -1)) return luaL_error(L, "Could not find love.%s.%s!", mod, fn); + + lua_remove(L, -2); // remove mod + lua_remove(L, -2); // remove fn + return 0; +} + +int luax_convobj(lua_State *L, int idx, const char *mod, const char *fn) +{ + // Convert string to a file. + luax_getfunction(L, mod, fn); + lua_pushvalue(L, idx); // The initial argument. + lua_call(L, 1, 1); // Call the function, one arg, one return value. + lua_replace(L, idx); // Replace the initial argument with the new object. + return 0; +} + +int luax_convobj(lua_State *L, int idxs[], int n, const char *mod, const char *fn) +{ + luax_getfunction(L, mod, fn); + for (int i = 0; i < n; i++) + { + lua_pushvalue(L, idxs[i]); // The arguments. + } + lua_call(L, n, 1); // Call the function, n args, one return value. + lua_replace(L, idxs[0]); // Replace the initial argument with the new object. + return 0; +} + +int luax_strtofile(lua_State *L, int idx) +{ + return luax_convobj(L, idx, "filesystem", "newFile"); +} + +int luax_filetodata(lua_State *L, int idx) +{ + return luax_convobj(L, idx, "filesystem", "read"); +} + +int luax_insist(lua_State *L, int idx, const char *k) +{ + // Convert to absolute index if necessary. + if (idx < 0 && idx > LUA_REGISTRYINDEX) + idx = lua_gettop(L) + ++idx; + + lua_getfield(L, idx, k); + + // Create if necessary. + if (!lua_istable(L, -1)) + { + lua_pop(L, 1); // Pop the non-table. + lua_newtable(L); + lua_pushvalue(L, -1); // Duplicate the table to leave on top. + lua_setfield(L, idx, k); // lua_stack[idx][k] = lua_stack[-1] (table) + } + + return 1; +} + +int luax_insistglobal(lua_State *L, const char *k) +{ + lua_getglobal(L, k); + + if (!lua_istable(L, -1)) + { + lua_pop(L, 1); // Pop the non-table. + lua_newtable(L); + lua_pushvalue(L, -1); + lua_setglobal(L, k); + } + + return 1; +} + +int luax_insistlove(lua_State *L, const char *k) +{ + luax_insistglobal(L, "love"); + luax_insist(L, -1, k); + + // The love table should be replaced with the top stack + // item. Only the reqested table should remain on the stack. + lua_replace(L, -2); + + return 1; +} + +int luax_getregistry(lua_State *L, Registry r) +{ + switch (r) + { + case REGISTRY_GC: + return luax_insistlove(L, "_gc"); + case REGISTRY_MODULES: + return luax_insistlove(L, "_modules"); + default: + return luaL_error(L, "Attempted to use invalid registry."); + } +} + +StringMap::Entry typeEntries[] = +{ + {"Invalid", INVALID_ID}, + + {"Object", OBJECT_ID}, + {"Data", DATA_ID}, + {"Module", MODULE_ID}, + + // Filesystem + {"File", FILESYSTEM_FILE_ID}, + {"FileData", FILESYSTEM_FILE_DATA_ID}, + + // Font + {"GlyphData", FONT_GLYPH_DATA_ID}, + {"Rasterizer", FONT_RASTERIZER_ID}, + + // Graphics + {"Drawable", GRAPHICS_DRAWABLE_ID}, + {"Image", GRAPHICS_IMAGE_ID}, + {"Quad", GRAPHICS_QUAD_ID}, + {"Font", GRAPHICS_FONT_ID}, + {"ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_ID}, + {"SpriteBatch", GRAPHICS_SPRITE_BATCH_ID}, + {"Canvas", GRAPHICS_CANVAS_ID}, + + // Image + {"ImageData", IMAGE_IMAGE_DATA_ID}, + + // Audio + {"Source", AUDIO_SOURCE_ID}, + + // Sound + {"SoundData", SOUND_SOUND_DATA_ID}, + {"Decoder", SOUND_DECODER_ID}, + + // Physics + {"World", PHYSICS_WORLD_ID}, + {"Contact", PHYSICS_CONTACT_ID}, + {"Body", PHYSICS_BODY_ID}, + {"Shape", PHYSICS_SHAPE_ID}, + {"CircleShape", PHYSICS_CIRCLE_SHAPE_ID}, + {"PolygonShape", PHYSICS_POLYGON_SHAPE_ID}, + {"Joint", PHYSICS_JOINT_ID}, + {"MouseJoint", PHYSICS_MOUSE_JOINT_ID}, + {"DistanceJoint", PHYSICS_DISTANCE_JOINT_ID}, + {"PrismaticJoint", PHYSICS_PRISMATIC_JOINT_ID}, + {"RevoluteJoint", PHYSICS_REVOLUTE_JOINT_ID}, + {"PulleyJoint", PHYSICS_PULLEY_JOINT_ID}, + {"GearJoint", PHYSICS_GEAR_JOINT_ID}, + + // Thread + {"Thread", THREAD_THREAD_ID}, + + // The modules themselves. Only add abstracted modules here. + {"filesystem", MODULE_FILESYSTEM_ID}, + {"image", MODULE_IMAGE_ID}, + {"sound", MODULE_SOUND_ID}, +}; + +StringMap types(typeEntries, sizeof(typeEntries)); + +Type luax_type(lua_State *L, int idx) +{ + Type t = INVALID_ID; + types.find(luaL_checkstring(L, idx), t); + return t; +} + +} // love diff --git a/src/common/runtime.h b/src/common/runtime.h index 14a2979ff..3d3c2a5e1 100644 --- a/src/common/runtime.h +++ b/src/common/runtime.h @@ -1,384 +1,384 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_RUNTIME_H -#define LOVE_RUNTIME_H - -// LOVE -#include "types.h" - -// Lua -extern "C" { - #include - #include - #include -} - -namespace love -{ - -// Forward declarations. -class Module; -class Reference; - -// Exposed mutex of the GC -extern void *_gcmutex; -extern unsigned int _gcthread; - -/** - * Registries represent special tables which can be accessed with - * luax_getregistry. - **/ -enum Registry -{ - REGISTRY_GC = 1, - REGISTRY_MODULES, -}; - -/** - * This structure wraps all Lua-exposed objects. It exists in the - * Lua state as a full userdata (so we can catch __gc "events"), - * though the Object it refers to is light userdata in the sense - * that it is not allocated by the Lua VM. - **/ -struct Proxy -{ - // Holds type information (see types.h). - bits flags; - - // The light userdata. - void *data; - - // True if Lua should delete on GC. - bool own; -}; - -/** - * A Module with Lua wrapper functions and other data. - **/ -struct WrappedModule -{ - // The module containing the functions. - Module *module; - - // The name for the table to put the functions in, without the 'love'-prefix. - const char *name; - - // The type flags of this module. - love::bits flags; - - // The functions of the module (last element {0,0}). - const luaL_Reg *functions; - - // A list of functions which expose the types of the modules (last element 0). - const lua_CFunction *types; - -}; - -/** - * Returns a reference to the top stack element (-1) if the value - * is of the specified type. If the value is incorrect, zero is returned. - * - * In any case, the top stack element is popped, regardless of its type. - **/ -Reference *luax_refif (lua_State *L, int type); - -/** - * Prints the current contents of the stack. Only useful for debugging. - * @param L The Lua state. - **/ -void luax_printstack(lua_State *L); - -/** - * Converts the value at idx to a bool. It follow the same rules - * as lua_toboolean, but returns a bool instead of an int. - * @param L The Lua state. - * @param idx The index on the Lua stack. - * @return True if the value evaluates to true, false otherwise. - **/ -bool luax_toboolean(lua_State *L, int idx); - -/** - * Pushes a bool onto the stack. It's the same as lua_pushboolean, - * but with bool instead of int. - * @param L The Lua state. - * @param b The bool to push. - **/ -void luax_pushboolean(lua_State *L, bool b); - -/** - * Converts the value at idx to a bool, or if not present, b is returned. - * @param L The Lua state. - * @param idx The index of the Lua stack. - * @param b The value to return if no value exist at the specified index. - * @return True if the value evaluates to true, false otherwise. - **/ -bool luax_optboolean(lua_State *L, int idx, bool b); - -/** - * Converts the value at idx to a std::string. It takes care of the string - * size and possible embedded nulls. - * @param L The Lua state. - * @param idx The index on the Lua stack. - * @return Copy of the string at the specified index. - **/ -std::string luax_checkstring(lua_State *L, int idx); - -/** - * Pushes a std::string onto the stack. It uses the length of the string - * for lua_pushlstring's len argument. - * @param L The Lua state. - * @param str The string to push. - **/ -void luax_pushstring(lua_State *L, std::string str); - -/** - * Require at least 'min' number of items on the stack. - * @param L The Lua state. - * @param min The minimum number of items on the stack. - * @return Zero if conditions are met, otherwise a Lua error (longjmp). - **/ -int luax_assert_argc(lua_State *L, int min); - -/** - * Require at least 'min', but more than 'max' items on the stack. - * @param L The Lua state. - * @param min The minimum number of items on the stack. - * @param max The maximum number of items on the stack. - * @return Zero if conditions are met, otherwise a Lua error (longjmp). - **/ -int luax_assert_argc(lua_State *L, int min, int max); - -/** - * Require that the value at idx is a function. - * @param L The Lua state. - *@param idx The index on the stack. - **/ -int luax_assert_function(lua_State *L, int idx); - -/** - * Register a module in the love table. The love table will be created if it does not exist. - * @param L The Lua state. - **/ -int luax_register_module(lua_State *L, const WrappedModule &m); - -/** - * Inserts a module with 'name' into the package.preloaded table. - * @param f The function to be called when the module is opened. - * @param name The name of the module, with 'love'-prefix, for instance 'love.graphics'. - **/ -int luax_preload(lua_State *L, lua_CFunction f, const char *name); - -/** - * Register a new type. - * @param tname The name of the type. This must not conflict with other type names, - * even from other modules. - * @param f The list of member functions for the type. - **/ -int luax_register_type(lua_State *L, const char *tname, const luaL_Reg *f = 0); - -/** - * Do a table.insert from C - * @param L the state - * @param tindex the stack index of the table - * @param vindex the stack index of the value - * @param pos the position to insert it in - **/ -int luax_table_insert(lua_State *L, int tindex, int vindex, int pos = -1); - -/** - * Register a new searcher function for package.loaders. This can for instance enable - * loading of files through love.filesystem using standard require. - * @param L The Lua state. - * @param f The searcher function. - * @param pos The position to insert the loader in. - **/ -int luax_register_searcher(lua_State *L, lua_CFunction f, int pos = -1); - -/** - * Creates a new Lua-accessible object of the given type, and put it on the stack. - * @param L The Lua state. - * @param name The name of the type. This must match the used earlier with luax_register_type. - * @param flags The type information. - * @param data The pointer to the actual object. - * @own Set this to true (default) if the object should be released upon garbage collection. - **/ -void luax_newtype(lua_State *L, const char *name, bits flags, void *data, bool own = true); - -/** - * Checks whether the value at idx is a certain type. - * @param L The Lua state. - * @param idx The index on the stack. - * @param type The type to check for. - * @return True if the value is Proxy of the specified type, false otherwise. - **/ -bool luax_istype(lua_State *L, int idx, love::bits type); - -/** - * Gets the function love.module.function and puts it on top of the stack (alone). If the - * love table, the module, or the function does not exist, an error is returned. - * @return An error if nonexistent, or 1 if successful. - **/ -int luax_getfunction(lua_State *L, const char *module, const char *function); - -/** - * Converts an object into another object by the specified function love.module.function. - * The conversion function must accept a single object of the relevant type as a parameter, - * and returnone value. If the function does not exist (see luax_getfunction), an error is returned. - * - * Note that the initial object at idx is replaced by the new object. - * - * @param L The Lua state. - * @param idx The index on the stack. - * @param module The module in the love table. - * @param function The function in the module. - **/ -int luax_convobj(lua_State *L, int idx, const char *module, const char *function); - -/** - * Converts an object into another object by the specified function love.module.function. - * The conversion function must accept a single object of the relevant type as its first parameter, - * and return one value. If the function does not exist (see luax_getfunction), an error is returned. - * - * Note that the initial object at idx is replaced by the new object. - * - * @param L The Lua state. - * @param idxs An array of indices on the stack. - * @param n How many arguments are being passed. - * @param module The module in the love table. - * @param function The function in the module. - **/ -int luax_convobj(lua_State *L, int idxs[], int n, const char *module, const char *function); - -/** - * 'Insist' that a table 'k' exists in the table at idx. Insistence involves that the - * table (k) is created if it does not exist in the table at idx. The table at idx must - * pre-exist, however. Also note that if the a non-table value exists at the specified - * location, it will be overwritten with a new table. The insisted table, and only the - * insisted table, will be placed on top of the stack. - * - * @param idx The index on the stack containing a table. - * @param k The name of the table we are insisting exist. - **/ -int luax_insist(lua_State *L, int idx, const char *k); - -/** - * Insist that a global table 'k' exists. See luax_insist. - * @param k The name of the table we are insisting exist. - **/ -int luax_insistglobal(lua_State *L, const char *k); - -/** - * Insists that a table 'k' exists inside the 'love' table. See luax_insist. - * @param k The name of the table we are insisting exist. - **/ -int luax_insistlove(lua_State *L, const char *k); - -/** - * Gets (creates if needed) the specified Registry, and puts it on top - * of the stack. - * @param L The Lua state. - * @param r The Registry to get. - **/ -int luax_getregistry(lua_State *L, Registry r); - -Type luax_type(lua_State *L, int idx); - -/** - * Convert the value at the specified index to an Lua number, and then - * convert to a float. - * - * @param L The Lua state. - * @param idx The index on the stack. - */ -inline float luax_tofloat(lua_State *L, int idx) -{ - return static_cast(lua_tonumber(L, idx)); -} - -/** - * Like luax_tofloat, but checks that the value is a number. - * - * @see luax_tofloat - */ -inline float luax_checkfloat(lua_State *L, int idx) -{ - return static_cast(luaL_checknumber(L, idx)); -} - -/** - * Converts the value at idx to the specified type without checking that - * this conversion is valid. If the type has been previously verified with - * luax_istype, then this can be safely used. Otherwise, use luax_checktype. - * @param L The Lua state. - * @param idx The index on the stack. - * @param name The name of the type. - * @param type The type bit. - **/ -template -T *luax_totype(lua_State *L, int idx, const char *, love::bits) -{ - return (T *)(((Proxy *)lua_touserdata(L, idx))->data); -} - -/** - * Like luax_totype, but causes an error if the value at idx is not Proxy, - * or is not the specified type. - * @param L The Lua state. - * @param idx The index on the stack. - * @param name The name of the type. - * @param type The type bit. - **/ -template -T *luax_checktype(lua_State *L, int idx, const char *name, love::bits type) -{ - if (lua_isuserdata(L, idx) == 0) - luaL_error(L, "Incorrect parameter type: expected userdata."); - - Proxy *u = (Proxy *)lua_touserdata(L, idx); - - if ((u->flags & type) != type) - luaL_error(L, "Incorrect parameter type: expected %s", name); - - return (T *)u->data; -} - -template -T *luax_getmodule(lua_State *L, const char *k, love::bits type) -{ - luax_getregistry(L, REGISTRY_MODULES); - lua_getfield(L, -1, k); - - if (!lua_isuserdata(L, -1)) - luaL_error(L, "Tried to get nonexisting module %s.", k); - - Proxy *u = (Proxy *)lua_touserdata(L, -1); - - if ((u->flags & type) != type) - luaL_error(L, "Incorrect module %s", k); - - lua_pop(L, 2); - - return (T *)u->data; -} - -} // love - -#endif // LOVE_RUNTIME_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_RUNTIME_H +#define LOVE_RUNTIME_H + +// LOVE +#include "types.h" + +// Lua +extern "C" { + #include + #include + #include +} + +namespace love +{ + +// Forward declarations. +class Module; +class Reference; + +// Exposed mutex of the GC +extern void *_gcmutex; +extern unsigned int _gcthread; + +/** + * Registries represent special tables which can be accessed with + * luax_getregistry. + **/ +enum Registry +{ + REGISTRY_GC = 1, + REGISTRY_MODULES, +}; + +/** + * This structure wraps all Lua-exposed objects. It exists in the + * Lua state as a full userdata (so we can catch __gc "events"), + * though the Object it refers to is light userdata in the sense + * that it is not allocated by the Lua VM. + **/ +struct Proxy +{ + // Holds type information (see types.h). + bits flags; + + // The light userdata. + void *data; + + // True if Lua should delete on GC. + bool own; +}; + +/** + * A Module with Lua wrapper functions and other data. + **/ +struct WrappedModule +{ + // The module containing the functions. + Module *module; + + // The name for the table to put the functions in, without the 'love'-prefix. + const char *name; + + // The type flags of this module. + love::bits flags; + + // The functions of the module (last element {0,0}). + const luaL_Reg *functions; + + // A list of functions which expose the types of the modules (last element 0). + const lua_CFunction *types; + +}; + +/** + * Returns a reference to the top stack element (-1) if the value + * is of the specified type. If the value is incorrect, zero is returned. + * + * In any case, the top stack element is popped, regardless of its type. + **/ +Reference *luax_refif (lua_State *L, int type); + +/** + * Prints the current contents of the stack. Only useful for debugging. + * @param L The Lua state. + **/ +void luax_printstack(lua_State *L); + +/** + * Converts the value at idx to a bool. It follow the same rules + * as lua_toboolean, but returns a bool instead of an int. + * @param L The Lua state. + * @param idx The index on the Lua stack. + * @return True if the value evaluates to true, false otherwise. + **/ +bool luax_toboolean(lua_State *L, int idx); + +/** + * Pushes a bool onto the stack. It's the same as lua_pushboolean, + * but with bool instead of int. + * @param L The Lua state. + * @param b The bool to push. + **/ +void luax_pushboolean(lua_State *L, bool b); + +/** + * Converts the value at idx to a bool, or if not present, b is returned. + * @param L The Lua state. + * @param idx The index of the Lua stack. + * @param b The value to return if no value exist at the specified index. + * @return True if the value evaluates to true, false otherwise. + **/ +bool luax_optboolean(lua_State *L, int idx, bool b); + +/** + * Converts the value at idx to a std::string. It takes care of the string + * size and possible embedded nulls. + * @param L The Lua state. + * @param idx The index on the Lua stack. + * @return Copy of the string at the specified index. + **/ +std::string luax_checkstring(lua_State *L, int idx); + +/** + * Pushes a std::string onto the stack. It uses the length of the string + * for lua_pushlstring's len argument. + * @param L The Lua state. + * @param str The string to push. + **/ +void luax_pushstring(lua_State *L, std::string str); + +/** + * Require at least 'min' number of items on the stack. + * @param L The Lua state. + * @param min The minimum number of items on the stack. + * @return Zero if conditions are met, otherwise a Lua error (longjmp). + **/ +int luax_assert_argc(lua_State *L, int min); + +/** + * Require at least 'min', but more than 'max' items on the stack. + * @param L The Lua state. + * @param min The minimum number of items on the stack. + * @param max The maximum number of items on the stack. + * @return Zero if conditions are met, otherwise a Lua error (longjmp). + **/ +int luax_assert_argc(lua_State *L, int min, int max); + +/** + * Require that the value at idx is a function. + * @param L The Lua state. + *@param idx The index on the stack. + **/ +int luax_assert_function(lua_State *L, int idx); + +/** + * Register a module in the love table. The love table will be created if it does not exist. + * @param L The Lua state. + **/ +int luax_register_module(lua_State *L, const WrappedModule &m); + +/** + * Inserts a module with 'name' into the package.preloaded table. + * @param f The function to be called when the module is opened. + * @param name The name of the module, with 'love'-prefix, for instance 'love.graphics'. + **/ +int luax_preload(lua_State *L, lua_CFunction f, const char *name); + +/** + * Register a new type. + * @param tname The name of the type. This must not conflict with other type names, + * even from other modules. + * @param f The list of member functions for the type. + **/ +int luax_register_type(lua_State *L, const char *tname, const luaL_Reg *f = 0); + +/** + * Do a table.insert from C + * @param L the state + * @param tindex the stack index of the table + * @param vindex the stack index of the value + * @param pos the position to insert it in + **/ +int luax_table_insert(lua_State *L, int tindex, int vindex, int pos = -1); + +/** + * Register a new searcher function for package.loaders. This can for instance enable + * loading of files through love.filesystem using standard require. + * @param L The Lua state. + * @param f The searcher function. + * @param pos The position to insert the loader in. + **/ +int luax_register_searcher(lua_State *L, lua_CFunction f, int pos = -1); + +/** + * Creates a new Lua-accessible object of the given type, and put it on the stack. + * @param L The Lua state. + * @param name The name of the type. This must match the used earlier with luax_register_type. + * @param flags The type information. + * @param data The pointer to the actual object. + * @own Set this to true (default) if the object should be released upon garbage collection. + **/ +void luax_newtype(lua_State *L, const char *name, bits flags, void *data, bool own = true); + +/** + * Checks whether the value at idx is a certain type. + * @param L The Lua state. + * @param idx The index on the stack. + * @param type The type to check for. + * @return True if the value is Proxy of the specified type, false otherwise. + **/ +bool luax_istype(lua_State *L, int idx, love::bits type); + +/** + * Gets the function love.module.function and puts it on top of the stack (alone). If the + * love table, the module, or the function does not exist, an error is returned. + * @return An error if nonexistent, or 1 if successful. + **/ +int luax_getfunction(lua_State *L, const char *module, const char *function); + +/** + * Converts an object into another object by the specified function love.module.function. + * The conversion function must accept a single object of the relevant type as a parameter, + * and returnone value. If the function does not exist (see luax_getfunction), an error is returned. + * + * Note that the initial object at idx is replaced by the new object. + * + * @param L The Lua state. + * @param idx The index on the stack. + * @param module The module in the love table. + * @param function The function in the module. + **/ +int luax_convobj(lua_State *L, int idx, const char *module, const char *function); + +/** + * Converts an object into another object by the specified function love.module.function. + * The conversion function must accept a single object of the relevant type as its first parameter, + * and return one value. If the function does not exist (see luax_getfunction), an error is returned. + * + * Note that the initial object at idx is replaced by the new object. + * + * @param L The Lua state. + * @param idxs An array of indices on the stack. + * @param n How many arguments are being passed. + * @param module The module in the love table. + * @param function The function in the module. + **/ +int luax_convobj(lua_State *L, int idxs[], int n, const char *module, const char *function); + +/** + * 'Insist' that a table 'k' exists in the table at idx. Insistence involves that the + * table (k) is created if it does not exist in the table at idx. The table at idx must + * pre-exist, however. Also note that if the a non-table value exists at the specified + * location, it will be overwritten with a new table. The insisted table, and only the + * insisted table, will be placed on top of the stack. + * + * @param idx The index on the stack containing a table. + * @param k The name of the table we are insisting exist. + **/ +int luax_insist(lua_State *L, int idx, const char *k); + +/** + * Insist that a global table 'k' exists. See luax_insist. + * @param k The name of the table we are insisting exist. + **/ +int luax_insistglobal(lua_State *L, const char *k); + +/** + * Insists that a table 'k' exists inside the 'love' table. See luax_insist. + * @param k The name of the table we are insisting exist. + **/ +int luax_insistlove(lua_State *L, const char *k); + +/** + * Gets (creates if needed) the specified Registry, and puts it on top + * of the stack. + * @param L The Lua state. + * @param r The Registry to get. + **/ +int luax_getregistry(lua_State *L, Registry r); + +Type luax_type(lua_State *L, int idx); + +/** + * Convert the value at the specified index to an Lua number, and then + * convert to a float. + * + * @param L The Lua state. + * @param idx The index on the stack. + */ +inline float luax_tofloat(lua_State *L, int idx) +{ + return static_cast(lua_tonumber(L, idx)); +} + +/** + * Like luax_tofloat, but checks that the value is a number. + * + * @see luax_tofloat + */ +inline float luax_checkfloat(lua_State *L, int idx) +{ + return static_cast(luaL_checknumber(L, idx)); +} + +/** + * Converts the value at idx to the specified type without checking that + * this conversion is valid. If the type has been previously verified with + * luax_istype, then this can be safely used. Otherwise, use luax_checktype. + * @param L The Lua state. + * @param idx The index on the stack. + * @param name The name of the type. + * @param type The type bit. + **/ +template +T *luax_totype(lua_State *L, int idx, const char *, love::bits) +{ + return (T *)(((Proxy *)lua_touserdata(L, idx))->data); +} + +/** + * Like luax_totype, but causes an error if the value at idx is not Proxy, + * or is not the specified type. + * @param L The Lua state. + * @param idx The index on the stack. + * @param name The name of the type. + * @param type The type bit. + **/ +template +T *luax_checktype(lua_State *L, int idx, const char *name, love::bits type) +{ + if (lua_isuserdata(L, idx) == 0) + luaL_error(L, "Incorrect parameter type: expected userdata."); + + Proxy *u = (Proxy *)lua_touserdata(L, idx); + + if ((u->flags & type) != type) + luaL_error(L, "Incorrect parameter type: expected %s", name); + + return (T *)u->data; +} + +template +T *luax_getmodule(lua_State *L, const char *k, love::bits type) +{ + luax_getregistry(L, REGISTRY_MODULES); + lua_getfield(L, -1, k); + + if (!lua_isuserdata(L, -1)) + luaL_error(L, "Tried to get nonexisting module %s.", k); + + Proxy *u = (Proxy *)lua_touserdata(L, -1); + + if ((u->flags & type) != type) + luaL_error(L, "Incorrect module %s", k); + + lua_pop(L, 2); + + return (T *)u->data; +} + +} // love + +#endif // LOVE_RUNTIME_H diff --git a/src/common/types.h b/src/common/types.h index 4b0ea2898..f245edfa3 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -1,174 +1,174 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_TYPES_H -#define LOVE_TYPES_H - -// STD -#include - -namespace love -{ - -enum Type -{ - INVALID_ID = 0, - // Cross-module types. - OBJECT_ID, - DATA_ID, - MODULE_ID, - - // Filesystem. - FILESYSTEM_FILE_ID, - FILESYSTEM_FILE_DATA_ID, - - // Font - FONT_GLYPH_DATA_ID, - FONT_RASTERIZER_ID, - - // Graphics - GRAPHICS_DRAWABLE_ID, - GRAPHICS_DRAWQABLE_ID, - GRAPHICS_IMAGE_ID, - GRAPHICS_QUAD_ID, - GRAPHICS_FONT_ID, - GRAPHICS_PARTICLE_SYSTEM_ID, - GRAPHICS_SPRITE_BATCH_ID, - GRAPHICS_CANVAS_ID, - GRAPHICS_PIXELEFFECT_ID, - - // Image - IMAGE_IMAGE_DATA_ID, - IMAGE_ENCODED_IMAGE_DATA_ID, - - // Audio - AUDIO_SOURCE_ID, - - // Sound - SOUND_SOUND_DATA_ID, - SOUND_DECODER_ID, - - // Physics - PHYSICS_WORLD_ID, - PHYSICS_CONTACT_ID, - PHYSICS_BODY_ID, - PHYSICS_FIXTURE_ID, - PHYSICS_SHAPE_ID, - PHYSICS_CIRCLE_SHAPE_ID, - PHYSICS_POLYGON_SHAPE_ID, - PHYSICS_EDGE_SHAPE_ID, - PHYSICS_CHAIN_SHAPE_ID, - PHYSICS_JOINT_ID, - PHYSICS_MOUSE_JOINT_ID, - PHYSICS_DISTANCE_JOINT_ID, - PHYSICS_PRISMATIC_JOINT_ID, - PHYSICS_REVOLUTE_JOINT_ID, - PHYSICS_PULLEY_JOINT_ID, - PHYSICS_GEAR_JOINT_ID, - PHYSICS_FRICTION_JOINT_ID, - PHYSICS_WELD_JOINT_ID, - PHYSICS_ROPE_JOINT_ID, - PHYSICS_WHEEL_JOINT_ID, - - // Thread - THREAD_THREAD_ID, - - // The modules themselves. Only add abstracted modules here. - MODULE_FILESYSTEM_ID, - MODULE_IMAGE_ID, - MODULE_SOUND_ID, - - // Count the number of bits needed. - TYPE_MAX_ENUM -}; - -typedef std::bitset bits; - -const bits INVALID_T = bits(1) << INVALID_ID; - -const bits OBJECT_T = bits(1) << OBJECT_ID; -const bits DATA_T = (bits(1) << DATA_ID) | OBJECT_T; -const bits MODULE_T = (bits(1) << MODULE_ID) | OBJECT_T; - -// Filesystem. -const bits FILESYSTEM_FILE_T = (bits(1) << FILESYSTEM_FILE_ID) | OBJECT_T; -const bits FILESYSTEM_FILE_DATA_T = (bits(1) << FILESYSTEM_FILE_DATA_ID) | DATA_T; - -const bits FONT_GLYPH_DATA_T = (bits(1) << FONT_GLYPH_DATA_ID) | DATA_T; -const bits FONT_RASTERIZER_T = (bits(1) << FONT_RASTERIZER_ID) | OBJECT_T; - -// Graphics. -const bits GRAPHICS_DRAWABLE_T = (bits(1) << GRAPHICS_DRAWABLE_ID) | OBJECT_T; -const bits GRAPHICS_DRAWQABLE_T = (bits(1) << GRAPHICS_DRAWQABLE_ID) | GRAPHICS_DRAWABLE_T; -const bits GRAPHICS_IMAGE_T = (bits(1) << GRAPHICS_IMAGE_ID) | GRAPHICS_DRAWQABLE_T; -const bits GRAPHICS_QUAD_T = (bits(1) << GRAPHICS_QUAD_ID) | OBJECT_T; -const bits GRAPHICS_FONT_T = (bits(1) << GRAPHICS_FONT_ID) | OBJECT_T; -const bits GRAPHICS_PARTICLE_SYSTEM_T = (bits(1) << GRAPHICS_PARTICLE_SYSTEM_ID) | GRAPHICS_DRAWABLE_T; -const bits GRAPHICS_SPRITE_BATCH_T = (bits(1) << GRAPHICS_SPRITE_BATCH_ID) | GRAPHICS_DRAWABLE_T; -const bits GRAPHICS_CANVAS_T = (bits(1) << GRAPHICS_CANVAS_ID) | GRAPHICS_DRAWQABLE_T; -const bits GRAPHICS_PIXELEFFECT_T = (bits(1) << GRAPHICS_PIXELEFFECT_ID) | OBJECT_T; - -// Image. -const bits IMAGE_IMAGE_DATA_T = (bits(1) << IMAGE_IMAGE_DATA_ID) | DATA_T; -const bits IMAGE_ENCODED_IMAGE_DATA_T = (bits(1) << IMAGE_ENCODED_IMAGE_DATA_ID) | DATA_T; - -// Audio. -const bits AUDIO_SOURCE_T = (bits(1) << AUDIO_SOURCE_ID) | OBJECT_T; - -// Sound. -const bits SOUND_SOUND_DATA_T = (bits(1) << SOUND_SOUND_DATA_ID) | DATA_T; -const bits SOUND_DECODER_T = bits(1) << SOUND_DECODER_ID; - -// Physics. -const bits PHYSICS_WORLD_T = (bits(1) << PHYSICS_WORLD_ID) | OBJECT_T; -const bits PHYSICS_CONTACT_T = (bits(1) << PHYSICS_CONTACT_ID) | OBJECT_T; -const bits PHYSICS_BODY_T = (bits(1) << PHYSICS_BODY_ID) | OBJECT_T; -const bits PHYSICS_FIXTURE_T = (bits(1) << PHYSICS_FIXTURE_ID) | OBJECT_T; -const bits PHYSICS_SHAPE_T = (bits(1) << PHYSICS_SHAPE_ID) | OBJECT_T; -const bits PHYSICS_CIRCLE_SHAPE_T = (bits(1) << PHYSICS_CIRCLE_SHAPE_ID) | PHYSICS_SHAPE_T; -const bits PHYSICS_POLYGON_SHAPE_T = (bits(1) << PHYSICS_POLYGON_SHAPE_ID) | PHYSICS_SHAPE_T; -const bits PHYSICS_EDGE_SHAPE_T = (bits(1) << PHYSICS_EDGE_SHAPE_ID) | PHYSICS_SHAPE_T; -const bits PHYSICS_CHAIN_SHAPE_T = (bits(1) << PHYSICS_CHAIN_SHAPE_ID) | PHYSICS_SHAPE_T; -const bits PHYSICS_JOINT_T = (bits(1) << PHYSICS_JOINT_ID) | OBJECT_T; -const bits PHYSICS_MOUSE_JOINT_T = (bits(1) << PHYSICS_MOUSE_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_DISTANCE_JOINT_T = (bits(1) << PHYSICS_DISTANCE_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_PRISMATIC_JOINT_T = (bits(1) << PHYSICS_PRISMATIC_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_REVOLUTE_JOINT_T = (bits(1) << PHYSICS_REVOLUTE_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_PULLEY_JOINT_T = (bits(1) << PHYSICS_PULLEY_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_GEAR_JOINT_T = (bits(1) << PHYSICS_GEAR_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_FRICTION_JOINT_T = (bits(1) << PHYSICS_FRICTION_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_WELD_JOINT_T = (bits(1) << PHYSICS_WELD_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_ROPE_JOINT_T = (bits(1) << PHYSICS_ROPE_JOINT_ID) | PHYSICS_JOINT_T; -const bits PHYSICS_WHEEL_JOINT_T = (bits(1) << PHYSICS_WHEEL_JOINT_ID) | PHYSICS_JOINT_T; - -// Thread. -const bits THREAD_THREAD_T = (bits(1) << THREAD_THREAD_ID) | OBJECT_T; - -// Modules. -const bits MODULE_FILESYSTEM_T = (bits(1) << MODULE_FILESYSTEM_ID) | MODULE_T; -const bits MODULE_IMAGE_T = (bits(1) << MODULE_IMAGE_ID) | MODULE_T; -const bits MODULE_SOUND_T = (bits(1) << MODULE_SOUND_ID) | MODULE_T; - -bool getType(const char *in, Type &out); -bool getType(Type in, const char *&out); - -} // love - -#endif // LOVE_TYPES_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_TYPES_H +#define LOVE_TYPES_H + +// STD +#include + +namespace love +{ + +enum Type +{ + INVALID_ID = 0, + // Cross-module types. + OBJECT_ID, + DATA_ID, + MODULE_ID, + + // Filesystem. + FILESYSTEM_FILE_ID, + FILESYSTEM_FILE_DATA_ID, + + // Font + FONT_GLYPH_DATA_ID, + FONT_RASTERIZER_ID, + + // Graphics + GRAPHICS_DRAWABLE_ID, + GRAPHICS_DRAWQABLE_ID, + GRAPHICS_IMAGE_ID, + GRAPHICS_QUAD_ID, + GRAPHICS_FONT_ID, + GRAPHICS_PARTICLE_SYSTEM_ID, + GRAPHICS_SPRITE_BATCH_ID, + GRAPHICS_CANVAS_ID, + GRAPHICS_PIXELEFFECT_ID, + + // Image + IMAGE_IMAGE_DATA_ID, + IMAGE_ENCODED_IMAGE_DATA_ID, + + // Audio + AUDIO_SOURCE_ID, + + // Sound + SOUND_SOUND_DATA_ID, + SOUND_DECODER_ID, + + // Physics + PHYSICS_WORLD_ID, + PHYSICS_CONTACT_ID, + PHYSICS_BODY_ID, + PHYSICS_FIXTURE_ID, + PHYSICS_SHAPE_ID, + PHYSICS_CIRCLE_SHAPE_ID, + PHYSICS_POLYGON_SHAPE_ID, + PHYSICS_EDGE_SHAPE_ID, + PHYSICS_CHAIN_SHAPE_ID, + PHYSICS_JOINT_ID, + PHYSICS_MOUSE_JOINT_ID, + PHYSICS_DISTANCE_JOINT_ID, + PHYSICS_PRISMATIC_JOINT_ID, + PHYSICS_REVOLUTE_JOINT_ID, + PHYSICS_PULLEY_JOINT_ID, + PHYSICS_GEAR_JOINT_ID, + PHYSICS_FRICTION_JOINT_ID, + PHYSICS_WELD_JOINT_ID, + PHYSICS_ROPE_JOINT_ID, + PHYSICS_WHEEL_JOINT_ID, + + // Thread + THREAD_THREAD_ID, + + // The modules themselves. Only add abstracted modules here. + MODULE_FILESYSTEM_ID, + MODULE_IMAGE_ID, + MODULE_SOUND_ID, + + // Count the number of bits needed. + TYPE_MAX_ENUM +}; + +typedef std::bitset bits; + +const bits INVALID_T = bits(1) << INVALID_ID; + +const bits OBJECT_T = bits(1) << OBJECT_ID; +const bits DATA_T = (bits(1) << DATA_ID) | OBJECT_T; +const bits MODULE_T = (bits(1) << MODULE_ID) | OBJECT_T; + +// Filesystem. +const bits FILESYSTEM_FILE_T = (bits(1) << FILESYSTEM_FILE_ID) | OBJECT_T; +const bits FILESYSTEM_FILE_DATA_T = (bits(1) << FILESYSTEM_FILE_DATA_ID) | DATA_T; + +const bits FONT_GLYPH_DATA_T = (bits(1) << FONT_GLYPH_DATA_ID) | DATA_T; +const bits FONT_RASTERIZER_T = (bits(1) << FONT_RASTERIZER_ID) | OBJECT_T; + +// Graphics. +const bits GRAPHICS_DRAWABLE_T = (bits(1) << GRAPHICS_DRAWABLE_ID) | OBJECT_T; +const bits GRAPHICS_DRAWQABLE_T = (bits(1) << GRAPHICS_DRAWQABLE_ID) | GRAPHICS_DRAWABLE_T; +const bits GRAPHICS_IMAGE_T = (bits(1) << GRAPHICS_IMAGE_ID) | GRAPHICS_DRAWQABLE_T; +const bits GRAPHICS_QUAD_T = (bits(1) << GRAPHICS_QUAD_ID) | OBJECT_T; +const bits GRAPHICS_FONT_T = (bits(1) << GRAPHICS_FONT_ID) | OBJECT_T; +const bits GRAPHICS_PARTICLE_SYSTEM_T = (bits(1) << GRAPHICS_PARTICLE_SYSTEM_ID) | GRAPHICS_DRAWABLE_T; +const bits GRAPHICS_SPRITE_BATCH_T = (bits(1) << GRAPHICS_SPRITE_BATCH_ID) | GRAPHICS_DRAWABLE_T; +const bits GRAPHICS_CANVAS_T = (bits(1) << GRAPHICS_CANVAS_ID) | GRAPHICS_DRAWQABLE_T; +const bits GRAPHICS_PIXELEFFECT_T = (bits(1) << GRAPHICS_PIXELEFFECT_ID) | OBJECT_T; + +// Image. +const bits IMAGE_IMAGE_DATA_T = (bits(1) << IMAGE_IMAGE_DATA_ID) | DATA_T; +const bits IMAGE_ENCODED_IMAGE_DATA_T = (bits(1) << IMAGE_ENCODED_IMAGE_DATA_ID) | DATA_T; + +// Audio. +const bits AUDIO_SOURCE_T = (bits(1) << AUDIO_SOURCE_ID) | OBJECT_T; + +// Sound. +const bits SOUND_SOUND_DATA_T = (bits(1) << SOUND_SOUND_DATA_ID) | DATA_T; +const bits SOUND_DECODER_T = bits(1) << SOUND_DECODER_ID; + +// Physics. +const bits PHYSICS_WORLD_T = (bits(1) << PHYSICS_WORLD_ID) | OBJECT_T; +const bits PHYSICS_CONTACT_T = (bits(1) << PHYSICS_CONTACT_ID) | OBJECT_T; +const bits PHYSICS_BODY_T = (bits(1) << PHYSICS_BODY_ID) | OBJECT_T; +const bits PHYSICS_FIXTURE_T = (bits(1) << PHYSICS_FIXTURE_ID) | OBJECT_T; +const bits PHYSICS_SHAPE_T = (bits(1) << PHYSICS_SHAPE_ID) | OBJECT_T; +const bits PHYSICS_CIRCLE_SHAPE_T = (bits(1) << PHYSICS_CIRCLE_SHAPE_ID) | PHYSICS_SHAPE_T; +const bits PHYSICS_POLYGON_SHAPE_T = (bits(1) << PHYSICS_POLYGON_SHAPE_ID) | PHYSICS_SHAPE_T; +const bits PHYSICS_EDGE_SHAPE_T = (bits(1) << PHYSICS_EDGE_SHAPE_ID) | PHYSICS_SHAPE_T; +const bits PHYSICS_CHAIN_SHAPE_T = (bits(1) << PHYSICS_CHAIN_SHAPE_ID) | PHYSICS_SHAPE_T; +const bits PHYSICS_JOINT_T = (bits(1) << PHYSICS_JOINT_ID) | OBJECT_T; +const bits PHYSICS_MOUSE_JOINT_T = (bits(1) << PHYSICS_MOUSE_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_DISTANCE_JOINT_T = (bits(1) << PHYSICS_DISTANCE_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_PRISMATIC_JOINT_T = (bits(1) << PHYSICS_PRISMATIC_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_REVOLUTE_JOINT_T = (bits(1) << PHYSICS_REVOLUTE_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_PULLEY_JOINT_T = (bits(1) << PHYSICS_PULLEY_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_GEAR_JOINT_T = (bits(1) << PHYSICS_GEAR_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_FRICTION_JOINT_T = (bits(1) << PHYSICS_FRICTION_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_WELD_JOINT_T = (bits(1) << PHYSICS_WELD_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_ROPE_JOINT_T = (bits(1) << PHYSICS_ROPE_JOINT_ID) | PHYSICS_JOINT_T; +const bits PHYSICS_WHEEL_JOINT_T = (bits(1) << PHYSICS_WHEEL_JOINT_ID) | PHYSICS_JOINT_T; + +// Thread. +const bits THREAD_THREAD_T = (bits(1) << THREAD_THREAD_ID) | OBJECT_T; + +// Modules. +const bits MODULE_FILESYSTEM_T = (bits(1) << MODULE_FILESYSTEM_ID) | MODULE_T; +const bits MODULE_IMAGE_T = (bits(1) << MODULE_IMAGE_ID) | MODULE_T; +const bits MODULE_SOUND_T = (bits(1) << MODULE_SOUND_ID) | MODULE_T; + +bool getType(const char *in, Type &out); +bool getType(Type in, const char *&out); + +} // love + +#endif // LOVE_TYPES_H diff --git a/src/common/utf8.cpp b/src/common/utf8.cpp index 4716b41a8..82fecdcca 100644 --- a/src/common/utf8.cpp +++ b/src/common/utf8.cpp @@ -1,61 +1,61 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "utf8.h" - -#ifdef LOVE_WINDOWS - -namespace love -{ - -std::string to_utf8(LPCWSTR wstr) -{ - size_t wide_len = wcslen(wstr)+1; - - // Get size in UTF-8. - int utf8_size = WideCharToMultiByte(CP_UTF8, 0, wstr, wide_len, 0, 0, 0, 0); - - char *utf8_str = new char[utf8_size]; - - // Convert to UTF-8. - int ok = WideCharToMultiByte(CP_UTF8, 0, wstr, wide_len, utf8_str, utf8_size, 0, 0); - - std::string ret; - if (ok) - ret = utf8_str; - - delete[] utf8_str; - return ret; -} - -void replace_char(std::string &str, char find, char replace) -{ - int length = str.length(); - - for (int i = 0; i -#include - -namespace love -{ - -/** - * Convert the wide string to a UTF-8 encoded string. - * @param wstr The wide-char string. - * @return A UTF-8 string. - **/ -std::string to_utf8(LPCWSTR wstr); - -/** - * Replace all occurences of 'find' with 'replace' in a string. - * @param str The string to modify. - * @param find The character to match. - * @param replace The character to replace matches. - **/ -void replace_char(std::string &str, char find, char replace); - -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "config.h" + +#ifdef LOVE_WINDOWS + +#include +#include + +namespace love +{ + +/** + * Convert the wide string to a UTF-8 encoded string. + * @param wstr The wide-char string. + * @return A UTF-8 string. + **/ +std::string to_utf8(LPCWSTR wstr); + +/** + * Replace all occurences of 'find' with 'replace' in a string. + * @param str The string to modify. + * @param find The character to match. + * @param replace The character to replace matches. + **/ +void replace_char(std::string &str, char find, char replace); + +} // love + #endif // LOVE_WINDOWS \ No newline at end of file diff --git a/src/common/version.h b/src/common/version.h index 88ab7c60e..ca1dd3577 100644 --- a/src/common/version.h +++ b/src/common/version.h @@ -1,37 +1,37 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_VERSION_H -#define LOVE_VERSION_H - -namespace love -{ - -// Version stuff. -const int VERSION_MAJOR = 0; -const int VERSION_MINOR = 8; -const int VERSION_REV = 0; -const char *VERSION = "0.8.0"; -const char *VERSION_COMPATIBILITY[] = { VERSION, 0 }; -const char *VERSION_CODENAME = "Rubber Piggy"; - -} // love - -#endif // LOVE_VERSION_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_VERSION_H +#define LOVE_VERSION_H + +namespace love +{ + +// Version stuff. +const int VERSION_MAJOR = 0; +const int VERSION_MINOR = 8; +const int VERSION_REV = 0; +const char *VERSION = "0.8.0"; +const char *VERSION_COMPATIBILITY[] = { VERSION, 0 }; +const char *VERSION_CODENAME = "Rubber Piggy"; + +} // love + +#endif // LOVE_VERSION_H diff --git a/src/common/wrap_Data.cpp b/src/common/wrap_Data.cpp index 59e40d93c..13cf27f10 100644 --- a/src/common/wrap_Data.cpp +++ b/src/common/wrap_Data.cpp @@ -1,58 +1,58 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Data.h" - -namespace love -{ - -Data *luax_checkdata(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Data", DATA_T); -} - -int w_Data_getPointer(lua_State *L) -{ - Data *t = luax_checkdata(L, 1); - lua_pushlightuserdata(L, t->getData()); - return 1; -} - -int w_Data_getSize(lua_State *L) -{ - Data *t = luax_checkdata(L, 1); - lua_pushinteger(L, t->getSize()); - return 1; -} - -const luaL_Reg w_Data_functions[] = -{ - { "getPointer", w_Data_getPointer }, - { "getSize", w_Data_getSize }, - { 0, 0 } -}; - -int w_Data_open(lua_State *L) -{ - luax_register_type(L, "Data", w_Data_functions); - return 0; -} - -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Data.h" + +namespace love +{ + +Data *luax_checkdata(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Data", DATA_T); +} + +int w_Data_getPointer(lua_State *L) +{ + Data *t = luax_checkdata(L, 1); + lua_pushlightuserdata(L, t->getData()); + return 1; +} + +int w_Data_getSize(lua_State *L) +{ + Data *t = luax_checkdata(L, 1); + lua_pushinteger(L, t->getSize()); + return 1; +} + +const luaL_Reg w_Data_functions[] = +{ + { "getPointer", w_Data_getPointer }, + { "getSize", w_Data_getSize }, + { 0, 0 } +}; + +int w_Data_open(lua_State *L) +{ + luax_register_type(L, "Data", w_Data_functions); + return 0; +} + +} // love diff --git a/src/common/wrap_Data.h b/src/common/wrap_Data.h index 2d9c7f018..fab3f076b 100644 --- a/src/common/wrap_Data.h +++ b/src/common/wrap_Data.h @@ -1,38 +1,38 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_WRAP_DATA_H -#define LOVE_WRAP_DATA_H - -// LOVE -#include "runtime.h" -#include "Data.h" - -namespace love -{ - -Data *luax_checkdata(lua_State *L, int idx); -int w_Data_getPointer(lua_State *L); -int w_Data_getSize(lua_State *L); -int w_Data_open(lua_State *L); - -} // love - -#endif // LOVE_WRAP_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_WRAP_DATA_H +#define LOVE_WRAP_DATA_H + +// LOVE +#include "runtime.h" +#include "Data.h" + +namespace love +{ + +Data *luax_checkdata(lua_State *L, int idx); +int w_Data_getPointer(lua_State *L); +int w_Data_getSize(lua_State *L); +int w_Data_open(lua_State *L); + +} // love + +#endif // LOVE_WRAP_DATA_H diff --git a/src/libraries/Box2D/Box2D.h b/src/libraries/Box2D/Box2D.h index 66d221742..f674d8226 100755 --- a/src/libraries/Box2D/Box2D.h +++ b/src/libraries/Box2D/Box2D.h @@ -1,67 +1,67 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef BOX2D_H -#define BOX2D_H - -/** -\mainpage Box2D API Documentation - -\section intro_sec Getting Started - -For documentation please see http://box2d.org/documentation.html - -For discussion please visit http://box2d.org/forum -*/ - -// These include files constitute the main Box2D API - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BOX2D_H +#define BOX2D_H + +/** +\mainpage Box2D API Documentation + +\section intro_sec Getting Started + +For documentation please see http://box2d.org/documentation.html + +For discussion please visit http://box2d.org/forum +*/ + +// These include files constitute the main Box2D API + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/src/libraries/Box2D/Collision/Shapes/b2ChainShape.cpp b/src/libraries/Box2D/Collision/Shapes/b2ChainShape.cpp index f7bbe06b6..bd23346a5 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2ChainShape.cpp +++ b/src/libraries/Box2D/Collision/Shapes/b2ChainShape.cpp @@ -1,171 +1,171 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -using namespace std; - -b2ChainShape::~b2ChainShape() -{ - b2Free(m_vertices); - m_vertices = NULL; - m_count = 0; -} - -void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count) -{ - b2Assert(m_vertices == NULL && m_count == 0); - b2Assert(count >= 3); - m_count = count + 1; - m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - memcpy(m_vertices, vertices, count * sizeof(b2Vec2)); - m_vertices[count] = m_vertices[0]; - m_prevVertex = m_vertices[m_count - 2]; - m_nextVertex = m_vertices[1]; - m_hasPrevVertex = true; - m_hasNextVertex = true; -} - -void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count) -{ - b2Assert(m_vertices == NULL && m_count == 0); - b2Assert(count >= 2); - m_count = count; - m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2)); - memcpy(m_vertices, vertices, m_count * sizeof(b2Vec2)); - m_hasPrevVertex = false; - m_hasNextVertex = false; -} - -void b2ChainShape::SetPrevVertex(const b2Vec2& prevVertex) -{ - m_prevVertex = prevVertex; - m_hasPrevVertex = true; -} - -void b2ChainShape::SetNextVertex(const b2Vec2& nextVertex) -{ - m_nextVertex = nextVertex; - m_hasNextVertex = true; -} - -b2Shape* b2ChainShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2ChainShape)); - b2ChainShape* clone = new (mem) b2ChainShape; - clone->CreateChain(m_vertices, m_count); - clone->m_prevVertex = m_prevVertex; - clone->m_nextVertex = m_nextVertex; - clone->m_hasPrevVertex = m_hasPrevVertex; - clone->m_hasNextVertex = m_hasNextVertex; - return clone; -} - -int32 b2ChainShape::GetChildCount() const -{ - // edge count = vertex count - 1 - return m_count - 1; -} - -void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const -{ - b2Assert(0 <= index && index < m_count - 1); - edge->m_type = b2Shape::e_edge; - edge->m_radius = m_radius; - - edge->m_vertex1 = m_vertices[index + 0]; - edge->m_vertex2 = m_vertices[index + 1]; - - if (index > 0) - { - edge->m_vertex0 = m_vertices[index - 1]; - edge->m_hasVertex0 = true; - } - else - { - edge->m_vertex0 = m_prevVertex; - edge->m_hasVertex0 = m_hasPrevVertex; - } - - if (index < m_count - 2) - { - edge->m_vertex3 = m_vertices[index + 2]; - edge->m_hasVertex3 = true; - } - else - { - edge->m_vertex3 = m_nextVertex; - edge->m_hasVertex3 = m_hasNextVertex; - } -} - -bool b2ChainShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - B2_NOT_USED(xf); - B2_NOT_USED(p); - return false; -} - -bool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - b2Assert(childIndex < m_count); - - b2EdgeShape edgeShape; - - int32 i1 = childIndex; - int32 i2 = childIndex + 1; - if (i2 == m_count) - { - i2 = 0; - } - - edgeShape.m_vertex1 = m_vertices[i1]; - edgeShape.m_vertex2 = m_vertices[i2]; - - return edgeShape.RayCast(output, input, xf, 0); -} - -void b2ChainShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - b2Assert(childIndex < m_count); - - int32 i1 = childIndex; - int32 i2 = childIndex + 1; - if (i2 == m_count) - { - i2 = 0; - } - - b2Vec2 v1 = b2Mul(xf, m_vertices[i1]); - b2Vec2 v2 = b2Mul(xf, m_vertices[i2]); - - aabb->lowerBound = b2Min(v1, v2); - aabb->upperBound = b2Max(v1, v2); -} - -void b2ChainShape::ComputeMass(b2MassData* massData, float32 density) const -{ - B2_NOT_USED(density); - - massData->mass = 0.0f; - massData->center.SetZero(); - massData->I = 0.0f; -} +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +using namespace std; + +b2ChainShape::~b2ChainShape() +{ + b2Free(m_vertices); + m_vertices = NULL; + m_count = 0; +} + +void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count) +{ + b2Assert(m_vertices == NULL && m_count == 0); + b2Assert(count >= 3); + m_count = count + 1; + m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + memcpy(m_vertices, vertices, count * sizeof(b2Vec2)); + m_vertices[count] = m_vertices[0]; + m_prevVertex = m_vertices[m_count - 2]; + m_nextVertex = m_vertices[1]; + m_hasPrevVertex = true; + m_hasNextVertex = true; +} + +void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count) +{ + b2Assert(m_vertices == NULL && m_count == 0); + b2Assert(count >= 2); + m_count = count; + m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2)); + memcpy(m_vertices, vertices, m_count * sizeof(b2Vec2)); + m_hasPrevVertex = false; + m_hasNextVertex = false; +} + +void b2ChainShape::SetPrevVertex(const b2Vec2& prevVertex) +{ + m_prevVertex = prevVertex; + m_hasPrevVertex = true; +} + +void b2ChainShape::SetNextVertex(const b2Vec2& nextVertex) +{ + m_nextVertex = nextVertex; + m_hasNextVertex = true; +} + +b2Shape* b2ChainShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2ChainShape)); + b2ChainShape* clone = new (mem) b2ChainShape; + clone->CreateChain(m_vertices, m_count); + clone->m_prevVertex = m_prevVertex; + clone->m_nextVertex = m_nextVertex; + clone->m_hasPrevVertex = m_hasPrevVertex; + clone->m_hasNextVertex = m_hasNextVertex; + return clone; +} + +int32 b2ChainShape::GetChildCount() const +{ + // edge count = vertex count - 1 + return m_count - 1; +} + +void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const +{ + b2Assert(0 <= index && index < m_count - 1); + edge->m_type = b2Shape::e_edge; + edge->m_radius = m_radius; + + edge->m_vertex1 = m_vertices[index + 0]; + edge->m_vertex2 = m_vertices[index + 1]; + + if (index > 0) + { + edge->m_vertex0 = m_vertices[index - 1]; + edge->m_hasVertex0 = true; + } + else + { + edge->m_vertex0 = m_prevVertex; + edge->m_hasVertex0 = m_hasPrevVertex; + } + + if (index < m_count - 2) + { + edge->m_vertex3 = m_vertices[index + 2]; + edge->m_hasVertex3 = true; + } + else + { + edge->m_vertex3 = m_nextVertex; + edge->m_hasVertex3 = m_hasNextVertex; + } +} + +bool b2ChainShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + B2_NOT_USED(xf); + B2_NOT_USED(p); + return false; +} + +bool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + b2Assert(childIndex < m_count); + + b2EdgeShape edgeShape; + + int32 i1 = childIndex; + int32 i2 = childIndex + 1; + if (i2 == m_count) + { + i2 = 0; + } + + edgeShape.m_vertex1 = m_vertices[i1]; + edgeShape.m_vertex2 = m_vertices[i2]; + + return edgeShape.RayCast(output, input, xf, 0); +} + +void b2ChainShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + b2Assert(childIndex < m_count); + + int32 i1 = childIndex; + int32 i2 = childIndex + 1; + if (i2 == m_count) + { + i2 = 0; + } + + b2Vec2 v1 = b2Mul(xf, m_vertices[i1]); + b2Vec2 v2 = b2Mul(xf, m_vertices[i2]); + + aabb->lowerBound = b2Min(v1, v2); + aabb->upperBound = b2Max(v1, v2); +} + +void b2ChainShape::ComputeMass(b2MassData* massData, float32 density) const +{ + B2_NOT_USED(density); + + massData->mass = 0.0f; + massData->center.SetZero(); + massData->I = 0.0f; +} diff --git a/src/libraries/Box2D/Collision/Shapes/b2ChainShape.h b/src/libraries/Box2D/Collision/Shapes/b2ChainShape.h index 6aa41ea41..d7c5b2924 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2ChainShape.h +++ b/src/libraries/Box2D/Collision/Shapes/b2ChainShape.h @@ -1,102 +1,102 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_SHAPE_H -#define B2_CHAIN_SHAPE_H - -#include - -class b2EdgeShape; - -/// A chain shape is a free form sequence of line segments. -/// The chain has two-sided collision, so you can use inside and outside collision. -/// Therefore, you may use any winding order. -/// Since there may be many vertices, they are allocated using b2Alloc. -/// Connectivity information is used to create smooth collisions. -/// WARNING: The chain will not collide properly if there are self-intersections. -class b2ChainShape : public b2Shape -{ -public: - b2ChainShape(); - - /// The destructor frees the vertices using b2Free. - ~b2ChainShape(); - - /// Create a loop. This automatically adjusts connectivity. - /// @param vertices an array of vertices, these are copied - /// @param count the vertex count - void CreateLoop(const b2Vec2* vertices, int32 count); - - /// Create a chain with isolated end vertices. - /// @param vertices an array of vertices, these are copied - /// @param count the vertex count - void CreateChain(const b2Vec2* vertices, int32 count); - - /// Establish connectivity to a vertex that precedes the first vertex. - /// Don't call this for loops. - void SetPrevVertex(const b2Vec2& prevVertex); - - /// Establish connectivity to a vertex that follows the last vertex. - /// Don't call this for loops. - void SetNextVertex(const b2Vec2& nextVertex); - - /// Implement b2Shape. Vertices are cloned using b2Alloc. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Get a child edge. - void GetChildEdge(b2EdgeShape* edge, int32 index) const; - - /// This always return false. - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// Chains have zero mass. - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// The vertices. Owned by this class. - b2Vec2* m_vertices; - - /// The vertex count. - int32 m_count; - - b2Vec2 m_prevVertex, m_nextVertex; - bool m_hasPrevVertex, m_hasNextVertex; -}; - -inline b2ChainShape::b2ChainShape() -{ - m_type = e_chain; - m_radius = b2_polygonRadius; - m_vertices = NULL; - m_count = 0; - m_hasPrevVertex = NULL; - m_hasNextVertex = NULL; -} - -#endif +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_SHAPE_H +#define B2_CHAIN_SHAPE_H + +#include + +class b2EdgeShape; + +/// A chain shape is a free form sequence of line segments. +/// The chain has two-sided collision, so you can use inside and outside collision. +/// Therefore, you may use any winding order. +/// Since there may be many vertices, they are allocated using b2Alloc. +/// Connectivity information is used to create smooth collisions. +/// WARNING: The chain will not collide properly if there are self-intersections. +class b2ChainShape : public b2Shape +{ +public: + b2ChainShape(); + + /// The destructor frees the vertices using b2Free. + ~b2ChainShape(); + + /// Create a loop. This automatically adjusts connectivity. + /// @param vertices an array of vertices, these are copied + /// @param count the vertex count + void CreateLoop(const b2Vec2* vertices, int32 count); + + /// Create a chain with isolated end vertices. + /// @param vertices an array of vertices, these are copied + /// @param count the vertex count + void CreateChain(const b2Vec2* vertices, int32 count); + + /// Establish connectivity to a vertex that precedes the first vertex. + /// Don't call this for loops. + void SetPrevVertex(const b2Vec2& prevVertex); + + /// Establish connectivity to a vertex that follows the last vertex. + /// Don't call this for loops. + void SetNextVertex(const b2Vec2& nextVertex); + + /// Implement b2Shape. Vertices are cloned using b2Alloc. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Get a child edge. + void GetChildEdge(b2EdgeShape* edge, int32 index) const; + + /// This always return false. + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// Chains have zero mass. + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// The vertices. Owned by this class. + b2Vec2* m_vertices; + + /// The vertex count. + int32 m_count; + + b2Vec2 m_prevVertex, m_nextVertex; + bool m_hasPrevVertex, m_hasNextVertex; +}; + +inline b2ChainShape::b2ChainShape() +{ + m_type = e_chain; + m_radius = b2_polygonRadius; + m_vertices = NULL; + m_count = 0; + m_hasPrevVertex = NULL; + m_hasNextVertex = NULL; +} + +#endif diff --git a/src/libraries/Box2D/Collision/Shapes/b2CircleShape.cpp b/src/libraries/Box2D/Collision/Shapes/b2CircleShape.cpp index c03d662df..d494b134a 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2CircleShape.cpp +++ b/src/libraries/Box2D/Collision/Shapes/b2CircleShape.cpp @@ -1,100 +1,100 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2CircleShape)); - b2CircleShape* clone = new (mem) b2CircleShape; - *clone = *this; - return clone; -} - -int32 b2CircleShape::GetChildCount() const -{ - return 1; -} - -bool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const -{ - b2Vec2 center = transform.p + b2Mul(transform.q, m_p); - b2Vec2 d = p - center; - return b2Dot(d, d) <= m_radius * m_radius; -} - -// Collision Detection in Interactive 3D Environments by Gino van den Bergen -// From Section 3.1.2 -// x = s + a * r -// norm(x) = radius -bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 position = transform.p + b2Mul(transform.q, m_p); - b2Vec2 s = input.p1 - position; - float32 b = b2Dot(s, s) - m_radius * m_radius; - - // Solve quadratic equation. - b2Vec2 r = input.p2 - input.p1; - float32 c = b2Dot(s, r); - float32 rr = b2Dot(r, r); - float32 sigma = c * c - rr * b; - - // Check for negative discriminant and short segment. - if (sigma < 0.0f || rr < b2_epsilon) - { - return false; - } - - // Find the point of intersection of the line with the circle. - float32 a = -(c + b2Sqrt(sigma)); - - // Is the intersection point on the segment? - if (0.0f <= a && a <= input.maxFraction * rr) - { - a /= rr; - output->fraction = a; - output->normal = s + a * r; - output->normal.Normalize(); - return true; - } - - return false; -} - -void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 p = transform.p + b2Mul(transform.q, m_p); - aabb->lowerBound.Set(p.x - m_radius, p.y - m_radius); - aabb->upperBound.Set(p.x + m_radius, p.y + m_radius); -} - -void b2CircleShape::ComputeMass(b2MassData* massData, float32 density) const -{ - massData->mass = density * b2_pi * m_radius * m_radius; - massData->center = m_p; - - // inertia about the local origin - massData->I = massData->mass * (0.5f * m_radius * m_radius + b2Dot(m_p, m_p)); -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2CircleShape)); + b2CircleShape* clone = new (mem) b2CircleShape; + *clone = *this; + return clone; +} + +int32 b2CircleShape::GetChildCount() const +{ + return 1; +} + +bool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const +{ + b2Vec2 center = transform.p + b2Mul(transform.q, m_p); + b2Vec2 d = p - center; + return b2Dot(d, d) <= m_radius * m_radius; +} + +// Collision Detection in Interactive 3D Environments by Gino van den Bergen +// From Section 3.1.2 +// x = s + a * r +// norm(x) = radius +bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 position = transform.p + b2Mul(transform.q, m_p); + b2Vec2 s = input.p1 - position; + float32 b = b2Dot(s, s) - m_radius * m_radius; + + // Solve quadratic equation. + b2Vec2 r = input.p2 - input.p1; + float32 c = b2Dot(s, r); + float32 rr = b2Dot(r, r); + float32 sigma = c * c - rr * b; + + // Check for negative discriminant and short segment. + if (sigma < 0.0f || rr < b2_epsilon) + { + return false; + } + + // Find the point of intersection of the line with the circle. + float32 a = -(c + b2Sqrt(sigma)); + + // Is the intersection point on the segment? + if (0.0f <= a && a <= input.maxFraction * rr) + { + a /= rr; + output->fraction = a; + output->normal = s + a * r; + output->normal.Normalize(); + return true; + } + + return false; +} + +void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 p = transform.p + b2Mul(transform.q, m_p); + aabb->lowerBound.Set(p.x - m_radius, p.y - m_radius); + aabb->upperBound.Set(p.x + m_radius, p.y + m_radius); +} + +void b2CircleShape::ComputeMass(b2MassData* massData, float32 density) const +{ + massData->mass = density * b2_pi * m_radius * m_radius; + massData->center = m_p; + + // inertia about the local origin + massData->I = massData->mass * (0.5f * m_radius * m_radius + b2Dot(m_p, m_p)); +} diff --git a/src/libraries/Box2D/Collision/Shapes/b2CircleShape.h b/src/libraries/Box2D/Collision/Shapes/b2CircleShape.h index 6c1fd543a..3209f924a 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2CircleShape.h +++ b/src/libraries/Box2D/Collision/Shapes/b2CircleShape.h @@ -1,91 +1,91 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CIRCLE_SHAPE_H -#define B2_CIRCLE_SHAPE_H - -#include - -/// A circle shape. -class b2CircleShape : public b2Shape -{ -public: - b2CircleShape(); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Implement b2Shape. - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// Get the supporting vertex index in the given direction. - int32 GetSupport(const b2Vec2& d) const; - - /// Get the supporting vertex in the given direction. - const b2Vec2& GetSupportVertex(const b2Vec2& d) const; - - /// Get the vertex count. - int32 GetVertexCount() const { return 1; } - - /// Get a vertex by index. Used by b2Distance. - const b2Vec2& GetVertex(int32 index) const; - - /// Position - b2Vec2 m_p; -}; - -inline b2CircleShape::b2CircleShape() -{ - m_type = e_circle; - m_radius = 0.0f; - m_p.SetZero(); -} - -inline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const -{ - B2_NOT_USED(d); - return 0; -} - -inline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const -{ - B2_NOT_USED(d); - return m_p; -} - -inline const b2Vec2& b2CircleShape::GetVertex(int32 index) const -{ - B2_NOT_USED(index); - b2Assert(index == 0); - return m_p; -} - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CIRCLE_SHAPE_H +#define B2_CIRCLE_SHAPE_H + +#include + +/// A circle shape. +class b2CircleShape : public b2Shape +{ +public: + b2CircleShape(); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Implement b2Shape. + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// Get the supporting vertex index in the given direction. + int32 GetSupport(const b2Vec2& d) const; + + /// Get the supporting vertex in the given direction. + const b2Vec2& GetSupportVertex(const b2Vec2& d) const; + + /// Get the vertex count. + int32 GetVertexCount() const { return 1; } + + /// Get a vertex by index. Used by b2Distance. + const b2Vec2& GetVertex(int32 index) const; + + /// Position + b2Vec2 m_p; +}; + +inline b2CircleShape::b2CircleShape() +{ + m_type = e_circle; + m_radius = 0.0f; + m_p.SetZero(); +} + +inline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const +{ + B2_NOT_USED(d); + return 0; +} + +inline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const +{ + B2_NOT_USED(d); + return m_p; +} + +inline const b2Vec2& b2CircleShape::GetVertex(int32 index) const +{ + B2_NOT_USED(index); + b2Assert(index == 0); + return m_p; +} + +#endif diff --git a/src/libraries/Box2D/Collision/Shapes/b2EdgeShape.cpp b/src/libraries/Box2D/Collision/Shapes/b2EdgeShape.cpp index e204160b0..cbac41cfa 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2EdgeShape.cpp +++ b/src/libraries/Box2D/Collision/Shapes/b2EdgeShape.cpp @@ -1,139 +1,139 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) -{ - m_vertex1 = v1; - m_vertex2 = v2; - m_hasVertex0 = false; - m_hasVertex3 = false; -} - -b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2EdgeShape)); - b2EdgeShape* clone = new (mem) b2EdgeShape; - *clone = *this; - return clone; -} - -int32 b2EdgeShape::GetChildCount() const -{ - return 1; -} - -bool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - B2_NOT_USED(xf); - B2_NOT_USED(p); - return false; -} - -// p = p1 + t * d -// v = v1 + s * e -// p1 + t * d = v1 + s * e -// s * e - t * d = p1 - v1 -bool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - // Put the ray into the edge's frame of reference. - b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); - b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); - b2Vec2 d = p2 - p1; - - b2Vec2 v1 = m_vertex1; - b2Vec2 v2 = m_vertex2; - b2Vec2 e = v2 - v1; - b2Vec2 normal(e.y, -e.x); - normal.Normalize(); - - // q = p1 + t * d - // dot(normal, q - v1) = 0 - // dot(normal, p1 - v1) + t * dot(normal, d) = 0 - float32 numerator = b2Dot(normal, v1 - p1); - float32 denominator = b2Dot(normal, d); - - if (denominator == 0.0f) - { - return false; - } - - float32 t = numerator / denominator; - if (t < 0.0f || input.maxFraction < t) - { - return false; - } - - b2Vec2 q = p1 + t * d; - - // q = v1 + s * r - // s = dot(q - v1, r) / dot(r, r) - b2Vec2 r = v2 - v1; - float32 rr = b2Dot(r, r); - if (rr == 0.0f) - { - return false; - } - - float32 s = b2Dot(q - v1, r) / rr; - if (s < 0.0f || 1.0f < s) - { - return false; - } - - output->fraction = t; - if (numerator > 0.0f) - { - output->normal = -normal; - } - else - { - output->normal = normal; - } - return true; -} - -void b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 v1 = b2Mul(xf, m_vertex1); - b2Vec2 v2 = b2Mul(xf, m_vertex2); - - b2Vec2 lower = b2Min(v1, v2); - b2Vec2 upper = b2Max(v1, v2); - - b2Vec2 r(m_radius, m_radius); - aabb->lowerBound = lower - r; - aabb->upperBound = upper + r; -} - -void b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const -{ - B2_NOT_USED(density); - - massData->mass = 0.0f; - massData->center = 0.5f * (m_vertex1 + m_vertex2); - massData->I = 0.0f; -} +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) +{ + m_vertex1 = v1; + m_vertex2 = v2; + m_hasVertex0 = false; + m_hasVertex3 = false; +} + +b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2EdgeShape)); + b2EdgeShape* clone = new (mem) b2EdgeShape; + *clone = *this; + return clone; +} + +int32 b2EdgeShape::GetChildCount() const +{ + return 1; +} + +bool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + B2_NOT_USED(xf); + B2_NOT_USED(p); + return false; +} + +// p = p1 + t * d +// v = v1 + s * e +// p1 + t * d = v1 + s * e +// s * e - t * d = p1 - v1 +bool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + // Put the ray into the edge's frame of reference. + b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); + b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); + b2Vec2 d = p2 - p1; + + b2Vec2 v1 = m_vertex1; + b2Vec2 v2 = m_vertex2; + b2Vec2 e = v2 - v1; + b2Vec2 normal(e.y, -e.x); + normal.Normalize(); + + // q = p1 + t * d + // dot(normal, q - v1) = 0 + // dot(normal, p1 - v1) + t * dot(normal, d) = 0 + float32 numerator = b2Dot(normal, v1 - p1); + float32 denominator = b2Dot(normal, d); + + if (denominator == 0.0f) + { + return false; + } + + float32 t = numerator / denominator; + if (t < 0.0f || input.maxFraction < t) + { + return false; + } + + b2Vec2 q = p1 + t * d; + + // q = v1 + s * r + // s = dot(q - v1, r) / dot(r, r) + b2Vec2 r = v2 - v1; + float32 rr = b2Dot(r, r); + if (rr == 0.0f) + { + return false; + } + + float32 s = b2Dot(q - v1, r) / rr; + if (s < 0.0f || 1.0f < s) + { + return false; + } + + output->fraction = t; + if (numerator > 0.0f) + { + output->normal = -normal; + } + else + { + output->normal = normal; + } + return true; +} + +void b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 v1 = b2Mul(xf, m_vertex1); + b2Vec2 v2 = b2Mul(xf, m_vertex2); + + b2Vec2 lower = b2Min(v1, v2); + b2Vec2 upper = b2Max(v1, v2); + + b2Vec2 r(m_radius, m_radius); + aabb->lowerBound = lower - r; + aabb->upperBound = upper + r; +} + +void b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const +{ + B2_NOT_USED(density); + + massData->mass = 0.0f; + massData->center = 0.5f * (m_vertex1 + m_vertex2); + massData->I = 0.0f; +} diff --git a/src/libraries/Box2D/Collision/Shapes/b2EdgeShape.h b/src/libraries/Box2D/Collision/Shapes/b2EdgeShape.h index 99f822bec..0acef8518 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2EdgeShape.h +++ b/src/libraries/Box2D/Collision/Shapes/b2EdgeShape.h @@ -1,74 +1,74 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_SHAPE_H -#define B2_EDGE_SHAPE_H - -#include - -/// A line segment (edge) shape. These can be connected in chains or loops -/// to other edge shapes. The connectivity information is used to ensure -/// correct contact normals. -class b2EdgeShape : public b2Shape -{ -public: - b2EdgeShape(); - - /// Set this as an isolated edge. - void Set(const b2Vec2& v1, const b2Vec2& v2); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// These are the edge vertices - b2Vec2 m_vertex1, m_vertex2; - - /// Optional adjacent vertices. These are used for smooth collision. - b2Vec2 m_vertex0, m_vertex3; - bool m_hasVertex0, m_hasVertex3; -}; - -inline b2EdgeShape::b2EdgeShape() -{ - m_type = e_edge; - m_radius = b2_polygonRadius; - m_vertex0.x = 0.0f; - m_vertex0.y = 0.0f; - m_vertex3.x = 0.0f; - m_vertex3.y = 0.0f; - m_hasVertex0 = false; - m_hasVertex3 = false; -} - -#endif +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_SHAPE_H +#define B2_EDGE_SHAPE_H + +#include + +/// A line segment (edge) shape. These can be connected in chains or loops +/// to other edge shapes. The connectivity information is used to ensure +/// correct contact normals. +class b2EdgeShape : public b2Shape +{ +public: + b2EdgeShape(); + + /// Set this as an isolated edge. + void Set(const b2Vec2& v1, const b2Vec2& v2); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// These are the edge vertices + b2Vec2 m_vertex1, m_vertex2; + + /// Optional adjacent vertices. These are used for smooth collision. + b2Vec2 m_vertex0, m_vertex3; + bool m_hasVertex0, m_hasVertex3; +}; + +inline b2EdgeShape::b2EdgeShape() +{ + m_type = e_edge; + m_radius = b2_polygonRadius; + m_vertex0.x = 0.0f; + m_vertex0.y = 0.0f; + m_vertex3.x = 0.0f; + m_vertex3.y = 0.0f; + m_hasVertex0 = false; + m_hasVertex3 = false; +} + +#endif diff --git a/src/libraries/Box2D/Collision/Shapes/b2PolygonShape.cpp b/src/libraries/Box2D/Collision/Shapes/b2PolygonShape.cpp index 8be813338..499e168f8 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2PolygonShape.cpp +++ b/src/libraries/Box2D/Collision/Shapes/b2PolygonShape.cpp @@ -1,361 +1,361 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const -{ - void* mem = allocator->Allocate(sizeof(b2PolygonShape)); - b2PolygonShape* clone = new (mem) b2PolygonShape; - *clone = *this; - return clone; -} - -void b2PolygonShape::SetAsBox(float32 hx, float32 hy) -{ - m_vertexCount = 4; - m_vertices[0].Set(-hx, -hy); - m_vertices[1].Set( hx, -hy); - m_vertices[2].Set( hx, hy); - m_vertices[3].Set(-hx, hy); - m_normals[0].Set(0.0f, -1.0f); - m_normals[1].Set(1.0f, 0.0f); - m_normals[2].Set(0.0f, 1.0f); - m_normals[3].Set(-1.0f, 0.0f); - m_centroid.SetZero(); -} - -void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle) -{ - m_vertexCount = 4; - m_vertices[0].Set(-hx, -hy); - m_vertices[1].Set( hx, -hy); - m_vertices[2].Set( hx, hy); - m_vertices[3].Set(-hx, hy); - m_normals[0].Set(0.0f, -1.0f); - m_normals[1].Set(1.0f, 0.0f); - m_normals[2].Set(0.0f, 1.0f); - m_normals[3].Set(-1.0f, 0.0f); - m_centroid = center; - - b2Transform xf; - xf.p = center; - xf.q.Set(angle); - - // Transform vertices and normals. - for (int32 i = 0; i < m_vertexCount; ++i) - { - m_vertices[i] = b2Mul(xf, m_vertices[i]); - m_normals[i] = b2Mul(xf.q, m_normals[i]); - } -} - -int32 b2PolygonShape::GetChildCount() const -{ - return 1; -} - -static b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count) -{ - b2Assert(count >= 3); - - b2Vec2 c; c.Set(0.0f, 0.0f); - float32 area = 0.0f; - - // pRef is the reference point for forming triangles. - // It's location doesn't change the result (except for rounding error). - b2Vec2 pRef(0.0f, 0.0f); -#if 0 - // This code would put the reference point inside the polygon. - for (int32 i = 0; i < count; ++i) - { - pRef += vs[i]; - } - pRef *= 1.0f / count; -#endif - - const float32 inv3 = 1.0f / 3.0f; - - for (int32 i = 0; i < count; ++i) - { - // Triangle vertices. - b2Vec2 p1 = pRef; - b2Vec2 p2 = vs[i]; - b2Vec2 p3 = i + 1 < count ? vs[i+1] : vs[0]; - - b2Vec2 e1 = p2 - p1; - b2Vec2 e2 = p3 - p1; - - float32 D = b2Cross(e1, e2); - - float32 triangleArea = 0.5f * D; - area += triangleArea; - - // Area weighted centroid - c += triangleArea * inv3 * (p1 + p2 + p3); - } - - // Centroid - b2Assert(area > b2_epsilon); - c *= 1.0f / area; - return c; -} - -void b2PolygonShape::Set(const b2Vec2* vertices, int32 count) -{ - b2Assert(3 <= count && count <= b2_maxPolygonVertices); - m_vertexCount = count; - - // Copy vertices. - for (int32 i = 0; i < m_vertexCount; ++i) - { - m_vertices[i] = vertices[i]; - } - - // Compute normals. Ensure the edges have non-zero length. - for (int32 i = 0; i < m_vertexCount; ++i) - { - int32 i1 = i; - int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; - b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; - b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon); - m_normals[i] = b2Cross(edge, 1.0f); - m_normals[i].Normalize(); - } - -#ifdef _DEBUG - // Ensure the polygon is convex and the interior - // is to the left of each edge. - for (int32 i = 0; i < m_vertexCount; ++i) - { - int32 i1 = i; - int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; - b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; - - for (int32 j = 0; j < m_vertexCount; ++j) - { - // Don't check vertices on the current edge. - if (j == i1 || j == i2) - { - continue; - } - - b2Vec2 r = m_vertices[j] - m_vertices[i1]; - - // If this crashes, your polygon is non-convex, has colinear edges, - // or the winding order is wrong. - float32 s = b2Cross(edge, r); - b2Assert(s > 0.0f && "ERROR: Please ensure your polygon is convex and has a CCW winding order"); - } - } -#endif - - // Compute the polygon centroid. - m_centroid = ComputeCentroid(m_vertices, m_vertexCount); -} - -bool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const -{ - b2Vec2 pLocal = b2MulT(xf.q, p - xf.p); - - for (int32 i = 0; i < m_vertexCount; ++i) - { - float32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]); - if (dot > 0.0f) - { - return false; - } - } - - return true; -} - -bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - // Put the ray into the polygon's frame of reference. - b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); - b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); - b2Vec2 d = p2 - p1; - - float32 lower = 0.0f, upper = input.maxFraction; - - int32 index = -1; - - for (int32 i = 0; i < m_vertexCount; ++i) - { - // p = p1 + a * d - // dot(normal, p - v) = 0 - // dot(normal, p1 - v) + a * dot(normal, d) = 0 - float32 numerator = b2Dot(m_normals[i], m_vertices[i] - p1); - float32 denominator = b2Dot(m_normals[i], d); - - if (denominator == 0.0f) - { - if (numerator < 0.0f) - { - return false; - } - } - else - { - // Note: we want this predicate without division: - // lower < numerator / denominator, where denominator < 0 - // Since denominator < 0, we have to flip the inequality: - // lower < numerator / denominator <==> denominator * lower > numerator. - if (denominator < 0.0f && numerator < lower * denominator) - { - // Increase lower. - // The segment enters this half-space. - lower = numerator / denominator; - index = i; - } - else if (denominator > 0.0f && numerator < upper * denominator) - { - // Decrease upper. - // The segment exits this half-space. - upper = numerator / denominator; - } - } - - // The use of epsilon here causes the assert on lower to trip - // in some cases. Apparently the use of epsilon was to make edge - // shapes work, but now those are handled separately. - //if (upper < lower - b2_epsilon) - if (upper < lower) - { - return false; - } - } - - b2Assert(0.0f <= lower && lower <= input.maxFraction); - - if (index >= 0) - { - output->fraction = lower; - output->normal = b2Mul(xf.q, m_normals[index]); - return true; - } - - return false; -} - -void b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const -{ - B2_NOT_USED(childIndex); - - b2Vec2 lower = b2Mul(xf, m_vertices[0]); - b2Vec2 upper = lower; - - for (int32 i = 1; i < m_vertexCount; ++i) - { - b2Vec2 v = b2Mul(xf, m_vertices[i]); - lower = b2Min(lower, v); - upper = b2Max(upper, v); - } - - b2Vec2 r(m_radius, m_radius); - aabb->lowerBound = lower - r; - aabb->upperBound = upper + r; -} - -void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const -{ - // Polygon mass, centroid, and inertia. - // Let rho be the polygon density in mass per unit area. - // Then: - // mass = rho * int(dA) - // centroid.x = (1/mass) * rho * int(x * dA) - // centroid.y = (1/mass) * rho * int(y * dA) - // I = rho * int((x*x + y*y) * dA) - // - // We can compute these integrals by summing all the integrals - // for each triangle of the polygon. To evaluate the integral - // for a single triangle, we make a change of variables to - // the (u,v) coordinates of the triangle: - // x = x0 + e1x * u + e2x * v - // y = y0 + e1y * u + e2y * v - // where 0 <= u && 0 <= v && u + v <= 1. - // - // We integrate u from [0,1-v] and then v from [0,1]. - // We also need to use the Jacobian of the transformation: - // D = cross(e1, e2) - // - // Simplification: triangle centroid = (1/3) * (p1 + p2 + p3) - // - // The rest of the derivation is handled by computer algebra. - - b2Assert(m_vertexCount >= 3); - - b2Vec2 center; center.Set(0.0f, 0.0f); - float32 area = 0.0f; - float32 I = 0.0f; - - // s is the reference point for forming triangles. - // It's location doesn't change the result (except for rounding error). - b2Vec2 s(0.0f, 0.0f); - - // This code would put the reference point inside the polygon. - for (int32 i = 0; i < m_vertexCount; ++i) - { - s += m_vertices[i]; - } - s *= 1.0f / m_vertexCount; - - const float32 k_inv3 = 1.0f / 3.0f; - - for (int32 i = 0; i < m_vertexCount; ++i) - { - // Triangle vertices. - b2Vec2 e1 = m_vertices[i] - s; - b2Vec2 e2 = i + 1 < m_vertexCount ? m_vertices[i+1] - s : m_vertices[0] - s; - - float32 D = b2Cross(e1, e2); - - float32 triangleArea = 0.5f * D; - area += triangleArea; - - // Area weighted centroid - center += triangleArea * k_inv3 * (e1 + e2); - - float32 ex1 = e1.x, ey1 = e1.y; - float32 ex2 = e2.x, ey2 = e2.y; - - float32 intx2 = ex1*ex1 + ex2*ex1 + ex2*ex2; - float32 inty2 = ey1*ey1 + ey2*ey1 + ey2*ey2; - - I += (0.25f * k_inv3 * D) * (intx2 + inty2); - } - - // Total mass - massData->mass = density * area; - - // Center of mass - b2Assert(area > b2_epsilon); - center *= 1.0f / area; - massData->center = center + s; - - // Inertia tensor relative to the local origin (point s). - massData->I = density * I; - - // Shift to center of mass then to original body origin. - massData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center)); -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const +{ + void* mem = allocator->Allocate(sizeof(b2PolygonShape)); + b2PolygonShape* clone = new (mem) b2PolygonShape; + *clone = *this; + return clone; +} + +void b2PolygonShape::SetAsBox(float32 hx, float32 hy) +{ + m_vertexCount = 4; + m_vertices[0].Set(-hx, -hy); + m_vertices[1].Set( hx, -hy); + m_vertices[2].Set( hx, hy); + m_vertices[3].Set(-hx, hy); + m_normals[0].Set(0.0f, -1.0f); + m_normals[1].Set(1.0f, 0.0f); + m_normals[2].Set(0.0f, 1.0f); + m_normals[3].Set(-1.0f, 0.0f); + m_centroid.SetZero(); +} + +void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle) +{ + m_vertexCount = 4; + m_vertices[0].Set(-hx, -hy); + m_vertices[1].Set( hx, -hy); + m_vertices[2].Set( hx, hy); + m_vertices[3].Set(-hx, hy); + m_normals[0].Set(0.0f, -1.0f); + m_normals[1].Set(1.0f, 0.0f); + m_normals[2].Set(0.0f, 1.0f); + m_normals[3].Set(-1.0f, 0.0f); + m_centroid = center; + + b2Transform xf; + xf.p = center; + xf.q.Set(angle); + + // Transform vertices and normals. + for (int32 i = 0; i < m_vertexCount; ++i) + { + m_vertices[i] = b2Mul(xf, m_vertices[i]); + m_normals[i] = b2Mul(xf.q, m_normals[i]); + } +} + +int32 b2PolygonShape::GetChildCount() const +{ + return 1; +} + +static b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count) +{ + b2Assert(count >= 3); + + b2Vec2 c; c.Set(0.0f, 0.0f); + float32 area = 0.0f; + + // pRef is the reference point for forming triangles. + // It's location doesn't change the result (except for rounding error). + b2Vec2 pRef(0.0f, 0.0f); +#if 0 + // This code would put the reference point inside the polygon. + for (int32 i = 0; i < count; ++i) + { + pRef += vs[i]; + } + pRef *= 1.0f / count; +#endif + + const float32 inv3 = 1.0f / 3.0f; + + for (int32 i = 0; i < count; ++i) + { + // Triangle vertices. + b2Vec2 p1 = pRef; + b2Vec2 p2 = vs[i]; + b2Vec2 p3 = i + 1 < count ? vs[i+1] : vs[0]; + + b2Vec2 e1 = p2 - p1; + b2Vec2 e2 = p3 - p1; + + float32 D = b2Cross(e1, e2); + + float32 triangleArea = 0.5f * D; + area += triangleArea; + + // Area weighted centroid + c += triangleArea * inv3 * (p1 + p2 + p3); + } + + // Centroid + b2Assert(area > b2_epsilon); + c *= 1.0f / area; + return c; +} + +void b2PolygonShape::Set(const b2Vec2* vertices, int32 count) +{ + b2Assert(3 <= count && count <= b2_maxPolygonVertices); + m_vertexCount = count; + + // Copy vertices. + for (int32 i = 0; i < m_vertexCount; ++i) + { + m_vertices[i] = vertices[i]; + } + + // Compute normals. Ensure the edges have non-zero length. + for (int32 i = 0; i < m_vertexCount; ++i) + { + int32 i1 = i; + int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; + b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; + b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon); + m_normals[i] = b2Cross(edge, 1.0f); + m_normals[i].Normalize(); + } + +#ifdef _DEBUG + // Ensure the polygon is convex and the interior + // is to the left of each edge. + for (int32 i = 0; i < m_vertexCount; ++i) + { + int32 i1 = i; + int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; + b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; + + for (int32 j = 0; j < m_vertexCount; ++j) + { + // Don't check vertices on the current edge. + if (j == i1 || j == i2) + { + continue; + } + + b2Vec2 r = m_vertices[j] - m_vertices[i1]; + + // If this crashes, your polygon is non-convex, has colinear edges, + // or the winding order is wrong. + float32 s = b2Cross(edge, r); + b2Assert(s > 0.0f && "ERROR: Please ensure your polygon is convex and has a CCW winding order"); + } + } +#endif + + // Compute the polygon centroid. + m_centroid = ComputeCentroid(m_vertices, m_vertexCount); +} + +bool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const +{ + b2Vec2 pLocal = b2MulT(xf.q, p - xf.p); + + for (int32 i = 0; i < m_vertexCount; ++i) + { + float32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]); + if (dot > 0.0f) + { + return false; + } + } + + return true; +} + +bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + // Put the ray into the polygon's frame of reference. + b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p); + b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p); + b2Vec2 d = p2 - p1; + + float32 lower = 0.0f, upper = input.maxFraction; + + int32 index = -1; + + for (int32 i = 0; i < m_vertexCount; ++i) + { + // p = p1 + a * d + // dot(normal, p - v) = 0 + // dot(normal, p1 - v) + a * dot(normal, d) = 0 + float32 numerator = b2Dot(m_normals[i], m_vertices[i] - p1); + float32 denominator = b2Dot(m_normals[i], d); + + if (denominator == 0.0f) + { + if (numerator < 0.0f) + { + return false; + } + } + else + { + // Note: we want this predicate without division: + // lower < numerator / denominator, where denominator < 0 + // Since denominator < 0, we have to flip the inequality: + // lower < numerator / denominator <==> denominator * lower > numerator. + if (denominator < 0.0f && numerator < lower * denominator) + { + // Increase lower. + // The segment enters this half-space. + lower = numerator / denominator; + index = i; + } + else if (denominator > 0.0f && numerator < upper * denominator) + { + // Decrease upper. + // The segment exits this half-space. + upper = numerator / denominator; + } + } + + // The use of epsilon here causes the assert on lower to trip + // in some cases. Apparently the use of epsilon was to make edge + // shapes work, but now those are handled separately. + //if (upper < lower - b2_epsilon) + if (upper < lower) + { + return false; + } + } + + b2Assert(0.0f <= lower && lower <= input.maxFraction); + + if (index >= 0) + { + output->fraction = lower; + output->normal = b2Mul(xf.q, m_normals[index]); + return true; + } + + return false; +} + +void b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const +{ + B2_NOT_USED(childIndex); + + b2Vec2 lower = b2Mul(xf, m_vertices[0]); + b2Vec2 upper = lower; + + for (int32 i = 1; i < m_vertexCount; ++i) + { + b2Vec2 v = b2Mul(xf, m_vertices[i]); + lower = b2Min(lower, v); + upper = b2Max(upper, v); + } + + b2Vec2 r(m_radius, m_radius); + aabb->lowerBound = lower - r; + aabb->upperBound = upper + r; +} + +void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const +{ + // Polygon mass, centroid, and inertia. + // Let rho be the polygon density in mass per unit area. + // Then: + // mass = rho * int(dA) + // centroid.x = (1/mass) * rho * int(x * dA) + // centroid.y = (1/mass) * rho * int(y * dA) + // I = rho * int((x*x + y*y) * dA) + // + // We can compute these integrals by summing all the integrals + // for each triangle of the polygon. To evaluate the integral + // for a single triangle, we make a change of variables to + // the (u,v) coordinates of the triangle: + // x = x0 + e1x * u + e2x * v + // y = y0 + e1y * u + e2y * v + // where 0 <= u && 0 <= v && u + v <= 1. + // + // We integrate u from [0,1-v] and then v from [0,1]. + // We also need to use the Jacobian of the transformation: + // D = cross(e1, e2) + // + // Simplification: triangle centroid = (1/3) * (p1 + p2 + p3) + // + // The rest of the derivation is handled by computer algebra. + + b2Assert(m_vertexCount >= 3); + + b2Vec2 center; center.Set(0.0f, 0.0f); + float32 area = 0.0f; + float32 I = 0.0f; + + // s is the reference point for forming triangles. + // It's location doesn't change the result (except for rounding error). + b2Vec2 s(0.0f, 0.0f); + + // This code would put the reference point inside the polygon. + for (int32 i = 0; i < m_vertexCount; ++i) + { + s += m_vertices[i]; + } + s *= 1.0f / m_vertexCount; + + const float32 k_inv3 = 1.0f / 3.0f; + + for (int32 i = 0; i < m_vertexCount; ++i) + { + // Triangle vertices. + b2Vec2 e1 = m_vertices[i] - s; + b2Vec2 e2 = i + 1 < m_vertexCount ? m_vertices[i+1] - s : m_vertices[0] - s; + + float32 D = b2Cross(e1, e2); + + float32 triangleArea = 0.5f * D; + area += triangleArea; + + // Area weighted centroid + center += triangleArea * k_inv3 * (e1 + e2); + + float32 ex1 = e1.x, ey1 = e1.y; + float32 ex2 = e2.x, ey2 = e2.y; + + float32 intx2 = ex1*ex1 + ex2*ex1 + ex2*ex2; + float32 inty2 = ey1*ey1 + ey2*ey1 + ey2*ey2; + + I += (0.25f * k_inv3 * D) * (intx2 + inty2); + } + + // Total mass + massData->mass = density * area; + + // Center of mass + b2Assert(area > b2_epsilon); + center *= 1.0f / area; + massData->center = center + s; + + // Inertia tensor relative to the local origin (point s). + massData->I = density * I; + + // Shift to center of mass then to original body origin. + massData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center)); +} diff --git a/src/libraries/Box2D/Collision/Shapes/b2PolygonShape.h b/src/libraries/Box2D/Collision/Shapes/b2PolygonShape.h index fd11bd162..5c5321221 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2PolygonShape.h +++ b/src/libraries/Box2D/Collision/Shapes/b2PolygonShape.h @@ -1,95 +1,95 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_SHAPE_H -#define B2_POLYGON_SHAPE_H - -#include - -/// A convex polygon. It is assumed that the interior of the polygon is to -/// the left of each edge. -/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. -/// In most cases you should not need many vertices for a convex polygon. -class b2PolygonShape : public b2Shape -{ -public: - b2PolygonShape(); - - /// Implement b2Shape. - b2Shape* Clone(b2BlockAllocator* allocator) const; - - /// @see b2Shape::GetChildCount - int32 GetChildCount() const; - - /// Copy vertices. This assumes the vertices define a convex polygon. - /// It is assumed that the exterior is the the right of each edge. - /// The count must be in the range [3, b2_maxPolygonVertices]. - void Set(const b2Vec2* vertices, int32 vertexCount); - - /// Build vertices to represent an axis-aligned box. - /// @param hx the half-width. - /// @param hy the half-height. - void SetAsBox(float32 hx, float32 hy); - - /// Build vertices to represent an oriented box. - /// @param hx the half-width. - /// @param hy the half-height. - /// @param center the center of the box in local coordinates. - /// @param angle the rotation of the box in local coordinates. - void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle); - - /// @see b2Shape::TestPoint - bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; - - /// Implement b2Shape. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeAABB - void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; - - /// @see b2Shape::ComputeMass - void ComputeMass(b2MassData* massData, float32 density) const; - - /// Get the vertex count. - int32 GetVertexCount() const { return m_vertexCount; } - - /// Get a vertex by index. - const b2Vec2& GetVertex(int32 index) const; - - b2Vec2 m_centroid; - b2Vec2 m_vertices[b2_maxPolygonVertices]; - b2Vec2 m_normals[b2_maxPolygonVertices]; - int32 m_vertexCount; -}; - -inline b2PolygonShape::b2PolygonShape() -{ - m_type = e_polygon; - m_radius = b2_polygonRadius; - m_vertexCount = 0; - m_centroid.SetZero(); -} - -inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const -{ - b2Assert(0 <= index && index < m_vertexCount); - return m_vertices[index]; -} - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_SHAPE_H +#define B2_POLYGON_SHAPE_H + +#include + +/// A convex polygon. It is assumed that the interior of the polygon is to +/// the left of each edge. +/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. +/// In most cases you should not need many vertices for a convex polygon. +class b2PolygonShape : public b2Shape +{ +public: + b2PolygonShape(); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Copy vertices. This assumes the vertices define a convex polygon. + /// It is assumed that the exterior is the the right of each edge. + /// The count must be in the range [3, b2_maxPolygonVertices]. + void Set(const b2Vec2* vertices, int32 vertexCount); + + /// Build vertices to represent an axis-aligned box. + /// @param hx the half-width. + /// @param hy the half-height. + void SetAsBox(float32 hx, float32 hy); + + /// Build vertices to represent an oriented box. + /// @param hx the half-width. + /// @param hy the half-height. + /// @param center the center of the box in local coordinates. + /// @param angle the rotation of the box in local coordinates. + void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle); + + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// Get the vertex count. + int32 GetVertexCount() const { return m_vertexCount; } + + /// Get a vertex by index. + const b2Vec2& GetVertex(int32 index) const; + + b2Vec2 m_centroid; + b2Vec2 m_vertices[b2_maxPolygonVertices]; + b2Vec2 m_normals[b2_maxPolygonVertices]; + int32 m_vertexCount; +}; + +inline b2PolygonShape::b2PolygonShape() +{ + m_type = e_polygon; + m_radius = b2_polygonRadius; + m_vertexCount = 0; + m_centroid.SetZero(); +} + +inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const +{ + b2Assert(0 <= index && index < m_vertexCount); + return m_vertices[index]; +} + +#endif diff --git a/src/libraries/Box2D/Collision/Shapes/b2Shape.h b/src/libraries/Box2D/Collision/Shapes/b2Shape.h index fd7de2626..170ea1a13 100755 --- a/src/libraries/Box2D/Collision/Shapes/b2Shape.h +++ b/src/libraries/Box2D/Collision/Shapes/b2Shape.h @@ -1,101 +1,101 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_SHAPE_H -#define B2_SHAPE_H - -#include -#include -#include - -/// This holds the mass data computed for a shape. -struct b2MassData -{ - /// The mass of the shape, usually in kilograms. - float32 mass; - - /// The position of the shape's centroid relative to the shape's origin. - b2Vec2 center; - - /// The rotational inertia of the shape about the local origin. - float32 I; -}; - -/// A shape is used for collision detection. You can create a shape however you like. -/// Shapes used for simulation in b2World are created automatically when a b2Fixture -/// is created. Shapes may encapsulate a one or more child shapes. -class b2Shape -{ -public: - - enum Type - { - e_circle = 0, - e_edge = 1, - e_polygon = 2, - e_chain = 3, - e_typeCount = 4 - }; - - virtual ~b2Shape() {} - - /// Clone the concrete shape using the provided allocator. - virtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0; - - /// Get the type of this shape. You can use this to down cast to the concrete shape. - /// @return the shape type. - Type GetType() const; - - /// Get the number of child primitives. - virtual int32 GetChildCount() const = 0; - - /// Test a point for containment in this shape. This only works for convex shapes. - /// @param xf the shape world transform. - /// @param p a point in world coordinates. - virtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0; - - /// Cast a ray against a child shape. - /// @param output the ray-cast results. - /// @param input the ray-cast input parameters. - /// @param transform the transform to be applied to the shape. - /// @param childIndex the child shape index - virtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, - const b2Transform& transform, int32 childIndex) const = 0; - - /// Given a transform, compute the associated axis aligned bounding box for a child shape. - /// @param aabb returns the axis aligned box. - /// @param xf the world transform of the shape. - /// @param childIndex the child shape - virtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const = 0; - - /// Compute the mass properties of this shape using its dimensions and density. - /// The inertia tensor is computed about the local origin. - /// @param massData returns the mass data for this shape. - /// @param density the density in kilograms per meter squared. - virtual void ComputeMass(b2MassData* massData, float32 density) const = 0; - - Type m_type; - float32 m_radius; -}; - -inline b2Shape::Type b2Shape::GetType() const -{ - return m_type; -} - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_SHAPE_H +#define B2_SHAPE_H + +#include +#include +#include + +/// This holds the mass data computed for a shape. +struct b2MassData +{ + /// The mass of the shape, usually in kilograms. + float32 mass; + + /// The position of the shape's centroid relative to the shape's origin. + b2Vec2 center; + + /// The rotational inertia of the shape about the local origin. + float32 I; +}; + +/// A shape is used for collision detection. You can create a shape however you like. +/// Shapes used for simulation in b2World are created automatically when a b2Fixture +/// is created. Shapes may encapsulate a one or more child shapes. +class b2Shape +{ +public: + + enum Type + { + e_circle = 0, + e_edge = 1, + e_polygon = 2, + e_chain = 3, + e_typeCount = 4 + }; + + virtual ~b2Shape() {} + + /// Clone the concrete shape using the provided allocator. + virtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0; + + /// Get the type of this shape. You can use this to down cast to the concrete shape. + /// @return the shape type. + Type GetType() const; + + /// Get the number of child primitives. + virtual int32 GetChildCount() const = 0; + + /// Test a point for containment in this shape. This only works for convex shapes. + /// @param xf the shape world transform. + /// @param p a point in world coordinates. + virtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0; + + /// Cast a ray against a child shape. + /// @param output the ray-cast results. + /// @param input the ray-cast input parameters. + /// @param transform the transform to be applied to the shape. + /// @param childIndex the child shape index + virtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const = 0; + + /// Given a transform, compute the associated axis aligned bounding box for a child shape. + /// @param aabb returns the axis aligned box. + /// @param xf the world transform of the shape. + /// @param childIndex the child shape + virtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const = 0; + + /// Compute the mass properties of this shape using its dimensions and density. + /// The inertia tensor is computed about the local origin. + /// @param massData returns the mass data for this shape. + /// @param density the density in kilograms per meter squared. + virtual void ComputeMass(b2MassData* massData, float32 density) const = 0; + + Type m_type; + float32 m_radius; +}; + +inline b2Shape::Type b2Shape::GetType() const +{ + return m_type; +} + +#endif diff --git a/src/libraries/Box2D/Collision/b2BroadPhase.cpp b/src/libraries/Box2D/Collision/b2BroadPhase.cpp index 2aa62f948..b34df8707 100755 --- a/src/libraries/Box2D/Collision/b2BroadPhase.cpp +++ b/src/libraries/Box2D/Collision/b2BroadPhase.cpp @@ -1,122 +1,122 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -using namespace std; - -b2BroadPhase::b2BroadPhase() -{ - m_proxyCount = 0; - - m_pairCapacity = 16; - m_pairCount = 0; - m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); - - m_moveCapacity = 16; - m_moveCount = 0; - m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); -} - -b2BroadPhase::~b2BroadPhase() -{ - b2Free(m_moveBuffer); - b2Free(m_pairBuffer); -} - -int32 b2BroadPhase::CreateProxy(const b2AABB& aabb, void* userData) -{ - int32 proxyId = m_tree.CreateProxy(aabb, userData); - ++m_proxyCount; - BufferMove(proxyId); - return proxyId; -} - -void b2BroadPhase::DestroyProxy(int32 proxyId) -{ - UnBufferMove(proxyId); - --m_proxyCount; - m_tree.DestroyProxy(proxyId); -} - -void b2BroadPhase::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) -{ - bool buffer = m_tree.MoveProxy(proxyId, aabb, displacement); - if (buffer) - { - BufferMove(proxyId); - } -} - -void b2BroadPhase::TouchProxy(int32 proxyId) -{ - BufferMove(proxyId); -} - -void b2BroadPhase::BufferMove(int32 proxyId) -{ - if (m_moveCount == m_moveCapacity) - { - int32* oldBuffer = m_moveBuffer; - m_moveCapacity *= 2; - m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); - memcpy(m_moveBuffer, oldBuffer, m_moveCount * sizeof(int32)); - b2Free(oldBuffer); - } - - m_moveBuffer[m_moveCount] = proxyId; - ++m_moveCount; -} - -void b2BroadPhase::UnBufferMove(int32 proxyId) -{ - for (int32 i = 0; i < m_moveCount; ++i) - { - if (m_moveBuffer[i] == proxyId) - { - m_moveBuffer[i] = e_nullProxy; - return; - } - } -} - -// This is called from b2DynamicTree::Query when we are gathering pairs. -bool b2BroadPhase::QueryCallback(int32 proxyId) -{ - // A proxy cannot form a pair with itself. - if (proxyId == m_queryProxyId) - { - return true; - } - - // Grow the pair buffer as needed. - if (m_pairCount == m_pairCapacity) - { - b2Pair* oldBuffer = m_pairBuffer; - m_pairCapacity *= 2; - m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); - memcpy(m_pairBuffer, oldBuffer, m_pairCount * sizeof(b2Pair)); - b2Free(oldBuffer); - } - - m_pairBuffer[m_pairCount].proxyIdA = b2Min(proxyId, m_queryProxyId); - m_pairBuffer[m_pairCount].proxyIdB = b2Max(proxyId, m_queryProxyId); - ++m_pairCount; - - return true; -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +using namespace std; + +b2BroadPhase::b2BroadPhase() +{ + m_proxyCount = 0; + + m_pairCapacity = 16; + m_pairCount = 0; + m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); + + m_moveCapacity = 16; + m_moveCount = 0; + m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); +} + +b2BroadPhase::~b2BroadPhase() +{ + b2Free(m_moveBuffer); + b2Free(m_pairBuffer); +} + +int32 b2BroadPhase::CreateProxy(const b2AABB& aabb, void* userData) +{ + int32 proxyId = m_tree.CreateProxy(aabb, userData); + ++m_proxyCount; + BufferMove(proxyId); + return proxyId; +} + +void b2BroadPhase::DestroyProxy(int32 proxyId) +{ + UnBufferMove(proxyId); + --m_proxyCount; + m_tree.DestroyProxy(proxyId); +} + +void b2BroadPhase::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) +{ + bool buffer = m_tree.MoveProxy(proxyId, aabb, displacement); + if (buffer) + { + BufferMove(proxyId); + } +} + +void b2BroadPhase::TouchProxy(int32 proxyId) +{ + BufferMove(proxyId); +} + +void b2BroadPhase::BufferMove(int32 proxyId) +{ + if (m_moveCount == m_moveCapacity) + { + int32* oldBuffer = m_moveBuffer; + m_moveCapacity *= 2; + m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32)); + memcpy(m_moveBuffer, oldBuffer, m_moveCount * sizeof(int32)); + b2Free(oldBuffer); + } + + m_moveBuffer[m_moveCount] = proxyId; + ++m_moveCount; +} + +void b2BroadPhase::UnBufferMove(int32 proxyId) +{ + for (int32 i = 0; i < m_moveCount; ++i) + { + if (m_moveBuffer[i] == proxyId) + { + m_moveBuffer[i] = e_nullProxy; + return; + } + } +} + +// This is called from b2DynamicTree::Query when we are gathering pairs. +bool b2BroadPhase::QueryCallback(int32 proxyId) +{ + // A proxy cannot form a pair with itself. + if (proxyId == m_queryProxyId) + { + return true; + } + + // Grow the pair buffer as needed. + if (m_pairCount == m_pairCapacity) + { + b2Pair* oldBuffer = m_pairBuffer; + m_pairCapacity *= 2; + m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair)); + memcpy(m_pairBuffer, oldBuffer, m_pairCount * sizeof(b2Pair)); + b2Free(oldBuffer); + } + + m_pairBuffer[m_pairCount].proxyIdA = b2Min(proxyId, m_queryProxyId); + m_pairBuffer[m_pairCount].proxyIdB = b2Max(proxyId, m_queryProxyId); + ++m_pairCount; + + return true; +} diff --git a/src/libraries/Box2D/Collision/b2BroadPhase.h b/src/libraries/Box2D/Collision/b2BroadPhase.h index c7398c97a..a289bbf6c 100755 --- a/src/libraries/Box2D/Collision/b2BroadPhase.h +++ b/src/libraries/Box2D/Collision/b2BroadPhase.h @@ -1,248 +1,248 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BROAD_PHASE_H -#define B2_BROAD_PHASE_H - -#include -#include -#include -#include - -struct b2Pair -{ - int32 proxyIdA; - int32 proxyIdB; - int32 next; -}; - -/// The broad-phase is used for computing pairs and performing volume queries and ray casts. -/// This broad-phase does not persist pairs. Instead, this reports potentially new pairs. -/// It is up to the client to consume the new pairs and to track subsequent overlap. -class b2BroadPhase -{ -public: - - enum - { - e_nullProxy = -1 - }; - - b2BroadPhase(); - ~b2BroadPhase(); - - /// Create a proxy with an initial AABB. Pairs are not reported until - /// UpdatePairs is called. - int32 CreateProxy(const b2AABB& aabb, void* userData); - - /// Destroy a proxy. It is up to the client to remove any pairs. - void DestroyProxy(int32 proxyId); - - /// Call MoveProxy as many times as you like, then when you are done - /// call UpdatePairs to finalized the proxy pairs (for your time step). - void MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement); - - /// Call to trigger a re-processing of it's pairs on the next call to UpdatePairs. - void TouchProxy(int32 proxyId); - - /// Get the fat AABB for a proxy. - const b2AABB& GetFatAABB(int32 proxyId) const; - - /// Get user data from a proxy. Returns NULL if the id is invalid. - void* GetUserData(int32 proxyId) const; - - /// Test overlap of fat AABBs. - bool TestOverlap(int32 proxyIdA, int32 proxyIdB) const; - - /// Get the number of proxies. - int32 GetProxyCount() const; - - /// Update the pairs. This results in pair callbacks. This can only add pairs. - template - void UpdatePairs(T* callback); - - /// Query an AABB for overlapping proxies. The callback class - /// is called for each proxy that overlaps the supplied AABB. - template - void Query(T* callback, const b2AABB& aabb) const; - - /// Ray-cast against the proxies in the tree. This relies on the callback - /// to perform a exact ray-cast in the case were the proxy contains a shape. - /// The callback also performs the any collision filtering. This has performance - /// roughly equal to k * log(n), where k is the number of collisions and n is the - /// number of proxies in the tree. - /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). - /// @param callback a callback class that is called for each proxy that is hit by the ray. - template - void RayCast(T* callback, const b2RayCastInput& input) const; - - /// Get the height of the embedded tree. - int32 GetTreeHeight() const; - - /// Get the balance of the embedded tree. - int32 GetTreeBalance() const; - - /// Get the quality metric of the embedded tree. - float32 GetTreeQuality() const; - -private: - - friend class b2DynamicTree; - - void BufferMove(int32 proxyId); - void UnBufferMove(int32 proxyId); - - bool QueryCallback(int32 proxyId); - - b2DynamicTree m_tree; - - int32 m_proxyCount; - - int32* m_moveBuffer; - int32 m_moveCapacity; - int32 m_moveCount; - - b2Pair* m_pairBuffer; - int32 m_pairCapacity; - int32 m_pairCount; - - int32 m_queryProxyId; -}; - -/// This is used to sort pairs. -inline bool b2PairLessThan(const b2Pair& pair1, const b2Pair& pair2) -{ - if (pair1.proxyIdA < pair2.proxyIdA) - { - return true; - } - - if (pair1.proxyIdA == pair2.proxyIdA) - { - return pair1.proxyIdB < pair2.proxyIdB; - } - - return false; -} - -inline void* b2BroadPhase::GetUserData(int32 proxyId) const -{ - return m_tree.GetUserData(proxyId); -} - -inline bool b2BroadPhase::TestOverlap(int32 proxyIdA, int32 proxyIdB) const -{ - const b2AABB& aabbA = m_tree.GetFatAABB(proxyIdA); - const b2AABB& aabbB = m_tree.GetFatAABB(proxyIdB); - return b2TestOverlap(aabbA, aabbB); -} - -inline const b2AABB& b2BroadPhase::GetFatAABB(int32 proxyId) const -{ - return m_tree.GetFatAABB(proxyId); -} - -inline int32 b2BroadPhase::GetProxyCount() const -{ - return m_proxyCount; -} - -inline int32 b2BroadPhase::GetTreeHeight() const -{ - return m_tree.GetHeight(); -} - -inline int32 b2BroadPhase::GetTreeBalance() const -{ - return m_tree.GetMaxBalance(); -} - -inline float32 b2BroadPhase::GetTreeQuality() const -{ - return m_tree.GetAreaRatio(); -} - -template -void b2BroadPhase::UpdatePairs(T* callback) -{ - // Reset pair buffer - m_pairCount = 0; - - // Perform tree queries for all moving proxies. - for (int32 i = 0; i < m_moveCount; ++i) - { - m_queryProxyId = m_moveBuffer[i]; - if (m_queryProxyId == e_nullProxy) - { - continue; - } - - // We have to query the tree with the fat AABB so that - // we don't fail to create a pair that may touch later. - const b2AABB& fatAABB = m_tree.GetFatAABB(m_queryProxyId); - - // Query tree, create pairs and add them pair buffer. - m_tree.Query(this, fatAABB); - } - - // Reset move buffer - m_moveCount = 0; - - // Sort the pair buffer to expose duplicates. - std::sort(m_pairBuffer, m_pairBuffer + m_pairCount, b2PairLessThan); - - // Send the pairs back to the client. - int32 i = 0; - while (i < m_pairCount) - { - b2Pair* primaryPair = m_pairBuffer + i; - void* userDataA = m_tree.GetUserData(primaryPair->proxyIdA); - void* userDataB = m_tree.GetUserData(primaryPair->proxyIdB); - - callback->AddPair(userDataA, userDataB); - ++i; - - // Skip any duplicate pairs. - while (i < m_pairCount) - { - b2Pair* pair = m_pairBuffer + i; - if (pair->proxyIdA != primaryPair->proxyIdA || pair->proxyIdB != primaryPair->proxyIdB) - { - break; - } - ++i; - } - } - - // Try to keep the tree balanced. - //m_tree.Rebalance(4); -} - -template -inline void b2BroadPhase::Query(T* callback, const b2AABB& aabb) const -{ - m_tree.Query(callback, aabb); -} - -template -inline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) const -{ - m_tree.RayCast(callback, input); -} - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BROAD_PHASE_H +#define B2_BROAD_PHASE_H + +#include +#include +#include +#include + +struct b2Pair +{ + int32 proxyIdA; + int32 proxyIdB; + int32 next; +}; + +/// The broad-phase is used for computing pairs and performing volume queries and ray casts. +/// This broad-phase does not persist pairs. Instead, this reports potentially new pairs. +/// It is up to the client to consume the new pairs and to track subsequent overlap. +class b2BroadPhase +{ +public: + + enum + { + e_nullProxy = -1 + }; + + b2BroadPhase(); + ~b2BroadPhase(); + + /// Create a proxy with an initial AABB. Pairs are not reported until + /// UpdatePairs is called. + int32 CreateProxy(const b2AABB& aabb, void* userData); + + /// Destroy a proxy. It is up to the client to remove any pairs. + void DestroyProxy(int32 proxyId); + + /// Call MoveProxy as many times as you like, then when you are done + /// call UpdatePairs to finalized the proxy pairs (for your time step). + void MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement); + + /// Call to trigger a re-processing of it's pairs on the next call to UpdatePairs. + void TouchProxy(int32 proxyId); + + /// Get the fat AABB for a proxy. + const b2AABB& GetFatAABB(int32 proxyId) const; + + /// Get user data from a proxy. Returns NULL if the id is invalid. + void* GetUserData(int32 proxyId) const; + + /// Test overlap of fat AABBs. + bool TestOverlap(int32 proxyIdA, int32 proxyIdB) const; + + /// Get the number of proxies. + int32 GetProxyCount() const; + + /// Update the pairs. This results in pair callbacks. This can only add pairs. + template + void UpdatePairs(T* callback); + + /// Query an AABB for overlapping proxies. The callback class + /// is called for each proxy that overlaps the supplied AABB. + template + void Query(T* callback, const b2AABB& aabb) const; + + /// Ray-cast against the proxies in the tree. This relies on the callback + /// to perform a exact ray-cast in the case were the proxy contains a shape. + /// The callback also performs the any collision filtering. This has performance + /// roughly equal to k * log(n), where k is the number of collisions and n is the + /// number of proxies in the tree. + /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). + /// @param callback a callback class that is called for each proxy that is hit by the ray. + template + void RayCast(T* callback, const b2RayCastInput& input) const; + + /// Get the height of the embedded tree. + int32 GetTreeHeight() const; + + /// Get the balance of the embedded tree. + int32 GetTreeBalance() const; + + /// Get the quality metric of the embedded tree. + float32 GetTreeQuality() const; + +private: + + friend class b2DynamicTree; + + void BufferMove(int32 proxyId); + void UnBufferMove(int32 proxyId); + + bool QueryCallback(int32 proxyId); + + b2DynamicTree m_tree; + + int32 m_proxyCount; + + int32* m_moveBuffer; + int32 m_moveCapacity; + int32 m_moveCount; + + b2Pair* m_pairBuffer; + int32 m_pairCapacity; + int32 m_pairCount; + + int32 m_queryProxyId; +}; + +/// This is used to sort pairs. +inline bool b2PairLessThan(const b2Pair& pair1, const b2Pair& pair2) +{ + if (pair1.proxyIdA < pair2.proxyIdA) + { + return true; + } + + if (pair1.proxyIdA == pair2.proxyIdA) + { + return pair1.proxyIdB < pair2.proxyIdB; + } + + return false; +} + +inline void* b2BroadPhase::GetUserData(int32 proxyId) const +{ + return m_tree.GetUserData(proxyId); +} + +inline bool b2BroadPhase::TestOverlap(int32 proxyIdA, int32 proxyIdB) const +{ + const b2AABB& aabbA = m_tree.GetFatAABB(proxyIdA); + const b2AABB& aabbB = m_tree.GetFatAABB(proxyIdB); + return b2TestOverlap(aabbA, aabbB); +} + +inline const b2AABB& b2BroadPhase::GetFatAABB(int32 proxyId) const +{ + return m_tree.GetFatAABB(proxyId); +} + +inline int32 b2BroadPhase::GetProxyCount() const +{ + return m_proxyCount; +} + +inline int32 b2BroadPhase::GetTreeHeight() const +{ + return m_tree.GetHeight(); +} + +inline int32 b2BroadPhase::GetTreeBalance() const +{ + return m_tree.GetMaxBalance(); +} + +inline float32 b2BroadPhase::GetTreeQuality() const +{ + return m_tree.GetAreaRatio(); +} + +template +void b2BroadPhase::UpdatePairs(T* callback) +{ + // Reset pair buffer + m_pairCount = 0; + + // Perform tree queries for all moving proxies. + for (int32 i = 0; i < m_moveCount; ++i) + { + m_queryProxyId = m_moveBuffer[i]; + if (m_queryProxyId == e_nullProxy) + { + continue; + } + + // We have to query the tree with the fat AABB so that + // we don't fail to create a pair that may touch later. + const b2AABB& fatAABB = m_tree.GetFatAABB(m_queryProxyId); + + // Query tree, create pairs and add them pair buffer. + m_tree.Query(this, fatAABB); + } + + // Reset move buffer + m_moveCount = 0; + + // Sort the pair buffer to expose duplicates. + std::sort(m_pairBuffer, m_pairBuffer + m_pairCount, b2PairLessThan); + + // Send the pairs back to the client. + int32 i = 0; + while (i < m_pairCount) + { + b2Pair* primaryPair = m_pairBuffer + i; + void* userDataA = m_tree.GetUserData(primaryPair->proxyIdA); + void* userDataB = m_tree.GetUserData(primaryPair->proxyIdB); + + callback->AddPair(userDataA, userDataB); + ++i; + + // Skip any duplicate pairs. + while (i < m_pairCount) + { + b2Pair* pair = m_pairBuffer + i; + if (pair->proxyIdA != primaryPair->proxyIdA || pair->proxyIdB != primaryPair->proxyIdB) + { + break; + } + ++i; + } + } + + // Try to keep the tree balanced. + //m_tree.Rebalance(4); +} + +template +inline void b2BroadPhase::Query(T* callback, const b2AABB& aabb) const +{ + m_tree.Query(callback, aabb); +} + +template +inline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) const +{ + m_tree.RayCast(callback, input); +} + +#endif diff --git a/src/libraries/Box2D/Collision/b2CollideCircle.cpp b/src/libraries/Box2D/Collision/b2CollideCircle.cpp index 0ad58f000..ae91c733c 100755 --- a/src/libraries/Box2D/Collision/b2CollideCircle.cpp +++ b/src/libraries/Box2D/Collision/b2CollideCircle.cpp @@ -1,154 +1,154 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -void b2CollideCircles( - b2Manifold* manifold, - const b2CircleShape* circleA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - b2Vec2 pA = b2Mul(xfA, circleA->m_p); - b2Vec2 pB = b2Mul(xfB, circleB->m_p); - - b2Vec2 d = pB - pA; - float32 distSqr = b2Dot(d, d); - float32 rA = circleA->m_radius, rB = circleB->m_radius; - float32 radius = rA + rB; - if (distSqr > radius * radius) - { - return; - } - - manifold->type = b2Manifold::e_circles; - manifold->localPoint = circleA->m_p; - manifold->localNormal.SetZero(); - manifold->pointCount = 1; - - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; -} - -void b2CollidePolygonAndCircle( - b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - // Compute circle position in the frame of the polygon. - b2Vec2 c = b2Mul(xfB, circleB->m_p); - b2Vec2 cLocal = b2MulT(xfA, c); - - // Find the min separating edge. - int32 normalIndex = 0; - float32 separation = -b2_maxFloat; - float32 radius = polygonA->m_radius + circleB->m_radius; - int32 vertexCount = polygonA->m_vertexCount; - const b2Vec2* vertices = polygonA->m_vertices; - const b2Vec2* normals = polygonA->m_normals; - - for (int32 i = 0; i < vertexCount; ++i) - { - float32 s = b2Dot(normals[i], cLocal - vertices[i]); - - if (s > radius) - { - // Early out. - return; - } - - if (s > separation) - { - separation = s; - normalIndex = i; - } - } - - // Vertices that subtend the incident face. - int32 vertIndex1 = normalIndex; - int32 vertIndex2 = vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0; - b2Vec2 v1 = vertices[vertIndex1]; - b2Vec2 v2 = vertices[vertIndex2]; - - // If the center is inside the polygon ... - if (separation < b2_epsilon) - { - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = normals[normalIndex]; - manifold->localPoint = 0.5f * (v1 + v2); - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - return; - } - - // Compute barycentric coordinates - float32 u1 = b2Dot(cLocal - v1, v2 - v1); - float32 u2 = b2Dot(cLocal - v2, v1 - v2); - if (u1 <= 0.0f) - { - if (b2DistanceSquared(cLocal, v1) > radius * radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = cLocal - v1; - manifold->localNormal.Normalize(); - manifold->localPoint = v1; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } - else if (u2 <= 0.0f) - { - if (b2DistanceSquared(cLocal, v2) > radius * radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = cLocal - v2; - manifold->localNormal.Normalize(); - manifold->localPoint = v2; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } - else - { - b2Vec2 faceCenter = 0.5f * (v1 + v2); - float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]); - if (separation > radius) - { - return; - } - - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = normals[vertIndex1]; - manifold->localPoint = faceCenter; - manifold->points[0].localPoint = circleB->m_p; - manifold->points[0].id.key = 0; - } -} +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +void b2CollideCircles( + b2Manifold* manifold, + const b2CircleShape* circleA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + b2Vec2 pA = b2Mul(xfA, circleA->m_p); + b2Vec2 pB = b2Mul(xfB, circleB->m_p); + + b2Vec2 d = pB - pA; + float32 distSqr = b2Dot(d, d); + float32 rA = circleA->m_radius, rB = circleB->m_radius; + float32 radius = rA + rB; + if (distSqr > radius * radius) + { + return; + } + + manifold->type = b2Manifold::e_circles; + manifold->localPoint = circleA->m_p; + manifold->localNormal.SetZero(); + manifold->pointCount = 1; + + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; +} + +void b2CollidePolygonAndCircle( + b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + // Compute circle position in the frame of the polygon. + b2Vec2 c = b2Mul(xfB, circleB->m_p); + b2Vec2 cLocal = b2MulT(xfA, c); + + // Find the min separating edge. + int32 normalIndex = 0; + float32 separation = -b2_maxFloat; + float32 radius = polygonA->m_radius + circleB->m_radius; + int32 vertexCount = polygonA->m_vertexCount; + const b2Vec2* vertices = polygonA->m_vertices; + const b2Vec2* normals = polygonA->m_normals; + + for (int32 i = 0; i < vertexCount; ++i) + { + float32 s = b2Dot(normals[i], cLocal - vertices[i]); + + if (s > radius) + { + // Early out. + return; + } + + if (s > separation) + { + separation = s; + normalIndex = i; + } + } + + // Vertices that subtend the incident face. + int32 vertIndex1 = normalIndex; + int32 vertIndex2 = vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0; + b2Vec2 v1 = vertices[vertIndex1]; + b2Vec2 v2 = vertices[vertIndex2]; + + // If the center is inside the polygon ... + if (separation < b2_epsilon) + { + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = normals[normalIndex]; + manifold->localPoint = 0.5f * (v1 + v2); + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + return; + } + + // Compute barycentric coordinates + float32 u1 = b2Dot(cLocal - v1, v2 - v1); + float32 u2 = b2Dot(cLocal - v2, v1 - v2); + if (u1 <= 0.0f) + { + if (b2DistanceSquared(cLocal, v1) > radius * radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = cLocal - v1; + manifold->localNormal.Normalize(); + manifold->localPoint = v1; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } + else if (u2 <= 0.0f) + { + if (b2DistanceSquared(cLocal, v2) > radius * radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = cLocal - v2; + manifold->localNormal.Normalize(); + manifold->localPoint = v2; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } + else + { + b2Vec2 faceCenter = 0.5f * (v1 + v2); + float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]); + if (separation > radius) + { + return; + } + + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = normals[vertIndex1]; + manifold->localPoint = faceCenter; + manifold->points[0].localPoint = circleB->m_p; + manifold->points[0].id.key = 0; + } +} diff --git a/src/libraries/Box2D/Collision/b2CollideEdge.cpp b/src/libraries/Box2D/Collision/b2CollideEdge.cpp index 281967183..92a8e1157 100755 --- a/src/libraries/Box2D/Collision/b2CollideEdge.cpp +++ b/src/libraries/Box2D/Collision/b2CollideEdge.cpp @@ -1,698 +1,698 @@ -/* - * Copyright (c) 2007-2009 Erin Catto http://www.box2d.org - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -#include -#include -#include -#include - - -// Compute contact points for edge versus circle. -// This accounts for edge connectivity. -void b2CollideEdgeAndCircle(b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - - // Compute circle in frame of edge - b2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p)); - - b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2; - b2Vec2 e = B - A; - - // Barycentric coordinates - float32 u = b2Dot(e, B - Q); - float32 v = b2Dot(e, Q - A); - - float32 radius = edgeA->m_radius + circleB->m_radius; - - b2ContactFeature cf; - cf.indexB = 0; - cf.typeB = b2ContactFeature::e_vertex; - - // Region A - if (v <= 0.0f) - { - b2Vec2 P = A; - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - // Is there an edge connected to A? - if (edgeA->m_hasVertex0) - { - b2Vec2 A1 = edgeA->m_vertex0; - b2Vec2 B1 = A; - b2Vec2 e1 = B1 - A1; - float32 u1 = b2Dot(e1, B1 - Q); - - // Is the circle in Region AB of the previous edge? - if (u1 > 0.0f) - { - return; - } - } - - cf.indexA = 0; - cf.typeA = b2ContactFeature::e_vertex; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_circles; - manifold->localNormal.SetZero(); - manifold->localPoint = P; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; - return; - } - - // Region B - if (u <= 0.0f) - { - b2Vec2 P = B; - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - // Is there an edge connected to B? - if (edgeA->m_hasVertex3) - { - b2Vec2 B2 = edgeA->m_vertex3; - b2Vec2 A2 = B; - b2Vec2 e2 = B2 - A2; - float32 v2 = b2Dot(e2, Q - A2); - - // Is the circle in Region AB of the next edge? - if (v2 > 0.0f) - { - return; - } - } - - cf.indexA = 1; - cf.typeA = b2ContactFeature::e_vertex; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_circles; - manifold->localNormal.SetZero(); - manifold->localPoint = P; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; - return; - } - - // Region AB - float32 den = b2Dot(e, e); - b2Assert(den > 0.0f); - b2Vec2 P = (1.0f / den) * (u * A + v * B); - b2Vec2 d = Q - P; - float32 dd = b2Dot(d, d); - if (dd > radius * radius) - { - return; - } - - b2Vec2 n(-e.y, e.x); - if (b2Dot(n, Q - A) < 0.0f) - { - n.Set(-n.x, -n.y); - } - n.Normalize(); - - cf.indexA = 0; - cf.typeA = b2ContactFeature::e_face; - manifold->pointCount = 1; - manifold->type = b2Manifold::e_faceA; - manifold->localNormal = n; - manifold->localPoint = A; - manifold->points[0].id.key = 0; - manifold->points[0].id.cf = cf; - manifold->points[0].localPoint = circleB->m_p; -} - -// This structure is used to keep track of the best separating axis. -struct b2EPAxis -{ - enum Type - { - e_unknown, - e_edgeA, - e_edgeB - }; - - Type type; - int32 index; - float32 separation; -}; - -// This holds polygon B expressed in frame A. -struct b2TempPolygon -{ - b2Vec2 vertices[b2_maxPolygonVertices]; - b2Vec2 normals[b2_maxPolygonVertices]; - int32 count; -}; - -// Reference face used for clipping -struct b2ReferenceFace -{ - int32 i1, i2; - - b2Vec2 v1, v2; - - b2Vec2 normal; - - b2Vec2 sideNormal1; - float32 sideOffset1; - - b2Vec2 sideNormal2; - float32 sideOffset2; -}; - -// This class collides and edge and a polygon, taking into account edge adjacency. -struct b2EPCollider -{ - void Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB); - b2EPAxis ComputeEdgeSeparation(); - b2EPAxis ComputePolygonSeparation(); - - enum VertexType - { - e_isolated, - e_concave, - e_convex - }; - - b2TempPolygon m_polygonB; - - b2Transform m_xf; - b2Vec2 m_centroidB; - b2Vec2 m_v0, m_v1, m_v2, m_v3; - b2Vec2 m_normal0, m_normal1, m_normal2; - b2Vec2 m_normal; - VertexType m_type1, m_type2; - b2Vec2 m_lowerLimit, m_upperLimit; - float32 m_radius; - bool m_front; -}; - -// Algorithm: -// 1. Classify v1 and v2 -// 2. Classify polygon centroid as front or back -// 3. Flip normal if necessary -// 4. Initialize normal range to [-pi, pi] about face normal -// 5. Adjust normal range according to adjacent edges -// 6. Visit each separating axes, only accept axes within the range -// 7. Return if _any_ axis indicates separation -// 8. Clip -void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB) -{ - m_xf = b2MulT(xfA, xfB); - - m_centroidB = b2Mul(m_xf, polygonB->m_centroid); - - m_v0 = edgeA->m_vertex0; - m_v1 = edgeA->m_vertex1; - m_v2 = edgeA->m_vertex2; - m_v3 = edgeA->m_vertex3; - - bool hasVertex0 = edgeA->m_hasVertex0; - bool hasVertex3 = edgeA->m_hasVertex3; - - b2Vec2 edge1 = m_v2 - m_v1; - edge1.Normalize(); - m_normal1.Set(edge1.y, -edge1.x); - float32 offset1 = b2Dot(m_normal1, m_centroidB - m_v1); - float32 offset0 = 0.0f, offset2 = 0.0f; - bool convex1 = false, convex2 = false; - - // Is there a preceding edge? - if (hasVertex0) - { - b2Vec2 edge0 = m_v1 - m_v0; - edge0.Normalize(); - m_normal0.Set(edge0.y, -edge0.x); - convex1 = b2Cross(edge0, edge1) >= 0.0f; - offset0 = b2Dot(m_normal0, m_centroidB - m_v0); - } - - // Is there a following edge? - if (hasVertex3) - { - b2Vec2 edge2 = m_v3 - m_v2; - edge2.Normalize(); - m_normal2.Set(edge2.y, -edge2.x); - convex2 = b2Cross(edge1, edge2) > 0.0f; - offset2 = b2Dot(m_normal2, m_centroidB - m_v2); - } - - // Determine front or back collision. Determine collision normal limits. - if (hasVertex0 && hasVertex3) - { - if (convex1 && convex2) - { - m_front = offset0 >= 0.0f || offset1 >= 0.0f || offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal1; - } - } - else if (convex1) - { - m_front = offset0 >= 0.0f || (offset1 >= 0.0f && offset2 >= 0.0f); - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = -m_normal1; - } - } - else if (convex2) - { - m_front = offset2 >= 0.0f || (offset0 >= 0.0f && offset1 >= 0.0f); - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal0; - } - } - else - { - m_front = offset0 >= 0.0f && offset1 >= 0.0f && offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = -m_normal0; - } - } - } - else if (hasVertex0) - { - if (convex1) - { - m_front = offset0 >= 0.0f || offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal0; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal1; - } - } - else - { - m_front = offset0 >= 0.0f && offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = -m_normal0; - } - } - } - else if (hasVertex3) - { - if (convex2) - { - m_front = offset1 >= 0.0f || offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal2; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal1; - } - } - else - { - m_front = offset1 >= 0.0f && offset2 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = -m_normal2; - m_upperLimit = m_normal1; - } - } - } - else - { - m_front = offset1 >= 0.0f; - if (m_front) - { - m_normal = m_normal1; - m_lowerLimit = -m_normal1; - m_upperLimit = -m_normal1; - } - else - { - m_normal = -m_normal1; - m_lowerLimit = m_normal1; - m_upperLimit = m_normal1; - } - } - - // Get polygonB in frameA - m_polygonB.count = polygonB->m_vertexCount; - for (int32 i = 0; i < polygonB->m_vertexCount; ++i) - { - m_polygonB.vertices[i] = b2Mul(m_xf, polygonB->m_vertices[i]); - m_polygonB.normals[i] = b2Mul(m_xf.q, polygonB->m_normals[i]); - } - - m_radius = 2.0f * b2_polygonRadius; - - manifold->pointCount = 0; - - b2EPAxis edgeAxis = ComputeEdgeSeparation(); - - // If no valid normal can be found than this edge should not collide. - if (edgeAxis.type == b2EPAxis::e_unknown) - { - return; - } - - if (edgeAxis.separation > m_radius) - { - return; - } - - b2EPAxis polygonAxis = ComputePolygonSeparation(); - if (polygonAxis.type != b2EPAxis::e_unknown && polygonAxis.separation > m_radius) - { - return; - } - - // Use hysteresis for jitter reduction. - const float32 k_relativeTol = 0.98f; - const float32 k_absoluteTol = 0.001f; - - b2EPAxis primaryAxis; - if (polygonAxis.type == b2EPAxis::e_unknown) - { - primaryAxis = edgeAxis; - } - else if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol) - { - primaryAxis = polygonAxis; - } - else - { - primaryAxis = edgeAxis; - } - - b2ClipVertex ie[2]; - b2ReferenceFace rf; - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - manifold->type = b2Manifold::e_faceA; - - // Search for the polygon normal that is most anti-parallel to the edge normal. - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_normal, m_polygonB.normals[0]); - for (int32 i = 1; i < m_polygonB.count; ++i) - { - float32 value = b2Dot(m_normal, m_polygonB.normals[i]); - if (value < bestValue) - { - bestValue = value; - bestIndex = i; - } - } - - int32 i1 = bestIndex; - int32 i2 = i1 + 1 < m_polygonB.count ? i1 + 1 : 0; - - ie[0].v = m_polygonB.vertices[i1]; - ie[0].id.cf.indexA = 0; - ie[0].id.cf.indexB = i1; - ie[0].id.cf.typeA = b2ContactFeature::e_face; - ie[0].id.cf.typeB = b2ContactFeature::e_vertex; - - ie[1].v = m_polygonB.vertices[i2]; - ie[1].id.cf.indexA = 0; - ie[1].id.cf.indexB = i2; - ie[1].id.cf.typeA = b2ContactFeature::e_face; - ie[1].id.cf.typeB = b2ContactFeature::e_vertex; - - if (m_front) - { - rf.i1 = 0; - rf.i2 = 1; - rf.v1 = m_v1; - rf.v2 = m_v2; - rf.normal = m_normal1; - } - else - { - rf.i1 = 1; - rf.i2 = 0; - rf.v1 = m_v2; - rf.v2 = m_v1; - rf.normal = -m_normal1; - } - } - else - { - manifold->type = b2Manifold::e_faceB; - - ie[0].v = m_v1; - ie[0].id.cf.indexA = 0; - ie[0].id.cf.indexB = primaryAxis.index; - ie[0].id.cf.typeA = b2ContactFeature::e_vertex; - ie[0].id.cf.typeB = b2ContactFeature::e_face; - - ie[1].v = m_v2; - ie[1].id.cf.indexA = 0; - ie[1].id.cf.indexB = primaryAxis.index; - ie[1].id.cf.typeA = b2ContactFeature::e_vertex; - ie[1].id.cf.typeB = b2ContactFeature::e_face; - - rf.i1 = primaryAxis.index; - rf.i2 = rf.i1 + 1 < m_polygonB.count ? rf.i1 + 1 : 0; - rf.v1 = m_polygonB.vertices[rf.i1]; - rf.v2 = m_polygonB.vertices[rf.i2]; - rf.normal = m_polygonB.normals[rf.i1]; - } - - rf.sideNormal1.Set(rf.normal.y, -rf.normal.x); - rf.sideNormal2 = -rf.sideNormal1; - rf.sideOffset1 = b2Dot(rf.sideNormal1, rf.v1); - rf.sideOffset2 = b2Dot(rf.sideNormal2, rf.v2); - - // Clip incident edge against extruded edge1 side edges. - b2ClipVertex clipPoints1[2]; - b2ClipVertex clipPoints2[2]; - int32 np; - - // Clip to box side 1 - np = b2ClipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1); - - if (np < b2_maxManifoldPoints) - { - return; - } - - // Clip to negative box side 1 - np = b2ClipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2); - - if (np < b2_maxManifoldPoints) - { - return; - } - - // Now clipPoints2 contains the clipped points. - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - manifold->localNormal = rf.normal; - manifold->localPoint = rf.v1; - } - else - { - manifold->localNormal = polygonB->m_normals[rf.i1]; - manifold->localPoint = polygonB->m_vertices[rf.i1]; - } - - int32 pointCount = 0; - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - float32 separation; - - separation = b2Dot(rf.normal, clipPoints2[i].v - rf.v1); - - if (separation <= m_radius) - { - b2ManifoldPoint* cp = manifold->points + pointCount; - - if (primaryAxis.type == b2EPAxis::e_edgeA) - { - cp->localPoint = b2MulT(m_xf, clipPoints2[i].v); - cp->id = clipPoints2[i].id; - } - else - { - cp->localPoint = clipPoints2[i].v; - cp->id.cf.typeA = clipPoints2[i].id.cf.typeB; - cp->id.cf.typeB = clipPoints2[i].id.cf.typeA; - cp->id.cf.indexA = clipPoints2[i].id.cf.indexB; - cp->id.cf.indexB = clipPoints2[i].id.cf.indexA; - } - - ++pointCount; - } - } - - manifold->pointCount = pointCount; -} - -b2EPAxis b2EPCollider::ComputeEdgeSeparation() -{ - b2EPAxis axis; - axis.type = b2EPAxis::e_edgeA; - axis.index = m_front ? 0 : 1; - axis.separation = FLT_MAX; - - for (int32 i = 0; i < m_polygonB.count; ++i) - { - float32 s = b2Dot(m_normal, m_polygonB.vertices[i] - m_v1); - if (s < axis.separation) - { - axis.separation = s; - } - } - - return axis; -} - -b2EPAxis b2EPCollider::ComputePolygonSeparation() -{ - b2EPAxis axis; - axis.type = b2EPAxis::e_unknown; - axis.index = -1; - axis.separation = -FLT_MAX; - - b2Vec2 perp(-m_normal.y, m_normal.x); - - for (int32 i = 0; i < m_polygonB.count; ++i) - { - b2Vec2 n = -m_polygonB.normals[i]; - - float32 s1 = b2Dot(n, m_polygonB.vertices[i] - m_v1); - float32 s2 = b2Dot(n, m_polygonB.vertices[i] - m_v2); - float32 s = b2Min(s1, s2); - - if (s > m_radius) - { - // No collision - axis.type = b2EPAxis::e_edgeB; - axis.index = i; - axis.separation = s; - return axis; - } - - // Adjacency - if (b2Dot(n, perp) >= 0.0f) - { - if (b2Dot(n - m_upperLimit, m_normal) < -b2_angularSlop) - { - continue; - } - } - else - { - if (b2Dot(n - m_lowerLimit, m_normal) < -b2_angularSlop) - { - continue; - } - } - - if (s > axis.separation) - { - axis.type = b2EPAxis::e_edgeB; - axis.index = i; - axis.separation = s; - } - } - - return axis; -} - -void b2CollideEdgeAndPolygon( b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB) -{ - b2EPCollider collider; - collider.Collide(manifold, edgeA, xfA, polygonB, xfB); -} +/* + * Copyright (c) 2007-2009 Erin Catto http://www.box2d.org + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +#include +#include +#include +#include + + +// Compute contact points for edge versus circle. +// This accounts for edge connectivity. +void b2CollideEdgeAndCircle(b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + + // Compute circle in frame of edge + b2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p)); + + b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2; + b2Vec2 e = B - A; + + // Barycentric coordinates + float32 u = b2Dot(e, B - Q); + float32 v = b2Dot(e, Q - A); + + float32 radius = edgeA->m_radius + circleB->m_radius; + + b2ContactFeature cf; + cf.indexB = 0; + cf.typeB = b2ContactFeature::e_vertex; + + // Region A + if (v <= 0.0f) + { + b2Vec2 P = A; + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + // Is there an edge connected to A? + if (edgeA->m_hasVertex0) + { + b2Vec2 A1 = edgeA->m_vertex0; + b2Vec2 B1 = A; + b2Vec2 e1 = B1 - A1; + float32 u1 = b2Dot(e1, B1 - Q); + + // Is the circle in Region AB of the previous edge? + if (u1 > 0.0f) + { + return; + } + } + + cf.indexA = 0; + cf.typeA = b2ContactFeature::e_vertex; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_circles; + manifold->localNormal.SetZero(); + manifold->localPoint = P; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; + return; + } + + // Region B + if (u <= 0.0f) + { + b2Vec2 P = B; + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + // Is there an edge connected to B? + if (edgeA->m_hasVertex3) + { + b2Vec2 B2 = edgeA->m_vertex3; + b2Vec2 A2 = B; + b2Vec2 e2 = B2 - A2; + float32 v2 = b2Dot(e2, Q - A2); + + // Is the circle in Region AB of the next edge? + if (v2 > 0.0f) + { + return; + } + } + + cf.indexA = 1; + cf.typeA = b2ContactFeature::e_vertex; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_circles; + manifold->localNormal.SetZero(); + manifold->localPoint = P; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; + return; + } + + // Region AB + float32 den = b2Dot(e, e); + b2Assert(den > 0.0f); + b2Vec2 P = (1.0f / den) * (u * A + v * B); + b2Vec2 d = Q - P; + float32 dd = b2Dot(d, d); + if (dd > radius * radius) + { + return; + } + + b2Vec2 n(-e.y, e.x); + if (b2Dot(n, Q - A) < 0.0f) + { + n.Set(-n.x, -n.y); + } + n.Normalize(); + + cf.indexA = 0; + cf.typeA = b2ContactFeature::e_face; + manifold->pointCount = 1; + manifold->type = b2Manifold::e_faceA; + manifold->localNormal = n; + manifold->localPoint = A; + manifold->points[0].id.key = 0; + manifold->points[0].id.cf = cf; + manifold->points[0].localPoint = circleB->m_p; +} + +// This structure is used to keep track of the best separating axis. +struct b2EPAxis +{ + enum Type + { + e_unknown, + e_edgeA, + e_edgeB + }; + + Type type; + int32 index; + float32 separation; +}; + +// This holds polygon B expressed in frame A. +struct b2TempPolygon +{ + b2Vec2 vertices[b2_maxPolygonVertices]; + b2Vec2 normals[b2_maxPolygonVertices]; + int32 count; +}; + +// Reference face used for clipping +struct b2ReferenceFace +{ + int32 i1, i2; + + b2Vec2 v1, v2; + + b2Vec2 normal; + + b2Vec2 sideNormal1; + float32 sideOffset1; + + b2Vec2 sideNormal2; + float32 sideOffset2; +}; + +// This class collides and edge and a polygon, taking into account edge adjacency. +struct b2EPCollider +{ + void Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB); + b2EPAxis ComputeEdgeSeparation(); + b2EPAxis ComputePolygonSeparation(); + + enum VertexType + { + e_isolated, + e_concave, + e_convex + }; + + b2TempPolygon m_polygonB; + + b2Transform m_xf; + b2Vec2 m_centroidB; + b2Vec2 m_v0, m_v1, m_v2, m_v3; + b2Vec2 m_normal0, m_normal1, m_normal2; + b2Vec2 m_normal; + VertexType m_type1, m_type2; + b2Vec2 m_lowerLimit, m_upperLimit; + float32 m_radius; + bool m_front; +}; + +// Algorithm: +// 1. Classify v1 and v2 +// 2. Classify polygon centroid as front or back +// 3. Flip normal if necessary +// 4. Initialize normal range to [-pi, pi] about face normal +// 5. Adjust normal range according to adjacent edges +// 6. Visit each separating axes, only accept axes within the range +// 7. Return if _any_ axis indicates separation +// 8. Clip +void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB) +{ + m_xf = b2MulT(xfA, xfB); + + m_centroidB = b2Mul(m_xf, polygonB->m_centroid); + + m_v0 = edgeA->m_vertex0; + m_v1 = edgeA->m_vertex1; + m_v2 = edgeA->m_vertex2; + m_v3 = edgeA->m_vertex3; + + bool hasVertex0 = edgeA->m_hasVertex0; + bool hasVertex3 = edgeA->m_hasVertex3; + + b2Vec2 edge1 = m_v2 - m_v1; + edge1.Normalize(); + m_normal1.Set(edge1.y, -edge1.x); + float32 offset1 = b2Dot(m_normal1, m_centroidB - m_v1); + float32 offset0 = 0.0f, offset2 = 0.0f; + bool convex1 = false, convex2 = false; + + // Is there a preceding edge? + if (hasVertex0) + { + b2Vec2 edge0 = m_v1 - m_v0; + edge0.Normalize(); + m_normal0.Set(edge0.y, -edge0.x); + convex1 = b2Cross(edge0, edge1) >= 0.0f; + offset0 = b2Dot(m_normal0, m_centroidB - m_v0); + } + + // Is there a following edge? + if (hasVertex3) + { + b2Vec2 edge2 = m_v3 - m_v2; + edge2.Normalize(); + m_normal2.Set(edge2.y, -edge2.x); + convex2 = b2Cross(edge1, edge2) > 0.0f; + offset2 = b2Dot(m_normal2, m_centroidB - m_v2); + } + + // Determine front or back collision. Determine collision normal limits. + if (hasVertex0 && hasVertex3) + { + if (convex1 && convex2) + { + m_front = offset0 >= 0.0f || offset1 >= 0.0f || offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal1; + } + } + else if (convex1) + { + m_front = offset0 >= 0.0f || (offset1 >= 0.0f && offset2 >= 0.0f); + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = -m_normal1; + } + } + else if (convex2) + { + m_front = offset2 >= 0.0f || (offset0 >= 0.0f && offset1 >= 0.0f); + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal0; + } + } + else + { + m_front = offset0 >= 0.0f && offset1 >= 0.0f && offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = -m_normal0; + } + } + } + else if (hasVertex0) + { + if (convex1) + { + m_front = offset0 >= 0.0f || offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal0; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal1; + } + } + else + { + m_front = offset0 >= 0.0f && offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = -m_normal0; + } + } + } + else if (hasVertex3) + { + if (convex2) + { + m_front = offset1 >= 0.0f || offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal2; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal1; + } + } + else + { + m_front = offset1 >= 0.0f && offset2 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = -m_normal2; + m_upperLimit = m_normal1; + } + } + } + else + { + m_front = offset1 >= 0.0f; + if (m_front) + { + m_normal = m_normal1; + m_lowerLimit = -m_normal1; + m_upperLimit = -m_normal1; + } + else + { + m_normal = -m_normal1; + m_lowerLimit = m_normal1; + m_upperLimit = m_normal1; + } + } + + // Get polygonB in frameA + m_polygonB.count = polygonB->m_vertexCount; + for (int32 i = 0; i < polygonB->m_vertexCount; ++i) + { + m_polygonB.vertices[i] = b2Mul(m_xf, polygonB->m_vertices[i]); + m_polygonB.normals[i] = b2Mul(m_xf.q, polygonB->m_normals[i]); + } + + m_radius = 2.0f * b2_polygonRadius; + + manifold->pointCount = 0; + + b2EPAxis edgeAxis = ComputeEdgeSeparation(); + + // If no valid normal can be found than this edge should not collide. + if (edgeAxis.type == b2EPAxis::e_unknown) + { + return; + } + + if (edgeAxis.separation > m_radius) + { + return; + } + + b2EPAxis polygonAxis = ComputePolygonSeparation(); + if (polygonAxis.type != b2EPAxis::e_unknown && polygonAxis.separation > m_radius) + { + return; + } + + // Use hysteresis for jitter reduction. + const float32 k_relativeTol = 0.98f; + const float32 k_absoluteTol = 0.001f; + + b2EPAxis primaryAxis; + if (polygonAxis.type == b2EPAxis::e_unknown) + { + primaryAxis = edgeAxis; + } + else if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol) + { + primaryAxis = polygonAxis; + } + else + { + primaryAxis = edgeAxis; + } + + b2ClipVertex ie[2]; + b2ReferenceFace rf; + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + manifold->type = b2Manifold::e_faceA; + + // Search for the polygon normal that is most anti-parallel to the edge normal. + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_normal, m_polygonB.normals[0]); + for (int32 i = 1; i < m_polygonB.count; ++i) + { + float32 value = b2Dot(m_normal, m_polygonB.normals[i]); + if (value < bestValue) + { + bestValue = value; + bestIndex = i; + } + } + + int32 i1 = bestIndex; + int32 i2 = i1 + 1 < m_polygonB.count ? i1 + 1 : 0; + + ie[0].v = m_polygonB.vertices[i1]; + ie[0].id.cf.indexA = 0; + ie[0].id.cf.indexB = i1; + ie[0].id.cf.typeA = b2ContactFeature::e_face; + ie[0].id.cf.typeB = b2ContactFeature::e_vertex; + + ie[1].v = m_polygonB.vertices[i2]; + ie[1].id.cf.indexA = 0; + ie[1].id.cf.indexB = i2; + ie[1].id.cf.typeA = b2ContactFeature::e_face; + ie[1].id.cf.typeB = b2ContactFeature::e_vertex; + + if (m_front) + { + rf.i1 = 0; + rf.i2 = 1; + rf.v1 = m_v1; + rf.v2 = m_v2; + rf.normal = m_normal1; + } + else + { + rf.i1 = 1; + rf.i2 = 0; + rf.v1 = m_v2; + rf.v2 = m_v1; + rf.normal = -m_normal1; + } + } + else + { + manifold->type = b2Manifold::e_faceB; + + ie[0].v = m_v1; + ie[0].id.cf.indexA = 0; + ie[0].id.cf.indexB = primaryAxis.index; + ie[0].id.cf.typeA = b2ContactFeature::e_vertex; + ie[0].id.cf.typeB = b2ContactFeature::e_face; + + ie[1].v = m_v2; + ie[1].id.cf.indexA = 0; + ie[1].id.cf.indexB = primaryAxis.index; + ie[1].id.cf.typeA = b2ContactFeature::e_vertex; + ie[1].id.cf.typeB = b2ContactFeature::e_face; + + rf.i1 = primaryAxis.index; + rf.i2 = rf.i1 + 1 < m_polygonB.count ? rf.i1 + 1 : 0; + rf.v1 = m_polygonB.vertices[rf.i1]; + rf.v2 = m_polygonB.vertices[rf.i2]; + rf.normal = m_polygonB.normals[rf.i1]; + } + + rf.sideNormal1.Set(rf.normal.y, -rf.normal.x); + rf.sideNormal2 = -rf.sideNormal1; + rf.sideOffset1 = b2Dot(rf.sideNormal1, rf.v1); + rf.sideOffset2 = b2Dot(rf.sideNormal2, rf.v2); + + // Clip incident edge against extruded edge1 side edges. + b2ClipVertex clipPoints1[2]; + b2ClipVertex clipPoints2[2]; + int32 np; + + // Clip to box side 1 + np = b2ClipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1); + + if (np < b2_maxManifoldPoints) + { + return; + } + + // Clip to negative box side 1 + np = b2ClipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2); + + if (np < b2_maxManifoldPoints) + { + return; + } + + // Now clipPoints2 contains the clipped points. + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + manifold->localNormal = rf.normal; + manifold->localPoint = rf.v1; + } + else + { + manifold->localNormal = polygonB->m_normals[rf.i1]; + manifold->localPoint = polygonB->m_vertices[rf.i1]; + } + + int32 pointCount = 0; + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + float32 separation; + + separation = b2Dot(rf.normal, clipPoints2[i].v - rf.v1); + + if (separation <= m_radius) + { + b2ManifoldPoint* cp = manifold->points + pointCount; + + if (primaryAxis.type == b2EPAxis::e_edgeA) + { + cp->localPoint = b2MulT(m_xf, clipPoints2[i].v); + cp->id = clipPoints2[i].id; + } + else + { + cp->localPoint = clipPoints2[i].v; + cp->id.cf.typeA = clipPoints2[i].id.cf.typeB; + cp->id.cf.typeB = clipPoints2[i].id.cf.typeA; + cp->id.cf.indexA = clipPoints2[i].id.cf.indexB; + cp->id.cf.indexB = clipPoints2[i].id.cf.indexA; + } + + ++pointCount; + } + } + + manifold->pointCount = pointCount; +} + +b2EPAxis b2EPCollider::ComputeEdgeSeparation() +{ + b2EPAxis axis; + axis.type = b2EPAxis::e_edgeA; + axis.index = m_front ? 0 : 1; + axis.separation = FLT_MAX; + + for (int32 i = 0; i < m_polygonB.count; ++i) + { + float32 s = b2Dot(m_normal, m_polygonB.vertices[i] - m_v1); + if (s < axis.separation) + { + axis.separation = s; + } + } + + return axis; +} + +b2EPAxis b2EPCollider::ComputePolygonSeparation() +{ + b2EPAxis axis; + axis.type = b2EPAxis::e_unknown; + axis.index = -1; + axis.separation = -FLT_MAX; + + b2Vec2 perp(-m_normal.y, m_normal.x); + + for (int32 i = 0; i < m_polygonB.count; ++i) + { + b2Vec2 n = -m_polygonB.normals[i]; + + float32 s1 = b2Dot(n, m_polygonB.vertices[i] - m_v1); + float32 s2 = b2Dot(n, m_polygonB.vertices[i] - m_v2); + float32 s = b2Min(s1, s2); + + if (s > m_radius) + { + // No collision + axis.type = b2EPAxis::e_edgeB; + axis.index = i; + axis.separation = s; + return axis; + } + + // Adjacency + if (b2Dot(n, perp) >= 0.0f) + { + if (b2Dot(n - m_upperLimit, m_normal) < -b2_angularSlop) + { + continue; + } + } + else + { + if (b2Dot(n - m_lowerLimit, m_normal) < -b2_angularSlop) + { + continue; + } + } + + if (s > axis.separation) + { + axis.type = b2EPAxis::e_edgeB; + axis.index = i; + axis.separation = s; + } + } + + return axis; +} + +void b2CollideEdgeAndPolygon( b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB) +{ + b2EPCollider collider; + collider.Collide(manifold, edgeA, xfA, polygonB, xfB); +} diff --git a/src/libraries/Box2D/Collision/b2CollidePolygon.cpp b/src/libraries/Box2D/Collision/b2CollidePolygon.cpp index 2f0946b92..68695285c 100755 --- a/src/libraries/Box2D/Collision/b2CollidePolygon.cpp +++ b/src/libraries/Box2D/Collision/b2CollidePolygon.cpp @@ -1,317 +1,317 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -// Find the separation between poly1 and poly2 for a give edge normal on poly1. -static float32 b2EdgeSeparation(const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - const b2Vec2* vertices1 = poly1->m_vertices; - const b2Vec2* normals1 = poly1->m_normals; - - int32 count2 = poly2->m_vertexCount; - const b2Vec2* vertices2 = poly2->m_vertices; - - b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); - - // Convert normal from poly1's frame into poly2's frame. - b2Vec2 normal1World = b2Mul(xf1.q, normals1[edge1]); - b2Vec2 normal1 = b2MulT(xf2.q, normal1World); - - // Find support vertex on poly2 for -normal. - int32 index = 0; - float32 minDot = b2_maxFloat; - - for (int32 i = 0; i < count2; ++i) - { - float32 dot = b2Dot(vertices2[i], normal1); - if (dot < minDot) - { - minDot = dot; - index = i; - } - } - - b2Vec2 v1 = b2Mul(xf1, vertices1[edge1]); - b2Vec2 v2 = b2Mul(xf2, vertices2[index]); - float32 separation = b2Dot(v2 - v1, normal1World); - return separation; -} - -// Find the max separation between poly1 and poly2 using edge normals from poly1. -static float32 b2FindMaxSeparation(int32* edgeIndex, - const b2PolygonShape* poly1, const b2Transform& xf1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - int32 count1 = poly1->m_vertexCount; - const b2Vec2* normals1 = poly1->m_normals; - - // Vector pointing from the centroid of poly1 to the centroid of poly2. - b2Vec2 d = b2Mul(xf2, poly2->m_centroid) - b2Mul(xf1, poly1->m_centroid); - b2Vec2 dLocal1 = b2MulT(xf1.q, d); - - // Find edge normal on poly1 that has the largest projection onto d. - int32 edge = 0; - float32 maxDot = -b2_maxFloat; - for (int32 i = 0; i < count1; ++i) - { - float32 dot = b2Dot(normals1[i], dLocal1); - if (dot > maxDot) - { - maxDot = dot; - edge = i; - } - } - - // Get the separation for the edge normal. - float32 s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); - - // Check the separation for the previous edge normal. - int32 prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1; - float32 sPrev = b2EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2); - - // Check the separation for the next edge normal. - int32 nextEdge = edge + 1 < count1 ? edge + 1 : 0; - float32 sNext = b2EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2); - - // Find the best edge and the search direction. - int32 bestEdge; - float32 bestSeparation; - int32 increment; - if (sPrev > s && sPrev > sNext) - { - increment = -1; - bestEdge = prevEdge; - bestSeparation = sPrev; - } - else if (sNext > s) - { - increment = 1; - bestEdge = nextEdge; - bestSeparation = sNext; - } - else - { - *edgeIndex = edge; - return s; - } - - // Perform a local search for the best edge normal. - for ( ; ; ) - { - if (increment == -1) - edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1; - else - edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0; - - s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); - - if (s > bestSeparation) - { - bestEdge = edge; - bestSeparation = s; - } - else - { - break; - } - } - - *edgeIndex = bestEdge; - return bestSeparation; -} - -static void b2FindIncidentEdge(b2ClipVertex c[2], - const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, - const b2PolygonShape* poly2, const b2Transform& xf2) -{ - const b2Vec2* normals1 = poly1->m_normals; - - int32 count2 = poly2->m_vertexCount; - const b2Vec2* vertices2 = poly2->m_vertices; - const b2Vec2* normals2 = poly2->m_normals; - - b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); - - // Get the normal of the reference edge in poly2's frame. - b2Vec2 normal1 = b2MulT(xf2.q, b2Mul(xf1.q, normals1[edge1])); - - // Find the incident edge on poly2. - int32 index = 0; - float32 minDot = b2_maxFloat; - for (int32 i = 0; i < count2; ++i) - { - float32 dot = b2Dot(normal1, normals2[i]); - if (dot < minDot) - { - minDot = dot; - index = i; - } - } - - // Build the clip vertices for the incident edge. - int32 i1 = index; - int32 i2 = i1 + 1 < count2 ? i1 + 1 : 0; - - c[0].v = b2Mul(xf2, vertices2[i1]); - c[0].id.cf.indexA = (uint8)edge1; - c[0].id.cf.indexB = (uint8)i1; - c[0].id.cf.typeA = b2ContactFeature::e_face; - c[0].id.cf.typeB = b2ContactFeature::e_vertex; - - c[1].v = b2Mul(xf2, vertices2[i2]); - c[1].id.cf.indexA = (uint8)edge1; - c[1].id.cf.indexB = (uint8)i2; - c[1].id.cf.typeA = b2ContactFeature::e_face; - c[1].id.cf.typeB = b2ContactFeature::e_vertex; -} - -// Find edge normal of max separation on A - return if separating axis is found -// Find edge normal of max separation on B - return if separation axis is found -// Choose reference edge as min(minA, minB) -// Find incident edge -// Clip - -// The normal points from 1 to 2 -void b2CollidePolygons(b2Manifold* manifold, - const b2PolygonShape* polyA, const b2Transform& xfA, - const b2PolygonShape* polyB, const b2Transform& xfB) -{ - manifold->pointCount = 0; - float32 totalRadius = polyA->m_radius + polyB->m_radius; - - int32 edgeA = 0; - float32 separationA = b2FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB); - if (separationA > totalRadius) - return; - - int32 edgeB = 0; - float32 separationB = b2FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA); - if (separationB > totalRadius) - return; - - const b2PolygonShape* poly1; // reference polygon - const b2PolygonShape* poly2; // incident polygon - b2Transform xf1, xf2; - int32 edge1; // reference edge - uint8 flip; - const float32 k_relativeTol = 0.98f; - const float32 k_absoluteTol = 0.001f; - - if (separationB > k_relativeTol * separationA + k_absoluteTol) - { - poly1 = polyB; - poly2 = polyA; - xf1 = xfB; - xf2 = xfA; - edge1 = edgeB; - manifold->type = b2Manifold::e_faceB; - flip = 1; - } - else - { - poly1 = polyA; - poly2 = polyB; - xf1 = xfA; - xf2 = xfB; - edge1 = edgeA; - manifold->type = b2Manifold::e_faceA; - flip = 0; - } - - b2ClipVertex incidentEdge[2]; - b2FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2); - - int32 count1 = poly1->m_vertexCount; - const b2Vec2* vertices1 = poly1->m_vertices; - - int32 iv1 = edge1; - int32 iv2 = edge1 + 1 < count1 ? edge1 + 1 : 0; - - b2Vec2 v11 = vertices1[iv1]; - b2Vec2 v12 = vertices1[iv2]; - - b2Vec2 localTangent = v12 - v11; - localTangent.Normalize(); - - b2Vec2 localNormal = b2Cross(localTangent, 1.0f); - b2Vec2 planePoint = 0.5f * (v11 + v12); - - b2Vec2 tangent = b2Mul(xf1.q, localTangent); - b2Vec2 normal = b2Cross(tangent, 1.0f); - - v11 = b2Mul(xf1, v11); - v12 = b2Mul(xf1, v12); - - // Face offset. - float32 frontOffset = b2Dot(normal, v11); - - // Side offsets, extended by polytope skin thickness. - float32 sideOffset1 = -b2Dot(tangent, v11) + totalRadius; - float32 sideOffset2 = b2Dot(tangent, v12) + totalRadius; - - // Clip incident edge against extruded edge1 side edges. - b2ClipVertex clipPoints1[2]; - b2ClipVertex clipPoints2[2]; - int np; - - // Clip to box side 1 - np = b2ClipSegmentToLine(clipPoints1, incidentEdge, -tangent, sideOffset1, iv1); - - if (np < 2) - return; - - // Clip to negative box side 1 - np = b2ClipSegmentToLine(clipPoints2, clipPoints1, tangent, sideOffset2, iv2); - - if (np < 2) - { - return; - } - - // Now clipPoints2 contains the clipped points. - manifold->localNormal = localNormal; - manifold->localPoint = planePoint; - - int32 pointCount = 0; - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - float32 separation = b2Dot(normal, clipPoints2[i].v) - frontOffset; - - if (separation <= totalRadius) - { - b2ManifoldPoint* cp = manifold->points + pointCount; - cp->localPoint = b2MulT(xf2, clipPoints2[i].v); - cp->id = clipPoints2[i].id; - if (flip) - { - // Swap features - b2ContactFeature cf = cp->id.cf; - cp->id.cf.indexA = cf.indexB; - cp->id.cf.indexB = cf.indexA; - cp->id.cf.typeA = cf.typeB; - cp->id.cf.typeB = cf.typeA; - } - ++pointCount; - } - } - - manifold->pointCount = pointCount; -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +// Find the separation between poly1 and poly2 for a give edge normal on poly1. +static float32 b2EdgeSeparation(const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + const b2Vec2* vertices1 = poly1->m_vertices; + const b2Vec2* normals1 = poly1->m_normals; + + int32 count2 = poly2->m_vertexCount; + const b2Vec2* vertices2 = poly2->m_vertices; + + b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); + + // Convert normal from poly1's frame into poly2's frame. + b2Vec2 normal1World = b2Mul(xf1.q, normals1[edge1]); + b2Vec2 normal1 = b2MulT(xf2.q, normal1World); + + // Find support vertex on poly2 for -normal. + int32 index = 0; + float32 minDot = b2_maxFloat; + + for (int32 i = 0; i < count2; ++i) + { + float32 dot = b2Dot(vertices2[i], normal1); + if (dot < minDot) + { + minDot = dot; + index = i; + } + } + + b2Vec2 v1 = b2Mul(xf1, vertices1[edge1]); + b2Vec2 v2 = b2Mul(xf2, vertices2[index]); + float32 separation = b2Dot(v2 - v1, normal1World); + return separation; +} + +// Find the max separation between poly1 and poly2 using edge normals from poly1. +static float32 b2FindMaxSeparation(int32* edgeIndex, + const b2PolygonShape* poly1, const b2Transform& xf1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + int32 count1 = poly1->m_vertexCount; + const b2Vec2* normals1 = poly1->m_normals; + + // Vector pointing from the centroid of poly1 to the centroid of poly2. + b2Vec2 d = b2Mul(xf2, poly2->m_centroid) - b2Mul(xf1, poly1->m_centroid); + b2Vec2 dLocal1 = b2MulT(xf1.q, d); + + // Find edge normal on poly1 that has the largest projection onto d. + int32 edge = 0; + float32 maxDot = -b2_maxFloat; + for (int32 i = 0; i < count1; ++i) + { + float32 dot = b2Dot(normals1[i], dLocal1); + if (dot > maxDot) + { + maxDot = dot; + edge = i; + } + } + + // Get the separation for the edge normal. + float32 s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); + + // Check the separation for the previous edge normal. + int32 prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1; + float32 sPrev = b2EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2); + + // Check the separation for the next edge normal. + int32 nextEdge = edge + 1 < count1 ? edge + 1 : 0; + float32 sNext = b2EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2); + + // Find the best edge and the search direction. + int32 bestEdge; + float32 bestSeparation; + int32 increment; + if (sPrev > s && sPrev > sNext) + { + increment = -1; + bestEdge = prevEdge; + bestSeparation = sPrev; + } + else if (sNext > s) + { + increment = 1; + bestEdge = nextEdge; + bestSeparation = sNext; + } + else + { + *edgeIndex = edge; + return s; + } + + // Perform a local search for the best edge normal. + for ( ; ; ) + { + if (increment == -1) + edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1; + else + edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0; + + s = b2EdgeSeparation(poly1, xf1, edge, poly2, xf2); + + if (s > bestSeparation) + { + bestEdge = edge; + bestSeparation = s; + } + else + { + break; + } + } + + *edgeIndex = bestEdge; + return bestSeparation; +} + +static void b2FindIncidentEdge(b2ClipVertex c[2], + const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1, + const b2PolygonShape* poly2, const b2Transform& xf2) +{ + const b2Vec2* normals1 = poly1->m_normals; + + int32 count2 = poly2->m_vertexCount; + const b2Vec2* vertices2 = poly2->m_vertices; + const b2Vec2* normals2 = poly2->m_normals; + + b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); + + // Get the normal of the reference edge in poly2's frame. + b2Vec2 normal1 = b2MulT(xf2.q, b2Mul(xf1.q, normals1[edge1])); + + // Find the incident edge on poly2. + int32 index = 0; + float32 minDot = b2_maxFloat; + for (int32 i = 0; i < count2; ++i) + { + float32 dot = b2Dot(normal1, normals2[i]); + if (dot < minDot) + { + minDot = dot; + index = i; + } + } + + // Build the clip vertices for the incident edge. + int32 i1 = index; + int32 i2 = i1 + 1 < count2 ? i1 + 1 : 0; + + c[0].v = b2Mul(xf2, vertices2[i1]); + c[0].id.cf.indexA = (uint8)edge1; + c[0].id.cf.indexB = (uint8)i1; + c[0].id.cf.typeA = b2ContactFeature::e_face; + c[0].id.cf.typeB = b2ContactFeature::e_vertex; + + c[1].v = b2Mul(xf2, vertices2[i2]); + c[1].id.cf.indexA = (uint8)edge1; + c[1].id.cf.indexB = (uint8)i2; + c[1].id.cf.typeA = b2ContactFeature::e_face; + c[1].id.cf.typeB = b2ContactFeature::e_vertex; +} + +// Find edge normal of max separation on A - return if separating axis is found +// Find edge normal of max separation on B - return if separation axis is found +// Choose reference edge as min(minA, minB) +// Find incident edge +// Clip + +// The normal points from 1 to 2 +void b2CollidePolygons(b2Manifold* manifold, + const b2PolygonShape* polyA, const b2Transform& xfA, + const b2PolygonShape* polyB, const b2Transform& xfB) +{ + manifold->pointCount = 0; + float32 totalRadius = polyA->m_radius + polyB->m_radius; + + int32 edgeA = 0; + float32 separationA = b2FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB); + if (separationA > totalRadius) + return; + + int32 edgeB = 0; + float32 separationB = b2FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA); + if (separationB > totalRadius) + return; + + const b2PolygonShape* poly1; // reference polygon + const b2PolygonShape* poly2; // incident polygon + b2Transform xf1, xf2; + int32 edge1; // reference edge + uint8 flip; + const float32 k_relativeTol = 0.98f; + const float32 k_absoluteTol = 0.001f; + + if (separationB > k_relativeTol * separationA + k_absoluteTol) + { + poly1 = polyB; + poly2 = polyA; + xf1 = xfB; + xf2 = xfA; + edge1 = edgeB; + manifold->type = b2Manifold::e_faceB; + flip = 1; + } + else + { + poly1 = polyA; + poly2 = polyB; + xf1 = xfA; + xf2 = xfB; + edge1 = edgeA; + manifold->type = b2Manifold::e_faceA; + flip = 0; + } + + b2ClipVertex incidentEdge[2]; + b2FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2); + + int32 count1 = poly1->m_vertexCount; + const b2Vec2* vertices1 = poly1->m_vertices; + + int32 iv1 = edge1; + int32 iv2 = edge1 + 1 < count1 ? edge1 + 1 : 0; + + b2Vec2 v11 = vertices1[iv1]; + b2Vec2 v12 = vertices1[iv2]; + + b2Vec2 localTangent = v12 - v11; + localTangent.Normalize(); + + b2Vec2 localNormal = b2Cross(localTangent, 1.0f); + b2Vec2 planePoint = 0.5f * (v11 + v12); + + b2Vec2 tangent = b2Mul(xf1.q, localTangent); + b2Vec2 normal = b2Cross(tangent, 1.0f); + + v11 = b2Mul(xf1, v11); + v12 = b2Mul(xf1, v12); + + // Face offset. + float32 frontOffset = b2Dot(normal, v11); + + // Side offsets, extended by polytope skin thickness. + float32 sideOffset1 = -b2Dot(tangent, v11) + totalRadius; + float32 sideOffset2 = b2Dot(tangent, v12) + totalRadius; + + // Clip incident edge against extruded edge1 side edges. + b2ClipVertex clipPoints1[2]; + b2ClipVertex clipPoints2[2]; + int np; + + // Clip to box side 1 + np = b2ClipSegmentToLine(clipPoints1, incidentEdge, -tangent, sideOffset1, iv1); + + if (np < 2) + return; + + // Clip to negative box side 1 + np = b2ClipSegmentToLine(clipPoints2, clipPoints1, tangent, sideOffset2, iv2); + + if (np < 2) + { + return; + } + + // Now clipPoints2 contains the clipped points. + manifold->localNormal = localNormal; + manifold->localPoint = planePoint; + + int32 pointCount = 0; + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + float32 separation = b2Dot(normal, clipPoints2[i].v) - frontOffset; + + if (separation <= totalRadius) + { + b2ManifoldPoint* cp = manifold->points + pointCount; + cp->localPoint = b2MulT(xf2, clipPoints2[i].v); + cp->id = clipPoints2[i].id; + if (flip) + { + // Swap features + b2ContactFeature cf = cp->id.cf; + cp->id.cf.indexA = cf.indexB; + cp->id.cf.indexB = cf.indexA; + cp->id.cf.typeA = cf.typeB; + cp->id.cf.typeB = cf.typeA; + } + ++pointCount; + } + } + + manifold->pointCount = pointCount; +} diff --git a/src/libraries/Box2D/Collision/b2Collision.cpp b/src/libraries/Box2D/Collision/b2Collision.cpp index 4b092f0cb..8ecb33775 100755 --- a/src/libraries/Box2D/Collision/b2Collision.cpp +++ b/src/libraries/Box2D/Collision/b2Collision.cpp @@ -1,249 +1,249 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -void b2WorldManifold::Initialize(const b2Manifold* manifold, - const b2Transform& xfA, float32 radiusA, - const b2Transform& xfB, float32 radiusB) -{ - if (manifold->pointCount == 0) - { - return; - } - - switch (manifold->type) - { - case b2Manifold::e_circles: - { - normal.Set(1.0f, 0.0f); - b2Vec2 pointA = b2Mul(xfA, manifold->localPoint); - b2Vec2 pointB = b2Mul(xfB, manifold->points[0].localPoint); - if (b2DistanceSquared(pointA, pointB) > b2_epsilon * b2_epsilon) - { - normal = pointB - pointA; - normal.Normalize(); - } - - b2Vec2 cA = pointA + radiusA * normal; - b2Vec2 cB = pointB - radiusB * normal; - points[0] = 0.5f * (cA + cB); - } - break; - - case b2Manifold::e_faceA: - { - normal = b2Mul(xfA.q, manifold->localNormal); - b2Vec2 planePoint = b2Mul(xfA, manifold->localPoint); - - for (int32 i = 0; i < manifold->pointCount; ++i) - { - b2Vec2 clipPoint = b2Mul(xfB, manifold->points[i].localPoint); - b2Vec2 cA = clipPoint + (radiusA - b2Dot(clipPoint - planePoint, normal)) * normal; - b2Vec2 cB = clipPoint - radiusB * normal; - points[i] = 0.5f * (cA + cB); - } - } - break; - - case b2Manifold::e_faceB: - { - normal = b2Mul(xfB.q, manifold->localNormal); - b2Vec2 planePoint = b2Mul(xfB, manifold->localPoint); - - for (int32 i = 0; i < manifold->pointCount; ++i) - { - b2Vec2 clipPoint = b2Mul(xfA, manifold->points[i].localPoint); - b2Vec2 cB = clipPoint + (radiusB - b2Dot(clipPoint - planePoint, normal)) * normal; - b2Vec2 cA = clipPoint - radiusA * normal; - points[i] = 0.5f * (cA + cB); - } - - // Ensure normal points from A to B. - normal = -normal; - } - break; - } -} - -void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], - const b2Manifold* manifold1, const b2Manifold* manifold2) -{ - for (int32 i = 0; i < b2_maxManifoldPoints; ++i) - { - state1[i] = b2_nullState; - state2[i] = b2_nullState; - } - - // Detect persists and removes. - for (int32 i = 0; i < manifold1->pointCount; ++i) - { - b2ContactID id = manifold1->points[i].id; - - state1[i] = b2_removeState; - - for (int32 j = 0; j < manifold2->pointCount; ++j) - { - if (manifold2->points[j].id.key == id.key) - { - state1[i] = b2_persistState; - break; - } - } - } - - // Detect persists and adds. - for (int32 i = 0; i < manifold2->pointCount; ++i) - { - b2ContactID id = manifold2->points[i].id; - - state2[i] = b2_addState; - - for (int32 j = 0; j < manifold1->pointCount; ++j) - { - if (manifold1->points[j].id.key == id.key) - { - state2[i] = b2_persistState; - break; - } - } - } -} - -// From Real-time Collision Detection, p179. -bool b2AABB::RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const -{ - float32 tmin = -b2_maxFloat; - float32 tmax = b2_maxFloat; - - b2Vec2 p = input.p1; - b2Vec2 d = input.p2 - input.p1; - b2Vec2 absD = b2Abs(d); - - b2Vec2 normal; - - for (int32 i = 0; i < 2; ++i) - { - if (absD(i) < b2_epsilon) - { - // Parallel. - if (p(i) < lowerBound(i) || upperBound(i) < p(i)) - { - return false; - } - } - else - { - float32 inv_d = 1.0f / d(i); - float32 t1 = (lowerBound(i) - p(i)) * inv_d; - float32 t2 = (upperBound(i) - p(i)) * inv_d; - - // Sign of the normal vector. - float32 s = -1.0f; - - if (t1 > t2) - { - b2Swap(t1, t2); - s = 1.0f; - } - - // Push the min up - if (t1 > tmin) - { - normal.SetZero(); - normal(i) = s; - tmin = t1; - } - - // Pull the max down - tmax = b2Min(tmax, t2); - - if (tmin > tmax) - { - return false; - } - } - } - - // Does the ray start inside the box? - // Does the ray intersect beyond the max fraction? - if (tmin < 0.0f || input.maxFraction < tmin) - { - return false; - } - - // Intersection. - output->fraction = tmin; - output->normal = normal; - return true; -} - -// Sutherland-Hodgman clipping. -int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], - const b2Vec2& normal, float32 offset, int32 vertexIndexA) -{ - // Start with no output points - int32 numOut = 0; - - // Calculate the distance of end points to the line - float32 distance0 = b2Dot(normal, vIn[0].v) - offset; - float32 distance1 = b2Dot(normal, vIn[1].v) - offset; - - // If the points are behind the plane - if (distance0 <= 0.0f) vOut[numOut++] = vIn[0]; - if (distance1 <= 0.0f) vOut[numOut++] = vIn[1]; - - // If the points are on different sides of the plane - if (distance0 * distance1 < 0.0f) - { - // Find intersection point of edge and plane - float32 interp = distance0 / (distance0 - distance1); - vOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v); - - // VertexA is hitting edgeB. - vOut[numOut].id.cf.indexA = vertexIndexA; - vOut[numOut].id.cf.indexB = vIn[0].id.cf.indexB; - vOut[numOut].id.cf.typeA = b2ContactFeature::e_vertex; - vOut[numOut].id.cf.typeB = b2ContactFeature::e_face; - ++numOut; - } - - return numOut; -} - -bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, - const b2Shape* shapeB, int32 indexB, - const b2Transform& xfA, const b2Transform& xfB) -{ - b2DistanceInput input; - input.proxyA.Set(shapeA, indexA); - input.proxyB.Set(shapeB, indexB); - input.transformA = xfA; - input.transformB = xfB; - input.useRadii = true; - - b2SimplexCache cache; - cache.count = 0; - - b2DistanceOutput output; - - b2Distance(&output, &cache, &input); - - return output.distance < 10.0f * b2_epsilon; -} +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +void b2WorldManifold::Initialize(const b2Manifold* manifold, + const b2Transform& xfA, float32 radiusA, + const b2Transform& xfB, float32 radiusB) +{ + if (manifold->pointCount == 0) + { + return; + } + + switch (manifold->type) + { + case b2Manifold::e_circles: + { + normal.Set(1.0f, 0.0f); + b2Vec2 pointA = b2Mul(xfA, manifold->localPoint); + b2Vec2 pointB = b2Mul(xfB, manifold->points[0].localPoint); + if (b2DistanceSquared(pointA, pointB) > b2_epsilon * b2_epsilon) + { + normal = pointB - pointA; + normal.Normalize(); + } + + b2Vec2 cA = pointA + radiusA * normal; + b2Vec2 cB = pointB - radiusB * normal; + points[0] = 0.5f * (cA + cB); + } + break; + + case b2Manifold::e_faceA: + { + normal = b2Mul(xfA.q, manifold->localNormal); + b2Vec2 planePoint = b2Mul(xfA, manifold->localPoint); + + for (int32 i = 0; i < manifold->pointCount; ++i) + { + b2Vec2 clipPoint = b2Mul(xfB, manifold->points[i].localPoint); + b2Vec2 cA = clipPoint + (radiusA - b2Dot(clipPoint - planePoint, normal)) * normal; + b2Vec2 cB = clipPoint - radiusB * normal; + points[i] = 0.5f * (cA + cB); + } + } + break; + + case b2Manifold::e_faceB: + { + normal = b2Mul(xfB.q, manifold->localNormal); + b2Vec2 planePoint = b2Mul(xfB, manifold->localPoint); + + for (int32 i = 0; i < manifold->pointCount; ++i) + { + b2Vec2 clipPoint = b2Mul(xfA, manifold->points[i].localPoint); + b2Vec2 cB = clipPoint + (radiusB - b2Dot(clipPoint - planePoint, normal)) * normal; + b2Vec2 cA = clipPoint - radiusA * normal; + points[i] = 0.5f * (cA + cB); + } + + // Ensure normal points from A to B. + normal = -normal; + } + break; + } +} + +void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], + const b2Manifold* manifold1, const b2Manifold* manifold2) +{ + for (int32 i = 0; i < b2_maxManifoldPoints; ++i) + { + state1[i] = b2_nullState; + state2[i] = b2_nullState; + } + + // Detect persists and removes. + for (int32 i = 0; i < manifold1->pointCount; ++i) + { + b2ContactID id = manifold1->points[i].id; + + state1[i] = b2_removeState; + + for (int32 j = 0; j < manifold2->pointCount; ++j) + { + if (manifold2->points[j].id.key == id.key) + { + state1[i] = b2_persistState; + break; + } + } + } + + // Detect persists and adds. + for (int32 i = 0; i < manifold2->pointCount; ++i) + { + b2ContactID id = manifold2->points[i].id; + + state2[i] = b2_addState; + + for (int32 j = 0; j < manifold1->pointCount; ++j) + { + if (manifold1->points[j].id.key == id.key) + { + state2[i] = b2_persistState; + break; + } + } + } +} + +// From Real-time Collision Detection, p179. +bool b2AABB::RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const +{ + float32 tmin = -b2_maxFloat; + float32 tmax = b2_maxFloat; + + b2Vec2 p = input.p1; + b2Vec2 d = input.p2 - input.p1; + b2Vec2 absD = b2Abs(d); + + b2Vec2 normal; + + for (int32 i = 0; i < 2; ++i) + { + if (absD(i) < b2_epsilon) + { + // Parallel. + if (p(i) < lowerBound(i) || upperBound(i) < p(i)) + { + return false; + } + } + else + { + float32 inv_d = 1.0f / d(i); + float32 t1 = (lowerBound(i) - p(i)) * inv_d; + float32 t2 = (upperBound(i) - p(i)) * inv_d; + + // Sign of the normal vector. + float32 s = -1.0f; + + if (t1 > t2) + { + b2Swap(t1, t2); + s = 1.0f; + } + + // Push the min up + if (t1 > tmin) + { + normal.SetZero(); + normal(i) = s; + tmin = t1; + } + + // Pull the max down + tmax = b2Min(tmax, t2); + + if (tmin > tmax) + { + return false; + } + } + } + + // Does the ray start inside the box? + // Does the ray intersect beyond the max fraction? + if (tmin < 0.0f || input.maxFraction < tmin) + { + return false; + } + + // Intersection. + output->fraction = tmin; + output->normal = normal; + return true; +} + +// Sutherland-Hodgman clipping. +int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], + const b2Vec2& normal, float32 offset, int32 vertexIndexA) +{ + // Start with no output points + int32 numOut = 0; + + // Calculate the distance of end points to the line + float32 distance0 = b2Dot(normal, vIn[0].v) - offset; + float32 distance1 = b2Dot(normal, vIn[1].v) - offset; + + // If the points are behind the plane + if (distance0 <= 0.0f) vOut[numOut++] = vIn[0]; + if (distance1 <= 0.0f) vOut[numOut++] = vIn[1]; + + // If the points are on different sides of the plane + if (distance0 * distance1 < 0.0f) + { + // Find intersection point of edge and plane + float32 interp = distance0 / (distance0 - distance1); + vOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v); + + // VertexA is hitting edgeB. + vOut[numOut].id.cf.indexA = vertexIndexA; + vOut[numOut].id.cf.indexB = vIn[0].id.cf.indexB; + vOut[numOut].id.cf.typeA = b2ContactFeature::e_vertex; + vOut[numOut].id.cf.typeB = b2ContactFeature::e_face; + ++numOut; + } + + return numOut; +} + +bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, + const b2Shape* shapeB, int32 indexB, + const b2Transform& xfA, const b2Transform& xfB) +{ + b2DistanceInput input; + input.proxyA.Set(shapeA, indexA); + input.proxyB.Set(shapeB, indexB); + input.transformA = xfA; + input.transformB = xfB; + input.useRadii = true; + + b2SimplexCache cache; + cache.count = 0; + + b2DistanceOutput output; + + b2Distance(&output, &cache, &input); + + return output.distance < 10.0f * b2_epsilon; +} diff --git a/src/libraries/Box2D/Collision/b2Collision.h b/src/libraries/Box2D/Collision/b2Collision.h index 27897f70a..8bb316caa 100755 --- a/src/libraries/Box2D/Collision/b2Collision.h +++ b/src/libraries/Box2D/Collision/b2Collision.h @@ -1,276 +1,276 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_COLLISION_H -#define B2_COLLISION_H - -#include -#include - -/// @file -/// Structures and functions used for computing contact points, distance -/// queries, and TOI queries. - -class b2Shape; -class b2CircleShape; -class b2EdgeShape; -class b2PolygonShape; - -const uint8 b2_nullFeature = UCHAR_MAX; - -/// The features that intersect to form the contact point -/// This must be 4 bytes or less. -struct b2ContactFeature -{ - enum Type - { - e_vertex = 0, - e_face = 1 - }; - - uint8 indexA; ///< Feature index on shapeA - uint8 indexB; ///< Feature index on shapeB - uint8 typeA; ///< The feature type on shapeA - uint8 typeB; ///< The feature type on shapeB -}; - -/// Contact ids to facilitate warm starting. -union b2ContactID -{ - b2ContactFeature cf; - uint32 key; ///< Used to quickly compare contact ids. -}; - -/// A manifold point is a contact point belonging to a contact -/// manifold. It holds details related to the geometry and dynamics -/// of the contact points. -/// The local point usage depends on the manifold type: -/// -e_circles: the local center of circleB -/// -e_faceA: the local center of cirlceB or the clip point of polygonB -/// -e_faceB: the clip point of polygonA -/// This structure is stored across time steps, so we keep it small. -/// Note: the impulses are used for internal caching and may not -/// provide reliable contact forces, especially for high speed collisions. -struct b2ManifoldPoint -{ - b2Vec2 localPoint; ///< usage depends on manifold type - float32 normalImpulse; ///< the non-penetration impulse - float32 tangentImpulse; ///< the friction impulse - b2ContactID id; ///< uniquely identifies a contact point between two shapes -}; - -/// A manifold for two touching convex shapes. -/// Box2D supports multiple types of contact: -/// - clip point versus plane with radius -/// - point versus point with radius (circles) -/// The local point usage depends on the manifold type: -/// -e_circles: the local center of circleA -/// -e_faceA: the center of faceA -/// -e_faceB: the center of faceB -/// Similarly the local normal usage: -/// -e_circles: not used -/// -e_faceA: the normal on polygonA -/// -e_faceB: the normal on polygonB -/// We store contacts in this way so that position correction can -/// account for movement, which is critical for continuous physics. -/// All contact scenarios must be expressed in one of these types. -/// This structure is stored across time steps, so we keep it small. -struct b2Manifold -{ - enum Type - { - e_circles, - e_faceA, - e_faceB - }; - - b2ManifoldPoint points[b2_maxManifoldPoints]; ///< the points of contact - b2Vec2 localNormal; ///< not use for Type::e_points - b2Vec2 localPoint; ///< usage depends on manifold type - Type type; - int32 pointCount; ///< the number of manifold points -}; - -/// This is used to compute the current state of a contact manifold. -struct b2WorldManifold -{ - /// Evaluate the manifold with supplied transforms. This assumes - /// modest motion from the original state. This does not change the - /// point count, impulses, etc. The radii must come from the shapes - /// that generated the manifold. - void Initialize(const b2Manifold* manifold, - const b2Transform& xfA, float32 radiusA, - const b2Transform& xfB, float32 radiusB); - - b2Vec2 normal; ///< world vector pointing from A to B - b2Vec2 points[b2_maxManifoldPoints]; ///< world contact point (point of intersection) -}; - -/// This is used for determining the state of contact points. -enum b2PointState -{ - b2_nullState, ///< point does not exist - b2_addState, ///< point was added in the update - b2_persistState, ///< point persisted across the update - b2_removeState ///< point was removed in the update -}; - -/// Compute the point states given two manifolds. The states pertain to the transition from manifold1 -/// to manifold2. So state1 is either persist or remove while state2 is either add or persist. -void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], - const b2Manifold* manifold1, const b2Manifold* manifold2); - -/// Used for computing contact manifolds. -struct b2ClipVertex -{ - b2Vec2 v; - b2ContactID id; -}; - -/// Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). -struct b2RayCastInput -{ - b2Vec2 p1, p2; - float32 maxFraction; -}; - -/// Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 -/// come from b2RayCastInput. -struct b2RayCastOutput -{ - b2Vec2 normal; - float32 fraction; -}; - -/// An axis aligned bounding box. -struct b2AABB -{ - /// Verify that the bounds are sorted. - bool IsValid() const; - - /// Get the center of the AABB. - b2Vec2 GetCenter() const - { - return 0.5f * (lowerBound + upperBound); - } - - /// Get the extents of the AABB (half-widths). - b2Vec2 GetExtents() const - { - return 0.5f * (upperBound - lowerBound); - } - - /// Get the perimeter length - float32 GetPerimeter() const - { - float32 wx = upperBound.x - lowerBound.x; - float32 wy = upperBound.y - lowerBound.y; - return 2.0f * (wx + wy); - } - - /// Combine an AABB into this one. - void Combine(const b2AABB& aabb) - { - lowerBound = b2Min(lowerBound, aabb.lowerBound); - upperBound = b2Max(upperBound, aabb.upperBound); - } - - /// Combine two AABBs into this one. - void Combine(const b2AABB& aabb1, const b2AABB& aabb2) - { - lowerBound = b2Min(aabb1.lowerBound, aabb2.lowerBound); - upperBound = b2Max(aabb1.upperBound, aabb2.upperBound); - } - - /// Does this aabb contain the provided AABB. - bool Contains(const b2AABB& aabb) const - { - bool result = true; - result = result && lowerBound.x <= aabb.lowerBound.x; - result = result && lowerBound.y <= aabb.lowerBound.y; - result = result && aabb.upperBound.x <= upperBound.x; - result = result && aabb.upperBound.y <= upperBound.y; - return result; - } - - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const; - - b2Vec2 lowerBound; ///< the lower vertex - b2Vec2 upperBound; ///< the upper vertex -}; - -/// Compute the collision manifold between two circles. -void b2CollideCircles(b2Manifold* manifold, - const b2CircleShape* circleA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between a polygon and a circle. -void b2CollidePolygonAndCircle(b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between two polygons. -void b2CollidePolygons(b2Manifold* manifold, - const b2PolygonShape* polygonA, const b2Transform& xfA, - const b2PolygonShape* polygonB, const b2Transform& xfB); - -/// Compute the collision manifold between an edge and a circle. -void b2CollideEdgeAndCircle(b2Manifold* manifold, - const b2EdgeShape* polygonA, const b2Transform& xfA, - const b2CircleShape* circleB, const b2Transform& xfB); - -/// Compute the collision manifold between an edge and a circle. -void b2CollideEdgeAndPolygon(b2Manifold* manifold, - const b2EdgeShape* edgeA, const b2Transform& xfA, - const b2PolygonShape* circleB, const b2Transform& xfB); - -/// Clipping for contact manifolds. -int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], - const b2Vec2& normal, float32 offset, int32 vertexIndexA); - -/// Determine if two generic shapes overlap. -bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, - const b2Shape* shapeB, int32 indexB, - const b2Transform& xfA, const b2Transform& xfB); - -// ---------------- Inline Functions ------------------------------------------ - -inline bool b2AABB::IsValid() const -{ - b2Vec2 d = upperBound - lowerBound; - bool valid = d.x >= 0.0f && d.y >= 0.0f; - valid = valid && lowerBound.IsValid() && upperBound.IsValid(); - return valid; -} - -inline bool b2TestOverlap(const b2AABB& a, const b2AABB& b) -{ - b2Vec2 d1, d2; - d1 = b.lowerBound - a.upperBound; - d2 = a.lowerBound - b.upperBound; - - if (d1.x > 0.0f || d1.y > 0.0f) - return false; - - if (d2.x > 0.0f || d2.y > 0.0f) - return false; - - return true; -} - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_COLLISION_H +#define B2_COLLISION_H + +#include +#include + +/// @file +/// Structures and functions used for computing contact points, distance +/// queries, and TOI queries. + +class b2Shape; +class b2CircleShape; +class b2EdgeShape; +class b2PolygonShape; + +const uint8 b2_nullFeature = UCHAR_MAX; + +/// The features that intersect to form the contact point +/// This must be 4 bytes or less. +struct b2ContactFeature +{ + enum Type + { + e_vertex = 0, + e_face = 1 + }; + + uint8 indexA; ///< Feature index on shapeA + uint8 indexB; ///< Feature index on shapeB + uint8 typeA; ///< The feature type on shapeA + uint8 typeB; ///< The feature type on shapeB +}; + +/// Contact ids to facilitate warm starting. +union b2ContactID +{ + b2ContactFeature cf; + uint32 key; ///< Used to quickly compare contact ids. +}; + +/// A manifold point is a contact point belonging to a contact +/// manifold. It holds details related to the geometry and dynamics +/// of the contact points. +/// The local point usage depends on the manifold type: +/// -e_circles: the local center of circleB +/// -e_faceA: the local center of cirlceB or the clip point of polygonB +/// -e_faceB: the clip point of polygonA +/// This structure is stored across time steps, so we keep it small. +/// Note: the impulses are used for internal caching and may not +/// provide reliable contact forces, especially for high speed collisions. +struct b2ManifoldPoint +{ + b2Vec2 localPoint; ///< usage depends on manifold type + float32 normalImpulse; ///< the non-penetration impulse + float32 tangentImpulse; ///< the friction impulse + b2ContactID id; ///< uniquely identifies a contact point between two shapes +}; + +/// A manifold for two touching convex shapes. +/// Box2D supports multiple types of contact: +/// - clip point versus plane with radius +/// - point versus point with radius (circles) +/// The local point usage depends on the manifold type: +/// -e_circles: the local center of circleA +/// -e_faceA: the center of faceA +/// -e_faceB: the center of faceB +/// Similarly the local normal usage: +/// -e_circles: not used +/// -e_faceA: the normal on polygonA +/// -e_faceB: the normal on polygonB +/// We store contacts in this way so that position correction can +/// account for movement, which is critical for continuous physics. +/// All contact scenarios must be expressed in one of these types. +/// This structure is stored across time steps, so we keep it small. +struct b2Manifold +{ + enum Type + { + e_circles, + e_faceA, + e_faceB + }; + + b2ManifoldPoint points[b2_maxManifoldPoints]; ///< the points of contact + b2Vec2 localNormal; ///< not use for Type::e_points + b2Vec2 localPoint; ///< usage depends on manifold type + Type type; + int32 pointCount; ///< the number of manifold points +}; + +/// This is used to compute the current state of a contact manifold. +struct b2WorldManifold +{ + /// Evaluate the manifold with supplied transforms. This assumes + /// modest motion from the original state. This does not change the + /// point count, impulses, etc. The radii must come from the shapes + /// that generated the manifold. + void Initialize(const b2Manifold* manifold, + const b2Transform& xfA, float32 radiusA, + const b2Transform& xfB, float32 radiusB); + + b2Vec2 normal; ///< world vector pointing from A to B + b2Vec2 points[b2_maxManifoldPoints]; ///< world contact point (point of intersection) +}; + +/// This is used for determining the state of contact points. +enum b2PointState +{ + b2_nullState, ///< point does not exist + b2_addState, ///< point was added in the update + b2_persistState, ///< point persisted across the update + b2_removeState ///< point was removed in the update +}; + +/// Compute the point states given two manifolds. The states pertain to the transition from manifold1 +/// to manifold2. So state1 is either persist or remove while state2 is either add or persist. +void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], + const b2Manifold* manifold1, const b2Manifold* manifold2); + +/// Used for computing contact manifolds. +struct b2ClipVertex +{ + b2Vec2 v; + b2ContactID id; +}; + +/// Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). +struct b2RayCastInput +{ + b2Vec2 p1, p2; + float32 maxFraction; +}; + +/// Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 +/// come from b2RayCastInput. +struct b2RayCastOutput +{ + b2Vec2 normal; + float32 fraction; +}; + +/// An axis aligned bounding box. +struct b2AABB +{ + /// Verify that the bounds are sorted. + bool IsValid() const; + + /// Get the center of the AABB. + b2Vec2 GetCenter() const + { + return 0.5f * (lowerBound + upperBound); + } + + /// Get the extents of the AABB (half-widths). + b2Vec2 GetExtents() const + { + return 0.5f * (upperBound - lowerBound); + } + + /// Get the perimeter length + float32 GetPerimeter() const + { + float32 wx = upperBound.x - lowerBound.x; + float32 wy = upperBound.y - lowerBound.y; + return 2.0f * (wx + wy); + } + + /// Combine an AABB into this one. + void Combine(const b2AABB& aabb) + { + lowerBound = b2Min(lowerBound, aabb.lowerBound); + upperBound = b2Max(upperBound, aabb.upperBound); + } + + /// Combine two AABBs into this one. + void Combine(const b2AABB& aabb1, const b2AABB& aabb2) + { + lowerBound = b2Min(aabb1.lowerBound, aabb2.lowerBound); + upperBound = b2Max(aabb1.upperBound, aabb2.upperBound); + } + + /// Does this aabb contain the provided AABB. + bool Contains(const b2AABB& aabb) const + { + bool result = true; + result = result && lowerBound.x <= aabb.lowerBound.x; + result = result && lowerBound.y <= aabb.lowerBound.y; + result = result && aabb.upperBound.x <= upperBound.x; + result = result && aabb.upperBound.y <= upperBound.y; + return result; + } + + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const; + + b2Vec2 lowerBound; ///< the lower vertex + b2Vec2 upperBound; ///< the upper vertex +}; + +/// Compute the collision manifold between two circles. +void b2CollideCircles(b2Manifold* manifold, + const b2CircleShape* circleA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between a polygon and a circle. +void b2CollidePolygonAndCircle(b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between two polygons. +void b2CollidePolygons(b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB); + +/// Compute the collision manifold between an edge and a circle. +void b2CollideEdgeAndCircle(b2Manifold* manifold, + const b2EdgeShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between an edge and a circle. +void b2CollideEdgeAndPolygon(b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* circleB, const b2Transform& xfB); + +/// Clipping for contact manifolds. +int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], + const b2Vec2& normal, float32 offset, int32 vertexIndexA); + +/// Determine if two generic shapes overlap. +bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, + const b2Shape* shapeB, int32 indexB, + const b2Transform& xfA, const b2Transform& xfB); + +// ---------------- Inline Functions ------------------------------------------ + +inline bool b2AABB::IsValid() const +{ + b2Vec2 d = upperBound - lowerBound; + bool valid = d.x >= 0.0f && d.y >= 0.0f; + valid = valid && lowerBound.IsValid() && upperBound.IsValid(); + return valid; +} + +inline bool b2TestOverlap(const b2AABB& a, const b2AABB& b) +{ + b2Vec2 d1, d2; + d1 = b.lowerBound - a.upperBound; + d2 = a.lowerBound - b.upperBound; + + if (d1.x > 0.0f || d1.y > 0.0f) + return false; + + if (d2.x > 0.0f || d2.y > 0.0f) + return false; + + return true; +} + +#endif diff --git a/src/libraries/Box2D/Collision/b2Distance.cpp b/src/libraries/Box2D/Collision/b2Distance.cpp index 1010c8c0e..8309ea4fe 100755 --- a/src/libraries/Box2D/Collision/b2Distance.cpp +++ b/src/libraries/Box2D/Collision/b2Distance.cpp @@ -1,603 +1,603 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates. -int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; - -void b2DistanceProxy::Set(const b2Shape* shape, int32 index) -{ - switch (shape->GetType()) - { - case b2Shape::e_circle: - { - const b2CircleShape* circle = (b2CircleShape*)shape; - m_vertices = &circle->m_p; - m_count = 1; - m_radius = circle->m_radius; - } - break; - - case b2Shape::e_polygon: - { - const b2PolygonShape* polygon = (b2PolygonShape*)shape; - m_vertices = polygon->m_vertices; - m_count = polygon->m_vertexCount; - m_radius = polygon->m_radius; - } - break; - - case b2Shape::e_chain: - { - const b2ChainShape* chain = (b2ChainShape*)shape; - b2Assert(0 <= index && index < chain->m_count); - - m_buffer[0] = chain->m_vertices[index]; - if (index + 1 < chain->m_count) - { - m_buffer[1] = chain->m_vertices[index + 1]; - } - else - { - m_buffer[1] = chain->m_vertices[0]; - } - - m_vertices = m_buffer; - m_count = 2; - m_radius = chain->m_radius; - } - break; - - case b2Shape::e_edge: - { - const b2EdgeShape* edge = (b2EdgeShape*)shape; - m_vertices = &edge->m_vertex1; - m_count = 2; - m_radius = edge->m_radius; - } - break; - - default: - b2Assert(false); - } -} - - -struct b2SimplexVertex -{ - b2Vec2 wA; // support point in proxyA - b2Vec2 wB; // support point in proxyB - b2Vec2 w; // wB - wA - float32 a; // barycentric coordinate for closest point - int32 indexA; // wA index - int32 indexB; // wB index -}; - -struct b2Simplex -{ - void ReadCache( const b2SimplexCache* cache, - const b2DistanceProxy* proxyA, const b2Transform& transformA, - const b2DistanceProxy* proxyB, const b2Transform& transformB) - { - b2Assert(cache->count <= 3); - - // Copy data from cache. - m_count = cache->count; - b2SimplexVertex* vertices = &m_v1; - for (int32 i = 0; i < m_count; ++i) - { - b2SimplexVertex* v = vertices + i; - v->indexA = cache->indexA[i]; - v->indexB = cache->indexB[i]; - b2Vec2 wALocal = proxyA->GetVertex(v->indexA); - b2Vec2 wBLocal = proxyB->GetVertex(v->indexB); - v->wA = b2Mul(transformA, wALocal); - v->wB = b2Mul(transformB, wBLocal); - v->w = v->wB - v->wA; - v->a = 0.0f; - } - - // Compute the new simplex metric, if it is substantially different than - // old metric then flush the simplex. - if (m_count > 1) - { - float32 metric1 = cache->metric; - float32 metric2 = GetMetric(); - if (metric2 < 0.5f * metric1 || 2.0f * metric1 < metric2 || metric2 < b2_epsilon) - { - // Reset the simplex. - m_count = 0; - } - } - - // If the cache is empty or invalid ... - if (m_count == 0) - { - b2SimplexVertex* v = vertices + 0; - v->indexA = 0; - v->indexB = 0; - b2Vec2 wALocal = proxyA->GetVertex(0); - b2Vec2 wBLocal = proxyB->GetVertex(0); - v->wA = b2Mul(transformA, wALocal); - v->wB = b2Mul(transformB, wBLocal); - v->w = v->wB - v->wA; - m_count = 1; - } - } - - void WriteCache(b2SimplexCache* cache) const - { - cache->metric = GetMetric(); - cache->count = uint16(m_count); - const b2SimplexVertex* vertices = &m_v1; - for (int32 i = 0; i < m_count; ++i) - { - cache->indexA[i] = uint8(vertices[i].indexA); - cache->indexB[i] = uint8(vertices[i].indexB); - } - } - - b2Vec2 GetSearchDirection() const - { - switch (m_count) - { - case 1: - return -m_v1.w; - - case 2: - { - b2Vec2 e12 = m_v2.w - m_v1.w; - float32 sgn = b2Cross(e12, -m_v1.w); - if (sgn > 0.0f) - { - // Origin is left of e12. - return b2Cross(1.0f, e12); - } - else - { - // Origin is right of e12. - return b2Cross(e12, 1.0f); - } - } - - default: - b2Assert(false); - return b2Vec2_zero; - } - } - - b2Vec2 GetClosestPoint() const - { - switch (m_count) - { - case 0: - b2Assert(false); - return b2Vec2_zero; - - case 1: - return m_v1.w; - - case 2: - return m_v1.a * m_v1.w + m_v2.a * m_v2.w; - - case 3: - return b2Vec2_zero; - - default: - b2Assert(false); - return b2Vec2_zero; - } - } - - void GetWitnessPoints(b2Vec2* pA, b2Vec2* pB) const - { - switch (m_count) - { - case 0: - b2Assert(false); - break; - - case 1: - *pA = m_v1.wA; - *pB = m_v1.wB; - break; - - case 2: - *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA; - *pB = m_v1.a * m_v1.wB + m_v2.a * m_v2.wB; - break; - - case 3: - *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA + m_v3.a * m_v3.wA; - *pB = *pA; - break; - - default: - b2Assert(false); - break; - } - } - - float32 GetMetric() const - { - switch (m_count) - { - case 0: - b2Assert(false); - return 0.0; - - case 1: - return 0.0f; - - case 2: - return b2Distance(m_v1.w, m_v2.w); - - case 3: - return b2Cross(m_v2.w - m_v1.w, m_v3.w - m_v1.w); - - default: - b2Assert(false); - return 0.0f; - } - } - - void Solve2(); - void Solve3(); - - b2SimplexVertex m_v1, m_v2, m_v3; - int32 m_count; -}; - - -// Solve a line segment using barycentric coordinates. -// -// p = a1 * w1 + a2 * w2 -// a1 + a2 = 1 -// -// The vector from the origin to the closest point on the line is -// perpendicular to the line. -// e12 = w2 - w1 -// dot(p, e) = 0 -// a1 * dot(w1, e) + a2 * dot(w2, e) = 0 -// -// 2-by-2 linear system -// [1 1 ][a1] = [1] -// [w1.e12 w2.e12][a2] = [0] -// -// Define -// d12_1 = dot(w2, e12) -// d12_2 = -dot(w1, e12) -// d12 = d12_1 + d12_2 -// -// Solution -// a1 = d12_1 / d12 -// a2 = d12_2 / d12 -void b2Simplex::Solve2() -{ - b2Vec2 w1 = m_v1.w; - b2Vec2 w2 = m_v2.w; - b2Vec2 e12 = w2 - w1; - - // w1 region - float32 d12_2 = -b2Dot(w1, e12); - if (d12_2 <= 0.0f) - { - // a2 <= 0, so we clamp it to 0 - m_v1.a = 1.0f; - m_count = 1; - return; - } - - // w2 region - float32 d12_1 = b2Dot(w2, e12); - if (d12_1 <= 0.0f) - { - // a1 <= 0, so we clamp it to 0 - m_v2.a = 1.0f; - m_count = 1; - m_v1 = m_v2; - return; - } - - // Must be in e12 region. - float32 inv_d12 = 1.0f / (d12_1 + d12_2); - m_v1.a = d12_1 * inv_d12; - m_v2.a = d12_2 * inv_d12; - m_count = 2; -} - -// Possible regions: -// - points[2] -// - edge points[0]-points[2] -// - edge points[1]-points[2] -// - inside the triangle -void b2Simplex::Solve3() -{ - b2Vec2 w1 = m_v1.w; - b2Vec2 w2 = m_v2.w; - b2Vec2 w3 = m_v3.w; - - // Edge12 - // [1 1 ][a1] = [1] - // [w1.e12 w2.e12][a2] = [0] - // a3 = 0 - b2Vec2 e12 = w2 - w1; - float32 w1e12 = b2Dot(w1, e12); - float32 w2e12 = b2Dot(w2, e12); - float32 d12_1 = w2e12; - float32 d12_2 = -w1e12; - - // Edge13 - // [1 1 ][a1] = [1] - // [w1.e13 w3.e13][a3] = [0] - // a2 = 0 - b2Vec2 e13 = w3 - w1; - float32 w1e13 = b2Dot(w1, e13); - float32 w3e13 = b2Dot(w3, e13); - float32 d13_1 = w3e13; - float32 d13_2 = -w1e13; - - // Edge23 - // [1 1 ][a2] = [1] - // [w2.e23 w3.e23][a3] = [0] - // a1 = 0 - b2Vec2 e23 = w3 - w2; - float32 w2e23 = b2Dot(w2, e23); - float32 w3e23 = b2Dot(w3, e23); - float32 d23_1 = w3e23; - float32 d23_2 = -w2e23; - - // Triangle123 - float32 n123 = b2Cross(e12, e13); - - float32 d123_1 = n123 * b2Cross(w2, w3); - float32 d123_2 = n123 * b2Cross(w3, w1); - float32 d123_3 = n123 * b2Cross(w1, w2); - - // w1 region - if (d12_2 <= 0.0f && d13_2 <= 0.0f) - { - m_v1.a = 1.0f; - m_count = 1; - return; - } - - // e12 - if (d12_1 > 0.0f && d12_2 > 0.0f && d123_3 <= 0.0f) - { - float32 inv_d12 = 1.0f / (d12_1 + d12_2); - m_v1.a = d12_1 * inv_d12; - m_v2.a = d12_2 * inv_d12; - m_count = 2; - return; - } - - // e13 - if (d13_1 > 0.0f && d13_2 > 0.0f && d123_2 <= 0.0f) - { - float32 inv_d13 = 1.0f / (d13_1 + d13_2); - m_v1.a = d13_1 * inv_d13; - m_v3.a = d13_2 * inv_d13; - m_count = 2; - m_v2 = m_v3; - return; - } - - // w2 region - if (d12_1 <= 0.0f && d23_2 <= 0.0f) - { - m_v2.a = 1.0f; - m_count = 1; - m_v1 = m_v2; - return; - } - - // w3 region - if (d13_1 <= 0.0f && d23_1 <= 0.0f) - { - m_v3.a = 1.0f; - m_count = 1; - m_v1 = m_v3; - return; - } - - // e23 - if (d23_1 > 0.0f && d23_2 > 0.0f && d123_1 <= 0.0f) - { - float32 inv_d23 = 1.0f / (d23_1 + d23_2); - m_v2.a = d23_1 * inv_d23; - m_v3.a = d23_2 * inv_d23; - m_count = 2; - m_v1 = m_v3; - return; - } - - // Must be in triangle123 - float32 inv_d123 = 1.0f / (d123_1 + d123_2 + d123_3); - m_v1.a = d123_1 * inv_d123; - m_v2.a = d123_2 * inv_d123; - m_v3.a = d123_3 * inv_d123; - m_count = 3; -} - -void b2Distance(b2DistanceOutput* output, - b2SimplexCache* cache, - const b2DistanceInput* input) -{ - ++b2_gjkCalls; - - const b2DistanceProxy* proxyA = &input->proxyA; - const b2DistanceProxy* proxyB = &input->proxyB; - - b2Transform transformA = input->transformA; - b2Transform transformB = input->transformB; - - // Initialize the simplex. - b2Simplex simplex; - simplex.ReadCache(cache, proxyA, transformA, proxyB, transformB); - - // Get simplex vertices as an array. - b2SimplexVertex* vertices = &simplex.m_v1; - const int32 k_maxIters = 20; - - // These store the vertices of the last simplex so that we - // can check for duplicates and prevent cycling. - int32 saveA[3], saveB[3]; - int32 saveCount = 0; - - b2Vec2 closestPoint = simplex.GetClosestPoint(); - float32 distanceSqr1 = closestPoint.LengthSquared(); - float32 distanceSqr2 = distanceSqr1; - - // Main iteration loop. - int32 iter = 0; - while (iter < k_maxIters) - { - // Copy simplex so we can identify duplicates. - saveCount = simplex.m_count; - for (int32 i = 0; i < saveCount; ++i) - { - saveA[i] = vertices[i].indexA; - saveB[i] = vertices[i].indexB; - } - - switch (simplex.m_count) - { - case 1: - break; - - case 2: - simplex.Solve2(); - break; - - case 3: - simplex.Solve3(); - break; - - default: - b2Assert(false); - } - - // If we have 3 points, then the origin is in the corresponding triangle. - if (simplex.m_count == 3) - { - break; - } - - // Compute closest point. - b2Vec2 p = simplex.GetClosestPoint(); - distanceSqr2 = p.LengthSquared(); - - // Ensure progress - if (distanceSqr2 >= distanceSqr1) - { - //break; - } - distanceSqr1 = distanceSqr2; - - // Get search direction. - b2Vec2 d = simplex.GetSearchDirection(); - - // Ensure the search direction is numerically fit. - if (d.LengthSquared() < b2_epsilon * b2_epsilon) - { - // The origin is probably contained by a line segment - // or triangle. Thus the shapes are overlapped. - - // We can't return zero here even though there may be overlap. - // In case the simplex is a point, segment, or triangle it is difficult - // to determine if the origin is contained in the CSO or very close to it. - break; - } - - // Compute a tentative new simplex vertex using support points. - b2SimplexVertex* vertex = vertices + simplex.m_count; - vertex->indexA = proxyA->GetSupport(b2MulT(transformA.q, -d)); - vertex->wA = b2Mul(transformA, proxyA->GetVertex(vertex->indexA)); - b2Vec2 wBLocal; - vertex->indexB = proxyB->GetSupport(b2MulT(transformB.q, d)); - vertex->wB = b2Mul(transformB, proxyB->GetVertex(vertex->indexB)); - vertex->w = vertex->wB - vertex->wA; - - // Iteration count is equated to the number of support point calls. - ++iter; - ++b2_gjkIters; - - // Check for duplicate support points. This is the main termination criteria. - bool duplicate = false; - for (int32 i = 0; i < saveCount; ++i) - { - if (vertex->indexA == saveA[i] && vertex->indexB == saveB[i]) - { - duplicate = true; - break; - } - } - - // If we found a duplicate support point we must exit to avoid cycling. - if (duplicate) - { - break; - } - - // New vertex is ok and needed. - ++simplex.m_count; - } - - b2_gjkMaxIters = b2Max(b2_gjkMaxIters, iter); - - // Prepare output. - simplex.GetWitnessPoints(&output->pointA, &output->pointB); - output->distance = b2Distance(output->pointA, output->pointB); - output->iterations = iter; - - // Cache the simplex. - simplex.WriteCache(cache); - - // Apply radii if requested. - if (input->useRadii) - { - float32 rA = proxyA->m_radius; - float32 rB = proxyB->m_radius; - - if (output->distance > rA + rB && output->distance > b2_epsilon) - { - // Shapes are still no overlapped. - // Move the witness points to the outer surface. - output->distance -= rA + rB; - b2Vec2 normal = output->pointB - output->pointA; - normal.Normalize(); - output->pointA += rA * normal; - output->pointB -= rB * normal; - } - else - { - // Shapes are overlapped when radii are considered. - // Move the witness points to the middle. - b2Vec2 p = 0.5f * (output->pointA + output->pointB); - output->pointA = p; - output->pointB = p; - output->distance = 0.0f; - } - } -} +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates. +int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; + +void b2DistanceProxy::Set(const b2Shape* shape, int32 index) +{ + switch (shape->GetType()) + { + case b2Shape::e_circle: + { + const b2CircleShape* circle = (b2CircleShape*)shape; + m_vertices = &circle->m_p; + m_count = 1; + m_radius = circle->m_radius; + } + break; + + case b2Shape::e_polygon: + { + const b2PolygonShape* polygon = (b2PolygonShape*)shape; + m_vertices = polygon->m_vertices; + m_count = polygon->m_vertexCount; + m_radius = polygon->m_radius; + } + break; + + case b2Shape::e_chain: + { + const b2ChainShape* chain = (b2ChainShape*)shape; + b2Assert(0 <= index && index < chain->m_count); + + m_buffer[0] = chain->m_vertices[index]; + if (index + 1 < chain->m_count) + { + m_buffer[1] = chain->m_vertices[index + 1]; + } + else + { + m_buffer[1] = chain->m_vertices[0]; + } + + m_vertices = m_buffer; + m_count = 2; + m_radius = chain->m_radius; + } + break; + + case b2Shape::e_edge: + { + const b2EdgeShape* edge = (b2EdgeShape*)shape; + m_vertices = &edge->m_vertex1; + m_count = 2; + m_radius = edge->m_radius; + } + break; + + default: + b2Assert(false); + } +} + + +struct b2SimplexVertex +{ + b2Vec2 wA; // support point in proxyA + b2Vec2 wB; // support point in proxyB + b2Vec2 w; // wB - wA + float32 a; // barycentric coordinate for closest point + int32 indexA; // wA index + int32 indexB; // wB index +}; + +struct b2Simplex +{ + void ReadCache( const b2SimplexCache* cache, + const b2DistanceProxy* proxyA, const b2Transform& transformA, + const b2DistanceProxy* proxyB, const b2Transform& transformB) + { + b2Assert(cache->count <= 3); + + // Copy data from cache. + m_count = cache->count; + b2SimplexVertex* vertices = &m_v1; + for (int32 i = 0; i < m_count; ++i) + { + b2SimplexVertex* v = vertices + i; + v->indexA = cache->indexA[i]; + v->indexB = cache->indexB[i]; + b2Vec2 wALocal = proxyA->GetVertex(v->indexA); + b2Vec2 wBLocal = proxyB->GetVertex(v->indexB); + v->wA = b2Mul(transformA, wALocal); + v->wB = b2Mul(transformB, wBLocal); + v->w = v->wB - v->wA; + v->a = 0.0f; + } + + // Compute the new simplex metric, if it is substantially different than + // old metric then flush the simplex. + if (m_count > 1) + { + float32 metric1 = cache->metric; + float32 metric2 = GetMetric(); + if (metric2 < 0.5f * metric1 || 2.0f * metric1 < metric2 || metric2 < b2_epsilon) + { + // Reset the simplex. + m_count = 0; + } + } + + // If the cache is empty or invalid ... + if (m_count == 0) + { + b2SimplexVertex* v = vertices + 0; + v->indexA = 0; + v->indexB = 0; + b2Vec2 wALocal = proxyA->GetVertex(0); + b2Vec2 wBLocal = proxyB->GetVertex(0); + v->wA = b2Mul(transformA, wALocal); + v->wB = b2Mul(transformB, wBLocal); + v->w = v->wB - v->wA; + m_count = 1; + } + } + + void WriteCache(b2SimplexCache* cache) const + { + cache->metric = GetMetric(); + cache->count = uint16(m_count); + const b2SimplexVertex* vertices = &m_v1; + for (int32 i = 0; i < m_count; ++i) + { + cache->indexA[i] = uint8(vertices[i].indexA); + cache->indexB[i] = uint8(vertices[i].indexB); + } + } + + b2Vec2 GetSearchDirection() const + { + switch (m_count) + { + case 1: + return -m_v1.w; + + case 2: + { + b2Vec2 e12 = m_v2.w - m_v1.w; + float32 sgn = b2Cross(e12, -m_v1.w); + if (sgn > 0.0f) + { + // Origin is left of e12. + return b2Cross(1.0f, e12); + } + else + { + // Origin is right of e12. + return b2Cross(e12, 1.0f); + } + } + + default: + b2Assert(false); + return b2Vec2_zero; + } + } + + b2Vec2 GetClosestPoint() const + { + switch (m_count) + { + case 0: + b2Assert(false); + return b2Vec2_zero; + + case 1: + return m_v1.w; + + case 2: + return m_v1.a * m_v1.w + m_v2.a * m_v2.w; + + case 3: + return b2Vec2_zero; + + default: + b2Assert(false); + return b2Vec2_zero; + } + } + + void GetWitnessPoints(b2Vec2* pA, b2Vec2* pB) const + { + switch (m_count) + { + case 0: + b2Assert(false); + break; + + case 1: + *pA = m_v1.wA; + *pB = m_v1.wB; + break; + + case 2: + *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA; + *pB = m_v1.a * m_v1.wB + m_v2.a * m_v2.wB; + break; + + case 3: + *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA + m_v3.a * m_v3.wA; + *pB = *pA; + break; + + default: + b2Assert(false); + break; + } + } + + float32 GetMetric() const + { + switch (m_count) + { + case 0: + b2Assert(false); + return 0.0; + + case 1: + return 0.0f; + + case 2: + return b2Distance(m_v1.w, m_v2.w); + + case 3: + return b2Cross(m_v2.w - m_v1.w, m_v3.w - m_v1.w); + + default: + b2Assert(false); + return 0.0f; + } + } + + void Solve2(); + void Solve3(); + + b2SimplexVertex m_v1, m_v2, m_v3; + int32 m_count; +}; + + +// Solve a line segment using barycentric coordinates. +// +// p = a1 * w1 + a2 * w2 +// a1 + a2 = 1 +// +// The vector from the origin to the closest point on the line is +// perpendicular to the line. +// e12 = w2 - w1 +// dot(p, e) = 0 +// a1 * dot(w1, e) + a2 * dot(w2, e) = 0 +// +// 2-by-2 linear system +// [1 1 ][a1] = [1] +// [w1.e12 w2.e12][a2] = [0] +// +// Define +// d12_1 = dot(w2, e12) +// d12_2 = -dot(w1, e12) +// d12 = d12_1 + d12_2 +// +// Solution +// a1 = d12_1 / d12 +// a2 = d12_2 / d12 +void b2Simplex::Solve2() +{ + b2Vec2 w1 = m_v1.w; + b2Vec2 w2 = m_v2.w; + b2Vec2 e12 = w2 - w1; + + // w1 region + float32 d12_2 = -b2Dot(w1, e12); + if (d12_2 <= 0.0f) + { + // a2 <= 0, so we clamp it to 0 + m_v1.a = 1.0f; + m_count = 1; + return; + } + + // w2 region + float32 d12_1 = b2Dot(w2, e12); + if (d12_1 <= 0.0f) + { + // a1 <= 0, so we clamp it to 0 + m_v2.a = 1.0f; + m_count = 1; + m_v1 = m_v2; + return; + } + + // Must be in e12 region. + float32 inv_d12 = 1.0f / (d12_1 + d12_2); + m_v1.a = d12_1 * inv_d12; + m_v2.a = d12_2 * inv_d12; + m_count = 2; +} + +// Possible regions: +// - points[2] +// - edge points[0]-points[2] +// - edge points[1]-points[2] +// - inside the triangle +void b2Simplex::Solve3() +{ + b2Vec2 w1 = m_v1.w; + b2Vec2 w2 = m_v2.w; + b2Vec2 w3 = m_v3.w; + + // Edge12 + // [1 1 ][a1] = [1] + // [w1.e12 w2.e12][a2] = [0] + // a3 = 0 + b2Vec2 e12 = w2 - w1; + float32 w1e12 = b2Dot(w1, e12); + float32 w2e12 = b2Dot(w2, e12); + float32 d12_1 = w2e12; + float32 d12_2 = -w1e12; + + // Edge13 + // [1 1 ][a1] = [1] + // [w1.e13 w3.e13][a3] = [0] + // a2 = 0 + b2Vec2 e13 = w3 - w1; + float32 w1e13 = b2Dot(w1, e13); + float32 w3e13 = b2Dot(w3, e13); + float32 d13_1 = w3e13; + float32 d13_2 = -w1e13; + + // Edge23 + // [1 1 ][a2] = [1] + // [w2.e23 w3.e23][a3] = [0] + // a1 = 0 + b2Vec2 e23 = w3 - w2; + float32 w2e23 = b2Dot(w2, e23); + float32 w3e23 = b2Dot(w3, e23); + float32 d23_1 = w3e23; + float32 d23_2 = -w2e23; + + // Triangle123 + float32 n123 = b2Cross(e12, e13); + + float32 d123_1 = n123 * b2Cross(w2, w3); + float32 d123_2 = n123 * b2Cross(w3, w1); + float32 d123_3 = n123 * b2Cross(w1, w2); + + // w1 region + if (d12_2 <= 0.0f && d13_2 <= 0.0f) + { + m_v1.a = 1.0f; + m_count = 1; + return; + } + + // e12 + if (d12_1 > 0.0f && d12_2 > 0.0f && d123_3 <= 0.0f) + { + float32 inv_d12 = 1.0f / (d12_1 + d12_2); + m_v1.a = d12_1 * inv_d12; + m_v2.a = d12_2 * inv_d12; + m_count = 2; + return; + } + + // e13 + if (d13_1 > 0.0f && d13_2 > 0.0f && d123_2 <= 0.0f) + { + float32 inv_d13 = 1.0f / (d13_1 + d13_2); + m_v1.a = d13_1 * inv_d13; + m_v3.a = d13_2 * inv_d13; + m_count = 2; + m_v2 = m_v3; + return; + } + + // w2 region + if (d12_1 <= 0.0f && d23_2 <= 0.0f) + { + m_v2.a = 1.0f; + m_count = 1; + m_v1 = m_v2; + return; + } + + // w3 region + if (d13_1 <= 0.0f && d23_1 <= 0.0f) + { + m_v3.a = 1.0f; + m_count = 1; + m_v1 = m_v3; + return; + } + + // e23 + if (d23_1 > 0.0f && d23_2 > 0.0f && d123_1 <= 0.0f) + { + float32 inv_d23 = 1.0f / (d23_1 + d23_2); + m_v2.a = d23_1 * inv_d23; + m_v3.a = d23_2 * inv_d23; + m_count = 2; + m_v1 = m_v3; + return; + } + + // Must be in triangle123 + float32 inv_d123 = 1.0f / (d123_1 + d123_2 + d123_3); + m_v1.a = d123_1 * inv_d123; + m_v2.a = d123_2 * inv_d123; + m_v3.a = d123_3 * inv_d123; + m_count = 3; +} + +void b2Distance(b2DistanceOutput* output, + b2SimplexCache* cache, + const b2DistanceInput* input) +{ + ++b2_gjkCalls; + + const b2DistanceProxy* proxyA = &input->proxyA; + const b2DistanceProxy* proxyB = &input->proxyB; + + b2Transform transformA = input->transformA; + b2Transform transformB = input->transformB; + + // Initialize the simplex. + b2Simplex simplex; + simplex.ReadCache(cache, proxyA, transformA, proxyB, transformB); + + // Get simplex vertices as an array. + b2SimplexVertex* vertices = &simplex.m_v1; + const int32 k_maxIters = 20; + + // These store the vertices of the last simplex so that we + // can check for duplicates and prevent cycling. + int32 saveA[3], saveB[3]; + int32 saveCount = 0; + + b2Vec2 closestPoint = simplex.GetClosestPoint(); + float32 distanceSqr1 = closestPoint.LengthSquared(); + float32 distanceSqr2 = distanceSqr1; + + // Main iteration loop. + int32 iter = 0; + while (iter < k_maxIters) + { + // Copy simplex so we can identify duplicates. + saveCount = simplex.m_count; + for (int32 i = 0; i < saveCount; ++i) + { + saveA[i] = vertices[i].indexA; + saveB[i] = vertices[i].indexB; + } + + switch (simplex.m_count) + { + case 1: + break; + + case 2: + simplex.Solve2(); + break; + + case 3: + simplex.Solve3(); + break; + + default: + b2Assert(false); + } + + // If we have 3 points, then the origin is in the corresponding triangle. + if (simplex.m_count == 3) + { + break; + } + + // Compute closest point. + b2Vec2 p = simplex.GetClosestPoint(); + distanceSqr2 = p.LengthSquared(); + + // Ensure progress + if (distanceSqr2 >= distanceSqr1) + { + //break; + } + distanceSqr1 = distanceSqr2; + + // Get search direction. + b2Vec2 d = simplex.GetSearchDirection(); + + // Ensure the search direction is numerically fit. + if (d.LengthSquared() < b2_epsilon * b2_epsilon) + { + // The origin is probably contained by a line segment + // or triangle. Thus the shapes are overlapped. + + // We can't return zero here even though there may be overlap. + // In case the simplex is a point, segment, or triangle it is difficult + // to determine if the origin is contained in the CSO or very close to it. + break; + } + + // Compute a tentative new simplex vertex using support points. + b2SimplexVertex* vertex = vertices + simplex.m_count; + vertex->indexA = proxyA->GetSupport(b2MulT(transformA.q, -d)); + vertex->wA = b2Mul(transformA, proxyA->GetVertex(vertex->indexA)); + b2Vec2 wBLocal; + vertex->indexB = proxyB->GetSupport(b2MulT(transformB.q, d)); + vertex->wB = b2Mul(transformB, proxyB->GetVertex(vertex->indexB)); + vertex->w = vertex->wB - vertex->wA; + + // Iteration count is equated to the number of support point calls. + ++iter; + ++b2_gjkIters; + + // Check for duplicate support points. This is the main termination criteria. + bool duplicate = false; + for (int32 i = 0; i < saveCount; ++i) + { + if (vertex->indexA == saveA[i] && vertex->indexB == saveB[i]) + { + duplicate = true; + break; + } + } + + // If we found a duplicate support point we must exit to avoid cycling. + if (duplicate) + { + break; + } + + // New vertex is ok and needed. + ++simplex.m_count; + } + + b2_gjkMaxIters = b2Max(b2_gjkMaxIters, iter); + + // Prepare output. + simplex.GetWitnessPoints(&output->pointA, &output->pointB); + output->distance = b2Distance(output->pointA, output->pointB); + output->iterations = iter; + + // Cache the simplex. + simplex.WriteCache(cache); + + // Apply radii if requested. + if (input->useRadii) + { + float32 rA = proxyA->m_radius; + float32 rB = proxyB->m_radius; + + if (output->distance > rA + rB && output->distance > b2_epsilon) + { + // Shapes are still no overlapped. + // Move the witness points to the outer surface. + output->distance -= rA + rB; + b2Vec2 normal = output->pointB - output->pointA; + normal.Normalize(); + output->pointA += rA * normal; + output->pointB -= rB * normal; + } + else + { + // Shapes are overlapped when radii are considered. + // Move the witness points to the middle. + b2Vec2 p = 0.5f * (output->pointA + output->pointB); + output->pointA = p; + output->pointB = p; + output->distance = 0.0f; + } + } +} diff --git a/src/libraries/Box2D/Collision/b2Distance.h b/src/libraries/Box2D/Collision/b2Distance.h index 54ed1e136..7bae689d1 100755 --- a/src/libraries/Box2D/Collision/b2Distance.h +++ b/src/libraries/Box2D/Collision/b2Distance.h @@ -1,141 +1,141 @@ - -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DISTANCE_H -#define B2_DISTANCE_H - -#include - -class b2Shape; - -/// A distance proxy is used by the GJK algorithm. -/// It encapsulates any shape. -struct b2DistanceProxy -{ - b2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {} - - /// Initialize the proxy using the given shape. The shape - /// must remain in scope while the proxy is in use. - void Set(const b2Shape* shape, int32 index); - - /// Get the supporting vertex index in the given direction. - int32 GetSupport(const b2Vec2& d) const; - - /// Get the supporting vertex in the given direction. - const b2Vec2& GetSupportVertex(const b2Vec2& d) const; - - /// Get the vertex count. - int32 GetVertexCount() const; - - /// Get a vertex by index. Used by b2Distance. - const b2Vec2& GetVertex(int32 index) const; - - b2Vec2 m_buffer[2]; - const b2Vec2* m_vertices; - int32 m_count; - float32 m_radius; -}; - -/// Used to warm start b2Distance. -/// Set count to zero on first call. -struct b2SimplexCache -{ - float32 metric; ///< length or area - uint16 count; - uint8 indexA[3]; ///< vertices on shape A - uint8 indexB[3]; ///< vertices on shape B -}; - -/// Input for b2Distance. -/// You have to option to use the shape radii -/// in the computation. Even -struct b2DistanceInput -{ - b2DistanceProxy proxyA; - b2DistanceProxy proxyB; - b2Transform transformA; - b2Transform transformB; - bool useRadii; -}; - -/// Output for b2Distance. -struct b2DistanceOutput -{ - b2Vec2 pointA; ///< closest point on shapeA - b2Vec2 pointB; ///< closest point on shapeB - float32 distance; - int32 iterations; ///< number of GJK iterations used -}; - -/// Compute the closest points between two shapes. Supports any combination of: -/// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. -/// On the first call set b2SimplexCache.count to zero. -void b2Distance(b2DistanceOutput* output, - b2SimplexCache* cache, - const b2DistanceInput* input); - - -////////////////////////////////////////////////////////////////////////// - -inline int32 b2DistanceProxy::GetVertexCount() const -{ - return m_count; -} - -inline const b2Vec2& b2DistanceProxy::GetVertex(int32 index) const -{ - b2Assert(0 <= index && index < m_count); - return m_vertices[index]; -} - -inline int32 b2DistanceProxy::GetSupport(const b2Vec2& d) const -{ - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_vertices[0], d); - for (int32 i = 1; i < m_count; ++i) - { - float32 value = b2Dot(m_vertices[i], d); - if (value > bestValue) - { - bestIndex = i; - bestValue = value; - } - } - - return bestIndex; -} - -inline const b2Vec2& b2DistanceProxy::GetSupportVertex(const b2Vec2& d) const -{ - int32 bestIndex = 0; - float32 bestValue = b2Dot(m_vertices[0], d); - for (int32 i = 1; i < m_count; ++i) - { - float32 value = b2Dot(m_vertices[i], d); - if (value > bestValue) - { - bestIndex = i; - bestValue = value; - } - } - - return m_vertices[bestIndex]; -} - -#endif + +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DISTANCE_H +#define B2_DISTANCE_H + +#include + +class b2Shape; + +/// A distance proxy is used by the GJK algorithm. +/// It encapsulates any shape. +struct b2DistanceProxy +{ + b2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {} + + /// Initialize the proxy using the given shape. The shape + /// must remain in scope while the proxy is in use. + void Set(const b2Shape* shape, int32 index); + + /// Get the supporting vertex index in the given direction. + int32 GetSupport(const b2Vec2& d) const; + + /// Get the supporting vertex in the given direction. + const b2Vec2& GetSupportVertex(const b2Vec2& d) const; + + /// Get the vertex count. + int32 GetVertexCount() const; + + /// Get a vertex by index. Used by b2Distance. + const b2Vec2& GetVertex(int32 index) const; + + b2Vec2 m_buffer[2]; + const b2Vec2* m_vertices; + int32 m_count; + float32 m_radius; +}; + +/// Used to warm start b2Distance. +/// Set count to zero on first call. +struct b2SimplexCache +{ + float32 metric; ///< length or area + uint16 count; + uint8 indexA[3]; ///< vertices on shape A + uint8 indexB[3]; ///< vertices on shape B +}; + +/// Input for b2Distance. +/// You have to option to use the shape radii +/// in the computation. Even +struct b2DistanceInput +{ + b2DistanceProxy proxyA; + b2DistanceProxy proxyB; + b2Transform transformA; + b2Transform transformB; + bool useRadii; +}; + +/// Output for b2Distance. +struct b2DistanceOutput +{ + b2Vec2 pointA; ///< closest point on shapeA + b2Vec2 pointB; ///< closest point on shapeB + float32 distance; + int32 iterations; ///< number of GJK iterations used +}; + +/// Compute the closest points between two shapes. Supports any combination of: +/// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. +/// On the first call set b2SimplexCache.count to zero. +void b2Distance(b2DistanceOutput* output, + b2SimplexCache* cache, + const b2DistanceInput* input); + + +////////////////////////////////////////////////////////////////////////// + +inline int32 b2DistanceProxy::GetVertexCount() const +{ + return m_count; +} + +inline const b2Vec2& b2DistanceProxy::GetVertex(int32 index) const +{ + b2Assert(0 <= index && index < m_count); + return m_vertices[index]; +} + +inline int32 b2DistanceProxy::GetSupport(const b2Vec2& d) const +{ + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_vertices[0], d); + for (int32 i = 1; i < m_count; ++i) + { + float32 value = b2Dot(m_vertices[i], d); + if (value > bestValue) + { + bestIndex = i; + bestValue = value; + } + } + + return bestIndex; +} + +inline const b2Vec2& b2DistanceProxy::GetSupportVertex(const b2Vec2& d) const +{ + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_vertices[0], d); + for (int32 i = 1; i < m_count; ++i) + { + float32 value = b2Dot(m_vertices[i], d); + if (value > bestValue) + { + bestIndex = i; + bestValue = value; + } + } + + return m_vertices[bestIndex]; +} + +#endif diff --git a/src/libraries/Box2D/Collision/b2DynamicTree.cpp b/src/libraries/Box2D/Collision/b2DynamicTree.cpp index 1a42c3a5f..2f81958e3 100755 --- a/src/libraries/Box2D/Collision/b2DynamicTree.cpp +++ b/src/libraries/Box2D/Collision/b2DynamicTree.cpp @@ -1,771 +1,771 @@ -/* -* Copyright (c) 2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -using namespace std; - - -b2DynamicTree::b2DynamicTree() -{ - m_root = b2_nullNode; - - m_nodeCapacity = 16; - m_nodeCount = 0; - m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); - memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); - - // Build a linked list for the free list. - for (int32 i = 0; i < m_nodeCapacity - 1; ++i) - { - m_nodes[i].next = i + 1; - m_nodes[i].height = -1; - } - m_nodes[m_nodeCapacity-1].next = b2_nullNode; - m_nodes[m_nodeCapacity-1].height = -1; - m_freeList = 0; - - m_path = 0; - - m_insertionCount = 0; -} - -b2DynamicTree::~b2DynamicTree() -{ - // This frees the entire tree in one shot. - b2Free(m_nodes); -} - -// Allocate a node from the pool. Grow the pool if necessary. -int32 b2DynamicTree::AllocateNode() -{ - // Expand the node pool as needed. - if (m_freeList == b2_nullNode) - { - b2Assert(m_nodeCount == m_nodeCapacity); - - // The free list is empty. Rebuild a bigger pool. - b2TreeNode* oldNodes = m_nodes; - m_nodeCapacity *= 2; - m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); - memcpy(m_nodes, oldNodes, m_nodeCount * sizeof(b2TreeNode)); - b2Free(oldNodes); - - // Build a linked list for the free list. The parent - // pointer becomes the "next" pointer. - for (int32 i = m_nodeCount; i < m_nodeCapacity - 1; ++i) - { - m_nodes[i].next = i + 1; - m_nodes[i].height = -1; - } - m_nodes[m_nodeCapacity-1].next = b2_nullNode; - m_nodes[m_nodeCapacity-1].height = -1; - m_freeList = m_nodeCount; - } - - // Peel a node off the free list. - int32 nodeId = m_freeList; - m_freeList = m_nodes[nodeId].next; - m_nodes[nodeId].parent = b2_nullNode; - m_nodes[nodeId].child1 = b2_nullNode; - m_nodes[nodeId].child2 = b2_nullNode; - m_nodes[nodeId].height = 0; - m_nodes[nodeId].userData = NULL; - ++m_nodeCount; - return nodeId; -} - -// Return a node to the pool. -void b2DynamicTree::FreeNode(int32 nodeId) -{ - b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); - b2Assert(0 < m_nodeCount); - m_nodes[nodeId].next = m_freeList; - m_nodes[nodeId].height = -1; - m_freeList = nodeId; - --m_nodeCount; -} - -// Create a proxy in the tree as a leaf node. We return the index -// of the node instead of a pointer so that we can grow -// the node pool. -int32 b2DynamicTree::CreateProxy(const b2AABB& aabb, void* userData) -{ - int32 proxyId = AllocateNode(); - - // Fatten the aabb. - b2Vec2 r(b2_aabbExtension, b2_aabbExtension); - m_nodes[proxyId].aabb.lowerBound = aabb.lowerBound - r; - m_nodes[proxyId].aabb.upperBound = aabb.upperBound + r; - m_nodes[proxyId].userData = userData; - m_nodes[proxyId].height = 0; - - InsertLeaf(proxyId); - - return proxyId; -} - -void b2DynamicTree::DestroyProxy(int32 proxyId) -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - b2Assert(m_nodes[proxyId].IsLeaf()); - - RemoveLeaf(proxyId); - FreeNode(proxyId); -} - -bool b2DynamicTree::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - - b2Assert(m_nodes[proxyId].IsLeaf()); - - if (m_nodes[proxyId].aabb.Contains(aabb)) - { - return false; - } - - RemoveLeaf(proxyId); - - // Extend AABB. - b2AABB b = aabb; - b2Vec2 r(b2_aabbExtension, b2_aabbExtension); - b.lowerBound = b.lowerBound - r; - b.upperBound = b.upperBound + r; - - // Predict AABB displacement. - b2Vec2 d = b2_aabbMultiplier * displacement; - - if (d.x < 0.0f) - { - b.lowerBound.x += d.x; - } - else - { - b.upperBound.x += d.x; - } - - if (d.y < 0.0f) - { - b.lowerBound.y += d.y; - } - else - { - b.upperBound.y += d.y; - } - - m_nodes[proxyId].aabb = b; - - InsertLeaf(proxyId); - return true; -} - -void b2DynamicTree::InsertLeaf(int32 leaf) -{ - ++m_insertionCount; - - if (m_root == b2_nullNode) - { - m_root = leaf; - m_nodes[m_root].parent = b2_nullNode; - return; - } - - // Find the best sibling for this node - b2AABB leafAABB = m_nodes[leaf].aabb; - int32 index = m_root; - while (m_nodes[index].IsLeaf() == false) - { - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - float32 area = m_nodes[index].aabb.GetPerimeter(); - - b2AABB combinedAABB; - combinedAABB.Combine(m_nodes[index].aabb, leafAABB); - float32 combinedArea = combinedAABB.GetPerimeter(); - - // Cost of creating a new parent for this node and the new leaf - float32 cost = 2.0f * combinedArea; - - // Minimum cost of pushing the leaf further down the tree - float32 inheritanceCost = 2.0f * (combinedArea - area); - - // Cost of descending into child1 - float32 cost1; - if (m_nodes[child1].IsLeaf()) - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child1].aabb); - cost1 = aabb.GetPerimeter() + inheritanceCost; - } - else - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child1].aabb); - float32 oldArea = m_nodes[child1].aabb.GetPerimeter(); - float32 newArea = aabb.GetPerimeter(); - cost1 = (newArea - oldArea) + inheritanceCost; - } - - // Cost of descending into child2 - float32 cost2; - if (m_nodes[child2].IsLeaf()) - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child2].aabb); - cost2 = aabb.GetPerimeter() + inheritanceCost; - } - else - { - b2AABB aabb; - aabb.Combine(leafAABB, m_nodes[child2].aabb); - float32 oldArea = m_nodes[child2].aabb.GetPerimeter(); - float32 newArea = aabb.GetPerimeter(); - cost2 = newArea - oldArea + inheritanceCost; - } - - // Descend according to the minimum cost. - if (cost < cost1 && cost < cost2) - { - break; - } - - // Descend - if (cost1 < cost2) - { - index = child1; - } - else - { - index = child2; - } - } - - int32 sibling = index; - - // Create a new parent. - int32 oldParent = m_nodes[sibling].parent; - int32 newParent = AllocateNode(); - m_nodes[newParent].parent = oldParent; - m_nodes[newParent].userData = NULL; - m_nodes[newParent].aabb.Combine(leafAABB, m_nodes[sibling].aabb); - m_nodes[newParent].height = m_nodes[sibling].height + 1; - - if (oldParent != b2_nullNode) - { - // The sibling was not the root. - if (m_nodes[oldParent].child1 == sibling) - { - m_nodes[oldParent].child1 = newParent; - } - else - { - m_nodes[oldParent].child2 = newParent; - } - - m_nodes[newParent].child1 = sibling; - m_nodes[newParent].child2 = leaf; - m_nodes[sibling].parent = newParent; - m_nodes[leaf].parent = newParent; - } - else - { - // The sibling was the root. - m_nodes[newParent].child1 = sibling; - m_nodes[newParent].child2 = leaf; - m_nodes[sibling].parent = newParent; - m_nodes[leaf].parent = newParent; - m_root = newParent; - } - - // Walk back up the tree fixing heights and AABBs - index = m_nodes[leaf].parent; - while (index != b2_nullNode) - { - index = Balance(index); - - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - b2Assert(child1 != b2_nullNode); - b2Assert(child2 != b2_nullNode); - - m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); - m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - - index = m_nodes[index].parent; - } - - //Validate(); -} - -void b2DynamicTree::RemoveLeaf(int32 leaf) -{ - if (leaf == m_root) - { - m_root = b2_nullNode; - return; - } - - int32 parent = m_nodes[leaf].parent; - int32 grandParent = m_nodes[parent].parent; - int32 sibling; - if (m_nodes[parent].child1 == leaf) - { - sibling = m_nodes[parent].child2; - } - else - { - sibling = m_nodes[parent].child1; - } - - if (grandParent != b2_nullNode) - { - // Destroy parent and connect sibling to grandParent. - if (m_nodes[grandParent].child1 == parent) - { - m_nodes[grandParent].child1 = sibling; - } - else - { - m_nodes[grandParent].child2 = sibling; - } - m_nodes[sibling].parent = grandParent; - FreeNode(parent); - - // Adjust ancestor bounds. - int32 index = grandParent; - while (index != b2_nullNode) - { - index = Balance(index); - - int32 child1 = m_nodes[index].child1; - int32 child2 = m_nodes[index].child2; - - m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); - - index = m_nodes[index].parent; - } - } - else - { - m_root = sibling; - m_nodes[sibling].parent = b2_nullNode; - FreeNode(parent); - } - - //Validate(); -} - -// Perform a left or right rotation if node A is imbalanced. -// Returns the new root index. -int32 b2DynamicTree::Balance(int32 iA) -{ - b2Assert(iA != b2_nullNode); - - b2TreeNode* A = m_nodes + iA; - if (A->IsLeaf() || A->height < 2) - { - return iA; - } - - int32 iB = A->child1; - int32 iC = A->child2; - b2Assert(0 <= iB && iB < m_nodeCapacity); - b2Assert(0 <= iC && iC < m_nodeCapacity); - - b2TreeNode* B = m_nodes + iB; - b2TreeNode* C = m_nodes + iC; - - int32 balance = C->height - B->height; - - // Rotate C up - if (balance > 1) - { - int32 iF = C->child1; - int32 iG = C->child2; - b2TreeNode* F = m_nodes + iF; - b2TreeNode* G = m_nodes + iG; - b2Assert(0 <= iF && iF < m_nodeCapacity); - b2Assert(0 <= iG && iG < m_nodeCapacity); - - // Swap A and C - C->child1 = iA; - C->parent = A->parent; - A->parent = iC; - - // A's old parent should point to C - if (C->parent != b2_nullNode) - { - if (m_nodes[C->parent].child1 == iA) - { - m_nodes[C->parent].child1 = iC; - } - else - { - b2Assert(m_nodes[C->parent].child2 == iA); - m_nodes[C->parent].child2 = iC; - } - } - else - { - m_root = iC; - } - - // Rotate - if (F->height > G->height) - { - C->child2 = iF; - A->child2 = iG; - G->parent = iA; - A->aabb.Combine(B->aabb, G->aabb); - C->aabb.Combine(A->aabb, F->aabb); - - A->height = 1 + b2Max(B->height, G->height); - C->height = 1 + b2Max(A->height, F->height); - } - else - { - C->child2 = iG; - A->child2 = iF; - F->parent = iA; - A->aabb.Combine(B->aabb, F->aabb); - C->aabb.Combine(A->aabb, G->aabb); - - A->height = 1 + b2Max(B->height, F->height); - C->height = 1 + b2Max(A->height, G->height); - } - - return iC; - } - - // Rotate B up - if (balance < -1) - { - int32 iD = B->child1; - int32 iE = B->child2; - b2TreeNode* D = m_nodes + iD; - b2TreeNode* E = m_nodes + iE; - b2Assert(0 <= iD && iD < m_nodeCapacity); - b2Assert(0 <= iE && iE < m_nodeCapacity); - - // Swap A and B - B->child1 = iA; - B->parent = A->parent; - A->parent = iB; - - // A's old parent should point to B - if (B->parent != b2_nullNode) - { - if (m_nodes[B->parent].child1 == iA) - { - m_nodes[B->parent].child1 = iB; - } - else - { - b2Assert(m_nodes[B->parent].child2 == iA); - m_nodes[B->parent].child2 = iB; - } - } - else - { - m_root = iB; - } - - // Rotate - if (D->height > E->height) - { - B->child2 = iD; - A->child1 = iE; - E->parent = iA; - A->aabb.Combine(C->aabb, E->aabb); - B->aabb.Combine(A->aabb, D->aabb); - - A->height = 1 + b2Max(C->height, E->height); - B->height = 1 + b2Max(A->height, D->height); - } - else - { - B->child2 = iE; - A->child1 = iD; - D->parent = iA; - A->aabb.Combine(C->aabb, D->aabb); - B->aabb.Combine(A->aabb, E->aabb); - - A->height = 1 + b2Max(C->height, D->height); - B->height = 1 + b2Max(A->height, E->height); - } - - return iB; - } - - return iA; -} - -int32 b2DynamicTree::GetHeight() const -{ - if (m_root == b2_nullNode) - { - return 0; - } - - return m_nodes[m_root].height; -} - -// -float32 b2DynamicTree::GetAreaRatio() const -{ - if (m_root == b2_nullNode) - { - return 0.0f; - } - - const b2TreeNode* root = m_nodes + m_root; - float32 rootArea = root->aabb.GetPerimeter(); - - float32 totalArea = 0.0f; - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - const b2TreeNode* node = m_nodes + i; - if (node->height < 0) - { - // Free node in pool - continue; - } - - totalArea += node->aabb.GetPerimeter(); - } - - return totalArea / rootArea; -} - -// Compute the height of a sub-tree. -int32 b2DynamicTree::ComputeHeight(int32 nodeId) const -{ - b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); - b2TreeNode* node = m_nodes + nodeId; - - if (node->IsLeaf()) - { - return 0; - } - - int32 height1 = ComputeHeight(node->child1); - int32 height2 = ComputeHeight(node->child2); - return 1 + b2Max(height1, height2); -} - -int32 b2DynamicTree::ComputeHeight() const -{ - int32 height = ComputeHeight(m_root); - return height; -} - -void b2DynamicTree::ValidateStructure(int32 index) const -{ - if (index == b2_nullNode) - { - return; - } - - if (index == m_root) - { - b2Assert(m_nodes[index].parent == b2_nullNode); - } - - const b2TreeNode* node = m_nodes + index; - - int32 child1 = node->child1; - int32 child2 = node->child2; - - if (node->IsLeaf()) - { - b2Assert(child1 == b2_nullNode); - b2Assert(child2 == b2_nullNode); - b2Assert(node->height == 0); - return; - } - - b2Assert(0 <= child1 && child1 < m_nodeCapacity); - b2Assert(0 <= child2 && child2 < m_nodeCapacity); - - b2Assert(m_nodes[child1].parent == index); - b2Assert(m_nodes[child2].parent == index); - - ValidateStructure(child1); - ValidateStructure(child2); -} - -void b2DynamicTree::ValidateMetrics(int32 index) const -{ - if (index == b2_nullNode) - { - return; - } - - const b2TreeNode* node = m_nodes + index; - - int32 child1 = node->child1; - int32 child2 = node->child2; - - if (node->IsLeaf()) - { - b2Assert(child1 == b2_nullNode); - b2Assert(child2 == b2_nullNode); - b2Assert(node->height == 0); - return; - } - - b2Assert(0 <= child1 && child1 < m_nodeCapacity); - b2Assert(0 <= child2 && child2 < m_nodeCapacity); - - int32 height1 = m_nodes[child1].height; - int32 height2 = m_nodes[child2].height; - int32 height; - height = 1 + b2Max(height1, height2); - b2Assert(node->height == height); - - b2AABB aabb; - aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); - - b2Assert(aabb.lowerBound == node->aabb.lowerBound); - b2Assert(aabb.upperBound == node->aabb.upperBound); - - ValidateMetrics(child1); - ValidateMetrics(child2); -} - -void b2DynamicTree::Validate() const -{ - ValidateStructure(m_root); - ValidateMetrics(m_root); - - int32 freeCount = 0; - int32 freeIndex = m_freeList; - while (freeIndex != b2_nullNode) - { - b2Assert(0 <= freeIndex && freeIndex < m_nodeCapacity); - freeIndex = m_nodes[freeIndex].next; - ++freeCount; - } - - b2Assert(GetHeight() == ComputeHeight()); - - b2Assert(m_nodeCount + freeCount == m_nodeCapacity); -} - -int32 b2DynamicTree::GetMaxBalance() const -{ - int32 maxBalance = 0; - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - const b2TreeNode* node = m_nodes + i; - if (node->height <= 1) - { - continue; - } - - b2Assert(node->IsLeaf() == false); - - int32 child1 = node->child1; - int32 child2 = node->child2; - int32 balance = b2Abs(m_nodes[child2].height - m_nodes[child1].height); - maxBalance = b2Max(maxBalance, balance); - } - - return maxBalance; -} - -void b2DynamicTree::RebuildBottomUp() -{ - int32* nodes = (int32*)b2Alloc(m_nodeCount * sizeof(int32)); - int32 count = 0; - - // Build array of leaves. Free the rest. - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - if (m_nodes[i].height < 0) - { - // free node in pool - continue; - } - - if (m_nodes[i].IsLeaf()) - { - m_nodes[i].parent = b2_nullNode; - nodes[count] = i; - ++count; - } - else - { - FreeNode(i); - } - } - - while (count > 1) - { - float32 minCost = b2_maxFloat; - int32 iMin = -1, jMin = -1; - for (int32 i = 0; i < count; ++i) - { - b2AABB aabbi = m_nodes[nodes[i]].aabb; - - for (int32 j = i + 1; j < count; ++j) - { - b2AABB aabbj = m_nodes[nodes[j]].aabb; - b2AABB b; - b.Combine(aabbi, aabbj); - float32 cost = b.GetPerimeter(); - if (cost < minCost) - { - iMin = i; - jMin = j; - minCost = cost; - } - } - } - - int32 index1 = nodes[iMin]; - int32 index2 = nodes[jMin]; - b2TreeNode* child1 = m_nodes + index1; - b2TreeNode* child2 = m_nodes + index2; - - int32 parentIndex = AllocateNode(); - b2TreeNode* parent = m_nodes + parentIndex; - parent->child1 = index1; - parent->child2 = index2; - parent->height = 1 + b2Max(child1->height, child2->height); - parent->aabb.Combine(child1->aabb, child2->aabb); - parent->parent = b2_nullNode; - - child1->parent = parentIndex; - child2->parent = parentIndex; - - nodes[jMin] = nodes[count-1]; - nodes[iMin] = parentIndex; - --count; - } - - m_root = nodes[0]; - b2Free(nodes); - - Validate(); -} +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +using namespace std; + + +b2DynamicTree::b2DynamicTree() +{ + m_root = b2_nullNode; + + m_nodeCapacity = 16; + m_nodeCount = 0; + m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); + memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); + + // Build a linked list for the free list. + for (int32 i = 0; i < m_nodeCapacity - 1; ++i) + { + m_nodes[i].next = i + 1; + m_nodes[i].height = -1; + } + m_nodes[m_nodeCapacity-1].next = b2_nullNode; + m_nodes[m_nodeCapacity-1].height = -1; + m_freeList = 0; + + m_path = 0; + + m_insertionCount = 0; +} + +b2DynamicTree::~b2DynamicTree() +{ + // This frees the entire tree in one shot. + b2Free(m_nodes); +} + +// Allocate a node from the pool. Grow the pool if necessary. +int32 b2DynamicTree::AllocateNode() +{ + // Expand the node pool as needed. + if (m_freeList == b2_nullNode) + { + b2Assert(m_nodeCount == m_nodeCapacity); + + // The free list is empty. Rebuild a bigger pool. + b2TreeNode* oldNodes = m_nodes; + m_nodeCapacity *= 2; + m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); + memcpy(m_nodes, oldNodes, m_nodeCount * sizeof(b2TreeNode)); + b2Free(oldNodes); + + // Build a linked list for the free list. The parent + // pointer becomes the "next" pointer. + for (int32 i = m_nodeCount; i < m_nodeCapacity - 1; ++i) + { + m_nodes[i].next = i + 1; + m_nodes[i].height = -1; + } + m_nodes[m_nodeCapacity-1].next = b2_nullNode; + m_nodes[m_nodeCapacity-1].height = -1; + m_freeList = m_nodeCount; + } + + // Peel a node off the free list. + int32 nodeId = m_freeList; + m_freeList = m_nodes[nodeId].next; + m_nodes[nodeId].parent = b2_nullNode; + m_nodes[nodeId].child1 = b2_nullNode; + m_nodes[nodeId].child2 = b2_nullNode; + m_nodes[nodeId].height = 0; + m_nodes[nodeId].userData = NULL; + ++m_nodeCount; + return nodeId; +} + +// Return a node to the pool. +void b2DynamicTree::FreeNode(int32 nodeId) +{ + b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); + b2Assert(0 < m_nodeCount); + m_nodes[nodeId].next = m_freeList; + m_nodes[nodeId].height = -1; + m_freeList = nodeId; + --m_nodeCount; +} + +// Create a proxy in the tree as a leaf node. We return the index +// of the node instead of a pointer so that we can grow +// the node pool. +int32 b2DynamicTree::CreateProxy(const b2AABB& aabb, void* userData) +{ + int32 proxyId = AllocateNode(); + + // Fatten the aabb. + b2Vec2 r(b2_aabbExtension, b2_aabbExtension); + m_nodes[proxyId].aabb.lowerBound = aabb.lowerBound - r; + m_nodes[proxyId].aabb.upperBound = aabb.upperBound + r; + m_nodes[proxyId].userData = userData; + m_nodes[proxyId].height = 0; + + InsertLeaf(proxyId); + + return proxyId; +} + +void b2DynamicTree::DestroyProxy(int32 proxyId) +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + b2Assert(m_nodes[proxyId].IsLeaf()); + + RemoveLeaf(proxyId); + FreeNode(proxyId); +} + +bool b2DynamicTree::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement) +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + + b2Assert(m_nodes[proxyId].IsLeaf()); + + if (m_nodes[proxyId].aabb.Contains(aabb)) + { + return false; + } + + RemoveLeaf(proxyId); + + // Extend AABB. + b2AABB b = aabb; + b2Vec2 r(b2_aabbExtension, b2_aabbExtension); + b.lowerBound = b.lowerBound - r; + b.upperBound = b.upperBound + r; + + // Predict AABB displacement. + b2Vec2 d = b2_aabbMultiplier * displacement; + + if (d.x < 0.0f) + { + b.lowerBound.x += d.x; + } + else + { + b.upperBound.x += d.x; + } + + if (d.y < 0.0f) + { + b.lowerBound.y += d.y; + } + else + { + b.upperBound.y += d.y; + } + + m_nodes[proxyId].aabb = b; + + InsertLeaf(proxyId); + return true; +} + +void b2DynamicTree::InsertLeaf(int32 leaf) +{ + ++m_insertionCount; + + if (m_root == b2_nullNode) + { + m_root = leaf; + m_nodes[m_root].parent = b2_nullNode; + return; + } + + // Find the best sibling for this node + b2AABB leafAABB = m_nodes[leaf].aabb; + int32 index = m_root; + while (m_nodes[index].IsLeaf() == false) + { + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + float32 area = m_nodes[index].aabb.GetPerimeter(); + + b2AABB combinedAABB; + combinedAABB.Combine(m_nodes[index].aabb, leafAABB); + float32 combinedArea = combinedAABB.GetPerimeter(); + + // Cost of creating a new parent for this node and the new leaf + float32 cost = 2.0f * combinedArea; + + // Minimum cost of pushing the leaf further down the tree + float32 inheritanceCost = 2.0f * (combinedArea - area); + + // Cost of descending into child1 + float32 cost1; + if (m_nodes[child1].IsLeaf()) + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child1].aabb); + cost1 = aabb.GetPerimeter() + inheritanceCost; + } + else + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child1].aabb); + float32 oldArea = m_nodes[child1].aabb.GetPerimeter(); + float32 newArea = aabb.GetPerimeter(); + cost1 = (newArea - oldArea) + inheritanceCost; + } + + // Cost of descending into child2 + float32 cost2; + if (m_nodes[child2].IsLeaf()) + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child2].aabb); + cost2 = aabb.GetPerimeter() + inheritanceCost; + } + else + { + b2AABB aabb; + aabb.Combine(leafAABB, m_nodes[child2].aabb); + float32 oldArea = m_nodes[child2].aabb.GetPerimeter(); + float32 newArea = aabb.GetPerimeter(); + cost2 = newArea - oldArea + inheritanceCost; + } + + // Descend according to the minimum cost. + if (cost < cost1 && cost < cost2) + { + break; + } + + // Descend + if (cost1 < cost2) + { + index = child1; + } + else + { + index = child2; + } + } + + int32 sibling = index; + + // Create a new parent. + int32 oldParent = m_nodes[sibling].parent; + int32 newParent = AllocateNode(); + m_nodes[newParent].parent = oldParent; + m_nodes[newParent].userData = NULL; + m_nodes[newParent].aabb.Combine(leafAABB, m_nodes[sibling].aabb); + m_nodes[newParent].height = m_nodes[sibling].height + 1; + + if (oldParent != b2_nullNode) + { + // The sibling was not the root. + if (m_nodes[oldParent].child1 == sibling) + { + m_nodes[oldParent].child1 = newParent; + } + else + { + m_nodes[oldParent].child2 = newParent; + } + + m_nodes[newParent].child1 = sibling; + m_nodes[newParent].child2 = leaf; + m_nodes[sibling].parent = newParent; + m_nodes[leaf].parent = newParent; + } + else + { + // The sibling was the root. + m_nodes[newParent].child1 = sibling; + m_nodes[newParent].child2 = leaf; + m_nodes[sibling].parent = newParent; + m_nodes[leaf].parent = newParent; + m_root = newParent; + } + + // Walk back up the tree fixing heights and AABBs + index = m_nodes[leaf].parent; + while (index != b2_nullNode) + { + index = Balance(index); + + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + b2Assert(child1 != b2_nullNode); + b2Assert(child2 != b2_nullNode); + + m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); + m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + + index = m_nodes[index].parent; + } + + //Validate(); +} + +void b2DynamicTree::RemoveLeaf(int32 leaf) +{ + if (leaf == m_root) + { + m_root = b2_nullNode; + return; + } + + int32 parent = m_nodes[leaf].parent; + int32 grandParent = m_nodes[parent].parent; + int32 sibling; + if (m_nodes[parent].child1 == leaf) + { + sibling = m_nodes[parent].child2; + } + else + { + sibling = m_nodes[parent].child1; + } + + if (grandParent != b2_nullNode) + { + // Destroy parent and connect sibling to grandParent. + if (m_nodes[grandParent].child1 == parent) + { + m_nodes[grandParent].child1 = sibling; + } + else + { + m_nodes[grandParent].child2 = sibling; + } + m_nodes[sibling].parent = grandParent; + FreeNode(parent); + + // Adjust ancestor bounds. + int32 index = grandParent; + while (index != b2_nullNode) + { + index = Balance(index); + + int32 child1 = m_nodes[index].child1; + int32 child2 = m_nodes[index].child2; + + m_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + m_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height); + + index = m_nodes[index].parent; + } + } + else + { + m_root = sibling; + m_nodes[sibling].parent = b2_nullNode; + FreeNode(parent); + } + + //Validate(); +} + +// Perform a left or right rotation if node A is imbalanced. +// Returns the new root index. +int32 b2DynamicTree::Balance(int32 iA) +{ + b2Assert(iA != b2_nullNode); + + b2TreeNode* A = m_nodes + iA; + if (A->IsLeaf() || A->height < 2) + { + return iA; + } + + int32 iB = A->child1; + int32 iC = A->child2; + b2Assert(0 <= iB && iB < m_nodeCapacity); + b2Assert(0 <= iC && iC < m_nodeCapacity); + + b2TreeNode* B = m_nodes + iB; + b2TreeNode* C = m_nodes + iC; + + int32 balance = C->height - B->height; + + // Rotate C up + if (balance > 1) + { + int32 iF = C->child1; + int32 iG = C->child2; + b2TreeNode* F = m_nodes + iF; + b2TreeNode* G = m_nodes + iG; + b2Assert(0 <= iF && iF < m_nodeCapacity); + b2Assert(0 <= iG && iG < m_nodeCapacity); + + // Swap A and C + C->child1 = iA; + C->parent = A->parent; + A->parent = iC; + + // A's old parent should point to C + if (C->parent != b2_nullNode) + { + if (m_nodes[C->parent].child1 == iA) + { + m_nodes[C->parent].child1 = iC; + } + else + { + b2Assert(m_nodes[C->parent].child2 == iA); + m_nodes[C->parent].child2 = iC; + } + } + else + { + m_root = iC; + } + + // Rotate + if (F->height > G->height) + { + C->child2 = iF; + A->child2 = iG; + G->parent = iA; + A->aabb.Combine(B->aabb, G->aabb); + C->aabb.Combine(A->aabb, F->aabb); + + A->height = 1 + b2Max(B->height, G->height); + C->height = 1 + b2Max(A->height, F->height); + } + else + { + C->child2 = iG; + A->child2 = iF; + F->parent = iA; + A->aabb.Combine(B->aabb, F->aabb); + C->aabb.Combine(A->aabb, G->aabb); + + A->height = 1 + b2Max(B->height, F->height); + C->height = 1 + b2Max(A->height, G->height); + } + + return iC; + } + + // Rotate B up + if (balance < -1) + { + int32 iD = B->child1; + int32 iE = B->child2; + b2TreeNode* D = m_nodes + iD; + b2TreeNode* E = m_nodes + iE; + b2Assert(0 <= iD && iD < m_nodeCapacity); + b2Assert(0 <= iE && iE < m_nodeCapacity); + + // Swap A and B + B->child1 = iA; + B->parent = A->parent; + A->parent = iB; + + // A's old parent should point to B + if (B->parent != b2_nullNode) + { + if (m_nodes[B->parent].child1 == iA) + { + m_nodes[B->parent].child1 = iB; + } + else + { + b2Assert(m_nodes[B->parent].child2 == iA); + m_nodes[B->parent].child2 = iB; + } + } + else + { + m_root = iB; + } + + // Rotate + if (D->height > E->height) + { + B->child2 = iD; + A->child1 = iE; + E->parent = iA; + A->aabb.Combine(C->aabb, E->aabb); + B->aabb.Combine(A->aabb, D->aabb); + + A->height = 1 + b2Max(C->height, E->height); + B->height = 1 + b2Max(A->height, D->height); + } + else + { + B->child2 = iE; + A->child1 = iD; + D->parent = iA; + A->aabb.Combine(C->aabb, D->aabb); + B->aabb.Combine(A->aabb, E->aabb); + + A->height = 1 + b2Max(C->height, D->height); + B->height = 1 + b2Max(A->height, E->height); + } + + return iB; + } + + return iA; +} + +int32 b2DynamicTree::GetHeight() const +{ + if (m_root == b2_nullNode) + { + return 0; + } + + return m_nodes[m_root].height; +} + +// +float32 b2DynamicTree::GetAreaRatio() const +{ + if (m_root == b2_nullNode) + { + return 0.0f; + } + + const b2TreeNode* root = m_nodes + m_root; + float32 rootArea = root->aabb.GetPerimeter(); + + float32 totalArea = 0.0f; + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + const b2TreeNode* node = m_nodes + i; + if (node->height < 0) + { + // Free node in pool + continue; + } + + totalArea += node->aabb.GetPerimeter(); + } + + return totalArea / rootArea; +} + +// Compute the height of a sub-tree. +int32 b2DynamicTree::ComputeHeight(int32 nodeId) const +{ + b2Assert(0 <= nodeId && nodeId < m_nodeCapacity); + b2TreeNode* node = m_nodes + nodeId; + + if (node->IsLeaf()) + { + return 0; + } + + int32 height1 = ComputeHeight(node->child1); + int32 height2 = ComputeHeight(node->child2); + return 1 + b2Max(height1, height2); +} + +int32 b2DynamicTree::ComputeHeight() const +{ + int32 height = ComputeHeight(m_root); + return height; +} + +void b2DynamicTree::ValidateStructure(int32 index) const +{ + if (index == b2_nullNode) + { + return; + } + + if (index == m_root) + { + b2Assert(m_nodes[index].parent == b2_nullNode); + } + + const b2TreeNode* node = m_nodes + index; + + int32 child1 = node->child1; + int32 child2 = node->child2; + + if (node->IsLeaf()) + { + b2Assert(child1 == b2_nullNode); + b2Assert(child2 == b2_nullNode); + b2Assert(node->height == 0); + return; + } + + b2Assert(0 <= child1 && child1 < m_nodeCapacity); + b2Assert(0 <= child2 && child2 < m_nodeCapacity); + + b2Assert(m_nodes[child1].parent == index); + b2Assert(m_nodes[child2].parent == index); + + ValidateStructure(child1); + ValidateStructure(child2); +} + +void b2DynamicTree::ValidateMetrics(int32 index) const +{ + if (index == b2_nullNode) + { + return; + } + + const b2TreeNode* node = m_nodes + index; + + int32 child1 = node->child1; + int32 child2 = node->child2; + + if (node->IsLeaf()) + { + b2Assert(child1 == b2_nullNode); + b2Assert(child2 == b2_nullNode); + b2Assert(node->height == 0); + return; + } + + b2Assert(0 <= child1 && child1 < m_nodeCapacity); + b2Assert(0 <= child2 && child2 < m_nodeCapacity); + + int32 height1 = m_nodes[child1].height; + int32 height2 = m_nodes[child2].height; + int32 height; + height = 1 + b2Max(height1, height2); + b2Assert(node->height == height); + + b2AABB aabb; + aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb); + + b2Assert(aabb.lowerBound == node->aabb.lowerBound); + b2Assert(aabb.upperBound == node->aabb.upperBound); + + ValidateMetrics(child1); + ValidateMetrics(child2); +} + +void b2DynamicTree::Validate() const +{ + ValidateStructure(m_root); + ValidateMetrics(m_root); + + int32 freeCount = 0; + int32 freeIndex = m_freeList; + while (freeIndex != b2_nullNode) + { + b2Assert(0 <= freeIndex && freeIndex < m_nodeCapacity); + freeIndex = m_nodes[freeIndex].next; + ++freeCount; + } + + b2Assert(GetHeight() == ComputeHeight()); + + b2Assert(m_nodeCount + freeCount == m_nodeCapacity); +} + +int32 b2DynamicTree::GetMaxBalance() const +{ + int32 maxBalance = 0; + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + const b2TreeNode* node = m_nodes + i; + if (node->height <= 1) + { + continue; + } + + b2Assert(node->IsLeaf() == false); + + int32 child1 = node->child1; + int32 child2 = node->child2; + int32 balance = b2Abs(m_nodes[child2].height - m_nodes[child1].height); + maxBalance = b2Max(maxBalance, balance); + } + + return maxBalance; +} + +void b2DynamicTree::RebuildBottomUp() +{ + int32* nodes = (int32*)b2Alloc(m_nodeCount * sizeof(int32)); + int32 count = 0; + + // Build array of leaves. Free the rest. + for (int32 i = 0; i < m_nodeCapacity; ++i) + { + if (m_nodes[i].height < 0) + { + // free node in pool + continue; + } + + if (m_nodes[i].IsLeaf()) + { + m_nodes[i].parent = b2_nullNode; + nodes[count] = i; + ++count; + } + else + { + FreeNode(i); + } + } + + while (count > 1) + { + float32 minCost = b2_maxFloat; + int32 iMin = -1, jMin = -1; + for (int32 i = 0; i < count; ++i) + { + b2AABB aabbi = m_nodes[nodes[i]].aabb; + + for (int32 j = i + 1; j < count; ++j) + { + b2AABB aabbj = m_nodes[nodes[j]].aabb; + b2AABB b; + b.Combine(aabbi, aabbj); + float32 cost = b.GetPerimeter(); + if (cost < minCost) + { + iMin = i; + jMin = j; + minCost = cost; + } + } + } + + int32 index1 = nodes[iMin]; + int32 index2 = nodes[jMin]; + b2TreeNode* child1 = m_nodes + index1; + b2TreeNode* child2 = m_nodes + index2; + + int32 parentIndex = AllocateNode(); + b2TreeNode* parent = m_nodes + parentIndex; + parent->child1 = index1; + parent->child2 = index2; + parent->height = 1 + b2Max(child1->height, child2->height); + parent->aabb.Combine(child1->aabb, child2->aabb); + parent->parent = b2_nullNode; + + child1->parent = parentIndex; + child2->parent = parentIndex; + + nodes[jMin] = nodes[count-1]; + nodes[iMin] = parentIndex; + --count; + } + + m_root = nodes[0]; + b2Free(nodes); + + Validate(); +} diff --git a/src/libraries/Box2D/Collision/b2DynamicTree.h b/src/libraries/Box2D/Collision/b2DynamicTree.h index a9bfbf379..0787785b7 100755 --- a/src/libraries/Box2D/Collision/b2DynamicTree.h +++ b/src/libraries/Box2D/Collision/b2DynamicTree.h @@ -1,284 +1,284 @@ -/* -* Copyright (c) 2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DYNAMIC_TREE_H -#define B2_DYNAMIC_TREE_H - -#include -#include - -#define b2_nullNode (-1) - -/// A node in the dynamic tree. The client does not interact with this directly. -struct b2TreeNode -{ - bool IsLeaf() const - { - return child1 == b2_nullNode; - } - - /// Enlarged AABB - b2AABB aabb; - - void* userData; - - union - { - int32 parent; - int32 next; - }; - - int32 child1; - int32 child2; - - // leaf = 0, free node = -1 - int32 height; -}; - -/// A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. -/// A dynamic tree arranges data in a binary tree to accelerate -/// queries such as volume queries and ray casts. Leafs are proxies -/// with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor -/// so that the proxy AABB is bigger than the client object. This allows the client -/// object to move by small amounts without triggering a tree update. -/// -/// Nodes are pooled and relocatable, so we use node indices rather than pointers. -class b2DynamicTree -{ -public: - /// Constructing the tree initializes the node pool. - b2DynamicTree(); - - /// Destroy the tree, freeing the node pool. - ~b2DynamicTree(); - - /// Create a proxy. Provide a tight fitting AABB and a userData pointer. - int32 CreateProxy(const b2AABB& aabb, void* userData); - - /// Destroy a proxy. This asserts if the id is invalid. - void DestroyProxy(int32 proxyId); - - /// Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, - /// then the proxy is removed from the tree and re-inserted. Otherwise - /// the function returns immediately. - /// @return true if the proxy was re-inserted. - bool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement); - - /// Get proxy user data. - /// @return the proxy user data or 0 if the id is invalid. - void* GetUserData(int32 proxyId) const; - - /// Get the fat AABB for a proxy. - const b2AABB& GetFatAABB(int32 proxyId) const; - - /// Query an AABB for overlapping proxies. The callback class - /// is called for each proxy that overlaps the supplied AABB. - template - void Query(T* callback, const b2AABB& aabb) const; - - /// Ray-cast against the proxies in the tree. This relies on the callback - /// to perform a exact ray-cast in the case were the proxy contains a shape. - /// The callback also performs the any collision filtering. This has performance - /// roughly equal to k * log(n), where k is the number of collisions and n is the - /// number of proxies in the tree. - /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). - /// @param callback a callback class that is called for each proxy that is hit by the ray. - template - void RayCast(T* callback, const b2RayCastInput& input) const; - - /// Validate this tree. For testing. - void Validate() const; - - /// Compute the height of the binary tree in O(N) time. Should not be - /// called often. - int32 GetHeight() const; - - /// Get the maximum balance of an node in the tree. The balance is the difference - /// in height of the two children of a node. - int32 GetMaxBalance() const; - - /// Get the ratio of the sum of the node areas to the root area. - float32 GetAreaRatio() const; - - /// Build an optimal tree. Very expensive. For testing. - void RebuildBottomUp(); - -private: - - int32 AllocateNode(); - void FreeNode(int32 node); - - void InsertLeaf(int32 node); - void RemoveLeaf(int32 node); - - int32 Balance(int32 index); - - int32 ComputeHeight() const; - int32 ComputeHeight(int32 nodeId) const; - - void ValidateStructure(int32 index) const; - void ValidateMetrics(int32 index) const; - - int32 m_root; - - b2TreeNode* m_nodes; - int32 m_nodeCount; - int32 m_nodeCapacity; - - int32 m_freeList; - - /// This is used to incrementally traverse the tree for re-balancing. - uint32 m_path; - - int32 m_insertionCount; -}; - -inline void* b2DynamicTree::GetUserData(int32 proxyId) const -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - return m_nodes[proxyId].userData; -} - -inline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const -{ - b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); - return m_nodes[proxyId].aabb; -} - -template -inline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const -{ - b2GrowableStack stack; - stack.Push(m_root); - - while (stack.GetCount() > 0) - { - int32 nodeId = stack.Pop(); - if (nodeId == b2_nullNode) - { - continue; - } - - const b2TreeNode* node = m_nodes + nodeId; - - if (b2TestOverlap(node->aabb, aabb)) - { - if (node->IsLeaf()) - { - bool proceed = callback->QueryCallback(nodeId); - if (proceed == false) - { - return; - } - } - else - { - stack.Push(node->child1); - stack.Push(node->child2); - } - } - } -} - -template -inline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const -{ - b2Vec2 p1 = input.p1; - b2Vec2 p2 = input.p2; - b2Vec2 r = p2 - p1; - b2Assert(r.LengthSquared() > 0.0f); - r.Normalize(); - - // v is perpendicular to the segment. - b2Vec2 v = b2Cross(1.0f, r); - b2Vec2 abs_v = b2Abs(v); - - // Separating axis for segment (Gino, p80). - // |dot(v, p1 - c)| > dot(|v|, h) - - float32 maxFraction = input.maxFraction; - - // Build a bounding box for the segment. - b2AABB segmentAABB; - { - b2Vec2 t = p1 + maxFraction * (p2 - p1); - segmentAABB.lowerBound = b2Min(p1, t); - segmentAABB.upperBound = b2Max(p1, t); - } - - b2GrowableStack stack; - stack.Push(m_root); - - while (stack.GetCount() > 0) - { - int32 nodeId = stack.Pop(); - if (nodeId == b2_nullNode) - { - continue; - } - - const b2TreeNode* node = m_nodes + nodeId; - - if (b2TestOverlap(node->aabb, segmentAABB) == false) - { - continue; - } - - // Separating axis for segment (Gino, p80). - // |dot(v, p1 - c)| > dot(|v|, h) - b2Vec2 c = node->aabb.GetCenter(); - b2Vec2 h = node->aabb.GetExtents(); - float32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h); - if (separation > 0.0f) - { - continue; - } - - if (node->IsLeaf()) - { - b2RayCastInput subInput; - subInput.p1 = input.p1; - subInput.p2 = input.p2; - subInput.maxFraction = maxFraction; - - float32 value = callback->RayCastCallback(subInput, nodeId); - - if (value == 0.0f) - { - // The client has terminated the ray cast. - return; - } - - if (value > 0.0f) - { - // Update segment bounding box. - maxFraction = value; - b2Vec2 t = p1 + maxFraction * (p2 - p1); - segmentAABB.lowerBound = b2Min(p1, t); - segmentAABB.upperBound = b2Max(p1, t); - } - } - else - { - stack.Push(node->child1); - stack.Push(node->child2); - } - } -} - -#endif +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DYNAMIC_TREE_H +#define B2_DYNAMIC_TREE_H + +#include +#include + +#define b2_nullNode (-1) + +/// A node in the dynamic tree. The client does not interact with this directly. +struct b2TreeNode +{ + bool IsLeaf() const + { + return child1 == b2_nullNode; + } + + /// Enlarged AABB + b2AABB aabb; + + void* userData; + + union + { + int32 parent; + int32 next; + }; + + int32 child1; + int32 child2; + + // leaf = 0, free node = -1 + int32 height; +}; + +/// A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. +/// A dynamic tree arranges data in a binary tree to accelerate +/// queries such as volume queries and ray casts. Leafs are proxies +/// with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor +/// so that the proxy AABB is bigger than the client object. This allows the client +/// object to move by small amounts without triggering a tree update. +/// +/// Nodes are pooled and relocatable, so we use node indices rather than pointers. +class b2DynamicTree +{ +public: + /// Constructing the tree initializes the node pool. + b2DynamicTree(); + + /// Destroy the tree, freeing the node pool. + ~b2DynamicTree(); + + /// Create a proxy. Provide a tight fitting AABB and a userData pointer. + int32 CreateProxy(const b2AABB& aabb, void* userData); + + /// Destroy a proxy. This asserts if the id is invalid. + void DestroyProxy(int32 proxyId); + + /// Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, + /// then the proxy is removed from the tree and re-inserted. Otherwise + /// the function returns immediately. + /// @return true if the proxy was re-inserted. + bool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement); + + /// Get proxy user data. + /// @return the proxy user data or 0 if the id is invalid. + void* GetUserData(int32 proxyId) const; + + /// Get the fat AABB for a proxy. + const b2AABB& GetFatAABB(int32 proxyId) const; + + /// Query an AABB for overlapping proxies. The callback class + /// is called for each proxy that overlaps the supplied AABB. + template + void Query(T* callback, const b2AABB& aabb) const; + + /// Ray-cast against the proxies in the tree. This relies on the callback + /// to perform a exact ray-cast in the case were the proxy contains a shape. + /// The callback also performs the any collision filtering. This has performance + /// roughly equal to k * log(n), where k is the number of collisions and n is the + /// number of proxies in the tree. + /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). + /// @param callback a callback class that is called for each proxy that is hit by the ray. + template + void RayCast(T* callback, const b2RayCastInput& input) const; + + /// Validate this tree. For testing. + void Validate() const; + + /// Compute the height of the binary tree in O(N) time. Should not be + /// called often. + int32 GetHeight() const; + + /// Get the maximum balance of an node in the tree. The balance is the difference + /// in height of the two children of a node. + int32 GetMaxBalance() const; + + /// Get the ratio of the sum of the node areas to the root area. + float32 GetAreaRatio() const; + + /// Build an optimal tree. Very expensive. For testing. + void RebuildBottomUp(); + +private: + + int32 AllocateNode(); + void FreeNode(int32 node); + + void InsertLeaf(int32 node); + void RemoveLeaf(int32 node); + + int32 Balance(int32 index); + + int32 ComputeHeight() const; + int32 ComputeHeight(int32 nodeId) const; + + void ValidateStructure(int32 index) const; + void ValidateMetrics(int32 index) const; + + int32 m_root; + + b2TreeNode* m_nodes; + int32 m_nodeCount; + int32 m_nodeCapacity; + + int32 m_freeList; + + /// This is used to incrementally traverse the tree for re-balancing. + uint32 m_path; + + int32 m_insertionCount; +}; + +inline void* b2DynamicTree::GetUserData(int32 proxyId) const +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + return m_nodes[proxyId].userData; +} + +inline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + return m_nodes[proxyId].aabb; +} + +template +inline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const +{ + b2GrowableStack stack; + stack.Push(m_root); + + while (stack.GetCount() > 0) + { + int32 nodeId = stack.Pop(); + if (nodeId == b2_nullNode) + { + continue; + } + + const b2TreeNode* node = m_nodes + nodeId; + + if (b2TestOverlap(node->aabb, aabb)) + { + if (node->IsLeaf()) + { + bool proceed = callback->QueryCallback(nodeId); + if (proceed == false) + { + return; + } + } + else + { + stack.Push(node->child1); + stack.Push(node->child2); + } + } + } +} + +template +inline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const +{ + b2Vec2 p1 = input.p1; + b2Vec2 p2 = input.p2; + b2Vec2 r = p2 - p1; + b2Assert(r.LengthSquared() > 0.0f); + r.Normalize(); + + // v is perpendicular to the segment. + b2Vec2 v = b2Cross(1.0f, r); + b2Vec2 abs_v = b2Abs(v); + + // Separating axis for segment (Gino, p80). + // |dot(v, p1 - c)| > dot(|v|, h) + + float32 maxFraction = input.maxFraction; + + // Build a bounding box for the segment. + b2AABB segmentAABB; + { + b2Vec2 t = p1 + maxFraction * (p2 - p1); + segmentAABB.lowerBound = b2Min(p1, t); + segmentAABB.upperBound = b2Max(p1, t); + } + + b2GrowableStack stack; + stack.Push(m_root); + + while (stack.GetCount() > 0) + { + int32 nodeId = stack.Pop(); + if (nodeId == b2_nullNode) + { + continue; + } + + const b2TreeNode* node = m_nodes + nodeId; + + if (b2TestOverlap(node->aabb, segmentAABB) == false) + { + continue; + } + + // Separating axis for segment (Gino, p80). + // |dot(v, p1 - c)| > dot(|v|, h) + b2Vec2 c = node->aabb.GetCenter(); + b2Vec2 h = node->aabb.GetExtents(); + float32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h); + if (separation > 0.0f) + { + continue; + } + + if (node->IsLeaf()) + { + b2RayCastInput subInput; + subInput.p1 = input.p1; + subInput.p2 = input.p2; + subInput.maxFraction = maxFraction; + + float32 value = callback->RayCastCallback(subInput, nodeId); + + if (value == 0.0f) + { + // The client has terminated the ray cast. + return; + } + + if (value > 0.0f) + { + // Update segment bounding box. + maxFraction = value; + b2Vec2 t = p1 + maxFraction * (p2 - p1); + segmentAABB.lowerBound = b2Min(p1, t); + segmentAABB.upperBound = b2Max(p1, t); + } + } + else + { + stack.Push(node->child1); + stack.Push(node->child2); + } + } +} + +#endif diff --git a/src/libraries/Box2D/Collision/b2TimeOfImpact.cpp b/src/libraries/Box2D/Collision/b2TimeOfImpact.cpp index 5c33e828c..9b456a999 100755 --- a/src/libraries/Box2D/Collision/b2TimeOfImpact.cpp +++ b/src/libraries/Box2D/Collision/b2TimeOfImpact.cpp @@ -1,483 +1,483 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#include -using namespace std; - -int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters; -int32 b2_toiRootIters, b2_toiMaxRootIters; - -struct b2SeparationFunction -{ - enum Type - { - e_points, - e_faceA, - e_faceB - }; - - // TODO_ERIN might not need to return the separation - - float32 Initialize(const b2SimplexCache* cache, - const b2DistanceProxy* proxyA, const b2Sweep& sweepA, - const b2DistanceProxy* proxyB, const b2Sweep& sweepB, - float32 t1) - { - m_proxyA = proxyA; - m_proxyB = proxyB; - int32 count = cache->count; - b2Assert(0 < count && count < 3); - - m_sweepA = sweepA; - m_sweepB = sweepB; - - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t1); - m_sweepB.GetTransform(&xfB, t1); - - if (count == 1) - { - m_type = e_points; - b2Vec2 localPointA = m_proxyA->GetVertex(cache->indexA[0]); - b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - m_axis = pointB - pointA; - float32 s = m_axis.Normalize(); - return s; - } - else if (cache->indexA[0] == cache->indexA[1]) - { - // Two points on B and one on A. - m_type = e_faceB; - b2Vec2 localPointB1 = proxyB->GetVertex(cache->indexB[0]); - b2Vec2 localPointB2 = proxyB->GetVertex(cache->indexB[1]); - - m_axis = b2Cross(localPointB2 - localPointB1, 1.0f); - m_axis.Normalize(); - b2Vec2 normal = b2Mul(xfB.q, m_axis); - - m_localPoint = 0.5f * (localPointB1 + localPointB2); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 localPointA = proxyA->GetVertex(cache->indexA[0]); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 s = b2Dot(pointA - pointB, normal); - if (s < 0.0f) - { - m_axis = -m_axis; - s = -s; - } - return s; - } - else - { - // Two points on A and one or two points on B. - m_type = e_faceA; - b2Vec2 localPointA1 = m_proxyA->GetVertex(cache->indexA[0]); - b2Vec2 localPointA2 = m_proxyA->GetVertex(cache->indexA[1]); - - m_axis = b2Cross(localPointA2 - localPointA1, 1.0f); - m_axis.Normalize(); - b2Vec2 normal = b2Mul(xfA.q, m_axis); - - m_localPoint = 0.5f * (localPointA1 + localPointA2); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 s = b2Dot(pointB - pointA, normal); - if (s < 0.0f) - { - m_axis = -m_axis; - s = -s; - } - return s; - } - } - - float32 FindMinSeparation(int32* indexA, int32* indexB, float32 t) const - { - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t); - m_sweepB.GetTransform(&xfB, t); - - switch (m_type) - { - case e_points: - { - b2Vec2 axisA = b2MulT(xfA.q, m_axis); - b2Vec2 axisB = b2MulT(xfB.q, -m_axis); - - *indexA = m_proxyA->GetSupport(axisA); - *indexB = m_proxyB->GetSupport(axisB); - - b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); - b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); - - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, m_axis); - return separation; - } - - case e_faceA: - { - b2Vec2 normal = b2Mul(xfA.q, m_axis); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 axisB = b2MulT(xfB.q, -normal); - - *indexA = -1; - *indexB = m_proxyB->GetSupport(axisB); - - b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, normal); - return separation; - } - - case e_faceB: - { - b2Vec2 normal = b2Mul(xfB.q, m_axis); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 axisA = b2MulT(xfA.q, -normal); - - *indexB = -1; - *indexA = m_proxyA->GetSupport(axisA); - - b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 separation = b2Dot(pointA - pointB, normal); - return separation; - } - - default: - b2Assert(false); - *indexA = -1; - *indexB = -1; - return 0.0f; - } - } - - float32 Evaluate(int32 indexA, int32 indexB, float32 t) const - { - b2Transform xfA, xfB; - m_sweepA.GetTransform(&xfA, t); - m_sweepB.GetTransform(&xfB, t); - - switch (m_type) - { - case e_points: - { - b2Vec2 axisA = b2MulT(xfA.q, m_axis); - b2Vec2 axisB = b2MulT(xfB.q, -m_axis); - - b2Vec2 localPointA = m_proxyA->GetVertex(indexA); - b2Vec2 localPointB = m_proxyB->GetVertex(indexB); - - b2Vec2 pointA = b2Mul(xfA, localPointA); - b2Vec2 pointB = b2Mul(xfB, localPointB); - float32 separation = b2Dot(pointB - pointA, m_axis); - - return separation; - } - - case e_faceA: - { - b2Vec2 normal = b2Mul(xfA.q, m_axis); - b2Vec2 pointA = b2Mul(xfA, m_localPoint); - - b2Vec2 axisB = b2MulT(xfB.q, -normal); - - b2Vec2 localPointB = m_proxyB->GetVertex(indexB); - b2Vec2 pointB = b2Mul(xfB, localPointB); - - float32 separation = b2Dot(pointB - pointA, normal); - return separation; - } - - case e_faceB: - { - b2Vec2 normal = b2Mul(xfB.q, m_axis); - b2Vec2 pointB = b2Mul(xfB, m_localPoint); - - b2Vec2 axisA = b2MulT(xfA.q, -normal); - - b2Vec2 localPointA = m_proxyA->GetVertex(indexA); - b2Vec2 pointA = b2Mul(xfA, localPointA); - - float32 separation = b2Dot(pointA - pointB, normal); - return separation; - } - - default: - b2Assert(false); - return 0.0f; - } - } - - const b2DistanceProxy* m_proxyA; - const b2DistanceProxy* m_proxyB; - b2Sweep m_sweepA, m_sweepB; - Type m_type; - b2Vec2 m_localPoint; - b2Vec2 m_axis; -}; - -// CCD via the local separating axis method. This seeks progression -// by computing the largest time at which separation is maintained. -void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input) -{ - ++b2_toiCalls; - - output->state = b2TOIOutput::e_unknown; - output->t = input->tMax; - - const b2DistanceProxy* proxyA = &input->proxyA; - const b2DistanceProxy* proxyB = &input->proxyB; - - b2Sweep sweepA = input->sweepA; - b2Sweep sweepB = input->sweepB; - - // Large rotations can make the root finder fail, so we normalize the - // sweep angles. - sweepA.Normalize(); - sweepB.Normalize(); - - float32 tMax = input->tMax; - - float32 totalRadius = proxyA->m_radius + proxyB->m_radius; - float32 target = b2Max(b2_linearSlop, totalRadius - 3.0f * b2_linearSlop); - float32 tolerance = 0.25f * b2_linearSlop; - b2Assert(target > tolerance); - - float32 t1 = 0.0f; - const int32 k_maxIterations = 20; // TODO_ERIN b2Settings - int32 iter = 0; - - // Prepare input for distance query. - b2SimplexCache cache; - cache.count = 0; - b2DistanceInput distanceInput; - distanceInput.proxyA = input->proxyA; - distanceInput.proxyB = input->proxyB; - distanceInput.useRadii = false; - - // The outer loop progressively attempts to compute new separating axes. - // This loop terminates when an axis is repeated (no progress is made). - for(;;) - { - b2Transform xfA, xfB; - sweepA.GetTransform(&xfA, t1); - sweepB.GetTransform(&xfB, t1); - - // Get the distance between shapes. We can also use the results - // to get a separating axis. - distanceInput.transformA = xfA; - distanceInput.transformB = xfB; - b2DistanceOutput distanceOutput; - b2Distance(&distanceOutput, &cache, &distanceInput); - - // If the shapes are overlapped, we give up on continuous collision. - if (distanceOutput.distance <= 0.0f) - { - // Failure! - output->state = b2TOIOutput::e_overlapped; - output->t = 0.0f; - break; - } - - if (distanceOutput.distance < target + tolerance) - { - // Victory! - output->state = b2TOIOutput::e_touching; - output->t = t1; - break; - } - - // Initialize the separating axis. - b2SeparationFunction fcn; - fcn.Initialize(&cache, proxyA, sweepA, proxyB, sweepB, t1); -#if 0 - // Dump the curve seen by the root finder - { - const int32 N = 100; - float32 dx = 1.0f / N; - float32 xs[N+1]; - float32 fs[N+1]; - - float32 x = 0.0f; - - for (int32 i = 0; i <= N; ++i) - { - sweepA.GetTransform(&xfA, x); - sweepB.GetTransform(&xfB, x); - float32 f = fcn.Evaluate(xfA, xfB) - target; - - printf("%g %g\n", x, f); - - xs[i] = x; - fs[i] = f; - - x += dx; - } - } -#endif - - // Compute the TOI on the separating axis. We do this by successively - // resolving the deepest point. This loop is bounded by the number of vertices. - bool done = false; - float32 t2 = tMax; - int32 pushBackIter = 0; - for (;;) - { - // Find the deepest point at t2. Store the witness point indices. - int32 indexA, indexB; - float32 s2 = fcn.FindMinSeparation(&indexA, &indexB, t2); - - // Is the final configuration separated? - if (s2 > target + tolerance) - { - // Victory! - output->state = b2TOIOutput::e_separated; - output->t = tMax; - done = true; - break; - } - - // Has the separation reached tolerance? - if (s2 > target - tolerance) - { - // Advance the sweeps - t1 = t2; - break; - } - - // Compute the initial separation of the witness points. - float32 s1 = fcn.Evaluate(indexA, indexB, t1); - - // Check for initial overlap. This might happen if the root finder - // runs out of iterations. - if (s1 < target - tolerance) - { - output->state = b2TOIOutput::e_failed; - output->t = t1; - done = true; - break; - } - - // Check for touching - if (s1 <= target + tolerance) - { - // Victory! t1 should hold the TOI (could be 0.0). - output->state = b2TOIOutput::e_touching; - output->t = t1; - done = true; - break; - } - - // Compute 1D root of: f(x) - target = 0 - int32 rootIterCount = 0; - float32 a1 = t1, a2 = t2; - for (;;) - { - // Use a mix of the secant rule and bisection. - float32 t; - if (rootIterCount & 1) - { - // Secant rule to improve convergence. - t = a1 + (target - s1) * (a2 - a1) / (s2 - s1); - } - else - { - // Bisection to guarantee progress. - t = 0.5f * (a1 + a2); - } - - float32 s = fcn.Evaluate(indexA, indexB, t); - - if (b2Abs(s - target) < tolerance) - { - // t2 holds a tentative value for t1 - t2 = t; - break; - } - - // Ensure we continue to bracket the root. - if (s > target) - { - a1 = t; - s1 = s; - } - else - { - a2 = t; - s2 = s; - } - - ++rootIterCount; - ++b2_toiRootIters; - - if (rootIterCount == 50) - { - break; - } - } - - b2_toiMaxRootIters = b2Max(b2_toiMaxRootIters, rootIterCount); - - ++pushBackIter; - - if (pushBackIter == b2_maxPolygonVertices) - { - break; - } - } - - ++iter; - ++b2_toiIters; - - if (done) - { - break; - } - - if (iter == k_maxIterations) - { - // Root finder got stuck. Semi-victory. - output->state = b2TOIOutput::e_failed; - output->t = t1; - break; - } - } - - b2_toiMaxIters = b2Max(b2_toiMaxIters, iter); -} +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#include +using namespace std; + +int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters; +int32 b2_toiRootIters, b2_toiMaxRootIters; + +struct b2SeparationFunction +{ + enum Type + { + e_points, + e_faceA, + e_faceB + }; + + // TODO_ERIN might not need to return the separation + + float32 Initialize(const b2SimplexCache* cache, + const b2DistanceProxy* proxyA, const b2Sweep& sweepA, + const b2DistanceProxy* proxyB, const b2Sweep& sweepB, + float32 t1) + { + m_proxyA = proxyA; + m_proxyB = proxyB; + int32 count = cache->count; + b2Assert(0 < count && count < 3); + + m_sweepA = sweepA; + m_sweepB = sweepB; + + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t1); + m_sweepB.GetTransform(&xfB, t1); + + if (count == 1) + { + m_type = e_points; + b2Vec2 localPointA = m_proxyA->GetVertex(cache->indexA[0]); + b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + m_axis = pointB - pointA; + float32 s = m_axis.Normalize(); + return s; + } + else if (cache->indexA[0] == cache->indexA[1]) + { + // Two points on B and one on A. + m_type = e_faceB; + b2Vec2 localPointB1 = proxyB->GetVertex(cache->indexB[0]); + b2Vec2 localPointB2 = proxyB->GetVertex(cache->indexB[1]); + + m_axis = b2Cross(localPointB2 - localPointB1, 1.0f); + m_axis.Normalize(); + b2Vec2 normal = b2Mul(xfB.q, m_axis); + + m_localPoint = 0.5f * (localPointB1 + localPointB2); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 localPointA = proxyA->GetVertex(cache->indexA[0]); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 s = b2Dot(pointA - pointB, normal); + if (s < 0.0f) + { + m_axis = -m_axis; + s = -s; + } + return s; + } + else + { + // Two points on A and one or two points on B. + m_type = e_faceA; + b2Vec2 localPointA1 = m_proxyA->GetVertex(cache->indexA[0]); + b2Vec2 localPointA2 = m_proxyA->GetVertex(cache->indexA[1]); + + m_axis = b2Cross(localPointA2 - localPointA1, 1.0f); + m_axis.Normalize(); + b2Vec2 normal = b2Mul(xfA.q, m_axis); + + m_localPoint = 0.5f * (localPointA1 + localPointA2); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 s = b2Dot(pointB - pointA, normal); + if (s < 0.0f) + { + m_axis = -m_axis; + s = -s; + } + return s; + } + } + + float32 FindMinSeparation(int32* indexA, int32* indexB, float32 t) const + { + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t); + m_sweepB.GetTransform(&xfB, t); + + switch (m_type) + { + case e_points: + { + b2Vec2 axisA = b2MulT(xfA.q, m_axis); + b2Vec2 axisB = b2MulT(xfB.q, -m_axis); + + *indexA = m_proxyA->GetSupport(axisA); + *indexB = m_proxyB->GetSupport(axisB); + + b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); + b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); + + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, m_axis); + return separation; + } + + case e_faceA: + { + b2Vec2 normal = b2Mul(xfA.q, m_axis); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 axisB = b2MulT(xfB.q, -normal); + + *indexA = -1; + *indexB = m_proxyB->GetSupport(axisB); + + b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, normal); + return separation; + } + + case e_faceB: + { + b2Vec2 normal = b2Mul(xfB.q, m_axis); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 axisA = b2MulT(xfA.q, -normal); + + *indexB = -1; + *indexA = m_proxyA->GetSupport(axisA); + + b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 separation = b2Dot(pointA - pointB, normal); + return separation; + } + + default: + b2Assert(false); + *indexA = -1; + *indexB = -1; + return 0.0f; + } + } + + float32 Evaluate(int32 indexA, int32 indexB, float32 t) const + { + b2Transform xfA, xfB; + m_sweepA.GetTransform(&xfA, t); + m_sweepB.GetTransform(&xfB, t); + + switch (m_type) + { + case e_points: + { + b2Vec2 axisA = b2MulT(xfA.q, m_axis); + b2Vec2 axisB = b2MulT(xfB.q, -m_axis); + + b2Vec2 localPointA = m_proxyA->GetVertex(indexA); + b2Vec2 localPointB = m_proxyB->GetVertex(indexB); + + b2Vec2 pointA = b2Mul(xfA, localPointA); + b2Vec2 pointB = b2Mul(xfB, localPointB); + float32 separation = b2Dot(pointB - pointA, m_axis); + + return separation; + } + + case e_faceA: + { + b2Vec2 normal = b2Mul(xfA.q, m_axis); + b2Vec2 pointA = b2Mul(xfA, m_localPoint); + + b2Vec2 axisB = b2MulT(xfB.q, -normal); + + b2Vec2 localPointB = m_proxyB->GetVertex(indexB); + b2Vec2 pointB = b2Mul(xfB, localPointB); + + float32 separation = b2Dot(pointB - pointA, normal); + return separation; + } + + case e_faceB: + { + b2Vec2 normal = b2Mul(xfB.q, m_axis); + b2Vec2 pointB = b2Mul(xfB, m_localPoint); + + b2Vec2 axisA = b2MulT(xfA.q, -normal); + + b2Vec2 localPointA = m_proxyA->GetVertex(indexA); + b2Vec2 pointA = b2Mul(xfA, localPointA); + + float32 separation = b2Dot(pointA - pointB, normal); + return separation; + } + + default: + b2Assert(false); + return 0.0f; + } + } + + const b2DistanceProxy* m_proxyA; + const b2DistanceProxy* m_proxyB; + b2Sweep m_sweepA, m_sweepB; + Type m_type; + b2Vec2 m_localPoint; + b2Vec2 m_axis; +}; + +// CCD via the local separating axis method. This seeks progression +// by computing the largest time at which separation is maintained. +void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input) +{ + ++b2_toiCalls; + + output->state = b2TOIOutput::e_unknown; + output->t = input->tMax; + + const b2DistanceProxy* proxyA = &input->proxyA; + const b2DistanceProxy* proxyB = &input->proxyB; + + b2Sweep sweepA = input->sweepA; + b2Sweep sweepB = input->sweepB; + + // Large rotations can make the root finder fail, so we normalize the + // sweep angles. + sweepA.Normalize(); + sweepB.Normalize(); + + float32 tMax = input->tMax; + + float32 totalRadius = proxyA->m_radius + proxyB->m_radius; + float32 target = b2Max(b2_linearSlop, totalRadius - 3.0f * b2_linearSlop); + float32 tolerance = 0.25f * b2_linearSlop; + b2Assert(target > tolerance); + + float32 t1 = 0.0f; + const int32 k_maxIterations = 20; // TODO_ERIN b2Settings + int32 iter = 0; + + // Prepare input for distance query. + b2SimplexCache cache; + cache.count = 0; + b2DistanceInput distanceInput; + distanceInput.proxyA = input->proxyA; + distanceInput.proxyB = input->proxyB; + distanceInput.useRadii = false; + + // The outer loop progressively attempts to compute new separating axes. + // This loop terminates when an axis is repeated (no progress is made). + for(;;) + { + b2Transform xfA, xfB; + sweepA.GetTransform(&xfA, t1); + sweepB.GetTransform(&xfB, t1); + + // Get the distance between shapes. We can also use the results + // to get a separating axis. + distanceInput.transformA = xfA; + distanceInput.transformB = xfB; + b2DistanceOutput distanceOutput; + b2Distance(&distanceOutput, &cache, &distanceInput); + + // If the shapes are overlapped, we give up on continuous collision. + if (distanceOutput.distance <= 0.0f) + { + // Failure! + output->state = b2TOIOutput::e_overlapped; + output->t = 0.0f; + break; + } + + if (distanceOutput.distance < target + tolerance) + { + // Victory! + output->state = b2TOIOutput::e_touching; + output->t = t1; + break; + } + + // Initialize the separating axis. + b2SeparationFunction fcn; + fcn.Initialize(&cache, proxyA, sweepA, proxyB, sweepB, t1); +#if 0 + // Dump the curve seen by the root finder + { + const int32 N = 100; + float32 dx = 1.0f / N; + float32 xs[N+1]; + float32 fs[N+1]; + + float32 x = 0.0f; + + for (int32 i = 0; i <= N; ++i) + { + sweepA.GetTransform(&xfA, x); + sweepB.GetTransform(&xfB, x); + float32 f = fcn.Evaluate(xfA, xfB) - target; + + printf("%g %g\n", x, f); + + xs[i] = x; + fs[i] = f; + + x += dx; + } + } +#endif + + // Compute the TOI on the separating axis. We do this by successively + // resolving the deepest point. This loop is bounded by the number of vertices. + bool done = false; + float32 t2 = tMax; + int32 pushBackIter = 0; + for (;;) + { + // Find the deepest point at t2. Store the witness point indices. + int32 indexA, indexB; + float32 s2 = fcn.FindMinSeparation(&indexA, &indexB, t2); + + // Is the final configuration separated? + if (s2 > target + tolerance) + { + // Victory! + output->state = b2TOIOutput::e_separated; + output->t = tMax; + done = true; + break; + } + + // Has the separation reached tolerance? + if (s2 > target - tolerance) + { + // Advance the sweeps + t1 = t2; + break; + } + + // Compute the initial separation of the witness points. + float32 s1 = fcn.Evaluate(indexA, indexB, t1); + + // Check for initial overlap. This might happen if the root finder + // runs out of iterations. + if (s1 < target - tolerance) + { + output->state = b2TOIOutput::e_failed; + output->t = t1; + done = true; + break; + } + + // Check for touching + if (s1 <= target + tolerance) + { + // Victory! t1 should hold the TOI (could be 0.0). + output->state = b2TOIOutput::e_touching; + output->t = t1; + done = true; + break; + } + + // Compute 1D root of: f(x) - target = 0 + int32 rootIterCount = 0; + float32 a1 = t1, a2 = t2; + for (;;) + { + // Use a mix of the secant rule and bisection. + float32 t; + if (rootIterCount & 1) + { + // Secant rule to improve convergence. + t = a1 + (target - s1) * (a2 - a1) / (s2 - s1); + } + else + { + // Bisection to guarantee progress. + t = 0.5f * (a1 + a2); + } + + float32 s = fcn.Evaluate(indexA, indexB, t); + + if (b2Abs(s - target) < tolerance) + { + // t2 holds a tentative value for t1 + t2 = t; + break; + } + + // Ensure we continue to bracket the root. + if (s > target) + { + a1 = t; + s1 = s; + } + else + { + a2 = t; + s2 = s; + } + + ++rootIterCount; + ++b2_toiRootIters; + + if (rootIterCount == 50) + { + break; + } + } + + b2_toiMaxRootIters = b2Max(b2_toiMaxRootIters, rootIterCount); + + ++pushBackIter; + + if (pushBackIter == b2_maxPolygonVertices) + { + break; + } + } + + ++iter; + ++b2_toiIters; + + if (done) + { + break; + } + + if (iter == k_maxIterations) + { + // Root finder got stuck. Semi-victory. + output->state = b2TOIOutput::e_failed; + output->t = t1; + break; + } + } + + b2_toiMaxIters = b2Max(b2_toiMaxIters, iter); +} diff --git a/src/libraries/Box2D/Collision/b2TimeOfImpact.h b/src/libraries/Box2D/Collision/b2TimeOfImpact.h index 179a1700e..20620c1ee 100755 --- a/src/libraries/Box2D/Collision/b2TimeOfImpact.h +++ b/src/libraries/Box2D/Collision/b2TimeOfImpact.h @@ -1,58 +1,58 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_TIME_OF_IMPACT_H -#define B2_TIME_OF_IMPACT_H - -#include -#include - -/// Input parameters for b2TimeOfImpact -struct b2TOIInput -{ - b2DistanceProxy proxyA; - b2DistanceProxy proxyB; - b2Sweep sweepA; - b2Sweep sweepB; - float32 tMax; // defines sweep interval [0, tMax] -}; - -// Output parameters for b2TimeOfImpact. -struct b2TOIOutput -{ - enum State - { - e_unknown, - e_failed, - e_overlapped, - e_touching, - e_separated - }; - - State state; - float32 t; -}; - -/// Compute the upper bound on time before two shapes penetrate. Time is represented as -/// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, -/// non-tunneling collision. If you change the time interval, you should call this function -/// again. -/// Note: use b2Distance to compute the contact point and normal at the time of impact. -void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_TIME_OF_IMPACT_H +#define B2_TIME_OF_IMPACT_H + +#include +#include + +/// Input parameters for b2TimeOfImpact +struct b2TOIInput +{ + b2DistanceProxy proxyA; + b2DistanceProxy proxyB; + b2Sweep sweepA; + b2Sweep sweepB; + float32 tMax; // defines sweep interval [0, tMax] +}; + +// Output parameters for b2TimeOfImpact. +struct b2TOIOutput +{ + enum State + { + e_unknown, + e_failed, + e_overlapped, + e_touching, + e_separated + }; + + State state; + float32 t; +}; + +/// Compute the upper bound on time before two shapes penetrate. Time is represented as +/// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, +/// non-tunneling collision. If you change the time interval, you should call this function +/// again. +/// Note: use b2Distance to compute the contact point and normal at the time of impact. +void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); + +#endif diff --git a/src/libraries/Box2D/Common/b2BlockAllocator.cpp b/src/libraries/Box2D/Common/b2BlockAllocator.cpp index f5060daa2..d5fa97db9 100755 --- a/src/libraries/Box2D/Common/b2BlockAllocator.cpp +++ b/src/libraries/Box2D/Common/b2BlockAllocator.cpp @@ -1,217 +1,217 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -using namespace std; - -int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = -{ - 16, // 0 - 32, // 1 - 64, // 2 - 96, // 3 - 128, // 4 - 160, // 5 - 192, // 6 - 224, // 7 - 256, // 8 - 320, // 9 - 384, // 10 - 448, // 11 - 512, // 12 - 640, // 13 -}; -uint8 b2BlockAllocator::s_blockSizeLookup[b2_maxBlockSize + 1]; -bool b2BlockAllocator::s_blockSizeLookupInitialized; - -struct b2Chunk -{ - int32 blockSize; - b2Block* blocks; -}; - -struct b2Block -{ - b2Block* next; -}; - -b2BlockAllocator::b2BlockAllocator() -{ - b2Assert(b2_blockSizes < UCHAR_MAX); - - m_chunkSpace = b2_chunkArrayIncrement; - m_chunkCount = 0; - m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); - - memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); - memset(m_freeLists, 0, sizeof(m_freeLists)); - - if (s_blockSizeLookupInitialized == false) - { - int32 j = 0; - for (int32 i = 1; i <= b2_maxBlockSize; ++i) - { - b2Assert(j < b2_blockSizes); - if (i <= s_blockSizes[j]) - { - s_blockSizeLookup[i] = (uint8)j; - } - else - { - ++j; - s_blockSizeLookup[i] = (uint8)j; - } - } - - s_blockSizeLookupInitialized = true; - } -} - -b2BlockAllocator::~b2BlockAllocator() -{ - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Free(m_chunks[i].blocks); - } - - b2Free(m_chunks); -} - -void* b2BlockAllocator::Allocate(int32 size) -{ - if (size == 0) - return NULL; - - b2Assert(0 < size); - - if (size > b2_maxBlockSize) - { - return b2Alloc(size); - } - - int32 index = s_blockSizeLookup[size]; - b2Assert(0 <= index && index < b2_blockSizes); - - if (m_freeLists[index]) - { - b2Block* block = m_freeLists[index]; - m_freeLists[index] = block->next; - return block; - } - else - { - if (m_chunkCount == m_chunkSpace) - { - b2Chunk* oldChunks = m_chunks; - m_chunkSpace += b2_chunkArrayIncrement; - m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); - memcpy(m_chunks, oldChunks, m_chunkCount * sizeof(b2Chunk)); - memset(m_chunks + m_chunkCount, 0, b2_chunkArrayIncrement * sizeof(b2Chunk)); - b2Free(oldChunks); - } - - b2Chunk* chunk = m_chunks + m_chunkCount; - chunk->blocks = (b2Block*)b2Alloc(b2_chunkSize); -#if defined(_DEBUG) - memset(chunk->blocks, 0xcd, b2_chunkSize); -#endif - int32 blockSize = s_blockSizes[index]; - chunk->blockSize = blockSize; - int32 blockCount = b2_chunkSize / blockSize; - b2Assert(blockCount * blockSize <= b2_chunkSize); - for (int32 i = 0; i < blockCount - 1; ++i) - { - b2Block* block = (b2Block*)((int8*)chunk->blocks + blockSize * i); - b2Block* next = (b2Block*)((int8*)chunk->blocks + blockSize * (i + 1)); - block->next = next; - } - b2Block* last = (b2Block*)((int8*)chunk->blocks + blockSize * (blockCount - 1)); - last->next = NULL; - - m_freeLists[index] = chunk->blocks->next; - ++m_chunkCount; - - return chunk->blocks; - } -} - -void b2BlockAllocator::Free(void* p, int32 size) -{ - if (size == 0) - { - return; - } - - b2Assert(0 < size); - - if (size > b2_maxBlockSize) - { - b2Free(p); - return; - } - - int32 index = s_blockSizeLookup[size]; - b2Assert(0 <= index && index < b2_blockSizes); - -#ifdef _DEBUG - // Verify the memory address and size is valid. - int32 blockSize = s_blockSizes[index]; - bool found = false; - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Chunk* chunk = m_chunks + i; - if (chunk->blockSize != blockSize) - { - b2Assert( (int8*)p + blockSize <= (int8*)chunk->blocks || - (int8*)chunk->blocks + b2_chunkSize <= (int8*)p); - } - else - { - if ((int8*)chunk->blocks <= (int8*)p && (int8*)p + blockSize <= (int8*)chunk->blocks + b2_chunkSize) - { - found = true; - } - } - } - - b2Assert(found); - - memset(p, 0xfd, blockSize); -#endif - - b2Block* block = (b2Block*)p; - block->next = m_freeLists[index]; - m_freeLists[index] = block; -} - -void b2BlockAllocator::Clear() -{ - for (int32 i = 0; i < m_chunkCount; ++i) - { - b2Free(m_chunks[i].blocks); - } - - m_chunkCount = 0; - memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); - - memset(m_freeLists, 0, sizeof(m_freeLists)); -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +using namespace std; + +int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = +{ + 16, // 0 + 32, // 1 + 64, // 2 + 96, // 3 + 128, // 4 + 160, // 5 + 192, // 6 + 224, // 7 + 256, // 8 + 320, // 9 + 384, // 10 + 448, // 11 + 512, // 12 + 640, // 13 +}; +uint8 b2BlockAllocator::s_blockSizeLookup[b2_maxBlockSize + 1]; +bool b2BlockAllocator::s_blockSizeLookupInitialized; + +struct b2Chunk +{ + int32 blockSize; + b2Block* blocks; +}; + +struct b2Block +{ + b2Block* next; +}; + +b2BlockAllocator::b2BlockAllocator() +{ + b2Assert(b2_blockSizes < UCHAR_MAX); + + m_chunkSpace = b2_chunkArrayIncrement; + m_chunkCount = 0; + m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); + + memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); + memset(m_freeLists, 0, sizeof(m_freeLists)); + + if (s_blockSizeLookupInitialized == false) + { + int32 j = 0; + for (int32 i = 1; i <= b2_maxBlockSize; ++i) + { + b2Assert(j < b2_blockSizes); + if (i <= s_blockSizes[j]) + { + s_blockSizeLookup[i] = (uint8)j; + } + else + { + ++j; + s_blockSizeLookup[i] = (uint8)j; + } + } + + s_blockSizeLookupInitialized = true; + } +} + +b2BlockAllocator::~b2BlockAllocator() +{ + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Free(m_chunks[i].blocks); + } + + b2Free(m_chunks); +} + +void* b2BlockAllocator::Allocate(int32 size) +{ + if (size == 0) + return NULL; + + b2Assert(0 < size); + + if (size > b2_maxBlockSize) + { + return b2Alloc(size); + } + + int32 index = s_blockSizeLookup[size]; + b2Assert(0 <= index && index < b2_blockSizes); + + if (m_freeLists[index]) + { + b2Block* block = m_freeLists[index]; + m_freeLists[index] = block->next; + return block; + } + else + { + if (m_chunkCount == m_chunkSpace) + { + b2Chunk* oldChunks = m_chunks; + m_chunkSpace += b2_chunkArrayIncrement; + m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); + memcpy(m_chunks, oldChunks, m_chunkCount * sizeof(b2Chunk)); + memset(m_chunks + m_chunkCount, 0, b2_chunkArrayIncrement * sizeof(b2Chunk)); + b2Free(oldChunks); + } + + b2Chunk* chunk = m_chunks + m_chunkCount; + chunk->blocks = (b2Block*)b2Alloc(b2_chunkSize); +#if defined(_DEBUG) + memset(chunk->blocks, 0xcd, b2_chunkSize); +#endif + int32 blockSize = s_blockSizes[index]; + chunk->blockSize = blockSize; + int32 blockCount = b2_chunkSize / blockSize; + b2Assert(blockCount * blockSize <= b2_chunkSize); + for (int32 i = 0; i < blockCount - 1; ++i) + { + b2Block* block = (b2Block*)((int8*)chunk->blocks + blockSize * i); + b2Block* next = (b2Block*)((int8*)chunk->blocks + blockSize * (i + 1)); + block->next = next; + } + b2Block* last = (b2Block*)((int8*)chunk->blocks + blockSize * (blockCount - 1)); + last->next = NULL; + + m_freeLists[index] = chunk->blocks->next; + ++m_chunkCount; + + return chunk->blocks; + } +} + +void b2BlockAllocator::Free(void* p, int32 size) +{ + if (size == 0) + { + return; + } + + b2Assert(0 < size); + + if (size > b2_maxBlockSize) + { + b2Free(p); + return; + } + + int32 index = s_blockSizeLookup[size]; + b2Assert(0 <= index && index < b2_blockSizes); + +#ifdef _DEBUG + // Verify the memory address and size is valid. + int32 blockSize = s_blockSizes[index]; + bool found = false; + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Chunk* chunk = m_chunks + i; + if (chunk->blockSize != blockSize) + { + b2Assert( (int8*)p + blockSize <= (int8*)chunk->blocks || + (int8*)chunk->blocks + b2_chunkSize <= (int8*)p); + } + else + { + if ((int8*)chunk->blocks <= (int8*)p && (int8*)p + blockSize <= (int8*)chunk->blocks + b2_chunkSize) + { + found = true; + } + } + } + + b2Assert(found); + + memset(p, 0xfd, blockSize); +#endif + + b2Block* block = (b2Block*)p; + block->next = m_freeLists[index]; + m_freeLists[index] = block; +} + +void b2BlockAllocator::Clear() +{ + for (int32 i = 0; i < m_chunkCount; ++i) + { + b2Free(m_chunks[i].blocks); + } + + m_chunkCount = 0; + memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); + + memset(m_freeLists, 0, sizeof(m_freeLists)); +} diff --git a/src/libraries/Box2D/Common/b2BlockAllocator.h b/src/libraries/Box2D/Common/b2BlockAllocator.h index 8ba29a5e9..cea3cef96 100755 --- a/src/libraries/Box2D/Common/b2BlockAllocator.h +++ b/src/libraries/Box2D/Common/b2BlockAllocator.h @@ -1,62 +1,62 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BLOCK_ALLOCATOR_H -#define B2_BLOCK_ALLOCATOR_H - -#include - -const int32 b2_chunkSize = 16 * 1024; -const int32 b2_maxBlockSize = 640; -const int32 b2_blockSizes = 14; -const int32 b2_chunkArrayIncrement = 128; - -struct b2Block; -struct b2Chunk; - -/// This is a small object allocator used for allocating small -/// objects that persist for more than one time step. -/// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp -class b2BlockAllocator -{ -public: - b2BlockAllocator(); - ~b2BlockAllocator(); - - /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. - void* Allocate(int32 size); - - /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. - void Free(void* p, int32 size); - - void Clear(); - -private: - - b2Chunk* m_chunks; - int32 m_chunkCount; - int32 m_chunkSpace; - - b2Block* m_freeLists[b2_blockSizes]; - - static int32 s_blockSizes[b2_blockSizes]; - static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; - static bool s_blockSizeLookupInitialized; -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BLOCK_ALLOCATOR_H +#define B2_BLOCK_ALLOCATOR_H + +#include + +const int32 b2_chunkSize = 16 * 1024; +const int32 b2_maxBlockSize = 640; +const int32 b2_blockSizes = 14; +const int32 b2_chunkArrayIncrement = 128; + +struct b2Block; +struct b2Chunk; + +/// This is a small object allocator used for allocating small +/// objects that persist for more than one time step. +/// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp +class b2BlockAllocator +{ +public: + b2BlockAllocator(); + ~b2BlockAllocator(); + + /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. + void* Allocate(int32 size); + + /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. + void Free(void* p, int32 size); + + void Clear(); + +private: + + b2Chunk* m_chunks; + int32 m_chunkCount; + int32 m_chunkSpace; + + b2Block* m_freeLists[b2_blockSizes]; + + static int32 s_blockSizes[b2_blockSizes]; + static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; + static bool s_blockSizeLookupInitialized; +}; + +#endif diff --git a/src/libraries/Box2D/Common/b2Draw.cpp b/src/libraries/Box2D/Common/b2Draw.cpp index 327b58079..2cd9b1a56 100755 --- a/src/libraries/Box2D/Common/b2Draw.cpp +++ b/src/libraries/Box2D/Common/b2Draw.cpp @@ -1,44 +1,44 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -b2Draw::b2Draw() -{ - m_drawFlags = 0; -} - -void b2Draw::SetFlags(uint32 flags) -{ - m_drawFlags = flags; -} - -uint32 b2Draw::GetFlags() const -{ - return m_drawFlags; -} - -void b2Draw::AppendFlags(uint32 flags) -{ - m_drawFlags |= flags; -} - -void b2Draw::ClearFlags(uint32 flags) -{ - m_drawFlags &= ~flags; -} +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +b2Draw::b2Draw() +{ + m_drawFlags = 0; +} + +void b2Draw::SetFlags(uint32 flags) +{ + m_drawFlags = flags; +} + +uint32 b2Draw::GetFlags() const +{ + return m_drawFlags; +} + +void b2Draw::AppendFlags(uint32 flags) +{ + m_drawFlags |= flags; +} + +void b2Draw::ClearFlags(uint32 flags) +{ + m_drawFlags &= ~flags; +} diff --git a/src/libraries/Box2D/Common/b2Draw.h b/src/libraries/Box2D/Common/b2Draw.h index de62dd611..7c4676b50 100755 --- a/src/libraries/Box2D/Common/b2Draw.h +++ b/src/libraries/Box2D/Common/b2Draw.h @@ -1,81 +1,81 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -/// Color for debug drawing. Each value has the range [0,1]. -struct b2Color -{ - b2Color() {} - b2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {} - void Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; } - float32 r, g, b; -}; - -/// Implement and register this class with a b2World to provide debug drawing of physics -/// entities in your game. -class b2Draw -{ -public: - b2Draw(); - - virtual ~b2Draw() {} - - enum - { - e_shapeBit = 0x0001, ///< draw shapes - e_jointBit = 0x0002, ///< draw joint connections - e_aabbBit = 0x0004, ///< draw axis aligned bounding boxes - e_pairBit = 0x0008, ///< draw broad-phase pairs - e_centerOfMassBit = 0x0010 ///< draw center of mass frame - }; - - /// Set the drawing flags. - void SetFlags(uint32 flags); - - /// Get the drawing flags. - uint32 GetFlags() const; - - /// Append flags to the current flags. - void AppendFlags(uint32 flags); - - /// Clear flags from the current flags. - void ClearFlags(uint32 flags); - - /// Draw a closed polygon provided in CCW order. - virtual void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; - - /// Draw a solid closed polygon provided in CCW order. - virtual void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; - - /// Draw a circle. - virtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0; - - /// Draw a solid circle. - virtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0; - - /// Draw a line segment. - virtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0; - - /// Draw a transform. Choose your own length scale. - /// @param xf a transform. - virtual void DrawTransform(const b2Transform& xf) = 0; - -protected: - uint32 m_drawFlags; -}; +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +/// Color for debug drawing. Each value has the range [0,1]. +struct b2Color +{ + b2Color() {} + b2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {} + void Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; } + float32 r, g, b; +}; + +/// Implement and register this class with a b2World to provide debug drawing of physics +/// entities in your game. +class b2Draw +{ +public: + b2Draw(); + + virtual ~b2Draw() {} + + enum + { + e_shapeBit = 0x0001, ///< draw shapes + e_jointBit = 0x0002, ///< draw joint connections + e_aabbBit = 0x0004, ///< draw axis aligned bounding boxes + e_pairBit = 0x0008, ///< draw broad-phase pairs + e_centerOfMassBit = 0x0010 ///< draw center of mass frame + }; + + /// Set the drawing flags. + void SetFlags(uint32 flags); + + /// Get the drawing flags. + uint32 GetFlags() const; + + /// Append flags to the current flags. + void AppendFlags(uint32 flags); + + /// Clear flags from the current flags. + void ClearFlags(uint32 flags); + + /// Draw a closed polygon provided in CCW order. + virtual void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; + + /// Draw a solid closed polygon provided in CCW order. + virtual void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; + + /// Draw a circle. + virtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0; + + /// Draw a solid circle. + virtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0; + + /// Draw a line segment. + virtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0; + + /// Draw a transform. Choose your own length scale. + /// @param xf a transform. + virtual void DrawTransform(const b2Transform& xf) = 0; + +protected: + uint32 m_drawFlags; +}; diff --git a/src/libraries/Box2D/Common/b2GrowableStack.h b/src/libraries/Box2D/Common/b2GrowableStack.h index d2e07120f..27a8eb25d 100755 --- a/src/libraries/Box2D/Common/b2GrowableStack.h +++ b/src/libraries/Box2D/Common/b2GrowableStack.h @@ -1,85 +1,85 @@ -/* -* Copyright (c) 2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_GROWABLE_STACK_H -#define B2_GROWABLE_STACK_H -#include -#include - -/// This is a growable LIFO stack with an initial capacity of N. -/// If the stack size exceeds the initial capacity, the heap is used -/// to increase the size of the stack. -template -class b2GrowableStack -{ -public: - b2GrowableStack() - { - m_stack = m_array; - m_count = 0; - m_capacity = N; - } - - ~b2GrowableStack() - { - if (m_stack != m_array) - { - b2Free(m_stack); - m_stack = NULL; - } - } - - void Push(const T& element) - { - if (m_count == m_capacity) - { - T* old = m_stack; - m_capacity *= 2; - m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); - std::memcpy(m_stack, old, m_count * sizeof(T)); - if (old != m_array) - { - b2Free(old); - } - } - - m_stack[m_count] = element; - ++m_count; - } - - T Pop() - { - b2Assert(m_count > 0); - --m_count; - return m_stack[m_count]; - } - - int32 GetCount() - { - return m_count; - } - -private: - T* m_stack; - T m_array[N]; - int32 m_count; - int32 m_capacity; -}; - - -#endif +/* +* Copyright (c) 2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_GROWABLE_STACK_H +#define B2_GROWABLE_STACK_H +#include +#include + +/// This is a growable LIFO stack with an initial capacity of N. +/// If the stack size exceeds the initial capacity, the heap is used +/// to increase the size of the stack. +template +class b2GrowableStack +{ +public: + b2GrowableStack() + { + m_stack = m_array; + m_count = 0; + m_capacity = N; + } + + ~b2GrowableStack() + { + if (m_stack != m_array) + { + b2Free(m_stack); + m_stack = NULL; + } + } + + void Push(const T& element) + { + if (m_count == m_capacity) + { + T* old = m_stack; + m_capacity *= 2; + m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); + std::memcpy(m_stack, old, m_count * sizeof(T)); + if (old != m_array) + { + b2Free(old); + } + } + + m_stack[m_count] = element; + ++m_count; + } + + T Pop() + { + b2Assert(m_count > 0); + --m_count; + return m_stack[m_count]; + } + + int32 GetCount() + { + return m_count; + } + +private: + T* m_stack; + T m_array[N]; + int32 m_count; + int32 m_capacity; +}; + + +#endif diff --git a/src/libraries/Box2D/Common/b2Math.cpp b/src/libraries/Box2D/Common/b2Math.cpp index 4974fe187..d6027be90 100755 --- a/src/libraries/Box2D/Common/b2Math.cpp +++ b/src/libraries/Box2D/Common/b2Math.cpp @@ -1,94 +1,94 @@ -/* -* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -const b2Vec2 b2Vec2_zero(0.0f, 0.0f); - -/// Solve A * x = b, where b is a column vector. This is more efficient -/// than computing the inverse in one-shot cases. -b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const -{ - float32 det = b2Dot(ex, b2Cross(ey, ez)); - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec3 x; - x.x = det * b2Dot(b, b2Cross(ey, ez)); - x.y = det * b2Dot(ex, b2Cross(b, ez)); - x.z = det * b2Dot(ex, b2Cross(ey, b)); - return x; -} - -/// Solve A * x = b, where b is a column vector. This is more efficient -/// than computing the inverse in one-shot cases. -b2Vec2 b2Mat33::Solve22(const b2Vec2& b) const -{ - float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; - float32 det = a11 * a22 - a12 * a21; - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec2 x; - x.x = det * (a22 * b.x - a12 * b.y); - x.y = det * (a11 * b.y - a21 * b.x); - return x; -} - -/// -void b2Mat33::GetInverse22(b2Mat33* M) const -{ - float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; - float32 det = a * d - b * c; - if (det != 0.0f) - { - det = 1.0f / det; - } - - M->ex.x = det * d; M->ey.x = -det * b; M->ex.z = 0.0f; - M->ex.y = -det * c; M->ey.y = det * a; M->ey.z = 0.0f; - M->ez.x = 0.0f; M->ez.y = 0.0f; M->ez.z = 0.0f; -} - -/// Returns the zero matrix if singular. -void b2Mat33::GetSymInverse33(b2Mat33* M) const -{ - float32 det = b2Dot(ex, b2Cross(ey, ez)); - if (det != 0.0f) - { - det = 1.0f / det; - } - - float32 a11 = ex.x, a12 = ey.x, a13 = ez.x; - float32 a22 = ey.y, a23 = ez.y; - float32 a33 = ez.z; - - M->ex.x = det * (a22 * a33 - a23 * a23); - M->ex.y = det * (a13 * a23 - a12 * a33); - M->ex.z = det * (a12 * a23 - a13 * a22); - - M->ey.x = M->ex.y; - M->ey.y = det * (a11 * a33 - a13 * a13); - M->ey.z = det * (a13 * a12 - a11 * a23); - - M->ez.x = M->ex.z; - M->ez.y = M->ey.z; - M->ez.z = det * (a11 * a22 - a12 * a12); -} +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +const b2Vec2 b2Vec2_zero(0.0f, 0.0f); + +/// Solve A * x = b, where b is a column vector. This is more efficient +/// than computing the inverse in one-shot cases. +b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const +{ + float32 det = b2Dot(ex, b2Cross(ey, ez)); + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec3 x; + x.x = det * b2Dot(b, b2Cross(ey, ez)); + x.y = det * b2Dot(ex, b2Cross(b, ez)); + x.z = det * b2Dot(ex, b2Cross(ey, b)); + return x; +} + +/// Solve A * x = b, where b is a column vector. This is more efficient +/// than computing the inverse in one-shot cases. +b2Vec2 b2Mat33::Solve22(const b2Vec2& b) const +{ + float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; + float32 det = a11 * a22 - a12 * a21; + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec2 x; + x.x = det * (a22 * b.x - a12 * b.y); + x.y = det * (a11 * b.y - a21 * b.x); + return x; +} + +/// +void b2Mat33::GetInverse22(b2Mat33* M) const +{ + float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; + float32 det = a * d - b * c; + if (det != 0.0f) + { + det = 1.0f / det; + } + + M->ex.x = det * d; M->ey.x = -det * b; M->ex.z = 0.0f; + M->ex.y = -det * c; M->ey.y = det * a; M->ey.z = 0.0f; + M->ez.x = 0.0f; M->ez.y = 0.0f; M->ez.z = 0.0f; +} + +/// Returns the zero matrix if singular. +void b2Mat33::GetSymInverse33(b2Mat33* M) const +{ + float32 det = b2Dot(ex, b2Cross(ey, ez)); + if (det != 0.0f) + { + det = 1.0f / det; + } + + float32 a11 = ex.x, a12 = ey.x, a13 = ez.x; + float32 a22 = ey.y, a23 = ez.y; + float32 a33 = ez.z; + + M->ex.x = det * (a22 * a33 - a23 * a23); + M->ex.y = det * (a13 * a23 - a12 * a33); + M->ex.z = det * (a12 * a23 - a13 * a22); + + M->ey.x = M->ex.y; + M->ey.y = det * (a11 * a33 - a13 * a13); + M->ey.z = det * (a13 * a12 - a11 * a23); + + M->ez.x = M->ex.z; + M->ez.y = M->ey.z; + M->ez.z = det * (a11 * a22 - a12 * a12); +} diff --git a/src/libraries/Box2D/Common/b2Math.h b/src/libraries/Box2D/Common/b2Math.h index 9808258bf..11c70707a 100755 --- a/src/libraries/Box2D/Common/b2Math.h +++ b/src/libraries/Box2D/Common/b2Math.h @@ -1,731 +1,731 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_MATH_H -#define B2_MATH_H - -#include - -#include -#include -#include -#include - -/// This function is used to ensure that a floating point number is -/// not a NaN or infinity. -inline bool b2IsValid(float32 x) -{ - if (x != x) - { - // NaN. - return false; - } - - float32 infinity = std::numeric_limits::infinity(); - return -infinity < x && x < infinity; -} - -/// This is a approximate yet fast inverse square-root. -inline float32 b2InvSqrt(float32 x) -{ - union - { - float32 x; - int32 i; - } convert; - - convert.x = x; - float32 xhalf = 0.5f * x; - convert.i = 0x5f3759df - (convert.i >> 1); - x = convert.x; - x = x * (1.5f - xhalf * x * x); - return x; -} - -#define b2Sqrt(x) std::sqrt(x) -#define b2Atan2(y, x) std::atan2(y, x) - -/// A 2D column vector. -struct b2Vec2 -{ - /// Default constructor does nothing (for performance). - b2Vec2() {} - - /// Construct using coordinates. - b2Vec2(float32 x, float32 y) : x(x), y(y) {} - - /// Set this vector to all zeros. - void SetZero() { x = 0.0f; y = 0.0f; } - - /// Set this vector to some specified coordinates. - void Set(float32 x_, float32 y_) { x = x_; y = y_; } - - /// Negate this vector. - b2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; } - - /// Read from and indexed element. - float32 operator () (int32 i) const - { - return (&x)[i]; - } - - /// Write to an indexed element. - float32& operator () (int32 i) - { - return (&x)[i]; - } - - /// Add a vector to this vector. - void operator += (const b2Vec2& v) - { - x += v.x; y += v.y; - } - - /// Subtract a vector from this vector. - void operator -= (const b2Vec2& v) - { - x -= v.x; y -= v.y; - } - - /// Multiply this vector by a scalar. - void operator *= (float32 a) - { - x *= a; y *= a; - } - - /// Get the length of this vector (the norm). - float32 Length() const - { - return b2Sqrt(x * x + y * y); - } - - /// Get the length squared. For performance, use this instead of - /// b2Vec2::Length (if possible). - float32 LengthSquared() const - { - return x * x + y * y; - } - - /// Convert this vector into a unit vector. Returns the length. - float32 Normalize() - { - float32 length = Length(); - if (length < b2_epsilon) - { - return 0.0f; - } - float32 invLength = 1.0f / length; - x *= invLength; - y *= invLength; - - return length; - } - - /// Does this vector contain finite coordinates? - bool IsValid() const - { - return b2IsValid(x) && b2IsValid(y); - } - - /// Get the skew vector such that dot(skew_vec, other) == cross(vec, other) - b2Vec2 Skew() const - { - return b2Vec2(-y, x); - } - - float32 x, y; -}; - -/// A 2D column vector with 3 elements. -struct b2Vec3 -{ - /// Default constructor does nothing (for performance). - b2Vec3() {} - - /// Construct using coordinates. - b2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {} - - /// Set this vector to all zeros. - void SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; } - - /// Set this vector to some specified coordinates. - void Set(float32 x_, float32 y_, float32 z_) { x = x_; y = y_; z = z_; } - - /// Negate this vector. - b2Vec3 operator -() const { b2Vec3 v; v.Set(-x, -y, -z); return v; } - - /// Add a vector to this vector. - void operator += (const b2Vec3& v) - { - x += v.x; y += v.y; z += v.z; - } - - /// Subtract a vector from this vector. - void operator -= (const b2Vec3& v) - { - x -= v.x; y -= v.y; z -= v.z; - } - - /// Multiply this vector by a scalar. - void operator *= (float32 s) - { - x *= s; y *= s; z *= s; - } - - float32 x, y, z; -}; - -/// A 2-by-2 matrix. Stored in column-major order. -struct b2Mat22 -{ - /// The default constructor does nothing (for performance). - b2Mat22() {} - - /// Construct this matrix using columns. - b2Mat22(const b2Vec2& c1, const b2Vec2& c2) - { - ex = c1; - ey = c2; - } - - /// Construct this matrix using scalars. - b2Mat22(float32 a11, float32 a12, float32 a21, float32 a22) - { - ex.x = a11; ex.y = a21; - ey.x = a12; ey.y = a22; - } - - /// Initialize this matrix using columns. - void Set(const b2Vec2& c1, const b2Vec2& c2) - { - ex = c1; - ey = c2; - } - - /// Set this to the identity matrix. - void SetIdentity() - { - ex.x = 1.0f; ey.x = 0.0f; - ex.y = 0.0f; ey.y = 1.0f; - } - - /// Set this matrix to all zeros. - void SetZero() - { - ex.x = 0.0f; ey.x = 0.0f; - ex.y = 0.0f; ey.y = 0.0f; - } - - b2Mat22 GetInverse() const - { - float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; - b2Mat22 B; - float32 det = a * d - b * c; - if (det != 0.0f) - { - det = 1.0f / det; - } - B.ex.x = det * d; B.ey.x = -det * b; - B.ex.y = -det * c; B.ey.y = det * a; - return B; - } - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. - b2Vec2 Solve(const b2Vec2& b) const - { - float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; - float32 det = a11 * a22 - a12 * a21; - if (det != 0.0f) - { - det = 1.0f / det; - } - b2Vec2 x; - x.x = det * (a22 * b.x - a12 * b.y); - x.y = det * (a11 * b.y - a21 * b.x); - return x; - } - - b2Vec2 ex, ey; -}; - -/// A 3-by-3 matrix. Stored in column-major order. -struct b2Mat33 -{ - /// The default constructor does nothing (for performance). - b2Mat33() {} - - /// Construct this matrix using columns. - b2Mat33(const b2Vec3& c1, const b2Vec3& c2, const b2Vec3& c3) - { - ex = c1; - ey = c2; - ez = c3; - } - - /// Set this matrix to all zeros. - void SetZero() - { - ex.SetZero(); - ey.SetZero(); - ez.SetZero(); - } - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. - b2Vec3 Solve33(const b2Vec3& b) const; - - /// Solve A * x = b, where b is a column vector. This is more efficient - /// than computing the inverse in one-shot cases. Solve only the upper - /// 2-by-2 matrix equation. - b2Vec2 Solve22(const b2Vec2& b) const; - - /// Get the inverse of this matrix as a 2-by-2. - /// Returns the zero matrix if singular. - void GetInverse22(b2Mat33* M) const; - - /// Get the symmetric inverse of this matrix as a 3-by-3. - /// Returns the zero matrix if singular. - void GetSymInverse33(b2Mat33* M) const; - - b2Vec3 ex, ey, ez; -}; - -/// Rotation -struct b2Rot -{ - b2Rot() {} - - /// Initialize from an angle in radians - explicit b2Rot(float32 angle) - { - /// TODO_ERIN optimize - s = sinf(angle); - c = cosf(angle); - } - - /// Set using an angle in radians. - void Set(float32 angle) - { - /// TODO_ERIN optimize - s = sinf(angle); - c = cosf(angle); - } - - /// Set to the identity rotation - void SetIdentity() - { - s = 0.0f; - c = 1.0f; - } - - /// Get the angle in radians - float32 GetAngle() const - { - return b2Atan2(s, c); - } - - /// Get the x-axis - b2Vec2 GetXAxis() const - { - return b2Vec2(c, s); - } - - /// Get the u-axis - b2Vec2 GetYAxis() const - { - return b2Vec2(-s, c); - } - - /// Sine and cosine - float32 s, c; -}; - -/// A transform contains translation and rotation. It is used to represent -/// the position and orientation of rigid frames. -struct b2Transform -{ - /// The default constructor does nothing. - b2Transform() {} - - /// Initialize using a position vector and a rotation. - b2Transform(const b2Vec2& position, const b2Rot& rotation) : p(position), q(rotation) {} - - /// Set this to the identity transform. - void SetIdentity() - { - p.SetZero(); - q.SetIdentity(); - } - - /// Set this based on the position and angle. - void Set(const b2Vec2& position, float32 angle) - { - p = position; - q.Set(angle); - } - - b2Vec2 p; - b2Rot q; -}; - -/// This describes the motion of a body/shape for TOI computation. -/// Shapes are defined with respect to the body origin, which may -/// no coincide with the center of mass. However, to support dynamics -/// we must interpolate the center of mass position. -struct b2Sweep -{ - /// Get the interpolated transform at a specific time. - /// @param beta is a factor in [0,1], where 0 indicates alpha0. - void GetTransform(b2Transform* xfb, float32 beta) const; - - /// Advance the sweep forward, yielding a new initial state. - /// @param alpha the new initial time. - void Advance(float32 alpha); - - /// Normalize the angles. - void Normalize(); - - b2Vec2 localCenter; ///< local center of mass position - b2Vec2 c0, c; ///< center world positions - float32 a0, a; ///< world angles - - /// Fraction of the current time step in the range [0,1] - /// c0 and a0 are the positions at alpha0. - float32 alpha0; -}; - -/// Useful constant -extern const b2Vec2 b2Vec2_zero; - -/// Perform the dot product on two vectors. -inline float32 b2Dot(const b2Vec2& a, const b2Vec2& b) -{ - return a.x * b.x + a.y * b.y; -} - -/// Perform the cross product on two vectors. In 2D this produces a scalar. -inline float32 b2Cross(const b2Vec2& a, const b2Vec2& b) -{ - return a.x * b.y - a.y * b.x; -} - -/// Perform the cross product on a vector and a scalar. In 2D this produces -/// a vector. -inline b2Vec2 b2Cross(const b2Vec2& a, float32 s) -{ - return b2Vec2(s * a.y, -s * a.x); -} - -/// Perform the cross product on a scalar and a vector. In 2D this produces -/// a vector. -inline b2Vec2 b2Cross(float32 s, const b2Vec2& a) -{ - return b2Vec2(-s * a.y, s * a.x); -} - -/// Multiply a matrix times a vector. If a rotation matrix is provided, -/// then this transforms the vector from one frame to another. -inline b2Vec2 b2Mul(const b2Mat22& A, const b2Vec2& v) -{ - return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); -} - -/// Multiply a matrix transpose times a vector. If a rotation matrix is provided, -/// then this transforms the vector from one frame to another (inverse transform). -inline b2Vec2 b2MulT(const b2Mat22& A, const b2Vec2& v) -{ - return b2Vec2(b2Dot(v, A.ex), b2Dot(v, A.ey)); -} - -/// Add two vectors component-wise. -inline b2Vec2 operator + (const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(a.x + b.x, a.y + b.y); -} - -/// Subtract two vectors component-wise. -inline b2Vec2 operator - (const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(a.x - b.x, a.y - b.y); -} - -inline b2Vec2 operator * (float32 s, const b2Vec2& a) -{ - return b2Vec2(s * a.x, s * a.y); -} - -inline bool operator == (const b2Vec2& a, const b2Vec2& b) -{ - return a.x == b.x && a.y == b.y; -} - -inline float32 b2Distance(const b2Vec2& a, const b2Vec2& b) -{ - b2Vec2 c = a - b; - return c.Length(); -} - -inline float32 b2DistanceSquared(const b2Vec2& a, const b2Vec2& b) -{ - b2Vec2 c = a - b; - return b2Dot(c, c); -} - -inline b2Vec3 operator * (float32 s, const b2Vec3& a) -{ - return b2Vec3(s * a.x, s * a.y, s * a.z); -} - -/// Add two vectors component-wise. -inline b2Vec3 operator + (const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.x + b.x, a.y + b.y, a.z + b.z); -} - -/// Subtract two vectors component-wise. -inline b2Vec3 operator - (const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.x - b.x, a.y - b.y, a.z - b.z); -} - -/// Perform the dot product on two vectors. -inline float32 b2Dot(const b2Vec3& a, const b2Vec3& b) -{ - return a.x * b.x + a.y * b.y + a.z * b.z; -} - -/// Perform the cross product on two vectors. -inline b2Vec3 b2Cross(const b2Vec3& a, const b2Vec3& b) -{ - return b2Vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); -} - -inline b2Mat22 operator + (const b2Mat22& A, const b2Mat22& B) -{ - return b2Mat22(A.ex + B.ex, A.ey + B.ey); -} - -// A * B -inline b2Mat22 b2Mul(const b2Mat22& A, const b2Mat22& B) -{ - return b2Mat22(b2Mul(A, B.ex), b2Mul(A, B.ey)); -} - -// A^T * B -inline b2Mat22 b2MulT(const b2Mat22& A, const b2Mat22& B) -{ - b2Vec2 c1(b2Dot(A.ex, B.ex), b2Dot(A.ey, B.ex)); - b2Vec2 c2(b2Dot(A.ex, B.ey), b2Dot(A.ey, B.ey)); - return b2Mat22(c1, c2); -} - -/// Multiply a matrix times a vector. -inline b2Vec3 b2Mul(const b2Mat33& A, const b2Vec3& v) -{ - return v.x * A.ex + v.y * A.ey + v.z * A.ez; -} - -/// Multiply a matrix times a vector. -inline b2Vec2 b2Mul22(const b2Mat33& A, const b2Vec2& v) -{ - return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); -} - -/// Multiply two rotations: q * r -inline b2Rot b2Mul(const b2Rot& q, const b2Rot& r) -{ - // [qc -qs] * [rc -rs] = [qc*rc-qs*rs -qc*rs-qs*rc] - // [qs qc] [rs rc] [qs*rc+qc*rs -qs*rs+qc*rc] - // s = qs * rc + qc * rs - // c = qc * rc - qs * rs - b2Rot qr; - qr.s = q.s * r.c + q.c * r.s; - qr.c = q.c * r.c - q.s * r.s; - return qr; -} - -/// Transpose multiply two rotations: qT * r -inline b2Rot b2MulT(const b2Rot& q, const b2Rot& r) -{ - // [ qc qs] * [rc -rs] = [qc*rc+qs*rs -qc*rs+qs*rc] - // [-qs qc] [rs rc] [-qs*rc+qc*rs qs*rs+qc*rc] - // s = qc * rs - qs * rc - // c = qc * rc + qs * rs - b2Rot qr; - qr.s = q.c * r.s - q.s * r.c; - qr.c = q.c * r.c + q.s * r.s; - return qr; -} - -/// Rotate a vector -inline b2Vec2 b2Mul(const b2Rot& q, const b2Vec2& v) -{ - return b2Vec2(q.c * v.x - q.s * v.y, q.s * v.x + q.c * v.y); -} - -/// Inverse rotate a vector -inline b2Vec2 b2MulT(const b2Rot& q, const b2Vec2& v) -{ - return b2Vec2(q.c * v.x + q.s * v.y, -q.s * v.x + q.c * v.y); -} - -inline b2Vec2 b2Mul(const b2Transform& T, const b2Vec2& v) -{ - float32 x = (T.q.c * v.x - T.q.s * v.y) + T.p.x; - float32 y = (T.q.s * v.x + T.q.c * v.y) + T.p.y; - - return b2Vec2(x, y); -} - -inline b2Vec2 b2MulT(const b2Transform& T, const b2Vec2& v) -{ - float32 px = v.x - T.p.x; - float32 py = v.y - T.p.y; - float32 x = (T.q.c * px + T.q.s * py); - float32 y = (-T.q.s * px + T.q.c * py); - - return b2Vec2(x, y); -} - -// v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p -// = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p -inline b2Transform b2Mul(const b2Transform& A, const b2Transform& B) -{ - b2Transform C; - C.q = b2Mul(A.q, B.q); - C.p = b2Mul(A.q, B.p) + A.p; - return C; -} - -// v2 = A.q' * (B.q * v1 + B.p - A.p) -// = A.q' * B.q * v1 + A.q' * (B.p - A.p) -inline b2Transform b2MulT(const b2Transform& A, const b2Transform& B) -{ - b2Transform C; - C.q = b2MulT(A.q, B.q); - C.p = b2MulT(A.q, B.p - A.p); - return C; -} - -template -inline T b2Abs(T a) -{ - return a > T(0) ? a : -a; -} - -inline b2Vec2 b2Abs(const b2Vec2& a) -{ - return b2Vec2(b2Abs(a.x), b2Abs(a.y)); -} - -inline b2Mat22 b2Abs(const b2Mat22& A) -{ - return b2Mat22(b2Abs(A.ex), b2Abs(A.ey)); -} - -template -inline T b2Min(T a, T b) -{ - return a < b ? a : b; -} - -inline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y)); -} - -template -inline T b2Max(T a, T b) -{ - return a > b ? a : b; -} - -inline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b) -{ - return b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y)); -} - -template -inline T b2Clamp(T a, T low, T high) -{ - return b2Max(low, b2Min(a, high)); -} - -inline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high) -{ - return b2Max(low, b2Min(a, high)); -} - -template inline void b2Swap(T& a, T& b) -{ - T tmp = a; - a = b; - b = tmp; -} - -/// "Next Largest Power of 2 -/// Given a binary integer value x, the next largest power of 2 can be computed by a SWAR algorithm -/// that recursively "folds" the upper bits into the lower bits. This process yields a bit vector with -/// the same most significant 1 as x, but all 1's below it. Adding 1 to that value yields the next -/// largest power of 2. For a 32-bit value:" -inline uint32 b2NextPowerOfTwo(uint32 x) -{ - x |= (x >> 1); - x |= (x >> 2); - x |= (x >> 4); - x |= (x >> 8); - x |= (x >> 16); - return x + 1; -} - -inline bool b2IsPowerOfTwo(uint32 x) -{ - bool result = x > 0 && (x & (x - 1)) == 0; - return result; -} - -inline void b2Sweep::GetTransform(b2Transform* xf, float32 beta) const -{ - xf->p = (1.0f - beta) * c0 + beta * c; - float32 angle = (1.0f - beta) * a0 + beta * a; - xf->q.Set(angle); - - // Shift to origin - xf->p -= b2Mul(xf->q, localCenter); -} - -inline void b2Sweep::Advance(float32 alpha) -{ - b2Assert(alpha0 < 1.0f); - float32 beta = (alpha - alpha0) / (1.0f - alpha0); - c0 = (1.0f - beta) * c0 + beta * c; - a0 = (1.0f - beta) * a0 + beta * a; - alpha0 = alpha; -} - -/// Normalize an angle in radians to be between -pi and pi -inline void b2Sweep::Normalize() -{ - float32 twoPi = 2.0f * b2_pi; - float32 d = twoPi * floorf(a0 / twoPi); - a0 -= d; - a -= d; -} - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_MATH_H +#define B2_MATH_H + +#include + +#include +#include +#include +#include + +/// This function is used to ensure that a floating point number is +/// not a NaN or infinity. +inline bool b2IsValid(float32 x) +{ + if (x != x) + { + // NaN. + return false; + } + + float32 infinity = std::numeric_limits::infinity(); + return -infinity < x && x < infinity; +} + +/// This is a approximate yet fast inverse square-root. +inline float32 b2InvSqrt(float32 x) +{ + union + { + float32 x; + int32 i; + } convert; + + convert.x = x; + float32 xhalf = 0.5f * x; + convert.i = 0x5f3759df - (convert.i >> 1); + x = convert.x; + x = x * (1.5f - xhalf * x * x); + return x; +} + +#define b2Sqrt(x) std::sqrt(x) +#define b2Atan2(y, x) std::atan2(y, x) + +/// A 2D column vector. +struct b2Vec2 +{ + /// Default constructor does nothing (for performance). + b2Vec2() {} + + /// Construct using coordinates. + b2Vec2(float32 x, float32 y) : x(x), y(y) {} + + /// Set this vector to all zeros. + void SetZero() { x = 0.0f; y = 0.0f; } + + /// Set this vector to some specified coordinates. + void Set(float32 x_, float32 y_) { x = x_; y = y_; } + + /// Negate this vector. + b2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; } + + /// Read from and indexed element. + float32 operator () (int32 i) const + { + return (&x)[i]; + } + + /// Write to an indexed element. + float32& operator () (int32 i) + { + return (&x)[i]; + } + + /// Add a vector to this vector. + void operator += (const b2Vec2& v) + { + x += v.x; y += v.y; + } + + /// Subtract a vector from this vector. + void operator -= (const b2Vec2& v) + { + x -= v.x; y -= v.y; + } + + /// Multiply this vector by a scalar. + void operator *= (float32 a) + { + x *= a; y *= a; + } + + /// Get the length of this vector (the norm). + float32 Length() const + { + return b2Sqrt(x * x + y * y); + } + + /// Get the length squared. For performance, use this instead of + /// b2Vec2::Length (if possible). + float32 LengthSquared() const + { + return x * x + y * y; + } + + /// Convert this vector into a unit vector. Returns the length. + float32 Normalize() + { + float32 length = Length(); + if (length < b2_epsilon) + { + return 0.0f; + } + float32 invLength = 1.0f / length; + x *= invLength; + y *= invLength; + + return length; + } + + /// Does this vector contain finite coordinates? + bool IsValid() const + { + return b2IsValid(x) && b2IsValid(y); + } + + /// Get the skew vector such that dot(skew_vec, other) == cross(vec, other) + b2Vec2 Skew() const + { + return b2Vec2(-y, x); + } + + float32 x, y; +}; + +/// A 2D column vector with 3 elements. +struct b2Vec3 +{ + /// Default constructor does nothing (for performance). + b2Vec3() {} + + /// Construct using coordinates. + b2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {} + + /// Set this vector to all zeros. + void SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; } + + /// Set this vector to some specified coordinates. + void Set(float32 x_, float32 y_, float32 z_) { x = x_; y = y_; z = z_; } + + /// Negate this vector. + b2Vec3 operator -() const { b2Vec3 v; v.Set(-x, -y, -z); return v; } + + /// Add a vector to this vector. + void operator += (const b2Vec3& v) + { + x += v.x; y += v.y; z += v.z; + } + + /// Subtract a vector from this vector. + void operator -= (const b2Vec3& v) + { + x -= v.x; y -= v.y; z -= v.z; + } + + /// Multiply this vector by a scalar. + void operator *= (float32 s) + { + x *= s; y *= s; z *= s; + } + + float32 x, y, z; +}; + +/// A 2-by-2 matrix. Stored in column-major order. +struct b2Mat22 +{ + /// The default constructor does nothing (for performance). + b2Mat22() {} + + /// Construct this matrix using columns. + b2Mat22(const b2Vec2& c1, const b2Vec2& c2) + { + ex = c1; + ey = c2; + } + + /// Construct this matrix using scalars. + b2Mat22(float32 a11, float32 a12, float32 a21, float32 a22) + { + ex.x = a11; ex.y = a21; + ey.x = a12; ey.y = a22; + } + + /// Initialize this matrix using columns. + void Set(const b2Vec2& c1, const b2Vec2& c2) + { + ex = c1; + ey = c2; + } + + /// Set this to the identity matrix. + void SetIdentity() + { + ex.x = 1.0f; ey.x = 0.0f; + ex.y = 0.0f; ey.y = 1.0f; + } + + /// Set this matrix to all zeros. + void SetZero() + { + ex.x = 0.0f; ey.x = 0.0f; + ex.y = 0.0f; ey.y = 0.0f; + } + + b2Mat22 GetInverse() const + { + float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; + b2Mat22 B; + float32 det = a * d - b * c; + if (det != 0.0f) + { + det = 1.0f / det; + } + B.ex.x = det * d; B.ey.x = -det * b; + B.ex.y = -det * c; B.ey.y = det * a; + return B; + } + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. + b2Vec2 Solve(const b2Vec2& b) const + { + float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; + float32 det = a11 * a22 - a12 * a21; + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec2 x; + x.x = det * (a22 * b.x - a12 * b.y); + x.y = det * (a11 * b.y - a21 * b.x); + return x; + } + + b2Vec2 ex, ey; +}; + +/// A 3-by-3 matrix. Stored in column-major order. +struct b2Mat33 +{ + /// The default constructor does nothing (for performance). + b2Mat33() {} + + /// Construct this matrix using columns. + b2Mat33(const b2Vec3& c1, const b2Vec3& c2, const b2Vec3& c3) + { + ex = c1; + ey = c2; + ez = c3; + } + + /// Set this matrix to all zeros. + void SetZero() + { + ex.SetZero(); + ey.SetZero(); + ez.SetZero(); + } + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. + b2Vec3 Solve33(const b2Vec3& b) const; + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. Solve only the upper + /// 2-by-2 matrix equation. + b2Vec2 Solve22(const b2Vec2& b) const; + + /// Get the inverse of this matrix as a 2-by-2. + /// Returns the zero matrix if singular. + void GetInverse22(b2Mat33* M) const; + + /// Get the symmetric inverse of this matrix as a 3-by-3. + /// Returns the zero matrix if singular. + void GetSymInverse33(b2Mat33* M) const; + + b2Vec3 ex, ey, ez; +}; + +/// Rotation +struct b2Rot +{ + b2Rot() {} + + /// Initialize from an angle in radians + explicit b2Rot(float32 angle) + { + /// TODO_ERIN optimize + s = sinf(angle); + c = cosf(angle); + } + + /// Set using an angle in radians. + void Set(float32 angle) + { + /// TODO_ERIN optimize + s = sinf(angle); + c = cosf(angle); + } + + /// Set to the identity rotation + void SetIdentity() + { + s = 0.0f; + c = 1.0f; + } + + /// Get the angle in radians + float32 GetAngle() const + { + return b2Atan2(s, c); + } + + /// Get the x-axis + b2Vec2 GetXAxis() const + { + return b2Vec2(c, s); + } + + /// Get the u-axis + b2Vec2 GetYAxis() const + { + return b2Vec2(-s, c); + } + + /// Sine and cosine + float32 s, c; +}; + +/// A transform contains translation and rotation. It is used to represent +/// the position and orientation of rigid frames. +struct b2Transform +{ + /// The default constructor does nothing. + b2Transform() {} + + /// Initialize using a position vector and a rotation. + b2Transform(const b2Vec2& position, const b2Rot& rotation) : p(position), q(rotation) {} + + /// Set this to the identity transform. + void SetIdentity() + { + p.SetZero(); + q.SetIdentity(); + } + + /// Set this based on the position and angle. + void Set(const b2Vec2& position, float32 angle) + { + p = position; + q.Set(angle); + } + + b2Vec2 p; + b2Rot q; +}; + +/// This describes the motion of a body/shape for TOI computation. +/// Shapes are defined with respect to the body origin, which may +/// no coincide with the center of mass. However, to support dynamics +/// we must interpolate the center of mass position. +struct b2Sweep +{ + /// Get the interpolated transform at a specific time. + /// @param beta is a factor in [0,1], where 0 indicates alpha0. + void GetTransform(b2Transform* xfb, float32 beta) const; + + /// Advance the sweep forward, yielding a new initial state. + /// @param alpha the new initial time. + void Advance(float32 alpha); + + /// Normalize the angles. + void Normalize(); + + b2Vec2 localCenter; ///< local center of mass position + b2Vec2 c0, c; ///< center world positions + float32 a0, a; ///< world angles + + /// Fraction of the current time step in the range [0,1] + /// c0 and a0 are the positions at alpha0. + float32 alpha0; +}; + +/// Useful constant +extern const b2Vec2 b2Vec2_zero; + +/// Perform the dot product on two vectors. +inline float32 b2Dot(const b2Vec2& a, const b2Vec2& b) +{ + return a.x * b.x + a.y * b.y; +} + +/// Perform the cross product on two vectors. In 2D this produces a scalar. +inline float32 b2Cross(const b2Vec2& a, const b2Vec2& b) +{ + return a.x * b.y - a.y * b.x; +} + +/// Perform the cross product on a vector and a scalar. In 2D this produces +/// a vector. +inline b2Vec2 b2Cross(const b2Vec2& a, float32 s) +{ + return b2Vec2(s * a.y, -s * a.x); +} + +/// Perform the cross product on a scalar and a vector. In 2D this produces +/// a vector. +inline b2Vec2 b2Cross(float32 s, const b2Vec2& a) +{ + return b2Vec2(-s * a.y, s * a.x); +} + +/// Multiply a matrix times a vector. If a rotation matrix is provided, +/// then this transforms the vector from one frame to another. +inline b2Vec2 b2Mul(const b2Mat22& A, const b2Vec2& v) +{ + return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); +} + +/// Multiply a matrix transpose times a vector. If a rotation matrix is provided, +/// then this transforms the vector from one frame to another (inverse transform). +inline b2Vec2 b2MulT(const b2Mat22& A, const b2Vec2& v) +{ + return b2Vec2(b2Dot(v, A.ex), b2Dot(v, A.ey)); +} + +/// Add two vectors component-wise. +inline b2Vec2 operator + (const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(a.x + b.x, a.y + b.y); +} + +/// Subtract two vectors component-wise. +inline b2Vec2 operator - (const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(a.x - b.x, a.y - b.y); +} + +inline b2Vec2 operator * (float32 s, const b2Vec2& a) +{ + return b2Vec2(s * a.x, s * a.y); +} + +inline bool operator == (const b2Vec2& a, const b2Vec2& b) +{ + return a.x == b.x && a.y == b.y; +} + +inline float32 b2Distance(const b2Vec2& a, const b2Vec2& b) +{ + b2Vec2 c = a - b; + return c.Length(); +} + +inline float32 b2DistanceSquared(const b2Vec2& a, const b2Vec2& b) +{ + b2Vec2 c = a - b; + return b2Dot(c, c); +} + +inline b2Vec3 operator * (float32 s, const b2Vec3& a) +{ + return b2Vec3(s * a.x, s * a.y, s * a.z); +} + +/// Add two vectors component-wise. +inline b2Vec3 operator + (const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.x + b.x, a.y + b.y, a.z + b.z); +} + +/// Subtract two vectors component-wise. +inline b2Vec3 operator - (const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.x - b.x, a.y - b.y, a.z - b.z); +} + +/// Perform the dot product on two vectors. +inline float32 b2Dot(const b2Vec3& a, const b2Vec3& b) +{ + return a.x * b.x + a.y * b.y + a.z * b.z; +} + +/// Perform the cross product on two vectors. +inline b2Vec3 b2Cross(const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); +} + +inline b2Mat22 operator + (const b2Mat22& A, const b2Mat22& B) +{ + return b2Mat22(A.ex + B.ex, A.ey + B.ey); +} + +// A * B +inline b2Mat22 b2Mul(const b2Mat22& A, const b2Mat22& B) +{ + return b2Mat22(b2Mul(A, B.ex), b2Mul(A, B.ey)); +} + +// A^T * B +inline b2Mat22 b2MulT(const b2Mat22& A, const b2Mat22& B) +{ + b2Vec2 c1(b2Dot(A.ex, B.ex), b2Dot(A.ey, B.ex)); + b2Vec2 c2(b2Dot(A.ex, B.ey), b2Dot(A.ey, B.ey)); + return b2Mat22(c1, c2); +} + +/// Multiply a matrix times a vector. +inline b2Vec3 b2Mul(const b2Mat33& A, const b2Vec3& v) +{ + return v.x * A.ex + v.y * A.ey + v.z * A.ez; +} + +/// Multiply a matrix times a vector. +inline b2Vec2 b2Mul22(const b2Mat33& A, const b2Vec2& v) +{ + return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); +} + +/// Multiply two rotations: q * r +inline b2Rot b2Mul(const b2Rot& q, const b2Rot& r) +{ + // [qc -qs] * [rc -rs] = [qc*rc-qs*rs -qc*rs-qs*rc] + // [qs qc] [rs rc] [qs*rc+qc*rs -qs*rs+qc*rc] + // s = qs * rc + qc * rs + // c = qc * rc - qs * rs + b2Rot qr; + qr.s = q.s * r.c + q.c * r.s; + qr.c = q.c * r.c - q.s * r.s; + return qr; +} + +/// Transpose multiply two rotations: qT * r +inline b2Rot b2MulT(const b2Rot& q, const b2Rot& r) +{ + // [ qc qs] * [rc -rs] = [qc*rc+qs*rs -qc*rs+qs*rc] + // [-qs qc] [rs rc] [-qs*rc+qc*rs qs*rs+qc*rc] + // s = qc * rs - qs * rc + // c = qc * rc + qs * rs + b2Rot qr; + qr.s = q.c * r.s - q.s * r.c; + qr.c = q.c * r.c + q.s * r.s; + return qr; +} + +/// Rotate a vector +inline b2Vec2 b2Mul(const b2Rot& q, const b2Vec2& v) +{ + return b2Vec2(q.c * v.x - q.s * v.y, q.s * v.x + q.c * v.y); +} + +/// Inverse rotate a vector +inline b2Vec2 b2MulT(const b2Rot& q, const b2Vec2& v) +{ + return b2Vec2(q.c * v.x + q.s * v.y, -q.s * v.x + q.c * v.y); +} + +inline b2Vec2 b2Mul(const b2Transform& T, const b2Vec2& v) +{ + float32 x = (T.q.c * v.x - T.q.s * v.y) + T.p.x; + float32 y = (T.q.s * v.x + T.q.c * v.y) + T.p.y; + + return b2Vec2(x, y); +} + +inline b2Vec2 b2MulT(const b2Transform& T, const b2Vec2& v) +{ + float32 px = v.x - T.p.x; + float32 py = v.y - T.p.y; + float32 x = (T.q.c * px + T.q.s * py); + float32 y = (-T.q.s * px + T.q.c * py); + + return b2Vec2(x, y); +} + +// v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p +// = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p +inline b2Transform b2Mul(const b2Transform& A, const b2Transform& B) +{ + b2Transform C; + C.q = b2Mul(A.q, B.q); + C.p = b2Mul(A.q, B.p) + A.p; + return C; +} + +// v2 = A.q' * (B.q * v1 + B.p - A.p) +// = A.q' * B.q * v1 + A.q' * (B.p - A.p) +inline b2Transform b2MulT(const b2Transform& A, const b2Transform& B) +{ + b2Transform C; + C.q = b2MulT(A.q, B.q); + C.p = b2MulT(A.q, B.p - A.p); + return C; +} + +template +inline T b2Abs(T a) +{ + return a > T(0) ? a : -a; +} + +inline b2Vec2 b2Abs(const b2Vec2& a) +{ + return b2Vec2(b2Abs(a.x), b2Abs(a.y)); +} + +inline b2Mat22 b2Abs(const b2Mat22& A) +{ + return b2Mat22(b2Abs(A.ex), b2Abs(A.ey)); +} + +template +inline T b2Min(T a, T b) +{ + return a < b ? a : b; +} + +inline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y)); +} + +template +inline T b2Max(T a, T b) +{ + return a > b ? a : b; +} + +inline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y)); +} + +template +inline T b2Clamp(T a, T low, T high) +{ + return b2Max(low, b2Min(a, high)); +} + +inline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high) +{ + return b2Max(low, b2Min(a, high)); +} + +template inline void b2Swap(T& a, T& b) +{ + T tmp = a; + a = b; + b = tmp; +} + +/// "Next Largest Power of 2 +/// Given a binary integer value x, the next largest power of 2 can be computed by a SWAR algorithm +/// that recursively "folds" the upper bits into the lower bits. This process yields a bit vector with +/// the same most significant 1 as x, but all 1's below it. Adding 1 to that value yields the next +/// largest power of 2. For a 32-bit value:" +inline uint32 b2NextPowerOfTwo(uint32 x) +{ + x |= (x >> 1); + x |= (x >> 2); + x |= (x >> 4); + x |= (x >> 8); + x |= (x >> 16); + return x + 1; +} + +inline bool b2IsPowerOfTwo(uint32 x) +{ + bool result = x > 0 && (x & (x - 1)) == 0; + return result; +} + +inline void b2Sweep::GetTransform(b2Transform* xf, float32 beta) const +{ + xf->p = (1.0f - beta) * c0 + beta * c; + float32 angle = (1.0f - beta) * a0 + beta * a; + xf->q.Set(angle); + + // Shift to origin + xf->p -= b2Mul(xf->q, localCenter); +} + +inline void b2Sweep::Advance(float32 alpha) +{ + b2Assert(alpha0 < 1.0f); + float32 beta = (alpha - alpha0) / (1.0f - alpha0); + c0 = (1.0f - beta) * c0 + beta * c; + a0 = (1.0f - beta) * a0 + beta * a; + alpha0 = alpha; +} + +/// Normalize an angle in radians to be between -pi and pi +inline void b2Sweep::Normalize() +{ + float32 twoPi = 2.0f * b2_pi; + float32 d = twoPi * floorf(a0 / twoPi); + a0 -= d; + a -= d; +} + +#endif diff --git a/src/libraries/Box2D/Common/b2Settings.cpp b/src/libraries/Box2D/Common/b2Settings.cpp index 82bc23630..416e72c16 100755 --- a/src/libraries/Box2D/Common/b2Settings.cpp +++ b/src/libraries/Box2D/Common/b2Settings.cpp @@ -1,52 +1,52 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include - -#include "common/Exception.h" - -b2Version b2_version = {2, 2, 1}; - -// Memory allocators. Modify these to use your own allocator. -void* b2Alloc(int32 size) -{ - return malloc(size); -} - -void b2Free(void* mem) -{ - free(mem); -} - -// You can modify this to use your logging facility. -void b2Log(const char* string, ...) -{ - va_list args; - va_start(args, string); - vprintf(string, args); - va_end(args); -} - -void loveAssert(bool test, const char *teststr) -{ - if (!test) - throw love::Exception("Box2D error: %s", teststr); -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include + +#include "common/Exception.h" + +b2Version b2_version = {2, 2, 1}; + +// Memory allocators. Modify these to use your own allocator. +void* b2Alloc(int32 size) +{ + return malloc(size); +} + +void b2Free(void* mem) +{ + free(mem); +} + +// You can modify this to use your logging facility. +void b2Log(const char* string, ...) +{ + va_list args; + va_start(args, string); + vprintf(string, args); + va_end(args); +} + +void loveAssert(bool test, const char *teststr) +{ + if (!test) + throw love::Exception("Box2D error: %s", teststr); +} diff --git a/src/libraries/Box2D/Common/b2Settings.h b/src/libraries/Box2D/Common/b2Settings.h index f049fa4de..0eb7a0fa4 100755 --- a/src/libraries/Box2D/Common/b2Settings.h +++ b/src/libraries/Box2D/Common/b2Settings.h @@ -1,153 +1,153 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_SETTINGS_H -#define B2_SETTINGS_H - -#include -#include - -void loveAssert(bool test, const char *teststr); - -#define B2_NOT_USED(x) ((void)(x)) -//#define b2Assert(A) assert(A) -#define b2Assert(A) loveAssert((A), #A) - -typedef signed char int8; -typedef signed short int16; -typedef signed int int32; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; -typedef float float32; -typedef double float64; - -#define b2_maxFloat FLT_MAX -#define b2_epsilon FLT_EPSILON -#define b2_pi 3.14159265359f - -/// @file -/// Global tuning constants based on meters-kilograms-seconds (MKS) units. -/// - -// Collision - -/// The maximum number of contact points between two convex shapes. Do -/// not change this value. -#define b2_maxManifoldPoints 2 - -/// The maximum number of vertices on a convex polygon. You cannot increase -/// this too much because b2BlockAllocator has a maximum object size. -#define b2_maxPolygonVertices 8 - -/// This is used to fatten AABBs in the dynamic tree. This allows proxies -/// to move by a small amount without triggering a tree adjustment. -/// This is in meters. -#define b2_aabbExtension 0.1f - -/// This is used to fatten AABBs in the dynamic tree. This is used to predict -/// the future position based on the current displacement. -/// This is a dimensionless multiplier. -#define b2_aabbMultiplier 2.0f - -/// A small length used as a collision and constraint tolerance. Usually it is -/// chosen to be numerically significant, but visually insignificant. -#define b2_linearSlop 0.005f - -/// A small angle used as a collision and constraint tolerance. Usually it is -/// chosen to be numerically significant, but visually insignificant. -#define b2_angularSlop (2.0f / 180.0f * b2_pi) - -/// The radius of the polygon/edge shape skin. This should not be modified. Making -/// this smaller means polygons will have an insufficient buffer for continuous collision. -/// Making it larger may create artifacts for vertex collision. -#define b2_polygonRadius (2.0f * b2_linearSlop) - -/// Maximum number of sub-steps per contact in continuous physics simulation. -#define b2_maxSubSteps 8 - - -// Dynamics - -/// Maximum number of contacts to be handled to solve a TOI impact. -#define b2_maxTOIContacts 32 - -/// A velocity threshold for elastic collisions. Any collision with a relative linear -/// velocity below this threshold will be treated as inelastic. -#define b2_velocityThreshold 1.0f - -/// The maximum linear position correction used when solving constraints. This helps to -/// prevent overshoot. -#define b2_maxLinearCorrection 0.2f - -/// The maximum angular position correction used when solving constraints. This helps to -/// prevent overshoot. -#define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) - -/// The maximum linear velocity of a body. This limit is very large and is used -/// to prevent numerical problems. You shouldn't need to adjust this. -#define b2_maxTranslation 2.0f -#define b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation) - -/// The maximum angular velocity of a body. This limit is very large and is used -/// to prevent numerical problems. You shouldn't need to adjust this. -#define b2_maxRotation (0.5f * b2_pi) -#define b2_maxRotationSquared (b2_maxRotation * b2_maxRotation) - -/// This scale factor controls how fast overlap is resolved. Ideally this would be 1 so -/// that overlap is removed in one time step. However using values close to 1 often lead -/// to overshoot. -#define b2_baumgarte 0.2f -#define b2_toiBaugarte 0.75f - - -// Sleep - -/// The time that a body must be still before it will go to sleep. -#define b2_timeToSleep 0.5f - -/// A body cannot sleep if its linear velocity is above this tolerance. -#define b2_linearSleepTolerance 0.01f - -/// A body cannot sleep if its angular velocity is above this tolerance. -#define b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) - -// Memory Allocation - -/// Implement this function to use your own memory allocator. -void* b2Alloc(int32 size); - -/// If you implement b2Alloc, you should also implement this function. -void b2Free(void* mem); - -/// Logging function. -void b2Log(const char* string, ...); - -/// Version numbering scheme. -/// See http://en.wikipedia.org/wiki/Software_versioning -struct b2Version -{ - int32 major; ///< significant changes - int32 minor; ///< incremental changes - int32 revision; ///< bug fixes -}; - -/// Current version. -extern b2Version b2_version; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_SETTINGS_H +#define B2_SETTINGS_H + +#include +#include + +void loveAssert(bool test, const char *teststr); + +#define B2_NOT_USED(x) ((void)(x)) +//#define b2Assert(A) assert(A) +#define b2Assert(A) loveAssert((A), #A) + +typedef signed char int8; +typedef signed short int16; +typedef signed int int32; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef float float32; +typedef double float64; + +#define b2_maxFloat FLT_MAX +#define b2_epsilon FLT_EPSILON +#define b2_pi 3.14159265359f + +/// @file +/// Global tuning constants based on meters-kilograms-seconds (MKS) units. +/// + +// Collision + +/// The maximum number of contact points between two convex shapes. Do +/// not change this value. +#define b2_maxManifoldPoints 2 + +/// The maximum number of vertices on a convex polygon. You cannot increase +/// this too much because b2BlockAllocator has a maximum object size. +#define b2_maxPolygonVertices 8 + +/// This is used to fatten AABBs in the dynamic tree. This allows proxies +/// to move by a small amount without triggering a tree adjustment. +/// This is in meters. +#define b2_aabbExtension 0.1f + +/// This is used to fatten AABBs in the dynamic tree. This is used to predict +/// the future position based on the current displacement. +/// This is a dimensionless multiplier. +#define b2_aabbMultiplier 2.0f + +/// A small length used as a collision and constraint tolerance. Usually it is +/// chosen to be numerically significant, but visually insignificant. +#define b2_linearSlop 0.005f + +/// A small angle used as a collision and constraint tolerance. Usually it is +/// chosen to be numerically significant, but visually insignificant. +#define b2_angularSlop (2.0f / 180.0f * b2_pi) + +/// The radius of the polygon/edge shape skin. This should not be modified. Making +/// this smaller means polygons will have an insufficient buffer for continuous collision. +/// Making it larger may create artifacts for vertex collision. +#define b2_polygonRadius (2.0f * b2_linearSlop) + +/// Maximum number of sub-steps per contact in continuous physics simulation. +#define b2_maxSubSteps 8 + + +// Dynamics + +/// Maximum number of contacts to be handled to solve a TOI impact. +#define b2_maxTOIContacts 32 + +/// A velocity threshold for elastic collisions. Any collision with a relative linear +/// velocity below this threshold will be treated as inelastic. +#define b2_velocityThreshold 1.0f + +/// The maximum linear position correction used when solving constraints. This helps to +/// prevent overshoot. +#define b2_maxLinearCorrection 0.2f + +/// The maximum angular position correction used when solving constraints. This helps to +/// prevent overshoot. +#define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) + +/// The maximum linear velocity of a body. This limit is very large and is used +/// to prevent numerical problems. You shouldn't need to adjust this. +#define b2_maxTranslation 2.0f +#define b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation) + +/// The maximum angular velocity of a body. This limit is very large and is used +/// to prevent numerical problems. You shouldn't need to adjust this. +#define b2_maxRotation (0.5f * b2_pi) +#define b2_maxRotationSquared (b2_maxRotation * b2_maxRotation) + +/// This scale factor controls how fast overlap is resolved. Ideally this would be 1 so +/// that overlap is removed in one time step. However using values close to 1 often lead +/// to overshoot. +#define b2_baumgarte 0.2f +#define b2_toiBaugarte 0.75f + + +// Sleep + +/// The time that a body must be still before it will go to sleep. +#define b2_timeToSleep 0.5f + +/// A body cannot sleep if its linear velocity is above this tolerance. +#define b2_linearSleepTolerance 0.01f + +/// A body cannot sleep if its angular velocity is above this tolerance. +#define b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) + +// Memory Allocation + +/// Implement this function to use your own memory allocator. +void* b2Alloc(int32 size); + +/// If you implement b2Alloc, you should also implement this function. +void b2Free(void* mem); + +/// Logging function. +void b2Log(const char* string, ...); + +/// Version numbering scheme. +/// See http://en.wikipedia.org/wiki/Software_versioning +struct b2Version +{ + int32 major; ///< significant changes + int32 minor; ///< incremental changes + int32 revision; ///< bug fixes +}; + +/// Current version. +extern b2Version b2_version; + +#endif diff --git a/src/libraries/Box2D/Common/b2StackAllocator.cpp b/src/libraries/Box2D/Common/b2StackAllocator.cpp index 4a862835b..321cabb23 100755 --- a/src/libraries/Box2D/Common/b2StackAllocator.cpp +++ b/src/libraries/Box2D/Common/b2StackAllocator.cpp @@ -1,83 +1,83 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2StackAllocator::b2StackAllocator() -{ - m_index = 0; - m_allocation = 0; - m_maxAllocation = 0; - m_entryCount = 0; -} - -b2StackAllocator::~b2StackAllocator() -{ - b2Assert(m_index == 0); - b2Assert(m_entryCount == 0); -} - -void* b2StackAllocator::Allocate(int32 size) -{ - b2Assert(m_entryCount < b2_maxStackEntries); - - b2StackEntry* entry = m_entries + m_entryCount; - entry->size = size; - if (m_index + size > b2_stackSize) - { - entry->data = (char*)b2Alloc(size); - entry->usedMalloc = true; - } - else - { - entry->data = m_data + m_index; - entry->usedMalloc = false; - m_index += size; - } - - m_allocation += size; - m_maxAllocation = b2Max(m_maxAllocation, m_allocation); - ++m_entryCount; - - return entry->data; -} - -void b2StackAllocator::Free(void* p) -{ - b2Assert(m_entryCount > 0); - b2StackEntry* entry = m_entries + m_entryCount - 1; - b2Assert(p == entry->data); - if (entry->usedMalloc) - { - b2Free(p); - } - else - { - m_index -= entry->size; - } - m_allocation -= entry->size; - --m_entryCount; - - p = NULL; -} - -int32 b2StackAllocator::GetMaxAllocation() const -{ - return m_maxAllocation; -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2StackAllocator::b2StackAllocator() +{ + m_index = 0; + m_allocation = 0; + m_maxAllocation = 0; + m_entryCount = 0; +} + +b2StackAllocator::~b2StackAllocator() +{ + b2Assert(m_index == 0); + b2Assert(m_entryCount == 0); +} + +void* b2StackAllocator::Allocate(int32 size) +{ + b2Assert(m_entryCount < b2_maxStackEntries); + + b2StackEntry* entry = m_entries + m_entryCount; + entry->size = size; + if (m_index + size > b2_stackSize) + { + entry->data = (char*)b2Alloc(size); + entry->usedMalloc = true; + } + else + { + entry->data = m_data + m_index; + entry->usedMalloc = false; + m_index += size; + } + + m_allocation += size; + m_maxAllocation = b2Max(m_maxAllocation, m_allocation); + ++m_entryCount; + + return entry->data; +} + +void b2StackAllocator::Free(void* p) +{ + b2Assert(m_entryCount > 0); + b2StackEntry* entry = m_entries + m_entryCount - 1; + b2Assert(p == entry->data); + if (entry->usedMalloc) + { + b2Free(p); + } + else + { + m_index -= entry->size; + } + m_allocation -= entry->size; + --m_entryCount; + + p = NULL; +} + +int32 b2StackAllocator::GetMaxAllocation() const +{ + return m_maxAllocation; +} diff --git a/src/libraries/Box2D/Common/b2StackAllocator.h b/src/libraries/Box2D/Common/b2StackAllocator.h index 796c51dfd..bb87a7edc 100755 --- a/src/libraries/Box2D/Common/b2StackAllocator.h +++ b/src/libraries/Box2D/Common/b2StackAllocator.h @@ -1,60 +1,60 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_STACK_ALLOCATOR_H -#define B2_STACK_ALLOCATOR_H - -#include - -const int32 b2_stackSize = 100 * 1024; // 100k -const int32 b2_maxStackEntries = 32; - -struct b2StackEntry -{ - char* data; - int32 size; - bool usedMalloc; -}; - -// This is a stack allocator used for fast per step allocations. -// You must nest allocate/free pairs. The code will assert -// if you try to interleave multiple allocate/free pairs. -class b2StackAllocator -{ -public: - b2StackAllocator(); - ~b2StackAllocator(); - - void* Allocate(int32 size); - void Free(void* p); - - int32 GetMaxAllocation() const; - -private: - - char m_data[b2_stackSize]; - int32 m_index; - - int32 m_allocation; - int32 m_maxAllocation; - - b2StackEntry m_entries[b2_maxStackEntries]; - int32 m_entryCount; -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_STACK_ALLOCATOR_H +#define B2_STACK_ALLOCATOR_H + +#include + +const int32 b2_stackSize = 100 * 1024; // 100k +const int32 b2_maxStackEntries = 32; + +struct b2StackEntry +{ + char* data; + int32 size; + bool usedMalloc; +}; + +// This is a stack allocator used for fast per step allocations. +// You must nest allocate/free pairs. The code will assert +// if you try to interleave multiple allocate/free pairs. +class b2StackAllocator +{ +public: + b2StackAllocator(); + ~b2StackAllocator(); + + void* Allocate(int32 size); + void Free(void* p); + + int32 GetMaxAllocation() const; + +private: + + char m_data[b2_stackSize]; + int32 m_index; + + int32 m_allocation; + int32 m_maxAllocation; + + b2StackEntry m_entries[b2_maxStackEntries]; + int32 m_entryCount; +}; + +#endif diff --git a/src/libraries/Box2D/Common/b2Timer.cpp b/src/libraries/Box2D/Common/b2Timer.cpp index ea3479f11..17cd247d4 100755 --- a/src/libraries/Box2D/Common/b2Timer.cpp +++ b/src/libraries/Box2D/Common/b2Timer.cpp @@ -1,100 +1,100 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -#if defined(_WIN32) - -float64 b2Timer::s_invFrequency = 0.0f; - -#include - -b2Timer::b2Timer() -{ - LARGE_INTEGER largeInteger; - - if (s_invFrequency == 0.0f) - { - QueryPerformanceFrequency(&largeInteger); - s_invFrequency = float64(largeInteger.QuadPart); - if (s_invFrequency > 0.0f) - { - s_invFrequency = 1000.0f / s_invFrequency; - } - } - - QueryPerformanceCounter(&largeInteger); - m_start = float64(largeInteger.QuadPart); -} - -void b2Timer::Reset() -{ - LARGE_INTEGER largeInteger; - QueryPerformanceCounter(&largeInteger); - m_start = float64(largeInteger.QuadPart); -} - -float32 b2Timer::GetMilliseconds() const -{ - LARGE_INTEGER largeInteger; - QueryPerformanceCounter(&largeInteger); - float64 count = float64(largeInteger.QuadPart); - float32 ms = float32(s_invFrequency * (count - m_start)); - return ms; -} - -#elif defined(__linux__) || defined (__APPLE__) - -#include - -b2Timer::b2Timer() -{ - Reset(); -} - -void b2Timer::Reset() -{ - timeval t; - gettimeofday(&t, 0); - m_start_sec = t.tv_sec; - m_start_msec = t.tv_usec * 0.001f; -} - -float32 b2Timer::GetMilliseconds() const -{ - timeval t; - gettimeofday(&t, 0); - return (t.tv_sec - m_start_sec) * 1000 + t.tv_usec * 0.001f - m_start_msec; -} - -#else - -b2Timer::b2Timer() -{ -} - -void b2Timer::Reset() -{ -} - -float32 b2Timer::GetMilliseconds() const -{ - return 0.0f; -} - -#endif +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +#if defined(_WIN32) + +float64 b2Timer::s_invFrequency = 0.0f; + +#include + +b2Timer::b2Timer() +{ + LARGE_INTEGER largeInteger; + + if (s_invFrequency == 0.0f) + { + QueryPerformanceFrequency(&largeInteger); + s_invFrequency = float64(largeInteger.QuadPart); + if (s_invFrequency > 0.0f) + { + s_invFrequency = 1000.0f / s_invFrequency; + } + } + + QueryPerformanceCounter(&largeInteger); + m_start = float64(largeInteger.QuadPart); +} + +void b2Timer::Reset() +{ + LARGE_INTEGER largeInteger; + QueryPerformanceCounter(&largeInteger); + m_start = float64(largeInteger.QuadPart); +} + +float32 b2Timer::GetMilliseconds() const +{ + LARGE_INTEGER largeInteger; + QueryPerformanceCounter(&largeInteger); + float64 count = float64(largeInteger.QuadPart); + float32 ms = float32(s_invFrequency * (count - m_start)); + return ms; +} + +#elif defined(__linux__) || defined (__APPLE__) + +#include + +b2Timer::b2Timer() +{ + Reset(); +} + +void b2Timer::Reset() +{ + timeval t; + gettimeofday(&t, 0); + m_start_sec = t.tv_sec; + m_start_msec = t.tv_usec * 0.001f; +} + +float32 b2Timer::GetMilliseconds() const +{ + timeval t; + gettimeofday(&t, 0); + return (t.tv_sec - m_start_sec) * 1000 + t.tv_usec * 0.001f - m_start_msec; +} + +#else + +b2Timer::b2Timer() +{ +} + +void b2Timer::Reset() +{ +} + +float32 b2Timer::GetMilliseconds() const +{ + return 0.0f; +} + +#endif diff --git a/src/libraries/Box2D/Common/b2Timer.h b/src/libraries/Box2D/Common/b2Timer.h index 19bde287f..b6db8884d 100755 --- a/src/libraries/Box2D/Common/b2Timer.h +++ b/src/libraries/Box2D/Common/b2Timer.h @@ -1,45 +1,45 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -/// Timer for profiling. This has platform specific code and may -/// not work on every platform. -class b2Timer -{ -public: - - /// Constructor - b2Timer(); - - /// Reset the timer. - void Reset(); - - /// Get the time since construction or the last reset. - float32 GetMilliseconds() const; - -private: - -#if defined(_WIN32) - float64 m_start; - static float64 s_invFrequency; -#elif defined(__linux__) || defined (__APPLE__) - unsigned long m_start_sec; - unsigned long m_start_msec; -#endif -}; +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +/// Timer for profiling. This has platform specific code and may +/// not work on every platform. +class b2Timer +{ +public: + + /// Constructor + b2Timer(); + + /// Reset the timer. + void Reset(); + + /// Get the time since construction or the last reset. + float32 GetMilliseconds() const; + +private: + +#if defined(_WIN32) + float64 m_start; + static float64 s_invFrequency; +#elif defined(__linux__) || defined (__APPLE__) + unsigned long m_start_sec; + unsigned long m_start_msec; +#endif +}; diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp index 3886dfd70..81bf68230 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp @@ -1,54 +1,54 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2ChainAndCircleContact)); - return new (mem) b2ChainAndCircleContact(fixtureA, indexA, fixtureB, indexB); -} - -void b2ChainAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2ChainAndCircleContact*)contact)->~b2ChainAndCircleContact(); - allocator->Free(contact, sizeof(b2ChainAndCircleContact)); -} - -b2ChainAndCircleContact::b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) -: b2Contact(fixtureA, indexA, fixtureB, indexB) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2ChainAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); - b2EdgeShape edge; - chain->GetChildEdge(&edge, m_indexA); - b2CollideEdgeAndCircle( manifold, &edge, xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2ChainAndCircleContact)); + return new (mem) b2ChainAndCircleContact(fixtureA, indexA, fixtureB, indexB); +} + +void b2ChainAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2ChainAndCircleContact*)contact)->~b2ChainAndCircleContact(); + allocator->Free(contact, sizeof(b2ChainAndCircleContact)); +} + +b2ChainAndCircleContact::b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) +: b2Contact(fixtureA, indexA, fixtureB, indexB) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2ChainAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); + b2EdgeShape edge; + chain->GetChildEdge(&edge, m_indexA); + b2CollideEdgeAndCircle( manifold, &edge, xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h b/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h index 2dad0b64f..b93c30edc 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h @@ -1,39 +1,39 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H -#define B2_CHAIN_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2ChainAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - ~b2ChainAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H +#define B2_CHAIN_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2ChainAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + ~b2ChainAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp index 02bcaaf6a..0da218786 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp @@ -1,54 +1,54 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2ChainAndPolygonContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2ChainAndPolygonContact)); - return new (mem) b2ChainAndPolygonContact(fixtureA, indexA, fixtureB, indexB); -} - -void b2ChainAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2ChainAndPolygonContact*)contact)->~b2ChainAndPolygonContact(); - allocator->Free(contact, sizeof(b2ChainAndPolygonContact)); -} - -b2ChainAndPolygonContact::b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) -: b2Contact(fixtureA, indexA, fixtureB, indexB) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2ChainAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); - b2EdgeShape edge; - chain->GetChildEdge(&edge, m_indexA); - b2CollideEdgeAndPolygon( manifold, &edge, xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2ChainAndPolygonContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2ChainAndPolygonContact)); + return new (mem) b2ChainAndPolygonContact(fixtureA, indexA, fixtureB, indexB); +} + +void b2ChainAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2ChainAndPolygonContact*)contact)->~b2ChainAndPolygonContact(); + allocator->Free(contact, sizeof(b2ChainAndPolygonContact)); +} + +b2ChainAndPolygonContact::b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) +: b2Contact(fixtureA, indexA, fixtureB, indexB) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2ChainAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); + b2EdgeShape edge; + chain->GetChildEdge(&edge, m_indexA); + b2CollideEdgeAndPolygon( manifold, &edge, xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h b/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h index 8f30ee867..0c09af68a 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h @@ -1,39 +1,39 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CHAIN_AND_POLYGON_CONTACT_H -#define B2_CHAIN_AND_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2ChainAndPolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - ~b2ChainAndPolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_AND_POLYGON_CONTACT_H +#define B2_CHAIN_AND_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2ChainAndPolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + ~b2ChainAndPolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2CircleContact.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2CircleContact.cpp index 584ef2f1f..ade092049 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2CircleContact.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2CircleContact.cpp @@ -1,53 +1,53 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2CircleContact)); - return new (mem) b2CircleContact(fixtureA, fixtureB); -} - -void b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2CircleContact*)contact)->~b2CircleContact(); - allocator->Free(contact, sizeof(b2CircleContact)); -} - -b2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) - : b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_circle); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideCircles(manifold, - (b2CircleShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2CircleContact)); + return new (mem) b2CircleContact(fixtureA, fixtureB); +} + +void b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2CircleContact*)contact)->~b2CircleContact(); + allocator->Free(contact, sizeof(b2CircleContact)); +} + +b2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) + : b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_circle); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideCircles(manifold, + (b2CircleShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2CircleContact.h b/src/libraries/Box2D/Dynamics/Contacts/b2CircleContact.h index aac1f0bd6..079d3abcd 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2CircleContact.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2CircleContact.h @@ -1,39 +1,39 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CIRCLE_CONTACT_H -#define B2_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2CircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2CircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CIRCLE_CONTACT_H +#define B2_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2CircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2CircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2Contact.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2Contact.cpp index 557af7f08..e7e2a2e65 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2Contact.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2Contact.cpp @@ -1,240 +1,240 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -b2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; -bool b2Contact::s_initialized = false; - -void b2Contact::InitializeRegisters() -{ - AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle); - AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle); - AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon); - AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle); - AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon); - AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle); - AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon); -} - -void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn, - b2Shape::Type type1, b2Shape::Type type2) -{ - b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); - b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); - - s_registers[type1][type2].createFcn = createFcn; - s_registers[type1][type2].destroyFcn = destoryFcn; - s_registers[type1][type2].primary = true; - - if (type1 != type2) - { - s_registers[type2][type1].createFcn = createFcn; - s_registers[type2][type1].destroyFcn = destoryFcn; - s_registers[type2][type1].primary = false; - } -} - -b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) -{ - if (s_initialized == false) - { - InitializeRegisters(); - s_initialized = true; - } - - b2Shape::Type type1 = fixtureA->GetType(); - b2Shape::Type type2 = fixtureB->GetType(); - - b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); - b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); - - b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; - if (createFcn) - { - if (s_registers[type1][type2].primary) - { - return createFcn(fixtureA, indexA, fixtureB, indexB, allocator); - } - else - { - return createFcn(fixtureB, indexB, fixtureA, indexA, allocator); - } - } - else - { - return NULL; - } -} - -void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - b2Assert(s_initialized == true); - - if (contact->m_manifold.pointCount > 0) - { - contact->GetFixtureA()->GetBody()->SetAwake(true); - contact->GetFixtureB()->GetBody()->SetAwake(true); - } - - b2Shape::Type typeA = contact->GetFixtureA()->GetType(); - b2Shape::Type typeB = contact->GetFixtureB()->GetType(); - - b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); - b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); - - b2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn; - destroyFcn(contact, allocator); -} - -b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) -{ - m_flags = e_enabledFlag; - - m_fixtureA = fA; - m_fixtureB = fB; - - m_indexA = indexA; - m_indexB = indexB; - - m_manifold.pointCount = 0; - - m_prev = NULL; - m_next = NULL; - - m_nodeA.contact = NULL; - m_nodeA.prev = NULL; - m_nodeA.next = NULL; - m_nodeA.other = NULL; - - m_nodeB.contact = NULL; - m_nodeB.prev = NULL; - m_nodeB.next = NULL; - m_nodeB.other = NULL; - - m_toiCount = 0; - - m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); - m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); -} - -// Update the contact manifold and touching status. -// Note: do not assume the fixture AABBs are overlapping or are valid. -void b2Contact::Update(b2ContactListener* listener) -{ - b2Manifold oldManifold = m_manifold; - - // Re-enable this contact. - m_flags |= e_enabledFlag; - - bool touching = false; - bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; - - bool sensorA = m_fixtureA->IsSensor(); - bool sensorB = m_fixtureB->IsSensor(); - bool sensor = sensorA || sensorB; - - b2Body* bodyA = m_fixtureA->GetBody(); - b2Body* bodyB = m_fixtureB->GetBody(); - const b2Transform& xfA = bodyA->GetTransform(); - const b2Transform& xfB = bodyB->GetTransform(); - - // Is this contact a sensor? - if (sensor) - { - const b2Shape* shapeA = m_fixtureA->GetShape(); - const b2Shape* shapeB = m_fixtureB->GetShape(); - touching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB); - - // Sensors don't generate manifolds. - m_manifold.pointCount = 0; - } - else - { - Evaluate(&m_manifold, xfA, xfB); - touching = m_manifold.pointCount > 0; - - // Match old contact ids to new contact ids and copy the - // stored impulses to warm start the solver. - for (int32 i = 0; i < m_manifold.pointCount; ++i) - { - b2ManifoldPoint* mp2 = m_manifold.points + i; - mp2->normalImpulse = 0.0f; - mp2->tangentImpulse = 0.0f; - b2ContactID id2 = mp2->id; - - for (int32 j = 0; j < oldManifold.pointCount; ++j) - { - b2ManifoldPoint* mp1 = oldManifold.points + j; - - if (mp1->id.key == id2.key) - { - mp2->normalImpulse = mp1->normalImpulse; - mp2->tangentImpulse = mp1->tangentImpulse; - break; - } - } - } - - if (touching != wasTouching) - { - bodyA->SetAwake(true); - bodyB->SetAwake(true); - } - } - - if (touching) - { - m_flags |= e_touchingFlag; - } - else - { - m_flags &= ~e_touchingFlag; - } - - if (wasTouching == false && touching == true && listener) - { - listener->BeginContact(this); - } - - if (wasTouching == true && touching == false && listener) - { - listener->EndContact(this); - } - - if (sensor == false && touching && listener) - { - listener->PreSolve(this, &oldManifold); - } -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +b2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; +bool b2Contact::s_initialized = false; + +void b2Contact::InitializeRegisters() +{ + AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle); + AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle); + AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon); + AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle); + AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon); + AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle); + AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon); +} + +void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn, + b2Shape::Type type1, b2Shape::Type type2) +{ + b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); + b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); + + s_registers[type1][type2].createFcn = createFcn; + s_registers[type1][type2].destroyFcn = destoryFcn; + s_registers[type1][type2].primary = true; + + if (type1 != type2) + { + s_registers[type2][type1].createFcn = createFcn; + s_registers[type2][type1].destroyFcn = destoryFcn; + s_registers[type2][type1].primary = false; + } +} + +b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) +{ + if (s_initialized == false) + { + InitializeRegisters(); + s_initialized = true; + } + + b2Shape::Type type1 = fixtureA->GetType(); + b2Shape::Type type2 = fixtureB->GetType(); + + b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); + b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); + + b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; + if (createFcn) + { + if (s_registers[type1][type2].primary) + { + return createFcn(fixtureA, indexA, fixtureB, indexB, allocator); + } + else + { + return createFcn(fixtureB, indexB, fixtureA, indexA, allocator); + } + } + else + { + return NULL; + } +} + +void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + b2Assert(s_initialized == true); + + if (contact->m_manifold.pointCount > 0) + { + contact->GetFixtureA()->GetBody()->SetAwake(true); + contact->GetFixtureB()->GetBody()->SetAwake(true); + } + + b2Shape::Type typeA = contact->GetFixtureA()->GetType(); + b2Shape::Type typeB = contact->GetFixtureB()->GetType(); + + b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); + b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); + + b2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn; + destroyFcn(contact, allocator); +} + +b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) +{ + m_flags = e_enabledFlag; + + m_fixtureA = fA; + m_fixtureB = fB; + + m_indexA = indexA; + m_indexB = indexB; + + m_manifold.pointCount = 0; + + m_prev = NULL; + m_next = NULL; + + m_nodeA.contact = NULL; + m_nodeA.prev = NULL; + m_nodeA.next = NULL; + m_nodeA.other = NULL; + + m_nodeB.contact = NULL; + m_nodeB.prev = NULL; + m_nodeB.next = NULL; + m_nodeB.other = NULL; + + m_toiCount = 0; + + m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); + m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); +} + +// Update the contact manifold and touching status. +// Note: do not assume the fixture AABBs are overlapping or are valid. +void b2Contact::Update(b2ContactListener* listener) +{ + b2Manifold oldManifold = m_manifold; + + // Re-enable this contact. + m_flags |= e_enabledFlag; + + bool touching = false; + bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; + + bool sensorA = m_fixtureA->IsSensor(); + bool sensorB = m_fixtureB->IsSensor(); + bool sensor = sensorA || sensorB; + + b2Body* bodyA = m_fixtureA->GetBody(); + b2Body* bodyB = m_fixtureB->GetBody(); + const b2Transform& xfA = bodyA->GetTransform(); + const b2Transform& xfB = bodyB->GetTransform(); + + // Is this contact a sensor? + if (sensor) + { + const b2Shape* shapeA = m_fixtureA->GetShape(); + const b2Shape* shapeB = m_fixtureB->GetShape(); + touching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB); + + // Sensors don't generate manifolds. + m_manifold.pointCount = 0; + } + else + { + Evaluate(&m_manifold, xfA, xfB); + touching = m_manifold.pointCount > 0; + + // Match old contact ids to new contact ids and copy the + // stored impulses to warm start the solver. + for (int32 i = 0; i < m_manifold.pointCount; ++i) + { + b2ManifoldPoint* mp2 = m_manifold.points + i; + mp2->normalImpulse = 0.0f; + mp2->tangentImpulse = 0.0f; + b2ContactID id2 = mp2->id; + + for (int32 j = 0; j < oldManifold.pointCount; ++j) + { + b2ManifoldPoint* mp1 = oldManifold.points + j; + + if (mp1->id.key == id2.key) + { + mp2->normalImpulse = mp1->normalImpulse; + mp2->tangentImpulse = mp1->tangentImpulse; + break; + } + } + } + + if (touching != wasTouching) + { + bodyA->SetAwake(true); + bodyB->SetAwake(true); + } + } + + if (touching) + { + m_flags |= e_touchingFlag; + } + else + { + m_flags &= ~e_touchingFlag; + } + + if (wasTouching == false && touching == true && listener) + { + listener->BeginContact(this); + } + + if (wasTouching == true && touching == false && listener) + { + listener->EndContact(this); + } + + if (sensor == false && touching && listener) + { + listener->PreSolve(this, &oldManifold); + } +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2Contact.h b/src/libraries/Box2D/Dynamics/Contacts/b2Contact.h index 7b5a6ab88..f8e74e923 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2Contact.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2Contact.h @@ -1,331 +1,331 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_H -#define B2_CONTACT_H - -#include -#include -#include -#include - -class b2Body; -class b2Contact; -class b2Fixture; -class b2World; -class b2BlockAllocator; -class b2StackAllocator; -class b2ContactListener; - -/// Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. -/// For example, anything slides on ice. -inline float32 b2MixFriction(float32 friction1, float32 friction2) -{ - return std::sqrt(friction1 * friction2); -} - -/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. -/// For example, a superball bounces on anything. -inline float32 b2MixRestitution(float32 restitution1, float32 restitution2) -{ - return restitution1 > restitution2 ? restitution1 : restitution2; -} - -typedef b2Contact* b2ContactCreateFcn( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, - b2BlockAllocator* allocator); -typedef void b2ContactDestroyFcn(b2Contact* contact, b2BlockAllocator* allocator); - -struct b2ContactRegister -{ - b2ContactCreateFcn* createFcn; - b2ContactDestroyFcn* destroyFcn; - bool primary; -}; - -/// A contact edge is used to connect bodies and contacts together -/// in a contact graph where each body is a node and each contact -/// is an edge. A contact edge belongs to a doubly linked list -/// maintained in each attached body. Each contact has two contact -/// nodes, one for each attached body. -struct b2ContactEdge -{ - b2Body* other; ///< provides quick access to the other body attached. - b2Contact* contact; ///< the contact - b2ContactEdge* prev; ///< the previous contact edge in the body's contact list - b2ContactEdge* next; ///< the next contact edge in the body's contact list -}; - -/// The class manages contact between two shapes. A contact exists for each overlapping -/// AABB in the broad-phase (except if filtered). Therefore a contact object may exist -/// that has no contact points. -class b2Contact -{ -public: - - /// Get the contact manifold. Do not modify the manifold unless you understand the - /// internals of Box2D. - b2Manifold* GetManifold(); - const b2Manifold* GetManifold() const; - - /// Get the world manifold. - void GetWorldManifold(b2WorldManifold* worldManifold) const; - - /// Is this contact touching? - bool IsTouching() const; - - /// Enable/disable this contact. This can be used inside the pre-solve - /// contact listener. The contact is only disabled for the current - /// time step (or sub-step in continuous collisions). - void SetEnabled(bool flag); - - /// Has this contact been disabled? - bool IsEnabled() const; - - /// Get the next contact in the world's contact list. - b2Contact* GetNext(); - const b2Contact* GetNext() const; - - /// Get fixture A in this contact. - b2Fixture* GetFixtureA(); - const b2Fixture* GetFixtureA() const; - - /// Get the child primitive index for fixture A. - int32 GetChildIndexA() const; - - /// Get fixture B in this contact. - b2Fixture* GetFixtureB(); - const b2Fixture* GetFixtureB() const; - - /// Get the child primitive index for fixture B. - int32 GetChildIndexB() const; - - /// Override the default friction mixture. You can call this in b2ContactListener::PreSolve. - /// This value persists until set or reset. - void SetFriction(float32 friction); - - /// Get the friction. - float32 GetFriction() const; - - /// Reset the friction mixture to the default value. - void ResetFriction(); - - /// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. - /// The value persists until you set or reset. - void SetRestitution(float32 restitution); - - /// Get the restitution. - float32 GetRestitution() const; - - /// Reset the restitution to the default value. - void ResetRestitution(); - - /// Evaluate this contact with your own manifold and transforms. - virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; - -protected: - friend class b2ContactManager; - friend class b2World; - friend class b2ContactSolver; - friend class b2Body; - friend class b2Fixture; - - // Flags stored in m_flags - enum - { - // Used when crawling contact graph when forming islands. - e_islandFlag = 0x0001, - - // Set when the shapes are touching. - e_touchingFlag = 0x0002, - - // This contact can be disabled (by user) - e_enabledFlag = 0x0004, - - // This contact needs filtering because a fixture filter was changed. - e_filterFlag = 0x0008, - - // This bullet contact had a TOI event - e_bulletHitFlag = 0x0010, - - // This contact has a valid TOI in m_toi - e_toiFlag = 0x0020 - }; - - /// Flag this contact for filtering. Filtering will occur the next time step. - void FlagForFiltering(); - - static void AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn, - b2Shape::Type typeA, b2Shape::Type typeB); - static void InitializeRegisters(); - static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {} - b2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); - virtual ~b2Contact() {} - - void Update(b2ContactListener* listener); - - static b2ContactRegister s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; - static bool s_initialized; - - uint32 m_flags; - - // World pool and list pointers. - b2Contact* m_prev; - b2Contact* m_next; - - // Nodes for connecting bodies. - b2ContactEdge m_nodeA; - b2ContactEdge m_nodeB; - - b2Fixture* m_fixtureA; - b2Fixture* m_fixtureB; - - int32 m_indexA; - int32 m_indexB; - - b2Manifold m_manifold; - - int32 m_toiCount; - float32 m_toi; - - float32 m_friction; - float32 m_restitution; -}; - -inline b2Manifold* b2Contact::GetManifold() -{ - return &m_manifold; -} - -inline const b2Manifold* b2Contact::GetManifold() const -{ - return &m_manifold; -} - -inline void b2Contact::GetWorldManifold(b2WorldManifold* worldManifold) const -{ - const b2Body* bodyA = m_fixtureA->GetBody(); - const b2Body* bodyB = m_fixtureB->GetBody(); - const b2Shape* shapeA = m_fixtureA->GetShape(); - const b2Shape* shapeB = m_fixtureB->GetShape(); - - worldManifold->Initialize(&m_manifold, bodyA->GetTransform(), shapeA->m_radius, bodyB->GetTransform(), shapeB->m_radius); -} - -inline void b2Contact::SetEnabled(bool flag) -{ - if (flag) - { - m_flags |= e_enabledFlag; - } - else - { - m_flags &= ~e_enabledFlag; - } -} - -inline bool b2Contact::IsEnabled() const -{ - return (m_flags & e_enabledFlag) == e_enabledFlag; -} - -inline bool b2Contact::IsTouching() const -{ - return (m_flags & e_touchingFlag) == e_touchingFlag; -} - -inline b2Contact* b2Contact::GetNext() -{ - return m_next; -} - -inline const b2Contact* b2Contact::GetNext() const -{ - return m_next; -} - -inline b2Fixture* b2Contact::GetFixtureA() -{ - return m_fixtureA; -} - -inline const b2Fixture* b2Contact::GetFixtureA() const -{ - return m_fixtureA; -} - -inline b2Fixture* b2Contact::GetFixtureB() -{ - return m_fixtureB; -} - -inline int32 b2Contact::GetChildIndexA() const -{ - return m_indexA; -} - -inline const b2Fixture* b2Contact::GetFixtureB() const -{ - return m_fixtureB; -} - -inline int32 b2Contact::GetChildIndexB() const -{ - return m_indexB; -} - -inline void b2Contact::FlagForFiltering() -{ - m_flags |= e_filterFlag; -} - -inline void b2Contact::SetFriction(float32 friction) -{ - m_friction = friction; -} - -inline float32 b2Contact::GetFriction() const -{ - return m_friction; -} - -inline void b2Contact::ResetFriction() -{ - m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); -} - -inline void b2Contact::SetRestitution(float32 restitution) -{ - m_restitution = restitution; -} - -inline float32 b2Contact::GetRestitution() const -{ - return m_restitution; -} - -inline void b2Contact::ResetRestitution() -{ - m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); -} - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_H +#define B2_CONTACT_H + +#include +#include +#include +#include + +class b2Body; +class b2Contact; +class b2Fixture; +class b2World; +class b2BlockAllocator; +class b2StackAllocator; +class b2ContactListener; + +/// Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. +/// For example, anything slides on ice. +inline float32 b2MixFriction(float32 friction1, float32 friction2) +{ + return std::sqrt(friction1 * friction2); +} + +/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. +/// For example, a superball bounces on anything. +inline float32 b2MixRestitution(float32 restitution1, float32 restitution2) +{ + return restitution1 > restitution2 ? restitution1 : restitution2; +} + +typedef b2Contact* b2ContactCreateFcn( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, + b2BlockAllocator* allocator); +typedef void b2ContactDestroyFcn(b2Contact* contact, b2BlockAllocator* allocator); + +struct b2ContactRegister +{ + b2ContactCreateFcn* createFcn; + b2ContactDestroyFcn* destroyFcn; + bool primary; +}; + +/// A contact edge is used to connect bodies and contacts together +/// in a contact graph where each body is a node and each contact +/// is an edge. A contact edge belongs to a doubly linked list +/// maintained in each attached body. Each contact has two contact +/// nodes, one for each attached body. +struct b2ContactEdge +{ + b2Body* other; ///< provides quick access to the other body attached. + b2Contact* contact; ///< the contact + b2ContactEdge* prev; ///< the previous contact edge in the body's contact list + b2ContactEdge* next; ///< the next contact edge in the body's contact list +}; + +/// The class manages contact between two shapes. A contact exists for each overlapping +/// AABB in the broad-phase (except if filtered). Therefore a contact object may exist +/// that has no contact points. +class b2Contact +{ +public: + + /// Get the contact manifold. Do not modify the manifold unless you understand the + /// internals of Box2D. + b2Manifold* GetManifold(); + const b2Manifold* GetManifold() const; + + /// Get the world manifold. + void GetWorldManifold(b2WorldManifold* worldManifold) const; + + /// Is this contact touching? + bool IsTouching() const; + + /// Enable/disable this contact. This can be used inside the pre-solve + /// contact listener. The contact is only disabled for the current + /// time step (or sub-step in continuous collisions). + void SetEnabled(bool flag); + + /// Has this contact been disabled? + bool IsEnabled() const; + + /// Get the next contact in the world's contact list. + b2Contact* GetNext(); + const b2Contact* GetNext() const; + + /// Get fixture A in this contact. + b2Fixture* GetFixtureA(); + const b2Fixture* GetFixtureA() const; + + /// Get the child primitive index for fixture A. + int32 GetChildIndexA() const; + + /// Get fixture B in this contact. + b2Fixture* GetFixtureB(); + const b2Fixture* GetFixtureB() const; + + /// Get the child primitive index for fixture B. + int32 GetChildIndexB() const; + + /// Override the default friction mixture. You can call this in b2ContactListener::PreSolve. + /// This value persists until set or reset. + void SetFriction(float32 friction); + + /// Get the friction. + float32 GetFriction() const; + + /// Reset the friction mixture to the default value. + void ResetFriction(); + + /// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. + /// The value persists until you set or reset. + void SetRestitution(float32 restitution); + + /// Get the restitution. + float32 GetRestitution() const; + + /// Reset the restitution to the default value. + void ResetRestitution(); + + /// Evaluate this contact with your own manifold and transforms. + virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; + +protected: + friend class b2ContactManager; + friend class b2World; + friend class b2ContactSolver; + friend class b2Body; + friend class b2Fixture; + + // Flags stored in m_flags + enum + { + // Used when crawling contact graph when forming islands. + e_islandFlag = 0x0001, + + // Set when the shapes are touching. + e_touchingFlag = 0x0002, + + // This contact can be disabled (by user) + e_enabledFlag = 0x0004, + + // This contact needs filtering because a fixture filter was changed. + e_filterFlag = 0x0008, + + // This bullet contact had a TOI event + e_bulletHitFlag = 0x0010, + + // This contact has a valid TOI in m_toi + e_toiFlag = 0x0020 + }; + + /// Flag this contact for filtering. Filtering will occur the next time step. + void FlagForFiltering(); + + static void AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn, + b2Shape::Type typeA, b2Shape::Type typeB); + static void InitializeRegisters(); + static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {} + b2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + virtual ~b2Contact() {} + + void Update(b2ContactListener* listener); + + static b2ContactRegister s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; + static bool s_initialized; + + uint32 m_flags; + + // World pool and list pointers. + b2Contact* m_prev; + b2Contact* m_next; + + // Nodes for connecting bodies. + b2ContactEdge m_nodeA; + b2ContactEdge m_nodeB; + + b2Fixture* m_fixtureA; + b2Fixture* m_fixtureB; + + int32 m_indexA; + int32 m_indexB; + + b2Manifold m_manifold; + + int32 m_toiCount; + float32 m_toi; + + float32 m_friction; + float32 m_restitution; +}; + +inline b2Manifold* b2Contact::GetManifold() +{ + return &m_manifold; +} + +inline const b2Manifold* b2Contact::GetManifold() const +{ + return &m_manifold; +} + +inline void b2Contact::GetWorldManifold(b2WorldManifold* worldManifold) const +{ + const b2Body* bodyA = m_fixtureA->GetBody(); + const b2Body* bodyB = m_fixtureB->GetBody(); + const b2Shape* shapeA = m_fixtureA->GetShape(); + const b2Shape* shapeB = m_fixtureB->GetShape(); + + worldManifold->Initialize(&m_manifold, bodyA->GetTransform(), shapeA->m_radius, bodyB->GetTransform(), shapeB->m_radius); +} + +inline void b2Contact::SetEnabled(bool flag) +{ + if (flag) + { + m_flags |= e_enabledFlag; + } + else + { + m_flags &= ~e_enabledFlag; + } +} + +inline bool b2Contact::IsEnabled() const +{ + return (m_flags & e_enabledFlag) == e_enabledFlag; +} + +inline bool b2Contact::IsTouching() const +{ + return (m_flags & e_touchingFlag) == e_touchingFlag; +} + +inline b2Contact* b2Contact::GetNext() +{ + return m_next; +} + +inline const b2Contact* b2Contact::GetNext() const +{ + return m_next; +} + +inline b2Fixture* b2Contact::GetFixtureA() +{ + return m_fixtureA; +} + +inline const b2Fixture* b2Contact::GetFixtureA() const +{ + return m_fixtureA; +} + +inline b2Fixture* b2Contact::GetFixtureB() +{ + return m_fixtureB; +} + +inline int32 b2Contact::GetChildIndexA() const +{ + return m_indexA; +} + +inline const b2Fixture* b2Contact::GetFixtureB() const +{ + return m_fixtureB; +} + +inline int32 b2Contact::GetChildIndexB() const +{ + return m_indexB; +} + +inline void b2Contact::FlagForFiltering() +{ + m_flags |= e_filterFlag; +} + +inline void b2Contact::SetFriction(float32 friction) +{ + m_friction = friction; +} + +inline float32 b2Contact::GetFriction() const +{ + return m_friction; +} + +inline void b2Contact::ResetFriction() +{ + m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); +} + +inline void b2Contact::SetRestitution(float32 restitution) +{ + m_restitution = restitution; +} + +inline float32 b2Contact::GetRestitution() const +{ + return m_restitution; +} + +inline void b2Contact::ResetRestitution() +{ + m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); +} + +#endif diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2ContactSolver.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2ContactSolver.cpp index c990d7fb8..4e510a620 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2ContactSolver.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2ContactSolver.cpp @@ -1,832 +1,832 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include - -#include -#include -#include -#include -#include - -#define B2_DEBUG_SOLVER 0 - -struct b2ContactPositionConstraint -{ - b2Vec2 localPoints[b2_maxManifoldPoints]; - b2Vec2 localNormal; - b2Vec2 localPoint; - int32 indexA; - int32 indexB; - float32 invMassA, invMassB; - b2Vec2 localCenterA, localCenterB; - float32 invIA, invIB; - b2Manifold::Type type; - float32 radiusA, radiusB; - int32 pointCount; -}; - -b2ContactSolver::b2ContactSolver(b2ContactSolverDef* def) -{ - m_step = def->step; - m_allocator = def->allocator; - m_count = def->count; - m_positionConstraints = (b2ContactPositionConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactPositionConstraint)); - m_velocityConstraints = (b2ContactVelocityConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactVelocityConstraint)); - m_positions = def->positions; - m_velocities = def->velocities; - m_contacts = def->contacts; - - // Initialize position independent portions of the constraints. - for (int32 i = 0; i < m_count; ++i) - { - b2Contact* contact = m_contacts[i]; - - b2Fixture* fixtureA = contact->m_fixtureA; - b2Fixture* fixtureB = contact->m_fixtureB; - b2Shape* shapeA = fixtureA->GetShape(); - b2Shape* shapeB = fixtureB->GetShape(); - float32 radiusA = shapeA->m_radius; - float32 radiusB = shapeB->m_radius; - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - b2Manifold* manifold = contact->GetManifold(); - - int32 pointCount = manifold->pointCount; - b2Assert(pointCount > 0); - - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - vc->friction = contact->m_friction; - vc->restitution = contact->m_restitution; - vc->indexA = bodyA->m_islandIndex; - vc->indexB = bodyB->m_islandIndex; - vc->invMassA = bodyA->m_invMass; - vc->invMassB = bodyB->m_invMass; - vc->invIA = bodyA->m_invI; - vc->invIB = bodyB->m_invI; - vc->contactIndex = i; - vc->pointCount = pointCount; - vc->K.SetZero(); - vc->normalMass.SetZero(); - - b2ContactPositionConstraint* pc = m_positionConstraints + i; - pc->indexA = bodyA->m_islandIndex; - pc->indexB = bodyB->m_islandIndex; - pc->invMassA = bodyA->m_invMass; - pc->invMassB = bodyB->m_invMass; - pc->localCenterA = bodyA->m_sweep.localCenter; - pc->localCenterB = bodyB->m_sweep.localCenter; - pc->invIA = bodyA->m_invI; - pc->invIB = bodyB->m_invI; - pc->localNormal = manifold->localNormal; - pc->localPoint = manifold->localPoint; - pc->pointCount = pointCount; - pc->radiusA = radiusA; - pc->radiusB = radiusB; - pc->type = manifold->type; - - for (int32 j = 0; j < pointCount; ++j) - { - b2ManifoldPoint* cp = manifold->points + j; - b2VelocityConstraintPoint* vcp = vc->points + j; - - if (m_step.warmStarting) - { - vcp->normalImpulse = m_step.dtRatio * cp->normalImpulse; - vcp->tangentImpulse = m_step.dtRatio * cp->tangentImpulse; - } - else - { - vcp->normalImpulse = 0.0f; - vcp->tangentImpulse = 0.0f; - } - - vcp->rA.SetZero(); - vcp->rB.SetZero(); - vcp->normalMass = 0.0f; - vcp->tangentMass = 0.0f; - vcp->velocityBias = 0.0f; - - pc->localPoints[j] = cp->localPoint; - } - } -} - -b2ContactSolver::~b2ContactSolver() -{ - m_allocator->Free(m_velocityConstraints); - m_allocator->Free(m_positionConstraints); -} - -// Initialize position dependent portions of the velocity constraints. -void b2ContactSolver::InitializeVelocityConstraints() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - float32 radiusA = pc->radiusA; - float32 radiusB = pc->radiusB; - b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - - float32 mA = vc->invMassA; - float32 mB = vc->invMassB; - float32 iA = vc->invIA; - float32 iB = vc->invIB; - b2Vec2 localCenterA = pc->localCenterA; - b2Vec2 localCenterB = pc->localCenterB; - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Assert(manifold->pointCount > 0); - - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2WorldManifold worldManifold; - worldManifold.Initialize(manifold, xfA, radiusA, xfB, radiusB); - - vc->normal = worldManifold.normal; - - int32 pointCount = vc->pointCount; - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - - vcp->rA = worldManifold.points[j] - cA; - vcp->rB = worldManifold.points[j] - cB; - - float32 rnA = b2Cross(vcp->rA, vc->normal); - float32 rnB = b2Cross(vcp->rB, vc->normal); - - float32 kNormal = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - vcp->normalMass = kNormal > 0.0f ? 1.0f / kNormal : 0.0f; - - b2Vec2 tangent = b2Cross(vc->normal, 1.0f); - - float32 rtA = b2Cross(vcp->rA, tangent); - float32 rtB = b2Cross(vcp->rB, tangent); - - float32 kTangent = mA + mB + iA * rtA * rtA + iB * rtB * rtB; - - vcp->tangentMass = kTangent > 0.0f ? 1.0f / kTangent : 0.0f; - - // Setup a velocity bias for restitution. - vcp->velocityBias = 0.0f; - float32 vRel = b2Dot(vc->normal, vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA)); - if (vRel < -b2_velocityThreshold) - { - vcp->velocityBias = -vc->restitution * vRel; - } - } - - // If we have two points, then prepare the block solver. - if (vc->pointCount == 2) - { - b2VelocityConstraintPoint* vcp1 = vc->points + 0; - b2VelocityConstraintPoint* vcp2 = vc->points + 1; - - float32 rn1A = b2Cross(vcp1->rA, vc->normal); - float32 rn1B = b2Cross(vcp1->rB, vc->normal); - float32 rn2A = b2Cross(vcp2->rA, vc->normal); - float32 rn2B = b2Cross(vcp2->rB, vc->normal); - - float32 k11 = mA + mB + iA * rn1A * rn1A + iB * rn1B * rn1B; - float32 k22 = mA + mB + iA * rn2A * rn2A + iB * rn2B * rn2B; - float32 k12 = mA + mB + iA * rn1A * rn2A + iB * rn1B * rn2B; - - // Ensure a reasonable condition number. - const float32 k_maxConditionNumber = 1000.0f; - if (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12)) - { - // K is safe to invert. - vc->K.ex.Set(k11, k12); - vc->K.ey.Set(k12, k22); - vc->normalMass = vc->K.GetInverse(); - } - else - { - // The constraints are redundant, just use one. - // TODO_ERIN use deepest? - vc->pointCount = 1; - } - } - } -} - -void b2ContactSolver::WarmStart() -{ - // Warm start. - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - float32 mA = vc->invMassA; - float32 iA = vc->invIA; - float32 mB = vc->invMassB; - float32 iB = vc->invIB; - int32 pointCount = vc->pointCount; - - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Vec2 normal = vc->normal; - b2Vec2 tangent = b2Cross(normal, 1.0f); - - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - b2Vec2 P = vcp->normalImpulse * normal + vcp->tangentImpulse * tangent; - wA -= iA * b2Cross(vcp->rA, P); - vA -= mA * P; - wB += iB * b2Cross(vcp->rB, P); - vB += mB * P; - } - - m_velocities[indexA].v = vA; - m_velocities[indexA].w = wA; - m_velocities[indexB].v = vB; - m_velocities[indexB].w = wB; - } -} - -void b2ContactSolver::SolveVelocityConstraints() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - - int32 indexA = vc->indexA; - int32 indexB = vc->indexB; - float32 mA = vc->invMassA; - float32 iA = vc->invIA; - float32 mB = vc->invMassB; - float32 iB = vc->invIB; - int32 pointCount = vc->pointCount; - - b2Vec2 vA = m_velocities[indexA].v; - float32 wA = m_velocities[indexA].w; - b2Vec2 vB = m_velocities[indexB].v; - float32 wB = m_velocities[indexB].w; - - b2Vec2 normal = vc->normal; - b2Vec2 tangent = b2Cross(normal, 1.0f); - float32 friction = vc->friction; - - b2Assert(pointCount == 1 || pointCount == 2); - - // Solve tangent constraints first because non-penetration is more important - // than friction. - for (int32 j = 0; j < pointCount; ++j) - { - b2VelocityConstraintPoint* vcp = vc->points + j; - - // Relative velocity at contact - b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); - - // Compute tangent force - float32 vt = b2Dot(dv, tangent); - float32 lambda = vcp->tangentMass * (-vt); - - // b2Clamp the accumulated force - float32 maxFriction = friction * vcp->normalImpulse; - float32 newImpulse = b2Clamp(vcp->tangentImpulse + lambda, -maxFriction, maxFriction); - lambda = newImpulse - vcp->tangentImpulse; - vcp->tangentImpulse = newImpulse; - - // Apply contact impulse - b2Vec2 P = lambda * tangent; - - vA -= mA * P; - wA -= iA * b2Cross(vcp->rA, P); - - vB += mB * P; - wB += iB * b2Cross(vcp->rB, P); - } - - // Solve normal constraints - if (vc->pointCount == 1) - { - b2VelocityConstraintPoint* vcp = vc->points + 0; - - // Relative velocity at contact - b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); - - // Compute normal impulse - float32 vn = b2Dot(dv, normal); - float32 lambda = -vcp->normalMass * (vn - vcp->velocityBias); - - // b2Clamp the accumulated impulse - float32 newImpulse = b2Max(vcp->normalImpulse + lambda, 0.0f); - lambda = newImpulse - vcp->normalImpulse; - vcp->normalImpulse = newImpulse; - - // Apply contact impulse - b2Vec2 P = lambda * normal; - vA -= mA * P; - wA -= iA * b2Cross(vcp->rA, P); - - vB += mB * P; - wB += iB * b2Cross(vcp->rB, P); - } - else - { - // Block solver developed in collaboration with Dirk Gregorius (back in 01/07 on Box2D_Lite). - // Build the mini LCP for this contact patch - // - // vn = A * x + b, vn >= 0, , vn >= 0, x >= 0 and vn_i * x_i = 0 with i = 1..2 - // - // A = J * W * JT and J = ( -n, -r1 x n, n, r2 x n ) - // b = vn0 - velocityBias - // - // The system is solved using the "Total enumeration method" (s. Murty). The complementary constraint vn_i * x_i - // implies that we must have in any solution either vn_i = 0 or x_i = 0. So for the 2D contact problem the cases - // vn1 = 0 and vn2 = 0, x1 = 0 and x2 = 0, x1 = 0 and vn2 = 0, x2 = 0 and vn1 = 0 need to be tested. The first valid - // solution that satisfies the problem is chosen. - // - // In order to account of the accumulated impulse 'a' (because of the iterative nature of the solver which only requires - // that the accumulated impulse is clamped and not the incremental impulse) we change the impulse variable (x_i). - // - // Substitute: - // - // x = a + d - // - // a := old total impulse - // x := new total impulse - // d := incremental impulse - // - // For the current iteration we extend the formula for the incremental impulse - // to compute the new total impulse: - // - // vn = A * d + b - // = A * (x - a) + b - // = A * x + b - A * a - // = A * x + b' - // b' = b - A * a; - - b2VelocityConstraintPoint* cp1 = vc->points + 0; - b2VelocityConstraintPoint* cp2 = vc->points + 1; - - b2Vec2 a(cp1->normalImpulse, cp2->normalImpulse); - b2Assert(a.x >= 0.0f && a.y >= 0.0f); - - // Relative velocity at contact - b2Vec2 dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - b2Vec2 dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - float32 vn1 = b2Dot(dv1, normal); - float32 vn2 = b2Dot(dv2, normal); - - b2Vec2 b; - b.x = vn1 - cp1->velocityBias; - b.y = vn2 - cp2->velocityBias; - - // Compute b' - b -= b2Mul(vc->K, a); - - const float32 k_errorTol = 1e-3f; - B2_NOT_USED(k_errorTol); - - for (;;) - { - // - // Case 1: vn = 0 - // - // 0 = A * x + b' - // - // Solve for x: - // - // x = - inv(A) * b' - // - b2Vec2 x = - b2Mul(vc->normalMass, b); - - if (x.x >= 0.0f && x.y >= 0.0f) - { - // Get the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - vn1 = b2Dot(dv1, normal); - vn2 = b2Dot(dv2, normal); - - b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); - b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); -#endif - break; - } - - // - // Case 2: vn1 = 0 and x2 = 0 - // - // 0 = a11 * x1 + a12 * 0 + b1' - // vn2 = a21 * x1 + a22 * 0 + b2' - // - x.x = - cp1->normalMass * b.x; - x.y = 0.0f; - vn1 = 0.0f; - vn2 = vc->K.ex.y * x.x + b.y; - - if (x.x >= 0.0f && vn2 >= 0.0f) - { - // Get the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); - - // Compute normal velocity - vn1 = b2Dot(dv1, normal); - - b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); -#endif - break; - } - - - // - // Case 3: vn2 = 0 and x1 = 0 - // - // vn1 = a11 * 0 + a12 * x2 + b1' - // 0 = a21 * 0 + a22 * x2 + b2' - // - x.x = 0.0f; - x.y = - cp2->normalMass * b.y; - vn1 = vc->K.ey.x * x.y + b.x; - vn2 = 0.0f; - - if (x.y >= 0.0f && vn1 >= 0.0f) - { - // Resubstitute for the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - -#if B2_DEBUG_SOLVER == 1 - // Postconditions - dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); - - // Compute normal velocity - vn2 = b2Dot(dv2, normal); - - b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); -#endif - break; - } - - // - // Case 4: x1 = 0 and x2 = 0 - // - // vn1 = b1 - // vn2 = b2; - x.x = 0.0f; - x.y = 0.0f; - vn1 = b.x; - vn2 = b.y; - - if (vn1 >= 0.0f && vn2 >= 0.0f ) - { - // Resubstitute for the incremental impulse - b2Vec2 d = x - a; - - // Apply incremental impulse - b2Vec2 P1 = d.x * normal; - b2Vec2 P2 = d.y * normal; - vA -= mA * (P1 + P2); - wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); - - vB += mB * (P1 + P2); - wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); - - // Accumulate - cp1->normalImpulse = x.x; - cp2->normalImpulse = x.y; - - break; - } - - // No solution, give up. This is hit sometimes, but it doesn't seem to matter. - break; - } - } - - m_velocities[indexA].v = vA; - m_velocities[indexA].w = wA; - m_velocities[indexB].v = vB; - m_velocities[indexB].w = wB; - } -} - -void b2ContactSolver::StoreImpulses() -{ - for (int32 i = 0; i < m_count; ++i) - { - b2ContactVelocityConstraint* vc = m_velocityConstraints + i; - b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); - - for (int32 j = 0; j < vc->pointCount; ++j) - { - manifold->points[j].normalImpulse = vc->points[j].normalImpulse; - manifold->points[j].tangentImpulse = vc->points[j].tangentImpulse; - } - } -} - -struct b2PositionSolverManifold -{ - void Initialize(b2ContactPositionConstraint* pc, const b2Transform& xfA, const b2Transform& xfB, int32 index) - { - b2Assert(pc->pointCount > 0); - - switch (pc->type) - { - case b2Manifold::e_circles: - { - b2Vec2 pointA = b2Mul(xfA, pc->localPoint); - b2Vec2 pointB = b2Mul(xfB, pc->localPoints[0]); - normal = pointB - pointA; - normal.Normalize(); - point = 0.5f * (pointA + pointB); - separation = b2Dot(pointB - pointA, normal) - pc->radiusA - pc->radiusB; - } - break; - - case b2Manifold::e_faceA: - { - normal = b2Mul(xfA.q, pc->localNormal); - b2Vec2 planePoint = b2Mul(xfA, pc->localPoint); - - b2Vec2 clipPoint = b2Mul(xfB, pc->localPoints[index]); - separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; - point = clipPoint; - } - break; - - case b2Manifold::e_faceB: - { - normal = b2Mul(xfB.q, pc->localNormal); - b2Vec2 planePoint = b2Mul(xfB, pc->localPoint); - - b2Vec2 clipPoint = b2Mul(xfA, pc->localPoints[index]); - separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; - point = clipPoint; - - // Ensure normal points from A to B - normal = -normal; - } - break; - } - } - - b2Vec2 normal; - b2Vec2 point; - float32 separation; -}; - -// Sequential solver. -bool b2ContactSolver::SolvePositionConstraints() -{ - float32 minSeparation = 0.0f; - - for (int32 i = 0; i < m_count; ++i) - { - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - int32 indexA = pc->indexA; - int32 indexB = pc->indexB; - b2Vec2 localCenterA = pc->localCenterA; - float32 mA = pc->invMassA; - float32 iA = pc->invIA; - b2Vec2 localCenterB = pc->localCenterB; - float32 mB = pc->invMassB; - float32 iB = pc->invIB; - int32 pointCount = pc->pointCount; - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - - // Solve normal constraints - for (int32 j = 0; j < pointCount; ++j) - { - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2PositionSolverManifold psm; - psm.Initialize(pc, xfA, xfB, j); - b2Vec2 normal = psm.normal; - - b2Vec2 point = psm.point; - float32 separation = psm.separation; - - b2Vec2 rA = point - cA; - b2Vec2 rB = point - cB; - - // Track max constraint error. - minSeparation = b2Min(minSeparation, separation); - - // Prevent large corrections and allow slop. - float32 C = b2Clamp(b2_baumgarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); - - // Compute the effective mass. - float32 rnA = b2Cross(rA, normal); - float32 rnB = b2Cross(rB, normal); - float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - // Compute normal impulse - float32 impulse = K > 0.0f ? - C / K : 0.0f; - - b2Vec2 P = impulse * normal; - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - - m_positions[indexA].c = cA; - m_positions[indexA].a = aA; - - m_positions[indexB].c = cB; - m_positions[indexB].a = aB; - } - - // We can't expect minSpeparation >= -b2_linearSlop because we don't - // push the separation above -b2_linearSlop. - return minSeparation >= -3.0f * b2_linearSlop; -} - -// Sequential position solver for position constraints. -bool b2ContactSolver::SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB) -{ - float32 minSeparation = 0.0f; - - for (int32 i = 0; i < m_count; ++i) - { - b2ContactPositionConstraint* pc = m_positionConstraints + i; - - int32 indexA = pc->indexA; - int32 indexB = pc->indexB; - b2Vec2 localCenterA = pc->localCenterA; - b2Vec2 localCenterB = pc->localCenterB; - int32 pointCount = pc->pointCount; - - float32 mA = 0.0f; - float32 iA = 0.0f; - if (indexA == toiIndexA || indexA == toiIndexB) - { - mA = pc->invMassA; - iA = pc->invIA; - } - - float32 mB = pc->invMassB; - float32 iB = pc->invIB; - if (indexB == toiIndexA || indexB == toiIndexB) - { - mB = pc->invMassB; - iB = pc->invIB; - } - - b2Vec2 cA = m_positions[indexA].c; - float32 aA = m_positions[indexA].a; - - b2Vec2 cB = m_positions[indexB].c; - float32 aB = m_positions[indexB].a; - - // Solve normal constraints - for (int32 j = 0; j < pointCount; ++j) - { - b2Transform xfA, xfB; - xfA.q.Set(aA); - xfB.q.Set(aB); - xfA.p = cA - b2Mul(xfA.q, localCenterA); - xfB.p = cB - b2Mul(xfB.q, localCenterB); - - b2PositionSolverManifold psm; - psm.Initialize(pc, xfA, xfB, j); - b2Vec2 normal = psm.normal; - - b2Vec2 point = psm.point; - float32 separation = psm.separation; - - b2Vec2 rA = point - cA; - b2Vec2 rB = point - cB; - - // Track max constraint error. - minSeparation = b2Min(minSeparation, separation); - - // Prevent large corrections and allow slop. - float32 C = b2Clamp(b2_toiBaugarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); - - // Compute the effective mass. - float32 rnA = b2Cross(rA, normal); - float32 rnB = b2Cross(rB, normal); - float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; - - // Compute normal impulse - float32 impulse = K > 0.0f ? - C / K : 0.0f; - - b2Vec2 P = impulse * normal; - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - - m_positions[indexA].c = cA; - m_positions[indexA].a = aA; - - m_positions[indexB].c = cB; - m_positions[indexB].a = aB; - } - - // We can't expect minSpeparation >= -b2_linearSlop because we don't - // push the separation above -b2_linearSlop. - return minSeparation >= -1.5f * b2_linearSlop; -} +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +#include +#include +#include +#include +#include + +#define B2_DEBUG_SOLVER 0 + +struct b2ContactPositionConstraint +{ + b2Vec2 localPoints[b2_maxManifoldPoints]; + b2Vec2 localNormal; + b2Vec2 localPoint; + int32 indexA; + int32 indexB; + float32 invMassA, invMassB; + b2Vec2 localCenterA, localCenterB; + float32 invIA, invIB; + b2Manifold::Type type; + float32 radiusA, radiusB; + int32 pointCount; +}; + +b2ContactSolver::b2ContactSolver(b2ContactSolverDef* def) +{ + m_step = def->step; + m_allocator = def->allocator; + m_count = def->count; + m_positionConstraints = (b2ContactPositionConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactPositionConstraint)); + m_velocityConstraints = (b2ContactVelocityConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactVelocityConstraint)); + m_positions = def->positions; + m_velocities = def->velocities; + m_contacts = def->contacts; + + // Initialize position independent portions of the constraints. + for (int32 i = 0; i < m_count; ++i) + { + b2Contact* contact = m_contacts[i]; + + b2Fixture* fixtureA = contact->m_fixtureA; + b2Fixture* fixtureB = contact->m_fixtureB; + b2Shape* shapeA = fixtureA->GetShape(); + b2Shape* shapeB = fixtureB->GetShape(); + float32 radiusA = shapeA->m_radius; + float32 radiusB = shapeB->m_radius; + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + b2Manifold* manifold = contact->GetManifold(); + + int32 pointCount = manifold->pointCount; + b2Assert(pointCount > 0); + + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + vc->friction = contact->m_friction; + vc->restitution = contact->m_restitution; + vc->indexA = bodyA->m_islandIndex; + vc->indexB = bodyB->m_islandIndex; + vc->invMassA = bodyA->m_invMass; + vc->invMassB = bodyB->m_invMass; + vc->invIA = bodyA->m_invI; + vc->invIB = bodyB->m_invI; + vc->contactIndex = i; + vc->pointCount = pointCount; + vc->K.SetZero(); + vc->normalMass.SetZero(); + + b2ContactPositionConstraint* pc = m_positionConstraints + i; + pc->indexA = bodyA->m_islandIndex; + pc->indexB = bodyB->m_islandIndex; + pc->invMassA = bodyA->m_invMass; + pc->invMassB = bodyB->m_invMass; + pc->localCenterA = bodyA->m_sweep.localCenter; + pc->localCenterB = bodyB->m_sweep.localCenter; + pc->invIA = bodyA->m_invI; + pc->invIB = bodyB->m_invI; + pc->localNormal = manifold->localNormal; + pc->localPoint = manifold->localPoint; + pc->pointCount = pointCount; + pc->radiusA = radiusA; + pc->radiusB = radiusB; + pc->type = manifold->type; + + for (int32 j = 0; j < pointCount; ++j) + { + b2ManifoldPoint* cp = manifold->points + j; + b2VelocityConstraintPoint* vcp = vc->points + j; + + if (m_step.warmStarting) + { + vcp->normalImpulse = m_step.dtRatio * cp->normalImpulse; + vcp->tangentImpulse = m_step.dtRatio * cp->tangentImpulse; + } + else + { + vcp->normalImpulse = 0.0f; + vcp->tangentImpulse = 0.0f; + } + + vcp->rA.SetZero(); + vcp->rB.SetZero(); + vcp->normalMass = 0.0f; + vcp->tangentMass = 0.0f; + vcp->velocityBias = 0.0f; + + pc->localPoints[j] = cp->localPoint; + } + } +} + +b2ContactSolver::~b2ContactSolver() +{ + m_allocator->Free(m_velocityConstraints); + m_allocator->Free(m_positionConstraints); +} + +// Initialize position dependent portions of the velocity constraints. +void b2ContactSolver::InitializeVelocityConstraints() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + float32 radiusA = pc->radiusA; + float32 radiusB = pc->radiusB; + b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + + float32 mA = vc->invMassA; + float32 mB = vc->invMassB; + float32 iA = vc->invIA; + float32 iB = vc->invIB; + b2Vec2 localCenterA = pc->localCenterA; + b2Vec2 localCenterB = pc->localCenterB; + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Assert(manifold->pointCount > 0); + + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2WorldManifold worldManifold; + worldManifold.Initialize(manifold, xfA, radiusA, xfB, radiusB); + + vc->normal = worldManifold.normal; + + int32 pointCount = vc->pointCount; + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + + vcp->rA = worldManifold.points[j] - cA; + vcp->rB = worldManifold.points[j] - cB; + + float32 rnA = b2Cross(vcp->rA, vc->normal); + float32 rnB = b2Cross(vcp->rB, vc->normal); + + float32 kNormal = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + vcp->normalMass = kNormal > 0.0f ? 1.0f / kNormal : 0.0f; + + b2Vec2 tangent = b2Cross(vc->normal, 1.0f); + + float32 rtA = b2Cross(vcp->rA, tangent); + float32 rtB = b2Cross(vcp->rB, tangent); + + float32 kTangent = mA + mB + iA * rtA * rtA + iB * rtB * rtB; + + vcp->tangentMass = kTangent > 0.0f ? 1.0f / kTangent : 0.0f; + + // Setup a velocity bias for restitution. + vcp->velocityBias = 0.0f; + float32 vRel = b2Dot(vc->normal, vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA)); + if (vRel < -b2_velocityThreshold) + { + vcp->velocityBias = -vc->restitution * vRel; + } + } + + // If we have two points, then prepare the block solver. + if (vc->pointCount == 2) + { + b2VelocityConstraintPoint* vcp1 = vc->points + 0; + b2VelocityConstraintPoint* vcp2 = vc->points + 1; + + float32 rn1A = b2Cross(vcp1->rA, vc->normal); + float32 rn1B = b2Cross(vcp1->rB, vc->normal); + float32 rn2A = b2Cross(vcp2->rA, vc->normal); + float32 rn2B = b2Cross(vcp2->rB, vc->normal); + + float32 k11 = mA + mB + iA * rn1A * rn1A + iB * rn1B * rn1B; + float32 k22 = mA + mB + iA * rn2A * rn2A + iB * rn2B * rn2B; + float32 k12 = mA + mB + iA * rn1A * rn2A + iB * rn1B * rn2B; + + // Ensure a reasonable condition number. + const float32 k_maxConditionNumber = 1000.0f; + if (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12)) + { + // K is safe to invert. + vc->K.ex.Set(k11, k12); + vc->K.ey.Set(k12, k22); + vc->normalMass = vc->K.GetInverse(); + } + else + { + // The constraints are redundant, just use one. + // TODO_ERIN use deepest? + vc->pointCount = 1; + } + } + } +} + +void b2ContactSolver::WarmStart() +{ + // Warm start. + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + float32 mA = vc->invMassA; + float32 iA = vc->invIA; + float32 mB = vc->invMassB; + float32 iB = vc->invIB; + int32 pointCount = vc->pointCount; + + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Vec2 normal = vc->normal; + b2Vec2 tangent = b2Cross(normal, 1.0f); + + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + b2Vec2 P = vcp->normalImpulse * normal + vcp->tangentImpulse * tangent; + wA -= iA * b2Cross(vcp->rA, P); + vA -= mA * P; + wB += iB * b2Cross(vcp->rB, P); + vB += mB * P; + } + + m_velocities[indexA].v = vA; + m_velocities[indexA].w = wA; + m_velocities[indexB].v = vB; + m_velocities[indexB].w = wB; + } +} + +void b2ContactSolver::SolveVelocityConstraints() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + + int32 indexA = vc->indexA; + int32 indexB = vc->indexB; + float32 mA = vc->invMassA; + float32 iA = vc->invIA; + float32 mB = vc->invMassB; + float32 iB = vc->invIB; + int32 pointCount = vc->pointCount; + + b2Vec2 vA = m_velocities[indexA].v; + float32 wA = m_velocities[indexA].w; + b2Vec2 vB = m_velocities[indexB].v; + float32 wB = m_velocities[indexB].w; + + b2Vec2 normal = vc->normal; + b2Vec2 tangent = b2Cross(normal, 1.0f); + float32 friction = vc->friction; + + b2Assert(pointCount == 1 || pointCount == 2); + + // Solve tangent constraints first because non-penetration is more important + // than friction. + for (int32 j = 0; j < pointCount; ++j) + { + b2VelocityConstraintPoint* vcp = vc->points + j; + + // Relative velocity at contact + b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); + + // Compute tangent force + float32 vt = b2Dot(dv, tangent); + float32 lambda = vcp->tangentMass * (-vt); + + // b2Clamp the accumulated force + float32 maxFriction = friction * vcp->normalImpulse; + float32 newImpulse = b2Clamp(vcp->tangentImpulse + lambda, -maxFriction, maxFriction); + lambda = newImpulse - vcp->tangentImpulse; + vcp->tangentImpulse = newImpulse; + + // Apply contact impulse + b2Vec2 P = lambda * tangent; + + vA -= mA * P; + wA -= iA * b2Cross(vcp->rA, P); + + vB += mB * P; + wB += iB * b2Cross(vcp->rB, P); + } + + // Solve normal constraints + if (vc->pointCount == 1) + { + b2VelocityConstraintPoint* vcp = vc->points + 0; + + // Relative velocity at contact + b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); + + // Compute normal impulse + float32 vn = b2Dot(dv, normal); + float32 lambda = -vcp->normalMass * (vn - vcp->velocityBias); + + // b2Clamp the accumulated impulse + float32 newImpulse = b2Max(vcp->normalImpulse + lambda, 0.0f); + lambda = newImpulse - vcp->normalImpulse; + vcp->normalImpulse = newImpulse; + + // Apply contact impulse + b2Vec2 P = lambda * normal; + vA -= mA * P; + wA -= iA * b2Cross(vcp->rA, P); + + vB += mB * P; + wB += iB * b2Cross(vcp->rB, P); + } + else + { + // Block solver developed in collaboration with Dirk Gregorius (back in 01/07 on Box2D_Lite). + // Build the mini LCP for this contact patch + // + // vn = A * x + b, vn >= 0, , vn >= 0, x >= 0 and vn_i * x_i = 0 with i = 1..2 + // + // A = J * W * JT and J = ( -n, -r1 x n, n, r2 x n ) + // b = vn0 - velocityBias + // + // The system is solved using the "Total enumeration method" (s. Murty). The complementary constraint vn_i * x_i + // implies that we must have in any solution either vn_i = 0 or x_i = 0. So for the 2D contact problem the cases + // vn1 = 0 and vn2 = 0, x1 = 0 and x2 = 0, x1 = 0 and vn2 = 0, x2 = 0 and vn1 = 0 need to be tested. The first valid + // solution that satisfies the problem is chosen. + // + // In order to account of the accumulated impulse 'a' (because of the iterative nature of the solver which only requires + // that the accumulated impulse is clamped and not the incremental impulse) we change the impulse variable (x_i). + // + // Substitute: + // + // x = a + d + // + // a := old total impulse + // x := new total impulse + // d := incremental impulse + // + // For the current iteration we extend the formula for the incremental impulse + // to compute the new total impulse: + // + // vn = A * d + b + // = A * (x - a) + b + // = A * x + b - A * a + // = A * x + b' + // b' = b - A * a; + + b2VelocityConstraintPoint* cp1 = vc->points + 0; + b2VelocityConstraintPoint* cp2 = vc->points + 1; + + b2Vec2 a(cp1->normalImpulse, cp2->normalImpulse); + b2Assert(a.x >= 0.0f && a.y >= 0.0f); + + // Relative velocity at contact + b2Vec2 dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + b2Vec2 dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + float32 vn1 = b2Dot(dv1, normal); + float32 vn2 = b2Dot(dv2, normal); + + b2Vec2 b; + b.x = vn1 - cp1->velocityBias; + b.y = vn2 - cp2->velocityBias; + + // Compute b' + b -= b2Mul(vc->K, a); + + const float32 k_errorTol = 1e-3f; + B2_NOT_USED(k_errorTol); + + for (;;) + { + // + // Case 1: vn = 0 + // + // 0 = A * x + b' + // + // Solve for x: + // + // x = - inv(A) * b' + // + b2Vec2 x = - b2Mul(vc->normalMass, b); + + if (x.x >= 0.0f && x.y >= 0.0f) + { + // Get the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + vn1 = b2Dot(dv1, normal); + vn2 = b2Dot(dv2, normal); + + b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); + b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); +#endif + break; + } + + // + // Case 2: vn1 = 0 and x2 = 0 + // + // 0 = a11 * x1 + a12 * 0 + b1' + // vn2 = a21 * x1 + a22 * 0 + b2' + // + x.x = - cp1->normalMass * b.x; + x.y = 0.0f; + vn1 = 0.0f; + vn2 = vc->K.ex.y * x.x + b.y; + + if (x.x >= 0.0f && vn2 >= 0.0f) + { + // Get the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA); + + // Compute normal velocity + vn1 = b2Dot(dv1, normal); + + b2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol); +#endif + break; + } + + + // + // Case 3: vn2 = 0 and x1 = 0 + // + // vn1 = a11 * 0 + a12 * x2 + b1' + // 0 = a21 * 0 + a22 * x2 + b2' + // + x.x = 0.0f; + x.y = - cp2->normalMass * b.y; + vn1 = vc->K.ey.x * x.y + b.x; + vn2 = 0.0f; + + if (x.y >= 0.0f && vn1 >= 0.0f) + { + // Resubstitute for the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + +#if B2_DEBUG_SOLVER == 1 + // Postconditions + dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA); + + // Compute normal velocity + vn2 = b2Dot(dv2, normal); + + b2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol); +#endif + break; + } + + // + // Case 4: x1 = 0 and x2 = 0 + // + // vn1 = b1 + // vn2 = b2; + x.x = 0.0f; + x.y = 0.0f; + vn1 = b.x; + vn2 = b.y; + + if (vn1 >= 0.0f && vn2 >= 0.0f ) + { + // Resubstitute for the incremental impulse + b2Vec2 d = x - a; + + // Apply incremental impulse + b2Vec2 P1 = d.x * normal; + b2Vec2 P2 = d.y * normal; + vA -= mA * (P1 + P2); + wA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2)); + + vB += mB * (P1 + P2); + wB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2)); + + // Accumulate + cp1->normalImpulse = x.x; + cp2->normalImpulse = x.y; + + break; + } + + // No solution, give up. This is hit sometimes, but it doesn't seem to matter. + break; + } + } + + m_velocities[indexA].v = vA; + m_velocities[indexA].w = wA; + m_velocities[indexB].v = vB; + m_velocities[indexB].w = wB; + } +} + +void b2ContactSolver::StoreImpulses() +{ + for (int32 i = 0; i < m_count; ++i) + { + b2ContactVelocityConstraint* vc = m_velocityConstraints + i; + b2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold(); + + for (int32 j = 0; j < vc->pointCount; ++j) + { + manifold->points[j].normalImpulse = vc->points[j].normalImpulse; + manifold->points[j].tangentImpulse = vc->points[j].tangentImpulse; + } + } +} + +struct b2PositionSolverManifold +{ + void Initialize(b2ContactPositionConstraint* pc, const b2Transform& xfA, const b2Transform& xfB, int32 index) + { + b2Assert(pc->pointCount > 0); + + switch (pc->type) + { + case b2Manifold::e_circles: + { + b2Vec2 pointA = b2Mul(xfA, pc->localPoint); + b2Vec2 pointB = b2Mul(xfB, pc->localPoints[0]); + normal = pointB - pointA; + normal.Normalize(); + point = 0.5f * (pointA + pointB); + separation = b2Dot(pointB - pointA, normal) - pc->radiusA - pc->radiusB; + } + break; + + case b2Manifold::e_faceA: + { + normal = b2Mul(xfA.q, pc->localNormal); + b2Vec2 planePoint = b2Mul(xfA, pc->localPoint); + + b2Vec2 clipPoint = b2Mul(xfB, pc->localPoints[index]); + separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; + point = clipPoint; + } + break; + + case b2Manifold::e_faceB: + { + normal = b2Mul(xfB.q, pc->localNormal); + b2Vec2 planePoint = b2Mul(xfB, pc->localPoint); + + b2Vec2 clipPoint = b2Mul(xfA, pc->localPoints[index]); + separation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB; + point = clipPoint; + + // Ensure normal points from A to B + normal = -normal; + } + break; + } + } + + b2Vec2 normal; + b2Vec2 point; + float32 separation; +}; + +// Sequential solver. +bool b2ContactSolver::SolvePositionConstraints() +{ + float32 minSeparation = 0.0f; + + for (int32 i = 0; i < m_count; ++i) + { + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + int32 indexA = pc->indexA; + int32 indexB = pc->indexB; + b2Vec2 localCenterA = pc->localCenterA; + float32 mA = pc->invMassA; + float32 iA = pc->invIA; + b2Vec2 localCenterB = pc->localCenterB; + float32 mB = pc->invMassB; + float32 iB = pc->invIB; + int32 pointCount = pc->pointCount; + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + + // Solve normal constraints + for (int32 j = 0; j < pointCount; ++j) + { + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2PositionSolverManifold psm; + psm.Initialize(pc, xfA, xfB, j); + b2Vec2 normal = psm.normal; + + b2Vec2 point = psm.point; + float32 separation = psm.separation; + + b2Vec2 rA = point - cA; + b2Vec2 rB = point - cB; + + // Track max constraint error. + minSeparation = b2Min(minSeparation, separation); + + // Prevent large corrections and allow slop. + float32 C = b2Clamp(b2_baumgarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); + + // Compute the effective mass. + float32 rnA = b2Cross(rA, normal); + float32 rnB = b2Cross(rB, normal); + float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + // Compute normal impulse + float32 impulse = K > 0.0f ? - C / K : 0.0f; + + b2Vec2 P = impulse * normal; + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + + m_positions[indexA].c = cA; + m_positions[indexA].a = aA; + + m_positions[indexB].c = cB; + m_positions[indexB].a = aB; + } + + // We can't expect minSpeparation >= -b2_linearSlop because we don't + // push the separation above -b2_linearSlop. + return minSeparation >= -3.0f * b2_linearSlop; +} + +// Sequential position solver for position constraints. +bool b2ContactSolver::SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB) +{ + float32 minSeparation = 0.0f; + + for (int32 i = 0; i < m_count; ++i) + { + b2ContactPositionConstraint* pc = m_positionConstraints + i; + + int32 indexA = pc->indexA; + int32 indexB = pc->indexB; + b2Vec2 localCenterA = pc->localCenterA; + b2Vec2 localCenterB = pc->localCenterB; + int32 pointCount = pc->pointCount; + + float32 mA = 0.0f; + float32 iA = 0.0f; + if (indexA == toiIndexA || indexA == toiIndexB) + { + mA = pc->invMassA; + iA = pc->invIA; + } + + float32 mB = pc->invMassB; + float32 iB = pc->invIB; + if (indexB == toiIndexA || indexB == toiIndexB) + { + mB = pc->invMassB; + iB = pc->invIB; + } + + b2Vec2 cA = m_positions[indexA].c; + float32 aA = m_positions[indexA].a; + + b2Vec2 cB = m_positions[indexB].c; + float32 aB = m_positions[indexB].a; + + // Solve normal constraints + for (int32 j = 0; j < pointCount; ++j) + { + b2Transform xfA, xfB; + xfA.q.Set(aA); + xfB.q.Set(aB); + xfA.p = cA - b2Mul(xfA.q, localCenterA); + xfB.p = cB - b2Mul(xfB.q, localCenterB); + + b2PositionSolverManifold psm; + psm.Initialize(pc, xfA, xfB, j); + b2Vec2 normal = psm.normal; + + b2Vec2 point = psm.point; + float32 separation = psm.separation; + + b2Vec2 rA = point - cA; + b2Vec2 rB = point - cB; + + // Track max constraint error. + minSeparation = b2Min(minSeparation, separation); + + // Prevent large corrections and allow slop. + float32 C = b2Clamp(b2_toiBaugarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f); + + // Compute the effective mass. + float32 rnA = b2Cross(rA, normal); + float32 rnB = b2Cross(rB, normal); + float32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB; + + // Compute normal impulse + float32 impulse = K > 0.0f ? - C / K : 0.0f; + + b2Vec2 P = impulse * normal; + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + + m_positions[indexA].c = cA; + m_positions[indexA].a = aA; + + m_positions[indexB].c = cB; + m_positions[indexB].a = aB; + } + + // We can't expect minSpeparation >= -b2_linearSlop because we don't + // push the separation above -b2_linearSlop. + return minSeparation >= -1.5f * b2_linearSlop; +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2ContactSolver.h b/src/libraries/Box2D/Dynamics/Contacts/b2ContactSolver.h index ca9de04db..ff3a49c4b 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2ContactSolver.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2ContactSolver.h @@ -1,94 +1,94 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_SOLVER_H -#define B2_CONTACT_SOLVER_H - -#include -#include -#include - -class b2Contact; -class b2Body; -class b2StackAllocator; -struct b2ContactPositionConstraint; - -struct b2VelocityConstraintPoint -{ - b2Vec2 rA; - b2Vec2 rB; - float32 normalImpulse; - float32 tangentImpulse; - float32 normalMass; - float32 tangentMass; - float32 velocityBias; -}; - -struct b2ContactVelocityConstraint -{ - b2VelocityConstraintPoint points[b2_maxManifoldPoints]; - b2Vec2 normal; - b2Mat22 normalMass; - b2Mat22 K; - int32 indexA; - int32 indexB; - float32 invMassA, invMassB; - float32 invIA, invIB; - float32 friction; - float32 restitution; - int32 pointCount; - int32 contactIndex; -}; - -struct b2ContactSolverDef -{ - b2TimeStep step; - b2Contact** contacts; - int32 count; - b2Position* positions; - b2Velocity* velocities; - b2StackAllocator* allocator; -}; - -class b2ContactSolver -{ -public: - b2ContactSolver(b2ContactSolverDef* def); - ~b2ContactSolver(); - - void InitializeVelocityConstraints(); - - void WarmStart(); - void SolveVelocityConstraints(); - void StoreImpulses(); - - bool SolvePositionConstraints(); - bool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB); - - b2TimeStep m_step; - b2Position* m_positions; - b2Velocity* m_velocities; - b2StackAllocator* m_allocator; - b2ContactPositionConstraint* m_positionConstraints; - b2ContactVelocityConstraint* m_velocityConstraints; - b2Contact** m_contacts; - int m_count; -}; - -#endif - +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_SOLVER_H +#define B2_CONTACT_SOLVER_H + +#include +#include +#include + +class b2Contact; +class b2Body; +class b2StackAllocator; +struct b2ContactPositionConstraint; + +struct b2VelocityConstraintPoint +{ + b2Vec2 rA; + b2Vec2 rB; + float32 normalImpulse; + float32 tangentImpulse; + float32 normalMass; + float32 tangentMass; + float32 velocityBias; +}; + +struct b2ContactVelocityConstraint +{ + b2VelocityConstraintPoint points[b2_maxManifoldPoints]; + b2Vec2 normal; + b2Mat22 normalMass; + b2Mat22 K; + int32 indexA; + int32 indexB; + float32 invMassA, invMassB; + float32 invIA, invIB; + float32 friction; + float32 restitution; + int32 pointCount; + int32 contactIndex; +}; + +struct b2ContactSolverDef +{ + b2TimeStep step; + b2Contact** contacts; + int32 count; + b2Position* positions; + b2Velocity* velocities; + b2StackAllocator* allocator; +}; + +class b2ContactSolver +{ +public: + b2ContactSolver(b2ContactSolverDef* def); + ~b2ContactSolver(); + + void InitializeVelocityConstraints(); + + void WarmStart(); + void SolveVelocityConstraints(); + void StoreImpulses(); + + bool SolvePositionConstraints(); + bool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB); + + b2TimeStep m_step; + b2Position* m_positions; + b2Velocity* m_velocities; + b2StackAllocator* m_allocator; + b2ContactPositionConstraint* m_positionConstraints; + b2ContactVelocityConstraint* m_velocityConstraints; + b2Contact** m_contacts; + int m_count; +}; + +#endif + diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp index 043365070..742a10167 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp @@ -1,50 +1,50 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact)); - return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB); -} - -void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact(); - allocator->Free(contact, sizeof(b2EdgeAndCircleContact)); -} - -b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideEdgeAndCircle( manifold, - (b2EdgeShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact)); + return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB); +} + +void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact(); + allocator->Free(contact, sizeof(b2EdgeAndCircleContact)); +} + +b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideEdgeAndCircle( manifold, + (b2EdgeShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h b/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h index 11b61b880..e7a34553c 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h @@ -1,39 +1,39 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_AND_CIRCLE_CONTACT_H -#define B2_EDGE_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2EdgeAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2EdgeAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_AND_CIRCLE_CONTACT_H +#define B2_EDGE_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2EdgeAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2EdgeAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp index 8bac536a0..0eb09cffa 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp @@ -1,50 +1,50 @@ -/* -* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); - return new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB); -} - -void b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact(); - allocator->Free(contact, sizeof(b2EdgeAndPolygonContact)); -} - -b2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollideEdgeAndPolygon( manifold, - (b2EdgeShape*)m_fixtureA->GetShape(), xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); + return new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB); +} + +void b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact(); + allocator->Free(contact, sizeof(b2EdgeAndPolygonContact)); +} + +b2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollideEdgeAndPolygon( manifold, + (b2EdgeShape*)m_fixtureA->GetShape(), xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h b/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h index 74b27ee01..3b40f1216 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h @@ -1,39 +1,39 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_EDGE_AND_POLYGON_CONTACT_H -#define B2_EDGE_AND_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2EdgeAndPolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2EdgeAndPolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_AND_POLYGON_CONTACT_H +#define B2_EDGE_AND_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2EdgeAndPolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2EdgeAndPolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp index 880f83e22..b5712af8a 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp @@ -1,50 +1,50 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact)); - return new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB); -} - -void b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact(); - allocator->Free(contact, sizeof(b2PolygonAndCircleContact)); -} - -b2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) -: b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); - b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); -} - -void b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollidePolygonAndCircle( manifold, - (b2PolygonShape*)m_fixtureA->GetShape(), xfA, - (b2CircleShape*)m_fixtureB->GetShape(), xfB); -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact)); + return new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB); +} + +void b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact(); + allocator->Free(contact, sizeof(b2PolygonAndCircleContact)); +} + +b2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) +: b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); + b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); +} + +void b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollidePolygonAndCircle( manifold, + (b2PolygonShape*)m_fixtureA->GetShape(), xfA, + (b2CircleShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h b/src/libraries/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h index 6beca16a2..fe0645e08 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h @@ -1,38 +1,38 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H -#define B2_POLYGON_AND_CIRCLE_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2PolygonAndCircleContact : public b2Contact -{ -public: - static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2PolygonAndCircleContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H +#define B2_POLYGON_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2PolygonAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2PolygonAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2PolygonContact.cpp b/src/libraries/Box2D/Dynamics/Contacts/b2PolygonContact.cpp index 52e1be874..47dce21fe 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2PolygonContact.cpp +++ b/src/libraries/Box2D/Dynamics/Contacts/b2PolygonContact.cpp @@ -1,53 +1,53 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include - -#include -using namespace std; - -b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) -{ - void* mem = allocator->Allocate(sizeof(b2PolygonContact)); - return new (mem) b2PolygonContact(fixtureA, fixtureB); -} - -void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) -{ - ((b2PolygonContact*)contact)->~b2PolygonContact(); - allocator->Free(contact, sizeof(b2PolygonContact)); -} - -b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) - : b2Contact(fixtureA, 0, fixtureB, 0) -{ - b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); - b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); -} - -void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) -{ - b2CollidePolygons( manifold, - (b2PolygonShape*)m_fixtureA->GetShape(), xfA, - (b2PolygonShape*)m_fixtureB->GetShape(), xfB); -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include + +#include +using namespace std; + +b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) +{ + void* mem = allocator->Allocate(sizeof(b2PolygonContact)); + return new (mem) b2PolygonContact(fixtureA, fixtureB); +} + +void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) +{ + ((b2PolygonContact*)contact)->~b2PolygonContact(); + allocator->Free(contact, sizeof(b2PolygonContact)); +} + +b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) + : b2Contact(fixtureA, 0, fixtureB, 0) +{ + b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); + b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); +} + +void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) +{ + b2CollidePolygons( manifold, + (b2PolygonShape*)m_fixtureA->GetShape(), xfA, + (b2PolygonShape*)m_fixtureB->GetShape(), xfB); +} diff --git a/src/libraries/Box2D/Dynamics/Contacts/b2PolygonContact.h b/src/libraries/Box2D/Dynamics/Contacts/b2PolygonContact.h index 45932148c..434e6c926 100755 --- a/src/libraries/Box2D/Dynamics/Contacts/b2PolygonContact.h +++ b/src/libraries/Box2D/Dynamics/Contacts/b2PolygonContact.h @@ -1,39 +1,39 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_POLYGON_CONTACT_H -#define B2_POLYGON_CONTACT_H - -#include - -class b2BlockAllocator; - -class b2PolygonContact : public b2Contact -{ -public: - static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, - b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); - static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); - - b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); - ~b2PolygonContact() {} - - void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_CONTACT_H +#define B2_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2PolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2PolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2DistanceJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2DistanceJoint.cpp index 1ced7d9de..ba2b6c009 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2DistanceJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2DistanceJoint.cpp @@ -1,260 +1,260 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// 1-D constrained system -// m (v2 - v1) = lambda -// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass. -// x2 = x1 + h * v2 - -// 1-D mass-damper-spring system -// m (v2 - v1) + h * d * v2 + h * k * - -// C = norm(p2 - p1) - L -// u = (p2 - p1) / norm(p2 - p1) -// Cdot = dot(u, v2 + cross(w2, r2) - v1 - cross(w1, r1)) -// J = [-u -cross(r1, u) u cross(r2, u)] -// K = J * invM * JT -// = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2 - -void b2DistanceJointDef::Initialize(b2Body* b1, b2Body* b2, - const b2Vec2& anchor1, const b2Vec2& anchor2) -{ - bodyA = b1; - bodyB = b2; - localAnchorA = bodyA->GetLocalPoint(anchor1); - localAnchorB = bodyB->GetLocalPoint(anchor2); - b2Vec2 d = anchor2 - anchor1; - length = d.Length(); -} - -b2DistanceJoint::b2DistanceJoint(const b2DistanceJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_length = def->length; - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - m_impulse = 0.0f; - m_gamma = 0.0f; - m_bias = 0.0f; -} - -void b2DistanceJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - m_u = cB + m_rB - cA - m_rA; - - // Handle singularity. - float32 length = m_u.Length(); - if (length > b2_linearSlop) - { - m_u *= 1.0f / length; - } - else - { - m_u.Set(0.0f, 0.0f); - } - - float32 crAu = b2Cross(m_rA, m_u); - float32 crBu = b2Cross(m_rB, m_u); - float32 invMass = m_invMassA + m_invIA * crAu * crAu + m_invMassB + m_invIB * crBu * crBu; - - // Compute the effective mass matrix. - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - - if (m_frequencyHz > 0.0f) - { - float32 C = length - m_length; - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m_mass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m_mass * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; - m_bias = C * h * k * m_gamma; - - invMass += m_gamma; - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - } - else - { - m_gamma = 0.0f; - m_bias = 0.0f; - } - - if (data.step.warmStarting) - { - // Scale the impulse to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2DistanceJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = dot(u, v + cross(w, r)) - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - float32 Cdot = b2Dot(m_u, vpB - vpA); - - float32 impulse = -m_mass * (Cdot + m_bias + m_gamma * m_impulse); - m_impulse += impulse; - - b2Vec2 P = impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2DistanceJoint::SolvePositionConstraints(const b2SolverData& data) -{ - if (m_frequencyHz > 0.0f) - { - // There is no position correction for soft distance constraints. - return true; - } - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 u = cB + rB - cA - rA; - - float32 length = u.Normalize(); - float32 C = length - m_length; - C = b2Clamp(C, -b2_maxLinearCorrection, b2_maxLinearCorrection); - - float32 impulse = -m_mass * C; - b2Vec2 P = impulse * u; - - cA -= m_invMassA * P; - aA -= m_invIA * b2Cross(rA, P); - cB += m_invMassB * P; - aB += m_invIB * b2Cross(rB, P); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return b2Abs(C) < b2_linearSlop; -} - -b2Vec2 b2DistanceJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2DistanceJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2DistanceJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 F = (inv_dt * m_impulse) * m_u; - return F; -} - -float32 b2DistanceJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -void b2DistanceJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2DistanceJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.length = %.15lef;\n", m_length); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// 1-D constrained system +// m (v2 - v1) = lambda +// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass. +// x2 = x1 + h * v2 + +// 1-D mass-damper-spring system +// m (v2 - v1) + h * d * v2 + h * k * + +// C = norm(p2 - p1) - L +// u = (p2 - p1) / norm(p2 - p1) +// Cdot = dot(u, v2 + cross(w2, r2) - v1 - cross(w1, r1)) +// J = [-u -cross(r1, u) u cross(r2, u)] +// K = J * invM * JT +// = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2 + +void b2DistanceJointDef::Initialize(b2Body* b1, b2Body* b2, + const b2Vec2& anchor1, const b2Vec2& anchor2) +{ + bodyA = b1; + bodyB = b2; + localAnchorA = bodyA->GetLocalPoint(anchor1); + localAnchorB = bodyB->GetLocalPoint(anchor2); + b2Vec2 d = anchor2 - anchor1; + length = d.Length(); +} + +b2DistanceJoint::b2DistanceJoint(const b2DistanceJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_length = def->length; + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + m_impulse = 0.0f; + m_gamma = 0.0f; + m_bias = 0.0f; +} + +void b2DistanceJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + m_u = cB + m_rB - cA - m_rA; + + // Handle singularity. + float32 length = m_u.Length(); + if (length > b2_linearSlop) + { + m_u *= 1.0f / length; + } + else + { + m_u.Set(0.0f, 0.0f); + } + + float32 crAu = b2Cross(m_rA, m_u); + float32 crBu = b2Cross(m_rB, m_u); + float32 invMass = m_invMassA + m_invIA * crAu * crAu + m_invMassB + m_invIB * crBu * crBu; + + // Compute the effective mass matrix. + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + + if (m_frequencyHz > 0.0f) + { + float32 C = length - m_length; + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m_mass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m_mass * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; + m_bias = C * h * k * m_gamma; + + invMass += m_gamma; + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + } + else + { + m_gamma = 0.0f; + m_bias = 0.0f; + } + + if (data.step.warmStarting) + { + // Scale the impulse to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2DistanceJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = dot(u, v + cross(w, r)) + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + float32 Cdot = b2Dot(m_u, vpB - vpA); + + float32 impulse = -m_mass * (Cdot + m_bias + m_gamma * m_impulse); + m_impulse += impulse; + + b2Vec2 P = impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2DistanceJoint::SolvePositionConstraints(const b2SolverData& data) +{ + if (m_frequencyHz > 0.0f) + { + // There is no position correction for soft distance constraints. + return true; + } + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 u = cB + rB - cA - rA; + + float32 length = u.Normalize(); + float32 C = length - m_length; + C = b2Clamp(C, -b2_maxLinearCorrection, b2_maxLinearCorrection); + + float32 impulse = -m_mass * C; + b2Vec2 P = impulse * u; + + cA -= m_invMassA * P; + aA -= m_invIA * b2Cross(rA, P); + cB += m_invMassB * P; + aB += m_invIB * b2Cross(rB, P); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return b2Abs(C) < b2_linearSlop; +} + +b2Vec2 b2DistanceJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2DistanceJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2DistanceJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 F = (inv_dt * m_impulse) * m_u; + return F; +} + +float32 b2DistanceJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +void b2DistanceJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2DistanceJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.length = %.15lef;\n", m_length); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2DistanceJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2DistanceJoint.h index 9d0528b95..2faba9d47 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2DistanceJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2DistanceJoint.h @@ -1,169 +1,169 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_DISTANCE_JOINT_H -#define B2_DISTANCE_JOINT_H - -#include - -/// Distance joint definition. This requires defining an -/// anchor point on both bodies and the non-zero length of the -/// distance joint. The definition uses local anchor points -/// so that the initial configuration can violate the constraint -/// slightly. This helps when saving and loading a game. -/// @warning Do not use a zero or short length. -struct b2DistanceJointDef : public b2JointDef -{ - b2DistanceJointDef() - { - type = e_distanceJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - length = 1.0f; - frequencyHz = 0.0f; - dampingRatio = 0.0f; - } - - /// Initialize the bodies, anchors, and length using the world - /// anchors. - void Initialize(b2Body* bodyA, b2Body* bodyB, - const b2Vec2& anchorA, const b2Vec2& anchorB); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The natural length between the anchor points. - float32 length; - - /// The mass-spring-damper frequency in Hertz. A value of 0 - /// disables softness. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A distance joint constrains two points on two bodies -/// to remain at a fixed distance from each other. You can view -/// this as a massless, rigid rod. -class b2DistanceJoint : public b2Joint -{ -public: - - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - /// Get the reaction force given the inverse time step. - /// Unit is N. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Get the reaction torque given the inverse time step. - /// Unit is N*m. This is always zero for a distance joint. - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set/get the natural length. - /// Manipulating the length can lead to non-physical behavior when the frequency is zero. - void SetLength(float32 length); - float32 GetLength() const; - - /// Set/get frequency in Hz. - void SetFrequency(float32 hz); - float32 GetFrequency() const; - - /// Set/get damping ratio. - void SetDampingRatio(float32 ratio); - float32 GetDampingRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2DistanceJoint(const b2DistanceJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_bias; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_gamma; - float32 m_impulse; - float32 m_length; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_u; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; -}; - -inline void b2DistanceJoint::SetLength(float32 length) -{ - m_length = length; -} - -inline float32 b2DistanceJoint::GetLength() const -{ - return m_length; -} - -inline void b2DistanceJoint::SetFrequency(float32 hz) -{ - m_frequencyHz = hz; -} - -inline float32 b2DistanceJoint::GetFrequency() const -{ - return m_frequencyHz; -} - -inline void b2DistanceJoint::SetDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -inline float32 b2DistanceJoint::GetDampingRatio() const -{ - return m_dampingRatio; -} - -#endif +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DISTANCE_JOINT_H +#define B2_DISTANCE_JOINT_H + +#include + +/// Distance joint definition. This requires defining an +/// anchor point on both bodies and the non-zero length of the +/// distance joint. The definition uses local anchor points +/// so that the initial configuration can violate the constraint +/// slightly. This helps when saving and loading a game. +/// @warning Do not use a zero or short length. +struct b2DistanceJointDef : public b2JointDef +{ + b2DistanceJointDef() + { + type = e_distanceJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + length = 1.0f; + frequencyHz = 0.0f; + dampingRatio = 0.0f; + } + + /// Initialize the bodies, anchors, and length using the world + /// anchors. + void Initialize(b2Body* bodyA, b2Body* bodyB, + const b2Vec2& anchorA, const b2Vec2& anchorB); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The natural length between the anchor points. + float32 length; + + /// The mass-spring-damper frequency in Hertz. A value of 0 + /// disables softness. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A distance joint constrains two points on two bodies +/// to remain at a fixed distance from each other. You can view +/// this as a massless, rigid rod. +class b2DistanceJoint : public b2Joint +{ +public: + + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + /// Get the reaction force given the inverse time step. + /// Unit is N. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Get the reaction torque given the inverse time step. + /// Unit is N*m. This is always zero for a distance joint. + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set/get the natural length. + /// Manipulating the length can lead to non-physical behavior when the frequency is zero. + void SetLength(float32 length); + float32 GetLength() const; + + /// Set/get frequency in Hz. + void SetFrequency(float32 hz); + float32 GetFrequency() const; + + /// Set/get damping ratio. + void SetDampingRatio(float32 ratio); + float32 GetDampingRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2DistanceJoint(const b2DistanceJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_bias; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_gamma; + float32 m_impulse; + float32 m_length; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_u; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; +}; + +inline void b2DistanceJoint::SetLength(float32 length) +{ + m_length = length; +} + +inline float32 b2DistanceJoint::GetLength() const +{ + return m_length; +} + +inline void b2DistanceJoint::SetFrequency(float32 hz) +{ + m_frequencyHz = hz; +} + +inline float32 b2DistanceJoint::GetFrequency() const +{ + return m_frequencyHz; +} + +inline void b2DistanceJoint::SetDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +inline float32 b2DistanceJoint::GetDampingRatio() const +{ + return m_dampingRatio; +} + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2FrictionJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2FrictionJoint.cpp index 075e72bb4..412d257a7 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2FrictionJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2FrictionJoint.cpp @@ -1,251 +1,251 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Angle constraint -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2FrictionJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); -} - -b2FrictionJoint::b2FrictionJoint(const b2FrictionJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_linearImpulse.SetZero(); - m_angularImpulse = 0.0f; - - m_maxForce = def->maxForce; - m_maxTorque = def->maxTorque; -} - -void b2FrictionJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective mass matrix. - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat22 K; - K.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y; - K.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y; - K.ey.x = K.ex.y; - K.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x; - - m_linearMass = K.GetInverse(); - - m_angularMass = iA + iB; - if (m_angularMass > 0.0f) - { - m_angularMass = 1.0f / m_angularMass; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_linearImpulse *= data.step.dtRatio; - m_angularImpulse *= data.step.dtRatio; - - b2Vec2 P(m_linearImpulse.x, m_linearImpulse.y); - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_angularImpulse); - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_angularImpulse); - } - else - { - m_linearImpulse.SetZero(); - m_angularImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2FrictionJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - float32 h = data.step.dt; - - // Solve angular friction - { - float32 Cdot = wB - wA; - float32 impulse = -m_angularMass * Cdot; - - float32 oldImpulse = m_angularImpulse; - float32 maxImpulse = h * m_maxTorque; - m_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_angularImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve linear friction - { - b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - - b2Vec2 impulse = -b2Mul(m_linearMass, Cdot); - b2Vec2 oldImpulse = m_linearImpulse; - m_linearImpulse += impulse; - - float32 maxImpulse = h * m_maxForce; - - if (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) - { - m_linearImpulse.Normalize(); - m_linearImpulse *= maxImpulse; - } - - impulse = m_linearImpulse - oldImpulse; - - vA -= mA * impulse; - wA -= iA * b2Cross(m_rA, impulse); - - vB += mB * impulse; - wB += iB * b2Cross(m_rB, impulse); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2FrictionJoint::SolvePositionConstraints(const b2SolverData& data) -{ - B2_NOT_USED(data); - - return true; -} - -b2Vec2 b2FrictionJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2FrictionJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2FrictionJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * m_linearImpulse; -} - -float32 b2FrictionJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_angularImpulse; -} - -void b2FrictionJoint::SetMaxForce(float32 force) -{ - b2Assert(b2IsValid(force) && force >= 0.0f); - m_maxForce = force; -} - -float32 b2FrictionJoint::GetMaxForce() const -{ - return m_maxForce; -} - -void b2FrictionJoint::SetMaxTorque(float32 torque) -{ - b2Assert(b2IsValid(torque) && torque >= 0.0f); - m_maxTorque = torque; -} - -float32 b2FrictionJoint::GetMaxTorque() const -{ - return m_maxTorque; -} - -void b2FrictionJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2FrictionJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.maxForce = %.15lef;\n", m_maxForce); - b2Log(" jd.maxTorque = %.15lef;\n", m_maxTorque); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Angle constraint +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2FrictionJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); +} + +b2FrictionJoint::b2FrictionJoint(const b2FrictionJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_linearImpulse.SetZero(); + m_angularImpulse = 0.0f; + + m_maxForce = def->maxForce; + m_maxTorque = def->maxTorque; +} + +void b2FrictionJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective mass matrix. + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat22 K; + K.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y; + K.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y; + K.ey.x = K.ex.y; + K.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x; + + m_linearMass = K.GetInverse(); + + m_angularMass = iA + iB; + if (m_angularMass > 0.0f) + { + m_angularMass = 1.0f / m_angularMass; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_linearImpulse *= data.step.dtRatio; + m_angularImpulse *= data.step.dtRatio; + + b2Vec2 P(m_linearImpulse.x, m_linearImpulse.y); + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_angularImpulse); + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_angularImpulse); + } + else + { + m_linearImpulse.SetZero(); + m_angularImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2FrictionJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + float32 h = data.step.dt; + + // Solve angular friction + { + float32 Cdot = wB - wA; + float32 impulse = -m_angularMass * Cdot; + + float32 oldImpulse = m_angularImpulse; + float32 maxImpulse = h * m_maxTorque; + m_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_angularImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve linear friction + { + b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + + b2Vec2 impulse = -b2Mul(m_linearMass, Cdot); + b2Vec2 oldImpulse = m_linearImpulse; + m_linearImpulse += impulse; + + float32 maxImpulse = h * m_maxForce; + + if (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) + { + m_linearImpulse.Normalize(); + m_linearImpulse *= maxImpulse; + } + + impulse = m_linearImpulse - oldImpulse; + + vA -= mA * impulse; + wA -= iA * b2Cross(m_rA, impulse); + + vB += mB * impulse; + wB += iB * b2Cross(m_rB, impulse); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2FrictionJoint::SolvePositionConstraints(const b2SolverData& data) +{ + B2_NOT_USED(data); + + return true; +} + +b2Vec2 b2FrictionJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2FrictionJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2FrictionJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * m_linearImpulse; +} + +float32 b2FrictionJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_angularImpulse; +} + +void b2FrictionJoint::SetMaxForce(float32 force) +{ + b2Assert(b2IsValid(force) && force >= 0.0f); + m_maxForce = force; +} + +float32 b2FrictionJoint::GetMaxForce() const +{ + return m_maxForce; +} + +void b2FrictionJoint::SetMaxTorque(float32 torque) +{ + b2Assert(b2IsValid(torque) && torque >= 0.0f); + m_maxTorque = torque; +} + +float32 b2FrictionJoint::GetMaxTorque() const +{ + return m_maxTorque; +} + +void b2FrictionJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2FrictionJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.maxForce = %.15lef;\n", m_maxForce); + b2Log(" jd.maxTorque = %.15lef;\n", m_maxTorque); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2FrictionJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2FrictionJoint.h index 785d9ac15..d57abe80d 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2FrictionJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2FrictionJoint.h @@ -1,119 +1,119 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_FRICTION_JOINT_H -#define B2_FRICTION_JOINT_H - -#include - -/// Friction joint definition. -struct b2FrictionJointDef : public b2JointDef -{ - b2FrictionJointDef() - { - type = e_frictionJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - maxForce = 0.0f; - maxTorque = 0.0f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The maximum friction force in N. - float32 maxForce; - - /// The maximum friction torque in N-m. - float32 maxTorque; -}; - -/// Friction joint. This is used for top-down friction. -/// It provides 2D translational friction and angular friction. -class b2FrictionJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set the maximum friction force in N. - void SetMaxForce(float32 force); - - /// Get the maximum friction force in N. - float32 GetMaxForce() const; - - /// Set the maximum friction torque in N*m. - void SetMaxTorque(float32 torque); - - /// Get the maximum friction torque in N*m. - float32 GetMaxTorque() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - - b2FrictionJoint(const b2FrictionJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - - // Solver shared - b2Vec2 m_linearImpulse; - float32 m_angularImpulse; - float32 m_maxForce; - float32 m_maxTorque; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat22 m_linearMass; - float32 m_angularMass; -}; - -#endif +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_FRICTION_JOINT_H +#define B2_FRICTION_JOINT_H + +#include + +/// Friction joint definition. +struct b2FrictionJointDef : public b2JointDef +{ + b2FrictionJointDef() + { + type = e_frictionJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + maxForce = 0.0f; + maxTorque = 0.0f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The maximum friction force in N. + float32 maxForce; + + /// The maximum friction torque in N-m. + float32 maxTorque; +}; + +/// Friction joint. This is used for top-down friction. +/// It provides 2D translational friction and angular friction. +class b2FrictionJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set the maximum friction force in N. + void SetMaxForce(float32 force); + + /// Get the maximum friction force in N. + float32 GetMaxForce() const; + + /// Set the maximum friction torque in N*m. + void SetMaxTorque(float32 torque); + + /// Get the maximum friction torque in N*m. + float32 GetMaxTorque() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + + b2FrictionJoint(const b2FrictionJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + + // Solver shared + b2Vec2 m_linearImpulse; + float32 m_angularImpulse; + float32 m_maxForce; + float32 m_maxTorque; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat22 m_linearMass; + float32 m_angularMass; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2GearJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2GearJoint.cpp index 201f01233..023d107b4 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2GearJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2GearJoint.cpp @@ -1,423 +1,423 @@ -/* -* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -// Gear Joint: -// C0 = (coordinate1 + ratio * coordinate2)_initial -// C = (coordinate1 + ratio * coordinate2) - C0 = 0 -// J = [J1 ratio * J2] -// K = J * invM * JT -// = J1 * invM1 * J1T + ratio * ratio * J2 * invM2 * J2T -// -// Revolute: -// coordinate = rotation -// Cdot = angularVelocity -// J = [0 0 1] -// K = J * invM * JT = invI -// -// Prismatic: -// coordinate = dot(p - pg, ug) -// Cdot = dot(v + cross(w, r), ug) -// J = [ug cross(r, ug)] -// K = J * invM * JT = invMass + invI * cross(r, ug)^2 - -b2GearJoint::b2GearJoint(const b2GearJointDef* def) -: b2Joint(def) -{ - m_joint1 = def->joint1; - m_joint2 = def->joint2; - - m_typeA = m_joint1->GetType(); - m_typeB = m_joint2->GetType(); - - b2Assert(m_typeA == e_revoluteJoint || m_typeA == e_prismaticJoint); - b2Assert(m_typeB == e_revoluteJoint || m_typeB == e_prismaticJoint); - - float32 coordinateA, coordinateB; - - // TODO_ERIN there might be some problem with the joint edges in b2Joint. - - m_bodyC = m_joint1->GetBodyA(); - m_bodyA = m_joint1->GetBodyB(); - - // Get geometry of joint1 - b2Transform xfA = m_bodyA->m_xf; - float32 aA = m_bodyA->m_sweep.a; - b2Transform xfC = m_bodyC->m_xf; - float32 aC = m_bodyC->m_sweep.a; - - if (m_typeA == e_revoluteJoint) - { - b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint1; - m_localAnchorC = revolute->m_localAnchorA; - m_localAnchorA = revolute->m_localAnchorB; - m_referenceAngleA = revolute->m_referenceAngle; - m_localAxisC.SetZero(); - - coordinateA = aA - aC - m_referenceAngleA; - } - else - { - b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint1; - m_localAnchorC = prismatic->m_localAnchorA; - m_localAnchorA = prismatic->m_localAnchorB; - m_referenceAngleA = prismatic->m_referenceAngle; - m_localAxisC = prismatic->m_localXAxisA; - - b2Vec2 pC = m_localAnchorC; - b2Vec2 pA = b2MulT(xfC.q, b2Mul(xfA.q, m_localAnchorA) + (xfA.p - xfC.p)); - coordinateA = b2Dot(pA - pC, m_localAxisC); - } - - m_bodyD = m_joint2->GetBodyA(); - m_bodyB = m_joint2->GetBodyB(); - - // Get geometry of joint2 - b2Transform xfB = m_bodyB->m_xf; - float32 aB = m_bodyB->m_sweep.a; - b2Transform xfD = m_bodyD->m_xf; - float32 aD = m_bodyD->m_sweep.a; - - if (m_typeB == e_revoluteJoint) - { - b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint2; - m_localAnchorD = revolute->m_localAnchorA; - m_localAnchorB = revolute->m_localAnchorB; - m_referenceAngleB = revolute->m_referenceAngle; - m_localAxisD.SetZero(); - - coordinateB = aB - aD - m_referenceAngleB; - } - else - { - b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint2; - m_localAnchorD = prismatic->m_localAnchorA; - m_localAnchorB = prismatic->m_localAnchorB; - m_referenceAngleB = prismatic->m_referenceAngle; - m_localAxisD = prismatic->m_localXAxisA; - - b2Vec2 pD = m_localAnchorD; - b2Vec2 pB = b2MulT(xfD.q, b2Mul(xfB.q, m_localAnchorB) + (xfB.p - xfD.p)); - coordinateB = b2Dot(pB - pD, m_localAxisD); - } - - m_ratio = def->ratio; - - m_constant = coordinateA + m_ratio * coordinateB; - - m_impulse = 0.0f; -} - -void b2GearJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_indexC = m_bodyC->m_islandIndex; - m_indexD = m_bodyD->m_islandIndex; - m_lcA = m_bodyA->m_sweep.localCenter; - m_lcB = m_bodyB->m_sweep.localCenter; - m_lcC = m_bodyC->m_sweep.localCenter; - m_lcD = m_bodyD->m_sweep.localCenter; - m_mA = m_bodyA->m_invMass; - m_mB = m_bodyB->m_invMass; - m_mC = m_bodyC->m_invMass; - m_mD = m_bodyD->m_invMass; - m_iA = m_bodyA->m_invI; - m_iB = m_bodyB->m_invI; - m_iC = m_bodyC->m_invI; - m_iD = m_bodyD->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Vec2 cC = data.positions[m_indexC].c; - float32 aC = data.positions[m_indexC].a; - b2Vec2 vC = data.velocities[m_indexC].v; - float32 wC = data.velocities[m_indexC].w; - - b2Vec2 cD = data.positions[m_indexD].c; - float32 aD = data.positions[m_indexD].a; - b2Vec2 vD = data.velocities[m_indexD].v; - float32 wD = data.velocities[m_indexD].w; - - b2Rot qA(aA), qB(aB), qC(aC), qD(aD); - - m_mass = 0.0f; - - if (m_typeA == e_revoluteJoint) - { - m_JvAC.SetZero(); - m_JwA = 1.0f; - m_JwC = 1.0f; - m_mass += m_iA + m_iC; - } - else - { - b2Vec2 u = b2Mul(qC, m_localAxisC); - b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); - m_JvAC = u; - m_JwC = b2Cross(rC, u); - m_JwA = b2Cross(rA, u); - m_mass += m_mC + m_mA + m_iC * m_JwC * m_JwC + m_iA * m_JwA * m_JwA; - } - - if (m_typeB == e_revoluteJoint) - { - m_JvBD.SetZero(); - m_JwB = m_ratio; - m_JwD = m_ratio; - m_mass += m_ratio * m_ratio * (m_iB + m_iD); - } - else - { - b2Vec2 u = b2Mul(qD, m_localAxisD); - b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); - m_JvBD = m_ratio * u; - m_JwD = m_ratio * b2Cross(rD, u); - m_JwB = m_ratio * b2Cross(rB, u); - m_mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * m_JwD * m_JwD + m_iB * m_JwB * m_JwB; - } - - // Compute effective mass. - m_mass = m_mass > 0.0f ? 1.0f / m_mass : 0.0f; - - if (data.step.warmStarting) - { - vA += (m_mA * m_impulse) * m_JvAC; - wA += m_iA * m_impulse * m_JwA; - vB += (m_mB * m_impulse) * m_JvBD; - wB += m_iB * m_impulse * m_JwB; - vC -= (m_mC * m_impulse) * m_JvAC; - wC -= m_iC * m_impulse * m_JwC; - vD -= (m_mD * m_impulse) * m_JvBD; - wD -= m_iD * m_impulse * m_JwD; - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; - data.velocities[m_indexC].v = vC; - data.velocities[m_indexC].w = wC; - data.velocities[m_indexD].v = vD; - data.velocities[m_indexD].w = wD; -} - -void b2GearJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - b2Vec2 vC = data.velocities[m_indexC].v; - float32 wC = data.velocities[m_indexC].w; - b2Vec2 vD = data.velocities[m_indexD].v; - float32 wD = data.velocities[m_indexD].w; - - float32 Cdot = b2Dot(m_JvAC, vA - vC) + b2Dot(m_JvBD, vB - vD); - Cdot += (m_JwA * wA - m_JwC * wC) + (m_JwB * wB - m_JwD * wD); - - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - vA += (m_mA * impulse) * m_JvAC; - wA += m_iA * impulse * m_JwA; - vB += (m_mB * impulse) * m_JvBD; - wB += m_iB * impulse * m_JwB; - vC -= (m_mC * impulse) * m_JvAC; - wC -= m_iC * impulse * m_JwC; - vD -= (m_mD * impulse) * m_JvBD; - wD -= m_iD * impulse * m_JwD; - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; - data.velocities[m_indexC].v = vC; - data.velocities[m_indexC].w = wC; - data.velocities[m_indexD].v = vD; - data.velocities[m_indexD].w = wD; -} - -bool b2GearJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 cC = data.positions[m_indexC].c; - float32 aC = data.positions[m_indexC].a; - b2Vec2 cD = data.positions[m_indexD].c; - float32 aD = data.positions[m_indexD].a; - - b2Rot qA(aA), qB(aB), qC(aC), qD(aD); - - float32 linearError = 0.0f; - - float32 coordinateA, coordinateB; - - b2Vec2 JvAC, JvBD; - float32 JwA, JwB, JwC, JwD; - float32 mass = 0.0f; - - if (m_typeA == e_revoluteJoint) - { - JvAC.SetZero(); - JwA = 1.0f; - JwC = 1.0f; - mass += m_iA + m_iC; - - coordinateA = aA - aC - m_referenceAngleA; - } - else - { - b2Vec2 u = b2Mul(qC, m_localAxisC); - b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); - JvAC = u; - JwC = b2Cross(rC, u); - JwA = b2Cross(rA, u); - mass += m_mC + m_mA + m_iC * JwC * JwC + m_iA * JwA * JwA; - - b2Vec2 pC = m_localAnchorC - m_lcC; - b2Vec2 pA = b2MulT(qC, rA + (cA - cC)); - coordinateA = b2Dot(pA - pC, m_localAxisC); - } - - if (m_typeB == e_revoluteJoint) - { - JvBD.SetZero(); - JwB = m_ratio; - JwD = m_ratio; - mass += m_ratio * m_ratio * (m_iB + m_iD); - - coordinateB = aB - aD - m_referenceAngleB; - } - else - { - b2Vec2 u = b2Mul(qD, m_localAxisD); - b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); - JvBD = m_ratio * u; - JwD = m_ratio * b2Cross(rD, u); - JwB = m_ratio * b2Cross(rB, u); - mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * JwD * JwD + m_iB * JwB * JwB; - - b2Vec2 pD = m_localAnchorD - m_lcD; - b2Vec2 pB = b2MulT(qD, rB + (cB - cD)); - coordinateB = b2Dot(pB - pD, m_localAxisD); - } - - float32 C = (coordinateA + m_ratio * coordinateB) - m_constant; - - float32 impulse = 0.0f; - if (mass > 0.0f) - { - impulse = -C / mass; - } - - cA += m_mA * impulse * JvAC; - aA += m_iA * impulse * JwA; - cB += m_mB * impulse * JvBD; - aB += m_iB * impulse * JwB; - cC -= m_mC * impulse * JvAC; - aC -= m_iC * impulse * JwC; - cD -= m_mD * impulse * JvBD; - aD -= m_iD * impulse * JwD; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - data.positions[m_indexC].c = cC; - data.positions[m_indexC].a = aC; - data.positions[m_indexD].c = cD; - data.positions[m_indexD].a = aD; - - // TODO_ERIN not implemented - return linearError < b2_linearSlop; -} - -b2Vec2 b2GearJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2GearJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2GearJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P = m_impulse * m_JvAC; - return inv_dt * P; -} - -float32 b2GearJoint::GetReactionTorque(float32 inv_dt) const -{ - float32 L = m_impulse * m_JwA; - return inv_dt * L; -} - -void b2GearJoint::SetRatio(float32 ratio) -{ - b2Assert(b2IsValid(ratio)); - m_ratio = ratio; -} - -float32 b2GearJoint::GetRatio() const -{ - return m_ratio; -} - -void b2GearJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - int32 index1 = m_joint1->m_index; - int32 index2 = m_joint2->m_index; - - b2Log(" b2GearJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.joint1 = joints[%d];\n", index1); - b2Log(" jd.joint2 = joints[%d];\n", index2); - b2Log(" jd.ratio = %.15lef;\n", m_ratio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +// Gear Joint: +// C0 = (coordinate1 + ratio * coordinate2)_initial +// C = (coordinate1 + ratio * coordinate2) - C0 = 0 +// J = [J1 ratio * J2] +// K = J * invM * JT +// = J1 * invM1 * J1T + ratio * ratio * J2 * invM2 * J2T +// +// Revolute: +// coordinate = rotation +// Cdot = angularVelocity +// J = [0 0 1] +// K = J * invM * JT = invI +// +// Prismatic: +// coordinate = dot(p - pg, ug) +// Cdot = dot(v + cross(w, r), ug) +// J = [ug cross(r, ug)] +// K = J * invM * JT = invMass + invI * cross(r, ug)^2 + +b2GearJoint::b2GearJoint(const b2GearJointDef* def) +: b2Joint(def) +{ + m_joint1 = def->joint1; + m_joint2 = def->joint2; + + m_typeA = m_joint1->GetType(); + m_typeB = m_joint2->GetType(); + + b2Assert(m_typeA == e_revoluteJoint || m_typeA == e_prismaticJoint); + b2Assert(m_typeB == e_revoluteJoint || m_typeB == e_prismaticJoint); + + float32 coordinateA, coordinateB; + + // TODO_ERIN there might be some problem with the joint edges in b2Joint. + + m_bodyC = m_joint1->GetBodyA(); + m_bodyA = m_joint1->GetBodyB(); + + // Get geometry of joint1 + b2Transform xfA = m_bodyA->m_xf; + float32 aA = m_bodyA->m_sweep.a; + b2Transform xfC = m_bodyC->m_xf; + float32 aC = m_bodyC->m_sweep.a; + + if (m_typeA == e_revoluteJoint) + { + b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint1; + m_localAnchorC = revolute->m_localAnchorA; + m_localAnchorA = revolute->m_localAnchorB; + m_referenceAngleA = revolute->m_referenceAngle; + m_localAxisC.SetZero(); + + coordinateA = aA - aC - m_referenceAngleA; + } + else + { + b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint1; + m_localAnchorC = prismatic->m_localAnchorA; + m_localAnchorA = prismatic->m_localAnchorB; + m_referenceAngleA = prismatic->m_referenceAngle; + m_localAxisC = prismatic->m_localXAxisA; + + b2Vec2 pC = m_localAnchorC; + b2Vec2 pA = b2MulT(xfC.q, b2Mul(xfA.q, m_localAnchorA) + (xfA.p - xfC.p)); + coordinateA = b2Dot(pA - pC, m_localAxisC); + } + + m_bodyD = m_joint2->GetBodyA(); + m_bodyB = m_joint2->GetBodyB(); + + // Get geometry of joint2 + b2Transform xfB = m_bodyB->m_xf; + float32 aB = m_bodyB->m_sweep.a; + b2Transform xfD = m_bodyD->m_xf; + float32 aD = m_bodyD->m_sweep.a; + + if (m_typeB == e_revoluteJoint) + { + b2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint2; + m_localAnchorD = revolute->m_localAnchorA; + m_localAnchorB = revolute->m_localAnchorB; + m_referenceAngleB = revolute->m_referenceAngle; + m_localAxisD.SetZero(); + + coordinateB = aB - aD - m_referenceAngleB; + } + else + { + b2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint2; + m_localAnchorD = prismatic->m_localAnchorA; + m_localAnchorB = prismatic->m_localAnchorB; + m_referenceAngleB = prismatic->m_referenceAngle; + m_localAxisD = prismatic->m_localXAxisA; + + b2Vec2 pD = m_localAnchorD; + b2Vec2 pB = b2MulT(xfD.q, b2Mul(xfB.q, m_localAnchorB) + (xfB.p - xfD.p)); + coordinateB = b2Dot(pB - pD, m_localAxisD); + } + + m_ratio = def->ratio; + + m_constant = coordinateA + m_ratio * coordinateB; + + m_impulse = 0.0f; +} + +void b2GearJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_indexC = m_bodyC->m_islandIndex; + m_indexD = m_bodyD->m_islandIndex; + m_lcA = m_bodyA->m_sweep.localCenter; + m_lcB = m_bodyB->m_sweep.localCenter; + m_lcC = m_bodyC->m_sweep.localCenter; + m_lcD = m_bodyD->m_sweep.localCenter; + m_mA = m_bodyA->m_invMass; + m_mB = m_bodyB->m_invMass; + m_mC = m_bodyC->m_invMass; + m_mD = m_bodyD->m_invMass; + m_iA = m_bodyA->m_invI; + m_iB = m_bodyB->m_invI; + m_iC = m_bodyC->m_invI; + m_iD = m_bodyD->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Vec2 cC = data.positions[m_indexC].c; + float32 aC = data.positions[m_indexC].a; + b2Vec2 vC = data.velocities[m_indexC].v; + float32 wC = data.velocities[m_indexC].w; + + b2Vec2 cD = data.positions[m_indexD].c; + float32 aD = data.positions[m_indexD].a; + b2Vec2 vD = data.velocities[m_indexD].v; + float32 wD = data.velocities[m_indexD].w; + + b2Rot qA(aA), qB(aB), qC(aC), qD(aD); + + m_mass = 0.0f; + + if (m_typeA == e_revoluteJoint) + { + m_JvAC.SetZero(); + m_JwA = 1.0f; + m_JwC = 1.0f; + m_mass += m_iA + m_iC; + } + else + { + b2Vec2 u = b2Mul(qC, m_localAxisC); + b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); + m_JvAC = u; + m_JwC = b2Cross(rC, u); + m_JwA = b2Cross(rA, u); + m_mass += m_mC + m_mA + m_iC * m_JwC * m_JwC + m_iA * m_JwA * m_JwA; + } + + if (m_typeB == e_revoluteJoint) + { + m_JvBD.SetZero(); + m_JwB = m_ratio; + m_JwD = m_ratio; + m_mass += m_ratio * m_ratio * (m_iB + m_iD); + } + else + { + b2Vec2 u = b2Mul(qD, m_localAxisD); + b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); + m_JvBD = m_ratio * u; + m_JwD = m_ratio * b2Cross(rD, u); + m_JwB = m_ratio * b2Cross(rB, u); + m_mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * m_JwD * m_JwD + m_iB * m_JwB * m_JwB; + } + + // Compute effective mass. + m_mass = m_mass > 0.0f ? 1.0f / m_mass : 0.0f; + + if (data.step.warmStarting) + { + vA += (m_mA * m_impulse) * m_JvAC; + wA += m_iA * m_impulse * m_JwA; + vB += (m_mB * m_impulse) * m_JvBD; + wB += m_iB * m_impulse * m_JwB; + vC -= (m_mC * m_impulse) * m_JvAC; + wC -= m_iC * m_impulse * m_JwC; + vD -= (m_mD * m_impulse) * m_JvBD; + wD -= m_iD * m_impulse * m_JwD; + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; + data.velocities[m_indexC].v = vC; + data.velocities[m_indexC].w = wC; + data.velocities[m_indexD].v = vD; + data.velocities[m_indexD].w = wD; +} + +void b2GearJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + b2Vec2 vC = data.velocities[m_indexC].v; + float32 wC = data.velocities[m_indexC].w; + b2Vec2 vD = data.velocities[m_indexD].v; + float32 wD = data.velocities[m_indexD].w; + + float32 Cdot = b2Dot(m_JvAC, vA - vC) + b2Dot(m_JvBD, vB - vD); + Cdot += (m_JwA * wA - m_JwC * wC) + (m_JwB * wB - m_JwD * wD); + + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + vA += (m_mA * impulse) * m_JvAC; + wA += m_iA * impulse * m_JwA; + vB += (m_mB * impulse) * m_JvBD; + wB += m_iB * impulse * m_JwB; + vC -= (m_mC * impulse) * m_JvAC; + wC -= m_iC * impulse * m_JwC; + vD -= (m_mD * impulse) * m_JvBD; + wD -= m_iD * impulse * m_JwD; + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; + data.velocities[m_indexC].v = vC; + data.velocities[m_indexC].w = wC; + data.velocities[m_indexD].v = vD; + data.velocities[m_indexD].w = wD; +} + +bool b2GearJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 cC = data.positions[m_indexC].c; + float32 aC = data.positions[m_indexC].a; + b2Vec2 cD = data.positions[m_indexD].c; + float32 aD = data.positions[m_indexD].a; + + b2Rot qA(aA), qB(aB), qC(aC), qD(aD); + + float32 linearError = 0.0f; + + float32 coordinateA, coordinateB; + + b2Vec2 JvAC, JvBD; + float32 JwA, JwB, JwC, JwD; + float32 mass = 0.0f; + + if (m_typeA == e_revoluteJoint) + { + JvAC.SetZero(); + JwA = 1.0f; + JwC = 1.0f; + mass += m_iA + m_iC; + + coordinateA = aA - aC - m_referenceAngleA; + } + else + { + b2Vec2 u = b2Mul(qC, m_localAxisC); + b2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA); + JvAC = u; + JwC = b2Cross(rC, u); + JwA = b2Cross(rA, u); + mass += m_mC + m_mA + m_iC * JwC * JwC + m_iA * JwA * JwA; + + b2Vec2 pC = m_localAnchorC - m_lcC; + b2Vec2 pA = b2MulT(qC, rA + (cA - cC)); + coordinateA = b2Dot(pA - pC, m_localAxisC); + } + + if (m_typeB == e_revoluteJoint) + { + JvBD.SetZero(); + JwB = m_ratio; + JwD = m_ratio; + mass += m_ratio * m_ratio * (m_iB + m_iD); + + coordinateB = aB - aD - m_referenceAngleB; + } + else + { + b2Vec2 u = b2Mul(qD, m_localAxisD); + b2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB); + JvBD = m_ratio * u; + JwD = m_ratio * b2Cross(rD, u); + JwB = m_ratio * b2Cross(rB, u); + mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * JwD * JwD + m_iB * JwB * JwB; + + b2Vec2 pD = m_localAnchorD - m_lcD; + b2Vec2 pB = b2MulT(qD, rB + (cB - cD)); + coordinateB = b2Dot(pB - pD, m_localAxisD); + } + + float32 C = (coordinateA + m_ratio * coordinateB) - m_constant; + + float32 impulse = 0.0f; + if (mass > 0.0f) + { + impulse = -C / mass; + } + + cA += m_mA * impulse * JvAC; + aA += m_iA * impulse * JwA; + cB += m_mB * impulse * JvBD; + aB += m_iB * impulse * JwB; + cC -= m_mC * impulse * JvAC; + aC -= m_iC * impulse * JwC; + cD -= m_mD * impulse * JvBD; + aD -= m_iD * impulse * JwD; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + data.positions[m_indexC].c = cC; + data.positions[m_indexC].a = aC; + data.positions[m_indexD].c = cD; + data.positions[m_indexD].a = aD; + + // TODO_ERIN not implemented + return linearError < b2_linearSlop; +} + +b2Vec2 b2GearJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2GearJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2GearJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P = m_impulse * m_JvAC; + return inv_dt * P; +} + +float32 b2GearJoint::GetReactionTorque(float32 inv_dt) const +{ + float32 L = m_impulse * m_JwA; + return inv_dt * L; +} + +void b2GearJoint::SetRatio(float32 ratio) +{ + b2Assert(b2IsValid(ratio)); + m_ratio = ratio; +} + +float32 b2GearJoint::GetRatio() const +{ + return m_ratio; +} + +void b2GearJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + int32 index1 = m_joint1->m_index; + int32 index2 = m_joint2->m_index; + + b2Log(" b2GearJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.joint1 = joints[%d];\n", index1); + b2Log(" jd.joint2 = joints[%d];\n", index2); + b2Log(" jd.ratio = %.15lef;\n", m_ratio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2GearJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2GearJoint.h index 48cdfd886..fd3d7b2fa 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2GearJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2GearJoint.h @@ -1,125 +1,125 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_GEAR_JOINT_H -#define B2_GEAR_JOINT_H - -#include - -/// Gear joint definition. This definition requires two existing -/// revolute or prismatic joints (any combination will work). -struct b2GearJointDef : public b2JointDef -{ - b2GearJointDef() - { - type = e_gearJoint; - joint1 = NULL; - joint2 = NULL; - ratio = 1.0f; - } - - /// The first revolute/prismatic joint attached to the gear joint. - b2Joint* joint1; - - /// The second revolute/prismatic joint attached to the gear joint. - b2Joint* joint2; - - /// The gear ratio. - /// @see b2GearJoint for explanation. - float32 ratio; -}; - -/// A gear joint is used to connect two joints together. Either joint -/// can be a revolute or prismatic joint. You specify a gear ratio -/// to bind the motions together: -/// coordinate1 + ratio * coordinate2 = constant -/// The ratio can be negative or positive. If one joint is a revolute joint -/// and the other joint is a prismatic joint, then the ratio will have units -/// of length or units of 1/length. -/// @warning You have to manually destroy the gear joint if joint1 or joint2 -/// is destroyed. -class b2GearJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the first joint. - b2Joint* GetJoint1() { return m_joint1; } - - /// Get the second joint. - b2Joint* GetJoint2() { return m_joint2; } - - /// Set/Get the gear ratio. - void SetRatio(float32 ratio); - float32 GetRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2GearJoint(const b2GearJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Joint* m_joint1; - b2Joint* m_joint2; - - b2JointType m_typeA; - b2JointType m_typeB; - - // Body A is connected to body C - // Body B is connected to body D - b2Body* m_bodyC; - b2Body* m_bodyD; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localAnchorC; - b2Vec2 m_localAnchorD; - - b2Vec2 m_localAxisC; - b2Vec2 m_localAxisD; - - float32 m_referenceAngleA; - float32 m_referenceAngleB; - - float32 m_constant; - float32 m_ratio; - - float32 m_impulse; - - // Solver temp - int32 m_indexA, m_indexB, m_indexC, m_indexD; - b2Vec2 m_lcA, m_lcB, m_lcC, m_lcD; - float32 m_mA, m_mB, m_mC, m_mD; - float32 m_iA, m_iB, m_iC, m_iD; - b2Vec2 m_JvAC, m_JvBD; - float32 m_JwA, m_JwB, m_JwC, m_JwD; - float32 m_mass; -}; - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_GEAR_JOINT_H +#define B2_GEAR_JOINT_H + +#include + +/// Gear joint definition. This definition requires two existing +/// revolute or prismatic joints (any combination will work). +struct b2GearJointDef : public b2JointDef +{ + b2GearJointDef() + { + type = e_gearJoint; + joint1 = NULL; + joint2 = NULL; + ratio = 1.0f; + } + + /// The first revolute/prismatic joint attached to the gear joint. + b2Joint* joint1; + + /// The second revolute/prismatic joint attached to the gear joint. + b2Joint* joint2; + + /// The gear ratio. + /// @see b2GearJoint for explanation. + float32 ratio; +}; + +/// A gear joint is used to connect two joints together. Either joint +/// can be a revolute or prismatic joint. You specify a gear ratio +/// to bind the motions together: +/// coordinate1 + ratio * coordinate2 = constant +/// The ratio can be negative or positive. If one joint is a revolute joint +/// and the other joint is a prismatic joint, then the ratio will have units +/// of length or units of 1/length. +/// @warning You have to manually destroy the gear joint if joint1 or joint2 +/// is destroyed. +class b2GearJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the first joint. + b2Joint* GetJoint1() { return m_joint1; } + + /// Get the second joint. + b2Joint* GetJoint2() { return m_joint2; } + + /// Set/Get the gear ratio. + void SetRatio(float32 ratio); + float32 GetRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2GearJoint(const b2GearJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Joint* m_joint1; + b2Joint* m_joint2; + + b2JointType m_typeA; + b2JointType m_typeB; + + // Body A is connected to body C + // Body B is connected to body D + b2Body* m_bodyC; + b2Body* m_bodyD; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localAnchorC; + b2Vec2 m_localAnchorD; + + b2Vec2 m_localAxisC; + b2Vec2 m_localAxisD; + + float32 m_referenceAngleA; + float32 m_referenceAngleB; + + float32 m_constant; + float32 m_ratio; + + float32 m_impulse; + + // Solver temp + int32 m_indexA, m_indexB, m_indexC, m_indexD; + b2Vec2 m_lcA, m_lcB, m_lcC, m_lcD; + float32 m_mA, m_mB, m_mC, m_mD; + float32 m_iA, m_iB, m_iC, m_iD; + b2Vec2 m_JvAC, m_JvBD; + float32 m_JwA, m_JwB, m_JwC, m_JwD; + float32 m_mass; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2Joint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2Joint.cpp index 85322f77c..84802bff9 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2Joint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2Joint.cpp @@ -1,199 +1,199 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator) -{ - b2Joint* joint = NULL; - - switch (def->type) - { - case e_distanceJoint: - { - void* mem = allocator->Allocate(sizeof(b2DistanceJoint)); - joint = new (mem) b2DistanceJoint((b2DistanceJointDef*)def); - } - break; - - case e_mouseJoint: - { - void* mem = allocator->Allocate(sizeof(b2MouseJoint)); - joint = new (mem) b2MouseJoint((b2MouseJointDef*)def); - } - break; - - case e_prismaticJoint: - { - void* mem = allocator->Allocate(sizeof(b2PrismaticJoint)); - joint = new (mem) b2PrismaticJoint((b2PrismaticJointDef*)def); - } - break; - - case e_revoluteJoint: - { - void* mem = allocator->Allocate(sizeof(b2RevoluteJoint)); - joint = new (mem) b2RevoluteJoint((b2RevoluteJointDef*)def); - } - break; - - case e_pulleyJoint: - { - void* mem = allocator->Allocate(sizeof(b2PulleyJoint)); - joint = new (mem) b2PulleyJoint((b2PulleyJointDef*)def); - } - break; - - case e_gearJoint: - { - void* mem = allocator->Allocate(sizeof(b2GearJoint)); - joint = new (mem) b2GearJoint((b2GearJointDef*)def); - } - break; - - case e_wheelJoint: - { - void* mem = allocator->Allocate(sizeof(b2WheelJoint)); - joint = new (mem) b2WheelJoint((b2WheelJointDef*)def); - } - break; - - case e_weldJoint: - { - void* mem = allocator->Allocate(sizeof(b2WeldJoint)); - joint = new (mem) b2WeldJoint((b2WeldJointDef*)def); - } - break; - - case e_frictionJoint: - { - void* mem = allocator->Allocate(sizeof(b2FrictionJoint)); - joint = new (mem) b2FrictionJoint((b2FrictionJointDef*)def); - } - break; - - case e_ropeJoint: - { - void* mem = allocator->Allocate(sizeof(b2RopeJoint)); - joint = new (mem) b2RopeJoint((b2RopeJointDef*)def); - } - break; - - default: - b2Assert(false); - break; - } - - return joint; -} - -void b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator) -{ - joint->~b2Joint(); - switch (joint->m_type) - { - case e_distanceJoint: - allocator->Free(joint, sizeof(b2DistanceJoint)); - break; - - case e_mouseJoint: - allocator->Free(joint, sizeof(b2MouseJoint)); - break; - - case e_prismaticJoint: - allocator->Free(joint, sizeof(b2PrismaticJoint)); - break; - - case e_revoluteJoint: - allocator->Free(joint, sizeof(b2RevoluteJoint)); - break; - - case e_pulleyJoint: - allocator->Free(joint, sizeof(b2PulleyJoint)); - break; - - case e_gearJoint: - allocator->Free(joint, sizeof(b2GearJoint)); - break; - - case e_wheelJoint: - allocator->Free(joint, sizeof(b2WheelJoint)); - break; - - case e_weldJoint: - allocator->Free(joint, sizeof(b2WeldJoint)); - break; - - case e_frictionJoint: - allocator->Free(joint, sizeof(b2FrictionJoint)); - break; - - case e_ropeJoint: - allocator->Free(joint, sizeof(b2RopeJoint)); - break; - - default: - b2Assert(false); - break; - } -} - -b2Joint::b2Joint(const b2JointDef* def) -{ - b2Assert(def->bodyA != def->bodyB); - - m_type = def->type; - m_prev = NULL; - m_next = NULL; - m_bodyA = def->bodyA; - m_bodyB = def->bodyB; - m_index = 0; - m_collideConnected = def->collideConnected; - m_islandFlag = false; - m_userData = def->userData; - - m_edgeA.joint = NULL; - m_edgeA.other = NULL; - m_edgeA.prev = NULL; - m_edgeA.next = NULL; - - m_edgeB.joint = NULL; - m_edgeB.other = NULL; - m_edgeB.prev = NULL; - m_edgeB.next = NULL; -} - -bool b2Joint::IsActive() const -{ - return m_bodyA->IsActive() && m_bodyB->IsActive(); -} +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator) +{ + b2Joint* joint = NULL; + + switch (def->type) + { + case e_distanceJoint: + { + void* mem = allocator->Allocate(sizeof(b2DistanceJoint)); + joint = new (mem) b2DistanceJoint((b2DistanceJointDef*)def); + } + break; + + case e_mouseJoint: + { + void* mem = allocator->Allocate(sizeof(b2MouseJoint)); + joint = new (mem) b2MouseJoint((b2MouseJointDef*)def); + } + break; + + case e_prismaticJoint: + { + void* mem = allocator->Allocate(sizeof(b2PrismaticJoint)); + joint = new (mem) b2PrismaticJoint((b2PrismaticJointDef*)def); + } + break; + + case e_revoluteJoint: + { + void* mem = allocator->Allocate(sizeof(b2RevoluteJoint)); + joint = new (mem) b2RevoluteJoint((b2RevoluteJointDef*)def); + } + break; + + case e_pulleyJoint: + { + void* mem = allocator->Allocate(sizeof(b2PulleyJoint)); + joint = new (mem) b2PulleyJoint((b2PulleyJointDef*)def); + } + break; + + case e_gearJoint: + { + void* mem = allocator->Allocate(sizeof(b2GearJoint)); + joint = new (mem) b2GearJoint((b2GearJointDef*)def); + } + break; + + case e_wheelJoint: + { + void* mem = allocator->Allocate(sizeof(b2WheelJoint)); + joint = new (mem) b2WheelJoint((b2WheelJointDef*)def); + } + break; + + case e_weldJoint: + { + void* mem = allocator->Allocate(sizeof(b2WeldJoint)); + joint = new (mem) b2WeldJoint((b2WeldJointDef*)def); + } + break; + + case e_frictionJoint: + { + void* mem = allocator->Allocate(sizeof(b2FrictionJoint)); + joint = new (mem) b2FrictionJoint((b2FrictionJointDef*)def); + } + break; + + case e_ropeJoint: + { + void* mem = allocator->Allocate(sizeof(b2RopeJoint)); + joint = new (mem) b2RopeJoint((b2RopeJointDef*)def); + } + break; + + default: + b2Assert(false); + break; + } + + return joint; +} + +void b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator) +{ + joint->~b2Joint(); + switch (joint->m_type) + { + case e_distanceJoint: + allocator->Free(joint, sizeof(b2DistanceJoint)); + break; + + case e_mouseJoint: + allocator->Free(joint, sizeof(b2MouseJoint)); + break; + + case e_prismaticJoint: + allocator->Free(joint, sizeof(b2PrismaticJoint)); + break; + + case e_revoluteJoint: + allocator->Free(joint, sizeof(b2RevoluteJoint)); + break; + + case e_pulleyJoint: + allocator->Free(joint, sizeof(b2PulleyJoint)); + break; + + case e_gearJoint: + allocator->Free(joint, sizeof(b2GearJoint)); + break; + + case e_wheelJoint: + allocator->Free(joint, sizeof(b2WheelJoint)); + break; + + case e_weldJoint: + allocator->Free(joint, sizeof(b2WeldJoint)); + break; + + case e_frictionJoint: + allocator->Free(joint, sizeof(b2FrictionJoint)); + break; + + case e_ropeJoint: + allocator->Free(joint, sizeof(b2RopeJoint)); + break; + + default: + b2Assert(false); + break; + } +} + +b2Joint::b2Joint(const b2JointDef* def) +{ + b2Assert(def->bodyA != def->bodyB); + + m_type = def->type; + m_prev = NULL; + m_next = NULL; + m_bodyA = def->bodyA; + m_bodyB = def->bodyB; + m_index = 0; + m_collideConnected = def->collideConnected; + m_islandFlag = false; + m_userData = def->userData; + + m_edgeA.joint = NULL; + m_edgeA.other = NULL; + m_edgeA.prev = NULL; + m_edgeA.next = NULL; + + m_edgeB.joint = NULL; + m_edgeB.other = NULL; + m_edgeB.prev = NULL; + m_edgeB.next = NULL; +} + +bool b2Joint::IsActive() const +{ + return m_bodyA->IsActive() && m_bodyB->IsActive(); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2Joint.h b/src/libraries/Box2D/Dynamics/Joints/b2Joint.h index 90154ccb8..c0f9db832 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2Joint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2Joint.h @@ -1,222 +1,222 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_JOINT_H -#define B2_JOINT_H - -#include - -class b2Body; -class b2Joint; -struct b2SolverData; -class b2BlockAllocator; - -enum b2JointType -{ - e_unknownJoint, - e_revoluteJoint, - e_prismaticJoint, - e_distanceJoint, - e_pulleyJoint, - e_mouseJoint, - e_gearJoint, - e_wheelJoint, - e_weldJoint, - e_frictionJoint, - e_ropeJoint -}; - -enum b2LimitState -{ - e_inactiveLimit, - e_atLowerLimit, - e_atUpperLimit, - e_equalLimits -}; - -struct b2Jacobian -{ - b2Vec2 linear; - float32 angularA; - float32 angularB; -}; - -/// A joint edge is used to connect bodies and joints together -/// in a joint graph where each body is a node and each joint -/// is an edge. A joint edge belongs to a doubly linked list -/// maintained in each attached body. Each joint has two joint -/// nodes, one for each attached body. -struct b2JointEdge -{ - b2Body* other; ///< provides quick access to the other body attached. - b2Joint* joint; ///< the joint - b2JointEdge* prev; ///< the previous joint edge in the body's joint list - b2JointEdge* next; ///< the next joint edge in the body's joint list -}; - -/// Joint definitions are used to construct joints. -struct b2JointDef -{ - b2JointDef() - { - type = e_unknownJoint; - userData = NULL; - bodyA = NULL; - bodyB = NULL; - collideConnected = false; - } - - /// The joint type is set automatically for concrete joint types. - b2JointType type; - - /// Use this to attach application specific data to your joints. - void* userData; - - /// The first attached body. - b2Body* bodyA; - - /// The second attached body. - b2Body* bodyB; - - /// Set this flag to true if the attached bodies should collide. - bool collideConnected; -}; - -/// The base joint class. Joints are used to constraint two bodies together in -/// various fashions. Some joints also feature limits and motors. -class b2Joint -{ -public: - - /// Get the type of the concrete joint. - b2JointType GetType() const; - - /// Get the first body attached to this joint. - b2Body* GetBodyA(); - - /// Get the second body attached to this joint. - b2Body* GetBodyB(); - - /// Get the anchor point on bodyA in world coordinates. - virtual b2Vec2 GetAnchorA() const = 0; - - /// Get the anchor point on bodyB in world coordinates. - virtual b2Vec2 GetAnchorB() const = 0; - - /// Get the reaction force on bodyB at the joint anchor in Newtons. - virtual b2Vec2 GetReactionForce(float32 inv_dt) const = 0; - - /// Get the reaction torque on bodyB in N*m. - virtual float32 GetReactionTorque(float32 inv_dt) const = 0; - - /// Get the next joint the world joint list. - b2Joint* GetNext(); - const b2Joint* GetNext() const; - - /// Get the user data pointer. - void* GetUserData() const; - - /// Set the user data pointer. - void SetUserData(void* data); - - /// Short-cut function to determine if either body is inactive. - bool IsActive() const; - - /// Get collide connected. - /// Note: modifying the collide connect flag won't work correctly because - /// the flag is only checked when fixture AABBs begin to overlap. - bool GetCollideConnected() const; - - /// Dump this joint to the log file. - virtual void Dump() { b2Log("// Dump is not supported for this joint type.\n"); } - -protected: - friend class b2World; - friend class b2Body; - friend class b2Island; - friend class b2GearJoint; - - static b2Joint* Create(const b2JointDef* def, b2BlockAllocator* allocator); - static void Destroy(b2Joint* joint, b2BlockAllocator* allocator); - - b2Joint(const b2JointDef* def); - virtual ~b2Joint() {} - - virtual void InitVelocityConstraints(const b2SolverData& data) = 0; - virtual void SolveVelocityConstraints(const b2SolverData& data) = 0; - - // This returns true if the position errors are within tolerance. - virtual bool SolvePositionConstraints(const b2SolverData& data) = 0; - - b2JointType m_type; - b2Joint* m_prev; - b2Joint* m_next; - b2JointEdge m_edgeA; - b2JointEdge m_edgeB; - b2Body* m_bodyA; - b2Body* m_bodyB; - - int32 m_index; - - bool m_islandFlag; - bool m_collideConnected; - - void* m_userData; -}; - -inline b2JointType b2Joint::GetType() const -{ - return m_type; -} - -inline b2Body* b2Joint::GetBodyA() -{ - return m_bodyA; -} - -inline b2Body* b2Joint::GetBodyB() -{ - return m_bodyB; -} - -inline b2Joint* b2Joint::GetNext() -{ - return m_next; -} - -inline const b2Joint* b2Joint::GetNext() const -{ - return m_next; -} - -inline void* b2Joint::GetUserData() const -{ - return m_userData; -} - -inline void b2Joint::SetUserData(void* data) -{ - m_userData = data; -} - -inline bool b2Joint::GetCollideConnected() const -{ - return m_collideConnected; -} - -#endif +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_JOINT_H +#define B2_JOINT_H + +#include + +class b2Body; +class b2Joint; +struct b2SolverData; +class b2BlockAllocator; + +enum b2JointType +{ + e_unknownJoint, + e_revoluteJoint, + e_prismaticJoint, + e_distanceJoint, + e_pulleyJoint, + e_mouseJoint, + e_gearJoint, + e_wheelJoint, + e_weldJoint, + e_frictionJoint, + e_ropeJoint +}; + +enum b2LimitState +{ + e_inactiveLimit, + e_atLowerLimit, + e_atUpperLimit, + e_equalLimits +}; + +struct b2Jacobian +{ + b2Vec2 linear; + float32 angularA; + float32 angularB; +}; + +/// A joint edge is used to connect bodies and joints together +/// in a joint graph where each body is a node and each joint +/// is an edge. A joint edge belongs to a doubly linked list +/// maintained in each attached body. Each joint has two joint +/// nodes, one for each attached body. +struct b2JointEdge +{ + b2Body* other; ///< provides quick access to the other body attached. + b2Joint* joint; ///< the joint + b2JointEdge* prev; ///< the previous joint edge in the body's joint list + b2JointEdge* next; ///< the next joint edge in the body's joint list +}; + +/// Joint definitions are used to construct joints. +struct b2JointDef +{ + b2JointDef() + { + type = e_unknownJoint; + userData = NULL; + bodyA = NULL; + bodyB = NULL; + collideConnected = false; + } + + /// The joint type is set automatically for concrete joint types. + b2JointType type; + + /// Use this to attach application specific data to your joints. + void* userData; + + /// The first attached body. + b2Body* bodyA; + + /// The second attached body. + b2Body* bodyB; + + /// Set this flag to true if the attached bodies should collide. + bool collideConnected; +}; + +/// The base joint class. Joints are used to constraint two bodies together in +/// various fashions. Some joints also feature limits and motors. +class b2Joint +{ +public: + + /// Get the type of the concrete joint. + b2JointType GetType() const; + + /// Get the first body attached to this joint. + b2Body* GetBodyA(); + + /// Get the second body attached to this joint. + b2Body* GetBodyB(); + + /// Get the anchor point on bodyA in world coordinates. + virtual b2Vec2 GetAnchorA() const = 0; + + /// Get the anchor point on bodyB in world coordinates. + virtual b2Vec2 GetAnchorB() const = 0; + + /// Get the reaction force on bodyB at the joint anchor in Newtons. + virtual b2Vec2 GetReactionForce(float32 inv_dt) const = 0; + + /// Get the reaction torque on bodyB in N*m. + virtual float32 GetReactionTorque(float32 inv_dt) const = 0; + + /// Get the next joint the world joint list. + b2Joint* GetNext(); + const b2Joint* GetNext() const; + + /// Get the user data pointer. + void* GetUserData() const; + + /// Set the user data pointer. + void SetUserData(void* data); + + /// Short-cut function to determine if either body is inactive. + bool IsActive() const; + + /// Get collide connected. + /// Note: modifying the collide connect flag won't work correctly because + /// the flag is only checked when fixture AABBs begin to overlap. + bool GetCollideConnected() const; + + /// Dump this joint to the log file. + virtual void Dump() { b2Log("// Dump is not supported for this joint type.\n"); } + +protected: + friend class b2World; + friend class b2Body; + friend class b2Island; + friend class b2GearJoint; + + static b2Joint* Create(const b2JointDef* def, b2BlockAllocator* allocator); + static void Destroy(b2Joint* joint, b2BlockAllocator* allocator); + + b2Joint(const b2JointDef* def); + virtual ~b2Joint() {} + + virtual void InitVelocityConstraints(const b2SolverData& data) = 0; + virtual void SolveVelocityConstraints(const b2SolverData& data) = 0; + + // This returns true if the position errors are within tolerance. + virtual bool SolvePositionConstraints(const b2SolverData& data) = 0; + + b2JointType m_type; + b2Joint* m_prev; + b2Joint* m_next; + b2JointEdge m_edgeA; + b2JointEdge m_edgeB; + b2Body* m_bodyA; + b2Body* m_bodyB; + + int32 m_index; + + bool m_islandFlag; + bool m_collideConnected; + + void* m_userData; +}; + +inline b2JointType b2Joint::GetType() const +{ + return m_type; +} + +inline b2Body* b2Joint::GetBodyA() +{ + return m_bodyA; +} + +inline b2Body* b2Joint::GetBodyB() +{ + return m_bodyB; +} + +inline b2Joint* b2Joint::GetNext() +{ + return m_next; +} + +inline const b2Joint* b2Joint::GetNext() const +{ + return m_next; +} + +inline void* b2Joint::GetUserData() const +{ + return m_userData; +} + +inline void b2Joint::SetUserData(void* data) +{ + m_userData = data; +} + +inline bool b2Joint::GetCollideConnected() const +{ + return m_collideConnected; +} + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2MouseJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2MouseJoint.cpp index be7c38348..4d19bd407 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2MouseJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2MouseJoint.cpp @@ -1,217 +1,217 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// p = attached point, m = mouse point -// C = p - m -// Cdot = v -// = v + cross(w, r) -// J = [I r_skew] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -b2MouseJoint::b2MouseJoint(const b2MouseJointDef* def) -: b2Joint(def) -{ - b2Assert(def->target.IsValid()); - b2Assert(b2IsValid(def->maxForce) && def->maxForce >= 0.0f); - b2Assert(b2IsValid(def->frequencyHz) && def->frequencyHz >= 0.0f); - b2Assert(b2IsValid(def->dampingRatio) && def->dampingRatio >= 0.0f); - - m_targetA = def->target; - m_localAnchorB = b2MulT(m_bodyB->GetTransform(), m_targetA); - - m_maxForce = def->maxForce; - m_impulse.SetZero(); - - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_beta = 0.0f; - m_gamma = 0.0f; -} - -void b2MouseJoint::SetTarget(const b2Vec2& target) -{ - if (m_bodyB->IsAwake() == false) - { - m_bodyB->SetAwake(true); - } - m_targetA = target; -} - -const b2Vec2& b2MouseJoint::GetTarget() const -{ - return m_targetA; -} - -void b2MouseJoint::SetMaxForce(float32 force) -{ - m_maxForce = force; -} - -float32 b2MouseJoint::GetMaxForce() const -{ - return m_maxForce; -} - -void b2MouseJoint::SetFrequency(float32 hz) -{ - m_frequencyHz = hz; -} - -float32 b2MouseJoint::GetFrequency() const -{ - return m_frequencyHz; -} - -void b2MouseJoint::SetDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -float32 b2MouseJoint::GetDampingRatio() const -{ - return m_dampingRatio; -} - -void b2MouseJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexB = m_bodyB->m_islandIndex; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassB = m_bodyB->m_invMass; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qB(aB); - - float32 mass = m_bodyB->GetMass(); - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * mass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = mass * (omega * omega); - - // magic formulas - // gamma has units of inverse mass. - // beta has units of inverse time. - float32 h = data.step.dt; - b2Assert(d + h * k > b2_epsilon); - m_gamma = h * (d + h * k); - if (m_gamma != 0.0f) - { - m_gamma = 1.0f / m_gamma; - } - m_beta = h * k * m_gamma; - - // Compute the effective mass matrix. - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] - // = [1/m1+1/m2 0 ] + invI1 * [r1.y*r1.y -r1.x*r1.y] + invI2 * [r1.y*r1.y -r1.x*r1.y] - // [ 0 1/m1+1/m2] [-r1.x*r1.y r1.x*r1.x] [-r1.x*r1.y r1.x*r1.x] - b2Mat22 K; - K.ex.x = m_invMassB + m_invIB * m_rB.y * m_rB.y + m_gamma; - K.ex.y = -m_invIB * m_rB.x * m_rB.y; - K.ey.x = K.ex.y; - K.ey.y = m_invMassB + m_invIB * m_rB.x * m_rB.x + m_gamma; - - m_mass = K.GetInverse(); - - m_C = cB + m_rB - m_targetA; - m_C *= m_beta; - - // Cheat with some damping - wB *= 0.98f; - - if (data.step.warmStarting) - { - m_impulse *= data.step.dtRatio; - vB += m_invMassB * m_impulse; - wB += m_invIB * b2Cross(m_rB, m_impulse); - } - else - { - m_impulse.SetZero(); - } - - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2MouseJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = v + cross(w, r) - b2Vec2 Cdot = vB + b2Cross(wB, m_rB); - b2Vec2 impulse = b2Mul(m_mass, -(Cdot + m_C + m_gamma * m_impulse)); - - b2Vec2 oldImpulse = m_impulse; - m_impulse += impulse; - float32 maxImpulse = data.step.dt * m_maxForce; - if (m_impulse.LengthSquared() > maxImpulse * maxImpulse) - { - m_impulse *= maxImpulse / m_impulse.Length(); - } - impulse = m_impulse - oldImpulse; - - vB += m_invMassB * impulse; - wB += m_invIB * b2Cross(m_rB, impulse); - - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2MouseJoint::SolvePositionConstraints(const b2SolverData& data) -{ - B2_NOT_USED(data); - return true; -} - -b2Vec2 b2MouseJoint::GetAnchorA() const -{ - return m_targetA; -} - -b2Vec2 b2MouseJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2MouseJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * m_impulse; -} - -float32 b2MouseJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * 0.0f; -} +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// p = attached point, m = mouse point +// C = p - m +// Cdot = v +// = v + cross(w, r) +// J = [I r_skew] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +b2MouseJoint::b2MouseJoint(const b2MouseJointDef* def) +: b2Joint(def) +{ + b2Assert(def->target.IsValid()); + b2Assert(b2IsValid(def->maxForce) && def->maxForce >= 0.0f); + b2Assert(b2IsValid(def->frequencyHz) && def->frequencyHz >= 0.0f); + b2Assert(b2IsValid(def->dampingRatio) && def->dampingRatio >= 0.0f); + + m_targetA = def->target; + m_localAnchorB = b2MulT(m_bodyB->GetTransform(), m_targetA); + + m_maxForce = def->maxForce; + m_impulse.SetZero(); + + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_beta = 0.0f; + m_gamma = 0.0f; +} + +void b2MouseJoint::SetTarget(const b2Vec2& target) +{ + if (m_bodyB->IsAwake() == false) + { + m_bodyB->SetAwake(true); + } + m_targetA = target; +} + +const b2Vec2& b2MouseJoint::GetTarget() const +{ + return m_targetA; +} + +void b2MouseJoint::SetMaxForce(float32 force) +{ + m_maxForce = force; +} + +float32 b2MouseJoint::GetMaxForce() const +{ + return m_maxForce; +} + +void b2MouseJoint::SetFrequency(float32 hz) +{ + m_frequencyHz = hz; +} + +float32 b2MouseJoint::GetFrequency() const +{ + return m_frequencyHz; +} + +void b2MouseJoint::SetDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +float32 b2MouseJoint::GetDampingRatio() const +{ + return m_dampingRatio; +} + +void b2MouseJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexB = m_bodyB->m_islandIndex; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassB = m_bodyB->m_invMass; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qB(aB); + + float32 mass = m_bodyB->GetMass(); + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * mass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = mass * (omega * omega); + + // magic formulas + // gamma has units of inverse mass. + // beta has units of inverse time. + float32 h = data.step.dt; + b2Assert(d + h * k > b2_epsilon); + m_gamma = h * (d + h * k); + if (m_gamma != 0.0f) + { + m_gamma = 1.0f / m_gamma; + } + m_beta = h * k * m_gamma; + + // Compute the effective mass matrix. + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] + // = [1/m1+1/m2 0 ] + invI1 * [r1.y*r1.y -r1.x*r1.y] + invI2 * [r1.y*r1.y -r1.x*r1.y] + // [ 0 1/m1+1/m2] [-r1.x*r1.y r1.x*r1.x] [-r1.x*r1.y r1.x*r1.x] + b2Mat22 K; + K.ex.x = m_invMassB + m_invIB * m_rB.y * m_rB.y + m_gamma; + K.ex.y = -m_invIB * m_rB.x * m_rB.y; + K.ey.x = K.ex.y; + K.ey.y = m_invMassB + m_invIB * m_rB.x * m_rB.x + m_gamma; + + m_mass = K.GetInverse(); + + m_C = cB + m_rB - m_targetA; + m_C *= m_beta; + + // Cheat with some damping + wB *= 0.98f; + + if (data.step.warmStarting) + { + m_impulse *= data.step.dtRatio; + vB += m_invMassB * m_impulse; + wB += m_invIB * b2Cross(m_rB, m_impulse); + } + else + { + m_impulse.SetZero(); + } + + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2MouseJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = v + cross(w, r) + b2Vec2 Cdot = vB + b2Cross(wB, m_rB); + b2Vec2 impulse = b2Mul(m_mass, -(Cdot + m_C + m_gamma * m_impulse)); + + b2Vec2 oldImpulse = m_impulse; + m_impulse += impulse; + float32 maxImpulse = data.step.dt * m_maxForce; + if (m_impulse.LengthSquared() > maxImpulse * maxImpulse) + { + m_impulse *= maxImpulse / m_impulse.Length(); + } + impulse = m_impulse - oldImpulse; + + vB += m_invMassB * impulse; + wB += m_invIB * b2Cross(m_rB, impulse); + + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2MouseJoint::SolvePositionConstraints(const b2SolverData& data) +{ + B2_NOT_USED(data); + return true; +} + +b2Vec2 b2MouseJoint::GetAnchorA() const +{ + return m_targetA; +} + +b2Vec2 b2MouseJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2MouseJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * m_impulse; +} + +float32 b2MouseJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * 0.0f; +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2MouseJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2MouseJoint.h index bb2e28418..682e78340 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2MouseJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2MouseJoint.h @@ -1,126 +1,126 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_MOUSE_JOINT_H -#define B2_MOUSE_JOINT_H - -#include - -/// Mouse joint definition. This requires a world target point, -/// tuning parameters, and the time step. -struct b2MouseJointDef : public b2JointDef -{ - b2MouseJointDef() - { - type = e_mouseJoint; - target.Set(0.0f, 0.0f); - maxForce = 0.0f; - frequencyHz = 5.0f; - dampingRatio = 0.7f; - } - - /// The initial world target point. This is assumed - /// to coincide with the body anchor initially. - b2Vec2 target; - - /// The maximum constraint force that can be exerted - /// to move the candidate body. Usually you will express - /// as some multiple of the weight (multiplier * mass * gravity). - float32 maxForce; - - /// The response speed. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A mouse joint is used to make a point on a body track a -/// specified world point. This a soft constraint with a maximum -/// force. This allows the constraint to stretch and without -/// applying huge forces. -/// NOTE: this joint is not documented in the manual because it was -/// developed to be used in the testbed. If you want to learn how to -/// use the mouse joint, look at the testbed. -class b2MouseJoint : public b2Joint -{ -public: - - /// Implements b2Joint. - b2Vec2 GetAnchorA() const; - - /// Implements b2Joint. - b2Vec2 GetAnchorB() const; - - /// Implements b2Joint. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Implements b2Joint. - float32 GetReactionTorque(float32 inv_dt) const; - - /// Use this to update the target point. - void SetTarget(const b2Vec2& target); - const b2Vec2& GetTarget() const; - - /// Set/get the maximum force in Newtons. - void SetMaxForce(float32 force); - float32 GetMaxForce() const; - - /// Set/get the frequency in Hertz. - void SetFrequency(float32 hz); - float32 GetFrequency() const; - - /// Set/get the damping ratio (dimensionless). - void SetDampingRatio(float32 ratio); - float32 GetDampingRatio() const; - - /// The mouse joint does not support dumping. - void Dump() { b2Log("Mouse joint dumping is not supported.\n"); } - -protected: - friend class b2Joint; - - b2MouseJoint(const b2MouseJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_localAnchorB; - b2Vec2 m_targetA; - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_beta; - - // Solver shared - b2Vec2 m_impulse; - float32 m_maxForce; - float32 m_gamma; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rB; - b2Vec2 m_localCenterB; - float32 m_invMassB; - float32 m_invIB; - b2Mat22 m_mass; - b2Vec2 m_C; -}; - -#endif +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_MOUSE_JOINT_H +#define B2_MOUSE_JOINT_H + +#include + +/// Mouse joint definition. This requires a world target point, +/// tuning parameters, and the time step. +struct b2MouseJointDef : public b2JointDef +{ + b2MouseJointDef() + { + type = e_mouseJoint; + target.Set(0.0f, 0.0f); + maxForce = 0.0f; + frequencyHz = 5.0f; + dampingRatio = 0.7f; + } + + /// The initial world target point. This is assumed + /// to coincide with the body anchor initially. + b2Vec2 target; + + /// The maximum constraint force that can be exerted + /// to move the candidate body. Usually you will express + /// as some multiple of the weight (multiplier * mass * gravity). + float32 maxForce; + + /// The response speed. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A mouse joint is used to make a point on a body track a +/// specified world point. This a soft constraint with a maximum +/// force. This allows the constraint to stretch and without +/// applying huge forces. +/// NOTE: this joint is not documented in the manual because it was +/// developed to be used in the testbed. If you want to learn how to +/// use the mouse joint, look at the testbed. +class b2MouseJoint : public b2Joint +{ +public: + + /// Implements b2Joint. + b2Vec2 GetAnchorA() const; + + /// Implements b2Joint. + b2Vec2 GetAnchorB() const; + + /// Implements b2Joint. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Implements b2Joint. + float32 GetReactionTorque(float32 inv_dt) const; + + /// Use this to update the target point. + void SetTarget(const b2Vec2& target); + const b2Vec2& GetTarget() const; + + /// Set/get the maximum force in Newtons. + void SetMaxForce(float32 force); + float32 GetMaxForce() const; + + /// Set/get the frequency in Hertz. + void SetFrequency(float32 hz); + float32 GetFrequency() const; + + /// Set/get the damping ratio (dimensionless). + void SetDampingRatio(float32 ratio); + float32 GetDampingRatio() const; + + /// The mouse joint does not support dumping. + void Dump() { b2Log("Mouse joint dumping is not supported.\n"); } + +protected: + friend class b2Joint; + + b2MouseJoint(const b2MouseJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_localAnchorB; + b2Vec2 m_targetA; + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_beta; + + // Solver shared + b2Vec2 m_impulse; + float32 m_maxForce; + float32 m_gamma; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rB; + b2Vec2 m_localCenterB; + float32 m_invMassB; + float32 m_invIB; + b2Mat22 m_mass; + b2Vec2 m_C; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp index 88a388072..1df28b9db 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp @@ -1,637 +1,637 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Linear constraint (point-to-line) -// d = p2 - p1 = x2 + r2 - x1 - r1 -// C = dot(perp, d) -// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) -// = -dot(perp, v1) - dot(cross(d + r1, perp), w1) + dot(perp, v2) + dot(cross(r2, perp), v2) -// J = [-perp, -cross(d + r1, perp), perp, cross(r2,perp)] -// -// Angular constraint -// C = a2 - a1 + a_initial -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// -// K = J * invM * JT -// -// J = [-a -s1 a s2] -// [0 -1 0 1] -// a = perp -// s1 = cross(d + r1, a) = cross(p2 - x1, a) -// s2 = cross(r2, a) = cross(p2 - x2, a) - - -// Motor/Limit linear constraint -// C = dot(ax1, d) -// Cdot = = -dot(ax1, v1) - dot(cross(d + r1, ax1), w1) + dot(ax1, v2) + dot(cross(r2, ax1), v2) -// J = [-ax1 -cross(d+r1,ax1) ax1 cross(r2,ax1)] - -// Block Solver -// We develop a block solver that includes the joint limit. This makes the limit stiff (inelastic) even -// when the mass has poor distribution (leading to large torques about the joint anchor points). -// -// The Jacobian has 3 rows: -// J = [-uT -s1 uT s2] // linear -// [0 -1 0 1] // angular -// [-vT -a1 vT a2] // limit -// -// u = perp -// v = axis -// s1 = cross(d + r1, u), s2 = cross(r2, u) -// a1 = cross(d + r1, v), a2 = cross(r2, v) - -// M * (v2 - v1) = JT * df -// J * v2 = bias -// -// v2 = v1 + invM * JT * df -// J * (v1 + invM * JT * df) = bias -// K * df = bias - J * v1 = -Cdot -// K = J * invM * JT -// Cdot = J * v1 - bias -// -// Now solve for f2. -// df = f2 - f1 -// K * (f2 - f1) = -Cdot -// f2 = invK * (-Cdot) + f1 -// -// Clamp accumulated limit impulse. -// lower: f2(3) = max(f2(3), 0) -// upper: f2(3) = min(f2(3), 0) -// -// Solve for correct f2(1:2) -// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:3) * f1 -// = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:2) * f1(1:2) + K(1:2,3) * f1(3) -// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3)) + K(1:2,1:2) * f1(1:2) -// f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) -// -// Now compute impulse to be applied: -// df = f2 - f1 - -void b2PrismaticJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - localAxisA = bodyA->GetLocalVector(axis); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_localXAxisA = def->localAxisA; - m_localXAxisA.Normalize(); - m_localYAxisA = b2Cross(1.0f, m_localXAxisA); - m_referenceAngle = def->referenceAngle; - - m_impulse.SetZero(); - m_motorMass = 0.0; - m_motorImpulse = 0.0f; - - m_lowerTranslation = def->lowerTranslation; - m_upperTranslation = def->upperTranslation; - m_maxMotorForce = def->maxMotorForce; - m_motorSpeed = def->motorSpeed; - m_enableLimit = def->enableLimit; - m_enableMotor = def->enableMotor; - m_limitState = e_inactiveLimit; - - m_axis.SetZero(); - m_perp.SetZero(); -} - -void b2PrismaticJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective masses. - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = (cB - cA) + rB - rA; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Compute motor Jacobian and effective mass. - { - m_axis = b2Mul(qA, m_localXAxisA); - m_a1 = b2Cross(d + rA, m_axis); - m_a2 = b2Cross(rB, m_axis); - - m_motorMass = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - } - - // Prismatic constraint. - { - m_perp = b2Mul(qA, m_localYAxisA); - - m_s1 = b2Cross(d + rA, m_perp); - m_s2 = b2Cross(rB, m_perp); - - float32 k11 = mA + mB + iA * m_s1 * m_s1 + iB * m_s2 * m_s2; - float32 k12 = iA * m_s1 + iB * m_s2; - float32 k13 = iA * m_s1 * m_a1 + iB * m_s2 * m_a2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - // For bodies with fixed rotation. - k22 = 1.0f; - } - float32 k23 = iA * m_a1 + iB * m_a2; - float32 k33 = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; - - m_K.ex.Set(k11, k12, k13); - m_K.ey.Set(k12, k22, k23); - m_K.ez.Set(k13, k23, k33); - } - - // Compute motor and limit terms. - if (m_enableLimit) - { - float32 jointTranslation = b2Dot(m_axis, d); - if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) - { - m_limitState = e_equalLimits; - } - else if (jointTranslation <= m_lowerTranslation) - { - if (m_limitState != e_atLowerLimit) - { - m_limitState = e_atLowerLimit; - m_impulse.z = 0.0f; - } - } - else if (jointTranslation >= m_upperTranslation) - { - if (m_limitState != e_atUpperLimit) - { - m_limitState = e_atUpperLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - - if (m_enableMotor == false) - { - m_motorImpulse = 0.0f; - } - - if (data.step.warmStarting) - { - // Account for variable time step. - m_impulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis; - float32 LA = m_impulse.x * m_s1 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a1; - float32 LB = m_impulse.x * m_s2 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - else - { - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2PrismaticJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Solve linear motor constraint. - if (m_enableMotor && m_limitState != e_equalLimits) - { - float32 Cdot = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; - float32 impulse = m_motorMass * (m_motorSpeed - Cdot); - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorForce; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - b2Vec2 P = impulse * m_axis; - float32 LA = impulse * m_a1; - float32 LB = impulse * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - b2Vec2 Cdot1; - Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; - Cdot1.y = wB - wA; - - if (m_enableLimit && m_limitState != e_inactiveLimit) - { - // Solve prismatic and limit constraint in block form. - float32 Cdot2; - Cdot2 = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 f1 = m_impulse; - b2Vec3 df = m_K.Solve33(-Cdot); - m_impulse += df; - - if (m_limitState == e_atLowerLimit) - { - m_impulse.z = b2Max(m_impulse.z, 0.0f); - } - else if (m_limitState == e_atUpperLimit) - { - m_impulse.z = b2Min(m_impulse.z, 0.0f); - } - - // f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) - b2Vec2 b = -Cdot1 - (m_impulse.z - f1.z) * b2Vec2(m_K.ez.x, m_K.ez.y); - b2Vec2 f2r = m_K.Solve22(b) + b2Vec2(f1.x, f1.y); - m_impulse.x = f2r.x; - m_impulse.y = f2r.y; - - df = m_impulse - f1; - - b2Vec2 P = df.x * m_perp + df.z * m_axis; - float32 LA = df.x * m_s1 + df.y + df.z * m_a1; - float32 LB = df.x * m_s2 + df.y + df.z * m_a2; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - else - { - // Limit is inactive, just solve the prismatic constraint in block form. - b2Vec2 df = m_K.Solve22(-Cdot1); - m_impulse.x += df.x; - m_impulse.y += df.y; - - b2Vec2 P = df.x * m_perp; - float32 LA = df.x * m_s1 + df.y; - float32 LB = df.x * m_s2 + df.y; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - - b2Vec2 Cdot10 = Cdot1; - - Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; - Cdot1.y = wB - wA; - - if (b2Abs(Cdot1.x) > 0.01f || b2Abs(Cdot1.y) > 0.01f) - { - b2Vec2 test = b2Mul22(m_K, df); - Cdot1.x += 0.0f; - } - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2PrismaticJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - // Compute fresh Jacobians - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = cB + rB - cA - rA; - - b2Vec2 axis = b2Mul(qA, m_localXAxisA); - float32 a1 = b2Cross(d + rA, axis); - float32 a2 = b2Cross(rB, axis); - b2Vec2 perp = b2Mul(qA, m_localYAxisA); - - float32 s1 = b2Cross(d + rA, perp); - float32 s2 = b2Cross(rB, perp); - - b2Vec3 impulse; - b2Vec2 C1; - C1.x = b2Dot(perp, d); - C1.y = aB - aA - m_referenceAngle; - - float32 linearError = b2Abs(C1.x); - float32 angularError = b2Abs(C1.y); - - bool active = false; - float32 C2 = 0.0f; - if (m_enableLimit) - { - float32 translation = b2Dot(axis, d); - if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) - { - // Prevent large angular corrections - C2 = b2Clamp(translation, -b2_maxLinearCorrection, b2_maxLinearCorrection); - linearError = b2Max(linearError, b2Abs(translation)); - active = true; - } - else if (translation <= m_lowerTranslation) - { - // Prevent large linear corrections and allow some slop. - C2 = b2Clamp(translation - m_lowerTranslation + b2_linearSlop, -b2_maxLinearCorrection, 0.0f); - linearError = b2Max(linearError, m_lowerTranslation - translation); - active = true; - } - else if (translation >= m_upperTranslation) - { - // Prevent large linear corrections and allow some slop. - C2 = b2Clamp(translation - m_upperTranslation - b2_linearSlop, 0.0f, b2_maxLinearCorrection); - linearError = b2Max(linearError, translation - m_upperTranslation); - active = true; - } - } - - if (active) - { - float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; - float32 k12 = iA * s1 + iB * s2; - float32 k13 = iA * s1 * a1 + iB * s2 * a2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - // For fixed rotation - k22 = 1.0f; - } - float32 k23 = iA * a1 + iB * a2; - float32 k33 = mA + mB + iA * a1 * a1 + iB * a2 * a2; - - b2Mat33 K; - K.ex.Set(k11, k12, k13); - K.ey.Set(k12, k22, k23); - K.ez.Set(k13, k23, k33); - - b2Vec3 C; - C.x = C1.x; - C.y = C1.y; - C.z = C2; - - impulse = K.Solve33(-C); - } - else - { - float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; - float32 k12 = iA * s1 + iB * s2; - float32 k22 = iA + iB; - if (k22 == 0.0f) - { - k22 = 1.0f; - } - - b2Mat22 K; - K.ex.Set(k11, k12); - K.ey.Set(k12, k22); - - b2Vec2 impulse1 = K.Solve(-C1); - impulse.x = impulse1.x; - impulse.y = impulse1.y; - impulse.z = 0.0f; - } - - b2Vec2 P = impulse.x * perp + impulse.z * axis; - float32 LA = impulse.x * s1 + impulse.y + impulse.z * a1; - float32 LB = impulse.x * s2 + impulse.y + impulse.z * a2; - - cA -= mA * P; - aA -= iA * LA; - cB += mB * P; - aB += iB * LB; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return linearError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2PrismaticJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2PrismaticJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2PrismaticJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * (m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis); -} - -float32 b2PrismaticJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.y; -} - -float32 b2PrismaticJoint::GetJointTranslation() const -{ - b2Vec2 pA = m_bodyA->GetWorldPoint(m_localAnchorA); - b2Vec2 pB = m_bodyB->GetWorldPoint(m_localAnchorB); - b2Vec2 d = pB - pA; - b2Vec2 axis = m_bodyA->GetWorldVector(m_localXAxisA); - - float32 translation = b2Dot(d, axis); - return translation; -} - -float32 b2PrismaticJoint::GetJointSpeed() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - - b2Vec2 rA = b2Mul(bA->m_xf.q, m_localAnchorA - bA->m_sweep.localCenter); - b2Vec2 rB = b2Mul(bB->m_xf.q, m_localAnchorB - bB->m_sweep.localCenter); - b2Vec2 p1 = bA->m_sweep.c + rA; - b2Vec2 p2 = bB->m_sweep.c + rB; - b2Vec2 d = p2 - p1; - b2Vec2 axis = b2Mul(bA->m_xf.q, m_localXAxisA); - - b2Vec2 vA = bA->m_linearVelocity; - b2Vec2 vB = bB->m_linearVelocity; - float32 wA = bA->m_angularVelocity; - float32 wB = bB->m_angularVelocity; - - float32 speed = b2Dot(d, b2Cross(wA, axis)) + b2Dot(axis, vB + b2Cross(wB, rB) - vA - b2Cross(wA, rA)); - return speed; -} - -bool b2PrismaticJoint::IsLimitEnabled() const -{ - return m_enableLimit; -} - -void b2PrismaticJoint::EnableLimit(bool flag) -{ - if (flag != m_enableLimit) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableLimit = flag; - m_impulse.z = 0.0f; - } -} - -float32 b2PrismaticJoint::GetLowerLimit() const -{ - return m_lowerTranslation; -} - -float32 b2PrismaticJoint::GetUpperLimit() const -{ - return m_upperTranslation; -} - -void b2PrismaticJoint::SetLimits(float32 lower, float32 upper) -{ - b2Assert(lower <= upper); - if (lower != m_lowerTranslation || upper != m_upperTranslation) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_lowerTranslation = lower; - m_upperTranslation = upper; - m_impulse.z = 0.0f; - } -} - -bool b2PrismaticJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2PrismaticJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -void b2PrismaticJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2PrismaticJoint::SetMaxMotorForce(float32 force) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorForce = force; -} - -float32 b2PrismaticJoint::GetMotorForce(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2PrismaticJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2PrismaticJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); - b2Log(" jd.lowerTranslation = %.15lef;\n", m_lowerTranslation); - b2Log(" jd.upperTranslation = %.15lef;\n", m_upperTranslation); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorForce = %.15lef;\n", m_maxMotorForce); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Linear constraint (point-to-line) +// d = p2 - p1 = x2 + r2 - x1 - r1 +// C = dot(perp, d) +// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) +// = -dot(perp, v1) - dot(cross(d + r1, perp), w1) + dot(perp, v2) + dot(cross(r2, perp), v2) +// J = [-perp, -cross(d + r1, perp), perp, cross(r2,perp)] +// +// Angular constraint +// C = a2 - a1 + a_initial +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// +// K = J * invM * JT +// +// J = [-a -s1 a s2] +// [0 -1 0 1] +// a = perp +// s1 = cross(d + r1, a) = cross(p2 - x1, a) +// s2 = cross(r2, a) = cross(p2 - x2, a) + + +// Motor/Limit linear constraint +// C = dot(ax1, d) +// Cdot = = -dot(ax1, v1) - dot(cross(d + r1, ax1), w1) + dot(ax1, v2) + dot(cross(r2, ax1), v2) +// J = [-ax1 -cross(d+r1,ax1) ax1 cross(r2,ax1)] + +// Block Solver +// We develop a block solver that includes the joint limit. This makes the limit stiff (inelastic) even +// when the mass has poor distribution (leading to large torques about the joint anchor points). +// +// The Jacobian has 3 rows: +// J = [-uT -s1 uT s2] // linear +// [0 -1 0 1] // angular +// [-vT -a1 vT a2] // limit +// +// u = perp +// v = axis +// s1 = cross(d + r1, u), s2 = cross(r2, u) +// a1 = cross(d + r1, v), a2 = cross(r2, v) + +// M * (v2 - v1) = JT * df +// J * v2 = bias +// +// v2 = v1 + invM * JT * df +// J * (v1 + invM * JT * df) = bias +// K * df = bias - J * v1 = -Cdot +// K = J * invM * JT +// Cdot = J * v1 - bias +// +// Now solve for f2. +// df = f2 - f1 +// K * (f2 - f1) = -Cdot +// f2 = invK * (-Cdot) + f1 +// +// Clamp accumulated limit impulse. +// lower: f2(3) = max(f2(3), 0) +// upper: f2(3) = min(f2(3), 0) +// +// Solve for correct f2(1:2) +// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:3) * f1 +// = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:2) * f1(1:2) + K(1:2,3) * f1(3) +// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3)) + K(1:2,1:2) * f1(1:2) +// f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) +// +// Now compute impulse to be applied: +// df = f2 - f1 + +void b2PrismaticJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + localAxisA = bodyA->GetLocalVector(axis); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_localXAxisA = def->localAxisA; + m_localXAxisA.Normalize(); + m_localYAxisA = b2Cross(1.0f, m_localXAxisA); + m_referenceAngle = def->referenceAngle; + + m_impulse.SetZero(); + m_motorMass = 0.0; + m_motorImpulse = 0.0f; + + m_lowerTranslation = def->lowerTranslation; + m_upperTranslation = def->upperTranslation; + m_maxMotorForce = def->maxMotorForce; + m_motorSpeed = def->motorSpeed; + m_enableLimit = def->enableLimit; + m_enableMotor = def->enableMotor; + m_limitState = e_inactiveLimit; + + m_axis.SetZero(); + m_perp.SetZero(); +} + +void b2PrismaticJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective masses. + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = (cB - cA) + rB - rA; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Compute motor Jacobian and effective mass. + { + m_axis = b2Mul(qA, m_localXAxisA); + m_a1 = b2Cross(d + rA, m_axis); + m_a2 = b2Cross(rB, m_axis); + + m_motorMass = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + } + + // Prismatic constraint. + { + m_perp = b2Mul(qA, m_localYAxisA); + + m_s1 = b2Cross(d + rA, m_perp); + m_s2 = b2Cross(rB, m_perp); + + float32 k11 = mA + mB + iA * m_s1 * m_s1 + iB * m_s2 * m_s2; + float32 k12 = iA * m_s1 + iB * m_s2; + float32 k13 = iA * m_s1 * m_a1 + iB * m_s2 * m_a2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + // For bodies with fixed rotation. + k22 = 1.0f; + } + float32 k23 = iA * m_a1 + iB * m_a2; + float32 k33 = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2; + + m_K.ex.Set(k11, k12, k13); + m_K.ey.Set(k12, k22, k23); + m_K.ez.Set(k13, k23, k33); + } + + // Compute motor and limit terms. + if (m_enableLimit) + { + float32 jointTranslation = b2Dot(m_axis, d); + if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) + { + m_limitState = e_equalLimits; + } + else if (jointTranslation <= m_lowerTranslation) + { + if (m_limitState != e_atLowerLimit) + { + m_limitState = e_atLowerLimit; + m_impulse.z = 0.0f; + } + } + else if (jointTranslation >= m_upperTranslation) + { + if (m_limitState != e_atUpperLimit) + { + m_limitState = e_atUpperLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + + if (m_enableMotor == false) + { + m_motorImpulse = 0.0f; + } + + if (data.step.warmStarting) + { + // Account for variable time step. + m_impulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis; + float32 LA = m_impulse.x * m_s1 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a1; + float32 LB = m_impulse.x * m_s2 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + else + { + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2PrismaticJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Solve linear motor constraint. + if (m_enableMotor && m_limitState != e_equalLimits) + { + float32 Cdot = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; + float32 impulse = m_motorMass * (m_motorSpeed - Cdot); + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorForce; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + b2Vec2 P = impulse * m_axis; + float32 LA = impulse * m_a1; + float32 LB = impulse * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + b2Vec2 Cdot1; + Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; + Cdot1.y = wB - wA; + + if (m_enableLimit && m_limitState != e_inactiveLimit) + { + // Solve prismatic and limit constraint in block form. + float32 Cdot2; + Cdot2 = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 f1 = m_impulse; + b2Vec3 df = m_K.Solve33(-Cdot); + m_impulse += df; + + if (m_limitState == e_atLowerLimit) + { + m_impulse.z = b2Max(m_impulse.z, 0.0f); + } + else if (m_limitState == e_atUpperLimit) + { + m_impulse.z = b2Min(m_impulse.z, 0.0f); + } + + // f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2) + b2Vec2 b = -Cdot1 - (m_impulse.z - f1.z) * b2Vec2(m_K.ez.x, m_K.ez.y); + b2Vec2 f2r = m_K.Solve22(b) + b2Vec2(f1.x, f1.y); + m_impulse.x = f2r.x; + m_impulse.y = f2r.y; + + df = m_impulse - f1; + + b2Vec2 P = df.x * m_perp + df.z * m_axis; + float32 LA = df.x * m_s1 + df.y + df.z * m_a1; + float32 LB = df.x * m_s2 + df.y + df.z * m_a2; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + else + { + // Limit is inactive, just solve the prismatic constraint in block form. + b2Vec2 df = m_K.Solve22(-Cdot1); + m_impulse.x += df.x; + m_impulse.y += df.y; + + b2Vec2 P = df.x * m_perp; + float32 LA = df.x * m_s1 + df.y; + float32 LB = df.x * m_s2 + df.y; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + + b2Vec2 Cdot10 = Cdot1; + + Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; + Cdot1.y = wB - wA; + + if (b2Abs(Cdot1.x) > 0.01f || b2Abs(Cdot1.y) > 0.01f) + { + b2Vec2 test = b2Mul22(m_K, df); + Cdot1.x += 0.0f; + } + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2PrismaticJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + // Compute fresh Jacobians + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = cB + rB - cA - rA; + + b2Vec2 axis = b2Mul(qA, m_localXAxisA); + float32 a1 = b2Cross(d + rA, axis); + float32 a2 = b2Cross(rB, axis); + b2Vec2 perp = b2Mul(qA, m_localYAxisA); + + float32 s1 = b2Cross(d + rA, perp); + float32 s2 = b2Cross(rB, perp); + + b2Vec3 impulse; + b2Vec2 C1; + C1.x = b2Dot(perp, d); + C1.y = aB - aA - m_referenceAngle; + + float32 linearError = b2Abs(C1.x); + float32 angularError = b2Abs(C1.y); + + bool active = false; + float32 C2 = 0.0f; + if (m_enableLimit) + { + float32 translation = b2Dot(axis, d); + if (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop) + { + // Prevent large angular corrections + C2 = b2Clamp(translation, -b2_maxLinearCorrection, b2_maxLinearCorrection); + linearError = b2Max(linearError, b2Abs(translation)); + active = true; + } + else if (translation <= m_lowerTranslation) + { + // Prevent large linear corrections and allow some slop. + C2 = b2Clamp(translation - m_lowerTranslation + b2_linearSlop, -b2_maxLinearCorrection, 0.0f); + linearError = b2Max(linearError, m_lowerTranslation - translation); + active = true; + } + else if (translation >= m_upperTranslation) + { + // Prevent large linear corrections and allow some slop. + C2 = b2Clamp(translation - m_upperTranslation - b2_linearSlop, 0.0f, b2_maxLinearCorrection); + linearError = b2Max(linearError, translation - m_upperTranslation); + active = true; + } + } + + if (active) + { + float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; + float32 k12 = iA * s1 + iB * s2; + float32 k13 = iA * s1 * a1 + iB * s2 * a2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + // For fixed rotation + k22 = 1.0f; + } + float32 k23 = iA * a1 + iB * a2; + float32 k33 = mA + mB + iA * a1 * a1 + iB * a2 * a2; + + b2Mat33 K; + K.ex.Set(k11, k12, k13); + K.ey.Set(k12, k22, k23); + K.ez.Set(k13, k23, k33); + + b2Vec3 C; + C.x = C1.x; + C.y = C1.y; + C.z = C2; + + impulse = K.Solve33(-C); + } + else + { + float32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2; + float32 k12 = iA * s1 + iB * s2; + float32 k22 = iA + iB; + if (k22 == 0.0f) + { + k22 = 1.0f; + } + + b2Mat22 K; + K.ex.Set(k11, k12); + K.ey.Set(k12, k22); + + b2Vec2 impulse1 = K.Solve(-C1); + impulse.x = impulse1.x; + impulse.y = impulse1.y; + impulse.z = 0.0f; + } + + b2Vec2 P = impulse.x * perp + impulse.z * axis; + float32 LA = impulse.x * s1 + impulse.y + impulse.z * a1; + float32 LB = impulse.x * s2 + impulse.y + impulse.z * a2; + + cA -= mA * P; + aA -= iA * LA; + cB += mB * P; + aB += iB * LB; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return linearError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2PrismaticJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2PrismaticJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2PrismaticJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * (m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis); +} + +float32 b2PrismaticJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.y; +} + +float32 b2PrismaticJoint::GetJointTranslation() const +{ + b2Vec2 pA = m_bodyA->GetWorldPoint(m_localAnchorA); + b2Vec2 pB = m_bodyB->GetWorldPoint(m_localAnchorB); + b2Vec2 d = pB - pA; + b2Vec2 axis = m_bodyA->GetWorldVector(m_localXAxisA); + + float32 translation = b2Dot(d, axis); + return translation; +} + +float32 b2PrismaticJoint::GetJointSpeed() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + + b2Vec2 rA = b2Mul(bA->m_xf.q, m_localAnchorA - bA->m_sweep.localCenter); + b2Vec2 rB = b2Mul(bB->m_xf.q, m_localAnchorB - bB->m_sweep.localCenter); + b2Vec2 p1 = bA->m_sweep.c + rA; + b2Vec2 p2 = bB->m_sweep.c + rB; + b2Vec2 d = p2 - p1; + b2Vec2 axis = b2Mul(bA->m_xf.q, m_localXAxisA); + + b2Vec2 vA = bA->m_linearVelocity; + b2Vec2 vB = bB->m_linearVelocity; + float32 wA = bA->m_angularVelocity; + float32 wB = bB->m_angularVelocity; + + float32 speed = b2Dot(d, b2Cross(wA, axis)) + b2Dot(axis, vB + b2Cross(wB, rB) - vA - b2Cross(wA, rA)); + return speed; +} + +bool b2PrismaticJoint::IsLimitEnabled() const +{ + return m_enableLimit; +} + +void b2PrismaticJoint::EnableLimit(bool flag) +{ + if (flag != m_enableLimit) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableLimit = flag; + m_impulse.z = 0.0f; + } +} + +float32 b2PrismaticJoint::GetLowerLimit() const +{ + return m_lowerTranslation; +} + +float32 b2PrismaticJoint::GetUpperLimit() const +{ + return m_upperTranslation; +} + +void b2PrismaticJoint::SetLimits(float32 lower, float32 upper) +{ + b2Assert(lower <= upper); + if (lower != m_lowerTranslation || upper != m_upperTranslation) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_lowerTranslation = lower; + m_upperTranslation = upper; + m_impulse.z = 0.0f; + } +} + +bool b2PrismaticJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2PrismaticJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +void b2PrismaticJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2PrismaticJoint::SetMaxMotorForce(float32 force) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorForce = force; +} + +float32 b2PrismaticJoint::GetMotorForce(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2PrismaticJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2PrismaticJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); + b2Log(" jd.lowerTranslation = %.15lef;\n", m_lowerTranslation); + b2Log(" jd.upperTranslation = %.15lef;\n", m_upperTranslation); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorForce = %.15lef;\n", m_maxMotorForce); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2PrismaticJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2PrismaticJoint.h index 8d0f34229..6ef5d3ec0 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2PrismaticJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2PrismaticJoint.h @@ -1,196 +1,196 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_PRISMATIC_JOINT_H -#define B2_PRISMATIC_JOINT_H - -#include - -/// Prismatic joint definition. This requires defining a line of -/// motion using an axis and an anchor point. The definition uses local -/// anchor points and a local axis so that the initial configuration -/// can violate the constraint slightly. The joint translation is zero -/// when the local anchor points coincide in world space. Using local -/// anchors and a local axis helps when saving and loading a game. -struct b2PrismaticJointDef : public b2JointDef -{ - b2PrismaticJointDef() - { - type = e_prismaticJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - localAxisA.Set(1.0f, 0.0f); - referenceAngle = 0.0f; - enableLimit = false; - lowerTranslation = 0.0f; - upperTranslation = 0.0f; - enableMotor = false; - maxMotorForce = 0.0f; - motorSpeed = 0.0f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and unit world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The local translation unit axis in bodyA. - b2Vec2 localAxisA; - - /// The constrained angle between the bodies: bodyB_angle - bodyA_angle. - float32 referenceAngle; - - /// Enable/disable the joint limit. - bool enableLimit; - - /// The lower translation limit, usually in meters. - float32 lowerTranslation; - - /// The upper translation limit, usually in meters. - float32 upperTranslation; - - /// Enable/disable the joint motor. - bool enableMotor; - - /// The maximum motor torque, usually in N-m. - float32 maxMotorForce; - - /// The desired motor speed in radians per second. - float32 motorSpeed; -}; - -/// A prismatic joint. This joint provides one degree of freedom: translation -/// along an axis fixed in bodyA. Relative rotation is prevented. You can -/// use a joint limit to restrict the range of motion and a joint motor to -/// drive the motion or to model joint friction. -class b2PrismaticJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// The local joint axis relative to bodyA. - const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Get the current joint translation, usually in meters. - float32 GetJointTranslation() const; - - /// Get the current joint translation speed, usually in meters per second. - float32 GetJointSpeed() const; - - /// Is the joint limit enabled? - bool IsLimitEnabled() const; - - /// Enable/disable the joint limit. - void EnableLimit(bool flag); - - /// Get the lower joint limit, usually in meters. - float32 GetLowerLimit() const; - - /// Get the upper joint limit, usually in meters. - float32 GetUpperLimit() const; - - /// Set the joint limits, usually in meters. - void SetLimits(float32 lower, float32 upper); - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed, usually in meters per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed, usually in meters per second. - float32 GetMotorSpeed() const; - - /// Set the maximum motor force, usually in N. - void SetMaxMotorForce(float32 force); - float32 GetMaxMotorForce() const { return m_maxMotorForce; } - - /// Get the current motor force given the inverse time step, usually in N. - float32 GetMotorForce(float32 inv_dt) const; - - /// Dump to b2Log - void Dump(); - -protected: - friend class b2Joint; - friend class b2GearJoint; - b2PrismaticJoint(const b2PrismaticJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localXAxisA; - b2Vec2 m_localYAxisA; - float32 m_referenceAngle; - b2Vec3 m_impulse; - float32 m_motorImpulse; - float32 m_lowerTranslation; - float32 m_upperTranslation; - float32 m_maxMotorForce; - float32 m_motorSpeed; - bool m_enableLimit; - bool m_enableMotor; - b2LimitState m_limitState; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Vec2 m_axis, m_perp; - float32 m_s1, m_s2; - float32 m_a1, m_a2; - b2Mat33 m_K; - float32 m_motorMass; -}; - -inline float32 b2PrismaticJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_PRISMATIC_JOINT_H +#define B2_PRISMATIC_JOINT_H + +#include + +/// Prismatic joint definition. This requires defining a line of +/// motion using an axis and an anchor point. The definition uses local +/// anchor points and a local axis so that the initial configuration +/// can violate the constraint slightly. The joint translation is zero +/// when the local anchor points coincide in world space. Using local +/// anchors and a local axis helps when saving and loading a game. +struct b2PrismaticJointDef : public b2JointDef +{ + b2PrismaticJointDef() + { + type = e_prismaticJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + localAxisA.Set(1.0f, 0.0f); + referenceAngle = 0.0f; + enableLimit = false; + lowerTranslation = 0.0f; + upperTranslation = 0.0f; + enableMotor = false; + maxMotorForce = 0.0f; + motorSpeed = 0.0f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and unit world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The local translation unit axis in bodyA. + b2Vec2 localAxisA; + + /// The constrained angle between the bodies: bodyB_angle - bodyA_angle. + float32 referenceAngle; + + /// Enable/disable the joint limit. + bool enableLimit; + + /// The lower translation limit, usually in meters. + float32 lowerTranslation; + + /// The upper translation limit, usually in meters. + float32 upperTranslation; + + /// Enable/disable the joint motor. + bool enableMotor; + + /// The maximum motor torque, usually in N-m. + float32 maxMotorForce; + + /// The desired motor speed in radians per second. + float32 motorSpeed; +}; + +/// A prismatic joint. This joint provides one degree of freedom: translation +/// along an axis fixed in bodyA. Relative rotation is prevented. You can +/// use a joint limit to restrict the range of motion and a joint motor to +/// drive the motion or to model joint friction. +class b2PrismaticJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// The local joint axis relative to bodyA. + const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Get the current joint translation, usually in meters. + float32 GetJointTranslation() const; + + /// Get the current joint translation speed, usually in meters per second. + float32 GetJointSpeed() const; + + /// Is the joint limit enabled? + bool IsLimitEnabled() const; + + /// Enable/disable the joint limit. + void EnableLimit(bool flag); + + /// Get the lower joint limit, usually in meters. + float32 GetLowerLimit() const; + + /// Get the upper joint limit, usually in meters. + float32 GetUpperLimit() const; + + /// Set the joint limits, usually in meters. + void SetLimits(float32 lower, float32 upper); + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed, usually in meters per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed, usually in meters per second. + float32 GetMotorSpeed() const; + + /// Set the maximum motor force, usually in N. + void SetMaxMotorForce(float32 force); + float32 GetMaxMotorForce() const { return m_maxMotorForce; } + + /// Get the current motor force given the inverse time step, usually in N. + float32 GetMotorForce(float32 inv_dt) const; + + /// Dump to b2Log + void Dump(); + +protected: + friend class b2Joint; + friend class b2GearJoint; + b2PrismaticJoint(const b2PrismaticJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localXAxisA; + b2Vec2 m_localYAxisA; + float32 m_referenceAngle; + b2Vec3 m_impulse; + float32 m_motorImpulse; + float32 m_lowerTranslation; + float32 m_upperTranslation; + float32 m_maxMotorForce; + float32 m_motorSpeed; + bool m_enableLimit; + bool m_enableMotor; + b2LimitState m_limitState; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Vec2 m_axis, m_perp; + float32 m_s1, m_s2; + float32 m_a1, m_a2; + b2Mat33 m_K; + float32 m_motorMass; +}; + +inline float32 b2PrismaticJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.cpp index e0bb7da51..b7bab69fc 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.cpp @@ -1,332 +1,332 @@ -/* -* Copyright (c) 2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Pulley: -// length1 = norm(p1 - s1) -// length2 = norm(p2 - s2) -// C0 = (length1 + ratio * length2)_initial -// C = C0 - (length1 + ratio * length2) -// u1 = (p1 - s1) / norm(p1 - s1) -// u2 = (p2 - s2) / norm(p2 - s2) -// Cdot = -dot(u1, v1 + cross(w1, r1)) - ratio * dot(u2, v2 + cross(w2, r2)) -// J = -[u1 cross(r1, u1) ratio * u2 ratio * cross(r2, u2)] -// K = J * invM * JT -// = invMass1 + invI1 * cross(r1, u1)^2 + ratio^2 * (invMass2 + invI2 * cross(r2, u2)^2) - -void b2PulleyJointDef::Initialize(b2Body* bA, b2Body* bB, - const b2Vec2& groundA, const b2Vec2& groundB, - const b2Vec2& anchorA, const b2Vec2& anchorB, - float32 r) -{ - bodyA = bA; - bodyB = bB; - groundAnchorA = groundA; - groundAnchorB = groundB; - localAnchorA = bodyA->GetLocalPoint(anchorA); - localAnchorB = bodyB->GetLocalPoint(anchorB); - b2Vec2 dA = anchorA - groundA; - lengthA = dA.Length(); - b2Vec2 dB = anchorB - groundB; - lengthB = dB.Length(); - ratio = r; - b2Assert(ratio > b2_epsilon); -} - -b2PulleyJoint::b2PulleyJoint(const b2PulleyJointDef* def) -: b2Joint(def) -{ - m_groundAnchorA = def->groundAnchorA; - m_groundAnchorB = def->groundAnchorB; - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_lengthA = def->lengthA; - m_lengthB = def->lengthB; - - b2Assert(def->ratio != 0.0f); - m_ratio = def->ratio; - - m_constant = def->lengthA + m_ratio * def->lengthB; - - m_impulse = 0.0f; -} - -void b2PulleyJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // Get the pulley axes. - m_uA = cA + m_rA - m_groundAnchorA; - m_uB = cB + m_rB - m_groundAnchorB; - - float32 lengthA = m_uA.Length(); - float32 lengthB = m_uB.Length(); - - if (lengthA > 10.0f * b2_linearSlop) - { - m_uA *= 1.0f / lengthA; - } - else - { - m_uA.SetZero(); - } - - if (lengthB > 10.0f * b2_linearSlop) - { - m_uB *= 1.0f / lengthB; - } - else - { - m_uB.SetZero(); - } - - // Compute effective mass. - float32 ruA = b2Cross(m_rA, m_uA); - float32 ruB = b2Cross(m_rB, m_uB); - - float32 mA = m_invMassA + m_invIA * ruA * ruA; - float32 mB = m_invMassB + m_invIB * ruB * ruB; - - m_mass = mA + m_ratio * m_ratio * mB; - - if (m_mass > 0.0f) - { - m_mass = 1.0f / m_mass; - } - - if (data.step.warmStarting) - { - // Scale impulses to support variable time steps. - m_impulse *= data.step.dtRatio; - - // Warm starting. - b2Vec2 PA = -(m_impulse) * m_uA; - b2Vec2 PB = (-m_ratio * m_impulse) * m_uB; - - vA += m_invMassA * PA; - wA += m_invIA * b2Cross(m_rA, PA); - vB += m_invMassB * PB; - wB += m_invIB * b2Cross(m_rB, PB); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2PulleyJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - - float32 Cdot = -b2Dot(m_uA, vpA) - m_ratio * b2Dot(m_uB, vpB); - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - b2Vec2 PA = -impulse * m_uA; - b2Vec2 PB = -m_ratio * impulse * m_uB; - vA += m_invMassA * PA; - wA += m_invIA * b2Cross(m_rA, PA); - vB += m_invMassB * PB; - wB += m_invIB * b2Cross(m_rB, PB); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2PulleyJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // Get the pulley axes. - b2Vec2 uA = cA + rA - m_groundAnchorA; - b2Vec2 uB = cB + rB - m_groundAnchorB; - - float32 lengthA = uA.Length(); - float32 lengthB = uB.Length(); - - if (lengthA > 10.0f * b2_linearSlop) - { - uA *= 1.0f / lengthA; - } - else - { - uA.SetZero(); - } - - if (lengthB > 10.0f * b2_linearSlop) - { - uB *= 1.0f / lengthB; - } - else - { - uB.SetZero(); - } - - // Compute effective mass. - float32 ruA = b2Cross(rA, uA); - float32 ruB = b2Cross(rB, uB); - - float32 mA = m_invMassA + m_invIA * ruA * ruA; - float32 mB = m_invMassB + m_invIB * ruB * ruB; - - float32 mass = mA + m_ratio * m_ratio * mB; - - if (mass > 0.0f) - { - mass = 1.0f / mass; - } - - float32 C = m_constant - lengthA - m_ratio * lengthB; - float32 linearError = b2Abs(C); - - float32 impulse = -mass * C; - - b2Vec2 PA = -impulse * uA; - b2Vec2 PB = -m_ratio * impulse * uB; - - cA += m_invMassA * PA; - aA += m_invIA * b2Cross(rA, PA); - cB += m_invMassB * PB; - aB += m_invIB * b2Cross(rB, PB); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return linearError < b2_linearSlop; -} - -b2Vec2 b2PulleyJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2PulleyJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2PulleyJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P = m_impulse * m_uB; - return inv_dt * P; -} - -float32 b2PulleyJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -b2Vec2 b2PulleyJoint::GetGroundAnchorA() const -{ - return m_groundAnchorA; -} - -b2Vec2 b2PulleyJoint::GetGroundAnchorB() const -{ - return m_groundAnchorB; -} - -float32 b2PulleyJoint::GetLengthA() const -{ - b2Vec2 p = m_bodyA->GetWorldPoint(m_localAnchorA); - b2Vec2 s = m_groundAnchorA; - b2Vec2 d = p - s; - return d.Length(); -} - -float32 b2PulleyJoint::GetLengthB() const -{ - b2Vec2 p = m_bodyB->GetWorldPoint(m_localAnchorB); - b2Vec2 s = m_groundAnchorB; - b2Vec2 d = p - s; - return d.Length(); -} - -float32 b2PulleyJoint::GetRatio() const -{ - return m_ratio; -} - -void b2PulleyJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2PulleyJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.groundAnchorA.Set(%.15lef, %.15lef);\n", m_groundAnchorA.x, m_groundAnchorA.y); - b2Log(" jd.groundAnchorB.Set(%.15lef, %.15lef);\n", m_groundAnchorB.x, m_groundAnchorB.y); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.lengthA = %.15lef;\n", m_lengthA); - b2Log(" jd.lengthB = %.15lef;\n", m_lengthB); - b2Log(" jd.ratio = %.15lef;\n", m_ratio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Pulley: +// length1 = norm(p1 - s1) +// length2 = norm(p2 - s2) +// C0 = (length1 + ratio * length2)_initial +// C = C0 - (length1 + ratio * length2) +// u1 = (p1 - s1) / norm(p1 - s1) +// u2 = (p2 - s2) / norm(p2 - s2) +// Cdot = -dot(u1, v1 + cross(w1, r1)) - ratio * dot(u2, v2 + cross(w2, r2)) +// J = -[u1 cross(r1, u1) ratio * u2 ratio * cross(r2, u2)] +// K = J * invM * JT +// = invMass1 + invI1 * cross(r1, u1)^2 + ratio^2 * (invMass2 + invI2 * cross(r2, u2)^2) + +void b2PulleyJointDef::Initialize(b2Body* bA, b2Body* bB, + const b2Vec2& groundA, const b2Vec2& groundB, + const b2Vec2& anchorA, const b2Vec2& anchorB, + float32 r) +{ + bodyA = bA; + bodyB = bB; + groundAnchorA = groundA; + groundAnchorB = groundB; + localAnchorA = bodyA->GetLocalPoint(anchorA); + localAnchorB = bodyB->GetLocalPoint(anchorB); + b2Vec2 dA = anchorA - groundA; + lengthA = dA.Length(); + b2Vec2 dB = anchorB - groundB; + lengthB = dB.Length(); + ratio = r; + b2Assert(ratio > b2_epsilon); +} + +b2PulleyJoint::b2PulleyJoint(const b2PulleyJointDef* def) +: b2Joint(def) +{ + m_groundAnchorA = def->groundAnchorA; + m_groundAnchorB = def->groundAnchorB; + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_lengthA = def->lengthA; + m_lengthB = def->lengthB; + + b2Assert(def->ratio != 0.0f); + m_ratio = def->ratio; + + m_constant = def->lengthA + m_ratio * def->lengthB; + + m_impulse = 0.0f; +} + +void b2PulleyJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // Get the pulley axes. + m_uA = cA + m_rA - m_groundAnchorA; + m_uB = cB + m_rB - m_groundAnchorB; + + float32 lengthA = m_uA.Length(); + float32 lengthB = m_uB.Length(); + + if (lengthA > 10.0f * b2_linearSlop) + { + m_uA *= 1.0f / lengthA; + } + else + { + m_uA.SetZero(); + } + + if (lengthB > 10.0f * b2_linearSlop) + { + m_uB *= 1.0f / lengthB; + } + else + { + m_uB.SetZero(); + } + + // Compute effective mass. + float32 ruA = b2Cross(m_rA, m_uA); + float32 ruB = b2Cross(m_rB, m_uB); + + float32 mA = m_invMassA + m_invIA * ruA * ruA; + float32 mB = m_invMassB + m_invIB * ruB * ruB; + + m_mass = mA + m_ratio * m_ratio * mB; + + if (m_mass > 0.0f) + { + m_mass = 1.0f / m_mass; + } + + if (data.step.warmStarting) + { + // Scale impulses to support variable time steps. + m_impulse *= data.step.dtRatio; + + // Warm starting. + b2Vec2 PA = -(m_impulse) * m_uA; + b2Vec2 PB = (-m_ratio * m_impulse) * m_uB; + + vA += m_invMassA * PA; + wA += m_invIA * b2Cross(m_rA, PA); + vB += m_invMassB * PB; + wB += m_invIB * b2Cross(m_rB, PB); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2PulleyJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + + float32 Cdot = -b2Dot(m_uA, vpA) - m_ratio * b2Dot(m_uB, vpB); + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + b2Vec2 PA = -impulse * m_uA; + b2Vec2 PB = -m_ratio * impulse * m_uB; + vA += m_invMassA * PA; + wA += m_invIA * b2Cross(m_rA, PA); + vB += m_invMassB * PB; + wB += m_invIB * b2Cross(m_rB, PB); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2PulleyJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // Get the pulley axes. + b2Vec2 uA = cA + rA - m_groundAnchorA; + b2Vec2 uB = cB + rB - m_groundAnchorB; + + float32 lengthA = uA.Length(); + float32 lengthB = uB.Length(); + + if (lengthA > 10.0f * b2_linearSlop) + { + uA *= 1.0f / lengthA; + } + else + { + uA.SetZero(); + } + + if (lengthB > 10.0f * b2_linearSlop) + { + uB *= 1.0f / lengthB; + } + else + { + uB.SetZero(); + } + + // Compute effective mass. + float32 ruA = b2Cross(rA, uA); + float32 ruB = b2Cross(rB, uB); + + float32 mA = m_invMassA + m_invIA * ruA * ruA; + float32 mB = m_invMassB + m_invIB * ruB * ruB; + + float32 mass = mA + m_ratio * m_ratio * mB; + + if (mass > 0.0f) + { + mass = 1.0f / mass; + } + + float32 C = m_constant - lengthA - m_ratio * lengthB; + float32 linearError = b2Abs(C); + + float32 impulse = -mass * C; + + b2Vec2 PA = -impulse * uA; + b2Vec2 PB = -m_ratio * impulse * uB; + + cA += m_invMassA * PA; + aA += m_invIA * b2Cross(rA, PA); + cB += m_invMassB * PB; + aB += m_invIB * b2Cross(rB, PB); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return linearError < b2_linearSlop; +} + +b2Vec2 b2PulleyJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2PulleyJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2PulleyJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P = m_impulse * m_uB; + return inv_dt * P; +} + +float32 b2PulleyJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +b2Vec2 b2PulleyJoint::GetGroundAnchorA() const +{ + return m_groundAnchorA; +} + +b2Vec2 b2PulleyJoint::GetGroundAnchorB() const +{ + return m_groundAnchorB; +} + +float32 b2PulleyJoint::GetLengthA() const +{ + b2Vec2 p = m_bodyA->GetWorldPoint(m_localAnchorA); + b2Vec2 s = m_groundAnchorA; + b2Vec2 d = p - s; + return d.Length(); +} + +float32 b2PulleyJoint::GetLengthB() const +{ + b2Vec2 p = m_bodyB->GetWorldPoint(m_localAnchorB); + b2Vec2 s = m_groundAnchorB; + b2Vec2 d = p - s; + return d.Length(); +} + +float32 b2PulleyJoint::GetRatio() const +{ + return m_ratio; +} + +void b2PulleyJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2PulleyJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.groundAnchorA.Set(%.15lef, %.15lef);\n", m_groundAnchorA.x, m_groundAnchorA.y); + b2Log(" jd.groundAnchorB.Set(%.15lef, %.15lef);\n", m_groundAnchorB.x, m_groundAnchorB.y); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.lengthA = %.15lef;\n", m_lengthA); + b2Log(" jd.lengthB = %.15lef;\n", m_lengthB); + b2Log(" jd.ratio = %.15lef;\n", m_ratio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.h index 639789f52..24480ba05 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.h @@ -1,143 +1,143 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_PULLEY_JOINT_H -#define B2_PULLEY_JOINT_H - -#include - -const float32 b2_minPulleyLength = 2.0f; - -/// Pulley joint definition. This requires two ground anchors, -/// two dynamic body anchor points, and a pulley ratio. -struct b2PulleyJointDef : public b2JointDef -{ - b2PulleyJointDef() - { - type = e_pulleyJoint; - groundAnchorA.Set(-1.0f, 1.0f); - groundAnchorB.Set(1.0f, 1.0f); - localAnchorA.Set(-1.0f, 0.0f); - localAnchorB.Set(1.0f, 0.0f); - lengthA = 0.0f; - lengthB = 0.0f; - ratio = 1.0f; - collideConnected = true; - } - - /// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. - void Initialize(b2Body* bodyA, b2Body* bodyB, - const b2Vec2& groundAnchorA, const b2Vec2& groundAnchorB, - const b2Vec2& anchorA, const b2Vec2& anchorB, - float32 ratio); - - /// The first ground anchor in world coordinates. This point never moves. - b2Vec2 groundAnchorA; - - /// The second ground anchor in world coordinates. This point never moves. - b2Vec2 groundAnchorB; - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The a reference length for the segment attached to bodyA. - float32 lengthA; - - /// The a reference length for the segment attached to bodyB. - float32 lengthB; - - /// The pulley ratio, used to simulate a block-and-tackle. - float32 ratio; -}; - -/// The pulley joint is connected to two bodies and two fixed ground points. -/// The pulley supports a ratio such that: -/// length1 + ratio * length2 <= constant -/// Yes, the force transmitted is scaled by the ratio. -/// Warning: the pulley joint can get a bit squirrelly by itself. They often -/// work better when combined with prismatic joints. You should also cover the -/// the anchor points with static shapes to prevent one side from going to -/// zero length. -class b2PulleyJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the first ground anchor. - b2Vec2 GetGroundAnchorA() const; - - /// Get the second ground anchor. - b2Vec2 GetGroundAnchorB() const; - - /// Get the current length of the segment attached to bodyA. - float32 GetLengthA() const; - - /// Get the current length of the segment attached to bodyB. - float32 GetLengthB() const; - - /// Get the pulley ratio. - float32 GetRatio() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2PulleyJoint(const b2PulleyJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - b2Vec2 m_groundAnchorA; - b2Vec2 m_groundAnchorB; - float32 m_lengthA; - float32 m_lengthB; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_constant; - float32 m_ratio; - float32 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_uA; - b2Vec2 m_uB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; -}; - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_PULLEY_JOINT_H +#define B2_PULLEY_JOINT_H + +#include + +const float32 b2_minPulleyLength = 2.0f; + +/// Pulley joint definition. This requires two ground anchors, +/// two dynamic body anchor points, and a pulley ratio. +struct b2PulleyJointDef : public b2JointDef +{ + b2PulleyJointDef() + { + type = e_pulleyJoint; + groundAnchorA.Set(-1.0f, 1.0f); + groundAnchorB.Set(1.0f, 1.0f); + localAnchorA.Set(-1.0f, 0.0f); + localAnchorB.Set(1.0f, 0.0f); + lengthA = 0.0f; + lengthB = 0.0f; + ratio = 1.0f; + collideConnected = true; + } + + /// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. + void Initialize(b2Body* bodyA, b2Body* bodyB, + const b2Vec2& groundAnchorA, const b2Vec2& groundAnchorB, + const b2Vec2& anchorA, const b2Vec2& anchorB, + float32 ratio); + + /// The first ground anchor in world coordinates. This point never moves. + b2Vec2 groundAnchorA; + + /// The second ground anchor in world coordinates. This point never moves. + b2Vec2 groundAnchorB; + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The a reference length for the segment attached to bodyA. + float32 lengthA; + + /// The a reference length for the segment attached to bodyB. + float32 lengthB; + + /// The pulley ratio, used to simulate a block-and-tackle. + float32 ratio; +}; + +/// The pulley joint is connected to two bodies and two fixed ground points. +/// The pulley supports a ratio such that: +/// length1 + ratio * length2 <= constant +/// Yes, the force transmitted is scaled by the ratio. +/// Warning: the pulley joint can get a bit squirrelly by itself. They often +/// work better when combined with prismatic joints. You should also cover the +/// the anchor points with static shapes to prevent one side from going to +/// zero length. +class b2PulleyJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the first ground anchor. + b2Vec2 GetGroundAnchorA() const; + + /// Get the second ground anchor. + b2Vec2 GetGroundAnchorB() const; + + /// Get the current length of the segment attached to bodyA. + float32 GetLengthA() const; + + /// Get the current length of the segment attached to bodyB. + float32 GetLengthB() const; + + /// Get the pulley ratio. + float32 GetRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2PulleyJoint(const b2PulleyJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_groundAnchorA; + b2Vec2 m_groundAnchorB; + float32 m_lengthA; + float32 m_lengthB; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_constant; + float32 m_ratio; + float32 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_uA; + b2Vec2 m_uB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp index ffb17252c..e658f38b0 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp @@ -1,504 +1,504 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// C = p2 - p1 -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Motor constraint -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2RevoluteJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2RevoluteJoint::b2RevoluteJoint(const b2RevoluteJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_referenceAngle = def->referenceAngle; - - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - - m_lowerAngle = def->lowerAngle; - m_upperAngle = def->upperAngle; - m_maxMotorTorque = def->maxMotorTorque; - m_motorSpeed = def->motorSpeed; - m_enableLimit = def->enableLimit; - m_enableMotor = def->enableMotor; - m_limitState = e_inactiveLimit; -} - -void b2RevoluteJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - bool fixedRotation = (iA + iB == 0.0f); - - m_mass.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; - m_mass.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; - m_mass.ez.x = -m_rA.y * iA - m_rB.y * iB; - m_mass.ex.y = m_mass.ey.x; - m_mass.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; - m_mass.ez.y = m_rA.x * iA + m_rB.x * iB; - m_mass.ex.z = m_mass.ez.x; - m_mass.ey.z = m_mass.ez.y; - m_mass.ez.z = iA + iB; - - m_motorMass = iA + iB; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - - if (m_enableMotor == false || fixedRotation) - { - m_motorImpulse = 0.0f; - } - - if (m_enableLimit && fixedRotation == false) - { - float32 jointAngle = aB - aA - m_referenceAngle; - if (b2Abs(m_upperAngle - m_lowerAngle) < 2.0f * b2_angularSlop) - { - m_limitState = e_equalLimits; - } - else if (jointAngle <= m_lowerAngle) - { - if (m_limitState != e_atLowerLimit) - { - m_impulse.z = 0.0f; - } - m_limitState = e_atLowerLimit; - } - else if (jointAngle >= m_upperAngle) - { - if (m_limitState != e_atUpperLimit) - { - m_impulse.z = 0.0f; - } - m_limitState = e_atUpperLimit; - } - else - { - m_limitState = e_inactiveLimit; - m_impulse.z = 0.0f; - } - } - else - { - m_limitState = e_inactiveLimit; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_impulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P(m_impulse.x, m_impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_motorImpulse + m_impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_motorImpulse + m_impulse.z); - } - else - { - m_impulse.SetZero(); - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2RevoluteJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - bool fixedRotation = (iA + iB == 0.0f); - - // Solve motor constraint. - if (m_enableMotor && m_limitState != e_equalLimits && fixedRotation == false) - { - float32 Cdot = wB - wA - m_motorSpeed; - float32 impulse = -m_motorMass * Cdot; - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorTorque; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve limit constraint. - if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) - { - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - float32 Cdot2 = wB - wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 impulse = -m_mass.Solve33(Cdot); - - if (m_limitState == e_equalLimits) - { - m_impulse += impulse; - } - else if (m_limitState == e_atLowerLimit) - { - float32 newImpulse = m_impulse.z + impulse.z; - if (newImpulse < 0.0f) - { - b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); - b2Vec2 reduced = m_mass.Solve22(rhs); - impulse.x = reduced.x; - impulse.y = reduced.y; - impulse.z = -m_impulse.z; - m_impulse.x += reduced.x; - m_impulse.y += reduced.y; - m_impulse.z = 0.0f; - } - else - { - m_impulse += impulse; - } - } - else if (m_limitState == e_atUpperLimit) - { - float32 newImpulse = m_impulse.z + impulse.z; - if (newImpulse > 0.0f) - { - b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); - b2Vec2 reduced = m_mass.Solve22(rhs); - impulse.x = reduced.x; - impulse.y = reduced.y; - impulse.z = -m_impulse.z; - m_impulse.x += reduced.x; - m_impulse.y += reduced.y; - m_impulse.z = 0.0f; - } - else - { - m_impulse += impulse; - } - } - - b2Vec2 P(impulse.x, impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + impulse.z); - } - else - { - // Solve point-to-point constraint - b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - b2Vec2 impulse = m_mass.Solve22(-Cdot); - - m_impulse.x += impulse.x; - m_impulse.y += impulse.y; - - vA -= mA * impulse; - wA -= iA * b2Cross(m_rA, impulse); - - vB += mB * impulse; - wB += iB * b2Cross(m_rB, impulse); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2RevoluteJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 angularError = 0.0f; - float32 positionError = 0.0f; - - bool fixedRotation = (m_invIA + m_invIB == 0.0f); - - // Solve angular limit constraint. - if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) - { - float32 angle = aB - aA - m_referenceAngle; - float32 limitImpulse = 0.0f; - - if (m_limitState == e_equalLimits) - { - // Prevent large angular corrections - float32 C = b2Clamp(angle - m_lowerAngle, -b2_maxAngularCorrection, b2_maxAngularCorrection); - limitImpulse = -m_motorMass * C; - angularError = b2Abs(C); - } - else if (m_limitState == e_atLowerLimit) - { - float32 C = angle - m_lowerAngle; - angularError = -C; - - // Prevent large angular corrections and allow some slop. - C = b2Clamp(C + b2_angularSlop, -b2_maxAngularCorrection, 0.0f); - limitImpulse = -m_motorMass * C; - } - else if (m_limitState == e_atUpperLimit) - { - float32 C = angle - m_upperAngle; - angularError = C; - - // Prevent large angular corrections and allow some slop. - C = b2Clamp(C - b2_angularSlop, 0.0f, b2_maxAngularCorrection); - limitImpulse = -m_motorMass * C; - } - - aA -= m_invIA * limitImpulse; - aB += m_invIB * limitImpulse; - } - - // Solve point-to-point constraint. - { - qA.Set(aA); - qB.Set(aB); - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - b2Vec2 C = cB + rB - cA - rA; - positionError = C.Length(); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat22 K; - K.ex.x = mA + mB + iA * rA.y * rA.y + iB * rB.y * rB.y; - K.ex.y = -iA * rA.x * rA.y - iB * rB.x * rB.y; - K.ey.x = K.ex.y; - K.ey.y = mA + mB + iA * rA.x * rA.x + iB * rB.x * rB.x; - - b2Vec2 impulse = -K.Solve(C); - - cA -= mA * impulse; - aA -= iA * b2Cross(rA, impulse); - - cB += mB * impulse; - aB += iB * b2Cross(rB, impulse); - } - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return positionError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2RevoluteJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2RevoluteJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2RevoluteJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P(m_impulse.x, m_impulse.y); - return inv_dt * P; -} - -float32 b2RevoluteJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.z; -} - -float32 b2RevoluteJoint::GetJointAngle() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - return bB->m_sweep.a - bA->m_sweep.a - m_referenceAngle; -} - -float32 b2RevoluteJoint::GetJointSpeed() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - return bB->m_angularVelocity - bA->m_angularVelocity; -} - -bool b2RevoluteJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2RevoluteJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -float32 b2RevoluteJoint::GetMotorTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2RevoluteJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2RevoluteJoint::SetMaxMotorTorque(float32 torque) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorTorque = torque; -} - -bool b2RevoluteJoint::IsLimitEnabled() const -{ - return m_enableLimit; -} - -void b2RevoluteJoint::EnableLimit(bool flag) -{ - if (flag != m_enableLimit) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableLimit = flag; - m_impulse.z = 0.0f; - } -} - -float32 b2RevoluteJoint::GetLowerLimit() const -{ - return m_lowerAngle; -} - -float32 b2RevoluteJoint::GetUpperLimit() const -{ - return m_upperAngle; -} - -void b2RevoluteJoint::SetLimits(float32 lower, float32 upper) -{ - b2Assert(lower <= upper); - - if (lower != m_lowerAngle || upper != m_upperAngle) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_impulse.z = 0.0f; - m_lowerAngle = lower; - m_upperAngle = upper; - } -} - -void b2RevoluteJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2RevoluteJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); - b2Log(" jd.lowerAngle = %.15lef;\n", m_lowerAngle); - b2Log(" jd.upperAngle = %.15lef;\n", m_upperAngle); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// C = p2 - p1 +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Motor constraint +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2RevoluteJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2RevoluteJoint::b2RevoluteJoint(const b2RevoluteJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_referenceAngle = def->referenceAngle; + + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + + m_lowerAngle = def->lowerAngle; + m_upperAngle = def->upperAngle; + m_maxMotorTorque = def->maxMotorTorque; + m_motorSpeed = def->motorSpeed; + m_enableLimit = def->enableLimit; + m_enableMotor = def->enableMotor; + m_limitState = e_inactiveLimit; +} + +void b2RevoluteJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + bool fixedRotation = (iA + iB == 0.0f); + + m_mass.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; + m_mass.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; + m_mass.ez.x = -m_rA.y * iA - m_rB.y * iB; + m_mass.ex.y = m_mass.ey.x; + m_mass.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; + m_mass.ez.y = m_rA.x * iA + m_rB.x * iB; + m_mass.ex.z = m_mass.ez.x; + m_mass.ey.z = m_mass.ez.y; + m_mass.ez.z = iA + iB; + + m_motorMass = iA + iB; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + + if (m_enableMotor == false || fixedRotation) + { + m_motorImpulse = 0.0f; + } + + if (m_enableLimit && fixedRotation == false) + { + float32 jointAngle = aB - aA - m_referenceAngle; + if (b2Abs(m_upperAngle - m_lowerAngle) < 2.0f * b2_angularSlop) + { + m_limitState = e_equalLimits; + } + else if (jointAngle <= m_lowerAngle) + { + if (m_limitState != e_atLowerLimit) + { + m_impulse.z = 0.0f; + } + m_limitState = e_atLowerLimit; + } + else if (jointAngle >= m_upperAngle) + { + if (m_limitState != e_atUpperLimit) + { + m_impulse.z = 0.0f; + } + m_limitState = e_atUpperLimit; + } + else + { + m_limitState = e_inactiveLimit; + m_impulse.z = 0.0f; + } + } + else + { + m_limitState = e_inactiveLimit; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_impulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P(m_impulse.x, m_impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_motorImpulse + m_impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_motorImpulse + m_impulse.z); + } + else + { + m_impulse.SetZero(); + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2RevoluteJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + bool fixedRotation = (iA + iB == 0.0f); + + // Solve motor constraint. + if (m_enableMotor && m_limitState != e_equalLimits && fixedRotation == false) + { + float32 Cdot = wB - wA - m_motorSpeed; + float32 impulse = -m_motorMass * Cdot; + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorTorque; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve limit constraint. + if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) + { + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + float32 Cdot2 = wB - wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 impulse = -m_mass.Solve33(Cdot); + + if (m_limitState == e_equalLimits) + { + m_impulse += impulse; + } + else if (m_limitState == e_atLowerLimit) + { + float32 newImpulse = m_impulse.z + impulse.z; + if (newImpulse < 0.0f) + { + b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); + b2Vec2 reduced = m_mass.Solve22(rhs); + impulse.x = reduced.x; + impulse.y = reduced.y; + impulse.z = -m_impulse.z; + m_impulse.x += reduced.x; + m_impulse.y += reduced.y; + m_impulse.z = 0.0f; + } + else + { + m_impulse += impulse; + } + } + else if (m_limitState == e_atUpperLimit) + { + float32 newImpulse = m_impulse.z + impulse.z; + if (newImpulse > 0.0f) + { + b2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y); + b2Vec2 reduced = m_mass.Solve22(rhs); + impulse.x = reduced.x; + impulse.y = reduced.y; + impulse.z = -m_impulse.z; + m_impulse.x += reduced.x; + m_impulse.y += reduced.y; + m_impulse.z = 0.0f; + } + else + { + m_impulse += impulse; + } + } + + b2Vec2 P(impulse.x, impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + impulse.z); + } + else + { + // Solve point-to-point constraint + b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + b2Vec2 impulse = m_mass.Solve22(-Cdot); + + m_impulse.x += impulse.x; + m_impulse.y += impulse.y; + + vA -= mA * impulse; + wA -= iA * b2Cross(m_rA, impulse); + + vB += mB * impulse; + wB += iB * b2Cross(m_rB, impulse); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2RevoluteJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 angularError = 0.0f; + float32 positionError = 0.0f; + + bool fixedRotation = (m_invIA + m_invIB == 0.0f); + + // Solve angular limit constraint. + if (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false) + { + float32 angle = aB - aA - m_referenceAngle; + float32 limitImpulse = 0.0f; + + if (m_limitState == e_equalLimits) + { + // Prevent large angular corrections + float32 C = b2Clamp(angle - m_lowerAngle, -b2_maxAngularCorrection, b2_maxAngularCorrection); + limitImpulse = -m_motorMass * C; + angularError = b2Abs(C); + } + else if (m_limitState == e_atLowerLimit) + { + float32 C = angle - m_lowerAngle; + angularError = -C; + + // Prevent large angular corrections and allow some slop. + C = b2Clamp(C + b2_angularSlop, -b2_maxAngularCorrection, 0.0f); + limitImpulse = -m_motorMass * C; + } + else if (m_limitState == e_atUpperLimit) + { + float32 C = angle - m_upperAngle; + angularError = C; + + // Prevent large angular corrections and allow some slop. + C = b2Clamp(C - b2_angularSlop, 0.0f, b2_maxAngularCorrection); + limitImpulse = -m_motorMass * C; + } + + aA -= m_invIA * limitImpulse; + aB += m_invIB * limitImpulse; + } + + // Solve point-to-point constraint. + { + qA.Set(aA); + qB.Set(aB); + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + b2Vec2 C = cB + rB - cA - rA; + positionError = C.Length(); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat22 K; + K.ex.x = mA + mB + iA * rA.y * rA.y + iB * rB.y * rB.y; + K.ex.y = -iA * rA.x * rA.y - iB * rB.x * rB.y; + K.ey.x = K.ex.y; + K.ey.y = mA + mB + iA * rA.x * rA.x + iB * rB.x * rB.x; + + b2Vec2 impulse = -K.Solve(C); + + cA -= mA * impulse; + aA -= iA * b2Cross(rA, impulse); + + cB += mB * impulse; + aB += iB * b2Cross(rB, impulse); + } + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return positionError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2RevoluteJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2RevoluteJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2RevoluteJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P(m_impulse.x, m_impulse.y); + return inv_dt * P; +} + +float32 b2RevoluteJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.z; +} + +float32 b2RevoluteJoint::GetJointAngle() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + return bB->m_sweep.a - bA->m_sweep.a - m_referenceAngle; +} + +float32 b2RevoluteJoint::GetJointSpeed() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + return bB->m_angularVelocity - bA->m_angularVelocity; +} + +bool b2RevoluteJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2RevoluteJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +float32 b2RevoluteJoint::GetMotorTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2RevoluteJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2RevoluteJoint::SetMaxMotorTorque(float32 torque) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorTorque = torque; +} + +bool b2RevoluteJoint::IsLimitEnabled() const +{ + return m_enableLimit; +} + +void b2RevoluteJoint::EnableLimit(bool flag) +{ + if (flag != m_enableLimit) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableLimit = flag; + m_impulse.z = 0.0f; + } +} + +float32 b2RevoluteJoint::GetLowerLimit() const +{ + return m_lowerAngle; +} + +float32 b2RevoluteJoint::GetUpperLimit() const +{ + return m_upperAngle; +} + +void b2RevoluteJoint::SetLimits(float32 lower, float32 upper) +{ + b2Assert(lower <= upper); + + if (lower != m_lowerAngle || upper != m_upperAngle) + { + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_impulse.z = 0.0f; + m_lowerAngle = lower; + m_upperAngle = upper; + } +} + +void b2RevoluteJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2RevoluteJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.enableLimit = bool(%d);\n", m_enableLimit); + b2Log(" jd.lowerAngle = %.15lef;\n", m_lowerAngle); + b2Log(" jd.upperAngle = %.15lef;\n", m_upperAngle); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2RevoluteJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2RevoluteJoint.h index e62cdbccd..bbed4a6cb 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2RevoluteJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2RevoluteJoint.h @@ -1,204 +1,204 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_REVOLUTE_JOINT_H -#define B2_REVOLUTE_JOINT_H - -#include - -/// Revolute joint definition. This requires defining an -/// anchor point where the bodies are joined. The definition -/// uses local anchor points so that the initial configuration -/// can violate the constraint slightly. You also need to -/// specify the initial relative angle for joint limits. This -/// helps when saving and loading a game. -/// The local anchor points are measured from the body's origin -/// rather than the center of mass because: -/// 1. you might not know where the center of mass will be. -/// 2. if you add/remove shapes from a body and recompute the mass, -/// the joints will be broken. -struct b2RevoluteJointDef : public b2JointDef -{ - b2RevoluteJointDef() - { - type = e_revoluteJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - referenceAngle = 0.0f; - lowerAngle = 0.0f; - upperAngle = 0.0f; - maxMotorTorque = 0.0f; - motorSpeed = 0.0f; - enableLimit = false; - enableMotor = false; - } - - /// Initialize the bodies, anchors, and reference angle using a world - /// anchor point. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The bodyB angle minus bodyA angle in the reference state (radians). - float32 referenceAngle; - - /// A flag to enable joint limits. - bool enableLimit; - - /// The lower angle for the joint limit (radians). - float32 lowerAngle; - - /// The upper angle for the joint limit (radians). - float32 upperAngle; - - /// A flag to enable the joint motor. - bool enableMotor; - - /// The desired motor speed. Usually in radians per second. - float32 motorSpeed; - - /// The maximum motor torque used to achieve the desired motor speed. - /// Usually in N-m. - float32 maxMotorTorque; -}; - -/// A revolute joint constrains two bodies to share a common point while they -/// are free to rotate about the point. The relative rotation about the shared -/// point is the joint angle. You can limit the relative rotation with -/// a joint limit that specifies a lower and upper angle. You can use a motor -/// to drive the relative rotation about the shared point. A maximum motor torque -/// is provided so that infinite forces are not generated. -class b2RevoluteJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Get the current joint angle in radians. - float32 GetJointAngle() const; - - /// Get the current joint angle speed in radians per second. - float32 GetJointSpeed() const; - - /// Is the joint limit enabled? - bool IsLimitEnabled() const; - - /// Enable/disable the joint limit. - void EnableLimit(bool flag); - - /// Get the lower joint limit in radians. - float32 GetLowerLimit() const; - - /// Get the upper joint limit in radians. - float32 GetUpperLimit() const; - - /// Set the joint limits in radians. - void SetLimits(float32 lower, float32 upper); - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed in radians per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed in radians per second. - float32 GetMotorSpeed() const; - - /// Set the maximum motor torque, usually in N-m. - void SetMaxMotorTorque(float32 torque); - float32 GetMaxMotorTorque() const { return m_maxMotorTorque; } - - /// Get the reaction force given the inverse time step. - /// Unit is N. - b2Vec2 GetReactionForce(float32 inv_dt) const; - - /// Get the reaction torque due to the joint limit given the inverse time step. - /// Unit is N*m. - float32 GetReactionTorque(float32 inv_dt) const; - - /// Get the current motor torque given the inverse time step. - /// Unit is N*m. - float32 GetMotorTorque(float32 inv_dt) const; - - /// Dump to b2Log. - void Dump(); - -protected: - - friend class b2Joint; - friend class b2GearJoint; - - b2RevoluteJoint(const b2RevoluteJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec3 m_impulse; - float32 m_motorImpulse; - - bool m_enableMotor; - float32 m_maxMotorTorque; - float32 m_motorSpeed; - - bool m_enableLimit; - float32 m_referenceAngle; - float32 m_lowerAngle; - float32 m_upperAngle; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat33 m_mass; // effective mass for point-to-point constraint. - float32 m_motorMass; // effective mass for motor/limit angular constraint. - b2LimitState m_limitState; -}; - -inline float32 b2RevoluteJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_REVOLUTE_JOINT_H +#define B2_REVOLUTE_JOINT_H + +#include + +/// Revolute joint definition. This requires defining an +/// anchor point where the bodies are joined. The definition +/// uses local anchor points so that the initial configuration +/// can violate the constraint slightly. You also need to +/// specify the initial relative angle for joint limits. This +/// helps when saving and loading a game. +/// The local anchor points are measured from the body's origin +/// rather than the center of mass because: +/// 1. you might not know where the center of mass will be. +/// 2. if you add/remove shapes from a body and recompute the mass, +/// the joints will be broken. +struct b2RevoluteJointDef : public b2JointDef +{ + b2RevoluteJointDef() + { + type = e_revoluteJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + referenceAngle = 0.0f; + lowerAngle = 0.0f; + upperAngle = 0.0f; + maxMotorTorque = 0.0f; + motorSpeed = 0.0f; + enableLimit = false; + enableMotor = false; + } + + /// Initialize the bodies, anchors, and reference angle using a world + /// anchor point. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The bodyB angle minus bodyA angle in the reference state (radians). + float32 referenceAngle; + + /// A flag to enable joint limits. + bool enableLimit; + + /// The lower angle for the joint limit (radians). + float32 lowerAngle; + + /// The upper angle for the joint limit (radians). + float32 upperAngle; + + /// A flag to enable the joint motor. + bool enableMotor; + + /// The desired motor speed. Usually in radians per second. + float32 motorSpeed; + + /// The maximum motor torque used to achieve the desired motor speed. + /// Usually in N-m. + float32 maxMotorTorque; +}; + +/// A revolute joint constrains two bodies to share a common point while they +/// are free to rotate about the point. The relative rotation about the shared +/// point is the joint angle. You can limit the relative rotation with +/// a joint limit that specifies a lower and upper angle. You can use a motor +/// to drive the relative rotation about the shared point. A maximum motor torque +/// is provided so that infinite forces are not generated. +class b2RevoluteJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Get the current joint angle in radians. + float32 GetJointAngle() const; + + /// Get the current joint angle speed in radians per second. + float32 GetJointSpeed() const; + + /// Is the joint limit enabled? + bool IsLimitEnabled() const; + + /// Enable/disable the joint limit. + void EnableLimit(bool flag); + + /// Get the lower joint limit in radians. + float32 GetLowerLimit() const; + + /// Get the upper joint limit in radians. + float32 GetUpperLimit() const; + + /// Set the joint limits in radians. + void SetLimits(float32 lower, float32 upper); + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed in radians per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed in radians per second. + float32 GetMotorSpeed() const; + + /// Set the maximum motor torque, usually in N-m. + void SetMaxMotorTorque(float32 torque); + float32 GetMaxMotorTorque() const { return m_maxMotorTorque; } + + /// Get the reaction force given the inverse time step. + /// Unit is N. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Get the reaction torque due to the joint limit given the inverse time step. + /// Unit is N*m. + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the current motor torque given the inverse time step. + /// Unit is N*m. + float32 GetMotorTorque(float32 inv_dt) const; + + /// Dump to b2Log. + void Dump(); + +protected: + + friend class b2Joint; + friend class b2GearJoint; + + b2RevoluteJoint(const b2RevoluteJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec3 m_impulse; + float32 m_motorImpulse; + + bool m_enableMotor; + float32 m_maxMotorTorque; + float32 m_motorSpeed; + + bool m_enableLimit; + float32 m_referenceAngle; + float32 m_lowerAngle; + float32 m_upperAngle; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat33 m_mass; // effective mass for point-to-point constraint. + float32 m_motorMass; // effective mass for motor/limit angular constraint. + b2LimitState m_limitState; +}; + +inline float32 b2RevoluteJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2RopeJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2RopeJoint.cpp index 107ce1fa5..952ee7a3e 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2RopeJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2RopeJoint.cpp @@ -1,241 +1,241 @@ -/* -* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - - -// Limit: -// C = norm(pB - pA) - L -// u = (pB - pA) / norm(pB - pA) -// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) -// J = [-u -cross(rA, u) u cross(rB, u)] -// K = J * invM * JT -// = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2 - -b2RopeJoint::b2RopeJoint(const b2RopeJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - - m_maxLength = def->maxLength; - - m_mass = 0.0f; - m_impulse = 0.0f; - m_state = e_inactiveLimit; - m_length = 0.0f; -} - -void b2RopeJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - m_u = cB + m_rB - cA - m_rA; - - m_length = m_u.Length(); - - float32 C = m_length - m_maxLength; - if (C > 0.0f) - { - m_state = e_atUpperLimit; - } - else - { - m_state = e_inactiveLimit; - } - - if (m_length > b2_linearSlop) - { - m_u *= 1.0f / m_length; - } - else - { - m_u.SetZero(); - m_mass = 0.0f; - m_impulse = 0.0f; - return; - } - - // Compute effective mass. - float32 crA = b2Cross(m_rA, m_u); - float32 crB = b2Cross(m_rB, m_u); - float32 invMass = m_invMassA + m_invIA * crA * crA + m_invMassB + m_invIB * crB * crB; - - m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; - - if (data.step.warmStarting) - { - // Scale the impulse to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - } - else - { - m_impulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2RopeJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Cdot = dot(u, v + cross(w, r)) - b2Vec2 vpA = vA + b2Cross(wA, m_rA); - b2Vec2 vpB = vB + b2Cross(wB, m_rB); - float32 C = m_length - m_maxLength; - float32 Cdot = b2Dot(m_u, vpB - vpA); - - // Predictive constraint. - if (C < 0.0f) - { - Cdot += data.step.inv_dt * C; - } - - float32 impulse = -m_mass * Cdot; - float32 oldImpulse = m_impulse; - m_impulse = b2Min(0.0f, m_impulse + impulse); - impulse = m_impulse - oldImpulse; - - b2Vec2 P = impulse * m_u; - vA -= m_invMassA * P; - wA -= m_invIA * b2Cross(m_rA, P); - vB += m_invMassB * P; - wB += m_invIB * b2Cross(m_rB, P); - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2RopeJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 u = cB + rB - cA - rA; - - float32 length = u.Normalize(); - float32 C = length - m_maxLength; - - C = b2Clamp(C, 0.0f, b2_maxLinearCorrection); - - float32 impulse = -m_mass * C; - b2Vec2 P = impulse * u; - - cA -= m_invMassA * P; - aA -= m_invIA * b2Cross(rA, P); - cB += m_invMassB * P; - aB += m_invIB * b2Cross(rB, P); - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return length - m_maxLength < b2_linearSlop; -} - -b2Vec2 b2RopeJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2RopeJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2RopeJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 F = (inv_dt * m_impulse) * m_u; - return F; -} - -float32 b2RopeJoint::GetReactionTorque(float32 inv_dt) const -{ - B2_NOT_USED(inv_dt); - return 0.0f; -} - -float32 b2RopeJoint::GetMaxLength() const -{ - return m_maxLength; -} - -b2LimitState b2RopeJoint::GetLimitState() const -{ - return m_state; -} - -void b2RopeJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2RopeJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.maxLength = %.15lef;\n", m_maxLength); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + + +// Limit: +// C = norm(pB - pA) - L +// u = (pB - pA) / norm(pB - pA) +// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) +// J = [-u -cross(rA, u) u cross(rB, u)] +// K = J * invM * JT +// = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2 + +b2RopeJoint::b2RopeJoint(const b2RopeJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + + m_maxLength = def->maxLength; + + m_mass = 0.0f; + m_impulse = 0.0f; + m_state = e_inactiveLimit; + m_length = 0.0f; +} + +void b2RopeJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + m_u = cB + m_rB - cA - m_rA; + + m_length = m_u.Length(); + + float32 C = m_length - m_maxLength; + if (C > 0.0f) + { + m_state = e_atUpperLimit; + } + else + { + m_state = e_inactiveLimit; + } + + if (m_length > b2_linearSlop) + { + m_u *= 1.0f / m_length; + } + else + { + m_u.SetZero(); + m_mass = 0.0f; + m_impulse = 0.0f; + return; + } + + // Compute effective mass. + float32 crA = b2Cross(m_rA, m_u); + float32 crB = b2Cross(m_rB, m_u); + float32 invMass = m_invMassA + m_invIA * crA * crA + m_invMassB + m_invIB * crB * crB; + + m_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f; + + if (data.step.warmStarting) + { + // Scale the impulse to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + } + else + { + m_impulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2RopeJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Cdot = dot(u, v + cross(w, r)) + b2Vec2 vpA = vA + b2Cross(wA, m_rA); + b2Vec2 vpB = vB + b2Cross(wB, m_rB); + float32 C = m_length - m_maxLength; + float32 Cdot = b2Dot(m_u, vpB - vpA); + + // Predictive constraint. + if (C < 0.0f) + { + Cdot += data.step.inv_dt * C; + } + + float32 impulse = -m_mass * Cdot; + float32 oldImpulse = m_impulse; + m_impulse = b2Min(0.0f, m_impulse + impulse); + impulse = m_impulse - oldImpulse; + + b2Vec2 P = impulse * m_u; + vA -= m_invMassA * P; + wA -= m_invIA * b2Cross(m_rA, P); + vB += m_invMassB * P; + wB += m_invIB * b2Cross(m_rB, P); + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2RopeJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 u = cB + rB - cA - rA; + + float32 length = u.Normalize(); + float32 C = length - m_maxLength; + + C = b2Clamp(C, 0.0f, b2_maxLinearCorrection); + + float32 impulse = -m_mass * C; + b2Vec2 P = impulse * u; + + cA -= m_invMassA * P; + aA -= m_invIA * b2Cross(rA, P); + cB += m_invMassB * P; + aB += m_invIB * b2Cross(rB, P); + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return length - m_maxLength < b2_linearSlop; +} + +b2Vec2 b2RopeJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2RopeJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2RopeJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 F = (inv_dt * m_impulse) * m_u; + return F; +} + +float32 b2RopeJoint::GetReactionTorque(float32 inv_dt) const +{ + B2_NOT_USED(inv_dt); + return 0.0f; +} + +float32 b2RopeJoint::GetMaxLength() const +{ + return m_maxLength; +} + +b2LimitState b2RopeJoint::GetLimitState() const +{ + return m_state; +} + +void b2RopeJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2RopeJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.maxLength = %.15lef;\n", m_maxLength); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2RopeJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2RopeJoint.h index 30252460c..eaca575d0 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2RopeJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2RopeJoint.h @@ -1,114 +1,114 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ROPE_JOINT_H -#define B2_ROPE_JOINT_H - -#include - -/// Rope joint definition. This requires two body anchor points and -/// a maximum lengths. -/// Note: by default the connected objects will not collide. -/// see collideConnected in b2JointDef. -struct b2RopeJointDef : public b2JointDef -{ - b2RopeJointDef() - { - type = e_ropeJoint; - localAnchorA.Set(-1.0f, 0.0f); - localAnchorB.Set(1.0f, 0.0f); - maxLength = 0.0f; - } - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The maximum length of the rope. - /// Warning: this must be larger than b2_linearSlop or - /// the joint will have no effect. - float32 maxLength; -}; - -/// A rope joint enforces a maximum distance between two points -/// on two bodies. It has no other effect. -/// Warning: if you attempt to change the maximum length during -/// the simulation you will get some non-physical behavior. -/// A model that would allow you to dynamically modify the length -/// would have some sponginess, so I chose not to implement it -/// that way. See b2DistanceJoint if you want to dynamically -/// control length. -class b2RopeJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Set/Get the maximum length of the rope. - void SetMaxLength(float32 length) { m_maxLength = length; } - float32 GetMaxLength() const; - - b2LimitState GetLimitState() const; - - /// Dump joint to dmLog - void Dump(); - -protected: - - friend class b2Joint; - b2RopeJoint(const b2RopeJointDef* data); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_maxLength; - float32 m_length; - float32 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_u; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - float32 m_mass; - b2LimitState m_state; -}; - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ROPE_JOINT_H +#define B2_ROPE_JOINT_H + +#include + +/// Rope joint definition. This requires two body anchor points and +/// a maximum lengths. +/// Note: by default the connected objects will not collide. +/// see collideConnected in b2JointDef. +struct b2RopeJointDef : public b2JointDef +{ + b2RopeJointDef() + { + type = e_ropeJoint; + localAnchorA.Set(-1.0f, 0.0f); + localAnchorB.Set(1.0f, 0.0f); + maxLength = 0.0f; + } + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The maximum length of the rope. + /// Warning: this must be larger than b2_linearSlop or + /// the joint will have no effect. + float32 maxLength; +}; + +/// A rope joint enforces a maximum distance between two points +/// on two bodies. It has no other effect. +/// Warning: if you attempt to change the maximum length during +/// the simulation you will get some non-physical behavior. +/// A model that would allow you to dynamically modify the length +/// would have some sponginess, so I chose not to implement it +/// that way. See b2DistanceJoint if you want to dynamically +/// control length. +class b2RopeJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set/Get the maximum length of the rope. + void SetMaxLength(float32 length) { m_maxLength = length; } + float32 GetMaxLength() const; + + b2LimitState GetLimitState() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2RopeJoint(const b2RopeJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_maxLength; + float32 m_length; + float32 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_u; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; + b2LimitState m_state; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2WeldJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2WeldJoint.cpp index 9a86686e2..8e49aca17 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2WeldJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2WeldJoint.cpp @@ -1,330 +1,330 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// C = p2 - p1 -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Angle constraint -// C = angle2 - angle1 - referenceAngle -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2WeldJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -} - -b2WeldJoint::b2WeldJoint(const b2WeldJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_referenceAngle = def->referenceAngle; - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_impulse.SetZero(); -} - -void b2WeldJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat33 K; - K.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; - K.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; - K.ez.x = -m_rA.y * iA - m_rB.y * iB; - K.ex.y = K.ey.x; - K.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; - K.ez.y = m_rA.x * iA + m_rB.x * iB; - K.ex.z = K.ez.x; - K.ey.z = K.ez.y; - K.ez.z = iA + iB; - - if (m_frequencyHz > 0.0f) - { - K.GetInverse22(&m_mass); - - float32 invM = iA + iB; - float32 m = invM > 0.0f ? 1.0f / invM : 0.0f; - - float32 C = aB - aA - m_referenceAngle; - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; - m_bias = C * h * k * m_gamma; - - invM += m_gamma; - m_mass.ez.z = invM != 0.0f ? 1.0f / invM : 0.0f; - } - else - { - K.GetSymInverse33(&m_mass); - m_gamma = 0.0f; - m_bias = 0.0f; - } - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_impulse *= data.step.dtRatio; - - b2Vec2 P(m_impulse.x, m_impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_impulse.z); - } - else - { - m_impulse.SetZero(); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2WeldJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - if (m_frequencyHz > 0.0f) - { - float32 Cdot2 = wB - wA; - - float32 impulse2 = -m_mass.ez.z * (Cdot2 + m_bias + m_gamma * m_impulse.z); - m_impulse.z += impulse2; - - wA -= iA * impulse2; - wB += iB * impulse2; - - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - - b2Vec2 impulse1 = -b2Mul22(m_mass, Cdot1); - m_impulse.x += impulse1.x; - m_impulse.y += impulse1.y; - - b2Vec2 P = impulse1; - - vA -= mA * P; - wA -= iA * b2Cross(m_rA, P); - - vB += mB * P; - wB += iB * b2Cross(m_rB, P); - } - else - { - b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); - float32 Cdot2 = wB - wA; - b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); - - b2Vec3 impulse = -b2Mul(m_mass, Cdot); - m_impulse += impulse; - - b2Vec2 P(impulse.x, impulse.y); - - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + impulse.z); - - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + impulse.z); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2WeldJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - - float32 positionError, angularError; - - b2Mat33 K; - K.ex.x = mA + mB + rA.y * rA.y * iA + rB.y * rB.y * iB; - K.ey.x = -rA.y * rA.x * iA - rB.y * rB.x * iB; - K.ez.x = -rA.y * iA - rB.y * iB; - K.ex.y = K.ey.x; - K.ey.y = mA + mB + rA.x * rA.x * iA + rB.x * rB.x * iB; - K.ez.y = rA.x * iA + rB.x * iB; - K.ex.z = K.ez.x; - K.ey.z = K.ez.y; - K.ez.z = iA + iB; - - if (m_frequencyHz > 0.0f) - { - b2Vec2 C1 = cB + rB - cA - rA; - - positionError = C1.Length(); - angularError = 0.0f; - - b2Vec2 P = -K.Solve22(C1); - - cA -= mA * P; - aA -= iA * b2Cross(rA, P); - - cB += mB * P; - aB += iB * b2Cross(rB, P); - } - else - { - b2Vec2 C1 = cB + rB - cA - rA; - float32 C2 = aB - aA - m_referenceAngle; - - positionError = C1.Length(); - angularError = b2Abs(C2); - - b2Vec3 C(C1.x, C1.y, C2); - - b2Vec3 impulse = -K.Solve33(C); - b2Vec2 P(impulse.x, impulse.y); - - cA -= mA * P; - aA -= iA * (b2Cross(rA, P) + impulse.z); - - cB += mB * P; - aB += iB * (b2Cross(rB, P) + impulse.z); - } - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return positionError <= b2_linearSlop && angularError <= b2_angularSlop; -} - -b2Vec2 b2WeldJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2WeldJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2WeldJoint::GetReactionForce(float32 inv_dt) const -{ - b2Vec2 P(m_impulse.x, m_impulse.y); - return inv_dt * P; -} - -float32 b2WeldJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_impulse.z; -} - -void b2WeldJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2WeldJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Point-to-point constraint +// C = p2 - p1 +// Cdot = v2 - v1 +// = v2 + cross(w2, r2) - v1 - cross(w1, r1) +// J = [-I -r1_skew I r2_skew ] +// Identity used: +// w k % (rx i + ry j) = w * (-ry i + rx j) + +// Angle constraint +// C = angle2 - angle1 - referenceAngle +// Cdot = w2 - w1 +// J = [0 0 -1 0 0 1] +// K = invI1 + invI2 + +void b2WeldJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); +} + +b2WeldJoint::b2WeldJoint(const b2WeldJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_referenceAngle = def->referenceAngle; + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_impulse.SetZero(); +} + +void b2WeldJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + m_rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + m_rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + // J = [-I -r1_skew I r2_skew] + // [ 0 -1 0 1] + // r_skew = [-ry; rx] + + // Matlab + // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] + // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] + // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Mat33 K; + K.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB; + K.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB; + K.ez.x = -m_rA.y * iA - m_rB.y * iB; + K.ex.y = K.ey.x; + K.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB; + K.ez.y = m_rA.x * iA + m_rB.x * iB; + K.ex.z = K.ez.x; + K.ey.z = K.ez.y; + K.ez.z = iA + iB; + + if (m_frequencyHz > 0.0f) + { + K.GetInverse22(&m_mass); + + float32 invM = iA + iB; + float32 m = invM > 0.0f ? 1.0f / invM : 0.0f; + + float32 C = aB - aA - m_referenceAngle; + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + m_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f; + m_bias = C * h * k * m_gamma; + + invM += m_gamma; + m_mass.ez.z = invM != 0.0f ? 1.0f / invM : 0.0f; + } + else + { + K.GetSymInverse33(&m_mass); + m_gamma = 0.0f; + m_bias = 0.0f; + } + + if (data.step.warmStarting) + { + // Scale impulses to support a variable time step. + m_impulse *= data.step.dtRatio; + + b2Vec2 P(m_impulse.x, m_impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + m_impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + m_impulse.z); + } + else + { + m_impulse.SetZero(); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2WeldJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + if (m_frequencyHz > 0.0f) + { + float32 Cdot2 = wB - wA; + + float32 impulse2 = -m_mass.ez.z * (Cdot2 + m_bias + m_gamma * m_impulse.z); + m_impulse.z += impulse2; + + wA -= iA * impulse2; + wB += iB * impulse2; + + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + + b2Vec2 impulse1 = -b2Mul22(m_mass, Cdot1); + m_impulse.x += impulse1.x; + m_impulse.y += impulse1.y; + + b2Vec2 P = impulse1; + + vA -= mA * P; + wA -= iA * b2Cross(m_rA, P); + + vB += mB * P; + wB += iB * b2Cross(m_rB, P); + } + else + { + b2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA); + float32 Cdot2 = wB - wA; + b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); + + b2Vec3 impulse = -b2Mul(m_mass, Cdot); + m_impulse += impulse; + + b2Vec2 P(impulse.x, impulse.y); + + vA -= mA * P; + wA -= iA * (b2Cross(m_rA, P) + impulse.z); + + vB += mB * P; + wB += iB * (b2Cross(m_rB, P) + impulse.z); + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2WeldJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + + float32 positionError, angularError; + + b2Mat33 K; + K.ex.x = mA + mB + rA.y * rA.y * iA + rB.y * rB.y * iB; + K.ey.x = -rA.y * rA.x * iA - rB.y * rB.x * iB; + K.ez.x = -rA.y * iA - rB.y * iB; + K.ex.y = K.ey.x; + K.ey.y = mA + mB + rA.x * rA.x * iA + rB.x * rB.x * iB; + K.ez.y = rA.x * iA + rB.x * iB; + K.ex.z = K.ez.x; + K.ey.z = K.ez.y; + K.ez.z = iA + iB; + + if (m_frequencyHz > 0.0f) + { + b2Vec2 C1 = cB + rB - cA - rA; + + positionError = C1.Length(); + angularError = 0.0f; + + b2Vec2 P = -K.Solve22(C1); + + cA -= mA * P; + aA -= iA * b2Cross(rA, P); + + cB += mB * P; + aB += iB * b2Cross(rB, P); + } + else + { + b2Vec2 C1 = cB + rB - cA - rA; + float32 C2 = aB - aA - m_referenceAngle; + + positionError = C1.Length(); + angularError = b2Abs(C2); + + b2Vec3 C(C1.x, C1.y, C2); + + b2Vec3 impulse = -K.Solve33(C); + b2Vec2 P(impulse.x, impulse.y); + + cA -= mA * P; + aA -= iA * (b2Cross(rA, P) + impulse.z); + + cB += mB * P; + aB += iB * (b2Cross(rB, P) + impulse.z); + } + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return positionError <= b2_linearSlop && angularError <= b2_angularSlop; +} + +b2Vec2 b2WeldJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2WeldJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2WeldJoint::GetReactionForce(float32 inv_dt) const +{ + b2Vec2 P(m_impulse.x, m_impulse.y); + return inv_dt * P; +} + +float32 b2WeldJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_impulse.z; +} + +void b2WeldJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2WeldJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.referenceAngle = %.15lef;\n", m_referenceAngle); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2WeldJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2WeldJoint.h index 2adfc26ab..eed9bc103 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2WeldJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2WeldJoint.h @@ -1,126 +1,126 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WELD_JOINT_H -#define B2_WELD_JOINT_H - -#include - -/// Weld joint definition. You need to specify local anchor points -/// where they are attached and the relative body angle. The position -/// of the anchor points is important for computing the reaction torque. -struct b2WeldJointDef : public b2JointDef -{ - b2WeldJointDef() - { - type = e_weldJoint; - localAnchorA.Set(0.0f, 0.0f); - localAnchorB.Set(0.0f, 0.0f); - referenceAngle = 0.0f; - frequencyHz = 0.0f; - dampingRatio = 0.0f; - } - - /// Initialize the bodies, anchors, and reference angle using a world - /// anchor point. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The bodyB angle minus bodyA angle in the reference state (radians). - float32 referenceAngle; - - /// The mass-spring-damper frequency in Hertz. Rotation only. - /// Disable softness with a value of 0. - float32 frequencyHz; - - /// The damping ratio. 0 = no damping, 1 = critical damping. - float32 dampingRatio; -}; - -/// A weld joint essentially glues two bodies together. A weld joint may -/// distort somewhat because the island constraint solver is approximate. -class b2WeldJoint : public b2Joint -{ -public: - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// Get the reference angle. - float32 GetReferenceAngle() const { return m_referenceAngle; } - - /// Set/get frequency in Hz. - void SetFrequency(float32 hz) { m_frequencyHz = hz; } - float32 GetFrequency() const { return m_frequencyHz; } - - /// Set/get damping ratio. - void SetDampingRatio(float32 ratio) { m_dampingRatio = ratio; } - float32 GetDampingRatio() const { return m_dampingRatio; } - - /// Dump to b2Log - void Dump(); - -protected: - - friend class b2Joint; - - b2WeldJoint(const b2WeldJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - float32 m_bias; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - float32 m_referenceAngle; - float32 m_gamma; - b2Vec3 m_impulse; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_rA; - b2Vec2 m_rB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - b2Mat33 m_mass; -}; - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WELD_JOINT_H +#define B2_WELD_JOINT_H + +#include + +/// Weld joint definition. You need to specify local anchor points +/// where they are attached and the relative body angle. The position +/// of the anchor points is important for computing the reaction torque. +struct b2WeldJointDef : public b2JointDef +{ + b2WeldJointDef() + { + type = e_weldJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + referenceAngle = 0.0f; + frequencyHz = 0.0f; + dampingRatio = 0.0f; + } + + /// Initialize the bodies, anchors, and reference angle using a world + /// anchor point. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The bodyB angle minus bodyA angle in the reference state (radians). + float32 referenceAngle; + + /// The mass-spring-damper frequency in Hertz. Rotation only. + /// Disable softness with a value of 0. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A weld joint essentially glues two bodies together. A weld joint may +/// distort somewhat because the island constraint solver is approximate. +class b2WeldJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Set/get frequency in Hz. + void SetFrequency(float32 hz) { m_frequencyHz = hz; } + float32 GetFrequency() const { return m_frequencyHz; } + + /// Set/get damping ratio. + void SetDampingRatio(float32 ratio) { m_dampingRatio = ratio; } + float32 GetDampingRatio() const { return m_dampingRatio; } + + /// Dump to b2Log + void Dump(); + +protected: + + friend class b2Joint; + + b2WeldJoint(const b2WeldJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_bias; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_referenceAngle; + float32 m_gamma; + b2Vec3 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat33 m_mass; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/Joints/b2WheelJoint.cpp b/src/libraries/Box2D/Dynamics/Joints/b2WheelJoint.cpp index 998c627db..5ecc8928c 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2WheelJoint.cpp +++ b/src/libraries/Box2D/Dynamics/Joints/b2WheelJoint.cpp @@ -1,419 +1,419 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Linear constraint (point-to-line) -// d = pB - pA = xB + rB - xA - rA -// C = dot(ay, d) -// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA)) -// = -dot(ay, vA) - dot(cross(d + rA, ay), wA) + dot(ay, vB) + dot(cross(rB, ay), vB) -// J = [-ay, -cross(d + rA, ay), ay, cross(rB, ay)] - -// Spring linear constraint -// C = dot(ax, d) -// Cdot = = -dot(ax, vA) - dot(cross(d + rA, ax), wA) + dot(ax, vB) + dot(cross(rB, ax), vB) -// J = [-ax -cross(d+rA, ax) ax cross(rB, ax)] - -// Motor rotational constraint -// Cdot = wB - wA -// J = [0 0 -1 0 0 1] - -void b2WheelJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) -{ - bodyA = bA; - bodyB = bB; - localAnchorA = bodyA->GetLocalPoint(anchor); - localAnchorB = bodyB->GetLocalPoint(anchor); - localAxisA = bodyA->GetLocalVector(axis); -} - -b2WheelJoint::b2WheelJoint(const b2WheelJointDef* def) -: b2Joint(def) -{ - m_localAnchorA = def->localAnchorA; - m_localAnchorB = def->localAnchorB; - m_localXAxisA = def->localAxisA; - m_localYAxisA = b2Cross(1.0f, m_localXAxisA); - - m_mass = 0.0f; - m_impulse = 0.0f; - m_motorMass = 0.0; - m_motorImpulse = 0.0f; - m_springMass = 0.0f; - m_springImpulse = 0.0f; - - m_maxMotorTorque = def->maxMotorTorque; - m_motorSpeed = def->motorSpeed; - m_enableMotor = def->enableMotor; - - m_frequencyHz = def->frequencyHz; - m_dampingRatio = def->dampingRatio; - - m_bias = 0.0f; - m_gamma = 0.0f; - - m_ax.SetZero(); - m_ay.SetZero(); -} - -void b2WheelJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective masses. - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = cB + rB - cA - rA; - - // Point to line constraint - { - m_ay = b2Mul(qA, m_localYAxisA); - m_sAy = b2Cross(d + rA, m_ay); - m_sBy = b2Cross(rB, m_ay); - - m_mass = mA + mB + iA * m_sAy * m_sAy + iB * m_sBy * m_sBy; - - if (m_mass > 0.0f) - { - m_mass = 1.0f / m_mass; - } - } - - // Spring constraint - m_springMass = 0.0f; - m_bias = 0.0f; - m_gamma = 0.0f; - if (m_frequencyHz > 0.0f) - { - m_ax = b2Mul(qA, m_localXAxisA); - m_sAx = b2Cross(d + rA, m_ax); - m_sBx = b2Cross(rB, m_ax); - - float32 invMass = mA + mB + iA * m_sAx * m_sAx + iB * m_sBx * m_sBx; - - if (invMass > 0.0f) - { - m_springMass = 1.0f / invMass; - - float32 C = b2Dot(d, m_ax); - - // Frequency - float32 omega = 2.0f * b2_pi * m_frequencyHz; - - // Damping coefficient - float32 d = 2.0f * m_springMass * m_dampingRatio * omega; - - // Spring stiffness - float32 k = m_springMass * omega * omega; - - // magic formulas - float32 h = data.step.dt; - m_gamma = h * (d + h * k); - if (m_gamma > 0.0f) - { - m_gamma = 1.0f / m_gamma; - } - - m_bias = C * h * k * m_gamma; - - m_springMass = invMass + m_gamma; - if (m_springMass > 0.0f) - { - m_springMass = 1.0f / m_springMass; - } - } - } - else - { - m_springImpulse = 0.0f; - } - - // Rotational motor - if (m_enableMotor) - { - m_motorMass = iA + iB; - if (m_motorMass > 0.0f) - { - m_motorMass = 1.0f / m_motorMass; - } - } - else - { - m_motorMass = 0.0f; - m_motorImpulse = 0.0f; - } - - if (data.step.warmStarting) - { - // Account for variable time step. - m_impulse *= data.step.dtRatio; - m_springImpulse *= data.step.dtRatio; - m_motorImpulse *= data.step.dtRatio; - - b2Vec2 P = m_impulse * m_ay + m_springImpulse * m_ax; - float32 LA = m_impulse * m_sAy + m_springImpulse * m_sAx + m_motorImpulse; - float32 LB = m_impulse * m_sBy + m_springImpulse * m_sBx + m_motorImpulse; - - vA -= m_invMassA * P; - wA -= m_invIA * LA; - - vB += m_invMassB * P; - wB += m_invIB * LB; - } - else - { - m_impulse = 0.0f; - m_springImpulse = 0.0f; - m_motorImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2WheelJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - // Solve spring constraint - { - float32 Cdot = b2Dot(m_ax, vB - vA) + m_sBx * wB - m_sAx * wA; - float32 impulse = -m_springMass * (Cdot + m_bias + m_gamma * m_springImpulse); - m_springImpulse += impulse; - - b2Vec2 P = impulse * m_ax; - float32 LA = impulse * m_sAx; - float32 LB = impulse * m_sBx; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - // Solve rotational motor constraint - { - float32 Cdot = wB - wA - m_motorSpeed; - float32 impulse = -m_motorMass * Cdot; - - float32 oldImpulse = m_motorImpulse; - float32 maxImpulse = data.step.dt * m_maxMotorTorque; - m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_motorImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve point to line constraint - { - float32 Cdot = b2Dot(m_ay, vB - vA) + m_sBy * wB - m_sAy * wA; - float32 impulse = -m_mass * Cdot; - m_impulse += impulse; - - b2Vec2 P = impulse * m_ay; - float32 LA = impulse * m_sAy; - float32 LB = impulse * m_sBy; - - vA -= mA * P; - wA -= iA * LA; - - vB += mB * P; - wB += iB * LB; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2WheelJoint::SolvePositionConstraints(const b2SolverData& data) -{ - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - - b2Rot qA(aA), qB(aB); - - b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); - b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); - b2Vec2 d = (cB - cA) + rB - rA; - - b2Vec2 ay = b2Mul(qA, m_localYAxisA); - - float32 sAy = b2Cross(d + rA, ay); - float32 sBy = b2Cross(rB, ay); - - float32 C = b2Dot(d, ay); - - float32 k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy; - - float32 impulse; - if (k != 0.0f) - { - impulse = - C / k; - } - else - { - impulse = 0.0f; - } - - b2Vec2 P = impulse * ay; - float32 LA = impulse * sAy; - float32 LB = impulse * sBy; - - cA -= m_invMassA * P; - aA -= m_invIA * LA; - cB += m_invMassB * P; - aB += m_invIB * LB; - - data.positions[m_indexA].c = cA; - data.positions[m_indexA].a = aA; - data.positions[m_indexB].c = cB; - data.positions[m_indexB].a = aB; - - return b2Abs(C) <= b2_linearSlop; -} - -b2Vec2 b2WheelJoint::GetAnchorA() const -{ - return m_bodyA->GetWorldPoint(m_localAnchorA); -} - -b2Vec2 b2WheelJoint::GetAnchorB() const -{ - return m_bodyB->GetWorldPoint(m_localAnchorB); -} - -b2Vec2 b2WheelJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * (m_impulse * m_ay + m_springImpulse * m_ax); -} - -float32 b2WheelJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -float32 b2WheelJoint::GetJointTranslation() const -{ - b2Body* bA = m_bodyA; - b2Body* bB = m_bodyB; - - b2Vec2 pA = bA->GetWorldPoint(m_localAnchorA); - b2Vec2 pB = bB->GetWorldPoint(m_localAnchorB); - b2Vec2 d = pB - pA; - b2Vec2 axis = bA->GetWorldVector(m_localXAxisA); - - float32 translation = b2Dot(d, axis); - return translation; -} - -float32 b2WheelJoint::GetJointSpeed() const -{ - float32 wA = m_bodyA->m_angularVelocity; - float32 wB = m_bodyB->m_angularVelocity; - return wB - wA; -} - -bool b2WheelJoint::IsMotorEnabled() const -{ - return m_enableMotor; -} - -void b2WheelJoint::EnableMotor(bool flag) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_enableMotor = flag; -} - -void b2WheelJoint::SetMotorSpeed(float32 speed) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_motorSpeed = speed; -} - -void b2WheelJoint::SetMaxMotorTorque(float32 torque) -{ - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_maxMotorTorque = torque; -} - -float32 b2WheelJoint::GetMotorTorque(float32 inv_dt) const -{ - return inv_dt * m_motorImpulse; -} - -void b2WheelJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2WheelJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); - b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); - b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); - b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); - b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); - b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); - b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); - b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include + +// Linear constraint (point-to-line) +// d = pB - pA = xB + rB - xA - rA +// C = dot(ay, d) +// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA)) +// = -dot(ay, vA) - dot(cross(d + rA, ay), wA) + dot(ay, vB) + dot(cross(rB, ay), vB) +// J = [-ay, -cross(d + rA, ay), ay, cross(rB, ay)] + +// Spring linear constraint +// C = dot(ax, d) +// Cdot = = -dot(ax, vA) - dot(cross(d + rA, ax), wA) + dot(ax, vB) + dot(cross(rB, ax), vB) +// J = [-ax -cross(d+rA, ax) ax cross(rB, ax)] + +// Motor rotational constraint +// Cdot = wB - wA +// J = [0 0 -1 0 0 1] + +void b2WheelJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis) +{ + bodyA = bA; + bodyB = bB; + localAnchorA = bodyA->GetLocalPoint(anchor); + localAnchorB = bodyB->GetLocalPoint(anchor); + localAxisA = bodyA->GetLocalVector(axis); +} + +b2WheelJoint::b2WheelJoint(const b2WheelJointDef* def) +: b2Joint(def) +{ + m_localAnchorA = def->localAnchorA; + m_localAnchorB = def->localAnchorB; + m_localXAxisA = def->localAxisA; + m_localYAxisA = b2Cross(1.0f, m_localXAxisA); + + m_mass = 0.0f; + m_impulse = 0.0f; + m_motorMass = 0.0; + m_motorImpulse = 0.0f; + m_springMass = 0.0f; + m_springImpulse = 0.0f; + + m_maxMotorTorque = def->maxMotorTorque; + m_motorSpeed = def->motorSpeed; + m_enableMotor = def->enableMotor; + + m_frequencyHz = def->frequencyHz; + m_dampingRatio = def->dampingRatio; + + m_bias = 0.0f; + m_gamma = 0.0f; + + m_ax.SetZero(); + m_ay.SetZero(); +} + +void b2WheelJoint::InitVelocityConstraints(const b2SolverData& data) +{ + m_indexA = m_bodyA->m_islandIndex; + m_indexB = m_bodyB->m_islandIndex; + m_localCenterA = m_bodyA->m_sweep.localCenter; + m_localCenterB = m_bodyB->m_sweep.localCenter; + m_invMassA = m_bodyA->m_invMass; + m_invMassB = m_bodyB->m_invMass; + m_invIA = m_bodyA->m_invI; + m_invIB = m_bodyB->m_invI; + + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + b2Rot qA(aA), qB(aB); + + // Compute the effective masses. + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = cB + rB - cA - rA; + + // Point to line constraint + { + m_ay = b2Mul(qA, m_localYAxisA); + m_sAy = b2Cross(d + rA, m_ay); + m_sBy = b2Cross(rB, m_ay); + + m_mass = mA + mB + iA * m_sAy * m_sAy + iB * m_sBy * m_sBy; + + if (m_mass > 0.0f) + { + m_mass = 1.0f / m_mass; + } + } + + // Spring constraint + m_springMass = 0.0f; + m_bias = 0.0f; + m_gamma = 0.0f; + if (m_frequencyHz > 0.0f) + { + m_ax = b2Mul(qA, m_localXAxisA); + m_sAx = b2Cross(d + rA, m_ax); + m_sBx = b2Cross(rB, m_ax); + + float32 invMass = mA + mB + iA * m_sAx * m_sAx + iB * m_sBx * m_sBx; + + if (invMass > 0.0f) + { + m_springMass = 1.0f / invMass; + + float32 C = b2Dot(d, m_ax); + + // Frequency + float32 omega = 2.0f * b2_pi * m_frequencyHz; + + // Damping coefficient + float32 d = 2.0f * m_springMass * m_dampingRatio * omega; + + // Spring stiffness + float32 k = m_springMass * omega * omega; + + // magic formulas + float32 h = data.step.dt; + m_gamma = h * (d + h * k); + if (m_gamma > 0.0f) + { + m_gamma = 1.0f / m_gamma; + } + + m_bias = C * h * k * m_gamma; + + m_springMass = invMass + m_gamma; + if (m_springMass > 0.0f) + { + m_springMass = 1.0f / m_springMass; + } + } + } + else + { + m_springImpulse = 0.0f; + } + + // Rotational motor + if (m_enableMotor) + { + m_motorMass = iA + iB; + if (m_motorMass > 0.0f) + { + m_motorMass = 1.0f / m_motorMass; + } + } + else + { + m_motorMass = 0.0f; + m_motorImpulse = 0.0f; + } + + if (data.step.warmStarting) + { + // Account for variable time step. + m_impulse *= data.step.dtRatio; + m_springImpulse *= data.step.dtRatio; + m_motorImpulse *= data.step.dtRatio; + + b2Vec2 P = m_impulse * m_ay + m_springImpulse * m_ax; + float32 LA = m_impulse * m_sAy + m_springImpulse * m_sAx + m_motorImpulse; + float32 LB = m_impulse * m_sBy + m_springImpulse * m_sBx + m_motorImpulse; + + vA -= m_invMassA * P; + wA -= m_invIA * LA; + + vB += m_invMassB * P; + wB += m_invIB * LB; + } + else + { + m_impulse = 0.0f; + m_springImpulse = 0.0f; + m_motorImpulse = 0.0f; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +void b2WheelJoint::SolveVelocityConstraints(const b2SolverData& data) +{ + float32 mA = m_invMassA, mB = m_invMassB; + float32 iA = m_invIA, iB = m_invIB; + + b2Vec2 vA = data.velocities[m_indexA].v; + float32 wA = data.velocities[m_indexA].w; + b2Vec2 vB = data.velocities[m_indexB].v; + float32 wB = data.velocities[m_indexB].w; + + // Solve spring constraint + { + float32 Cdot = b2Dot(m_ax, vB - vA) + m_sBx * wB - m_sAx * wA; + float32 impulse = -m_springMass * (Cdot + m_bias + m_gamma * m_springImpulse); + m_springImpulse += impulse; + + b2Vec2 P = impulse * m_ax; + float32 LA = impulse * m_sAx; + float32 LB = impulse * m_sBx; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + // Solve rotational motor constraint + { + float32 Cdot = wB - wA - m_motorSpeed; + float32 impulse = -m_motorMass * Cdot; + + float32 oldImpulse = m_motorImpulse; + float32 maxImpulse = data.step.dt * m_maxMotorTorque; + m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); + impulse = m_motorImpulse - oldImpulse; + + wA -= iA * impulse; + wB += iB * impulse; + } + + // Solve point to line constraint + { + float32 Cdot = b2Dot(m_ay, vB - vA) + m_sBy * wB - m_sAy * wA; + float32 impulse = -m_mass * Cdot; + m_impulse += impulse; + + b2Vec2 P = impulse * m_ay; + float32 LA = impulse * m_sAy; + float32 LB = impulse * m_sBy; + + vA -= mA * P; + wA -= iA * LA; + + vB += mB * P; + wB += iB * LB; + } + + data.velocities[m_indexA].v = vA; + data.velocities[m_indexA].w = wA; + data.velocities[m_indexB].v = vB; + data.velocities[m_indexB].w = wB; +} + +bool b2WheelJoint::SolvePositionConstraints(const b2SolverData& data) +{ + b2Vec2 cA = data.positions[m_indexA].c; + float32 aA = data.positions[m_indexA].a; + b2Vec2 cB = data.positions[m_indexB].c; + float32 aB = data.positions[m_indexB].a; + + b2Rot qA(aA), qB(aB); + + b2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA); + b2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB); + b2Vec2 d = (cB - cA) + rB - rA; + + b2Vec2 ay = b2Mul(qA, m_localYAxisA); + + float32 sAy = b2Cross(d + rA, ay); + float32 sBy = b2Cross(rB, ay); + + float32 C = b2Dot(d, ay); + + float32 k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy; + + float32 impulse; + if (k != 0.0f) + { + impulse = - C / k; + } + else + { + impulse = 0.0f; + } + + b2Vec2 P = impulse * ay; + float32 LA = impulse * sAy; + float32 LB = impulse * sBy; + + cA -= m_invMassA * P; + aA -= m_invIA * LA; + cB += m_invMassB * P; + aB += m_invIB * LB; + + data.positions[m_indexA].c = cA; + data.positions[m_indexA].a = aA; + data.positions[m_indexB].c = cB; + data.positions[m_indexB].a = aB; + + return b2Abs(C) <= b2_linearSlop; +} + +b2Vec2 b2WheelJoint::GetAnchorA() const +{ + return m_bodyA->GetWorldPoint(m_localAnchorA); +} + +b2Vec2 b2WheelJoint::GetAnchorB() const +{ + return m_bodyB->GetWorldPoint(m_localAnchorB); +} + +b2Vec2 b2WheelJoint::GetReactionForce(float32 inv_dt) const +{ + return inv_dt * (m_impulse * m_ay + m_springImpulse * m_ax); +} + +float32 b2WheelJoint::GetReactionTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +float32 b2WheelJoint::GetJointTranslation() const +{ + b2Body* bA = m_bodyA; + b2Body* bB = m_bodyB; + + b2Vec2 pA = bA->GetWorldPoint(m_localAnchorA); + b2Vec2 pB = bB->GetWorldPoint(m_localAnchorB); + b2Vec2 d = pB - pA; + b2Vec2 axis = bA->GetWorldVector(m_localXAxisA); + + float32 translation = b2Dot(d, axis); + return translation; +} + +float32 b2WheelJoint::GetJointSpeed() const +{ + float32 wA = m_bodyA->m_angularVelocity; + float32 wB = m_bodyB->m_angularVelocity; + return wB - wA; +} + +bool b2WheelJoint::IsMotorEnabled() const +{ + return m_enableMotor; +} + +void b2WheelJoint::EnableMotor(bool flag) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_enableMotor = flag; +} + +void b2WheelJoint::SetMotorSpeed(float32 speed) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_motorSpeed = speed; +} + +void b2WheelJoint::SetMaxMotorTorque(float32 torque) +{ + m_bodyA->SetAwake(true); + m_bodyB->SetAwake(true); + m_maxMotorTorque = torque; +} + +float32 b2WheelJoint::GetMotorTorque(float32 inv_dt) const +{ + return inv_dt * m_motorImpulse; +} + +void b2WheelJoint::Dump() +{ + int32 indexA = m_bodyA->m_islandIndex; + int32 indexB = m_bodyB->m_islandIndex; + + b2Log(" b2WheelJointDef jd;\n"); + b2Log(" jd.bodyA = bodies[%d];\n", indexA); + b2Log(" jd.bodyB = bodies[%d];\n", indexB); + b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); + b2Log(" jd.localAnchorA.Set(%.15lef, %.15lef);\n", m_localAnchorA.x, m_localAnchorA.y); + b2Log(" jd.localAnchorB.Set(%.15lef, %.15lef);\n", m_localAnchorB.x, m_localAnchorB.y); + b2Log(" jd.localAxisA.Set(%.15lef, %.15lef);\n", m_localXAxisA.x, m_localXAxisA.y); + b2Log(" jd.enableMotor = bool(%d);\n", m_enableMotor); + b2Log(" jd.motorSpeed = %.15lef;\n", m_motorSpeed); + b2Log(" jd.maxMotorTorque = %.15lef;\n", m_maxMotorTorque); + b2Log(" jd.frequencyHz = %.15lef;\n", m_frequencyHz); + b2Log(" jd.dampingRatio = %.15lef;\n", m_dampingRatio); + b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); +} diff --git a/src/libraries/Box2D/Dynamics/Joints/b2WheelJoint.h b/src/libraries/Box2D/Dynamics/Joints/b2WheelJoint.h index 9a8b13639..968eeafe5 100755 --- a/src/libraries/Box2D/Dynamics/Joints/b2WheelJoint.h +++ b/src/libraries/Box2D/Dynamics/Joints/b2WheelJoint.h @@ -1,213 +1,213 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WHEEL_JOINT_H -#define B2_WHEEL_JOINT_H - -#include - -/// Wheel joint definition. This requires defining a line of -/// motion using an axis and an anchor point. The definition uses local -/// anchor points and a local axis so that the initial configuration -/// can violate the constraint slightly. The joint translation is zero -/// when the local anchor points coincide in world space. Using local -/// anchors and a local axis helps when saving and loading a game. -struct b2WheelJointDef : public b2JointDef -{ - b2WheelJointDef() - { - type = e_wheelJoint; - localAnchorA.SetZero(); - localAnchorB.SetZero(); - localAxisA.Set(1.0f, 0.0f); - enableMotor = false; - maxMotorTorque = 0.0f; - motorSpeed = 0.0f; - frequencyHz = 2.0f; - dampingRatio = 0.7f; - } - - /// Initialize the bodies, anchors, axis, and reference angle using the world - /// anchor and world axis. - void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); - - /// The local anchor point relative to bodyA's origin. - b2Vec2 localAnchorA; - - /// The local anchor point relative to bodyB's origin. - b2Vec2 localAnchorB; - - /// The local translation axis in bodyA. - b2Vec2 localAxisA; - - /// Enable/disable the joint motor. - bool enableMotor; - - /// The maximum motor torque, usually in N-m. - float32 maxMotorTorque; - - /// The desired motor speed in radians per second. - float32 motorSpeed; - - /// Suspension frequency, zero indicates no suspension - float32 frequencyHz; - - /// Suspension damping ratio, one indicates critical damping - float32 dampingRatio; -}; - -/// A wheel joint. This joint provides two degrees of freedom: translation -/// along an axis fixed in bodyA and rotation in the plane. You can use a -/// joint limit to restrict the range of motion and a joint motor to drive -/// the rotation or to model rotational friction. -/// This joint is designed for vehicle suspensions. -class b2WheelJoint : public b2Joint -{ -public: - void GetDefinition(b2WheelJointDef* def) const; - - b2Vec2 GetAnchorA() const; - b2Vec2 GetAnchorB() const; - - b2Vec2 GetReactionForce(float32 inv_dt) const; - float32 GetReactionTorque(float32 inv_dt) const; - - /// The local anchor point relative to bodyA's origin. - const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - - /// The local anchor point relative to bodyB's origin. - const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } - - /// The local joint axis relative to bodyA. - const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } - - /// Get the current joint translation, usually in meters. - float32 GetJointTranslation() const; - - /// Get the current joint translation speed, usually in meters per second. - float32 GetJointSpeed() const; - - /// Is the joint motor enabled? - bool IsMotorEnabled() const; - - /// Enable/disable the joint motor. - void EnableMotor(bool flag); - - /// Set the motor speed, usually in radians per second. - void SetMotorSpeed(float32 speed); - - /// Get the motor speed, usually in radians per second. - float32 GetMotorSpeed() const; - - /// Set/Get the maximum motor force, usually in N-m. - void SetMaxMotorTorque(float32 torque); - float32 GetMaxMotorTorque() const; - - /// Get the current motor torque given the inverse time step, usually in N-m. - float32 GetMotorTorque(float32 inv_dt) const; - - /// Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring. - void SetSpringFrequencyHz(float32 hz); - float32 GetSpringFrequencyHz() const; - - /// Set/Get the spring damping ratio - void SetSpringDampingRatio(float32 ratio); - float32 GetSpringDampingRatio() const; - - /// Dump to b2Log - void Dump(); - -protected: - - friend class b2Joint; - b2WheelJoint(const b2WheelJointDef* def); - - void InitVelocityConstraints(const b2SolverData& data); - void SolveVelocityConstraints(const b2SolverData& data); - bool SolvePositionConstraints(const b2SolverData& data); - - float32 m_frequencyHz; - float32 m_dampingRatio; - - // Solver shared - b2Vec2 m_localAnchorA; - b2Vec2 m_localAnchorB; - b2Vec2 m_localXAxisA; - b2Vec2 m_localYAxisA; - - float32 m_impulse; - float32 m_motorImpulse; - float32 m_springImpulse; - - float32 m_maxMotorTorque; - float32 m_motorSpeed; - bool m_enableMotor; - - // Solver temp - int32 m_indexA; - int32 m_indexB; - b2Vec2 m_localCenterA; - b2Vec2 m_localCenterB; - float32 m_invMassA; - float32 m_invMassB; - float32 m_invIA; - float32 m_invIB; - - b2Vec2 m_ax, m_ay; - float32 m_sAx, m_sBx; - float32 m_sAy, m_sBy; - - float32 m_mass; - float32 m_motorMass; - float32 m_springMass; - - float32 m_bias; - float32 m_gamma; -}; - -inline float32 b2WheelJoint::GetMotorSpeed() const -{ - return m_motorSpeed; -} - -inline float32 b2WheelJoint::GetMaxMotorTorque() const -{ - return m_maxMotorTorque; -} - -inline void b2WheelJoint::SetSpringFrequencyHz(float32 hz) -{ - m_frequencyHz = hz; -} - -inline float32 b2WheelJoint::GetSpringFrequencyHz() const -{ - return m_frequencyHz; -} - -inline void b2WheelJoint::SetSpringDampingRatio(float32 ratio) -{ - m_dampingRatio = ratio; -} - -inline float32 b2WheelJoint::GetSpringDampingRatio() const -{ - return m_dampingRatio; -} - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WHEEL_JOINT_H +#define B2_WHEEL_JOINT_H + +#include + +/// Wheel joint definition. This requires defining a line of +/// motion using an axis and an anchor point. The definition uses local +/// anchor points and a local axis so that the initial configuration +/// can violate the constraint slightly. The joint translation is zero +/// when the local anchor points coincide in world space. Using local +/// anchors and a local axis helps when saving and loading a game. +struct b2WheelJointDef : public b2JointDef +{ + b2WheelJointDef() + { + type = e_wheelJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + localAxisA.Set(1.0f, 0.0f); + enableMotor = false; + maxMotorTorque = 0.0f; + motorSpeed = 0.0f; + frequencyHz = 2.0f; + dampingRatio = 0.7f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The local translation axis in bodyA. + b2Vec2 localAxisA; + + /// Enable/disable the joint motor. + bool enableMotor; + + /// The maximum motor torque, usually in N-m. + float32 maxMotorTorque; + + /// The desired motor speed in radians per second. + float32 motorSpeed; + + /// Suspension frequency, zero indicates no suspension + float32 frequencyHz; + + /// Suspension damping ratio, one indicates critical damping + float32 dampingRatio; +}; + +/// A wheel joint. This joint provides two degrees of freedom: translation +/// along an axis fixed in bodyA and rotation in the plane. You can use a +/// joint limit to restrict the range of motion and a joint motor to drive +/// the rotation or to model rotational friction. +/// This joint is designed for vehicle suspensions. +class b2WheelJoint : public b2Joint +{ +public: + void GetDefinition(b2WheelJointDef* def) const; + + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// The local joint axis relative to bodyA. + const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } + + /// Get the current joint translation, usually in meters. + float32 GetJointTranslation() const; + + /// Get the current joint translation speed, usually in meters per second. + float32 GetJointSpeed() const; + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed, usually in radians per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed, usually in radians per second. + float32 GetMotorSpeed() const; + + /// Set/Get the maximum motor force, usually in N-m. + void SetMaxMotorTorque(float32 torque); + float32 GetMaxMotorTorque() const; + + /// Get the current motor torque given the inverse time step, usually in N-m. + float32 GetMotorTorque(float32 inv_dt) const; + + /// Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring. + void SetSpringFrequencyHz(float32 hz); + float32 GetSpringFrequencyHz() const; + + /// Set/Get the spring damping ratio + void SetSpringDampingRatio(float32 ratio); + float32 GetSpringDampingRatio() const; + + /// Dump to b2Log + void Dump(); + +protected: + + friend class b2Joint; + b2WheelJoint(const b2WheelJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localXAxisA; + b2Vec2 m_localYAxisA; + + float32 m_impulse; + float32 m_motorImpulse; + float32 m_springImpulse; + + float32 m_maxMotorTorque; + float32 m_motorSpeed; + bool m_enableMotor; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + + b2Vec2 m_ax, m_ay; + float32 m_sAx, m_sBx; + float32 m_sAy, m_sBy; + + float32 m_mass; + float32 m_motorMass; + float32 m_springMass; + + float32 m_bias; + float32 m_gamma; +}; + +inline float32 b2WheelJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +inline float32 b2WheelJoint::GetMaxMotorTorque() const +{ + return m_maxMotorTorque; +} + +inline void b2WheelJoint::SetSpringFrequencyHz(float32 hz) +{ + m_frequencyHz = hz; +} + +inline float32 b2WheelJoint::GetSpringFrequencyHz() const +{ + return m_frequencyHz; +} + +inline void b2WheelJoint::SetSpringDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +inline float32 b2WheelJoint::GetSpringDampingRatio() const +{ + return m_dampingRatio; +} + +#endif diff --git a/src/libraries/Box2D/Dynamics/b2Body.cpp b/src/libraries/Box2D/Dynamics/b2Body.cpp index b50bf45ad..b19c7ffd5 100755 --- a/src/libraries/Box2D/Dynamics/b2Body.cpp +++ b/src/libraries/Box2D/Dynamics/b2Body.cpp @@ -1,514 +1,514 @@ -/* -* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -b2Body::b2Body(const b2BodyDef* bd, b2World* world) -{ - b2Assert(bd->position.IsValid()); - b2Assert(bd->linearVelocity.IsValid()); - b2Assert(b2IsValid(bd->angle)); - b2Assert(b2IsValid(bd->angularVelocity)); - b2Assert(b2IsValid(bd->angularDamping) && bd->angularDamping >= 0.0f); - b2Assert(b2IsValid(bd->linearDamping) && bd->linearDamping >= 0.0f); - - m_flags = 0; - - if (bd->bullet) - { - m_flags |= e_bulletFlag; - } - if (bd->fixedRotation) - { - m_flags |= e_fixedRotationFlag; - } - if (bd->allowSleep) - { - m_flags |= e_autoSleepFlag; - } - if (bd->awake) - { - m_flags |= e_awakeFlag; - } - if (bd->active) - { - m_flags |= e_activeFlag; - } - - m_world = world; - - m_xf.p = bd->position; - m_xf.q.Set(bd->angle); - - m_sweep.localCenter.SetZero(); - m_sweep.c0 = m_xf.p; - m_sweep.c = m_xf.p; - m_sweep.a0 = bd->angle; - m_sweep.a = bd->angle; - m_sweep.alpha0 = 0.0f; - - m_jointList = NULL; - m_contactList = NULL; - m_prev = NULL; - m_next = NULL; - - m_linearVelocity = bd->linearVelocity; - m_angularVelocity = bd->angularVelocity; - - m_linearDamping = bd->linearDamping; - m_angularDamping = bd->angularDamping; - m_gravityScale = bd->gravityScale; - - m_force.SetZero(); - m_torque = 0.0f; - - m_sleepTime = 0.0f; - - m_type = bd->type; - - if (m_type == b2_dynamicBody) - { - m_mass = 1.0f; - m_invMass = 1.0f; - } - else - { - m_mass = 0.0f; - m_invMass = 0.0f; - } - - m_I = 0.0f; - m_invI = 0.0f; - - m_userData = bd->userData; - - m_fixtureList = NULL; - m_fixtureCount = 0; -} - -b2Body::~b2Body() -{ - // shapes and joints are destroyed in b2World::Destroy -} - -void b2Body::SetType(b2BodyType type) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - if (m_type == type) - { - return; - } - - m_type = type; - - ResetMassData(); - - if (m_type == b2_staticBody) - { - m_linearVelocity.SetZero(); - m_angularVelocity = 0.0f; - m_sweep.a0 = m_sweep.a; - m_sweep.c0 = m_sweep.c; - SynchronizeFixtures(); - } - - SetAwake(true); - - m_force.SetZero(); - m_torque = 0.0f; - - // Since the body type changed, we need to flag contacts for filtering. - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Refilter(); - } -} - -b2Fixture* b2Body::CreateFixture(const b2FixtureDef* def) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return NULL; - } - - b2BlockAllocator* allocator = &m_world->m_blockAllocator; - - void* memory = allocator->Allocate(sizeof(b2Fixture)); - b2Fixture* fixture = new (memory) b2Fixture; - fixture->Create(allocator, this, def); - - if (m_flags & e_activeFlag) - { - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - fixture->CreateProxies(broadPhase, m_xf); - } - - fixture->m_next = m_fixtureList; - m_fixtureList = fixture; - ++m_fixtureCount; - - fixture->m_body = this; - - // Adjust mass properties if needed. - if (fixture->m_density > 0.0f) - { - ResetMassData(); - } - - // Let the world know we have a new fixture. This will cause new contacts - // to be created at the beginning of the next time step. - m_world->m_flags |= b2World::e_newFixture; - - return fixture; -} - -b2Fixture* b2Body::CreateFixture(const b2Shape* shape, float32 density) -{ - b2FixtureDef def; - def.shape = shape; - def.density = density; - - return CreateFixture(&def); -} - -void b2Body::DestroyFixture(b2Fixture* fixture) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - b2Assert(fixture->m_body == this); - - // Remove the fixture from this body's singly linked list. - b2Assert(m_fixtureCount > 0); - b2Fixture** node = &m_fixtureList; - bool found = false; - while (*node != NULL) - { - if (*node == fixture) - { - *node = fixture->m_next; - found = true; - break; - } - - node = &(*node)->m_next; - } - - // You tried to remove a shape that is not attached to this body. - b2Assert(found); - - // Destroy any contacts associated with the fixture. - b2ContactEdge* edge = m_contactList; - while (edge) - { - b2Contact* c = edge->contact; - edge = edge->next; - - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - - if (fixture == fixtureA || fixture == fixtureB) - { - // This destroys the contact and removes it from - // this body's contact list. - m_world->m_contactManager.Destroy(c); - } - } - - b2BlockAllocator* allocator = &m_world->m_blockAllocator; - - if (m_flags & e_activeFlag) - { - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - fixture->DestroyProxies(broadPhase); - } - - fixture->Destroy(allocator); - fixture->m_body = NULL; - fixture->m_next = NULL; - fixture->~b2Fixture(); - allocator->Free(fixture, sizeof(b2Fixture)); - - --m_fixtureCount; - - // Reset the mass data. - ResetMassData(); -} - -void b2Body::ResetMassData() -{ - // Compute mass data from shapes. Each shape has its own density. - m_mass = 0.0f; - m_invMass = 0.0f; - m_I = 0.0f; - m_invI = 0.0f; - m_sweep.localCenter.SetZero(); - - // Static and kinematic bodies have zero mass. - if (m_type == b2_staticBody || m_type == b2_kinematicBody) - { - m_sweep.c0 = m_xf.p; - m_sweep.c = m_xf.p; - m_sweep.a0 = m_sweep.a; - return; - } - - b2Assert(m_type == b2_dynamicBody); - - // Accumulate mass over all fixtures. - b2Vec2 localCenter = b2Vec2_zero; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - if (f->m_density == 0.0f) - { - continue; - } - - b2MassData massData; - f->GetMassData(&massData); - m_mass += massData.mass; - localCenter += massData.mass * massData.center; - m_I += massData.I; - } - - // Compute center of mass. - if (m_mass > 0.0f) - { - m_invMass = 1.0f / m_mass; - localCenter *= m_invMass; - } - else - { - // Force all dynamic bodies to have a positive mass. - m_mass = 1.0f; - m_invMass = 1.0f; - } - - if (m_I > 0.0f && (m_flags & e_fixedRotationFlag) == 0) - { - // Center the inertia about the center of mass. - m_I -= m_mass * b2Dot(localCenter, localCenter); - b2Assert(m_I > 0.0f); - m_invI = 1.0f / m_I; - - } - else - { - m_I = 0.0f; - m_invI = 0.0f; - } - - // Move center of mass. - b2Vec2 oldCenter = m_sweep.c; - m_sweep.localCenter = localCenter; - m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - - // Update center of mass velocity. - m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); -} - -void b2Body::SetMassData(const b2MassData* massData) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - if (m_type != b2_dynamicBody) - { - return; - } - - m_invMass = 0.0f; - m_I = 0.0f; - m_invI = 0.0f; - - m_mass = massData->mass; - if (m_mass <= 0.0f) - { - m_mass = 1.0f; - } - - m_invMass = 1.0f / m_mass; - - if (massData->I > 0.0f && (m_flags & b2Body::e_fixedRotationFlag) == 0) - { - m_I = massData->I - m_mass * b2Dot(massData->center, massData->center); - b2Assert(m_I > 0.0f); - m_invI = 1.0f / m_I; - } - - // Move center of mass. - b2Vec2 oldCenter = m_sweep.c; - m_sweep.localCenter = massData->center; - m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - - // Update center of mass velocity. - m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); -} - -bool b2Body::ShouldCollide(const b2Body* other) const -{ - // At least one body should be dynamic. - if (m_type != b2_dynamicBody && other->m_type != b2_dynamicBody) - { - return false; - } - - // Does a joint prevent collision? - for (b2JointEdge* jn = m_jointList; jn; jn = jn->next) - { - if (jn->other == other) - { - if (jn->joint->m_collideConnected == false) - { - return false; - } - } - } - - return true; -} - -void b2Body::SetTransform(const b2Vec2& position, float32 angle) -{ - b2Assert(m_world->IsLocked() == false); - if (m_world->IsLocked() == true) - { - return; - } - - m_xf.q.Set(angle); - m_xf.p = position; - - m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); - m_sweep.a = angle; - - m_sweep.c0 = m_sweep.c; - m_sweep.a0 = angle; - - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Synchronize(broadPhase, m_xf, m_xf); - } - - m_world->m_contactManager.FindNewContacts(); -} - -void b2Body::SynchronizeFixtures() -{ - b2Transform xf1; - xf1.q.Set(m_sweep.a0); - xf1.p = m_sweep.c0 - b2Mul(xf1.q, m_sweep.localCenter); - - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->Synchronize(broadPhase, xf1, m_xf); - } -} - -void b2Body::SetActive(bool flag) -{ - b2Assert(m_world->IsLocked() == false); - - if (flag == IsActive()) - { - return; - } - - if (flag) - { - m_flags |= e_activeFlag; - - // Create all proxies. - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->CreateProxies(broadPhase, m_xf); - } - - // Contacts are created the next time step. - } - else - { - m_flags &= ~e_activeFlag; - - // Destroy all proxies. - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - f->DestroyProxies(broadPhase); - } - - // Destroy the attached contacts. - b2ContactEdge* ce = m_contactList; - while (ce) - { - b2ContactEdge* ce0 = ce; - ce = ce->next; - m_world->m_contactManager.Destroy(ce0->contact); - } - m_contactList = NULL; - } -} - -void b2Body::Dump() -{ - int32 bodyIndex = m_islandIndex; - - b2Log("{\n"); - b2Log(" b2BodyDef bd;\n"); - b2Log(" bd.type = b2BodyType(%d);\n", m_type); - b2Log(" bd.position.Set(%.15lef, %.15lef);\n", m_xf.p.x, m_xf.p.y); - b2Log(" bd.angle = %.15lef;\n", m_sweep.a); - b2Log(" bd.linearVelocity.Set(%.15lef, %.15lef);\n", m_linearVelocity.x, m_linearVelocity.y); - b2Log(" bd.angularVelocity = %.15lef;\n", m_angularVelocity); - b2Log(" bd.linearDamping = %.15lef;\n", m_linearDamping); - b2Log(" bd.angularDamping = %.15lef;\n", m_angularDamping); - b2Log(" bd.allowSleep = bool(%d);\n", m_flags & e_autoSleepFlag); - b2Log(" bd.awake = bool(%d);\n", m_flags & e_awakeFlag); - b2Log(" bd.fixedRotation = bool(%d);\n", m_flags & e_fixedRotationFlag); - b2Log(" bd.bullet = bool(%d);\n", m_flags & e_bulletFlag); - b2Log(" bd.active = bool(%d);\n", m_flags & e_activeFlag); - b2Log(" bd.gravityScale = %.15lef;\n", m_gravityScale); - b2Log(" bodies[%d] = m_world->CreateBody(&bd);\n", m_islandIndex); - b2Log("\n"); - for (b2Fixture* f = m_fixtureList; f; f = f->m_next) - { - b2Log(" {\n"); - f->Dump(bodyIndex); - b2Log(" }\n"); - } - b2Log("}\n"); +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +b2Body::b2Body(const b2BodyDef* bd, b2World* world) +{ + b2Assert(bd->position.IsValid()); + b2Assert(bd->linearVelocity.IsValid()); + b2Assert(b2IsValid(bd->angle)); + b2Assert(b2IsValid(bd->angularVelocity)); + b2Assert(b2IsValid(bd->angularDamping) && bd->angularDamping >= 0.0f); + b2Assert(b2IsValid(bd->linearDamping) && bd->linearDamping >= 0.0f); + + m_flags = 0; + + if (bd->bullet) + { + m_flags |= e_bulletFlag; + } + if (bd->fixedRotation) + { + m_flags |= e_fixedRotationFlag; + } + if (bd->allowSleep) + { + m_flags |= e_autoSleepFlag; + } + if (bd->awake) + { + m_flags |= e_awakeFlag; + } + if (bd->active) + { + m_flags |= e_activeFlag; + } + + m_world = world; + + m_xf.p = bd->position; + m_xf.q.Set(bd->angle); + + m_sweep.localCenter.SetZero(); + m_sweep.c0 = m_xf.p; + m_sweep.c = m_xf.p; + m_sweep.a0 = bd->angle; + m_sweep.a = bd->angle; + m_sweep.alpha0 = 0.0f; + + m_jointList = NULL; + m_contactList = NULL; + m_prev = NULL; + m_next = NULL; + + m_linearVelocity = bd->linearVelocity; + m_angularVelocity = bd->angularVelocity; + + m_linearDamping = bd->linearDamping; + m_angularDamping = bd->angularDamping; + m_gravityScale = bd->gravityScale; + + m_force.SetZero(); + m_torque = 0.0f; + + m_sleepTime = 0.0f; + + m_type = bd->type; + + if (m_type == b2_dynamicBody) + { + m_mass = 1.0f; + m_invMass = 1.0f; + } + else + { + m_mass = 0.0f; + m_invMass = 0.0f; + } + + m_I = 0.0f; + m_invI = 0.0f; + + m_userData = bd->userData; + + m_fixtureList = NULL; + m_fixtureCount = 0; +} + +b2Body::~b2Body() +{ + // shapes and joints are destroyed in b2World::Destroy +} + +void b2Body::SetType(b2BodyType type) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + if (m_type == type) + { + return; + } + + m_type = type; + + ResetMassData(); + + if (m_type == b2_staticBody) + { + m_linearVelocity.SetZero(); + m_angularVelocity = 0.0f; + m_sweep.a0 = m_sweep.a; + m_sweep.c0 = m_sweep.c; + SynchronizeFixtures(); + } + + SetAwake(true); + + m_force.SetZero(); + m_torque = 0.0f; + + // Since the body type changed, we need to flag contacts for filtering. + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Refilter(); + } +} + +b2Fixture* b2Body::CreateFixture(const b2FixtureDef* def) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return NULL; + } + + b2BlockAllocator* allocator = &m_world->m_blockAllocator; + + void* memory = allocator->Allocate(sizeof(b2Fixture)); + b2Fixture* fixture = new (memory) b2Fixture; + fixture->Create(allocator, this, def); + + if (m_flags & e_activeFlag) + { + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + fixture->CreateProxies(broadPhase, m_xf); + } + + fixture->m_next = m_fixtureList; + m_fixtureList = fixture; + ++m_fixtureCount; + + fixture->m_body = this; + + // Adjust mass properties if needed. + if (fixture->m_density > 0.0f) + { + ResetMassData(); + } + + // Let the world know we have a new fixture. This will cause new contacts + // to be created at the beginning of the next time step. + m_world->m_flags |= b2World::e_newFixture; + + return fixture; +} + +b2Fixture* b2Body::CreateFixture(const b2Shape* shape, float32 density) +{ + b2FixtureDef def; + def.shape = shape; + def.density = density; + + return CreateFixture(&def); +} + +void b2Body::DestroyFixture(b2Fixture* fixture) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + b2Assert(fixture->m_body == this); + + // Remove the fixture from this body's singly linked list. + b2Assert(m_fixtureCount > 0); + b2Fixture** node = &m_fixtureList; + bool found = false; + while (*node != NULL) + { + if (*node == fixture) + { + *node = fixture->m_next; + found = true; + break; + } + + node = &(*node)->m_next; + } + + // You tried to remove a shape that is not attached to this body. + b2Assert(found); + + // Destroy any contacts associated with the fixture. + b2ContactEdge* edge = m_contactList; + while (edge) + { + b2Contact* c = edge->contact; + edge = edge->next; + + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + + if (fixture == fixtureA || fixture == fixtureB) + { + // This destroys the contact and removes it from + // this body's contact list. + m_world->m_contactManager.Destroy(c); + } + } + + b2BlockAllocator* allocator = &m_world->m_blockAllocator; + + if (m_flags & e_activeFlag) + { + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + fixture->DestroyProxies(broadPhase); + } + + fixture->Destroy(allocator); + fixture->m_body = NULL; + fixture->m_next = NULL; + fixture->~b2Fixture(); + allocator->Free(fixture, sizeof(b2Fixture)); + + --m_fixtureCount; + + // Reset the mass data. + ResetMassData(); +} + +void b2Body::ResetMassData() +{ + // Compute mass data from shapes. Each shape has its own density. + m_mass = 0.0f; + m_invMass = 0.0f; + m_I = 0.0f; + m_invI = 0.0f; + m_sweep.localCenter.SetZero(); + + // Static and kinematic bodies have zero mass. + if (m_type == b2_staticBody || m_type == b2_kinematicBody) + { + m_sweep.c0 = m_xf.p; + m_sweep.c = m_xf.p; + m_sweep.a0 = m_sweep.a; + return; + } + + b2Assert(m_type == b2_dynamicBody); + + // Accumulate mass over all fixtures. + b2Vec2 localCenter = b2Vec2_zero; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + if (f->m_density == 0.0f) + { + continue; + } + + b2MassData massData; + f->GetMassData(&massData); + m_mass += massData.mass; + localCenter += massData.mass * massData.center; + m_I += massData.I; + } + + // Compute center of mass. + if (m_mass > 0.0f) + { + m_invMass = 1.0f / m_mass; + localCenter *= m_invMass; + } + else + { + // Force all dynamic bodies to have a positive mass. + m_mass = 1.0f; + m_invMass = 1.0f; + } + + if (m_I > 0.0f && (m_flags & e_fixedRotationFlag) == 0) + { + // Center the inertia about the center of mass. + m_I -= m_mass * b2Dot(localCenter, localCenter); + b2Assert(m_I > 0.0f); + m_invI = 1.0f / m_I; + + } + else + { + m_I = 0.0f; + m_invI = 0.0f; + } + + // Move center of mass. + b2Vec2 oldCenter = m_sweep.c; + m_sweep.localCenter = localCenter; + m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + + // Update center of mass velocity. + m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); +} + +void b2Body::SetMassData(const b2MassData* massData) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + if (m_type != b2_dynamicBody) + { + return; + } + + m_invMass = 0.0f; + m_I = 0.0f; + m_invI = 0.0f; + + m_mass = massData->mass; + if (m_mass <= 0.0f) + { + m_mass = 1.0f; + } + + m_invMass = 1.0f / m_mass; + + if (massData->I > 0.0f && (m_flags & b2Body::e_fixedRotationFlag) == 0) + { + m_I = massData->I - m_mass * b2Dot(massData->center, massData->center); + b2Assert(m_I > 0.0f); + m_invI = 1.0f / m_I; + } + + // Move center of mass. + b2Vec2 oldCenter = m_sweep.c; + m_sweep.localCenter = massData->center; + m_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + + // Update center of mass velocity. + m_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter); +} + +bool b2Body::ShouldCollide(const b2Body* other) const +{ + // At least one body should be dynamic. + if (m_type != b2_dynamicBody && other->m_type != b2_dynamicBody) + { + return false; + } + + // Does a joint prevent collision? + for (b2JointEdge* jn = m_jointList; jn; jn = jn->next) + { + if (jn->other == other) + { + if (jn->joint->m_collideConnected == false) + { + return false; + } + } + } + + return true; +} + +void b2Body::SetTransform(const b2Vec2& position, float32 angle) +{ + b2Assert(m_world->IsLocked() == false); + if (m_world->IsLocked() == true) + { + return; + } + + m_xf.q.Set(angle); + m_xf.p = position; + + m_sweep.c = b2Mul(m_xf, m_sweep.localCenter); + m_sweep.a = angle; + + m_sweep.c0 = m_sweep.c; + m_sweep.a0 = angle; + + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Synchronize(broadPhase, m_xf, m_xf); + } + + m_world->m_contactManager.FindNewContacts(); +} + +void b2Body::SynchronizeFixtures() +{ + b2Transform xf1; + xf1.q.Set(m_sweep.a0); + xf1.p = m_sweep.c0 - b2Mul(xf1.q, m_sweep.localCenter); + + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->Synchronize(broadPhase, xf1, m_xf); + } +} + +void b2Body::SetActive(bool flag) +{ + b2Assert(m_world->IsLocked() == false); + + if (flag == IsActive()) + { + return; + } + + if (flag) + { + m_flags |= e_activeFlag; + + // Create all proxies. + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->CreateProxies(broadPhase, m_xf); + } + + // Contacts are created the next time step. + } + else + { + m_flags &= ~e_activeFlag; + + // Destroy all proxies. + b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + f->DestroyProxies(broadPhase); + } + + // Destroy the attached contacts. + b2ContactEdge* ce = m_contactList; + while (ce) + { + b2ContactEdge* ce0 = ce; + ce = ce->next; + m_world->m_contactManager.Destroy(ce0->contact); + } + m_contactList = NULL; + } +} + +void b2Body::Dump() +{ + int32 bodyIndex = m_islandIndex; + + b2Log("{\n"); + b2Log(" b2BodyDef bd;\n"); + b2Log(" bd.type = b2BodyType(%d);\n", m_type); + b2Log(" bd.position.Set(%.15lef, %.15lef);\n", m_xf.p.x, m_xf.p.y); + b2Log(" bd.angle = %.15lef;\n", m_sweep.a); + b2Log(" bd.linearVelocity.Set(%.15lef, %.15lef);\n", m_linearVelocity.x, m_linearVelocity.y); + b2Log(" bd.angularVelocity = %.15lef;\n", m_angularVelocity); + b2Log(" bd.linearDamping = %.15lef;\n", m_linearDamping); + b2Log(" bd.angularDamping = %.15lef;\n", m_angularDamping); + b2Log(" bd.allowSleep = bool(%d);\n", m_flags & e_autoSleepFlag); + b2Log(" bd.awake = bool(%d);\n", m_flags & e_awakeFlag); + b2Log(" bd.fixedRotation = bool(%d);\n", m_flags & e_fixedRotationFlag); + b2Log(" bd.bullet = bool(%d);\n", m_flags & e_bulletFlag); + b2Log(" bd.active = bool(%d);\n", m_flags & e_activeFlag); + b2Log(" bd.gravityScale = %.15lef;\n", m_gravityScale); + b2Log(" bodies[%d] = m_world->CreateBody(&bd);\n", m_islandIndex); + b2Log("\n"); + for (b2Fixture* f = m_fixtureList; f; f = f->m_next) + { + b2Log(" {\n"); + f->Dump(bodyIndex); + b2Log(" }\n"); + } + b2Log("}\n"); } \ No newline at end of file diff --git a/src/libraries/Box2D/Dynamics/b2Body.h b/src/libraries/Box2D/Dynamics/b2Body.h index 73f2cb415..c6009513a 100755 --- a/src/libraries/Box2D/Dynamics/b2Body.h +++ b/src/libraries/Box2D/Dynamics/b2Body.h @@ -1,846 +1,846 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_BODY_H -#define B2_BODY_H - -#include -#include -#include - -class b2Fixture; -class b2Joint; -class b2Contact; -class b2Controller; -class b2World; -struct b2FixtureDef; -struct b2JointEdge; -struct b2ContactEdge; - -/// The body type. -/// static: zero mass, zero velocity, may be manually moved -/// kinematic: zero mass, non-zero velocity set by user, moved by solver -/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver -enum b2BodyType -{ - b2_staticBody = 0, - b2_kinematicBody, - b2_dynamicBody - - // TODO_ERIN - //b2_bulletBody, -}; - -/// A body definition holds all the data needed to construct a rigid body. -/// You can safely re-use body definitions. Shapes are added to a body after construction. -struct b2BodyDef -{ - /// This constructor sets the body definition default values. - b2BodyDef() - { - userData = NULL; - position.Set(0.0f, 0.0f); - angle = 0.0f; - linearVelocity.Set(0.0f, 0.0f); - angularVelocity = 0.0f; - linearDamping = 0.0f; - angularDamping = 0.0f; - allowSleep = true; - awake = true; - fixedRotation = false; - bullet = false; - type = b2_staticBody; - active = true; - gravityScale = 1.0f; - } - - /// The body type: static, kinematic, or dynamic. - /// Note: if a dynamic body would have zero mass, the mass is set to one. - b2BodyType type; - - /// The world position of the body. Avoid creating bodies at the origin - /// since this can lead to many overlapping shapes. - b2Vec2 position; - - /// The world angle of the body in radians. - float32 angle; - - /// The linear velocity of the body's origin in world co-ordinates. - b2Vec2 linearVelocity; - - /// The angular velocity of the body. - float32 angularVelocity; - - /// Linear damping is use to reduce the linear velocity. The damping parameter - /// can be larger than 1.0f but the damping effect becomes sensitive to the - /// time step when the damping parameter is large. - float32 linearDamping; - - /// Angular damping is use to reduce the angular velocity. The damping parameter - /// can be larger than 1.0f but the damping effect becomes sensitive to the - /// time step when the damping parameter is large. - float32 angularDamping; - - /// Set this flag to false if this body should never fall asleep. Note that - /// this increases CPU usage. - bool allowSleep; - - /// Is this body initially awake or sleeping? - bool awake; - - /// Should this body be prevented from rotating? Useful for characters. - bool fixedRotation; - - /// Is this a fast moving body that should be prevented from tunneling through - /// other moving bodies? Note that all bodies are prevented from tunneling through - /// kinematic and static bodies. This setting is only considered on dynamic bodies. - /// @warning You should use this flag sparingly since it increases processing time. - bool bullet; - - /// Does this body start out active? - bool active; - - /// Use this to store application specific body data. - void* userData; - - /// Scale the gravity applied to this body. - float32 gravityScale; -}; - -/// A rigid body. These are created via b2World::CreateBody. -class b2Body -{ -public: - /// Creates a fixture and attach it to this body. Use this function if you need - /// to set some fixture parameters, like friction. Otherwise you can create the - /// fixture directly from a shape. - /// If the density is non-zero, this function automatically updates the mass of the body. - /// Contacts are not created until the next time step. - /// @param def the fixture definition. - /// @warning This function is locked during callbacks. - b2Fixture* CreateFixture(const b2FixtureDef* def); - - /// Creates a fixture from a shape and attach it to this body. - /// This is a convenience function. Use b2FixtureDef if you need to set parameters - /// like friction, restitution, user data, or filtering. - /// If the density is non-zero, this function automatically updates the mass of the body. - /// @param shape the shape to be cloned. - /// @param density the shape density (set to zero for static bodies). - /// @warning This function is locked during callbacks. - b2Fixture* CreateFixture(const b2Shape* shape, float32 density); - - /// Destroy a fixture. This removes the fixture from the broad-phase and - /// destroys all contacts associated with this fixture. This will - /// automatically adjust the mass of the body if the body is dynamic and the - /// fixture has positive density. - /// All fixtures attached to a body are implicitly destroyed when the body is destroyed. - /// @param fixture the fixture to be removed. - /// @warning This function is locked during callbacks. - void DestroyFixture(b2Fixture* fixture); - - /// Set the position of the body's origin and rotation. - /// This breaks any contacts and wakes the other bodies. - /// Manipulating a body's transform may cause non-physical behavior. - /// @param position the world position of the body's local origin. - /// @param angle the world rotation in radians. - void SetTransform(const b2Vec2& position, float32 angle); - - /// Get the body transform for the body's origin. - /// @return the world transform of the body's origin. - const b2Transform& GetTransform() const; - - /// Get the world body origin position. - /// @return the world position of the body's origin. - const b2Vec2& GetPosition() const; - - /// Get the angle in radians. - /// @return the current world rotation angle in radians. - float32 GetAngle() const; - - /// Get the world position of the center of mass. - const b2Vec2& GetWorldCenter() const; - - /// Get the local position of the center of mass. - const b2Vec2& GetLocalCenter() const; - - /// Set the linear velocity of the center of mass. - /// @param v the new linear velocity of the center of mass. - void SetLinearVelocity(const b2Vec2& v); - - /// Get the linear velocity of the center of mass. - /// @return the linear velocity of the center of mass. - b2Vec2 GetLinearVelocity() const; - - /// Set the angular velocity. - /// @param omega the new angular velocity in radians/second. - void SetAngularVelocity(float32 omega); - - /// Get the angular velocity. - /// @return the angular velocity in radians/second. - float32 GetAngularVelocity() const; - - /// Apply a force at a world point. If the force is not - /// applied at the center of mass, it will generate a torque and - /// affect the angular velocity. This wakes up the body. - /// @param force the world force vector, usually in Newtons (N). - /// @param point the world position of the point of application. - void ApplyForce(const b2Vec2& force, const b2Vec2& point); - - /// Apply a force to the center of mass. This wakes up the body. - /// @param force the world force vector, usually in Newtons (N). - void ApplyForceToCenter(const b2Vec2& force); - - /// Apply a torque. This affects the angular velocity - /// without affecting the linear velocity of the center of mass. - /// This wakes up the body. - /// @param torque about the z-axis (out of the screen), usually in N-m. - void ApplyTorque(float32 torque); - - /// Apply an impulse at a point. This immediately modifies the velocity. - /// It also modifies the angular velocity if the point of application - /// is not at the center of mass. This wakes up the body. - /// @param impulse the world impulse vector, usually in N-seconds or kg-m/s. - /// @param point the world position of the point of application. - void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point); - - /// Apply an angular impulse. - /// @param impulse the angular impulse in units of kg*m*m/s - void ApplyAngularImpulse(float32 impulse); - - /// Get the total mass of the body. - /// @return the mass, usually in kilograms (kg). - float32 GetMass() const; - - /// Get the rotational inertia of the body about the local origin. - /// @return the rotational inertia, usually in kg-m^2. - float32 GetInertia() const; - - /// Get the mass data of the body. - /// @return a struct containing the mass, inertia and center of the body. - void GetMassData(b2MassData* data) const; - - /// Set the mass properties to override the mass properties of the fixtures. - /// Note that this changes the center of mass position. - /// Note that creating or destroying fixtures can also alter the mass. - /// This function has no effect if the body isn't dynamic. - /// @param massData the mass properties. - void SetMassData(const b2MassData* data); - - /// This resets the mass properties to the sum of the mass properties of the fixtures. - /// This normally does not need to be called unless you called SetMassData to override - /// the mass and you later want to reset the mass. - void ResetMassData(); - - /// Get the world coordinates of a point given the local coordinates. - /// @param localPoint a point on the body measured relative the the body's origin. - /// @return the same point expressed in world coordinates. - b2Vec2 GetWorldPoint(const b2Vec2& localPoint) const; - - /// Get the world coordinates of a vector given the local coordinates. - /// @param localVector a vector fixed in the body. - /// @return the same vector expressed in world coordinates. - b2Vec2 GetWorldVector(const b2Vec2& localVector) const; - - /// Gets a local point relative to the body's origin given a world point. - /// @param a point in world coordinates. - /// @return the corresponding local point relative to the body's origin. - b2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const; - - /// Gets a local vector given a world vector. - /// @param a vector in world coordinates. - /// @return the corresponding local vector. - b2Vec2 GetLocalVector(const b2Vec2& worldVector) const; - - /// Get the world linear velocity of a world point attached to this body. - /// @param a point in world coordinates. - /// @return the world velocity of a point. - b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const; - - /// Get the world velocity of a local point. - /// @param a point in local coordinates. - /// @return the world velocity of a point. - b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const; - - /// Get the linear damping of the body. - float32 GetLinearDamping() const; - - /// Set the linear damping of the body. - void SetLinearDamping(float32 linearDamping); - - /// Get the angular damping of the body. - float32 GetAngularDamping() const; - - /// Set the angular damping of the body. - void SetAngularDamping(float32 angularDamping); - - /// Get the gravity scale of the body. - float32 GetGravityScale() const; - - /// Set the gravity scale of the body. - void SetGravityScale(float32 scale); - - /// Set the type of this body. This may alter the mass and velocity. - void SetType(b2BodyType type); - - /// Get the type of this body. - b2BodyType GetType() const; - - /// Should this body be treated like a bullet for continuous collision detection? - void SetBullet(bool flag); - - /// Is this body treated like a bullet for continuous collision detection? - bool IsBullet() const; - - /// You can disable sleeping on this body. If you disable sleeping, the - /// body will be woken. - void SetSleepingAllowed(bool flag); - - /// Is this body allowed to sleep - bool IsSleepingAllowed() const; - - /// Set the sleep state of the body. A sleeping body has very - /// low CPU cost. - /// @param flag set to true to put body to sleep, false to wake it. - void SetAwake(bool flag); - - /// Get the sleeping state of this body. - /// @return true if the body is sleeping. - bool IsAwake() const; - - /// Set the active state of the body. An inactive body is not - /// simulated and cannot be collided with or woken up. - /// If you pass a flag of true, all fixtures will be added to the - /// broad-phase. - /// If you pass a flag of false, all fixtures will be removed from - /// the broad-phase and all contacts will be destroyed. - /// Fixtures and joints are otherwise unaffected. You may continue - /// to create/destroy fixtures and joints on inactive bodies. - /// Fixtures on an inactive body are implicitly inactive and will - /// not participate in collisions, ray-casts, or queries. - /// Joints connected to an inactive body are implicitly inactive. - /// An inactive body is still owned by a b2World object and remains - /// in the body list. - void SetActive(bool flag); - - /// Get the active state of the body. - bool IsActive() const; - - /// Set this body to have fixed rotation. This causes the mass - /// to be reset. - void SetFixedRotation(bool flag); - - /// Does this body have fixed rotation? - bool IsFixedRotation() const; - - /// Get the list of all fixtures attached to this body. - b2Fixture* GetFixtureList(); - const b2Fixture* GetFixtureList() const; - - /// Get the list of all joints attached to this body. - b2JointEdge* GetJointList(); - const b2JointEdge* GetJointList() const; - - /// Get the list of all contacts attached to this body. - /// @warning this list changes during the time step and you may - /// miss some collisions if you don't use b2ContactListener. - b2ContactEdge* GetContactList(); - const b2ContactEdge* GetContactList() const; - - /// Get the next body in the world's body list. - b2Body* GetNext(); - const b2Body* GetNext() const; - - /// Get the user data pointer that was provided in the body definition. - void* GetUserData() const; - - /// Set the user data. Use this to store your application specific data. - void SetUserData(void* data); - - /// Get the parent world of this body. - b2World* GetWorld(); - const b2World* GetWorld() const; - - /// Dump this body to a log file - void Dump(); - -private: - - friend class b2World; - friend class b2Island; - friend class b2ContactManager; - friend class b2ContactSolver; - friend class b2Contact; - - friend class b2DistanceJoint; - friend class b2GearJoint; - friend class b2WheelJoint; - friend class b2MouseJoint; - friend class b2PrismaticJoint; - friend class b2PulleyJoint; - friend class b2RevoluteJoint; - friend class b2WeldJoint; - friend class b2FrictionJoint; - friend class b2RopeJoint; - - // m_flags - enum - { - e_islandFlag = 0x0001, - e_awakeFlag = 0x0002, - e_autoSleepFlag = 0x0004, - e_bulletFlag = 0x0008, - e_fixedRotationFlag = 0x0010, - e_activeFlag = 0x0020, - e_toiFlag = 0x0040 - }; - - b2Body(const b2BodyDef* bd, b2World* world); - ~b2Body(); - - void SynchronizeFixtures(); - void SynchronizeTransform(); - - // This is used to prevent connected bodies from colliding. - // It may lie, depending on the collideConnected flag. - bool ShouldCollide(const b2Body* other) const; - - void Advance(float32 t); - - b2BodyType m_type; - - uint16 m_flags; - - int32 m_islandIndex; - - b2Transform m_xf; // the body origin transform - b2Sweep m_sweep; // the swept motion for CCD - - b2Vec2 m_linearVelocity; - float32 m_angularVelocity; - - b2Vec2 m_force; - float32 m_torque; - - b2World* m_world; - b2Body* m_prev; - b2Body* m_next; - - b2Fixture* m_fixtureList; - int32 m_fixtureCount; - - b2JointEdge* m_jointList; - b2ContactEdge* m_contactList; - - float32 m_mass, m_invMass; - - // Rotational inertia about the center of mass. - float32 m_I, m_invI; - - float32 m_linearDamping; - float32 m_angularDamping; - float32 m_gravityScale; - - float32 m_sleepTime; - - void* m_userData; -}; - -inline b2BodyType b2Body::GetType() const -{ - return m_type; -} - -inline const b2Transform& b2Body::GetTransform() const -{ - return m_xf; -} - -inline const b2Vec2& b2Body::GetPosition() const -{ - return m_xf.p; -} - -inline float32 b2Body::GetAngle() const -{ - return m_sweep.a; -} - -inline const b2Vec2& b2Body::GetWorldCenter() const -{ - return m_sweep.c; -} - -inline const b2Vec2& b2Body::GetLocalCenter() const -{ - return m_sweep.localCenter; -} - -inline void b2Body::SetLinearVelocity(const b2Vec2& v) -{ - if (m_type == b2_staticBody) - { - return; - } - - if (b2Dot(v,v) > 0.0f) - { - SetAwake(true); - } - - m_linearVelocity = v; -} - -inline b2Vec2 b2Body::GetLinearVelocity() const -{ - return m_linearVelocity; -} - -inline void b2Body::SetAngularVelocity(float32 w) -{ - if (m_type == b2_staticBody) - { - return; - } - - if (w * w > 0.0f) - { - SetAwake(true); - } - - m_angularVelocity = w; -} - -inline float32 b2Body::GetAngularVelocity() const -{ - return m_angularVelocity; -} - -inline float32 b2Body::GetMass() const -{ - return m_mass; -} - -inline float32 b2Body::GetInertia() const -{ - return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); -} - -inline void b2Body::GetMassData(b2MassData* data) const -{ - data->mass = m_mass; - data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); - data->center = m_sweep.localCenter; -} - -inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const -{ - return b2Mul(m_xf, localPoint); -} - -inline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const -{ - return b2Mul(m_xf.q, localVector); -} - -inline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const -{ - return b2MulT(m_xf, worldPoint); -} - -inline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const -{ - return b2MulT(m_xf.q, worldVector); -} - -inline b2Vec2 b2Body::GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const -{ - return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c); -} - -inline b2Vec2 b2Body::GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const -{ - return GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint)); -} - -inline float32 b2Body::GetLinearDamping() const -{ - return m_linearDamping; -} - -inline void b2Body::SetLinearDamping(float32 linearDamping) -{ - m_linearDamping = linearDamping; -} - -inline float32 b2Body::GetAngularDamping() const -{ - return m_angularDamping; -} - -inline void b2Body::SetAngularDamping(float32 angularDamping) -{ - m_angularDamping = angularDamping; -} - -inline float32 b2Body::GetGravityScale() const -{ - return m_gravityScale; -} - -inline void b2Body::SetGravityScale(float32 scale) -{ - m_gravityScale = scale; -} - -inline void b2Body::SetBullet(bool flag) -{ - if (flag) - { - m_flags |= e_bulletFlag; - } - else - { - m_flags &= ~e_bulletFlag; - } -} - -inline bool b2Body::IsBullet() const -{ - return (m_flags & e_bulletFlag) == e_bulletFlag; -} - -inline void b2Body::SetAwake(bool flag) -{ - if (flag) - { - if ((m_flags & e_awakeFlag) == 0) - { - m_flags |= e_awakeFlag; - m_sleepTime = 0.0f; - } - } - else - { - m_flags &= ~e_awakeFlag; - m_sleepTime = 0.0f; - m_linearVelocity.SetZero(); - m_angularVelocity = 0.0f; - m_force.SetZero(); - m_torque = 0.0f; - } -} - -inline bool b2Body::IsAwake() const -{ - return (m_flags & e_awakeFlag) == e_awakeFlag; -} - -inline bool b2Body::IsActive() const -{ - return (m_flags & e_activeFlag) == e_activeFlag; -} - -inline void b2Body::SetFixedRotation(bool flag) -{ - if (flag) - { - m_flags |= e_fixedRotationFlag; - } - else - { - m_flags &= ~e_fixedRotationFlag; - } - - ResetMassData(); -} - -inline bool b2Body::IsFixedRotation() const -{ - return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; -} - -inline void b2Body::SetSleepingAllowed(bool flag) -{ - if (flag) - { - m_flags |= e_autoSleepFlag; - } - else - { - m_flags &= ~e_autoSleepFlag; - SetAwake(true); - } -} - -inline bool b2Body::IsSleepingAllowed() const -{ - return (m_flags & e_autoSleepFlag) == e_autoSleepFlag; -} - -inline b2Fixture* b2Body::GetFixtureList() -{ - return m_fixtureList; -} - -inline const b2Fixture* b2Body::GetFixtureList() const -{ - return m_fixtureList; -} - -inline b2JointEdge* b2Body::GetJointList() -{ - return m_jointList; -} - -inline const b2JointEdge* b2Body::GetJointList() const -{ - return m_jointList; -} - -inline b2ContactEdge* b2Body::GetContactList() -{ - return m_contactList; -} - -inline const b2ContactEdge* b2Body::GetContactList() const -{ - return m_contactList; -} - -inline b2Body* b2Body::GetNext() -{ - return m_next; -} - -inline const b2Body* b2Body::GetNext() const -{ - return m_next; -} - -inline void b2Body::SetUserData(void* data) -{ - m_userData = data; -} - -inline void* b2Body::GetUserData() const -{ - return m_userData; -} - -inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_force += force; - m_torque += b2Cross(point - m_sweep.c, force); -} - -inline void b2Body::ApplyForceToCenter(const b2Vec2& force) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_force += force; -} - -inline void b2Body::ApplyTorque(float32 torque) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - - m_torque += torque; -} - -inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - m_linearVelocity += m_invMass * impulse; - m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); -} - -inline void b2Body::ApplyAngularImpulse(float32 impulse) -{ - if (m_type != b2_dynamicBody) - { - return; - } - - if (IsAwake() == false) - { - SetAwake(true); - } - m_angularVelocity += m_invI * impulse; -} - -inline void b2Body::SynchronizeTransform() -{ - m_xf.q.Set(m_sweep.a); - m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); -} - -inline void b2Body::Advance(float32 alpha) -{ - // Advance to the new safe time. This doesn't sync the broad-phase. - m_sweep.Advance(alpha); - m_sweep.c = m_sweep.c0; - m_sweep.a = m_sweep.a0; - m_xf.q.Set(m_sweep.a); - m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); -} - -inline b2World* b2Body::GetWorld() -{ - return m_world; -} - -inline const b2World* b2Body::GetWorld() const -{ - return m_world; -} - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BODY_H +#define B2_BODY_H + +#include +#include +#include + +class b2Fixture; +class b2Joint; +class b2Contact; +class b2Controller; +class b2World; +struct b2FixtureDef; +struct b2JointEdge; +struct b2ContactEdge; + +/// The body type. +/// static: zero mass, zero velocity, may be manually moved +/// kinematic: zero mass, non-zero velocity set by user, moved by solver +/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver +enum b2BodyType +{ + b2_staticBody = 0, + b2_kinematicBody, + b2_dynamicBody + + // TODO_ERIN + //b2_bulletBody, +}; + +/// A body definition holds all the data needed to construct a rigid body. +/// You can safely re-use body definitions. Shapes are added to a body after construction. +struct b2BodyDef +{ + /// This constructor sets the body definition default values. + b2BodyDef() + { + userData = NULL; + position.Set(0.0f, 0.0f); + angle = 0.0f; + linearVelocity.Set(0.0f, 0.0f); + angularVelocity = 0.0f; + linearDamping = 0.0f; + angularDamping = 0.0f; + allowSleep = true; + awake = true; + fixedRotation = false; + bullet = false; + type = b2_staticBody; + active = true; + gravityScale = 1.0f; + } + + /// The body type: static, kinematic, or dynamic. + /// Note: if a dynamic body would have zero mass, the mass is set to one. + b2BodyType type; + + /// The world position of the body. Avoid creating bodies at the origin + /// since this can lead to many overlapping shapes. + b2Vec2 position; + + /// The world angle of the body in radians. + float32 angle; + + /// The linear velocity of the body's origin in world co-ordinates. + b2Vec2 linearVelocity; + + /// The angular velocity of the body. + float32 angularVelocity; + + /// Linear damping is use to reduce the linear velocity. The damping parameter + /// can be larger than 1.0f but the damping effect becomes sensitive to the + /// time step when the damping parameter is large. + float32 linearDamping; + + /// Angular damping is use to reduce the angular velocity. The damping parameter + /// can be larger than 1.0f but the damping effect becomes sensitive to the + /// time step when the damping parameter is large. + float32 angularDamping; + + /// Set this flag to false if this body should never fall asleep. Note that + /// this increases CPU usage. + bool allowSleep; + + /// Is this body initially awake or sleeping? + bool awake; + + /// Should this body be prevented from rotating? Useful for characters. + bool fixedRotation; + + /// Is this a fast moving body that should be prevented from tunneling through + /// other moving bodies? Note that all bodies are prevented from tunneling through + /// kinematic and static bodies. This setting is only considered on dynamic bodies. + /// @warning You should use this flag sparingly since it increases processing time. + bool bullet; + + /// Does this body start out active? + bool active; + + /// Use this to store application specific body data. + void* userData; + + /// Scale the gravity applied to this body. + float32 gravityScale; +}; + +/// A rigid body. These are created via b2World::CreateBody. +class b2Body +{ +public: + /// Creates a fixture and attach it to this body. Use this function if you need + /// to set some fixture parameters, like friction. Otherwise you can create the + /// fixture directly from a shape. + /// If the density is non-zero, this function automatically updates the mass of the body. + /// Contacts are not created until the next time step. + /// @param def the fixture definition. + /// @warning This function is locked during callbacks. + b2Fixture* CreateFixture(const b2FixtureDef* def); + + /// Creates a fixture from a shape and attach it to this body. + /// This is a convenience function. Use b2FixtureDef if you need to set parameters + /// like friction, restitution, user data, or filtering. + /// If the density is non-zero, this function automatically updates the mass of the body. + /// @param shape the shape to be cloned. + /// @param density the shape density (set to zero for static bodies). + /// @warning This function is locked during callbacks. + b2Fixture* CreateFixture(const b2Shape* shape, float32 density); + + /// Destroy a fixture. This removes the fixture from the broad-phase and + /// destroys all contacts associated with this fixture. This will + /// automatically adjust the mass of the body if the body is dynamic and the + /// fixture has positive density. + /// All fixtures attached to a body are implicitly destroyed when the body is destroyed. + /// @param fixture the fixture to be removed. + /// @warning This function is locked during callbacks. + void DestroyFixture(b2Fixture* fixture); + + /// Set the position of the body's origin and rotation. + /// This breaks any contacts and wakes the other bodies. + /// Manipulating a body's transform may cause non-physical behavior. + /// @param position the world position of the body's local origin. + /// @param angle the world rotation in radians. + void SetTransform(const b2Vec2& position, float32 angle); + + /// Get the body transform for the body's origin. + /// @return the world transform of the body's origin. + const b2Transform& GetTransform() const; + + /// Get the world body origin position. + /// @return the world position of the body's origin. + const b2Vec2& GetPosition() const; + + /// Get the angle in radians. + /// @return the current world rotation angle in radians. + float32 GetAngle() const; + + /// Get the world position of the center of mass. + const b2Vec2& GetWorldCenter() const; + + /// Get the local position of the center of mass. + const b2Vec2& GetLocalCenter() const; + + /// Set the linear velocity of the center of mass. + /// @param v the new linear velocity of the center of mass. + void SetLinearVelocity(const b2Vec2& v); + + /// Get the linear velocity of the center of mass. + /// @return the linear velocity of the center of mass. + b2Vec2 GetLinearVelocity() const; + + /// Set the angular velocity. + /// @param omega the new angular velocity in radians/second. + void SetAngularVelocity(float32 omega); + + /// Get the angular velocity. + /// @return the angular velocity in radians/second. + float32 GetAngularVelocity() const; + + /// Apply a force at a world point. If the force is not + /// applied at the center of mass, it will generate a torque and + /// affect the angular velocity. This wakes up the body. + /// @param force the world force vector, usually in Newtons (N). + /// @param point the world position of the point of application. + void ApplyForce(const b2Vec2& force, const b2Vec2& point); + + /// Apply a force to the center of mass. This wakes up the body. + /// @param force the world force vector, usually in Newtons (N). + void ApplyForceToCenter(const b2Vec2& force); + + /// Apply a torque. This affects the angular velocity + /// without affecting the linear velocity of the center of mass. + /// This wakes up the body. + /// @param torque about the z-axis (out of the screen), usually in N-m. + void ApplyTorque(float32 torque); + + /// Apply an impulse at a point. This immediately modifies the velocity. + /// It also modifies the angular velocity if the point of application + /// is not at the center of mass. This wakes up the body. + /// @param impulse the world impulse vector, usually in N-seconds or kg-m/s. + /// @param point the world position of the point of application. + void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point); + + /// Apply an angular impulse. + /// @param impulse the angular impulse in units of kg*m*m/s + void ApplyAngularImpulse(float32 impulse); + + /// Get the total mass of the body. + /// @return the mass, usually in kilograms (kg). + float32 GetMass() const; + + /// Get the rotational inertia of the body about the local origin. + /// @return the rotational inertia, usually in kg-m^2. + float32 GetInertia() const; + + /// Get the mass data of the body. + /// @return a struct containing the mass, inertia and center of the body. + void GetMassData(b2MassData* data) const; + + /// Set the mass properties to override the mass properties of the fixtures. + /// Note that this changes the center of mass position. + /// Note that creating or destroying fixtures can also alter the mass. + /// This function has no effect if the body isn't dynamic. + /// @param massData the mass properties. + void SetMassData(const b2MassData* data); + + /// This resets the mass properties to the sum of the mass properties of the fixtures. + /// This normally does not need to be called unless you called SetMassData to override + /// the mass and you later want to reset the mass. + void ResetMassData(); + + /// Get the world coordinates of a point given the local coordinates. + /// @param localPoint a point on the body measured relative the the body's origin. + /// @return the same point expressed in world coordinates. + b2Vec2 GetWorldPoint(const b2Vec2& localPoint) const; + + /// Get the world coordinates of a vector given the local coordinates. + /// @param localVector a vector fixed in the body. + /// @return the same vector expressed in world coordinates. + b2Vec2 GetWorldVector(const b2Vec2& localVector) const; + + /// Gets a local point relative to the body's origin given a world point. + /// @param a point in world coordinates. + /// @return the corresponding local point relative to the body's origin. + b2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const; + + /// Gets a local vector given a world vector. + /// @param a vector in world coordinates. + /// @return the corresponding local vector. + b2Vec2 GetLocalVector(const b2Vec2& worldVector) const; + + /// Get the world linear velocity of a world point attached to this body. + /// @param a point in world coordinates. + /// @return the world velocity of a point. + b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const; + + /// Get the world velocity of a local point. + /// @param a point in local coordinates. + /// @return the world velocity of a point. + b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const; + + /// Get the linear damping of the body. + float32 GetLinearDamping() const; + + /// Set the linear damping of the body. + void SetLinearDamping(float32 linearDamping); + + /// Get the angular damping of the body. + float32 GetAngularDamping() const; + + /// Set the angular damping of the body. + void SetAngularDamping(float32 angularDamping); + + /// Get the gravity scale of the body. + float32 GetGravityScale() const; + + /// Set the gravity scale of the body. + void SetGravityScale(float32 scale); + + /// Set the type of this body. This may alter the mass and velocity. + void SetType(b2BodyType type); + + /// Get the type of this body. + b2BodyType GetType() const; + + /// Should this body be treated like a bullet for continuous collision detection? + void SetBullet(bool flag); + + /// Is this body treated like a bullet for continuous collision detection? + bool IsBullet() const; + + /// You can disable sleeping on this body. If you disable sleeping, the + /// body will be woken. + void SetSleepingAllowed(bool flag); + + /// Is this body allowed to sleep + bool IsSleepingAllowed() const; + + /// Set the sleep state of the body. A sleeping body has very + /// low CPU cost. + /// @param flag set to true to put body to sleep, false to wake it. + void SetAwake(bool flag); + + /// Get the sleeping state of this body. + /// @return true if the body is sleeping. + bool IsAwake() const; + + /// Set the active state of the body. An inactive body is not + /// simulated and cannot be collided with or woken up. + /// If you pass a flag of true, all fixtures will be added to the + /// broad-phase. + /// If you pass a flag of false, all fixtures will be removed from + /// the broad-phase and all contacts will be destroyed. + /// Fixtures and joints are otherwise unaffected. You may continue + /// to create/destroy fixtures and joints on inactive bodies. + /// Fixtures on an inactive body are implicitly inactive and will + /// not participate in collisions, ray-casts, or queries. + /// Joints connected to an inactive body are implicitly inactive. + /// An inactive body is still owned by a b2World object and remains + /// in the body list. + void SetActive(bool flag); + + /// Get the active state of the body. + bool IsActive() const; + + /// Set this body to have fixed rotation. This causes the mass + /// to be reset. + void SetFixedRotation(bool flag); + + /// Does this body have fixed rotation? + bool IsFixedRotation() const; + + /// Get the list of all fixtures attached to this body. + b2Fixture* GetFixtureList(); + const b2Fixture* GetFixtureList() const; + + /// Get the list of all joints attached to this body. + b2JointEdge* GetJointList(); + const b2JointEdge* GetJointList() const; + + /// Get the list of all contacts attached to this body. + /// @warning this list changes during the time step and you may + /// miss some collisions if you don't use b2ContactListener. + b2ContactEdge* GetContactList(); + const b2ContactEdge* GetContactList() const; + + /// Get the next body in the world's body list. + b2Body* GetNext(); + const b2Body* GetNext() const; + + /// Get the user data pointer that was provided in the body definition. + void* GetUserData() const; + + /// Set the user data. Use this to store your application specific data. + void SetUserData(void* data); + + /// Get the parent world of this body. + b2World* GetWorld(); + const b2World* GetWorld() const; + + /// Dump this body to a log file + void Dump(); + +private: + + friend class b2World; + friend class b2Island; + friend class b2ContactManager; + friend class b2ContactSolver; + friend class b2Contact; + + friend class b2DistanceJoint; + friend class b2GearJoint; + friend class b2WheelJoint; + friend class b2MouseJoint; + friend class b2PrismaticJoint; + friend class b2PulleyJoint; + friend class b2RevoluteJoint; + friend class b2WeldJoint; + friend class b2FrictionJoint; + friend class b2RopeJoint; + + // m_flags + enum + { + e_islandFlag = 0x0001, + e_awakeFlag = 0x0002, + e_autoSleepFlag = 0x0004, + e_bulletFlag = 0x0008, + e_fixedRotationFlag = 0x0010, + e_activeFlag = 0x0020, + e_toiFlag = 0x0040 + }; + + b2Body(const b2BodyDef* bd, b2World* world); + ~b2Body(); + + void SynchronizeFixtures(); + void SynchronizeTransform(); + + // This is used to prevent connected bodies from colliding. + // It may lie, depending on the collideConnected flag. + bool ShouldCollide(const b2Body* other) const; + + void Advance(float32 t); + + b2BodyType m_type; + + uint16 m_flags; + + int32 m_islandIndex; + + b2Transform m_xf; // the body origin transform + b2Sweep m_sweep; // the swept motion for CCD + + b2Vec2 m_linearVelocity; + float32 m_angularVelocity; + + b2Vec2 m_force; + float32 m_torque; + + b2World* m_world; + b2Body* m_prev; + b2Body* m_next; + + b2Fixture* m_fixtureList; + int32 m_fixtureCount; + + b2JointEdge* m_jointList; + b2ContactEdge* m_contactList; + + float32 m_mass, m_invMass; + + // Rotational inertia about the center of mass. + float32 m_I, m_invI; + + float32 m_linearDamping; + float32 m_angularDamping; + float32 m_gravityScale; + + float32 m_sleepTime; + + void* m_userData; +}; + +inline b2BodyType b2Body::GetType() const +{ + return m_type; +} + +inline const b2Transform& b2Body::GetTransform() const +{ + return m_xf; +} + +inline const b2Vec2& b2Body::GetPosition() const +{ + return m_xf.p; +} + +inline float32 b2Body::GetAngle() const +{ + return m_sweep.a; +} + +inline const b2Vec2& b2Body::GetWorldCenter() const +{ + return m_sweep.c; +} + +inline const b2Vec2& b2Body::GetLocalCenter() const +{ + return m_sweep.localCenter; +} + +inline void b2Body::SetLinearVelocity(const b2Vec2& v) +{ + if (m_type == b2_staticBody) + { + return; + } + + if (b2Dot(v,v) > 0.0f) + { + SetAwake(true); + } + + m_linearVelocity = v; +} + +inline b2Vec2 b2Body::GetLinearVelocity() const +{ + return m_linearVelocity; +} + +inline void b2Body::SetAngularVelocity(float32 w) +{ + if (m_type == b2_staticBody) + { + return; + } + + if (w * w > 0.0f) + { + SetAwake(true); + } + + m_angularVelocity = w; +} + +inline float32 b2Body::GetAngularVelocity() const +{ + return m_angularVelocity; +} + +inline float32 b2Body::GetMass() const +{ + return m_mass; +} + +inline float32 b2Body::GetInertia() const +{ + return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); +} + +inline void b2Body::GetMassData(b2MassData* data) const +{ + data->mass = m_mass; + data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); + data->center = m_sweep.localCenter; +} + +inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const +{ + return b2Mul(m_xf, localPoint); +} + +inline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const +{ + return b2Mul(m_xf.q, localVector); +} + +inline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const +{ + return b2MulT(m_xf, worldPoint); +} + +inline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const +{ + return b2MulT(m_xf.q, worldVector); +} + +inline b2Vec2 b2Body::GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const +{ + return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c); +} + +inline b2Vec2 b2Body::GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const +{ + return GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint)); +} + +inline float32 b2Body::GetLinearDamping() const +{ + return m_linearDamping; +} + +inline void b2Body::SetLinearDamping(float32 linearDamping) +{ + m_linearDamping = linearDamping; +} + +inline float32 b2Body::GetAngularDamping() const +{ + return m_angularDamping; +} + +inline void b2Body::SetAngularDamping(float32 angularDamping) +{ + m_angularDamping = angularDamping; +} + +inline float32 b2Body::GetGravityScale() const +{ + return m_gravityScale; +} + +inline void b2Body::SetGravityScale(float32 scale) +{ + m_gravityScale = scale; +} + +inline void b2Body::SetBullet(bool flag) +{ + if (flag) + { + m_flags |= e_bulletFlag; + } + else + { + m_flags &= ~e_bulletFlag; + } +} + +inline bool b2Body::IsBullet() const +{ + return (m_flags & e_bulletFlag) == e_bulletFlag; +} + +inline void b2Body::SetAwake(bool flag) +{ + if (flag) + { + if ((m_flags & e_awakeFlag) == 0) + { + m_flags |= e_awakeFlag; + m_sleepTime = 0.0f; + } + } + else + { + m_flags &= ~e_awakeFlag; + m_sleepTime = 0.0f; + m_linearVelocity.SetZero(); + m_angularVelocity = 0.0f; + m_force.SetZero(); + m_torque = 0.0f; + } +} + +inline bool b2Body::IsAwake() const +{ + return (m_flags & e_awakeFlag) == e_awakeFlag; +} + +inline bool b2Body::IsActive() const +{ + return (m_flags & e_activeFlag) == e_activeFlag; +} + +inline void b2Body::SetFixedRotation(bool flag) +{ + if (flag) + { + m_flags |= e_fixedRotationFlag; + } + else + { + m_flags &= ~e_fixedRotationFlag; + } + + ResetMassData(); +} + +inline bool b2Body::IsFixedRotation() const +{ + return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; +} + +inline void b2Body::SetSleepingAllowed(bool flag) +{ + if (flag) + { + m_flags |= e_autoSleepFlag; + } + else + { + m_flags &= ~e_autoSleepFlag; + SetAwake(true); + } +} + +inline bool b2Body::IsSleepingAllowed() const +{ + return (m_flags & e_autoSleepFlag) == e_autoSleepFlag; +} + +inline b2Fixture* b2Body::GetFixtureList() +{ + return m_fixtureList; +} + +inline const b2Fixture* b2Body::GetFixtureList() const +{ + return m_fixtureList; +} + +inline b2JointEdge* b2Body::GetJointList() +{ + return m_jointList; +} + +inline const b2JointEdge* b2Body::GetJointList() const +{ + return m_jointList; +} + +inline b2ContactEdge* b2Body::GetContactList() +{ + return m_contactList; +} + +inline const b2ContactEdge* b2Body::GetContactList() const +{ + return m_contactList; +} + +inline b2Body* b2Body::GetNext() +{ + return m_next; +} + +inline const b2Body* b2Body::GetNext() const +{ + return m_next; +} + +inline void b2Body::SetUserData(void* data) +{ + m_userData = data; +} + +inline void* b2Body::GetUserData() const +{ + return m_userData; +} + +inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_force += force; + m_torque += b2Cross(point - m_sweep.c, force); +} + +inline void b2Body::ApplyForceToCenter(const b2Vec2& force) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_force += force; +} + +inline void b2Body::ApplyTorque(float32 torque) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_torque += torque; +} + +inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + m_linearVelocity += m_invMass * impulse; + m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); +} + +inline void b2Body::ApplyAngularImpulse(float32 impulse) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + m_angularVelocity += m_invI * impulse; +} + +inline void b2Body::SynchronizeTransform() +{ + m_xf.q.Set(m_sweep.a); + m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); +} + +inline void b2Body::Advance(float32 alpha) +{ + // Advance to the new safe time. This doesn't sync the broad-phase. + m_sweep.Advance(alpha); + m_sweep.c = m_sweep.c0; + m_sweep.a = m_sweep.a0; + m_xf.q.Set(m_sweep.a); + m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); +} + +inline b2World* b2Body::GetWorld() +{ + return m_world; +} + +inline const b2World* b2Body::GetWorld() const +{ + return m_world; +} + +#endif diff --git a/src/libraries/Box2D/Dynamics/b2ContactManager.cpp b/src/libraries/Box2D/Dynamics/b2ContactManager.cpp index 5ac12b350..47331bd9e 100755 --- a/src/libraries/Box2D/Dynamics/b2ContactManager.cpp +++ b/src/libraries/Box2D/Dynamics/b2ContactManager.cpp @@ -1,293 +1,293 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -b2ContactFilter b2_defaultFilter; -b2ContactListener b2_defaultListener; - -b2ContactManager::b2ContactManager() -{ - m_contactList = NULL; - m_contactCount = 0; - m_contactFilter = &b2_defaultFilter; - m_contactListener = &b2_defaultListener; - m_allocator = NULL; -} - -void b2ContactManager::Destroy(b2Contact* c) -{ - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - if (m_contactListener && c->IsTouching()) - { - m_contactListener->EndContact(c); - } - - // Remove from the world. - if (c->m_prev) - { - c->m_prev->m_next = c->m_next; - } - - if (c->m_next) - { - c->m_next->m_prev = c->m_prev; - } - - if (c == m_contactList) - { - m_contactList = c->m_next; - } - - // Remove from body 1 - if (c->m_nodeA.prev) - { - c->m_nodeA.prev->next = c->m_nodeA.next; - } - - if (c->m_nodeA.next) - { - c->m_nodeA.next->prev = c->m_nodeA.prev; - } - - if (&c->m_nodeA == bodyA->m_contactList) - { - bodyA->m_contactList = c->m_nodeA.next; - } - - // Remove from body 2 - if (c->m_nodeB.prev) - { - c->m_nodeB.prev->next = c->m_nodeB.next; - } - - if (c->m_nodeB.next) - { - c->m_nodeB.next->prev = c->m_nodeB.prev; - } - - if (&c->m_nodeB == bodyB->m_contactList) - { - bodyB->m_contactList = c->m_nodeB.next; - } - - // Call the factory. - b2Contact::Destroy(c, m_allocator); - --m_contactCount; -} - -// This is the top level collision call for the time step. Here -// all the narrow phase collision is processed for the world -// contact list. -void b2ContactManager::Collide() -{ - // Update awake contacts. - b2Contact* c = m_contactList; - while (c) - { - b2Fixture* fixtureA = c->GetFixtureA(); - b2Fixture* fixtureB = c->GetFixtureB(); - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - // Is this contact flagged for filtering? - if (c->m_flags & b2Contact::e_filterFlag) - { - // Should these bodies collide? - if (bodyB->ShouldCollide(bodyA) == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // Check user filtering. - if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // Clear the filtering flag. - c->m_flags &= ~b2Contact::e_filterFlag; - } - - bool activeA = bodyA->IsAwake() && bodyA->m_type != b2_staticBody; - bool activeB = bodyB->IsAwake() && bodyB->m_type != b2_staticBody; - - // At least one body must be awake and it must be dynamic or kinematic. - if (activeA == false && activeB == false) - { - c = c->GetNext(); - continue; - } - - int32 proxyIdA = fixtureA->m_proxies[indexA].proxyId; - int32 proxyIdB = fixtureB->m_proxies[indexB].proxyId; - bool overlap = m_broadPhase.TestOverlap(proxyIdA, proxyIdB); - - // Here we destroy contacts that cease to overlap in the broad-phase. - if (overlap == false) - { - b2Contact* cNuke = c; - c = cNuke->GetNext(); - Destroy(cNuke); - continue; - } - - // The contact persists. - c->Update(m_contactListener); - c = c->GetNext(); - } -} - -void b2ContactManager::FindNewContacts() -{ - m_broadPhase.UpdatePairs(this); -} - -void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB) -{ - b2FixtureProxy* proxyA = (b2FixtureProxy*)proxyUserDataA; - b2FixtureProxy* proxyB = (b2FixtureProxy*)proxyUserDataB; - - b2Fixture* fixtureA = proxyA->fixture; - b2Fixture* fixtureB = proxyB->fixture; - - int32 indexA = proxyA->childIndex; - int32 indexB = proxyB->childIndex; - - b2Body* bodyA = fixtureA->GetBody(); - b2Body* bodyB = fixtureB->GetBody(); - - // Are the fixtures on the same body? - if (bodyA == bodyB) - { - return; - } - - // TODO_ERIN use a hash table to remove a potential bottleneck when both - // bodies have a lot of contacts. - // Does a contact already exist? - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - b2Fixture* fA = edge->contact->GetFixtureA(); - b2Fixture* fB = edge->contact->GetFixtureB(); - int32 iA = edge->contact->GetChildIndexA(); - int32 iB = edge->contact->GetChildIndexB(); - - if (fA == fixtureA && fB == fixtureB && iA == indexA && iB == indexB) - { - // A contact already exists. - return; - } - - if (fA == fixtureB && fB == fixtureA && iA == indexB && iB == indexA) - { - // A contact already exists. - return; - } - } - - edge = edge->next; - } - - // Does a joint override collision? Is at least one body dynamic? - if (bodyB->ShouldCollide(bodyA) == false) - { - return; - } - - // Check user filtering. - if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) - { - return; - } - - // Call the factory. - b2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator); - if (c == NULL) - { - return; - } - - // Contact creation may swap fixtures. - fixtureA = c->GetFixtureA(); - fixtureB = c->GetFixtureB(); - indexA = c->GetChildIndexA(); - indexB = c->GetChildIndexB(); - bodyA = fixtureA->GetBody(); - bodyB = fixtureB->GetBody(); - - // Insert into the world. - c->m_prev = NULL; - c->m_next = m_contactList; - if (m_contactList != NULL) - { - m_contactList->m_prev = c; - } - m_contactList = c; - - // Connect to island graph. - - // Connect to body A - c->m_nodeA.contact = c; - c->m_nodeA.other = bodyB; - - c->m_nodeA.prev = NULL; - c->m_nodeA.next = bodyA->m_contactList; - if (bodyA->m_contactList != NULL) - { - bodyA->m_contactList->prev = &c->m_nodeA; - } - bodyA->m_contactList = &c->m_nodeA; - - // Connect to body B - c->m_nodeB.contact = c; - c->m_nodeB.other = bodyA; - - c->m_nodeB.prev = NULL; - c->m_nodeB.next = bodyB->m_contactList; - if (bodyB->m_contactList != NULL) - { - bodyB->m_contactList->prev = &c->m_nodeB; - } - bodyB->m_contactList = &c->m_nodeB; - - // Wake up the bodies - bodyA->SetAwake(true); - bodyB->SetAwake(true); - - ++m_contactCount; -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include + +b2ContactFilter b2_defaultFilter; +b2ContactListener b2_defaultListener; + +b2ContactManager::b2ContactManager() +{ + m_contactList = NULL; + m_contactCount = 0; + m_contactFilter = &b2_defaultFilter; + m_contactListener = &b2_defaultListener; + m_allocator = NULL; +} + +void b2ContactManager::Destroy(b2Contact* c) +{ + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + if (m_contactListener && c->IsTouching()) + { + m_contactListener->EndContact(c); + } + + // Remove from the world. + if (c->m_prev) + { + c->m_prev->m_next = c->m_next; + } + + if (c->m_next) + { + c->m_next->m_prev = c->m_prev; + } + + if (c == m_contactList) + { + m_contactList = c->m_next; + } + + // Remove from body 1 + if (c->m_nodeA.prev) + { + c->m_nodeA.prev->next = c->m_nodeA.next; + } + + if (c->m_nodeA.next) + { + c->m_nodeA.next->prev = c->m_nodeA.prev; + } + + if (&c->m_nodeA == bodyA->m_contactList) + { + bodyA->m_contactList = c->m_nodeA.next; + } + + // Remove from body 2 + if (c->m_nodeB.prev) + { + c->m_nodeB.prev->next = c->m_nodeB.next; + } + + if (c->m_nodeB.next) + { + c->m_nodeB.next->prev = c->m_nodeB.prev; + } + + if (&c->m_nodeB == bodyB->m_contactList) + { + bodyB->m_contactList = c->m_nodeB.next; + } + + // Call the factory. + b2Contact::Destroy(c, m_allocator); + --m_contactCount; +} + +// This is the top level collision call for the time step. Here +// all the narrow phase collision is processed for the world +// contact list. +void b2ContactManager::Collide() +{ + // Update awake contacts. + b2Contact* c = m_contactList; + while (c) + { + b2Fixture* fixtureA = c->GetFixtureA(); + b2Fixture* fixtureB = c->GetFixtureB(); + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + // Is this contact flagged for filtering? + if (c->m_flags & b2Contact::e_filterFlag) + { + // Should these bodies collide? + if (bodyB->ShouldCollide(bodyA) == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // Check user filtering. + if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // Clear the filtering flag. + c->m_flags &= ~b2Contact::e_filterFlag; + } + + bool activeA = bodyA->IsAwake() && bodyA->m_type != b2_staticBody; + bool activeB = bodyB->IsAwake() && bodyB->m_type != b2_staticBody; + + // At least one body must be awake and it must be dynamic or kinematic. + if (activeA == false && activeB == false) + { + c = c->GetNext(); + continue; + } + + int32 proxyIdA = fixtureA->m_proxies[indexA].proxyId; + int32 proxyIdB = fixtureB->m_proxies[indexB].proxyId; + bool overlap = m_broadPhase.TestOverlap(proxyIdA, proxyIdB); + + // Here we destroy contacts that cease to overlap in the broad-phase. + if (overlap == false) + { + b2Contact* cNuke = c; + c = cNuke->GetNext(); + Destroy(cNuke); + continue; + } + + // The contact persists. + c->Update(m_contactListener); + c = c->GetNext(); + } +} + +void b2ContactManager::FindNewContacts() +{ + m_broadPhase.UpdatePairs(this); +} + +void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB) +{ + b2FixtureProxy* proxyA = (b2FixtureProxy*)proxyUserDataA; + b2FixtureProxy* proxyB = (b2FixtureProxy*)proxyUserDataB; + + b2Fixture* fixtureA = proxyA->fixture; + b2Fixture* fixtureB = proxyB->fixture; + + int32 indexA = proxyA->childIndex; + int32 indexB = proxyB->childIndex; + + b2Body* bodyA = fixtureA->GetBody(); + b2Body* bodyB = fixtureB->GetBody(); + + // Are the fixtures on the same body? + if (bodyA == bodyB) + { + return; + } + + // TODO_ERIN use a hash table to remove a potential bottleneck when both + // bodies have a lot of contacts. + // Does a contact already exist? + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + b2Fixture* fA = edge->contact->GetFixtureA(); + b2Fixture* fB = edge->contact->GetFixtureB(); + int32 iA = edge->contact->GetChildIndexA(); + int32 iB = edge->contact->GetChildIndexB(); + + if (fA == fixtureA && fB == fixtureB && iA == indexA && iB == indexB) + { + // A contact already exists. + return; + } + + if (fA == fixtureB && fB == fixtureA && iA == indexB && iB == indexA) + { + // A contact already exists. + return; + } + } + + edge = edge->next; + } + + // Does a joint override collision? Is at least one body dynamic? + if (bodyB->ShouldCollide(bodyA) == false) + { + return; + } + + // Check user filtering. + if (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false) + { + return; + } + + // Call the factory. + b2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator); + if (c == NULL) + { + return; + } + + // Contact creation may swap fixtures. + fixtureA = c->GetFixtureA(); + fixtureB = c->GetFixtureB(); + indexA = c->GetChildIndexA(); + indexB = c->GetChildIndexB(); + bodyA = fixtureA->GetBody(); + bodyB = fixtureB->GetBody(); + + // Insert into the world. + c->m_prev = NULL; + c->m_next = m_contactList; + if (m_contactList != NULL) + { + m_contactList->m_prev = c; + } + m_contactList = c; + + // Connect to island graph. + + // Connect to body A + c->m_nodeA.contact = c; + c->m_nodeA.other = bodyB; + + c->m_nodeA.prev = NULL; + c->m_nodeA.next = bodyA->m_contactList; + if (bodyA->m_contactList != NULL) + { + bodyA->m_contactList->prev = &c->m_nodeA; + } + bodyA->m_contactList = &c->m_nodeA; + + // Connect to body B + c->m_nodeB.contact = c; + c->m_nodeB.other = bodyA; + + c->m_nodeB.prev = NULL; + c->m_nodeB.next = bodyB->m_contactList; + if (bodyB->m_contactList != NULL) + { + bodyB->m_contactList->prev = &c->m_nodeB; + } + bodyB->m_contactList = &c->m_nodeB; + + // Wake up the bodies + bodyA->SetAwake(true); + bodyB->SetAwake(true); + + ++m_contactCount; +} diff --git a/src/libraries/Box2D/Dynamics/b2ContactManager.h b/src/libraries/Box2D/Dynamics/b2ContactManager.h index dc1f77fe5..6a1d072af 100755 --- a/src/libraries/Box2D/Dynamics/b2ContactManager.h +++ b/src/libraries/Box2D/Dynamics/b2ContactManager.h @@ -1,52 +1,52 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_CONTACT_MANAGER_H -#define B2_CONTACT_MANAGER_H - -#include - -class b2Contact; -class b2ContactFilter; -class b2ContactListener; -class b2BlockAllocator; - -// Delegate of b2World. -class b2ContactManager -{ -public: - b2ContactManager(); - - // Broad-phase callback. - void AddPair(void* proxyUserDataA, void* proxyUserDataB); - - void FindNewContacts(); - - void Destroy(b2Contact* c); - - void Collide(); - - b2BroadPhase m_broadPhase; - b2Contact* m_contactList; - int32 m_contactCount; - b2ContactFilter* m_contactFilter; - b2ContactListener* m_contactListener; - b2BlockAllocator* m_allocator; -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_MANAGER_H +#define B2_CONTACT_MANAGER_H + +#include + +class b2Contact; +class b2ContactFilter; +class b2ContactListener; +class b2BlockAllocator; + +// Delegate of b2World. +class b2ContactManager +{ +public: + b2ContactManager(); + + // Broad-phase callback. + void AddPair(void* proxyUserDataA, void* proxyUserDataB); + + void FindNewContacts(); + + void Destroy(b2Contact* c); + + void Collide(); + + b2BroadPhase m_broadPhase; + b2Contact* m_contactList; + int32 m_contactCount; + b2ContactFilter* m_contactFilter; + b2ContactListener* m_contactListener; + b2BlockAllocator* m_allocator; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/b2Fixture.cpp b/src/libraries/Box2D/Dynamics/b2Fixture.cpp index 77537b276..1d09c6d57 100755 --- a/src/libraries/Box2D/Dynamics/b2Fixture.cpp +++ b/src/libraries/Box2D/Dynamics/b2Fixture.cpp @@ -1,303 +1,303 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -b2Fixture::b2Fixture() -{ - m_userData = NULL; - m_body = NULL; - m_next = NULL; - m_proxies = NULL; - m_proxyCount = 0; - m_shape = NULL; - m_density = 0.0f; -} - -void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def) -{ - m_userData = def->userData; - m_friction = def->friction; - m_restitution = def->restitution; - - m_body = body; - m_next = NULL; - - m_filter = def->filter; - - m_isSensor = def->isSensor; - - m_shape = def->shape->Clone(allocator); - - // Reserve proxy space - int32 childCount = m_shape->GetChildCount(); - m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy)); - for (int32 i = 0; i < childCount; ++i) - { - m_proxies[i].fixture = NULL; - m_proxies[i].proxyId = b2BroadPhase::e_nullProxy; - } - m_proxyCount = 0; - - m_density = def->density; -} - -void b2Fixture::Destroy(b2BlockAllocator* allocator) -{ - // The proxies must be destroyed before calling this. - b2Assert(m_proxyCount == 0); - - // Free the proxy array. - int32 childCount = m_shape->GetChildCount(); - allocator->Free(m_proxies, childCount * sizeof(b2FixtureProxy)); - m_proxies = NULL; - - // Free the child shape. - switch (m_shape->m_type) - { - case b2Shape::e_circle: - { - b2CircleShape* s = (b2CircleShape*)m_shape; - s->~b2CircleShape(); - allocator->Free(s, sizeof(b2CircleShape)); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* s = (b2EdgeShape*)m_shape; - s->~b2EdgeShape(); - allocator->Free(s, sizeof(b2EdgeShape)); - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* s = (b2PolygonShape*)m_shape; - s->~b2PolygonShape(); - allocator->Free(s, sizeof(b2PolygonShape)); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* s = (b2ChainShape*)m_shape; - s->~b2ChainShape(); - allocator->Free(s, sizeof(b2ChainShape)); - } - break; - - default: - b2Assert(false); - break; - } - - m_shape = NULL; -} - -void b2Fixture::CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf) -{ - b2Assert(m_proxyCount == 0); - - // Create proxies in the broad-phase. - m_proxyCount = m_shape->GetChildCount(); - - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - m_shape->ComputeAABB(&proxy->aabb, xf, i); - proxy->proxyId = broadPhase->CreateProxy(proxy->aabb, proxy); - proxy->fixture = this; - proxy->childIndex = i; - } -} - -void b2Fixture::DestroyProxies(b2BroadPhase* broadPhase) -{ - // Destroy proxies in the broad-phase. - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - broadPhase->DestroyProxy(proxy->proxyId); - proxy->proxyId = b2BroadPhase::e_nullProxy; - } - - m_proxyCount = 0; -} - -void b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transform1, const b2Transform& transform2) -{ - if (m_proxyCount == 0) - { - return; - } - - for (int32 i = 0; i < m_proxyCount; ++i) - { - b2FixtureProxy* proxy = m_proxies + i; - - // Compute an AABB that covers the swept shape (may miss some rotation effect). - b2AABB aabb1, aabb2; - m_shape->ComputeAABB(&aabb1, transform1, proxy->childIndex); - m_shape->ComputeAABB(&aabb2, transform2, proxy->childIndex); - - proxy->aabb.Combine(aabb1, aabb2); - - b2Vec2 displacement = transform2.p - transform1.p; - - broadPhase->MoveProxy(proxy->proxyId, proxy->aabb, displacement); - } -} - -void b2Fixture::SetFilterData(const b2Filter& filter) -{ - m_filter = filter; - - Refilter(); -} - -void b2Fixture::Refilter() -{ - if (m_body == NULL) - { - return; - } - - // Flag associated contacts for filtering. - b2ContactEdge* edge = m_body->GetContactList(); - while (edge) - { - b2Contact* contact = edge->contact; - b2Fixture* fixtureA = contact->GetFixtureA(); - b2Fixture* fixtureB = contact->GetFixtureB(); - if (fixtureA == this || fixtureB == this) - { - contact->FlagForFiltering(); - } - - edge = edge->next; - } - - b2World* world = m_body->GetWorld(); - - if (world == NULL) - { - return; - } - - // Touch each proxy so that new pairs may be created - b2BroadPhase* broadPhase = &world->m_contactManager.m_broadPhase; - for (int32 i = 0; i < m_proxyCount; ++i) - { - broadPhase->TouchProxy(m_proxies[i].proxyId); - } -} - -void b2Fixture::SetSensor(bool sensor) -{ - if (sensor != m_isSensor) - { - m_body->SetAwake(true); - m_isSensor = sensor; - } -} - -void b2Fixture::Dump(int32 bodyIndex) -{ - b2Log(" b2FixtureDef fd;\n"); - b2Log(" fd.friction = %.15lef;\n", m_friction); - b2Log(" fd.restitution = %.15lef;\n", m_restitution); - b2Log(" fd.density = %.15lef;\n", m_density); - b2Log(" fd.isSensor = bool(%d);\n", m_isSensor); - b2Log(" fd.filter.categoryBits = uint16(%d);\n", m_filter.categoryBits); - b2Log(" fd.filter.maskBits = uint16(%d);\n", m_filter.maskBits); - b2Log(" fd.filter.groupIndex = int16(%d);\n", m_filter.groupIndex); - - switch (m_shape->m_type) - { - case b2Shape::e_circle: - { - b2CircleShape* s = (b2CircleShape*)m_shape; - b2Log(" b2CircleShape shape;\n"); - b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); - b2Log(" shape.m_p.Set(%.15lef, %.15lef);\n", s->m_p.x, s->m_p.y); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* s = (b2EdgeShape*)m_shape; - b2Log(" b2EdgeShape shape;\n"); - b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); - b2Log(" shape.m_vertex0.Set(%.15lef, %.15lef);\n", s->m_vertex0.x, s->m_vertex0.y); - b2Log(" shape.m_vertex1.Set(%.15lef, %.15lef);\n", s->m_vertex1.x, s->m_vertex1.y); - b2Log(" shape.m_vertex2.Set(%.15lef, %.15lef);\n", s->m_vertex2.x, s->m_vertex2.y); - b2Log(" shape.m_vertex3.Set(%.15lef, %.15lef);\n", s->m_vertex3.x, s->m_vertex3.y); - b2Log(" shape.m_hasVertex0 = bool(%d);\n", s->m_hasVertex0); - b2Log(" shape.m_hasVertex3 = bool(%d);\n", s->m_hasVertex3); - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* s = (b2PolygonShape*)m_shape; - b2Log(" b2PolygonShape shape;\n"); - b2Log(" b2Vec2 vs[%d];\n", b2_maxPolygonVertices); - for (int32 i = 0; i < s->m_vertexCount; ++i) - { - b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); - } - b2Log(" shape.Set(vs, %d);\n", s->m_vertexCount); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* s = (b2ChainShape*)m_shape; - b2Log(" b2ChainShape shape;\n"); - b2Log(" b2Vec2 vs[%d];\n", s->m_count); - for (int32 i = 0; i < s->m_count; ++i) - { - b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); - } - b2Log(" shape.CreateChain(vs, %d);\n", s->m_count); - b2Log(" shape.m_prevVertex.Set(%.15lef, %.15lef);\n", s->m_prevVertex.x, s->m_prevVertex.y); - b2Log(" shape.m_nextVertex.Set(%.15lef, %.15lef);\n", s->m_nextVertex.x, s->m_nextVertex.y); - b2Log(" shape.m_hasPrevVertex = bool(%d);\n", s->m_hasPrevVertex); - b2Log(" shape.m_hasNextVertex = bool(%d);\n", s->m_hasNextVertex); - } - break; - - default: - return; - } - - b2Log("\n"); - b2Log(" fd.shape = &shape;\n"); - b2Log("\n"); - b2Log(" bodies[%d]->CreateFixture(&fd);\n", bodyIndex); -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +b2Fixture::b2Fixture() +{ + m_userData = NULL; + m_body = NULL; + m_next = NULL; + m_proxies = NULL; + m_proxyCount = 0; + m_shape = NULL; + m_density = 0.0f; +} + +void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def) +{ + m_userData = def->userData; + m_friction = def->friction; + m_restitution = def->restitution; + + m_body = body; + m_next = NULL; + + m_filter = def->filter; + + m_isSensor = def->isSensor; + + m_shape = def->shape->Clone(allocator); + + // Reserve proxy space + int32 childCount = m_shape->GetChildCount(); + m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy)); + for (int32 i = 0; i < childCount; ++i) + { + m_proxies[i].fixture = NULL; + m_proxies[i].proxyId = b2BroadPhase::e_nullProxy; + } + m_proxyCount = 0; + + m_density = def->density; +} + +void b2Fixture::Destroy(b2BlockAllocator* allocator) +{ + // The proxies must be destroyed before calling this. + b2Assert(m_proxyCount == 0); + + // Free the proxy array. + int32 childCount = m_shape->GetChildCount(); + allocator->Free(m_proxies, childCount * sizeof(b2FixtureProxy)); + m_proxies = NULL; + + // Free the child shape. + switch (m_shape->m_type) + { + case b2Shape::e_circle: + { + b2CircleShape* s = (b2CircleShape*)m_shape; + s->~b2CircleShape(); + allocator->Free(s, sizeof(b2CircleShape)); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* s = (b2EdgeShape*)m_shape; + s->~b2EdgeShape(); + allocator->Free(s, sizeof(b2EdgeShape)); + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* s = (b2PolygonShape*)m_shape; + s->~b2PolygonShape(); + allocator->Free(s, sizeof(b2PolygonShape)); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* s = (b2ChainShape*)m_shape; + s->~b2ChainShape(); + allocator->Free(s, sizeof(b2ChainShape)); + } + break; + + default: + b2Assert(false); + break; + } + + m_shape = NULL; +} + +void b2Fixture::CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf) +{ + b2Assert(m_proxyCount == 0); + + // Create proxies in the broad-phase. + m_proxyCount = m_shape->GetChildCount(); + + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + m_shape->ComputeAABB(&proxy->aabb, xf, i); + proxy->proxyId = broadPhase->CreateProxy(proxy->aabb, proxy); + proxy->fixture = this; + proxy->childIndex = i; + } +} + +void b2Fixture::DestroyProxies(b2BroadPhase* broadPhase) +{ + // Destroy proxies in the broad-phase. + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + broadPhase->DestroyProxy(proxy->proxyId); + proxy->proxyId = b2BroadPhase::e_nullProxy; + } + + m_proxyCount = 0; +} + +void b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transform1, const b2Transform& transform2) +{ + if (m_proxyCount == 0) + { + return; + } + + for (int32 i = 0; i < m_proxyCount; ++i) + { + b2FixtureProxy* proxy = m_proxies + i; + + // Compute an AABB that covers the swept shape (may miss some rotation effect). + b2AABB aabb1, aabb2; + m_shape->ComputeAABB(&aabb1, transform1, proxy->childIndex); + m_shape->ComputeAABB(&aabb2, transform2, proxy->childIndex); + + proxy->aabb.Combine(aabb1, aabb2); + + b2Vec2 displacement = transform2.p - transform1.p; + + broadPhase->MoveProxy(proxy->proxyId, proxy->aabb, displacement); + } +} + +void b2Fixture::SetFilterData(const b2Filter& filter) +{ + m_filter = filter; + + Refilter(); +} + +void b2Fixture::Refilter() +{ + if (m_body == NULL) + { + return; + } + + // Flag associated contacts for filtering. + b2ContactEdge* edge = m_body->GetContactList(); + while (edge) + { + b2Contact* contact = edge->contact; + b2Fixture* fixtureA = contact->GetFixtureA(); + b2Fixture* fixtureB = contact->GetFixtureB(); + if (fixtureA == this || fixtureB == this) + { + contact->FlagForFiltering(); + } + + edge = edge->next; + } + + b2World* world = m_body->GetWorld(); + + if (world == NULL) + { + return; + } + + // Touch each proxy so that new pairs may be created + b2BroadPhase* broadPhase = &world->m_contactManager.m_broadPhase; + for (int32 i = 0; i < m_proxyCount; ++i) + { + broadPhase->TouchProxy(m_proxies[i].proxyId); + } +} + +void b2Fixture::SetSensor(bool sensor) +{ + if (sensor != m_isSensor) + { + m_body->SetAwake(true); + m_isSensor = sensor; + } +} + +void b2Fixture::Dump(int32 bodyIndex) +{ + b2Log(" b2FixtureDef fd;\n"); + b2Log(" fd.friction = %.15lef;\n", m_friction); + b2Log(" fd.restitution = %.15lef;\n", m_restitution); + b2Log(" fd.density = %.15lef;\n", m_density); + b2Log(" fd.isSensor = bool(%d);\n", m_isSensor); + b2Log(" fd.filter.categoryBits = uint16(%d);\n", m_filter.categoryBits); + b2Log(" fd.filter.maskBits = uint16(%d);\n", m_filter.maskBits); + b2Log(" fd.filter.groupIndex = int16(%d);\n", m_filter.groupIndex); + + switch (m_shape->m_type) + { + case b2Shape::e_circle: + { + b2CircleShape* s = (b2CircleShape*)m_shape; + b2Log(" b2CircleShape shape;\n"); + b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); + b2Log(" shape.m_p.Set(%.15lef, %.15lef);\n", s->m_p.x, s->m_p.y); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* s = (b2EdgeShape*)m_shape; + b2Log(" b2EdgeShape shape;\n"); + b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); + b2Log(" shape.m_vertex0.Set(%.15lef, %.15lef);\n", s->m_vertex0.x, s->m_vertex0.y); + b2Log(" shape.m_vertex1.Set(%.15lef, %.15lef);\n", s->m_vertex1.x, s->m_vertex1.y); + b2Log(" shape.m_vertex2.Set(%.15lef, %.15lef);\n", s->m_vertex2.x, s->m_vertex2.y); + b2Log(" shape.m_vertex3.Set(%.15lef, %.15lef);\n", s->m_vertex3.x, s->m_vertex3.y); + b2Log(" shape.m_hasVertex0 = bool(%d);\n", s->m_hasVertex0); + b2Log(" shape.m_hasVertex3 = bool(%d);\n", s->m_hasVertex3); + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* s = (b2PolygonShape*)m_shape; + b2Log(" b2PolygonShape shape;\n"); + b2Log(" b2Vec2 vs[%d];\n", b2_maxPolygonVertices); + for (int32 i = 0; i < s->m_vertexCount; ++i) + { + b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); + } + b2Log(" shape.Set(vs, %d);\n", s->m_vertexCount); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* s = (b2ChainShape*)m_shape; + b2Log(" b2ChainShape shape;\n"); + b2Log(" b2Vec2 vs[%d];\n", s->m_count); + for (int32 i = 0; i < s->m_count; ++i) + { + b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); + } + b2Log(" shape.CreateChain(vs, %d);\n", s->m_count); + b2Log(" shape.m_prevVertex.Set(%.15lef, %.15lef);\n", s->m_prevVertex.x, s->m_prevVertex.y); + b2Log(" shape.m_nextVertex.Set(%.15lef, %.15lef);\n", s->m_nextVertex.x, s->m_nextVertex.y); + b2Log(" shape.m_hasPrevVertex = bool(%d);\n", s->m_hasPrevVertex); + b2Log(" shape.m_hasNextVertex = bool(%d);\n", s->m_hasNextVertex); + } + break; + + default: + return; + } + + b2Log("\n"); + b2Log(" fd.shape = &shape;\n"); + b2Log("\n"); + b2Log(" bodies[%d]->CreateFixture(&fd);\n", bodyIndex); +} diff --git a/src/libraries/Box2D/Dynamics/b2Fixture.h b/src/libraries/Box2D/Dynamics/b2Fixture.h index 5ebd0c3fd..753127fbc 100755 --- a/src/libraries/Box2D/Dynamics/b2Fixture.h +++ b/src/libraries/Box2D/Dynamics/b2Fixture.h @@ -1,345 +1,345 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_FIXTURE_H -#define B2_FIXTURE_H - -#include -#include -#include - -class b2BlockAllocator; -class b2Body; -class b2BroadPhase; -class b2Fixture; - -/// This holds contact filtering data. -struct b2Filter -{ - b2Filter() - { - categoryBits = 0x0001; - maskBits = 0xFFFF; - groupIndex = 0; - } - - /// The collision category bits. Normally you would just set one bit. - uint16 categoryBits; - - /// The collision mask bits. This states the categories that this - /// shape would accept for collision. - uint16 maskBits; - - /// Collision groups allow a certain group of objects to never collide (negative) - /// or always collide (positive). Zero means no collision group. Non-zero group - /// filtering always wins against the mask bits. - int16 groupIndex; -}; - -/// A fixture definition is used to create a fixture. This class defines an -/// abstract fixture definition. You can reuse fixture definitions safely. -struct b2FixtureDef -{ - /// The constructor sets the default fixture definition values. - b2FixtureDef() - { - shape = NULL; - userData = NULL; - friction = 0.2f; - restitution = 0.0f; - density = 0.0f; - isSensor = false; - } - - /// The shape, this must be set. The shape will be cloned, so you - /// can create the shape on the stack. - const b2Shape* shape; - - /// Use this to store application specific fixture data. - void* userData; - - /// The friction coefficient, usually in the range [0,1]. - float32 friction; - - /// The restitution (elasticity) usually in the range [0,1]. - float32 restitution; - - /// The density, usually in kg/m^2. - float32 density; - - /// A sensor shape collects contact information but never generates a collision - /// response. - bool isSensor; - - /// Contact filtering data. - b2Filter filter; -}; - -/// This proxy is used internally to connect fixtures to the broad-phase. -struct b2FixtureProxy -{ - b2AABB aabb; - b2Fixture* fixture; - int32 childIndex; - int32 proxyId; -}; - -/// A fixture is used to attach a shape to a body for collision detection. A fixture -/// inherits its transform from its parent. Fixtures hold additional non-geometric data -/// such as friction, collision filters, etc. -/// Fixtures are created via b2Body::CreateFixture. -/// @warning you cannot reuse fixtures. -class b2Fixture -{ -public: - /// Get the type of the child shape. You can use this to down cast to the concrete shape. - /// @return the shape type. - b2Shape::Type GetType() const; - - /// Get the child shape. You can modify the child shape, however you should not change the - /// number of vertices because this will crash some collision caching mechanisms. - /// Manipulating the shape may lead to non-physical behavior. - b2Shape* GetShape(); - const b2Shape* GetShape() const; - - /// Set if this fixture is a sensor. - void SetSensor(bool sensor); - - /// Is this fixture a sensor (non-solid)? - /// @return the true if the shape is a sensor. - bool IsSensor() const; - - /// Set the contact filtering data. This will not update contacts until the next time - /// step when either parent body is active and awake. - /// This automatically calls Refilter. - void SetFilterData(const b2Filter& filter); - - /// Get the contact filtering data. - const b2Filter& GetFilterData() const; - - /// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide. - void Refilter(); - - /// Get the parent body of this fixture. This is NULL if the fixture is not attached. - /// @return the parent body. - b2Body* GetBody(); - const b2Body* GetBody() const; - - /// Get the next fixture in the parent body's fixture list. - /// @return the next shape. - b2Fixture* GetNext(); - const b2Fixture* GetNext() const; - - /// Get the user data that was assigned in the fixture definition. Use this to - /// store your application specific data. - void* GetUserData() const; - - /// Set the user data. Use this to store your application specific data. - void SetUserData(void* data); - - /// Test a point for containment in this fixture. - /// @param p a point in world coordinates. - bool TestPoint(const b2Vec2& p) const; - - /// Cast a ray against this shape. - /// @param output the ray-cast results. - /// @param input the ray-cast input parameters. - bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const; - - /// Get the mass data for this fixture. The mass data is based on the density and - /// the shape. The rotational inertia is about the shape's origin. This operation - /// may be expensive. - void GetMassData(b2MassData* massData) const; - - /// Set the density of this fixture. This will _not_ automatically adjust the mass - /// of the body. You must call b2Body::ResetMassData to update the body's mass. - void SetDensity(float32 density); - - /// Get the density of this fixture. - float32 GetDensity() const; - - /// Get the coefficient of friction. - float32 GetFriction() const; - - /// Set the coefficient of friction. This will _not_ change the friction of - /// existing contacts. - void SetFriction(float32 friction); - - /// Get the coefficient of restitution. - float32 GetRestitution() const; - - /// Set the coefficient of restitution. This will _not_ change the restitution of - /// existing contacts. - void SetRestitution(float32 restitution); - - /// Get the fixture's AABB. This AABB may be enlarge and/or stale. - /// If you need a more accurate AABB, compute it using the shape and - /// the body transform. - const b2AABB& GetAABB(int32 childIndex) const; - - /// Dump this fixture to the log file. - void Dump(int32 bodyIndex); - -protected: - - friend class b2Body; - friend class b2World; - friend class b2Contact; - friend class b2ContactManager; - - b2Fixture(); - - // We need separation create/destroy functions from the constructor/destructor because - // the destructor cannot access the allocator (no destructor arguments allowed by C++). - void Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def); - void Destroy(b2BlockAllocator* allocator); - - // These support body activation/deactivation. - void CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf); - void DestroyProxies(b2BroadPhase* broadPhase); - - void Synchronize(b2BroadPhase* broadPhase, const b2Transform& xf1, const b2Transform& xf2); - - float32 m_density; - - b2Fixture* m_next; - b2Body* m_body; - - b2Shape* m_shape; - - float32 m_friction; - float32 m_restitution; - - b2FixtureProxy* m_proxies; - int32 m_proxyCount; - - b2Filter m_filter; - - bool m_isSensor; - - void* m_userData; -}; - -inline b2Shape::Type b2Fixture::GetType() const -{ - return m_shape->GetType(); -} - -inline b2Shape* b2Fixture::GetShape() -{ - return m_shape; -} - -inline const b2Shape* b2Fixture::GetShape() const -{ - return m_shape; -} - -inline bool b2Fixture::IsSensor() const -{ - return m_isSensor; -} - -inline const b2Filter& b2Fixture::GetFilterData() const -{ - return m_filter; -} - -inline void* b2Fixture::GetUserData() const -{ - return m_userData; -} - -inline void b2Fixture::SetUserData(void* data) -{ - m_userData = data; -} - -inline b2Body* b2Fixture::GetBody() -{ - return m_body; -} - -inline const b2Body* b2Fixture::GetBody() const -{ - return m_body; -} - -inline b2Fixture* b2Fixture::GetNext() -{ - return m_next; -} - -inline const b2Fixture* b2Fixture::GetNext() const -{ - return m_next; -} - -inline void b2Fixture::SetDensity(float32 density) -{ - b2Assert(b2IsValid(density) && density >= 0.0f); - m_density = density; -} - -inline float32 b2Fixture::GetDensity() const -{ - return m_density; -} - -inline float32 b2Fixture::GetFriction() const -{ - return m_friction; -} - -inline void b2Fixture::SetFriction(float32 friction) -{ - m_friction = friction; -} - -inline float32 b2Fixture::GetRestitution() const -{ - return m_restitution; -} - -inline void b2Fixture::SetRestitution(float32 restitution) -{ - m_restitution = restitution; -} - -inline bool b2Fixture::TestPoint(const b2Vec2& p) const -{ - return m_shape->TestPoint(m_body->GetTransform(), p); -} - -inline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const -{ - return m_shape->RayCast(output, input, m_body->GetTransform(), childIndex); -} - -inline void b2Fixture::GetMassData(b2MassData* massData) const -{ - m_shape->ComputeMass(massData, m_density); -} - -inline const b2AABB& b2Fixture::GetAABB(int32 childIndex) const -{ - b2Assert(0 <= childIndex && childIndex < m_proxyCount); - return m_proxies[childIndex].aabb; -} - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_FIXTURE_H +#define B2_FIXTURE_H + +#include +#include +#include + +class b2BlockAllocator; +class b2Body; +class b2BroadPhase; +class b2Fixture; + +/// This holds contact filtering data. +struct b2Filter +{ + b2Filter() + { + categoryBits = 0x0001; + maskBits = 0xFFFF; + groupIndex = 0; + } + + /// The collision category bits. Normally you would just set one bit. + uint16 categoryBits; + + /// The collision mask bits. This states the categories that this + /// shape would accept for collision. + uint16 maskBits; + + /// Collision groups allow a certain group of objects to never collide (negative) + /// or always collide (positive). Zero means no collision group. Non-zero group + /// filtering always wins against the mask bits. + int16 groupIndex; +}; + +/// A fixture definition is used to create a fixture. This class defines an +/// abstract fixture definition. You can reuse fixture definitions safely. +struct b2FixtureDef +{ + /// The constructor sets the default fixture definition values. + b2FixtureDef() + { + shape = NULL; + userData = NULL; + friction = 0.2f; + restitution = 0.0f; + density = 0.0f; + isSensor = false; + } + + /// The shape, this must be set. The shape will be cloned, so you + /// can create the shape on the stack. + const b2Shape* shape; + + /// Use this to store application specific fixture data. + void* userData; + + /// The friction coefficient, usually in the range [0,1]. + float32 friction; + + /// The restitution (elasticity) usually in the range [0,1]. + float32 restitution; + + /// The density, usually in kg/m^2. + float32 density; + + /// A sensor shape collects contact information but never generates a collision + /// response. + bool isSensor; + + /// Contact filtering data. + b2Filter filter; +}; + +/// This proxy is used internally to connect fixtures to the broad-phase. +struct b2FixtureProxy +{ + b2AABB aabb; + b2Fixture* fixture; + int32 childIndex; + int32 proxyId; +}; + +/// A fixture is used to attach a shape to a body for collision detection. A fixture +/// inherits its transform from its parent. Fixtures hold additional non-geometric data +/// such as friction, collision filters, etc. +/// Fixtures are created via b2Body::CreateFixture. +/// @warning you cannot reuse fixtures. +class b2Fixture +{ +public: + /// Get the type of the child shape. You can use this to down cast to the concrete shape. + /// @return the shape type. + b2Shape::Type GetType() const; + + /// Get the child shape. You can modify the child shape, however you should not change the + /// number of vertices because this will crash some collision caching mechanisms. + /// Manipulating the shape may lead to non-physical behavior. + b2Shape* GetShape(); + const b2Shape* GetShape() const; + + /// Set if this fixture is a sensor. + void SetSensor(bool sensor); + + /// Is this fixture a sensor (non-solid)? + /// @return the true if the shape is a sensor. + bool IsSensor() const; + + /// Set the contact filtering data. This will not update contacts until the next time + /// step when either parent body is active and awake. + /// This automatically calls Refilter. + void SetFilterData(const b2Filter& filter); + + /// Get the contact filtering data. + const b2Filter& GetFilterData() const; + + /// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide. + void Refilter(); + + /// Get the parent body of this fixture. This is NULL if the fixture is not attached. + /// @return the parent body. + b2Body* GetBody(); + const b2Body* GetBody() const; + + /// Get the next fixture in the parent body's fixture list. + /// @return the next shape. + b2Fixture* GetNext(); + const b2Fixture* GetNext() const; + + /// Get the user data that was assigned in the fixture definition. Use this to + /// store your application specific data. + void* GetUserData() const; + + /// Set the user data. Use this to store your application specific data. + void SetUserData(void* data); + + /// Test a point for containment in this fixture. + /// @param p a point in world coordinates. + bool TestPoint(const b2Vec2& p) const; + + /// Cast a ray against this shape. + /// @param output the ray-cast results. + /// @param input the ray-cast input parameters. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const; + + /// Get the mass data for this fixture. The mass data is based on the density and + /// the shape. The rotational inertia is about the shape's origin. This operation + /// may be expensive. + void GetMassData(b2MassData* massData) const; + + /// Set the density of this fixture. This will _not_ automatically adjust the mass + /// of the body. You must call b2Body::ResetMassData to update the body's mass. + void SetDensity(float32 density); + + /// Get the density of this fixture. + float32 GetDensity() const; + + /// Get the coefficient of friction. + float32 GetFriction() const; + + /// Set the coefficient of friction. This will _not_ change the friction of + /// existing contacts. + void SetFriction(float32 friction); + + /// Get the coefficient of restitution. + float32 GetRestitution() const; + + /// Set the coefficient of restitution. This will _not_ change the restitution of + /// existing contacts. + void SetRestitution(float32 restitution); + + /// Get the fixture's AABB. This AABB may be enlarge and/or stale. + /// If you need a more accurate AABB, compute it using the shape and + /// the body transform. + const b2AABB& GetAABB(int32 childIndex) const; + + /// Dump this fixture to the log file. + void Dump(int32 bodyIndex); + +protected: + + friend class b2Body; + friend class b2World; + friend class b2Contact; + friend class b2ContactManager; + + b2Fixture(); + + // We need separation create/destroy functions from the constructor/destructor because + // the destructor cannot access the allocator (no destructor arguments allowed by C++). + void Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def); + void Destroy(b2BlockAllocator* allocator); + + // These support body activation/deactivation. + void CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf); + void DestroyProxies(b2BroadPhase* broadPhase); + + void Synchronize(b2BroadPhase* broadPhase, const b2Transform& xf1, const b2Transform& xf2); + + float32 m_density; + + b2Fixture* m_next; + b2Body* m_body; + + b2Shape* m_shape; + + float32 m_friction; + float32 m_restitution; + + b2FixtureProxy* m_proxies; + int32 m_proxyCount; + + b2Filter m_filter; + + bool m_isSensor; + + void* m_userData; +}; + +inline b2Shape::Type b2Fixture::GetType() const +{ + return m_shape->GetType(); +} + +inline b2Shape* b2Fixture::GetShape() +{ + return m_shape; +} + +inline const b2Shape* b2Fixture::GetShape() const +{ + return m_shape; +} + +inline bool b2Fixture::IsSensor() const +{ + return m_isSensor; +} + +inline const b2Filter& b2Fixture::GetFilterData() const +{ + return m_filter; +} + +inline void* b2Fixture::GetUserData() const +{ + return m_userData; +} + +inline void b2Fixture::SetUserData(void* data) +{ + m_userData = data; +} + +inline b2Body* b2Fixture::GetBody() +{ + return m_body; +} + +inline const b2Body* b2Fixture::GetBody() const +{ + return m_body; +} + +inline b2Fixture* b2Fixture::GetNext() +{ + return m_next; +} + +inline const b2Fixture* b2Fixture::GetNext() const +{ + return m_next; +} + +inline void b2Fixture::SetDensity(float32 density) +{ + b2Assert(b2IsValid(density) && density >= 0.0f); + m_density = density; +} + +inline float32 b2Fixture::GetDensity() const +{ + return m_density; +} + +inline float32 b2Fixture::GetFriction() const +{ + return m_friction; +} + +inline void b2Fixture::SetFriction(float32 friction) +{ + m_friction = friction; +} + +inline float32 b2Fixture::GetRestitution() const +{ + return m_restitution; +} + +inline void b2Fixture::SetRestitution(float32 restitution) +{ + m_restitution = restitution; +} + +inline bool b2Fixture::TestPoint(const b2Vec2& p) const +{ + return m_shape->TestPoint(m_body->GetTransform(), p); +} + +inline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const +{ + return m_shape->RayCast(output, input, m_body->GetTransform(), childIndex); +} + +inline void b2Fixture::GetMassData(b2MassData* massData) const +{ + m_shape->ComputeMass(massData, m_density); +} + +inline const b2AABB& b2Fixture::GetAABB(int32 childIndex) const +{ + b2Assert(0 <= childIndex && childIndex < m_proxyCount); + return m_proxies[childIndex].aabb; +} + +#endif diff --git a/src/libraries/Box2D/Dynamics/b2Island.cpp b/src/libraries/Box2D/Dynamics/b2Island.cpp index 0e2129cf8..0ecb273a5 100755 --- a/src/libraries/Box2D/Dynamics/b2Island.cpp +++ b/src/libraries/Box2D/Dynamics/b2Island.cpp @@ -1,539 +1,539 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* -Position Correction Notes -========================= -I tried the several algorithms for position correction of the 2D revolute joint. -I looked at these systems: -- simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s. -- suspension bridge with 30 1m long planks of length 1m. -- multi-link chain with 30 1m long links. - -Here are the algorithms: - -Baumgarte - A fraction of the position error is added to the velocity error. There is no -separate position solver. - -Pseudo Velocities - After the velocity solver and position integration, -the position error, Jacobian, and effective mass are recomputed. Then -the velocity constraints are solved with pseudo velocities and a fraction -of the position error is added to the pseudo velocity error. The pseudo -velocities are initialized to zero and there is no warm-starting. After -the position solver, the pseudo velocities are added to the positions. -This is also called the First Order World method or the Position LCP method. - -Modified Nonlinear Gauss-Seidel (NGS) - Like Pseudo Velocities except the -position error is re-computed for each constraint and the positions are updated -after the constraint is solved. The radius vectors (aka Jacobians) are -re-computed too (otherwise the algorithm has horrible instability). The pseudo -velocity states are not needed because they are effectively zero at the beginning -of each iteration. Since we have the current position error, we allow the -iterations to terminate early if the error becomes smaller than b2_linearSlop. - -Full NGS or just NGS - Like Modified NGS except the effective mass are re-computed -each time a constraint is solved. - -Here are the results: -Baumgarte - this is the cheapest algorithm but it has some stability problems, -especially with the bridge. The chain links separate easily close to the root -and they jitter as they struggle to pull together. This is one of the most common -methods in the field. The big drawback is that the position correction artificially -affects the momentum, thus leading to instabilities and false bounce. I used a -bias factor of 0.2. A larger bias factor makes the bridge less stable, a smaller -factor makes joints and contacts more spongy. - -Pseudo Velocities - the is more stable than the Baumgarte method. The bridge is -stable. However, joints still separate with large angular velocities. Drag the -simple pendulum in a circle quickly and the joint will separate. The chain separates -easily and does not recover. I used a bias factor of 0.2. A larger value lead to -the bridge collapsing when a heavy cube drops on it. - -Modified NGS - this algorithm is better in some ways than Baumgarte and Pseudo -Velocities, but in other ways it is worse. The bridge and chain are much more -stable, but the simple pendulum goes unstable at high angular velocities. - -Full NGS - stable in all tests. The joints display good stiffness. The bridge -still sags, but this is better than infinite forces. - -Recommendations -Pseudo Velocities are not really worthwhile because the bridge and chain cannot -recover from joint separation. In other cases the benefit over Baumgarte is small. - -Modified NGS is not a robust method for the revolute joint due to the violent -instability seen in the simple pendulum. Perhaps it is viable with other constraint -types, especially scalar constraints where the effective mass is a scalar. - -This leaves Baumgarte and Full NGS. Baumgarte has small, but manageable instabilities -and is very fast. I don't think we can escape Baumgarte, especially in highly -demanding cases where high constraint fidelity is not needed. - -Full NGS is robust and easy on the eyes. I recommend this as an option for -higher fidelity simulation and certainly for suspension bridges and long chains. -Full NGS might be a good choice for ragdolls, especially motorized ragdolls where -joint separation can be problematic. The number of NGS iterations can be reduced -for better performance without harming robustness much. - -Each joint in a can be handled differently in the position solver. So I recommend -a system where the user can select the algorithm on a per joint basis. I would -probably default to the slower Full NGS and let the user select the faster -Baumgarte method in performance critical scenarios. -*/ - -/* -Cache Performance - -The Box2D solvers are dominated by cache misses. Data structures are designed -to increase the number of cache hits. Much of misses are due to random access -to body data. The constraint structures are iterated over linearly, which leads -to few cache misses. - -The bodies are not accessed during iteration. Instead read only data, such as -the mass values are stored with the constraints. The mutable data are the constraint -impulses and the bodies velocities/positions. The impulses are held inside the -constraint structures. The body velocities/positions are held in compact, temporary -arrays to increase the number of cache hits. Linear and angular velocity are -stored in a single array since multiple arrays lead to multiple misses. -*/ - -/* -2D Rotation - -R = [cos(theta) -sin(theta)] - [sin(theta) cos(theta) ] - -thetaDot = omega - -Let q1 = cos(theta), q2 = sin(theta). -R = [q1 -q2] - [q2 q1] - -q1Dot = -thetaDot * q2 -q2Dot = thetaDot * q1 - -q1_new = q1_old - dt * w * q2 -q2_new = q2_old + dt * w * q1 -then normalize. - -This might be faster than computing sin+cos. -However, we can compute sin+cos of the same angle fast. -*/ - -b2Island::b2Island( - int32 bodyCapacity, - int32 contactCapacity, - int32 jointCapacity, - b2StackAllocator* allocator, - b2ContactListener* listener) -{ - m_bodyCapacity = bodyCapacity; - m_contactCapacity = contactCapacity; - m_jointCapacity = jointCapacity; - m_bodyCount = 0; - m_contactCount = 0; - m_jointCount = 0; - - m_allocator = allocator; - m_listener = listener; - - m_bodies = (b2Body**)m_allocator->Allocate(bodyCapacity * sizeof(b2Body*)); - m_contacts = (b2Contact**)m_allocator->Allocate(contactCapacity * sizeof(b2Contact*)); - m_joints = (b2Joint**)m_allocator->Allocate(jointCapacity * sizeof(b2Joint*)); - - m_velocities = (b2Velocity*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Velocity)); - m_positions = (b2Position*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Position)); -} - -b2Island::~b2Island() -{ - // Warning: the order should reverse the constructor order. - m_allocator->Free(m_positions); - m_allocator->Free(m_velocities); - m_allocator->Free(m_joints); - m_allocator->Free(m_contacts); - m_allocator->Free(m_bodies); -} - -void b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep) -{ - b2Timer timer; - - float32 h = step.dt; - - // Integrate velocities and apply damping. Initialize the body state. - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - - b2Vec2 c = b->m_sweep.c; - float32 a = b->m_sweep.a; - b2Vec2 v = b->m_linearVelocity; - float32 w = b->m_angularVelocity; - - // Store positions for continuous collision. - b->m_sweep.c0 = b->m_sweep.c; - b->m_sweep.a0 = b->m_sweep.a; - - if (b->m_type == b2_dynamicBody) - { - // Integrate velocities. - v += h * (b->m_gravityScale * gravity + b->m_invMass * b->m_force); - w += h * b->m_invI * b->m_torque; - - // Apply damping. - // ODE: dv/dt + c * v = 0 - // Solution: v(t) = v0 * exp(-c * t) - // Time step: v(t + dt) = v0 * exp(-c * (t + dt)) = v0 * exp(-c * t) * exp(-c * dt) = v * exp(-c * dt) - // v2 = exp(-c * dt) * v1 - // Taylor expansion: - // v2 = (1.0f - c * dt) * v1 - v *= b2Clamp(1.0f - h * b->m_linearDamping, 0.0f, 1.0f); - w *= b2Clamp(1.0f - h * b->m_angularDamping, 0.0f, 1.0f); - } - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - } - - timer.Reset(); - - // Solver data - b2SolverData solverData; - solverData.step = step; - solverData.positions = m_positions; - solverData.velocities = m_velocities; - - // Initialize velocity constraints. - b2ContactSolverDef contactSolverDef; - contactSolverDef.step = step; - contactSolverDef.contacts = m_contacts; - contactSolverDef.count = m_contactCount; - contactSolverDef.positions = m_positions; - contactSolverDef.velocities = m_velocities; - contactSolverDef.allocator = m_allocator; - - b2ContactSolver contactSolver(&contactSolverDef); - contactSolver.InitializeVelocityConstraints(); - - if (step.warmStarting) - { - contactSolver.WarmStart(); - } - - for (int32 i = 0; i < m_jointCount; ++i) - { - m_joints[i]->InitVelocityConstraints(solverData); - } - - profile->solveInit = timer.GetMilliseconds(); - - // Solve velocity constraints - timer.Reset(); - for (int32 i = 0; i < step.velocityIterations; ++i) - { - for (int32 j = 0; j < m_jointCount; ++j) - { - m_joints[j]->SolveVelocityConstraints(solverData); - } - - contactSolver.SolveVelocityConstraints(); - } - - // Store impulses for warm starting - contactSolver.StoreImpulses(); - profile->solveVelocity = timer.GetMilliseconds(); - - // Integrate positions - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Vec2 c = m_positions[i].c; - float32 a = m_positions[i].a; - b2Vec2 v = m_velocities[i].v; - float32 w = m_velocities[i].w; - - // Check for large velocities - b2Vec2 translation = h * v; - if (b2Dot(translation, translation) > b2_maxTranslationSquared) - { - float32 ratio = b2_maxTranslation / translation.Length(); - v *= ratio; - } - - float32 rotation = h * w; - if (rotation * rotation > b2_maxRotationSquared) - { - float32 ratio = b2_maxRotation / b2Abs(rotation); - w *= ratio; - } - - // Integrate - c += h * v; - a += h * w; - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - } - - // Solve position constraints - timer.Reset(); - bool positionSolved = false; - for (int32 i = 0; i < step.positionIterations; ++i) - { - bool contactsOkay = contactSolver.SolvePositionConstraints(); - - bool jointsOkay = true; - for (int32 i = 0; i < m_jointCount; ++i) - { - bool jointOkay = m_joints[i]->SolvePositionConstraints(solverData); - jointsOkay = jointsOkay && jointOkay; - } - - if (contactsOkay && jointsOkay) - { - // Exit early if the position errors are small. - positionSolved = true; - break; - } - } - - // Copy state buffers back to the bodies - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* body = m_bodies[i]; - body->m_sweep.c = m_positions[i].c; - body->m_sweep.a = m_positions[i].a; - body->m_linearVelocity = m_velocities[i].v; - body->m_angularVelocity = m_velocities[i].w; - body->SynchronizeTransform(); - } - - profile->solvePosition = timer.GetMilliseconds(); - - Report(contactSolver.m_velocityConstraints); - - if (allowSleep) - { - float32 minSleepTime = b2_maxFloat; - - const float32 linTolSqr = b2_linearSleepTolerance * b2_linearSleepTolerance; - const float32 angTolSqr = b2_angularSleepTolerance * b2_angularSleepTolerance; - - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - if (b->GetType() == b2_staticBody) - { - continue; - } - - if ((b->m_flags & b2Body::e_autoSleepFlag) == 0 || - b->m_angularVelocity * b->m_angularVelocity > angTolSqr || - b2Dot(b->m_linearVelocity, b->m_linearVelocity) > linTolSqr) - { - b->m_sleepTime = 0.0f; - minSleepTime = 0.0f; - } - else - { - b->m_sleepTime += h; - minSleepTime = b2Min(minSleepTime, b->m_sleepTime); - } - } - - if (minSleepTime >= b2_timeToSleep && positionSolved) - { - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - b->SetAwake(false); - } - } - } -} - -void b2Island::SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB) -{ - b2Assert(toiIndexA < m_bodyCount); - b2Assert(toiIndexB < m_bodyCount); - - // Initialize the body state. - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Body* b = m_bodies[i]; - m_positions[i].c = b->m_sweep.c; - m_positions[i].a = b->m_sweep.a; - m_velocities[i].v = b->m_linearVelocity; - m_velocities[i].w = b->m_angularVelocity; - } - - b2ContactSolverDef contactSolverDef; - contactSolverDef.contacts = m_contacts; - contactSolverDef.count = m_contactCount; - contactSolverDef.allocator = m_allocator; - contactSolverDef.step = subStep; - contactSolverDef.positions = m_positions; - contactSolverDef.velocities = m_velocities; - b2ContactSolver contactSolver(&contactSolverDef); - - // Solve position constraints. - for (int32 i = 0; i < subStep.positionIterations; ++i) - { - bool contactsOkay = contactSolver.SolveTOIPositionConstraints(toiIndexA, toiIndexB); - if (contactsOkay) - { - break; - } - } - -#if 0 - // Is the new position really safe? - for (int32 i = 0; i < m_contactCount; ++i) - { - b2Contact* c = m_contacts[i]; - b2Fixture* fA = c->GetFixtureA(); - b2Fixture* fB = c->GetFixtureB(); - - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - - b2DistanceInput input; - input.proxyA.Set(fA->GetShape(), indexA); - input.proxyB.Set(fB->GetShape(), indexB); - input.transformA = bA->GetTransform(); - input.transformB = bB->GetTransform(); - input.useRadii = false; - - b2DistanceOutput output; - b2SimplexCache cache; - cache.count = 0; - b2Distance(&output, &cache, &input); - - if (output.distance == 0 || cache.count == 3) - { - cache.count += 0; - } - } -#endif - - // Leap of faith to new safe state. - m_bodies[toiIndexA]->m_sweep.c0 = m_positions[toiIndexA].c; - m_bodies[toiIndexA]->m_sweep.a0 = m_positions[toiIndexA].a; - m_bodies[toiIndexB]->m_sweep.c0 = m_positions[toiIndexB].c; - m_bodies[toiIndexB]->m_sweep.a0 = m_positions[toiIndexB].a; - - // No warm starting is needed for TOI events because warm - // starting impulses were applied in the discrete solver. - contactSolver.InitializeVelocityConstraints(); - - // Solve velocity constraints. - for (int32 i = 0; i < subStep.velocityIterations; ++i) - { - contactSolver.SolveVelocityConstraints(); - } - - // Don't store the TOI contact forces for warm starting - // because they can be quite large. - - float32 h = subStep.dt; - - // Integrate positions - for (int32 i = 0; i < m_bodyCount; ++i) - { - b2Vec2 c = m_positions[i].c; - float32 a = m_positions[i].a; - b2Vec2 v = m_velocities[i].v; - float32 w = m_velocities[i].w; - - // Check for large velocities - b2Vec2 translation = h * v; - if (b2Dot(translation, translation) > b2_maxTranslationSquared) - { - float32 ratio = b2_maxTranslation / translation.Length(); - v *= ratio; - } - - float32 rotation = h * w; - if (rotation * rotation > b2_maxRotationSquared) - { - float32 ratio = b2_maxRotation / b2Abs(rotation); - w *= ratio; - } - - // Integrate - c += h * v; - a += h * w; - - m_positions[i].c = c; - m_positions[i].a = a; - m_velocities[i].v = v; - m_velocities[i].w = w; - - // Sync bodies - b2Body* body = m_bodies[i]; - body->m_sweep.c = c; - body->m_sweep.a = a; - body->m_linearVelocity = v; - body->m_angularVelocity = w; - body->SynchronizeTransform(); - } - - Report(contactSolver.m_velocityConstraints); -} - -void b2Island::Report(const b2ContactVelocityConstraint* constraints) -{ - if (m_listener == NULL) - { - return; - } - - for (int32 i = 0; i < m_contactCount; ++i) - { - b2Contact* c = m_contacts[i]; - - const b2ContactVelocityConstraint* vc = constraints + i; - - b2ContactImpulse impulse; - impulse.count = vc->pointCount; - for (int32 j = 0; j < vc->pointCount; ++j) - { - impulse.normalImpulses[j] = vc->points[j].normalImpulse; - impulse.tangentImpulses[j] = vc->points[j].tangentImpulse; - } - - m_listener->PostSolve(c, &impulse); - } -} +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* +Position Correction Notes +========================= +I tried the several algorithms for position correction of the 2D revolute joint. +I looked at these systems: +- simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s. +- suspension bridge with 30 1m long planks of length 1m. +- multi-link chain with 30 1m long links. + +Here are the algorithms: + +Baumgarte - A fraction of the position error is added to the velocity error. There is no +separate position solver. + +Pseudo Velocities - After the velocity solver and position integration, +the position error, Jacobian, and effective mass are recomputed. Then +the velocity constraints are solved with pseudo velocities and a fraction +of the position error is added to the pseudo velocity error. The pseudo +velocities are initialized to zero and there is no warm-starting. After +the position solver, the pseudo velocities are added to the positions. +This is also called the First Order World method or the Position LCP method. + +Modified Nonlinear Gauss-Seidel (NGS) - Like Pseudo Velocities except the +position error is re-computed for each constraint and the positions are updated +after the constraint is solved. The radius vectors (aka Jacobians) are +re-computed too (otherwise the algorithm has horrible instability). The pseudo +velocity states are not needed because they are effectively zero at the beginning +of each iteration. Since we have the current position error, we allow the +iterations to terminate early if the error becomes smaller than b2_linearSlop. + +Full NGS or just NGS - Like Modified NGS except the effective mass are re-computed +each time a constraint is solved. + +Here are the results: +Baumgarte - this is the cheapest algorithm but it has some stability problems, +especially with the bridge. The chain links separate easily close to the root +and they jitter as they struggle to pull together. This is one of the most common +methods in the field. The big drawback is that the position correction artificially +affects the momentum, thus leading to instabilities and false bounce. I used a +bias factor of 0.2. A larger bias factor makes the bridge less stable, a smaller +factor makes joints and contacts more spongy. + +Pseudo Velocities - the is more stable than the Baumgarte method. The bridge is +stable. However, joints still separate with large angular velocities. Drag the +simple pendulum in a circle quickly and the joint will separate. The chain separates +easily and does not recover. I used a bias factor of 0.2. A larger value lead to +the bridge collapsing when a heavy cube drops on it. + +Modified NGS - this algorithm is better in some ways than Baumgarte and Pseudo +Velocities, but in other ways it is worse. The bridge and chain are much more +stable, but the simple pendulum goes unstable at high angular velocities. + +Full NGS - stable in all tests. The joints display good stiffness. The bridge +still sags, but this is better than infinite forces. + +Recommendations +Pseudo Velocities are not really worthwhile because the bridge and chain cannot +recover from joint separation. In other cases the benefit over Baumgarte is small. + +Modified NGS is not a robust method for the revolute joint due to the violent +instability seen in the simple pendulum. Perhaps it is viable with other constraint +types, especially scalar constraints where the effective mass is a scalar. + +This leaves Baumgarte and Full NGS. Baumgarte has small, but manageable instabilities +and is very fast. I don't think we can escape Baumgarte, especially in highly +demanding cases where high constraint fidelity is not needed. + +Full NGS is robust and easy on the eyes. I recommend this as an option for +higher fidelity simulation and certainly for suspension bridges and long chains. +Full NGS might be a good choice for ragdolls, especially motorized ragdolls where +joint separation can be problematic. The number of NGS iterations can be reduced +for better performance without harming robustness much. + +Each joint in a can be handled differently in the position solver. So I recommend +a system where the user can select the algorithm on a per joint basis. I would +probably default to the slower Full NGS and let the user select the faster +Baumgarte method in performance critical scenarios. +*/ + +/* +Cache Performance + +The Box2D solvers are dominated by cache misses. Data structures are designed +to increase the number of cache hits. Much of misses are due to random access +to body data. The constraint structures are iterated over linearly, which leads +to few cache misses. + +The bodies are not accessed during iteration. Instead read only data, such as +the mass values are stored with the constraints. The mutable data are the constraint +impulses and the bodies velocities/positions. The impulses are held inside the +constraint structures. The body velocities/positions are held in compact, temporary +arrays to increase the number of cache hits. Linear and angular velocity are +stored in a single array since multiple arrays lead to multiple misses. +*/ + +/* +2D Rotation + +R = [cos(theta) -sin(theta)] + [sin(theta) cos(theta) ] + +thetaDot = omega + +Let q1 = cos(theta), q2 = sin(theta). +R = [q1 -q2] + [q2 q1] + +q1Dot = -thetaDot * q2 +q2Dot = thetaDot * q1 + +q1_new = q1_old - dt * w * q2 +q2_new = q2_old + dt * w * q1 +then normalize. + +This might be faster than computing sin+cos. +However, we can compute sin+cos of the same angle fast. +*/ + +b2Island::b2Island( + int32 bodyCapacity, + int32 contactCapacity, + int32 jointCapacity, + b2StackAllocator* allocator, + b2ContactListener* listener) +{ + m_bodyCapacity = bodyCapacity; + m_contactCapacity = contactCapacity; + m_jointCapacity = jointCapacity; + m_bodyCount = 0; + m_contactCount = 0; + m_jointCount = 0; + + m_allocator = allocator; + m_listener = listener; + + m_bodies = (b2Body**)m_allocator->Allocate(bodyCapacity * sizeof(b2Body*)); + m_contacts = (b2Contact**)m_allocator->Allocate(contactCapacity * sizeof(b2Contact*)); + m_joints = (b2Joint**)m_allocator->Allocate(jointCapacity * sizeof(b2Joint*)); + + m_velocities = (b2Velocity*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Velocity)); + m_positions = (b2Position*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Position)); +} + +b2Island::~b2Island() +{ + // Warning: the order should reverse the constructor order. + m_allocator->Free(m_positions); + m_allocator->Free(m_velocities); + m_allocator->Free(m_joints); + m_allocator->Free(m_contacts); + m_allocator->Free(m_bodies); +} + +void b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep) +{ + b2Timer timer; + + float32 h = step.dt; + + // Integrate velocities and apply damping. Initialize the body state. + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + + b2Vec2 c = b->m_sweep.c; + float32 a = b->m_sweep.a; + b2Vec2 v = b->m_linearVelocity; + float32 w = b->m_angularVelocity; + + // Store positions for continuous collision. + b->m_sweep.c0 = b->m_sweep.c; + b->m_sweep.a0 = b->m_sweep.a; + + if (b->m_type == b2_dynamicBody) + { + // Integrate velocities. + v += h * (b->m_gravityScale * gravity + b->m_invMass * b->m_force); + w += h * b->m_invI * b->m_torque; + + // Apply damping. + // ODE: dv/dt + c * v = 0 + // Solution: v(t) = v0 * exp(-c * t) + // Time step: v(t + dt) = v0 * exp(-c * (t + dt)) = v0 * exp(-c * t) * exp(-c * dt) = v * exp(-c * dt) + // v2 = exp(-c * dt) * v1 + // Taylor expansion: + // v2 = (1.0f - c * dt) * v1 + v *= b2Clamp(1.0f - h * b->m_linearDamping, 0.0f, 1.0f); + w *= b2Clamp(1.0f - h * b->m_angularDamping, 0.0f, 1.0f); + } + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + } + + timer.Reset(); + + // Solver data + b2SolverData solverData; + solverData.step = step; + solverData.positions = m_positions; + solverData.velocities = m_velocities; + + // Initialize velocity constraints. + b2ContactSolverDef contactSolverDef; + contactSolverDef.step = step; + contactSolverDef.contacts = m_contacts; + contactSolverDef.count = m_contactCount; + contactSolverDef.positions = m_positions; + contactSolverDef.velocities = m_velocities; + contactSolverDef.allocator = m_allocator; + + b2ContactSolver contactSolver(&contactSolverDef); + contactSolver.InitializeVelocityConstraints(); + + if (step.warmStarting) + { + contactSolver.WarmStart(); + } + + for (int32 i = 0; i < m_jointCount; ++i) + { + m_joints[i]->InitVelocityConstraints(solverData); + } + + profile->solveInit = timer.GetMilliseconds(); + + // Solve velocity constraints + timer.Reset(); + for (int32 i = 0; i < step.velocityIterations; ++i) + { + for (int32 j = 0; j < m_jointCount; ++j) + { + m_joints[j]->SolveVelocityConstraints(solverData); + } + + contactSolver.SolveVelocityConstraints(); + } + + // Store impulses for warm starting + contactSolver.StoreImpulses(); + profile->solveVelocity = timer.GetMilliseconds(); + + // Integrate positions + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Vec2 c = m_positions[i].c; + float32 a = m_positions[i].a; + b2Vec2 v = m_velocities[i].v; + float32 w = m_velocities[i].w; + + // Check for large velocities + b2Vec2 translation = h * v; + if (b2Dot(translation, translation) > b2_maxTranslationSquared) + { + float32 ratio = b2_maxTranslation / translation.Length(); + v *= ratio; + } + + float32 rotation = h * w; + if (rotation * rotation > b2_maxRotationSquared) + { + float32 ratio = b2_maxRotation / b2Abs(rotation); + w *= ratio; + } + + // Integrate + c += h * v; + a += h * w; + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + } + + // Solve position constraints + timer.Reset(); + bool positionSolved = false; + for (int32 i = 0; i < step.positionIterations; ++i) + { + bool contactsOkay = contactSolver.SolvePositionConstraints(); + + bool jointsOkay = true; + for (int32 i = 0; i < m_jointCount; ++i) + { + bool jointOkay = m_joints[i]->SolvePositionConstraints(solverData); + jointsOkay = jointsOkay && jointOkay; + } + + if (contactsOkay && jointsOkay) + { + // Exit early if the position errors are small. + positionSolved = true; + break; + } + } + + // Copy state buffers back to the bodies + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* body = m_bodies[i]; + body->m_sweep.c = m_positions[i].c; + body->m_sweep.a = m_positions[i].a; + body->m_linearVelocity = m_velocities[i].v; + body->m_angularVelocity = m_velocities[i].w; + body->SynchronizeTransform(); + } + + profile->solvePosition = timer.GetMilliseconds(); + + Report(contactSolver.m_velocityConstraints); + + if (allowSleep) + { + float32 minSleepTime = b2_maxFloat; + + const float32 linTolSqr = b2_linearSleepTolerance * b2_linearSleepTolerance; + const float32 angTolSqr = b2_angularSleepTolerance * b2_angularSleepTolerance; + + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + if (b->GetType() == b2_staticBody) + { + continue; + } + + if ((b->m_flags & b2Body::e_autoSleepFlag) == 0 || + b->m_angularVelocity * b->m_angularVelocity > angTolSqr || + b2Dot(b->m_linearVelocity, b->m_linearVelocity) > linTolSqr) + { + b->m_sleepTime = 0.0f; + minSleepTime = 0.0f; + } + else + { + b->m_sleepTime += h; + minSleepTime = b2Min(minSleepTime, b->m_sleepTime); + } + } + + if (minSleepTime >= b2_timeToSleep && positionSolved) + { + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + b->SetAwake(false); + } + } + } +} + +void b2Island::SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB) +{ + b2Assert(toiIndexA < m_bodyCount); + b2Assert(toiIndexB < m_bodyCount); + + // Initialize the body state. + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Body* b = m_bodies[i]; + m_positions[i].c = b->m_sweep.c; + m_positions[i].a = b->m_sweep.a; + m_velocities[i].v = b->m_linearVelocity; + m_velocities[i].w = b->m_angularVelocity; + } + + b2ContactSolverDef contactSolverDef; + contactSolverDef.contacts = m_contacts; + contactSolverDef.count = m_contactCount; + contactSolverDef.allocator = m_allocator; + contactSolverDef.step = subStep; + contactSolverDef.positions = m_positions; + contactSolverDef.velocities = m_velocities; + b2ContactSolver contactSolver(&contactSolverDef); + + // Solve position constraints. + for (int32 i = 0; i < subStep.positionIterations; ++i) + { + bool contactsOkay = contactSolver.SolveTOIPositionConstraints(toiIndexA, toiIndexB); + if (contactsOkay) + { + break; + } + } + +#if 0 + // Is the new position really safe? + for (int32 i = 0; i < m_contactCount; ++i) + { + b2Contact* c = m_contacts[i]; + b2Fixture* fA = c->GetFixtureA(); + b2Fixture* fB = c->GetFixtureB(); + + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + + b2DistanceInput input; + input.proxyA.Set(fA->GetShape(), indexA); + input.proxyB.Set(fB->GetShape(), indexB); + input.transformA = bA->GetTransform(); + input.transformB = bB->GetTransform(); + input.useRadii = false; + + b2DistanceOutput output; + b2SimplexCache cache; + cache.count = 0; + b2Distance(&output, &cache, &input); + + if (output.distance == 0 || cache.count == 3) + { + cache.count += 0; + } + } +#endif + + // Leap of faith to new safe state. + m_bodies[toiIndexA]->m_sweep.c0 = m_positions[toiIndexA].c; + m_bodies[toiIndexA]->m_sweep.a0 = m_positions[toiIndexA].a; + m_bodies[toiIndexB]->m_sweep.c0 = m_positions[toiIndexB].c; + m_bodies[toiIndexB]->m_sweep.a0 = m_positions[toiIndexB].a; + + // No warm starting is needed for TOI events because warm + // starting impulses were applied in the discrete solver. + contactSolver.InitializeVelocityConstraints(); + + // Solve velocity constraints. + for (int32 i = 0; i < subStep.velocityIterations; ++i) + { + contactSolver.SolveVelocityConstraints(); + } + + // Don't store the TOI contact forces for warm starting + // because they can be quite large. + + float32 h = subStep.dt; + + // Integrate positions + for (int32 i = 0; i < m_bodyCount; ++i) + { + b2Vec2 c = m_positions[i].c; + float32 a = m_positions[i].a; + b2Vec2 v = m_velocities[i].v; + float32 w = m_velocities[i].w; + + // Check for large velocities + b2Vec2 translation = h * v; + if (b2Dot(translation, translation) > b2_maxTranslationSquared) + { + float32 ratio = b2_maxTranslation / translation.Length(); + v *= ratio; + } + + float32 rotation = h * w; + if (rotation * rotation > b2_maxRotationSquared) + { + float32 ratio = b2_maxRotation / b2Abs(rotation); + w *= ratio; + } + + // Integrate + c += h * v; + a += h * w; + + m_positions[i].c = c; + m_positions[i].a = a; + m_velocities[i].v = v; + m_velocities[i].w = w; + + // Sync bodies + b2Body* body = m_bodies[i]; + body->m_sweep.c = c; + body->m_sweep.a = a; + body->m_linearVelocity = v; + body->m_angularVelocity = w; + body->SynchronizeTransform(); + } + + Report(contactSolver.m_velocityConstraints); +} + +void b2Island::Report(const b2ContactVelocityConstraint* constraints) +{ + if (m_listener == NULL) + { + return; + } + + for (int32 i = 0; i < m_contactCount; ++i) + { + b2Contact* c = m_contacts[i]; + + const b2ContactVelocityConstraint* vc = constraints + i; + + b2ContactImpulse impulse; + impulse.count = vc->pointCount; + for (int32 j = 0; j < vc->pointCount; ++j) + { + impulse.normalImpulses[j] = vc->points[j].normalImpulse; + impulse.tangentImpulses[j] = vc->points[j].tangentImpulse; + } + + m_listener->PostSolve(c, &impulse); + } +} diff --git a/src/libraries/Box2D/Dynamics/b2Island.h b/src/libraries/Box2D/Dynamics/b2Island.h index ef3d9b1df..4a814c463 100755 --- a/src/libraries/Box2D/Dynamics/b2Island.h +++ b/src/libraries/Box2D/Dynamics/b2Island.h @@ -1,93 +1,93 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ISLAND_H -#define B2_ISLAND_H - -#include -#include -#include - -class b2Contact; -class b2Joint; -class b2StackAllocator; -class b2ContactListener; -struct b2ContactVelocityConstraint; -struct b2Profile; - -/// This is an internal class. -class b2Island -{ -public: - b2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity, - b2StackAllocator* allocator, b2ContactListener* listener); - ~b2Island(); - - void Clear() - { - m_bodyCount = 0; - m_contactCount = 0; - m_jointCount = 0; - } - - void Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep); - - void SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB); - - void Add(b2Body* body) - { - b2Assert(m_bodyCount < m_bodyCapacity); - body->m_islandIndex = m_bodyCount; - m_bodies[m_bodyCount] = body; - ++m_bodyCount; - } - - void Add(b2Contact* contact) - { - b2Assert(m_contactCount < m_contactCapacity); - m_contacts[m_contactCount++] = contact; - } - - void Add(b2Joint* joint) - { - b2Assert(m_jointCount < m_jointCapacity); - m_joints[m_jointCount++] = joint; - } - - void Report(const b2ContactVelocityConstraint* constraints); - - b2StackAllocator* m_allocator; - b2ContactListener* m_listener; - - b2Body** m_bodies; - b2Contact** m_contacts; - b2Joint** m_joints; - - b2Position* m_positions; - b2Velocity* m_velocities; - - int32 m_bodyCount; - int32 m_jointCount; - int32 m_contactCount; - - int32 m_bodyCapacity; - int32 m_contactCapacity; - int32 m_jointCapacity; -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ISLAND_H +#define B2_ISLAND_H + +#include +#include +#include + +class b2Contact; +class b2Joint; +class b2StackAllocator; +class b2ContactListener; +struct b2ContactVelocityConstraint; +struct b2Profile; + +/// This is an internal class. +class b2Island +{ +public: + b2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity, + b2StackAllocator* allocator, b2ContactListener* listener); + ~b2Island(); + + void Clear() + { + m_bodyCount = 0; + m_contactCount = 0; + m_jointCount = 0; + } + + void Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep); + + void SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB); + + void Add(b2Body* body) + { + b2Assert(m_bodyCount < m_bodyCapacity); + body->m_islandIndex = m_bodyCount; + m_bodies[m_bodyCount] = body; + ++m_bodyCount; + } + + void Add(b2Contact* contact) + { + b2Assert(m_contactCount < m_contactCapacity); + m_contacts[m_contactCount++] = contact; + } + + void Add(b2Joint* joint) + { + b2Assert(m_jointCount < m_jointCapacity); + m_joints[m_jointCount++] = joint; + } + + void Report(const b2ContactVelocityConstraint* constraints); + + b2StackAllocator* m_allocator; + b2ContactListener* m_listener; + + b2Body** m_bodies; + b2Contact** m_contacts; + b2Joint** m_joints; + + b2Position* m_positions; + b2Velocity* m_velocities; + + int32 m_bodyCount; + int32 m_jointCount; + int32 m_contactCount; + + int32 m_bodyCapacity; + int32 m_contactCapacity; + int32 m_jointCapacity; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/b2TimeStep.h b/src/libraries/Box2D/Dynamics/b2TimeStep.h index abe6fb6e0..a3727624c 100755 --- a/src/libraries/Box2D/Dynamics/b2TimeStep.h +++ b/src/libraries/Box2D/Dynamics/b2TimeStep.h @@ -1,70 +1,70 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_TIME_STEP_H -#define B2_TIME_STEP_H - -#include - -/// Profiling data. Times are in milliseconds. -struct b2Profile -{ - float32 step; - float32 collide; - float32 solve; - float32 solveInit; - float32 solveVelocity; - float32 solvePosition; - float32 broadphase; - float32 solveTOI; -}; - -/// This is an internal structure. -struct b2TimeStep -{ - float32 dt; // time step - float32 inv_dt; // inverse time step (0 if dt == 0). - float32 dtRatio; // dt * inv_dt0 - int32 velocityIterations; - int32 positionIterations; - bool warmStarting; -}; - -/// This is an internal structure. -struct b2Position -{ - b2Vec2 c; - float32 a; -}; - -/// This is an internal structure. -struct b2Velocity -{ - b2Vec2 v; - float32 w; -}; - -/// Solver Data -struct b2SolverData -{ - b2TimeStep step; - b2Position* positions; - b2Velocity* velocities; -}; - -#endif +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_TIME_STEP_H +#define B2_TIME_STEP_H + +#include + +/// Profiling data. Times are in milliseconds. +struct b2Profile +{ + float32 step; + float32 collide; + float32 solve; + float32 solveInit; + float32 solveVelocity; + float32 solvePosition; + float32 broadphase; + float32 solveTOI; +}; + +/// This is an internal structure. +struct b2TimeStep +{ + float32 dt; // time step + float32 inv_dt; // inverse time step (0 if dt == 0). + float32 dtRatio; // dt * inv_dt0 + int32 velocityIterations; + int32 positionIterations; + bool warmStarting; +}; + +/// This is an internal structure. +struct b2Position +{ + b2Vec2 c; + float32 a; +}; + +/// This is an internal structure. +struct b2Velocity +{ + b2Vec2 v; + float32 w; +}; + +/// Solver Data +struct b2SolverData +{ + b2TimeStep step; + b2Position* positions; + b2Velocity* velocities; +}; + +#endif diff --git a/src/libraries/Box2D/Dynamics/b2World.cpp b/src/libraries/Box2D/Dynamics/b2World.cpp index baacded4f..fae03ecb5 100755 --- a/src/libraries/Box2D/Dynamics/b2World.cpp +++ b/src/libraries/Box2D/Dynamics/b2World.cpp @@ -1,1316 +1,1316 @@ -/* -* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -b2World::b2World(const b2Vec2& gravity) -{ - m_destructionListener = NULL; - m_debugDraw = NULL; - - m_bodyList = NULL; - m_jointList = NULL; - - m_bodyCount = 0; - m_jointCount = 0; - - m_warmStarting = true; - m_continuousPhysics = true; - m_subStepping = false; - - m_stepComplete = true; - - m_allowSleep = true; - m_gravity = gravity; - - m_flags = e_clearForces; - - m_inv_dt0 = 0.0f; - - m_contactManager.m_allocator = &m_blockAllocator; - - memset(&m_profile, 0, sizeof(b2Profile)); -} - -b2World::~b2World() -{ - // Some shapes allocate using b2Alloc. - b2Body* b = m_bodyList; - while (b) - { - b2Body* bNext = b->m_next; - - b2Fixture* f = b->m_fixtureList; - while (f) - { - b2Fixture* fNext = f->m_next; - f->m_proxyCount = 0; - f->Destroy(&m_blockAllocator); - f = fNext; - } - - b = bNext; - } -} - -void b2World::SetDestructionListener(b2DestructionListener* listener) -{ - m_destructionListener = listener; -} - -void b2World::SetContactFilter(b2ContactFilter* filter) -{ - m_contactManager.m_contactFilter = filter; -} - -void b2World::SetContactListener(b2ContactListener* listener) -{ - m_contactManager.m_contactListener = listener; -} - -void b2World::SetDebugDraw(b2Draw* debugDraw) -{ - m_debugDraw = debugDraw; -} - -b2Body* b2World::CreateBody(const b2BodyDef* def) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return NULL; - } - - void* mem = m_blockAllocator.Allocate(sizeof(b2Body)); - b2Body* b = new (mem) b2Body(def, this); - - // Add to world doubly linked list. - b->m_prev = NULL; - b->m_next = m_bodyList; - if (m_bodyList) - { - m_bodyList->m_prev = b; - } - m_bodyList = b; - ++m_bodyCount; - - return b; -} - -void b2World::DestroyBody(b2Body* b) -{ - b2Assert(m_bodyCount > 0); - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return; - } - - // Delete the attached joints. - b2JointEdge* je = b->m_jointList; - while (je) - { - b2JointEdge* je0 = je; - je = je->next; - - if (m_destructionListener) - { - m_destructionListener->SayGoodbye(je0->joint); - } - - DestroyJoint(je0->joint); - - b->m_jointList = je; - } - b->m_jointList = NULL; - - // Delete the attached contacts. - b2ContactEdge* ce = b->m_contactList; - while (ce) - { - b2ContactEdge* ce0 = ce; - ce = ce->next; - m_contactManager.Destroy(ce0->contact); - } - b->m_contactList = NULL; - - // Delete the attached fixtures. This destroys broad-phase proxies. - b2Fixture* f = b->m_fixtureList; - while (f) - { - b2Fixture* f0 = f; - f = f->m_next; - - if (m_destructionListener) - { - m_destructionListener->SayGoodbye(f0); - } - - f0->DestroyProxies(&m_contactManager.m_broadPhase); - f0->Destroy(&m_blockAllocator); - f0->~b2Fixture(); - m_blockAllocator.Free(f0, sizeof(b2Fixture)); - - b->m_fixtureList = f; - b->m_fixtureCount -= 1; - } - b->m_fixtureList = NULL; - b->m_fixtureCount = 0; - - // Remove world body list. - if (b->m_prev) - { - b->m_prev->m_next = b->m_next; - } - - if (b->m_next) - { - b->m_next->m_prev = b->m_prev; - } - - if (b == m_bodyList) - { - m_bodyList = b->m_next; - } - - --m_bodyCount; - b->~b2Body(); - m_blockAllocator.Free(b, sizeof(b2Body)); -} - -b2Joint* b2World::CreateJoint(const b2JointDef* def) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return NULL; - } - - b2Joint* j = b2Joint::Create(def, &m_blockAllocator); - - // Connect to the world list. - j->m_prev = NULL; - j->m_next = m_jointList; - if (m_jointList) - { - m_jointList->m_prev = j; - } - m_jointList = j; - ++m_jointCount; - - // Connect to the bodies' doubly linked lists. - j->m_edgeA.joint = j; - j->m_edgeA.other = j->m_bodyB; - j->m_edgeA.prev = NULL; - j->m_edgeA.next = j->m_bodyA->m_jointList; - if (j->m_bodyA->m_jointList) j->m_bodyA->m_jointList->prev = &j->m_edgeA; - j->m_bodyA->m_jointList = &j->m_edgeA; - - j->m_edgeB.joint = j; - j->m_edgeB.other = j->m_bodyA; - j->m_edgeB.prev = NULL; - j->m_edgeB.next = j->m_bodyB->m_jointList; - if (j->m_bodyB->m_jointList) j->m_bodyB->m_jointList->prev = &j->m_edgeB; - j->m_bodyB->m_jointList = &j->m_edgeB; - - b2Body* bodyA = def->bodyA; - b2Body* bodyB = def->bodyB; - - // If the joint prevents collisions, then flag any contacts for filtering. - if (def->collideConnected == false) - { - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - // Flag the contact for filtering at the next time step (where either - // body is awake). - edge->contact->FlagForFiltering(); - } - - edge = edge->next; - } - } - - // Note: creating a joint doesn't wake the bodies. - - return j; -} - -void b2World::DestroyJoint(b2Joint* j) -{ - b2Assert(IsLocked() == false); - if (IsLocked()) - { - return; - } - - bool collideConnected = j->m_collideConnected; - - // Remove from the doubly linked list. - if (j->m_prev) - { - j->m_prev->m_next = j->m_next; - } - - if (j->m_next) - { - j->m_next->m_prev = j->m_prev; - } - - if (j == m_jointList) - { - m_jointList = j->m_next; - } - - // Disconnect from island graph. - b2Body* bodyA = j->m_bodyA; - b2Body* bodyB = j->m_bodyB; - - // Wake up connected bodies. - bodyA->SetAwake(true); - bodyB->SetAwake(true); - - // Remove from body 1. - if (j->m_edgeA.prev) - { - j->m_edgeA.prev->next = j->m_edgeA.next; - } - - if (j->m_edgeA.next) - { - j->m_edgeA.next->prev = j->m_edgeA.prev; - } - - if (&j->m_edgeA == bodyA->m_jointList) - { - bodyA->m_jointList = j->m_edgeA.next; - } - - j->m_edgeA.prev = NULL; - j->m_edgeA.next = NULL; - - // Remove from body 2 - if (j->m_edgeB.prev) - { - j->m_edgeB.prev->next = j->m_edgeB.next; - } - - if (j->m_edgeB.next) - { - j->m_edgeB.next->prev = j->m_edgeB.prev; - } - - if (&j->m_edgeB == bodyB->m_jointList) - { - bodyB->m_jointList = j->m_edgeB.next; - } - - j->m_edgeB.prev = NULL; - j->m_edgeB.next = NULL; - - b2Joint::Destroy(j, &m_blockAllocator); - - b2Assert(m_jointCount > 0); - --m_jointCount; - - // If the joint prevents collisions, then flag any contacts for filtering. - if (collideConnected == false) - { - b2ContactEdge* edge = bodyB->GetContactList(); - while (edge) - { - if (edge->other == bodyA) - { - // Flag the contact for filtering at the next time step (where either - // body is awake). - edge->contact->FlagForFiltering(); - } - - edge = edge->next; - } - } -} - -// -void b2World::SetAllowSleeping(bool flag) -{ - if (flag == m_allowSleep) - { - return; - } - - m_allowSleep = flag; - if (m_allowSleep == false) - { - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->SetAwake(true); - } - } -} - -// Find islands, integrate and solve constraints, solve position constraints -void b2World::Solve(const b2TimeStep& step) -{ - m_profile.solveInit = 0.0f; - m_profile.solveVelocity = 0.0f; - m_profile.solvePosition = 0.0f; - - // Size the island for the worst case. - b2Island island(m_bodyCount, - m_contactManager.m_contactCount, - m_jointCount, - &m_stackAllocator, - m_contactManager.m_contactListener); - - // Clear all the island flags. - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_flags &= ~b2Body::e_islandFlag; - } - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - c->m_flags &= ~b2Contact::e_islandFlag; - } - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - j->m_islandFlag = false; - } - - // Build and simulate all awake islands. - int32 stackSize = m_bodyCount; - b2Body** stack = (b2Body**)m_stackAllocator.Allocate(stackSize * sizeof(b2Body*)); - for (b2Body* seed = m_bodyList; seed; seed = seed->m_next) - { - if (seed->m_flags & b2Body::e_islandFlag) - { - continue; - } - - if (seed->IsAwake() == false || seed->IsActive() == false) - { - continue; - } - - // The seed can be dynamic or kinematic. - if (seed->GetType() == b2_staticBody) - { - continue; - } - - // Reset island and stack. - island.Clear(); - int32 stackCount = 0; - stack[stackCount++] = seed; - seed->m_flags |= b2Body::e_islandFlag; - - // Perform a depth first search (DFS) on the constraint graph. - while (stackCount > 0) - { - // Grab the next body off the stack and add it to the island. - b2Body* b = stack[--stackCount]; - b2Assert(b->IsActive() == true); - island.Add(b); - - // Make sure the body is awake. - b->SetAwake(true); - - // To keep islands as small as possible, we don't - // propagate islands across static bodies. - if (b->GetType() == b2_staticBody) - { - continue; - } - - // Search all contacts connected to this body. - for (b2ContactEdge* ce = b->m_contactList; ce; ce = ce->next) - { - b2Contact* contact = ce->contact; - - // Has this contact already been added to an island? - if (contact->m_flags & b2Contact::e_islandFlag) - { - continue; - } - - // Is this contact solid and touching? - if (contact->IsEnabled() == false || - contact->IsTouching() == false) - { - continue; - } - - // Skip sensors. - bool sensorA = contact->m_fixtureA->m_isSensor; - bool sensorB = contact->m_fixtureB->m_isSensor; - if (sensorA || sensorB) - { - continue; - } - - island.Add(contact); - contact->m_flags |= b2Contact::e_islandFlag; - - b2Body* other = ce->other; - - // Was the other body already added to this island? - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - b2Assert(stackCount < stackSize); - stack[stackCount++] = other; - other->m_flags |= b2Body::e_islandFlag; - } - - // Search all joints connect to this body. - for (b2JointEdge* je = b->m_jointList; je; je = je->next) - { - if (je->joint->m_islandFlag == true) - { - continue; - } - - b2Body* other = je->other; - - // Don't simulate joints connected to inactive bodies. - if (other->IsActive() == false) - { - continue; - } - - island.Add(je->joint); - je->joint->m_islandFlag = true; - - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - b2Assert(stackCount < stackSize); - stack[stackCount++] = other; - other->m_flags |= b2Body::e_islandFlag; - } - } - - b2Profile profile; - island.Solve(&profile, step, m_gravity, m_allowSleep); - m_profile.solveInit += profile.solveInit; - m_profile.solveVelocity += profile.solveVelocity; - m_profile.solvePosition += profile.solvePosition; - - // Post solve cleanup. - for (int32 i = 0; i < island.m_bodyCount; ++i) - { - // Allow static bodies to participate in other islands. - b2Body* b = island.m_bodies[i]; - if (b->GetType() == b2_staticBody) - { - b->m_flags &= ~b2Body::e_islandFlag; - } - } - } - - m_stackAllocator.Free(stack); - - { - b2Timer timer; - // Synchronize fixtures, check for out of range bodies. - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - // If a body was not in an island then it did not move. - if ((b->m_flags & b2Body::e_islandFlag) == 0) - { - continue; - } - - if (b->GetType() == b2_staticBody) - { - continue; - } - - // Update fixtures (for broad-phase). - b->SynchronizeFixtures(); - } - - // Look for new contacts. - m_contactManager.FindNewContacts(); - m_profile.broadphase = timer.GetMilliseconds(); - } -} - -// Find TOI contacts and solve them. -void b2World::SolveTOI(const b2TimeStep& step) -{ - b2Island island(2 * b2_maxTOIContacts, b2_maxTOIContacts, 0, &m_stackAllocator, m_contactManager.m_contactListener); - - if (m_stepComplete) - { - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_flags &= ~b2Body::e_islandFlag; - b->m_sweep.alpha0 = 0.0f; - } - - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - // Invalidate TOI - c->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); - c->m_toiCount = 0; - c->m_toi = 1.0f; - } - } - - // Find TOI events and solve them. - for (;;) - { - // Find the first TOI. - b2Contact* minContact = NULL; - float32 minAlpha = 1.0f; - - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) - { - // Is this contact disabled? - if (c->IsEnabled() == false) - { - continue; - } - - // Prevent excessive sub-stepping. - if (c->m_toiCount > b2_maxSubSteps) - { - continue; - } - - float32 alpha = 1.0f; - if (c->m_flags & b2Contact::e_toiFlag) - { - // This contact has a valid cached TOI. - alpha = c->m_toi; - } - else - { - b2Fixture* fA = c->GetFixtureA(); - b2Fixture* fB = c->GetFixtureB(); - - // Is there a sensor? - if (fA->IsSensor() || fB->IsSensor()) - { - continue; - } - - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - b2BodyType typeA = bA->m_type; - b2BodyType typeB = bB->m_type; - b2Assert(typeA == b2_dynamicBody || typeB == b2_dynamicBody); - - bool activeA = bA->IsAwake() && typeA != b2_staticBody; - bool activeB = bB->IsAwake() && typeB != b2_staticBody; - - // Is at least one body active (awake and dynamic or kinematic)? - if (activeA == false && activeB == false) - { - continue; - } - - bool collideA = bA->IsBullet() || typeA != b2_dynamicBody; - bool collideB = bB->IsBullet() || typeB != b2_dynamicBody; - - // Are these two non-bullet dynamic bodies? - if (collideA == false && collideB == false) - { - continue; - } - - // Compute the TOI for this contact. - // Put the sweeps onto the same time interval. - float32 alpha0 = bA->m_sweep.alpha0; - - if (bA->m_sweep.alpha0 < bB->m_sweep.alpha0) - { - alpha0 = bB->m_sweep.alpha0; - bA->m_sweep.Advance(alpha0); - } - else if (bB->m_sweep.alpha0 < bA->m_sweep.alpha0) - { - alpha0 = bA->m_sweep.alpha0; - bB->m_sweep.Advance(alpha0); - } - - b2Assert(alpha0 < 1.0f); - - int32 indexA = c->GetChildIndexA(); - int32 indexB = c->GetChildIndexB(); - - // Compute the time of impact in interval [0, minTOI] - b2TOIInput input; - input.proxyA.Set(fA->GetShape(), indexA); - input.proxyB.Set(fB->GetShape(), indexB); - input.sweepA = bA->m_sweep; - input.sweepB = bB->m_sweep; - input.tMax = 1.0f; - - b2TOIOutput output; - b2TimeOfImpact(&output, &input); - - // Beta is the fraction of the remaining portion of the . - float32 beta = output.t; - if (output.state == b2TOIOutput::e_touching) - { - alpha = b2Min(alpha0 + (1.0f - alpha0) * beta, 1.0f); - } - else - { - alpha = 1.0f; - } - - c->m_toi = alpha; - c->m_flags |= b2Contact::e_toiFlag; - } - - if (alpha < minAlpha) - { - // This is the minimum TOI found so far. - minContact = c; - minAlpha = alpha; - } - } - - if (minContact == NULL || 1.0f - 10.0f * b2_epsilon < minAlpha) - { - // No more TOI events. Done! - m_stepComplete = true; - break; - } - - // Advance the bodies to the TOI. - b2Fixture* fA = minContact->GetFixtureA(); - b2Fixture* fB = minContact->GetFixtureB(); - b2Body* bA = fA->GetBody(); - b2Body* bB = fB->GetBody(); - - b2Sweep backup1 = bA->m_sweep; - b2Sweep backup2 = bB->m_sweep; - - bA->Advance(minAlpha); - bB->Advance(minAlpha); - - // The TOI contact likely has some new contact points. - minContact->Update(m_contactManager.m_contactListener); - minContact->m_flags &= ~b2Contact::e_toiFlag; - ++minContact->m_toiCount; - - // Is the contact solid? - if (minContact->IsEnabled() == false || minContact->IsTouching() == false) - { - // Restore the sweeps. - minContact->SetEnabled(false); - bA->m_sweep = backup1; - bB->m_sweep = backup2; - bA->SynchronizeTransform(); - bB->SynchronizeTransform(); - continue; - } - - bA->SetAwake(true); - bB->SetAwake(true); - - // Build the island - island.Clear(); - island.Add(bA); - island.Add(bB); - island.Add(minContact); - - bA->m_flags |= b2Body::e_islandFlag; - bB->m_flags |= b2Body::e_islandFlag; - minContact->m_flags |= b2Contact::e_islandFlag; - - // Get contacts on bodyA and bodyB. - b2Body* bodies[2] = {bA, bB}; - for (int32 i = 0; i < 2; ++i) - { - b2Body* body = bodies[i]; - if (body->m_type == b2_dynamicBody) - { - for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) - { - if (island.m_bodyCount == island.m_bodyCapacity) - { - break; - } - - if (island.m_contactCount == island.m_contactCapacity) - { - break; - } - - b2Contact* contact = ce->contact; - - // Has this contact already been added to the island? - if (contact->m_flags & b2Contact::e_islandFlag) - { - continue; - } - - // Only add static, kinematic, or bullet bodies. - b2Body* other = ce->other; - if (other->m_type == b2_dynamicBody && - body->IsBullet() == false && other->IsBullet() == false) - { - continue; - } - - // Skip sensors. - bool sensorA = contact->m_fixtureA->m_isSensor; - bool sensorB = contact->m_fixtureB->m_isSensor; - if (sensorA || sensorB) - { - continue; - } - - // Tentatively advance the body to the TOI. - b2Sweep backup = other->m_sweep; - if ((other->m_flags & b2Body::e_islandFlag) == 0) - { - other->Advance(minAlpha); - } - - // Update the contact points - contact->Update(m_contactManager.m_contactListener); - - // Was the contact disabled by the user? - if (contact->IsEnabled() == false) - { - other->m_sweep = backup; - other->SynchronizeTransform(); - continue; - } - - // Are there contact points? - if (contact->IsTouching() == false) - { - other->m_sweep = backup; - other->SynchronizeTransform(); - continue; - } - - // Add the contact to the island - contact->m_flags |= b2Contact::e_islandFlag; - island.Add(contact); - - // Has the other body already been added to the island? - if (other->m_flags & b2Body::e_islandFlag) - { - continue; - } - - // Add the other body to the island. - other->m_flags |= b2Body::e_islandFlag; - - if (other->m_type != b2_staticBody) - { - other->SetAwake(true); - } - - island.Add(other); - } - } - } - - b2TimeStep subStep; - subStep.dt = (1.0f - minAlpha) * step.dt; - subStep.inv_dt = 1.0f / subStep.dt; - subStep.dtRatio = 1.0f; - subStep.positionIterations = 20; - subStep.velocityIterations = step.velocityIterations; - subStep.warmStarting = false; - island.SolveTOI(subStep, bA->m_islandIndex, bB->m_islandIndex); - - // Reset island flags and synchronize broad-phase proxies. - for (int32 i = 0; i < island.m_bodyCount; ++i) - { - b2Body* body = island.m_bodies[i]; - body->m_flags &= ~b2Body::e_islandFlag; - - if (body->m_type != b2_dynamicBody) - { - continue; - } - - body->SynchronizeFixtures(); - - // Invalidate all contact TOIs on this displaced body. - for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) - { - ce->contact->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); - } - } - - // Commit fixture proxy movements to the broad-phase so that new contacts are created. - // Also, some contacts can be destroyed. - m_contactManager.FindNewContacts(); - - if (m_subStepping) - { - m_stepComplete = false; - break; - } - } -} - -void b2World::Step(float32 dt, int32 velocityIterations, int32 positionIterations) -{ - b2Timer stepTimer; - - // If new fixtures were added, we need to find the new contacts. - if (m_flags & e_newFixture) - { - m_contactManager.FindNewContacts(); - m_flags &= ~e_newFixture; - } - - m_flags |= e_locked; - - b2TimeStep step; - step.dt = dt; - step.velocityIterations = velocityIterations; - step.positionIterations = positionIterations; - if (dt > 0.0f) - { - step.inv_dt = 1.0f / dt; - } - else - { - step.inv_dt = 0.0f; - } - - step.dtRatio = m_inv_dt0 * dt; - - step.warmStarting = m_warmStarting; - - // Update contacts. This is where some contacts are destroyed. - { - b2Timer timer; - m_contactManager.Collide(); - m_profile.collide = timer.GetMilliseconds(); - } - - // Integrate velocities, solve velocity constraints, and integrate positions. - if (m_stepComplete && step.dt > 0.0f) - { - b2Timer timer; - Solve(step); - m_profile.solve = timer.GetMilliseconds(); - } - - // Handle TOI events. - if (m_continuousPhysics && step.dt > 0.0f) - { - b2Timer timer; - SolveTOI(step); - m_profile.solveTOI = timer.GetMilliseconds(); - } - - if (step.dt > 0.0f) - { - m_inv_dt0 = step.inv_dt; - } - - if (m_flags & e_clearForces) - { - ClearForces(); - } - - m_flags &= ~e_locked; - - m_profile.step = stepTimer.GetMilliseconds(); -} - -void b2World::ClearForces() -{ - for (b2Body* body = m_bodyList; body; body = body->GetNext()) - { - body->m_force.SetZero(); - body->m_torque = 0.0f; - } -} - -struct b2WorldQueryWrapper -{ - bool QueryCallback(int32 proxyId) - { - b2FixtureProxy* proxy = (b2FixtureProxy*)broadPhase->GetUserData(proxyId); - return callback->ReportFixture(proxy->fixture); - } - - const b2BroadPhase* broadPhase; - b2QueryCallback* callback; -}; - -void b2World::QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const -{ - b2WorldQueryWrapper wrapper; - wrapper.broadPhase = &m_contactManager.m_broadPhase; - wrapper.callback = callback; - m_contactManager.m_broadPhase.Query(&wrapper, aabb); -} - -struct b2WorldRayCastWrapper -{ - float32 RayCastCallback(const b2RayCastInput& input, int32 proxyId) - { - void* userData = broadPhase->GetUserData(proxyId); - b2FixtureProxy* proxy = (b2FixtureProxy*)userData; - b2Fixture* fixture = proxy->fixture; - int32 index = proxy->childIndex; - b2RayCastOutput output; - bool hit = fixture->RayCast(&output, input, index); - - if (hit) - { - float32 fraction = output.fraction; - b2Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2; - return callback->ReportFixture(fixture, point, output.normal, fraction); - } - - return input.maxFraction; - } - - const b2BroadPhase* broadPhase; - b2RayCastCallback* callback; -}; - -void b2World::RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const -{ - b2WorldRayCastWrapper wrapper; - wrapper.broadPhase = &m_contactManager.m_broadPhase; - wrapper.callback = callback; - b2RayCastInput input; - input.maxFraction = 1.0f; - input.p1 = point1; - input.p2 = point2; - m_contactManager.m_broadPhase.RayCast(&wrapper, input); -} - -void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color& color) -{ - switch (fixture->GetType()) - { - case b2Shape::e_circle: - { - b2CircleShape* circle = (b2CircleShape*)fixture->GetShape(); - - b2Vec2 center = b2Mul(xf, circle->m_p); - float32 radius = circle->m_radius; - b2Vec2 axis = b2Mul(xf.q, b2Vec2(1.0f, 0.0f)); - - m_debugDraw->DrawSolidCircle(center, radius, axis, color); - } - break; - - case b2Shape::e_edge: - { - b2EdgeShape* edge = (b2EdgeShape*)fixture->GetShape(); - b2Vec2 v1 = b2Mul(xf, edge->m_vertex1); - b2Vec2 v2 = b2Mul(xf, edge->m_vertex2); - m_debugDraw->DrawSegment(v1, v2, color); - } - break; - - case b2Shape::e_chain: - { - b2ChainShape* chain = (b2ChainShape*)fixture->GetShape(); - int32 count = chain->m_count; - const b2Vec2* vertices = chain->m_vertices; - - b2Vec2 v1 = b2Mul(xf, vertices[0]); - for (int32 i = 1; i < count; ++i) - { - b2Vec2 v2 = b2Mul(xf, vertices[i]); - m_debugDraw->DrawSegment(v1, v2, color); - m_debugDraw->DrawCircle(v1, 0.05f, color); - v1 = v2; - } - } - break; - - case b2Shape::e_polygon: - { - b2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape(); - int32 vertexCount = poly->m_vertexCount; - b2Assert(vertexCount <= b2_maxPolygonVertices); - b2Vec2 vertices[b2_maxPolygonVertices]; - - for (int32 i = 0; i < vertexCount; ++i) - { - vertices[i] = b2Mul(xf, poly->m_vertices[i]); - } - - m_debugDraw->DrawSolidPolygon(vertices, vertexCount, color); - } - break; - - default: - break; - } -} - -void b2World::DrawJoint(b2Joint* joint) -{ - b2Body* bodyA = joint->GetBodyA(); - b2Body* bodyB = joint->GetBodyB(); - const b2Transform& xf1 = bodyA->GetTransform(); - const b2Transform& xf2 = bodyB->GetTransform(); - b2Vec2 x1 = xf1.p; - b2Vec2 x2 = xf2.p; - b2Vec2 p1 = joint->GetAnchorA(); - b2Vec2 p2 = joint->GetAnchorB(); - - b2Color color(0.5f, 0.8f, 0.8f); - - switch (joint->GetType()) - { - case e_distanceJoint: - m_debugDraw->DrawSegment(p1, p2, color); - break; - - case e_pulleyJoint: - { - b2PulleyJoint* pulley = (b2PulleyJoint*)joint; - b2Vec2 s1 = pulley->GetGroundAnchorA(); - b2Vec2 s2 = pulley->GetGroundAnchorB(); - m_debugDraw->DrawSegment(s1, p1, color); - m_debugDraw->DrawSegment(s2, p2, color); - m_debugDraw->DrawSegment(s1, s2, color); - } - break; - - case e_mouseJoint: - // don't draw this - break; - - default: - m_debugDraw->DrawSegment(x1, p1, color); - m_debugDraw->DrawSegment(p1, p2, color); - m_debugDraw->DrawSegment(x2, p2, color); - } -} - -void b2World::DrawDebugData() -{ - if (m_debugDraw == NULL) - { - return; - } - - uint32 flags = m_debugDraw->GetFlags(); - - if (flags & b2Draw::e_shapeBit) - { - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - const b2Transform& xf = b->GetTransform(); - for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) - { - if (b->IsActive() == false) - { - DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.3f)); - } - else if (b->GetType() == b2_staticBody) - { - DrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f)); - } - else if (b->GetType() == b2_kinematicBody) - { - DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f)); - } - else if (b->IsAwake() == false) - { - DrawShape(f, xf, b2Color(0.6f, 0.6f, 0.6f)); - } - else - { - DrawShape(f, xf, b2Color(0.9f, 0.7f, 0.7f)); - } - } - } - } - - if (flags & b2Draw::e_jointBit) - { - for (b2Joint* j = m_jointList; j; j = j->GetNext()) - { - DrawJoint(j); - } - } - - if (flags & b2Draw::e_pairBit) - { - b2Color color(0.3f, 0.9f, 0.9f); - for (b2Contact* c = m_contactManager.m_contactList; c; c = c->GetNext()) - { - //b2Fixture* fixtureA = c->GetFixtureA(); - //b2Fixture* fixtureB = c->GetFixtureB(); - - //b2Vec2 cA = fixtureA->GetAABB().GetCenter(); - //b2Vec2 cB = fixtureB->GetAABB().GetCenter(); - - //m_debugDraw->DrawSegment(cA, cB, color); - } - } - - if (flags & b2Draw::e_aabbBit) - { - b2Color color(0.9f, 0.3f, 0.9f); - b2BroadPhase* bp = &m_contactManager.m_broadPhase; - - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - if (b->IsActive() == false) - { - continue; - } - - for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) - { - for (int32 i = 0; i < f->m_proxyCount; ++i) - { - b2FixtureProxy* proxy = f->m_proxies + i; - b2AABB aabb = bp->GetFatAABB(proxy->proxyId); - b2Vec2 vs[4]; - vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y); - vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y); - vs[2].Set(aabb.upperBound.x, aabb.upperBound.y); - vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y); - - m_debugDraw->DrawPolygon(vs, 4, color); - } - } - } - } - - if (flags & b2Draw::e_centerOfMassBit) - { - for (b2Body* b = m_bodyList; b; b = b->GetNext()) - { - b2Transform xf = b->GetTransform(); - xf.p = b->GetWorldCenter(); - m_debugDraw->DrawTransform(xf); - } - } -} - -int32 b2World::GetProxyCount() const -{ - return m_contactManager.m_broadPhase.GetProxyCount(); -} - -int32 b2World::GetTreeHeight() const -{ - return m_contactManager.m_broadPhase.GetTreeHeight(); -} - -int32 b2World::GetTreeBalance() const -{ - return m_contactManager.m_broadPhase.GetTreeBalance(); -} - -float32 b2World::GetTreeQuality() const -{ - return m_contactManager.m_broadPhase.GetTreeQuality(); -} - -void b2World::Dump() -{ - if ((m_flags & e_locked) == e_locked) - { - return; - } - - b2Log("b2Vec2 g(%.15lef, %.15lef);\n", m_gravity.x, m_gravity.y); - b2Log("m_world->SetGravity(g);\n"); - - b2Log("b2Body** bodies = (b2Body**)b2Alloc(%d * sizeof(b2Body*));\n", m_bodyCount); - b2Log("b2Joint** joints = (b2Joint**)b2Alloc(%d * sizeof(b2Joint*));\n", m_jointCount); - int32 i = 0; - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_islandIndex = i; - b->Dump(); - ++i; - } - - i = 0; - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - j->m_index = i; - ++i; - } - - // First pass on joints, skip gear joints. - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - if (j->m_type == e_gearJoint) - { - continue; - } - - b2Log("{\n"); - j->Dump(); - b2Log("}\n"); - } - - // Second pass on joints, only gear joints. - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - if (j->m_type != e_gearJoint) - { - continue; - } - - b2Log("{\n"); - j->Dump(); - b2Log("}\n"); - } - - b2Log("b2Free(joints);\n"); - b2Log("b2Free(bodies);\n"); - b2Log("joints = NULL;\n"); - b2Log("bodies = NULL;\n"); -} +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +b2World::b2World(const b2Vec2& gravity) +{ + m_destructionListener = NULL; + m_debugDraw = NULL; + + m_bodyList = NULL; + m_jointList = NULL; + + m_bodyCount = 0; + m_jointCount = 0; + + m_warmStarting = true; + m_continuousPhysics = true; + m_subStepping = false; + + m_stepComplete = true; + + m_allowSleep = true; + m_gravity = gravity; + + m_flags = e_clearForces; + + m_inv_dt0 = 0.0f; + + m_contactManager.m_allocator = &m_blockAllocator; + + memset(&m_profile, 0, sizeof(b2Profile)); +} + +b2World::~b2World() +{ + // Some shapes allocate using b2Alloc. + b2Body* b = m_bodyList; + while (b) + { + b2Body* bNext = b->m_next; + + b2Fixture* f = b->m_fixtureList; + while (f) + { + b2Fixture* fNext = f->m_next; + f->m_proxyCount = 0; + f->Destroy(&m_blockAllocator); + f = fNext; + } + + b = bNext; + } +} + +void b2World::SetDestructionListener(b2DestructionListener* listener) +{ + m_destructionListener = listener; +} + +void b2World::SetContactFilter(b2ContactFilter* filter) +{ + m_contactManager.m_contactFilter = filter; +} + +void b2World::SetContactListener(b2ContactListener* listener) +{ + m_contactManager.m_contactListener = listener; +} + +void b2World::SetDebugDraw(b2Draw* debugDraw) +{ + m_debugDraw = debugDraw; +} + +b2Body* b2World::CreateBody(const b2BodyDef* def) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return NULL; + } + + void* mem = m_blockAllocator.Allocate(sizeof(b2Body)); + b2Body* b = new (mem) b2Body(def, this); + + // Add to world doubly linked list. + b->m_prev = NULL; + b->m_next = m_bodyList; + if (m_bodyList) + { + m_bodyList->m_prev = b; + } + m_bodyList = b; + ++m_bodyCount; + + return b; +} + +void b2World::DestroyBody(b2Body* b) +{ + b2Assert(m_bodyCount > 0); + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return; + } + + // Delete the attached joints. + b2JointEdge* je = b->m_jointList; + while (je) + { + b2JointEdge* je0 = je; + je = je->next; + + if (m_destructionListener) + { + m_destructionListener->SayGoodbye(je0->joint); + } + + DestroyJoint(je0->joint); + + b->m_jointList = je; + } + b->m_jointList = NULL; + + // Delete the attached contacts. + b2ContactEdge* ce = b->m_contactList; + while (ce) + { + b2ContactEdge* ce0 = ce; + ce = ce->next; + m_contactManager.Destroy(ce0->contact); + } + b->m_contactList = NULL; + + // Delete the attached fixtures. This destroys broad-phase proxies. + b2Fixture* f = b->m_fixtureList; + while (f) + { + b2Fixture* f0 = f; + f = f->m_next; + + if (m_destructionListener) + { + m_destructionListener->SayGoodbye(f0); + } + + f0->DestroyProxies(&m_contactManager.m_broadPhase); + f0->Destroy(&m_blockAllocator); + f0->~b2Fixture(); + m_blockAllocator.Free(f0, sizeof(b2Fixture)); + + b->m_fixtureList = f; + b->m_fixtureCount -= 1; + } + b->m_fixtureList = NULL; + b->m_fixtureCount = 0; + + // Remove world body list. + if (b->m_prev) + { + b->m_prev->m_next = b->m_next; + } + + if (b->m_next) + { + b->m_next->m_prev = b->m_prev; + } + + if (b == m_bodyList) + { + m_bodyList = b->m_next; + } + + --m_bodyCount; + b->~b2Body(); + m_blockAllocator.Free(b, sizeof(b2Body)); +} + +b2Joint* b2World::CreateJoint(const b2JointDef* def) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return NULL; + } + + b2Joint* j = b2Joint::Create(def, &m_blockAllocator); + + // Connect to the world list. + j->m_prev = NULL; + j->m_next = m_jointList; + if (m_jointList) + { + m_jointList->m_prev = j; + } + m_jointList = j; + ++m_jointCount; + + // Connect to the bodies' doubly linked lists. + j->m_edgeA.joint = j; + j->m_edgeA.other = j->m_bodyB; + j->m_edgeA.prev = NULL; + j->m_edgeA.next = j->m_bodyA->m_jointList; + if (j->m_bodyA->m_jointList) j->m_bodyA->m_jointList->prev = &j->m_edgeA; + j->m_bodyA->m_jointList = &j->m_edgeA; + + j->m_edgeB.joint = j; + j->m_edgeB.other = j->m_bodyA; + j->m_edgeB.prev = NULL; + j->m_edgeB.next = j->m_bodyB->m_jointList; + if (j->m_bodyB->m_jointList) j->m_bodyB->m_jointList->prev = &j->m_edgeB; + j->m_bodyB->m_jointList = &j->m_edgeB; + + b2Body* bodyA = def->bodyA; + b2Body* bodyB = def->bodyB; + + // If the joint prevents collisions, then flag any contacts for filtering. + if (def->collideConnected == false) + { + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + // Flag the contact for filtering at the next time step (where either + // body is awake). + edge->contact->FlagForFiltering(); + } + + edge = edge->next; + } + } + + // Note: creating a joint doesn't wake the bodies. + + return j; +} + +void b2World::DestroyJoint(b2Joint* j) +{ + b2Assert(IsLocked() == false); + if (IsLocked()) + { + return; + } + + bool collideConnected = j->m_collideConnected; + + // Remove from the doubly linked list. + if (j->m_prev) + { + j->m_prev->m_next = j->m_next; + } + + if (j->m_next) + { + j->m_next->m_prev = j->m_prev; + } + + if (j == m_jointList) + { + m_jointList = j->m_next; + } + + // Disconnect from island graph. + b2Body* bodyA = j->m_bodyA; + b2Body* bodyB = j->m_bodyB; + + // Wake up connected bodies. + bodyA->SetAwake(true); + bodyB->SetAwake(true); + + // Remove from body 1. + if (j->m_edgeA.prev) + { + j->m_edgeA.prev->next = j->m_edgeA.next; + } + + if (j->m_edgeA.next) + { + j->m_edgeA.next->prev = j->m_edgeA.prev; + } + + if (&j->m_edgeA == bodyA->m_jointList) + { + bodyA->m_jointList = j->m_edgeA.next; + } + + j->m_edgeA.prev = NULL; + j->m_edgeA.next = NULL; + + // Remove from body 2 + if (j->m_edgeB.prev) + { + j->m_edgeB.prev->next = j->m_edgeB.next; + } + + if (j->m_edgeB.next) + { + j->m_edgeB.next->prev = j->m_edgeB.prev; + } + + if (&j->m_edgeB == bodyB->m_jointList) + { + bodyB->m_jointList = j->m_edgeB.next; + } + + j->m_edgeB.prev = NULL; + j->m_edgeB.next = NULL; + + b2Joint::Destroy(j, &m_blockAllocator); + + b2Assert(m_jointCount > 0); + --m_jointCount; + + // If the joint prevents collisions, then flag any contacts for filtering. + if (collideConnected == false) + { + b2ContactEdge* edge = bodyB->GetContactList(); + while (edge) + { + if (edge->other == bodyA) + { + // Flag the contact for filtering at the next time step (where either + // body is awake). + edge->contact->FlagForFiltering(); + } + + edge = edge->next; + } + } +} + +// +void b2World::SetAllowSleeping(bool flag) +{ + if (flag == m_allowSleep) + { + return; + } + + m_allowSleep = flag; + if (m_allowSleep == false) + { + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->SetAwake(true); + } + } +} + +// Find islands, integrate and solve constraints, solve position constraints +void b2World::Solve(const b2TimeStep& step) +{ + m_profile.solveInit = 0.0f; + m_profile.solveVelocity = 0.0f; + m_profile.solvePosition = 0.0f; + + // Size the island for the worst case. + b2Island island(m_bodyCount, + m_contactManager.m_contactCount, + m_jointCount, + &m_stackAllocator, + m_contactManager.m_contactListener); + + // Clear all the island flags. + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_flags &= ~b2Body::e_islandFlag; + } + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + c->m_flags &= ~b2Contact::e_islandFlag; + } + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + j->m_islandFlag = false; + } + + // Build and simulate all awake islands. + int32 stackSize = m_bodyCount; + b2Body** stack = (b2Body**)m_stackAllocator.Allocate(stackSize * sizeof(b2Body*)); + for (b2Body* seed = m_bodyList; seed; seed = seed->m_next) + { + if (seed->m_flags & b2Body::e_islandFlag) + { + continue; + } + + if (seed->IsAwake() == false || seed->IsActive() == false) + { + continue; + } + + // The seed can be dynamic or kinematic. + if (seed->GetType() == b2_staticBody) + { + continue; + } + + // Reset island and stack. + island.Clear(); + int32 stackCount = 0; + stack[stackCount++] = seed; + seed->m_flags |= b2Body::e_islandFlag; + + // Perform a depth first search (DFS) on the constraint graph. + while (stackCount > 0) + { + // Grab the next body off the stack and add it to the island. + b2Body* b = stack[--stackCount]; + b2Assert(b->IsActive() == true); + island.Add(b); + + // Make sure the body is awake. + b->SetAwake(true); + + // To keep islands as small as possible, we don't + // propagate islands across static bodies. + if (b->GetType() == b2_staticBody) + { + continue; + } + + // Search all contacts connected to this body. + for (b2ContactEdge* ce = b->m_contactList; ce; ce = ce->next) + { + b2Contact* contact = ce->contact; + + // Has this contact already been added to an island? + if (contact->m_flags & b2Contact::e_islandFlag) + { + continue; + } + + // Is this contact solid and touching? + if (contact->IsEnabled() == false || + contact->IsTouching() == false) + { + continue; + } + + // Skip sensors. + bool sensorA = contact->m_fixtureA->m_isSensor; + bool sensorB = contact->m_fixtureB->m_isSensor; + if (sensorA || sensorB) + { + continue; + } + + island.Add(contact); + contact->m_flags |= b2Contact::e_islandFlag; + + b2Body* other = ce->other; + + // Was the other body already added to this island? + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + b2Assert(stackCount < stackSize); + stack[stackCount++] = other; + other->m_flags |= b2Body::e_islandFlag; + } + + // Search all joints connect to this body. + for (b2JointEdge* je = b->m_jointList; je; je = je->next) + { + if (je->joint->m_islandFlag == true) + { + continue; + } + + b2Body* other = je->other; + + // Don't simulate joints connected to inactive bodies. + if (other->IsActive() == false) + { + continue; + } + + island.Add(je->joint); + je->joint->m_islandFlag = true; + + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + b2Assert(stackCount < stackSize); + stack[stackCount++] = other; + other->m_flags |= b2Body::e_islandFlag; + } + } + + b2Profile profile; + island.Solve(&profile, step, m_gravity, m_allowSleep); + m_profile.solveInit += profile.solveInit; + m_profile.solveVelocity += profile.solveVelocity; + m_profile.solvePosition += profile.solvePosition; + + // Post solve cleanup. + for (int32 i = 0; i < island.m_bodyCount; ++i) + { + // Allow static bodies to participate in other islands. + b2Body* b = island.m_bodies[i]; + if (b->GetType() == b2_staticBody) + { + b->m_flags &= ~b2Body::e_islandFlag; + } + } + } + + m_stackAllocator.Free(stack); + + { + b2Timer timer; + // Synchronize fixtures, check for out of range bodies. + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + // If a body was not in an island then it did not move. + if ((b->m_flags & b2Body::e_islandFlag) == 0) + { + continue; + } + + if (b->GetType() == b2_staticBody) + { + continue; + } + + // Update fixtures (for broad-phase). + b->SynchronizeFixtures(); + } + + // Look for new contacts. + m_contactManager.FindNewContacts(); + m_profile.broadphase = timer.GetMilliseconds(); + } +} + +// Find TOI contacts and solve them. +void b2World::SolveTOI(const b2TimeStep& step) +{ + b2Island island(2 * b2_maxTOIContacts, b2_maxTOIContacts, 0, &m_stackAllocator, m_contactManager.m_contactListener); + + if (m_stepComplete) + { + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_flags &= ~b2Body::e_islandFlag; + b->m_sweep.alpha0 = 0.0f; + } + + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + // Invalidate TOI + c->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); + c->m_toiCount = 0; + c->m_toi = 1.0f; + } + } + + // Find TOI events and solve them. + for (;;) + { + // Find the first TOI. + b2Contact* minContact = NULL; + float32 minAlpha = 1.0f; + + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next) + { + // Is this contact disabled? + if (c->IsEnabled() == false) + { + continue; + } + + // Prevent excessive sub-stepping. + if (c->m_toiCount > b2_maxSubSteps) + { + continue; + } + + float32 alpha = 1.0f; + if (c->m_flags & b2Contact::e_toiFlag) + { + // This contact has a valid cached TOI. + alpha = c->m_toi; + } + else + { + b2Fixture* fA = c->GetFixtureA(); + b2Fixture* fB = c->GetFixtureB(); + + // Is there a sensor? + if (fA->IsSensor() || fB->IsSensor()) + { + continue; + } + + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + b2BodyType typeA = bA->m_type; + b2BodyType typeB = bB->m_type; + b2Assert(typeA == b2_dynamicBody || typeB == b2_dynamicBody); + + bool activeA = bA->IsAwake() && typeA != b2_staticBody; + bool activeB = bB->IsAwake() && typeB != b2_staticBody; + + // Is at least one body active (awake and dynamic or kinematic)? + if (activeA == false && activeB == false) + { + continue; + } + + bool collideA = bA->IsBullet() || typeA != b2_dynamicBody; + bool collideB = bB->IsBullet() || typeB != b2_dynamicBody; + + // Are these two non-bullet dynamic bodies? + if (collideA == false && collideB == false) + { + continue; + } + + // Compute the TOI for this contact. + // Put the sweeps onto the same time interval. + float32 alpha0 = bA->m_sweep.alpha0; + + if (bA->m_sweep.alpha0 < bB->m_sweep.alpha0) + { + alpha0 = bB->m_sweep.alpha0; + bA->m_sweep.Advance(alpha0); + } + else if (bB->m_sweep.alpha0 < bA->m_sweep.alpha0) + { + alpha0 = bA->m_sweep.alpha0; + bB->m_sweep.Advance(alpha0); + } + + b2Assert(alpha0 < 1.0f); + + int32 indexA = c->GetChildIndexA(); + int32 indexB = c->GetChildIndexB(); + + // Compute the time of impact in interval [0, minTOI] + b2TOIInput input; + input.proxyA.Set(fA->GetShape(), indexA); + input.proxyB.Set(fB->GetShape(), indexB); + input.sweepA = bA->m_sweep; + input.sweepB = bB->m_sweep; + input.tMax = 1.0f; + + b2TOIOutput output; + b2TimeOfImpact(&output, &input); + + // Beta is the fraction of the remaining portion of the . + float32 beta = output.t; + if (output.state == b2TOIOutput::e_touching) + { + alpha = b2Min(alpha0 + (1.0f - alpha0) * beta, 1.0f); + } + else + { + alpha = 1.0f; + } + + c->m_toi = alpha; + c->m_flags |= b2Contact::e_toiFlag; + } + + if (alpha < minAlpha) + { + // This is the minimum TOI found so far. + minContact = c; + minAlpha = alpha; + } + } + + if (minContact == NULL || 1.0f - 10.0f * b2_epsilon < minAlpha) + { + // No more TOI events. Done! + m_stepComplete = true; + break; + } + + // Advance the bodies to the TOI. + b2Fixture* fA = minContact->GetFixtureA(); + b2Fixture* fB = minContact->GetFixtureB(); + b2Body* bA = fA->GetBody(); + b2Body* bB = fB->GetBody(); + + b2Sweep backup1 = bA->m_sweep; + b2Sweep backup2 = bB->m_sweep; + + bA->Advance(minAlpha); + bB->Advance(minAlpha); + + // The TOI contact likely has some new contact points. + minContact->Update(m_contactManager.m_contactListener); + minContact->m_flags &= ~b2Contact::e_toiFlag; + ++minContact->m_toiCount; + + // Is the contact solid? + if (minContact->IsEnabled() == false || minContact->IsTouching() == false) + { + // Restore the sweeps. + minContact->SetEnabled(false); + bA->m_sweep = backup1; + bB->m_sweep = backup2; + bA->SynchronizeTransform(); + bB->SynchronizeTransform(); + continue; + } + + bA->SetAwake(true); + bB->SetAwake(true); + + // Build the island + island.Clear(); + island.Add(bA); + island.Add(bB); + island.Add(minContact); + + bA->m_flags |= b2Body::e_islandFlag; + bB->m_flags |= b2Body::e_islandFlag; + minContact->m_flags |= b2Contact::e_islandFlag; + + // Get contacts on bodyA and bodyB. + b2Body* bodies[2] = {bA, bB}; + for (int32 i = 0; i < 2; ++i) + { + b2Body* body = bodies[i]; + if (body->m_type == b2_dynamicBody) + { + for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) + { + if (island.m_bodyCount == island.m_bodyCapacity) + { + break; + } + + if (island.m_contactCount == island.m_contactCapacity) + { + break; + } + + b2Contact* contact = ce->contact; + + // Has this contact already been added to the island? + if (contact->m_flags & b2Contact::e_islandFlag) + { + continue; + } + + // Only add static, kinematic, or bullet bodies. + b2Body* other = ce->other; + if (other->m_type == b2_dynamicBody && + body->IsBullet() == false && other->IsBullet() == false) + { + continue; + } + + // Skip sensors. + bool sensorA = contact->m_fixtureA->m_isSensor; + bool sensorB = contact->m_fixtureB->m_isSensor; + if (sensorA || sensorB) + { + continue; + } + + // Tentatively advance the body to the TOI. + b2Sweep backup = other->m_sweep; + if ((other->m_flags & b2Body::e_islandFlag) == 0) + { + other->Advance(minAlpha); + } + + // Update the contact points + contact->Update(m_contactManager.m_contactListener); + + // Was the contact disabled by the user? + if (contact->IsEnabled() == false) + { + other->m_sweep = backup; + other->SynchronizeTransform(); + continue; + } + + // Are there contact points? + if (contact->IsTouching() == false) + { + other->m_sweep = backup; + other->SynchronizeTransform(); + continue; + } + + // Add the contact to the island + contact->m_flags |= b2Contact::e_islandFlag; + island.Add(contact); + + // Has the other body already been added to the island? + if (other->m_flags & b2Body::e_islandFlag) + { + continue; + } + + // Add the other body to the island. + other->m_flags |= b2Body::e_islandFlag; + + if (other->m_type != b2_staticBody) + { + other->SetAwake(true); + } + + island.Add(other); + } + } + } + + b2TimeStep subStep; + subStep.dt = (1.0f - minAlpha) * step.dt; + subStep.inv_dt = 1.0f / subStep.dt; + subStep.dtRatio = 1.0f; + subStep.positionIterations = 20; + subStep.velocityIterations = step.velocityIterations; + subStep.warmStarting = false; + island.SolveTOI(subStep, bA->m_islandIndex, bB->m_islandIndex); + + // Reset island flags and synchronize broad-phase proxies. + for (int32 i = 0; i < island.m_bodyCount; ++i) + { + b2Body* body = island.m_bodies[i]; + body->m_flags &= ~b2Body::e_islandFlag; + + if (body->m_type != b2_dynamicBody) + { + continue; + } + + body->SynchronizeFixtures(); + + // Invalidate all contact TOIs on this displaced body. + for (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next) + { + ce->contact->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag); + } + } + + // Commit fixture proxy movements to the broad-phase so that new contacts are created. + // Also, some contacts can be destroyed. + m_contactManager.FindNewContacts(); + + if (m_subStepping) + { + m_stepComplete = false; + break; + } + } +} + +void b2World::Step(float32 dt, int32 velocityIterations, int32 positionIterations) +{ + b2Timer stepTimer; + + // If new fixtures were added, we need to find the new contacts. + if (m_flags & e_newFixture) + { + m_contactManager.FindNewContacts(); + m_flags &= ~e_newFixture; + } + + m_flags |= e_locked; + + b2TimeStep step; + step.dt = dt; + step.velocityIterations = velocityIterations; + step.positionIterations = positionIterations; + if (dt > 0.0f) + { + step.inv_dt = 1.0f / dt; + } + else + { + step.inv_dt = 0.0f; + } + + step.dtRatio = m_inv_dt0 * dt; + + step.warmStarting = m_warmStarting; + + // Update contacts. This is where some contacts are destroyed. + { + b2Timer timer; + m_contactManager.Collide(); + m_profile.collide = timer.GetMilliseconds(); + } + + // Integrate velocities, solve velocity constraints, and integrate positions. + if (m_stepComplete && step.dt > 0.0f) + { + b2Timer timer; + Solve(step); + m_profile.solve = timer.GetMilliseconds(); + } + + // Handle TOI events. + if (m_continuousPhysics && step.dt > 0.0f) + { + b2Timer timer; + SolveTOI(step); + m_profile.solveTOI = timer.GetMilliseconds(); + } + + if (step.dt > 0.0f) + { + m_inv_dt0 = step.inv_dt; + } + + if (m_flags & e_clearForces) + { + ClearForces(); + } + + m_flags &= ~e_locked; + + m_profile.step = stepTimer.GetMilliseconds(); +} + +void b2World::ClearForces() +{ + for (b2Body* body = m_bodyList; body; body = body->GetNext()) + { + body->m_force.SetZero(); + body->m_torque = 0.0f; + } +} + +struct b2WorldQueryWrapper +{ + bool QueryCallback(int32 proxyId) + { + b2FixtureProxy* proxy = (b2FixtureProxy*)broadPhase->GetUserData(proxyId); + return callback->ReportFixture(proxy->fixture); + } + + const b2BroadPhase* broadPhase; + b2QueryCallback* callback; +}; + +void b2World::QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const +{ + b2WorldQueryWrapper wrapper; + wrapper.broadPhase = &m_contactManager.m_broadPhase; + wrapper.callback = callback; + m_contactManager.m_broadPhase.Query(&wrapper, aabb); +} + +struct b2WorldRayCastWrapper +{ + float32 RayCastCallback(const b2RayCastInput& input, int32 proxyId) + { + void* userData = broadPhase->GetUserData(proxyId); + b2FixtureProxy* proxy = (b2FixtureProxy*)userData; + b2Fixture* fixture = proxy->fixture; + int32 index = proxy->childIndex; + b2RayCastOutput output; + bool hit = fixture->RayCast(&output, input, index); + + if (hit) + { + float32 fraction = output.fraction; + b2Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2; + return callback->ReportFixture(fixture, point, output.normal, fraction); + } + + return input.maxFraction; + } + + const b2BroadPhase* broadPhase; + b2RayCastCallback* callback; +}; + +void b2World::RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const +{ + b2WorldRayCastWrapper wrapper; + wrapper.broadPhase = &m_contactManager.m_broadPhase; + wrapper.callback = callback; + b2RayCastInput input; + input.maxFraction = 1.0f; + input.p1 = point1; + input.p2 = point2; + m_contactManager.m_broadPhase.RayCast(&wrapper, input); +} + +void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color& color) +{ + switch (fixture->GetType()) + { + case b2Shape::e_circle: + { + b2CircleShape* circle = (b2CircleShape*)fixture->GetShape(); + + b2Vec2 center = b2Mul(xf, circle->m_p); + float32 radius = circle->m_radius; + b2Vec2 axis = b2Mul(xf.q, b2Vec2(1.0f, 0.0f)); + + m_debugDraw->DrawSolidCircle(center, radius, axis, color); + } + break; + + case b2Shape::e_edge: + { + b2EdgeShape* edge = (b2EdgeShape*)fixture->GetShape(); + b2Vec2 v1 = b2Mul(xf, edge->m_vertex1); + b2Vec2 v2 = b2Mul(xf, edge->m_vertex2); + m_debugDraw->DrawSegment(v1, v2, color); + } + break; + + case b2Shape::e_chain: + { + b2ChainShape* chain = (b2ChainShape*)fixture->GetShape(); + int32 count = chain->m_count; + const b2Vec2* vertices = chain->m_vertices; + + b2Vec2 v1 = b2Mul(xf, vertices[0]); + for (int32 i = 1; i < count; ++i) + { + b2Vec2 v2 = b2Mul(xf, vertices[i]); + m_debugDraw->DrawSegment(v1, v2, color); + m_debugDraw->DrawCircle(v1, 0.05f, color); + v1 = v2; + } + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape(); + int32 vertexCount = poly->m_vertexCount; + b2Assert(vertexCount <= b2_maxPolygonVertices); + b2Vec2 vertices[b2_maxPolygonVertices]; + + for (int32 i = 0; i < vertexCount; ++i) + { + vertices[i] = b2Mul(xf, poly->m_vertices[i]); + } + + m_debugDraw->DrawSolidPolygon(vertices, vertexCount, color); + } + break; + + default: + break; + } +} + +void b2World::DrawJoint(b2Joint* joint) +{ + b2Body* bodyA = joint->GetBodyA(); + b2Body* bodyB = joint->GetBodyB(); + const b2Transform& xf1 = bodyA->GetTransform(); + const b2Transform& xf2 = bodyB->GetTransform(); + b2Vec2 x1 = xf1.p; + b2Vec2 x2 = xf2.p; + b2Vec2 p1 = joint->GetAnchorA(); + b2Vec2 p2 = joint->GetAnchorB(); + + b2Color color(0.5f, 0.8f, 0.8f); + + switch (joint->GetType()) + { + case e_distanceJoint: + m_debugDraw->DrawSegment(p1, p2, color); + break; + + case e_pulleyJoint: + { + b2PulleyJoint* pulley = (b2PulleyJoint*)joint; + b2Vec2 s1 = pulley->GetGroundAnchorA(); + b2Vec2 s2 = pulley->GetGroundAnchorB(); + m_debugDraw->DrawSegment(s1, p1, color); + m_debugDraw->DrawSegment(s2, p2, color); + m_debugDraw->DrawSegment(s1, s2, color); + } + break; + + case e_mouseJoint: + // don't draw this + break; + + default: + m_debugDraw->DrawSegment(x1, p1, color); + m_debugDraw->DrawSegment(p1, p2, color); + m_debugDraw->DrawSegment(x2, p2, color); + } +} + +void b2World::DrawDebugData() +{ + if (m_debugDraw == NULL) + { + return; + } + + uint32 flags = m_debugDraw->GetFlags(); + + if (flags & b2Draw::e_shapeBit) + { + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + const b2Transform& xf = b->GetTransform(); + for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) + { + if (b->IsActive() == false) + { + DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.3f)); + } + else if (b->GetType() == b2_staticBody) + { + DrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f)); + } + else if (b->GetType() == b2_kinematicBody) + { + DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f)); + } + else if (b->IsAwake() == false) + { + DrawShape(f, xf, b2Color(0.6f, 0.6f, 0.6f)); + } + else + { + DrawShape(f, xf, b2Color(0.9f, 0.7f, 0.7f)); + } + } + } + } + + if (flags & b2Draw::e_jointBit) + { + for (b2Joint* j = m_jointList; j; j = j->GetNext()) + { + DrawJoint(j); + } + } + + if (flags & b2Draw::e_pairBit) + { + b2Color color(0.3f, 0.9f, 0.9f); + for (b2Contact* c = m_contactManager.m_contactList; c; c = c->GetNext()) + { + //b2Fixture* fixtureA = c->GetFixtureA(); + //b2Fixture* fixtureB = c->GetFixtureB(); + + //b2Vec2 cA = fixtureA->GetAABB().GetCenter(); + //b2Vec2 cB = fixtureB->GetAABB().GetCenter(); + + //m_debugDraw->DrawSegment(cA, cB, color); + } + } + + if (flags & b2Draw::e_aabbBit) + { + b2Color color(0.9f, 0.3f, 0.9f); + b2BroadPhase* bp = &m_contactManager.m_broadPhase; + + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + if (b->IsActive() == false) + { + continue; + } + + for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext()) + { + for (int32 i = 0; i < f->m_proxyCount; ++i) + { + b2FixtureProxy* proxy = f->m_proxies + i; + b2AABB aabb = bp->GetFatAABB(proxy->proxyId); + b2Vec2 vs[4]; + vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y); + vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y); + vs[2].Set(aabb.upperBound.x, aabb.upperBound.y); + vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y); + + m_debugDraw->DrawPolygon(vs, 4, color); + } + } + } + } + + if (flags & b2Draw::e_centerOfMassBit) + { + for (b2Body* b = m_bodyList; b; b = b->GetNext()) + { + b2Transform xf = b->GetTransform(); + xf.p = b->GetWorldCenter(); + m_debugDraw->DrawTransform(xf); + } + } +} + +int32 b2World::GetProxyCount() const +{ + return m_contactManager.m_broadPhase.GetProxyCount(); +} + +int32 b2World::GetTreeHeight() const +{ + return m_contactManager.m_broadPhase.GetTreeHeight(); +} + +int32 b2World::GetTreeBalance() const +{ + return m_contactManager.m_broadPhase.GetTreeBalance(); +} + +float32 b2World::GetTreeQuality() const +{ + return m_contactManager.m_broadPhase.GetTreeQuality(); +} + +void b2World::Dump() +{ + if ((m_flags & e_locked) == e_locked) + { + return; + } + + b2Log("b2Vec2 g(%.15lef, %.15lef);\n", m_gravity.x, m_gravity.y); + b2Log("m_world->SetGravity(g);\n"); + + b2Log("b2Body** bodies = (b2Body**)b2Alloc(%d * sizeof(b2Body*));\n", m_bodyCount); + b2Log("b2Joint** joints = (b2Joint**)b2Alloc(%d * sizeof(b2Joint*));\n", m_jointCount); + int32 i = 0; + for (b2Body* b = m_bodyList; b; b = b->m_next) + { + b->m_islandIndex = i; + b->Dump(); + ++i; + } + + i = 0; + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + j->m_index = i; + ++i; + } + + // First pass on joints, skip gear joints. + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + if (j->m_type == e_gearJoint) + { + continue; + } + + b2Log("{\n"); + j->Dump(); + b2Log("}\n"); + } + + // Second pass on joints, only gear joints. + for (b2Joint* j = m_jointList; j; j = j->m_next) + { + if (j->m_type != e_gearJoint) + { + continue; + } + + b2Log("{\n"); + j->Dump(); + b2Log("}\n"); + } + + b2Log("b2Free(joints);\n"); + b2Log("b2Free(bodies);\n"); + b2Log("joints = NULL;\n"); + b2Log("bodies = NULL;\n"); +} diff --git a/src/libraries/Box2D/Dynamics/b2WorldCallbacks.cpp b/src/libraries/Box2D/Dynamics/b2WorldCallbacks.cpp index 82b28cc05..0f4b9c53c 100755 --- a/src/libraries/Box2D/Dynamics/b2WorldCallbacks.cpp +++ b/src/libraries/Box2D/Dynamics/b2WorldCallbacks.cpp @@ -1,36 +1,36 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -// Return true if contact calculations should be performed between these two shapes. -// If you implement your own collision filter you may want to build from this implementation. -bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB) -{ - const b2Filter& filterA = fixtureA->GetFilterData(); - const b2Filter& filterB = fixtureB->GetFilterData(); - - if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) - { - return filterA.groupIndex > 0; - } - - bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; - return collide; -} +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +// Return true if contact calculations should be performed between these two shapes. +// If you implement your own collision filter you may want to build from this implementation. +bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB) +{ + const b2Filter& filterA = fixtureA->GetFilterData(); + const b2Filter& filterB = fixtureB->GetFilterData(); + + if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) + { + return filterA.groupIndex > 0; + } + + bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; + return collide; +} diff --git a/src/libraries/Box2D/Dynamics/b2WorldCallbacks.h b/src/libraries/Box2D/Dynamics/b2WorldCallbacks.h index 9b937e81f..82ffc0229 100755 --- a/src/libraries/Box2D/Dynamics/b2WorldCallbacks.h +++ b/src/libraries/Box2D/Dynamics/b2WorldCallbacks.h @@ -1,155 +1,155 @@ -/* -* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_WORLD_CALLBACKS_H -#define B2_WORLD_CALLBACKS_H - -#include - -struct b2Vec2; -struct b2Transform; -class b2Fixture; -class b2Body; -class b2Joint; -class b2Contact; -struct b2ContactResult; -struct b2Manifold; - -/// Joints and fixtures are destroyed when their associated -/// body is destroyed. Implement this listener so that you -/// may nullify references to these joints and shapes. -class b2DestructionListener -{ -public: - virtual ~b2DestructionListener() {} - - /// Called when any joint is about to be destroyed due - /// to the destruction of one of its attached bodies. - virtual void SayGoodbye(b2Joint* joint) = 0; - - /// Called when any fixture is about to be destroyed due - /// to the destruction of its parent body. - virtual void SayGoodbye(b2Fixture* fixture) = 0; -}; - -/// Implement this class to provide collision filtering. In other words, you can implement -/// this class if you want finer control over contact creation. -class b2ContactFilter -{ -public: - virtual ~b2ContactFilter() {} - - /// Return true if contact calculations should be performed between these two shapes. - /// @warning for performance reasons this is only called when the AABBs begin to overlap. - virtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB); -}; - -/// Contact impulses for reporting. Impulses are used instead of forces because -/// sub-step forces may approach infinity for rigid body collisions. These -/// match up one-to-one with the contact points in b2Manifold. -struct b2ContactImpulse -{ - float32 normalImpulses[b2_maxManifoldPoints]; - float32 tangentImpulses[b2_maxManifoldPoints]; - int32 count; -}; - -/// Implement this class to get contact information. You can use these results for -/// things like sounds and game logic. You can also get contact results by -/// traversing the contact lists after the time step. However, you might miss -/// some contacts because continuous physics leads to sub-stepping. -/// Additionally you may receive multiple callbacks for the same contact in a -/// single time step. -/// You should strive to make your callbacks efficient because there may be -/// many callbacks per time step. -/// @warning You cannot create/destroy Box2D entities inside these callbacks. -class b2ContactListener -{ -public: - virtual ~b2ContactListener() {} - - /// Called when two fixtures begin to touch. - virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); } - - /// Called when two fixtures cease to touch. - virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); } - - /// This is called after a contact is updated. This allows you to inspect a - /// contact before it goes to the solver. If you are careful, you can modify the - /// contact manifold (e.g. disable contact). - /// A copy of the old manifold is provided so that you can detect changes. - /// Note: this is called only for awake bodies. - /// Note: this is called even when the number of contact points is zero. - /// Note: this is not called for sensors. - /// Note: if you set the number of contact points to zero, you will not - /// get an EndContact callback. However, you may get a BeginContact callback - /// the next step. - virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) - { - B2_NOT_USED(contact); - B2_NOT_USED(oldManifold); - } - - /// This lets you inspect a contact after the solver is finished. This is useful - /// for inspecting impulses. - /// Note: the contact manifold does not include time of impact impulses, which can be - /// arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly - /// in a separate data structure. - /// Note: this is only called for contacts that are touching, solid, and awake. - virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) - { - B2_NOT_USED(contact); - B2_NOT_USED(impulse); - } -}; - -/// Callback class for AABB queries. -/// See b2World::Query -class b2QueryCallback -{ -public: - virtual ~b2QueryCallback() {} - - /// Called for each fixture found in the query AABB. - /// @return false to terminate the query. - virtual bool ReportFixture(b2Fixture* fixture) = 0; -}; - -/// Callback class for ray casts. -/// See b2World::RayCast -class b2RayCastCallback -{ -public: - virtual ~b2RayCastCallback() {} - - /// Called for each fixture found in the query. You control how the ray cast - /// proceeds by returning a float: - /// return -1: ignore this fixture and continue - /// return 0: terminate the ray cast - /// return fraction: clip the ray to this point - /// return 1: don't clip the ray and continue - /// @param fixture the fixture hit by the ray - /// @param point the point of initial intersection - /// @param normal the normal vector at the point of intersection - /// @return -1 to filter, 0 to terminate, fraction to clip the ray for - /// closest hit, 1 to continue - virtual float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, - const b2Vec2& normal, float32 fraction) = 0; -}; - -#endif +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WORLD_CALLBACKS_H +#define B2_WORLD_CALLBACKS_H + +#include + +struct b2Vec2; +struct b2Transform; +class b2Fixture; +class b2Body; +class b2Joint; +class b2Contact; +struct b2ContactResult; +struct b2Manifold; + +/// Joints and fixtures are destroyed when their associated +/// body is destroyed. Implement this listener so that you +/// may nullify references to these joints and shapes. +class b2DestructionListener +{ +public: + virtual ~b2DestructionListener() {} + + /// Called when any joint is about to be destroyed due + /// to the destruction of one of its attached bodies. + virtual void SayGoodbye(b2Joint* joint) = 0; + + /// Called when any fixture is about to be destroyed due + /// to the destruction of its parent body. + virtual void SayGoodbye(b2Fixture* fixture) = 0; +}; + +/// Implement this class to provide collision filtering. In other words, you can implement +/// this class if you want finer control over contact creation. +class b2ContactFilter +{ +public: + virtual ~b2ContactFilter() {} + + /// Return true if contact calculations should be performed between these two shapes. + /// @warning for performance reasons this is only called when the AABBs begin to overlap. + virtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB); +}; + +/// Contact impulses for reporting. Impulses are used instead of forces because +/// sub-step forces may approach infinity for rigid body collisions. These +/// match up one-to-one with the contact points in b2Manifold. +struct b2ContactImpulse +{ + float32 normalImpulses[b2_maxManifoldPoints]; + float32 tangentImpulses[b2_maxManifoldPoints]; + int32 count; +}; + +/// Implement this class to get contact information. You can use these results for +/// things like sounds and game logic. You can also get contact results by +/// traversing the contact lists after the time step. However, you might miss +/// some contacts because continuous physics leads to sub-stepping. +/// Additionally you may receive multiple callbacks for the same contact in a +/// single time step. +/// You should strive to make your callbacks efficient because there may be +/// many callbacks per time step. +/// @warning You cannot create/destroy Box2D entities inside these callbacks. +class b2ContactListener +{ +public: + virtual ~b2ContactListener() {} + + /// Called when two fixtures begin to touch. + virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); } + + /// Called when two fixtures cease to touch. + virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); } + + /// This is called after a contact is updated. This allows you to inspect a + /// contact before it goes to the solver. If you are careful, you can modify the + /// contact manifold (e.g. disable contact). + /// A copy of the old manifold is provided so that you can detect changes. + /// Note: this is called only for awake bodies. + /// Note: this is called even when the number of contact points is zero. + /// Note: this is not called for sensors. + /// Note: if you set the number of contact points to zero, you will not + /// get an EndContact callback. However, you may get a BeginContact callback + /// the next step. + virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) + { + B2_NOT_USED(contact); + B2_NOT_USED(oldManifold); + } + + /// This lets you inspect a contact after the solver is finished. This is useful + /// for inspecting impulses. + /// Note: the contact manifold does not include time of impact impulses, which can be + /// arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly + /// in a separate data structure. + /// Note: this is only called for contacts that are touching, solid, and awake. + virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) + { + B2_NOT_USED(contact); + B2_NOT_USED(impulse); + } +}; + +/// Callback class for AABB queries. +/// See b2World::Query +class b2QueryCallback +{ +public: + virtual ~b2QueryCallback() {} + + /// Called for each fixture found in the query AABB. + /// @return false to terminate the query. + virtual bool ReportFixture(b2Fixture* fixture) = 0; +}; + +/// Callback class for ray casts. +/// See b2World::RayCast +class b2RayCastCallback +{ +public: + virtual ~b2RayCastCallback() {} + + /// Called for each fixture found in the query. You control how the ray cast + /// proceeds by returning a float: + /// return -1: ignore this fixture and continue + /// return 0: terminate the ray cast + /// return fraction: clip the ray to this point + /// return 1: don't clip the ray and continue + /// @param fixture the fixture hit by the ray + /// @param point the point of initial intersection + /// @param normal the normal vector at the point of intersection + /// @return -1 to filter, 0 to terminate, fraction to clip the ray for + /// closest hit, 1 to continue + virtual float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, + const b2Vec2& normal, float32 fraction) = 0; +}; + +#endif diff --git a/src/libraries/Box2D/Rope/b2Rope.cpp b/src/libraries/Box2D/Rope/b2Rope.cpp index 97578b266..7af3a6cf2 100755 --- a/src/libraries/Box2D/Rope/b2Rope.cpp +++ b/src/libraries/Box2D/Rope/b2Rope.cpp @@ -1,259 +1,259 @@ -/* -* Copyright (c) 2011 Erin Catto http://box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include - -b2Rope::b2Rope() -{ - m_count = 0; - m_ps = NULL; - m_p0s = NULL; - m_vs = NULL; - m_ims = NULL; - m_Ls = NULL; - m_as = NULL; - m_gravity.SetZero(); - m_k2 = 1.0f; - m_k3 = 0.1f; -} - -b2Rope::~b2Rope() -{ - b2Free(m_ps); - b2Free(m_p0s); - b2Free(m_vs); - b2Free(m_ims); - b2Free(m_Ls); - b2Free(m_as); -} - -void b2Rope::Initialize(const b2RopeDef* def) -{ - b2Assert(def->count >= 3); - m_count = def->count; - m_ps = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_p0s = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_vs = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); - m_ims = (float32*)b2Alloc(m_count * sizeof(float32)); - - for (int32 i = 0; i < m_count; ++i) - { - m_ps[i] = def->vertices[i]; - m_p0s[i] = def->vertices[i]; - m_vs[i].SetZero(); - - float32 m = def->masses[i]; - if (m > 0.0f) - { - m_ims[i] = 1.0f / m; - } - else - { - m_ims[i] = 0.0f; - } - } - - int32 count2 = m_count - 1; - int32 count3 = m_count - 2; - m_Ls = (float32*)b2Alloc(count2 * sizeof(float32)); - m_as = (float32*)b2Alloc(count3 * sizeof(float32)); - - for (int32 i = 0; i < count2; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i+1]; - m_Ls[i] = b2Distance(p1, p2); - } - - for (int32 i = 0; i < count3; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - b2Vec2 p3 = m_ps[i + 2]; - - b2Vec2 d1 = p2 - p1; - b2Vec2 d2 = p3 - p2; - - float32 a = b2Cross(d1, d2); - float32 b = b2Dot(d1, d2); - - m_as[i] = b2Atan2(a, b); - } - - m_gravity = def->gravity; - m_damping = def->damping; - m_k2 = def->k2; - m_k3 = def->k3; -} - -void b2Rope::Step(float32 h, int32 iterations) -{ - if (h == 0.0) - { - return; - } - - float32 d = expf(- h * m_damping); - - for (int32 i = 0; i < m_count; ++i) - { - m_p0s[i] = m_ps[i]; - if (m_ims[i] > 0.0f) - { - m_vs[i] += h * m_gravity; - } - m_vs[i] *= d; - m_ps[i] += h * m_vs[i]; - - } - - for (int32 i = 0; i < iterations; ++i) - { - SolveC2(); - SolveC3(); - SolveC2(); - } - - float32 inv_h = 1.0f / h; - for (int32 i = 0; i < m_count; ++i) - { - m_vs[i] = inv_h * (m_ps[i] - m_p0s[i]); - } -} - -void b2Rope::SolveC2() -{ - int32 count2 = m_count - 1; - - for (int32 i = 0; i < count2; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - - b2Vec2 d = p2 - p1; - float32 L = d.Normalize(); - - float32 im1 = m_ims[i]; - float32 im2 = m_ims[i + 1]; - - if (im1 + im2 == 0.0f) - { - continue; - } - - float32 s1 = im1 / (im1 + im2); - float32 s2 = im2 / (im1 + im2); - - p1 -= m_k2 * s1 * (m_Ls[i] - L) * d; - p2 += m_k2 * s2 * (m_Ls[i] - L) * d; - - m_ps[i] = p1; - m_ps[i + 1] = p2; - } -} - -void b2Rope::SetAngle(float32 angle) -{ - int32 count3 = m_count - 2; - for (int32 i = 0; i < count3; ++i) - { - m_as[i] = angle; - } -} - -void b2Rope::SolveC3() -{ - int32 count3 = m_count - 2; - - for (int32 i = 0; i < count3; ++i) - { - b2Vec2 p1 = m_ps[i]; - b2Vec2 p2 = m_ps[i + 1]; - b2Vec2 p3 = m_ps[i + 2]; - - float32 m1 = m_ims[i]; - float32 m2 = m_ims[i + 1]; - float32 m3 = m_ims[i + 2]; - - b2Vec2 d1 = p2 - p1; - b2Vec2 d2 = p3 - p2; - - float32 L1sqr = d1.LengthSquared(); - float32 L2sqr = d2.LengthSquared(); - - if (L1sqr * L2sqr == 0.0f) - { - continue; - } - - float32 a = b2Cross(d1, d2); - float32 b = b2Dot(d1, d2); - - float32 angle = b2Atan2(a, b); - - b2Vec2 Jd1 = (-1.0f / L1sqr) * d1.Skew(); - b2Vec2 Jd2 = (1.0f / L2sqr) * d2.Skew(); - - b2Vec2 J1 = -Jd1; - b2Vec2 J2 = Jd1 - Jd2; - b2Vec2 J3 = Jd2; - - float32 mass = m1 * b2Dot(J1, J1) + m2 * b2Dot(J2, J2) + m3 * b2Dot(J3, J3); - if (mass == 0.0f) - { - continue; - } - - mass = 1.0f / mass; - - float32 C = angle - m_as[i]; - - while (C > b2_pi) - { - angle -= 2 * b2_pi; - C = angle - m_as[i]; - } - - while (C < -b2_pi) - { - angle += 2.0f * b2_pi; - C = angle - m_as[i]; - } - - float32 impulse = - m_k3 * mass * C; - - p1 += (m1 * impulse) * J1; - p2 += (m2 * impulse) * J2; - p3 += (m3 * impulse) * J3; - - m_ps[i] = p1; - m_ps[i + 1] = p2; - m_ps[i + 2] = p3; - } -} - -void b2Rope::Draw(b2Draw* draw) const -{ - b2Color c(0.4f, 0.5f, 0.7f); - - for (int32 i = 0; i < m_count - 1; ++i) - { - draw->DrawSegment(m_ps[i], m_ps[i+1], c); - } -} +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include + +b2Rope::b2Rope() +{ + m_count = 0; + m_ps = NULL; + m_p0s = NULL; + m_vs = NULL; + m_ims = NULL; + m_Ls = NULL; + m_as = NULL; + m_gravity.SetZero(); + m_k2 = 1.0f; + m_k3 = 0.1f; +} + +b2Rope::~b2Rope() +{ + b2Free(m_ps); + b2Free(m_p0s); + b2Free(m_vs); + b2Free(m_ims); + b2Free(m_Ls); + b2Free(m_as); +} + +void b2Rope::Initialize(const b2RopeDef* def) +{ + b2Assert(def->count >= 3); + m_count = def->count; + m_ps = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_p0s = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_vs = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); + m_ims = (float32*)b2Alloc(m_count * sizeof(float32)); + + for (int32 i = 0; i < m_count; ++i) + { + m_ps[i] = def->vertices[i]; + m_p0s[i] = def->vertices[i]; + m_vs[i].SetZero(); + + float32 m = def->masses[i]; + if (m > 0.0f) + { + m_ims[i] = 1.0f / m; + } + else + { + m_ims[i] = 0.0f; + } + } + + int32 count2 = m_count - 1; + int32 count3 = m_count - 2; + m_Ls = (float32*)b2Alloc(count2 * sizeof(float32)); + m_as = (float32*)b2Alloc(count3 * sizeof(float32)); + + for (int32 i = 0; i < count2; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i+1]; + m_Ls[i] = b2Distance(p1, p2); + } + + for (int32 i = 0; i < count3; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + b2Vec2 p3 = m_ps[i + 2]; + + b2Vec2 d1 = p2 - p1; + b2Vec2 d2 = p3 - p2; + + float32 a = b2Cross(d1, d2); + float32 b = b2Dot(d1, d2); + + m_as[i] = b2Atan2(a, b); + } + + m_gravity = def->gravity; + m_damping = def->damping; + m_k2 = def->k2; + m_k3 = def->k3; +} + +void b2Rope::Step(float32 h, int32 iterations) +{ + if (h == 0.0) + { + return; + } + + float32 d = expf(- h * m_damping); + + for (int32 i = 0; i < m_count; ++i) + { + m_p0s[i] = m_ps[i]; + if (m_ims[i] > 0.0f) + { + m_vs[i] += h * m_gravity; + } + m_vs[i] *= d; + m_ps[i] += h * m_vs[i]; + + } + + for (int32 i = 0; i < iterations; ++i) + { + SolveC2(); + SolveC3(); + SolveC2(); + } + + float32 inv_h = 1.0f / h; + for (int32 i = 0; i < m_count; ++i) + { + m_vs[i] = inv_h * (m_ps[i] - m_p0s[i]); + } +} + +void b2Rope::SolveC2() +{ + int32 count2 = m_count - 1; + + for (int32 i = 0; i < count2; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + + b2Vec2 d = p2 - p1; + float32 L = d.Normalize(); + + float32 im1 = m_ims[i]; + float32 im2 = m_ims[i + 1]; + + if (im1 + im2 == 0.0f) + { + continue; + } + + float32 s1 = im1 / (im1 + im2); + float32 s2 = im2 / (im1 + im2); + + p1 -= m_k2 * s1 * (m_Ls[i] - L) * d; + p2 += m_k2 * s2 * (m_Ls[i] - L) * d; + + m_ps[i] = p1; + m_ps[i + 1] = p2; + } +} + +void b2Rope::SetAngle(float32 angle) +{ + int32 count3 = m_count - 2; + for (int32 i = 0; i < count3; ++i) + { + m_as[i] = angle; + } +} + +void b2Rope::SolveC3() +{ + int32 count3 = m_count - 2; + + for (int32 i = 0; i < count3; ++i) + { + b2Vec2 p1 = m_ps[i]; + b2Vec2 p2 = m_ps[i + 1]; + b2Vec2 p3 = m_ps[i + 2]; + + float32 m1 = m_ims[i]; + float32 m2 = m_ims[i + 1]; + float32 m3 = m_ims[i + 2]; + + b2Vec2 d1 = p2 - p1; + b2Vec2 d2 = p3 - p2; + + float32 L1sqr = d1.LengthSquared(); + float32 L2sqr = d2.LengthSquared(); + + if (L1sqr * L2sqr == 0.0f) + { + continue; + } + + float32 a = b2Cross(d1, d2); + float32 b = b2Dot(d1, d2); + + float32 angle = b2Atan2(a, b); + + b2Vec2 Jd1 = (-1.0f / L1sqr) * d1.Skew(); + b2Vec2 Jd2 = (1.0f / L2sqr) * d2.Skew(); + + b2Vec2 J1 = -Jd1; + b2Vec2 J2 = Jd1 - Jd2; + b2Vec2 J3 = Jd2; + + float32 mass = m1 * b2Dot(J1, J1) + m2 * b2Dot(J2, J2) + m3 * b2Dot(J3, J3); + if (mass == 0.0f) + { + continue; + } + + mass = 1.0f / mass; + + float32 C = angle - m_as[i]; + + while (C > b2_pi) + { + angle -= 2 * b2_pi; + C = angle - m_as[i]; + } + + while (C < -b2_pi) + { + angle += 2.0f * b2_pi; + C = angle - m_as[i]; + } + + float32 impulse = - m_k3 * mass * C; + + p1 += (m1 * impulse) * J1; + p2 += (m2 * impulse) * J2; + p3 += (m3 * impulse) * J3; + + m_ps[i] = p1; + m_ps[i + 1] = p2; + m_ps[i + 2] = p3; + } +} + +void b2Rope::Draw(b2Draw* draw) const +{ + b2Color c(0.4f, 0.5f, 0.7f); + + for (int32 i = 0; i < m_count - 1; ++i) + { + draw->DrawSegment(m_ps[i], m_ps[i+1], c); + } +} diff --git a/src/libraries/Box2D/Rope/b2Rope.h b/src/libraries/Box2D/Rope/b2Rope.h index bc5375ddb..246cf923f 100755 --- a/src/libraries/Box2D/Rope/b2Rope.h +++ b/src/libraries/Box2D/Rope/b2Rope.h @@ -1,115 +1,115 @@ -/* -* Copyright (c) 2011 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef B2_ROPE_H -#define B2_ROPE_H - -#include - -class b2Draw; - -/// -struct b2RopeDef -{ - b2RopeDef() - { - vertices = NULL; - count = 0; - masses = NULL; - gravity.SetZero(); - damping = 0.1f; - k2 = 0.9f; - k3 = 0.1f; - } - - /// - b2Vec2* vertices; - - /// - int32 count; - - /// - float32* masses; - - /// - b2Vec2 gravity; - - /// - float32 damping; - - /// Stretching stiffness - float32 k2; - - /// Bending stiffness. Values above 0.5 can make the simulation blow up. - float32 k3; -}; - -/// -class b2Rope -{ -public: - b2Rope(); - ~b2Rope(); - - /// - void Initialize(const b2RopeDef* def); - - /// - void Step(float32 timeStep, int32 iterations); - - /// - int32 GetVertexCount() const - { - return m_count; - } - - /// - const b2Vec2* GetVertices() const - { - return m_ps; - } - - /// - void Draw(b2Draw* draw) const; - - /// - void SetAngle(float32 angle); - -private: - - void SolveC2(); - void SolveC3(); - - int32 m_count; - b2Vec2* m_ps; - b2Vec2* m_p0s; - b2Vec2* m_vs; - - float32* m_ims; - - float32* m_Ls; - float32* m_as; - - b2Vec2 m_gravity; - float32 m_damping; - - float32 m_k2; - float32 m_k3; -}; - -#endif +/* +* Copyright (c) 2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ROPE_H +#define B2_ROPE_H + +#include + +class b2Draw; + +/// +struct b2RopeDef +{ + b2RopeDef() + { + vertices = NULL; + count = 0; + masses = NULL; + gravity.SetZero(); + damping = 0.1f; + k2 = 0.9f; + k3 = 0.1f; + } + + /// + b2Vec2* vertices; + + /// + int32 count; + + /// + float32* masses; + + /// + b2Vec2 gravity; + + /// + float32 damping; + + /// Stretching stiffness + float32 k2; + + /// Bending stiffness. Values above 0.5 can make the simulation blow up. + float32 k3; +}; + +/// +class b2Rope +{ +public: + b2Rope(); + ~b2Rope(); + + /// + void Initialize(const b2RopeDef* def); + + /// + void Step(float32 timeStep, int32 iterations); + + /// + int32 GetVertexCount() const + { + return m_count; + } + + /// + const b2Vec2* GetVertices() const + { + return m_ps; + } + + /// + void Draw(b2Draw* draw) const; + + /// + void SetAngle(float32 angle); + +private: + + void SolveC2(); + void SolveC3(); + + int32 m_count; + b2Vec2* m_ps; + b2Vec2* m_p0s; + b2Vec2* m_vs; + + float32* m_ims; + + float32* m_Ls; + float32* m_as; + + b2Vec2 m_gravity; + float32 m_damping; + + float32 m_k2; + float32 m_k3; +}; + +#endif diff --git a/src/libraries/luasocket/libluasocket/ftp.lua.h b/src/libraries/luasocket/libluasocket/ftp.lua.h index 811b564cd..0f6c8153c 100644 --- a/src/libraries/luasocket/libluasocket/ftp.lua.h +++ b/src/libraries/luasocket/libluasocket/ftp.lua.h @@ -1,468 +1,468 @@ -/* code automatically generated by bin2c -- DO NOT EDIT */ -{ -/* #include'ing this file in a C program is equivalent to calling - if (luaL_loadfile(L,"ftp.lua")==0) lua_call(L, 0, 0); -*/ -/* ftp.lua */ -static const unsigned char B1[]={ - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 70, 84, 80, 32,115,117,112,112,111,114,116, 32,102,111,114, 32,116,104,101, - 32, 76,117, 97, 32,108, 97,110,103,117, 97,103,101, 10, 45, 45, 32, 76,117, 97, - 83,111, 99,107,101,116, 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65, -117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, - 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, 73,100, 58, 32,102,116,112, 46,108, -117, 97, 44,118, 32, 49, 46, 52, 53, 32, 50, 48, 48, 55, 47, 48, 55, 47, 49, 49, - 32, 49, 57, 58, 50, 53, 58, 52, 55, 32,100,105,101,103,111, 32, 69,120,112, 32, - 36, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, - 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, - 45, 32, 68,101, 99,108, 97,114,101, 32,109,111,100,117,108,101, 32, 97,110,100, - 32,105,109,112,111,114,116, 32,100,101,112,101,110,100,101,110, 99,105,101,115, - 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108, -111, 99, 97,108, 32, 98, 97,115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, - 32,116, 97, 98,108,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,116, 97, - 98,108,101, 34, 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61, - 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108, -111, 99, 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101, 40, - 34,109, 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99,107,101,116, - 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 34, 41, - 10,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32,114,101,113,117,105,114,101, - 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34, 41, 10,108,111, 99, 97,108, - 32,116,112, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101, -116, 46,116,112, 34, 41, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32, 61, - 32,114,101,113,117,105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,109,111, -100,117,108,101, 40, 34,115,111, 99,107,101,116, 46,102,116,112, 34, 41, 10, 10, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97,110,116,115, 10, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, -116,105,109,101,111,117,116, 32,105,110, 32,115,101, 99,111,110,100,115, 32, 98, -101,102,111,114,101, 32,116,104,101, 32,112,114,111,103,114, 97,109, 32,103,105, -118,101,115, 32,117,112, 32,111,110, 32, 97, 32, 99,111,110,110,101, 99,116,105, -111,110, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100, -101,102, 97,117,108,116, 32,112,111,114,116, 32,102,111,114, 32,102,116,112, 32, -115,101,114,118,105, 99,101, 10, 80, 79, 82, 84, 32, 61, 32, 50, 49, 10, 45, 45, - 32,116,104,105,115, 32,105,115, 32,116,104,101, 32,100,101,102, 97,117,108,116, - 32, 97,110,111,110,121,109,111,117,115, 32,112, 97,115,115,119,111,114,100, 46, - 32,117,115,101,100, 32,119,104,101,110, 32,110,111, 32,112, 97,115,115,119,111, -114,100, 32,105,115, 10, 45, 45, 32,112,114,111,118,105,100,101,100, 32,105,110, - 32,117,114,108, 46, 32,115,104,111,117,108,100, 32, 98,101, 32, 99,104, 97,110, -103,101,100, 32,116,111, 32,121,111,117,114, 32,101, 45,109, 97,105,108, 46, 10, - 85, 83, 69, 82, 32, 61, 32, 34,102,116,112, 34, 10, 80, 65, 83, 83, 87, 79, 82, - 68, 32, 61, 32, 34, 97,110,111,110,121,109,111,117,115, 64, 97,110,111,110,121, -109,111,117,115, 46,111,114,103, 34, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32,108,101,118,101, -108, 32, 70, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109,101,116, 97,116, 32, - 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123,125, 32,125, 10, 10, -102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,115,101,114,118,101,114, - 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32, 32, 32, -108,111, 99, 97,108, 32,116,112, 32, 61, 32,115,111, 99,107,101,116, 46,116,114, -121, 40,116,112, 46, 99,111,110,110,101, 99,116, 40,115,101,114,118,101,114, 44, - 32,112,111,114,116, 32,111,114, 32, 80, 79, 82, 84, 44, 32, 84, 73, 77, 69, 79, - 85, 84, 44, 32, 99,114,101, 97,116,101, 41, 41, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,102, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, - 97, 98,108,101, 40,123, 32,116,112, 32, 61, 32,116,112, 32,125, 44, 32,109,101, -116, 97,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114, -101, 32,101,118,101,114,121,116,104,105,110,103, 32,103,101,116,115, 32, 99,108, -111,115,101,100, 32,105,110, 32, 97,110, 32,101,120, 99,101,112,116,105,111,110, - 10, 32, 32, 32, 32,102, 46,116,114,121, 32, 61, 32,115,111, 99,107,101,116, 46, -110,101,119,116,114,121, 40,102,117,110, 99,116,105,111,110, 40, 41, 32,102, 58, - 99,108,111,115,101, 40, 41, 32,101,110,100, 41, 10, 32, 32, 32, 32,114,101,116, -117,114,110, 32,102, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, -109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112,111,114,116, 99,111, -110,110,101, 99,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, - 40,115,101,108,102, 46,115,101,114,118,101,114, 58,115,101,116,116,105,109,101, -111,117,116, 40, 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,115,101, -108,102, 46,100, 97,116, 97, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115, -101,108,102, 46,115,101,114,118,101,114, 58, 97, 99, 99,101,112,116, 40, 41, 41, - 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,100, - 97,116, 97, 58,115,101,116,116,105,109,101,111,117,116, 40, 84, 73, 77, 69, 79, - 85, 84, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, -101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112, 97,115,118, 99,111,110, -110,101, 99,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,100, 97,116, 97, - 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,111, 99,107,101,116, 46,116, - 99,112, 40, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115, -101,108,102, 46,100, 97,116, 97, 58,115,101,116,116,105,109,101,111,117,116, 40, - 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116, -114,121, 40,115,101,108,102, 46,100, 97,116, 97, 58, 99,111,110,110,101, 99,116, - 40,115,101,108,102, 46,112, 97,115,118,116, 46,105,112, 44, 32,115,101,108,102, - 46,112, 97,115,118,116, 46,112,111,114,116, 41, 41, 10,101,110,100, 10, 10,102, -117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101, -120, 58,108,111,103,105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111, -114,100, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108, -102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,117,115,101,114, 34, 44, - 32,117,115,101,114, 32,111,114, 32, 85, 83, 69, 82, 41, 41, 10, 32, 32, 32, 32, -108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108,121, 32, 61, 32, -115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, - 99,107,123, 34, 50, 46, 46, 34, 44, 32, 51, 51, 49,125, 41, 10, 32, 32, 32, 32, -105,102, 32, 99,111,100,101, 32, 61, 61, 32, 51, 51, 49, 32,116,104,101,110, 10, - 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108, -102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,112, 97,115,115, 34, 44, - 32,112, 97,115,115,119,111,114,100, 32,111,114, 32, 80, 65, 83, 83, 87, 79, 82, - 68, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, - 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, - 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114, -110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101, -116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112, 97,115,118, 40, 41, 10, 32, - 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, - 99,111,109,109, 97,110,100, 40, 34,112, 97,115,118, 34, 41, 41, 10, 32, 32, 32, - 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108,121, 32, 61, - 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104, -101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97, -108, 32,112, 97,116,116,101,114,110, 32, 61, 32, 34, 40, 37,100, 43, 41, 37, 68, - 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 37, - 68, 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 34, 10, 32, 32, 32, 32,108, -111, 99, 97,108, 32, 97, 44, 32, 98, 44, 32, 99, 44, 32,100, 44, 32,112, 49, 44, - 32,112, 50, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, - 32,115,116,114,105,110,103, 46,102,105,110,100, 40,114,101,112,108,121, 44, 32, -112, 97,116,116,101,114,110, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116, -114,121, 40, 97, 32, 97,110,100, 32, 98, 32, 97,110,100, 32, 99, 32, 97,110,100, - 32,100, 32, 97,110,100, 32,112, 49, 32, 97,110,100, 32,112, 50, 44, 32,114,101, -112,108,121, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,112, 97,115,118,116, 32, - 61, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,112, 32, 61, 32,115,116,114, -105,110,103, 46,102,111,114,109, 97,116, 40, 34, 37,100, 46, 37,100, 46, 37,100, - 46, 37,100, 34, 44, 32, 97, 44, 32, 98, 44, 32, 99, 44, 32,100, 41, 44, 10, 32, - 32, 32, 32, 32, 32, 32, 32,112,111,114,116, 32, 61, 32,112, 49, 42, 50, 53, 54, - 32, 43, 32,112, 50, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,105,102, 32,115, -101,108,102, 46,115,101,114,118,101,114, 32,116,104,101,110, 10, 32, 32, 32, 32, - 32, 32, 32, 32,115,101,108,102, 46,115,101,114,118,101,114, 58, 99,108,111,115, -101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,115,101,114, -118,101,114, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, - 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,112, 97,115,118,116, 46, -105,112, 44, 32,115,101,108,102, 46,112, 97,115,118,116, 46,112,111,114,116, 10, -101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, - 95, 95,105,110,100,101,120, 58,112,111,114,116, 40,105,112, 44, 32,112,111,114, -116, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,112, 97,115,118,116, 32, 61, 32, -110,105,108, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,105,112, 32,116,104, -101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,112, 44, 32,112,111,114,116, 32, - 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,103, -101,116, 99,111,110,116,114,111,108, 40, 41, 58,103,101,116,115,111, 99,107,110, - 97,109,101, 40, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46, -115,101,114,118,101,114, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,111, - 99,107,101,116, 46, 98,105,110,100, 40,105,112, 44, 32, 48, 41, 41, 10, 32, 32, - 32, 32, 32, 32, 32, 32,105,112, 44, 32,112,111,114,116, 32, 61, 32,115,101,108, -102, 46,116,114,121, 40,115,101,108,102, 46,115,101,114,118,101,114, 58,103,101, -116,115,111, 99,107,110, 97,109,101, 40, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, - 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,115,101,114,118,101, -114, 58,115,101,116,116,105,109,101,111,117,116, 40, 84, 73, 77, 69, 79, 85, 84, - 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, - 32,112,108, 32, 61, 32,109, 97,116,104, 46,109,111,100, 40,112,111,114,116, 44, - 32, 50, 53, 54, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112,104, 32, 61, - 32, 40,112,111,114,116, 32, 45, 32,112,108, 41, 47, 50, 53, 54, 10, 32, 32, 32, - 32,108,111, 99, 97,108, 32, 97,114,103, 32, 61, 32,115,116,114,105,110,103, 46, -103,115,117, 98, 40,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 34, - 37,115, 44, 37,100, 44, 37,100, 34, 44, 32,105,112, 44, 32,112,104, 44, 32,112, -108, 41, 44, 32, 34, 37, 46, 34, 44, 32, 34, 44, 34, 41, 10, 32, 32, 32, 32,115, -101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, - 97,110,100, 40, 34,112,111,114,116, 34, 44, 32, 97,114,103, 41, 41, 10, 32, 32, - 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99, -104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116, -117,114,110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, -109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,115,101,110,100, 40,115, -101,110,100,116, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115, -101,108,102, 46,112, 97,115,118,116, 32,111,114, 32,115,101,108,102, 46,115,101, -114,118,101,114, 44, 32, 34,110,101,101,100, 32,112,111,114,116, 32,111,114, 32, -112, 97,115,118, 32,102,105,114,115,116, 34, 41, 10, 32, 32, 32, 32, 45, 45, 32, -105,102, 32,116,104,101,114,101, 32,105,115, 32, 97, 32,112, 97,115,118,116, 32, -116, 97, 98,108,101, 44, 32,119,101, 32, 97,108,114,101, 97,100,121, 32,115,101, -110,116, 32, 97, 32, 80, 65, 83, 86, 32, 99,111,109,109, 97,110,100, 10, 32, 32, - 32, 32, 45, 45, 32,119,101, 32,106,117,115,116, 32,103,101,116, 32,116,104,101, - 32,100, 97,116, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 32,105,110,116, -111, 32,115,101,108,102, 46,100, 97,116, 97, 10, 32, 32, 32, 32,105,102, 32,115, -101,108,102, 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58, -112, 97,115,118, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32, - 32, 32, 45, 45, 32,103,101,116, 32,116,104,101, 32,116,114, 97,110,115,102,101, -114, 32, 97,114,103,117,109,101,110,116, 32, 97,110,100, 32, 99,111,109,109, 97, -110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,114,103,117,109,101,110, -116, 32, 61, 32,115,101,110,100,116, 46, 97,114,103,117,109,101,110,116, 32,111, -114, 10, 32, 32, 32, 32, 32, 32, 32, 32,117,114,108, 46,117,110,101,115, 99, 97, -112,101, 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,110,100,116, - 46,112, 97,116,104, 32,111,114, 32, 34, 34, 44, 32, 34, 94, 91, 47, 92, 92, 93, - 34, 44, 32, 34, 34, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 97,114,103,117,109, -101,110,116, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32, 97,114,103,117,109, -101,110,116, 32, 61, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,108,111, - 99, 97,108, 32, 99,111,109,109, 97,110,100, 32, 61, 32,115,101,110,100,116, 46, - 99,111,109,109, 97,110,100, 32,111,114, 32, 34,115,116,111,114, 34, 10, 32, 32, - 32, 32, 45, 45, 32,115,101,110,100, 32,116,104,101, 32,116,114, 97,110,115,102, -101,114, 32, 99,111,109,109, 97,110,100, 32, 97,110,100, 32, 99,104,101, 99,107, - 32,116,104,101, 32,114,101,112,108,121, 10, 32, 32, 32, 32,115,101,108,102, 46, -116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, - 99,111,109,109, 97,110,100, 44, 32, 97,114,103,117,109,101,110,116, 41, 41, 10, - 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108, -121, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, - 58, 99,104,101, 99,107,123, 34, 50, 46, 46, 34, 44, 32, 34, 49, 46, 46, 34,125, - 41, 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115, - 32,110,111,116, 32, 97, 32, 97, 32,112, 97,115,118,116, 32,116, 97, 98,108,101, - 44, 32,116,104,101,110, 32,116,104,101,114,101, 32,105,115, 32, 97, 32,115,101, -114,118,101,114, 10, 32, 32, 32, 32, 45, 45, 32, 97,110,100, 32,119,101, 32, 97, -108,114,101, 97,100,121, 32,115,101,110,116, 32, 97, 32, 80, 79, 82, 84, 32, 99, -111,109,109, 97,110,100, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,101, -108,102, 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58,112, -111,114,116, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32, 32, - 32, 45, 45, 32,103,101,116, 32,116,104,101, 32,115,105,110,107, 44, 32,115,111, -117,114, 99,101, 32, 97,110,100, 32,115,116,101,112, 32,102,111,114, 32,116,104, -101, 32,116,114, 97,110,115,102,101,114, 10, 32, 32, 32, 32,108,111, 99, 97,108, - 32,115,116,101,112, 32, 61, 32,115,101,110,100,116, 46,115,116,101,112, 32,111, -114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32, - 32, 32,108,111, 99, 97,108, 32,114,101, 97,100,116, 32, 61, 32,123,115,101,108, -102, 46,116,112, 46, 99,125, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104, -101, 99,107,115,116,101,112, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115, -114, 99, 44, 32,115,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32, - 99,104,101, 99,107, 32,115,116, 97,116,117,115, 32,105,110, 32, 99,111,110,116, -114,111,108, 32, 99,111,110,110,101, 99,116,105,111,110, 32,119,104,105,108,101, - 32,100,111,119,110,108,111, 97,100,105,110,103, 10, 32, 32, 32, 32, 32, 32, 32, - 32,108,111, 99, 97,108, 32,114,101, 97,100,121,116, 32, 61, 32,115,111, 99,107, -101,116, 46,115,101,108,101, 99,116, 40,114,101, 97,100,116, 44, 32,110,105,108, - 44, 32, 48, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,114,101, 97,100, -121,116, 91,116,112, 93, 32,116,104,101,110, 32, 99,111,100,101, 32, 61, 32,115, -101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99, -107, 40, 34, 50, 46, 46, 34, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, - 32, 32,114,101,116,117,114,110, 32,115,116,101,112, 40,115,114, 99, 44, 32,115, -110,107, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97, -108, 32,115,105,110,107, 32, 61, 32,115,111, 99,107,101,116, 46,115,105,110,107, - 40, 34, 99,108,111,115,101, 45,119,104,101,110, 45,100,111,110,101, 34, 44, 32, -115,101,108,102, 46,100, 97,116, 97, 41, 10, 32, 32, 32, 32, 45, 45, 32,116,114, - 97,110,115,102,101,114, 32, 97,108,108, 32,100, 97,116, 97, 32, 97,110,100, 32, - 99,104,101, 99,107, 32,101,114,114,111,114, 10, 32, 32, 32, 32,115,101,108,102, - 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46, 97,108,108, 40, -115,101,110,100,116, 46,115,111,117,114, 99,101, 44, 32,115,105,110,107, 44, 32, - 99,104,101, 99,107,115,116,101,112, 41, 41, 10, 32, 32, 32, 32,105,102, 32,115, -116,114,105,110,103, 46,102,105,110,100, 40, 99,111,100,101, 44, 32, 34, 49, 46, - 46, 34, 41, 32,116,104,101,110, 32,115,101,108,102, 46,116,114,121, 40,115,101, -108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 32, -101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,100,111,110,101, 32,119,105,116,104, - 32,100, 97,116, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 10, 32, 32, 32, - 32,115,101,108,102, 46,100, 97,116, 97, 58, 99,108,111,115,101, 40, 41, 10, 32, - 32, 32, 32, 45, 45, 32,102,105,110,100, 32,111,117,116, 32,104,111,119, 32,109, - 97,110,121, 32, 98,121,116,101,115, 32,119,101,114,101, 32,115,101,110,116, 10, - 32, 32, 32, 32,108,111, 99, 97,108, 32,115,101,110,116, 32, 61, 32,115,111, 99, -107,101,116, 46,115,107,105,112, 40, 49, 44, 32,115,101,108,102, 46,100, 97,116, - 97, 58,103,101,116,115,116, 97,116,115, 40, 41, 41, 10, 32, 32, 32, 32,115,101, -108,102, 46,100, 97,116, 97, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,114,101, -116,117,114,110, 32,115,101,110,116, 10,101,110,100, 10, 10,102,117,110, 99,116, -105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, - 99,101,105,118,101, 40,114,101, 99,118,116, 41, 10, 32, 32, 32, 32,115,101,108, -102, 46,116,114,121, 40,115,101,108,102, 46,112, 97,115,118,116, 32,111,114, 32, -115,101,108,102, 46,115,101,114,118,101,114, 44, 32, 34,110,101,101,100, 32,112, -111,114,116, 32,111,114, 32,112, 97,115,118, 32,102,105,114,115,116, 34, 41, 10, - 32, 32, 32, 32,105,102, 32,115,101,108,102, 46,112, 97,115,118,116, 32,116,104, -101,110, 32,115,101,108,102, 58,112, 97,115,118, 99,111,110,110,101, 99,116, 40, - 41, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,114,103,117, -109,101,110,116, 32, 61, 32,114,101, 99,118,116, 46, 97,114,103,117,109,101,110, -116, 32,111,114, 10, 32, 32, 32, 32, 32, 32, 32, 32,117,114,108, 46,117,110,101, -115, 99, 97,112,101, 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,114,101, - 99,118,116, 46,112, 97,116,104, 32,111,114, 32, 34, 34, 44, 32, 34, 94, 91, 47, - 92, 92, 93, 34, 44, 32, 34, 34, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 97,114, -103,117,109,101,110,116, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32, 97,114, -103,117,109,101,110,116, 32, 61, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, - 32,108,111, 99, 97,108, 32, 99,111,109,109, 97,110,100, 32, 61, 32,114,101, 99, -118,116, 46, 99,111,109,109, 97,110,100, 32,111,114, 32, 34,114,101,116,114, 34, - 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116, -112, 58, 99,111,109,109, 97,110,100, 40, 99,111,109,109, 97,110,100, 44, 32, 97, -114,103,117,109,101,110,116, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, - 99,111,100,101, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, - 46,116,112, 58, 99,104,101, 99,107,123, 34, 49, 46, 46, 34, 44, 32, 34, 50, 46, - 46, 34,125, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,101,108,102, - 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58,112,111,114, -116, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,108, -111, 99, 97,108, 32,115,111,117,114, 99,101, 32, 61, 32,115,111, 99,107,101,116, - 46,115,111,117,114, 99,101, 40, 34,117,110,116,105,108, 45, 99,108,111,115,101, -100, 34, 44, 32,115,101,108,102, 46,100, 97,116, 97, 41, 10, 32, 32, 32, 32,108, -111, 99, 97,108, 32,115,116,101,112, 32, 61, 32,114,101, 99,118,116, 46,115,116, -101,112, 32,111,114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101, -112, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,108,116,110, 49, 50, - 46,112,117,109,112, 46, 97,108,108, 40,115,111,117,114, 99,101, 44, 32,114,101, - 99,118,116, 46,115,105,110,107, 44, 32,115,116,101,112, 41, 41, 10, 32, 32, 32, - 32,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 99,111,100,101, - 44, 32, 34, 49, 46, 46, 34, 41, 32,116,104,101,110, 32,115,101,108,102, 46,116, -114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, - 46, 34, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32,115,101,108,102, 46,100, 97, -116, 97, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46, -100, 97,116, 97, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,114,101,116,117,114, -110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101, -116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,119,100, 40,100,105,114, 41, - 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116, -112, 58, 99,111,109,109, 97,110,100, 40, 34, 99,119,100, 34, 44, 32,100,105,114, - 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, - 46,116,112, 58, 99,104,101, 99,107, 40, 50, 53, 48, 41, 41, 10, 32, 32, 32, 32, -114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105, -111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,116,121,112, -101, 40,116,121,112,101, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, - 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,116,121, -112,101, 34, 44, 32,116,121,112,101, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, - 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 50, - 48, 48, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110, -100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95, -105,110,100,101,120, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,108,111, - 99, 97,108, 32, 99,111,100,101, 32, 61, 32,115,101,108,102, 46,116,114,121, 40, -115,101,108,102, 46,116,112, 58, 99,104,101, 99,107,123, 34, 49, 46, 46, 34, 44, - 32, 34, 50, 46, 46, 34,125, 41, 10, 32, 32, 32, 32,105,102, 32,115,116,114,105, -110,103, 46,102,105,110,100, 40, 99,111,100,101, 44, 32, 34, 49, 46, 46, 34, 41, - 32,116,104,101,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, -116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 32,101,110,100, - 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10,102, -117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101, -120, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114, -121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,113, -117,105,116, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40, -115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, - 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10, -102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100, -101,120, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,105,102, 32,115,101, -108,102, 46,100, 97,116, 97, 32,116,104,101,110, 32,115,101,108,102, 46,100, 97, -116, 97, 58, 99,108,111,115,101, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,105, -102, 32,115,101,108,102, 46,115,101,114,118,101,114, 32,116,104,101,110, 32,115, -101,108,102, 46,115,101,114,118,101,114, 58, 99,108,111,115,101, 40, 41, 32,101, -110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116, -112, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 72,105,103,104, - 32,108,101,118,101,108, 32, 70, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,102, -117,110, 99,116,105,111,110, 32,111,118,101,114,114,105,100,101, 40,116, 41, 10, - 32, 32, 32, 32,105,102, 32,116, 46,117,114,108, 32,116,104,101,110, 10, 32, 32, - 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,117, 32, 61, 32,117,114,108, 46, -112, 97,114,115,101, 40,116, 46,117,114,108, 41, 10, 32, 32, 32, 32, 32, 32, 32, - 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46,112, 97,105, -114,115, 40,116, 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32,117, 91,105, 93, 32, 61, 32,118, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110, -100, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,117, 10, 32, - 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,116, 32,101,110,100, - 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, - 32,116,112,117,116, 40,112,117,116,116, 41, 10, 32, 32, 32, 32,112,117,116,116, - 32, 61, 32,111,118,101,114,114,105,100,101, 40,112,117,116,116, 41, 10, 32, 32, - 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40,112,117,116,116, 46,104,111, -115,116, 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109, -101, 34, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,111,112, -101,110, 40,112,117,116,116, 46,104,111,115,116, 44, 32,112,117,116,116, 46,112, -111,114,116, 44, 32,112,117,116,116, 46, 99,114,101, 97,116,101, 41, 10, 32, 32, - 32, 32,102, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,102, 58,108,111, -103,105,110, 40,112,117,116,116, 46,117,115,101,114, 44, 32,112,117,116,116, 46, -112, 97,115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,105,102, 32,112,117,116, -116, 46,116,121,112,101, 32,116,104,101,110, 32,102, 58,116,121,112,101, 40,112, -117,116,116, 46,116,121,112,101, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58, -112, 97,115,118, 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,101,110, -116, 32, 61, 32,102, 58,115,101,110,100, 40,112,117,116,116, 41, 10, 32, 32, 32, - 32,102, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,102, 58, 99,108,111,115, -101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,110,116, 10, -101,110,100, 10, 10,108,111, 99, 97,108, 32,100,101,102, 97,117,108,116, 32, 61, - 32,123, 10, 9,112, 97,116,104, 32, 61, 32, 34, 47, 34, 44, 10, 9,115, 99,104, -101,109,101, 32, 61, 32, 34,102,116,112, 34, 10,125, 10, 10,108,111, 99, 97,108, - 32,102,117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 40,117, 41, 10, 32, - 32, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,115,111, 99,107,101,116, 46, -116,114,121, 40,117,114,108, 46,112, 97,114,115,101, 40,117, 44, 32,100,101,102, - 97,117,108,116, 41, 41, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114, -121, 40,116, 46,115, 99,104,101,109,101, 32, 61, 61, 32, 34,102,116,112, 34, 44, - 32, 34,119,114,111,110,103, 32,115, 99,104,101,109,101, 32, 39, 34, 32, 46, 46, - 32,116, 46,115, 99,104,101,109,101, 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32, - 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40,116, 46,104,111,115,116, 44, - 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109,101, 34, 41, - 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,116, 32, 61, 32, 34, 94,116, -121,112,101, 61, 40, 46, 41, 36, 34, 10, 32, 32, 32, 32,105,102, 32,116, 46,112, - 97,114, 97,109,115, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,116, - 46,116,121,112,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, - 50, 44, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,116, 46,112, 97,114, - 97,109,115, 44, 32,112, 97,116, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115, -111, 99,107,101,116, 46,116,114,121, 40,116, 46,116,121,112,101, 32, 61, 61, 32, - 34, 97, 34, 32,111,114, 32,116, 46,116,121,112,101, 32, 61, 61, 32, 34,105, 34, - 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 34,105,110,118, 97,108, -105,100, 32,116,121,112,101, 32, 39, 34, 32, 46, 46, 32,116, 46,116,121,112,101, - 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, - 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10,108,111, 99, 97,108, - 32,102,117,110, 99,116,105,111,110, 32,115,112,117,116, 40,117, 44, 32, 98,111, -100,121, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112,117,116,116, 32, 61, - 32,112, 97,114,115,101, 40,117, 41, 10, 32, 32, 32, 32,112,117,116,116, 46,115, -111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114, 99,101, - 46,115,116,114,105,110,103, 40, 98,111,100,121, 41, 10, 32, 32, 32, 32,114,101, -116,117,114,110, 32,116,112,117,116, 40,112,117,116,116, 41, 10,101,110,100, 10, - 10,112,117,116, 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116,101, 99, -116, 40,102,117,110, 99,116,105,111,110, 40,112,117,116,116, 44, 32, 98,111,100, -121, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112,101, 40, -112,117,116,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32,116,104, -101,110, 32,114,101,116,117,114,110, 32,115,112,117,116, 40,112,117,116,116, 44, - 32, 98,111,100,121, 41, 10, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117, -114,110, 32,116,112,117,116, 40,112,117,116,116, 41, 32,101,110,100, 10,101,110, -100, 41, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,116, -103,101,116, 40,103,101,116,116, 41, 10, 32, 32, 32, 32,103,101,116,116, 32, 61, - 32,111,118,101,114,114,105,100,101, 40,103,101,116,116, 41, 10, 32, 32, 32, 32, -115,111, 99,107,101,116, 46,116,114,121, 40,103,101,116,116, 46,104,111,115,116, - 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109,101, 34, - 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,111,112,101,110, - 40,103,101,116,116, 46,104,111,115,116, 44, 32,103,101,116,116, 46,112,111,114, -116, 44, 32,103,101,116,116, 46, 99,114,101, 97,116,101, 41, 10, 32, 32, 32, 32, -102, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,102, 58,108,111,103,105, -110, 40,103,101,116,116, 46,117,115,101,114, 44, 32,103,101,116,116, 46,112, 97, -115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,105,102, 32,103,101,116,116, 46, -116,121,112,101, 32,116,104,101,110, 32,102, 58,116,121,112,101, 40,103,101,116, -116, 46,116,121,112,101, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58,112, 97, -115,118, 40, 41, 10, 32, 32, 32, 32,102, 58,114,101, 99,101,105,118,101, 40,103, -101,116,116, 41, 10, 32, 32, 32, 32,102, 58,113,117,105,116, 40, 41, 10, 32, 32, - 32, 32,114,101,116,117,114,110, 32,102, 58, 99,108,111,115,101, 40, 41, 10,101, -110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115, -103,101,116, 40,117, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,103,101,116, -116, 32, 61, 32,112, 97,114,115,101, 40,117, 41, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32,103,101,116,116, 46,115, -105,110,107, 32, 61, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,116, 97, 98, -108,101, 40,116, 41, 10, 32, 32, 32, 32,116,103,101,116, 40,103,101,116,116, 41, - 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,116, 97, 98,108,101, 46, 99,111, -110, 99, 97,116, 40,116, 41, 10,101,110,100, 10, 10, 99,111,109,109, 97,110,100, - 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116,101, 99,116, 40,102,117, -110, 99,116,105,111,110, 40, 99,109,100,116, 41, 10, 32, 32, 32, 32, 99,109,100, -116, 32, 61, 32,111,118,101,114,114,105,100,101, 40, 99,109,100,116, 41, 10, 32, - 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40, 99,109,100,116, 46,104, -111,115,116, 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97, -109,101, 34, 41, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40, - 99,109,100,116, 46, 99,111,109,109, 97,110,100, 44, 32, 34,109,105,115,115,105, -110,103, 32, 99,111,109,109, 97,110,100, 34, 41, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,102, 32, 61, 32,111,112,101,110, 40, 99,109,100,116, 46,104,111,115, -116, 44, 32, 99,109,100,116, 46,112,111,114,116, 44, 32, 99,109,100,116, 46, 99, -114,101, 97,116,101, 41, 10, 32, 32, 32, 32,102, 58,103,114,101,101,116, 40, 41, - 10, 32, 32, 32, 32,102, 58,108,111,103,105,110, 40, 99,109,100,116, 46,117,115, -101,114, 44, 32, 99,109,100,116, 46,112, 97,115,115,119,111,114,100, 41, 10, 32, - 32, 32, 32,102, 46,116,114,121, 40,102, 46,116,112, 58, 99,111,109,109, 97,110, -100, 40, 99,109,100,116, 46, 99,111,109,109, 97,110,100, 44, 32, 99,109,100,116, - 46, 97,114,103,117,109,101,110,116, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 99, -109,100,116, 46, 99,104,101, 99,107, 32,116,104,101,110, 32,102, 46,116,114,121, - 40,102, 46,116,112, 58, 99,104,101, 99,107, 40, 99,109,100,116, 46, 99,104,101, - 99,107, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58,113,117,105,116, 40, - 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102, 58, 99,108,111,115,101, - 40, 41, 10,101,110,100, 41, 10, 10,103,101,116, 32, 61, 32,115,111, 99,107,101, -116, 46,112,114,111,116,101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,103, -101,116,116, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112, -101, 40,103,101,116,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32, -116,104,101,110, 32,114,101,116,117,114,110, 32,115,103,101,116, 40,103,101,116, -116, 41, 10, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,116, -103,101,116, 40,103,101,116,116, 41, 32,101,110,100, 10,101,110,100, 41, 10, 10, - -}; - - if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"ftp.lua")==0) lua_call(L, 0, 0); -} +/* code automatically generated by bin2c -- DO NOT EDIT */ +{ +/* #include'ing this file in a C program is equivalent to calling + if (luaL_loadfile(L,"ftp.lua")==0) lua_call(L, 0, 0); +*/ +/* ftp.lua */ +static const unsigned char B1[]={ + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 70, 84, 80, 32,115,117,112,112,111,114,116, 32,102,111,114, 32,116,104,101, + 32, 76,117, 97, 32,108, 97,110,103,117, 97,103,101, 10, 45, 45, 32, 76,117, 97, + 83,111, 99,107,101,116, 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65, +117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, + 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, 73,100, 58, 32,102,116,112, 46,108, +117, 97, 44,118, 32, 49, 46, 52, 53, 32, 50, 48, 48, 55, 47, 48, 55, 47, 49, 49, + 32, 49, 57, 58, 50, 53, 58, 52, 55, 32,100,105,101,103,111, 32, 69,120,112, 32, + 36, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, + 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, + 45, 32, 68,101, 99,108, 97,114,101, 32,109,111,100,117,108,101, 32, 97,110,100, + 32,105,109,112,111,114,116, 32,100,101,112,101,110,100,101,110, 99,105,101,115, + 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108, +111, 99, 97,108, 32, 98, 97,115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, + 32,116, 97, 98,108,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,116, 97, + 98,108,101, 34, 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61, + 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108, +111, 99, 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101, 40, + 34,109, 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99,107,101,116, + 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 34, 41, + 10,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32,114,101,113,117,105,114,101, + 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34, 41, 10,108,111, 99, 97,108, + 32,116,112, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101, +116, 46,116,112, 34, 41, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32, 61, + 32,114,101,113,117,105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,109,111, +100,117,108,101, 40, 34,115,111, 99,107,101,116, 46,102,116,112, 34, 41, 10, 10, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97,110,116,115, 10, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, +116,105,109,101,111,117,116, 32,105,110, 32,115,101, 99,111,110,100,115, 32, 98, +101,102,111,114,101, 32,116,104,101, 32,112,114,111,103,114, 97,109, 32,103,105, +118,101,115, 32,117,112, 32,111,110, 32, 97, 32, 99,111,110,110,101, 99,116,105, +111,110, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100, +101,102, 97,117,108,116, 32,112,111,114,116, 32,102,111,114, 32,102,116,112, 32, +115,101,114,118,105, 99,101, 10, 80, 79, 82, 84, 32, 61, 32, 50, 49, 10, 45, 45, + 32,116,104,105,115, 32,105,115, 32,116,104,101, 32,100,101,102, 97,117,108,116, + 32, 97,110,111,110,121,109,111,117,115, 32,112, 97,115,115,119,111,114,100, 46, + 32,117,115,101,100, 32,119,104,101,110, 32,110,111, 32,112, 97,115,115,119,111, +114,100, 32,105,115, 10, 45, 45, 32,112,114,111,118,105,100,101,100, 32,105,110, + 32,117,114,108, 46, 32,115,104,111,117,108,100, 32, 98,101, 32, 99,104, 97,110, +103,101,100, 32,116,111, 32,121,111,117,114, 32,101, 45,109, 97,105,108, 46, 10, + 85, 83, 69, 82, 32, 61, 32, 34,102,116,112, 34, 10, 80, 65, 83, 83, 87, 79, 82, + 68, 32, 61, 32, 34, 97,110,111,110,121,109,111,117,115, 64, 97,110,111,110,121, +109,111,117,115, 46,111,114,103, 34, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32,108,101,118,101, +108, 32, 70, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109,101,116, 97,116, 32, + 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123,125, 32,125, 10, 10, +102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,115,101,114,118,101,114, + 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32, 32, 32, +108,111, 99, 97,108, 32,116,112, 32, 61, 32,115,111, 99,107,101,116, 46,116,114, +121, 40,116,112, 46, 99,111,110,110,101, 99,116, 40,115,101,114,118,101,114, 44, + 32,112,111,114,116, 32,111,114, 32, 80, 79, 82, 84, 44, 32, 84, 73, 77, 69, 79, + 85, 84, 44, 32, 99,114,101, 97,116,101, 41, 41, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,102, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, + 97, 98,108,101, 40,123, 32,116,112, 32, 61, 32,116,112, 32,125, 44, 32,109,101, +116, 97,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114, +101, 32,101,118,101,114,121,116,104,105,110,103, 32,103,101,116,115, 32, 99,108, +111,115,101,100, 32,105,110, 32, 97,110, 32,101,120, 99,101,112,116,105,111,110, + 10, 32, 32, 32, 32,102, 46,116,114,121, 32, 61, 32,115,111, 99,107,101,116, 46, +110,101,119,116,114,121, 40,102,117,110, 99,116,105,111,110, 40, 41, 32,102, 58, + 99,108,111,115,101, 40, 41, 32,101,110,100, 41, 10, 32, 32, 32, 32,114,101,116, +117,114,110, 32,102, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, +109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112,111,114,116, 99,111, +110,110,101, 99,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, + 40,115,101,108,102, 46,115,101,114,118,101,114, 58,115,101,116,116,105,109,101, +111,117,116, 40, 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,115,101, +108,102, 46,100, 97,116, 97, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115, +101,108,102, 46,115,101,114,118,101,114, 58, 97, 99, 99,101,112,116, 40, 41, 41, + 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,100, + 97,116, 97, 58,115,101,116,116,105,109,101,111,117,116, 40, 84, 73, 77, 69, 79, + 85, 84, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, +101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112, 97,115,118, 99,111,110, +110,101, 99,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,100, 97,116, 97, + 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,111, 99,107,101,116, 46,116, + 99,112, 40, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115, +101,108,102, 46,100, 97,116, 97, 58,115,101,116,116,105,109,101,111,117,116, 40, + 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116, +114,121, 40,115,101,108,102, 46,100, 97,116, 97, 58, 99,111,110,110,101, 99,116, + 40,115,101,108,102, 46,112, 97,115,118,116, 46,105,112, 44, 32,115,101,108,102, + 46,112, 97,115,118,116, 46,112,111,114,116, 41, 41, 10,101,110,100, 10, 10,102, +117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101, +120, 58,108,111,103,105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111, +114,100, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108, +102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,117,115,101,114, 34, 44, + 32,117,115,101,114, 32,111,114, 32, 85, 83, 69, 82, 41, 41, 10, 32, 32, 32, 32, +108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108,121, 32, 61, 32, +115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, + 99,107,123, 34, 50, 46, 46, 34, 44, 32, 51, 51, 49,125, 41, 10, 32, 32, 32, 32, +105,102, 32, 99,111,100,101, 32, 61, 61, 32, 51, 51, 49, 32,116,104,101,110, 10, + 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108, +102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,112, 97,115,115, 34, 44, + 32,112, 97,115,115,119,111,114,100, 32,111,114, 32, 80, 65, 83, 83, 87, 79, 82, + 68, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, + 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, + 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114, +110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101, +116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112, 97,115,118, 40, 41, 10, 32, + 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, + 99,111,109,109, 97,110,100, 40, 34,112, 97,115,118, 34, 41, 41, 10, 32, 32, 32, + 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108,121, 32, 61, + 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104, +101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97, +108, 32,112, 97,116,116,101,114,110, 32, 61, 32, 34, 40, 37,100, 43, 41, 37, 68, + 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 37, + 68, 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 34, 10, 32, 32, 32, 32,108, +111, 99, 97,108, 32, 97, 44, 32, 98, 44, 32, 99, 44, 32,100, 44, 32,112, 49, 44, + 32,112, 50, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, + 32,115,116,114,105,110,103, 46,102,105,110,100, 40,114,101,112,108,121, 44, 32, +112, 97,116,116,101,114,110, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116, +114,121, 40, 97, 32, 97,110,100, 32, 98, 32, 97,110,100, 32, 99, 32, 97,110,100, + 32,100, 32, 97,110,100, 32,112, 49, 32, 97,110,100, 32,112, 50, 44, 32,114,101, +112,108,121, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,112, 97,115,118,116, 32, + 61, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,112, 32, 61, 32,115,116,114, +105,110,103, 46,102,111,114,109, 97,116, 40, 34, 37,100, 46, 37,100, 46, 37,100, + 46, 37,100, 34, 44, 32, 97, 44, 32, 98, 44, 32, 99, 44, 32,100, 41, 44, 10, 32, + 32, 32, 32, 32, 32, 32, 32,112,111,114,116, 32, 61, 32,112, 49, 42, 50, 53, 54, + 32, 43, 32,112, 50, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,105,102, 32,115, +101,108,102, 46,115,101,114,118,101,114, 32,116,104,101,110, 10, 32, 32, 32, 32, + 32, 32, 32, 32,115,101,108,102, 46,115,101,114,118,101,114, 58, 99,108,111,115, +101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,115,101,114, +118,101,114, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, + 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,112, 97,115,118,116, 46, +105,112, 44, 32,115,101,108,102, 46,112, 97,115,118,116, 46,112,111,114,116, 10, +101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, + 95, 95,105,110,100,101,120, 58,112,111,114,116, 40,105,112, 44, 32,112,111,114, +116, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,112, 97,115,118,116, 32, 61, 32, +110,105,108, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,105,112, 32,116,104, +101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,112, 44, 32,112,111,114,116, 32, + 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,103, +101,116, 99,111,110,116,114,111,108, 40, 41, 58,103,101,116,115,111, 99,107,110, + 97,109,101, 40, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46, +115,101,114,118,101,114, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,111, + 99,107,101,116, 46, 98,105,110,100, 40,105,112, 44, 32, 48, 41, 41, 10, 32, 32, + 32, 32, 32, 32, 32, 32,105,112, 44, 32,112,111,114,116, 32, 61, 32,115,101,108, +102, 46,116,114,121, 40,115,101,108,102, 46,115,101,114,118,101,114, 58,103,101, +116,115,111, 99,107,110, 97,109,101, 40, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, + 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,115,101,114,118,101, +114, 58,115,101,116,116,105,109,101,111,117,116, 40, 84, 73, 77, 69, 79, 85, 84, + 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, + 32,112,108, 32, 61, 32,109, 97,116,104, 46,109,111,100, 40,112,111,114,116, 44, + 32, 50, 53, 54, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112,104, 32, 61, + 32, 40,112,111,114,116, 32, 45, 32,112,108, 41, 47, 50, 53, 54, 10, 32, 32, 32, + 32,108,111, 99, 97,108, 32, 97,114,103, 32, 61, 32,115,116,114,105,110,103, 46, +103,115,117, 98, 40,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 34, + 37,115, 44, 37,100, 44, 37,100, 34, 44, 32,105,112, 44, 32,112,104, 44, 32,112, +108, 41, 44, 32, 34, 37, 46, 34, 44, 32, 34, 44, 34, 41, 10, 32, 32, 32, 32,115, +101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, + 97,110,100, 40, 34,112,111,114,116, 34, 44, 32, 97,114,103, 41, 41, 10, 32, 32, + 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99, +104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116, +117,114,110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, +109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,115,101,110,100, 40,115, +101,110,100,116, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115, +101,108,102, 46,112, 97,115,118,116, 32,111,114, 32,115,101,108,102, 46,115,101, +114,118,101,114, 44, 32, 34,110,101,101,100, 32,112,111,114,116, 32,111,114, 32, +112, 97,115,118, 32,102,105,114,115,116, 34, 41, 10, 32, 32, 32, 32, 45, 45, 32, +105,102, 32,116,104,101,114,101, 32,105,115, 32, 97, 32,112, 97,115,118,116, 32, +116, 97, 98,108,101, 44, 32,119,101, 32, 97,108,114,101, 97,100,121, 32,115,101, +110,116, 32, 97, 32, 80, 65, 83, 86, 32, 99,111,109,109, 97,110,100, 10, 32, 32, + 32, 32, 45, 45, 32,119,101, 32,106,117,115,116, 32,103,101,116, 32,116,104,101, + 32,100, 97,116, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 32,105,110,116, +111, 32,115,101,108,102, 46,100, 97,116, 97, 10, 32, 32, 32, 32,105,102, 32,115, +101,108,102, 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58, +112, 97,115,118, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32, + 32, 32, 45, 45, 32,103,101,116, 32,116,104,101, 32,116,114, 97,110,115,102,101, +114, 32, 97,114,103,117,109,101,110,116, 32, 97,110,100, 32, 99,111,109,109, 97, +110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,114,103,117,109,101,110, +116, 32, 61, 32,115,101,110,100,116, 46, 97,114,103,117,109,101,110,116, 32,111, +114, 10, 32, 32, 32, 32, 32, 32, 32, 32,117,114,108, 46,117,110,101,115, 99, 97, +112,101, 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,110,100,116, + 46,112, 97,116,104, 32,111,114, 32, 34, 34, 44, 32, 34, 94, 91, 47, 92, 92, 93, + 34, 44, 32, 34, 34, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 97,114,103,117,109, +101,110,116, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32, 97,114,103,117,109, +101,110,116, 32, 61, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,108,111, + 99, 97,108, 32, 99,111,109,109, 97,110,100, 32, 61, 32,115,101,110,100,116, 46, + 99,111,109,109, 97,110,100, 32,111,114, 32, 34,115,116,111,114, 34, 10, 32, 32, + 32, 32, 45, 45, 32,115,101,110,100, 32,116,104,101, 32,116,114, 97,110,115,102, +101,114, 32, 99,111,109,109, 97,110,100, 32, 97,110,100, 32, 99,104,101, 99,107, + 32,116,104,101, 32,114,101,112,108,121, 10, 32, 32, 32, 32,115,101,108,102, 46, +116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, + 99,111,109,109, 97,110,100, 44, 32, 97,114,103,117,109,101,110,116, 41, 41, 10, + 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108, +121, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, + 58, 99,104,101, 99,107,123, 34, 50, 46, 46, 34, 44, 32, 34, 49, 46, 46, 34,125, + 41, 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115, + 32,110,111,116, 32, 97, 32, 97, 32,112, 97,115,118,116, 32,116, 97, 98,108,101, + 44, 32,116,104,101,110, 32,116,104,101,114,101, 32,105,115, 32, 97, 32,115,101, +114,118,101,114, 10, 32, 32, 32, 32, 45, 45, 32, 97,110,100, 32,119,101, 32, 97, +108,114,101, 97,100,121, 32,115,101,110,116, 32, 97, 32, 80, 79, 82, 84, 32, 99, +111,109,109, 97,110,100, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,101, +108,102, 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58,112, +111,114,116, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32, 32, + 32, 45, 45, 32,103,101,116, 32,116,104,101, 32,115,105,110,107, 44, 32,115,111, +117,114, 99,101, 32, 97,110,100, 32,115,116,101,112, 32,102,111,114, 32,116,104, +101, 32,116,114, 97,110,115,102,101,114, 10, 32, 32, 32, 32,108,111, 99, 97,108, + 32,115,116,101,112, 32, 61, 32,115,101,110,100,116, 46,115,116,101,112, 32,111, +114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32, + 32, 32,108,111, 99, 97,108, 32,114,101, 97,100,116, 32, 61, 32,123,115,101,108, +102, 46,116,112, 46, 99,125, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104, +101, 99,107,115,116,101,112, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115, +114, 99, 44, 32,115,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32, + 99,104,101, 99,107, 32,115,116, 97,116,117,115, 32,105,110, 32, 99,111,110,116, +114,111,108, 32, 99,111,110,110,101, 99,116,105,111,110, 32,119,104,105,108,101, + 32,100,111,119,110,108,111, 97,100,105,110,103, 10, 32, 32, 32, 32, 32, 32, 32, + 32,108,111, 99, 97,108, 32,114,101, 97,100,121,116, 32, 61, 32,115,111, 99,107, +101,116, 46,115,101,108,101, 99,116, 40,114,101, 97,100,116, 44, 32,110,105,108, + 44, 32, 48, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,114,101, 97,100, +121,116, 91,116,112, 93, 32,116,104,101,110, 32, 99,111,100,101, 32, 61, 32,115, +101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99, +107, 40, 34, 50, 46, 46, 34, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, + 32, 32,114,101,116,117,114,110, 32,115,116,101,112, 40,115,114, 99, 44, 32,115, +110,107, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97, +108, 32,115,105,110,107, 32, 61, 32,115,111, 99,107,101,116, 46,115,105,110,107, + 40, 34, 99,108,111,115,101, 45,119,104,101,110, 45,100,111,110,101, 34, 44, 32, +115,101,108,102, 46,100, 97,116, 97, 41, 10, 32, 32, 32, 32, 45, 45, 32,116,114, + 97,110,115,102,101,114, 32, 97,108,108, 32,100, 97,116, 97, 32, 97,110,100, 32, + 99,104,101, 99,107, 32,101,114,114,111,114, 10, 32, 32, 32, 32,115,101,108,102, + 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46, 97,108,108, 40, +115,101,110,100,116, 46,115,111,117,114, 99,101, 44, 32,115,105,110,107, 44, 32, + 99,104,101, 99,107,115,116,101,112, 41, 41, 10, 32, 32, 32, 32,105,102, 32,115, +116,114,105,110,103, 46,102,105,110,100, 40, 99,111,100,101, 44, 32, 34, 49, 46, + 46, 34, 41, 32,116,104,101,110, 32,115,101,108,102, 46,116,114,121, 40,115,101, +108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 32, +101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,100,111,110,101, 32,119,105,116,104, + 32,100, 97,116, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 10, 32, 32, 32, + 32,115,101,108,102, 46,100, 97,116, 97, 58, 99,108,111,115,101, 40, 41, 10, 32, + 32, 32, 32, 45, 45, 32,102,105,110,100, 32,111,117,116, 32,104,111,119, 32,109, + 97,110,121, 32, 98,121,116,101,115, 32,119,101,114,101, 32,115,101,110,116, 10, + 32, 32, 32, 32,108,111, 99, 97,108, 32,115,101,110,116, 32, 61, 32,115,111, 99, +107,101,116, 46,115,107,105,112, 40, 49, 44, 32,115,101,108,102, 46,100, 97,116, + 97, 58,103,101,116,115,116, 97,116,115, 40, 41, 41, 10, 32, 32, 32, 32,115,101, +108,102, 46,100, 97,116, 97, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32,115,101,110,116, 10,101,110,100, 10, 10,102,117,110, 99,116, +105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, + 99,101,105,118,101, 40,114,101, 99,118,116, 41, 10, 32, 32, 32, 32,115,101,108, +102, 46,116,114,121, 40,115,101,108,102, 46,112, 97,115,118,116, 32,111,114, 32, +115,101,108,102, 46,115,101,114,118,101,114, 44, 32, 34,110,101,101,100, 32,112, +111,114,116, 32,111,114, 32,112, 97,115,118, 32,102,105,114,115,116, 34, 41, 10, + 32, 32, 32, 32,105,102, 32,115,101,108,102, 46,112, 97,115,118,116, 32,116,104, +101,110, 32,115,101,108,102, 58,112, 97,115,118, 99,111,110,110,101, 99,116, 40, + 41, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,114,103,117, +109,101,110,116, 32, 61, 32,114,101, 99,118,116, 46, 97,114,103,117,109,101,110, +116, 32,111,114, 10, 32, 32, 32, 32, 32, 32, 32, 32,117,114,108, 46,117,110,101, +115, 99, 97,112,101, 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,114,101, + 99,118,116, 46,112, 97,116,104, 32,111,114, 32, 34, 34, 44, 32, 34, 94, 91, 47, + 92, 92, 93, 34, 44, 32, 34, 34, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 97,114, +103,117,109,101,110,116, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32, 97,114, +103,117,109,101,110,116, 32, 61, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, + 32,108,111, 99, 97,108, 32, 99,111,109,109, 97,110,100, 32, 61, 32,114,101, 99, +118,116, 46, 99,111,109,109, 97,110,100, 32,111,114, 32, 34,114,101,116,114, 34, + 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116, +112, 58, 99,111,109,109, 97,110,100, 40, 99,111,109,109, 97,110,100, 44, 32, 97, +114,103,117,109,101,110,116, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, + 99,111,100,101, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, + 46,116,112, 58, 99,104,101, 99,107,123, 34, 49, 46, 46, 34, 44, 32, 34, 50, 46, + 46, 34,125, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,101,108,102, + 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58,112,111,114, +116, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,108, +111, 99, 97,108, 32,115,111,117,114, 99,101, 32, 61, 32,115,111, 99,107,101,116, + 46,115,111,117,114, 99,101, 40, 34,117,110,116,105,108, 45, 99,108,111,115,101, +100, 34, 44, 32,115,101,108,102, 46,100, 97,116, 97, 41, 10, 32, 32, 32, 32,108, +111, 99, 97,108, 32,115,116,101,112, 32, 61, 32,114,101, 99,118,116, 46,115,116, +101,112, 32,111,114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101, +112, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,108,116,110, 49, 50, + 46,112,117,109,112, 46, 97,108,108, 40,115,111,117,114, 99,101, 44, 32,114,101, + 99,118,116, 46,115,105,110,107, 44, 32,115,116,101,112, 41, 41, 10, 32, 32, 32, + 32,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 99,111,100,101, + 44, 32, 34, 49, 46, 46, 34, 41, 32,116,104,101,110, 32,115,101,108,102, 46,116, +114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, + 46, 34, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32,115,101,108,102, 46,100, 97, +116, 97, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46, +100, 97,116, 97, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,114,101,116,117,114, +110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101, +116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,119,100, 40,100,105,114, 41, + 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116, +112, 58, 99,111,109,109, 97,110,100, 40, 34, 99,119,100, 34, 44, 32,100,105,114, + 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, + 46,116,112, 58, 99,104,101, 99,107, 40, 50, 53, 48, 41, 41, 10, 32, 32, 32, 32, +114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105, +111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,116,121,112, +101, 40,116,121,112,101, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, + 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,116,121, +112,101, 34, 44, 32,116,121,112,101, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, + 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 50, + 48, 48, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110, +100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95, +105,110,100,101,120, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,108,111, + 99, 97,108, 32, 99,111,100,101, 32, 61, 32,115,101,108,102, 46,116,114,121, 40, +115,101,108,102, 46,116,112, 58, 99,104,101, 99,107,123, 34, 49, 46, 46, 34, 44, + 32, 34, 50, 46, 46, 34,125, 41, 10, 32, 32, 32, 32,105,102, 32,115,116,114,105, +110,103, 46,102,105,110,100, 40, 99,111,100,101, 44, 32, 34, 49, 46, 46, 34, 41, + 32,116,104,101,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, +116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 32,101,110,100, + 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10,102, +117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101, +120, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114, +121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,113, +117,105,116, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40, +115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, + 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10, +102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100, +101,120, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,105,102, 32,115,101, +108,102, 46,100, 97,116, 97, 32,116,104,101,110, 32,115,101,108,102, 46,100, 97, +116, 97, 58, 99,108,111,115,101, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,105, +102, 32,115,101,108,102, 46,115,101,114,118,101,114, 32,116,104,101,110, 32,115, +101,108,102, 46,115,101,114,118,101,114, 58, 99,108,111,115,101, 40, 41, 32,101, +110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116, +112, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 72,105,103,104, + 32,108,101,118,101,108, 32, 70, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,102, +117,110, 99,116,105,111,110, 32,111,118,101,114,114,105,100,101, 40,116, 41, 10, + 32, 32, 32, 32,105,102, 32,116, 46,117,114,108, 32,116,104,101,110, 10, 32, 32, + 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,117, 32, 61, 32,117,114,108, 46, +112, 97,114,115,101, 40,116, 46,117,114,108, 41, 10, 32, 32, 32, 32, 32, 32, 32, + 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46,112, 97,105, +114,115, 40,116, 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32,117, 91,105, 93, 32, 61, 32,118, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110, +100, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,117, 10, 32, + 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,116, 32,101,110,100, + 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, + 32,116,112,117,116, 40,112,117,116,116, 41, 10, 32, 32, 32, 32,112,117,116,116, + 32, 61, 32,111,118,101,114,114,105,100,101, 40,112,117,116,116, 41, 10, 32, 32, + 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40,112,117,116,116, 46,104,111, +115,116, 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109, +101, 34, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,111,112, +101,110, 40,112,117,116,116, 46,104,111,115,116, 44, 32,112,117,116,116, 46,112, +111,114,116, 44, 32,112,117,116,116, 46, 99,114,101, 97,116,101, 41, 10, 32, 32, + 32, 32,102, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,102, 58,108,111, +103,105,110, 40,112,117,116,116, 46,117,115,101,114, 44, 32,112,117,116,116, 46, +112, 97,115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,105,102, 32,112,117,116, +116, 46,116,121,112,101, 32,116,104,101,110, 32,102, 58,116,121,112,101, 40,112, +117,116,116, 46,116,121,112,101, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58, +112, 97,115,118, 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,101,110, +116, 32, 61, 32,102, 58,115,101,110,100, 40,112,117,116,116, 41, 10, 32, 32, 32, + 32,102, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,102, 58, 99,108,111,115, +101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,110,116, 10, +101,110,100, 10, 10,108,111, 99, 97,108, 32,100,101,102, 97,117,108,116, 32, 61, + 32,123, 10, 9,112, 97,116,104, 32, 61, 32, 34, 47, 34, 44, 10, 9,115, 99,104, +101,109,101, 32, 61, 32, 34,102,116,112, 34, 10,125, 10, 10,108,111, 99, 97,108, + 32,102,117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 40,117, 41, 10, 32, + 32, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,115,111, 99,107,101,116, 46, +116,114,121, 40,117,114,108, 46,112, 97,114,115,101, 40,117, 44, 32,100,101,102, + 97,117,108,116, 41, 41, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114, +121, 40,116, 46,115, 99,104,101,109,101, 32, 61, 61, 32, 34,102,116,112, 34, 44, + 32, 34,119,114,111,110,103, 32,115, 99,104,101,109,101, 32, 39, 34, 32, 46, 46, + 32,116, 46,115, 99,104,101,109,101, 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32, + 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40,116, 46,104,111,115,116, 44, + 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109,101, 34, 41, + 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,116, 32, 61, 32, 34, 94,116, +121,112,101, 61, 40, 46, 41, 36, 34, 10, 32, 32, 32, 32,105,102, 32,116, 46,112, + 97,114, 97,109,115, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,116, + 46,116,121,112,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, + 50, 44, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,116, 46,112, 97,114, + 97,109,115, 44, 32,112, 97,116, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115, +111, 99,107,101,116, 46,116,114,121, 40,116, 46,116,121,112,101, 32, 61, 61, 32, + 34, 97, 34, 32,111,114, 32,116, 46,116,121,112,101, 32, 61, 61, 32, 34,105, 34, + 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 34,105,110,118, 97,108, +105,100, 32,116,121,112,101, 32, 39, 34, 32, 46, 46, 32,116, 46,116,121,112,101, + 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, + 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10,108,111, 99, 97,108, + 32,102,117,110, 99,116,105,111,110, 32,115,112,117,116, 40,117, 44, 32, 98,111, +100,121, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112,117,116,116, 32, 61, + 32,112, 97,114,115,101, 40,117, 41, 10, 32, 32, 32, 32,112,117,116,116, 46,115, +111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114, 99,101, + 46,115,116,114,105,110,103, 40, 98,111,100,121, 41, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32,116,112,117,116, 40,112,117,116,116, 41, 10,101,110,100, 10, + 10,112,117,116, 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116,101, 99, +116, 40,102,117,110, 99,116,105,111,110, 40,112,117,116,116, 44, 32, 98,111,100, +121, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112,101, 40, +112,117,116,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32,116,104, +101,110, 32,114,101,116,117,114,110, 32,115,112,117,116, 40,112,117,116,116, 44, + 32, 98,111,100,121, 41, 10, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117, +114,110, 32,116,112,117,116, 40,112,117,116,116, 41, 32,101,110,100, 10,101,110, +100, 41, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,116, +103,101,116, 40,103,101,116,116, 41, 10, 32, 32, 32, 32,103,101,116,116, 32, 61, + 32,111,118,101,114,114,105,100,101, 40,103,101,116,116, 41, 10, 32, 32, 32, 32, +115,111, 99,107,101,116, 46,116,114,121, 40,103,101,116,116, 46,104,111,115,116, + 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109,101, 34, + 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,111,112,101,110, + 40,103,101,116,116, 46,104,111,115,116, 44, 32,103,101,116,116, 46,112,111,114, +116, 44, 32,103,101,116,116, 46, 99,114,101, 97,116,101, 41, 10, 32, 32, 32, 32, +102, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,102, 58,108,111,103,105, +110, 40,103,101,116,116, 46,117,115,101,114, 44, 32,103,101,116,116, 46,112, 97, +115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,105,102, 32,103,101,116,116, 46, +116,121,112,101, 32,116,104,101,110, 32,102, 58,116,121,112,101, 40,103,101,116, +116, 46,116,121,112,101, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58,112, 97, +115,118, 40, 41, 10, 32, 32, 32, 32,102, 58,114,101, 99,101,105,118,101, 40,103, +101,116,116, 41, 10, 32, 32, 32, 32,102, 58,113,117,105,116, 40, 41, 10, 32, 32, + 32, 32,114,101,116,117,114,110, 32,102, 58, 99,108,111,115,101, 40, 41, 10,101, +110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115, +103,101,116, 40,117, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,103,101,116, +116, 32, 61, 32,112, 97,114,115,101, 40,117, 41, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32,103,101,116,116, 46,115, +105,110,107, 32, 61, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,116, 97, 98, +108,101, 40,116, 41, 10, 32, 32, 32, 32,116,103,101,116, 40,103,101,116,116, 41, + 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,116, 97, 98,108,101, 46, 99,111, +110, 99, 97,116, 40,116, 41, 10,101,110,100, 10, 10, 99,111,109,109, 97,110,100, + 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116,101, 99,116, 40,102,117, +110, 99,116,105,111,110, 40, 99,109,100,116, 41, 10, 32, 32, 32, 32, 99,109,100, +116, 32, 61, 32,111,118,101,114,114,105,100,101, 40, 99,109,100,116, 41, 10, 32, + 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40, 99,109,100,116, 46,104, +111,115,116, 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97, +109,101, 34, 41, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40, + 99,109,100,116, 46, 99,111,109,109, 97,110,100, 44, 32, 34,109,105,115,115,105, +110,103, 32, 99,111,109,109, 97,110,100, 34, 41, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,102, 32, 61, 32,111,112,101,110, 40, 99,109,100,116, 46,104,111,115, +116, 44, 32, 99,109,100,116, 46,112,111,114,116, 44, 32, 99,109,100,116, 46, 99, +114,101, 97,116,101, 41, 10, 32, 32, 32, 32,102, 58,103,114,101,101,116, 40, 41, + 10, 32, 32, 32, 32,102, 58,108,111,103,105,110, 40, 99,109,100,116, 46,117,115, +101,114, 44, 32, 99,109,100,116, 46,112, 97,115,115,119,111,114,100, 41, 10, 32, + 32, 32, 32,102, 46,116,114,121, 40,102, 46,116,112, 58, 99,111,109,109, 97,110, +100, 40, 99,109,100,116, 46, 99,111,109,109, 97,110,100, 44, 32, 99,109,100,116, + 46, 97,114,103,117,109,101,110,116, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 99, +109,100,116, 46, 99,104,101, 99,107, 32,116,104,101,110, 32,102, 46,116,114,121, + 40,102, 46,116,112, 58, 99,104,101, 99,107, 40, 99,109,100,116, 46, 99,104,101, + 99,107, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58,113,117,105,116, 40, + 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102, 58, 99,108,111,115,101, + 40, 41, 10,101,110,100, 41, 10, 10,103,101,116, 32, 61, 32,115,111, 99,107,101, +116, 46,112,114,111,116,101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,103, +101,116,116, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112, +101, 40,103,101,116,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32, +116,104,101,110, 32,114,101,116,117,114,110, 32,115,103,101,116, 40,103,101,116, +116, 41, 10, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,116, +103,101,116, 40,103,101,116,116, 41, 32,101,110,100, 10,101,110,100, 41, 10, 10, + +}; + + if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"ftp.lua")==0) lua_call(L, 0, 0); +} diff --git a/src/libraries/luasocket/libluasocket/http.lua.h b/src/libraries/luasocket/libluasocket/http.lua.h index 49b8793e6..556a57bbe 100644 --- a/src/libraries/luasocket/libluasocket/http.lua.h +++ b/src/libraries/luasocket/libluasocket/http.lua.h @@ -1,621 +1,621 @@ -/* code automatically generated by bin2c -- DO NOT EDIT */ -/* #include'ing this file in a C program is equivalent to calling - if (luaL_loadfile(L,"http.lua")==0) lua_call(L, 0, 0); -*/ -{ -/* http.lua */ -static const unsigned char B1[]={ - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 72, 84, 84, 80, 47, 49, 46, 49, 32, 99,108,105,101,110,116, 32,115,117,112, -112,111,114,116, 32,102,111,114, 32,116,104,101, 32, 76,117, 97, 32,108, 97,110, -103,117, 97,103,101, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32, -116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, - 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, - 68, 58, 32, 36, 73,100, 58, 32,104,116,116,112, 46,108,117, 97, 44,118, 32, 49, - 46, 55, 49, 32, 50, 48, 48, 55, 47, 49, 48, 47, 49, 51, 32, 50, 51, 58, 53, 53, - 58, 50, 48, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, - 97,114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114, -116, 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, - 32,115,111, 99,107,101,116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115, -111, 99,107,101,116, 34, 41, 10,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32, -114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34, - 41, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32, 61, 32,114,101,113,117, -105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,108,111, 99, 97,108, 32,109, -105,109,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,109,105,109,101, 34, - 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114,101,113, -117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108,111, 99, 97,108, - 32, 98, 97,115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,116, 97, 98, -108,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,116, 97, 98,108,101, 34, - 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101,116, 46,104,116,116, -112, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 10, 45, 45, 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97, -110,116,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 10, 45, 45, 32, 99,111,110,110,101, 99,116,105,111,110, 32,116,105,109,101, -111,117,116, 32,105,110, 32,115,101, 99,111,110,100,115, 10, 84, 73, 77, 69, 79, - 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100,101,102, 97,117,108,116, 32,112, -111,114,116, 32,102,111,114, 32,100,111, 99,117,109,101,110,116, 32,114,101,116, -114,105,101,118, 97,108, 10, 80, 79, 82, 84, 32, 61, 32, 56, 48, 10, 45, 45, 32, -117,115,101,114, 32, 97,103,101,110,116, 32,102,105,101,108,100, 32,115,101,110, -116, 32,105,110, 32,114,101,113,117,101,115,116, 10, 85, 83, 69, 82, 65, 71, 69, - 78, 84, 32, 61, 32,115,111, 99,107,101,116, 46, 95, 86, 69, 82, 83, 73, 79, 78, - 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, - 45, 45, 32, 82,101, 97,100,115, 32, 77, 73, 77, 69, 32,104,101, 97,100,101,114, -115, 32,102,114,111,109, 32, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 44, - 32,117,110,102,111,108,100,105,110,103, 32,119,104,101,114,101, 32,110,101,101, -100,101,100, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,114,101, 99, -101,105,118,101,104,101, 97,100,101,114,115, 40,115,111, 99,107, 44, 32,104,101, - 97,100,101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,105,110, -101, 44, 32,110, 97,109,101, 44, 32,118, 97,108,117,101, 44, 32,101,114,114, 10, - 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104,101, 97,100,101,114, -115, 32,111,114, 32,123,125, 10, 32, 32, 32, 32, 45, 45, 32,103,101,116, 32,102, -105,114,115,116, 32,108,105,110,101, 10, 32, 32, 32, 32,108,105,110,101, 44, 32, -101,114,114, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, - 10, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116, -117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, - 32, 45, 45, 32,104,101, 97,100,101,114,115, 32,103,111, 32,117,110,116,105,108, - 32, 97, 32, 98,108, 97,110,107, 32,108,105,110,101, 32,105,115, 32,102,111,117, -110,100, 10, 32, 32, 32, 32,119,104,105,108,101, 32,108,105,110,101, 32,126, 61, - 32, 34, 34, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,103,101, -116, 32,102,105,101,108,100, 45,110, 97,109,101, 32, 97,110,100, 32,118, 97,108, -117,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,110, 97,109,101, 44, 32,118, 97,108, -117,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32, -115,116,114,105,110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, - 40, 46, 45, 41, 58, 37,115, 42, 40, 46, 42, 41, 34, 41, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32,105,102, 32,110,111,116, 32, 40,110, 97,109,101, 32, 97,110,100, - 32,118, 97,108,117,101, 41, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, -110,105,108, 44, 32, 34,109, 97,108,102,111,114,109,101,100, 32,114,101,112,111, -110,115,101, 32,104,101, 97,100,101,114,115, 34, 32,101,110,100, 10, 32, 32, 32, - 32, 32, 32, 32, 32,110, 97,109,101, 32, 61, 32,115,116,114,105,110,103, 46,108, -111,119,101,114, 40,110, 97,109,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, - 45, 32,103,101,116, 32,110,101,120,116, 32,108,105,110,101, 32, 40,118, 97,108, -117,101, 32,109,105,103,104,116, 32, 98,101, 32,102,111,108,100,101,100, 41, 10, - 32, 32, 32, 32, 32, 32, 32, 32,108,105,110,101, 44, 32,101,114,114, 32, 32, 61, - 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116,117, -114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 45, 45, 32,117,110,102,111,108,100, 32, 97,110,121, 32,102,111, -108,100,101,100, 32,118, 97,108,117,101,115, 10, 32, 32, 32, 32, 32, 32, 32, 32, -119,104,105,108,101, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,108,105, -110,101, 44, 32, 34, 94, 37,115, 34, 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32,118, 97,108,117,101, 32, 61, 32,118, 97,108,117,101, 32, - 46, 46, 32,108,105,110,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -108,105,110,101, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, - 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, - 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114, -114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 45, 45, 32,115, 97,118,101, 32,112, 97,105,114, 32,105, -110, 32,116, 97, 98,108,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,104, -101, 97,100,101,114,115, 91,110, 97,109,101, 93, 32,116,104,101,110, 32,104,101, - 97,100,101,114,115, 91,110, 97,109,101, 93, 32, 61, 32,104,101, 97,100,101,114, -115, 91,110, 97,109,101, 93, 32, 46, 46, 32, 34, 44, 32, 34, 32, 46, 46, 32,118, - 97,108,117,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,104,101, - 97,100,101,114,115, 91,110, 97,109,101, 93, 32, 61, 32,118, 97,108,117,101, 32, -101,110,100, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117, -114,110, 32,104,101, 97,100,101,114,115, 10,101,110,100, 10, 10, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 69,120,116, -114, 97, 32,115,111,117,114, 99,101,115, 32, 97,110,100, 32,115,105,110,107,115, - 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,115, -111, 99,107,101,116, 46,115,111,117,114, 99,101,116, 91, 34,104,116,116,112, 45, - 99,104,117,110,107,101,100, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, - 40,115,111, 99,107, 44, 32,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, -114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, - 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100, - 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, - 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32, - 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116, -105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105, -114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99, -116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 45, - 45, 32,103,101,116, 32, 99,104,117,110,107, 32,115,105,122,101, 44, 32,115,107, -105,112, 32,101,120,116,101,110,116,105,111,110, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,105,110,101, 44, 32,101,114,114, - 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101, -110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110, -100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, -115,105,122,101, 32, 61, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, - 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,108,105,110,101, 44, 32, 34, - 59, 46, 42, 34, 44, 32, 34, 34, 41, 44, 32, 49, 54, 41, 10, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,105,122,101, 32,116, -104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, 34,105,110,118, - 97,108,105,100, 32, 99,104,117,110,107, 32,115,105,122,101, 34, 32,101,110,100, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,119, 97,115, 32, -105,116, 32,116,104,101, 32,108, 97,115,116, 32, 99,104,117,110,107, 63, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,105,122,101, 32, 62, - 32, 48, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 45, 45, 32,105,102, 32,110,111,116, 44, 32,103,101,116, 32, 99, -104,117,110,107, 32, 97,110,100, 32,115,107,105,112, 32,116,101,114,109,105,110, - 97,116,105,110,103, 32, 67, 82, 76, 70, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32, -101,114,114, 44, 32,112, 97,114,116, 32, 61, 32,115,111, 99,107, 58,114,101, 99, -101,105,118,101, 40,115,105,122,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107, 32,116,104,101,110, - 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 32,101,110,100, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, -114,110, 32, 99,104,117,110,107, 44, 32,101,114,114, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,105,102, 32,105,116, 32,119, 97,115, 44, - 32,114,101, 97,100, 32,116,114, 97,105,108,101,114,115, 32,105,110,116,111, 32, -104,101, 97,100,101,114,115, 32,116, 97, 98,108,101, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 44, 32,101, -114,114, 32, 61, 32,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40, -115,111, 99,107, 44, 32,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,104,101, - 97,100,101,114,115, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105, -108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, - 32, 32, 32,125, 41, 10,101,110,100, 10, 10,115,111, 99,107,101,116, 46,115,105, -110,107,116, 91, 34,104,116,116,112, 45, 99,104,117,110,107,101,100, 34, 93, 32, - 61, 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10, 32, 32, 32, - 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97, -116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102, -100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114, -110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, - 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99, -116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100, -105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, - 99,116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107, 44, 32,101, -114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110, -111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110, - 32,115,111, 99,107, 58,115,101,110,100, 40, 34, 48, 92,114, 92,110, 92,114, 92, -110, 34, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -108,111, 99, 97,108, 32,115,105,122,101, 32, 61, 32,115,116,114,105,110,103, 46, -102,111,114,109, 97,116, 40, 34, 37, 88, 92,114, 92,110, 34, 44, 32,115,116,114, -105,110,103, 46,108,101,110, 40, 99,104,117,110,107, 41, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58, -115,101,110,100, 40,115,105,122,101, 32, 46, 46, 32, 32, 99,104,117,110,107, 32, - 46, 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101, -110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32, -108,101,118,101,108, 32, 72, 84, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109, -101,116, 97,116, 32, 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123, -125, 32,125, 10, 10,102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,104, -111,115,116, 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, - 32, 32, 32, 45, 45, 32, 99,114,101, 97,116,101, 32,115,111, 99,107,101,116, 32, -119,105,116,104, 32,117,115,101,114, 32, 99,111,110,110,101, 99,116, 32,102,117, -110, 99,116,105,111,110, 44, 32,111,114, 32,119,105,116,104, 32,100,101,102, 97, -117,108,116, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99, 32, 61, 32,115,111, - 99,107,101,116, 46,116,114,121, 40, 40, 99,114,101, 97,116,101, 32,111,114, 32, -115,111, 99,107,101,116, 46,116, 99,112, 41, 40, 41, 41, 10, 32, 32, 32, 32,108, -111, 99, 97,108, 32,104, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116, - 97,116, 97, 98,108,101, 40,123, 32, 99, 32, 61, 32, 99, 32,125, 44, 32,109,101, -116, 97,116, 41, 10, 32, 32, 32, 32, 45, 45, 32, 99,114,101, 97,116,101, 32,102, -105,110, 97,108,105,122,101,100, 32,116,114,121, 10, 32, 32, 32, 32,104, 46,116, -114,121, 32, 61, 32,115,111, 99,107,101,116, 46,110,101,119,116,114,121, 40,102, -117,110, 99,116,105,111,110, 40, 41, 32,104, 58, 99,108,111,115,101, 40, 41, 32, -101,110,100, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,116, 32,116,105,109,101, -111,117,116, 32, 98,101,102,111,114,101, 32, 99,111,110,110,101, 99,116,105,110, -103, 10, 32, 32, 32, 32,104, 46,116,114,121, 40, 99, 58,115,101,116,116,105,109, -101,111,117,116, 40, 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,104, - 46,116,114,121, 40, 99, 58, 99,111,110,110,101, 99,116, 40,104,111,115,116, 44, - 32,112,111,114,116, 32,111,114, 32, 80, 79, 82, 84, 41, 41, 10, 32, 32, 32, 32, - 45, 45, 32,104,101,114,101, 32,101,118,101,114,121,116,104,105,110,103, 32,119, -111,114,107,101,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,104, 10,101, -110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, - 95,105,110,100,101,120, 58,115,101,110,100,114,101,113,117,101,115,116,108,105, -110,101, 40,109,101,116,104,111,100, 44, 32,117,114,105, 41, 10, 32, 32, 32, 32, -108,111, 99, 97,108, 32,114,101,113,108,105,110,101, 32, 61, 32,115,116,114,105, -110,103, 46,102,111,114,109, 97,116, 40, 34, 37,115, 32, 37,115, 32, 72, 84, 84, - 80, 47, 49, 46, 49, 92,114, 92,110, 34, 44, 32,109,101,116,104,111,100, 32,111, -114, 32, 34, 71, 69, 84, 34, 44, 32,117,114,105, 41, 10, 32, 32, 32, 32,114,101, -116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, 99, - 58,115,101,110,100, 40,114,101,113,108,105,110,101, 41, 41, 10,101,110,100, 10, - 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110, -100,101,120, 58,115,101,110,100,104,101, 97,100,101,114,115, 40,104,101, 97,100, -101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32, 61, 32, 34, - 92,114, 92,110, 34, 10, 32, 32, 32, 32,102,111,114, 32,105, 44, 32,118, 32,105, -110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101,114,115, - 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 32, 61, 32,105, 32, 46, - 46, 32, 34, 58, 32, 34, 32, 46, 46, 32,118, 32, 46, 46, 32, 34, 92,114, 92,110, - 34, 32, 46, 46, 32,104, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,115, -101,108,102, 46,116,114,121, 40,115,101,108,102, 46, 99, 58,115,101,110,100, 40, -104, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, - 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105, -110,100,101,120, 58,115,101,110,100, 98,111,100,121, 40,104,101, 97,100,101,114, -115, 44, 32,115,111,117,114, 99,101, 44, 32,115,116,101,112, 41, 10, 32, 32, 32, - 32,115,111,117,114, 99,101, 32, 61, 32,115,111,117,114, 99,101, 32,111,114, 32, -108,116,110, 49, 50, 46,115,111,117,114, 99,101, 46,101,109,112,116,121, 40, 41, - 10, 32, 32, 32, 32,115,116,101,112, 32, 61, 32,115,116,101,112, 32,111,114, 32, -108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32, 32, 32, - 45, 45, 32,105,102, 32,119,101, 32,100,111,110, 39,116, 32,107,110,111,119, 32, -116,104,101, 32,115,105,122,101, 32,105,110, 32, 97,100,118, 97,110, 99,101, 44, - 32,115,101,110,100, 32, 99,104,117,110,107,101,100, 32, 97,110,100, 32,104,111, -112,101, 32,102,111,114, 32,116,104,101, 32, 98,101,115,116, 10, 32, 32, 32, 32, -108,111, 99, 97,108, 32,109,111,100,101, 32, 61, 32, 34,104,116,116,112, 45, 99, -104,117,110,107,101,100, 34, 10, 32, 32, 32, 32,105,102, 32,104,101, 97,100,101, -114,115, 91, 34, 99,111,110,116,101,110,116, 45,108,101,110,103,116,104, 34, 93, - 32,116,104,101,110, 32,109,111,100,101, 32, 61, 32, 34,107,101,101,112, 45,111, -112,101,110, 34, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, -115,101,108,102, 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46, - 97,108,108, 40,115,111,117,114, 99,101, 44, 32,115,111, 99,107,101,116, 46,115, -105,110,107, 40,109,111,100,101, 44, 32,115,101,108,102, 46, 99, 41, 44, 32,115, -116,101,112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, -109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118, -101,115,116, 97,116,117,115,108,105,110,101, 40, 41, 10, 32, 32, 32, 32,108,111, - 99, 97,108, 32,115,116, 97,116,117,115, 32, 61, 32,115,101,108,102, 46,116,114, -121, 40,115,101,108,102, 46, 99, 58,114,101, 99,101,105,118,101, 40, 53, 41, 41, - 10, 32, 32, 32, 32, 45, 45, 32,105,100,101,110,116,105,102,121, 32, 72, 84, 84, - 80, 47, 48, 46, 57, 32,114,101,115,112,111,110,115,101,115, 44, 32,119,104,105, - 99,104, 32,100,111, 32,110,111,116, 32, 99,111,110,116, 97,105,110, 32, 97, 32, -115,116, 97,116,117,115, 32,108,105,110,101, 10, 32, 32, 32, 32, 45, 45, 32,116, -104,105,115, 32,105,115, 32,106,117,115,116, 32, 97, 32,104,101,117,114,105,115, -116,105, 99, 44, 32, 98,117,116, 32,105,115, 32,119,104, 97,116, 32,116,104,101, - 32, 82, 70, 67, 32,114,101, 99,111,109,109,101,110,100,115, 10, 32, 32, 32, 32, -105,102, 32,115,116, 97,116,117,115, 32,126, 61, 32, 34, 72, 84, 84, 80, 47, 34, - 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,115,116, - 97,116,117,115, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,111,116,104,101, -114,119,105,115,101, 32,112,114,111, 99,101,101,100, 32,114,101, 97,100,105,110, -103, 32, 97, 32,115,116, 97,116,117,115, 32,108,105,110,101, 10, 32, 32, 32, 32, -115,116, 97,116,117,115, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101, -108,102, 46, 99, 58,114,101, 99,101,105,118,101, 40, 34, 42,108, 34, 44, 32,115, -116, 97,116,117,115, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111, -100,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32, -115,116,114,105,110,103, 46,102,105,110,100, 40,115,116, 97,116,117,115, 44, 32, - 34, 72, 84, 84, 80, 47, 37,100, 42, 37, 46, 37,100, 42, 32, 40, 37,100, 37,100, - 37,100, 41, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101, -108,102, 46,116,114,121, 40, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, - 40, 99,111,100,101, 41, 44, 32,115,116, 97,116,117,115, 41, 10,101,110,100, 10, - 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110, -100,101,120, 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40, 41, - 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116,114,121, - 40,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40,115,101,108,102, - 46, 99, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, -101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118,101, - 98,111,100,121, 40,104,101, 97,100,101,114,115, 44, 32,115,105,110,107, 44, 32, -115,116,101,112, 41, 10, 32, 32, 32, 32,115,105,110,107, 32, 61, 32,115,105,110, -107, 32,111,114, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,110,117,108,108, - 40, 41, 10, 32, 32, 32, 32,115,116,101,112, 32, 61, 32,115,116,101,112, 32,111, -114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32, - 32, 32,108,111, 99, 97,108, 32,108,101,110,103,116,104, 32, 61, 32, 98, 97,115, -101, 46,116,111,110,117,109, 98,101,114, 40,104,101, 97,100,101,114,115, 91, 34, - 99,111,110,116,101,110,116, 45,108,101,110,103,116,104, 34, 93, 41, 10, 32, 32, - 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,104,101, 97,100,101,114,115, 91, - 34,116,114, 97,110,115,102,101,114, 45,101,110, 99,111,100,105,110,103, 34, 93, - 32, 45, 45, 32,115,104,111,114,116, 99,117,116, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,109,111,100,101, 32, 61, 32, 34,100,101,102, 97,117,108,116, 34, 32, - 45, 45, 32, 99,111,110,110,101, 99,116,105,111,110, 32, 99,108,111,115,101, 10, - 32, 32, 32, 32,105,102, 32,116, 32, 97,110,100, 32,116, 32,126, 61, 32, 34,105, -100,101,110,116,105,116,121, 34, 32,116,104,101,110, 32,109,111,100,101, 32, 61, - 32, 34,104,116,116,112, 45, 99,104,117,110,107,101,100, 34, 10, 32, 32, 32, 32, -101,108,115,101,105,102, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, - 40,104,101, 97,100,101,114,115, 91, 34, 99,111,110,116,101,110,116, 45,108,101, -110,103,116,104, 34, 93, 41, 32,116,104,101,110, 32,109,111,100,101, 32, 61, 32, - 34, 98,121, 45,108,101,110,103,116,104, 34, 32,101,110,100, 10, 32, 32, 32, 32, -114,101,116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,108,116,110, 49, - 50, 46,112,117,109,112, 46, 97,108,108, 40,115,111, 99,107,101,116, 46,115,111, -117,114, 99,101, 40,109,111,100,101, 44, 32,115,101,108,102, 46, 99, 44, 32,108, -101,110,103,116,104, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,105,110,107, - 44, 32,115,116,101,112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105, -111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99, -101,105,118,101, 48, 57, 98,111,100,121, 40,115,116, 97,116,117,115, 44, 32,115, -105,110,107, 44, 32,115,116,101,112, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, - 32,115,111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114, - 99,101, 46,114,101,119,105,110,100, 40,115,111, 99,107,101,116, 46,115,111,117, -114, 99,101, 40, 34,117,110,116,105,108, 45, 99,108,111,115,101,100, 34, 44, 32, -115,101,108,102, 46, 99, 41, 41, 10, 32, 32, 32, 32,115,111,117,114, 99,101, 40, -115,116, 97,116,117,115, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115, -101,108,102, 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46, 97, -108,108, 40,115,111,117,114, 99,101, 44, 32,115,105,110,107, 44, 32,115,116,101, -112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101, -116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,108,111,115,101, 40, 41, 10, - 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58, 99,108, -111,115,101, 40, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 72,105,103,104, 32,108,101,118, -101,108, 32, 72, 84, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,102,117,110, 99, -116,105,111,110, 32, 97,100,106,117,115,116,117,114,105, 40,114,101,113,116, 41, - 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117, 32, 61, 32,114,101,113,116, 10, - 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115, 32, 97, - 32,112,114,111,120,121, 44, 32,119,101, 32,110,101,101,100, 32,116,104,101, 32, -102,117,108,108, 32,117,114,108, 46, 32,111,116,104,101,114,119,105,115,101, 44, - 32,106,117,115,116, 32, 97, 32,112, 97,114,116, 46, 10, 32, 32, 32, 32,105,102, - 32,110,111,116, 32,114,101,113,116, 46,112,114,111,120,121, 32, 97,110,100, 32, -110,111,116, 32, 80, 82, 79, 88, 89, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, - 32, 32, 32,117, 32, 61, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -112, 97,116,104, 32, 61, 32,115,111, 99,107,101,116, 46,116,114,121, 40,114,101, -113,116, 46,112, 97,116,104, 44, 32, 34,105,110,118, 97,108,105,100, 32,112, 97, -116,104, 32, 39,110,105,108, 39, 34, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,112, 97,114, 97,109,115, 32, 61, 32,114,101,113,116, 46,112, 97,114, - 97,109,115, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,113,117,101,114, -121, 32, 61, 32,114,101,113,116, 46,113,117,101,114,121, 44, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,102,114, 97,103,109,101,110,116, 32, 61, 32,114,101, -113,116, 46,102,114, 97,103,109,101,110,116, 10, 32, 32, 32, 32, 32, 32, 32, 32, -125, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, - 32,117,114,108, 46, 98,117,105,108,100, 40,117, 41, 10,101,110,100, 10, 10,108, -111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116, -112,114,111,120,121, 40,114,101,113,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97, -108, 32,112,114,111,120,121, 32, 61, 32,114,101,113,116, 46,112,114,111,120,121, - 32,111,114, 32, 80, 82, 79, 88, 89, 10, 32, 32, 32, 32,105,102, 32,112,114,111, -120,121, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,112,114,111,120, -121, 32, 61, 32,117,114,108, 46,112, 97,114,115,101, 40,112,114,111,120,121, 41, - 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,112,114,111,120, -121, 46,104,111,115,116, 44, 32,112,114,111,120,121, 46,112,111,114,116, 32,111, -114, 32, 51, 49, 50, 56, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, - 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,113,116, 46,104,111,115,116, - 44, 32,114,101,113,116, 46,112,111,114,116, 10, 32, 32, 32, 32,101,110,100, 10, -101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, - 97,100,106,117,115,116,104,101, 97,100,101,114,115, 40,114,101,113,116, 41, 10, - 32, 32, 32, 32, 45, 45, 32,100,101,102, 97,117,108,116, 32,104,101, 97,100,101, -114,115, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,111,119,101,114, 32, 61, - 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34,117,115,101,114, 45, 97,103, -101,110,116, 34, 93, 32, 61, 32, 85, 83, 69, 82, 65, 71, 69, 78, 84, 44, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 91, 34,104,111,115,116, 34, 93, 32, 61, 32,114,101, -113,116, 46,104,111,115,116, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99, -111,110,110,101, 99,116,105,111,110, 34, 93, 32, 61, 32, 34, 99,108,111,115,101, - 44, 32, 84, 69, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34,116,101, 34, - 93, 32, 61, 32, 34,116,114, 97,105,108,101,114,115, 34, 10, 32, 32, 32, 32,125, - 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,119,101, 32,104, 97,118,101, 32, 97, -117,116,104,101,110,116,105, 99, 97,116,105,111,110, 32,105,110,102,111,114,109, - 97,116,105,111,110, 44, 32,112, 97,115,115, 32,105,116, 32, 97,108,111,110,103, - 10, 32, 32, 32, 32,105,102, 32,114,101,113,116, 46,117,115,101,114, 32, 97,110, -100, 32,114,101,113,116, 46,112, 97,115,115,119,111,114,100, 32,116,104,101,110, - 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111,119,101,114, 91, 34, 97,117,116,104, -111,114,105,122, 97,116,105,111,110, 34, 93, 32, 61, 32, 10, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 34, 66, 97,115,105, 99, 32, 34, 32, 46, 46, 32, 32, - 40,109,105,109,101, 46, 98, 54, 52, 40,114,101,113,116, 46,117,115,101,114, 32, - 46, 46, 32, 34, 58, 34, 32, 46, 46, 32,114,101,113,116, 46,112, 97,115,115,119, -111,114,100, 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, - 32,111,118,101,114,114,105,100,101, 32,119,105,116,104, 32,117,115,101,114, 32, -104,101, 97,100,101,114,115, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32, -105,110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,114,101,113,116, 46,104, -101, 97,100,101,114,115, 32,111,114, 32,108,111,119,101,114, 41, 32,100,111, 10, - 32, 32, 32, 32, 32, 32, 32, 32,108,111,119,101,114, 91,115,116,114,105,110,103, - 46,108,111,119,101,114, 40,105, 41, 93, 32, 61, 32,118, 10, 32, 32, 32, 32,101, -110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,111,119,101,114, 10, -101,110,100, 10, 10, 45, 45, 32,100,101,102, 97,117,108,116, 32,117,114,108, 32, -112, 97,114,116,115, 10,108,111, 99, 97,108, 32,100,101,102, 97,117,108,116, 32, - 61, 32,123, 10, 32, 32, 32, 32,104,111,115,116, 32, 61, 32, 34, 34, 44, 10, 32, - 32, 32, 32,112,111,114,116, 32, 61, 32, 80, 79, 82, 84, 44, 10, 32, 32, 32, 32, -112, 97,116,104, 32, 61, 34, 47, 34, 44, 10, 32, 32, 32, 32,115, 99,104,101,109, -101, 32, 61, 32, 34,104,116,116,112, 34, 10,125, 10, 10,108,111, 99, 97,108, 32, -102,117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116,114,101,113,117,101, -115,116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,112, 97,114,115, -101, 32,117,114,108, 32,105,102, 32,112,114,111,118,105,100,101,100, 10, 32, 32, - 32, 32,108,111, 99, 97,108, 32,110,114,101,113,116, 32, 61, 32,114,101,113,116, - 46,117,114,108, 32, 97,110,100, 32,117,114,108, 46,112, 97,114,115,101, 40,114, -101,113,116, 46,117,114,108, 44, 32,100,101,102, 97,117,108,116, 41, 32,111,114, - 32,123,125, 10, 32, 32, 32, 32, 45, 45, 32,101,120,112,108,105, 99,105,116, 32, - 99,111,109,112,111,110,101,110,116,115, 32,111,118,101,114,114,105,100,101, 32, -117,114,108, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, - 97,115,101, 46,112, 97,105,114,115, 40,114,101,113,116, 41, 32,100,111, 32,110, -114,101,113,116, 91,105, 93, 32, 61, 32,118, 32,101,110,100, 10, 32, 32, 32, 32, -105,102, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61, 61, 32, 34, 34, 32, -116,104,101,110, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61, 32, 56, 48, - 32,101,110,100, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40, -110,114,101,113,116, 46,104,111,115,116, 32, 97,110,100, 32,110,114,101,113,116, - 46,104,111,115,116, 32,126, 61, 32, 34, 34, 44, 32, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 34,105,110,118, 97,108,105,100, 32,104,111,115,116, 32, 39, 34, 32, 46, - 46, 32, 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110,114,101,113, -116, 46,104,111,115,116, 41, 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32, 32, 32, - 45, 45, 32, 99,111,109,112,117,116,101, 32,117,114,105, 32,105,102, 32,117,115, -101,114, 32,104, 97,115,110, 39,116, 32,111,118,101,114,114,105,100,101,110, 10, - 32, 32, 32, 32,110,114,101,113,116, 46,117,114,105, 32, 61, 32,114,101,113,116, - 46,117,114,105, 32,111,114, 32, 97,100,106,117,115,116,117,114,105, 40,110,114, -101,113,116, 41, 10, 32, 32, 32, 32, 45, 45, 32, 97,106,117,115,116, 32,104,111, -115,116, 32, 97,110,100, 32,112,111,114,116, 32,105,102, 32,116,104,101,114,101, - 32,105,115, 32, 97, 32,112,114,111,120,121, 10, 32, 32, 32, 32,110,114,101,113, -116, 46,104,111,115,116, 44, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61, - 32, 97,100,106,117,115,116,112,114,111,120,121, 40,110,114,101,113,116, 41, 10, - 32, 32, 32, 32, 45, 45, 32, 97,100,106,117,115,116, 32,104,101, 97,100,101,114, -115, 32,105,110, 32,114,101,113,117,101,115,116, 10, 32, 32, 32, 32,110,114,101, -113,116, 46,104,101, 97,100,101,114,115, 32, 61, 32, 97,100,106,117,115,116,104, -101, 97,100,101,114,115, 40,110,114,101,113,116, 41, 10, 32, 32, 32, 32,114,101, -116,117,114,110, 32,110,114,101,113,116, 10,101,110,100, 10, 10,108,111, 99, 97, -108, 32,102,117,110, 99,116,105,111,110, 32,115,104,111,117,108,100,114,101,100, -105,114,101, 99,116, 40,114,101,113,116, 44, 32, 99,111,100,101, 44, 32,104,101, - 97,100,101,114,115, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,104,101, - 97,100,101,114,115, 46,108,111, 99, 97,116,105,111,110, 32, 97,110,100, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116,114,105,110,103, 46,103,115,117, - 98, 40,104,101, 97,100,101,114,115, 46,108,111, 99, 97,116,105,111,110, 44, 32, - 34, 37,115, 34, 44, 32, 34, 34, 41, 32,126, 61, 32, 34, 34, 32, 97,110,100, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40,114,101,113,116, 46,114,101,100, -105,114,101, 99,116, 32,126, 61, 32,102, 97,108,115,101, 41, 32, 97,110,100, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 99,111,100,101, 32, 61, 61, 32, - 51, 48, 49, 32,111,114, 32, 99,111,100,101, 32, 61, 61, 32, 51, 48, 50, 41, 32, - 97,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40,110,111,116, 32, -114,101,113,116, 46,109,101,116,104,111,100, 32,111,114, 32,114,101,113,116, 46, -109,101,116,104,111,100, 32, 61, 61, 32, 34, 71, 69, 84, 34, 32,111,114, 32,114, -101,113,116, 46,109,101,116,104,111,100, 32, 61, 61, 32, 34, 72, 69, 65, 68, 34, - 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97,110,100, 32, 40,110,111, -116, 32,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32,111,114, - 32,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32, 60, 32, 53, - 41, 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111, -110, 32,115,104,111,117,108,100,114,101, 99,101,105,118,101, 98,111,100,121, 40, -114,101,113,116, 44, 32, 99,111,100,101, 41, 10, 32, 32, 32, 32,105,102, 32,114, -101,113,116, 46,109,101,116,104,111,100, 32, 61, 61, 32, 34, 72, 69, 65, 68, 34, - 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 32,101,110,100, - 10, 32, 32, 32, 32,105,102, 32, 99,111,100,101, 32, 61, 61, 32, 50, 48, 52, 32, -111,114, 32, 99,111,100,101, 32, 61, 61, 32, 51, 48, 52, 32,116,104,101,110, 32, -114,101,116,117,114,110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,105, -102, 32, 99,111,100,101, 32, 62, 61, 32, 49, 48, 48, 32, 97,110,100, 32, 99,111, -100,101, 32, 60, 32, 50, 48, 48, 32,116,104,101,110, 32,114,101,116,117,114,110, - 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, - 49, 10,101,110,100, 10, 10, 45, 45, 32,102,111,114,119, 97,114,100, 32,100,101, - 99,108, 97,114, 97,116,105,111,110,115, 10,108,111, 99, 97,108, 32,116,114,101, -113,117,101,115,116, 44, 32,116,114,101,100,105,114,101, 99,116, 10, 10,102,117, -110, 99,116,105,111,110, 32,116,114,101,100,105,114,101, 99,116, 40,114,101,113, -116, 44, 32,108,111, 99, 97,116,105,111,110, 41, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,114,101,115,117,108,116, 44, 32, 99,111,100,101, 44, 32,104,101, 97, -100,101,114,115, 44, 32,115,116, 97,116,117,115, 32, 61, 32,116,114,101,113,117, -101,115,116, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,116,104,101, - 32, 82, 70, 67, 32,115, 97,121,115, 32,116,104,101, 32,114,101,100,105,114,101, - 99,116, 32, 85, 82, 76, 32,104, 97,115, 32,116,111, 32, 98,101, 32, 97, 98,115, -111,108,117,116,101, 44, 32, 98,117,116, 32,115,111,109,101, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 45, 45, 32,115,101,114,118,101,114,115, 32,100,111, 32,110,111, -116, 32,114,101,115,112,101, 99,116, 32,116,104, 97,116, 10, 32, 32, 32, 32, 32, - 32, 32, 32,117,114,108, 32, 61, 32,117,114,108, 46, 97, 98,115,111,108,117,116, -101, 40,114,101,113,116, 46,117,114,108, 44, 32,108,111, 99, 97,116,105,111,110, - 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,111,117,114, 99,101, 32, 61, 32, -114,101,113,116, 46,115,111,117,114, 99,101, 44, 10, 32, 32, 32, 32, 32, 32, 32, - 32,115,105,110,107, 32, 61, 32,114,101,113,116, 46,115,105,110,107, 44, 10, 32, - 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,114,101,113, -116, 46,104,101, 97,100,101,114,115, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, -114,111,120,121, 32, 61, 32,114,101,113,116, 46,112,114,111,120,121, 44, 32, 10, - 32, 32, 32, 32, 32, 32, 32, 32,110,114,101,100,105,114,101, 99,116,115, 32, 61, - 32, 40,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32,111,114, - 32, 48, 41, 32, 43, 32, 49, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99,114,101, - 97,116,101, 32, 61, 32,114,101,113,116, 46, 99,114,101, 97,116,101, 10, 32, 32, - 32, 32,125, 32, 32, 32, 10, 32, 32, 32, 32, 45, 45, 32,112, 97,115,115, 32,108, -111, 99, 97,116,105,111,110, 32,104,101, 97,100,101,114, 32, 98, 97, 99,107, 32, - 97,115, 32, 97, 32,104,105,110,116, 32,119,101, 32,114,101,100,105,114,101, 99, -116,101,100, 10, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104,101, - 97,100,101,114,115, 32,111,114, 32,123,125, 10, 32, 32, 32, 32,104,101, 97,100, -101,114,115, 46,108,111, 99, 97,116,105,111,110, 32, 61, 32,104,101, 97,100,101, -114,115, 46,108,111, 99, 97,116,105,111,110, 32,111,114, 32,108,111, 99, 97,116, -105,111,110, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,115,117,108, -116, 44, 32, 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 44, 32,115,116, - 97,116,117,115, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,116, -114,101,113,117,101,115,116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32, 45, 45, - 32,119,101, 32,108,111,111,112, 32,117,110,116,105,108, 32,119,101, 32,103,101, -116, 32,119,104, 97,116, 32,119,101, 32,119, 97,110,116, 44, 32,111,114, 10, 32, - 32, 32, 32, 45, 45, 32,117,110,116,105,108, 32,119,101, 32, 97,114,101, 32,115, -117,114,101, 32,116,104,101,114,101, 32,105,115, 32,110,111, 32,119, 97,121, 32, -116,111, 32,103,101,116, 32,105,116, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, -110,114,101,113,116, 32, 61, 32, 97,100,106,117,115,116,114,101,113,117,101,115, -116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32, - 61, 32,111,112,101,110, 40,110,114,101,113,116, 46,104,111,115,116, 44, 32,110, -114,101,113,116, 46,112,111,114,116, 44, 32,110,114,101,113,116, 46, 99,114,101, - 97,116,101, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,114,101,113, -117,101,115,116, 32,108,105,110,101, 32, 97,110,100, 32,104,101, 97,100,101,114, -115, 10, 32, 32, 32, 32,104, 58,115,101,110,100,114,101,113,117,101,115,116,108, -105,110,101, 40,110,114,101,113,116, 46,109,101,116,104,111,100, 44, 32,110,114, -101,113,116, 46,117,114,105, 41, 10, 32, 32, 32, 32,104, 58,115,101,110,100,104, -101, 97,100,101,114,115, 40,110,114,101,113,116, 46,104,101, 97,100,101,114,115, - 41, 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115, - 32, 97, 32, 98,111,100,121, 44, 32,115,101,110,100, 32,105,116, 10, 32, 32, 32, - 32,105,102, 32,110,114,101,113,116, 46,115,111,117,114, 99,101, 32,116,104,101, -110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 58,115,101,110,100, 98,111,100,121, - 40,110,114,101,113,116, 46,104,101, 97,100,101,114,115, 44, 32,110,114,101,113, -116, 46,115,111,117,114, 99,101, 44, 32,110,114,101,113,116, 46,115,116,101,112, - 41, 32, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, - 32, 99,111,100,101, 44, 32,115,116, 97,116,117,115, 32, 61, 32,104, 58,114,101, - 99,101,105,118,101,115,116, 97,116,117,115,108,105,110,101, 40, 41, 10, 32, 32, - 32, 32, 45, 45, 32,105,102, 32,105,116, 32,105,115, 32, 97,110, 32, 72, 84, 84, - 80, 47, 48, 46, 57, 32,115,101,114,118,101,114, 44, 32,115,105,109,112,108,121, - 32,103,101,116, 32,116,104,101, 32, 98,111,100,121, 32, 97,110,100, 32,119,101, - 32, 97,114,101, 32,100,111,110,101, 10, 32, 32, 32, 32,105,102, 32,110,111,116, - 32, 99,111,100,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, - 58,114,101, 99,101,105,118,101, 48, 57, 98,111,100,121, 40,115,116, 97,116,117, -115, 44, 32,110,114,101,113,116, 46,115,105,110,107, 44, 32,110,114,101,113,116, - 46,115,116,101,112, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114, -110, 32, 49, 44, 32, 50, 48, 48, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, - 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115, 10, 32, 32, 32, 32, 45, - 45, 32,105,103,110,111,114,101, 32, 97,110,121, 32, 49, 48, 48, 45, 99,111,110, -116,105,110,117,101, 32,109,101,115,115, 97,103,101,115, 10, 32, 32, 32, 32,119, -104,105,108,101, 32, 99,111,100,101, 32, 61, 61, 32, 49, 48, 48, 32,100,111, 32, - 10, 32, 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104, - 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40, 41, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 99,111,100,101, 44, 32,115,116, 97,116,117,115, 32, 61, - 32,104, 58,114,101, 99,101,105,118,101,115,116, 97,116,117,115,108,105,110,101, - 40, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,104,101, 97,100,101, -114,115, 32, 61, 32,104, 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114, -115, 40, 41, 10, 32, 32, 32, 32, 45, 45, 32, 97,116, 32,116,104,105,115, 32,112, -111,105,110,116, 32,119,101, 32,115,104,111,117,108,100, 32,104, 97,118,101, 32, - 97, 32,104,111,110,101,115,116, 32,114,101,112,108,121, 32,102,114,111,109, 32, -116,104,101, 32,115,101,114,118,101,114, 10, 32, 32, 32, 32, 45, 45, 32,119,101, - 32, 99, 97,110, 39,116, 32,114,101,100,105,114,101, 99,116, 32,105,102, 32,119, -101, 32, 97,108,114,101, 97,100,121, 32,117,115,101,100, 32,116,104,101, 32,115, -111,117,114, 99,101, 44, 32,115,111, 32,119,101, 32,114,101,112,111,114,116, 32, -116,104,101, 32,101,114,114,111,114, 32, 10, 32, 32, 32, 32,105,102, 32,115,104, -111,117,108,100,114,101,100,105,114,101, 99,116, 40,110,114,101,113,116, 44, 32, - 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 41, 32, 97,110,100, 32,110, -111,116, 32,110,114,101,113,116, 46,115,111,117,114, 99,101, 32,116,104,101,110, - 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 58, 99,108,111,115,101, 40, 41, 10, 32, - 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,116,114,101,100,105,114, -101, 99,116, 40,114,101,113,116, 44, 32,104,101, 97,100,101,114,115, 46,108,111, - 99, 97,116,105,111,110, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, - 45, 45, 32,104,101,114,101, 32,119,101, 32, 97,114,101, 32,102,105,110, 97,108, -108,121, 32,100,111,110,101, 10, 32, 32, 32, 32,105,102, 32,115,104,111,117,108, -100,114,101, 99,101,105,118,101, 98,111,100,121, 40,110,114,101,113,116, 44, 32, - 99,111,100,101, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, - 58,114,101, 99,101,105,118,101, 98,111,100,121, 40,104,101, 97,100,101,114,115, - 44, 32,110,114,101,113,116, 46,115,105,110,107, 44, 32,110,114,101,113,116, 46, -115,116,101,112, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,104, 58, - 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, - 44, 32, 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 44, 32,115,116, 97, -116,117,115, 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116, -105,111,110, 32,115,114,101,113,117,101,115,116, 40,117, 44, 32, 98, 41, 10, 32, - 32, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32, -108,111, 99, 97,108, 32,114,101,113,116, 32, 61, 32,123, 10, 32, 32, 32, 32, 32, - 32, 32, 32,117,114,108, 32, 61, 32,117, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, -115,105,110,107, 32, 61, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,116, 97, - 98,108,101, 40,116, 41, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,105,102, 32, - 98, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,113,116, 46, -115,111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114, 99, -101, 46,115,116,114,105,110,103, 40, 98, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, -114,101,113,116, 46,104,101, 97,100,101,114,115, 32, 61, 32,123, 10, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99,111,110,116,101,110,116, 45,108, -101,110,103,116,104, 34, 93, 32, 61, 32,115,116,114,105,110,103, 46,108,101,110, - 40, 98, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99, -111,110,116,101,110,116, 45,116,121,112,101, 34, 93, 32, 61, 32, 34, 97,112,112, -108,105, 99, 97,116,105,111,110, 47,120, 45,119,119,119, 45,102,111,114,109, 45, -117,114,108,101,110, 99,111,100,101,100, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, -125, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,113,116, 46,109,101,116,104,111, -100, 32, 61, 32, 34, 80, 79, 83, 84, 34, 10, 32, 32, 32, 32,101,110,100, 10, 32, - 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,104,101, 97,100,101, -114,115, 44, 32,115,116, 97,116,117,115, 32, 61, 32,115,111, 99,107,101,116, 46, -115,107,105,112, 40, 49, 44, 32,116,114,101,113,117,101,115,116, 40,114,101,113, -116, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,116, 97, 98,108,101, - 46, 99,111,110, 99, 97,116, 40,116, 41, 44, 32, 99,111,100,101, 44, 32,104,101, - 97,100,101,114,115, 44, 32,115,116, 97,116,117,115, 10,101,110,100, 10, 10,114, -101,113,117,101,115,116, 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116, -101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,114,101,113,116, 44, 32, 98, -111,100,121, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112, -101, 40,114,101,113,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32, -116,104,101,110, 32,114,101,116,117,114,110, 32,115,114,101,113,117,101,115,116, - 40,114,101,113,116, 44, 32, 98,111,100,121, 41, 10, 32, 32, 32, 32,101,108,115, -101, 32,114,101,116,117,114,110, 32,116,114,101,113,117,101,115,116, 40,114,101, -113,116, 41, 32,101,110,100, 10,101,110,100, 41, 10, -}; - - if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"http.lua")==0) lua_call(L, 0, 0); -} +/* code automatically generated by bin2c -- DO NOT EDIT */ +/* #include'ing this file in a C program is equivalent to calling + if (luaL_loadfile(L,"http.lua")==0) lua_call(L, 0, 0); +*/ +{ +/* http.lua */ +static const unsigned char B1[]={ + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 72, 84, 84, 80, 47, 49, 46, 49, 32, 99,108,105,101,110,116, 32,115,117,112, +112,111,114,116, 32,102,111,114, 32,116,104,101, 32, 76,117, 97, 32,108, 97,110, +103,117, 97,103,101, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32, +116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, + 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, + 68, 58, 32, 36, 73,100, 58, 32,104,116,116,112, 46,108,117, 97, 44,118, 32, 49, + 46, 55, 49, 32, 50, 48, 48, 55, 47, 49, 48, 47, 49, 51, 32, 50, 51, 58, 53, 53, + 58, 50, 48, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, + 97,114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114, +116, 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, + 32,115,111, 99,107,101,116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115, +111, 99,107,101,116, 34, 41, 10,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32, +114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34, + 41, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32, 61, 32,114,101,113,117, +105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,108,111, 99, 97,108, 32,109, +105,109,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,109,105,109,101, 34, + 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114,101,113, +117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108,111, 99, 97,108, + 32, 98, 97,115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,116, 97, 98, +108,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,116, 97, 98,108,101, 34, + 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101,116, 46,104,116,116, +112, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 10, 45, 45, 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97, +110,116,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 10, 45, 45, 32, 99,111,110,110,101, 99,116,105,111,110, 32,116,105,109,101, +111,117,116, 32,105,110, 32,115,101, 99,111,110,100,115, 10, 84, 73, 77, 69, 79, + 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100,101,102, 97,117,108,116, 32,112, +111,114,116, 32,102,111,114, 32,100,111, 99,117,109,101,110,116, 32,114,101,116, +114,105,101,118, 97,108, 10, 80, 79, 82, 84, 32, 61, 32, 56, 48, 10, 45, 45, 32, +117,115,101,114, 32, 97,103,101,110,116, 32,102,105,101,108,100, 32,115,101,110, +116, 32,105,110, 32,114,101,113,117,101,115,116, 10, 85, 83, 69, 82, 65, 71, 69, + 78, 84, 32, 61, 32,115,111, 99,107,101,116, 46, 95, 86, 69, 82, 83, 73, 79, 78, + 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, + 45, 45, 32, 82,101, 97,100,115, 32, 77, 73, 77, 69, 32,104,101, 97,100,101,114, +115, 32,102,114,111,109, 32, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 44, + 32,117,110,102,111,108,100,105,110,103, 32,119,104,101,114,101, 32,110,101,101, +100,101,100, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,114,101, 99, +101,105,118,101,104,101, 97,100,101,114,115, 40,115,111, 99,107, 44, 32,104,101, + 97,100,101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,105,110, +101, 44, 32,110, 97,109,101, 44, 32,118, 97,108,117,101, 44, 32,101,114,114, 10, + 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104,101, 97,100,101,114, +115, 32,111,114, 32,123,125, 10, 32, 32, 32, 32, 45, 45, 32,103,101,116, 32,102, +105,114,115,116, 32,108,105,110,101, 10, 32, 32, 32, 32,108,105,110,101, 44, 32, +101,114,114, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, + 10, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116, +117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, + 32, 45, 45, 32,104,101, 97,100,101,114,115, 32,103,111, 32,117,110,116,105,108, + 32, 97, 32, 98,108, 97,110,107, 32,108,105,110,101, 32,105,115, 32,102,111,117, +110,100, 10, 32, 32, 32, 32,119,104,105,108,101, 32,108,105,110,101, 32,126, 61, + 32, 34, 34, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,103,101, +116, 32,102,105,101,108,100, 45,110, 97,109,101, 32, 97,110,100, 32,118, 97,108, +117,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,110, 97,109,101, 44, 32,118, 97,108, +117,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32, +115,116,114,105,110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, + 40, 46, 45, 41, 58, 37,115, 42, 40, 46, 42, 41, 34, 41, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32,105,102, 32,110,111,116, 32, 40,110, 97,109,101, 32, 97,110,100, + 32,118, 97,108,117,101, 41, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, +110,105,108, 44, 32, 34,109, 97,108,102,111,114,109,101,100, 32,114,101,112,111, +110,115,101, 32,104,101, 97,100,101,114,115, 34, 32,101,110,100, 10, 32, 32, 32, + 32, 32, 32, 32, 32,110, 97,109,101, 32, 61, 32,115,116,114,105,110,103, 46,108, +111,119,101,114, 40,110, 97,109,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, + 45, 32,103,101,116, 32,110,101,120,116, 32,108,105,110,101, 32, 40,118, 97,108, +117,101, 32,109,105,103,104,116, 32, 98,101, 32,102,111,108,100,101,100, 41, 10, + 32, 32, 32, 32, 32, 32, 32, 32,108,105,110,101, 44, 32,101,114,114, 32, 32, 61, + 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116,117, +114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 45, 45, 32,117,110,102,111,108,100, 32, 97,110,121, 32,102,111, +108,100,101,100, 32,118, 97,108,117,101,115, 10, 32, 32, 32, 32, 32, 32, 32, 32, +119,104,105,108,101, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,108,105, +110,101, 44, 32, 34, 94, 37,115, 34, 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32,118, 97,108,117,101, 32, 61, 32,118, 97,108,117,101, 32, + 46, 46, 32,108,105,110,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +108,105,110,101, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, + 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, + 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114, +114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 45, 45, 32,115, 97,118,101, 32,112, 97,105,114, 32,105, +110, 32,116, 97, 98,108,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,104, +101, 97,100,101,114,115, 91,110, 97,109,101, 93, 32,116,104,101,110, 32,104,101, + 97,100,101,114,115, 91,110, 97,109,101, 93, 32, 61, 32,104,101, 97,100,101,114, +115, 91,110, 97,109,101, 93, 32, 46, 46, 32, 34, 44, 32, 34, 32, 46, 46, 32,118, + 97,108,117,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,104,101, + 97,100,101,114,115, 91,110, 97,109,101, 93, 32, 61, 32,118, 97,108,117,101, 32, +101,110,100, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117, +114,110, 32,104,101, 97,100,101,114,115, 10,101,110,100, 10, 10, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 69,120,116, +114, 97, 32,115,111,117,114, 99,101,115, 32, 97,110,100, 32,115,105,110,107,115, + 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,115, +111, 99,107,101,116, 46,115,111,117,114, 99,101,116, 91, 34,104,116,116,112, 45, + 99,104,117,110,107,101,100, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, + 40,115,111, 99,107, 44, 32,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, +114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, + 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100, + 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, + 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32, + 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116, +105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105, +114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99, +116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 45, + 45, 32,103,101,116, 32, 99,104,117,110,107, 32,115,105,122,101, 44, 32,115,107, +105,112, 32,101,120,116,101,110,116,105,111,110, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,105,110,101, 44, 32,101,114,114, + 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101, +110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110, +100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, +115,105,122,101, 32, 61, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, + 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,108,105,110,101, 44, 32, 34, + 59, 46, 42, 34, 44, 32, 34, 34, 41, 44, 32, 49, 54, 41, 10, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,105,122,101, 32,116, +104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, 34,105,110,118, + 97,108,105,100, 32, 99,104,117,110,107, 32,115,105,122,101, 34, 32,101,110,100, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,119, 97,115, 32, +105,116, 32,116,104,101, 32,108, 97,115,116, 32, 99,104,117,110,107, 63, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,105,122,101, 32, 62, + 32, 48, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 45, 45, 32,105,102, 32,110,111,116, 44, 32,103,101,116, 32, 99, +104,117,110,107, 32, 97,110,100, 32,115,107,105,112, 32,116,101,114,109,105,110, + 97,116,105,110,103, 32, 67, 82, 76, 70, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32, +101,114,114, 44, 32,112, 97,114,116, 32, 61, 32,115,111, 99,107, 58,114,101, 99, +101,105,118,101, 40,115,105,122,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107, 32,116,104,101,110, + 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 32,101,110,100, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, +114,110, 32, 99,104,117,110,107, 44, 32,101,114,114, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,105,102, 32,105,116, 32,119, 97,115, 44, + 32,114,101, 97,100, 32,116,114, 97,105,108,101,114,115, 32,105,110,116,111, 32, +104,101, 97,100,101,114,115, 32,116, 97, 98,108,101, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 44, 32,101, +114,114, 32, 61, 32,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40, +115,111, 99,107, 44, 32,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,104,101, + 97,100,101,114,115, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105, +108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, + 32, 32, 32,125, 41, 10,101,110,100, 10, 10,115,111, 99,107,101,116, 46,115,105, +110,107,116, 91, 34,104,116,116,112, 45, 99,104,117,110,107,101,100, 34, 93, 32, + 61, 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10, 32, 32, 32, + 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97, +116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102, +100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114, +110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, + 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99, +116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100, +105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, + 99,116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107, 44, 32,101, +114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110, +111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110, + 32,115,111, 99,107, 58,115,101,110,100, 40, 34, 48, 92,114, 92,110, 92,114, 92, +110, 34, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +108,111, 99, 97,108, 32,115,105,122,101, 32, 61, 32,115,116,114,105,110,103, 46, +102,111,114,109, 97,116, 40, 34, 37, 88, 92,114, 92,110, 34, 44, 32,115,116,114, +105,110,103, 46,108,101,110, 40, 99,104,117,110,107, 41, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58, +115,101,110,100, 40,115,105,122,101, 32, 46, 46, 32, 32, 99,104,117,110,107, 32, + 46, 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101, +110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32, +108,101,118,101,108, 32, 72, 84, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109, +101,116, 97,116, 32, 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123, +125, 32,125, 10, 10,102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,104, +111,115,116, 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, + 32, 32, 32, 45, 45, 32, 99,114,101, 97,116,101, 32,115,111, 99,107,101,116, 32, +119,105,116,104, 32,117,115,101,114, 32, 99,111,110,110,101, 99,116, 32,102,117, +110, 99,116,105,111,110, 44, 32,111,114, 32,119,105,116,104, 32,100,101,102, 97, +117,108,116, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99, 32, 61, 32,115,111, + 99,107,101,116, 46,116,114,121, 40, 40, 99,114,101, 97,116,101, 32,111,114, 32, +115,111, 99,107,101,116, 46,116, 99,112, 41, 40, 41, 41, 10, 32, 32, 32, 32,108, +111, 99, 97,108, 32,104, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116, + 97,116, 97, 98,108,101, 40,123, 32, 99, 32, 61, 32, 99, 32,125, 44, 32,109,101, +116, 97,116, 41, 10, 32, 32, 32, 32, 45, 45, 32, 99,114,101, 97,116,101, 32,102, +105,110, 97,108,105,122,101,100, 32,116,114,121, 10, 32, 32, 32, 32,104, 46,116, +114,121, 32, 61, 32,115,111, 99,107,101,116, 46,110,101,119,116,114,121, 40,102, +117,110, 99,116,105,111,110, 40, 41, 32,104, 58, 99,108,111,115,101, 40, 41, 32, +101,110,100, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,116, 32,116,105,109,101, +111,117,116, 32, 98,101,102,111,114,101, 32, 99,111,110,110,101, 99,116,105,110, +103, 10, 32, 32, 32, 32,104, 46,116,114,121, 40, 99, 58,115,101,116,116,105,109, +101,111,117,116, 40, 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,104, + 46,116,114,121, 40, 99, 58, 99,111,110,110,101, 99,116, 40,104,111,115,116, 44, + 32,112,111,114,116, 32,111,114, 32, 80, 79, 82, 84, 41, 41, 10, 32, 32, 32, 32, + 45, 45, 32,104,101,114,101, 32,101,118,101,114,121,116,104,105,110,103, 32,119, +111,114,107,101,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,104, 10,101, +110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, + 95,105,110,100,101,120, 58,115,101,110,100,114,101,113,117,101,115,116,108,105, +110,101, 40,109,101,116,104,111,100, 44, 32,117,114,105, 41, 10, 32, 32, 32, 32, +108,111, 99, 97,108, 32,114,101,113,108,105,110,101, 32, 61, 32,115,116,114,105, +110,103, 46,102,111,114,109, 97,116, 40, 34, 37,115, 32, 37,115, 32, 72, 84, 84, + 80, 47, 49, 46, 49, 92,114, 92,110, 34, 44, 32,109,101,116,104,111,100, 32,111, +114, 32, 34, 71, 69, 84, 34, 44, 32,117,114,105, 41, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, 99, + 58,115,101,110,100, 40,114,101,113,108,105,110,101, 41, 41, 10,101,110,100, 10, + 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110, +100,101,120, 58,115,101,110,100,104,101, 97,100,101,114,115, 40,104,101, 97,100, +101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32, 61, 32, 34, + 92,114, 92,110, 34, 10, 32, 32, 32, 32,102,111,114, 32,105, 44, 32,118, 32,105, +110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101,114,115, + 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 32, 61, 32,105, 32, 46, + 46, 32, 34, 58, 32, 34, 32, 46, 46, 32,118, 32, 46, 46, 32, 34, 92,114, 92,110, + 34, 32, 46, 46, 32,104, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,115, +101,108,102, 46,116,114,121, 40,115,101,108,102, 46, 99, 58,115,101,110,100, 40, +104, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, + 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105, +110,100,101,120, 58,115,101,110,100, 98,111,100,121, 40,104,101, 97,100,101,114, +115, 44, 32,115,111,117,114, 99,101, 44, 32,115,116,101,112, 41, 10, 32, 32, 32, + 32,115,111,117,114, 99,101, 32, 61, 32,115,111,117,114, 99,101, 32,111,114, 32, +108,116,110, 49, 50, 46,115,111,117,114, 99,101, 46,101,109,112,116,121, 40, 41, + 10, 32, 32, 32, 32,115,116,101,112, 32, 61, 32,115,116,101,112, 32,111,114, 32, +108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32, 32, 32, + 45, 45, 32,105,102, 32,119,101, 32,100,111,110, 39,116, 32,107,110,111,119, 32, +116,104,101, 32,115,105,122,101, 32,105,110, 32, 97,100,118, 97,110, 99,101, 44, + 32,115,101,110,100, 32, 99,104,117,110,107,101,100, 32, 97,110,100, 32,104,111, +112,101, 32,102,111,114, 32,116,104,101, 32, 98,101,115,116, 10, 32, 32, 32, 32, +108,111, 99, 97,108, 32,109,111,100,101, 32, 61, 32, 34,104,116,116,112, 45, 99, +104,117,110,107,101,100, 34, 10, 32, 32, 32, 32,105,102, 32,104,101, 97,100,101, +114,115, 91, 34, 99,111,110,116,101,110,116, 45,108,101,110,103,116,104, 34, 93, + 32,116,104,101,110, 32,109,111,100,101, 32, 61, 32, 34,107,101,101,112, 45,111, +112,101,110, 34, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, +115,101,108,102, 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46, + 97,108,108, 40,115,111,117,114, 99,101, 44, 32,115,111, 99,107,101,116, 46,115, +105,110,107, 40,109,111,100,101, 44, 32,115,101,108,102, 46, 99, 41, 44, 32,115, +116,101,112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, +109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118, +101,115,116, 97,116,117,115,108,105,110,101, 40, 41, 10, 32, 32, 32, 32,108,111, + 99, 97,108, 32,115,116, 97,116,117,115, 32, 61, 32,115,101,108,102, 46,116,114, +121, 40,115,101,108,102, 46, 99, 58,114,101, 99,101,105,118,101, 40, 53, 41, 41, + 10, 32, 32, 32, 32, 45, 45, 32,105,100,101,110,116,105,102,121, 32, 72, 84, 84, + 80, 47, 48, 46, 57, 32,114,101,115,112,111,110,115,101,115, 44, 32,119,104,105, + 99,104, 32,100,111, 32,110,111,116, 32, 99,111,110,116, 97,105,110, 32, 97, 32, +115,116, 97,116,117,115, 32,108,105,110,101, 10, 32, 32, 32, 32, 45, 45, 32,116, +104,105,115, 32,105,115, 32,106,117,115,116, 32, 97, 32,104,101,117,114,105,115, +116,105, 99, 44, 32, 98,117,116, 32,105,115, 32,119,104, 97,116, 32,116,104,101, + 32, 82, 70, 67, 32,114,101, 99,111,109,109,101,110,100,115, 10, 32, 32, 32, 32, +105,102, 32,115,116, 97,116,117,115, 32,126, 61, 32, 34, 72, 84, 84, 80, 47, 34, + 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,115,116, + 97,116,117,115, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,111,116,104,101, +114,119,105,115,101, 32,112,114,111, 99,101,101,100, 32,114,101, 97,100,105,110, +103, 32, 97, 32,115,116, 97,116,117,115, 32,108,105,110,101, 10, 32, 32, 32, 32, +115,116, 97,116,117,115, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101, +108,102, 46, 99, 58,114,101, 99,101,105,118,101, 40, 34, 42,108, 34, 44, 32,115, +116, 97,116,117,115, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111, +100,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32, +115,116,114,105,110,103, 46,102,105,110,100, 40,115,116, 97,116,117,115, 44, 32, + 34, 72, 84, 84, 80, 47, 37,100, 42, 37, 46, 37,100, 42, 32, 40, 37,100, 37,100, + 37,100, 41, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101, +108,102, 46,116,114,121, 40, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, + 40, 99,111,100,101, 41, 44, 32,115,116, 97,116,117,115, 41, 10,101,110,100, 10, + 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110, +100,101,120, 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40, 41, + 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116,114,121, + 40,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40,115,101,108,102, + 46, 99, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, +101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118,101, + 98,111,100,121, 40,104,101, 97,100,101,114,115, 44, 32,115,105,110,107, 44, 32, +115,116,101,112, 41, 10, 32, 32, 32, 32,115,105,110,107, 32, 61, 32,115,105,110, +107, 32,111,114, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,110,117,108,108, + 40, 41, 10, 32, 32, 32, 32,115,116,101,112, 32, 61, 32,115,116,101,112, 32,111, +114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32, + 32, 32,108,111, 99, 97,108, 32,108,101,110,103,116,104, 32, 61, 32, 98, 97,115, +101, 46,116,111,110,117,109, 98,101,114, 40,104,101, 97,100,101,114,115, 91, 34, + 99,111,110,116,101,110,116, 45,108,101,110,103,116,104, 34, 93, 41, 10, 32, 32, + 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,104,101, 97,100,101,114,115, 91, + 34,116,114, 97,110,115,102,101,114, 45,101,110, 99,111,100,105,110,103, 34, 93, + 32, 45, 45, 32,115,104,111,114,116, 99,117,116, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,109,111,100,101, 32, 61, 32, 34,100,101,102, 97,117,108,116, 34, 32, + 45, 45, 32, 99,111,110,110,101, 99,116,105,111,110, 32, 99,108,111,115,101, 10, + 32, 32, 32, 32,105,102, 32,116, 32, 97,110,100, 32,116, 32,126, 61, 32, 34,105, +100,101,110,116,105,116,121, 34, 32,116,104,101,110, 32,109,111,100,101, 32, 61, + 32, 34,104,116,116,112, 45, 99,104,117,110,107,101,100, 34, 10, 32, 32, 32, 32, +101,108,115,101,105,102, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, + 40,104,101, 97,100,101,114,115, 91, 34, 99,111,110,116,101,110,116, 45,108,101, +110,103,116,104, 34, 93, 41, 32,116,104,101,110, 32,109,111,100,101, 32, 61, 32, + 34, 98,121, 45,108,101,110,103,116,104, 34, 32,101,110,100, 10, 32, 32, 32, 32, +114,101,116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,108,116,110, 49, + 50, 46,112,117,109,112, 46, 97,108,108, 40,115,111, 99,107,101,116, 46,115,111, +117,114, 99,101, 40,109,111,100,101, 44, 32,115,101,108,102, 46, 99, 44, 32,108, +101,110,103,116,104, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,105,110,107, + 44, 32,115,116,101,112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105, +111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99, +101,105,118,101, 48, 57, 98,111,100,121, 40,115,116, 97,116,117,115, 44, 32,115, +105,110,107, 44, 32,115,116,101,112, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, + 32,115,111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114, + 99,101, 46,114,101,119,105,110,100, 40,115,111, 99,107,101,116, 46,115,111,117, +114, 99,101, 40, 34,117,110,116,105,108, 45, 99,108,111,115,101,100, 34, 44, 32, +115,101,108,102, 46, 99, 41, 41, 10, 32, 32, 32, 32,115,111,117,114, 99,101, 40, +115,116, 97,116,117,115, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115, +101,108,102, 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46, 97, +108,108, 40,115,111,117,114, 99,101, 44, 32,115,105,110,107, 44, 32,115,116,101, +112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101, +116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,108,111,115,101, 40, 41, 10, + 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58, 99,108, +111,115,101, 40, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 72,105,103,104, 32,108,101,118, +101,108, 32, 72, 84, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,102,117,110, 99, +116,105,111,110, 32, 97,100,106,117,115,116,117,114,105, 40,114,101,113,116, 41, + 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117, 32, 61, 32,114,101,113,116, 10, + 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115, 32, 97, + 32,112,114,111,120,121, 44, 32,119,101, 32,110,101,101,100, 32,116,104,101, 32, +102,117,108,108, 32,117,114,108, 46, 32,111,116,104,101,114,119,105,115,101, 44, + 32,106,117,115,116, 32, 97, 32,112, 97,114,116, 46, 10, 32, 32, 32, 32,105,102, + 32,110,111,116, 32,114,101,113,116, 46,112,114,111,120,121, 32, 97,110,100, 32, +110,111,116, 32, 80, 82, 79, 88, 89, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, + 32, 32, 32,117, 32, 61, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +112, 97,116,104, 32, 61, 32,115,111, 99,107,101,116, 46,116,114,121, 40,114,101, +113,116, 46,112, 97,116,104, 44, 32, 34,105,110,118, 97,108,105,100, 32,112, 97, +116,104, 32, 39,110,105,108, 39, 34, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,112, 97,114, 97,109,115, 32, 61, 32,114,101,113,116, 46,112, 97,114, + 97,109,115, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,113,117,101,114, +121, 32, 61, 32,114,101,113,116, 46,113,117,101,114,121, 44, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,102,114, 97,103,109,101,110,116, 32, 61, 32,114,101, +113,116, 46,102,114, 97,103,109,101,110,116, 10, 32, 32, 32, 32, 32, 32, 32, 32, +125, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, + 32,117,114,108, 46, 98,117,105,108,100, 40,117, 41, 10,101,110,100, 10, 10,108, +111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116, +112,114,111,120,121, 40,114,101,113,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97, +108, 32,112,114,111,120,121, 32, 61, 32,114,101,113,116, 46,112,114,111,120,121, + 32,111,114, 32, 80, 82, 79, 88, 89, 10, 32, 32, 32, 32,105,102, 32,112,114,111, +120,121, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,112,114,111,120, +121, 32, 61, 32,117,114,108, 46,112, 97,114,115,101, 40,112,114,111,120,121, 41, + 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,112,114,111,120, +121, 46,104,111,115,116, 44, 32,112,114,111,120,121, 46,112,111,114,116, 32,111, +114, 32, 51, 49, 50, 56, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, + 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,113,116, 46,104,111,115,116, + 44, 32,114,101,113,116, 46,112,111,114,116, 10, 32, 32, 32, 32,101,110,100, 10, +101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, + 97,100,106,117,115,116,104,101, 97,100,101,114,115, 40,114,101,113,116, 41, 10, + 32, 32, 32, 32, 45, 45, 32,100,101,102, 97,117,108,116, 32,104,101, 97,100,101, +114,115, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,111,119,101,114, 32, 61, + 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34,117,115,101,114, 45, 97,103, +101,110,116, 34, 93, 32, 61, 32, 85, 83, 69, 82, 65, 71, 69, 78, 84, 44, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 91, 34,104,111,115,116, 34, 93, 32, 61, 32,114,101, +113,116, 46,104,111,115,116, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99, +111,110,110,101, 99,116,105,111,110, 34, 93, 32, 61, 32, 34, 99,108,111,115,101, + 44, 32, 84, 69, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34,116,101, 34, + 93, 32, 61, 32, 34,116,114, 97,105,108,101,114,115, 34, 10, 32, 32, 32, 32,125, + 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,119,101, 32,104, 97,118,101, 32, 97, +117,116,104,101,110,116,105, 99, 97,116,105,111,110, 32,105,110,102,111,114,109, + 97,116,105,111,110, 44, 32,112, 97,115,115, 32,105,116, 32, 97,108,111,110,103, + 10, 32, 32, 32, 32,105,102, 32,114,101,113,116, 46,117,115,101,114, 32, 97,110, +100, 32,114,101,113,116, 46,112, 97,115,115,119,111,114,100, 32,116,104,101,110, + 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111,119,101,114, 91, 34, 97,117,116,104, +111,114,105,122, 97,116,105,111,110, 34, 93, 32, 61, 32, 10, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 34, 66, 97,115,105, 99, 32, 34, 32, 46, 46, 32, 32, + 40,109,105,109,101, 46, 98, 54, 52, 40,114,101,113,116, 46,117,115,101,114, 32, + 46, 46, 32, 34, 58, 34, 32, 46, 46, 32,114,101,113,116, 46,112, 97,115,115,119, +111,114,100, 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, + 32,111,118,101,114,114,105,100,101, 32,119,105,116,104, 32,117,115,101,114, 32, +104,101, 97,100,101,114,115, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32, +105,110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,114,101,113,116, 46,104, +101, 97,100,101,114,115, 32,111,114, 32,108,111,119,101,114, 41, 32,100,111, 10, + 32, 32, 32, 32, 32, 32, 32, 32,108,111,119,101,114, 91,115,116,114,105,110,103, + 46,108,111,119,101,114, 40,105, 41, 93, 32, 61, 32,118, 10, 32, 32, 32, 32,101, +110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,111,119,101,114, 10, +101,110,100, 10, 10, 45, 45, 32,100,101,102, 97,117,108,116, 32,117,114,108, 32, +112, 97,114,116,115, 10,108,111, 99, 97,108, 32,100,101,102, 97,117,108,116, 32, + 61, 32,123, 10, 32, 32, 32, 32,104,111,115,116, 32, 61, 32, 34, 34, 44, 10, 32, + 32, 32, 32,112,111,114,116, 32, 61, 32, 80, 79, 82, 84, 44, 10, 32, 32, 32, 32, +112, 97,116,104, 32, 61, 34, 47, 34, 44, 10, 32, 32, 32, 32,115, 99,104,101,109, +101, 32, 61, 32, 34,104,116,116,112, 34, 10,125, 10, 10,108,111, 99, 97,108, 32, +102,117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116,114,101,113,117,101, +115,116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,112, 97,114,115, +101, 32,117,114,108, 32,105,102, 32,112,114,111,118,105,100,101,100, 10, 32, 32, + 32, 32,108,111, 99, 97,108, 32,110,114,101,113,116, 32, 61, 32,114,101,113,116, + 46,117,114,108, 32, 97,110,100, 32,117,114,108, 46,112, 97,114,115,101, 40,114, +101,113,116, 46,117,114,108, 44, 32,100,101,102, 97,117,108,116, 41, 32,111,114, + 32,123,125, 10, 32, 32, 32, 32, 45, 45, 32,101,120,112,108,105, 99,105,116, 32, + 99,111,109,112,111,110,101,110,116,115, 32,111,118,101,114,114,105,100,101, 32, +117,114,108, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, + 97,115,101, 46,112, 97,105,114,115, 40,114,101,113,116, 41, 32,100,111, 32,110, +114,101,113,116, 91,105, 93, 32, 61, 32,118, 32,101,110,100, 10, 32, 32, 32, 32, +105,102, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61, 61, 32, 34, 34, 32, +116,104,101,110, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61, 32, 56, 48, + 32,101,110,100, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40, +110,114,101,113,116, 46,104,111,115,116, 32, 97,110,100, 32,110,114,101,113,116, + 46,104,111,115,116, 32,126, 61, 32, 34, 34, 44, 32, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 34,105,110,118, 97,108,105,100, 32,104,111,115,116, 32, 39, 34, 32, 46, + 46, 32, 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110,114,101,113, +116, 46,104,111,115,116, 41, 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32, 32, 32, + 45, 45, 32, 99,111,109,112,117,116,101, 32,117,114,105, 32,105,102, 32,117,115, +101,114, 32,104, 97,115,110, 39,116, 32,111,118,101,114,114,105,100,101,110, 10, + 32, 32, 32, 32,110,114,101,113,116, 46,117,114,105, 32, 61, 32,114,101,113,116, + 46,117,114,105, 32,111,114, 32, 97,100,106,117,115,116,117,114,105, 40,110,114, +101,113,116, 41, 10, 32, 32, 32, 32, 45, 45, 32, 97,106,117,115,116, 32,104,111, +115,116, 32, 97,110,100, 32,112,111,114,116, 32,105,102, 32,116,104,101,114,101, + 32,105,115, 32, 97, 32,112,114,111,120,121, 10, 32, 32, 32, 32,110,114,101,113, +116, 46,104,111,115,116, 44, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61, + 32, 97,100,106,117,115,116,112,114,111,120,121, 40,110,114,101,113,116, 41, 10, + 32, 32, 32, 32, 45, 45, 32, 97,100,106,117,115,116, 32,104,101, 97,100,101,114, +115, 32,105,110, 32,114,101,113,117,101,115,116, 10, 32, 32, 32, 32,110,114,101, +113,116, 46,104,101, 97,100,101,114,115, 32, 61, 32, 97,100,106,117,115,116,104, +101, 97,100,101,114,115, 40,110,114,101,113,116, 41, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32,110,114,101,113,116, 10,101,110,100, 10, 10,108,111, 99, 97, +108, 32,102,117,110, 99,116,105,111,110, 32,115,104,111,117,108,100,114,101,100, +105,114,101, 99,116, 40,114,101,113,116, 44, 32, 99,111,100,101, 44, 32,104,101, + 97,100,101,114,115, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,104,101, + 97,100,101,114,115, 46,108,111, 99, 97,116,105,111,110, 32, 97,110,100, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116,114,105,110,103, 46,103,115,117, + 98, 40,104,101, 97,100,101,114,115, 46,108,111, 99, 97,116,105,111,110, 44, 32, + 34, 37,115, 34, 44, 32, 34, 34, 41, 32,126, 61, 32, 34, 34, 32, 97,110,100, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40,114,101,113,116, 46,114,101,100, +105,114,101, 99,116, 32,126, 61, 32,102, 97,108,115,101, 41, 32, 97,110,100, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 99,111,100,101, 32, 61, 61, 32, + 51, 48, 49, 32,111,114, 32, 99,111,100,101, 32, 61, 61, 32, 51, 48, 50, 41, 32, + 97,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40,110,111,116, 32, +114,101,113,116, 46,109,101,116,104,111,100, 32,111,114, 32,114,101,113,116, 46, +109,101,116,104,111,100, 32, 61, 61, 32, 34, 71, 69, 84, 34, 32,111,114, 32,114, +101,113,116, 46,109,101,116,104,111,100, 32, 61, 61, 32, 34, 72, 69, 65, 68, 34, + 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97,110,100, 32, 40,110,111, +116, 32,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32,111,114, + 32,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32, 60, 32, 53, + 41, 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111, +110, 32,115,104,111,117,108,100,114,101, 99,101,105,118,101, 98,111,100,121, 40, +114,101,113,116, 44, 32, 99,111,100,101, 41, 10, 32, 32, 32, 32,105,102, 32,114, +101,113,116, 46,109,101,116,104,111,100, 32, 61, 61, 32, 34, 72, 69, 65, 68, 34, + 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 32,101,110,100, + 10, 32, 32, 32, 32,105,102, 32, 99,111,100,101, 32, 61, 61, 32, 50, 48, 52, 32, +111,114, 32, 99,111,100,101, 32, 61, 61, 32, 51, 48, 52, 32,116,104,101,110, 32, +114,101,116,117,114,110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,105, +102, 32, 99,111,100,101, 32, 62, 61, 32, 49, 48, 48, 32, 97,110,100, 32, 99,111, +100,101, 32, 60, 32, 50, 48, 48, 32,116,104,101,110, 32,114,101,116,117,114,110, + 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, + 49, 10,101,110,100, 10, 10, 45, 45, 32,102,111,114,119, 97,114,100, 32,100,101, + 99,108, 97,114, 97,116,105,111,110,115, 10,108,111, 99, 97,108, 32,116,114,101, +113,117,101,115,116, 44, 32,116,114,101,100,105,114,101, 99,116, 10, 10,102,117, +110, 99,116,105,111,110, 32,116,114,101,100,105,114,101, 99,116, 40,114,101,113, +116, 44, 32,108,111, 99, 97,116,105,111,110, 41, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,114,101,115,117,108,116, 44, 32, 99,111,100,101, 44, 32,104,101, 97, +100,101,114,115, 44, 32,115,116, 97,116,117,115, 32, 61, 32,116,114,101,113,117, +101,115,116, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,116,104,101, + 32, 82, 70, 67, 32,115, 97,121,115, 32,116,104,101, 32,114,101,100,105,114,101, + 99,116, 32, 85, 82, 76, 32,104, 97,115, 32,116,111, 32, 98,101, 32, 97, 98,115, +111,108,117,116,101, 44, 32, 98,117,116, 32,115,111,109,101, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 45, 45, 32,115,101,114,118,101,114,115, 32,100,111, 32,110,111, +116, 32,114,101,115,112,101, 99,116, 32,116,104, 97,116, 10, 32, 32, 32, 32, 32, + 32, 32, 32,117,114,108, 32, 61, 32,117,114,108, 46, 97, 98,115,111,108,117,116, +101, 40,114,101,113,116, 46,117,114,108, 44, 32,108,111, 99, 97,116,105,111,110, + 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,111,117,114, 99,101, 32, 61, 32, +114,101,113,116, 46,115,111,117,114, 99,101, 44, 10, 32, 32, 32, 32, 32, 32, 32, + 32,115,105,110,107, 32, 61, 32,114,101,113,116, 46,115,105,110,107, 44, 10, 32, + 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,114,101,113, +116, 46,104,101, 97,100,101,114,115, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, +114,111,120,121, 32, 61, 32,114,101,113,116, 46,112,114,111,120,121, 44, 32, 10, + 32, 32, 32, 32, 32, 32, 32, 32,110,114,101,100,105,114,101, 99,116,115, 32, 61, + 32, 40,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32,111,114, + 32, 48, 41, 32, 43, 32, 49, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99,114,101, + 97,116,101, 32, 61, 32,114,101,113,116, 46, 99,114,101, 97,116,101, 10, 32, 32, + 32, 32,125, 32, 32, 32, 10, 32, 32, 32, 32, 45, 45, 32,112, 97,115,115, 32,108, +111, 99, 97,116,105,111,110, 32,104,101, 97,100,101,114, 32, 98, 97, 99,107, 32, + 97,115, 32, 97, 32,104,105,110,116, 32,119,101, 32,114,101,100,105,114,101, 99, +116,101,100, 10, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104,101, + 97,100,101,114,115, 32,111,114, 32,123,125, 10, 32, 32, 32, 32,104,101, 97,100, +101,114,115, 46,108,111, 99, 97,116,105,111,110, 32, 61, 32,104,101, 97,100,101, +114,115, 46,108,111, 99, 97,116,105,111,110, 32,111,114, 32,108,111, 99, 97,116, +105,111,110, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,115,117,108, +116, 44, 32, 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 44, 32,115,116, + 97,116,117,115, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,116, +114,101,113,117,101,115,116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32, 45, 45, + 32,119,101, 32,108,111,111,112, 32,117,110,116,105,108, 32,119,101, 32,103,101, +116, 32,119,104, 97,116, 32,119,101, 32,119, 97,110,116, 44, 32,111,114, 10, 32, + 32, 32, 32, 45, 45, 32,117,110,116,105,108, 32,119,101, 32, 97,114,101, 32,115, +117,114,101, 32,116,104,101,114,101, 32,105,115, 32,110,111, 32,119, 97,121, 32, +116,111, 32,103,101,116, 32,105,116, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, +110,114,101,113,116, 32, 61, 32, 97,100,106,117,115,116,114,101,113,117,101,115, +116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32, + 61, 32,111,112,101,110, 40,110,114,101,113,116, 46,104,111,115,116, 44, 32,110, +114,101,113,116, 46,112,111,114,116, 44, 32,110,114,101,113,116, 46, 99,114,101, + 97,116,101, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,114,101,113, +117,101,115,116, 32,108,105,110,101, 32, 97,110,100, 32,104,101, 97,100,101,114, +115, 10, 32, 32, 32, 32,104, 58,115,101,110,100,114,101,113,117,101,115,116,108, +105,110,101, 40,110,114,101,113,116, 46,109,101,116,104,111,100, 44, 32,110,114, +101,113,116, 46,117,114,105, 41, 10, 32, 32, 32, 32,104, 58,115,101,110,100,104, +101, 97,100,101,114,115, 40,110,114,101,113,116, 46,104,101, 97,100,101,114,115, + 41, 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115, + 32, 97, 32, 98,111,100,121, 44, 32,115,101,110,100, 32,105,116, 10, 32, 32, 32, + 32,105,102, 32,110,114,101,113,116, 46,115,111,117,114, 99,101, 32,116,104,101, +110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 58,115,101,110,100, 98,111,100,121, + 40,110,114,101,113,116, 46,104,101, 97,100,101,114,115, 44, 32,110,114,101,113, +116, 46,115,111,117,114, 99,101, 44, 32,110,114,101,113,116, 46,115,116,101,112, + 41, 32, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, + 32, 99,111,100,101, 44, 32,115,116, 97,116,117,115, 32, 61, 32,104, 58,114,101, + 99,101,105,118,101,115,116, 97,116,117,115,108,105,110,101, 40, 41, 10, 32, 32, + 32, 32, 45, 45, 32,105,102, 32,105,116, 32,105,115, 32, 97,110, 32, 72, 84, 84, + 80, 47, 48, 46, 57, 32,115,101,114,118,101,114, 44, 32,115,105,109,112,108,121, + 32,103,101,116, 32,116,104,101, 32, 98,111,100,121, 32, 97,110,100, 32,119,101, + 32, 97,114,101, 32,100,111,110,101, 10, 32, 32, 32, 32,105,102, 32,110,111,116, + 32, 99,111,100,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, + 58,114,101, 99,101,105,118,101, 48, 57, 98,111,100,121, 40,115,116, 97,116,117, +115, 44, 32,110,114,101,113,116, 46,115,105,110,107, 44, 32,110,114,101,113,116, + 46,115,116,101,112, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114, +110, 32, 49, 44, 32, 50, 48, 48, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, + 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115, 10, 32, 32, 32, 32, 45, + 45, 32,105,103,110,111,114,101, 32, 97,110,121, 32, 49, 48, 48, 45, 99,111,110, +116,105,110,117,101, 32,109,101,115,115, 97,103,101,115, 10, 32, 32, 32, 32,119, +104,105,108,101, 32, 99,111,100,101, 32, 61, 61, 32, 49, 48, 48, 32,100,111, 32, + 10, 32, 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104, + 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40, 41, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 99,111,100,101, 44, 32,115,116, 97,116,117,115, 32, 61, + 32,104, 58,114,101, 99,101,105,118,101,115,116, 97,116,117,115,108,105,110,101, + 40, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,104,101, 97,100,101, +114,115, 32, 61, 32,104, 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114, +115, 40, 41, 10, 32, 32, 32, 32, 45, 45, 32, 97,116, 32,116,104,105,115, 32,112, +111,105,110,116, 32,119,101, 32,115,104,111,117,108,100, 32,104, 97,118,101, 32, + 97, 32,104,111,110,101,115,116, 32,114,101,112,108,121, 32,102,114,111,109, 32, +116,104,101, 32,115,101,114,118,101,114, 10, 32, 32, 32, 32, 45, 45, 32,119,101, + 32, 99, 97,110, 39,116, 32,114,101,100,105,114,101, 99,116, 32,105,102, 32,119, +101, 32, 97,108,114,101, 97,100,121, 32,117,115,101,100, 32,116,104,101, 32,115, +111,117,114, 99,101, 44, 32,115,111, 32,119,101, 32,114,101,112,111,114,116, 32, +116,104,101, 32,101,114,114,111,114, 32, 10, 32, 32, 32, 32,105,102, 32,115,104, +111,117,108,100,114,101,100,105,114,101, 99,116, 40,110,114,101,113,116, 44, 32, + 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 41, 32, 97,110,100, 32,110, +111,116, 32,110,114,101,113,116, 46,115,111,117,114, 99,101, 32,116,104,101,110, + 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 58, 99,108,111,115,101, 40, 41, 10, 32, + 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,116,114,101,100,105,114, +101, 99,116, 40,114,101,113,116, 44, 32,104,101, 97,100,101,114,115, 46,108,111, + 99, 97,116,105,111,110, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, + 45, 45, 32,104,101,114,101, 32,119,101, 32, 97,114,101, 32,102,105,110, 97,108, +108,121, 32,100,111,110,101, 10, 32, 32, 32, 32,105,102, 32,115,104,111,117,108, +100,114,101, 99,101,105,118,101, 98,111,100,121, 40,110,114,101,113,116, 44, 32, + 99,111,100,101, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, + 58,114,101, 99,101,105,118,101, 98,111,100,121, 40,104,101, 97,100,101,114,115, + 44, 32,110,114,101,113,116, 46,115,105,110,107, 44, 32,110,114,101,113,116, 46, +115,116,101,112, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,104, 58, + 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, + 44, 32, 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 44, 32,115,116, 97, +116,117,115, 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116, +105,111,110, 32,115,114,101,113,117,101,115,116, 40,117, 44, 32, 98, 41, 10, 32, + 32, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32, +108,111, 99, 97,108, 32,114,101,113,116, 32, 61, 32,123, 10, 32, 32, 32, 32, 32, + 32, 32, 32,117,114,108, 32, 61, 32,117, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, +115,105,110,107, 32, 61, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,116, 97, + 98,108,101, 40,116, 41, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,105,102, 32, + 98, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,113,116, 46, +115,111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114, 99, +101, 46,115,116,114,105,110,103, 40, 98, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, +114,101,113,116, 46,104,101, 97,100,101,114,115, 32, 61, 32,123, 10, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99,111,110,116,101,110,116, 45,108, +101,110,103,116,104, 34, 93, 32, 61, 32,115,116,114,105,110,103, 46,108,101,110, + 40, 98, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99, +111,110,116,101,110,116, 45,116,121,112,101, 34, 93, 32, 61, 32, 34, 97,112,112, +108,105, 99, 97,116,105,111,110, 47,120, 45,119,119,119, 45,102,111,114,109, 45, +117,114,108,101,110, 99,111,100,101,100, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, +125, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,113,116, 46,109,101,116,104,111, +100, 32, 61, 32, 34, 80, 79, 83, 84, 34, 10, 32, 32, 32, 32,101,110,100, 10, 32, + 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,104,101, 97,100,101, +114,115, 44, 32,115,116, 97,116,117,115, 32, 61, 32,115,111, 99,107,101,116, 46, +115,107,105,112, 40, 49, 44, 32,116,114,101,113,117,101,115,116, 40,114,101,113, +116, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,116, 97, 98,108,101, + 46, 99,111,110, 99, 97,116, 40,116, 41, 44, 32, 99,111,100,101, 44, 32,104,101, + 97,100,101,114,115, 44, 32,115,116, 97,116,117,115, 10,101,110,100, 10, 10,114, +101,113,117,101,115,116, 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116, +101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,114,101,113,116, 44, 32, 98, +111,100,121, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112, +101, 40,114,101,113,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32, +116,104,101,110, 32,114,101,116,117,114,110, 32,115,114,101,113,117,101,115,116, + 40,114,101,113,116, 44, 32, 98,111,100,121, 41, 10, 32, 32, 32, 32,101,108,115, +101, 32,114,101,116,117,114,110, 32,116,114,101,113,117,101,115,116, 40,114,101, +113,116, 41, 32,101,110,100, 10,101,110,100, 41, 10, +}; + + if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"http.lua")==0) lua_call(L, 0, 0); +} diff --git a/src/libraries/luasocket/libluasocket/ltn12.lua.h b/src/libraries/luasocket/libluasocket/ltn12.lua.h index 474c8bf1d..254c0683b 100644 --- a/src/libraries/luasocket/libluasocket/ltn12.lua.h +++ b/src/libraries/luasocket/libluasocket/ltn12.lua.h @@ -1,420 +1,420 @@ -/* code automatically generated by bin2c -- DO NOT EDIT */ -{ -/* #include'ing this file in a C program is equivalent to calling - if (luaL_loadfile(L,"ltn12.lua")==0) lua_call(L, 0, 0); -*/ -/* ltn12.lua */ -static const unsigned char B1[]={ - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 76, 84, 78, 49, 50, 32, 45, 32, 70,105,108,116,101,114,115, 44, 32,115,111, -117,114, 99,101,115, 44, 32,115,105,110,107,115, 32, 97,110,100, 32,112,117,109, -112,115, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32,116,111,111, -108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101, -103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, - 36, 73,100, 58, 32,108,116,110, 49, 50, 46,108,117, 97, 44,118, 32, 49, 46, 51, - 49, 32, 50, 48, 48, 54, 47, 48, 52, 47, 48, 51, 32, 48, 52, 58, 52, 53, 58, 52, - 50, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114, -101, 32,109,111,100,117,108,101, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, - 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10, -108,111, 99, 97,108, 32,116, 97, 98,108,101, 32, 61, 32,114,101,113,117,105,114, -101, 40, 34,116, 97, 98,108,101, 34, 41, 10,108,111, 99, 97,108, 32, 98, 97,115, -101, 32, 61, 32, 95, 71, 10,109,111,100,117,108,101, 40, 34,108,116,110, 49, 50, - 34, 41, 10, 10,102,105,108,116,101,114, 32, 61, 32,123,125, 10,115,111,117,114, - 99,101, 32, 61, 32,123,125, 10,115,105,110,107, 32, 61, 32,123,125, 10,112,117, -109,112, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 50, 48, 52, 56, 32,115,101,101, -109,115, 32,116,111, 32, 98,101, 32, 98,101,116,116,101,114, 32,105,110, 32,119, -105,110,100,111,119,115, 46, 46, 46, 10, 66, 76, 79, 67, 75, 83, 73, 90, 69, 32, - 61, 32, 50, 48, 52, 56, 10, 95, 86, 69, 82, 83, 73, 79, 78, 32, 61, 32, 34, 76, - 84, 78, 49, 50, 32, 49, 46, 48, 46, 49, 34, 10, 10, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 70,105,108,116,101,114, - 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,104,105, -103,104, 32,108,101,118,101,108, 32,102,105,108,116,101,114, 32,116,104, 97,116, - 32, 99,121, 99,108,101,115, 32, 97, 32,108,111,119, 45,108,101,118,101,108, 32, -102,105,108,116,101,114, 10,102,117,110, 99,116,105,111,110, 32,102,105,108,116, -101,114, 46, 99,121, 99,108,101, 40,108,111,119, 44, 32, 99,116,120, 44, 32,101, -120,116,114, 97, 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114, -116, 40,108,111,119, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117, -110, 99,116,105,111,110, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, - 32, 32,108,111, 99, 97,108, 32,114,101,116, 10, 32, 32, 32, 32, 32, 32, 32, 32, -114,101,116, 44, 32, 99,116,120, 32, 61, 32,108,111,119, 40, 99,116,120, 44, 32, - 99,104,117,110,107, 44, 32,101,120,116,114, 97, 41, 10, 32, 32, 32, 32, 32, 32, - 32, 32,114,101,116,117,114,110, 32,114,101,116, 10, 32, 32, 32, 32,101,110,100, - 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 97,105,110,115, 32, 97, 32, 98,117, -110, 99,104, 32,111,102, 32,102,105,108,116,101,114,115, 32,116,111,103,101,116, -104,101,114, 10, 45, 45, 32, 40,116,104, 97,110,107,115, 32,116,111, 32, 87,105, -109, 32, 67,111,117,119,101,110, 98,101,114,103, 41, 10,102,117,110, 99,116,105, -111,110, 32,102,105,108,116,101,114, 46, 99,104, 97,105,110, 40, 46, 46, 46, 41, - 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,110, 32, 61, 32,116, 97, 98,108,101, - 46,103,101,116,110, 40, 97,114,103, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, - 32,116,111,112, 44, 32,105,110,100,101,120, 32, 61, 32, 49, 44, 32, 49, 10, 32, - 32, 32, 32,108,111, 99, 97,108, 32,114,101,116,114,121, 32, 61, 32, 34, 34, 10, - 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, - 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,114,121, - 32, 61, 32, 99,104,117,110,107, 32, 97,110,100, 32,114,101,116,114,121, 10, 32, - 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,105,110,100,101, -120, 32, 61, 61, 32,116,111,112, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61, 32, 97,114, -103, 91,105,110,100,101,120, 93, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107, - 32, 61, 61, 32, 34, 34, 32,111,114, 32,116,111,112, 32, 61, 61, 32,110, 32,116, -104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105,102, 32, - 99,104,117,110,107, 32,116,104,101,110, 32,105,110,100,101,120, 32, 61, 32,105, -110,100,101,120, 32, 43, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,111,112, 32, 61, 32,116,111,112, 43, - 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,105,110,100,101,120, 32, 61, 32,116,111,112, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61, 32, 97,114,103, 91,105, -110,100,101,120, 93, 40, 99,104,117,110,107, 32,111,114, 32, 34, 34, 41, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104, -117,110,107, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,110,100,101,120, - 32, 61, 32,105,110,100,101,120, 32, 45, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61, - 32,114,101,116,114,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,101,108,115,101,105,102, 32, 99,104,117,110,107, 32,116,104,101,110, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32,105,102, 32,105,110,100,101,120, 32, 61, 61, 32,110, 32,116,104,101,110, 32, -114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,105,110, -100,101,120, 32, 61, 32,105,110,100,101,120, 32, 43, 32, 49, 32,101,110,100, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, - 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 34,102,105,108,116,101,114, 32, -114,101,116,117,114,110,101,100, 32,105,110, 97,112,112,114,111,112,114,105, 97, -116,101, 32,110,105,108, 34, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, - 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 83,111,117,114, 99, -101, 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,114,101, 97,116,101, 32, 97,110, 32,101, -109,112,116,121, 32,115,111,117,114, 99,101, 10,108,111, 99, 97,108, 32,102,117, -110, 99,116,105,111,110, 32,101,109,112,116,121, 40, 41, 10, 32, 32, 32, 32,114, -101,116,117,114,110, 32,110,105,108, 10,101,110,100, 10, 10,102,117,110, 99,116, -105,111,110, 32,115,111,117,114, 99,101, 46,101,109,112,116,121, 40, 41, 10, 32, - 32, 32, 32,114,101,116,117,114,110, 32,101,109,112,116,121, 10,101,110,100, 10, - 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,115,111,117,114, 99,101, - 32,116,104, 97,116, 32,106,117,115,116, 32,111,117,116,112,117,116,115, 32, 97, -110, 32,101,114,114,111,114, 10,102,117,110, 99,116,105,111,110, 32,115,111,117, -114, 99,101, 46,101,114,114,111,114, 40,101,114,114, 41, 10, 32, 32, 32, 32,114, -101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, - 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, - 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101, - 97,116,101,115, 32, 97, 32,102,105,108,101, 32,115,111,117,114, 99,101, 10,102, -117,110, 99,116,105,111,110, 32,115,111,117,114, 99,101, 46,102,105,108,101, 40, -104, 97,110,100,108,101, 44, 32,105,111, 95,101,114,114, 41, 10, 32, 32, 32, 32, -105,102, 32,104, 97,110,100,108,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, - 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99, -104,117,110,107, 32, 61, 32,104, 97,110,100,108,101, 58,114,101, 97,100, 40, 66, - 76, 79, 67, 75, 83, 73, 90, 69, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 32, -104, 97,110,100,108,101, 58, 99,108,111,115,101, 40, 41, 32,101,110,100, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,104, -117,110,107, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, -101,108,115,101, 32,114,101,116,117,114,110, 32,115,111,117,114, 99,101, 46,101, -114,114,111,114, 40,105,111, 95,101,114,114, 32,111,114, 32, 34,117,110, 97, 98, -108,101, 32,116,111, 32,111,112,101,110, 32,102,105,108,101, 34, 41, 32,101,110, -100, 10,101,110,100, 10, 10, 45, 45, 32,116,117,114,110,115, 32, 97, 32,102, 97, -110, 99,121, 32,115,111,117,114, 99,101, 32,105,110,116,111, 32, 97, 32,115,105, -109,112,108,101, 32,115,111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110, - 32,115,111,117,114, 99,101, 46,115,105,109,112,108,105,102,121, 40,115,114, 99, - 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114, - 99, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105, -111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99, -104,117,110,107, 44, 32,101,114,114, 95,111,114, 95,110,101,119, 32, 61, 32,115, -114, 99, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,114, 99, 32, 61, 32,101, -114,114, 95,111,114, 95,110,101,119, 32,111,114, 32,115,114, 99, 10, 32, 32, 32, - 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104, -101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 95,111, -114, 95,110,101,119, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114, -101,116,117,114,110, 32, 99,104,117,110,107, 32,101,110,100, 10, 32, 32, 32, 32, -101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, -115,116,114,105,110,103, 32,115,111,117,114, 99,101, 10,102,117,110, 99,116,105, -111,110, 32,115,111,117,114, 99,101, 46,115,116,114,105,110,103, 40,115, 41, 10, - 32, 32, 32, 32,105,102, 32,115, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, - 32, 32,108,111, 99, 97,108, 32,105, 32, 61, 32, 49, 10, 32, 32, 32, 32, 32, 32, - 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104, -117,110,107, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115, 44, 32, -105, 44, 32,105, 43, 66, 76, 79, 67, 75, 83, 73, 90, 69, 45, 49, 41, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105, 32, 61, 32,105, 32, 43, 32, 66, 76, - 79, 67, 75, 83, 73, 90, 69, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -105,102, 32, 99,104,117,110,107, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32, -114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,110,105,108, - 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, - 32,101,108,115,101, 32,114,101,116,117,114,110, 32,115,111,117,114, 99,101, 46, -101,109,112,116,121, 40, 41, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, - 99,114,101, 97,116,101,115, 32,114,101,119,105,110,100, 97, 98,108,101, 32,115, -111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110, 32,115,111,117,114, 99, -101, 46,114,101,119,105,110,100, 40,115,114, 99, 41, 10, 32, 32, 32, 32, 98, 97, -115,101, 46, 97,115,115,101,114,116, 40,115,114, 99, 41, 10, 32, 32, 32, 32,108, -111, 99, 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32,114,101,116,117, -114,110, 32,102,117,110, 99,116,105,111,110, 40, 99,104,117,110,107, 41, 10, 32, - 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32, -116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117, -110,107, 32, 61, 32,116, 97, 98,108,101, 46,114,101,109,111,118,101, 40,116, 41, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, - 99,104,117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,115,114, - 99, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, - 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 32,101,110,100, 10, 32, 32, - 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40,116, 44, 32, 99, -104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, - 32, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, -115,111,117,114, 99,101, 46, 99,104, 97,105,110, 40,115,114, 99, 44, 32,102, 41, - 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114, 99, - 32, 97,110,100, 32,102, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108, 97, -115,116, 95,105,110, 44, 32,108, 97,115,116, 95,111,117,116, 32, 61, 32, 34, 34, - 44, 32, 34, 34, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,116, 97,116,101, - 32, 61, 32, 34,102,101,101,100,105,110,103, 34, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,101,114,114, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117, -110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, -110,111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104,101,110, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, - 40, 39,115,111,117,114, 99,101, 32,105,115, 32,101,109,112,116,121, 33, 39, 44, - 32, 50, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, - 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,116, 97,116,101, 32, 61, - 61, 32, 34,102,101,101,100,105,110,103, 34, 32,116,104,101,110, 10, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,115,116, 95,105,110, - 44, 32,101,114,114, 32, 61, 32,115,114, 99, 40, 41, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101, -110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110, -100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97, -115,116, 95,111,117,116, 32, 61, 32,102, 40,108, 97,115,116, 95,105,110, 41, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110, -111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104,101,110, 10, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, -108, 97,115,116, 95,105,110, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115, -101, 46,101,114,114,111,114, 40, 39,102,105,108,116,101,114, 32,114,101,116,117, -114,110,101,100, 32,105,110, 97,112,112,114,111,112,114,105, 97,116,101, 32,110, -105,108, 39, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, - 32,110,105,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,101,108,115,101,105,102, 32,108, 97,115,116, 95,111,117,116, - 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116, 97,116,101, 32, 61, 32, - 34,101, 97,116,105,110,103, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95,105,110, 32, -116,104,101,110, 32,108, 97,115,116, 95,105,110, 32, 61, 32, 34, 34, 32,101,110, -100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,114,101,116,117,114,110, 32,108, 97,115,116, 95,111,117,116, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,115,116, 95,111,117,116, 32, - 61, 32,102, 40,108, 97,115,116, 95,105,110, 41, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95,111,117,116, - 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95, -105,110, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116, - 97,116,101, 32, 61, 32, 34,102,101,101,100,105,110,103, 34, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 39,102,105,108, -116,101,114, 32,114,101,116,117,114,110,101,100, 32, 34, 34, 39, 41, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110, -100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108, -115,101,105,102, 32,110,111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104, -101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,105,102, 32,108, 97,115,116, 95,105,110, 32,116,104,101,110, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 39,102,105,108,116,101, -114, 32,114,101,116,117,114,110,101,100, 32,105,110, 97,112,112,114,111,112,114, -105, 97,116,101, 32,110,105,108, 39, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -114,101,116,117,114,110, 32,110,105,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, -114,110, 32,108, 97,115,116, 95,111,117,116, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, - 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97, -116,101,115, 32, 97, 32,115,111,117,114, 99,101, 32,116,104, 97,116, 32,112,114, -111,100,117, 99,101,115, 32, 99,111,110,116,101,110,116,115, 32,111,102, 32,115, -101,118,101,114, 97,108, 32,115,111,117,114, 99,101,115, 44, 32,111,110,101, 32, - 97,102,116,101,114, 32,116,104,101, 10, 45, 45, 32,111,116,104,101,114, 44, 32, - 97,115, 32,105,102, 32,116,104,101,121, 32,119,101,114,101, 32, 99,111,110, 99, - 97,116,101,110, 97,116,101,100, 10, 45, 45, 32, 40,116,104, 97,110,107,115, 32, -116,111, 32, 87,105,109, 32, 67,111,117,119,101,110, 98,101,114,103, 41, 10,102, -117,110, 99,116,105,111,110, 32,115,111,117,114, 99,101, 46, 99, 97,116, 40, 46, - 46, 46, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,114, 99, 32, 61, 32, -116, 97, 98,108,101, 46,114,101,109,111,118,101, 40, 97,114,103, 44, 32, 49, 41, - 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, - 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,115,114, 99, - 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97, -108, 32, 99,104,117,110,107, 44, 32,101,114,114, 32, 61, 32,115,114, 99, 40, 41, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110, -107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 32, -101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101, -114,114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, -101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -115,114, 99, 32, 61, 32,116, 97, 98,108,101, 46,114,101,109,111,118,101, 40, 97, -114,103, 44, 32, 49, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, - 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 83,105,110,107, 32,115,116, -117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105,110,107, 32, -116,104, 97,116, 32,115,116,111,114,101,115, 32,105,110,116,111, 32, 97, 32,116, - 97, 98,108,101, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,116, - 97, 98,108,101, 40,116, 41, 10, 32, 32, 32, 32,116, 32, 61, 32,116, 32,111,114, - 32,123,125, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,102,117, -110, 99,116,105,111,110, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10, 32, - 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107, 32,116,104,101,110, - 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40,116, 44, 32, 99,104,117, -110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, -114,110, 32, 49, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116, -117,114,110, 32,102, 44, 32,116, 10,101,110,100, 10, 10, 45, 45, 32,116,117,114, -110,115, 32, 97, 32,102, 97,110, 99,121, 32,115,105,110,107, 32,105,110,116,111, - 32, 97, 32,115,105,109,112,108,101, 32,115,105,110,107, 10,102,117,110, 99,116, -105,111,110, 32,115,105,110,107, 46,115,105,109,112,108,105,102,121, 40,115,110, -107, 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115, -110,107, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116, -105,111,110, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114, 95,111, -114, 95,110,101,119, 32, 61, 32,115,110,107, 40, 99,104,117,110,107, 44, 32,101, -114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114, -101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, -101,114,114, 95,111,114, 95,110,101,119, 32,101,110,100, 10, 32, 32, 32, 32, 32, - 32, 32, 32,115,110,107, 32, 61, 32,101,114,114, 95,111,114, 95,110,101,119, 32, -111,114, 32,115,110,107, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114, -110, 32, 49, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, - 99,114,101, 97,116,101,115, 32, 97, 32,102,105,108,101, 32,115,105,110,107, 10, -102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,102,105,108,101, 40,104, - 97,110,100,108,101, 44, 32,105,111, 95,101,114,114, 41, 10, 32, 32, 32, 32,105, -102, 32,104, 97,110,100,108,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, - 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 99,104, -117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,104, 97,110,100, -108,101, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, -104, 97,110,100,108,101, 58,119,114,105,116,101, 40, 99,104,117,110,107, 41, 32, -101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, -101,108,115,101, 32,114,101,116,117,114,110, 32,115,105,110,107, 46,101,114,114, -111,114, 40,105,111, 95,101,114,114, 32,111,114, 32, 34,117,110, 97, 98,108,101, - 32,116,111, 32,111,112,101,110, 32,102,105,108,101, 34, 41, 32,101,110,100, 10, -101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105, -110,107, 32,116,104, 97,116, 32,100,105,115, 99, 97,114,100,115, 32,100, 97,116, - 97, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,110,117,108, -108, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, - 10, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,110,117,108,108, - 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,110,117,108,108, 10,101, -110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105,110, -107, 32,116,104, 97,116, 32,106,117,115,116, 32,114,101,116,117,114,110,115, 32, - 97,110, 32,101,114,114,111,114, 10,102,117,110, 99,116,105,111,110, 32,115,105, -110,107, 46,101,114,114,111,114, 40,101,114,114, 41, 10, 32, 32, 32, 32,114,101, -116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 10, - 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 97,105, -110,115, 32, 97, 32,115,105,110,107, 32,119,105,116,104, 32, 97, 32,102,105,108, -116,101,114, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46, 99,104, - 97,105,110, 40,102, 44, 32,115,110,107, 41, 10, 32, 32, 32, 32, 98, 97,115,101, - 46, 97,115,115,101,114,116, 40,102, 32, 97,110,100, 32,115,110,107, 41, 10, 32, - 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 99, -104,117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105, -102, 32, 99,104,117,110,107, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,102,105,108, -116,101,114,101,100, 32, 61, 32,102, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,100,111,110,101, 32, - 61, 32, 99,104,117,110,107, 32, 97,110,100, 32, 34, 34, 10, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, - 97,108, 32,114,101,116, 44, 32,115,110,107,101,114,114, 32, 61, 32,115,110,107, - 40,102,105,108,116,101,114,101,100, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114, -101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, -115,110,107,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,105,102, 32,102,105,108,116,101,114,101,100, 32, 61, - 61, 32,100,111,110,101, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 49, - 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32,102,105,108,116,101,114,101,100, 32, 61, 32,102, 40,100,111,110,101, 41, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, - 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 49, 32,101,110, -100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 80,117,109,112, - 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 10, 45, 45, 32,112,117,109,112,115, 32,111,110,101, 32, 99,104, -117,110,107, 32,102,114,111,109, 32,116,104,101, 32,115,111,117,114, 99,101, 32, -116,111, 32,116,104,101, 32,115,105,110,107, 10,102,117,110, 99,116,105,111,110, - 32,112,117,109,112, 46,115,116,101,112, 40,115,114, 99, 44, 32,115,110,107, 41, - 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,115,114, - 99, 95,101,114,114, 32, 61, 32,115,114, 99, 40, 41, 10, 32, 32, 32, 32,108,111, - 99, 97,108, 32,114,101,116, 44, 32,115,110,107, 95,101,114,114, 32, 61, 32,115, -110,107, 40, 99,104,117,110,107, 44, 32,115,114, 99, 95,101,114,114, 41, 10, 32, - 32, 32, 32,105,102, 32, 99,104,117,110,107, 32, 97,110,100, 32,114,101,116, 32, -116,104,101,110, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32,101,108, -115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,115,114, 99, 95,101, -114,114, 32,111,114, 32,115,110,107, 95,101,114,114, 32,101,110,100, 10,101,110, -100, 10, 10, 45, 45, 32,112,117,109,112,115, 32, 97,108,108, 32,100, 97,116, 97, - 32,102,114,111,109, 32, 97, 32,115,111,117,114, 99,101, 32,116,111, 32, 97, 32, -115,105,110,107, 44, 32,117,115,105,110,103, 32, 97, 32,115,116,101,112, 32,102, -117,110, 99,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32,112,117,109, -112, 46, 97,108,108, 40,115,114, 99, 44, 32,115,110,107, 44, 32,115,116,101,112, - 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114, - 99, 32, 97,110,100, 32,115,110,107, 41, 10, 32, 32, 32, 32,115,116,101,112, 32, - 61, 32,115,116,101,112, 32,111,114, 32,112,117,109,112, 46,115,116,101,112, 10, - 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, 10, 32, 32, - 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114, - 32, 61, 32,115,116,101,112, 40,115,114, 99, 44, 32,115,110,107, 41, 10, 32, 32, - 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,116, 32,116,104,101, -110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, - 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114, -114, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114, -101,116,117,114,110, 32, 49, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, -101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, -}; - - if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"ltn12.lua")==0) lua_call(L, 0, 0); -} +/* code automatically generated by bin2c -- DO NOT EDIT */ +{ +/* #include'ing this file in a C program is equivalent to calling + if (luaL_loadfile(L,"ltn12.lua")==0) lua_call(L, 0, 0); +*/ +/* ltn12.lua */ +static const unsigned char B1[]={ + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 76, 84, 78, 49, 50, 32, 45, 32, 70,105,108,116,101,114,115, 44, 32,115,111, +117,114, 99,101,115, 44, 32,115,105,110,107,115, 32, 97,110,100, 32,112,117,109, +112,115, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32,116,111,111, +108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101, +103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, + 36, 73,100, 58, 32,108,116,110, 49, 50, 46,108,117, 97, 44,118, 32, 49, 46, 51, + 49, 32, 50, 48, 48, 54, 47, 48, 52, 47, 48, 51, 32, 48, 52, 58, 52, 53, 58, 52, + 50, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114, +101, 32,109,111,100,117,108,101, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, + 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10, +108,111, 99, 97,108, 32,116, 97, 98,108,101, 32, 61, 32,114,101,113,117,105,114, +101, 40, 34,116, 97, 98,108,101, 34, 41, 10,108,111, 99, 97,108, 32, 98, 97,115, +101, 32, 61, 32, 95, 71, 10,109,111,100,117,108,101, 40, 34,108,116,110, 49, 50, + 34, 41, 10, 10,102,105,108,116,101,114, 32, 61, 32,123,125, 10,115,111,117,114, + 99,101, 32, 61, 32,123,125, 10,115,105,110,107, 32, 61, 32,123,125, 10,112,117, +109,112, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 50, 48, 52, 56, 32,115,101,101, +109,115, 32,116,111, 32, 98,101, 32, 98,101,116,116,101,114, 32,105,110, 32,119, +105,110,100,111,119,115, 46, 46, 46, 10, 66, 76, 79, 67, 75, 83, 73, 90, 69, 32, + 61, 32, 50, 48, 52, 56, 10, 95, 86, 69, 82, 83, 73, 79, 78, 32, 61, 32, 34, 76, + 84, 78, 49, 50, 32, 49, 46, 48, 46, 49, 34, 10, 10, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 70,105,108,116,101,114, + 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,104,105, +103,104, 32,108,101,118,101,108, 32,102,105,108,116,101,114, 32,116,104, 97,116, + 32, 99,121, 99,108,101,115, 32, 97, 32,108,111,119, 45,108,101,118,101,108, 32, +102,105,108,116,101,114, 10,102,117,110, 99,116,105,111,110, 32,102,105,108,116, +101,114, 46, 99,121, 99,108,101, 40,108,111,119, 44, 32, 99,116,120, 44, 32,101, +120,116,114, 97, 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114, +116, 40,108,111,119, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117, +110, 99,116,105,111,110, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, + 32, 32,108,111, 99, 97,108, 32,114,101,116, 10, 32, 32, 32, 32, 32, 32, 32, 32, +114,101,116, 44, 32, 99,116,120, 32, 61, 32,108,111,119, 40, 99,116,120, 44, 32, + 99,104,117,110,107, 44, 32,101,120,116,114, 97, 41, 10, 32, 32, 32, 32, 32, 32, + 32, 32,114,101,116,117,114,110, 32,114,101,116, 10, 32, 32, 32, 32,101,110,100, + 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 97,105,110,115, 32, 97, 32, 98,117, +110, 99,104, 32,111,102, 32,102,105,108,116,101,114,115, 32,116,111,103,101,116, +104,101,114, 10, 45, 45, 32, 40,116,104, 97,110,107,115, 32,116,111, 32, 87,105, +109, 32, 67,111,117,119,101,110, 98,101,114,103, 41, 10,102,117,110, 99,116,105, +111,110, 32,102,105,108,116,101,114, 46, 99,104, 97,105,110, 40, 46, 46, 46, 41, + 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,110, 32, 61, 32,116, 97, 98,108,101, + 46,103,101,116,110, 40, 97,114,103, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, + 32,116,111,112, 44, 32,105,110,100,101,120, 32, 61, 32, 49, 44, 32, 49, 10, 32, + 32, 32, 32,108,111, 99, 97,108, 32,114,101,116,114,121, 32, 61, 32, 34, 34, 10, + 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, + 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,114,121, + 32, 61, 32, 99,104,117,110,107, 32, 97,110,100, 32,114,101,116,114,121, 10, 32, + 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,105,110,100,101, +120, 32, 61, 61, 32,116,111,112, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61, 32, 97,114, +103, 91,105,110,100,101,120, 93, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107, + 32, 61, 61, 32, 34, 34, 32,111,114, 32,116,111,112, 32, 61, 61, 32,110, 32,116, +104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105,102, 32, + 99,104,117,110,107, 32,116,104,101,110, 32,105,110,100,101,120, 32, 61, 32,105, +110,100,101,120, 32, 43, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,111,112, 32, 61, 32,116,111,112, 43, + 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,105,110,100,101,120, 32, 61, 32,116,111,112, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61, 32, 97,114,103, 91,105, +110,100,101,120, 93, 40, 99,104,117,110,107, 32,111,114, 32, 34, 34, 41, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104, +117,110,107, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,110,100,101,120, + 32, 61, 32,105,110,100,101,120, 32, 45, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61, + 32,114,101,116,114,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,101,108,115,101,105,102, 32, 99,104,117,110,107, 32,116,104,101,110, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32,105,102, 32,105,110,100,101,120, 32, 61, 61, 32,110, 32,116,104,101,110, 32, +114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,105,110, +100,101,120, 32, 61, 32,105,110,100,101,120, 32, 43, 32, 49, 32,101,110,100, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, + 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 34,102,105,108,116,101,114, 32, +114,101,116,117,114,110,101,100, 32,105,110, 97,112,112,114,111,112,114,105, 97, +116,101, 32,110,105,108, 34, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, + 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 83,111,117,114, 99, +101, 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,114,101, 97,116,101, 32, 97,110, 32,101, +109,112,116,121, 32,115,111,117,114, 99,101, 10,108,111, 99, 97,108, 32,102,117, +110, 99,116,105,111,110, 32,101,109,112,116,121, 40, 41, 10, 32, 32, 32, 32,114, +101,116,117,114,110, 32,110,105,108, 10,101,110,100, 10, 10,102,117,110, 99,116, +105,111,110, 32,115,111,117,114, 99,101, 46,101,109,112,116,121, 40, 41, 10, 32, + 32, 32, 32,114,101,116,117,114,110, 32,101,109,112,116,121, 10,101,110,100, 10, + 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,115,111,117,114, 99,101, + 32,116,104, 97,116, 32,106,117,115,116, 32,111,117,116,112,117,116,115, 32, 97, +110, 32,101,114,114,111,114, 10,102,117,110, 99,116,105,111,110, 32,115,111,117, +114, 99,101, 46,101,114,114,111,114, 40,101,114,114, 41, 10, 32, 32, 32, 32,114, +101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, + 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, + 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101, + 97,116,101,115, 32, 97, 32,102,105,108,101, 32,115,111,117,114, 99,101, 10,102, +117,110, 99,116,105,111,110, 32,115,111,117,114, 99,101, 46,102,105,108,101, 40, +104, 97,110,100,108,101, 44, 32,105,111, 95,101,114,114, 41, 10, 32, 32, 32, 32, +105,102, 32,104, 97,110,100,108,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, + 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99, +104,117,110,107, 32, 61, 32,104, 97,110,100,108,101, 58,114,101, 97,100, 40, 66, + 76, 79, 67, 75, 83, 73, 90, 69, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 32, +104, 97,110,100,108,101, 58, 99,108,111,115,101, 40, 41, 32,101,110,100, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,104, +117,110,107, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, +101,108,115,101, 32,114,101,116,117,114,110, 32,115,111,117,114, 99,101, 46,101, +114,114,111,114, 40,105,111, 95,101,114,114, 32,111,114, 32, 34,117,110, 97, 98, +108,101, 32,116,111, 32,111,112,101,110, 32,102,105,108,101, 34, 41, 32,101,110, +100, 10,101,110,100, 10, 10, 45, 45, 32,116,117,114,110,115, 32, 97, 32,102, 97, +110, 99,121, 32,115,111,117,114, 99,101, 32,105,110,116,111, 32, 97, 32,115,105, +109,112,108,101, 32,115,111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110, + 32,115,111,117,114, 99,101, 46,115,105,109,112,108,105,102,121, 40,115,114, 99, + 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114, + 99, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105, +111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99, +104,117,110,107, 44, 32,101,114,114, 95,111,114, 95,110,101,119, 32, 61, 32,115, +114, 99, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,114, 99, 32, 61, 32,101, +114,114, 95,111,114, 95,110,101,119, 32,111,114, 32,115,114, 99, 10, 32, 32, 32, + 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104, +101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 95,111, +114, 95,110,101,119, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114, +101,116,117,114,110, 32, 99,104,117,110,107, 32,101,110,100, 10, 32, 32, 32, 32, +101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, +115,116,114,105,110,103, 32,115,111,117,114, 99,101, 10,102,117,110, 99,116,105, +111,110, 32,115,111,117,114, 99,101, 46,115,116,114,105,110,103, 40,115, 41, 10, + 32, 32, 32, 32,105,102, 32,115, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, + 32, 32,108,111, 99, 97,108, 32,105, 32, 61, 32, 49, 10, 32, 32, 32, 32, 32, 32, + 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104, +117,110,107, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115, 44, 32, +105, 44, 32,105, 43, 66, 76, 79, 67, 75, 83, 73, 90, 69, 45, 49, 41, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105, 32, 61, 32,105, 32, 43, 32, 66, 76, + 79, 67, 75, 83, 73, 90, 69, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +105,102, 32, 99,104,117,110,107, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32, +114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,110,105,108, + 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, + 32,101,108,115,101, 32,114,101,116,117,114,110, 32,115,111,117,114, 99,101, 46, +101,109,112,116,121, 40, 41, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, + 99,114,101, 97,116,101,115, 32,114,101,119,105,110,100, 97, 98,108,101, 32,115, +111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110, 32,115,111,117,114, 99, +101, 46,114,101,119,105,110,100, 40,115,114, 99, 41, 10, 32, 32, 32, 32, 98, 97, +115,101, 46, 97,115,115,101,114,116, 40,115,114, 99, 41, 10, 32, 32, 32, 32,108, +111, 99, 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32,114,101,116,117, +114,110, 32,102,117,110, 99,116,105,111,110, 40, 99,104,117,110,107, 41, 10, 32, + 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32, +116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117, +110,107, 32, 61, 32,116, 97, 98,108,101, 46,114,101,109,111,118,101, 40,116, 41, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, + 99,104,117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,115,114, + 99, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, + 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 32,101,110,100, 10, 32, 32, + 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40,116, 44, 32, 99, +104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, + 32, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, +115,111,117,114, 99,101, 46, 99,104, 97,105,110, 40,115,114, 99, 44, 32,102, 41, + 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114, 99, + 32, 97,110,100, 32,102, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108, 97, +115,116, 95,105,110, 44, 32,108, 97,115,116, 95,111,117,116, 32, 61, 32, 34, 34, + 44, 32, 34, 34, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,116, 97,116,101, + 32, 61, 32, 34,102,101,101,100,105,110,103, 34, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,101,114,114, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117, +110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, +110,111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104,101,110, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, + 40, 39,115,111,117,114, 99,101, 32,105,115, 32,101,109,112,116,121, 33, 39, 44, + 32, 50, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, + 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,116, 97,116,101, 32, 61, + 61, 32, 34,102,101,101,100,105,110,103, 34, 32,116,104,101,110, 10, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,115,116, 95,105,110, + 44, 32,101,114,114, 32, 61, 32,115,114, 99, 40, 41, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101, +110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110, +100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97, +115,116, 95,111,117,116, 32, 61, 32,102, 40,108, 97,115,116, 95,105,110, 41, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110, +111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104,101,110, 10, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, +108, 97,115,116, 95,105,110, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115, +101, 46,101,114,114,111,114, 40, 39,102,105,108,116,101,114, 32,114,101,116,117, +114,110,101,100, 32,105,110, 97,112,112,114,111,112,114,105, 97,116,101, 32,110, +105,108, 39, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, + 32,110,105,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,101,108,115,101,105,102, 32,108, 97,115,116, 95,111,117,116, + 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116, 97,116,101, 32, 61, 32, + 34,101, 97,116,105,110,103, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95,105,110, 32, +116,104,101,110, 32,108, 97,115,116, 95,105,110, 32, 61, 32, 34, 34, 32,101,110, +100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,114,101,116,117,114,110, 32,108, 97,115,116, 95,111,117,116, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,115,116, 95,111,117,116, 32, + 61, 32,102, 40,108, 97,115,116, 95,105,110, 41, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95,111,117,116, + 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95, +105,110, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116, + 97,116,101, 32, 61, 32, 34,102,101,101,100,105,110,103, 34, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 39,102,105,108, +116,101,114, 32,114,101,116,117,114,110,101,100, 32, 34, 34, 39, 41, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110, +100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108, +115,101,105,102, 32,110,111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104, +101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,105,102, 32,108, 97,115,116, 95,105,110, 32,116,104,101,110, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 39,102,105,108,116,101, +114, 32,114,101,116,117,114,110,101,100, 32,105,110, 97,112,112,114,111,112,114, +105, 97,116,101, 32,110,105,108, 39, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +114,101,116,117,114,110, 32,110,105,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, +114,110, 32,108, 97,115,116, 95,111,117,116, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, + 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97, +116,101,115, 32, 97, 32,115,111,117,114, 99,101, 32,116,104, 97,116, 32,112,114, +111,100,117, 99,101,115, 32, 99,111,110,116,101,110,116,115, 32,111,102, 32,115, +101,118,101,114, 97,108, 32,115,111,117,114, 99,101,115, 44, 32,111,110,101, 32, + 97,102,116,101,114, 32,116,104,101, 10, 45, 45, 32,111,116,104,101,114, 44, 32, + 97,115, 32,105,102, 32,116,104,101,121, 32,119,101,114,101, 32, 99,111,110, 99, + 97,116,101,110, 97,116,101,100, 10, 45, 45, 32, 40,116,104, 97,110,107,115, 32, +116,111, 32, 87,105,109, 32, 67,111,117,119,101,110, 98,101,114,103, 41, 10,102, +117,110, 99,116,105,111,110, 32,115,111,117,114, 99,101, 46, 99, 97,116, 40, 46, + 46, 46, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,114, 99, 32, 61, 32, +116, 97, 98,108,101, 46,114,101,109,111,118,101, 40, 97,114,103, 44, 32, 49, 41, + 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, + 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,115,114, 99, + 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97, +108, 32, 99,104,117,110,107, 44, 32,101,114,114, 32, 61, 32,115,114, 99, 40, 41, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110, +107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 32, +101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101, +114,114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, +101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +115,114, 99, 32, 61, 32,116, 97, 98,108,101, 46,114,101,109,111,118,101, 40, 97, +114,103, 44, 32, 49, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, + 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 83,105,110,107, 32,115,116, +117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105,110,107, 32, +116,104, 97,116, 32,115,116,111,114,101,115, 32,105,110,116,111, 32, 97, 32,116, + 97, 98,108,101, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,116, + 97, 98,108,101, 40,116, 41, 10, 32, 32, 32, 32,116, 32, 61, 32,116, 32,111,114, + 32,123,125, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,102,117, +110, 99,116,105,111,110, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10, 32, + 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107, 32,116,104,101,110, + 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40,116, 44, 32, 99,104,117, +110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, +114,110, 32, 49, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116, +117,114,110, 32,102, 44, 32,116, 10,101,110,100, 10, 10, 45, 45, 32,116,117,114, +110,115, 32, 97, 32,102, 97,110, 99,121, 32,115,105,110,107, 32,105,110,116,111, + 32, 97, 32,115,105,109,112,108,101, 32,115,105,110,107, 10,102,117,110, 99,116, +105,111,110, 32,115,105,110,107, 46,115,105,109,112,108,105,102,121, 40,115,110, +107, 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115, +110,107, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116, +105,111,110, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114, 95,111, +114, 95,110,101,119, 32, 61, 32,115,110,107, 40, 99,104,117,110,107, 44, 32,101, +114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114, +101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, +101,114,114, 95,111,114, 95,110,101,119, 32,101,110,100, 10, 32, 32, 32, 32, 32, + 32, 32, 32,115,110,107, 32, 61, 32,101,114,114, 95,111,114, 95,110,101,119, 32, +111,114, 32,115,110,107, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114, +110, 32, 49, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, + 99,114,101, 97,116,101,115, 32, 97, 32,102,105,108,101, 32,115,105,110,107, 10, +102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,102,105,108,101, 40,104, + 97,110,100,108,101, 44, 32,105,111, 95,101,114,114, 41, 10, 32, 32, 32, 32,105, +102, 32,104, 97,110,100,108,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, + 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 99,104, +117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,104, 97,110,100, +108,101, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, +104, 97,110,100,108,101, 58,119,114,105,116,101, 40, 99,104,117,110,107, 41, 32, +101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, +101,108,115,101, 32,114,101,116,117,114,110, 32,115,105,110,107, 46,101,114,114, +111,114, 40,105,111, 95,101,114,114, 32,111,114, 32, 34,117,110, 97, 98,108,101, + 32,116,111, 32,111,112,101,110, 32,102,105,108,101, 34, 41, 32,101,110,100, 10, +101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105, +110,107, 32,116,104, 97,116, 32,100,105,115, 99, 97,114,100,115, 32,100, 97,116, + 97, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,110,117,108, +108, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, + 10, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,110,117,108,108, + 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,110,117,108,108, 10,101, +110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105,110, +107, 32,116,104, 97,116, 32,106,117,115,116, 32,114,101,116,117,114,110,115, 32, + 97,110, 32,101,114,114,111,114, 10,102,117,110, 99,116,105,111,110, 32,115,105, +110,107, 46,101,114,114,111,114, 40,101,114,114, 41, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 10, + 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 97,105, +110,115, 32, 97, 32,115,105,110,107, 32,119,105,116,104, 32, 97, 32,102,105,108, +116,101,114, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46, 99,104, + 97,105,110, 40,102, 44, 32,115,110,107, 41, 10, 32, 32, 32, 32, 98, 97,115,101, + 46, 97,115,115,101,114,116, 40,102, 32, 97,110,100, 32,115,110,107, 41, 10, 32, + 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 99, +104,117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105, +102, 32, 99,104,117,110,107, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,102,105,108, +116,101,114,101,100, 32, 61, 32,102, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,100,111,110,101, 32, + 61, 32, 99,104,117,110,107, 32, 97,110,100, 32, 34, 34, 10, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, + 97,108, 32,114,101,116, 44, 32,115,110,107,101,114,114, 32, 61, 32,115,110,107, + 40,102,105,108,116,101,114,101,100, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114, +101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, +115,110,107,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,105,102, 32,102,105,108,116,101,114,101,100, 32, 61, + 61, 32,100,111,110,101, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 49, + 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32,102,105,108,116,101,114,101,100, 32, 61, 32,102, 40,100,111,110,101, 41, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, + 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 49, 32,101,110, +100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 80,117,109,112, + 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 10, 45, 45, 32,112,117,109,112,115, 32,111,110,101, 32, 99,104, +117,110,107, 32,102,114,111,109, 32,116,104,101, 32,115,111,117,114, 99,101, 32, +116,111, 32,116,104,101, 32,115,105,110,107, 10,102,117,110, 99,116,105,111,110, + 32,112,117,109,112, 46,115,116,101,112, 40,115,114, 99, 44, 32,115,110,107, 41, + 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,115,114, + 99, 95,101,114,114, 32, 61, 32,115,114, 99, 40, 41, 10, 32, 32, 32, 32,108,111, + 99, 97,108, 32,114,101,116, 44, 32,115,110,107, 95,101,114,114, 32, 61, 32,115, +110,107, 40, 99,104,117,110,107, 44, 32,115,114, 99, 95,101,114,114, 41, 10, 32, + 32, 32, 32,105,102, 32, 99,104,117,110,107, 32, 97,110,100, 32,114,101,116, 32, +116,104,101,110, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32,101,108, +115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,115,114, 99, 95,101, +114,114, 32,111,114, 32,115,110,107, 95,101,114,114, 32,101,110,100, 10,101,110, +100, 10, 10, 45, 45, 32,112,117,109,112,115, 32, 97,108,108, 32,100, 97,116, 97, + 32,102,114,111,109, 32, 97, 32,115,111,117,114, 99,101, 32,116,111, 32, 97, 32, +115,105,110,107, 44, 32,117,115,105,110,103, 32, 97, 32,115,116,101,112, 32,102, +117,110, 99,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32,112,117,109, +112, 46, 97,108,108, 40,115,114, 99, 44, 32,115,110,107, 44, 32,115,116,101,112, + 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114, + 99, 32, 97,110,100, 32,115,110,107, 41, 10, 32, 32, 32, 32,115,116,101,112, 32, + 61, 32,115,116,101,112, 32,111,114, 32,112,117,109,112, 46,115,116,101,112, 10, + 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, 10, 32, 32, + 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114, + 32, 61, 32,115,116,101,112, 40,115,114, 99, 44, 32,115,110,107, 41, 10, 32, 32, + 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,116, 32,116,104,101, +110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, + 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114, +114, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114, +101,116,117,114,110, 32, 49, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, +101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, +}; + + if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"ltn12.lua")==0) lua_call(L, 0, 0); +} diff --git a/src/libraries/luasocket/libluasocket/mime.lua.h b/src/libraries/luasocket/libluasocket/mime.lua.h index 3e35dd029..c758dcd5b 100644 --- a/src/libraries/luasocket/libluasocket/mime.lua.h +++ b/src/libraries/luasocket/libluasocket/mime.lua.h @@ -1,133 +1,133 @@ -/* code automatically generated by bin2c -- DO NOT EDIT */ -{ -/* #include'ing this file in a C program is equivalent to calling - if (luaL_loadfile(L,"mime.lua")==0) lua_call(L, 0, 0); -*/ -/* mime.lua */ -static const unsigned char B1[]={ - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 77, 73, 77, 69, 32,115,117,112,112,111,114,116, 32,102,111,114, 32,116,104, -101, 32, 76,117, 97, 32,108, 97,110,103,117, 97,103,101, 46, 10, 45, 45, 32, 65, -117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, - 45, 32, 67,111,110,102,111,114,109,105,110,103, 32,116,111, 32, 82, 70, 67,115, - 32, 50, 48, 52, 53, 45, 50, 48, 52, 57, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, - 58, 32, 36, 73,100, 58, 32,109,105,109,101, 46,108,117, 97, 44,118, 32, 49, 46, - 50, 57, 32, 50, 48, 48, 55, 47, 48, 54, 47, 49, 49, 32, 50, 51, 58, 52, 52, 58, - 53, 52, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97, -114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, - 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97, -115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32, - 61, 32,114,101,113,117,105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,108, -111, 99, 97,108, 32,109,105,109,101, 32, 61, 32,114,101,113,117,105,114,101, 40, - 34,109,105,109,101, 46, 99,111,114,101, 34, 41, 10,108,111, 99, 97,108, 32,105, -111, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,105,111, 34, 41, 10,108,111, - 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114,101,113,117,105,114,101, - 40, 34,115,116,114,105,110,103, 34, 41, 10,109,111,100,117,108,101, 40, 34,109, -105,109,101, 34, 41, 10, 10, 45, 45, 32,101,110, 99,111,100,101, 44, 32,100,101, - 99,111,100,101, 32, 97,110,100, 32,119,114, 97,112, 32, 97,108,103,111,114,105, -116,104,109, 32,116, 97, 98,108,101,115, 10,101,110, 99,111,100,101,116, 32, 61, - 32,123,125, 10,100,101, 99,111,100,101,116, 32, 61, 32,123,125, 10,119,114, 97, -112,116, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, - 97, 32,102,117,110, 99,116,105,111,110, 32,116,104, 97,116, 32, 99,104,111,111, -115,101,115, 32, 97, 32,102,105,108,116,101,114, 32, 98,121, 32,110, 97,109,101, - 32,102,114,111,109, 32, 97, 32,103,105,118,101,110, 32,116, 97, 98,108,101, 10, -108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, 99,104,111,111,115, -101, 40,116, 97, 98,108,101, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, -102,117,110, 99,116,105,111,110, 40,110, 97,109,101, 44, 32,111,112,116, 49, 44, - 32,111,112,116, 50, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 98, 97, -115,101, 46,116,121,112,101, 40,110, 97,109,101, 41, 32,126, 61, 32, 34,115,116, -114,105,110,103, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,110, 97,109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50, 32, - 61, 32, 34,100,101,102, 97,117,108,116, 34, 44, 32,110, 97,109,101, 44, 32,111, -112,116, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, - 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,116, 97, 98,108,101, 91, -110, 97,109,101, 32,111,114, 32, 34,110,105,108, 34, 93, 10, 32, 32, 32, 32, 32, - 32, 32, 32,105,102, 32,110,111,116, 32,102, 32,116,104,101,110, 32, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, - 40, 34,117,110,107,110,111,119,110, 32,107,101,121, 32, 40, 34, 32, 46, 46, 32, - 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110, 97,109,101, 41, 32, - 46, 46, 32, 34, 41, 34, 44, 32, 51, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101, -108,115,101, 32,114,101,116,117,114,110, 32,102, 40,111,112,116, 49, 44, 32,111, -112,116, 50, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, - 10, 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,101,110, 99,111, -100,105,110,103, 32,102,105,108,116,101,114,115, 10,101,110, 99,111,100,101,116, - 91, 39, 98, 97,115,101, 54, 52, 39, 93, 32, 61, 32,102,117,110, 99,116,105,111, -110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,116,110, 49, 50, - 46,102,105,108,116,101,114, 46, 99,121, 99,108,101, 40, 98, 54, 52, 44, 32, 34, - 34, 41, 10,101,110,100, 10, 10,101,110, 99,111,100,101,116, 91, 39,113,117,111, -116,101,100, 45,112,114,105,110,116, 97, 98,108,101, 39, 93, 32, 61, 32,102,117, -110, 99,116,105,111,110, 40,109,111,100,101, 41, 10, 32, 32, 32, 32,114,101,116, -117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99, -108,101, 40,113,112, 44, 32, 34, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 40, -109,111,100,101, 32, 61, 61, 32, 34, 98,105,110, 97,114,121, 34, 41, 32, 97,110, -100, 32, 34, 61, 48, 68, 61, 48, 65, 34, 32,111,114, 32, 34, 92,114, 92,110, 34, - 41, 10,101,110,100, 10, 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101, - 32,100,101, 99,111,100,105,110,103, 32,102,105,108,116,101,114,115, 10,100,101, - 99,111,100,101,116, 91, 39, 98, 97,115,101, 54, 52, 39, 93, 32, 61, 32,102,117, -110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, -108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108,101, 40,117, -110, 98, 54, 52, 44, 32, 34, 34, 41, 10,101,110,100, 10, 10,100,101, 99,111,100, -101,116, 91, 39,113,117,111,116,101,100, 45,112,114,105,110,116, 97, 98,108,101, - 39, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, -114,101,116,117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, - 99,121, 99,108,101, 40,117,110,113,112, 44, 32, 34, 34, 41, 10,101,110,100, 10, - 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,102,111,114,109, - 97,116, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32,105,102, 32, 99,104,117, -110,107, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99, -104,117,110,107, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32,114,101,116,117, -114,110, 32, 34, 39, 39, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, - 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,108,101,110, 40, 99, -104,117,110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,108,115,101, 32,114, -101,116,117,114,110, 32, 34,110,105,108, 34, 32,101,110,100, 10,101,110,100, 10, - 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,108,105,110,101, 45, -119,114, 97,112, 32,102,105,108,116,101,114,115, 10,119,114, 97,112,116, 91, 39, -116,101,120,116, 39, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,108,101, -110,103,116,104, 41, 10, 32, 32, 32, 32,108,101,110,103,116,104, 32, 61, 32,108, -101,110,103,116,104, 32,111,114, 32, 55, 54, 10, 32, 32, 32, 32,114,101,116,117, -114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108, -101, 40,119,114,112, 44, 32,108,101,110,103,116,104, 44, 32,108,101,110,103,116, -104, 41, 10,101,110,100, 10,119,114, 97,112,116, 91, 39, 98, 97,115,101, 54, 52, - 39, 93, 32, 61, 32,119,114, 97,112,116, 91, 39,116,101,120,116, 39, 93, 10,119, -114, 97,112,116, 91, 39,100,101,102, 97,117,108,116, 39, 93, 32, 61, 32,119,114, - 97,112,116, 91, 39,116,101,120,116, 39, 93, 10, 10,119,114, 97,112,116, 91, 39, -113,117,111,116,101,100, 45,112,114,105,110,116, 97, 98,108,101, 39, 93, 32, 61, - 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117, -114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108, -101, 40,113,112,119,114,112, 44, 32, 55, 54, 44, 32, 55, 54, 41, 10,101,110,100, - 10, 10, 45, 45, 32,102,117,110, 99,116,105,111,110, 32,116,104, 97,116, 32, 99, -104,111,111,115,101, 32,116,104,101, 32,101,110, 99,111,100,105,110,103, 44, 32, -100,101, 99,111,100,105,110,103, 32,111,114, 32,119,114, 97,112, 32, 97,108,103, -111,114,105,116,104,109, 10,101,110, 99,111,100,101, 32, 61, 32, 99,104,111,111, -115,101, 40,101,110, 99,111,100,101,116, 41, 10,100,101, 99,111,100,101, 32, 61, - 32, 99,104,111,111,115,101, 40,100,101, 99,111,100,101,116, 41, 10,119,114, 97, -112, 32, 61, 32, 99,104,111,111,115,101, 40,119,114, 97,112,116, 41, 10, 10, 45, - 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,101,110,100, 45,111,102, 45, -108,105,110,101, 32,110,111,114,109, 97,108,105,122, 97,116,105,111,110, 32,102, -105,108,116,101,114, 10,102,117,110, 99,116,105,111,110, 32,110,111,114,109, 97, -108,105,122,101, 40,109, 97,114,107,101,114, 41, 10, 32, 32, 32, 32,114,101,116, -117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99, -108,101, 40,101,111,108, 44, 32, 48, 44, 32,109, 97,114,107,101,114, 41, 10,101, -110,100, 10, 10, 45, 45, 32,104,105,103,104, 32,108,101,118,101,108, 32,115,116, -117,102,102,105,110,103, 32,102,105,108,116,101,114, 10,102,117,110, 99,116,105, -111,110, 32,115,116,117,102,102, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114, -110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108,101, - 40,100,111,116, 44, 32, 50, 41, 10,101,110,100, 10, -}; - - if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"mime.lua")==0) lua_call(L, 0, 0); -} +/* code automatically generated by bin2c -- DO NOT EDIT */ +{ +/* #include'ing this file in a C program is equivalent to calling + if (luaL_loadfile(L,"mime.lua")==0) lua_call(L, 0, 0); +*/ +/* mime.lua */ +static const unsigned char B1[]={ + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 77, 73, 77, 69, 32,115,117,112,112,111,114,116, 32,102,111,114, 32,116,104, +101, 32, 76,117, 97, 32,108, 97,110,103,117, 97,103,101, 46, 10, 45, 45, 32, 65, +117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, + 45, 32, 67,111,110,102,111,114,109,105,110,103, 32,116,111, 32, 82, 70, 67,115, + 32, 50, 48, 52, 53, 45, 50, 48, 52, 57, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, + 58, 32, 36, 73,100, 58, 32,109,105,109,101, 46,108,117, 97, 44,118, 32, 49, 46, + 50, 57, 32, 50, 48, 48, 55, 47, 48, 54, 47, 49, 49, 32, 50, 51, 58, 52, 52, 58, + 53, 52, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97, +114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, + 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97, +115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32, + 61, 32,114,101,113,117,105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,108, +111, 99, 97,108, 32,109,105,109,101, 32, 61, 32,114,101,113,117,105,114,101, 40, + 34,109,105,109,101, 46, 99,111,114,101, 34, 41, 10,108,111, 99, 97,108, 32,105, +111, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,105,111, 34, 41, 10,108,111, + 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114,101,113,117,105,114,101, + 40, 34,115,116,114,105,110,103, 34, 41, 10,109,111,100,117,108,101, 40, 34,109, +105,109,101, 34, 41, 10, 10, 45, 45, 32,101,110, 99,111,100,101, 44, 32,100,101, + 99,111,100,101, 32, 97,110,100, 32,119,114, 97,112, 32, 97,108,103,111,114,105, +116,104,109, 32,116, 97, 98,108,101,115, 10,101,110, 99,111,100,101,116, 32, 61, + 32,123,125, 10,100,101, 99,111,100,101,116, 32, 61, 32,123,125, 10,119,114, 97, +112,116, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, + 97, 32,102,117,110, 99,116,105,111,110, 32,116,104, 97,116, 32, 99,104,111,111, +115,101,115, 32, 97, 32,102,105,108,116,101,114, 32, 98,121, 32,110, 97,109,101, + 32,102,114,111,109, 32, 97, 32,103,105,118,101,110, 32,116, 97, 98,108,101, 10, +108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, 99,104,111,111,115, +101, 40,116, 97, 98,108,101, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, +102,117,110, 99,116,105,111,110, 40,110, 97,109,101, 44, 32,111,112,116, 49, 44, + 32,111,112,116, 50, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 98, 97, +115,101, 46,116,121,112,101, 40,110, 97,109,101, 41, 32,126, 61, 32, 34,115,116, +114,105,110,103, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,110, 97,109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50, 32, + 61, 32, 34,100,101,102, 97,117,108,116, 34, 44, 32,110, 97,109,101, 44, 32,111, +112,116, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, + 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,116, 97, 98,108,101, 91, +110, 97,109,101, 32,111,114, 32, 34,110,105,108, 34, 93, 10, 32, 32, 32, 32, 32, + 32, 32, 32,105,102, 32,110,111,116, 32,102, 32,116,104,101,110, 32, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, + 40, 34,117,110,107,110,111,119,110, 32,107,101,121, 32, 40, 34, 32, 46, 46, 32, + 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110, 97,109,101, 41, 32, + 46, 46, 32, 34, 41, 34, 44, 32, 51, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101, +108,115,101, 32,114,101,116,117,114,110, 32,102, 40,111,112,116, 49, 44, 32,111, +112,116, 50, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, + 10, 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,101,110, 99,111, +100,105,110,103, 32,102,105,108,116,101,114,115, 10,101,110, 99,111,100,101,116, + 91, 39, 98, 97,115,101, 54, 52, 39, 93, 32, 61, 32,102,117,110, 99,116,105,111, +110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,116,110, 49, 50, + 46,102,105,108,116,101,114, 46, 99,121, 99,108,101, 40, 98, 54, 52, 44, 32, 34, + 34, 41, 10,101,110,100, 10, 10,101,110, 99,111,100,101,116, 91, 39,113,117,111, +116,101,100, 45,112,114,105,110,116, 97, 98,108,101, 39, 93, 32, 61, 32,102,117, +110, 99,116,105,111,110, 40,109,111,100,101, 41, 10, 32, 32, 32, 32,114,101,116, +117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99, +108,101, 40,113,112, 44, 32, 34, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 40, +109,111,100,101, 32, 61, 61, 32, 34, 98,105,110, 97,114,121, 34, 41, 32, 97,110, +100, 32, 34, 61, 48, 68, 61, 48, 65, 34, 32,111,114, 32, 34, 92,114, 92,110, 34, + 41, 10,101,110,100, 10, 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101, + 32,100,101, 99,111,100,105,110,103, 32,102,105,108,116,101,114,115, 10,100,101, + 99,111,100,101,116, 91, 39, 98, 97,115,101, 54, 52, 39, 93, 32, 61, 32,102,117, +110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, +108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108,101, 40,117, +110, 98, 54, 52, 44, 32, 34, 34, 41, 10,101,110,100, 10, 10,100,101, 99,111,100, +101,116, 91, 39,113,117,111,116,101,100, 45,112,114,105,110,116, 97, 98,108,101, + 39, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, +114,101,116,117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, + 99,121, 99,108,101, 40,117,110,113,112, 44, 32, 34, 34, 41, 10,101,110,100, 10, + 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,102,111,114,109, + 97,116, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32,105,102, 32, 99,104,117, +110,107, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99, +104,117,110,107, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32,114,101,116,117, +114,110, 32, 34, 39, 39, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, + 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,108,101,110, 40, 99, +104,117,110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,108,115,101, 32,114, +101,116,117,114,110, 32, 34,110,105,108, 34, 32,101,110,100, 10,101,110,100, 10, + 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,108,105,110,101, 45, +119,114, 97,112, 32,102,105,108,116,101,114,115, 10,119,114, 97,112,116, 91, 39, +116,101,120,116, 39, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,108,101, +110,103,116,104, 41, 10, 32, 32, 32, 32,108,101,110,103,116,104, 32, 61, 32,108, +101,110,103,116,104, 32,111,114, 32, 55, 54, 10, 32, 32, 32, 32,114,101,116,117, +114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108, +101, 40,119,114,112, 44, 32,108,101,110,103,116,104, 44, 32,108,101,110,103,116, +104, 41, 10,101,110,100, 10,119,114, 97,112,116, 91, 39, 98, 97,115,101, 54, 52, + 39, 93, 32, 61, 32,119,114, 97,112,116, 91, 39,116,101,120,116, 39, 93, 10,119, +114, 97,112,116, 91, 39,100,101,102, 97,117,108,116, 39, 93, 32, 61, 32,119,114, + 97,112,116, 91, 39,116,101,120,116, 39, 93, 10, 10,119,114, 97,112,116, 91, 39, +113,117,111,116,101,100, 45,112,114,105,110,116, 97, 98,108,101, 39, 93, 32, 61, + 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117, +114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108, +101, 40,113,112,119,114,112, 44, 32, 55, 54, 44, 32, 55, 54, 41, 10,101,110,100, + 10, 10, 45, 45, 32,102,117,110, 99,116,105,111,110, 32,116,104, 97,116, 32, 99, +104,111,111,115,101, 32,116,104,101, 32,101,110, 99,111,100,105,110,103, 44, 32, +100,101, 99,111,100,105,110,103, 32,111,114, 32,119,114, 97,112, 32, 97,108,103, +111,114,105,116,104,109, 10,101,110, 99,111,100,101, 32, 61, 32, 99,104,111,111, +115,101, 40,101,110, 99,111,100,101,116, 41, 10,100,101, 99,111,100,101, 32, 61, + 32, 99,104,111,111,115,101, 40,100,101, 99,111,100,101,116, 41, 10,119,114, 97, +112, 32, 61, 32, 99,104,111,111,115,101, 40,119,114, 97,112,116, 41, 10, 10, 45, + 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,101,110,100, 45,111,102, 45, +108,105,110,101, 32,110,111,114,109, 97,108,105,122, 97,116,105,111,110, 32,102, +105,108,116,101,114, 10,102,117,110, 99,116,105,111,110, 32,110,111,114,109, 97, +108,105,122,101, 40,109, 97,114,107,101,114, 41, 10, 32, 32, 32, 32,114,101,116, +117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99, +108,101, 40,101,111,108, 44, 32, 48, 44, 32,109, 97,114,107,101,114, 41, 10,101, +110,100, 10, 10, 45, 45, 32,104,105,103,104, 32,108,101,118,101,108, 32,115,116, +117,102,102,105,110,103, 32,102,105,108,116,101,114, 10,102,117,110, 99,116,105, +111,110, 32,115,116,117,102,102, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114, +110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108,101, + 40,100,111,116, 44, 32, 50, 41, 10,101,110,100, 10, +}; + + if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"mime.lua")==0) lua_call(L, 0, 0); +} diff --git a/src/libraries/luasocket/libluasocket/pre.lua b/src/libraries/luasocket/libluasocket/pre.lua index 91699b0e1..fd6ebb15f 100644 --- a/src/libraries/luasocket/libluasocket/pre.lua +++ b/src/libraries/luasocket/libluasocket/pre.lua @@ -1 +1 @@ -if not socket then error("No socket.") end +if not socket then error("No socket.") end diff --git a/src/libraries/luasocket/libluasocket/smtp.lua.h b/src/libraries/luasocket/libluasocket/smtp.lua.h index 769eafd4f..e8d7f9871 100644 --- a/src/libraries/luasocket/libluasocket/smtp.lua.h +++ b/src/libraries/luasocket/libluasocket/smtp.lua.h @@ -1,410 +1,410 @@ -/* code automatically generated by bin2c -- DO NOT EDIT */ -{ -/* #include'ing this file in a C program is equivalent to calling - if (luaL_loadfile(L,"smtp.lua")==0) lua_call(L, 0, 0); -*/ -/* smtp.lua */ -static const unsigned char B1[]={ - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 83, 77, 84, 80, 32, 99,108,105,101,110,116, 32,115,117,112,112,111,114,116, - 32,102,111,114, 32,116,104,101, 32, 76,117, 97, 32,108, 97,110,103,117, 97,103, -101, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32,116,111,111,108, -107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101,103, -111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, - 73,100, 58, 32,115,109,116,112, 46,108,117, 97, 44,118, 32, 49, 46, 52, 54, 32, - 50, 48, 48, 55, 47, 48, 51, 47, 49, 50, 32, 48, 52, 58, 48, 56, 58, 52, 48, 32, -100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114,101, 32, -109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, 32,100,101, -112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97,115,101, 32, - 61, 32, 95, 71, 10,108,111, 99, 97,108, 32, 99,111,114,111,117,116,105,110,101, - 32, 61, 32,114,101,113,117,105,114,101, 40, 34, 99,111,114,111,117,116,105,110, -101, 34, 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114, -101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108,111, 99, - 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,109, - 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,111,115, 32, 61, 32,114,101,113, -117,105,114,101, 40, 34,111,115, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99, -107,101,116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101, -116, 34, 41, 10,108,111, 99, 97,108, 32,116,112, 32, 61, 32,114,101,113,117,105, -114,101, 40, 34,115,111, 99,107,101,116, 46,116,112, 34, 41, 10,108,111, 99, 97, -108, 32,108,116,110, 49, 50, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,108, -116,110, 49, 50, 34, 41, 10,108,111, 99, 97,108, 32,109,105,109,101, 32, 61, 32, -114,101,113,117,105,114,101, 40, 34,109,105,109,101, 34, 41, 10,109,111,100,117, -108,101, 40, 34,115,111, 99,107,101,116, 46,115,109,116,112, 34, 41, 10, 10, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, - 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97,110,116,115, 10, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,116, -105,109,101,111,117,116, 32,102,111,114, 32, 99,111,110,110,101, 99,116,105,111, -110, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100,101, -102, 97,117,108,116, 32,115,101,114,118,101,114, 32,117,115,101,100, 32,116,111, - 32,115,101,110,100, 32,101, 45,109, 97,105,108,115, 10, 83, 69, 82, 86, 69, 82, - 32, 61, 32, 34,108,111, 99, 97,108,104,111,115,116, 34, 10, 45, 45, 32,100,101, -102, 97,117,108,116, 32,112,111,114,116, 10, 80, 79, 82, 84, 32, 61, 32, 50, 53, - 10, 45, 45, 32,100,111,109, 97,105,110, 32,117,115,101,100, 32,105,110, 32, 72, - 69, 76, 79, 32, 99,111,109,109, 97,110,100, 32, 97,110,100, 32,100,101,102, 97, -117,108,116, 32,115,101,110,100,109, 97,105,108, 10, 45, 45, 32, 73,102, 32,119, -101, 32, 97,114,101, 32,117,110,100,101,114, 32, 97, 32, 67, 71, 73, 44, 32,116, -114,121, 32,116,111, 32,103,101,116, 32,102,114,111,109, 32,101,110,118,105,114, -111,110,109,101,110,116, 10, 68, 79, 77, 65, 73, 78, 32, 61, 32,111,115, 46,103, -101,116,101,110,118, 40, 34, 83, 69, 82, 86, 69, 82, 95, 78, 65, 77, 69, 34, 41, - 32,111,114, 32, 34,108,111, 99, 97,108,104,111,115,116, 34, 10, 45, 45, 32,100, -101,102, 97,117,108,116, 32,116,105,109,101, 32,122,111,110,101, 32, 40,109,101, - 97,110,115, 32,119,101, 32,100,111,110, 39,116, 32,107,110,111,119, 41, 10, 90, - 79, 78, 69, 32, 61, 32, 34, 45, 48, 48, 48, 48, 34, 10, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32,108,101, -118,101,108, 32, 83, 77, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109,101,116, - 97,116, 32, 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123,125, 32, -125, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95, -105,110,100,101,120, 58,103,114,101,101,116, 40,100,111,109, 97,105,110, 41, 10, - 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, - 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,115, -101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, - 97,110,100, 40, 34, 69, 72, 76, 79, 34, 44, 32,100,111,109, 97,105,110, 32,111, -114, 32, 68, 79, 77, 65, 73, 78, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114, -110, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 49, 44, 32,115,101,108, -102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, - 34, 50, 46, 46, 34, 41, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105, -111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,109, 97,105, -108, 40,102,114,111,109, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, - 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 77, 65, - 73, 76, 34, 44, 32, 34, 70, 82, 79, 77, 58, 34, 32, 46, 46, 32,102,114,111,109, - 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116, -114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, - 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, -101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114, 99,112,116, 40,116,111, - 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, -116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 82, 67, 80, 84, 34, 44, 32, 34, - 84, 79, 58, 34, 32, 46, 46, 32,116,111, 41, 41, 10, 32, 32, 32, 32,114,101,116, -117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, - 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10, -102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100, -101,120, 58,100, 97,116, 97, 40,115,114, 99, 44, 32,115,116,101,112, 41, 10, 32, - 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, - 99,111,109,109, 97,110,100, 40, 34, 68, 65, 84, 65, 34, 41, 41, 10, 32, 32, 32, - 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104, -101, 99,107, 40, 34, 51, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, - 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,115,111,117,114, 99,101, 40, -115,114, 99, 44, 32,115,116,101,112, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, - 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,115,101,110,100, 40, 34, 92, -114, 92,110, 46, 92,114, 92,110, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117, -114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, - 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10,102, -117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101, -120, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114, -121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 81, - 85, 73, 84, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101, -108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, - 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105, -111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,108,111, -115,101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, - 46,116,112, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 10, 10,102,117,110, - 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, -108,111,103,105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100, - 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, -116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 65, 85, 84, 72, 34, 44, 32, 34, - 76, 79, 71, 73, 78, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114, -121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 51, 46, 46, - 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108, -102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40,109,105,109,101, 46, 98, 54, - 52, 40,117,115,101,114, 41, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116, -114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 51, 46, - 46, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101, -108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40,109,105,109,101, 46, 98, - 54, 52, 40,112, 97,115,115,119,111,114,100, 41, 41, 41, 10, 32, 32, 32, 32,114, -101,116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, -116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, - 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105, -110,100,101,120, 58,112,108, 97,105,110, 40,117,115,101,114, 44, 32,112, 97,115, -115,119,111,114,100, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,117,116, -104, 32, 61, 32, 34, 80, 76, 65, 73, 78, 32, 34, 32, 46, 46, 32,109,105,109,101, - 46, 98, 54, 52, 40, 34, 92, 48, 34, 32, 46, 46, 32,117,115,101,114, 32, 46, 46, - 32, 34, 92, 48, 34, 32, 46, 46, 32,112, 97,115,115,119,111,114,100, 41, 10, 32, - 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, - 99,111,109,109, 97,110,100, 40, 34, 65, 85, 84, 72, 34, 44, 32, 97,117,116,104, - 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116, -114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, - 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, -101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 97,117,116,104, 40,117,115, -101,114, 44, 32,112, 97,115,115,119,111,114,100, 44, 32,101,120,116, 41, 10, 32, - 32, 32, 32,105,102, 32,110,111,116, 32,117,115,101,114, 32,111,114, 32,110,111, -116, 32,112, 97,115,115,119,111,114,100, 32,116,104,101,110, 32,114,101,116,117, -114,110, 32, 49, 32,101,110,100, 10, 32, 32, 32, 32,105,102, 32,115,116,114,105, -110,103, 46,102,105,110,100, 40,101,120,116, 44, 32, 34, 65, 85, 84, 72, 91, 94, - 92,110, 93, 43, 76, 79, 71, 73, 78, 34, 41, 32,116,104,101,110, 10, 32, 32, 32, - 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 58,108,111,103, -105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100, 41, 10, 32, - 32, 32, 32,101,108,115,101,105,102, 32,115,116,114,105,110,103, 46,102,105,110, -100, 40,101,120,116, 44, 32, 34, 65, 85, 84, 72, 91, 94, 92,110, 93, 43, 80, 76, - 65, 73, 78, 34, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114, -101,116,117,114,110, 32,115,101,108,102, 58,112,108, 97,105,110, 40,117,115,101, -114, 44, 32,112, 97,115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,101,108,115, -101, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,110, -105,108, 44, 32, 34, 97,117,116,104,101,110,116,105, 99, 97,116,105,111,110, 32, -110,111,116, 32,115,117,112,112,111,114,116,101,100, 34, 41, 10, 32, 32, 32, 32, -101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,115,101,110,100, 32,109,101,115, -115, 97,103,101, 32,111,114, 32,116,104,114,111,119, 32, 97,110, 32,101,120, 99, -101,112,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97, -116, 46, 95, 95,105,110,100,101,120, 58,115,101,110,100, 40,109, 97,105,108,116, - 41, 10, 32, 32, 32, 32,115,101,108,102, 58,109, 97,105,108, 40,109, 97,105,108, -116, 46,102,114,111,109, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46, -116,121,112,101, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 32, 61, 61, 32, - 34,116, 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, - 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46,105,112, 97, -105,114,115, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 32,100,111, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 58,114, 99,112,116, - 40,118, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, -101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 58,114, 99, -112,116, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 10, 32, 32, 32, 32,101, -110,100, 10, 32, 32, 32, 32,115,101,108,102, 58,100, 97,116, 97, 40,108,116,110, - 49, 50, 46,115,111,117,114, 99,101, 46, 99,104, 97,105,110, 40,109, 97,105,108, -116, 46,115,111,117,114, 99,101, 44, 32,109,105,109,101, 46,115,116,117,102,102, - 40, 41, 41, 44, 32,109, 97,105,108,116, 46,115,116,101,112, 41, 10,101,110,100, - 10, 10,102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,115,101,114,118, -101,114, 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32, - 32, 32,108,111, 99, 97,108, 32,116,112, 32, 61, 32,115,111, 99,107,101,116, 46, -116,114,121, 40,116,112, 46, 99,111,110,110,101, 99,116, 40,115,101,114,118,101, -114, 32,111,114, 32, 83, 69, 82, 86, 69, 82, 44, 32,112,111,114,116, 32,111,114, - 32, 80, 79, 82, 84, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 84, 73, 77, 69, 79, - 85, 84, 44, 32, 99,114,101, 97,116,101, 41, 41, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,115, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, - 97, 98,108,101, 40,123,116,112, 32, 61, 32,116,112,125, 44, 32,109,101,116, 97, -116, 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32, -116,112, 32,105,115, 32, 99,108,111,115,101,100, 32,105,102, 32,119,101, 32,103, -101,116, 32, 97,110, 32,101,120, 99,101,112,116,105,111,110, 10, 32, 32, 32, 32, -115, 46,116,114,121, 32, 61, 32,115,111, 99,107,101,116, 46,110,101,119,116,114, -121, 40,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, - 32,115, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10, - 32, 32, 32, 32,114,101,116,117,114,110, 32,115, 10,101,110,100, 10, 10, 45, 45, - 32, 99,111,110,118,101,114,116, 32,104,101, 97,100,101,114,115, 32,116,111, 32, -108,111,119,101,114, 99, 97,115,101, 10,108,111, 99, 97,108, 32,102,117,110, 99, -116,105,111,110, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,104, -101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,111, -119,101,114, 32, 61, 32,123,125, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, - 32,105,110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101, -114,115, 32,111,114, 32,108,111,119,101,114, 41, 32,100,111, 10, 32, 32, 32, 32, - 32, 32, 32, 32,108,111,119,101,114, 91,115,116,114,105,110,103, 46,108,111,119, -101,114, 40,105, 41, 93, 32, 61, 32,118, 10, 32, 32, 32, 32,101,110,100, 10, 32, - 32, 32, 32,114,101,116,117,114,110, 32,108,111,119,101,114, 10,101,110,100, 10, - 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, - 77,117,108,116,105,112, 97,114,116, 32,109,101,115,115, 97,103,101, 32,115,111, -117,114, 99,101, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,104,111,112,101, -102,117,108,108,121, 32,117,110,105,113,117,101, 32,109,105,109,101, 32, 98,111, -117,110,100, 97,114,121, 10,108,111, 99, 97,108, 32,115,101,113,110,111, 32, 61, - 32, 48, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,110,101, -119, 98,111,117,110,100, 97,114,121, 40, 41, 10, 32, 32, 32, 32,115,101,113,110, -111, 32, 61, 32,115,101,113,110,111, 32, 43, 32, 49, 10, 32, 32, 32, 32,114,101, -116,117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 39, - 37,115, 37, 48, 53,100, 61, 61, 37, 48, 53,117, 39, 44, 32,111,115, 46,100, 97, -116,101, 40, 39, 37,100, 37,109, 37, 89, 37, 72, 37, 77, 37, 83, 39, 41, 44, 10, - 32, 32, 32, 32, 32, 32, 32, 32,109, 97,116,104, 46,114, 97,110,100,111,109, 40, - 48, 44, 32, 57, 57, 57, 57, 57, 41, 44, 32,115,101,113,110,111, 41, 10,101,110, -100, 10, 10, 45, 45, 32,115,101,110,100, 95,109,101,115,115, 97,103,101, 32,102, -111,114,119, 97,114,100, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 10,108, -111, 99, 97,108, 32,115,101,110,100, 95,109,101,115,115, 97,103,101, 10, 10, 45, - 45, 32,121,105,101,108,100, 32,116,104,101, 32,104,101, 97,100,101,114,115, 32, - 97,108,108, 32, 97,116, 32,111,110, 99,101, 44, 32,105,116, 39,115, 32,102, 97, -115,116,101,114, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, -115,101,110,100, 95,104,101, 97,100,101,114,115, 40,104,101, 97,100,101,114,115, - 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32, 61, 32, 34, 92,114, 92, -110, 34, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97, -115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101,114,115, 41, 32,100,111, - 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 32, 61, 32,105, 32, 46, 46, 32, 39, 58, - 32, 39, 32, 46, 46, 32,118, 32, 46, 46, 32, 34, 92,114, 92,110, 34, 32, 46, 46, - 32,104, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 99,111,114,111,117, -116,105,110,101, 46,121,105,101,108,100, 40,104, 41, 10,101,110,100, 10, 10, 45, - 45, 32,121,105,101,108,100, 32,109,117,108,116,105,112, 97,114,116, 32,109,101, -115,115, 97,103,101, 32, 98,111,100,121, 32,102,114,111,109, 32, 97, 32,109,117, -108,116,105,112, 97,114,116, 32,109,101,115,115, 97,103,101, 32,116, 97, 98,108, -101, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115,101,110, -100, 95,109,117,108,116,105,112, 97,114,116, 40,109,101,115,103,116, 41, 10, 32, - 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32,119,101, 32,104, - 97,118,101, 32,111,117,114, 32, 98,111,117,110,100, 97,114,121, 32, 97,110,100, - 32,115,101,110,100, 32,104,101, 97,100,101,114,115, 10, 32, 32, 32, 32,108,111, - 99, 97,108, 32, 98,100, 32, 61, 32,110,101,119, 98,111,117,110,100, 97,114,121, - 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115, - 32, 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,109,101,115, -103,116, 46,104,101, 97,100,101,114,115, 32,111,114, 32,123,125, 41, 10, 32, 32, - 32, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116, -121,112,101, 39, 93, 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110, -116,101,110,116, 45,116,121,112,101, 39, 93, 32,111,114, 32, 39,109,117,108,116, -105,112, 97,114,116, 47,109,105,120,101,100, 39, 10, 32, 32, 32, 32,104,101, 97, -100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39, 93, - 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45, -116,121,112,101, 39, 93, 32, 46, 46, 10, 32, 32, 32, 32, 32, 32, 32, 32, 39, 59, - 32, 98,111,117,110,100, 97,114,121, 61, 34, 39, 32, 46, 46, 32, 32, 98,100, 32, - 46, 46, 32, 39, 34, 39, 10, 32, 32, 32, 32,115,101,110,100, 95,104,101, 97,100, -101,114,115, 40,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 45, 45, 32, -115,101,110,100, 32,112,114,101, 97,109, 98,108,101, 10, 32, 32, 32, 32,105,102, - 32,109,101,115,103,116, 46, 98,111,100,121, 46,112,114,101, 97,109, 98,108,101, - 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116, -105,110,101, 46,121,105,101,108,100, 40,109,101,115,103,116, 46, 98,111,100,121, - 46,112,114,101, 97,109, 98,108,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99, -111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40, 34, 92,114, 92,110, - 34, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,115,101, -110,100, 32,101, 97, 99,104, 32,112, 97,114,116, 32,115,101,112, 97,114, 97,116, -101,100, 32, 98,121, 32, 97, 32, 98,111,117,110,100, 97,114,121, 10, 32, 32, 32, - 32,102,111,114, 32,105, 44, 32,109, 32,105,110, 32, 98, 97,115,101, 46,105,112, - 97,105,114,115, 40,109,101,115,103,116, 46, 98,111,100,121, 41, 32,100,111, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116,105,110,101, 46,121,105, -101,108,100, 40, 34, 92,114, 92,110, 45, 45, 34, 32, 46, 46, 32, 98,100, 32, 46, - 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101, -110,100, 95,109,101,115,115, 97,103,101, 40,109, 41, 10, 32, 32, 32, 32,101,110, -100, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,108, 97,115,116, 32, 98, -111,117,110,100, 97,114,121, 10, 32, 32, 32, 32, 99,111,114,111,117,116,105,110, -101, 46,121,105,101,108,100, 40, 34, 92,114, 92,110, 45, 45, 34, 32, 46, 46, 32, - 98,100, 32, 46, 46, 32, 34, 45, 45, 92,114, 92,110, 92,114, 92,110, 34, 41, 10, - 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,101,112,105,108,111,103,117,101, - 10, 32, 32, 32, 32,105,102, 32,109,101,115,103,116, 46, 98,111,100,121, 46,101, -112,105,108,111,103,117,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40,109,101,115, -103,116, 46, 98,111,100,121, 46,101,112,105,108,111,103,117,101, 41, 10, 32, 32, - 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108, -100, 40, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32,101,110,100, 10,101,110, -100, 10, 10, 45, 45, 32,121,105,101,108,100, 32,109,101,115,115, 97,103,101, 32, - 98,111,100,121, 32,102,114,111,109, 32, 97, 32,115,111,117,114, 99,101, 10,108, -111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115,101,110,100, 95,115, -111,117,114, 99,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32, 45, 45, 32, -109, 97,107,101, 32,115,117,114,101, 32,119,101, 32,104, 97,118,101, 32, 97, 32, - 99,111,110,116,101,110,116, 45,116,121,112,101, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,104,101, 97,100,101,114,115, 32, 61, 32,108,111,119,101,114, 95,104, -101, 97,100,101,114,115, 40,109,101,115,103,116, 46,104,101, 97,100,101,114,115, - 32,111,114, 32,123,125, 41, 10, 32, 32, 32, 32,104,101, 97,100,101,114,115, 91, - 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39, 93, 32, 61, 32,104,101, - 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39, - 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32, 32, 32, 39,116,101,120,116, 47,112, -108, 97,105,110, 59, 32, 99,104, 97,114,115,101,116, 61, 34,105,115,111, 45, 56, - 56, 53, 57, 45, 49, 34, 39, 10, 32, 32, 32, 32,115,101,110,100, 95,104,101, 97, -100,101,114,115, 40,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 45, 45, - 32,115,101,110,100, 32, 98,111,100,121, 32,102,114,111,109, 32,115,111,117,114, - 99,101, 10, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, - 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, - 44, 32,101,114,114, 32, 61, 32,109,101,115,103,116, 46, 98,111,100,121, 40, 41, - 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, - 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40,110,105,108, - 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105, -102, 32, 99,104,117,110,107, 32,116,104,101,110, 32, 99,111,114,111,117,116,105, -110,101, 46,121,105,101,108,100, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32,101,108,115,101, 32, 98,114,101, 97,107, 32,101,110,100, 10, 32, - 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,121,105,101,108,100, - 32,109,101,115,115, 97,103,101, 32, 98,111,100,121, 32,102,114,111,109, 32, 97, - 32,115,116,114,105,110,103, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105, -111,110, 32,115,101,110,100, 95,115,116,114,105,110,103, 40,109,101,115,103,116, - 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32,119, -101, 32,104, 97,118,101, 32, 97, 32, 99,111,110,116,101,110,116, 45,116,121,112, -101, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115, 32, - 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,109,101,115,103, -116, 46,104,101, 97,100,101,114,115, 32,111,114, 32,123,125, 41, 10, 32, 32, 32, - 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121, -112,101, 39, 93, 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116, -101,110,116, 45,116,121,112,101, 39, 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 39,116,101,120,116, 47,112,108, 97,105,110, 59, 32, 99,104, 97,114,115, -101,116, 61, 34,105,115,111, 45, 56, 56, 53, 57, 45, 49, 34, 39, 10, 32, 32, 32, - 32,115,101,110,100, 95,104,101, 97,100,101,114,115, 40,104,101, 97,100,101,114, -115, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32, 98,111,100,121, 32, -102,114,111,109, 32,115,116,114,105,110,103, 10, 32, 32, 32, 32, 99,111,114,111, -117,116,105,110,101, 46,121,105,101,108,100, 40,109,101,115,103,116, 46, 98,111, -100,121, 41, 10,101,110,100, 10, 10, 45, 45, 32,109,101,115,115, 97,103,101, 32, -115,111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110, 32,115,101,110,100, - 95,109,101,115,115, 97,103,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32, -105,102, 32, 98, 97,115,101, 46,116,121,112,101, 40,109,101,115,103,116, 46, 98, -111,100,121, 41, 32, 61, 61, 32, 34,116, 97, 98,108,101, 34, 32,116,104,101,110, - 32,115,101,110,100, 95,109,117,108,116,105,112, 97,114,116, 40,109,101,115,103, -116, 41, 10, 32, 32, 32, 32,101,108,115,101,105,102, 32, 98, 97,115,101, 46,116, -121,112,101, 40,109,101,115,103,116, 46, 98,111,100,121, 41, 32, 61, 61, 32, 34, -102,117,110, 99,116,105,111,110, 34, 32,116,104,101,110, 32,115,101,110,100, 95, -115,111,117,114, 99,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,101,108, -115,101, 32,115,101,110,100, 95,115,116,114,105,110,103, 40,109,101,115,103,116, - 41, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,115,101,116, 32,100,101, -102, 97,117,108, 32,104,101, 97,100,101,114,115, 10,108,111, 99, 97,108, 32,102, -117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116, 95,104,101, 97,100,101, -114,115, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, -108,111,119,101,114, 32, 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114, -115, 40,109,101,115,103,116, 46,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, - 32,108,111,119,101,114, 91, 34,100, 97,116,101, 34, 93, 32, 61, 32,108,111,119, -101,114, 91, 34,100, 97,116,101, 34, 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32, - 32, 32,111,115, 46,100, 97,116,101, 40, 34, 33, 37, 97, 44, 32, 37,100, 32, 37, - 98, 32, 37, 89, 32, 37, 72, 58, 37, 77, 58, 37, 83, 32, 34, 41, 32, 46, 46, 32, - 40,109,101,115,103,116, 46,122,111,110,101, 32,111,114, 32, 90, 79, 78, 69, 41, - 10, 32, 32, 32, 32,108,111,119,101,114, 91, 34,120, 45,109, 97,105,108,101,114, - 34, 93, 32, 61, 32,108,111,119,101,114, 91, 34,120, 45,109, 97,105,108,101,114, - 34, 93, 32,111,114, 32,115,111, 99,107,101,116, 46, 95, 86, 69, 82, 83, 73, 79, - 78, 10, 32, 32, 32, 32, 45, 45, 32,116,104,105,115, 32, 99, 97,110, 39,116, 32, - 98,101, 32,111,118,101,114,114,105,100,101,110, 10, 32, 32, 32, 32,108,111,119, -101,114, 91, 34,109,105,109,101, 45,118,101,114,115,105,111,110, 34, 93, 32, 61, - 32, 34, 49, 46, 48, 34, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,111, -119,101,114, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101, -115,115, 97,103,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,109,101,115, -103,116, 46,104,101, 97,100,101,114,115, 32, 61, 32, 97,100,106,117,115,116, 95, -104,101, 97,100,101,114,115, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32, 45, - 45, 32, 99,114,101, 97,116,101, 32, 97,110,100, 32,114,101,116,117,114,110, 32, -109,101,115,115, 97,103,101, 32,115,111,117,114, 99,101, 10, 32, 32, 32, 32,108, -111, 99, 97,108, 32, 99,111, 32, 61, 32, 99,111,114,111,117,116,105,110,101, 46, - 99,114,101, 97,116,101, 40,102,117,110, 99,116,105,111,110, 40, 41, 32,115,101, -110,100, 95,109,101,115,115, 97,103,101, 40,109,101,115,103,116, 41, 32,101,110, -100, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105, -111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114, -101,116, 44, 32, 97, 44, 32, 98, 32, 61, 32, 99,111,114,111,117,116,105,110,101, - 46,114,101,115,117,109,101, 40, 99,111, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, -105,102, 32,114,101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 97, - 44, 32, 98, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116, -117,114,110, 32,110,105,108, 44, 32, 97, 32,101,110,100, 10, 32, 32, 32, 32,101, -110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 10, 45, 45, 32, 72,105,103,104, 32,108,101,118,101,108, 32, 83, 77, - 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 10,115,101,110,100, 32, 61, 32,115,111, 99,107,101,116, 46,112, -114,111,116,101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,109, 97,105,108, -116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115, 32, 61, 32,111,112,101, -110, 40,109, 97,105,108,116, 46,115,101,114,118,101,114, 44, 32,109, 97,105,108, -116, 46,112,111,114,116, 44, 32,109, 97,105,108,116, 46, 99,114,101, 97,116,101, - 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,101,120,116, 32, 61, 32,115, 58, -103,114,101,101,116, 40,109, 97,105,108,116, 46,100,111,109, 97,105,110, 41, 10, - 32, 32, 32, 32,115, 58, 97,117,116,104, 40,109, 97,105,108,116, 46,117,115,101, -114, 44, 32,109, 97,105,108,116, 46,112, 97,115,115,119,111,114,100, 44, 32,101, -120,116, 41, 10, 32, 32, 32, 32,115, 58,115,101,110,100, 40,109, 97,105,108,116, - 41, 10, 32, 32, 32, 32,115, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,114, -101,116,117,114,110, 32,115, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 41, - 10, -}; - - if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"smtp.lua")==0) lua_call(L, 0, 0); -} +/* code automatically generated by bin2c -- DO NOT EDIT */ +{ +/* #include'ing this file in a C program is equivalent to calling + if (luaL_loadfile(L,"smtp.lua")==0) lua_call(L, 0, 0); +*/ +/* smtp.lua */ +static const unsigned char B1[]={ + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 83, 77, 84, 80, 32, 99,108,105,101,110,116, 32,115,117,112,112,111,114,116, + 32,102,111,114, 32,116,104,101, 32, 76,117, 97, 32,108, 97,110,103,117, 97,103, +101, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32,116,111,111,108, +107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101,103, +111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, + 73,100, 58, 32,115,109,116,112, 46,108,117, 97, 44,118, 32, 49, 46, 52, 54, 32, + 50, 48, 48, 55, 47, 48, 51, 47, 49, 50, 32, 48, 52, 58, 48, 56, 58, 52, 48, 32, +100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114,101, 32, +109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, 32,100,101, +112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97,115,101, 32, + 61, 32, 95, 71, 10,108,111, 99, 97,108, 32, 99,111,114,111,117,116,105,110,101, + 32, 61, 32,114,101,113,117,105,114,101, 40, 34, 99,111,114,111,117,116,105,110, +101, 34, 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114, +101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108,111, 99, + 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,109, + 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,111,115, 32, 61, 32,114,101,113, +117,105,114,101, 40, 34,111,115, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99, +107,101,116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101, +116, 34, 41, 10,108,111, 99, 97,108, 32,116,112, 32, 61, 32,114,101,113,117,105, +114,101, 40, 34,115,111, 99,107,101,116, 46,116,112, 34, 41, 10,108,111, 99, 97, +108, 32,108,116,110, 49, 50, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,108, +116,110, 49, 50, 34, 41, 10,108,111, 99, 97,108, 32,109,105,109,101, 32, 61, 32, +114,101,113,117,105,114,101, 40, 34,109,105,109,101, 34, 41, 10,109,111,100,117, +108,101, 40, 34,115,111, 99,107,101,116, 46,115,109,116,112, 34, 41, 10, 10, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, + 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97,110,116,115, 10, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,116, +105,109,101,111,117,116, 32,102,111,114, 32, 99,111,110,110,101, 99,116,105,111, +110, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100,101, +102, 97,117,108,116, 32,115,101,114,118,101,114, 32,117,115,101,100, 32,116,111, + 32,115,101,110,100, 32,101, 45,109, 97,105,108,115, 10, 83, 69, 82, 86, 69, 82, + 32, 61, 32, 34,108,111, 99, 97,108,104,111,115,116, 34, 10, 45, 45, 32,100,101, +102, 97,117,108,116, 32,112,111,114,116, 10, 80, 79, 82, 84, 32, 61, 32, 50, 53, + 10, 45, 45, 32,100,111,109, 97,105,110, 32,117,115,101,100, 32,105,110, 32, 72, + 69, 76, 79, 32, 99,111,109,109, 97,110,100, 32, 97,110,100, 32,100,101,102, 97, +117,108,116, 32,115,101,110,100,109, 97,105,108, 10, 45, 45, 32, 73,102, 32,119, +101, 32, 97,114,101, 32,117,110,100,101,114, 32, 97, 32, 67, 71, 73, 44, 32,116, +114,121, 32,116,111, 32,103,101,116, 32,102,114,111,109, 32,101,110,118,105,114, +111,110,109,101,110,116, 10, 68, 79, 77, 65, 73, 78, 32, 61, 32,111,115, 46,103, +101,116,101,110,118, 40, 34, 83, 69, 82, 86, 69, 82, 95, 78, 65, 77, 69, 34, 41, + 32,111,114, 32, 34,108,111, 99, 97,108,104,111,115,116, 34, 10, 45, 45, 32,100, +101,102, 97,117,108,116, 32,116,105,109,101, 32,122,111,110,101, 32, 40,109,101, + 97,110,115, 32,119,101, 32,100,111,110, 39,116, 32,107,110,111,119, 41, 10, 90, + 79, 78, 69, 32, 61, 32, 34, 45, 48, 48, 48, 48, 34, 10, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32,108,101, +118,101,108, 32, 83, 77, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109,101,116, + 97,116, 32, 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123,125, 32, +125, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95, +105,110,100,101,120, 58,103,114,101,101,116, 40,100,111,109, 97,105,110, 41, 10, + 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, + 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,115, +101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, + 97,110,100, 40, 34, 69, 72, 76, 79, 34, 44, 32,100,111,109, 97,105,110, 32,111, +114, 32, 68, 79, 77, 65, 73, 78, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114, +110, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 49, 44, 32,115,101,108, +102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, + 34, 50, 46, 46, 34, 41, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105, +111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,109, 97,105, +108, 40,102,114,111,109, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, + 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 77, 65, + 73, 76, 34, 44, 32, 34, 70, 82, 79, 77, 58, 34, 32, 46, 46, 32,102,114,111,109, + 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116, +114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, + 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, +101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114, 99,112,116, 40,116,111, + 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, +116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 82, 67, 80, 84, 34, 44, 32, 34, + 84, 79, 58, 34, 32, 46, 46, 32,116,111, 41, 41, 10, 32, 32, 32, 32,114,101,116, +117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, + 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10, +102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100, +101,120, 58,100, 97,116, 97, 40,115,114, 99, 44, 32,115,116,101,112, 41, 10, 32, + 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, + 99,111,109,109, 97,110,100, 40, 34, 68, 65, 84, 65, 34, 41, 41, 10, 32, 32, 32, + 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104, +101, 99,107, 40, 34, 51, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, + 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,115,111,117,114, 99,101, 40, +115,114, 99, 44, 32,115,116,101,112, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, + 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,115,101,110,100, 40, 34, 92, +114, 92,110, 46, 92,114, 92,110, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117, +114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, + 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10,102, +117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101, +120, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114, +121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 81, + 85, 73, 84, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101, +108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, + 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105, +111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,108,111, +115,101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, + 46,116,112, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 10, 10,102,117,110, + 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, +108,111,103,105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100, + 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, +116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 65, 85, 84, 72, 34, 44, 32, 34, + 76, 79, 71, 73, 78, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114, +121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 51, 46, 46, + 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108, +102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40,109,105,109,101, 46, 98, 54, + 52, 40,117,115,101,114, 41, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116, +114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 51, 46, + 46, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101, +108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40,109,105,109,101, 46, 98, + 54, 52, 40,112, 97,115,115,119,111,114,100, 41, 41, 41, 10, 32, 32, 32, 32,114, +101,116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, +116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, + 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105, +110,100,101,120, 58,112,108, 97,105,110, 40,117,115,101,114, 44, 32,112, 97,115, +115,119,111,114,100, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,117,116, +104, 32, 61, 32, 34, 80, 76, 65, 73, 78, 32, 34, 32, 46, 46, 32,109,105,109,101, + 46, 98, 54, 52, 40, 34, 92, 48, 34, 32, 46, 46, 32,117,115,101,114, 32, 46, 46, + 32, 34, 92, 48, 34, 32, 46, 46, 32,112, 97,115,115,119,111,114,100, 41, 10, 32, + 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, + 99,111,109,109, 97,110,100, 40, 34, 65, 85, 84, 72, 34, 44, 32, 97,117,116,104, + 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116, +114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, + 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, +101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 97,117,116,104, 40,117,115, +101,114, 44, 32,112, 97,115,115,119,111,114,100, 44, 32,101,120,116, 41, 10, 32, + 32, 32, 32,105,102, 32,110,111,116, 32,117,115,101,114, 32,111,114, 32,110,111, +116, 32,112, 97,115,115,119,111,114,100, 32,116,104,101,110, 32,114,101,116,117, +114,110, 32, 49, 32,101,110,100, 10, 32, 32, 32, 32,105,102, 32,115,116,114,105, +110,103, 46,102,105,110,100, 40,101,120,116, 44, 32, 34, 65, 85, 84, 72, 91, 94, + 92,110, 93, 43, 76, 79, 71, 73, 78, 34, 41, 32,116,104,101,110, 10, 32, 32, 32, + 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 58,108,111,103, +105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100, 41, 10, 32, + 32, 32, 32,101,108,115,101,105,102, 32,115,116,114,105,110,103, 46,102,105,110, +100, 40,101,120,116, 44, 32, 34, 65, 85, 84, 72, 91, 94, 92,110, 93, 43, 80, 76, + 65, 73, 78, 34, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114, +101,116,117,114,110, 32,115,101,108,102, 58,112,108, 97,105,110, 40,117,115,101, +114, 44, 32,112, 97,115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,101,108,115, +101, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,110, +105,108, 44, 32, 34, 97,117,116,104,101,110,116,105, 99, 97,116,105,111,110, 32, +110,111,116, 32,115,117,112,112,111,114,116,101,100, 34, 41, 10, 32, 32, 32, 32, +101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,115,101,110,100, 32,109,101,115, +115, 97,103,101, 32,111,114, 32,116,104,114,111,119, 32, 97,110, 32,101,120, 99, +101,112,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97, +116, 46, 95, 95,105,110,100,101,120, 58,115,101,110,100, 40,109, 97,105,108,116, + 41, 10, 32, 32, 32, 32,115,101,108,102, 58,109, 97,105,108, 40,109, 97,105,108, +116, 46,102,114,111,109, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46, +116,121,112,101, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 32, 61, 61, 32, + 34,116, 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, + 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46,105,112, 97, +105,114,115, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 32,100,111, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 58,114, 99,112,116, + 40,118, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, +101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 58,114, 99, +112,116, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 10, 32, 32, 32, 32,101, +110,100, 10, 32, 32, 32, 32,115,101,108,102, 58,100, 97,116, 97, 40,108,116,110, + 49, 50, 46,115,111,117,114, 99,101, 46, 99,104, 97,105,110, 40,109, 97,105,108, +116, 46,115,111,117,114, 99,101, 44, 32,109,105,109,101, 46,115,116,117,102,102, + 40, 41, 41, 44, 32,109, 97,105,108,116, 46,115,116,101,112, 41, 10,101,110,100, + 10, 10,102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,115,101,114,118, +101,114, 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32, + 32, 32,108,111, 99, 97,108, 32,116,112, 32, 61, 32,115,111, 99,107,101,116, 46, +116,114,121, 40,116,112, 46, 99,111,110,110,101, 99,116, 40,115,101,114,118,101, +114, 32,111,114, 32, 83, 69, 82, 86, 69, 82, 44, 32,112,111,114,116, 32,111,114, + 32, 80, 79, 82, 84, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 84, 73, 77, 69, 79, + 85, 84, 44, 32, 99,114,101, 97,116,101, 41, 41, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,115, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, + 97, 98,108,101, 40,123,116,112, 32, 61, 32,116,112,125, 44, 32,109,101,116, 97, +116, 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32, +116,112, 32,105,115, 32, 99,108,111,115,101,100, 32,105,102, 32,119,101, 32,103, +101,116, 32, 97,110, 32,101,120, 99,101,112,116,105,111,110, 10, 32, 32, 32, 32, +115, 46,116,114,121, 32, 61, 32,115,111, 99,107,101,116, 46,110,101,119,116,114, +121, 40,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, + 32,115, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10, + 32, 32, 32, 32,114,101,116,117,114,110, 32,115, 10,101,110,100, 10, 10, 45, 45, + 32, 99,111,110,118,101,114,116, 32,104,101, 97,100,101,114,115, 32,116,111, 32, +108,111,119,101,114, 99, 97,115,101, 10,108,111, 99, 97,108, 32,102,117,110, 99, +116,105,111,110, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,104, +101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,111, +119,101,114, 32, 61, 32,123,125, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, + 32,105,110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101, +114,115, 32,111,114, 32,108,111,119,101,114, 41, 32,100,111, 10, 32, 32, 32, 32, + 32, 32, 32, 32,108,111,119,101,114, 91,115,116,114,105,110,103, 46,108,111,119, +101,114, 40,105, 41, 93, 32, 61, 32,118, 10, 32, 32, 32, 32,101,110,100, 10, 32, + 32, 32, 32,114,101,116,117,114,110, 32,108,111,119,101,114, 10,101,110,100, 10, + 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, + 77,117,108,116,105,112, 97,114,116, 32,109,101,115,115, 97,103,101, 32,115,111, +117,114, 99,101, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,104,111,112,101, +102,117,108,108,121, 32,117,110,105,113,117,101, 32,109,105,109,101, 32, 98,111, +117,110,100, 97,114,121, 10,108,111, 99, 97,108, 32,115,101,113,110,111, 32, 61, + 32, 48, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,110,101, +119, 98,111,117,110,100, 97,114,121, 40, 41, 10, 32, 32, 32, 32,115,101,113,110, +111, 32, 61, 32,115,101,113,110,111, 32, 43, 32, 49, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 39, + 37,115, 37, 48, 53,100, 61, 61, 37, 48, 53,117, 39, 44, 32,111,115, 46,100, 97, +116,101, 40, 39, 37,100, 37,109, 37, 89, 37, 72, 37, 77, 37, 83, 39, 41, 44, 10, + 32, 32, 32, 32, 32, 32, 32, 32,109, 97,116,104, 46,114, 97,110,100,111,109, 40, + 48, 44, 32, 57, 57, 57, 57, 57, 41, 44, 32,115,101,113,110,111, 41, 10,101,110, +100, 10, 10, 45, 45, 32,115,101,110,100, 95,109,101,115,115, 97,103,101, 32,102, +111,114,119, 97,114,100, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 10,108, +111, 99, 97,108, 32,115,101,110,100, 95,109,101,115,115, 97,103,101, 10, 10, 45, + 45, 32,121,105,101,108,100, 32,116,104,101, 32,104,101, 97,100,101,114,115, 32, + 97,108,108, 32, 97,116, 32,111,110, 99,101, 44, 32,105,116, 39,115, 32,102, 97, +115,116,101,114, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, +115,101,110,100, 95,104,101, 97,100,101,114,115, 40,104,101, 97,100,101,114,115, + 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32, 61, 32, 34, 92,114, 92, +110, 34, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97, +115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101,114,115, 41, 32,100,111, + 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 32, 61, 32,105, 32, 46, 46, 32, 39, 58, + 32, 39, 32, 46, 46, 32,118, 32, 46, 46, 32, 34, 92,114, 92,110, 34, 32, 46, 46, + 32,104, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 99,111,114,111,117, +116,105,110,101, 46,121,105,101,108,100, 40,104, 41, 10,101,110,100, 10, 10, 45, + 45, 32,121,105,101,108,100, 32,109,117,108,116,105,112, 97,114,116, 32,109,101, +115,115, 97,103,101, 32, 98,111,100,121, 32,102,114,111,109, 32, 97, 32,109,117, +108,116,105,112, 97,114,116, 32,109,101,115,115, 97,103,101, 32,116, 97, 98,108, +101, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115,101,110, +100, 95,109,117,108,116,105,112, 97,114,116, 40,109,101,115,103,116, 41, 10, 32, + 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32,119,101, 32,104, + 97,118,101, 32,111,117,114, 32, 98,111,117,110,100, 97,114,121, 32, 97,110,100, + 32,115,101,110,100, 32,104,101, 97,100,101,114,115, 10, 32, 32, 32, 32,108,111, + 99, 97,108, 32, 98,100, 32, 61, 32,110,101,119, 98,111,117,110,100, 97,114,121, + 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115, + 32, 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,109,101,115, +103,116, 46,104,101, 97,100,101,114,115, 32,111,114, 32,123,125, 41, 10, 32, 32, + 32, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116, +121,112,101, 39, 93, 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110, +116,101,110,116, 45,116,121,112,101, 39, 93, 32,111,114, 32, 39,109,117,108,116, +105,112, 97,114,116, 47,109,105,120,101,100, 39, 10, 32, 32, 32, 32,104,101, 97, +100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39, 93, + 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45, +116,121,112,101, 39, 93, 32, 46, 46, 10, 32, 32, 32, 32, 32, 32, 32, 32, 39, 59, + 32, 98,111,117,110,100, 97,114,121, 61, 34, 39, 32, 46, 46, 32, 32, 98,100, 32, + 46, 46, 32, 39, 34, 39, 10, 32, 32, 32, 32,115,101,110,100, 95,104,101, 97,100, +101,114,115, 40,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 45, 45, 32, +115,101,110,100, 32,112,114,101, 97,109, 98,108,101, 10, 32, 32, 32, 32,105,102, + 32,109,101,115,103,116, 46, 98,111,100,121, 46,112,114,101, 97,109, 98,108,101, + 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116, +105,110,101, 46,121,105,101,108,100, 40,109,101,115,103,116, 46, 98,111,100,121, + 46,112,114,101, 97,109, 98,108,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99, +111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40, 34, 92,114, 92,110, + 34, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,115,101, +110,100, 32,101, 97, 99,104, 32,112, 97,114,116, 32,115,101,112, 97,114, 97,116, +101,100, 32, 98,121, 32, 97, 32, 98,111,117,110,100, 97,114,121, 10, 32, 32, 32, + 32,102,111,114, 32,105, 44, 32,109, 32,105,110, 32, 98, 97,115,101, 46,105,112, + 97,105,114,115, 40,109,101,115,103,116, 46, 98,111,100,121, 41, 32,100,111, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116,105,110,101, 46,121,105, +101,108,100, 40, 34, 92,114, 92,110, 45, 45, 34, 32, 46, 46, 32, 98,100, 32, 46, + 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101, +110,100, 95,109,101,115,115, 97,103,101, 40,109, 41, 10, 32, 32, 32, 32,101,110, +100, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,108, 97,115,116, 32, 98, +111,117,110,100, 97,114,121, 10, 32, 32, 32, 32, 99,111,114,111,117,116,105,110, +101, 46,121,105,101,108,100, 40, 34, 92,114, 92,110, 45, 45, 34, 32, 46, 46, 32, + 98,100, 32, 46, 46, 32, 34, 45, 45, 92,114, 92,110, 92,114, 92,110, 34, 41, 10, + 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,101,112,105,108,111,103,117,101, + 10, 32, 32, 32, 32,105,102, 32,109,101,115,103,116, 46, 98,111,100,121, 46,101, +112,105,108,111,103,117,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40,109,101,115, +103,116, 46, 98,111,100,121, 46,101,112,105,108,111,103,117,101, 41, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108, +100, 40, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32,101,110,100, 10,101,110, +100, 10, 10, 45, 45, 32,121,105,101,108,100, 32,109,101,115,115, 97,103,101, 32, + 98,111,100,121, 32,102,114,111,109, 32, 97, 32,115,111,117,114, 99,101, 10,108, +111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115,101,110,100, 95,115, +111,117,114, 99,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32, 45, 45, 32, +109, 97,107,101, 32,115,117,114,101, 32,119,101, 32,104, 97,118,101, 32, 97, 32, + 99,111,110,116,101,110,116, 45,116,121,112,101, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,104,101, 97,100,101,114,115, 32, 61, 32,108,111,119,101,114, 95,104, +101, 97,100,101,114,115, 40,109,101,115,103,116, 46,104,101, 97,100,101,114,115, + 32,111,114, 32,123,125, 41, 10, 32, 32, 32, 32,104,101, 97,100,101,114,115, 91, + 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39, 93, 32, 61, 32,104,101, + 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39, + 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32, 32, 32, 39,116,101,120,116, 47,112, +108, 97,105,110, 59, 32, 99,104, 97,114,115,101,116, 61, 34,105,115,111, 45, 56, + 56, 53, 57, 45, 49, 34, 39, 10, 32, 32, 32, 32,115,101,110,100, 95,104,101, 97, +100,101,114,115, 40,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 45, 45, + 32,115,101,110,100, 32, 98,111,100,121, 32,102,114,111,109, 32,115,111,117,114, + 99,101, 10, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, + 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, + 44, 32,101,114,114, 32, 61, 32,109,101,115,103,116, 46, 98,111,100,121, 40, 41, + 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, + 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40,110,105,108, + 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105, +102, 32, 99,104,117,110,107, 32,116,104,101,110, 32, 99,111,114,111,117,116,105, +110,101, 46,121,105,101,108,100, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32,101,108,115,101, 32, 98,114,101, 97,107, 32,101,110,100, 10, 32, + 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,121,105,101,108,100, + 32,109,101,115,115, 97,103,101, 32, 98,111,100,121, 32,102,114,111,109, 32, 97, + 32,115,116,114,105,110,103, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105, +111,110, 32,115,101,110,100, 95,115,116,114,105,110,103, 40,109,101,115,103,116, + 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32,119, +101, 32,104, 97,118,101, 32, 97, 32, 99,111,110,116,101,110,116, 45,116,121,112, +101, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115, 32, + 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,109,101,115,103, +116, 46,104,101, 97,100,101,114,115, 32,111,114, 32,123,125, 41, 10, 32, 32, 32, + 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121, +112,101, 39, 93, 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116, +101,110,116, 45,116,121,112,101, 39, 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 39,116,101,120,116, 47,112,108, 97,105,110, 59, 32, 99,104, 97,114,115, +101,116, 61, 34,105,115,111, 45, 56, 56, 53, 57, 45, 49, 34, 39, 10, 32, 32, 32, + 32,115,101,110,100, 95,104,101, 97,100,101,114,115, 40,104,101, 97,100,101,114, +115, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32, 98,111,100,121, 32, +102,114,111,109, 32,115,116,114,105,110,103, 10, 32, 32, 32, 32, 99,111,114,111, +117,116,105,110,101, 46,121,105,101,108,100, 40,109,101,115,103,116, 46, 98,111, +100,121, 41, 10,101,110,100, 10, 10, 45, 45, 32,109,101,115,115, 97,103,101, 32, +115,111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110, 32,115,101,110,100, + 95,109,101,115,115, 97,103,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32, +105,102, 32, 98, 97,115,101, 46,116,121,112,101, 40,109,101,115,103,116, 46, 98, +111,100,121, 41, 32, 61, 61, 32, 34,116, 97, 98,108,101, 34, 32,116,104,101,110, + 32,115,101,110,100, 95,109,117,108,116,105,112, 97,114,116, 40,109,101,115,103, +116, 41, 10, 32, 32, 32, 32,101,108,115,101,105,102, 32, 98, 97,115,101, 46,116, +121,112,101, 40,109,101,115,103,116, 46, 98,111,100,121, 41, 32, 61, 61, 32, 34, +102,117,110, 99,116,105,111,110, 34, 32,116,104,101,110, 32,115,101,110,100, 95, +115,111,117,114, 99,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,101,108, +115,101, 32,115,101,110,100, 95,115,116,114,105,110,103, 40,109,101,115,103,116, + 41, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,115,101,116, 32,100,101, +102, 97,117,108, 32,104,101, 97,100,101,114,115, 10,108,111, 99, 97,108, 32,102, +117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116, 95,104,101, 97,100,101, +114,115, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, +108,111,119,101,114, 32, 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114, +115, 40,109,101,115,103,116, 46,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, + 32,108,111,119,101,114, 91, 34,100, 97,116,101, 34, 93, 32, 61, 32,108,111,119, +101,114, 91, 34,100, 97,116,101, 34, 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32, + 32, 32,111,115, 46,100, 97,116,101, 40, 34, 33, 37, 97, 44, 32, 37,100, 32, 37, + 98, 32, 37, 89, 32, 37, 72, 58, 37, 77, 58, 37, 83, 32, 34, 41, 32, 46, 46, 32, + 40,109,101,115,103,116, 46,122,111,110,101, 32,111,114, 32, 90, 79, 78, 69, 41, + 10, 32, 32, 32, 32,108,111,119,101,114, 91, 34,120, 45,109, 97,105,108,101,114, + 34, 93, 32, 61, 32,108,111,119,101,114, 91, 34,120, 45,109, 97,105,108,101,114, + 34, 93, 32,111,114, 32,115,111, 99,107,101,116, 46, 95, 86, 69, 82, 83, 73, 79, + 78, 10, 32, 32, 32, 32, 45, 45, 32,116,104,105,115, 32, 99, 97,110, 39,116, 32, + 98,101, 32,111,118,101,114,114,105,100,101,110, 10, 32, 32, 32, 32,108,111,119, +101,114, 91, 34,109,105,109,101, 45,118,101,114,115,105,111,110, 34, 93, 32, 61, + 32, 34, 49, 46, 48, 34, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,111, +119,101,114, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101, +115,115, 97,103,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,109,101,115, +103,116, 46,104,101, 97,100,101,114,115, 32, 61, 32, 97,100,106,117,115,116, 95, +104,101, 97,100,101,114,115, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32, 45, + 45, 32, 99,114,101, 97,116,101, 32, 97,110,100, 32,114,101,116,117,114,110, 32, +109,101,115,115, 97,103,101, 32,115,111,117,114, 99,101, 10, 32, 32, 32, 32,108, +111, 99, 97,108, 32, 99,111, 32, 61, 32, 99,111,114,111,117,116,105,110,101, 46, + 99,114,101, 97,116,101, 40,102,117,110, 99,116,105,111,110, 40, 41, 32,115,101, +110,100, 95,109,101,115,115, 97,103,101, 40,109,101,115,103,116, 41, 32,101,110, +100, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105, +111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114, +101,116, 44, 32, 97, 44, 32, 98, 32, 61, 32, 99,111,114,111,117,116,105,110,101, + 46,114,101,115,117,109,101, 40, 99,111, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, +105,102, 32,114,101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 97, + 44, 32, 98, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116, +117,114,110, 32,110,105,108, 44, 32, 97, 32,101,110,100, 10, 32, 32, 32, 32,101, +110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 10, 45, 45, 32, 72,105,103,104, 32,108,101,118,101,108, 32, 83, 77, + 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 10,115,101,110,100, 32, 61, 32,115,111, 99,107,101,116, 46,112, +114,111,116,101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,109, 97,105,108, +116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115, 32, 61, 32,111,112,101, +110, 40,109, 97,105,108,116, 46,115,101,114,118,101,114, 44, 32,109, 97,105,108, +116, 46,112,111,114,116, 44, 32,109, 97,105,108,116, 46, 99,114,101, 97,116,101, + 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,101,120,116, 32, 61, 32,115, 58, +103,114,101,101,116, 40,109, 97,105,108,116, 46,100,111,109, 97,105,110, 41, 10, + 32, 32, 32, 32,115, 58, 97,117,116,104, 40,109, 97,105,108,116, 46,117,115,101, +114, 44, 32,109, 97,105,108,116, 46,112, 97,115,115,119,111,114,100, 44, 32,101, +120,116, 41, 10, 32, 32, 32, 32,115, 58,115,101,110,100, 40,109, 97,105,108,116, + 41, 10, 32, 32, 32, 32,115, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,114, +101,116,117,114,110, 32,115, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 41, + 10, +}; + + if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"smtp.lua")==0) lua_call(L, 0, 0); +} diff --git a/src/libraries/luasocket/libluasocket/socket.lua.h b/src/libraries/luasocket/libluasocket/socket.lua.h index 32a38b6db..6dcaad05c 100644 --- a/src/libraries/luasocket/libluasocket/socket.lua.h +++ b/src/libraries/luasocket/libluasocket/socket.lua.h @@ -1,215 +1,215 @@ -/* code automatically generated by bin2c -- DO NOT EDIT */ -{ -/* #include'ing this file in a C program is equivalent to calling - if (luaL_loadfile(L,"socket.lua")==0) lua_call(L, 0, 0); -*/ -/* socket.lua */ -static const unsigned char B1[]={ - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 76,117, 97, 83,111, 99,107,101,116, 32,104,101,108,112,101,114, 32,109,111, -100,117,108,101, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101,103, -111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, - 73,100, 58, 32,115,111, 99,107,101,116, 46,108,117, 97, 44,118, 32, 49, 46, 50, - 50, 32, 50, 48, 48, 53, 47, 49, 49, 47, 50, 50, 32, 48, 56, 58, 51, 51, 58, 50, - 57, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114, -101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, 32, -100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97,115, -101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, - 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10, -108,111, 99, 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101, - 40, 34,109, 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99,107,101, -116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 46, - 99,111,114,101, 34, 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101, -116, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 10, 45, 45, 32, 69,120,112,111,114,116,101,100, 32, 97,117,120,105,108, -105, 97,114, 32,102,117,110, 99,116,105,111,110,115, 10, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110, - 32, 99,111,110,110,101, 99,116, 40, 97,100,100,114,101,115,115, 44, 32,112,111, -114,116, 44, 32,108, 97,100,100,114,101,115,115, 44, 32,108,112,111,114,116, 41, - 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,111, 99,107, 44, 32,101,114,114, - 32, 61, 32,115,111, 99,107,101,116, 46,116, 99,112, 40, 41, 10, 32, 32, 32, 32, -105,102, 32,110,111,116, 32,115,111, 99,107, 32,116,104,101,110, 32,114,101,116, -117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, - 32,105,102, 32,108, 97,100,100,114,101,115,115, 32,116,104,101,110, 10, 32, 32, - 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44, 32,101,114,114, - 32, 61, 32,115,111, 99,107, 58, 98,105,110,100, 40,108, 97,100,100,114,101,115, -115, 44, 32,108,112,111,114,116, 44, 32, 45, 49, 41, 10, 32, 32, 32, 32, 32, 32, - 32, 32,105,102, 32,110,111,116, 32,114,101,115, 32,116,104,101,110, 32,114,101, -116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, - 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44, - 32,101,114,114, 32, 61, 32,115,111, 99,107, 58, 99,111,110,110,101, 99,116, 40, - 97,100,100,114,101,115,115, 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105, -102, 32,110,111,116, 32,114,101,115, 32,116,104,101,110, 32,114,101,116,117,114, -110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32,114, -101,116,117,114,110, 32,115,111, 99,107, 10,101,110,100, 10, 10,102,117,110, 99, -116,105,111,110, 32, 98,105,110,100, 40,104,111,115,116, 44, 32,112,111,114,116, - 44, 32, 98, 97, 99,107,108,111,103, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, - 32,115,111, 99,107, 44, 32,101,114,114, 32, 61, 32,115,111, 99,107,101,116, 46, -116, 99,112, 40, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,111, 99, -107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101, -114,114, 32,101,110,100, 10, 32, 32, 32, 32,115,111, 99,107, 58,115,101,116,111, -112,116,105,111,110, 40, 34,114,101,117,115,101, 97,100,100,114, 34, 44, 32,116, -114,117,101, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44, 32, -101,114,114, 32, 61, 32,115,111, 99,107, 58, 98,105,110,100, 40,104,111,115,116, - 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114, -101,115, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, -101,114,114, 32,101,110,100, 10, 32, 32, 32, 32,114,101,115, 44, 32,101,114,114, - 32, 61, 32,115,111, 99,107, 58,108,105,115,116,101,110, 40, 98, 97, 99,107,108, -111,103, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,115, 32,116, -104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32, -101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,111, 99,107, 10, -101,110,100, 10, 10,116,114,121, 32, 61, 32,110,101,119,116,114,121, 40, 41, 10, - 10,102,117,110, 99,116,105,111,110, 32, 99,104,111,111,115,101, 40,116, 97, 98, -108,101, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116, -105,111,110, 40,110, 97,109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50, - 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121, -112,101, 40,110, 97,109,101, 41, 32,126, 61, 32, 34,115,116,114,105,110,103, 34, - 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,110, 97, -109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50, 32, 61, 32, 34,100,101, -102, 97,117,108,116, 34, 44, 32,110, 97,109,101, 44, 32,111,112,116, 49, 10, 32, - 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,108, -111, 99, 97,108, 32,102, 32, 61, 32,116, 97, 98,108,101, 91,110, 97,109,101, 32, -111,114, 32, 34,110,105,108, 34, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, - 32,110,111,116, 32,102, 32,116,104,101,110, 32, 98, 97,115,101, 46,101,114,114, -111,114, 40, 34,117,110,107,110,111,119,110, 32,107,101,121, 32, 40, 34, 46, 46, - 32, 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110, 97,109,101, 41, - 32, 46, 46, 34, 41, 34, 44, 32, 51, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101, -108,115,101, 32,114,101,116,117,114,110, 32,102, 40,111,112,116, 49, 44, 32,111, -112,116, 50, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, - 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, - 45, 45, 32, 83,111, 99,107,101,116, 32,115,111,117,114, 99,101,115, 32, 97,110, -100, 32,115,105,110,107,115, 44, 32, 99,111,110,102,111,114,109,105,110,103, 32, -116,111, 32, 76, 84, 78, 49, 50, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,114,101, 97,116,101, 32,110, 97,109, -101,115,112, 97, 99,101,115, 32,105,110,115,105,100,101, 32, 76,117, 97, 83,111, - 99,107,101,116, 32,110, 97,109,101,115,112, 97, 99,101, 10,115,111,117,114, 99, -101,116, 32, 61, 32,123,125, 10,115,105,110,107,116, 32, 61, 32,123,125, 10, 10, - 66, 76, 79, 67, 75, 83, 73, 90, 69, 32, 61, 32, 50, 48, 52, 56, 10, 10,115,105, -110,107,116, 91, 34, 99,108,111,115,101, 45,119,104,101,110, 45,100,111,110,101, - 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10, - 32, 32, 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109, -101,116, 97,116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103, -101,116,102,100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101, -116,117,114,110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110, -100, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102, -117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99, -107, 58,100,105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, - 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32, -102,117,110, 99,116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107, - 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105, -102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 10, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,111, 99,107, 58, 99,108, -111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58, -115,101,110,100, 40, 99,104,117,110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32, - 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110,100, 10, 10, -115,105,110,107,116, 91, 34,107,101,101,112, 45,111,112,101,110, 34, 93, 32, 61, - 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10, 32, 32, 32, 32, -114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, - 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100, - 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, - 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32, - 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116, -105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105, -114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99, -116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107, 44, 32,101,114, -114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104, -117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,115,111, 99,107, - 58,115,101,110,100, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 49, 32,101, -110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125, - 41, 10,101,110,100, 10, 10,115,105,110,107,116, 91, 34,100,101,102, 97,117,108, -116, 34, 93, 32, 61, 32,115,105,110,107,116, 91, 34,107,101,101,112, 45,111,112, -101,110, 34, 93, 10, 10,115,105,110,107, 32, 61, 32, 99,104,111,111,115,101, 40, -115,105,110,107,116, 41, 10, 10,115,111,117,114, 99,101,116, 91, 34, 98,121, 45, -108,101,110,103,116,104, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, -115,111, 99,107, 44, 32,108,101,110,103,116,104, 41, 10, 32, 32, 32, 32,114,101, -116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, 97, 98, -108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100, 32, 61, - 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115, -111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32, 32, 32, - 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116,105,111, -110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105,114,116, -121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32, 32, 32, - 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99,116,105, -111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, -108,101,110,103,116,104, 32, 60, 61, 32, 48, 32,116,104,101,110, 32,114,101,116, -117,114,110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32,108,111, 99, 97,108, 32,115,105,122,101, 32, 61, 32,109, 97,116, -104, 46,109,105,110, 40,115,111, 99,107,101,116, 46, 66, 76, 79, 67, 75, 83, 73, - 90, 69, 44, 32,108,101,110,103,116,104, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,101,114,114, - 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40,115,105,122,101, - 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, - 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114, -114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,101, -110,103,116,104, 32, 61, 32,108,101,110,103,116,104, 32, 45, 32,115,116,114,105, -110,103, 46,108,101,110, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, - 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110, -100, 10, 10,115,111,117,114, 99,101,116, 91, 34,117,110,116,105,108, 45, 99,108, -111,115,101,100, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115,111, - 99,107, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,100,111,110,101, 10, 32, - 32, 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101, -116, 97,116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101, -116,102,100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116, -117,114,110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, - 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117, -110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, - 58,100,105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32, -123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102, -117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,105,102, 32,100,111,110,101, 32,116,104,101,110, 32,114,101,116,117,114, -110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,101,114,114, 44, 32, -112, 97,114,116,105, 97,108, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105, -118,101, 40,115,111, 99,107,101,116, 46, 66, 76, 79, 67, 75, 83, 73, 90, 69, 41, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, -101,114,114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110, -107, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105,102, - 32,101,114,114, 32, 61, 61, 32, 34, 99,108,111,115,101,100, 34, 32,116,104,101, -110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,111, - 99,107, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,100,111,110,101, 32, 61, 32, 49, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,112, - 97,114,116,105, 97,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101, -108,115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32, -101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, -125, 41, 10,101,110,100, 10, 10, 10,115,111,117,114, 99,101,116, 91, 34,100,101, -102, 97,117,108,116, 34, 93, 32, 61, 32,115,111,117,114, 99,101,116, 91, 34,117, -110,116,105,108, 45, 99,108,111,115,101,100, 34, 93, 10, 10,115,111,117,114, 99, -101, 32, 61, 32, 99,104,111,111,115,101, 40,115,111,117,114, 99,101,116, 41, 10, - 10, -}; - - if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"socket.lua")==0) lua_call(L, 0, 0); -} +/* code automatically generated by bin2c -- DO NOT EDIT */ +{ +/* #include'ing this file in a C program is equivalent to calling + if (luaL_loadfile(L,"socket.lua")==0) lua_call(L, 0, 0); +*/ +/* socket.lua */ +static const unsigned char B1[]={ + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 76,117, 97, 83,111, 99,107,101,116, 32,104,101,108,112,101,114, 32,109,111, +100,117,108,101, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101,103, +111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, + 73,100, 58, 32,115,111, 99,107,101,116, 46,108,117, 97, 44,118, 32, 49, 46, 50, + 50, 32, 50, 48, 48, 53, 47, 49, 49, 47, 50, 50, 32, 48, 56, 58, 51, 51, 58, 50, + 57, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114, +101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, 32, +100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97,115, +101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, + 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10, +108,111, 99, 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101, + 40, 34,109, 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99,107,101, +116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 46, + 99,111,114,101, 34, 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101, +116, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 10, 45, 45, 32, 69,120,112,111,114,116,101,100, 32, 97,117,120,105,108, +105, 97,114, 32,102,117,110, 99,116,105,111,110,115, 10, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110, + 32, 99,111,110,110,101, 99,116, 40, 97,100,100,114,101,115,115, 44, 32,112,111, +114,116, 44, 32,108, 97,100,100,114,101,115,115, 44, 32,108,112,111,114,116, 41, + 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,111, 99,107, 44, 32,101,114,114, + 32, 61, 32,115,111, 99,107,101,116, 46,116, 99,112, 40, 41, 10, 32, 32, 32, 32, +105,102, 32,110,111,116, 32,115,111, 99,107, 32,116,104,101,110, 32,114,101,116, +117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, + 32,105,102, 32,108, 97,100,100,114,101,115,115, 32,116,104,101,110, 10, 32, 32, + 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44, 32,101,114,114, + 32, 61, 32,115,111, 99,107, 58, 98,105,110,100, 40,108, 97,100,100,114,101,115, +115, 44, 32,108,112,111,114,116, 44, 32, 45, 49, 41, 10, 32, 32, 32, 32, 32, 32, + 32, 32,105,102, 32,110,111,116, 32,114,101,115, 32,116,104,101,110, 32,114,101, +116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, + 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44, + 32,101,114,114, 32, 61, 32,115,111, 99,107, 58, 99,111,110,110,101, 99,116, 40, + 97,100,100,114,101,115,115, 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105, +102, 32,110,111,116, 32,114,101,115, 32,116,104,101,110, 32,114,101,116,117,114, +110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32,114, +101,116,117,114,110, 32,115,111, 99,107, 10,101,110,100, 10, 10,102,117,110, 99, +116,105,111,110, 32, 98,105,110,100, 40,104,111,115,116, 44, 32,112,111,114,116, + 44, 32, 98, 97, 99,107,108,111,103, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, + 32,115,111, 99,107, 44, 32,101,114,114, 32, 61, 32,115,111, 99,107,101,116, 46, +116, 99,112, 40, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,111, 99, +107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101, +114,114, 32,101,110,100, 10, 32, 32, 32, 32,115,111, 99,107, 58,115,101,116,111, +112,116,105,111,110, 40, 34,114,101,117,115,101, 97,100,100,114, 34, 44, 32,116, +114,117,101, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44, 32, +101,114,114, 32, 61, 32,115,111, 99,107, 58, 98,105,110,100, 40,104,111,115,116, + 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114, +101,115, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, +101,114,114, 32,101,110,100, 10, 32, 32, 32, 32,114,101,115, 44, 32,101,114,114, + 32, 61, 32,115,111, 99,107, 58,108,105,115,116,101,110, 40, 98, 97, 99,107,108, +111,103, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,115, 32,116, +104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32, +101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,111, 99,107, 10, +101,110,100, 10, 10,116,114,121, 32, 61, 32,110,101,119,116,114,121, 40, 41, 10, + 10,102,117,110, 99,116,105,111,110, 32, 99,104,111,111,115,101, 40,116, 97, 98, +108,101, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116, +105,111,110, 40,110, 97,109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50, + 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121, +112,101, 40,110, 97,109,101, 41, 32,126, 61, 32, 34,115,116,114,105,110,103, 34, + 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,110, 97, +109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50, 32, 61, 32, 34,100,101, +102, 97,117,108,116, 34, 44, 32,110, 97,109,101, 44, 32,111,112,116, 49, 10, 32, + 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,108, +111, 99, 97,108, 32,102, 32, 61, 32,116, 97, 98,108,101, 91,110, 97,109,101, 32, +111,114, 32, 34,110,105,108, 34, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, + 32,110,111,116, 32,102, 32,116,104,101,110, 32, 98, 97,115,101, 46,101,114,114, +111,114, 40, 34,117,110,107,110,111,119,110, 32,107,101,121, 32, 40, 34, 46, 46, + 32, 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110, 97,109,101, 41, + 32, 46, 46, 34, 41, 34, 44, 32, 51, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101, +108,115,101, 32,114,101,116,117,114,110, 32,102, 40,111,112,116, 49, 44, 32,111, +112,116, 50, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, + 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, + 45, 45, 32, 83,111, 99,107,101,116, 32,115,111,117,114, 99,101,115, 32, 97,110, +100, 32,115,105,110,107,115, 44, 32, 99,111,110,102,111,114,109,105,110,103, 32, +116,111, 32, 76, 84, 78, 49, 50, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,114,101, 97,116,101, 32,110, 97,109, +101,115,112, 97, 99,101,115, 32,105,110,115,105,100,101, 32, 76,117, 97, 83,111, + 99,107,101,116, 32,110, 97,109,101,115,112, 97, 99,101, 10,115,111,117,114, 99, +101,116, 32, 61, 32,123,125, 10,115,105,110,107,116, 32, 61, 32,123,125, 10, 10, + 66, 76, 79, 67, 75, 83, 73, 90, 69, 32, 61, 32, 50, 48, 52, 56, 10, 10,115,105, +110,107,116, 91, 34, 99,108,111,115,101, 45,119,104,101,110, 45,100,111,110,101, + 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10, + 32, 32, 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109, +101,116, 97,116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103, +101,116,102,100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101, +116,117,114,110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110, +100, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102, +117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99, +107, 58,100,105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, + 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32, +102,117,110, 99,116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107, + 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105, +102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 10, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,111, 99,107, 58, 99,108, +111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58, +115,101,110,100, 40, 99,104,117,110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32, + 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110,100, 10, 10, +115,105,110,107,116, 91, 34,107,101,101,112, 45,111,112,101,110, 34, 93, 32, 61, + 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10, 32, 32, 32, 32, +114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, + 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100, + 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, + 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32, + 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116, +105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105, +114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32, + 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99, +116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107, 44, 32,101,114, +114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104, +117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,115,111, 99,107, + 58,115,101,110,100, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 49, 32,101, +110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125, + 41, 10,101,110,100, 10, 10,115,105,110,107,116, 91, 34,100,101,102, 97,117,108, +116, 34, 93, 32, 61, 32,115,105,110,107,116, 91, 34,107,101,101,112, 45,111,112, +101,110, 34, 93, 10, 10,115,105,110,107, 32, 61, 32, 99,104,111,111,115,101, 40, +115,105,110,107,116, 41, 10, 10,115,111,117,114, 99,101,116, 91, 34, 98,121, 45, +108,101,110,103,116,104, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, +115,111, 99,107, 44, 32,108,101,110,103,116,104, 41, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, 97, 98, +108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100, 32, 61, + 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115, +111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32, 32, 32, + 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116,105,111, +110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105,114,116, +121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32, 32, 32, + 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99,116,105, +111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, +108,101,110,103,116,104, 32, 60, 61, 32, 48, 32,116,104,101,110, 32,114,101,116, +117,114,110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32,108,111, 99, 97,108, 32,115,105,122,101, 32, 61, 32,109, 97,116, +104, 46,109,105,110, 40,115,111, 99,107,101,116, 46, 66, 76, 79, 67, 75, 83, 73, + 90, 69, 44, 32,108,101,110,103,116,104, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,101,114,114, + 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40,115,105,122,101, + 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, + 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114, +114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,101, +110,103,116,104, 32, 61, 32,108,101,110,103,116,104, 32, 45, 32,115,116,114,105, +110,103, 46,108,101,110, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, + 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110, +100, 10, 10,115,111,117,114, 99,101,116, 91, 34,117,110,116,105,108, 45, 99,108, +111,115,101,100, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115,111, + 99,107, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,100,111,110,101, 10, 32, + 32, 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101, +116, 97,116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101, +116,102,100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116, +117,114,110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, + 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117, +110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, + 58,100,105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32, +123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102, +117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,105,102, 32,100,111,110,101, 32,116,104,101,110, 32,114,101,116,117,114, +110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,101,114,114, 44, 32, +112, 97,114,116,105, 97,108, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105, +118,101, 40,115,111, 99,107,101,116, 46, 66, 76, 79, 67, 75, 83, 73, 90, 69, 41, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, +101,114,114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110, +107, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105,102, + 32,101,114,114, 32, 61, 61, 32, 34, 99,108,111,115,101,100, 34, 32,116,104,101, +110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,111, + 99,107, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,100,111,110,101, 32, 61, 32, 49, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,112, + 97,114,116,105, 97,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101, +108,115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32, +101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, +125, 41, 10,101,110,100, 10, 10, 10,115,111,117,114, 99,101,116, 91, 34,100,101, +102, 97,117,108,116, 34, 93, 32, 61, 32,115,111,117,114, 99,101,116, 91, 34,117, +110,116,105,108, 45, 99,108,111,115,101,100, 34, 93, 10, 10,115,111,117,114, 99, +101, 32, 61, 32, 99,104,111,111,115,101, 40,115,111,117,114, 99,101,116, 41, 10, + 10, +}; + + if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"socket.lua")==0) lua_call(L, 0, 0); +} diff --git a/src/libraries/luasocket/libluasocket/tp.lua.h b/src/libraries/luasocket/libluasocket/tp.lua.h index 787fd09f0..efec651ae 100644 --- a/src/libraries/luasocket/libluasocket/tp.lua.h +++ b/src/libraries/luasocket/libluasocket/tp.lua.h @@ -1,192 +1,192 @@ -/* code automatically generated by bin2c -- DO NOT EDIT */ -{ -/* #include'ing this file in a C program is equivalent to calling - if (luaL_loadfile(L,"tp.lua")==0) lua_call(L, 0, 0); -*/ -/* tp.lua */ -static const unsigned char B1[]={ - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 85,110,105,102,105,101,100, 32, 83, 77, 84, 80, 47, 70, 84, 80, 32,115,117, - 98,115,121,115,116,101,109, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, - 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, - 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, - 73, 68, 58, 32, 36, 73,100, 58, 32,116,112, 46,108,117, 97, 44,118, 32, 49, 46, - 50, 50, 32, 50, 48, 48, 54, 47, 48, 51, 47, 49, 52, 32, 48, 57, 58, 48, 52, 58, - 49, 53, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97, -114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, - 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97, -115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, - 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, - 10,108,111, 99, 97,108, 32,115,111, 99,107,101,116, 32, 61, 32,114,101,113,117, -105,114,101, 40, 34,115,111, 99,107,101,116, 34, 41, 10,108,111, 99, 97,108, 32, -108,116,110, 49, 50, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,108,116,110, - 49, 50, 34, 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101,116, 46, -116,112, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 10, 45, 45, 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, - 97,110,116,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 10, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 73,109, -112,108,101,109,101,110,116, 97,116,105,111,110, 10, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,103,101,116,115, 32,115, -101,114,118,101,114, 32,114,101,112,108,121, 32, 40,119,111,114,107,115, 32,102, -111,114, 32, 83, 77, 84, 80, 32, 97,110,100, 32, 70, 84, 80, 41, 10,108,111, 99, - 97,108, 32,102,117,110, 99,116,105,111,110, 32,103,101,116, 95,114,101,112,108, -121, 40, 99, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, - 32, 99,117,114,114,101,110,116, 44, 32,115,101,112, 10, 32, 32, 32, 32,108,111, - 99, 97,108, 32,108,105,110,101, 44, 32,101,114,114, 32, 61, 32, 99, 58,114,101, - 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101, -112,108,121, 32, 61, 32,108,105,110,101, 10, 32, 32, 32, 32,105,102, 32,101,114, -114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101, -114,114, 32,101,110,100, 10, 32, 32, 32, 32, 99,111,100,101, 44, 32,115,101,112, - 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32,115,116, -114,105,110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, 40, 37, -100, 37,100, 37,100, 41, 40, 46, 63, 41, 34, 41, 41, 10, 32, 32, 32, 32,105,102, - 32,110,111,116, 32, 99,111,100,101, 32,116,104,101,110, 32,114,101,116,117,114, -110, 32,110,105,108, 44, 32, 34,105,110,118, 97,108,105,100, 32,115,101,114,118, -101,114, 32,114,101,112,108,121, 34, 32,101,110,100, 10, 32, 32, 32, 32,105,102, - 32,115,101,112, 32, 61, 61, 32, 34, 45, 34, 32,116,104,101,110, 32, 45, 45, 32, -114,101,112,108,121, 32,105,115, 32,109,117,108,116,105,108,105,110,101, 10, 32, - 32, 32, 32, 32, 32, 32, 32,114,101,112,101, 97,116, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32,108,105,110,101, 44, 32,101,114,114, 32, 61, 32, 99, 58, -114,101, 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116,117,114,110, - 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 99,117,114,114,101,110,116, 44, 32,115,101,112, 32, 61, - 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32,115,116,114,105, -110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, 40, 37,100, 37, -100, 37,100, 41, 40, 46, 63, 41, 34, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32,114,101,112,108,121, 32, 61, 32,114,101,112,108,121, 32, 46, 46, - 32, 34, 92,110, 34, 32, 46, 46, 32,108,105,110,101, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 45, 45, 32,114,101,112,108,121, 32,101,110,100,115, 32,119,105,116,104, - 32,115, 97,109,101, 32, 99,111,100,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,117, -110,116,105,108, 32, 99,111,100,101, 32, 61, 61, 32, 99,117,114,114,101,110,116, - 32, 97,110,100, 32,115,101,112, 32, 61, 61, 32, 34, 32, 34, 10, 32, 32, 32, 32, -101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,111,100,101, 44, - 32,114,101,112,108,121, 10,101,110,100, 10, 10, 45, 45, 32,109,101,116, 97,116, - 97, 98,108,101, 32,102,111,114, 32,115,111, 99,107, 32,111, 98,106,101, 99,116, - 10,108,111, 99, 97,108, 32,109,101,116, 97,116, 32, 61, 32,123, 32, 95, 95,105, -110,100,101,120, 32, 61, 32,123,125, 32,125, 10, 10,102,117,110, 99,116,105,111, -110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,104,101, 99, -107, 40,111,107, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, - 44, 32,114,101,112,108,121, 32, 61, 32,103,101,116, 95,114,101,112,108,121, 40, -115,101,108,102, 46, 99, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99, -111,100,101, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, - 32,114,101,112,108,121, 32,101,110,100, 10, 32, 32, 32, 32,105,102, 32, 98, 97, -115,101, 46,116,121,112,101, 40,111,107, 41, 32,126, 61, 32, 34,102,117,110, 99, -116,105,111,110, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105, -102, 32, 98, 97,115,101, 46,116,121,112,101, 40,111,107, 41, 32, 61, 61, 32, 34, -116, 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32,102,111,114, 32,105, 44, 32,118, 32,105,110, 32, 98, 97,115,101, - 46,105,112, 97,105,114,115, 40,111,107, 41, 32,100,111, 10, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,116,114,105,110,103, - 46,102,105,110,100, 40, 99,111,100,101, 44, 32,118, 41, 32,116,104,101,110, 10, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -114,101,116,117,114,110, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, - 40, 99,111,100,101, 41, 44, 32,114,101,112,108,121, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,114,101,112,108,121, 10, - 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, - 99,111,100,101, 44, 32,111,107, 41, 32,116,104,101,110, 32,114,101,116,117,114, -110, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, 40, 99,111,100,101, - 41, 44, 32,114,101,112,108,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32,101,108,115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,114,101, -112,108,121, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, - 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,111,107, 40, 98, - 97,115,101, 46,116,111,110,117,109, 98,101,114, 40, 99,111,100,101, 41, 44, 32, -114,101,112,108,121, 41, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99, -116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99, -111,109,109, 97,110,100, 40, 99,109,100, 44, 32, 97,114,103, 41, 10, 32, 32, 32, - 32,105,102, 32, 97,114,103, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, - 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58,115,101,110,100, 40, - 99,109,100, 32, 46, 46, 32, 34, 32, 34, 32, 46, 46, 32, 97,114,103, 46, 46, 32, - 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, - 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58,115, -101,110,100, 40, 99,109,100, 32, 46, 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32, - 32, 32, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, - 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,115,105,110,107, 40, -115,110,107, 44, 32,112, 97,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, - 99,104,117,110,107, 44, 32,101,114,114, 32, 61, 32, 99, 58,114,101, 99,101,105, -118,101, 40,112, 97,116, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115, -110,107, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10,101,110,100, 10, 10, -102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100, -101,120, 58,115,101,110,100, 40,100, 97,116, 97, 41, 10, 32, 32, 32, 32,114,101, -116,117,114,110, 32,115,101,108,102, 46, 99, 58,115,101,110,100, 40,100, 97,116, - 97, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, - 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118,101, 40,112, - 97,116, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, - 99, 58,114,101, 99,101,105,118,101, 40,112, 97,116, 41, 10,101,110,100, 10, 10, -102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100, -101,120, 58,103,101,116,102,100, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114, -110, 32,115,101,108,102, 46, 99, 58,103,101,116,102,100, 40, 41, 10,101,110,100, - 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105, -110,100,101,120, 58,100,105,114,116,121, 40, 41, 10, 32, 32, 32, 32,114,101,116, -117,114,110, 32,115,101,108,102, 46, 99, 58,100,105,114,116,121, 40, 41, 10,101, -110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, - 95,105,110,100,101,120, 58,103,101,116, 99,111,110,116,114,111,108, 40, 41, 10, - 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 10,101,110, -100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95, -105,110,100,101,120, 58,115,111,117,114, 99,101, 40,115,111,117,114, 99,101, 44, - 32,115,116,101,112, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,105,110, -107, 32, 61, 32,115,111, 99,107,101,116, 46,115,105,110,107, 40, 34,107,101,101, -112, 45,111,112,101,110, 34, 44, 32,115,101,108,102, 46, 99, 41, 10, 32, 32, 32, - 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114, 32, 61, 32,108,116, -110, 49, 50, 46,112,117,109,112, 46, 97,108,108, 40,115,111,117,114, 99,101, 44, - 32,115,105,110,107, 44, 32,115,116,101,112, 32,111,114, 32,108,116,110, 49, 50, - 46,112,117,109,112, 46,115,116,101,112, 41, 10, 32, 32, 32, 32,114,101,116,117, -114,110, 32,114,101,116, 44, 32,101,114,114, 10,101,110,100, 10, 10, 45, 45, 32, - 99,108,111,115,101,115, 32,116,104,101, 32,117,110,100,101,114,108,121,105,110, -103, 32, 99, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, - 95,105,110,100,101,120, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,115, -101,108,102, 46, 99, 58, 99,108,111,115,101, 40, 41, 10, 9,114,101,116,117,114, -110, 32, 49, 10,101,110,100, 10, 10, 45, 45, 32, 99,111,110,110,101, 99,116, 32, -119,105,116,104, 32,115,101,114,118,101,114, 32, 97,110,100, 32,114,101,116,117, -114,110, 32, 99, 32,111, 98,106,101, 99,116, 10,102,117,110, 99,116,105,111,110, - 32, 99,111,110,110,101, 99,116, 40,104,111,115,116, 44, 32,112,111,114,116, 44, - 32,116,105,109,101,111,117,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32, - 32, 32,108,111, 99, 97,108, 32, 99, 44, 32,101, 32, 61, 32, 40, 99,114,101, 97, -116,101, 32,111,114, 32,115,111, 99,107,101,116, 46,116, 99,112, 41, 40, 41, 10, - 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99, 32,116,104,101,110, 32,114,101, -116,117,114,110, 32,110,105,108, 44, 32,101, 32,101,110,100, 10, 32, 32, 32, 32, - 99, 58,115,101,116,116,105,109,101,111,117,116, 40,116,105,109,101,111,117,116, - 32,111,114, 32, 84, 73, 77, 69, 79, 85, 84, 41, 10, 32, 32, 32, 32,108,111, 99, - 97,108, 32,114, 44, 32,101, 32, 61, 32, 99, 58, 99,111,110,110,101, 99,116, 40, -104,111,115,116, 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105,102, 32,110, -111,116, 32,114, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99, 58, - 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, -114,110, 32,110,105,108, 44, 32,101, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, - 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, - 97,116, 97, 98,108,101, 40,123, 99, 32, 61, 32, 99,125, 44, 32,109,101,116, 97, -116, 41, 10,101,110,100, 10, 10, -}; - - if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"tp.lua")==0) lua_call(L, 0, 0); -} +/* code automatically generated by bin2c -- DO NOT EDIT */ +{ +/* #include'ing this file in a C program is equivalent to calling + if (luaL_loadfile(L,"tp.lua")==0) lua_call(L, 0, 0); +*/ +/* tp.lua */ +static const unsigned char B1[]={ + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 85,110,105,102,105,101,100, 32, 83, 77, 84, 80, 47, 70, 84, 80, 32,115,117, + 98,115,121,115,116,101,109, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, + 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, + 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, + 73, 68, 58, 32, 36, 73,100, 58, 32,116,112, 46,108,117, 97, 44,118, 32, 49, 46, + 50, 50, 32, 50, 48, 48, 54, 47, 48, 51, 47, 49, 52, 32, 48, 57, 58, 48, 52, 58, + 49, 53, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97, +114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, + 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97, +115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, + 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, + 10,108,111, 99, 97,108, 32,115,111, 99,107,101,116, 32, 61, 32,114,101,113,117, +105,114,101, 40, 34,115,111, 99,107,101,116, 34, 41, 10,108,111, 99, 97,108, 32, +108,116,110, 49, 50, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,108,116,110, + 49, 50, 34, 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101,116, 46, +116,112, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 10, 45, 45, 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, + 97,110,116,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 10, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 73,109, +112,108,101,109,101,110,116, 97,116,105,111,110, 10, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,103,101,116,115, 32,115, +101,114,118,101,114, 32,114,101,112,108,121, 32, 40,119,111,114,107,115, 32,102, +111,114, 32, 83, 77, 84, 80, 32, 97,110,100, 32, 70, 84, 80, 41, 10,108,111, 99, + 97,108, 32,102,117,110, 99,116,105,111,110, 32,103,101,116, 95,114,101,112,108, +121, 40, 99, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, + 32, 99,117,114,114,101,110,116, 44, 32,115,101,112, 10, 32, 32, 32, 32,108,111, + 99, 97,108, 32,108,105,110,101, 44, 32,101,114,114, 32, 61, 32, 99, 58,114,101, + 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101, +112,108,121, 32, 61, 32,108,105,110,101, 10, 32, 32, 32, 32,105,102, 32,101,114, +114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101, +114,114, 32,101,110,100, 10, 32, 32, 32, 32, 99,111,100,101, 44, 32,115,101,112, + 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32,115,116, +114,105,110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, 40, 37, +100, 37,100, 37,100, 41, 40, 46, 63, 41, 34, 41, 41, 10, 32, 32, 32, 32,105,102, + 32,110,111,116, 32, 99,111,100,101, 32,116,104,101,110, 32,114,101,116,117,114, +110, 32,110,105,108, 44, 32, 34,105,110,118, 97,108,105,100, 32,115,101,114,118, +101,114, 32,114,101,112,108,121, 34, 32,101,110,100, 10, 32, 32, 32, 32,105,102, + 32,115,101,112, 32, 61, 61, 32, 34, 45, 34, 32,116,104,101,110, 32, 45, 45, 32, +114,101,112,108,121, 32,105,115, 32,109,117,108,116,105,108,105,110,101, 10, 32, + 32, 32, 32, 32, 32, 32, 32,114,101,112,101, 97,116, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32,108,105,110,101, 44, 32,101,114,114, 32, 61, 32, 99, 58, +114,101, 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116,117,114,110, + 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 99,117,114,114,101,110,116, 44, 32,115,101,112, 32, 61, + 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32,115,116,114,105, +110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, 40, 37,100, 37, +100, 37,100, 41, 40, 46, 63, 41, 34, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32,114,101,112,108,121, 32, 61, 32,114,101,112,108,121, 32, 46, 46, + 32, 34, 92,110, 34, 32, 46, 46, 32,108,105,110,101, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 45, 45, 32,114,101,112,108,121, 32,101,110,100,115, 32,119,105,116,104, + 32,115, 97,109,101, 32, 99,111,100,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,117, +110,116,105,108, 32, 99,111,100,101, 32, 61, 61, 32, 99,117,114,114,101,110,116, + 32, 97,110,100, 32,115,101,112, 32, 61, 61, 32, 34, 32, 34, 10, 32, 32, 32, 32, +101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,111,100,101, 44, + 32,114,101,112,108,121, 10,101,110,100, 10, 10, 45, 45, 32,109,101,116, 97,116, + 97, 98,108,101, 32,102,111,114, 32,115,111, 99,107, 32,111, 98,106,101, 99,116, + 10,108,111, 99, 97,108, 32,109,101,116, 97,116, 32, 61, 32,123, 32, 95, 95,105, +110,100,101,120, 32, 61, 32,123,125, 32,125, 10, 10,102,117,110, 99,116,105,111, +110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,104,101, 99, +107, 40,111,107, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, + 44, 32,114,101,112,108,121, 32, 61, 32,103,101,116, 95,114,101,112,108,121, 40, +115,101,108,102, 46, 99, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99, +111,100,101, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, + 32,114,101,112,108,121, 32,101,110,100, 10, 32, 32, 32, 32,105,102, 32, 98, 97, +115,101, 46,116,121,112,101, 40,111,107, 41, 32,126, 61, 32, 34,102,117,110, 99, +116,105,111,110, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105, +102, 32, 98, 97,115,101, 46,116,121,112,101, 40,111,107, 41, 32, 61, 61, 32, 34, +116, 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32,102,111,114, 32,105, 44, 32,118, 32,105,110, 32, 98, 97,115,101, + 46,105,112, 97,105,114,115, 40,111,107, 41, 32,100,111, 10, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,116,114,105,110,103, + 46,102,105,110,100, 40, 99,111,100,101, 44, 32,118, 41, 32,116,104,101,110, 10, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +114,101,116,117,114,110, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, + 40, 99,111,100,101, 41, 44, 32,114,101,112,108,121, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,114,101,112,108,121, 10, + 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, + 99,111,100,101, 44, 32,111,107, 41, 32,116,104,101,110, 32,114,101,116,117,114, +110, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, 40, 99,111,100,101, + 41, 44, 32,114,101,112,108,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32,101,108,115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,114,101, +112,108,121, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, + 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,111,107, 40, 98, + 97,115,101, 46,116,111,110,117,109, 98,101,114, 40, 99,111,100,101, 41, 44, 32, +114,101,112,108,121, 41, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99, +116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99, +111,109,109, 97,110,100, 40, 99,109,100, 44, 32, 97,114,103, 41, 10, 32, 32, 32, + 32,105,102, 32, 97,114,103, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, + 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58,115,101,110,100, 40, + 99,109,100, 32, 46, 46, 32, 34, 32, 34, 32, 46, 46, 32, 97,114,103, 46, 46, 32, + 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, + 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58,115, +101,110,100, 40, 99,109,100, 32, 46, 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32, + 32, 32, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, + 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,115,105,110,107, 40, +115,110,107, 44, 32,112, 97,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, + 99,104,117,110,107, 44, 32,101,114,114, 32, 61, 32, 99, 58,114,101, 99,101,105, +118,101, 40,112, 97,116, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115, +110,107, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10,101,110,100, 10, 10, +102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100, +101,120, 58,115,101,110,100, 40,100, 97,116, 97, 41, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32,115,101,108,102, 46, 99, 58,115,101,110,100, 40,100, 97,116, + 97, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, + 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118,101, 40,112, + 97,116, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, + 99, 58,114,101, 99,101,105,118,101, 40,112, 97,116, 41, 10,101,110,100, 10, 10, +102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100, +101,120, 58,103,101,116,102,100, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114, +110, 32,115,101,108,102, 46, 99, 58,103,101,116,102,100, 40, 41, 10,101,110,100, + 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105, +110,100,101,120, 58,100,105,114,116,121, 40, 41, 10, 32, 32, 32, 32,114,101,116, +117,114,110, 32,115,101,108,102, 46, 99, 58,100,105,114,116,121, 40, 41, 10,101, +110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, + 95,105,110,100,101,120, 58,103,101,116, 99,111,110,116,114,111,108, 40, 41, 10, + 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 10,101,110, +100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95, +105,110,100,101,120, 58,115,111,117,114, 99,101, 40,115,111,117,114, 99,101, 44, + 32,115,116,101,112, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,105,110, +107, 32, 61, 32,115,111, 99,107,101,116, 46,115,105,110,107, 40, 34,107,101,101, +112, 45,111,112,101,110, 34, 44, 32,115,101,108,102, 46, 99, 41, 10, 32, 32, 32, + 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114, 32, 61, 32,108,116, +110, 49, 50, 46,112,117,109,112, 46, 97,108,108, 40,115,111,117,114, 99,101, 44, + 32,115,105,110,107, 44, 32,115,116,101,112, 32,111,114, 32,108,116,110, 49, 50, + 46,112,117,109,112, 46,115,116,101,112, 41, 10, 32, 32, 32, 32,114,101,116,117, +114,110, 32,114,101,116, 44, 32,101,114,114, 10,101,110,100, 10, 10, 45, 45, 32, + 99,108,111,115,101,115, 32,116,104,101, 32,117,110,100,101,114,108,121,105,110, +103, 32, 99, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, + 95,105,110,100,101,120, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,115, +101,108,102, 46, 99, 58, 99,108,111,115,101, 40, 41, 10, 9,114,101,116,117,114, +110, 32, 49, 10,101,110,100, 10, 10, 45, 45, 32, 99,111,110,110,101, 99,116, 32, +119,105,116,104, 32,115,101,114,118,101,114, 32, 97,110,100, 32,114,101,116,117, +114,110, 32, 99, 32,111, 98,106,101, 99,116, 10,102,117,110, 99,116,105,111,110, + 32, 99,111,110,110,101, 99,116, 40,104,111,115,116, 44, 32,112,111,114,116, 44, + 32,116,105,109,101,111,117,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32, + 32, 32,108,111, 99, 97,108, 32, 99, 44, 32,101, 32, 61, 32, 40, 99,114,101, 97, +116,101, 32,111,114, 32,115,111, 99,107,101,116, 46,116, 99,112, 41, 40, 41, 10, + 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99, 32,116,104,101,110, 32,114,101, +116,117,114,110, 32,110,105,108, 44, 32,101, 32,101,110,100, 10, 32, 32, 32, 32, + 99, 58,115,101,116,116,105,109,101,111,117,116, 40,116,105,109,101,111,117,116, + 32,111,114, 32, 84, 73, 77, 69, 79, 85, 84, 41, 10, 32, 32, 32, 32,108,111, 99, + 97,108, 32,114, 44, 32,101, 32, 61, 32, 99, 58, 99,111,110,110,101, 99,116, 40, +104,111,115,116, 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105,102, 32,110, +111,116, 32,114, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99, 58, + 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, +114,110, 32,110,105,108, 44, 32,101, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, + 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, + 97,116, 97, 98,108,101, 40,123, 99, 32, 61, 32, 99,125, 44, 32,109,101,116, 97, +116, 41, 10,101,110,100, 10, 10, +}; + + if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"tp.lua")==0) lua_call(L, 0, 0); +} diff --git a/src/libraries/luasocket/libluasocket/url.lua.h b/src/libraries/luasocket/libluasocket/url.lua.h index 4d51690e1..59916b377 100644 --- a/src/libraries/luasocket/libluasocket/url.lua.h +++ b/src/libraries/luasocket/libluasocket/url.lua.h @@ -1,538 +1,538 @@ -/* code automatically generated by bin2c -- DO NOT EDIT */ -{ -/* #include'ing this file in a C program is equivalent to calling - if (luaL_loadfile(L,"url.lua")==0) lua_call(L, 0, 0); -*/ -/* url.lua */ -static const unsigned char B1[]={ - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, - 32, 85, 82, 73, 32,112, 97,114,115,105,110,103, 44, 32, 99,111,109,112,111,115, -105,116,105,111,110, 32, 97,110,100, 32,114,101,108, 97,116,105,118,101, 32, 85, - 82, 76, 32,114,101,115,111,108,117,116,105,111,110, 10, 45, 45, 32, 76,117, 97, - 83,111, 99,107,101,116, 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65, -117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, - 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, 73,100, 58, 32,117,114,108, 46,108, -117, 97, 44,118, 32, 49, 46, 51, 56, 32, 50, 48, 48, 54, 47, 48, 52, 47, 48, 51, - 32, 48, 52, 58, 52, 53, 58, 52, 50, 32,100,105,101,103,111, 32, 69,120,112, 32, - 36, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, - 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, - 45, 32, 68,101, 99,108, 97,114,101, 32,109,111,100,117,108,101, 10, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, - 32,115,116,114,105,110,103, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115, -116,114,105,110,103, 34, 41, 10,108,111, 99, 97,108, 32, 98, 97,115,101, 32, 61, - 32, 95, 71, 10,108,111, 99, 97,108, 32,116, 97, 98,108,101, 32, 61, 32,114,101, -113,117,105,114,101, 40, 34,116, 97, 98,108,101, 34, 41, 10,109,111,100,117,108, -101, 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34, 41, 10, 10, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 77,111, -100,117,108,101, 32,118,101,114,115,105,111,110, 10, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 95, 86, 69, 82, 83, 73, 79, 78, 32, - 61, 32, 34, 85, 82, 76, 32, 49, 46, 48, 46, 49, 34, 10, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 69,110, 99,111, -100,101,115, 32, 97, 32,115,116,114,105,110,103, 32,105,110,116,111, 32,105,116, -115, 32,101,115, 99, 97,112,101,100, 32,104,101,120, 97,100,101, 99,105,109, 97, -108, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110, 10, 45, 45, 32, - 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32, 98,105,110, 97,114,121, - 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32,101,110, 99,111,100,101, -100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, 32,101,115, - 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110, - 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110, 97,114,121, 10, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99, -116,105,111,110, 32,101,115, 99, 97,112,101, 40,115, 41, 10, 32, 32, 32, 32,114, -101,116,117,114,110, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, - 32, 34, 40, 91, 94, 65, 45, 90, 97, 45,122, 48, 45, 57, 95, 93, 41, 34, 44, 32, -102,117,110, 99,116,105,111,110, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, -114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116, - 40, 34, 37, 37, 37, 48, 50,120, 34, 44, 32,115,116,114,105,110,103, 46, 98,121, -116,101, 40, 99, 41, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10,101,110,100, 10, - 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, - 45, 32, 80,114,111,116,101, 99,116,115, 32, 97, 32,112, 97,116,104, 32,115,101, -103,109,101,110,116, 44, 32,116,111, 32,112,114,101,118,101,110,116, 32,105,116, - 32,102,114,111,109, 32,105,110,116,101,114,102,101,114,105,110,103, 32,119,105, -116,104, 32,116,104,101, 10, 45, 45, 32,117,114,108, 32,112, 97,114,115,105,110, -103, 46, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32, - 98,105,110, 97,114,121, 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32, -101,110, 99,111,100,101,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, - 45, 32, 32, 32,101,115, 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110, -116, 97,116,105,111,110, 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110, - 97,114,121, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,109, 97,107, -101, 95,115,101,116, 40,116, 41, 10, 9,108,111, 99, 97,108, 32,115, 32, 61, 32, -123,125, 10, 9,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46, -105,112, 97,105,114,115, 40,116, 41, 32,100,111, 10, 9, 9,115, 91,116, 91,105, - 93, 93, 32, 61, 32, 49, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32, -115, 10,101,110,100, 10, 10, 45, 45, 32,116,104,101,115,101, 32, 97,114,101, 32, - 97,108,108,111,119,101,100, 32,119,105,116,104,105,110,103, 32, 97, 32,112, 97, -116,104, 32,115,101,103,109,101,110,116, 44, 32, 97,108,111,110,103, 32,119,105, -116,104, 32, 97,108,112,104, 97,110,117,109, 10, 45, 45, 32,111,116,104,101,114, - 32, 99,104, 97,114, 97, 99,116,101,114,115, 32,109,117,115,116, 32, 98,101, 32, -101,115, 99, 97,112,101,100, 10,108,111, 99, 97,108, 32,115,101,103,109,101,110, -116, 95,115,101,116, 32, 61, 32,109, 97,107,101, 95,115,101,116, 32,123, 10, 32, - 32, 32, 32, 34, 45, 34, 44, 32, 34, 95, 34, 44, 32, 34, 46, 34, 44, 32, 34, 33, - 34, 44, 32, 34,126, 34, 44, 32, 34, 42, 34, 44, 32, 34, 39, 34, 44, 32, 34, 40, - 34, 44, 10, 9, 34, 41, 34, 44, 32, 34, 58, 34, 44, 32, 34, 64, 34, 44, 32, 34, - 38, 34, 44, 32, 34, 61, 34, 44, 32, 34, 43, 34, 44, 32, 34, 36, 34, 44, 32, 34, - 44, 34, 44, 10,125, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111, -110, 32,112,114,111,116,101, 99,116, 95,115,101,103,109,101,110,116, 40,115, 41, - 10, 9,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,103,115,117, 98, - 40,115, 44, 32, 34, 40, 91, 94, 65, 45, 90, 97, 45,122, 48, 45, 57, 95, 93, 41, - 34, 44, 32,102,117,110, 99,116,105,111,110, 32, 40, 99, 41, 10, 9, 9,105,102, - 32,115,101,103,109,101,110,116, 95,115,101,116, 91, 99, 93, 32,116,104,101,110, - 32,114,101,116,117,114,110, 32, 99, 10, 9, 9,101,108,115,101, 32,114,101,116, -117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 34, 37, - 37, 37, 48, 50,120, 34, 44, 32,115,116,114,105,110,103, 46, 98,121,116,101, 40, - 99, 41, 41, 32,101,110,100, 10, 9,101,110,100, 41, 10,101,110,100, 10, 10, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, - 69,110, 99,111,100,101,115, 32, 97, 32,115,116,114,105,110,103, 32,105,110,116, -111, 32,105,116,115, 32,101,115, 99, 97,112,101,100, 32,104,101,120, 97,100,101, - 99,105,109, 97,108, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110, - 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32, 98,105, -110, 97,114,121, 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32,101,110, - 99,111,100,101,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, - 32, 32,101,115, 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110,116, 97, -116,105,111,110, 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110, 97,114, -121, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, -102,117,110, 99,116,105,111,110, 32,117,110,101,115, 99, 97,112,101, 40,115, 41, - 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,103, -115,117, 98, 40,115, 44, 32, 34, 37, 37, 40, 37,120, 37,120, 41, 34, 44, 32,102, -117,110, 99,116,105,111,110, 40,104,101,120, 41, 10, 32, 32, 32, 32, 32, 32, 32, - 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46, 99,104, 97,114, 40, - 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, 40,104,101,120, 44, 32, 49, - 54, 41, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10,101,110,100, 10, 10, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 66, -117,105,108,100,115, 32, 97, 32,112, 97,116,104, 32,102,114,111,109, 32, 97, 32, - 98, 97,115,101, 32,112, 97,116,104, 32, 97,110,100, 32, 97, 32,114,101,108, 97, -116,105,118,101, 32,112, 97,116,104, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, - 45, 32, 32, 32, 98, 97,115,101, 95,112, 97,116,104, 10, 45, 45, 32, 32, 32,114, -101,108, 97,116,105,118,101, 95,112, 97,116,104, 10, 45, 45, 32, 82,101,116,117, -114,110,115, 10, 45, 45, 32, 32, 32, 99,111,114,114,101,115,112,111,110,100,105, -110,103, 32, 97, 98,115,111,108,117,116,101, 32,112, 97,116,104, 10, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, - 32,102,117,110, 99,116,105,111,110, 32, 97, 98,115,111,108,117,116,101, 95,112, - 97,116,104, 40, 98, 97,115,101, 95,112, 97,116,104, 44, 32,114,101,108, 97,116, -105,118,101, 95,112, 97,116,104, 41, 10, 32, 32, 32, 32,105,102, 32,115,116,114, -105,110,103, 46,115,117, 98, 40,114,101,108, 97,116,105,118,101, 95,112, 97,116, -104, 44, 32, 49, 44, 32, 49, 41, 32, 61, 61, 32, 34, 47, 34, 32,116,104,101,110, - 32,114,101,116,117,114,110, 32,114,101,108, 97,116,105,118,101, 95,112, 97,116, -104, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,116,104, - 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 97,115,101, 95, -112, 97,116,104, 44, 32, 34, 91, 94, 47, 93, 42, 36, 34, 44, 32, 34, 34, 41, 10, - 32, 32, 32, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32,114, -101,108, 97,116,105,118,101, 95,112, 97,116,104, 10, 32, 32, 32, 32,112, 97,116, -104, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104, - 44, 32, 34, 40, 91, 94, 47, 93, 42, 37, 46, 47, 41, 34, 44, 32,102,117,110, 99, -116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, -115, 32,126, 61, 32, 34, 46, 47, 34, 32,116,104,101,110, 32,114,101,116,117,114, -110, 32,115, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 34, 34, 32,101, -110,100, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32, 32, 32, 32,112, 97,116,104, - 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104, 44, - 32, 34, 47, 37, 46, 36, 34, 44, 32, 34, 47, 34, 41, 10, 32, 32, 32, 32,108,111, - 99, 97,108, 32,114,101,100,117, 99,101,100, 10, 32, 32, 32, 32,119,104,105,108, -101, 32,114,101,100,117, 99,101,100, 32,126, 61, 32,112, 97,116,104, 32,100,111, - 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,100,117, 99,101,100, 32, 61, 32,112, - 97,116,104, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,116,104, 32, 61, 32,115, -116,114,105,110,103, 46,103,115,117, 98, 40,114,101,100,117, 99,101,100, 44, 32, - 34, 40, 91, 94, 47, 93, 42, 47, 37, 46, 37, 46, 47, 41, 34, 44, 32,102,117,110, - 99,116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32,105,102, 32,115, 32,126, 61, 32, 34, 46, 46, 47, 46, 46, 47, 34, 32,116, -104,101,110, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,108,115,101, 32,114, -101,116,117,114,110, 32,115, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, -101,110,100, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,112, 97,116, -104, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,114,101,100,117, - 99,101,100, 44, 32, 34, 40, 91, 94, 47, 93, 42, 47, 37, 46, 37, 46, 41, 36, 34, - 44, 32,102,117,110, 99,116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32, - 32, 32, 32,105,102, 32,115, 32,126, 61, 32, 34, 46, 46, 47, 46, 46, 34, 32,116, -104,101,110, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,108,115,101, 32,114, -101,116,117,114,110, 32,115, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 41, - 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,112, 97,116,104, 10,101,110,100, - 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, - 45, 45, 32, 80, 97,114,115,101,115, 32, 97, 32,117,114,108, 32, 97,110,100, 32, -114,101,116,117,114,110,115, 32, 97, 32,116, 97, 98,108,101, 32,119,105,116,104, - 32, 97,108,108, 32,105,116,115, 32,112, 97,114,116,115, 32, 97, 99, 99,111,114, -100,105,110,103, 32,116,111, 32, 82, 70, 67, 32, 50, 51, 57, 54, 10, 45, 45, 32, - 84,104,101, 32,102,111,108,108,111,119,105,110,103, 32,103,114, 97,109,109, 97, -114, 32,100,101,115, 99,114,105, 98,101,115, 32,116,104,101, 32,110, 97,109,101, -115, 32,103,105,118,101,110, 32,116,111, 32,116,104,101, 32, 85, 82, 76, 32,112, - 97,114,116,115, 10, 45, 45, 32, 60,117,114,108, 62, 32, 58, 58, 61, 32, 60,115, - 99,104,101,109,101, 62, 58, 47, 47, 60, 97,117,116,104,111,114,105,116,121, 62, - 47, 60,112, 97,116,104, 62, 59, 60,112, 97,114, 97,109,115, 62, 63, 60,113,117, -101,114,121, 62, 35, 60,102,114, 97,103,109,101,110,116, 62, 10, 45, 45, 32, 60, - 97,117,116,104,111,114,105,116,121, 62, 32, 58, 58, 61, 32, 60,117,115,101,114, -105,110,102,111, 62, 64, 60,104,111,115,116, 62, 58, 60,112,111,114,116, 62, 10, - 45, 45, 32, 60,117,115,101,114,105,110,102,111, 62, 32, 58, 58, 61, 32, 60,117, -115,101,114, 62, 91, 58, 60,112, 97,115,115,119,111,114,100, 62, 93, 10, 45, 45, - 32, 60,112, 97,116,104, 62, 32, 58, 58, 32, 61, 32,123, 60,115,101,103,109,101, -110,116, 62, 47,125, 60,115,101,103,109,101,110,116, 62, 10, 45, 45, 32, 73,110, -112,117,116, 10, 45, 45, 32, 32, 32,117,114,108, 58, 32,117,110,105,102,111,114, -109, 32,114,101,115,111,117,114, 99,101, 32,108,111, 99, 97,116,111,114, 32,111, -102, 32,114,101,113,117,101,115,116, 10, 45, 45, 32, 32, 32,100,101,102, 97,117, -108,116, 58, 32,116, 97, 98,108,101, 32,119,105,116,104, 32,100,101,102, 97,117, -108,116, 32,118, 97,108,117,101,115, 32,102,111,114, 32,101, 97, 99,104, 32,102, -105,101,108,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, - 32,116, 97, 98,108,101, 32,119,105,116,104, 32,116,104,101, 32,102,111,108,108, -111,119,105,110,103, 32,102,105,101,108,100,115, 44, 32,119,104,101,114,101, 32, - 82, 70, 67, 32,110, 97,109,105,110,103, 32, 99,111,110,118,101,110,116,105,111, -110,115, 32,104, 97,118,101, 10, 45, 45, 32, 32, 32, 98,101,101,110, 32,112,114, -101,115,101,114,118,101,100, 58, 10, 45, 45, 32, 32, 32, 32, 32,115, 99,104,101, -109,101, 44, 32, 97,117,116,104,111,114,105,116,121, 44, 32,117,115,101,114,105, -110,102,111, 44, 32,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100, 44, - 32,104,111,115,116, 44, 32,112,111,114,116, 44, 10, 45, 45, 32, 32, 32, 32, 32, -112, 97,116,104, 44, 32,112, 97,114, 97,109,115, 44, 32,113,117,101,114,121, 44, - 32,102,114, 97,103,109,101,110,116, 10, 45, 45, 32, 79, 98,115, 58, 10, 45, 45, - 32, 32, 32,116,104,101, 32,108,101, 97,100,105,110,103, 32, 39, 47, 39, 32,105, -110, 32,123, 47, 60,112, 97,116,104, 62,125, 32,105,115, 32, 99,111,110,115,105, -100,101,114,101,100, 32,112, 97,114,116, 32,111,102, 32, 60,112, 97,116,104, 62, - 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102, -117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 40,117,114,108, 44, 32,100, -101,102, 97,117,108,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,105,110,105,116,105, - 97,108,105,122,101, 32,100,101,102, 97,117,108,116, 32,112, 97,114, 97,109,101, -116,101,114,115, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,114,115,101, -100, 32, 61, 32,123,125, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105, -110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,100,101,102, 97,117,108,116, - 32,111,114, 32,112, 97,114,115,101,100, 41, 32,100,111, 32,112, 97,114,115,101, -100, 91,105, 93, 32, 61, 32,118, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32, -101,109,112,116,121, 32,117,114,108, 32,105,115, 32,112, 97,114,115,101,100, 32, -116,111, 32,110,105,108, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,117,114, -108, 32,111,114, 32,117,114,108, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32, -114,101,116,117,114,110, 32,110,105,108, 44, 32, 34,105,110,118, 97,108,105,100, - 32,117,114,108, 34, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,114,101,109, -111,118,101, 32,119,104,105,116,101,115,112, 97, 99,101, 10, 32, 32, 32, 32, 45, - 45, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, -117,114,108, 44, 32, 34, 37,115, 34, 44, 32, 34, 34, 41, 10, 32, 32, 32, 32, 45, - 45, 32,103,101,116, 32,102,114, 97,103,109,101,110,116, 10, 32, 32, 32, 32,117, -114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,114,108, - 44, 32, 34, 35, 40, 46, 42, 41, 36, 34, 44, 32,102,117,110, 99,116,105,111,110, - 40,102, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115,101,100, 46,102, -114, 97,103,109,101,110,116, 32, 61, 32,102, 10, 32, 32, 32, 32, 32, 32, 32, 32, -114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32, - 32, 32, 32, 45, 45, 32,103,101,116, 32,115, 99,104,101,109,101, 10, 32, 32, 32, - 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117, -114,108, 44, 32, 34, 94, 40, 91, 37,119, 93, 91, 37,119, 37, 43, 37, 45, 37, 46, - 93, 42, 41, 37, 58, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,102,117,110, 99, -116,105,111,110, 40,115, 41, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109, -101, 32, 61, 32,115, 59, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,110,100, - 41, 10, 32, 32, 32, 32, 45, 45, 32,103,101,116, 32, 97,117,116,104,111,114,105, -116,121, 10, 32, 32, 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46, -103,115,117, 98, 40,117,114,108, 44, 32, 34, 94, 47, 47, 40, 91, 94, 47, 93, 42, - 41, 34, 44, 32,102,117,110, 99,116,105,111,110, 40,110, 41, 10, 32, 32, 32, 32, - 32, 32, 32, 32,112, 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121, - 32, 61, 32,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, - 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32, 32, 32, 32, 45, 45, 32,103, -101,116, 32,113,117,101,114,121, 32,115,116,114,105,110,103,105,110,103, 10, 32, - 32, 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, - 40,117,114,108, 44, 32, 34, 37, 63, 40, 46, 42, 41, 34, 44, 32,102,117,110, 99, -116,105,111,110, 40,113, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115, -101,100, 46,113,117,101,114,121, 32, 61, 32,113, 10, 32, 32, 32, 32, 32, 32, 32, - 32,114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, - 32, 32, 32, 32, 45, 45, 32,103,101,116, 32,112, 97,114, 97,109,115, 10, 32, 32, - 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, -117,114,108, 44, 32, 34, 37, 59, 40, 46, 42, 41, 34, 44, 32,102,117,110, 99,116, -105,111,110, 40,112, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115,101, -100, 46,112, 97,114, 97,109,115, 32, 61, 32,112, 10, 32, 32, 32, 32, 32, 32, 32, - 32,114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, - 32, 32, 32, 32, 45, 45, 32,112, 97,116,104, 32,105,115, 32,119,104, 97,116,101, -118,101,114, 32,119, 97,115, 32,108,101,102,116, 10, 32, 32, 32, 32,105,102, 32, -117,114,108, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32,112, 97,114,115,101, -100, 46,112, 97,116,104, 32, 61, 32,117,114,108, 32,101,110,100, 10, 32, 32, 32, - 32,108,111, 99, 97,108, 32, 97,117,116,104,111,114,105,116,121, 32, 61, 32,112, - 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121, 10, 32, 32, 32, 32, -105,102, 32,110,111,116, 32, 97,117,116,104,111,114,105,116,121, 32,116,104,101, -110, 32,114,101,116,117,114,110, 32,112, 97,114,115,101,100, 32,101,110,100, 10, - 32, 32, 32, 32, 97,117,116,104,111,114,105,116,121, 32, 61, 32,115,116,114,105, -110,103, 46,103,115,117, 98, 40, 97,117,116,104,111,114,105,116,121, 44, 34, 94, - 40, 91, 94, 64, 93, 42, 41, 64, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,102, -117,110, 99,116,105,111,110, 40,117, 41, 32,112, 97,114,115,101,100, 46,117,115, -101,114,105,110,102,111, 32, 61, 32,117, 59, 32,114,101,116,117,114,110, 32, 34, - 34, 32,101,110,100, 41, 10, 32, 32, 32, 32, 97,117,116,104,111,114,105,116,121, - 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 97,117,116,104,111, -114,105,116,121, 44, 32, 34, 58, 40, 91, 94, 58, 93, 42, 41, 36, 34, 44, 10, 32, - 32, 32, 32, 32, 32, 32, 32,102,117,110, 99,116,105,111,110, 40,112, 41, 32,112, - 97,114,115,101,100, 46,112,111,114,116, 32, 61, 32,112, 59, 32,114,101,116,117, -114,110, 32, 34, 34, 32,101,110,100, 41, 10, 32, 32, 32, 32,105,102, 32, 97,117, -116,104,111,114,105,116,121, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32,112, - 97,114,115,101,100, 46,104,111,115,116, 32, 61, 32, 97,117,116,104,111,114,105, -116,121, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117,115,101, -114,105,110,102,111, 32, 61, 32,112, 97,114,115,101,100, 46,117,115,101,114,105, -110,102,111, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,117,115,101,114,105, -110,102,111, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,112, 97,114,115, -101,100, 32,101,110,100, 10, 32, 32, 32, 32,117,115,101,114,105,110,102,111, 32, - 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,115,101,114,105,110, -102,111, 44, 32, 34, 58, 40, 91, 94, 58, 93, 42, 41, 36, 34, 44, 10, 32, 32, 32, - 32, 32, 32, 32, 32,102,117,110, 99,116,105,111,110, 40,112, 41, 32,112, 97,114, -115,101,100, 46,112, 97,115,115,119,111,114,100, 32, 61, 32,112, 59, 32,114,101, -116,117,114,110, 32, 34, 34, 32,101,110,100, 41, 10, 32, 32, 32, 32,112, 97,114, -115,101,100, 46,117,115,101,114, 32, 61, 32,117,115,101,114,105,110,102,111, 10, - 32, 32, 32, 32,114,101,116,117,114,110, 32,112, 97,114,115,101,100, 10,101,110, -100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 10, 45, 45, 32, 82,101, 98,117,105,108,100,115, 32, 97, 32,112, 97,114,115,101, -100, 32, 85, 82, 76, 32,102,114,111,109, 32,105,116,115, 32, 99,111,109,112,111, -110,101,110,116,115, 46, 10, 45, 45, 32, 67,111,109,112,111,110,101,110,116,115, - 32, 97,114,101, 32,112,114,111,116,101, 99,116,101,100, 32,105,102, 32, 97,110, -121, 32,114,101,115,101,114,118,101,100, 32,111,114, 32,117,110, 97,108,108,111, -119,101,100, 32, 99,104, 97,114, 97, 99,116,101,114,115, 32, 97,114,101, 32,102, -111,117,110,100, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,112, - 97,114,115,101,100, 58, 32,112, 97,114,115,101,100, 32, 85, 82, 76, 44, 32, 97, -115, 32,114,101,116,117,114,110,101,100, 32, 98,121, 32,112, 97,114,115,101, 10, - 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, 32, 97, 32,115,116, -114,105,110,103,105,110,103, 32,119,105,116,104, 32,116,104,101, 32, 99,111,114, -114,101,115,112,111,110,100,105,110,103, 32, 85, 82, 76, 10, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111, -110, 32, 98,117,105,108,100, 40,112, 97,114,115,101,100, 41, 10, 32, 32, 32, 32, -108,111, 99, 97,108, 32,112,112, 97,116,104, 32, 61, 32,112, 97,114,115,101, 95, -112, 97,116,104, 40,112, 97,114,115,101,100, 46,112, 97,116,104, 32,111,114, 32, - 34, 34, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32, - 98,117,105,108,100, 95,112, 97,116,104, 40,112,112, 97,116,104, 41, 10, 32, 32, - 32, 32,105,102, 32,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,116, -104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46, 32, 34, 59, 34, - 32, 46, 46, 32,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,101,110, -100, 10, 32, 32, 32, 32,105,102, 32,112, 97,114,115,101,100, 46,113,117,101,114, -121, 32,116,104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46, 32, - 34, 63, 34, 32, 46, 46, 32,112, 97,114,115,101,100, 46,113,117,101,114,121, 32, -101,110,100, 10, 9,108,111, 99, 97,108, 32, 97,117,116,104,111,114,105,116,121, - 32, 61, 32,112, 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121, 10, - 9,105,102, 32,112, 97,114,115,101,100, 46,104,111,115,116, 32,116,104,101,110, - 10, 9, 9, 97,117,116,104,111,114,105,116,121, 32, 61, 32,112, 97,114,115,101, -100, 46,104,111,115,116, 10, 9, 9,105,102, 32,112, 97,114,115,101,100, 46,112, -111,114,116, 32,116,104,101,110, 32, 97,117,116,104,111,114,105,116,121, 32, 61, - 32, 97,117,116,104,111,114,105,116,121, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46, - 32,112, 97,114,115,101,100, 46,112,111,114,116, 32,101,110,100, 10, 9, 9,108, -111, 99, 97,108, 32,117,115,101,114,105,110,102,111, 32, 61, 32,112, 97,114,115, -101,100, 46,117,115,101,114,105,110,102,111, 10, 9, 9,105,102, 32,112, 97,114, -115,101,100, 46,117,115,101,114, 32,116,104,101,110, 10, 9, 9, 9,117,115,101, -114,105,110,102,111, 32, 61, 32,112, 97,114,115,101,100, 46,117,115,101,114, 10, - 9, 9, 9,105,102, 32,112, 97,114,115,101,100, 46,112, 97,115,115,119,111,114, -100, 32,116,104,101,110, 10, 9, 9, 9, 9,117,115,101,114,105,110,102,111, 32, - 61, 32,117,115,101,114,105,110,102,111, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46, - 32,112, 97,114,115,101,100, 46,112, 97,115,115,119,111,114,100, 10, 9, 9, 9, -101,110,100, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32,117,115,101,114,105, -110,102,111, 32,116,104,101,110, 32, 97,117,116,104,111,114,105,116,121, 32, 61, - 32,117,115,101,114,105,110,102,111, 32, 46, 46, 32, 34, 64, 34, 32, 46, 46, 32, - 97,117,116,104,111,114,105,116,121, 32,101,110,100, 10, 9,101,110,100, 10, 32, - 32, 32, 32,105,102, 32, 97,117,116,104,111,114,105,116,121, 32,116,104,101,110, - 32,117,114,108, 32, 61, 32, 34, 47, 47, 34, 32, 46, 46, 32, 97,117,116,104,111, -114,105,116,121, 32, 46, 46, 32,117,114,108, 32,101,110,100, 10, 32, 32, 32, 32, -105,102, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109,101, 32,116,104,101, -110, 32,117,114,108, 32, 61, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109, -101, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46, 32,117,114,108, 32,101,110,100, 10, - 32, 32, 32, 32,105,102, 32,112, 97,114,115,101,100, 46,102,114, 97,103,109,101, -110,116, 32,116,104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46, - 32, 34, 35, 34, 32, 46, 46, 32,112, 97,114,115,101,100, 46,102,114, 97,103,109, -101,110,116, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,117,114,108, 32, 61, - 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,114,108, 44, 32, 34, 37, -115, 34, 44, 32, 34, 34, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,117, -114,108, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 10, 45, 45, 32, 66,117,105,108,100,115, 32, 97, 32, 97, 98, -115,111,108,117,116,101, 32, 85, 82, 76, 32,102,114,111,109, 32, 97, 32, 98, 97, -115,101, 32, 97,110,100, 32, 97, 32,114,101,108, 97,116,105,118,101, 32, 85, 82, - 76, 32, 97, 99, 99,111,114,100,105,110,103, 32,116,111, 32, 82, 70, 67, 32, 50, - 51, 57, 54, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32, 98, 97, -115,101, 95,117,114,108, 10, 45, 45, 32, 32, 32,114,101,108, 97,116,105,118,101, - 95,117,114,108, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, - 32, 99,111,114,114,101,115,112,111,110,100,105,110,103, 32, 97, 98,115,111,108, -117,116,101, 32,117,114,108, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110, 32, 97, 98,115,111,108, -117,116,101, 40, 98, 97,115,101, 95,117,114,108, 44, 32,114,101,108, 97,116,105, -118,101, 95,117,114,108, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46, -116,121,112,101, 40, 98, 97,115,101, 95,117,114,108, 41, 32, 61, 61, 32, 34,116, - 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, - 97,115,101, 95,112, 97,114,115,101,100, 32, 61, 32, 98, 97,115,101, 95,117,114, -108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 95,117,114,108, 32, 61, - 32, 98,117,105,108,100, 40, 98, 97,115,101, 95,112, 97,114,115,101,100, 41, 10, - 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115, -101, 95,112, 97,114,115,101,100, 32, 61, 32,112, 97,114,115,101, 40, 98, 97,115, -101, 95,117,114,108, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108, -111, 99, 97,108, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, - 32, 61, 32,112, 97,114,115,101, 40,114,101,108, 97,116,105,118,101, 95,117,114, -108, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 98, 97,115,101, 95,112, - 97,114,115,101,100, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,114,101, -108, 97,116,105,118,101, 95,117,114,108, 10, 32, 32, 32, 32,101,108,115,101,105, -102, 32,110,111,116, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101, -100, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 95,117, -114,108, 10, 32, 32, 32, 32,101,108,115,101,105,102, 32,114,101,108, 97,116,105, -118,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101,109,101, 32,116,104,101, -110, 32,114,101,116,117,114,110, 32,114,101,108, 97,116,105,118,101, 95,117,114, -108, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,114, -101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101,109, -101, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101, -109,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101, -108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46, 97,117,116,104,111,114, -105,116,121, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46, 97,117,116, -104,111,114,105,116,121, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, - 46, 97,117,116,104,111,114,105,116,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116,105,118,101, 95,112, - 97,114,115,101,100, 46,112, 97,116,104, 32,116,104,101,110, 10, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, - 95,112, 97,114,115,101,100, 46,112, 97,116,104, 32, 61, 32, 98, 97,115,101, 95, -112, 97,114,115,101,100, 46,112, 97,116,104, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116, -105,118,101, 95,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,116,104, -101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46,112, - 97,114, 97,109,115, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, 46, -112, 97,114, 97,109,115, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116,105, -118,101, 95,112, 97,114,115,101,100, 46,113,117,101,114,121, 32,116,104,101,110, - 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, - 46,113,117,101,114,121, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, - 46,113,117,101,114,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,101,108,115,101, 32, 32, 32, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114, -115,101,100, 46,112, 97,116,104, 32, 61, 32, 97, 98,115,111,108,117,116,101, 95, -112, 97,116,104, 40, 98, 97,115,101, 95,112, 97,114,115,101,100, 46,112, 97,116, -104, 32,111,114, 32, 34, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97, -114,115,101,100, 46,112, 97,116,104, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, - 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 98,117,105,108,100, 40, -114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 41, 10, 32, 32, 32, - 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 66,114,101, 97,107,115, 32, 97, 32, -112, 97,116,104, 32,105,110,116,111, 32,105,116,115, 32,115,101,103,109,101,110, -116,115, 44, 32,117,110,101,115, 99, 97,112,105,110,103, 32,116,104,101, 32,115, -101,103,109,101,110,116,115, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, - 32, 32,112, 97,116,104, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, - 32, 32, 32,115,101,103,109,101,110,116, 58, 32, 97, 32,116, 97, 98,108,101, 32, -119,105,116,104, 32,111,110,101, 32,101,110,116,114,121, 32,112,101,114, 32,115, -101,103,109,101,110,116, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 95, -112, 97,116,104, 40,112, 97,116,104, 41, 10, 9,108,111, 99, 97,108, 32,112, 97, -114,115,101,100, 32, 61, 32,123,125, 10, 9,112, 97,116,104, 32, 61, 32,112, 97, -116,104, 32,111,114, 32, 34, 34, 10, 9, 45, 45,112, 97,116,104, 32, 61, 32,115, -116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104, 44, 32, 34, 37,115, - 34, 44, 32, 34, 34, 41, 10, 9,115,116,114,105,110,103, 46,103,115,117, 98, 40, -112, 97,116,104, 44, 32, 34, 40, 91, 94, 47, 93, 43, 41, 34, 44, 32,102,117,110, - 99,116,105,111,110, 32, 40,115, 41, 32,116, 97, 98,108,101, 46,105,110,115,101, -114,116, 40,112, 97,114,115,101,100, 44, 32,115, 41, 32,101,110,100, 41, 10, 9, -102,111,114, 32,105, 32, 61, 32, 49, 44, 32,116, 97, 98,108,101, 46,103,101,116, -110, 40,112, 97,114,115,101,100, 41, 32,100,111, 10, 9, 9,112, 97,114,115,101, -100, 91,105, 93, 32, 61, 32,117,110,101,115, 99, 97,112,101, 40,112, 97,114,115, -101,100, 91,105, 93, 41, 10, 9,101,110,100, 10, 9,105,102, 32,115,116,114,105, -110,103, 46,115,117, 98, 40,112, 97,116,104, 44, 32, 49, 44, 32, 49, 41, 32, 61, - 61, 32, 34, 47, 34, 32,116,104,101,110, 32,112, 97,114,115,101,100, 46,105,115, - 95, 97, 98,115,111,108,117,116,101, 32, 61, 32, 49, 32,101,110,100, 10, 9,105, -102, 32,115,116,114,105,110,103, 46,115,117, 98, 40,112, 97,116,104, 44, 32, 45, - 49, 44, 32, 45, 49, 41, 32, 61, 61, 32, 34, 47, 34, 32,116,104,101,110, 32,112, - 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114,121, 32, 61, - 32, 49, 32,101,110,100, 10, 9,114,101,116,117,114,110, 32,112, 97,114,115,101, -100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 10, 45, 45, 32, 66,117,105,108,100,115, 32, 97, 32,112, 97,116, -104, 32, 99,111,109,112,111,110,101,110,116, 32,102,114,111,109, 32,105,116,115, - 32,115,101,103,109,101,110,116,115, 44, 32,101,115, 99, 97,112,105,110,103, 32, -112,114,111,116,101, 99,116,101,100, 32, 99,104, 97,114, 97, 99,116,101,114,115, - 46, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,112, 97,114,115, -101,100, 58, 32,112, 97,116,104, 32,115,101,103,109,101,110,116,115, 10, 45, 45, - 32, 32, 32,117,110,115, 97,102,101, 58, 32,105,102, 32,116,114,117,101, 44, 32, -115,101,103,109,101,110,116,115, 32, 97,114,101, 32,110,111,116, 32,112,114,111, -116,101, 99,116,101,100, 32, 98,101,102,111,114,101, 32,112, 97,116,104, 32,105, -115, 32, 98,117,105,108,116, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, - 45, 32, 32, 32,112, 97,116,104, 58, 32, 99,111,114,114,101,115,112,111,110,100, -105,110,103, 32,112, 97,116,104, 32,115,116,114,105,110,103,105,110,103, 10, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, - 99,116,105,111,110, 32, 98,117,105,108,100, 95,112, 97,116,104, 40,112, 97,114, -115,101,100, 44, 32,117,110,115, 97,102,101, 41, 10, 9,108,111, 99, 97,108, 32, -112, 97,116,104, 32, 61, 32, 34, 34, 10, 9,108,111, 99, 97,108, 32,110, 32, 61, - 32,116, 97, 98,108,101, 46,103,101,116,110, 40,112, 97,114,115,101,100, 41, 10, - 9,105,102, 32,117,110,115, 97,102,101, 32,116,104,101,110, 10, 9, 9,102,111, -114, 32,105, 32, 61, 32, 49, 44, 32,110, 45, 49, 32,100,111, 10, 9, 9, 9,112, - 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32,112, 97,114,115,101,100, - 91,105, 93, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, - 46, 32, 34, 47, 34, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32,110, 32, 62, - 32, 48, 32,116,104,101,110, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97, -116,104, 32, 46, 46, 32,112, 97,114,115,101,100, 91,110, 93, 10, 9, 9, 9,105, -102, 32,112, 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114, -121, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, - 46, 32, 34, 47, 34, 32,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,108,115, -101, 10, 9, 9,102,111,114, 32,105, 32, 61, 32, 49, 44, 32,110, 45, 49, 32,100, -111, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32, -112,114,111,116,101, 99,116, 95,115,101,103,109,101,110,116, 40,112, 97,114,115, -101,100, 91,105, 93, 41, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116, -104, 32, 46, 46, 32, 34, 47, 34, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32, -110, 32, 62, 32, 48, 32,116,104,101,110, 10, 9, 9, 9,112, 97,116,104, 32, 61, - 32,112, 97,116,104, 32, 46, 46, 32,112,114,111,116,101, 99,116, 95,115,101,103, -109,101,110,116, 40,112, 97,114,115,101,100, 91,110, 93, 41, 10, 9, 9, 9,105, -102, 32,112, 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114, -121, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, - 46, 32, 34, 47, 34, 32,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,110,100, - 10, 9,105,102, 32,112, 97,114,115,101,100, 46,105,115, 95, 97, 98,115,111,108, -117,116,101, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32, 34, 47, 34, 32, - 46, 46, 32,112, 97,116,104, 32,101,110,100, 10, 9,114,101,116,117,114,110, 32, -112, 97,116,104, 10,101,110,100, 10, -}; - - if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"url.lua")==0) lua_call(L, 0, 0); -} +/* code automatically generated by bin2c -- DO NOT EDIT */ +{ +/* #include'ing this file in a C program is equivalent to calling + if (luaL_loadfile(L,"url.lua")==0) lua_call(L, 0, 0); +*/ +/* url.lua */ +static const unsigned char B1[]={ + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, + 32, 85, 82, 73, 32,112, 97,114,115,105,110,103, 44, 32, 99,111,109,112,111,115, +105,116,105,111,110, 32, 97,110,100, 32,114,101,108, 97,116,105,118,101, 32, 85, + 82, 76, 32,114,101,115,111,108,117,116,105,111,110, 10, 45, 45, 32, 76,117, 97, + 83,111, 99,107,101,116, 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65, +117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, + 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, 73,100, 58, 32,117,114,108, 46,108, +117, 97, 44,118, 32, 49, 46, 51, 56, 32, 50, 48, 48, 54, 47, 48, 52, 47, 48, 51, + 32, 48, 52, 58, 52, 53, 58, 52, 50, 32,100,105,101,103,111, 32, 69,120,112, 32, + 36, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, + 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, + 45, 32, 68,101, 99,108, 97,114,101, 32,109,111,100,117,108,101, 10, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, + 32,115,116,114,105,110,103, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115, +116,114,105,110,103, 34, 41, 10,108,111, 99, 97,108, 32, 98, 97,115,101, 32, 61, + 32, 95, 71, 10,108,111, 99, 97,108, 32,116, 97, 98,108,101, 32, 61, 32,114,101, +113,117,105,114,101, 40, 34,116, 97, 98,108,101, 34, 41, 10,109,111,100,117,108, +101, 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34, 41, 10, 10, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 77,111, +100,117,108,101, 32,118,101,114,115,105,111,110, 10, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 95, 86, 69, 82, 83, 73, 79, 78, 32, + 61, 32, 34, 85, 82, 76, 32, 49, 46, 48, 46, 49, 34, 10, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 69,110, 99,111, +100,101,115, 32, 97, 32,115,116,114,105,110,103, 32,105,110,116,111, 32,105,116, +115, 32,101,115, 99, 97,112,101,100, 32,104,101,120, 97,100,101, 99,105,109, 97, +108, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110, 10, 45, 45, 32, + 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32, 98,105,110, 97,114,121, + 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32,101,110, 99,111,100,101, +100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, 32,101,115, + 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110, + 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110, 97,114,121, 10, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99, +116,105,111,110, 32,101,115, 99, 97,112,101, 40,115, 41, 10, 32, 32, 32, 32,114, +101,116,117,114,110, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, + 32, 34, 40, 91, 94, 65, 45, 90, 97, 45,122, 48, 45, 57, 95, 93, 41, 34, 44, 32, +102,117,110, 99,116,105,111,110, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, +114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116, + 40, 34, 37, 37, 37, 48, 50,120, 34, 44, 32,115,116,114,105,110,103, 46, 98,121, +116,101, 40, 99, 41, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10,101,110,100, 10, + 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, + 45, 32, 80,114,111,116,101, 99,116,115, 32, 97, 32,112, 97,116,104, 32,115,101, +103,109,101,110,116, 44, 32,116,111, 32,112,114,101,118,101,110,116, 32,105,116, + 32,102,114,111,109, 32,105,110,116,101,114,102,101,114,105,110,103, 32,119,105, +116,104, 32,116,104,101, 10, 45, 45, 32,117,114,108, 32,112, 97,114,115,105,110, +103, 46, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32, + 98,105,110, 97,114,121, 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32, +101,110, 99,111,100,101,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, + 45, 32, 32, 32,101,115, 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110, +116, 97,116,105,111,110, 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110, + 97,114,121, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,109, 97,107, +101, 95,115,101,116, 40,116, 41, 10, 9,108,111, 99, 97,108, 32,115, 32, 61, 32, +123,125, 10, 9,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46, +105,112, 97,105,114,115, 40,116, 41, 32,100,111, 10, 9, 9,115, 91,116, 91,105, + 93, 93, 32, 61, 32, 49, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32, +115, 10,101,110,100, 10, 10, 45, 45, 32,116,104,101,115,101, 32, 97,114,101, 32, + 97,108,108,111,119,101,100, 32,119,105,116,104,105,110,103, 32, 97, 32,112, 97, +116,104, 32,115,101,103,109,101,110,116, 44, 32, 97,108,111,110,103, 32,119,105, +116,104, 32, 97,108,112,104, 97,110,117,109, 10, 45, 45, 32,111,116,104,101,114, + 32, 99,104, 97,114, 97, 99,116,101,114,115, 32,109,117,115,116, 32, 98,101, 32, +101,115, 99, 97,112,101,100, 10,108,111, 99, 97,108, 32,115,101,103,109,101,110, +116, 95,115,101,116, 32, 61, 32,109, 97,107,101, 95,115,101,116, 32,123, 10, 32, + 32, 32, 32, 34, 45, 34, 44, 32, 34, 95, 34, 44, 32, 34, 46, 34, 44, 32, 34, 33, + 34, 44, 32, 34,126, 34, 44, 32, 34, 42, 34, 44, 32, 34, 39, 34, 44, 32, 34, 40, + 34, 44, 10, 9, 34, 41, 34, 44, 32, 34, 58, 34, 44, 32, 34, 64, 34, 44, 32, 34, + 38, 34, 44, 32, 34, 61, 34, 44, 32, 34, 43, 34, 44, 32, 34, 36, 34, 44, 32, 34, + 44, 34, 44, 10,125, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111, +110, 32,112,114,111,116,101, 99,116, 95,115,101,103,109,101,110,116, 40,115, 41, + 10, 9,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,103,115,117, 98, + 40,115, 44, 32, 34, 40, 91, 94, 65, 45, 90, 97, 45,122, 48, 45, 57, 95, 93, 41, + 34, 44, 32,102,117,110, 99,116,105,111,110, 32, 40, 99, 41, 10, 9, 9,105,102, + 32,115,101,103,109,101,110,116, 95,115,101,116, 91, 99, 93, 32,116,104,101,110, + 32,114,101,116,117,114,110, 32, 99, 10, 9, 9,101,108,115,101, 32,114,101,116, +117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 34, 37, + 37, 37, 48, 50,120, 34, 44, 32,115,116,114,105,110,103, 46, 98,121,116,101, 40, + 99, 41, 41, 32,101,110,100, 10, 9,101,110,100, 41, 10,101,110,100, 10, 10, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, + 69,110, 99,111,100,101,115, 32, 97, 32,115,116,114,105,110,103, 32,105,110,116, +111, 32,105,116,115, 32,101,115, 99, 97,112,101,100, 32,104,101,120, 97,100,101, + 99,105,109, 97,108, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110, + 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32, 98,105, +110, 97,114,121, 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32,101,110, + 99,111,100,101,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, + 32, 32,101,115, 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110,116, 97, +116,105,111,110, 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110, 97,114, +121, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, +102,117,110, 99,116,105,111,110, 32,117,110,101,115, 99, 97,112,101, 40,115, 41, + 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,103, +115,117, 98, 40,115, 44, 32, 34, 37, 37, 40, 37,120, 37,120, 41, 34, 44, 32,102, +117,110, 99,116,105,111,110, 40,104,101,120, 41, 10, 32, 32, 32, 32, 32, 32, 32, + 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46, 99,104, 97,114, 40, + 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, 40,104,101,120, 44, 32, 49, + 54, 41, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10,101,110,100, 10, 10, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 66, +117,105,108,100,115, 32, 97, 32,112, 97,116,104, 32,102,114,111,109, 32, 97, 32, + 98, 97,115,101, 32,112, 97,116,104, 32, 97,110,100, 32, 97, 32,114,101,108, 97, +116,105,118,101, 32,112, 97,116,104, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, + 45, 32, 32, 32, 98, 97,115,101, 95,112, 97,116,104, 10, 45, 45, 32, 32, 32,114, +101,108, 97,116,105,118,101, 95,112, 97,116,104, 10, 45, 45, 32, 82,101,116,117, +114,110,115, 10, 45, 45, 32, 32, 32, 99,111,114,114,101,115,112,111,110,100,105, +110,103, 32, 97, 98,115,111,108,117,116,101, 32,112, 97,116,104, 10, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, + 32,102,117,110, 99,116,105,111,110, 32, 97, 98,115,111,108,117,116,101, 95,112, + 97,116,104, 40, 98, 97,115,101, 95,112, 97,116,104, 44, 32,114,101,108, 97,116, +105,118,101, 95,112, 97,116,104, 41, 10, 32, 32, 32, 32,105,102, 32,115,116,114, +105,110,103, 46,115,117, 98, 40,114,101,108, 97,116,105,118,101, 95,112, 97,116, +104, 44, 32, 49, 44, 32, 49, 41, 32, 61, 61, 32, 34, 47, 34, 32,116,104,101,110, + 32,114,101,116,117,114,110, 32,114,101,108, 97,116,105,118,101, 95,112, 97,116, +104, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,116,104, + 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 97,115,101, 95, +112, 97,116,104, 44, 32, 34, 91, 94, 47, 93, 42, 36, 34, 44, 32, 34, 34, 41, 10, + 32, 32, 32, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32,114, +101,108, 97,116,105,118,101, 95,112, 97,116,104, 10, 32, 32, 32, 32,112, 97,116, +104, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104, + 44, 32, 34, 40, 91, 94, 47, 93, 42, 37, 46, 47, 41, 34, 44, 32,102,117,110, 99, +116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, +115, 32,126, 61, 32, 34, 46, 47, 34, 32,116,104,101,110, 32,114,101,116,117,114, +110, 32,115, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 34, 34, 32,101, +110,100, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32, 32, 32, 32,112, 97,116,104, + 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104, 44, + 32, 34, 47, 37, 46, 36, 34, 44, 32, 34, 47, 34, 41, 10, 32, 32, 32, 32,108,111, + 99, 97,108, 32,114,101,100,117, 99,101,100, 10, 32, 32, 32, 32,119,104,105,108, +101, 32,114,101,100,117, 99,101,100, 32,126, 61, 32,112, 97,116,104, 32,100,111, + 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,100,117, 99,101,100, 32, 61, 32,112, + 97,116,104, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,116,104, 32, 61, 32,115, +116,114,105,110,103, 46,103,115,117, 98, 40,114,101,100,117, 99,101,100, 44, 32, + 34, 40, 91, 94, 47, 93, 42, 47, 37, 46, 37, 46, 47, 41, 34, 44, 32,102,117,110, + 99,116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32,105,102, 32,115, 32,126, 61, 32, 34, 46, 46, 47, 46, 46, 47, 34, 32,116, +104,101,110, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,108,115,101, 32,114, +101,116,117,114,110, 32,115, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, +101,110,100, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,112, 97,116, +104, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,114,101,100,117, + 99,101,100, 44, 32, 34, 40, 91, 94, 47, 93, 42, 47, 37, 46, 37, 46, 41, 36, 34, + 44, 32,102,117,110, 99,116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32, + 32, 32, 32,105,102, 32,115, 32,126, 61, 32, 34, 46, 46, 47, 46, 46, 34, 32,116, +104,101,110, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,108,115,101, 32,114, +101,116,117,114,110, 32,115, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 41, + 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,112, 97,116,104, 10,101,110,100, + 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, + 45, 45, 32, 80, 97,114,115,101,115, 32, 97, 32,117,114,108, 32, 97,110,100, 32, +114,101,116,117,114,110,115, 32, 97, 32,116, 97, 98,108,101, 32,119,105,116,104, + 32, 97,108,108, 32,105,116,115, 32,112, 97,114,116,115, 32, 97, 99, 99,111,114, +100,105,110,103, 32,116,111, 32, 82, 70, 67, 32, 50, 51, 57, 54, 10, 45, 45, 32, + 84,104,101, 32,102,111,108,108,111,119,105,110,103, 32,103,114, 97,109,109, 97, +114, 32,100,101,115, 99,114,105, 98,101,115, 32,116,104,101, 32,110, 97,109,101, +115, 32,103,105,118,101,110, 32,116,111, 32,116,104,101, 32, 85, 82, 76, 32,112, + 97,114,116,115, 10, 45, 45, 32, 60,117,114,108, 62, 32, 58, 58, 61, 32, 60,115, + 99,104,101,109,101, 62, 58, 47, 47, 60, 97,117,116,104,111,114,105,116,121, 62, + 47, 60,112, 97,116,104, 62, 59, 60,112, 97,114, 97,109,115, 62, 63, 60,113,117, +101,114,121, 62, 35, 60,102,114, 97,103,109,101,110,116, 62, 10, 45, 45, 32, 60, + 97,117,116,104,111,114,105,116,121, 62, 32, 58, 58, 61, 32, 60,117,115,101,114, +105,110,102,111, 62, 64, 60,104,111,115,116, 62, 58, 60,112,111,114,116, 62, 10, + 45, 45, 32, 60,117,115,101,114,105,110,102,111, 62, 32, 58, 58, 61, 32, 60,117, +115,101,114, 62, 91, 58, 60,112, 97,115,115,119,111,114,100, 62, 93, 10, 45, 45, + 32, 60,112, 97,116,104, 62, 32, 58, 58, 32, 61, 32,123, 60,115,101,103,109,101, +110,116, 62, 47,125, 60,115,101,103,109,101,110,116, 62, 10, 45, 45, 32, 73,110, +112,117,116, 10, 45, 45, 32, 32, 32,117,114,108, 58, 32,117,110,105,102,111,114, +109, 32,114,101,115,111,117,114, 99,101, 32,108,111, 99, 97,116,111,114, 32,111, +102, 32,114,101,113,117,101,115,116, 10, 45, 45, 32, 32, 32,100,101,102, 97,117, +108,116, 58, 32,116, 97, 98,108,101, 32,119,105,116,104, 32,100,101,102, 97,117, +108,116, 32,118, 97,108,117,101,115, 32,102,111,114, 32,101, 97, 99,104, 32,102, +105,101,108,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, + 32,116, 97, 98,108,101, 32,119,105,116,104, 32,116,104,101, 32,102,111,108,108, +111,119,105,110,103, 32,102,105,101,108,100,115, 44, 32,119,104,101,114,101, 32, + 82, 70, 67, 32,110, 97,109,105,110,103, 32, 99,111,110,118,101,110,116,105,111, +110,115, 32,104, 97,118,101, 10, 45, 45, 32, 32, 32, 98,101,101,110, 32,112,114, +101,115,101,114,118,101,100, 58, 10, 45, 45, 32, 32, 32, 32, 32,115, 99,104,101, +109,101, 44, 32, 97,117,116,104,111,114,105,116,121, 44, 32,117,115,101,114,105, +110,102,111, 44, 32,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100, 44, + 32,104,111,115,116, 44, 32,112,111,114,116, 44, 10, 45, 45, 32, 32, 32, 32, 32, +112, 97,116,104, 44, 32,112, 97,114, 97,109,115, 44, 32,113,117,101,114,121, 44, + 32,102,114, 97,103,109,101,110,116, 10, 45, 45, 32, 79, 98,115, 58, 10, 45, 45, + 32, 32, 32,116,104,101, 32,108,101, 97,100,105,110,103, 32, 39, 47, 39, 32,105, +110, 32,123, 47, 60,112, 97,116,104, 62,125, 32,105,115, 32, 99,111,110,115,105, +100,101,114,101,100, 32,112, 97,114,116, 32,111,102, 32, 60,112, 97,116,104, 62, + 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102, +117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 40,117,114,108, 44, 32,100, +101,102, 97,117,108,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,105,110,105,116,105, + 97,108,105,122,101, 32,100,101,102, 97,117,108,116, 32,112, 97,114, 97,109,101, +116,101,114,115, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,114,115,101, +100, 32, 61, 32,123,125, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105, +110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,100,101,102, 97,117,108,116, + 32,111,114, 32,112, 97,114,115,101,100, 41, 32,100,111, 32,112, 97,114,115,101, +100, 91,105, 93, 32, 61, 32,118, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32, +101,109,112,116,121, 32,117,114,108, 32,105,115, 32,112, 97,114,115,101,100, 32, +116,111, 32,110,105,108, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,117,114, +108, 32,111,114, 32,117,114,108, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32, +114,101,116,117,114,110, 32,110,105,108, 44, 32, 34,105,110,118, 97,108,105,100, + 32,117,114,108, 34, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,114,101,109, +111,118,101, 32,119,104,105,116,101,115,112, 97, 99,101, 10, 32, 32, 32, 32, 45, + 45, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, +117,114,108, 44, 32, 34, 37,115, 34, 44, 32, 34, 34, 41, 10, 32, 32, 32, 32, 45, + 45, 32,103,101,116, 32,102,114, 97,103,109,101,110,116, 10, 32, 32, 32, 32,117, +114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,114,108, + 44, 32, 34, 35, 40, 46, 42, 41, 36, 34, 44, 32,102,117,110, 99,116,105,111,110, + 40,102, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115,101,100, 46,102, +114, 97,103,109,101,110,116, 32, 61, 32,102, 10, 32, 32, 32, 32, 32, 32, 32, 32, +114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32, + 32, 32, 32, 45, 45, 32,103,101,116, 32,115, 99,104,101,109,101, 10, 32, 32, 32, + 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117, +114,108, 44, 32, 34, 94, 40, 91, 37,119, 93, 91, 37,119, 37, 43, 37, 45, 37, 46, + 93, 42, 41, 37, 58, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,102,117,110, 99, +116,105,111,110, 40,115, 41, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109, +101, 32, 61, 32,115, 59, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,110,100, + 41, 10, 32, 32, 32, 32, 45, 45, 32,103,101,116, 32, 97,117,116,104,111,114,105, +116,121, 10, 32, 32, 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46, +103,115,117, 98, 40,117,114,108, 44, 32, 34, 94, 47, 47, 40, 91, 94, 47, 93, 42, + 41, 34, 44, 32,102,117,110, 99,116,105,111,110, 40,110, 41, 10, 32, 32, 32, 32, + 32, 32, 32, 32,112, 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121, + 32, 61, 32,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, + 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32, 32, 32, 32, 45, 45, 32,103, +101,116, 32,113,117,101,114,121, 32,115,116,114,105,110,103,105,110,103, 10, 32, + 32, 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, + 40,117,114,108, 44, 32, 34, 37, 63, 40, 46, 42, 41, 34, 44, 32,102,117,110, 99, +116,105,111,110, 40,113, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115, +101,100, 46,113,117,101,114,121, 32, 61, 32,113, 10, 32, 32, 32, 32, 32, 32, 32, + 32,114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, + 32, 32, 32, 32, 45, 45, 32,103,101,116, 32,112, 97,114, 97,109,115, 10, 32, 32, + 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, +117,114,108, 44, 32, 34, 37, 59, 40, 46, 42, 41, 34, 44, 32,102,117,110, 99,116, +105,111,110, 40,112, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115,101, +100, 46,112, 97,114, 97,109,115, 32, 61, 32,112, 10, 32, 32, 32, 32, 32, 32, 32, + 32,114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, + 32, 32, 32, 32, 45, 45, 32,112, 97,116,104, 32,105,115, 32,119,104, 97,116,101, +118,101,114, 32,119, 97,115, 32,108,101,102,116, 10, 32, 32, 32, 32,105,102, 32, +117,114,108, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32,112, 97,114,115,101, +100, 46,112, 97,116,104, 32, 61, 32,117,114,108, 32,101,110,100, 10, 32, 32, 32, + 32,108,111, 99, 97,108, 32, 97,117,116,104,111,114,105,116,121, 32, 61, 32,112, + 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121, 10, 32, 32, 32, 32, +105,102, 32,110,111,116, 32, 97,117,116,104,111,114,105,116,121, 32,116,104,101, +110, 32,114,101,116,117,114,110, 32,112, 97,114,115,101,100, 32,101,110,100, 10, + 32, 32, 32, 32, 97,117,116,104,111,114,105,116,121, 32, 61, 32,115,116,114,105, +110,103, 46,103,115,117, 98, 40, 97,117,116,104,111,114,105,116,121, 44, 34, 94, + 40, 91, 94, 64, 93, 42, 41, 64, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,102, +117,110, 99,116,105,111,110, 40,117, 41, 32,112, 97,114,115,101,100, 46,117,115, +101,114,105,110,102,111, 32, 61, 32,117, 59, 32,114,101,116,117,114,110, 32, 34, + 34, 32,101,110,100, 41, 10, 32, 32, 32, 32, 97,117,116,104,111,114,105,116,121, + 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 97,117,116,104,111, +114,105,116,121, 44, 32, 34, 58, 40, 91, 94, 58, 93, 42, 41, 36, 34, 44, 10, 32, + 32, 32, 32, 32, 32, 32, 32,102,117,110, 99,116,105,111,110, 40,112, 41, 32,112, + 97,114,115,101,100, 46,112,111,114,116, 32, 61, 32,112, 59, 32,114,101,116,117, +114,110, 32, 34, 34, 32,101,110,100, 41, 10, 32, 32, 32, 32,105,102, 32, 97,117, +116,104,111,114,105,116,121, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32,112, + 97,114,115,101,100, 46,104,111,115,116, 32, 61, 32, 97,117,116,104,111,114,105, +116,121, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117,115,101, +114,105,110,102,111, 32, 61, 32,112, 97,114,115,101,100, 46,117,115,101,114,105, +110,102,111, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,117,115,101,114,105, +110,102,111, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,112, 97,114,115, +101,100, 32,101,110,100, 10, 32, 32, 32, 32,117,115,101,114,105,110,102,111, 32, + 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,115,101,114,105,110, +102,111, 44, 32, 34, 58, 40, 91, 94, 58, 93, 42, 41, 36, 34, 44, 10, 32, 32, 32, + 32, 32, 32, 32, 32,102,117,110, 99,116,105,111,110, 40,112, 41, 32,112, 97,114, +115,101,100, 46,112, 97,115,115,119,111,114,100, 32, 61, 32,112, 59, 32,114,101, +116,117,114,110, 32, 34, 34, 32,101,110,100, 41, 10, 32, 32, 32, 32,112, 97,114, +115,101,100, 46,117,115,101,114, 32, 61, 32,117,115,101,114,105,110,102,111, 10, + 32, 32, 32, 32,114,101,116,117,114,110, 32,112, 97,114,115,101,100, 10,101,110, +100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 10, 45, 45, 32, 82,101, 98,117,105,108,100,115, 32, 97, 32,112, 97,114,115,101, +100, 32, 85, 82, 76, 32,102,114,111,109, 32,105,116,115, 32, 99,111,109,112,111, +110,101,110,116,115, 46, 10, 45, 45, 32, 67,111,109,112,111,110,101,110,116,115, + 32, 97,114,101, 32,112,114,111,116,101, 99,116,101,100, 32,105,102, 32, 97,110, +121, 32,114,101,115,101,114,118,101,100, 32,111,114, 32,117,110, 97,108,108,111, +119,101,100, 32, 99,104, 97,114, 97, 99,116,101,114,115, 32, 97,114,101, 32,102, +111,117,110,100, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,112, + 97,114,115,101,100, 58, 32,112, 97,114,115,101,100, 32, 85, 82, 76, 44, 32, 97, +115, 32,114,101,116,117,114,110,101,100, 32, 98,121, 32,112, 97,114,115,101, 10, + 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, 32, 97, 32,115,116, +114,105,110,103,105,110,103, 32,119,105,116,104, 32,116,104,101, 32, 99,111,114, +114,101,115,112,111,110,100,105,110,103, 32, 85, 82, 76, 10, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111, +110, 32, 98,117,105,108,100, 40,112, 97,114,115,101,100, 41, 10, 32, 32, 32, 32, +108,111, 99, 97,108, 32,112,112, 97,116,104, 32, 61, 32,112, 97,114,115,101, 95, +112, 97,116,104, 40,112, 97,114,115,101,100, 46,112, 97,116,104, 32,111,114, 32, + 34, 34, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32, + 98,117,105,108,100, 95,112, 97,116,104, 40,112,112, 97,116,104, 41, 10, 32, 32, + 32, 32,105,102, 32,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,116, +104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46, 32, 34, 59, 34, + 32, 46, 46, 32,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,101,110, +100, 10, 32, 32, 32, 32,105,102, 32,112, 97,114,115,101,100, 46,113,117,101,114, +121, 32,116,104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46, 32, + 34, 63, 34, 32, 46, 46, 32,112, 97,114,115,101,100, 46,113,117,101,114,121, 32, +101,110,100, 10, 9,108,111, 99, 97,108, 32, 97,117,116,104,111,114,105,116,121, + 32, 61, 32,112, 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121, 10, + 9,105,102, 32,112, 97,114,115,101,100, 46,104,111,115,116, 32,116,104,101,110, + 10, 9, 9, 97,117,116,104,111,114,105,116,121, 32, 61, 32,112, 97,114,115,101, +100, 46,104,111,115,116, 10, 9, 9,105,102, 32,112, 97,114,115,101,100, 46,112, +111,114,116, 32,116,104,101,110, 32, 97,117,116,104,111,114,105,116,121, 32, 61, + 32, 97,117,116,104,111,114,105,116,121, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46, + 32,112, 97,114,115,101,100, 46,112,111,114,116, 32,101,110,100, 10, 9, 9,108, +111, 99, 97,108, 32,117,115,101,114,105,110,102,111, 32, 61, 32,112, 97,114,115, +101,100, 46,117,115,101,114,105,110,102,111, 10, 9, 9,105,102, 32,112, 97,114, +115,101,100, 46,117,115,101,114, 32,116,104,101,110, 10, 9, 9, 9,117,115,101, +114,105,110,102,111, 32, 61, 32,112, 97,114,115,101,100, 46,117,115,101,114, 10, + 9, 9, 9,105,102, 32,112, 97,114,115,101,100, 46,112, 97,115,115,119,111,114, +100, 32,116,104,101,110, 10, 9, 9, 9, 9,117,115,101,114,105,110,102,111, 32, + 61, 32,117,115,101,114,105,110,102,111, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46, + 32,112, 97,114,115,101,100, 46,112, 97,115,115,119,111,114,100, 10, 9, 9, 9, +101,110,100, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32,117,115,101,114,105, +110,102,111, 32,116,104,101,110, 32, 97,117,116,104,111,114,105,116,121, 32, 61, + 32,117,115,101,114,105,110,102,111, 32, 46, 46, 32, 34, 64, 34, 32, 46, 46, 32, + 97,117,116,104,111,114,105,116,121, 32,101,110,100, 10, 9,101,110,100, 10, 32, + 32, 32, 32,105,102, 32, 97,117,116,104,111,114,105,116,121, 32,116,104,101,110, + 32,117,114,108, 32, 61, 32, 34, 47, 47, 34, 32, 46, 46, 32, 97,117,116,104,111, +114,105,116,121, 32, 46, 46, 32,117,114,108, 32,101,110,100, 10, 32, 32, 32, 32, +105,102, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109,101, 32,116,104,101, +110, 32,117,114,108, 32, 61, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109, +101, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46, 32,117,114,108, 32,101,110,100, 10, + 32, 32, 32, 32,105,102, 32,112, 97,114,115,101,100, 46,102,114, 97,103,109,101, +110,116, 32,116,104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46, + 32, 34, 35, 34, 32, 46, 46, 32,112, 97,114,115,101,100, 46,102,114, 97,103,109, +101,110,116, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,117,114,108, 32, 61, + 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,114,108, 44, 32, 34, 37, +115, 34, 44, 32, 34, 34, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,117, +114,108, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 10, 45, 45, 32, 66,117,105,108,100,115, 32, 97, 32, 97, 98, +115,111,108,117,116,101, 32, 85, 82, 76, 32,102,114,111,109, 32, 97, 32, 98, 97, +115,101, 32, 97,110,100, 32, 97, 32,114,101,108, 97,116,105,118,101, 32, 85, 82, + 76, 32, 97, 99, 99,111,114,100,105,110,103, 32,116,111, 32, 82, 70, 67, 32, 50, + 51, 57, 54, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32, 98, 97, +115,101, 95,117,114,108, 10, 45, 45, 32, 32, 32,114,101,108, 97,116,105,118,101, + 95,117,114,108, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, + 32, 99,111,114,114,101,115,112,111,110,100,105,110,103, 32, 97, 98,115,111,108, +117,116,101, 32,117,114,108, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110, 32, 97, 98,115,111,108, +117,116,101, 40, 98, 97,115,101, 95,117,114,108, 44, 32,114,101,108, 97,116,105, +118,101, 95,117,114,108, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46, +116,121,112,101, 40, 98, 97,115,101, 95,117,114,108, 41, 32, 61, 61, 32, 34,116, + 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, + 97,115,101, 95,112, 97,114,115,101,100, 32, 61, 32, 98, 97,115,101, 95,117,114, +108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 95,117,114,108, 32, 61, + 32, 98,117,105,108,100, 40, 98, 97,115,101, 95,112, 97,114,115,101,100, 41, 10, + 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115, +101, 95,112, 97,114,115,101,100, 32, 61, 32,112, 97,114,115,101, 40, 98, 97,115, +101, 95,117,114,108, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108, +111, 99, 97,108, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, + 32, 61, 32,112, 97,114,115,101, 40,114,101,108, 97,116,105,118,101, 95,117,114, +108, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 98, 97,115,101, 95,112, + 97,114,115,101,100, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,114,101, +108, 97,116,105,118,101, 95,117,114,108, 10, 32, 32, 32, 32,101,108,115,101,105, +102, 32,110,111,116, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101, +100, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 95,117, +114,108, 10, 32, 32, 32, 32,101,108,115,101,105,102, 32,114,101,108, 97,116,105, +118,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101,109,101, 32,116,104,101, +110, 32,114,101,116,117,114,110, 32,114,101,108, 97,116,105,118,101, 95,117,114, +108, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,114, +101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101,109, +101, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101, +109,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101, +108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46, 97,117,116,104,111,114, +105,116,121, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46, 97,117,116, +104,111,114,105,116,121, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, + 46, 97,117,116,104,111,114,105,116,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116,105,118,101, 95,112, + 97,114,115,101,100, 46,112, 97,116,104, 32,116,104,101,110, 10, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, + 95,112, 97,114,115,101,100, 46,112, 97,116,104, 32, 61, 32, 98, 97,115,101, 95, +112, 97,114,115,101,100, 46,112, 97,116,104, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116, +105,118,101, 95,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,116,104, +101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46,112, + 97,114, 97,109,115, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, 46, +112, 97,114, 97,109,115, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116,105, +118,101, 95,112, 97,114,115,101,100, 46,113,117,101,114,121, 32,116,104,101,110, + 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, + 46,113,117,101,114,121, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, + 46,113,117,101,114,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,101,108,115,101, 32, 32, 32, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114, +115,101,100, 46,112, 97,116,104, 32, 61, 32, 97, 98,115,111,108,117,116,101, 95, +112, 97,116,104, 40, 98, 97,115,101, 95,112, 97,114,115,101,100, 46,112, 97,116, +104, 32,111,114, 32, 34, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97, +114,115,101,100, 46,112, 97,116,104, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, + 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 98,117,105,108,100, 40, +114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 41, 10, 32, 32, 32, + 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 66,114,101, 97,107,115, 32, 97, 32, +112, 97,116,104, 32,105,110,116,111, 32,105,116,115, 32,115,101,103,109,101,110, +116,115, 44, 32,117,110,101,115, 99, 97,112,105,110,103, 32,116,104,101, 32,115, +101,103,109,101,110,116,115, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, + 32, 32,112, 97,116,104, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, + 32, 32, 32,115,101,103,109,101,110,116, 58, 32, 97, 32,116, 97, 98,108,101, 32, +119,105,116,104, 32,111,110,101, 32,101,110,116,114,121, 32,112,101,114, 32,115, +101,103,109,101,110,116, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 95, +112, 97,116,104, 40,112, 97,116,104, 41, 10, 9,108,111, 99, 97,108, 32,112, 97, +114,115,101,100, 32, 61, 32,123,125, 10, 9,112, 97,116,104, 32, 61, 32,112, 97, +116,104, 32,111,114, 32, 34, 34, 10, 9, 45, 45,112, 97,116,104, 32, 61, 32,115, +116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104, 44, 32, 34, 37,115, + 34, 44, 32, 34, 34, 41, 10, 9,115,116,114,105,110,103, 46,103,115,117, 98, 40, +112, 97,116,104, 44, 32, 34, 40, 91, 94, 47, 93, 43, 41, 34, 44, 32,102,117,110, + 99,116,105,111,110, 32, 40,115, 41, 32,116, 97, 98,108,101, 46,105,110,115,101, +114,116, 40,112, 97,114,115,101,100, 44, 32,115, 41, 32,101,110,100, 41, 10, 9, +102,111,114, 32,105, 32, 61, 32, 49, 44, 32,116, 97, 98,108,101, 46,103,101,116, +110, 40,112, 97,114,115,101,100, 41, 32,100,111, 10, 9, 9,112, 97,114,115,101, +100, 91,105, 93, 32, 61, 32,117,110,101,115, 99, 97,112,101, 40,112, 97,114,115, +101,100, 91,105, 93, 41, 10, 9,101,110,100, 10, 9,105,102, 32,115,116,114,105, +110,103, 46,115,117, 98, 40,112, 97,116,104, 44, 32, 49, 44, 32, 49, 41, 32, 61, + 61, 32, 34, 47, 34, 32,116,104,101,110, 32,112, 97,114,115,101,100, 46,105,115, + 95, 97, 98,115,111,108,117,116,101, 32, 61, 32, 49, 32,101,110,100, 10, 9,105, +102, 32,115,116,114,105,110,103, 46,115,117, 98, 40,112, 97,116,104, 44, 32, 45, + 49, 44, 32, 45, 49, 41, 32, 61, 61, 32, 34, 47, 34, 32,116,104,101,110, 32,112, + 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114,121, 32, 61, + 32, 49, 32,101,110,100, 10, 9,114,101,116,117,114,110, 32,112, 97,114,115,101, +100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 10, 45, 45, 32, 66,117,105,108,100,115, 32, 97, 32,112, 97,116, +104, 32, 99,111,109,112,111,110,101,110,116, 32,102,114,111,109, 32,105,116,115, + 32,115,101,103,109,101,110,116,115, 44, 32,101,115, 99, 97,112,105,110,103, 32, +112,114,111,116,101, 99,116,101,100, 32, 99,104, 97,114, 97, 99,116,101,114,115, + 46, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,112, 97,114,115, +101,100, 58, 32,112, 97,116,104, 32,115,101,103,109,101,110,116,115, 10, 45, 45, + 32, 32, 32,117,110,115, 97,102,101, 58, 32,105,102, 32,116,114,117,101, 44, 32, +115,101,103,109,101,110,116,115, 32, 97,114,101, 32,110,111,116, 32,112,114,111, +116,101, 99,116,101,100, 32, 98,101,102,111,114,101, 32,112, 97,116,104, 32,105, +115, 32, 98,117,105,108,116, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, + 45, 32, 32, 32,112, 97,116,104, 58, 32, 99,111,114,114,101,115,112,111,110,100, +105,110,103, 32,112, 97,116,104, 32,115,116,114,105,110,103,105,110,103, 10, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, + 99,116,105,111,110, 32, 98,117,105,108,100, 95,112, 97,116,104, 40,112, 97,114, +115,101,100, 44, 32,117,110,115, 97,102,101, 41, 10, 9,108,111, 99, 97,108, 32, +112, 97,116,104, 32, 61, 32, 34, 34, 10, 9,108,111, 99, 97,108, 32,110, 32, 61, + 32,116, 97, 98,108,101, 46,103,101,116,110, 40,112, 97,114,115,101,100, 41, 10, + 9,105,102, 32,117,110,115, 97,102,101, 32,116,104,101,110, 10, 9, 9,102,111, +114, 32,105, 32, 61, 32, 49, 44, 32,110, 45, 49, 32,100,111, 10, 9, 9, 9,112, + 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32,112, 97,114,115,101,100, + 91,105, 93, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, + 46, 32, 34, 47, 34, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32,110, 32, 62, + 32, 48, 32,116,104,101,110, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97, +116,104, 32, 46, 46, 32,112, 97,114,115,101,100, 91,110, 93, 10, 9, 9, 9,105, +102, 32,112, 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114, +121, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, + 46, 32, 34, 47, 34, 32,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,108,115, +101, 10, 9, 9,102,111,114, 32,105, 32, 61, 32, 49, 44, 32,110, 45, 49, 32,100, +111, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32, +112,114,111,116,101, 99,116, 95,115,101,103,109,101,110,116, 40,112, 97,114,115, +101,100, 91,105, 93, 41, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116, +104, 32, 46, 46, 32, 34, 47, 34, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32, +110, 32, 62, 32, 48, 32,116,104,101,110, 10, 9, 9, 9,112, 97,116,104, 32, 61, + 32,112, 97,116,104, 32, 46, 46, 32,112,114,111,116,101, 99,116, 95,115,101,103, +109,101,110,116, 40,112, 97,114,115,101,100, 91,110, 93, 41, 10, 9, 9, 9,105, +102, 32,112, 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114, +121, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, + 46, 32, 34, 47, 34, 32,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,110,100, + 10, 9,105,102, 32,112, 97,114,115,101,100, 46,105,115, 95, 97, 98,115,111,108, +117,116,101, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32, 34, 47, 34, 32, + 46, 46, 32,112, 97,116,104, 32,101,110,100, 10, 9,114,101,116,117,114,110, 32, +112, 97,116,104, 10,101,110,100, 10, +}; + + if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"url.lua")==0) lua_call(L, 0, 0); +} diff --git a/src/libraries/luasocket/luasocket.cpp b/src/libraries/luasocket/luasocket.cpp index 9239753d4..5f0282b41 100644 --- a/src/libraries/luasocket/luasocket.cpp +++ b/src/libraries/luasocket/luasocket.cpp @@ -1,120 +1,120 @@ -/** -* Copyright (c) 2006-2012 LOVE Development Team -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -**/ - -#include "luasocket.h" - -// LuaSocket -extern "C" { -#include "libluasocket/luasocket.h" -#include "libluasocket/mime.h" -} - -// Quick macro for adding functions to -// the preloder. -#define PRELOAD(name, function) \ - lua_getglobal(L, "package"); \ - lua_getfield(L, -1, "preload"); \ - lua_pushcfunction(L, function); \ - lua_setfield(L, -2, name); \ - lua_pop(L, 2); - -namespace love -{ -namespace luasocket -{ - int __open(lua_State * L) - { - - // Preload code from LuaSocket. - PRELOAD("socket.core", luaopen_socket_core); - PRELOAD("mime.core", luaopen_mime_core); - - PRELOAD("socket", __open_luasocket_socket); - PRELOAD("socket.ftp", __open_luasocket_ftp) - PRELOAD("socket.http", __open_luasocket_http); - PRELOAD("ltn12", __open_luasocket_ltn12); - PRELOAD("mime", __open_luasocket_mime) - PRELOAD("socket.smtp", __open_luasocket_smtp); - PRELOAD("socket.tp", __open_luasocket_tp) - PRELOAD("socket.url", __open_luasocket_url) - - // No need to register garbage collector function. - - return 0; - } - - int __open_luasocket_socket(lua_State * L) - { - #include "libluasocket/socket.lua.h" - lua_getglobal(L, "socket"); - return 1; - } - - int __open_luasocket_ftp(lua_State * L) - { - #include "libluasocket/ftp.lua.h" - lua_getglobal(L, "socket.ftp"); - return 1; - } - - int __open_luasocket_http(lua_State * L) - { - #include "libluasocket/http.lua.h" - lua_getglobal(L, "socket.http"); - return 1; - } - - int __open_luasocket_ltn12(lua_State * L) - { - #include "libluasocket/ltn12.lua.h" - lua_getglobal(L, "ltn12"); - return 1; - } - - int __open_luasocket_mime(lua_State * L) - { - #include "libluasocket/mime.lua.h" - lua_getglobal(L, "mime"); - return 1; - } - - int __open_luasocket_smtp(lua_State * L) - { - #include "libluasocket/smtp.lua.h" - lua_getglobal(L, "socket.smtp"); - return 1; - } - - int __open_luasocket_tp(lua_State * L) - { - #include "libluasocket/tp.lua.h" - lua_getglobal(L, "socket.tp"); - return 1; - } - - int __open_luasocket_url(lua_State * L) - { - #include "libluasocket/url.lua.h" - lua_getglobal(L, "socket.url"); - return 1; - } - -} // luasocket -} // love +/** +* Copyright (c) 2006-2012 LOVE Development Team +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +**/ + +#include "luasocket.h" + +// LuaSocket +extern "C" { +#include "libluasocket/luasocket.h" +#include "libluasocket/mime.h" +} + +// Quick macro for adding functions to +// the preloder. +#define PRELOAD(name, function) \ + lua_getglobal(L, "package"); \ + lua_getfield(L, -1, "preload"); \ + lua_pushcfunction(L, function); \ + lua_setfield(L, -2, name); \ + lua_pop(L, 2); + +namespace love +{ +namespace luasocket +{ + int __open(lua_State * L) + { + + // Preload code from LuaSocket. + PRELOAD("socket.core", luaopen_socket_core); + PRELOAD("mime.core", luaopen_mime_core); + + PRELOAD("socket", __open_luasocket_socket); + PRELOAD("socket.ftp", __open_luasocket_ftp) + PRELOAD("socket.http", __open_luasocket_http); + PRELOAD("ltn12", __open_luasocket_ltn12); + PRELOAD("mime", __open_luasocket_mime) + PRELOAD("socket.smtp", __open_luasocket_smtp); + PRELOAD("socket.tp", __open_luasocket_tp) + PRELOAD("socket.url", __open_luasocket_url) + + // No need to register garbage collector function. + + return 0; + } + + int __open_luasocket_socket(lua_State * L) + { + #include "libluasocket/socket.lua.h" + lua_getglobal(L, "socket"); + return 1; + } + + int __open_luasocket_ftp(lua_State * L) + { + #include "libluasocket/ftp.lua.h" + lua_getglobal(L, "socket.ftp"); + return 1; + } + + int __open_luasocket_http(lua_State * L) + { + #include "libluasocket/http.lua.h" + lua_getglobal(L, "socket.http"); + return 1; + } + + int __open_luasocket_ltn12(lua_State * L) + { + #include "libluasocket/ltn12.lua.h" + lua_getglobal(L, "ltn12"); + return 1; + } + + int __open_luasocket_mime(lua_State * L) + { + #include "libluasocket/mime.lua.h" + lua_getglobal(L, "mime"); + return 1; + } + + int __open_luasocket_smtp(lua_State * L) + { + #include "libluasocket/smtp.lua.h" + lua_getglobal(L, "socket.smtp"); + return 1; + } + + int __open_luasocket_tp(lua_State * L) + { + #include "libluasocket/tp.lua.h" + lua_getglobal(L, "socket.tp"); + return 1; + } + + int __open_luasocket_url(lua_State * L) + { + #include "libluasocket/url.lua.h" + lua_getglobal(L, "socket.url"); + return 1; + } + +} // luasocket +} // love diff --git a/src/libraries/luasocket/luasocket.h b/src/libraries/luasocket/luasocket.h index c42c42e3b..4b2313829 100644 --- a/src/libraries/luasocket/luasocket.h +++ b/src/libraries/luasocket/luasocket.h @@ -1,48 +1,48 @@ -/** -* Copyright (c) 2006-2012 LOVE Development Team -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -**/ - -#ifndef LOVE_LUASOCKET_LUASOCKET_H -#define LOVE_LUASOCKET_LUASOCKET_H - -// LOVE -#include - -namespace love -{ -namespace luasocket -{ - int __open(lua_State * L); - - // Loaders for all lua files. We want to be able - // to load these dynamically. (Identical in the LuaSocket - // documentation. These functions wrap the parsing of code, etc). - int __open_luasocket_socket(lua_State * L); - int __open_luasocket_ftp(lua_State * L); - int __open_luasocket_http(lua_State * L); - int __open_luasocket_ltn12(lua_State * L); - int __open_luasocket_mime(lua_State * L); - int __open_luasocket_smtp(lua_State * L); - int __open_luasocket_tp(lua_State * L); - int __open_luasocket_url(lua_State * L); - -} // luasocket -} // love - -#endif // LOVE_LUASOCKET_LUASOCKET_H +/** +* Copyright (c) 2006-2012 LOVE Development Team +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +**/ + +#ifndef LOVE_LUASOCKET_LUASOCKET_H +#define LOVE_LUASOCKET_LUASOCKET_H + +// LOVE +#include + +namespace love +{ +namespace luasocket +{ + int __open(lua_State * L); + + // Loaders for all lua files. We want to be able + // to load these dynamically. (Identical in the LuaSocket + // documentation. These functions wrap the parsing of code, etc). + int __open_luasocket_socket(lua_State * L); + int __open_luasocket_ftp(lua_State * L); + int __open_luasocket_http(lua_State * L); + int __open_luasocket_ltn12(lua_State * L); + int __open_luasocket_mime(lua_State * L); + int __open_luasocket_smtp(lua_State * L); + int __open_luasocket_tp(lua_State * L); + int __open_luasocket_url(lua_State * L); + +} // luasocket +} // love + +#endif // LOVE_LUASOCKET_LUASOCKET_H diff --git a/src/libraries/utf8/utf8.h b/src/libraries/utf8/utf8.h index 4e4451403..82b13f59f 100644 --- a/src/libraries/utf8/utf8.h +++ b/src/libraries/utf8/utf8.h @@ -1,34 +1,34 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include "utf8/checked.h" -#include "utf8/unchecked.h" - -#endif // header guard +// Copyright 2006 Nemanja Trifunovic + +/* +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ + + +#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 +#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 + +#include "utf8/checked.h" +#include "utf8/unchecked.h" + +#endif // header guard diff --git a/src/libraries/utf8/utf8/checked.h b/src/libraries/utf8/utf8/checked.h index 9cb8d2c7f..b6a5f9d84 100644 --- a/src/libraries/utf8/utf8/checked.h +++ b/src/libraries/utf8/utf8/checked.h @@ -161,12 +161,12 @@ namespace utf8 template uint32_t prior(octet_iterator& it, octet_iterator start) - { + { // can't do much if it == start - if (it == start) + if (it == start) throw not_enough_room(); - octet_iterator end = it; + octet_iterator end = it; // Go back until we hit either a lead octet or start while (internal::is_trail(*(--it))) if (it == start) diff --git a/src/love.cpp b/src/love.cpp index 9c8f583b6..51bd5b656 100644 --- a/src/love.cpp +++ b/src/love.cpp @@ -1,205 +1,205 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "modules/love/love.h" -#include - -#ifdef LOVE_BUILD_EXE - -// Lua -extern "C" { - #include - #include - #include -} - -#ifdef LOVE_WINDOWS -#include -#endif // LOVE_WINDOWS - -#ifdef LOVE_LEGENDARY_UTF8_ARGV_HACK - -void get_utf8_arguments(int &argc, char **&argv) -{ - LPWSTR cmd = GetCommandLineW(); - - if (!cmd) - return; - - LPWSTR *argv_w = CommandLineToArgvW(cmd, &argc); - - argv = new char *[argc]; - - for (int i = 0; i < argc; ++i) - { - // Size of wide char buffer (plus one for trailing '\0'). - size_t wide_len = wcslen(argv_w[i]) + 1; - - // Get size in UTF-8. - int utf8_size = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], wide_len, argv[i], 0, 0, 0); - - argv[i] = new char[utf8_size]; - - // Convert to UTF-8. - int ok = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], wide_len, argv[i], utf8_size, 0, 0); - - int len = strlen(argv[i]); - - if (!ok) - printf("Warning: could not convert to UTF8.\n"); - } - - LocalFree(argv_w); -} - -#endif // LOVE_LEGENDARY_UTF8_ARGV_HACK - -#ifdef LOVE_LEGENDARY_LIBSTDCXX_HACK - -#include - -// Workarounds for symbols that are missing from Leopard stdlibc++.dylib. -// http://stackoverflow.com/questions/3484043/os-x-program-runs-on-dev-machine-crashing-horribly-on-others -_GLIBCXX_BEGIN_NAMESPACE(std) -// From ostream_insert.h -template ostream& __ostream_insert(ostream&, const char*, streamsize); - -#ifdef _GLIBCXX_USE_WCHAR_T -template wostream& __ostream_insert(wostream&, const wchar_t*, streamsize); -#endif - -// From ostream.tcc -template ostream& ostream::_M_insert(long); -template ostream& ostream::_M_insert(unsigned long); -template ostream& ostream::_M_insert(bool); -#ifdef _GLIBCXX_USE_LONG_LONG -template ostream& ostream::_M_insert(long long); -template ostream& ostream::_M_insert(unsigned long long); -#endif -template ostream& ostream::_M_insert(double); -template ostream& ostream::_M_insert(long double); -template ostream& ostream::_M_insert(const void*); - -#ifdef _GLIBCXX_USE_WCHAR_T -template wostream& wostream::_M_insert(long); -template wostream& wostream::_M_insert(unsigned long); -template wostream& wostream::_M_insert(bool); -#ifdef _GLIBCXX_USE_LONG_LONG -template wostream& wostream::_M_insert(long long); -template wostream& wostream::_M_insert(unsigned long long); -#endif -template wostream& wostream::_M_insert(double); -template wostream& wostream::_M_insert(long double); -template wostream& wostream::_M_insert(const void*); -#endif - -_GLIBCXX_END_NAMESPACE - -#endif // LOVE_LEGENDARY_LIBSTDCXX_HACK - -static int love_preload(lua_State *L, lua_CFunction f, const char *name) -{ - lua_getglobal(L, "package"); - lua_getfield(L, -1, "preload"); - lua_pushcfunction(L, f); - lua_setfield(L, -2, name); - lua_pop(L, 2); - return 0; -} - -int main(int argc, char **argv) -{ -#ifdef LOVE_LEGENDARY_UTF8_ARGV_HACK - int hack_argc = 0; char **hack_argv = 0; - get_utf8_arguments(hack_argc, hack_argv); - argc = hack_argc; - argv = hack_argv; -#endif // LOVE_LEGENDARY_UTF8_ARGV_HACK - - // Oh, you just want the version? Okay! - if (argc > 1 && strcmp(argv[1],"--version") == 0) - { - printf("LOVE %s (%s)\n", love_version(), love_codename()); - return 0; - } - - // Create the virtual machine. - lua_State *L = lua_open(); - luaL_openlibs(L); - - love_preload(L, luaopen_love, "love"); - - luaopen_love(L); - - // Add command line arguments to global arg (like stand-alone Lua). - { - lua_newtable(L); - - if (argc > 0) - { - lua_pushstring(L, argv[0]); - lua_rawseti(L, -2, -2); - } - - lua_pushstring(L, "embedded boot.lua"); - lua_rawseti(L, -2, -1); - - for (int i = 1; i + +#ifdef LOVE_BUILD_EXE + +// Lua +extern "C" { + #include + #include + #include +} + +#ifdef LOVE_WINDOWS +#include +#endif // LOVE_WINDOWS + +#ifdef LOVE_LEGENDARY_UTF8_ARGV_HACK + +void get_utf8_arguments(int &argc, char **&argv) +{ + LPWSTR cmd = GetCommandLineW(); + + if (!cmd) + return; + + LPWSTR *argv_w = CommandLineToArgvW(cmd, &argc); + + argv = new char *[argc]; + + for (int i = 0; i < argc; ++i) + { + // Size of wide char buffer (plus one for trailing '\0'). + size_t wide_len = wcslen(argv_w[i]) + 1; + + // Get size in UTF-8. + int utf8_size = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], wide_len, argv[i], 0, 0, 0); + + argv[i] = new char[utf8_size]; + + // Convert to UTF-8. + int ok = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], wide_len, argv[i], utf8_size, 0, 0); + + int len = strlen(argv[i]); + + if (!ok) + printf("Warning: could not convert to UTF8.\n"); + } + + LocalFree(argv_w); +} + +#endif // LOVE_LEGENDARY_UTF8_ARGV_HACK + +#ifdef LOVE_LEGENDARY_LIBSTDCXX_HACK + +#include + +// Workarounds for symbols that are missing from Leopard stdlibc++.dylib. +// http://stackoverflow.com/questions/3484043/os-x-program-runs-on-dev-machine-crashing-horribly-on-others +_GLIBCXX_BEGIN_NAMESPACE(std) +// From ostream_insert.h +template ostream& __ostream_insert(ostream&, const char*, streamsize); + +#ifdef _GLIBCXX_USE_WCHAR_T +template wostream& __ostream_insert(wostream&, const wchar_t*, streamsize); +#endif + +// From ostream.tcc +template ostream& ostream::_M_insert(long); +template ostream& ostream::_M_insert(unsigned long); +template ostream& ostream::_M_insert(bool); +#ifdef _GLIBCXX_USE_LONG_LONG +template ostream& ostream::_M_insert(long long); +template ostream& ostream::_M_insert(unsigned long long); +#endif +template ostream& ostream::_M_insert(double); +template ostream& ostream::_M_insert(long double); +template ostream& ostream::_M_insert(const void*); + +#ifdef _GLIBCXX_USE_WCHAR_T +template wostream& wostream::_M_insert(long); +template wostream& wostream::_M_insert(unsigned long); +template wostream& wostream::_M_insert(bool); +#ifdef _GLIBCXX_USE_LONG_LONG +template wostream& wostream::_M_insert(long long); +template wostream& wostream::_M_insert(unsigned long long); +#endif +template wostream& wostream::_M_insert(double); +template wostream& wostream::_M_insert(long double); +template wostream& wostream::_M_insert(const void*); +#endif + +_GLIBCXX_END_NAMESPACE + +#endif // LOVE_LEGENDARY_LIBSTDCXX_HACK + +static int love_preload(lua_State *L, lua_CFunction f, const char *name) +{ + lua_getglobal(L, "package"); + lua_getfield(L, -1, "preload"); + lua_pushcfunction(L, f); + lua_setfield(L, -2, name); + lua_pop(L, 2); + return 0; +} + +int main(int argc, char **argv) +{ +#ifdef LOVE_LEGENDARY_UTF8_ARGV_HACK + int hack_argc = 0; char **hack_argv = 0; + get_utf8_arguments(hack_argc, hack_argv); + argc = hack_argc; + argv = hack_argv; +#endif // LOVE_LEGENDARY_UTF8_ARGV_HACK + + // Oh, you just want the version? Okay! + if (argc > 1 && strcmp(argv[1],"--version") == 0) + { + printf("LOVE %s (%s)\n", love_version(), love_codename()); + return 0; + } + + // Create the virtual machine. + lua_State *L = lua_open(); + luaL_openlibs(L); + + love_preload(L, luaopen_love, "love"); + + luaopen_love(L); + + // Add command line arguments to global arg (like stand-alone Lua). + { + lua_newtable(L); + + if (argc > 0) + { + lua_pushstring(L, argv[0]); + lua_rawseti(L, -2, -2); + } + + lua_pushstring(L, "embedded boot.lua"); + lua_rawseti(L, -2, -1); + + for (int i = 1; i::Entry Audio::distanceModelEntries[] = -{ - {"none", Audio::DISTANCE_NONE}, - {"inverse", Audio::DISTANCE_INVERSE}, - {"inverse clamped", Audio::DISTANCE_INVERSE_CLAMPED}, - {"linear", Audio::DISTANCE_LINEAR}, - {"linear clamped", Audio::DISTANCE_LINEAR_CLAMPED}, - {"exponent", Audio::DISTANCE_EXPONENT}, - {"exponent clamped", Audio::DISTANCE_EXPONENT_CLAMPED} -}; - -StringMap Audio::distanceModels(Audio::distanceModelEntries, sizeof(Audio::distanceModelEntries)); - -bool Audio::getConstant(const char *in, DistanceModel &out) -{ - return distanceModels.find(in, out); -} - -bool Audio::getConstant(DistanceModel in, const char *&out) -{ - return distanceModels.find(in, out); -} - -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered Audio versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any Audio distribution. + **/ + +#include "Audio.h" + +namespace love +{ +namespace audio +{ + +StringMap::Entry Audio::distanceModelEntries[] = +{ + {"none", Audio::DISTANCE_NONE}, + {"inverse", Audio::DISTANCE_INVERSE}, + {"inverse clamped", Audio::DISTANCE_INVERSE_CLAMPED}, + {"linear", Audio::DISTANCE_LINEAR}, + {"linear clamped", Audio::DISTANCE_LINEAR_CLAMPED}, + {"exponent", Audio::DISTANCE_EXPONENT}, + {"exponent clamped", Audio::DISTANCE_EXPONENT_CLAMPED} +}; + +StringMap Audio::distanceModels(Audio::distanceModelEntries, sizeof(Audio::distanceModelEntries)); + +bool Audio::getConstant(const char *in, DistanceModel &out) +{ + return distanceModels.find(in, out); +} + +bool Audio::getConstant(DistanceModel in, const char *&out) +{ + return distanceModels.find(in, out); +} + +} // audio +} // love diff --git a/src/modules/audio/Audio.h b/src/modules/audio/Audio.h index 1e5dfce91..efad04a80 100644 --- a/src/modules/audio/Audio.h +++ b/src/modules/audio/Audio.h @@ -1,239 +1,239 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented = 0; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_AUDIO_H -#define LOVE_AUDIO_AUDIO_H - -#include "common/Module.h" -#include "common/StringMap.h" -#include "Source.h" - -namespace love -{ - -namespace sound -{ - -class Decoder; -class SoundData; - -} // sound - -namespace audio -{ - -/** - * The Audio module is responsible for playing back raw sound samples. - **/ -class Audio : public Module -{ -public: - - /** - * Attenuation by distance. - */ - enum DistanceModel - { - DISTANCE_NONE = 1, - DISTANCE_INVERSE, - DISTANCE_INVERSE_CLAMPED, - DISTANCE_LINEAR, - DISTANCE_LINEAR_CLAMPED, - DISTANCE_EXPONENT, - DISTANCE_EXPONENT_CLAMPED, - DISTANCE_MAX_ENUM - }; - - static bool getConstant(const char *in, DistanceModel &out); - static bool getConstant(DistanceModel in, const char *&out); - - /** - * Destructor. - **/ - virtual ~Audio() {}; - - virtual Source *newSource(love::sound::Decoder *decoder) = 0; - virtual Source *newSource(love::sound::SoundData *soundData) = 0; - - /** - * Gets the current number of simultaneous playing sources. - * @return The current number of simultaneous playing sources. - **/ - virtual int getNumSources() const = 0; - - /** - * Gets the maximum supported number of simultaneous playing sources. - * @return The maximum supported number of simultaneous playing sources. - **/ - virtual int getMaxSources() const = 0; - - /** - * Play the specified Source. - * @param source The Source to play. - **/ - virtual void play(Source *source) = 0; - - /** - * Stops playback on the specified source. - * @param source The source on which to stop the playback. - **/ - virtual void stop(Source *source) = 0; - - /** - * Stops all playing audio. - **/ - virtual void stop() = 0; - - /** - * Pauses playback on the specified source. - * @param source The source on which to pause the playback. - **/ - virtual void pause(Source *source) = 0; - - /** - * Pauses all audio. - **/ - virtual void pause() = 0; - - /** - * Resumes playback on the specified source. - * @param source The source on which to resume the playback. - **/ - virtual void resume(Source *source) = 0; - - /** - * Resumes all audio. - **/ - virtual void resume() = 0; - - /** - * Rewinds the specified source. Whatever is playing on this - * source gets rewound to the start. - * @param source The source to rewind. - **/ - virtual void rewind(Source *source) = 0; - - /** - * Rewinds all playing audio. - **/ - virtual void rewind() = 0; - - /** - * Sets the master volume, where 0.0f is min (off) and 1.0f is max. - * @param volume The new master volume. - **/ - virtual void setVolume(float volume) = 0; - - /** - * Gets the master volume. - * @return The current master volume. - **/ - virtual float getVolume() const = 0; - - /** - * Gets the position of the listener. - * @param v A float array of size 3 containing (x,y,z) in that order. - **/ - virtual void getPosition(float *v) const = 0; - - /** - * Sets the position of the listener. - * @param v A float array of size 3 containing [x,y,z] in that order. - **/ - virtual void setPosition(float *v) = 0; - - /** - * Gets the orientation of the listener. - * @param v A float array of size 6 containing [x,y,z] for the forward - * vector, followed by [x,y,z] for the up vector. - **/ - virtual void getOrientation(float *v) const = 0; - - /** - * Sets the orientation of the listener. - * @param v A float array of size 6 containing [x,y,z] for the forward - * vector, followed by [x,y,z] for the up vector. - **/ - virtual void setOrientation(float *v) = 0; - - /** - * Gets the velocity of the listener. - * @param v A float array of size 3 containing [x,y,z] in that order. - **/ - virtual void getVelocity(float *v) const = 0; - - /** - * Sets the velocity of the listener. - * @param v A float array of size 3 containing [x,y,z] in that order. - **/ - virtual void setVelocity(float *v) = 0; - - /** - * Begins recording audio input from the microphone. - **/ - virtual void record() = 0; - - /** - * Gets a section of recorded audio. - * Per OpenAL, the measurement begins from the start of the - * audio data in memory, which is after the last time this function - * was called. If this function has not been called yet this recording - * session, it just grabs from the beginning. - * @return All the recorded SoundData thus far. - **/ - virtual love::sound::SoundData *getRecordedData() = 0; - - /** - * Stops recording and, if passed true, returns all the recorded audio - * not already gotten by getRecordedData. - * @param returnData Whether to return recorded audio. - * @return if returnData, all the recorded audio yet to be gotten, - * otherwise NULL. - **/ - virtual love::sound::SoundData *stopRecording(bool returnData) = 0; - - /** - * Checks whether LOVE is able to record audio input. - * @return hasMic Whether LOVE has a microphone enabled. - **/ - virtual bool canRecord() = 0; - - /** - * Gets the distance model used for attenuation. - * @return Distance model. - */ - virtual DistanceModel getDistanceModel() const = 0; - - /** - * Sets the distance model used for attenuation. - * @param distanceModel Distance model. - */ - virtual void setDistanceModel(DistanceModel distanceModel) = 0; - -private: - - static StringMap::Entry distanceModelEntries[]; - static StringMap distanceModels; -}; // Audio - -} // audio -} // love - -#endif // LOVE_AUDIO_AUDIO_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented = 0; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_AUDIO_H +#define LOVE_AUDIO_AUDIO_H + +#include "common/Module.h" +#include "common/StringMap.h" +#include "Source.h" + +namespace love +{ + +namespace sound +{ + +class Decoder; +class SoundData; + +} // sound + +namespace audio +{ + +/** + * The Audio module is responsible for playing back raw sound samples. + **/ +class Audio : public Module +{ +public: + + /** + * Attenuation by distance. + */ + enum DistanceModel + { + DISTANCE_NONE = 1, + DISTANCE_INVERSE, + DISTANCE_INVERSE_CLAMPED, + DISTANCE_LINEAR, + DISTANCE_LINEAR_CLAMPED, + DISTANCE_EXPONENT, + DISTANCE_EXPONENT_CLAMPED, + DISTANCE_MAX_ENUM + }; + + static bool getConstant(const char *in, DistanceModel &out); + static bool getConstant(DistanceModel in, const char *&out); + + /** + * Destructor. + **/ + virtual ~Audio() {}; + + virtual Source *newSource(love::sound::Decoder *decoder) = 0; + virtual Source *newSource(love::sound::SoundData *soundData) = 0; + + /** + * Gets the current number of simultaneous playing sources. + * @return The current number of simultaneous playing sources. + **/ + virtual int getNumSources() const = 0; + + /** + * Gets the maximum supported number of simultaneous playing sources. + * @return The maximum supported number of simultaneous playing sources. + **/ + virtual int getMaxSources() const = 0; + + /** + * Play the specified Source. + * @param source The Source to play. + **/ + virtual void play(Source *source) = 0; + + /** + * Stops playback on the specified source. + * @param source The source on which to stop the playback. + **/ + virtual void stop(Source *source) = 0; + + /** + * Stops all playing audio. + **/ + virtual void stop() = 0; + + /** + * Pauses playback on the specified source. + * @param source The source on which to pause the playback. + **/ + virtual void pause(Source *source) = 0; + + /** + * Pauses all audio. + **/ + virtual void pause() = 0; + + /** + * Resumes playback on the specified source. + * @param source The source on which to resume the playback. + **/ + virtual void resume(Source *source) = 0; + + /** + * Resumes all audio. + **/ + virtual void resume() = 0; + + /** + * Rewinds the specified source. Whatever is playing on this + * source gets rewound to the start. + * @param source The source to rewind. + **/ + virtual void rewind(Source *source) = 0; + + /** + * Rewinds all playing audio. + **/ + virtual void rewind() = 0; + + /** + * Sets the master volume, where 0.0f is min (off) and 1.0f is max. + * @param volume The new master volume. + **/ + virtual void setVolume(float volume) = 0; + + /** + * Gets the master volume. + * @return The current master volume. + **/ + virtual float getVolume() const = 0; + + /** + * Gets the position of the listener. + * @param v A float array of size 3 containing (x,y,z) in that order. + **/ + virtual void getPosition(float *v) const = 0; + + /** + * Sets the position of the listener. + * @param v A float array of size 3 containing [x,y,z] in that order. + **/ + virtual void setPosition(float *v) = 0; + + /** + * Gets the orientation of the listener. + * @param v A float array of size 6 containing [x,y,z] for the forward + * vector, followed by [x,y,z] for the up vector. + **/ + virtual void getOrientation(float *v) const = 0; + + /** + * Sets the orientation of the listener. + * @param v A float array of size 6 containing [x,y,z] for the forward + * vector, followed by [x,y,z] for the up vector. + **/ + virtual void setOrientation(float *v) = 0; + + /** + * Gets the velocity of the listener. + * @param v A float array of size 3 containing [x,y,z] in that order. + **/ + virtual void getVelocity(float *v) const = 0; + + /** + * Sets the velocity of the listener. + * @param v A float array of size 3 containing [x,y,z] in that order. + **/ + virtual void setVelocity(float *v) = 0; + + /** + * Begins recording audio input from the microphone. + **/ + virtual void record() = 0; + + /** + * Gets a section of recorded audio. + * Per OpenAL, the measurement begins from the start of the + * audio data in memory, which is after the last time this function + * was called. If this function has not been called yet this recording + * session, it just grabs from the beginning. + * @return All the recorded SoundData thus far. + **/ + virtual love::sound::SoundData *getRecordedData() = 0; + + /** + * Stops recording and, if passed true, returns all the recorded audio + * not already gotten by getRecordedData. + * @param returnData Whether to return recorded audio. + * @return if returnData, all the recorded audio yet to be gotten, + * otherwise NULL. + **/ + virtual love::sound::SoundData *stopRecording(bool returnData) = 0; + + /** + * Checks whether LOVE is able to record audio input. + * @return hasMic Whether LOVE has a microphone enabled. + **/ + virtual bool canRecord() = 0; + + /** + * Gets the distance model used for attenuation. + * @return Distance model. + */ + virtual DistanceModel getDistanceModel() const = 0; + + /** + * Sets the distance model used for attenuation. + * @param distanceModel Distance model. + */ + virtual void setDistanceModel(DistanceModel distanceModel) = 0; + +private: + + static StringMap::Entry distanceModelEntries[]; + static StringMap distanceModels; +}; // Audio + +} // audio +} // love + +#endif // LOVE_AUDIO_AUDIO_H diff --git a/src/modules/audio/Source.cpp b/src/modules/audio/Source.cpp index ba325808e..0c16e667d 100644 --- a/src/modules/audio/Source.cpp +++ b/src/modules/audio/Source.cpp @@ -1,74 +1,74 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Source.h" - -namespace love -{ -namespace audio -{ - -Source::Source(Type type) - : type(type) -{ -} - -Source::~Source() -{ -} - -bool Source::getConstant(const char *in, Type &out) -{ - return types.find(in, out); -} - -bool Source::getConstant(Type in, const char *&out) -{ - return types.find(in, out); -} - -bool Source::getConstant(const char *in, Unit &out) -{ - return units.find(in, out); -} - -bool Source::getConstant(Unit in, const char *&out) -{ - return units.find(in, out); -} - -StringMap::Entry Source::typeEntries[] = -{ - {"static", Source::TYPE_STATIC}, - {"stream", Source::TYPE_STREAM}, -}; - -StringMap Source::types(Source::typeEntries, sizeof(Source::typeEntries)); - -StringMap::Entry Source::unitEntries[] = -{ - {"seconds", Source::UNIT_SECONDS}, - {"samples", Source::UNIT_SAMPLES}, -}; - -StringMap Source::units(Source::unitEntries, sizeof(Source::unitEntries)); - -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Source.h" + +namespace love +{ +namespace audio +{ + +Source::Source(Type type) + : type(type) +{ +} + +Source::~Source() +{ +} + +bool Source::getConstant(const char *in, Type &out) +{ + return types.find(in, out); +} + +bool Source::getConstant(Type in, const char *&out) +{ + return types.find(in, out); +} + +bool Source::getConstant(const char *in, Unit &out) +{ + return units.find(in, out); +} + +bool Source::getConstant(Unit in, const char *&out) +{ + return units.find(in, out); +} + +StringMap::Entry Source::typeEntries[] = +{ + {"static", Source::TYPE_STATIC}, + {"stream", Source::TYPE_STREAM}, +}; + +StringMap Source::types(Source::typeEntries, sizeof(Source::typeEntries)); + +StringMap::Entry Source::unitEntries[] = +{ + {"seconds", Source::UNIT_SECONDS}, + {"samples", Source::UNIT_SAMPLES}, +}; + +StringMap Source::units(Source::unitEntries, sizeof(Source::unitEntries)); + +} // audio +} // love diff --git a/src/modules/audio/Source.h b/src/modules/audio/Source.h index 54f62dad7..8c167d072 100644 --- a/src/modules/audio/Source.h +++ b/src/modules/audio/Source.h @@ -1,119 +1,119 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_SOURCE_H -#define LOVE_AUDIO_SOURCE_H - -// LOVE -#include "common/Object.h" -#include "common/StringMap.h" - -namespace love -{ -namespace audio -{ - -class Source : public Object -{ -public: - - enum Type - { - TYPE_STATIC = 1, - TYPE_STREAM, - TYPE_MAX_ENUM - }; // Type - - enum Unit - { - UNIT_SECONDS = 1, - UNIT_SAMPLES, - UNIT_MAX_ENUM - }; - - Source(Type type); - virtual ~Source(); - - virtual Source *copy() = 0; - - virtual void play() = 0; - virtual void stop() = 0; - virtual void pause() = 0; - virtual void resume() = 0; - virtual void rewind() = 0; - virtual bool isStopped() const = 0; - virtual bool isPaused() const = 0; - virtual bool isFinished() const = 0; - virtual bool update() = 0; - - virtual void setPitch(float pitch) = 0; - virtual float getPitch() const = 0; - - virtual void setVolume(float volume) = 0; - virtual float getVolume() const = 0; - - virtual void seek(float offset, Unit unit) = 0; - virtual float tell(Unit unit) = 0; - - // all float * v must be of size 3 - virtual void setPosition(float *v) = 0; - virtual void getPosition(float *v) const = 0; - virtual void setVelocity(float *v) = 0; - virtual void getVelocity(float *v) const = 0; - virtual void setDirection(float *v) = 0; - virtual void getDirection(float *v) const = 0; - - virtual void setLooping(bool looping) = 0; - virtual bool isLooping() const = 0; - virtual bool isStatic() const = 0; - - virtual void setMinVolume(float volume) = 0; - virtual float getMinVolume() const = 0; - virtual void setMaxVolume(float volume) = 0; - virtual float getMaxVolume() const = 0; - - virtual void setReferenceDistance(float distance) = 0; - virtual float getReferenceDistance() const = 0; - virtual void setRolloffFactor(float factor) = 0; - virtual float getRolloffFactor() const = 0; - virtual void setMaxDistance(float distance) = 0; - virtual float getMaxDistance() const = 0; - - static bool getConstant(const char *in, Type &out); - static bool getConstant(Type in, const char *&out); - static bool getConstant(const char *in, Unit &out); - static bool getConstant(Unit in, const char *&out); - -protected: - Type type; - -private: - - static StringMap::Entry typeEntries[]; - static StringMap types; - static StringMap::Entry unitEntries[]; - static StringMap units; - -}; // Source - -} // audio -} // love - -#endif // LOVE_AUDIO_SOURCE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_SOURCE_H +#define LOVE_AUDIO_SOURCE_H + +// LOVE +#include "common/Object.h" +#include "common/StringMap.h" + +namespace love +{ +namespace audio +{ + +class Source : public Object +{ +public: + + enum Type + { + TYPE_STATIC = 1, + TYPE_STREAM, + TYPE_MAX_ENUM + }; // Type + + enum Unit + { + UNIT_SECONDS = 1, + UNIT_SAMPLES, + UNIT_MAX_ENUM + }; + + Source(Type type); + virtual ~Source(); + + virtual Source *copy() = 0; + + virtual void play() = 0; + virtual void stop() = 0; + virtual void pause() = 0; + virtual void resume() = 0; + virtual void rewind() = 0; + virtual bool isStopped() const = 0; + virtual bool isPaused() const = 0; + virtual bool isFinished() const = 0; + virtual bool update() = 0; + + virtual void setPitch(float pitch) = 0; + virtual float getPitch() const = 0; + + virtual void setVolume(float volume) = 0; + virtual float getVolume() const = 0; + + virtual void seek(float offset, Unit unit) = 0; + virtual float tell(Unit unit) = 0; + + // all float * v must be of size 3 + virtual void setPosition(float *v) = 0; + virtual void getPosition(float *v) const = 0; + virtual void setVelocity(float *v) = 0; + virtual void getVelocity(float *v) const = 0; + virtual void setDirection(float *v) = 0; + virtual void getDirection(float *v) const = 0; + + virtual void setLooping(bool looping) = 0; + virtual bool isLooping() const = 0; + virtual bool isStatic() const = 0; + + virtual void setMinVolume(float volume) = 0; + virtual float getMinVolume() const = 0; + virtual void setMaxVolume(float volume) = 0; + virtual float getMaxVolume() const = 0; + + virtual void setReferenceDistance(float distance) = 0; + virtual float getReferenceDistance() const = 0; + virtual void setRolloffFactor(float factor) = 0; + virtual float getRolloffFactor() const = 0; + virtual void setMaxDistance(float distance) = 0; + virtual float getMaxDistance() const = 0; + + static bool getConstant(const char *in, Type &out); + static bool getConstant(Type in, const char *&out); + static bool getConstant(const char *in, Unit &out); + static bool getConstant(Unit in, const char *&out); + +protected: + Type type; + +private: + + static StringMap::Entry typeEntries[]; + static StringMap types; + static StringMap::Entry unitEntries[]; + static StringMap units; + +}; // Source + +} // audio +} // love + +#endif // LOVE_AUDIO_SOURCE_H diff --git a/src/modules/audio/null/Audio.cpp b/src/modules/audio/null/Audio.cpp index 14493718e..964b5712d 100644 --- a/src/modules/audio/null/Audio.cpp +++ b/src/modules/audio/null/Audio.cpp @@ -1,168 +1,168 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Audio.h" - -namespace love -{ -namespace audio -{ -namespace null -{ - -Audio::Audio() : distanceModel(DISTANCE_NONE) -{ -} - -Audio::~Audio() -{ -} - -const char *Audio::getName() const -{ - return "love.audio.null"; -} - -love::audio::Source *Audio::newSource(love::sound::Decoder *) -{ - return new Source(); -} - -love::audio::Source *Audio::newSource(love::sound::SoundData *) -{ - return new Source(); -} - -int Audio::getNumSources() const -{ - return 0; -} - -int Audio::getMaxSources() const -{ - return 0; -} - -void Audio::play(love::audio::Source *) -{ -} - -void Audio::play() -{ -} - -void Audio::stop(love::audio::Source *) -{ -} - -void Audio::stop() -{ -} - -void Audio::pause(love::audio::Source *) -{ -} - -void Audio::pause() -{ -} - -void Audio::resume(love::audio::Source *) -{ -} - -void Audio::resume() -{ -} - -void Audio::rewind(love::audio::Source *) -{ -} - -void Audio::rewind() -{ -} - -void Audio::setVolume(float volume) -{ - this->volume = volume; -} - -float Audio::getVolume() const -{ - return volume; -} - -void Audio::getPosition(float *) const -{ -} - -void Audio::setPosition(float *) -{ -} - -void Audio::getOrientation(float *) const -{ -} - -void Audio::setOrientation(float *) -{ -} - -void Audio::getVelocity(float *) const -{ -} - -void Audio::setVelocity(float *) -{ -} - -void Audio::record() -{ -} - -love::sound::SoundData *Audio::getRecordedData() -{ - return NULL; -} - -love::sound::SoundData *Audio::stopRecording(bool) -{ - return NULL; -} - -bool Audio::canRecord() -{ - return false; -} - -Audio::DistanceModel Audio::getDistanceModel() const -{ - return this->distanceModel; -} - -void Audio::setDistanceModel(DistanceModel distanceModel) -{ - this->distanceModel = distanceModel; -} - -} // null -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Audio.h" + +namespace love +{ +namespace audio +{ +namespace null +{ + +Audio::Audio() : distanceModel(DISTANCE_NONE) +{ +} + +Audio::~Audio() +{ +} + +const char *Audio::getName() const +{ + return "love.audio.null"; +} + +love::audio::Source *Audio::newSource(love::sound::Decoder *) +{ + return new Source(); +} + +love::audio::Source *Audio::newSource(love::sound::SoundData *) +{ + return new Source(); +} + +int Audio::getNumSources() const +{ + return 0; +} + +int Audio::getMaxSources() const +{ + return 0; +} + +void Audio::play(love::audio::Source *) +{ +} + +void Audio::play() +{ +} + +void Audio::stop(love::audio::Source *) +{ +} + +void Audio::stop() +{ +} + +void Audio::pause(love::audio::Source *) +{ +} + +void Audio::pause() +{ +} + +void Audio::resume(love::audio::Source *) +{ +} + +void Audio::resume() +{ +} + +void Audio::rewind(love::audio::Source *) +{ +} + +void Audio::rewind() +{ +} + +void Audio::setVolume(float volume) +{ + this->volume = volume; +} + +float Audio::getVolume() const +{ + return volume; +} + +void Audio::getPosition(float *) const +{ +} + +void Audio::setPosition(float *) +{ +} + +void Audio::getOrientation(float *) const +{ +} + +void Audio::setOrientation(float *) +{ +} + +void Audio::getVelocity(float *) const +{ +} + +void Audio::setVelocity(float *) +{ +} + +void Audio::record() +{ +} + +love::sound::SoundData *Audio::getRecordedData() +{ + return NULL; +} + +love::sound::SoundData *Audio::stopRecording(bool) +{ + return NULL; +} + +bool Audio::canRecord() +{ + return false; +} + +Audio::DistanceModel Audio::getDistanceModel() const +{ + return this->distanceModel; +} + +void Audio::setDistanceModel(DistanceModel distanceModel) +{ + this->distanceModel = distanceModel; +} + +} // null +} // audio +} // love diff --git a/src/modules/audio/null/Audio.h b/src/modules/audio/null/Audio.h index 7dc6119f7..d1d9379a1 100644 --- a/src/modules/audio/null/Audio.h +++ b/src/modules/audio/null/Audio.h @@ -1,89 +1,89 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_NULL_AUDIO_H -#define LOVE_AUDIO_NULL_AUDIO_H - -// LOVE -#include "audio/Audio.h" - -#include "Source.h" - -namespace love -{ -namespace audio -{ -namespace null -{ - -class Audio : public love::audio::Audio -{ -public: - - Audio(); - virtual ~Audio(); - - // Implements Module. - const char *getName() const; - - // Implements Audio. - love::audio::Source *newSource(love::sound::Decoder *decoder); - love::audio::Source *newSource(love::sound::SoundData *soundData); - int getNumSources() const; - int getMaxSources() const; - void play(love::audio::Source *source); - void play(); - void stop(love::audio::Source *source); - void stop(); - void pause(love::audio::Source *source); - void pause(); - void resume(love::audio::Source *source); - void resume(); - void rewind(love::audio::Source *source); - void rewind(); - void setVolume(float volume); - float getVolume() const; - - void getPosition(float *v) const; - void setPosition(float *v); - void getOrientation(float *v) const; - void setOrientation(float *v); - void getVelocity(float *v) const; - void setVelocity(float *v); - - void record(); - love::sound::SoundData *getRecordedData(); - love::sound::SoundData *stopRecording(bool returnData); - bool canRecord(); - - DistanceModel getDistanceModel() const; - void setDistanceModel(DistanceModel distanceModel); - -private: - float volume; - DistanceModel distanceModel; - -}; // Audio - -} // null -} // audio -} // love - -#endif // LOVE_AUDIO_NULL_AUDIO_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_NULL_AUDIO_H +#define LOVE_AUDIO_NULL_AUDIO_H + +// LOVE +#include "audio/Audio.h" + +#include "Source.h" + +namespace love +{ +namespace audio +{ +namespace null +{ + +class Audio : public love::audio::Audio +{ +public: + + Audio(); + virtual ~Audio(); + + // Implements Module. + const char *getName() const; + + // Implements Audio. + love::audio::Source *newSource(love::sound::Decoder *decoder); + love::audio::Source *newSource(love::sound::SoundData *soundData); + int getNumSources() const; + int getMaxSources() const; + void play(love::audio::Source *source); + void play(); + void stop(love::audio::Source *source); + void stop(); + void pause(love::audio::Source *source); + void pause(); + void resume(love::audio::Source *source); + void resume(); + void rewind(love::audio::Source *source); + void rewind(); + void setVolume(float volume); + float getVolume() const; + + void getPosition(float *v) const; + void setPosition(float *v); + void getOrientation(float *v) const; + void setOrientation(float *v); + void getVelocity(float *v) const; + void setVelocity(float *v); + + void record(); + love::sound::SoundData *getRecordedData(); + love::sound::SoundData *stopRecording(bool returnData); + bool canRecord(); + + DistanceModel getDistanceModel() const; + void setDistanceModel(DistanceModel distanceModel); + +private: + float volume; + DistanceModel distanceModel; + +}; // Audio + +} // null +} // audio +} // love + +#endif // LOVE_AUDIO_NULL_AUDIO_H diff --git a/src/modules/audio/null/Source.cpp b/src/modules/audio/null/Source.cpp index 092122b17..2cc253b03 100644 --- a/src/modules/audio/null/Source.cpp +++ b/src/modules/audio/null/Source.cpp @@ -1,205 +1,205 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Source.h" - -namespace love -{ -namespace audio -{ -namespace null -{ - -Source::Source() - : love::audio::Source(Source::TYPE_STATIC) -{ -} - -Source::~Source() -{ -} - -love::audio::Source *Source::copy() -{ - this->retain(); - return this; -} - -void Source::play() -{ -} - -void Source::stop() -{ -} - -void Source::pause() -{ -} - -void Source::resume() -{ -} - -void Source::rewind() -{ -} - -bool Source::isStopped() const -{ - return true; -} - -bool Source::isPaused() const -{ - return false; -} - -bool Source::isFinished() const -{ - return true; -} - -bool Source::update() -{ - return false; -} - -void Source::setPitch(float pitch) -{ - this->pitch = pitch; -} - -float Source::getPitch() const -{ - return pitch; -} - -void Source::setVolume(float volume) -{ - this->volume = volume; -} - -float Source::getVolume() const -{ - return volume; -} - -void Source::seek(float, Source::Unit) -{ -} - -float Source::tell(Source::Unit) -{ - return 0.0f; -} - -void Source::setPosition(float *) -{ -} - -void Source::getPosition(float *) const -{ -} - -void Source::setVelocity(float *) -{ -} - -void Source::getVelocity(float *) const -{ -} - -void Source::setDirection(float *) -{ -} - -void Source::getDirection(float *) const -{ -} - -void Source::setLooping(bool looping) -{ - this->looping = looping; -} - -bool Source::isLooping() const -{ - return looping; -} - -bool Source::isStatic() const -{ - return (type == TYPE_STATIC); -} - -void Source::setMinVolume(float volume) -{ - this->minVolume = volume; -} - -float Source::getMinVolume() const -{ - return this->minVolume; -} - -void Source::setMaxVolume(float volume) -{ - this->maxVolume = volume; -} - -float Source::getMaxVolume() const -{ - return this->maxVolume; -} - -void Source::setReferenceDistance(float distance) -{ - this->referenceDistance = distance; -} - -float Source::getReferenceDistance() const -{ - return this->referenceDistance; -} - -void Source::setRolloffFactor(float factor) -{ - this->rolloffFactor = factor; -} - -float Source::getRolloffFactor() const -{ - return this->rolloffFactor; -} - -void Source::setMaxDistance(float distance) -{ - this->maxDistance = distance; -} - -float Source::getMaxDistance() const -{ - return this->maxDistance; -} - -} // null -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Source.h" + +namespace love +{ +namespace audio +{ +namespace null +{ + +Source::Source() + : love::audio::Source(Source::TYPE_STATIC) +{ +} + +Source::~Source() +{ +} + +love::audio::Source *Source::copy() +{ + this->retain(); + return this; +} + +void Source::play() +{ +} + +void Source::stop() +{ +} + +void Source::pause() +{ +} + +void Source::resume() +{ +} + +void Source::rewind() +{ +} + +bool Source::isStopped() const +{ + return true; +} + +bool Source::isPaused() const +{ + return false; +} + +bool Source::isFinished() const +{ + return true; +} + +bool Source::update() +{ + return false; +} + +void Source::setPitch(float pitch) +{ + this->pitch = pitch; +} + +float Source::getPitch() const +{ + return pitch; +} + +void Source::setVolume(float volume) +{ + this->volume = volume; +} + +float Source::getVolume() const +{ + return volume; +} + +void Source::seek(float, Source::Unit) +{ +} + +float Source::tell(Source::Unit) +{ + return 0.0f; +} + +void Source::setPosition(float *) +{ +} + +void Source::getPosition(float *) const +{ +} + +void Source::setVelocity(float *) +{ +} + +void Source::getVelocity(float *) const +{ +} + +void Source::setDirection(float *) +{ +} + +void Source::getDirection(float *) const +{ +} + +void Source::setLooping(bool looping) +{ + this->looping = looping; +} + +bool Source::isLooping() const +{ + return looping; +} + +bool Source::isStatic() const +{ + return (type == TYPE_STATIC); +} + +void Source::setMinVolume(float volume) +{ + this->minVolume = volume; +} + +float Source::getMinVolume() const +{ + return this->minVolume; +} + +void Source::setMaxVolume(float volume) +{ + this->maxVolume = volume; +} + +float Source::getMaxVolume() const +{ + return this->maxVolume; +} + +void Source::setReferenceDistance(float distance) +{ + this->referenceDistance = distance; +} + +float Source::getReferenceDistance() const +{ + return this->referenceDistance; +} + +void Source::setRolloffFactor(float factor) +{ + this->rolloffFactor = factor; +} + +float Source::getRolloffFactor() const +{ + return this->rolloffFactor; +} + +void Source::setMaxDistance(float distance) +{ + this->maxDistance = distance; +} + +float Source::getMaxDistance() const +{ + return this->maxDistance; +} + +} // null +} // audio +} // love diff --git a/src/modules/audio/null/Source.h b/src/modules/audio/null/Source.h index a9822d5ca..046b5c435 100644 --- a/src/modules/audio/null/Source.h +++ b/src/modules/audio/null/Source.h @@ -1,94 +1,94 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_NULL_SOURCE_H -#define LOVE_AUDIO_NULL_SOURCE_H - -// LOVE -#include "common/Object.h" -#include "audio/Source.h" - -namespace love -{ -namespace audio -{ -namespace null -{ - -class Source : public love::audio::Source -{ -public: - Source(); - virtual ~Source(); - - virtual love::audio::Source *copy(); - virtual void play(); - virtual void stop(); - virtual void pause(); - virtual void resume(); - virtual void rewind(); - virtual bool isStopped() const; - virtual bool isPaused() const; - virtual bool isFinished() const; - virtual bool update(); - virtual void setPitch(float pitch); - virtual float getPitch() const; - virtual void setVolume(float volume); - virtual float getVolume() const; - virtual void seek(float offset, Unit unit); - virtual float tell(Unit unit); - virtual void setPosition(float *v); - virtual void getPosition(float *v) const; - virtual void setVelocity(float *v); - virtual void getVelocity(float *v) const; - virtual void setDirection(float *v); - virtual void getDirection(float *v) const; - void setLooping(bool looping); - bool isLooping() const; - bool isStatic() const; - virtual void setMinVolume(float volume); - virtual float getMinVolume() const; - virtual void setMaxVolume(float volume); - virtual float getMaxVolume() const; - virtual void setReferenceDistance(float distance); - virtual float getReferenceDistance() const; - virtual void setRolloffFactor(float factor); - virtual float getRolloffFactor() const; - virtual void setMaxDistance(float distance); - virtual float getMaxDistance() const; - -private: - - float pitch; - float volume; - bool looping; - float minVolume; - float maxVolume; - float referenceDistance; - float rolloffFactor; - float maxDistance; - -}; // Source - -} // null -} // audio -} // love - -#endif // LOVE_AUDIO_NULL_SOURCE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_NULL_SOURCE_H +#define LOVE_AUDIO_NULL_SOURCE_H + +// LOVE +#include "common/Object.h" +#include "audio/Source.h" + +namespace love +{ +namespace audio +{ +namespace null +{ + +class Source : public love::audio::Source +{ +public: + Source(); + virtual ~Source(); + + virtual love::audio::Source *copy(); + virtual void play(); + virtual void stop(); + virtual void pause(); + virtual void resume(); + virtual void rewind(); + virtual bool isStopped() const; + virtual bool isPaused() const; + virtual bool isFinished() const; + virtual bool update(); + virtual void setPitch(float pitch); + virtual float getPitch() const; + virtual void setVolume(float volume); + virtual float getVolume() const; + virtual void seek(float offset, Unit unit); + virtual float tell(Unit unit); + virtual void setPosition(float *v); + virtual void getPosition(float *v) const; + virtual void setVelocity(float *v); + virtual void getVelocity(float *v) const; + virtual void setDirection(float *v); + virtual void getDirection(float *v) const; + void setLooping(bool looping); + bool isLooping() const; + bool isStatic() const; + virtual void setMinVolume(float volume); + virtual float getMinVolume() const; + virtual void setMaxVolume(float volume); + virtual float getMaxVolume() const; + virtual void setReferenceDistance(float distance); + virtual float getReferenceDistance() const; + virtual void setRolloffFactor(float factor); + virtual float getRolloffFactor() const; + virtual void setMaxDistance(float distance); + virtual float getMaxDistance() const; + +private: + + float pitch; + float volume; + bool looping; + float minVolume; + float maxVolume; + float referenceDistance; + float rolloffFactor; + float maxDistance; + +}; // Source + +} // null +} // audio +} // love + +#endif // LOVE_AUDIO_NULL_SOURCE_H diff --git a/src/modules/audio/openal/Audio.cpp b/src/modules/audio/openal/Audio.cpp index 2a5c6ceb7..e63cf69d8 100644 --- a/src/modules/audio/openal/Audio.cpp +++ b/src/modules/audio/openal/Audio.cpp @@ -1,319 +1,319 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Audio.h" -#include "common/delay.h" - -#include "sound/Decoder.h" - -namespace love -{ -namespace audio -{ -namespace openal -{ - -Audio::PoolThread::PoolThread(Pool *pool) - : pool(pool) - , finish(false) -{ -} - -void Audio::PoolThread::main() -{ - while (true) - { - { - thread::Lock lock(mutex); - if (finish) - { - return; - } - } - - pool->update(); - delay(5); - } -} - -void Audio::PoolThread::setFinish() -{ - thread::Lock lock(mutex); - finish = true; -} - - -Audio::Audio() : distanceModel(DISTANCE_INVERSE_CLAMPED) -{ - // Passing zero for default device. - device = alcOpenDevice(0); - - if (device == 0) - throw love::Exception("Could not open device."); - - context = alcCreateContext(device, 0); - - if (context == 0) - throw love::Exception("Could not create context."); - - alcMakeContextCurrent(context); - - if (alcGetError(device) != ALC_NO_ERROR) - throw love::Exception("Could not make context current."); - - /*std::string captureName(alcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER)); - const ALCchar * devices = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER); - while (*devices) - { - std::string device(devices); - devices += device.size() + 1; - if (device.find("Mic") != std::string::npos || device.find("mic") != std::string::npos) - { - captureName = device; - } - } - - capture = alcCaptureOpenDevice(captureName.c_str(), 8000, AL_FORMAT_MONO16, 262144); // about 32 seconds - - if (!capture) - { - // We're not going to prevent LOVE from running without a microphone, but we should warn, at least - std::cerr << "Warning, couldn't open capture device! No audio input!" << std::endl; - }*/ - - // pool must be allocated after AL context. - pool = new Pool(); - - poolThread = new PoolThread(pool); - poolThread->start(); -} - -Audio::~Audio() -{ - poolThread->setFinish(); - poolThread->wait(); - - delete poolThread; - delete pool; - - alcMakeContextCurrent(0); - alcDestroyContext(context); - //if (capture) alcCaptureCloseDevice(capture); - alcCloseDevice(device); -} - - -const char *Audio::getName() const -{ - return "love.audio.openal"; -} - -love::audio::Source *Audio::newSource(love::sound::Decoder *decoder) -{ - return new Source(pool, decoder); -} - -love::audio::Source *Audio::newSource(love::sound::SoundData *soundData) -{ - return new Source(pool, soundData); -} - -int Audio::getNumSources() const -{ - return pool->getNumSources(); -} - -int Audio::getMaxSources() const -{ - return pool->getMaxSources(); -} - -void Audio::play(love::audio::Source *source) -{ - source->play(); -} - -void Audio::stop(love::audio::Source *source) -{ - source->stop(); -} - -void Audio::stop() -{ - pool->stop(); -} - -void Audio::pause(love::audio::Source *source) -{ - source->pause(); -} - -void Audio::pause() -{ - pool->pause(); -} - -void Audio::resume(love::audio::Source *source) -{ - source->resume(); -} - -void Audio::resume() -{ - pool->resume(); -} - -void Audio::rewind(love::audio::Source *source) -{ - source->rewind(); -} - -void Audio::rewind() -{ - pool->rewind(); -} - -void Audio::setVolume(float volume) -{ - alListenerf(AL_GAIN, volume); -} - -float Audio::getVolume() const -{ - ALfloat volume; - alGetListenerf(AL_GAIN, &volume); - return volume; -} - -void Audio::getPosition(float *v) const -{ - alGetListenerfv(AL_POSITION, v); -} - -void Audio::setPosition(float *v) -{ - alListenerfv(AL_POSITION, v); -} - -void Audio::getOrientation(float *v) const -{ - alGetListenerfv(AL_ORIENTATION, v); -} - -void Audio::setOrientation(float *v) -{ - alListenerfv(AL_ORIENTATION, v); -} - -void Audio::getVelocity(float *v) const -{ - alGetListenerfv(AL_VELOCITY, v); -} - -void Audio::setVelocity(float *v) -{ - alListenerfv(AL_VELOCITY, v); -} - -void Audio::record() -{ - if (!canRecord()) return; - alcCaptureStart(capture); -} - -love::sound::SoundData *Audio::getRecordedData() -{ - if (!canRecord()) - return NULL; - int samplerate = 8000; - ALCint samples; - alcGetIntegerv(capture, ALC_CAPTURE_SAMPLES, 4, &samples); - void *data = malloc(samples * (2/sizeof(char))); - alcCaptureSamples(capture, data, samples); - love::sound::SoundData *sd = new love::sound::SoundData(data, samples, samplerate, 16, 1); - free(data); - return sd; -} - -love::sound::SoundData *Audio::stopRecording(bool returnData) -{ - if (!canRecord()) - return NULL; - love::sound::SoundData *sd = NULL; - if (returnData) - { - sd = getRecordedData(); - } - alcCaptureStop(capture); - return sd; -} - -bool Audio::canRecord() -{ - return (capture != NULL); -} - -Audio::DistanceModel Audio::getDistanceModel() const -{ - return this->distanceModel; -} - -void Audio::setDistanceModel(DistanceModel distanceModel) -{ - this->distanceModel = distanceModel; - - switch (distanceModel) - { - case DISTANCE_NONE: - alDistanceModel(AL_NONE); - break; - - case DISTANCE_INVERSE: - alDistanceModel(AL_INVERSE_DISTANCE); - break; - - case DISTANCE_INVERSE_CLAMPED: - alDistanceModel(AL_INVERSE_DISTANCE_CLAMPED); - break; - - case DISTANCE_LINEAR: - alDistanceModel(AL_LINEAR_DISTANCE); - break; - - case DISTANCE_LINEAR_CLAMPED: - alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED); - break; - - case DISTANCE_EXPONENT: - alDistanceModel(AL_EXPONENT_DISTANCE); - break; - - case DISTANCE_EXPONENT_CLAMPED: - alDistanceModel(AL_EXPONENT_DISTANCE_CLAMPED); - break; - - default: - break; - } -} - -} // openal -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Audio.h" +#include "common/delay.h" + +#include "sound/Decoder.h" + +namespace love +{ +namespace audio +{ +namespace openal +{ + +Audio::PoolThread::PoolThread(Pool *pool) + : pool(pool) + , finish(false) +{ +} + +void Audio::PoolThread::main() +{ + while (true) + { + { + thread::Lock lock(mutex); + if (finish) + { + return; + } + } + + pool->update(); + delay(5); + } +} + +void Audio::PoolThread::setFinish() +{ + thread::Lock lock(mutex); + finish = true; +} + + +Audio::Audio() : distanceModel(DISTANCE_INVERSE_CLAMPED) +{ + // Passing zero for default device. + device = alcOpenDevice(0); + + if (device == 0) + throw love::Exception("Could not open device."); + + context = alcCreateContext(device, 0); + + if (context == 0) + throw love::Exception("Could not create context."); + + alcMakeContextCurrent(context); + + if (alcGetError(device) != ALC_NO_ERROR) + throw love::Exception("Could not make context current."); + + /*std::string captureName(alcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER)); + const ALCchar * devices = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER); + while (*devices) + { + std::string device(devices); + devices += device.size() + 1; + if (device.find("Mic") != std::string::npos || device.find("mic") != std::string::npos) + { + captureName = device; + } + } + + capture = alcCaptureOpenDevice(captureName.c_str(), 8000, AL_FORMAT_MONO16, 262144); // about 32 seconds + + if (!capture) + { + // We're not going to prevent LOVE from running without a microphone, but we should warn, at least + std::cerr << "Warning, couldn't open capture device! No audio input!" << std::endl; + }*/ + + // pool must be allocated after AL context. + pool = new Pool(); + + poolThread = new PoolThread(pool); + poolThread->start(); +} + +Audio::~Audio() +{ + poolThread->setFinish(); + poolThread->wait(); + + delete poolThread; + delete pool; + + alcMakeContextCurrent(0); + alcDestroyContext(context); + //if (capture) alcCaptureCloseDevice(capture); + alcCloseDevice(device); +} + + +const char *Audio::getName() const +{ + return "love.audio.openal"; +} + +love::audio::Source *Audio::newSource(love::sound::Decoder *decoder) +{ + return new Source(pool, decoder); +} + +love::audio::Source *Audio::newSource(love::sound::SoundData *soundData) +{ + return new Source(pool, soundData); +} + +int Audio::getNumSources() const +{ + return pool->getNumSources(); +} + +int Audio::getMaxSources() const +{ + return pool->getMaxSources(); +} + +void Audio::play(love::audio::Source *source) +{ + source->play(); +} + +void Audio::stop(love::audio::Source *source) +{ + source->stop(); +} + +void Audio::stop() +{ + pool->stop(); +} + +void Audio::pause(love::audio::Source *source) +{ + source->pause(); +} + +void Audio::pause() +{ + pool->pause(); +} + +void Audio::resume(love::audio::Source *source) +{ + source->resume(); +} + +void Audio::resume() +{ + pool->resume(); +} + +void Audio::rewind(love::audio::Source *source) +{ + source->rewind(); +} + +void Audio::rewind() +{ + pool->rewind(); +} + +void Audio::setVolume(float volume) +{ + alListenerf(AL_GAIN, volume); +} + +float Audio::getVolume() const +{ + ALfloat volume; + alGetListenerf(AL_GAIN, &volume); + return volume; +} + +void Audio::getPosition(float *v) const +{ + alGetListenerfv(AL_POSITION, v); +} + +void Audio::setPosition(float *v) +{ + alListenerfv(AL_POSITION, v); +} + +void Audio::getOrientation(float *v) const +{ + alGetListenerfv(AL_ORIENTATION, v); +} + +void Audio::setOrientation(float *v) +{ + alListenerfv(AL_ORIENTATION, v); +} + +void Audio::getVelocity(float *v) const +{ + alGetListenerfv(AL_VELOCITY, v); +} + +void Audio::setVelocity(float *v) +{ + alListenerfv(AL_VELOCITY, v); +} + +void Audio::record() +{ + if (!canRecord()) return; + alcCaptureStart(capture); +} + +love::sound::SoundData *Audio::getRecordedData() +{ + if (!canRecord()) + return NULL; + int samplerate = 8000; + ALCint samples; + alcGetIntegerv(capture, ALC_CAPTURE_SAMPLES, 4, &samples); + void *data = malloc(samples * (2/sizeof(char))); + alcCaptureSamples(capture, data, samples); + love::sound::SoundData *sd = new love::sound::SoundData(data, samples, samplerate, 16, 1); + free(data); + return sd; +} + +love::sound::SoundData *Audio::stopRecording(bool returnData) +{ + if (!canRecord()) + return NULL; + love::sound::SoundData *sd = NULL; + if (returnData) + { + sd = getRecordedData(); + } + alcCaptureStop(capture); + return sd; +} + +bool Audio::canRecord() +{ + return (capture != NULL); +} + +Audio::DistanceModel Audio::getDistanceModel() const +{ + return this->distanceModel; +} + +void Audio::setDistanceModel(DistanceModel distanceModel) +{ + this->distanceModel = distanceModel; + + switch (distanceModel) + { + case DISTANCE_NONE: + alDistanceModel(AL_NONE); + break; + + case DISTANCE_INVERSE: + alDistanceModel(AL_INVERSE_DISTANCE); + break; + + case DISTANCE_INVERSE_CLAMPED: + alDistanceModel(AL_INVERSE_DISTANCE_CLAMPED); + break; + + case DISTANCE_LINEAR: + alDistanceModel(AL_LINEAR_DISTANCE); + break; + + case DISTANCE_LINEAR_CLAMPED: + alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED); + break; + + case DISTANCE_EXPONENT: + alDistanceModel(AL_EXPONENT_DISTANCE); + break; + + case DISTANCE_EXPONENT_CLAMPED: + alDistanceModel(AL_EXPONENT_DISTANCE_CLAMPED); + break; + + default: + break; + } +} + +} // openal +} // audio +} // love diff --git a/src/modules/audio/openal/Audio.h b/src/modules/audio/openal/Audio.h index e44641990..03e2e602b 100644 --- a/src/modules/audio/openal/Audio.h +++ b/src/modules/audio/openal/Audio.h @@ -1,142 +1,142 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_OPENAL_AUDIO_H -#define LOVE_AUDIO_OPENAL_AUDIO_H - -// STD -#include -#include -#include -#include - -// LOVE -#include "audio/Audio.h" -#include "common/config.h" -#include "sound/SoundData.h" - -#include "Source.h" -#include "Pool.h" -#include "thread/threads.h" - -// OpenAL -#ifdef LOVE_MACOSX -#include -#include -#else -#include -#include -#endif - -namespace love -{ -namespace audio -{ -namespace openal -{ - -class Audio : public love::audio::Audio -{ -public: - - Audio(); - ~Audio(); - - // Implements Module. - const char *getName() const; - - // Implements Audio. - love::audio::Source *newSource(love::sound::Decoder *decoder); - love::audio::Source *newSource(love::sound::SoundData *soundData); - int getNumSources() const; - int getMaxSources() const; - void play(love::audio::Source *source); - void play(); - void stop(love::audio::Source *source); - void stop(); - void pause(love::audio::Source *source); - void pause(); - void resume(love::audio::Source *source); - void resume(); - void rewind(love::audio::Source *source); - void rewind(); - void setVolume(float volume); - float getVolume() const; - - void getPosition(float *v) const; - void setPosition(float *v); - void getOrientation(float *v) const; - void setOrientation(float *v); - void getVelocity(float *v) const; - void setVelocity(float *v); - - void record(); - love::sound::SoundData *getRecordedData(); - love::sound::SoundData *stopRecording(bool returnData); - bool canRecord(); - - DistanceModel getDistanceModel() const; - void setDistanceModel(DistanceModel distanceModel); - -private: - - // The OpenAL device. - ALCdevice *device; - - // The OpenAL capture device (microphone). - ALCdevice *capture; - - // The OpenAL context. - ALCcontext *context; - - // The Pool. - Pool *pool; - - class PoolThread: public thread::ThreadBase - { - protected: - Pool *pool; - - // Set this to true when the thread should finish. - // Main thread will write to this value, and PoolThread - // will read from it. - volatile bool finish; - - // finish lock - thread::Mutex mutex; - - virtual void main(); - - public: - PoolThread(Pool *pool); - void setFinish(); - }; - - PoolThread *poolThread; - - DistanceModel distanceModel; - -}; // Audio - -} // openal -} // audio -} // love - -#endif // LOVE_AUDIO_OPENAL_AUDIO_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_OPENAL_AUDIO_H +#define LOVE_AUDIO_OPENAL_AUDIO_H + +// STD +#include +#include +#include +#include + +// LOVE +#include "audio/Audio.h" +#include "common/config.h" +#include "sound/SoundData.h" + +#include "Source.h" +#include "Pool.h" +#include "thread/threads.h" + +// OpenAL +#ifdef LOVE_MACOSX +#include +#include +#else +#include +#include +#endif + +namespace love +{ +namespace audio +{ +namespace openal +{ + +class Audio : public love::audio::Audio +{ +public: + + Audio(); + ~Audio(); + + // Implements Module. + const char *getName() const; + + // Implements Audio. + love::audio::Source *newSource(love::sound::Decoder *decoder); + love::audio::Source *newSource(love::sound::SoundData *soundData); + int getNumSources() const; + int getMaxSources() const; + void play(love::audio::Source *source); + void play(); + void stop(love::audio::Source *source); + void stop(); + void pause(love::audio::Source *source); + void pause(); + void resume(love::audio::Source *source); + void resume(); + void rewind(love::audio::Source *source); + void rewind(); + void setVolume(float volume); + float getVolume() const; + + void getPosition(float *v) const; + void setPosition(float *v); + void getOrientation(float *v) const; + void setOrientation(float *v); + void getVelocity(float *v) const; + void setVelocity(float *v); + + void record(); + love::sound::SoundData *getRecordedData(); + love::sound::SoundData *stopRecording(bool returnData); + bool canRecord(); + + DistanceModel getDistanceModel() const; + void setDistanceModel(DistanceModel distanceModel); + +private: + + // The OpenAL device. + ALCdevice *device; + + // The OpenAL capture device (microphone). + ALCdevice *capture; + + // The OpenAL context. + ALCcontext *context; + + // The Pool. + Pool *pool; + + class PoolThread: public thread::ThreadBase + { + protected: + Pool *pool; + + // Set this to true when the thread should finish. + // Main thread will write to this value, and PoolThread + // will read from it. + volatile bool finish; + + // finish lock + thread::Mutex mutex; + + virtual void main(); + + public: + PoolThread(Pool *pool); + void setFinish(); + }; + + PoolThread *poolThread; + + DistanceModel distanceModel; + +}; // Audio + +} // openal +} // audio +} // love + +#endif // LOVE_AUDIO_OPENAL_AUDIO_H diff --git a/src/modules/audio/openal/Pool.cpp b/src/modules/audio/openal/Pool.cpp index 1950a4bcf..14e9699dd 100644 --- a/src/modules/audio/openal/Pool.cpp +++ b/src/modules/audio/openal/Pool.cpp @@ -1,293 +1,293 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Pool.h" - -#include "Source.h" - -namespace love -{ -namespace audio -{ -namespace openal -{ - -Pool::Pool() -{ - // Generate sources. - alGenSources(NUM_SOURCES, sources); - - // Create the mutex. - mutex = new thread::Mutex(); - - if (alGetError() != AL_NO_ERROR) - throw love::Exception("Could not generate sources."); - - // Make all sources available initially. - for (int i = 0; i < NUM_SOURCES; i++) - { -#ifdef AL_DIRECT_CHANNELS_SOFT - // Bypassing virtualization of speakers for multi-channel sources in OpenAL Soft. - alSourcei(sources[i], AL_DIRECT_CHANNELS_SOFT, AL_TRUE); -#endif - available.push(sources[i]); - } -} - -Pool::~Pool() -{ - stop(); - - delete mutex; - - // Free all sources. - alDeleteSources(NUM_SOURCES, sources); -} - -bool Pool::isAvailable() const -{ - bool has = false; - { - thread::Lock lock(mutex); - has = !available.empty(); - } - return has; -} - -bool Pool::isPlaying(Source *s) -{ - bool p = false; - { - thread::Lock lock(mutex); - for (std::map::iterator i = playing.begin(); i != playing.end(); i++) - { - if (i->first == s) - p = true; - } - } - return p; -} - -void Pool::update() -{ - thread::Lock lock(mutex); - - std::map::iterator i = playing.begin(); - - while (i != playing.end()) - { - if (!i->first->update()) - { - i->first->stopAtomic(); - i->first->rewindAtomic(); - i->first->release(); - available.push(i->second); - playing.erase(i++); - } - else - i++; - } -} - -int Pool::getNumSources() const -{ - return playing.size(); -} - -int Pool::getMaxSources() const -{ - return NUM_SOURCES; -} - -bool Pool::play(Source *source, ALuint &out) -{ - bool ok; - out = 0; - - thread::Lock lock(mutex); - - bool alreadyPlaying = findSource(source, out); - - if (!alreadyPlaying) - { - // Try to play. - if (!available.empty()) - { - // Get the first available source. - out = available.front(); - - // Remove it. - available.pop(); - - // Insert into map of playing sources. - playing.insert(std::pair(source, out)); - - source->retain(); - - source->playAtomic(); - - ok = true; - } - else - { - ok = false; - } - } - else - { - ok = true; - } - - return ok; -} - -void Pool::stop() -{ - thread::Lock lock(mutex); - for (std::map::iterator i = playing.begin(); i != playing.end(); i++) - { - i->first->stopAtomic(); - i->first->release(); - available.push(i->second); - } - - playing.clear(); -} - -void Pool::stop(Source *source) -{ - thread::Lock lock(mutex); - removeSource(source); -} - -void Pool::pause() -{ - thread::Lock lock(mutex); - for (std::map::iterator i = playing.begin(); i != playing.end(); i++) - i->first->pauseAtomic(); -} - -void Pool::pause(Source *source) -{ - thread::Lock lock(mutex); - ALuint out; - if (findSource(source, out)) - source->pauseAtomic(); -} - -void Pool::resume() -{ - thread::Lock lock(mutex); - for (std::map::iterator i = playing.begin(); i != playing.end(); i++) - i->first->resumeAtomic(); -} - -void Pool::resume(Source *source) -{ - thread::Lock lock(mutex); - ALuint out; - if (findSource(source, out)) - source->resumeAtomic(); -} - -void Pool::rewind() -{ - thread::Lock lock(mutex); - for (std::map::iterator i = playing.begin(); i != playing.end(); i++) - i->first->rewindAtomic(); -} - -// For those times we don't need it backed. -void Pool::softRewind(Source *source) -{ - thread::Lock lock(mutex); - source->rewindAtomic(); -} - -void Pool::rewind(Source *source) -{ - thread::Lock lock(mutex); - source->rewindAtomic(); -} - -void Pool::release(Source *source) -{ - ALuint s = findi(source); - - if (s != 0) - { - available.push(s); - playing.erase(source); - } -} - -void Pool::seek(Source *source, float offset, void *unit) -{ - thread::Lock lock(mutex); - return source->seekAtomic(offset, unit); -} - -float Pool::tell(Source *source, void *unit) -{ - thread::Lock lock(mutex); - return source->tellAtomic(unit); -} - -ALuint Pool::findi(const Source *source) const -{ - std::map::const_iterator i = playing.find((Source *)source); - - if (i != playing.end()) - return i->second; - - return 0; -} - -bool Pool::findSource(Source *source, ALuint &out) -{ - std::map::const_iterator i = playing.find((Source *)source); - - bool found = i != playing.end(); - - if (found) - out = i->second; - - return found; -} - -bool Pool::removeSource(Source *source) -{ - std::map::iterator i = playing.find((Source *)source); - - if (i != playing.end()) - { - source->stopAtomic(); - available.push(i->second); - playing.erase(i++); - source->release(); - return true; - } - - return false; -} - -} // openal -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Pool.h" + +#include "Source.h" + +namespace love +{ +namespace audio +{ +namespace openal +{ + +Pool::Pool() +{ + // Generate sources. + alGenSources(NUM_SOURCES, sources); + + // Create the mutex. + mutex = new thread::Mutex(); + + if (alGetError() != AL_NO_ERROR) + throw love::Exception("Could not generate sources."); + + // Make all sources available initially. + for (int i = 0; i < NUM_SOURCES; i++) + { +#ifdef AL_DIRECT_CHANNELS_SOFT + // Bypassing virtualization of speakers for multi-channel sources in OpenAL Soft. + alSourcei(sources[i], AL_DIRECT_CHANNELS_SOFT, AL_TRUE); +#endif + available.push(sources[i]); + } +} + +Pool::~Pool() +{ + stop(); + + delete mutex; + + // Free all sources. + alDeleteSources(NUM_SOURCES, sources); +} + +bool Pool::isAvailable() const +{ + bool has = false; + { + thread::Lock lock(mutex); + has = !available.empty(); + } + return has; +} + +bool Pool::isPlaying(Source *s) +{ + bool p = false; + { + thread::Lock lock(mutex); + for (std::map::iterator i = playing.begin(); i != playing.end(); i++) + { + if (i->first == s) + p = true; + } + } + return p; +} + +void Pool::update() +{ + thread::Lock lock(mutex); + + std::map::iterator i = playing.begin(); + + while (i != playing.end()) + { + if (!i->first->update()) + { + i->first->stopAtomic(); + i->first->rewindAtomic(); + i->first->release(); + available.push(i->second); + playing.erase(i++); + } + else + i++; + } +} + +int Pool::getNumSources() const +{ + return playing.size(); +} + +int Pool::getMaxSources() const +{ + return NUM_SOURCES; +} + +bool Pool::play(Source *source, ALuint &out) +{ + bool ok; + out = 0; + + thread::Lock lock(mutex); + + bool alreadyPlaying = findSource(source, out); + + if (!alreadyPlaying) + { + // Try to play. + if (!available.empty()) + { + // Get the first available source. + out = available.front(); + + // Remove it. + available.pop(); + + // Insert into map of playing sources. + playing.insert(std::pair(source, out)); + + source->retain(); + + source->playAtomic(); + + ok = true; + } + else + { + ok = false; + } + } + else + { + ok = true; + } + + return ok; +} + +void Pool::stop() +{ + thread::Lock lock(mutex); + for (std::map::iterator i = playing.begin(); i != playing.end(); i++) + { + i->first->stopAtomic(); + i->first->release(); + available.push(i->second); + } + + playing.clear(); +} + +void Pool::stop(Source *source) +{ + thread::Lock lock(mutex); + removeSource(source); +} + +void Pool::pause() +{ + thread::Lock lock(mutex); + for (std::map::iterator i = playing.begin(); i != playing.end(); i++) + i->first->pauseAtomic(); +} + +void Pool::pause(Source *source) +{ + thread::Lock lock(mutex); + ALuint out; + if (findSource(source, out)) + source->pauseAtomic(); +} + +void Pool::resume() +{ + thread::Lock lock(mutex); + for (std::map::iterator i = playing.begin(); i != playing.end(); i++) + i->first->resumeAtomic(); +} + +void Pool::resume(Source *source) +{ + thread::Lock lock(mutex); + ALuint out; + if (findSource(source, out)) + source->resumeAtomic(); +} + +void Pool::rewind() +{ + thread::Lock lock(mutex); + for (std::map::iterator i = playing.begin(); i != playing.end(); i++) + i->first->rewindAtomic(); +} + +// For those times we don't need it backed. +void Pool::softRewind(Source *source) +{ + thread::Lock lock(mutex); + source->rewindAtomic(); +} + +void Pool::rewind(Source *source) +{ + thread::Lock lock(mutex); + source->rewindAtomic(); +} + +void Pool::release(Source *source) +{ + ALuint s = findi(source); + + if (s != 0) + { + available.push(s); + playing.erase(source); + } +} + +void Pool::seek(Source *source, float offset, void *unit) +{ + thread::Lock lock(mutex); + return source->seekAtomic(offset, unit); +} + +float Pool::tell(Source *source, void *unit) +{ + thread::Lock lock(mutex); + return source->tellAtomic(unit); +} + +ALuint Pool::findi(const Source *source) const +{ + std::map::const_iterator i = playing.find((Source *)source); + + if (i != playing.end()) + return i->second; + + return 0; +} + +bool Pool::findSource(Source *source, ALuint &out) +{ + std::map::const_iterator i = playing.find((Source *)source); + + bool found = i != playing.end(); + + if (found) + out = i->second; + + return found; +} + +bool Pool::removeSource(Source *source) +{ + std::map::iterator i = playing.find((Source *)source); + + if (i != playing.end()) + { + source->stopAtomic(); + available.push(i->second); + playing.erase(i++); + source->release(); + return true; + } + + return false; +} + +} // openal +} // audio +} // love diff --git a/src/modules/audio/openal/Pool.h b/src/modules/audio/openal/Pool.h index c7563afaa..337c0a44b 100644 --- a/src/modules/audio/openal/Pool.h +++ b/src/modules/audio/openal/Pool.h @@ -1,124 +1,124 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_OPENAL_POOL_H -#define LOVE_AUDIO_OPENAL_POOL_H - -// STD -#include -#include -#include -#include - -// LOVE -#include "common/config.h" -#include "common/Exception.h" -#include "thread/threads.h" - -// OpenAL -#ifdef LOVE_MACOSX -#include -#include -#else -#include -#include -#include -#endif - -namespace love -{ -namespace audio -{ -namespace openal -{ - -class Source; - -class Pool -{ -public: - - Pool(); - ~Pool(); - - /** - * Checks whether an OpenAL source is available. - * @return True if at least one is available, false otherwise. - **/ - bool isAvailable() const; - - /** - * Checks whether a Source is currently in the playing list. - **/ - bool isPlaying(Source *s); - - void update(); - - int getNumSources() const; - int getMaxSources() const; - - bool play(Source *source, ALuint &out); - void stop(); - void stop(Source *source); - void pause(); - void pause(Source *source); - void resume(); - void resume(Source *source); - void rewind(); - void rewind(Source *source); - void softRewind(Source *source); - void seek(Source *source, float offset, void *unit); - float tell(Source *source, void *unit); - -private: - - /** - * Makes the specified OpenAL source available for use. - * @param source The OpenAL source. - **/ - void release(Source *source); - - ALuint findi(const Source *source) const; - - bool findSource(Source *source, ALuint &out); - bool removeSource(Source *source); - // Number of OpenAL sources. - static const int NUM_SOURCES = 64; - - // OpenAL sources - ALuint sources[NUM_SOURCES]; - - // A queue of available sources. - std::queue available; - - // A map of playing sources. - std::map playing; - - // Only one thread can access this object at the same time. This mutex will - // make sure of that. - thread::Mutex *mutex; - -}; // Pool - -} // openal -} // audio -} // love - -#endif // LOVE_AUDIO_OPENAL_POOL_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_OPENAL_POOL_H +#define LOVE_AUDIO_OPENAL_POOL_H + +// STD +#include +#include +#include +#include + +// LOVE +#include "common/config.h" +#include "common/Exception.h" +#include "thread/threads.h" + +// OpenAL +#ifdef LOVE_MACOSX +#include +#include +#else +#include +#include +#include +#endif + +namespace love +{ +namespace audio +{ +namespace openal +{ + +class Source; + +class Pool +{ +public: + + Pool(); + ~Pool(); + + /** + * Checks whether an OpenAL source is available. + * @return True if at least one is available, false otherwise. + **/ + bool isAvailable() const; + + /** + * Checks whether a Source is currently in the playing list. + **/ + bool isPlaying(Source *s); + + void update(); + + int getNumSources() const; + int getMaxSources() const; + + bool play(Source *source, ALuint &out); + void stop(); + void stop(Source *source); + void pause(); + void pause(Source *source); + void resume(); + void resume(Source *source); + void rewind(); + void rewind(Source *source); + void softRewind(Source *source); + void seek(Source *source, float offset, void *unit); + float tell(Source *source, void *unit); + +private: + + /** + * Makes the specified OpenAL source available for use. + * @param source The OpenAL source. + **/ + void release(Source *source); + + ALuint findi(const Source *source) const; + + bool findSource(Source *source, ALuint &out); + bool removeSource(Source *source); + // Number of OpenAL sources. + static const int NUM_SOURCES = 64; + + // OpenAL sources + ALuint sources[NUM_SOURCES]; + + // A queue of available sources. + std::queue available; + + // A map of playing sources. + std::map playing; + + // Only one thread can access this object at the same time. This mutex will + // make sure of that. + thread::Mutex *mutex; + +}; // Pool + +} // openal +} // audio +} // love + +#endif // LOVE_AUDIO_OPENAL_POOL_H diff --git a/src/modules/audio/openal/Source.cpp b/src/modules/audio/openal/Source.cpp index b858eb7ba..315825b7c 100644 --- a/src/modules/audio/openal/Source.cpp +++ b/src/modules/audio/openal/Source.cpp @@ -1,724 +1,724 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Source.h" - -#include "Pool.h" - -// STD -#include -#include - -namespace love -{ -namespace audio -{ -namespace openal -{ - -Source::Source(Pool *pool, love::sound::SoundData *soundData) - : love::audio::Source(Source::TYPE_STATIC) - , pool(pool) - , valid(false) - , pitch(1.0f) - , volume(1.0f) - , looping(false) - , paused(false) - , minVolume(0.0f) - , maxVolume(1.0f) - , referenceDistance(1.0f) - , rolloffFactor(1.0f) - , maxDistance(FLT_MAX) - , offsetSamples(0) - , offsetSeconds(0) - , decoder(0) - , toLoop(0) -{ - alGenBuffers(1, buffers); - ALenum fmt = getFormat(soundData->getChannels(), soundData->getBits()); - alBufferData(buffers[0], fmt, soundData->getData(), soundData->getSize(), soundData->getSampleRate()); - - static float z[3] = {0, 0, 0}; - - setFloatv(position, z); - setFloatv(velocity, z); - setFloatv(direction, z); -} - -Source::Source(Pool *pool, love::sound::Decoder *decoder) - : love::audio::Source(Source::TYPE_STREAM) - , pool(pool) - , valid(false) - , pitch(1.0f) - , volume(1.0f) - , looping(false) - , paused(false) - , minVolume(0.0f) - , maxVolume(1.0f) - , referenceDistance(1.0f) - , rolloffFactor(1.0f) - , maxDistance(FLT_MAX) - , offsetSamples(0) - , offsetSeconds(0) - , decoder(decoder) - , toLoop(0) -{ - decoder->retain(); - alGenBuffers(MAX_BUFFERS, buffers); - - static float z[3] = {0, 0, 0}; - - setFloatv(position, z); - setFloatv(velocity, z); - setFloatv(direction, z); -} - -Source::~Source() -{ - if (valid) - pool->stop(this); - alDeleteBuffers((type == TYPE_STATIC) ? 1 : MAX_BUFFERS, buffers); - if (decoder) - decoder->release(); -} - -love::audio::Source *Source::copy() -{ - return 0; -} - -void Source::play() -{ - if (valid && paused) - { - pool->resume(this); - return; - } - - valid = pool->play(this, source); - - if (valid) - reset(source); -} - -void Source::stop() -{ - if (!isStopped()) - { - pool->stop(this); - pool->softRewind(this); - } -} - -void Source::pause() -{ - pool->pause(this); -} - -void Source::resume() -{ - pool->resume(this); -} - -void Source::rewind() -{ - pool->rewind(this); -} - -bool Source::isStopped() const -{ - if (valid) - { - ALenum state; - alGetSourcei(source, AL_SOURCE_STATE, &state); - return (state == AL_STOPPED); - } - - return true; -} - -bool Source::isPaused() const -{ - if (valid) - { - ALenum state; - alGetSourcei(source, AL_SOURCE_STATE, &state); - return (state == AL_PAUSED); - } - - return false; -} - -bool Source::isFinished() const -{ - return type == TYPE_STATIC ? isStopped() : isStopped() && !isLooping() && decoder->isFinished(); -} - -bool Source::update() -{ - if (!valid) - return false; - if (type == TYPE_STATIC) - { - // Looping mode could have changed. - alSourcei(source, AL_LOOPING, isLooping() ? AL_TRUE : AL_FALSE); - return !isStopped(); - } - else if (type == TYPE_STREAM && (isLooping() || !isFinished())) - { - // Number of processed buffers. - ALint processed = 0; - - alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed); - - while (processed--) - { - ALuint buffer; - - float curOffsetSamples, curOffsetSecs; - - alGetSourcef(source, AL_SAMPLE_OFFSET, &curOffsetSamples); - - ALint b; - alGetSourcei(source, AL_BUFFER, &b); - int freq; - alGetBufferi(b, AL_FREQUENCY, &freq); - curOffsetSecs = curOffsetSamples / freq; - - // Get a free buffer. - alSourceUnqueueBuffers(source, 1, &buffer); - - float newOffsetSamples, newOffsetSecs; - - alGetSourcef(source, AL_SAMPLE_OFFSET, &newOffsetSamples); - newOffsetSecs = newOffsetSamples / freq; - - offsetSamples += (curOffsetSamples - newOffsetSamples); - offsetSeconds += (curOffsetSecs - newOffsetSecs); - - streamAtomic(buffer, decoder); - alSourceQueueBuffers(source, 1, &buffer); - } - return true; - } - return false; -} - -void Source::setPitch(float pitch) -{ - if (valid) - alSourcef(source, AL_PITCH, pitch); - - this->pitch = pitch; -} - -float Source::getPitch() const -{ - if (valid) - { - ALfloat f; - alGetSourcef(source, AL_PITCH, &f); - return f; - } - - // In case the Source isn't playing. - return pitch; -} - -void Source::setVolume(float volume) -{ - if (valid) - { - alSourcef(source, AL_GAIN, volume); - } - - this->volume = volume; -} - -float Source::getVolume() const -{ - if (valid) - { - ALfloat f; - alGetSourcef(source, AL_GAIN, &f); - return f; - } - - // In case the Source isn't playing. - return volume; -} - -void Source::seekAtomic(float offset, void *unit) -{ - if (valid) - { - switch (*((Source::Unit *) unit)) - { - case Source::UNIT_SAMPLES: - if (type == TYPE_STREAM) - { - offsetSamples = offset; - ALint buffer; - alGetSourcei(source, AL_BUFFER, &buffer); - int freq; - alGetBufferi(buffer, AL_FREQUENCY, &freq); - offset /= freq; - offsetSeconds = offset; - decoder->seek(offset); - } - else - { - alSourcef(source, AL_SAMPLE_OFFSET, offset); - } - break; - case Source::UNIT_SECONDS: - default: - if (type == TYPE_STREAM) - { - offsetSeconds = offset; - decoder->seek(offset); - ALint buffer; - alGetSourcei(source, AL_BUFFER, &buffer); - int freq; - alGetBufferi(buffer, AL_FREQUENCY, &freq); - offsetSamples = offset*freq; - } - else - { - alSourcef(source, AL_SEC_OFFSET, offset); - } - break; - } - if (type == TYPE_STREAM) - { - bool waspaused = paused; - // Because we still have old data - // from before the seek in the buffers - // let's empty them. - stopAtomic(); - playAtomic(); - if (waspaused) - pauseAtomic(); - } - } -} - -void Source::seek(float offset, Source::Unit unit) -{ - return pool->seek(this, offset, &unit); -} - -float Source::tellAtomic(void *unit) const -{ - if (valid) - { - float offset; - switch (*((Source::Unit *) unit)) - { - case Source::UNIT_SAMPLES: - alGetSourcef(source, AL_SAMPLE_OFFSET, &offset); - if (type == TYPE_STREAM) offset += offsetSamples; - break; - case Source::UNIT_SECONDS: - default: - alGetSourcef(source, AL_SAMPLE_OFFSET, &offset); - ALint buffer; - alGetSourcei(source, AL_BUFFER, &buffer); - int freq; - alGetBufferi(buffer, AL_FREQUENCY, &freq); - offset /= freq; - if (type == TYPE_STREAM) offset += offsetSeconds; - break; - } - return offset; - } - return 0.0f; -} - -float Source::tell(Source::Unit unit) -{ - return pool->tell(this, &unit); -} - -void Source::setPosition(float *v) -{ - if (valid) - alSourcefv(source, AL_POSITION, v); - - setFloatv(position, v); -} - -void Source::getPosition(float *v) const -{ - if (valid) - alGetSourcefv(source, AL_POSITION, v); - else - setFloatv(v, position); -} - -void Source::setVelocity(float *v) -{ - if (valid) - alSourcefv(source, AL_VELOCITY, v); - - setFloatv(velocity, v); -} - -void Source::getVelocity(float *v) const -{ - if (valid) - alGetSourcefv(source, AL_VELOCITY, v); - else - setFloatv(v, velocity); -} - -void Source::setDirection(float *v) -{ - if (valid) - alSourcefv(source, AL_DIRECTION, v); - else - setFloatv(direction, v); -} - -void Source::getDirection(float *v) const -{ - if (valid) - alGetSourcefv(source, AL_DIRECTION, v); - else - setFloatv(v, direction); -} - -void Source::setLooping(bool looping) -{ - if (valid && type == TYPE_STATIC) - alSourcei(source, AL_LOOPING, looping ? AL_TRUE : AL_FALSE); - - this->looping = looping; -} - -bool Source::isLooping() const -{ - return looping; -} - -void Source::playAtomic() -{ - if (type == TYPE_STATIC) - { - alSourcei(source, AL_BUFFER, buffers[0]); - } - else if (type == TYPE_STREAM) - { - int usedBuffers = 0; - - for (unsigned int i = 0; i < MAX_BUFFERS; i++) - { - streamAtomic(buffers[i], decoder); - ++usedBuffers; - if (decoder->isFinished()) - break; - } - - if (usedBuffers > 0) - alSourceQueueBuffers(source, usedBuffers, buffers); - } - - // Set these properties. These may have changed while we've - // been without an AL source. - alSourcef(source, AL_PITCH, pitch); - alSourcef(source, AL_GAIN, volume); - alSourcef(source, AL_MIN_GAIN, minVolume); - alSourcef(source, AL_MAX_GAIN, maxVolume); - alSourcef(source, AL_REFERENCE_DISTANCE, referenceDistance); - alSourcef(source, AL_ROLLOFF_FACTOR, rolloffFactor); - alSourcef(source, AL_MAX_DISTANCE, maxDistance); - - alSourcePlay(source); - - valid = true; //if it fails it will be set to false again - //but this prevents a horrible, horrible bug -} - -void Source::stopAtomic() -{ - if (valid) - { - if (type == TYPE_STATIC) - { - alSourceStop(source); - } - else if (type == TYPE_STREAM) - { - alSourceStop(source); - int queued = 0; - alGetSourcei(source, AL_BUFFERS_QUEUED, &queued); - - while (queued--) - { - ALuint buffer; - alSourceUnqueueBuffers(source, 1, &buffer); - } - } - alSourcei(source, AL_BUFFER, AL_NONE); - } - toLoop = 0; - valid = false; -} - -void Source::pauseAtomic() -{ - if (valid) - { - alSourcePause(source); - paused = true; - } -} - -void Source::resumeAtomic() -{ - if (valid && paused) - { - alSourcePlay(source); - paused = false; - } -} - -void Source::rewindAtomic() -{ - if (valid && type == TYPE_STATIC) - { - alSourceRewind(source); - if (!paused) - alSourcePlay(source); - } - else if (valid && type == TYPE_STREAM) - { - bool waspaused = paused; - decoder->rewind(); - // Because we still have old data - // from before the seek in the buffers - // let's empty them. - stopAtomic(); - playAtomic(); - if (waspaused) - pauseAtomic(); - offsetSamples = 0; - offsetSeconds = 0; - } - else if (type == TYPE_STREAM) - { - decoder->rewind(); - offsetSamples = 0; - offsetSeconds = 0; - } -} - -void Source::reset(ALenum source) -{ - alSourcefv(source, AL_POSITION, position); - alSourcefv(source, AL_VELOCITY, velocity); - alSourcefv(source, AL_DIRECTION, direction); - alSourcef(source, AL_PITCH, pitch); - alSourcef(source, AL_GAIN, volume); - alSourcef(source, AL_MIN_GAIN, minVolume); - alSourcef(source, AL_MAX_GAIN, maxVolume); - alSourcef(source, AL_REFERENCE_DISTANCE, referenceDistance); - alSourcef(source, AL_ROLLOFF_FACTOR, rolloffFactor); - alSourcef(source, AL_MAX_DISTANCE, maxDistance); -} - -void Source::setFloatv(float *dst, const float *src) const -{ - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; -} - -ALenum Source::getFormat(int channels, int bits) const -{ - if (channels == 1 && bits == 8) - return AL_FORMAT_MONO8; - else if (channels == 1 && bits == 16) - return AL_FORMAT_MONO16; - else if (channels == 2 && bits == 8) - return AL_FORMAT_STEREO8; - else if (channels == 2 && bits == 16) - return AL_FORMAT_STEREO16; - else - return 0; -} - -int Source::streamAtomic(ALuint buffer, love::sound::Decoder *d) -{ - // Get more sound data. - int decoded = d->decode(); - - int fmt = getFormat(d->getChannels(), d->getBits()); - - if (fmt != 0) - alBufferData(buffer, fmt, d->getBuffer(), decoded, d->getSampleRate()); - - if (decoder->isFinished() && isLooping()) - { - int queued, processed; - alGetSourcei(source, AL_BUFFERS_QUEUED, &queued); - alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed); - if (queued > processed) - toLoop = queued-processed; - else - toLoop = MAX_BUFFERS-processed; - d->rewind(); - } - - if (toLoop > 0) - { - if (--toLoop == 0) - { - offsetSamples = 0; - offsetSeconds = 0; - } - } - - return decoded; -} - -bool Source::isStatic() const -{ - return (type == TYPE_STATIC); -} - -void Source::setMinVolume(float volume) -{ - if (valid) - { - alSourcef(source, AL_MIN_GAIN, volume); - } - - this->minVolume = volume; -} - -float Source::getMinVolume() const -{ - if (valid) - { - ALfloat f; - alGetSourcef(source, AL_MIN_GAIN, &f); - return f; - } - - // In case the Source isn't playing. - return this->minVolume; -} - -void Source::setMaxVolume(float volume) -{ - if (valid) - { - alSourcef(source, AL_MAX_GAIN, volume); - } - - this->maxVolume = volume; -} - -float Source::getMaxVolume() const -{ - if (valid) - { - ALfloat f; - alGetSourcef(source, AL_MAX_GAIN, &f); - return f; - } - - // In case the Source isn't playing. - return this->maxVolume; -} - -void Source::setReferenceDistance(float distance) -{ - if (valid) - { - alSourcef(source, AL_REFERENCE_DISTANCE, distance); - } - - this->referenceDistance = distance; -} - -float Source::getReferenceDistance() const -{ - if (valid) - { - ALfloat f; - alGetSourcef(source, AL_REFERENCE_DISTANCE, &f); - return f; - } - - // In case the Source isn't playing. - return this->referenceDistance; -} - -void Source::setRolloffFactor(float factor) -{ - if (valid) - { - alSourcef(source, AL_ROLLOFF_FACTOR, factor); - } - - this->rolloffFactor = factor; -} - -float Source::getRolloffFactor() const -{ - if (valid) - { - ALfloat f; - alGetSourcef(source, AL_ROLLOFF_FACTOR, &f); - return f; - } - - // In case the Source isn't playing. - return this->rolloffFactor; -} - -void Source::setMaxDistance(float distance) -{ - if (valid) - { - alSourcef(source, AL_MAX_DISTANCE, distance); - } - - this->maxDistance = distance; -} - -float Source::getMaxDistance() const -{ - if (valid) - { - ALfloat f; - alGetSourcef(source, AL_MAX_DISTANCE, &f); - return f; - } - - // In case the Source isn't playing. - return this->maxDistance; -} - -} // openal -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Source.h" + +#include "Pool.h" + +// STD +#include +#include + +namespace love +{ +namespace audio +{ +namespace openal +{ + +Source::Source(Pool *pool, love::sound::SoundData *soundData) + : love::audio::Source(Source::TYPE_STATIC) + , pool(pool) + , valid(false) + , pitch(1.0f) + , volume(1.0f) + , looping(false) + , paused(false) + , minVolume(0.0f) + , maxVolume(1.0f) + , referenceDistance(1.0f) + , rolloffFactor(1.0f) + , maxDistance(FLT_MAX) + , offsetSamples(0) + , offsetSeconds(0) + , decoder(0) + , toLoop(0) +{ + alGenBuffers(1, buffers); + ALenum fmt = getFormat(soundData->getChannels(), soundData->getBits()); + alBufferData(buffers[0], fmt, soundData->getData(), soundData->getSize(), soundData->getSampleRate()); + + static float z[3] = {0, 0, 0}; + + setFloatv(position, z); + setFloatv(velocity, z); + setFloatv(direction, z); +} + +Source::Source(Pool *pool, love::sound::Decoder *decoder) + : love::audio::Source(Source::TYPE_STREAM) + , pool(pool) + , valid(false) + , pitch(1.0f) + , volume(1.0f) + , looping(false) + , paused(false) + , minVolume(0.0f) + , maxVolume(1.0f) + , referenceDistance(1.0f) + , rolloffFactor(1.0f) + , maxDistance(FLT_MAX) + , offsetSamples(0) + , offsetSeconds(0) + , decoder(decoder) + , toLoop(0) +{ + decoder->retain(); + alGenBuffers(MAX_BUFFERS, buffers); + + static float z[3] = {0, 0, 0}; + + setFloatv(position, z); + setFloatv(velocity, z); + setFloatv(direction, z); +} + +Source::~Source() +{ + if (valid) + pool->stop(this); + alDeleteBuffers((type == TYPE_STATIC) ? 1 : MAX_BUFFERS, buffers); + if (decoder) + decoder->release(); +} + +love::audio::Source *Source::copy() +{ + return 0; +} + +void Source::play() +{ + if (valid && paused) + { + pool->resume(this); + return; + } + + valid = pool->play(this, source); + + if (valid) + reset(source); +} + +void Source::stop() +{ + if (!isStopped()) + { + pool->stop(this); + pool->softRewind(this); + } +} + +void Source::pause() +{ + pool->pause(this); +} + +void Source::resume() +{ + pool->resume(this); +} + +void Source::rewind() +{ + pool->rewind(this); +} + +bool Source::isStopped() const +{ + if (valid) + { + ALenum state; + alGetSourcei(source, AL_SOURCE_STATE, &state); + return (state == AL_STOPPED); + } + + return true; +} + +bool Source::isPaused() const +{ + if (valid) + { + ALenum state; + alGetSourcei(source, AL_SOURCE_STATE, &state); + return (state == AL_PAUSED); + } + + return false; +} + +bool Source::isFinished() const +{ + return type == TYPE_STATIC ? isStopped() : isStopped() && !isLooping() && decoder->isFinished(); +} + +bool Source::update() +{ + if (!valid) + return false; + if (type == TYPE_STATIC) + { + // Looping mode could have changed. + alSourcei(source, AL_LOOPING, isLooping() ? AL_TRUE : AL_FALSE); + return !isStopped(); + } + else if (type == TYPE_STREAM && (isLooping() || !isFinished())) + { + // Number of processed buffers. + ALint processed = 0; + + alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed); + + while (processed--) + { + ALuint buffer; + + float curOffsetSamples, curOffsetSecs; + + alGetSourcef(source, AL_SAMPLE_OFFSET, &curOffsetSamples); + + ALint b; + alGetSourcei(source, AL_BUFFER, &b); + int freq; + alGetBufferi(b, AL_FREQUENCY, &freq); + curOffsetSecs = curOffsetSamples / freq; + + // Get a free buffer. + alSourceUnqueueBuffers(source, 1, &buffer); + + float newOffsetSamples, newOffsetSecs; + + alGetSourcef(source, AL_SAMPLE_OFFSET, &newOffsetSamples); + newOffsetSecs = newOffsetSamples / freq; + + offsetSamples += (curOffsetSamples - newOffsetSamples); + offsetSeconds += (curOffsetSecs - newOffsetSecs); + + streamAtomic(buffer, decoder); + alSourceQueueBuffers(source, 1, &buffer); + } + return true; + } + return false; +} + +void Source::setPitch(float pitch) +{ + if (valid) + alSourcef(source, AL_PITCH, pitch); + + this->pitch = pitch; +} + +float Source::getPitch() const +{ + if (valid) + { + ALfloat f; + alGetSourcef(source, AL_PITCH, &f); + return f; + } + + // In case the Source isn't playing. + return pitch; +} + +void Source::setVolume(float volume) +{ + if (valid) + { + alSourcef(source, AL_GAIN, volume); + } + + this->volume = volume; +} + +float Source::getVolume() const +{ + if (valid) + { + ALfloat f; + alGetSourcef(source, AL_GAIN, &f); + return f; + } + + // In case the Source isn't playing. + return volume; +} + +void Source::seekAtomic(float offset, void *unit) +{ + if (valid) + { + switch (*((Source::Unit *) unit)) + { + case Source::UNIT_SAMPLES: + if (type == TYPE_STREAM) + { + offsetSamples = offset; + ALint buffer; + alGetSourcei(source, AL_BUFFER, &buffer); + int freq; + alGetBufferi(buffer, AL_FREQUENCY, &freq); + offset /= freq; + offsetSeconds = offset; + decoder->seek(offset); + } + else + { + alSourcef(source, AL_SAMPLE_OFFSET, offset); + } + break; + case Source::UNIT_SECONDS: + default: + if (type == TYPE_STREAM) + { + offsetSeconds = offset; + decoder->seek(offset); + ALint buffer; + alGetSourcei(source, AL_BUFFER, &buffer); + int freq; + alGetBufferi(buffer, AL_FREQUENCY, &freq); + offsetSamples = offset*freq; + } + else + { + alSourcef(source, AL_SEC_OFFSET, offset); + } + break; + } + if (type == TYPE_STREAM) + { + bool waspaused = paused; + // Because we still have old data + // from before the seek in the buffers + // let's empty them. + stopAtomic(); + playAtomic(); + if (waspaused) + pauseAtomic(); + } + } +} + +void Source::seek(float offset, Source::Unit unit) +{ + return pool->seek(this, offset, &unit); +} + +float Source::tellAtomic(void *unit) const +{ + if (valid) + { + float offset; + switch (*((Source::Unit *) unit)) + { + case Source::UNIT_SAMPLES: + alGetSourcef(source, AL_SAMPLE_OFFSET, &offset); + if (type == TYPE_STREAM) offset += offsetSamples; + break; + case Source::UNIT_SECONDS: + default: + alGetSourcef(source, AL_SAMPLE_OFFSET, &offset); + ALint buffer; + alGetSourcei(source, AL_BUFFER, &buffer); + int freq; + alGetBufferi(buffer, AL_FREQUENCY, &freq); + offset /= freq; + if (type == TYPE_STREAM) offset += offsetSeconds; + break; + } + return offset; + } + return 0.0f; +} + +float Source::tell(Source::Unit unit) +{ + return pool->tell(this, &unit); +} + +void Source::setPosition(float *v) +{ + if (valid) + alSourcefv(source, AL_POSITION, v); + + setFloatv(position, v); +} + +void Source::getPosition(float *v) const +{ + if (valid) + alGetSourcefv(source, AL_POSITION, v); + else + setFloatv(v, position); +} + +void Source::setVelocity(float *v) +{ + if (valid) + alSourcefv(source, AL_VELOCITY, v); + + setFloatv(velocity, v); +} + +void Source::getVelocity(float *v) const +{ + if (valid) + alGetSourcefv(source, AL_VELOCITY, v); + else + setFloatv(v, velocity); +} + +void Source::setDirection(float *v) +{ + if (valid) + alSourcefv(source, AL_DIRECTION, v); + else + setFloatv(direction, v); +} + +void Source::getDirection(float *v) const +{ + if (valid) + alGetSourcefv(source, AL_DIRECTION, v); + else + setFloatv(v, direction); +} + +void Source::setLooping(bool looping) +{ + if (valid && type == TYPE_STATIC) + alSourcei(source, AL_LOOPING, looping ? AL_TRUE : AL_FALSE); + + this->looping = looping; +} + +bool Source::isLooping() const +{ + return looping; +} + +void Source::playAtomic() +{ + if (type == TYPE_STATIC) + { + alSourcei(source, AL_BUFFER, buffers[0]); + } + else if (type == TYPE_STREAM) + { + int usedBuffers = 0; + + for (unsigned int i = 0; i < MAX_BUFFERS; i++) + { + streamAtomic(buffers[i], decoder); + ++usedBuffers; + if (decoder->isFinished()) + break; + } + + if (usedBuffers > 0) + alSourceQueueBuffers(source, usedBuffers, buffers); + } + + // Set these properties. These may have changed while we've + // been without an AL source. + alSourcef(source, AL_PITCH, pitch); + alSourcef(source, AL_GAIN, volume); + alSourcef(source, AL_MIN_GAIN, minVolume); + alSourcef(source, AL_MAX_GAIN, maxVolume); + alSourcef(source, AL_REFERENCE_DISTANCE, referenceDistance); + alSourcef(source, AL_ROLLOFF_FACTOR, rolloffFactor); + alSourcef(source, AL_MAX_DISTANCE, maxDistance); + + alSourcePlay(source); + + valid = true; //if it fails it will be set to false again + //but this prevents a horrible, horrible bug +} + +void Source::stopAtomic() +{ + if (valid) + { + if (type == TYPE_STATIC) + { + alSourceStop(source); + } + else if (type == TYPE_STREAM) + { + alSourceStop(source); + int queued = 0; + alGetSourcei(source, AL_BUFFERS_QUEUED, &queued); + + while (queued--) + { + ALuint buffer; + alSourceUnqueueBuffers(source, 1, &buffer); + } + } + alSourcei(source, AL_BUFFER, AL_NONE); + } + toLoop = 0; + valid = false; +} + +void Source::pauseAtomic() +{ + if (valid) + { + alSourcePause(source); + paused = true; + } +} + +void Source::resumeAtomic() +{ + if (valid && paused) + { + alSourcePlay(source); + paused = false; + } +} + +void Source::rewindAtomic() +{ + if (valid && type == TYPE_STATIC) + { + alSourceRewind(source); + if (!paused) + alSourcePlay(source); + } + else if (valid && type == TYPE_STREAM) + { + bool waspaused = paused; + decoder->rewind(); + // Because we still have old data + // from before the seek in the buffers + // let's empty them. + stopAtomic(); + playAtomic(); + if (waspaused) + pauseAtomic(); + offsetSamples = 0; + offsetSeconds = 0; + } + else if (type == TYPE_STREAM) + { + decoder->rewind(); + offsetSamples = 0; + offsetSeconds = 0; + } +} + +void Source::reset(ALenum source) +{ + alSourcefv(source, AL_POSITION, position); + alSourcefv(source, AL_VELOCITY, velocity); + alSourcefv(source, AL_DIRECTION, direction); + alSourcef(source, AL_PITCH, pitch); + alSourcef(source, AL_GAIN, volume); + alSourcef(source, AL_MIN_GAIN, minVolume); + alSourcef(source, AL_MAX_GAIN, maxVolume); + alSourcef(source, AL_REFERENCE_DISTANCE, referenceDistance); + alSourcef(source, AL_ROLLOFF_FACTOR, rolloffFactor); + alSourcef(source, AL_MAX_DISTANCE, maxDistance); +} + +void Source::setFloatv(float *dst, const float *src) const +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +ALenum Source::getFormat(int channels, int bits) const +{ + if (channels == 1 && bits == 8) + return AL_FORMAT_MONO8; + else if (channels == 1 && bits == 16) + return AL_FORMAT_MONO16; + else if (channels == 2 && bits == 8) + return AL_FORMAT_STEREO8; + else if (channels == 2 && bits == 16) + return AL_FORMAT_STEREO16; + else + return 0; +} + +int Source::streamAtomic(ALuint buffer, love::sound::Decoder *d) +{ + // Get more sound data. + int decoded = d->decode(); + + int fmt = getFormat(d->getChannels(), d->getBits()); + + if (fmt != 0) + alBufferData(buffer, fmt, d->getBuffer(), decoded, d->getSampleRate()); + + if (decoder->isFinished() && isLooping()) + { + int queued, processed; + alGetSourcei(source, AL_BUFFERS_QUEUED, &queued); + alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed); + if (queued > processed) + toLoop = queued-processed; + else + toLoop = MAX_BUFFERS-processed; + d->rewind(); + } + + if (toLoop > 0) + { + if (--toLoop == 0) + { + offsetSamples = 0; + offsetSeconds = 0; + } + } + + return decoded; +} + +bool Source::isStatic() const +{ + return (type == TYPE_STATIC); +} + +void Source::setMinVolume(float volume) +{ + if (valid) + { + alSourcef(source, AL_MIN_GAIN, volume); + } + + this->minVolume = volume; +} + +float Source::getMinVolume() const +{ + if (valid) + { + ALfloat f; + alGetSourcef(source, AL_MIN_GAIN, &f); + return f; + } + + // In case the Source isn't playing. + return this->minVolume; +} + +void Source::setMaxVolume(float volume) +{ + if (valid) + { + alSourcef(source, AL_MAX_GAIN, volume); + } + + this->maxVolume = volume; +} + +float Source::getMaxVolume() const +{ + if (valid) + { + ALfloat f; + alGetSourcef(source, AL_MAX_GAIN, &f); + return f; + } + + // In case the Source isn't playing. + return this->maxVolume; +} + +void Source::setReferenceDistance(float distance) +{ + if (valid) + { + alSourcef(source, AL_REFERENCE_DISTANCE, distance); + } + + this->referenceDistance = distance; +} + +float Source::getReferenceDistance() const +{ + if (valid) + { + ALfloat f; + alGetSourcef(source, AL_REFERENCE_DISTANCE, &f); + return f; + } + + // In case the Source isn't playing. + return this->referenceDistance; +} + +void Source::setRolloffFactor(float factor) +{ + if (valid) + { + alSourcef(source, AL_ROLLOFF_FACTOR, factor); + } + + this->rolloffFactor = factor; +} + +float Source::getRolloffFactor() const +{ + if (valid) + { + ALfloat f; + alGetSourcef(source, AL_ROLLOFF_FACTOR, &f); + return f; + } + + // In case the Source isn't playing. + return this->rolloffFactor; +} + +void Source::setMaxDistance(float distance) +{ + if (valid) + { + alSourcef(source, AL_MAX_DISTANCE, distance); + } + + this->maxDistance = distance; +} + +float Source::getMaxDistance() const +{ + if (valid) + { + ALfloat f; + alGetSourcef(source, AL_MAX_DISTANCE, &f); + return f; + } + + // In case the Source isn't playing. + return this->maxDistance; +} + +} // openal +} // audio +} // love diff --git a/src/modules/audio/openal/Source.h b/src/modules/audio/openal/Source.h index 14306ac85..b4f5aee21 100644 --- a/src/modules/audio/openal/Source.h +++ b/src/modules/audio/openal/Source.h @@ -1,150 +1,150 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_OPENAL_SOURCE_H -#define LOVE_AUDIO_OPENAL_SOURCE_H - -// LOVE -#include "common/config.h" -#include "common/Object.h" -#include "audio/Source.h" -#include "sound/SoundData.h" -#include "sound/Decoder.h" - -// OpenAL -#ifdef LOVE_MACOSX -#include -#include -#else -#include -#include -#endif - -namespace love -{ -namespace audio -{ -namespace openal -{ - -class Audio; -class Pool; - -class Source : public love::audio::Source -{ -public: - Source(Pool *pool, love::sound::SoundData *soundData); - Source(Pool *pool, love::sound::Decoder *decoder); - virtual ~Source(); - - virtual love::audio::Source *copy(); - virtual void play(); - virtual void stop(); - virtual void pause(); - virtual void resume(); - virtual void rewind(); - virtual bool isStopped() const; - virtual bool isPaused() const; - virtual bool isFinished() const; - virtual bool update(); - virtual void setPitch(float pitch); - virtual float getPitch() const; - virtual void setVolume(float volume); - virtual float getVolume() const; - virtual void seekAtomic(float offset, void *unit); - virtual void seek(float offset, Unit unit); - virtual float tellAtomic(void *unit) const; - virtual float tell(Unit unit); - virtual void setPosition(float *v); - virtual void getPosition(float *v) const; - virtual void setVelocity(float *v); - virtual void getVelocity(float *v) const; - virtual void setDirection(float *v); - virtual void getDirection(float *v) const; - void setLooping(bool looping); - bool isLooping() const; - bool isStatic() const; - virtual void setMinVolume(float volume); - virtual float getMinVolume() const; - virtual void setMaxVolume(float volume); - virtual float getMaxVolume() const; - virtual void setReferenceDistance(float distance); - virtual float getReferenceDistance() const; - virtual void setRolloffFactor(float factor); - virtual float getRolloffFactor() const; - virtual void setMaxDistance(float distance); - virtual float getMaxDistance() const; - - void playAtomic(); - void stopAtomic(); - void pauseAtomic(); - void resumeAtomic(); - void rewindAtomic(); - -private: - - void reset(ALenum source); - - void setFloatv(float *dst, const float *src) const; - - /** - * Gets the OpenAL format identifier based on number of - * channels and bits. - * @param channels Either 1 (mono) or 2 (stereo). - * @param bits Either 8-bit samples, or 16-bit samples. - * @return One of AL_FORMAT_*, or 0 if unsupported format. - **/ - ALenum getFormat(int channels, int bits) const; - - int streamAtomic(ALuint buffer, love::sound::Decoder *d); - - Pool *pool; - ALuint source; - bool valid; - static const unsigned int MAX_BUFFERS = 32; - ALuint buffers[MAX_BUFFERS]; - - float pitch; - float volume; - float position[3]; - float velocity[3]; - float direction[3]; - bool looping; - bool paused; - float minVolume; - float maxVolume; - float referenceDistance; - float rolloffFactor; - float maxDistance; - - float offsetSamples; - float offsetSeconds; - - love::sound::Decoder *decoder; - - unsigned int toLoop; - -}; // Source - -} // openal -} // audio -} // love - -#endif // LOVE_AUDIO_OPENAL_SOURCE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_OPENAL_SOURCE_H +#define LOVE_AUDIO_OPENAL_SOURCE_H + +// LOVE +#include "common/config.h" +#include "common/Object.h" +#include "audio/Source.h" +#include "sound/SoundData.h" +#include "sound/Decoder.h" + +// OpenAL +#ifdef LOVE_MACOSX +#include +#include +#else +#include +#include +#endif + +namespace love +{ +namespace audio +{ +namespace openal +{ + +class Audio; +class Pool; + +class Source : public love::audio::Source +{ +public: + Source(Pool *pool, love::sound::SoundData *soundData); + Source(Pool *pool, love::sound::Decoder *decoder); + virtual ~Source(); + + virtual love::audio::Source *copy(); + virtual void play(); + virtual void stop(); + virtual void pause(); + virtual void resume(); + virtual void rewind(); + virtual bool isStopped() const; + virtual bool isPaused() const; + virtual bool isFinished() const; + virtual bool update(); + virtual void setPitch(float pitch); + virtual float getPitch() const; + virtual void setVolume(float volume); + virtual float getVolume() const; + virtual void seekAtomic(float offset, void *unit); + virtual void seek(float offset, Unit unit); + virtual float tellAtomic(void *unit) const; + virtual float tell(Unit unit); + virtual void setPosition(float *v); + virtual void getPosition(float *v) const; + virtual void setVelocity(float *v); + virtual void getVelocity(float *v) const; + virtual void setDirection(float *v); + virtual void getDirection(float *v) const; + void setLooping(bool looping); + bool isLooping() const; + bool isStatic() const; + virtual void setMinVolume(float volume); + virtual float getMinVolume() const; + virtual void setMaxVolume(float volume); + virtual float getMaxVolume() const; + virtual void setReferenceDistance(float distance); + virtual float getReferenceDistance() const; + virtual void setRolloffFactor(float factor); + virtual float getRolloffFactor() const; + virtual void setMaxDistance(float distance); + virtual float getMaxDistance() const; + + void playAtomic(); + void stopAtomic(); + void pauseAtomic(); + void resumeAtomic(); + void rewindAtomic(); + +private: + + void reset(ALenum source); + + void setFloatv(float *dst, const float *src) const; + + /** + * Gets the OpenAL format identifier based on number of + * channels and bits. + * @param channels Either 1 (mono) or 2 (stereo). + * @param bits Either 8-bit samples, or 16-bit samples. + * @return One of AL_FORMAT_*, or 0 if unsupported format. + **/ + ALenum getFormat(int channels, int bits) const; + + int streamAtomic(ALuint buffer, love::sound::Decoder *d); + + Pool *pool; + ALuint source; + bool valid; + static const unsigned int MAX_BUFFERS = 32; + ALuint buffers[MAX_BUFFERS]; + + float pitch; + float volume; + float position[3]; + float velocity[3]; + float direction[3]; + bool looping; + bool paused; + float minVolume; + float maxVolume; + float referenceDistance; + float rolloffFactor; + float maxDistance; + + float offsetSamples; + float offsetSeconds; + + love::sound::Decoder *decoder; + + unsigned int toLoop; + +}; // Source + +} // openal +} // audio +} // love + +#endif // LOVE_AUDIO_OPENAL_SOURCE_H diff --git a/src/modules/audio/wrap_Audio.cpp b/src/modules/audio/wrap_Audio.cpp index 55fadbcd7..cd4a73abe 100644 --- a/src/modules/audio/wrap_Audio.cpp +++ b/src/modules/audio/wrap_Audio.cpp @@ -1,343 +1,343 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "wrap_Audio.h" - -#include "openal/Audio.h" -#include "null/Audio.h" - -#include "scripts/audio.lua.h" - -#include "common/runtime.h" - -namespace love -{ -namespace audio -{ - -static Audio *instance = 0; - -int w_getNumSources(lua_State *L) -{ - lua_pushinteger(L, instance->getNumSources()); - return 1; -} - -int w_newSource1(lua_State *L) -{ - Source *t = 0; - - if (luax_istype(L, 1, SOUND_SOUND_DATA_T)) - t = instance->newSource(luax_totype(L, 1, "SoundData", SOUND_SOUND_DATA_T)); - else if (luax_istype(L, 1, SOUND_DECODER_T)) - t = instance->newSource(luax_totype(L, 1, "Decoder", SOUND_DECODER_T)); - - if (t) - { - luax_newtype(L, "Source", AUDIO_SOURCE_T, (void *)t); - return 1; - } - else - return luaL_error(L, "No matching overload"); - - return 0; -} - -int w_play(lua_State *L) -{ - Source *s = luax_checksource(L, 1); - instance->play(s); - return 0; -} - -int w_stop(lua_State *L) -{ - if (lua_gettop(L) == 0) - { - instance->stop(); - } - else - { - Source *s = luax_checksource(L, 1); - s->stop(); - } - return 0; -} - -int w_pause(lua_State *L) -{ - if (lua_gettop(L) == 0) - { - instance->pause(); - } - else - { - Source *s = luax_checksource(L, 1); - s->pause(); - } - - return 0; -} - -int w_resume(lua_State *L) -{ - if (lua_gettop(L) == 0) - { - instance->resume(); - } - else - { - Source *s = luax_checksource(L, 1); - s->resume(); - } - return 0; -} - -int w_rewind(lua_State *L) -{ - if (lua_gettop(L) == 0) - { - instance->rewind(); - } - else - { - Source *s = luax_checksource(L, 1); - s->rewind(); - } - return 0; -} - -int w_setVolume(lua_State *L) -{ - float v = (float)luaL_checknumber(L, 1); - instance->setVolume(v); - return 0; -} - -int w_getVolume(lua_State *L) -{ - lua_pushnumber(L, instance->getVolume()); - return 1; -} - -int w_setPosition(lua_State *L) -{ - float v[3]; - v[0] = (float)luaL_checknumber(L, 1); - v[1] = (float)luaL_checknumber(L, 2); - v[2] = (float)luaL_optnumber(L, 3, 0); - instance->setPosition(v); - return 0; -} - -int w_getPosition(lua_State *L) -{ - float v[3]; - instance->getPosition(v); - lua_pushnumber(L, v[0]); - lua_pushnumber(L, v[1]); - lua_pushnumber(L, v[2]); - return 3; -} - -int w_setOrientation(lua_State *L) -{ - float v[6]; - v[0] = (float)luaL_checknumber(L, 1); - v[1] = (float)luaL_checknumber(L, 2); - v[2] = (float)luaL_checknumber(L, 3); - v[3] = (float)luaL_checknumber(L, 4); - v[4] = (float)luaL_checknumber(L, 5); - v[5] = (float)luaL_checknumber(L, 6); - instance->setOrientation(v); - return 0; -} - -int w_getOrientation(lua_State *L) -{ - float v[6]; - instance->getOrientation(v); - lua_pushnumber(L, v[0]); - lua_pushnumber(L, v[1]); - lua_pushnumber(L, v[2]); - lua_pushnumber(L, v[3]); - lua_pushnumber(L, v[4]); - lua_pushnumber(L, v[5]); - return 6; -} - -int w_setVelocity(lua_State *L) -{ - float v[3]; - v[0] = (float)luaL_checknumber(L, 1); - v[1] = (float)luaL_checknumber(L, 2); - v[2] = (float)luaL_optnumber(L, 3, 0); - instance->setVelocity(v); - return 0; -} - -int w_getVelocity(lua_State *L) -{ - float v[3]; - instance->getVelocity(v); - lua_pushnumber(L, v[0]); - lua_pushnumber(L, v[1]); - lua_pushnumber(L, v[2]); - return 3; -} - -int w_record(lua_State *) -{ - instance->record(); - return 0; -} - -int w_getRecordedData(lua_State *L) -{ - love::sound::SoundData *sd = instance->getRecordedData(); - if (!sd) - lua_pushnil(L); - else - luax_newtype(L, "SoundData", SOUND_SOUND_DATA_T, (void *)sd); - return 1; -} - -int w_stopRecording(lua_State *L) -{ - if (luax_optboolean(L, 1, true)) - { - love::sound::SoundData *sd = instance->stopRecording(true); - if (!sd) lua_pushnil(L); - else luax_newtype(L, "SoundData", SOUND_SOUND_DATA_T, (void *)sd); - return 1; - } - instance->stopRecording(false); - return 0; -} - -int w_canRecord(lua_State *L) -{ - luax_pushboolean(L, instance->canRecord()); - return 1; -} - -int w_setDistanceModel(lua_State *L) -{ - const char *modelStr = luaL_checkstring(L, 1); - Audio::DistanceModel distanceModel; - if (!Audio::getConstant(modelStr, distanceModel)) - return luaL_error(L, "Invalid distance model: %s", modelStr); - instance->setDistanceModel(distanceModel); - return 0; -} - -int w_getDistanceModel(lua_State *L) -{ - Audio::DistanceModel distanceModel = instance->getDistanceModel(); - const char *modelStr; - if (!Audio::getConstant(distanceModel, modelStr)) - return 0; - lua_pushstring(L, modelStr); - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "getNumSources", w_getNumSources }, - { "newSource1", w_newSource1 }, - { "play", w_play }, - { "stop", w_stop }, - { "pause", w_pause }, - { "resume", w_resume }, - { "rewind", w_rewind }, - { "setVolume", w_setVolume }, - { "getVolume", w_getVolume }, - { "setPosition", w_setPosition }, - { "getPosition", w_getPosition }, - { "setOrientation", w_setOrientation }, - { "getOrientation", w_getOrientation }, - { "setVelocity", w_setVelocity }, - { "getVelocity", w_getVelocity }, - /*{ "record", w_record }, - { "getRecordedData", w_getRecordedData }, - { "stopRecording", w_stopRecording },*/ - { "setDistanceModel", w_setDistanceModel }, - { "getDistanceModel", w_getDistanceModel }, - { 0, 0 } -}; - -static const lua_CFunction types[] = -{ - luaopen_source, - 0 -}; - -extern "C" int luaopen_love_audio(lua_State *L) -{ - if (instance == 0) - { - // Try OpenAL first. - try - { - instance = new love::audio::openal::Audio(); - } - catch(love::Exception &e) - { - std::cout << e.what() << std::endl; - } - } - else - instance->retain(); - - if (instance == 0) - { - // Fall back to nullaudio. - try - { - instance = new love::audio::null::Audio(); - } - catch(love::Exception &e) - { - std::cout << e.what() << std::endl; - } - } - - if (instance == 0) - return luaL_error(L, "Could not open any audio module."); - - WrappedModule w; - w.module = instance; - w.name = "audio"; - w.flags = MODULE_T; - w.functions = functions; - w.types = types; - - int n = luax_register_module(L, w); - - if (luaL_loadbuffer(L, (const char *)audio_lua, sizeof(audio_lua), "audio.lua") == 0) - lua_call(L, 0, 0); - - return n; -} - -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "wrap_Audio.h" + +#include "openal/Audio.h" +#include "null/Audio.h" + +#include "scripts/audio.lua.h" + +#include "common/runtime.h" + +namespace love +{ +namespace audio +{ + +static Audio *instance = 0; + +int w_getNumSources(lua_State *L) +{ + lua_pushinteger(L, instance->getNumSources()); + return 1; +} + +int w_newSource1(lua_State *L) +{ + Source *t = 0; + + if (luax_istype(L, 1, SOUND_SOUND_DATA_T)) + t = instance->newSource(luax_totype(L, 1, "SoundData", SOUND_SOUND_DATA_T)); + else if (luax_istype(L, 1, SOUND_DECODER_T)) + t = instance->newSource(luax_totype(L, 1, "Decoder", SOUND_DECODER_T)); + + if (t) + { + luax_newtype(L, "Source", AUDIO_SOURCE_T, (void *)t); + return 1; + } + else + return luaL_error(L, "No matching overload"); + + return 0; +} + +int w_play(lua_State *L) +{ + Source *s = luax_checksource(L, 1); + instance->play(s); + return 0; +} + +int w_stop(lua_State *L) +{ + if (lua_gettop(L) == 0) + { + instance->stop(); + } + else + { + Source *s = luax_checksource(L, 1); + s->stop(); + } + return 0; +} + +int w_pause(lua_State *L) +{ + if (lua_gettop(L) == 0) + { + instance->pause(); + } + else + { + Source *s = luax_checksource(L, 1); + s->pause(); + } + + return 0; +} + +int w_resume(lua_State *L) +{ + if (lua_gettop(L) == 0) + { + instance->resume(); + } + else + { + Source *s = luax_checksource(L, 1); + s->resume(); + } + return 0; +} + +int w_rewind(lua_State *L) +{ + if (lua_gettop(L) == 0) + { + instance->rewind(); + } + else + { + Source *s = luax_checksource(L, 1); + s->rewind(); + } + return 0; +} + +int w_setVolume(lua_State *L) +{ + float v = (float)luaL_checknumber(L, 1); + instance->setVolume(v); + return 0; +} + +int w_getVolume(lua_State *L) +{ + lua_pushnumber(L, instance->getVolume()); + return 1; +} + +int w_setPosition(lua_State *L) +{ + float v[3]; + v[0] = (float)luaL_checknumber(L, 1); + v[1] = (float)luaL_checknumber(L, 2); + v[2] = (float)luaL_optnumber(L, 3, 0); + instance->setPosition(v); + return 0; +} + +int w_getPosition(lua_State *L) +{ + float v[3]; + instance->getPosition(v); + lua_pushnumber(L, v[0]); + lua_pushnumber(L, v[1]); + lua_pushnumber(L, v[2]); + return 3; +} + +int w_setOrientation(lua_State *L) +{ + float v[6]; + v[0] = (float)luaL_checknumber(L, 1); + v[1] = (float)luaL_checknumber(L, 2); + v[2] = (float)luaL_checknumber(L, 3); + v[3] = (float)luaL_checknumber(L, 4); + v[4] = (float)luaL_checknumber(L, 5); + v[5] = (float)luaL_checknumber(L, 6); + instance->setOrientation(v); + return 0; +} + +int w_getOrientation(lua_State *L) +{ + float v[6]; + instance->getOrientation(v); + lua_pushnumber(L, v[0]); + lua_pushnumber(L, v[1]); + lua_pushnumber(L, v[2]); + lua_pushnumber(L, v[3]); + lua_pushnumber(L, v[4]); + lua_pushnumber(L, v[5]); + return 6; +} + +int w_setVelocity(lua_State *L) +{ + float v[3]; + v[0] = (float)luaL_checknumber(L, 1); + v[1] = (float)luaL_checknumber(L, 2); + v[2] = (float)luaL_optnumber(L, 3, 0); + instance->setVelocity(v); + return 0; +} + +int w_getVelocity(lua_State *L) +{ + float v[3]; + instance->getVelocity(v); + lua_pushnumber(L, v[0]); + lua_pushnumber(L, v[1]); + lua_pushnumber(L, v[2]); + return 3; +} + +int w_record(lua_State *) +{ + instance->record(); + return 0; +} + +int w_getRecordedData(lua_State *L) +{ + love::sound::SoundData *sd = instance->getRecordedData(); + if (!sd) + lua_pushnil(L); + else + luax_newtype(L, "SoundData", SOUND_SOUND_DATA_T, (void *)sd); + return 1; +} + +int w_stopRecording(lua_State *L) +{ + if (luax_optboolean(L, 1, true)) + { + love::sound::SoundData *sd = instance->stopRecording(true); + if (!sd) lua_pushnil(L); + else luax_newtype(L, "SoundData", SOUND_SOUND_DATA_T, (void *)sd); + return 1; + } + instance->stopRecording(false); + return 0; +} + +int w_canRecord(lua_State *L) +{ + luax_pushboolean(L, instance->canRecord()); + return 1; +} + +int w_setDistanceModel(lua_State *L) +{ + const char *modelStr = luaL_checkstring(L, 1); + Audio::DistanceModel distanceModel; + if (!Audio::getConstant(modelStr, distanceModel)) + return luaL_error(L, "Invalid distance model: %s", modelStr); + instance->setDistanceModel(distanceModel); + return 0; +} + +int w_getDistanceModel(lua_State *L) +{ + Audio::DistanceModel distanceModel = instance->getDistanceModel(); + const char *modelStr; + if (!Audio::getConstant(distanceModel, modelStr)) + return 0; + lua_pushstring(L, modelStr); + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "getNumSources", w_getNumSources }, + { "newSource1", w_newSource1 }, + { "play", w_play }, + { "stop", w_stop }, + { "pause", w_pause }, + { "resume", w_resume }, + { "rewind", w_rewind }, + { "setVolume", w_setVolume }, + { "getVolume", w_getVolume }, + { "setPosition", w_setPosition }, + { "getPosition", w_getPosition }, + { "setOrientation", w_setOrientation }, + { "getOrientation", w_getOrientation }, + { "setVelocity", w_setVelocity }, + { "getVelocity", w_getVelocity }, + /*{ "record", w_record }, + { "getRecordedData", w_getRecordedData }, + { "stopRecording", w_stopRecording },*/ + { "setDistanceModel", w_setDistanceModel }, + { "getDistanceModel", w_getDistanceModel }, + { 0, 0 } +}; + +static const lua_CFunction types[] = +{ + luaopen_source, + 0 +}; + +extern "C" int luaopen_love_audio(lua_State *L) +{ + if (instance == 0) + { + // Try OpenAL first. + try + { + instance = new love::audio::openal::Audio(); + } + catch(love::Exception &e) + { + std::cout << e.what() << std::endl; + } + } + else + instance->retain(); + + if (instance == 0) + { + // Fall back to nullaudio. + try + { + instance = new love::audio::null::Audio(); + } + catch(love::Exception &e) + { + std::cout << e.what() << std::endl; + } + } + + if (instance == 0) + return luaL_error(L, "Could not open any audio module."); + + WrappedModule w; + w.module = instance; + w.name = "audio"; + w.flags = MODULE_T; + w.functions = functions; + w.types = types; + + int n = luax_register_module(L, w); + + if (luaL_loadbuffer(L, (const char *)audio_lua, sizeof(audio_lua), "audio.lua") == 0) + lua_call(L, 0, 0); + + return n; +} + +} // audio +} // love diff --git a/src/modules/audio/wrap_Audio.h b/src/modules/audio/wrap_Audio.h index 0cd5a4e8d..938a6fb5a 100644 --- a/src/modules/audio/wrap_Audio.h +++ b/src/modules/audio/wrap_Audio.h @@ -1,61 +1,61 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_WRAP_AUDIO_H -#define LOVE_AUDIO_WRAP_AUDIO_H - -// LOVE -#include "common/config.h" -#include "common/runtime.h" -#include "Audio.h" -#include "wrap_Source.h" - -namespace love -{ -namespace audio -{ - -int w_getNumSources(lua_State *L); -int w_newSource1(lua_State *L); -int w_play(lua_State *L); -int w_stop(lua_State *L); -int w_pause(lua_State *L); -int w_resume(lua_State *L); -int w_rewind(lua_State *L); -int w_setVolume(lua_State *L); -int w_getVolume(lua_State *L); -int w_setPosition(lua_State *L); -int w_getPosition(lua_State *L); -int w_setOrientation(lua_State *L); -int w_getOrientation(lua_State *L); -int w_setVelocity(lua_State *L); -int w_getVelocity(lua_State *L); -int w_record(lua_State *L); -int w_getRecordedData(lua_State *L); -int w_stopRecording(lua_State *L); -int w_canRecord(lua_State *L); -int w_setDistanceModel(lua_State *L); -int w_getDistanceModel(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_audio(lua_State *L); - -} // audio -} // love - -#endif // LOVE_AUDIO_WRAP_AUDIO_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_WRAP_AUDIO_H +#define LOVE_AUDIO_WRAP_AUDIO_H + +// LOVE +#include "common/config.h" +#include "common/runtime.h" +#include "Audio.h" +#include "wrap_Source.h" + +namespace love +{ +namespace audio +{ + +int w_getNumSources(lua_State *L); +int w_newSource1(lua_State *L); +int w_play(lua_State *L); +int w_stop(lua_State *L); +int w_pause(lua_State *L); +int w_resume(lua_State *L); +int w_rewind(lua_State *L); +int w_setVolume(lua_State *L); +int w_getVolume(lua_State *L); +int w_setPosition(lua_State *L); +int w_getPosition(lua_State *L); +int w_setOrientation(lua_State *L); +int w_getOrientation(lua_State *L); +int w_setVelocity(lua_State *L); +int w_getVelocity(lua_State *L); +int w_record(lua_State *L); +int w_getRecordedData(lua_State *L); +int w_stopRecording(lua_State *L); +int w_canRecord(lua_State *L); +int w_setDistanceModel(lua_State *L); +int w_getDistanceModel(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_audio(lua_State *L); + +} // audio +} // love + +#endif // LOVE_AUDIO_WRAP_AUDIO_H diff --git a/src/modules/audio/wrap_Source.cpp b/src/modules/audio/wrap_Source.cpp index 6648f2bfe..1795dec0e 100644 --- a/src/modules/audio/wrap_Source.cpp +++ b/src/modules/audio/wrap_Source.cpp @@ -1,320 +1,320 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Source.h" - -namespace love -{ -namespace audio -{ - -Source *luax_checksource(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Source", AUDIO_SOURCE_T); -} - -int w_Source_play(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - t->play(); - return 0; -} - -int w_Source_stop(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - t->stop(); - return 0; -} - -int w_Source_pause(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - t->pause(); - return 0; -} - -int w_Source_resume(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - t->resume(); - return 0; -} - -int w_Source_rewind(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - t->rewind(); - return 0; -} - -int w_Source_setPitch(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float p = (float)luaL_checknumber(L, 2); - t->setPitch(p); - return 0; -} - -int w_Source_getPitch(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - lua_pushnumber(L, t->getPitch()); - return 1; -} - -int w_Source_setVolume(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float p = (float)luaL_checknumber(L, 2); - t->setVolume(p); - return 0; -} - -int w_Source_getVolume(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - lua_pushnumber(L, t->getVolume()); - return 1; -} - -int w_Source_seek(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float offset = (float)luaL_checknumber(L, 2); - const char *unit = luaL_optstring(L, 3, "seconds"); - Source::Unit u; - t->getConstant(unit, u); - t->seek(offset, u); - return 0; -} - -int w_Source_tell(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - const char *unit = luaL_optstring(L, 2, "seconds"); - Source::Unit u; - t->getConstant(unit, u); - lua_pushnumber(L, t->tell(u)); - return 1; -} - -int w_Source_setPosition(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float v[3]; - v[0] = (float)luaL_checknumber(L, 2); - v[1] = (float)luaL_checknumber(L, 3); - v[2] = (float)luaL_optnumber(L, 4, 0); - t->setPosition(v); - return 0; -} - -int w_Source_getPosition(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float v[3]; - t->getPosition(v); - lua_pushnumber(L, v[0]); - lua_pushnumber(L, v[1]); - lua_pushnumber(L, v[2]); - return 3; -} - -int w_Source_setVelocity(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float v[3]; - v[0] = (float)luaL_checknumber(L, 2); - v[1] = (float)luaL_checknumber(L, 3); - v[2] = (float)luaL_optnumber(L, 4, 0); - t->setVelocity(v); - return 0; -} - -int w_Source_getVelocity(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float v[3]; - t->getVelocity(v); - lua_pushnumber(L, v[0]); - lua_pushnumber(L, v[1]); - lua_pushnumber(L, v[2]); - return 3; -} - -int w_Source_setDirection(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float v[3]; - v[0] = (float)luaL_checknumber(L, 2); - v[1] = (float)luaL_checknumber(L, 3); - v[2] = (float)luaL_optnumber(L, 4, 0); - t->setDirection(v); - return 0; -} - -int w_Source_getDirection(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float v[3]; - t->getDirection(v); - lua_pushnumber(L, v[0]); - lua_pushnumber(L, v[1]); - lua_pushnumber(L, v[2]); - return 3; -} - -int w_Source_setLooping(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - t->setLooping(luax_toboolean(L, 2)); - return 0; -} - -int w_Source_isLooping(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - luax_pushboolean(L, t->isLooping()); - return 1; -} - -int w_Source_isStopped(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - luax_pushboolean(L, t->isStopped()); - return 1; -} - -int w_Source_isPaused(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - luax_pushboolean(L, t->isPaused()); - return 1; -} - -int w_Source_isStatic(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - luax_pushboolean(L, t->isStatic()); - return 1; -} - -int w_Source_setVolumeLimits(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float vmin = (float)luaL_checknumber(L, 2); - float vmax = (float)luaL_checknumber(L, 3); - if (vmin < .0f || vmin > 1.f || vmax < .0f || vmax > 1.f) - return luaL_error(L, "Invalid volume limits: [%f:%f]. Must be in [0:1]", vmin, vmax); - t->setMinVolume(vmin); - t->setMaxVolume(vmin); - return 0; -} - -int w_Source_getVolumeLimits(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - lua_pushnumber(L, t->getMinVolume()); - lua_pushnumber(L, t->getMaxVolume()); - return 2; -} - -int w_Source_setDistance(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float dref = (float)luaL_checknumber(L, 2); - float dmax = (float)luaL_checknumber(L, 3); - if (dref < .0f || dmax < .0f) - return luaL_error(L, "Invalid distances: %f, %f. Must be > 0", dref, dmax); - t->setReferenceDistance(dref); - t->setMaxDistance(dmax); - return 0; -} - -int w_Source_getDistance(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - lua_pushnumber(L, t->getReferenceDistance()); - lua_pushnumber(L, t->getMaxDistance()); - return 2; -} - -int w_Source_setRolloff(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - float rolloff = (float)luaL_checknumber(L, 2); - if (rolloff < .0f) - return luaL_error(L, "Invalid rolloff: %f. Must be > 0.", rolloff); - t->setRolloffFactor(rolloff); - return 0; -} - -int w_Source_getRolloff(lua_State *L) -{ - Source *t = luax_checksource(L, 1); - lua_pushnumber(L, t->getRolloffFactor()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "play", w_Source_play }, - { "stop", w_Source_stop }, - { "pause", w_Source_pause }, - { "resume", w_Source_resume }, - { "rewind", w_Source_rewind }, - - { "setPitch", w_Source_setPitch }, - { "getPitch", w_Source_getPitch }, - { "setVolume", w_Source_setVolume }, - { "getVolume", w_Source_getVolume }, - { "seek", w_Source_seek }, - { "tell", w_Source_tell }, - { "setPosition", w_Source_setPosition }, - { "getPosition", w_Source_getPosition }, - { "setVelocity", w_Source_setVelocity }, - { "getVelocity", w_Source_getVelocity }, - { "setDirection", w_Source_setDirection }, - { "getDirection", w_Source_getDirection }, - - { "setLooping", w_Source_setLooping }, - { "isLooping", w_Source_isLooping }, - { "isStopped", w_Source_isStopped }, - { "isPaused", w_Source_isPaused }, - { "isStatic", w_Source_isStatic }, - - { "setVolumeLimits", w_Source_setVolumeLimits }, - { "getVolumeLimits", w_Source_getVolumeLimits }, - { "setDistance", w_Source_setDistance }, - { "getDistance", w_Source_setDistance }, - { "setRolloff", w_Source_setRolloff}, - { "getRolloff", w_Source_getRolloff}, - - { 0, 0 } -}; - -extern "C" int luaopen_source(lua_State *L) -{ - return luax_register_type(L, "Source", functions); -} - -} // audio -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Source.h" + +namespace love +{ +namespace audio +{ + +Source *luax_checksource(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Source", AUDIO_SOURCE_T); +} + +int w_Source_play(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + t->play(); + return 0; +} + +int w_Source_stop(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + t->stop(); + return 0; +} + +int w_Source_pause(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + t->pause(); + return 0; +} + +int w_Source_resume(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + t->resume(); + return 0; +} + +int w_Source_rewind(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + t->rewind(); + return 0; +} + +int w_Source_setPitch(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float p = (float)luaL_checknumber(L, 2); + t->setPitch(p); + return 0; +} + +int w_Source_getPitch(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + lua_pushnumber(L, t->getPitch()); + return 1; +} + +int w_Source_setVolume(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float p = (float)luaL_checknumber(L, 2); + t->setVolume(p); + return 0; +} + +int w_Source_getVolume(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + lua_pushnumber(L, t->getVolume()); + return 1; +} + +int w_Source_seek(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float offset = (float)luaL_checknumber(L, 2); + const char *unit = luaL_optstring(L, 3, "seconds"); + Source::Unit u; + t->getConstant(unit, u); + t->seek(offset, u); + return 0; +} + +int w_Source_tell(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + const char *unit = luaL_optstring(L, 2, "seconds"); + Source::Unit u; + t->getConstant(unit, u); + lua_pushnumber(L, t->tell(u)); + return 1; +} + +int w_Source_setPosition(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float v[3]; + v[0] = (float)luaL_checknumber(L, 2); + v[1] = (float)luaL_checknumber(L, 3); + v[2] = (float)luaL_optnumber(L, 4, 0); + t->setPosition(v); + return 0; +} + +int w_Source_getPosition(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float v[3]; + t->getPosition(v); + lua_pushnumber(L, v[0]); + lua_pushnumber(L, v[1]); + lua_pushnumber(L, v[2]); + return 3; +} + +int w_Source_setVelocity(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float v[3]; + v[0] = (float)luaL_checknumber(L, 2); + v[1] = (float)luaL_checknumber(L, 3); + v[2] = (float)luaL_optnumber(L, 4, 0); + t->setVelocity(v); + return 0; +} + +int w_Source_getVelocity(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float v[3]; + t->getVelocity(v); + lua_pushnumber(L, v[0]); + lua_pushnumber(L, v[1]); + lua_pushnumber(L, v[2]); + return 3; +} + +int w_Source_setDirection(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float v[3]; + v[0] = (float)luaL_checknumber(L, 2); + v[1] = (float)luaL_checknumber(L, 3); + v[2] = (float)luaL_optnumber(L, 4, 0); + t->setDirection(v); + return 0; +} + +int w_Source_getDirection(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float v[3]; + t->getDirection(v); + lua_pushnumber(L, v[0]); + lua_pushnumber(L, v[1]); + lua_pushnumber(L, v[2]); + return 3; +} + +int w_Source_setLooping(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + t->setLooping(luax_toboolean(L, 2)); + return 0; +} + +int w_Source_isLooping(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + luax_pushboolean(L, t->isLooping()); + return 1; +} + +int w_Source_isStopped(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + luax_pushboolean(L, t->isStopped()); + return 1; +} + +int w_Source_isPaused(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + luax_pushboolean(L, t->isPaused()); + return 1; +} + +int w_Source_isStatic(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + luax_pushboolean(L, t->isStatic()); + return 1; +} + +int w_Source_setVolumeLimits(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float vmin = (float)luaL_checknumber(L, 2); + float vmax = (float)luaL_checknumber(L, 3); + if (vmin < .0f || vmin > 1.f || vmax < .0f || vmax > 1.f) + return luaL_error(L, "Invalid volume limits: [%f:%f]. Must be in [0:1]", vmin, vmax); + t->setMinVolume(vmin); + t->setMaxVolume(vmin); + return 0; +} + +int w_Source_getVolumeLimits(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + lua_pushnumber(L, t->getMinVolume()); + lua_pushnumber(L, t->getMaxVolume()); + return 2; +} + +int w_Source_setDistance(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float dref = (float)luaL_checknumber(L, 2); + float dmax = (float)luaL_checknumber(L, 3); + if (dref < .0f || dmax < .0f) + return luaL_error(L, "Invalid distances: %f, %f. Must be > 0", dref, dmax); + t->setReferenceDistance(dref); + t->setMaxDistance(dmax); + return 0; +} + +int w_Source_getDistance(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + lua_pushnumber(L, t->getReferenceDistance()); + lua_pushnumber(L, t->getMaxDistance()); + return 2; +} + +int w_Source_setRolloff(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + float rolloff = (float)luaL_checknumber(L, 2); + if (rolloff < .0f) + return luaL_error(L, "Invalid rolloff: %f. Must be > 0.", rolloff); + t->setRolloffFactor(rolloff); + return 0; +} + +int w_Source_getRolloff(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + lua_pushnumber(L, t->getRolloffFactor()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "play", w_Source_play }, + { "stop", w_Source_stop }, + { "pause", w_Source_pause }, + { "resume", w_Source_resume }, + { "rewind", w_Source_rewind }, + + { "setPitch", w_Source_setPitch }, + { "getPitch", w_Source_getPitch }, + { "setVolume", w_Source_setVolume }, + { "getVolume", w_Source_getVolume }, + { "seek", w_Source_seek }, + { "tell", w_Source_tell }, + { "setPosition", w_Source_setPosition }, + { "getPosition", w_Source_getPosition }, + { "setVelocity", w_Source_setVelocity }, + { "getVelocity", w_Source_getVelocity }, + { "setDirection", w_Source_setDirection }, + { "getDirection", w_Source_getDirection }, + + { "setLooping", w_Source_setLooping }, + { "isLooping", w_Source_isLooping }, + { "isStopped", w_Source_isStopped }, + { "isPaused", w_Source_isPaused }, + { "isStatic", w_Source_isStatic }, + + { "setVolumeLimits", w_Source_setVolumeLimits }, + { "getVolumeLimits", w_Source_getVolumeLimits }, + { "setDistance", w_Source_setDistance }, + { "getDistance", w_Source_setDistance }, + { "setRolloff", w_Source_setRolloff}, + { "getRolloff", w_Source_getRolloff}, + + { 0, 0 } +}; + +extern "C" int luaopen_source(lua_State *L) +{ + return luax_register_type(L, "Source", functions); +} + +} // audio +} // love diff --git a/src/modules/audio/wrap_Source.h b/src/modules/audio/wrap_Source.h index eb3955498..b9fff3953 100644 --- a/src/modules/audio/wrap_Source.h +++ b/src/modules/audio/wrap_Source.h @@ -1,66 +1,66 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_AUDIO_WRAP_SOURCE_H -#define LOVE_AUDIO_WRAP_SOURCE_H - -#include "common/runtime.h" -#include "Source.h" - -namespace love -{ -namespace audio -{ - -Source *luax_checksource(lua_State *L, int idx); -int w_Source_play(lua_State *L); -int w_Source_stop(lua_State *L); -int w_Source_pause(lua_State *L); -int w_Source_resume(lua_State *L); -int w_Source_rewind(lua_State *L); -int w_Source_setPitch(lua_State *L); -int w_Source_getPitch(lua_State *L); -int w_Source_setVolume(lua_State *L); -int w_Source_getVolume(lua_State *L); -int w_Source_seek(lua_State *L); -int w_Source_tell(lua_State *L); -int w_Source_setPosition(lua_State *L); -int w_Source_getPosition(lua_State *L); -int w_Source_setVelocity(lua_State *L); -int w_Source_getVelocity(lua_State *L); -int w_Source_setDirection(lua_State *L); -int w_Source_getDirection(lua_State *L); -int w_Source_setLooping(lua_State *L); -int w_Source_isLooping(lua_State *L); -int w_Source_isStopped(lua_State *L); -int w_Source_isPaused(lua_State *L); -int w_Source_isStatic(lua_State *L); -int w_Source_setVolumeLimits(lua_State *L); -int w_Source_getVolumeLimits(lua_State *L); -int w_Source_setDistance(lua_State *L); -int w_Source_getDistance(lua_State *L); -int w_Source_setRolloff(lua_State *L); -int w_Source_getRolloff(lua_State *L); -extern "C" int luaopen_source(lua_State *L); - -} // audio -} // love - -#endif // LOVE_AUDIO_WRAP_SOURCE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_AUDIO_WRAP_SOURCE_H +#define LOVE_AUDIO_WRAP_SOURCE_H + +#include "common/runtime.h" +#include "Source.h" + +namespace love +{ +namespace audio +{ + +Source *luax_checksource(lua_State *L, int idx); +int w_Source_play(lua_State *L); +int w_Source_stop(lua_State *L); +int w_Source_pause(lua_State *L); +int w_Source_resume(lua_State *L); +int w_Source_rewind(lua_State *L); +int w_Source_setPitch(lua_State *L); +int w_Source_getPitch(lua_State *L); +int w_Source_setVolume(lua_State *L); +int w_Source_getVolume(lua_State *L); +int w_Source_seek(lua_State *L); +int w_Source_tell(lua_State *L); +int w_Source_setPosition(lua_State *L); +int w_Source_getPosition(lua_State *L); +int w_Source_setVelocity(lua_State *L); +int w_Source_getVelocity(lua_State *L); +int w_Source_setDirection(lua_State *L); +int w_Source_getDirection(lua_State *L); +int w_Source_setLooping(lua_State *L); +int w_Source_isLooping(lua_State *L); +int w_Source_isStopped(lua_State *L); +int w_Source_isPaused(lua_State *L); +int w_Source_isStatic(lua_State *L); +int w_Source_setVolumeLimits(lua_State *L); +int w_Source_getVolumeLimits(lua_State *L); +int w_Source_setDistance(lua_State *L); +int w_Source_getDistance(lua_State *L); +int w_Source_setRolloff(lua_State *L); +int w_Source_getRolloff(lua_State *L); +extern "C" int luaopen_source(lua_State *L); + +} // audio +} // love + +#endif // LOVE_AUDIO_WRAP_SOURCE_H diff --git a/src/modules/event/Event.cpp b/src/modules/event/Event.cpp index 642a23359..cb9b332a7 100644 --- a/src/modules/event/Event.cpp +++ b/src/modules/event/Event.cpp @@ -1,297 +1,297 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Event.h" - -using love::thread::Mutex; -using love::thread::Lock; - -namespace love -{ -namespace event -{ - -Message::Message(std::string name, Variant *a, Variant *b, Variant *c, Variant *d) - : name(name) - , nargs(0) -{ - args[0] = a; - args[1] = b; - args[2] = c; - args[3] = d; - for (int i = 0; i < 4; i++) - { - if (!args[i]) - continue; - args[i]->retain(); - nargs++; - } -} - -Message::~Message() -{ - for (int i = 0; i < nargs; i++) - args[i]->release(); -} - -int Message::toLua(lua_State *L) -{ - luax_pushstring(L, name); - for (int i = 0; i < nargs; i++) - args[i]->toLua(L); - return nargs+1; -} - -Message *Message::fromLua(lua_State *L, int n) -{ - std::string name = luax_checkstring(L, n); - n++; - Message *m = new Message(name); - for (int i = 0; i < 4; i++) - { - if (lua_isnoneornil(L, n+i)) - break; - m->args[i] = Variant::fromLua(L, n+i); - if (!m->args[i]) - { - delete m; - luaL_error(L, "Argument %d can't be stored safely\nExpected boolean, number, string or userdata.", n+i); - return NULL; - } - m->nargs++; - } - return m; -} - -Event::~Event() -{ -} - -void Event::push(Message *msg) -{ - Lock lock(mutex); - msg->retain(); - queue.push(msg); -} - -bool Event::poll(Message *&msg) -{ - Lock lock(mutex); - if (queue.empty()) - return false; - msg = queue.front(); - queue.pop(); - return true; -} - -void Event::clear() -{ - Lock lock(mutex); - while (!queue.empty()) - { - queue.back()->release(); - queue.pop(); - } -} - -bool Event::getConstant(const char *in, love::mouse::Mouse::Button &out) -{ - return buttons.find(in, out); -} - -bool Event::getConstant(love::mouse::Mouse::Button in, const char *&out) -{ - return buttons.find(in, out); -} - -bool Event::getConstant(const char *in, love::keyboard::Keyboard::Key &out) -{ - return keys.find(in, out); -} - -bool Event::getConstant(love::keyboard::Keyboard::Key in, const char *&out) -{ - return keys.find(in, out); -} - -StringMap::Entry Event::buttonEntries[] = -{ - {"l", love::mouse::Mouse::BUTTON_LEFT}, - {"m", love::mouse::Mouse::BUTTON_MIDDLE}, - {"r", love::mouse::Mouse::BUTTON_RIGHT}, - {"wu", love::mouse::Mouse::BUTTON_WHEELUP}, - {"wd", love::mouse::Mouse::BUTTON_WHEELDOWN}, - {"x1", love::mouse::Mouse::BUTTON_X1}, - {"x2", love::mouse::Mouse::BUTTON_X2}, -}; - -StringMap Event::buttons(Event::buttonEntries, sizeof(Event::buttonEntries)); - -StringMap::Entry Event::keyEntries[] = -{ - {"backspace", love::keyboard::Keyboard::KEY_BACKSPACE}, - {"tab", love::keyboard::Keyboard::KEY_TAB}, - {"clear", love::keyboard::Keyboard::KEY_CLEAR}, - {"return", love::keyboard::Keyboard::KEY_RETURN}, - {"pause", love::keyboard::Keyboard::KEY_PAUSE}, - {"escape", love::keyboard::Keyboard::KEY_ESCAPE}, - {" ", love::keyboard::Keyboard::KEY_SPACE}, - {"!", love::keyboard::Keyboard::KEY_EXCLAIM}, - {"\"", love::keyboard::Keyboard::KEY_QUOTEDBL}, - {"#", love::keyboard::Keyboard::KEY_HASH}, - {"$", love::keyboard::Keyboard::KEY_DOLLAR}, - {"&", love::keyboard::Keyboard::KEY_AMPERSAND}, - {"'", love::keyboard::Keyboard::KEY_QUOTE}, - {"(", love::keyboard::Keyboard::KEY_LEFTPAREN}, - {")", love::keyboard::Keyboard::KEY_RIGHTPAREN}, - {"*", love::keyboard::Keyboard::KEY_ASTERISK}, - {"+", love::keyboard::Keyboard::KEY_PLUS}, - {",", love::keyboard::Keyboard::KEY_COMMA}, - {"-", love::keyboard::Keyboard::KEY_MINUS}, - {".", love::keyboard::Keyboard::KEY_PERIOD}, - {"/", love::keyboard::Keyboard::KEY_SLASH}, - {"0", love::keyboard::Keyboard::KEY_0}, - {"1", love::keyboard::Keyboard::KEY_1}, - {"2", love::keyboard::Keyboard::KEY_2}, - {"3", love::keyboard::Keyboard::KEY_3}, - {"4", love::keyboard::Keyboard::KEY_4}, - {"5", love::keyboard::Keyboard::KEY_5}, - {"6", love::keyboard::Keyboard::KEY_6}, - {"7", love::keyboard::Keyboard::KEY_7}, - {"8", love::keyboard::Keyboard::KEY_8}, - {"9", love::keyboard::Keyboard::KEY_9}, - {":", love::keyboard::Keyboard::KEY_COLON}, - {";", love::keyboard::Keyboard::KEY_SEMICOLON}, - {"<", love::keyboard::Keyboard::KEY_LESS}, - {"=", love::keyboard::Keyboard::KEY_EQUALS}, - {">", love::keyboard::Keyboard::KEY_GREATER}, - {"?", love::keyboard::Keyboard::KEY_QUESTION}, - {"@", love::keyboard::Keyboard::KEY_AT}, - - {"[", love::keyboard::Keyboard::KEY_LEFTBRACKET}, - {"\\", love::keyboard::Keyboard::KEY_BACKSLASH}, - {"]", love::keyboard::Keyboard::KEY_RIGHTBRACKET}, - {"^", love::keyboard::Keyboard::KEY_CARET}, - {"_", love::keyboard::Keyboard::KEY_UNDERSCORE}, - {"`", love::keyboard::Keyboard::KEY_BACKQUOTE}, - {"a", love::keyboard::Keyboard::KEY_A}, - {"b", love::keyboard::Keyboard::KEY_B}, - {"c", love::keyboard::Keyboard::KEY_C}, - {"d", love::keyboard::Keyboard::KEY_D}, - {"e", love::keyboard::Keyboard::KEY_E}, - {"f", love::keyboard::Keyboard::KEY_F}, - {"g", love::keyboard::Keyboard::KEY_G}, - {"h", love::keyboard::Keyboard::KEY_H}, - {"i", love::keyboard::Keyboard::KEY_I}, - {"j", love::keyboard::Keyboard::KEY_J}, - {"k", love::keyboard::Keyboard::KEY_K}, - {"l", love::keyboard::Keyboard::KEY_L}, - {"m", love::keyboard::Keyboard::KEY_M}, - {"n", love::keyboard::Keyboard::KEY_N}, - {"o", love::keyboard::Keyboard::KEY_O}, - {"p", love::keyboard::Keyboard::KEY_P}, - {"q", love::keyboard::Keyboard::KEY_Q}, - {"r", love::keyboard::Keyboard::KEY_R}, - {"s", love::keyboard::Keyboard::KEY_S}, - {"t", love::keyboard::Keyboard::KEY_T}, - {"u", love::keyboard::Keyboard::KEY_U}, - {"v", love::keyboard::Keyboard::KEY_V}, - {"w", love::keyboard::Keyboard::KEY_W}, - {"x", love::keyboard::Keyboard::KEY_X}, - {"y", love::keyboard::Keyboard::KEY_Y}, - {"z", love::keyboard::Keyboard::KEY_Z}, - {"delete", love::keyboard::Keyboard::KEY_DELETE}, - - {"kp0", love::keyboard::Keyboard::KEY_KP0}, - {"kp1", love::keyboard::Keyboard::KEY_KP1}, - {"kp2", love::keyboard::Keyboard::KEY_KP2}, - {"kp3", love::keyboard::Keyboard::KEY_KP3}, - {"kp4", love::keyboard::Keyboard::KEY_KP4}, - {"kp5", love::keyboard::Keyboard::KEY_KP5}, - {"kp6", love::keyboard::Keyboard::KEY_KP6}, - {"kp7", love::keyboard::Keyboard::KEY_KP7}, - {"kp8", love::keyboard::Keyboard::KEY_KP8}, - {"kp9", love::keyboard::Keyboard::KEY_KP9}, - {"kp.", love::keyboard::Keyboard::KEY_KP_PERIOD}, - {"kp/", love::keyboard::Keyboard::KEY_KP_DIVIDE}, - {"kp*", love::keyboard::Keyboard::KEY_KP_MULTIPLY}, - {"kp-", love::keyboard::Keyboard::KEY_KP_MINUS}, - {"kp+", love::keyboard::Keyboard::KEY_KP_PLUS}, - {"kpenter", love::keyboard::Keyboard::KEY_KP_ENTER}, - {"kp=", love::keyboard::Keyboard::KEY_KP_EQUALS}, - - {"up", love::keyboard::Keyboard::KEY_UP}, - {"down", love::keyboard::Keyboard::KEY_DOWN}, - {"right", love::keyboard::Keyboard::KEY_RIGHT}, - {"left", love::keyboard::Keyboard::KEY_LEFT}, - {"insert", love::keyboard::Keyboard::KEY_INSERT}, - {"home", love::keyboard::Keyboard::KEY_HOME}, - {"end", love::keyboard::Keyboard::KEY_END}, - {"pageup", love::keyboard::Keyboard::KEY_PAGEUP}, - {"pagedown", love::keyboard::Keyboard::KEY_PAGEDOWN}, - - {"f1", love::keyboard::Keyboard::KEY_F1}, - {"f2", love::keyboard::Keyboard::KEY_F2}, - {"f3", love::keyboard::Keyboard::KEY_F3}, - {"f4", love::keyboard::Keyboard::KEY_F4}, - {"f5", love::keyboard::Keyboard::KEY_F5}, - {"f6", love::keyboard::Keyboard::KEY_F6}, - {"f7", love::keyboard::Keyboard::KEY_F7}, - {"f8", love::keyboard::Keyboard::KEY_F8}, - {"f9", love::keyboard::Keyboard::KEY_F9}, - {"f10", love::keyboard::Keyboard::KEY_F10}, - {"f11", love::keyboard::Keyboard::KEY_F11}, - {"f12", love::keyboard::Keyboard::KEY_F12}, - {"f13", love::keyboard::Keyboard::KEY_F13}, - {"f14", love::keyboard::Keyboard::KEY_F14}, - {"f15", love::keyboard::Keyboard::KEY_F15}, - - {"numlock", love::keyboard::Keyboard::KEY_NUMLOCK}, - {"capslock", love::keyboard::Keyboard::KEY_CAPSLOCK}, - {"scrollock", love::keyboard::Keyboard::KEY_SCROLLOCK}, - {"rshift", love::keyboard::Keyboard::KEY_RSHIFT}, - {"lshift", love::keyboard::Keyboard::KEY_LSHIFT}, - {"rctrl", love::keyboard::Keyboard::KEY_RCTRL}, - {"lctrl", love::keyboard::Keyboard::KEY_LCTRL}, - {"ralt", love::keyboard::Keyboard::KEY_RALT}, - {"lalt", love::keyboard::Keyboard::KEY_LALT}, - {"rmeta", love::keyboard::Keyboard::KEY_RMETA}, - {"lmeta", love::keyboard::Keyboard::KEY_LMETA}, - {"lsuper", love::keyboard::Keyboard::KEY_LSUPER}, - {"rsuper", love::keyboard::Keyboard::KEY_RSUPER}, - {"mode", love::keyboard::Keyboard::KEY_MODE}, - {"compose", love::keyboard::Keyboard::KEY_COMPOSE}, - - {"help", love::keyboard::Keyboard::KEY_HELP}, - {"print", love::keyboard::Keyboard::KEY_PRINT}, - {"sysreq", love::keyboard::Keyboard::KEY_SYSREQ}, - {"break", love::keyboard::Keyboard::KEY_BREAK}, - {"menu", love::keyboard::Keyboard::KEY_MENU}, - {"power", love::keyboard::Keyboard::KEY_POWER}, - {"euro", love::keyboard::Keyboard::KEY_EURO}, - {"undo", love::keyboard::Keyboard::KEY_UNDO}, - - {"unknown", love::keyboard::Keyboard::KEY_UNKNOWN}, -}; - -StringMap Event::keys(Event::keyEntries, sizeof(Event::keyEntries)); - -} // event -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Event.h" + +using love::thread::Mutex; +using love::thread::Lock; + +namespace love +{ +namespace event +{ + +Message::Message(std::string name, Variant *a, Variant *b, Variant *c, Variant *d) + : name(name) + , nargs(0) +{ + args[0] = a; + args[1] = b; + args[2] = c; + args[3] = d; + for (int i = 0; i < 4; i++) + { + if (!args[i]) + continue; + args[i]->retain(); + nargs++; + } +} + +Message::~Message() +{ + for (int i = 0; i < nargs; i++) + args[i]->release(); +} + +int Message::toLua(lua_State *L) +{ + luax_pushstring(L, name); + for (int i = 0; i < nargs; i++) + args[i]->toLua(L); + return nargs+1; +} + +Message *Message::fromLua(lua_State *L, int n) +{ + std::string name = luax_checkstring(L, n); + n++; + Message *m = new Message(name); + for (int i = 0; i < 4; i++) + { + if (lua_isnoneornil(L, n+i)) + break; + m->args[i] = Variant::fromLua(L, n+i); + if (!m->args[i]) + { + delete m; + luaL_error(L, "Argument %d can't be stored safely\nExpected boolean, number, string or userdata.", n+i); + return NULL; + } + m->nargs++; + } + return m; +} + +Event::~Event() +{ +} + +void Event::push(Message *msg) +{ + Lock lock(mutex); + msg->retain(); + queue.push(msg); +} + +bool Event::poll(Message *&msg) +{ + Lock lock(mutex); + if (queue.empty()) + return false; + msg = queue.front(); + queue.pop(); + return true; +} + +void Event::clear() +{ + Lock lock(mutex); + while (!queue.empty()) + { + queue.back()->release(); + queue.pop(); + } +} + +bool Event::getConstant(const char *in, love::mouse::Mouse::Button &out) +{ + return buttons.find(in, out); +} + +bool Event::getConstant(love::mouse::Mouse::Button in, const char *&out) +{ + return buttons.find(in, out); +} + +bool Event::getConstant(const char *in, love::keyboard::Keyboard::Key &out) +{ + return keys.find(in, out); +} + +bool Event::getConstant(love::keyboard::Keyboard::Key in, const char *&out) +{ + return keys.find(in, out); +} + +StringMap::Entry Event::buttonEntries[] = +{ + {"l", love::mouse::Mouse::BUTTON_LEFT}, + {"m", love::mouse::Mouse::BUTTON_MIDDLE}, + {"r", love::mouse::Mouse::BUTTON_RIGHT}, + {"wu", love::mouse::Mouse::BUTTON_WHEELUP}, + {"wd", love::mouse::Mouse::BUTTON_WHEELDOWN}, + {"x1", love::mouse::Mouse::BUTTON_X1}, + {"x2", love::mouse::Mouse::BUTTON_X2}, +}; + +StringMap Event::buttons(Event::buttonEntries, sizeof(Event::buttonEntries)); + +StringMap::Entry Event::keyEntries[] = +{ + {"backspace", love::keyboard::Keyboard::KEY_BACKSPACE}, + {"tab", love::keyboard::Keyboard::KEY_TAB}, + {"clear", love::keyboard::Keyboard::KEY_CLEAR}, + {"return", love::keyboard::Keyboard::KEY_RETURN}, + {"pause", love::keyboard::Keyboard::KEY_PAUSE}, + {"escape", love::keyboard::Keyboard::KEY_ESCAPE}, + {" ", love::keyboard::Keyboard::KEY_SPACE}, + {"!", love::keyboard::Keyboard::KEY_EXCLAIM}, + {"\"", love::keyboard::Keyboard::KEY_QUOTEDBL}, + {"#", love::keyboard::Keyboard::KEY_HASH}, + {"$", love::keyboard::Keyboard::KEY_DOLLAR}, + {"&", love::keyboard::Keyboard::KEY_AMPERSAND}, + {"'", love::keyboard::Keyboard::KEY_QUOTE}, + {"(", love::keyboard::Keyboard::KEY_LEFTPAREN}, + {")", love::keyboard::Keyboard::KEY_RIGHTPAREN}, + {"*", love::keyboard::Keyboard::KEY_ASTERISK}, + {"+", love::keyboard::Keyboard::KEY_PLUS}, + {",", love::keyboard::Keyboard::KEY_COMMA}, + {"-", love::keyboard::Keyboard::KEY_MINUS}, + {".", love::keyboard::Keyboard::KEY_PERIOD}, + {"/", love::keyboard::Keyboard::KEY_SLASH}, + {"0", love::keyboard::Keyboard::KEY_0}, + {"1", love::keyboard::Keyboard::KEY_1}, + {"2", love::keyboard::Keyboard::KEY_2}, + {"3", love::keyboard::Keyboard::KEY_3}, + {"4", love::keyboard::Keyboard::KEY_4}, + {"5", love::keyboard::Keyboard::KEY_5}, + {"6", love::keyboard::Keyboard::KEY_6}, + {"7", love::keyboard::Keyboard::KEY_7}, + {"8", love::keyboard::Keyboard::KEY_8}, + {"9", love::keyboard::Keyboard::KEY_9}, + {":", love::keyboard::Keyboard::KEY_COLON}, + {";", love::keyboard::Keyboard::KEY_SEMICOLON}, + {"<", love::keyboard::Keyboard::KEY_LESS}, + {"=", love::keyboard::Keyboard::KEY_EQUALS}, + {">", love::keyboard::Keyboard::KEY_GREATER}, + {"?", love::keyboard::Keyboard::KEY_QUESTION}, + {"@", love::keyboard::Keyboard::KEY_AT}, + + {"[", love::keyboard::Keyboard::KEY_LEFTBRACKET}, + {"\\", love::keyboard::Keyboard::KEY_BACKSLASH}, + {"]", love::keyboard::Keyboard::KEY_RIGHTBRACKET}, + {"^", love::keyboard::Keyboard::KEY_CARET}, + {"_", love::keyboard::Keyboard::KEY_UNDERSCORE}, + {"`", love::keyboard::Keyboard::KEY_BACKQUOTE}, + {"a", love::keyboard::Keyboard::KEY_A}, + {"b", love::keyboard::Keyboard::KEY_B}, + {"c", love::keyboard::Keyboard::KEY_C}, + {"d", love::keyboard::Keyboard::KEY_D}, + {"e", love::keyboard::Keyboard::KEY_E}, + {"f", love::keyboard::Keyboard::KEY_F}, + {"g", love::keyboard::Keyboard::KEY_G}, + {"h", love::keyboard::Keyboard::KEY_H}, + {"i", love::keyboard::Keyboard::KEY_I}, + {"j", love::keyboard::Keyboard::KEY_J}, + {"k", love::keyboard::Keyboard::KEY_K}, + {"l", love::keyboard::Keyboard::KEY_L}, + {"m", love::keyboard::Keyboard::KEY_M}, + {"n", love::keyboard::Keyboard::KEY_N}, + {"o", love::keyboard::Keyboard::KEY_O}, + {"p", love::keyboard::Keyboard::KEY_P}, + {"q", love::keyboard::Keyboard::KEY_Q}, + {"r", love::keyboard::Keyboard::KEY_R}, + {"s", love::keyboard::Keyboard::KEY_S}, + {"t", love::keyboard::Keyboard::KEY_T}, + {"u", love::keyboard::Keyboard::KEY_U}, + {"v", love::keyboard::Keyboard::KEY_V}, + {"w", love::keyboard::Keyboard::KEY_W}, + {"x", love::keyboard::Keyboard::KEY_X}, + {"y", love::keyboard::Keyboard::KEY_Y}, + {"z", love::keyboard::Keyboard::KEY_Z}, + {"delete", love::keyboard::Keyboard::KEY_DELETE}, + + {"kp0", love::keyboard::Keyboard::KEY_KP0}, + {"kp1", love::keyboard::Keyboard::KEY_KP1}, + {"kp2", love::keyboard::Keyboard::KEY_KP2}, + {"kp3", love::keyboard::Keyboard::KEY_KP3}, + {"kp4", love::keyboard::Keyboard::KEY_KP4}, + {"kp5", love::keyboard::Keyboard::KEY_KP5}, + {"kp6", love::keyboard::Keyboard::KEY_KP6}, + {"kp7", love::keyboard::Keyboard::KEY_KP7}, + {"kp8", love::keyboard::Keyboard::KEY_KP8}, + {"kp9", love::keyboard::Keyboard::KEY_KP9}, + {"kp.", love::keyboard::Keyboard::KEY_KP_PERIOD}, + {"kp/", love::keyboard::Keyboard::KEY_KP_DIVIDE}, + {"kp*", love::keyboard::Keyboard::KEY_KP_MULTIPLY}, + {"kp-", love::keyboard::Keyboard::KEY_KP_MINUS}, + {"kp+", love::keyboard::Keyboard::KEY_KP_PLUS}, + {"kpenter", love::keyboard::Keyboard::KEY_KP_ENTER}, + {"kp=", love::keyboard::Keyboard::KEY_KP_EQUALS}, + + {"up", love::keyboard::Keyboard::KEY_UP}, + {"down", love::keyboard::Keyboard::KEY_DOWN}, + {"right", love::keyboard::Keyboard::KEY_RIGHT}, + {"left", love::keyboard::Keyboard::KEY_LEFT}, + {"insert", love::keyboard::Keyboard::KEY_INSERT}, + {"home", love::keyboard::Keyboard::KEY_HOME}, + {"end", love::keyboard::Keyboard::KEY_END}, + {"pageup", love::keyboard::Keyboard::KEY_PAGEUP}, + {"pagedown", love::keyboard::Keyboard::KEY_PAGEDOWN}, + + {"f1", love::keyboard::Keyboard::KEY_F1}, + {"f2", love::keyboard::Keyboard::KEY_F2}, + {"f3", love::keyboard::Keyboard::KEY_F3}, + {"f4", love::keyboard::Keyboard::KEY_F4}, + {"f5", love::keyboard::Keyboard::KEY_F5}, + {"f6", love::keyboard::Keyboard::KEY_F6}, + {"f7", love::keyboard::Keyboard::KEY_F7}, + {"f8", love::keyboard::Keyboard::KEY_F8}, + {"f9", love::keyboard::Keyboard::KEY_F9}, + {"f10", love::keyboard::Keyboard::KEY_F10}, + {"f11", love::keyboard::Keyboard::KEY_F11}, + {"f12", love::keyboard::Keyboard::KEY_F12}, + {"f13", love::keyboard::Keyboard::KEY_F13}, + {"f14", love::keyboard::Keyboard::KEY_F14}, + {"f15", love::keyboard::Keyboard::KEY_F15}, + + {"numlock", love::keyboard::Keyboard::KEY_NUMLOCK}, + {"capslock", love::keyboard::Keyboard::KEY_CAPSLOCK}, + {"scrollock", love::keyboard::Keyboard::KEY_SCROLLOCK}, + {"rshift", love::keyboard::Keyboard::KEY_RSHIFT}, + {"lshift", love::keyboard::Keyboard::KEY_LSHIFT}, + {"rctrl", love::keyboard::Keyboard::KEY_RCTRL}, + {"lctrl", love::keyboard::Keyboard::KEY_LCTRL}, + {"ralt", love::keyboard::Keyboard::KEY_RALT}, + {"lalt", love::keyboard::Keyboard::KEY_LALT}, + {"rmeta", love::keyboard::Keyboard::KEY_RMETA}, + {"lmeta", love::keyboard::Keyboard::KEY_LMETA}, + {"lsuper", love::keyboard::Keyboard::KEY_LSUPER}, + {"rsuper", love::keyboard::Keyboard::KEY_RSUPER}, + {"mode", love::keyboard::Keyboard::KEY_MODE}, + {"compose", love::keyboard::Keyboard::KEY_COMPOSE}, + + {"help", love::keyboard::Keyboard::KEY_HELP}, + {"print", love::keyboard::Keyboard::KEY_PRINT}, + {"sysreq", love::keyboard::Keyboard::KEY_SYSREQ}, + {"break", love::keyboard::Keyboard::KEY_BREAK}, + {"menu", love::keyboard::Keyboard::KEY_MENU}, + {"power", love::keyboard::Keyboard::KEY_POWER}, + {"euro", love::keyboard::Keyboard::KEY_EURO}, + {"undo", love::keyboard::Keyboard::KEY_UNDO}, + + {"unknown", love::keyboard::Keyboard::KEY_UNKNOWN}, +}; + +StringMap Event::keys(Event::keyEntries, sizeof(Event::keyEntries)); + +} // event +} // love diff --git a/src/modules/event/Event.h b/src/modules/event/Event.h index d46bdce0f..7aa11e92a 100644 --- a/src/modules/event/Event.h +++ b/src/modules/event/Event.h @@ -1,83 +1,83 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_EVENT_EVENT_H -#define LOVE_EVENT_EVENT_H - -// LOVE -#include "common/Module.h" -#include "common/StringMap.h" -#include "common/Variant.h" -#include "keyboard/Keyboard.h" -#include "mouse/Mouse.h" -#include "thread/threads.h" - -// STL -#include - -namespace love -{ -namespace event -{ -class Message : public Object -{ -private: - std::string name; - Variant *args[4]; - int nargs; - -public: - Message(std::string name, Variant *a = NULL, Variant *b = NULL, Variant *c = NULL, Variant *d = NULL); - ~Message(); - - int toLua(lua_State *L); - static Message *fromLua(lua_State *L, int n); -}; - -class Event : public Module -{ -public: - virtual ~Event(); - - void push(Message *msg); - bool poll(Message *&msg); - virtual void clear(); - - virtual void pump() = 0; - - static bool getConstant(const char *in, love::mouse::Mouse::Button &out); - static bool getConstant(love::mouse::Mouse::Button in, const char *&out); - static bool getConstant(const char *in, love::keyboard::Keyboard::Key &out); - static bool getConstant(love::keyboard::Keyboard::Key in, const char *&out); - -protected: - thread::Mutex mutex; - std::queue queue; - static StringMap::Entry buttonEntries[]; - static StringMap buttons; - static StringMap::Entry keyEntries[]; - static StringMap keys; - -}; // Event - -} // event -} // love - -#endif // LOVE_EVENT_EVENT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_EVENT_EVENT_H +#define LOVE_EVENT_EVENT_H + +// LOVE +#include "common/Module.h" +#include "common/StringMap.h" +#include "common/Variant.h" +#include "keyboard/Keyboard.h" +#include "mouse/Mouse.h" +#include "thread/threads.h" + +// STL +#include + +namespace love +{ +namespace event +{ +class Message : public Object +{ +private: + std::string name; + Variant *args[4]; + int nargs; + +public: + Message(std::string name, Variant *a = NULL, Variant *b = NULL, Variant *c = NULL, Variant *d = NULL); + ~Message(); + + int toLua(lua_State *L); + static Message *fromLua(lua_State *L, int n); +}; + +class Event : public Module +{ +public: + virtual ~Event(); + + void push(Message *msg); + bool poll(Message *&msg); + virtual void clear(); + + virtual void pump() = 0; + + static bool getConstant(const char *in, love::mouse::Mouse::Button &out); + static bool getConstant(love::mouse::Mouse::Button in, const char *&out); + static bool getConstant(const char *in, love::keyboard::Keyboard::Key &out); + static bool getConstant(love::keyboard::Keyboard::Key in, const char *&out); + +protected: + thread::Mutex mutex; + std::queue queue; + static StringMap::Entry buttonEntries[]; + static StringMap buttons; + static StringMap::Entry keyEntries[]; + static StringMap keys; + +}; // Event + +} // event +} // love + +#endif // LOVE_EVENT_EVENT_H diff --git a/src/modules/event/sdl/Event.cpp b/src/modules/event/sdl/Event.cpp index 03f97fc34..0aeff94be 100644 --- a/src/modules/event/sdl/Event.cpp +++ b/src/modules/event/sdl/Event.cpp @@ -1,314 +1,314 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Event.h" - -#include "keyboard/Keyboard.h" -#include "mouse/Mouse.h" - -namespace love -{ -namespace event -{ -namespace sdl -{ - -const char *Event::getName() const -{ - return "love.event.sdl"; -} - -Event::Event() -{ - SDL_EnableUNICODE(1); -} - -void Event::pump() -{ - SDL_PumpEvents(); - - static SDL_Event e; - SDL_EnableUNICODE(1); - - Message *msg; - - while (SDL_PollEvent(&e)) - { - msg = convert(e); - if (msg) - { - push(msg); - msg->release(); - } - } -} - -Message *Event::wait() -{ - static SDL_Event e; - bool ok = (SDL_WaitEvent(&e) == 1); - if (!ok) - return NULL; - return convert(e); -} - -void Event::clear() -{ - static SDL_Event e; - - while (SDL_PollEvent(&e)) - { - // Do nothing with 'e' ... - } - - love::event::Event::clear(); -} - -Message *Event::convert(SDL_Event &e) -{ - Message *msg = NULL; - love::keyboard::Keyboard::Key key; - love::mouse::Mouse::Button button; - Variant *arg1, *arg2, *arg3; - const char *txt; - switch (e.type) - { - case SDL_KEYDOWN: - if (keys.find(e.key.keysym.sym, key) && love::event::Event::keys.find(key, txt)) - { - arg1 = new Variant(txt, strlen(txt)); - arg2 = new Variant((double) e.key.keysym.unicode); - msg = new Message("keypressed", arg1, arg2); - arg1->release(); - arg2->release(); - } - break; - case SDL_KEYUP: - if (keys.find(e.key.keysym.sym, key) && love::event::Event::keys.find(key, txt)) - { - arg1 = new Variant(txt, strlen(txt)); - msg = new Message("keyreleased", arg1); - arg1->release(); - } - break; - case SDL_MOUSEBUTTONDOWN: - case SDL_MOUSEBUTTONUP: - if (buttons.find(e.button.button, button) && love::event::Event::buttons.find(button, txt)) - { - arg1 = new Variant((double) e.button.x); - arg2 = new Variant((double) e.button.y); - arg3 = new Variant(txt, strlen(txt)); - msg = new Message((e.type == SDL_MOUSEBUTTONDOWN) ? - "mousepressed" : "mousereleased", - arg1, arg2, arg3); - arg1->release(); - arg2->release(); - arg3->release(); - } - break; - case SDL_JOYBUTTONDOWN: - case SDL_JOYBUTTONUP: - arg1 = new Variant((double)(e.jbutton.which+1)); - arg2 = new Variant((double)(e.jbutton.button+1)); - msg = new Message((e.type == SDL_JOYBUTTONDOWN) ? - "joystickpressed" : "joystickreleased", - arg1, arg2); - arg1->release(); - arg2->release(); - break; - case SDL_ACTIVEEVENT: - arg1 = new Variant(e.active.gain != 0); - if (e.active.state & SDL_APPINPUTFOCUS) - msg = new Message("focus", arg1); - arg1->release(); - break; - case SDL_QUIT: - msg = new Message("quit"); - break; - } - - return msg; -} - -EnumMap::Entry Event::keyEntries[] = -{ - { love::keyboard::Keyboard::KEY_BACKSPACE, SDLK_BACKSPACE}, - { love::keyboard::Keyboard::KEY_TAB, SDLK_TAB}, - { love::keyboard::Keyboard::KEY_CLEAR, SDLK_CLEAR}, - { love::keyboard::Keyboard::KEY_RETURN, SDLK_RETURN}, - { love::keyboard::Keyboard::KEY_PAUSE, SDLK_PAUSE}, - { love::keyboard::Keyboard::KEY_ESCAPE, SDLK_ESCAPE }, - { love::keyboard::Keyboard::KEY_SPACE, SDLK_SPACE }, - { love::keyboard::Keyboard::KEY_EXCLAIM, SDLK_EXCLAIM }, - { love::keyboard::Keyboard::KEY_QUOTEDBL, SDLK_QUOTEDBL }, - { love::keyboard::Keyboard::KEY_HASH, SDLK_HASH }, - { love::keyboard::Keyboard::KEY_DOLLAR, SDLK_DOLLAR }, - { love::keyboard::Keyboard::KEY_AMPERSAND, SDLK_AMPERSAND }, - { love::keyboard::Keyboard::KEY_QUOTE, SDLK_QUOTE }, - { love::keyboard::Keyboard::KEY_LEFTPAREN, SDLK_LEFTPAREN }, - { love::keyboard::Keyboard::KEY_RIGHTPAREN, SDLK_RIGHTPAREN }, - { love::keyboard::Keyboard::KEY_ASTERISK, SDLK_ASTERISK }, - { love::keyboard::Keyboard::KEY_PLUS, SDLK_PLUS }, - { love::keyboard::Keyboard::KEY_COMMA, SDLK_COMMA }, - { love::keyboard::Keyboard::KEY_MINUS, SDLK_MINUS }, - { love::keyboard::Keyboard::KEY_PERIOD, SDLK_PERIOD }, - { love::keyboard::Keyboard::KEY_SLASH, SDLK_SLASH }, - { love::keyboard::Keyboard::KEY_0, SDLK_0 }, - { love::keyboard::Keyboard::KEY_1, SDLK_1 }, - { love::keyboard::Keyboard::KEY_2, SDLK_2 }, - { love::keyboard::Keyboard::KEY_3, SDLK_3 }, - { love::keyboard::Keyboard::KEY_4, SDLK_4 }, - { love::keyboard::Keyboard::KEY_5, SDLK_5 }, - { love::keyboard::Keyboard::KEY_6, SDLK_6 }, - { love::keyboard::Keyboard::KEY_7, SDLK_7 }, - { love::keyboard::Keyboard::KEY_8, SDLK_8 }, - { love::keyboard::Keyboard::KEY_9, SDLK_9 }, - { love::keyboard::Keyboard::KEY_COLON, SDLK_COLON }, - { love::keyboard::Keyboard::KEY_SEMICOLON, SDLK_SEMICOLON }, - { love::keyboard::Keyboard::KEY_LESS, SDLK_LESS }, - { love::keyboard::Keyboard::KEY_EQUALS, SDLK_EQUALS }, - { love::keyboard::Keyboard::KEY_GREATER, SDLK_GREATER }, - { love::keyboard::Keyboard::KEY_QUESTION, SDLK_QUESTION }, - { love::keyboard::Keyboard::KEY_AT, SDLK_AT }, - - { love::keyboard::Keyboard::KEY_LEFTBRACKET, SDLK_LEFTBRACKET }, - { love::keyboard::Keyboard::KEY_BACKSLASH, SDLK_BACKSLASH }, - { love::keyboard::Keyboard::KEY_RIGHTBRACKET, SDLK_RIGHTBRACKET }, - { love::keyboard::Keyboard::KEY_CARET, SDLK_CARET }, - { love::keyboard::Keyboard::KEY_UNDERSCORE, SDLK_UNDERSCORE }, - { love::keyboard::Keyboard::KEY_BACKQUOTE, SDLK_BACKQUOTE }, - { love::keyboard::Keyboard::KEY_A, SDLK_a }, - { love::keyboard::Keyboard::KEY_B, SDLK_b }, - { love::keyboard::Keyboard::KEY_C, SDLK_c }, - { love::keyboard::Keyboard::KEY_D, SDLK_d }, - { love::keyboard::Keyboard::KEY_E, SDLK_e }, - { love::keyboard::Keyboard::KEY_F, SDLK_f }, - { love::keyboard::Keyboard::KEY_G, SDLK_g }, - { love::keyboard::Keyboard::KEY_H, SDLK_h }, - { love::keyboard::Keyboard::KEY_I, SDLK_i }, - { love::keyboard::Keyboard::KEY_J, SDLK_j }, - { love::keyboard::Keyboard::KEY_K, SDLK_k }, - { love::keyboard::Keyboard::KEY_L, SDLK_l }, - { love::keyboard::Keyboard::KEY_M, SDLK_m }, - { love::keyboard::Keyboard::KEY_N, SDLK_n }, - { love::keyboard::Keyboard::KEY_O, SDLK_o }, - { love::keyboard::Keyboard::KEY_P, SDLK_p }, - { love::keyboard::Keyboard::KEY_Q, SDLK_q }, - { love::keyboard::Keyboard::KEY_R, SDLK_r }, - { love::keyboard::Keyboard::KEY_S, SDLK_s }, - { love::keyboard::Keyboard::KEY_T, SDLK_t }, - { love::keyboard::Keyboard::KEY_U, SDLK_u }, - { love::keyboard::Keyboard::KEY_V, SDLK_v }, - { love::keyboard::Keyboard::KEY_W, SDLK_w }, - { love::keyboard::Keyboard::KEY_X, SDLK_x }, - { love::keyboard::Keyboard::KEY_Y, SDLK_y }, - { love::keyboard::Keyboard::KEY_Z, SDLK_z }, - { love::keyboard::Keyboard::KEY_DELETE, SDLK_DELETE }, - - { love::keyboard::Keyboard::KEY_KP0, SDLK_KP0 }, - { love::keyboard::Keyboard::KEY_KP1, SDLK_KP1 }, - { love::keyboard::Keyboard::KEY_KP2, SDLK_KP2 }, - { love::keyboard::Keyboard::KEY_KP3, SDLK_KP3 }, - { love::keyboard::Keyboard::KEY_KP4, SDLK_KP4 }, - { love::keyboard::Keyboard::KEY_KP5, SDLK_KP5 }, - { love::keyboard::Keyboard::KEY_KP6, SDLK_KP6 }, - { love::keyboard::Keyboard::KEY_KP7, SDLK_KP7 }, - { love::keyboard::Keyboard::KEY_KP8, SDLK_KP8 }, - { love::keyboard::Keyboard::KEY_KP9, SDLK_KP9 }, - { love::keyboard::Keyboard::KEY_KP_PERIOD, SDLK_KP_PERIOD }, - { love::keyboard::Keyboard::KEY_KP_DIVIDE, SDLK_KP_DIVIDE }, - { love::keyboard::Keyboard::KEY_KP_MULTIPLY, SDLK_KP_MULTIPLY}, - { love::keyboard::Keyboard::KEY_KP_MINUS, SDLK_KP_MINUS }, - { love::keyboard::Keyboard::KEY_KP_PLUS, SDLK_KP_PLUS }, - { love::keyboard::Keyboard::KEY_KP_ENTER, SDLK_KP_ENTER }, - { love::keyboard::Keyboard::KEY_KP_EQUALS, SDLK_KP_EQUALS }, - - { love::keyboard::Keyboard::KEY_UP, SDLK_UP }, - { love::keyboard::Keyboard::KEY_DOWN, SDLK_DOWN }, - { love::keyboard::Keyboard::KEY_RIGHT, SDLK_RIGHT }, - { love::keyboard::Keyboard::KEY_LEFT, SDLK_LEFT }, - { love::keyboard::Keyboard::KEY_INSERT, SDLK_INSERT }, - { love::keyboard::Keyboard::KEY_HOME, SDLK_HOME }, - { love::keyboard::Keyboard::KEY_END, SDLK_END }, - { love::keyboard::Keyboard::KEY_PAGEUP, SDLK_PAGEUP }, - { love::keyboard::Keyboard::KEY_PAGEDOWN, SDLK_PAGEDOWN }, - - { love::keyboard::Keyboard::KEY_F1, SDLK_F1 }, - { love::keyboard::Keyboard::KEY_F2, SDLK_F2 }, - { love::keyboard::Keyboard::KEY_F3, SDLK_F3 }, - { love::keyboard::Keyboard::KEY_F4, SDLK_F4 }, - { love::keyboard::Keyboard::KEY_F5, SDLK_F5 }, - { love::keyboard::Keyboard::KEY_F6, SDLK_F6 }, - { love::keyboard::Keyboard::KEY_F7, SDLK_F7 }, - { love::keyboard::Keyboard::KEY_F8, SDLK_F8 }, - { love::keyboard::Keyboard::KEY_F9, SDLK_F9 }, - { love::keyboard::Keyboard::KEY_F10, SDLK_F10 }, - { love::keyboard::Keyboard::KEY_F11, SDLK_F11 }, - { love::keyboard::Keyboard::KEY_F12, SDLK_F12 }, - { love::keyboard::Keyboard::KEY_F13, SDLK_F13 }, - { love::keyboard::Keyboard::KEY_F14, SDLK_F14 }, - { love::keyboard::Keyboard::KEY_F15, SDLK_F15 }, - - { love::keyboard::Keyboard::KEY_NUMLOCK, SDLK_NUMLOCK }, - { love::keyboard::Keyboard::KEY_CAPSLOCK, SDLK_CAPSLOCK }, - { love::keyboard::Keyboard::KEY_SCROLLOCK, SDLK_SCROLLOCK }, - { love::keyboard::Keyboard::KEY_RSHIFT, SDLK_RSHIFT }, - { love::keyboard::Keyboard::KEY_LSHIFT, SDLK_LSHIFT }, - { love::keyboard::Keyboard::KEY_RCTRL, SDLK_RCTRL }, - { love::keyboard::Keyboard::KEY_LCTRL, SDLK_LCTRL }, - { love::keyboard::Keyboard::KEY_RALT, SDLK_RALT }, - { love::keyboard::Keyboard::KEY_LALT, SDLK_LALT }, - { love::keyboard::Keyboard::KEY_RMETA, SDLK_RMETA }, - { love::keyboard::Keyboard::KEY_LMETA, SDLK_LMETA }, - { love::keyboard::Keyboard::KEY_LSUPER, SDLK_LSUPER }, - { love::keyboard::Keyboard::KEY_RSUPER, SDLK_RSUPER }, - { love::keyboard::Keyboard::KEY_MODE, SDLK_MODE }, - { love::keyboard::Keyboard::KEY_COMPOSE, SDLK_COMPOSE }, - - { love::keyboard::Keyboard::KEY_HELP, SDLK_HELP }, - { love::keyboard::Keyboard::KEY_PRINT, SDLK_PRINT }, - { love::keyboard::Keyboard::KEY_SYSREQ, SDLK_SYSREQ }, - { love::keyboard::Keyboard::KEY_BREAK, SDLK_BREAK }, - { love::keyboard::Keyboard::KEY_MENU, SDLK_MENU }, - { love::keyboard::Keyboard::KEY_POWER, SDLK_POWER }, - { love::keyboard::Keyboard::KEY_EURO, SDLK_EURO }, - { love::keyboard::Keyboard::KEY_UNDO, SDLK_UNDO }, - - { love::keyboard::Keyboard::KEY_UNKNOWN, SDLK_UNKNOWN }, -}; - -EnumMap Event::keys(Event::keyEntries, sizeof(Event::keyEntries)); - -EnumMap::Entry Event::buttonEntries[] = -{ - { love::mouse::Mouse::BUTTON_LEFT, SDL_BUTTON_LEFT}, - { love::mouse::Mouse::BUTTON_MIDDLE, SDL_BUTTON_MIDDLE}, - { love::mouse::Mouse::BUTTON_RIGHT, SDL_BUTTON_RIGHT}, - { love::mouse::Mouse::BUTTON_WHEELUP, SDL_BUTTON_WHEELUP}, - { love::mouse::Mouse::BUTTON_WHEELDOWN, SDL_BUTTON_WHEELDOWN}, - { love::mouse::Mouse::BUTTON_X1, SDL_BUTTON_X1}, - { love::mouse::Mouse::BUTTON_X2, SDL_BUTTON_X2}, -}; - -EnumMap Event::buttons(Event::buttonEntries, sizeof(Event::buttonEntries)); - -} // sdl -} // event -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Event.h" + +#include "keyboard/Keyboard.h" +#include "mouse/Mouse.h" + +namespace love +{ +namespace event +{ +namespace sdl +{ + +const char *Event::getName() const +{ + return "love.event.sdl"; +} + +Event::Event() +{ + SDL_EnableUNICODE(1); +} + +void Event::pump() +{ + SDL_PumpEvents(); + + static SDL_Event e; + SDL_EnableUNICODE(1); + + Message *msg; + + while (SDL_PollEvent(&e)) + { + msg = convert(e); + if (msg) + { + push(msg); + msg->release(); + } + } +} + +Message *Event::wait() +{ + static SDL_Event e; + bool ok = (SDL_WaitEvent(&e) == 1); + if (!ok) + return NULL; + return convert(e); +} + +void Event::clear() +{ + static SDL_Event e; + + while (SDL_PollEvent(&e)) + { + // Do nothing with 'e' ... + } + + love::event::Event::clear(); +} + +Message *Event::convert(SDL_Event &e) +{ + Message *msg = NULL; + love::keyboard::Keyboard::Key key; + love::mouse::Mouse::Button button; + Variant *arg1, *arg2, *arg3; + const char *txt; + switch (e.type) + { + case SDL_KEYDOWN: + if (keys.find(e.key.keysym.sym, key) && love::event::Event::keys.find(key, txt)) + { + arg1 = new Variant(txt, strlen(txt)); + arg2 = new Variant((double) e.key.keysym.unicode); + msg = new Message("keypressed", arg1, arg2); + arg1->release(); + arg2->release(); + } + break; + case SDL_KEYUP: + if (keys.find(e.key.keysym.sym, key) && love::event::Event::keys.find(key, txt)) + { + arg1 = new Variant(txt, strlen(txt)); + msg = new Message("keyreleased", arg1); + arg1->release(); + } + break; + case SDL_MOUSEBUTTONDOWN: + case SDL_MOUSEBUTTONUP: + if (buttons.find(e.button.button, button) && love::event::Event::buttons.find(button, txt)) + { + arg1 = new Variant((double) e.button.x); + arg2 = new Variant((double) e.button.y); + arg3 = new Variant(txt, strlen(txt)); + msg = new Message((e.type == SDL_MOUSEBUTTONDOWN) ? + "mousepressed" : "mousereleased", + arg1, arg2, arg3); + arg1->release(); + arg2->release(); + arg3->release(); + } + break; + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + arg1 = new Variant((double)(e.jbutton.which+1)); + arg2 = new Variant((double)(e.jbutton.button+1)); + msg = new Message((e.type == SDL_JOYBUTTONDOWN) ? + "joystickpressed" : "joystickreleased", + arg1, arg2); + arg1->release(); + arg2->release(); + break; + case SDL_ACTIVEEVENT: + arg1 = new Variant(e.active.gain != 0); + if (e.active.state & SDL_APPINPUTFOCUS) + msg = new Message("focus", arg1); + arg1->release(); + break; + case SDL_QUIT: + msg = new Message("quit"); + break; + } + + return msg; +} + +EnumMap::Entry Event::keyEntries[] = +{ + { love::keyboard::Keyboard::KEY_BACKSPACE, SDLK_BACKSPACE}, + { love::keyboard::Keyboard::KEY_TAB, SDLK_TAB}, + { love::keyboard::Keyboard::KEY_CLEAR, SDLK_CLEAR}, + { love::keyboard::Keyboard::KEY_RETURN, SDLK_RETURN}, + { love::keyboard::Keyboard::KEY_PAUSE, SDLK_PAUSE}, + { love::keyboard::Keyboard::KEY_ESCAPE, SDLK_ESCAPE }, + { love::keyboard::Keyboard::KEY_SPACE, SDLK_SPACE }, + { love::keyboard::Keyboard::KEY_EXCLAIM, SDLK_EXCLAIM }, + { love::keyboard::Keyboard::KEY_QUOTEDBL, SDLK_QUOTEDBL }, + { love::keyboard::Keyboard::KEY_HASH, SDLK_HASH }, + { love::keyboard::Keyboard::KEY_DOLLAR, SDLK_DOLLAR }, + { love::keyboard::Keyboard::KEY_AMPERSAND, SDLK_AMPERSAND }, + { love::keyboard::Keyboard::KEY_QUOTE, SDLK_QUOTE }, + { love::keyboard::Keyboard::KEY_LEFTPAREN, SDLK_LEFTPAREN }, + { love::keyboard::Keyboard::KEY_RIGHTPAREN, SDLK_RIGHTPAREN }, + { love::keyboard::Keyboard::KEY_ASTERISK, SDLK_ASTERISK }, + { love::keyboard::Keyboard::KEY_PLUS, SDLK_PLUS }, + { love::keyboard::Keyboard::KEY_COMMA, SDLK_COMMA }, + { love::keyboard::Keyboard::KEY_MINUS, SDLK_MINUS }, + { love::keyboard::Keyboard::KEY_PERIOD, SDLK_PERIOD }, + { love::keyboard::Keyboard::KEY_SLASH, SDLK_SLASH }, + { love::keyboard::Keyboard::KEY_0, SDLK_0 }, + { love::keyboard::Keyboard::KEY_1, SDLK_1 }, + { love::keyboard::Keyboard::KEY_2, SDLK_2 }, + { love::keyboard::Keyboard::KEY_3, SDLK_3 }, + { love::keyboard::Keyboard::KEY_4, SDLK_4 }, + { love::keyboard::Keyboard::KEY_5, SDLK_5 }, + { love::keyboard::Keyboard::KEY_6, SDLK_6 }, + { love::keyboard::Keyboard::KEY_7, SDLK_7 }, + { love::keyboard::Keyboard::KEY_8, SDLK_8 }, + { love::keyboard::Keyboard::KEY_9, SDLK_9 }, + { love::keyboard::Keyboard::KEY_COLON, SDLK_COLON }, + { love::keyboard::Keyboard::KEY_SEMICOLON, SDLK_SEMICOLON }, + { love::keyboard::Keyboard::KEY_LESS, SDLK_LESS }, + { love::keyboard::Keyboard::KEY_EQUALS, SDLK_EQUALS }, + { love::keyboard::Keyboard::KEY_GREATER, SDLK_GREATER }, + { love::keyboard::Keyboard::KEY_QUESTION, SDLK_QUESTION }, + { love::keyboard::Keyboard::KEY_AT, SDLK_AT }, + + { love::keyboard::Keyboard::KEY_LEFTBRACKET, SDLK_LEFTBRACKET }, + { love::keyboard::Keyboard::KEY_BACKSLASH, SDLK_BACKSLASH }, + { love::keyboard::Keyboard::KEY_RIGHTBRACKET, SDLK_RIGHTBRACKET }, + { love::keyboard::Keyboard::KEY_CARET, SDLK_CARET }, + { love::keyboard::Keyboard::KEY_UNDERSCORE, SDLK_UNDERSCORE }, + { love::keyboard::Keyboard::KEY_BACKQUOTE, SDLK_BACKQUOTE }, + { love::keyboard::Keyboard::KEY_A, SDLK_a }, + { love::keyboard::Keyboard::KEY_B, SDLK_b }, + { love::keyboard::Keyboard::KEY_C, SDLK_c }, + { love::keyboard::Keyboard::KEY_D, SDLK_d }, + { love::keyboard::Keyboard::KEY_E, SDLK_e }, + { love::keyboard::Keyboard::KEY_F, SDLK_f }, + { love::keyboard::Keyboard::KEY_G, SDLK_g }, + { love::keyboard::Keyboard::KEY_H, SDLK_h }, + { love::keyboard::Keyboard::KEY_I, SDLK_i }, + { love::keyboard::Keyboard::KEY_J, SDLK_j }, + { love::keyboard::Keyboard::KEY_K, SDLK_k }, + { love::keyboard::Keyboard::KEY_L, SDLK_l }, + { love::keyboard::Keyboard::KEY_M, SDLK_m }, + { love::keyboard::Keyboard::KEY_N, SDLK_n }, + { love::keyboard::Keyboard::KEY_O, SDLK_o }, + { love::keyboard::Keyboard::KEY_P, SDLK_p }, + { love::keyboard::Keyboard::KEY_Q, SDLK_q }, + { love::keyboard::Keyboard::KEY_R, SDLK_r }, + { love::keyboard::Keyboard::KEY_S, SDLK_s }, + { love::keyboard::Keyboard::KEY_T, SDLK_t }, + { love::keyboard::Keyboard::KEY_U, SDLK_u }, + { love::keyboard::Keyboard::KEY_V, SDLK_v }, + { love::keyboard::Keyboard::KEY_W, SDLK_w }, + { love::keyboard::Keyboard::KEY_X, SDLK_x }, + { love::keyboard::Keyboard::KEY_Y, SDLK_y }, + { love::keyboard::Keyboard::KEY_Z, SDLK_z }, + { love::keyboard::Keyboard::KEY_DELETE, SDLK_DELETE }, + + { love::keyboard::Keyboard::KEY_KP0, SDLK_KP0 }, + { love::keyboard::Keyboard::KEY_KP1, SDLK_KP1 }, + { love::keyboard::Keyboard::KEY_KP2, SDLK_KP2 }, + { love::keyboard::Keyboard::KEY_KP3, SDLK_KP3 }, + { love::keyboard::Keyboard::KEY_KP4, SDLK_KP4 }, + { love::keyboard::Keyboard::KEY_KP5, SDLK_KP5 }, + { love::keyboard::Keyboard::KEY_KP6, SDLK_KP6 }, + { love::keyboard::Keyboard::KEY_KP7, SDLK_KP7 }, + { love::keyboard::Keyboard::KEY_KP8, SDLK_KP8 }, + { love::keyboard::Keyboard::KEY_KP9, SDLK_KP9 }, + { love::keyboard::Keyboard::KEY_KP_PERIOD, SDLK_KP_PERIOD }, + { love::keyboard::Keyboard::KEY_KP_DIVIDE, SDLK_KP_DIVIDE }, + { love::keyboard::Keyboard::KEY_KP_MULTIPLY, SDLK_KP_MULTIPLY}, + { love::keyboard::Keyboard::KEY_KP_MINUS, SDLK_KP_MINUS }, + { love::keyboard::Keyboard::KEY_KP_PLUS, SDLK_KP_PLUS }, + { love::keyboard::Keyboard::KEY_KP_ENTER, SDLK_KP_ENTER }, + { love::keyboard::Keyboard::KEY_KP_EQUALS, SDLK_KP_EQUALS }, + + { love::keyboard::Keyboard::KEY_UP, SDLK_UP }, + { love::keyboard::Keyboard::KEY_DOWN, SDLK_DOWN }, + { love::keyboard::Keyboard::KEY_RIGHT, SDLK_RIGHT }, + { love::keyboard::Keyboard::KEY_LEFT, SDLK_LEFT }, + { love::keyboard::Keyboard::KEY_INSERT, SDLK_INSERT }, + { love::keyboard::Keyboard::KEY_HOME, SDLK_HOME }, + { love::keyboard::Keyboard::KEY_END, SDLK_END }, + { love::keyboard::Keyboard::KEY_PAGEUP, SDLK_PAGEUP }, + { love::keyboard::Keyboard::KEY_PAGEDOWN, SDLK_PAGEDOWN }, + + { love::keyboard::Keyboard::KEY_F1, SDLK_F1 }, + { love::keyboard::Keyboard::KEY_F2, SDLK_F2 }, + { love::keyboard::Keyboard::KEY_F3, SDLK_F3 }, + { love::keyboard::Keyboard::KEY_F4, SDLK_F4 }, + { love::keyboard::Keyboard::KEY_F5, SDLK_F5 }, + { love::keyboard::Keyboard::KEY_F6, SDLK_F6 }, + { love::keyboard::Keyboard::KEY_F7, SDLK_F7 }, + { love::keyboard::Keyboard::KEY_F8, SDLK_F8 }, + { love::keyboard::Keyboard::KEY_F9, SDLK_F9 }, + { love::keyboard::Keyboard::KEY_F10, SDLK_F10 }, + { love::keyboard::Keyboard::KEY_F11, SDLK_F11 }, + { love::keyboard::Keyboard::KEY_F12, SDLK_F12 }, + { love::keyboard::Keyboard::KEY_F13, SDLK_F13 }, + { love::keyboard::Keyboard::KEY_F14, SDLK_F14 }, + { love::keyboard::Keyboard::KEY_F15, SDLK_F15 }, + + { love::keyboard::Keyboard::KEY_NUMLOCK, SDLK_NUMLOCK }, + { love::keyboard::Keyboard::KEY_CAPSLOCK, SDLK_CAPSLOCK }, + { love::keyboard::Keyboard::KEY_SCROLLOCK, SDLK_SCROLLOCK }, + { love::keyboard::Keyboard::KEY_RSHIFT, SDLK_RSHIFT }, + { love::keyboard::Keyboard::KEY_LSHIFT, SDLK_LSHIFT }, + { love::keyboard::Keyboard::KEY_RCTRL, SDLK_RCTRL }, + { love::keyboard::Keyboard::KEY_LCTRL, SDLK_LCTRL }, + { love::keyboard::Keyboard::KEY_RALT, SDLK_RALT }, + { love::keyboard::Keyboard::KEY_LALT, SDLK_LALT }, + { love::keyboard::Keyboard::KEY_RMETA, SDLK_RMETA }, + { love::keyboard::Keyboard::KEY_LMETA, SDLK_LMETA }, + { love::keyboard::Keyboard::KEY_LSUPER, SDLK_LSUPER }, + { love::keyboard::Keyboard::KEY_RSUPER, SDLK_RSUPER }, + { love::keyboard::Keyboard::KEY_MODE, SDLK_MODE }, + { love::keyboard::Keyboard::KEY_COMPOSE, SDLK_COMPOSE }, + + { love::keyboard::Keyboard::KEY_HELP, SDLK_HELP }, + { love::keyboard::Keyboard::KEY_PRINT, SDLK_PRINT }, + { love::keyboard::Keyboard::KEY_SYSREQ, SDLK_SYSREQ }, + { love::keyboard::Keyboard::KEY_BREAK, SDLK_BREAK }, + { love::keyboard::Keyboard::KEY_MENU, SDLK_MENU }, + { love::keyboard::Keyboard::KEY_POWER, SDLK_POWER }, + { love::keyboard::Keyboard::KEY_EURO, SDLK_EURO }, + { love::keyboard::Keyboard::KEY_UNDO, SDLK_UNDO }, + + { love::keyboard::Keyboard::KEY_UNKNOWN, SDLK_UNKNOWN }, +}; + +EnumMap Event::keys(Event::keyEntries, sizeof(Event::keyEntries)); + +EnumMap::Entry Event::buttonEntries[] = +{ + { love::mouse::Mouse::BUTTON_LEFT, SDL_BUTTON_LEFT}, + { love::mouse::Mouse::BUTTON_MIDDLE, SDL_BUTTON_MIDDLE}, + { love::mouse::Mouse::BUTTON_RIGHT, SDL_BUTTON_RIGHT}, + { love::mouse::Mouse::BUTTON_WHEELUP, SDL_BUTTON_WHEELUP}, + { love::mouse::Mouse::BUTTON_WHEELDOWN, SDL_BUTTON_WHEELDOWN}, + { love::mouse::Mouse::BUTTON_X1, SDL_BUTTON_X1}, + { love::mouse::Mouse::BUTTON_X2, SDL_BUTTON_X2}, +}; + +EnumMap Event::buttons(Event::buttonEntries, sizeof(Event::buttonEntries)); + +} // sdl +} // event +} // love diff --git a/src/modules/event/sdl/Event.h b/src/modules/event/sdl/Event.h index 02aac455a..ae8fdc7f1 100644 --- a/src/modules/event/sdl/Event.h +++ b/src/modules/event/sdl/Event.h @@ -1,82 +1,82 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_EVENT_SDL_EVENT_H -#define LOVE_EVENT_SDL_EVENT_H - -// LOVE -#include "event/Event.h" -#include "common/runtime.h" -#include "common/EnumMap.h" - -// SDL -#include - -namespace love -{ -namespace event -{ -namespace sdl -{ - -class Event : public love::event::Event -{ -public: - - // Implements Module. - const char *getName() const; - - Event(); - - /** - * Pumps the event queue. This function gathers all the pending input information - * from devices and places it on the event queue. Normally not needed if you poll - * for events. - **/ - void pump(); - - /** - * Waits for the next event (indefinitely). Useful for creating games where - * the screen and game state only needs updating when the user interacts with - * the window. - **/ - Message *wait(); - - /** - * Clears the event queue. - */ - void clear(); - -private: - - Message *convert(SDL_Event &e); - - static EnumMap::Entry keyEntries[]; - static EnumMap keys; - static EnumMap::Entry buttonEntries[]; - static EnumMap buttons; - -}; // System - -} // sdl -} // event -} // love - -#endif // LOVE_EVENT_SDL_EVENT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_EVENT_SDL_EVENT_H +#define LOVE_EVENT_SDL_EVENT_H + +// LOVE +#include "event/Event.h" +#include "common/runtime.h" +#include "common/EnumMap.h" + +// SDL +#include + +namespace love +{ +namespace event +{ +namespace sdl +{ + +class Event : public love::event::Event +{ +public: + + // Implements Module. + const char *getName() const; + + Event(); + + /** + * Pumps the event queue. This function gathers all the pending input information + * from devices and places it on the event queue. Normally not needed if you poll + * for events. + **/ + void pump(); + + /** + * Waits for the next event (indefinitely). Useful for creating games where + * the screen and game state only needs updating when the user interacts with + * the window. + **/ + Message *wait(); + + /** + * Clears the event queue. + */ + void clear(); + +private: + + Message *convert(SDL_Event &e); + + static EnumMap::Entry keyEntries[]; + static EnumMap keys; + static EnumMap::Entry buttonEntries[]; + static EnumMap buttons; + +}; // System + +} // sdl +} // event +} // love + +#endif // LOVE_EVENT_SDL_EVENT_H diff --git a/src/modules/event/sdl/wrap_Event.cpp b/src/modules/event/sdl/wrap_Event.cpp index 17ab9aa06..5cdcf5a3d 100644 --- a/src/modules/event/sdl/wrap_Event.cpp +++ b/src/modules/event/sdl/wrap_Event.cpp @@ -1,150 +1,150 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Event.h" - -// LOVE -#include "common/runtime.h" - -// sdlevent -#include "Event.h" - -namespace love -{ -namespace event -{ -namespace sdl -{ - -static Event *instance = 0; - -static int poll_i(lua_State *L) -{ - Message *m; - - while (instance->poll(m)) - { - int args = m->toLua(L); - m->release(); - return args; - } - - // No pending events. - return 0; -} - -int w_pump(lua_State *) -{ - instance->pump(); - return 0; -} - -int w_poll(lua_State *L) -{ - lua_pushcclosure(L, &poll_i, 0); - return 1; -} - -int w_wait(lua_State *L) -{ - static Message *m; - - if ((m = instance->wait())) - { - int args = m->toLua(L); - m->release(); - return args; - } - - return 0; -} - -int w_push(lua_State *L) -{ - static Message *m; - - bool success = (m = Message::fromLua(L, 1)) != NULL; - luax_pushboolean(L, success); - - if (!success) - return 1; - - instance->push(m); - m->release(); - - return 1; -} - -int w_clear(lua_State *) -{ - instance->clear(); - return 0; -} - -int w_quit(lua_State *L) -{ - Message *m = new Message("quit"); - instance->push(m); - m->release(); - luax_pushboolean(L, true); - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "pump", w_pump }, - { "poll", w_poll }, - { "wait", w_wait }, - { "push", w_push }, - { "clear", w_clear }, - { "quit", w_quit }, - { 0, 0 } -}; - -extern "C" int luaopen_love_event(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new Event(); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "event"; - w.flags = MODULE_T; - w.functions = functions; - w.types = 0; - - return luax_register_module(L, w); -} - -} // sdl -} // event -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Event.h" + +// LOVE +#include "common/runtime.h" + +// sdlevent +#include "Event.h" + +namespace love +{ +namespace event +{ +namespace sdl +{ + +static Event *instance = 0; + +static int poll_i(lua_State *L) +{ + Message *m; + + while (instance->poll(m)) + { + int args = m->toLua(L); + m->release(); + return args; + } + + // No pending events. + return 0; +} + +int w_pump(lua_State *) +{ + instance->pump(); + return 0; +} + +int w_poll(lua_State *L) +{ + lua_pushcclosure(L, &poll_i, 0); + return 1; +} + +int w_wait(lua_State *L) +{ + static Message *m; + + if ((m = instance->wait())) + { + int args = m->toLua(L); + m->release(); + return args; + } + + return 0; +} + +int w_push(lua_State *L) +{ + static Message *m; + + bool success = (m = Message::fromLua(L, 1)) != NULL; + luax_pushboolean(L, success); + + if (!success) + return 1; + + instance->push(m); + m->release(); + + return 1; +} + +int w_clear(lua_State *) +{ + instance->clear(); + return 0; +} + +int w_quit(lua_State *L) +{ + Message *m = new Message("quit"); + instance->push(m); + m->release(); + luax_pushboolean(L, true); + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "pump", w_pump }, + { "poll", w_poll }, + { "wait", w_wait }, + { "push", w_push }, + { "clear", w_clear }, + { "quit", w_quit }, + { 0, 0 } +}; + +extern "C" int luaopen_love_event(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new Event(); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "event"; + w.flags = MODULE_T; + w.functions = functions; + w.types = 0; + + return luax_register_module(L, w); +} + +} // sdl +} // event +} // love diff --git a/src/modules/event/sdl/wrap_Event.h b/src/modules/event/sdl/wrap_Event.h index b518cb8ea..4d75814bc 100644 --- a/src/modules/event/sdl/wrap_Event.h +++ b/src/modules/event/sdl/wrap_Event.h @@ -1,48 +1,48 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_EVENT_SDL_WRAP_EVENT_H -#define LOVE_EVENT_SDL_WRAP_EVENT_H - -// LOVE -#include "common/config.h" -#include "Event.h" - -namespace love -{ -namespace event -{ -namespace sdl -{ - -int w_pump(lua_State *L); -int w_poll(lua_State *L); -int w_wait(lua_State *L); -int w_push(lua_State *L); -int w_clear(lua_State *L); -int w_quit(lua_State *L); - -extern "C" LOVE_EXPORT int luaopen_love_event(lua_State *L); - -} // sdl -} // event -} // love - -#endif // LOVE_EVENT_SDL_WRAP_EVENT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_EVENT_SDL_WRAP_EVENT_H +#define LOVE_EVENT_SDL_WRAP_EVENT_H + +// LOVE +#include "common/config.h" +#include "Event.h" + +namespace love +{ +namespace event +{ +namespace sdl +{ + +int w_pump(lua_State *L); +int w_poll(lua_State *L); +int w_wait(lua_State *L); +int w_push(lua_State *L); +int w_clear(lua_State *L); +int w_quit(lua_State *L); + +extern "C" LOVE_EXPORT int luaopen_love_event(lua_State *L); + +} // sdl +} // event +} // love + +#endif // LOVE_EVENT_SDL_WRAP_EVENT_H diff --git a/src/modules/filesystem/File.cpp b/src/modules/filesystem/File.cpp index 198d8d2a9..e478be1a1 100644 --- a/src/modules/filesystem/File.cpp +++ b/src/modules/filesystem/File.cpp @@ -1,53 +1,53 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "File.h" - -namespace love -{ -namespace filesystem -{ - -File::~File() -{ -} - -bool File::getConstant(const char *in, Mode &out) -{ - return modes.find(in, out); -} - -bool File::getConstant(Mode in, const char *&out) -{ - return modes.find(in, out); -} - -StringMap::Entry File::modeEntries[] = -{ - {"c", File::CLOSED}, - {"r", File::READ}, - {"w", File::WRITE}, - {"a", File::APPEND}, -}; - -StringMap File::modes(File::modeEntries, sizeof(File::modeEntries)); - -} // filesystem -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "File.h" + +namespace love +{ +namespace filesystem +{ + +File::~File() +{ +} + +bool File::getConstant(const char *in, Mode &out) +{ + return modes.find(in, out); +} + +bool File::getConstant(Mode in, const char *&out) +{ + return modes.find(in, out); +} + +StringMap::Entry File::modeEntries[] = +{ + {"c", File::CLOSED}, + {"r", File::READ}, + {"w", File::WRITE}, + {"a", File::APPEND}, +}; + +StringMap File::modes(File::modeEntries, sizeof(File::modeEntries)); + +} // filesystem +} // love diff --git a/src/modules/filesystem/File.h b/src/modules/filesystem/File.h index 40ee78bca..638de6598 100644 --- a/src/modules/filesystem/File.h +++ b/src/modules/filesystem/File.h @@ -1,178 +1,178 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FILESYSTEM_FILE_H -#define LOVE_FILESYSTEM_FILE_H - -// STD -#include - -// LOVE -#include "common/Data.h" -#include "common/Object.h" -#include "common/StringMap.h" -#include "common/int.h" - -namespace love -{ -namespace filesystem -{ - -/** - * A File interface, providing generic means of reading from and - * writing to files. - **/ -class File : public Object -{ -public: - - /** - * File open mode. - **/ - enum Mode - { - CLOSED, - READ, - WRITE, - APPEND, - MODE_MAX_ENUM - }; - - /** - * Used to indicate ALL data in a file. - **/ - static const int64 ALL = -1; - - /** - * Destructor. - **/ - virtual ~File(); - - /** - * Opens the file in a certain mode. - * - * @param mode READ, WRITE, APPEND. - * @return True if successful, false otherwise. - **/ - virtual bool open(Mode mode) = 0; - - /** - * Closes the file. - * - * @return True if successful, false otherwise. - **/ - virtual bool close() = 0; - - /** - * Gets the size of the file. - * - * @return The size of the file. - **/ - virtual int64 getSize() = 0; - - /** - * Reads data from the file and allocates a Data object. - * - * @param size The number of bytes to attempt reading, or -1 for EOF. - * @return A newly allocated Data object. - **/ - virtual Data *read(int64 size = ALL) = 0; - - /** - * Reads data into the destination buffer. - * - * @param dst The destination buffer. - * @param size The number of bytes to attempt reading. - * @return The number of bytes actually read. - **/ - virtual int64 read(void *dst, int64 size) = 0; - - /** - * Writes data into the File. - * - * @param data The source buffer. - * @param size The size of the buffer. - * @return True of success, false otherwise. - **/ - virtual bool write(const void *data, int64 size) = 0; - - /** - * Writes a Data object into the File. - * - * @param data The data object to write into the file. - * @param size The number of bytes to attempt writing, or -1 for everything. - * @return True of success, false otherwise. - **/ - virtual bool write(const Data *data, int64 size = ALL) = 0; - - /** - * Checks whether we are currently at end-of-file. - * - * @return True if EOF, false otherwise. - **/ - virtual bool eof() = 0; - - /** - * Gets the current position in the File. - * - * @return The current byte position in the File. - **/ - virtual int64 tell() = 0; - - /** - * Seeks to a certain position in the File. - * - * @param pos The byte position in the file. - * @return True on success, false otherwise. - **/ - virtual bool seek(uint64 pos) = 0; - - /** - * Gets the current mode of the File. - * @return The current mode of the File; CLOSED, READ, WRITE or APPEND. - **/ - virtual Mode getMode() = 0; - - /** - * Gets the filename for this File, or empty string if none. - * @return The filename for this File. - **/ - virtual std::string getFilename() const = 0; - - /** - * Gets the file extension for this File, or empty string if none. - * @return The file extension for this File (without the dot). - **/ - virtual std::string getExtension() const = 0; - - static bool getConstant(const char *in, Mode &out); - static bool getConstant(Mode in, const char *&out); - -private: - - static StringMap::Entry modeEntries[]; - static StringMap modes; - -}; // File - -} // filesystem -} // love - -#endif // LOVE_FILESYSTEM_FILE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FILESYSTEM_FILE_H +#define LOVE_FILESYSTEM_FILE_H + +// STD +#include + +// LOVE +#include "common/Data.h" +#include "common/Object.h" +#include "common/StringMap.h" +#include "common/int.h" + +namespace love +{ +namespace filesystem +{ + +/** + * A File interface, providing generic means of reading from and + * writing to files. + **/ +class File : public Object +{ +public: + + /** + * File open mode. + **/ + enum Mode + { + CLOSED, + READ, + WRITE, + APPEND, + MODE_MAX_ENUM + }; + + /** + * Used to indicate ALL data in a file. + **/ + static const int64 ALL = -1; + + /** + * Destructor. + **/ + virtual ~File(); + + /** + * Opens the file in a certain mode. + * + * @param mode READ, WRITE, APPEND. + * @return True if successful, false otherwise. + **/ + virtual bool open(Mode mode) = 0; + + /** + * Closes the file. + * + * @return True if successful, false otherwise. + **/ + virtual bool close() = 0; + + /** + * Gets the size of the file. + * + * @return The size of the file. + **/ + virtual int64 getSize() = 0; + + /** + * Reads data from the file and allocates a Data object. + * + * @param size The number of bytes to attempt reading, or -1 for EOF. + * @return A newly allocated Data object. + **/ + virtual Data *read(int64 size = ALL) = 0; + + /** + * Reads data into the destination buffer. + * + * @param dst The destination buffer. + * @param size The number of bytes to attempt reading. + * @return The number of bytes actually read. + **/ + virtual int64 read(void *dst, int64 size) = 0; + + /** + * Writes data into the File. + * + * @param data The source buffer. + * @param size The size of the buffer. + * @return True of success, false otherwise. + **/ + virtual bool write(const void *data, int64 size) = 0; + + /** + * Writes a Data object into the File. + * + * @param data The data object to write into the file. + * @param size The number of bytes to attempt writing, or -1 for everything. + * @return True of success, false otherwise. + **/ + virtual bool write(const Data *data, int64 size = ALL) = 0; + + /** + * Checks whether we are currently at end-of-file. + * + * @return True if EOF, false otherwise. + **/ + virtual bool eof() = 0; + + /** + * Gets the current position in the File. + * + * @return The current byte position in the File. + **/ + virtual int64 tell() = 0; + + /** + * Seeks to a certain position in the File. + * + * @param pos The byte position in the file. + * @return True on success, false otherwise. + **/ + virtual bool seek(uint64 pos) = 0; + + /** + * Gets the current mode of the File. + * @return The current mode of the File; CLOSED, READ, WRITE or APPEND. + **/ + virtual Mode getMode() = 0; + + /** + * Gets the filename for this File, or empty string if none. + * @return The filename for this File. + **/ + virtual std::string getFilename() const = 0; + + /** + * Gets the file extension for this File, or empty string if none. + * @return The file extension for this File (without the dot). + **/ + virtual std::string getExtension() const = 0; + + static bool getConstant(const char *in, Mode &out); + static bool getConstant(Mode in, const char *&out); + +private: + + static StringMap::Entry modeEntries[]; + static StringMap modes; + +}; // File + +} // filesystem +} // love + +#endif // LOVE_FILESYSTEM_FILE_H diff --git a/src/modules/filesystem/FileData.cpp b/src/modules/filesystem/FileData.cpp index 2cf557152..1da6f3f87 100644 --- a/src/modules/filesystem/FileData.cpp +++ b/src/modules/filesystem/FileData.cpp @@ -1,91 +1,91 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "FileData.h" - -// STD -#include -#include - -namespace love -{ -namespace filesystem -{ - -FileData::FileData(uint64 size, const std::string &filename) - : data(new char[(size_t) size]) - , size(size) - , filename(filename) -{ - if (filename.rfind('.') != std::string::npos) - extension = filename.substr(filename.rfind('.')+1); -} - -FileData::~FileData() -{ - delete [] data; -} - -void *FileData::getData() const -{ - return (void *)data; -} - -// TODO: Enable this -/*uint64 FileData::getSize() const -{ - return size; -}*/ - -int FileData::getSize() const -{ - return size > INT_MAX ? INT_MAX : (int) size; -} - -const std::string &FileData::getFilename() const -{ - return filename; -} - -const std::string &FileData::getExtension() const -{ - return extension; -} - -bool FileData::getConstant(const char *in, Decoder &out) -{ - return decoders.find(in, out); -} - -bool FileData::getConstant(Decoder in, const char *&out) -{ - return decoders.find(in, out); -} - -StringMap::Entry FileData::decoderEntries[] = -{ - {"file", FileData::FILE}, - {"base64", FileData::BASE64}, -}; - -StringMap FileData::decoders(FileData::decoderEntries, sizeof(FileData::decoderEntries)); - -} // filesystem -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "FileData.h" + +// STD +#include +#include + +namespace love +{ +namespace filesystem +{ + +FileData::FileData(uint64 size, const std::string &filename) + : data(new char[(size_t) size]) + , size(size) + , filename(filename) +{ + if (filename.rfind('.') != std::string::npos) + extension = filename.substr(filename.rfind('.')+1); +} + +FileData::~FileData() +{ + delete [] data; +} + +void *FileData::getData() const +{ + return (void *)data; +} + +// TODO: Enable this +/*uint64 FileData::getSize() const +{ + return size; +}*/ + +int FileData::getSize() const +{ + return size > INT_MAX ? INT_MAX : (int) size; +} + +const std::string &FileData::getFilename() const +{ + return filename; +} + +const std::string &FileData::getExtension() const +{ + return extension; +} + +bool FileData::getConstant(const char *in, Decoder &out) +{ + return decoders.find(in, out); +} + +bool FileData::getConstant(Decoder in, const char *&out) +{ + return decoders.find(in, out); +} + +StringMap::Entry FileData::decoderEntries[] = +{ + {"file", FileData::FILE}, + {"base64", FileData::BASE64}, +}; + +StringMap FileData::decoders(FileData::decoderEntries, sizeof(FileData::decoderEntries)); + +} // filesystem +} // love diff --git a/src/modules/filesystem/FileData.h b/src/modules/filesystem/FileData.h index d5c008141..77f693d32 100644 --- a/src/modules/filesystem/FileData.h +++ b/src/modules/filesystem/FileData.h @@ -1,84 +1,84 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FILESYSTEM_FILE_DATA_H -#define LOVE_FILESYSTEM_FILE_DATA_H - -// LOVE -#include -#include "common/Data.h" -#include "common/StringMap.h" -#include "common/int.h" - -namespace love -{ -namespace filesystem -{ - -class FileData : public Data -{ -public: - - enum Decoder - { - FILE, - BASE64, - DECODE_MAX_ENUM - }; // Decoder - - FileData(uint64 size, const std::string &filename); - - virtual ~FileData(); - - // Implements Data. - void *getData() const; - //TODO: Enable this - //uint64 getSize() const; - int getSize() const; - - const std::string &getFilename() const; - const std::string &getExtension() const; - - static bool getConstant(const char *in, Decoder &out); - static bool getConstant(Decoder in, const char *&out); - -private: - - // The actual data. - char *data; - - // Size of the data. - uint64 size; - - // The filename used for error purposes. - std::string filename; - - // The extension (without dot). Used to identify file type. - std::string extension; - - static StringMap::Entry decoderEntries[]; - static StringMap decoders; - -}; // FileData - -} // filesystem -} // love - -#endif // LOVE_FILESYSTEM_FILE_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FILESYSTEM_FILE_DATA_H +#define LOVE_FILESYSTEM_FILE_DATA_H + +// LOVE +#include +#include "common/Data.h" +#include "common/StringMap.h" +#include "common/int.h" + +namespace love +{ +namespace filesystem +{ + +class FileData : public Data +{ +public: + + enum Decoder + { + FILE, + BASE64, + DECODE_MAX_ENUM + }; // Decoder + + FileData(uint64 size, const std::string &filename); + + virtual ~FileData(); + + // Implements Data. + void *getData() const; + //TODO: Enable this + //uint64 getSize() const; + int getSize() const; + + const std::string &getFilename() const; + const std::string &getExtension() const; + + static bool getConstant(const char *in, Decoder &out); + static bool getConstant(Decoder in, const char *&out); + +private: + + // The actual data. + char *data; + + // Size of the data. + uint64 size; + + // The filename used for error purposes. + std::string filename; + + // The extension (without dot). Used to identify file type. + std::string extension; + + static StringMap::Entry decoderEntries[]; + static StringMap decoders; + +}; // FileData + +} // filesystem +} // love + +#endif // LOVE_FILESYSTEM_FILE_DATA_H diff --git a/src/modules/filesystem/physfs/File.cpp b/src/modules/filesystem/physfs/File.cpp index 83e2556b2..0ca71bc83 100644 --- a/src/modules/filesystem/physfs/File.cpp +++ b/src/modules/filesystem/physfs/File.cpp @@ -1,243 +1,243 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "File.h" - -// STD -#include - -// LOVE -#include "Filesystem.h" -#include "filesystem/FileData.h" - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -extern bool hack_setupWriteDirectory(); - -File::File(std::string filename) - : filename(filename) - , file(0) - , mode(filesystem::File::CLOSED) -{ -} - -File::~File() -{ - if (mode != CLOSED) - close(); -} - -bool File::open(Mode mode) -{ - if (mode == CLOSED) - return true; - - // File must exist if read mode. - if ((mode == READ) && !PHYSFS_exists(filename.c_str())) - throw love::Exception("Could not open file %s. Does not exist.", filename.c_str()); - - // Check whether the write directory is set. - if ((mode == APPEND || mode == WRITE) && (PHYSFS_getWriteDir() == 0) && !hack_setupWriteDirectory()) - throw love::Exception("Could not set write directory."); - - // File already open? - if (file != 0) - return false; - - this->mode = mode; - - switch (mode) - { - case READ: - file = PHYSFS_openRead(filename.c_str()); - break; - case APPEND: - file = PHYSFS_openAppend(filename.c_str()); - break; - case WRITE: - file = PHYSFS_openWrite(filename.c_str()); - break; - default: - break; - } - - return (file != 0); -} - -bool File::close() -{ - if (!PHYSFS_close(file)) - return false; - mode = CLOSED; - file = 0; - return true; -} - -int64 File::getSize() -{ - // If the file is closed, open it to - // check the size. - if (file == 0) - { - open(READ); - int64 size = (int64)PHYSFS_fileLength(file); - close(); - return size; - } - - return (int64)PHYSFS_fileLength(file); -} - - -Data *File::read(int64 size) -{ - bool isOpen = (file != 0); - - if (!isOpen && !open(READ)) - throw love::Exception("Could not read file %s.", filename.c_str()); - - int64 max = (int64)PHYSFS_fileLength(file); - size = (size == ALL) ? max : size; - size = (size > max) ? max : size; - - FileData *fileData = new FileData(size, getFilename()); - - read(fileData->getData(), size); - - if (!isOpen) - close(); - - return fileData; -} - -int64 File::read(void *dst, int64 size) -{ - bool isOpen = (file != 0); - - if (!isOpen) - open(READ); - - int64 max = (int64)PHYSFS_fileLength(file); - size = (size == ALL) ? max : size; - size = (size > max) ? max : size; - // Sadly, we'll have to clamp to 32 bits here - size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size; - - int64 read = (int64)PHYSFS_read(file, dst, 1, (int) size); - - if (!isOpen) - close(); - - return read; -} - -bool File::write(const void *data, int64 size) -{ - if (file == 0) - throw love::Exception("Could not write to file. File not open."); - - // Another clamp, for the time being. - size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size; - - // Try to write. - int64 written = static_cast(PHYSFS_write(file, data, 1, (int) size)); - - // Check that correct amount of data was written. - if (written != size) - return false; - - return true; -} - -bool File::write(const Data *data, int64 size) -{ - return write(data->getData(), (size == ALL) ? data->getSize() : size); -} - -#ifdef LOVE_WINDOWS -// MSVC doesn't like the 'this' keyword -// well, we'll use 'that'. -// It zigs, we zag. -inline bool test_eof(File *that, PHYSFS_File *) -{ - int64 pos = that->tell(); - int64 size = that->getSize(); - return pos == -1 || size == -1 || pos >= size; -} -#else -inline bool test_eof(File *, PHYSFS_File *file) -{ - return PHYSFS_eof(file); -} -#endif - -bool File::eof() -{ - if (file == 0 || test_eof(this, file)) - return true; - return false; -} - -int64 File::tell() -{ - if (file == 0) - return -1; - - return (int64)PHYSFS_tell(file); -} - -bool File::seek(uint64 pos) -{ - if (file == 0) - return false; - - if (!PHYSFS_seek(file, (PHYSFS_uint64)pos)) - return false; - return true; -} - -std::string File::getFilename() const -{ - return filename; -} - -std::string File::getExtension() const -{ - std::string::size_type idx = filename.rfind('.'); - - if (idx != std::string::npos) - return filename.substr(idx+1); - else - return std::string(); -} - -filesystem::File::Mode File::getMode() -{ - return mode; -} - -} // physfs -} // filesystem -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "File.h" + +// STD +#include + +// LOVE +#include "Filesystem.h" +#include "filesystem/FileData.h" + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +extern bool hack_setupWriteDirectory(); + +File::File(std::string filename) + : filename(filename) + , file(0) + , mode(filesystem::File::CLOSED) +{ +} + +File::~File() +{ + if (mode != CLOSED) + close(); +} + +bool File::open(Mode mode) +{ + if (mode == CLOSED) + return true; + + // File must exist if read mode. + if ((mode == READ) && !PHYSFS_exists(filename.c_str())) + throw love::Exception("Could not open file %s. Does not exist.", filename.c_str()); + + // Check whether the write directory is set. + if ((mode == APPEND || mode == WRITE) && (PHYSFS_getWriteDir() == 0) && !hack_setupWriteDirectory()) + throw love::Exception("Could not set write directory."); + + // File already open? + if (file != 0) + return false; + + this->mode = mode; + + switch (mode) + { + case READ: + file = PHYSFS_openRead(filename.c_str()); + break; + case APPEND: + file = PHYSFS_openAppend(filename.c_str()); + break; + case WRITE: + file = PHYSFS_openWrite(filename.c_str()); + break; + default: + break; + } + + return (file != 0); +} + +bool File::close() +{ + if (!PHYSFS_close(file)) + return false; + mode = CLOSED; + file = 0; + return true; +} + +int64 File::getSize() +{ + // If the file is closed, open it to + // check the size. + if (file == 0) + { + open(READ); + int64 size = (int64)PHYSFS_fileLength(file); + close(); + return size; + } + + return (int64)PHYSFS_fileLength(file); +} + + +Data *File::read(int64 size) +{ + bool isOpen = (file != 0); + + if (!isOpen && !open(READ)) + throw love::Exception("Could not read file %s.", filename.c_str()); + + int64 max = (int64)PHYSFS_fileLength(file); + size = (size == ALL) ? max : size; + size = (size > max) ? max : size; + + FileData *fileData = new FileData(size, getFilename()); + + read(fileData->getData(), size); + + if (!isOpen) + close(); + + return fileData; +} + +int64 File::read(void *dst, int64 size) +{ + bool isOpen = (file != 0); + + if (!isOpen) + open(READ); + + int64 max = (int64)PHYSFS_fileLength(file); + size = (size == ALL) ? max : size; + size = (size > max) ? max : size; + // Sadly, we'll have to clamp to 32 bits here + size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size; + + int64 read = (int64)PHYSFS_read(file, dst, 1, (int) size); + + if (!isOpen) + close(); + + return read; +} + +bool File::write(const void *data, int64 size) +{ + if (file == 0) + throw love::Exception("Could not write to file. File not open."); + + // Another clamp, for the time being. + size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size; + + // Try to write. + int64 written = static_cast(PHYSFS_write(file, data, 1, (int) size)); + + // Check that correct amount of data was written. + if (written != size) + return false; + + return true; +} + +bool File::write(const Data *data, int64 size) +{ + return write(data->getData(), (size == ALL) ? data->getSize() : size); +} + +#ifdef LOVE_WINDOWS +// MSVC doesn't like the 'this' keyword +// well, we'll use 'that'. +// It zigs, we zag. +inline bool test_eof(File *that, PHYSFS_File *) +{ + int64 pos = that->tell(); + int64 size = that->getSize(); + return pos == -1 || size == -1 || pos >= size; +} +#else +inline bool test_eof(File *, PHYSFS_File *file) +{ + return PHYSFS_eof(file); +} +#endif + +bool File::eof() +{ + if (file == 0 || test_eof(this, file)) + return true; + return false; +} + +int64 File::tell() +{ + if (file == 0) + return -1; + + return (int64)PHYSFS_tell(file); +} + +bool File::seek(uint64 pos) +{ + if (file == 0) + return false; + + if (!PHYSFS_seek(file, (PHYSFS_uint64)pos)) + return false; + return true; +} + +std::string File::getFilename() const +{ + return filename; +} + +std::string File::getExtension() const +{ + std::string::size_type idx = filename.rfind('.'); + + if (idx != std::string::npos) + return filename.substr(idx+1); + else + return std::string(); +} + +filesystem::File::Mode File::getMode() +{ + return mode; +} + +} // physfs +} // filesystem +} // love diff --git a/src/modules/filesystem/physfs/File.h b/src/modules/filesystem/physfs/File.h index 4883b500c..856a31879 100644 --- a/src/modules/filesystem/physfs/File.h +++ b/src/modules/filesystem/physfs/File.h @@ -1,89 +1,89 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FILESYSTEM_PHYSFS_FILE_H -#define LOVE_FILESYSTEM_PHYSFS_FILE_H - -// LOVE -#include "filesystem/File.h" - -// PhysFS -#ifdef LOVE_MACOSX // wacky Mac behavior means different #include syntax! -#include -#else -#include -#endif - -// STD -#include - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -class File : public love::filesystem::File -{ -private: - - // filename - std::string filename; - - // PHYSFS File handle. - PHYSFS_file *file; - - // The current mode of the file. - Mode mode; - -public: - - /** - * Constructs an File with the given source and filename. - * @param source The source from which to load the file. (Archive or directory) - * @param filename The relative filepath of the file to load from the source. - **/ - File(std::string filename); - - virtual ~File(); - - // Implements love::filesystem::File. - bool open(Mode mode); - bool close(); - int64 getSize(); - Data *read(int64 size = ALL); - int64 read(void *dst, int64 size); - bool write(const void *data, int64 size); - bool write(const Data *data, int64 size = ALL); - bool eof(); - int64 tell(); - bool seek(uint64 pos); - Mode getMode(); - std::string getFilename() const; - std::string getExtension() const; - -}; // File - -} // physfs -} // filesystem -} // love - -#endif // LOVE_FILESYSTEM_PHYSFS_FILE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FILESYSTEM_PHYSFS_FILE_H +#define LOVE_FILESYSTEM_PHYSFS_FILE_H + +// LOVE +#include "filesystem/File.h" + +// PhysFS +#ifdef LOVE_MACOSX // wacky Mac behavior means different #include syntax! +#include +#else +#include +#endif + +// STD +#include + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +class File : public love::filesystem::File +{ +private: + + // filename + std::string filename; + + // PHYSFS File handle. + PHYSFS_file *file; + + // The current mode of the file. + Mode mode; + +public: + + /** + * Constructs an File with the given source and filename. + * @param source The source from which to load the file. (Archive or directory) + * @param filename The relative filepath of the file to load from the source. + **/ + File(std::string filename); + + virtual ~File(); + + // Implements love::filesystem::File. + bool open(Mode mode); + bool close(); + int64 getSize(); + Data *read(int64 size = ALL); + int64 read(void *dst, int64 size); + bool write(const void *data, int64 size); + bool write(const Data *data, int64 size = ALL); + bool eof(); + int64 tell(); + bool seek(uint64 pos); + Mode getMode(); + std::string getFilename() const; + std::string getExtension() const; + +}; // File + +} // physfs +} // filesystem +} // love + +#endif // LOVE_FILESYSTEM_PHYSFS_FILE_H diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 3a23b9f0f..7f1efae06 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -1,610 +1,610 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -#include - -#include "common/utf8.h" -#include "common/b64.h" - -#include "Filesystem.h" - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -Filesystem::Filesystem() - : open_count(0) - , buffer(0) - , isInited(false) - , release(false) - , releaseSet(false) -{ -} - -Filesystem::~Filesystem() -{ - if (isInited) - { - isInited = false; - PHYSFS_deinit(); - } -} - -const char *Filesystem::getName() const -{ - return "love.filesystem.physfs"; -} - -void Filesystem::init(const char *arg0) -{ - if (!PHYSFS_init(arg0)) - throw Exception(PHYSFS_getLastError()); - isInited = true; -} - -void Filesystem::setRelease(bool release) -{ - if (releaseSet) - return; - this->release = release; - releaseSet = true; -} - -bool Filesystem::isRelease() const -{ - if (!releaseSet) - return false; - return release; -} - -bool Filesystem::setIdentity(const char *ident) -{ - if (!isInited) - return false; - - // Store the save directory. - save_identity = std::string(ident); - - // Generate the relative path to the game save folder. - save_path_relative = std::string(LOVE_APPDATA_PREFIX LOVE_APPDATA_FOLDER LOVE_PATH_SEPARATOR) + save_identity; - - // Generate the full path to the game save folder. - save_path_full = std::string(getAppdataDirectory()) + std::string(LOVE_PATH_SEPARATOR); - if (release) - save_path_full += std::string(LOVE_APPDATA_PREFIX) + save_identity; - else - save_path_full += save_path_relative; - - // We now have something like: - // save_identity: game - // save_path_relative: ./LOVE/game - // save_path_full: C:\Documents and Settings\user\Application Data/LOVE/game - - // Try to add the save directory to the search path. - // (No error on fail, it means that the path doesn't exist). - PHYSFS_addToSearchPath(save_path_full.c_str(), 0); - - return true; -} - -const char *Filesystem::getIdentity() const -{ - return save_identity.c_str(); -} - -bool Filesystem::setSource(const char *source) -{ - if (!isInited) - return false; - - // Check whether directory is already set. - if (!game_source.empty()) - return false; - - // Add the directory. - if (!PHYSFS_addToSearchPath(source, 1)) - return false; - - // Save the game source. - game_source = std::string(source); - - return true; -} - -bool Filesystem::setupWriteDirectory() -{ - if (!isInited) - return false; - - // These must all be set. - if (save_identity.empty() || save_path_full.empty() || save_path_relative.empty()) - return false; - - // Set the appdata folder as writable directory. - // (We must create the save folder before mounting it). - if (!PHYSFS_setWriteDir(getAppdataDirectory())) - return false; - - // Create the save folder. (We're now "at" %APPDATA%). - bool success = false; - if (release) - success = mkdir(save_identity.c_str()); - else - success = mkdir(save_path_relative.c_str()); - - if (!success) - { - PHYSFS_setWriteDir(0); // Clear the write directory in case of error. - return false; - } - - // Set the final write directory. - if (!PHYSFS_setWriteDir(save_path_full.c_str())) - return false; - - // Add the directory. (Will not be readded if already present). - if (!PHYSFS_addToSearchPath(save_path_full.c_str(), 0)) - { - PHYSFS_setWriteDir(0); // Clear the write directory in case of error. - return false; - } - - return true; -} - -File *Filesystem::newFile(const char *filename) -{ - return new File(filename); -} - -FileData *Filesystem::newFileData(void *data, unsigned int size, const char *filename) -{ - FileData *fd = new FileData(size, std::string(filename)); - - // Copy the data into FileData. - memcpy(fd->getData(), data, size); - - return fd; -} - -FileData *Filesystem::newFileData(const char *b64, const char *filename) -{ - int size = strlen(b64); - int outsize = 0; - char *dst = b64_decode(b64, size, outsize); - FileData *fd = new FileData(outsize, std::string(filename)); - - // Copy the data into FileData. - memcpy(fd->getData(), dst, outsize); - delete [] dst; - - return fd; -} - -const char *Filesystem::getWorkingDirectory() -{ - if (cwd.empty()) - { -#ifdef LOVE_WINDOWS - - WCHAR w_cwd[LOVE_MAX_PATH]; - _wgetcwd(w_cwd, LOVE_MAX_PATH); - cwd = to_utf8(w_cwd); - replace_char(cwd, '\\', '/'); -#else - char *cwd_char = new char[LOVE_MAX_PATH]; - - if (getcwd(cwd_char, LOVE_MAX_PATH)) - cwd = cwd_char; // if getcwd fails, cwd_char (and thus cwd) will still be empty - - delete [] cwd_char; -#endif - } - - return cwd.c_str(); -} - -const char *Filesystem::getUserDirectory() -{ - return PHYSFS_getUserDir(); -} - -const char *Filesystem::getAppdataDirectory() -{ -#ifdef LOVE_WINDOWS - if (appdata.empty()) - { - wchar_t *w_appdata = _wgetenv(TEXT("APPDATA")); - appdata = to_utf8(w_appdata); - replace_char(appdata, '\\', '/'); - } - return appdata.c_str(); -#elif defined(LOVE_MACOSX) - if (appdata.empty()) - { - std::string udir = getUserDirectory(); - udir.append("/Library/Application Support"); - appdata = udir; - } - return appdata.c_str(); -#elif defined(LOVE_LINUX) - if (appdata.empty()) - { - char *xdgdatahome = getenv("XDG_DATA_HOME"); - if (!xdgdatahome) - appdata = std::string(getUserDirectory()) + "/.local/share/"; - else - appdata = xdgdatahome; - } - return appdata.c_str(); -#else - return getUserDirectory(); -#endif -} - - -const char *Filesystem::getSaveDirectory() -{ - return save_path_full.c_str(); -} - -bool Filesystem::exists(const char *file) -{ - if (PHYSFS_exists(file)) - return true; - return false; -} - -bool Filesystem::isDirectory(const char *file) -{ - if (PHYSFS_isDirectory(file)) - return true; - return false; -} - -bool Filesystem::isFile(const char *file) -{ - return exists(file) && !isDirectory(file); -} - -bool Filesystem::mkdir(const char *file) -{ - if (PHYSFS_getWriteDir() == 0 && !setupWriteDirectory()) - return false; - - if (!PHYSFS_mkdir(file)) - return false; - return true; -} - -bool Filesystem::remove(const char *file) -{ - if (PHYSFS_getWriteDir() == 0 && !setupWriteDirectory()) - return false; - - if (!PHYSFS_delete(file)) - return false; - return true; -} - -int Filesystem::read(lua_State *L) -{ - // The file to read from. The file must either be created - // on-the-fly, or passed as a parameter. - File *file; - - if (lua_isstring(L, 1)) - { - // Create the file. - file = newFile(lua_tostring(L, 1)); - } - else - return luaL_error(L, "Expected filename."); - - // Optionally, the caller can specify whether to read - // the whole file, or just a part of it. - int count = luaL_optint(L, 2, (lua_Integer)file->getSize()); // FIXME - - // Read the data. - Data *data = file->read(count); - - // Error check. - if (data == 0) - return luaL_error(L, "File could not be read."); - - // Close and delete the file, if we created it. - // (I.e. if the first parameter is a string). - if (lua_isstring(L, 1)) - file->release(); - - // Push the string. - lua_pushlstring(L, (char *)data->getData(), data->getSize()); - - // Push the size. - lua_pushinteger(L, data->getSize()); - - // Lua has a copy now, so we can free it. - data->release(); - - return 2; -} - -int Filesystem::write(lua_State *L) -{ - // The file to write to. The file must either be created - // on-the-fly, or passed as a parameter. - File *file; - - // We know for sure that we need a second parameter, so - // let's check that first. - if (lua_isnoneornil(L, 2)) - return luaL_error(L, "Second argument needed."); - - if (lua_isstring(L, 1)) - { - // Create the file. - file = newFile(lua_tostring(L, 1)); - } - else - return luaL_error(L, "Expected filename."); - - // Get the current mode of the file. - File::Mode mode = file->getMode(); - - if (mode == File::CLOSED) - { - // It should be possible to use append mode, but - // normal File::Mode::Write is the default. - int mode = luaL_optint(L, 4, File::WRITE); - - // Open the file. - if (!file->open((File::Mode)mode)) - return luaL_error(L, "Could not open file."); - } - - size_t length = 0; - const char *input; - if (lua_isstring(L, 2)) - { - input = lua_tolstring(L, 2, &length); - } - else if (luax_istype(L, 2, DATA_T)) - { - love::Data *data = luax_totype(L, 2, "Data", DATA_T); - length = data->getSize(); - input = (char *)data->getData(); - } - else - { - return luaL_error(L, "Expected string or data for argument #2."); - } - - // Get how much we should write. Length of string default. - length = luaL_optint(L, 3, length); - - // Write the data. - bool success = file->write(input, length); - - // Close and delete the file, if we created - // it in this function. - if (lua_isstring(L, 1)) - { - // Kill the file if "we" created it. - file->close(); - file->release(); - } - - if (!success) - return luaL_error(L, "Data could not be written."); - - lua_pushboolean(L, success); - return 1; -} - -int Filesystem::enumerate(lua_State *L) -{ - int n = lua_gettop(L); - - if (n != 1) - return luaL_error(L, "Function requires a single parameter."); - - int type = lua_type(L, 1); - - if (type != LUA_TSTRING) - return luaL_error(L, "Function requires parameter of type string."); - - const char *dir = lua_tostring(L, 1); - char **rc = PHYSFS_enumerateFiles(dir); - char **i; - int index = 1; - - lua_newtable(L); - - for (i = rc; *i != 0; i++) - { - lua_pushinteger(L, index); - lua_pushstring(L, *i); - lua_settable(L, -3); - index++; - } - - PHYSFS_freeList(rc); - - return 1; -} - -int Filesystem::lines_i(lua_State *L) -{ - const int bufsize = 1024; - char buf[bufsize]; - int linesize = 0; - bool newline = false; - - File *file = luax_checktype(L, lua_upvalueindex(1), "File", FILESYSTEM_FILE_T); - - // Only accept read mode at this point. - if (file->getMode() != File::READ) - return luaL_error(L, "File needs to stay in read mode."); - - int64 pos = file->tell(); - int64 userpos = -1; - - if (lua_isnoneornil(L, lua_upvalueindex(2)) == 0) - { - // User may have changed the file position. - userpos = pos; - pos = (int64) lua_tonumber(L, lua_upvalueindex(2)); - if (userpos != pos) - file->seek(pos); - } - - while (!newline && !file->eof()) - { - // This 64-bit to 32-bit integer cast should be safe as it never exceeds bufsize. - int read = (int) file->read(buf, bufsize); - if (read < 0) - return luaL_error(L, "Could not read from file."); - - linesize += read; - - for (int i = 0; i < read; i++) - { - if (buf[i] == '\n') - { - linesize -= read - i; - newline = true; - break; - } - } - } - - if (newline || (file->eof() && linesize > 0)) - { - if (linesize < bufsize) - { - // We have the line in the buffer on the stack. No 'new' and 'read' needed. - lua_pushlstring(L, buf, linesize > 0 && buf[linesize - 1] == '\r' ? linesize - 1 : linesize); - if (userpos < 0) - file->seek(pos + linesize + 1); - } - else - { - char *str; - try - { - str = new char[linesize + 1]; - } - catch(std::bad_alloc &) - { - return luaL_error(L, "Out of memory"); - } - file->seek(pos); - - // Read the \n anyway and save us a call to seek. - if (file->read(str, linesize + 1) == -1) - { - delete [] str; - return luaL_error(L, "Could not read from file."); - } - - lua_pushlstring(L, str, str[linesize - 1] == '\r' ? linesize - 1 : linesize); - delete [] str; - } - - if (userpos >= 0) - { - // Save new position in upvalue. - lua_pushnumber(L, (lua_Number)(pos + linesize + 1)); - lua_replace(L, lua_upvalueindex(2)); - file->seek(userpos); - } - - return 1; - } - - // EOF reached. - if (userpos >= 0 && luax_toboolean(L, lua_upvalueindex(3))) - file->seek(userpos); - else - file->close(); - - return 0; -} - -int Filesystem::load(lua_State *L) -{ - // Need only one arg. - luax_assert_argc(L, 1, 1); - - // Must be string. - if (!lua_isstring(L, -1)) - return luaL_error(L, "The argument must be a string."); - - std::string filename = lua_tostring(L, -1); - - // The file must exist. - if (!exists(filename.c_str())) - return luaL_error(L, "File %s does not exist.", filename.c_str()); - - // Create the file. - File *file = newFile(filename.c_str()); - - // Get the data from the file. - Data *data = file->read(); - - int status = luaL_loadbuffer(L, (const char *)data->getData(), data->getSize(), ("@" + filename).c_str()); - - data->release(); - file->release(); - - // Load the chunk, but don't run it. - switch (status) - { - case LUA_ERRMEM: - return luaL_error(L, "Memory allocation error: %s\n", lua_tostring(L, -1)); - case LUA_ERRSYNTAX: - return luaL_error(L, "Syntax error: %s\n", lua_tostring(L, -1)); - default: // success - return 1; - } -} - -int Filesystem::getLastModified(lua_State *L) -{ - const char *filename = luaL_checkstring(L, 1); - PHYSFS_sint64 time = PHYSFS_getLastModTime(filename); - if (time == -1) - { - lua_pushnil(L); - lua_pushstring(L, "Could not determine file modification date."); - return 2; - } - lua_pushnumber(L, static_cast(time)); - return 1; -} - -} // physfs -} // filesystem -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +#include + +#include "common/utf8.h" +#include "common/b64.h" + +#include "Filesystem.h" + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +Filesystem::Filesystem() + : open_count(0) + , buffer(0) + , isInited(false) + , release(false) + , releaseSet(false) +{ +} + +Filesystem::~Filesystem() +{ + if (isInited) + { + isInited = false; + PHYSFS_deinit(); + } +} + +const char *Filesystem::getName() const +{ + return "love.filesystem.physfs"; +} + +void Filesystem::init(const char *arg0) +{ + if (!PHYSFS_init(arg0)) + throw Exception(PHYSFS_getLastError()); + isInited = true; +} + +void Filesystem::setRelease(bool release) +{ + if (releaseSet) + return; + this->release = release; + releaseSet = true; +} + +bool Filesystem::isRelease() const +{ + if (!releaseSet) + return false; + return release; +} + +bool Filesystem::setIdentity(const char *ident) +{ + if (!isInited) + return false; + + // Store the save directory. + save_identity = std::string(ident); + + // Generate the relative path to the game save folder. + save_path_relative = std::string(LOVE_APPDATA_PREFIX LOVE_APPDATA_FOLDER LOVE_PATH_SEPARATOR) + save_identity; + + // Generate the full path to the game save folder. + save_path_full = std::string(getAppdataDirectory()) + std::string(LOVE_PATH_SEPARATOR); + if (release) + save_path_full += std::string(LOVE_APPDATA_PREFIX) + save_identity; + else + save_path_full += save_path_relative; + + // We now have something like: + // save_identity: game + // save_path_relative: ./LOVE/game + // save_path_full: C:\Documents and Settings\user\Application Data/LOVE/game + + // Try to add the save directory to the search path. + // (No error on fail, it means that the path doesn't exist). + PHYSFS_addToSearchPath(save_path_full.c_str(), 0); + + return true; +} + +const char *Filesystem::getIdentity() const +{ + return save_identity.c_str(); +} + +bool Filesystem::setSource(const char *source) +{ + if (!isInited) + return false; + + // Check whether directory is already set. + if (!game_source.empty()) + return false; + + // Add the directory. + if (!PHYSFS_addToSearchPath(source, 1)) + return false; + + // Save the game source. + game_source = std::string(source); + + return true; +} + +bool Filesystem::setupWriteDirectory() +{ + if (!isInited) + return false; + + // These must all be set. + if (save_identity.empty() || save_path_full.empty() || save_path_relative.empty()) + return false; + + // Set the appdata folder as writable directory. + // (We must create the save folder before mounting it). + if (!PHYSFS_setWriteDir(getAppdataDirectory())) + return false; + + // Create the save folder. (We're now "at" %APPDATA%). + bool success = false; + if (release) + success = mkdir(save_identity.c_str()); + else + success = mkdir(save_path_relative.c_str()); + + if (!success) + { + PHYSFS_setWriteDir(0); // Clear the write directory in case of error. + return false; + } + + // Set the final write directory. + if (!PHYSFS_setWriteDir(save_path_full.c_str())) + return false; + + // Add the directory. (Will not be readded if already present). + if (!PHYSFS_addToSearchPath(save_path_full.c_str(), 0)) + { + PHYSFS_setWriteDir(0); // Clear the write directory in case of error. + return false; + } + + return true; +} + +File *Filesystem::newFile(const char *filename) +{ + return new File(filename); +} + +FileData *Filesystem::newFileData(void *data, unsigned int size, const char *filename) +{ + FileData *fd = new FileData(size, std::string(filename)); + + // Copy the data into FileData. + memcpy(fd->getData(), data, size); + + return fd; +} + +FileData *Filesystem::newFileData(const char *b64, const char *filename) +{ + int size = strlen(b64); + int outsize = 0; + char *dst = b64_decode(b64, size, outsize); + FileData *fd = new FileData(outsize, std::string(filename)); + + // Copy the data into FileData. + memcpy(fd->getData(), dst, outsize); + delete [] dst; + + return fd; +} + +const char *Filesystem::getWorkingDirectory() +{ + if (cwd.empty()) + { +#ifdef LOVE_WINDOWS + + WCHAR w_cwd[LOVE_MAX_PATH]; + _wgetcwd(w_cwd, LOVE_MAX_PATH); + cwd = to_utf8(w_cwd); + replace_char(cwd, '\\', '/'); +#else + char *cwd_char = new char[LOVE_MAX_PATH]; + + if (getcwd(cwd_char, LOVE_MAX_PATH)) + cwd = cwd_char; // if getcwd fails, cwd_char (and thus cwd) will still be empty + + delete [] cwd_char; +#endif + } + + return cwd.c_str(); +} + +const char *Filesystem::getUserDirectory() +{ + return PHYSFS_getUserDir(); +} + +const char *Filesystem::getAppdataDirectory() +{ +#ifdef LOVE_WINDOWS + if (appdata.empty()) + { + wchar_t *w_appdata = _wgetenv(TEXT("APPDATA")); + appdata = to_utf8(w_appdata); + replace_char(appdata, '\\', '/'); + } + return appdata.c_str(); +#elif defined(LOVE_MACOSX) + if (appdata.empty()) + { + std::string udir = getUserDirectory(); + udir.append("/Library/Application Support"); + appdata = udir; + } + return appdata.c_str(); +#elif defined(LOVE_LINUX) + if (appdata.empty()) + { + char *xdgdatahome = getenv("XDG_DATA_HOME"); + if (!xdgdatahome) + appdata = std::string(getUserDirectory()) + "/.local/share/"; + else + appdata = xdgdatahome; + } + return appdata.c_str(); +#else + return getUserDirectory(); +#endif +} + + +const char *Filesystem::getSaveDirectory() +{ + return save_path_full.c_str(); +} + +bool Filesystem::exists(const char *file) +{ + if (PHYSFS_exists(file)) + return true; + return false; +} + +bool Filesystem::isDirectory(const char *file) +{ + if (PHYSFS_isDirectory(file)) + return true; + return false; +} + +bool Filesystem::isFile(const char *file) +{ + return exists(file) && !isDirectory(file); +} + +bool Filesystem::mkdir(const char *file) +{ + if (PHYSFS_getWriteDir() == 0 && !setupWriteDirectory()) + return false; + + if (!PHYSFS_mkdir(file)) + return false; + return true; +} + +bool Filesystem::remove(const char *file) +{ + if (PHYSFS_getWriteDir() == 0 && !setupWriteDirectory()) + return false; + + if (!PHYSFS_delete(file)) + return false; + return true; +} + +int Filesystem::read(lua_State *L) +{ + // The file to read from. The file must either be created + // on-the-fly, or passed as a parameter. + File *file; + + if (lua_isstring(L, 1)) + { + // Create the file. + file = newFile(lua_tostring(L, 1)); + } + else + return luaL_error(L, "Expected filename."); + + // Optionally, the caller can specify whether to read + // the whole file, or just a part of it. + int count = luaL_optint(L, 2, (lua_Integer)file->getSize()); // FIXME + + // Read the data. + Data *data = file->read(count); + + // Error check. + if (data == 0) + return luaL_error(L, "File could not be read."); + + // Close and delete the file, if we created it. + // (I.e. if the first parameter is a string). + if (lua_isstring(L, 1)) + file->release(); + + // Push the string. + lua_pushlstring(L, (char *)data->getData(), data->getSize()); + + // Push the size. + lua_pushinteger(L, data->getSize()); + + // Lua has a copy now, so we can free it. + data->release(); + + return 2; +} + +int Filesystem::write(lua_State *L) +{ + // The file to write to. The file must either be created + // on-the-fly, or passed as a parameter. + File *file; + + // We know for sure that we need a second parameter, so + // let's check that first. + if (lua_isnoneornil(L, 2)) + return luaL_error(L, "Second argument needed."); + + if (lua_isstring(L, 1)) + { + // Create the file. + file = newFile(lua_tostring(L, 1)); + } + else + return luaL_error(L, "Expected filename."); + + // Get the current mode of the file. + File::Mode mode = file->getMode(); + + if (mode == File::CLOSED) + { + // It should be possible to use append mode, but + // normal File::Mode::Write is the default. + int mode = luaL_optint(L, 4, File::WRITE); + + // Open the file. + if (!file->open((File::Mode)mode)) + return luaL_error(L, "Could not open file."); + } + + size_t length = 0; + const char *input; + if (lua_isstring(L, 2)) + { + input = lua_tolstring(L, 2, &length); + } + else if (luax_istype(L, 2, DATA_T)) + { + love::Data *data = luax_totype(L, 2, "Data", DATA_T); + length = data->getSize(); + input = (char *)data->getData(); + } + else + { + return luaL_error(L, "Expected string or data for argument #2."); + } + + // Get how much we should write. Length of string default. + length = luaL_optint(L, 3, length); + + // Write the data. + bool success = file->write(input, length); + + // Close and delete the file, if we created + // it in this function. + if (lua_isstring(L, 1)) + { + // Kill the file if "we" created it. + file->close(); + file->release(); + } + + if (!success) + return luaL_error(L, "Data could not be written."); + + lua_pushboolean(L, success); + return 1; +} + +int Filesystem::enumerate(lua_State *L) +{ + int n = lua_gettop(L); + + if (n != 1) + return luaL_error(L, "Function requires a single parameter."); + + int type = lua_type(L, 1); + + if (type != LUA_TSTRING) + return luaL_error(L, "Function requires parameter of type string."); + + const char *dir = lua_tostring(L, 1); + char **rc = PHYSFS_enumerateFiles(dir); + char **i; + int index = 1; + + lua_newtable(L); + + for (i = rc; *i != 0; i++) + { + lua_pushinteger(L, index); + lua_pushstring(L, *i); + lua_settable(L, -3); + index++; + } + + PHYSFS_freeList(rc); + + return 1; +} + +int Filesystem::lines_i(lua_State *L) +{ + const int bufsize = 1024; + char buf[bufsize]; + int linesize = 0; + bool newline = false; + + File *file = luax_checktype(L, lua_upvalueindex(1), "File", FILESYSTEM_FILE_T); + + // Only accept read mode at this point. + if (file->getMode() != File::READ) + return luaL_error(L, "File needs to stay in read mode."); + + int64 pos = file->tell(); + int64 userpos = -1; + + if (lua_isnoneornil(L, lua_upvalueindex(2)) == 0) + { + // User may have changed the file position. + userpos = pos; + pos = (int64) lua_tonumber(L, lua_upvalueindex(2)); + if (userpos != pos) + file->seek(pos); + } + + while (!newline && !file->eof()) + { + // This 64-bit to 32-bit integer cast should be safe as it never exceeds bufsize. + int read = (int) file->read(buf, bufsize); + if (read < 0) + return luaL_error(L, "Could not read from file."); + + linesize += read; + + for (int i = 0; i < read; i++) + { + if (buf[i] == '\n') + { + linesize -= read - i; + newline = true; + break; + } + } + } + + if (newline || (file->eof() && linesize > 0)) + { + if (linesize < bufsize) + { + // We have the line in the buffer on the stack. No 'new' and 'read' needed. + lua_pushlstring(L, buf, linesize > 0 && buf[linesize - 1] == '\r' ? linesize - 1 : linesize); + if (userpos < 0) + file->seek(pos + linesize + 1); + } + else + { + char *str; + try + { + str = new char[linesize + 1]; + } + catch(std::bad_alloc &) + { + return luaL_error(L, "Out of memory"); + } + file->seek(pos); + + // Read the \n anyway and save us a call to seek. + if (file->read(str, linesize + 1) == -1) + { + delete [] str; + return luaL_error(L, "Could not read from file."); + } + + lua_pushlstring(L, str, str[linesize - 1] == '\r' ? linesize - 1 : linesize); + delete [] str; + } + + if (userpos >= 0) + { + // Save new position in upvalue. + lua_pushnumber(L, (lua_Number)(pos + linesize + 1)); + lua_replace(L, lua_upvalueindex(2)); + file->seek(userpos); + } + + return 1; + } + + // EOF reached. + if (userpos >= 0 && luax_toboolean(L, lua_upvalueindex(3))) + file->seek(userpos); + else + file->close(); + + return 0; +} + +int Filesystem::load(lua_State *L) +{ + // Need only one arg. + luax_assert_argc(L, 1, 1); + + // Must be string. + if (!lua_isstring(L, -1)) + return luaL_error(L, "The argument must be a string."); + + std::string filename = lua_tostring(L, -1); + + // The file must exist. + if (!exists(filename.c_str())) + return luaL_error(L, "File %s does not exist.", filename.c_str()); + + // Create the file. + File *file = newFile(filename.c_str()); + + // Get the data from the file. + Data *data = file->read(); + + int status = luaL_loadbuffer(L, (const char *)data->getData(), data->getSize(), ("@" + filename).c_str()); + + data->release(); + file->release(); + + // Load the chunk, but don't run it. + switch (status) + { + case LUA_ERRMEM: + return luaL_error(L, "Memory allocation error: %s\n", lua_tostring(L, -1)); + case LUA_ERRSYNTAX: + return luaL_error(L, "Syntax error: %s\n", lua_tostring(L, -1)); + default: // success + return 1; + } +} + +int Filesystem::getLastModified(lua_State *L) +{ + const char *filename = luaL_checkstring(L, 1); + PHYSFS_sint64 time = PHYSFS_getLastModTime(filename); + if (time == -1) + { + lua_pushnil(L); + lua_pushstring(L, "Could not determine file modification date."); + return 2; + } + lua_pushnumber(L, static_cast(time)); + return 1; +} + +} // physfs +} // filesystem +} // love diff --git a/src/modules/filesystem/physfs/Filesystem.h b/src/modules/filesystem/physfs/Filesystem.h index 399376267..27a891f55 100644 --- a/src/modules/filesystem/physfs/Filesystem.h +++ b/src/modules/filesystem/physfs/Filesystem.h @@ -1,297 +1,297 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H -#define LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H - -// STD -#include -#include -#include -#include - -// LOVE -#include "common/Module.h" -#include "common/config.h" -#include "common/int.h" -#include "filesystem/FileData.h" -#include "File.h" - -// For great CWD. (Current Working Directory) -// Using this instead of boost::filesystem which totally -// cramped our style. -#ifdef LOVE_WINDOWS -# include -# include -#else -# include -# include -#endif - -// In Windows, we would like to use "LOVE" as the -// application folder, but in Linux, we like .love. -#define LOVE_APPDATA_PREFIX "" -#ifdef LOVE_WINDOWS -# define LOVE_APPDATA_FOLDER "LOVE" -# define LOVE_PATH_SEPARATOR "/" -# define LOVE_MAX_PATH _MAX_PATH -#else -# ifdef LOVE_MACOSX -# define LOVE_APPDATA_FOLDER "LOVE" -# elif defined(LOVE_LINUX) -# define LOVE_APPDATA_FOLDER "love" -# else -# define LOVE_APPDATA_PREFIX "." -# define LOVE_APPDATA_FOLDER "love" -# endif -# define LOVE_PATH_SEPARATOR "/" -# define LOVE_MAX_PATH MAXPATHLEN -#endif - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ -class Filesystem : public Module -{ -private: - - // Counts open files. - int open_count; - - // Pointer used for file reads. - char *buffer; - - // Contains the current working directory (UTF8). - std::string cwd; - - // %APPDATA% on Windows. - std::string appdata; - - // This name will be used to create the folder - // in the appdata/userdata folder. - std::string save_identity; - - // Full and relative paths of the game save folder. - // (Relative to the %APPDATA% folder, meaning that the - // relative string will look something like: ./LOVE/game) - std::string save_path_relative, save_path_full; - - // The full path to the source of the game. - std::string game_source; - - // Workaround for machines without PhysFS 2.0 - bool isInited; - - // Allow saving outside of the LOVE_APPDATA_FOLDER - // for release 'builds' - bool release; - bool releaseSet; - -protected: - -public: - - Filesystem(); - - ~Filesystem(); - - const char *getName() const; - - void init(const char *arg0); - - void setRelease(bool release); - bool isRelease() const; - - /** - * This sets up the save directory. If the - * it is already set up, nothing happens. - * @return True on success, false otherwise. - **/ - bool setupWriteDirectory(); - - /** - * Sets the name of the save folder. - * @param ident The name of the game. Will be used to - * to create the folder in the LOVE data folder. - **/ - bool setIdentity(const char *ident); - const char *getIdentity() const; - - /** - * Sets the path to the game source. - * This can only be set once. - * @param source Path to a directory or a .love-file. - **/ - bool setSource(const char *source); - - /** - * Creates a new file. - **/ - File *newFile(const char *filename); - - /** - * Creates a new FileData object. Data will be copied. - * @param data Pointer to the data. - * @param size The size of the data. - * @param filename The full filename used to file type identification. - **/ - FileData *newFileData(void *data, unsigned int size, const char *filename); - - /** - * Creates a new FileData object from base64 data. - * @param b64 The base64 data. - **/ - FileData *newFileData(const char *b64, const char *filename); - - /** - * Gets the current working directory. - **/ - const char *getWorkingDirectory(); - - /** - * Gets the user home directory. - **/ - const char *getUserDirectory(); - - /** - * Gets the APPDATA directory. On Windows, this is the folder - * in the %APPDATA% enviroment variable. On Linux, this is the - * user home folder. - **/ - const char *getAppdataDirectory(); - - /** - * Gets the full path of the save folder. - **/ - const char *getSaveDirectory(); - - /** - * Checks whether a file exists in the current search path - * or not. - * @param file The filename to check. - **/ - bool exists(const char *file); - - /** - * Checks if an existing file really is a directory. - * @param file The filename to check. - **/ - bool isDirectory(const char *file); - - /** - * Checks if an existing file really is a file, - * and not a directory. - * @param file The filename to check. - **/ - bool isFile(const char *file); - - /** - * Creates a directory. Write dir must be set. - * @param file The directory to create. - **/ - bool mkdir(const char *file); - - /** - * Removes a file (or directory). - * @param file The file or directory to remove. - **/ - bool remove(const char *file); - - /** - * Opens a file for reading or writing. (Depends - * on the mode chosen at the time of creation). - * @param file The file to open. - * @param mode The mode to open the file in. - **/ - bool open(File *file, File::Mode mode); - - /** - * Closes a file. - * @param file The file to close. - **/ - bool close(File *file); - - /** - * Reads count bytes from an open file. - * The first parameter is either a File or - * a string. An optional second parameter specified the - * max number of bytes to read. - **/ - int read(lua_State *L); - - /** - * Write the bytes in data to the file. File - * must be opened for write. - * The first parameter is either a File or - * a string. - **/ - int write(lua_State *L); - - /** - * Check if end-of-file is reached. - * @return True if EOF, false otherwise. - **/ - bool eof(File *file); - - /** - * Gets the current position in a file. - * @param file An open File. - **/ - int tell(File *file); - - /** - * Seek to a position within a file. - * @param pos The position to seek to. - **/ - bool seek(File *file, uint64 pos); - - /** - * This "native" method returns a table of all - * files in a given directory. - **/ - int enumerate(lua_State *L); - - /** - * Loads a file without running it. The loaded - * chunk is returned as a function. - * @param filename The filename of the file to load. - * @return A function. - **/ - int load(lua_State *L); - - int getLastModified(lua_State *L); - - /** - * Text file line-reading iterator function used and - * pushed on the Lua stack by love.filesystem.lines - * and File:lines. - **/ - static int lines_i(lua_State *L); - -}; // Filesystem - -} // physfs -} // filesystem -} // love - -#endif // LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H +#define LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H + +// STD +#include +#include +#include +#include + +// LOVE +#include "common/Module.h" +#include "common/config.h" +#include "common/int.h" +#include "filesystem/FileData.h" +#include "File.h" + +// For great CWD. (Current Working Directory) +// Using this instead of boost::filesystem which totally +// cramped our style. +#ifdef LOVE_WINDOWS +# include +# include +#else +# include +# include +#endif + +// In Windows, we would like to use "LOVE" as the +// application folder, but in Linux, we like .love. +#define LOVE_APPDATA_PREFIX "" +#ifdef LOVE_WINDOWS +# define LOVE_APPDATA_FOLDER "LOVE" +# define LOVE_PATH_SEPARATOR "/" +# define LOVE_MAX_PATH _MAX_PATH +#else +# ifdef LOVE_MACOSX +# define LOVE_APPDATA_FOLDER "LOVE" +# elif defined(LOVE_LINUX) +# define LOVE_APPDATA_FOLDER "love" +# else +# define LOVE_APPDATA_PREFIX "." +# define LOVE_APPDATA_FOLDER "love" +# endif +# define LOVE_PATH_SEPARATOR "/" +# define LOVE_MAX_PATH MAXPATHLEN +#endif + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ +class Filesystem : public Module +{ +private: + + // Counts open files. + int open_count; + + // Pointer used for file reads. + char *buffer; + + // Contains the current working directory (UTF8). + std::string cwd; + + // %APPDATA% on Windows. + std::string appdata; + + // This name will be used to create the folder + // in the appdata/userdata folder. + std::string save_identity; + + // Full and relative paths of the game save folder. + // (Relative to the %APPDATA% folder, meaning that the + // relative string will look something like: ./LOVE/game) + std::string save_path_relative, save_path_full; + + // The full path to the source of the game. + std::string game_source; + + // Workaround for machines without PhysFS 2.0 + bool isInited; + + // Allow saving outside of the LOVE_APPDATA_FOLDER + // for release 'builds' + bool release; + bool releaseSet; + +protected: + +public: + + Filesystem(); + + ~Filesystem(); + + const char *getName() const; + + void init(const char *arg0); + + void setRelease(bool release); + bool isRelease() const; + + /** + * This sets up the save directory. If the + * it is already set up, nothing happens. + * @return True on success, false otherwise. + **/ + bool setupWriteDirectory(); + + /** + * Sets the name of the save folder. + * @param ident The name of the game. Will be used to + * to create the folder in the LOVE data folder. + **/ + bool setIdentity(const char *ident); + const char *getIdentity() const; + + /** + * Sets the path to the game source. + * This can only be set once. + * @param source Path to a directory or a .love-file. + **/ + bool setSource(const char *source); + + /** + * Creates a new file. + **/ + File *newFile(const char *filename); + + /** + * Creates a new FileData object. Data will be copied. + * @param data Pointer to the data. + * @param size The size of the data. + * @param filename The full filename used to file type identification. + **/ + FileData *newFileData(void *data, unsigned int size, const char *filename); + + /** + * Creates a new FileData object from base64 data. + * @param b64 The base64 data. + **/ + FileData *newFileData(const char *b64, const char *filename); + + /** + * Gets the current working directory. + **/ + const char *getWorkingDirectory(); + + /** + * Gets the user home directory. + **/ + const char *getUserDirectory(); + + /** + * Gets the APPDATA directory. On Windows, this is the folder + * in the %APPDATA% enviroment variable. On Linux, this is the + * user home folder. + **/ + const char *getAppdataDirectory(); + + /** + * Gets the full path of the save folder. + **/ + const char *getSaveDirectory(); + + /** + * Checks whether a file exists in the current search path + * or not. + * @param file The filename to check. + **/ + bool exists(const char *file); + + /** + * Checks if an existing file really is a directory. + * @param file The filename to check. + **/ + bool isDirectory(const char *file); + + /** + * Checks if an existing file really is a file, + * and not a directory. + * @param file The filename to check. + **/ + bool isFile(const char *file); + + /** + * Creates a directory. Write dir must be set. + * @param file The directory to create. + **/ + bool mkdir(const char *file); + + /** + * Removes a file (or directory). + * @param file The file or directory to remove. + **/ + bool remove(const char *file); + + /** + * Opens a file for reading or writing. (Depends + * on the mode chosen at the time of creation). + * @param file The file to open. + * @param mode The mode to open the file in. + **/ + bool open(File *file, File::Mode mode); + + /** + * Closes a file. + * @param file The file to close. + **/ + bool close(File *file); + + /** + * Reads count bytes from an open file. + * The first parameter is either a File or + * a string. An optional second parameter specified the + * max number of bytes to read. + **/ + int read(lua_State *L); + + /** + * Write the bytes in data to the file. File + * must be opened for write. + * The first parameter is either a File or + * a string. + **/ + int write(lua_State *L); + + /** + * Check if end-of-file is reached. + * @return True if EOF, false otherwise. + **/ + bool eof(File *file); + + /** + * Gets the current position in a file. + * @param file An open File. + **/ + int tell(File *file); + + /** + * Seek to a position within a file. + * @param pos The position to seek to. + **/ + bool seek(File *file, uint64 pos); + + /** + * This "native" method returns a table of all + * files in a given directory. + **/ + int enumerate(lua_State *L); + + /** + * Loads a file without running it. The loaded + * chunk is returned as a function. + * @param filename The filename of the file to load. + * @return A function. + **/ + int load(lua_State *L); + + int getLastModified(lua_State *L); + + /** + * Text file line-reading iterator function used and + * pushed on the Lua stack by love.filesystem.lines + * and File:lines. + **/ + static int lines_i(lua_State *L); + +}; // Filesystem + +} // physfs +} // filesystem +} // love + +#endif // LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H diff --git a/src/modules/filesystem/physfs/wrap_File.cpp b/src/modules/filesystem/physfs/wrap_File.cpp index 20277f395..29b5350f8 100644 --- a/src/modules/filesystem/physfs/wrap_File.cpp +++ b/src/modules/filesystem/physfs/wrap_File.cpp @@ -1,227 +1,227 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_File.h" - -#include "common/Data.h" -#include "common/Exception.h" -#include "common/int.h" - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -File *luax_checkfile(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "File", FILESYSTEM_FILE_T); -} - -int w_File_getSize(lua_State *L) -{ - File *t = luax_checkfile(L, 1); - int64 size = t->getSize(); - - // Push nil on failure or if size does not fit into a double precision floating-point number. - if (size == -1 || size >= 0x20000000000000LL) - lua_pushnil(L); - else - lua_pushnumber(L, (lua_Number)size); - - return 1; -} - -int w_File_open(lua_State *L) -{ - File *file = luax_checkfile(L, 1); - File::Mode mode; - - if (!File::getConstant(luaL_checkstring(L, 2), mode)) - return luaL_error(L, "Incorrect file open mode: %s", luaL_checkstring(L, 2)); - - try - { - lua_pushboolean(L, file->open(mode) ? 1 : 0); - } - catch(Exception e) - { - return luaL_error(L, e.what()); - } - - return 1; -} - -int w_File_close(lua_State *L) -{ - File *file = luax_checkfile(L, 1); - lua_pushboolean(L, file->close() ? 1 : 0); - return 1; -} - -int w_File_read(lua_State *L) -{ - File *file = luax_checkfile(L, 1); - Data *d = 0; - - int64 size = (int64)luaL_optnumber(L, 2, (lua_Number) file->getSize()); - - try - { - d = file->read(size); - } - catch(Exception e) - { - return luaL_error(L, e.what()); - } - - lua_pushlstring(L, (const char *) d->getData(), d->getSize()); - lua_pushnumber(L, d->getSize()); - d->release(); - return 2; -} - -int w_File_write(lua_State *L) -{ - File *file = luax_checkfile(L, 1); - bool result; - if (file->getMode() == File::CLOSED) - return luaL_error(L, "File is not open."); - if (lua_isstring(L, 2)) - { - try - { - result = file->write(lua_tostring(L, 2), luaL_optint(L, 3, lua_objlen(L, 2))); - } - catch(Exception e) - { - return luaL_error(L, e.what()); - } - - } - else if (luax_istype(L, 2, DATA_T)) - { - try - { - love::Data *data = luax_totype(L, 2, "Data", DATA_T); - result = file->write(data, luaL_optint(L, 3, data->getSize())); - } - catch(Exception e) - { - return luaL_error(L, e.what()); - } - } - else - { - return luaL_error(L, "String or data expected."); - } - lua_pushboolean(L, result); - return 1; -} - -int w_File_eof(lua_State *L) -{ - File *file = luax_checkfile(L, 1); - luax_pushboolean(L, file->eof()); - return 1; -} - -int w_File_tell(lua_State *L) -{ - File *file = luax_checkfile(L, 1); - int64 pos = file->tell(); - // Push nil on failure or if pos does not fit into a double precision floating-point number. - if (pos == -1 || pos >= 0x20000000000000LL) - lua_pushnil(L); - else - lua_pushnumber(L, (lua_Number)pos); - return 1; -} - -int w_File_seek(lua_State *L) -{ - File *file = luax_checkfile(L, 1); - lua_Number pos = luaL_checknumber(L, 2); - - // Push false on negative and precision-problematic numbers. - // Better fail than seek to an unknown position. - if (pos < 0.0 || pos >= 9007199254740992.0) - luax_pushboolean(L, false); - else - luax_pushboolean(L, file->seek((uint64)pos)); - return 1; -} - -int w_File_lines(lua_State *L) -{ - File *file; - - if (luax_istype(L, 1, FILESYSTEM_FILE_T)) - { - file = luax_checktype(L, 1, "File", FILESYSTEM_FILE_T); - lua_pushnumber(L, 0); // File position. - luax_pushboolean(L, file->getMode() != File::CLOSED); // Save current file mode. - } - else - return luaL_error(L, "Expected File."); - - if (file->getMode() != File::READ) - { - if (file->getMode() != File::CLOSED) - file->close(); - - try - { - if (!file->open(File::READ)) - return luaL_error(L, "Could not open file."); - } - catch(love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - } - - lua_pushcclosure(L, Filesystem::lines_i, 3); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "getSize", w_File_getSize }, - { "open", w_File_open }, - { "close", w_File_close }, - { "read", w_File_read }, - { "write", w_File_write }, - { "eof", w_File_eof }, - { "tell", w_File_tell }, - { "seek", w_File_seek }, - { "lines", w_File_lines }, - { 0, 0 } -}; - -extern "C" int luaopen_file(lua_State *L) -{ - return luax_register_type(L, "File", functions); -} - -} // physfs -} // filesystem -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_File.h" + +#include "common/Data.h" +#include "common/Exception.h" +#include "common/int.h" + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +File *luax_checkfile(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "File", FILESYSTEM_FILE_T); +} + +int w_File_getSize(lua_State *L) +{ + File *t = luax_checkfile(L, 1); + int64 size = t->getSize(); + + // Push nil on failure or if size does not fit into a double precision floating-point number. + if (size == -1 || size >= 0x20000000000000LL) + lua_pushnil(L); + else + lua_pushnumber(L, (lua_Number)size); + + return 1; +} + +int w_File_open(lua_State *L) +{ + File *file = luax_checkfile(L, 1); + File::Mode mode; + + if (!File::getConstant(luaL_checkstring(L, 2), mode)) + return luaL_error(L, "Incorrect file open mode: %s", luaL_checkstring(L, 2)); + + try + { + lua_pushboolean(L, file->open(mode) ? 1 : 0); + } + catch(Exception e) + { + return luaL_error(L, e.what()); + } + + return 1; +} + +int w_File_close(lua_State *L) +{ + File *file = luax_checkfile(L, 1); + lua_pushboolean(L, file->close() ? 1 : 0); + return 1; +} + +int w_File_read(lua_State *L) +{ + File *file = luax_checkfile(L, 1); + Data *d = 0; + + int64 size = (int64)luaL_optnumber(L, 2, (lua_Number) file->getSize()); + + try + { + d = file->read(size); + } + catch(Exception e) + { + return luaL_error(L, e.what()); + } + + lua_pushlstring(L, (const char *) d->getData(), d->getSize()); + lua_pushnumber(L, d->getSize()); + d->release(); + return 2; +} + +int w_File_write(lua_State *L) +{ + File *file = luax_checkfile(L, 1); + bool result; + if (file->getMode() == File::CLOSED) + return luaL_error(L, "File is not open."); + if (lua_isstring(L, 2)) + { + try + { + result = file->write(lua_tostring(L, 2), luaL_optint(L, 3, lua_objlen(L, 2))); + } + catch(Exception e) + { + return luaL_error(L, e.what()); + } + + } + else if (luax_istype(L, 2, DATA_T)) + { + try + { + love::Data *data = luax_totype(L, 2, "Data", DATA_T); + result = file->write(data, luaL_optint(L, 3, data->getSize())); + } + catch(Exception e) + { + return luaL_error(L, e.what()); + } + } + else + { + return luaL_error(L, "String or data expected."); + } + lua_pushboolean(L, result); + return 1; +} + +int w_File_eof(lua_State *L) +{ + File *file = luax_checkfile(L, 1); + luax_pushboolean(L, file->eof()); + return 1; +} + +int w_File_tell(lua_State *L) +{ + File *file = luax_checkfile(L, 1); + int64 pos = file->tell(); + // Push nil on failure or if pos does not fit into a double precision floating-point number. + if (pos == -1 || pos >= 0x20000000000000LL) + lua_pushnil(L); + else + lua_pushnumber(L, (lua_Number)pos); + return 1; +} + +int w_File_seek(lua_State *L) +{ + File *file = luax_checkfile(L, 1); + lua_Number pos = luaL_checknumber(L, 2); + + // Push false on negative and precision-problematic numbers. + // Better fail than seek to an unknown position. + if (pos < 0.0 || pos >= 9007199254740992.0) + luax_pushboolean(L, false); + else + luax_pushboolean(L, file->seek((uint64)pos)); + return 1; +} + +int w_File_lines(lua_State *L) +{ + File *file; + + if (luax_istype(L, 1, FILESYSTEM_FILE_T)) + { + file = luax_checktype(L, 1, "File", FILESYSTEM_FILE_T); + lua_pushnumber(L, 0); // File position. + luax_pushboolean(L, file->getMode() != File::CLOSED); // Save current file mode. + } + else + return luaL_error(L, "Expected File."); + + if (file->getMode() != File::READ) + { + if (file->getMode() != File::CLOSED) + file->close(); + + try + { + if (!file->open(File::READ)) + return luaL_error(L, "Could not open file."); + } + catch(love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + } + + lua_pushcclosure(L, Filesystem::lines_i, 3); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "getSize", w_File_getSize }, + { "open", w_File_open }, + { "close", w_File_close }, + { "read", w_File_read }, + { "write", w_File_write }, + { "eof", w_File_eof }, + { "tell", w_File_tell }, + { "seek", w_File_seek }, + { "lines", w_File_lines }, + { 0, 0 } +}; + +extern "C" int luaopen_file(lua_State *L) +{ + return luax_register_type(L, "File", functions); +} + +} // physfs +} // filesystem +} // love diff --git a/src/modules/filesystem/physfs/wrap_File.h b/src/modules/filesystem/physfs/wrap_File.h index 88f9947a6..042396543 100644 --- a/src/modules/filesystem/physfs/wrap_File.h +++ b/src/modules/filesystem/physfs/wrap_File.h @@ -1,52 +1,52 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_H -#define LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_H - -// LOVE -#include "common/runtime.h" -#include "Filesystem.h" -#include "File.h" - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -File *luax_checkfile(lua_State *L, int idx); -int w_File_getSize(lua_State *L); -int w_File_open(lua_State *L); -int w_File_close(lua_State *L); -int w_File_read(lua_State *L); -int w_File_write(lua_State *L); -int w_File_eof(lua_State *L); -int w_File_tell(lua_State *L); -int w_File_seek(lua_State *L); -int w_File_lines(lua_State *L); -extern "C" int luaopen_file(lua_State *L); - -} // physfs -} // filesystem -} // love - -#endif // LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_H +#define LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_H + +// LOVE +#include "common/runtime.h" +#include "Filesystem.h" +#include "File.h" + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +File *luax_checkfile(lua_State *L, int idx); +int w_File_getSize(lua_State *L); +int w_File_open(lua_State *L); +int w_File_close(lua_State *L); +int w_File_read(lua_State *L); +int w_File_write(lua_State *L); +int w_File_eof(lua_State *L); +int w_File_tell(lua_State *L); +int w_File_seek(lua_State *L); +int w_File_lines(lua_State *L); +extern "C" int luaopen_file(lua_State *L); + +} // physfs +} // filesystem +} // love + +#endif // LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_H diff --git a/src/modules/filesystem/physfs/wrap_FileData.cpp b/src/modules/filesystem/physfs/wrap_FileData.cpp index fffe6d3dd..73ef485ba 100644 --- a/src/modules/filesystem/physfs/wrap_FileData.cpp +++ b/src/modules/filesystem/physfs/wrap_FileData.cpp @@ -1,71 +1,71 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_FileData.h" - -#include "common/wrap_Data.h" - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -FileData *luax_checkfiledata(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "FileData", FILESYSTEM_FILE_DATA_T); -} - -int w_FileData_getFilename(lua_State *L) -{ - FileData *t = luax_checkfiledata(L, 1); - lua_pushstring(L, t->getFilename().c_str()); - return 1; -} - -int w_FileData_getExtension(lua_State *L) -{ - FileData *t = luax_checkfiledata(L, 1); - lua_pushstring(L, t->getExtension().c_str()); - return 1; -} - -static const luaL_Reg w_FileData_functions[] = -{ - - // Data - { "getPointer", w_Data_getPointer }, - { "getSize", w_Data_getSize }, - - { "getFilename", w_FileData_getFilename }, - { "getExtension", w_FileData_getExtension }, - - { 0, 0 } -}; - -extern "C" int luaopen_filedata(lua_State *L) -{ - return luax_register_type(L, "FileData", w_FileData_functions); -} - -} // physfs -} // filesystem -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_FileData.h" + +#include "common/wrap_Data.h" + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +FileData *luax_checkfiledata(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "FileData", FILESYSTEM_FILE_DATA_T); +} + +int w_FileData_getFilename(lua_State *L) +{ + FileData *t = luax_checkfiledata(L, 1); + lua_pushstring(L, t->getFilename().c_str()); + return 1; +} + +int w_FileData_getExtension(lua_State *L) +{ + FileData *t = luax_checkfiledata(L, 1); + lua_pushstring(L, t->getExtension().c_str()); + return 1; +} + +static const luaL_Reg w_FileData_functions[] = +{ + + // Data + { "getPointer", w_Data_getPointer }, + { "getSize", w_Data_getSize }, + + { "getFilename", w_FileData_getFilename }, + { "getExtension", w_FileData_getExtension }, + + { 0, 0 } +}; + +extern "C" int luaopen_filedata(lua_State *L) +{ + return luax_register_type(L, "FileData", w_FileData_functions); +} + +} // physfs +} // filesystem +} // love diff --git a/src/modules/filesystem/physfs/wrap_FileData.h b/src/modules/filesystem/physfs/wrap_FileData.h index ea07ce7d9..d4f5adc9b 100644 --- a/src/modules/filesystem/physfs/wrap_FileData.h +++ b/src/modules/filesystem/physfs/wrap_FileData.h @@ -1,45 +1,45 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_DATA_H -#define LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_DATA_H - -// LOVE -#include "common/runtime.h" - -#include "filesystem/FileData.h" - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -FileData *luax_checkfiledata(lua_State *L, int idx); -int w_FileData_getFilename(lua_State *L); -int w_FileData_getExtension(lua_State *L); -extern "C" int luaopen_filedata(lua_State *L); - -} // physfs -} // filesystem -} // love - -#endif // LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_DATA_H +#define LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_DATA_H + +// LOVE +#include "common/runtime.h" + +#include "filesystem/FileData.h" + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +FileData *luax_checkfiledata(lua_State *L, int idx); +int w_FileData_getFilename(lua_State *L); +int w_FileData_getExtension(lua_State *L); +extern "C" int luaopen_filedata(lua_State *L); + +} // physfs +} // filesystem +} // love + +#endif // LOVE_FILESYSTEM_PHYSFS_WRAP_FILE_DATA_H diff --git a/src/modules/filesystem/physfs/wrap_Filesystem.cpp b/src/modules/filesystem/physfs/wrap_Filesystem.cpp index ed486baf3..33b2ac260 100644 --- a/src/modules/filesystem/physfs/wrap_Filesystem.cpp +++ b/src/modules/filesystem/physfs/wrap_Filesystem.cpp @@ -1,443 +1,443 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "wrap_Filesystem.h" - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -static Filesystem *instance = 0; - -bool hack_setupWriteDirectory() -{ - if (instance != 0) - return instance->setupWriteDirectory(); - return false; -} - -int w_init(lua_State *L) -{ - const char *arg0 = luaL_checkstring(L, 1); - - try - { - instance->init(arg0); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - - return 0; -} - -int w_setRelease(lua_State *L) -{ - // no error checking needed, everything, even nothing - // can be converted to a boolean - instance->setRelease(luax_toboolean(L, 1)); - return 0; -} - -int w_setIdentity(lua_State *L) -{ - const char *arg = luaL_checkstring(L, 1); - - if (!instance->setIdentity(arg)) - return luaL_error(L, "Could not set write directory."); - - return 0; -} - -int w_getIdentity(lua_State *L) -{ - lua_pushstring(L, instance->getIdentity()); - return 1; -} - -int w_setSource(lua_State *L) -{ - const char *arg = luaL_checkstring(L, 1); - - if (!instance->setSource(arg)) - return luaL_error(L, "Could not set source."); - - return 0; -} - -int w_newFile(lua_State *L) -{ - const char *filename = luaL_checkstring(L, 1); - File *t; - try - { - t = instance->newFile(filename); - } - catch(Exception e) - { - return luaL_error(L, e.what()); - } - luax_newtype(L, "File", FILESYSTEM_FILE_T, (void *)t); - return 1; -} - -int w_newFileData(lua_State *L) -{ - if (!lua_isstring(L, 1)) - return luaL_error(L, "String expected."); - if (!lua_isstring(L, 2)) - return luaL_error(L, "String expected."); - - size_t length = 0; - const char *str = lua_tolstring(L, 1, &length); - const char *filename = lua_tostring(L, 2); - const char *decstr = lua_isstring(L, 3) ? lua_tostring(L, 3) : 0; - - FileData::Decoder decoder = FileData::FILE; - - if (decstr) - FileData::getConstant(decstr, decoder); - - FileData *t = 0; - - switch (decoder) - { - case FileData::FILE: - t = instance->newFileData((void *)str, (int)length, filename); - break; - case FileData::BASE64: - t = instance->newFileData(str, filename); - break; - default: - return luaL_error(L, "Unrecognized FileData decoder: %s", decstr); - } - - luax_newtype(L, "FileData", FILESYSTEM_FILE_DATA_T, (void *)t); - return 1; -} - -int w_getWorkingDirectory(lua_State *L) -{ - lua_pushstring(L, instance->getWorkingDirectory()); - return 1; -} - -int w_getUserDirectory(lua_State *L) -{ - lua_pushstring(L, instance->getUserDirectory()); - return 1; -} - -int w_getAppdataDirectory(lua_State *L) -{ - lua_pushstring(L, instance->getAppdataDirectory()); - return 1; -} - -int w_getSaveDirectory(lua_State *L) -{ - lua_pushstring(L, instance->getSaveDirectory()); - return 1; -} - -int w_exists(lua_State *L) -{ - const char *arg = luaL_checkstring(L, 1); - lua_pushboolean(L, instance->exists(arg) ? 1 : 0); - return 1; -} - -int w_isDirectory(lua_State *L) -{ - const char *arg = luaL_checkstring(L, 1); - lua_pushboolean(L, instance->isDirectory(arg) ? 1 : 0); - return 1; -} - -int w_isFile(lua_State *L) -{ - const char *arg = luaL_checkstring(L, 1); - lua_pushboolean(L, instance->isFile(arg) ? 1 : 0); - return 1; -} - -int w_mkdir(lua_State *L) -{ - const char *arg = luaL_checkstring(L, 1); - lua_pushboolean(L, instance->mkdir(arg) ? 1 : 0); - return 1; -} - -int w_remove(lua_State *L) -{ - const char *arg = luaL_checkstring(L, 1); - lua_pushboolean(L, instance->remove(arg) ? 1 : 0); - return 1; -} - -int w_read(lua_State *L) -{ - try - { - return instance->read(L); - } - catch(Exception e) - { - return luaL_error(L, e.what()); - } -} - -int w_write(lua_State *L) -{ - try - { - return instance->write(L); - } - catch(Exception e) - { - return luaL_error(L, e.what()); - } -} - -int w_enumerate(lua_State *L) -{ - return instance->enumerate(L); -} - -int w_lines(lua_State *L) -{ - File *file; - - if (lua_isstring(L, 1)) - { - file = instance->newFile(lua_tostring(L, 1)); - try - { - if (!file->open(File::READ)) - return luaL_error(L, "Could not open file."); - } - catch(love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - luax_newtype(L, "File", FILESYSTEM_FILE_T, file); - } - else - return luaL_error(L, "Expected filename."); - - lua_pushcclosure(L, Filesystem::lines_i, 1); - return 1; -} - -int w_load(lua_State *L) -{ - try - { - return instance->load(L); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } -} - -int w_getLastModified(lua_State *L) -{ - return instance->getLastModified(L); -} - -int loader(lua_State *L) -{ - const char *filename = lua_tostring(L, -1); - - std::string tmp(filename); - tmp += ".lua"; - - int size = tmp.size(); - - for (int i=0; iexists(tmp.c_str())) - { - lua_pop(L, 1); - lua_pushstring(L, tmp.c_str()); - // Ok, load it. - return instance->load(L); - } - - tmp = filename; - size = tmp.size(); - for (int i=0; iisDirectory(tmp.c_str())) - { - tmp += "/init.lua"; - if (instance->exists(tmp.c_str())) - { - lua_pop(L, 1); - lua_pushstring(L, tmp.c_str()); - // Ok, load it. - return instance->load(L); - } - } - - lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", (tmp + ".lua").c_str()); - return 1; -} - -inline const char *library_extension() -{ -#ifdef LOVE_WINDOWS - return ".dll"; -#else - return ".so"; -#endif -} - -int extloader(lua_State *L) -{ - const char *filename = lua_tostring(L, -1); - std::string tokenized_name(filename); - std::string tokenized_function(filename); - - for (unsigned int i = 0; i < tokenized_name.size(); i++) - { - if (tokenized_name[i] == '.') - { - tokenized_name[i] = '/'; - tokenized_function[i] = '_'; - } - } - - tokenized_name += library_extension(); - - void *handle = SDL_LoadObject((std::string(instance->getAppdataDirectory()) + LOVE_PATH_SEPARATOR LOVE_APPDATA_FOLDER LOVE_PATH_SEPARATOR + tokenized_name).c_str()); - if (!handle && instance->isRelease()) - handle = SDL_LoadObject((std::string(instance->getSaveDirectory()) + LOVE_PATH_SEPARATOR + tokenized_name).c_str()); - - if (!handle) - { - lua_pushfstring(L, "\n\tno extension \"%s\" in LOVE paths.\n", filename); - return 1; - } - - void *func = SDL_LoadFunction(handle, ("loveopen_" + tokenized_function).c_str()); - if (!func) - func = SDL_LoadFunction(handle, ("luaopen_" + tokenized_function).c_str()); - - if (!func) - { - SDL_UnloadObject(handle); - lua_pushfstring(L, "\n\textension \"%s\" is incompatible.\n", filename); - return 1; - } - - lua_pushcfunction(L, (lua_CFunction) func); - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "init", w_init }, - { "setRelease", w_setRelease }, - { "setIdentity", w_setIdentity }, - { "getIdentity", w_getIdentity }, - { "setSource", w_setSource }, - { "newFile", w_newFile }, - { "getWorkingDirectory", w_getWorkingDirectory }, - { "getUserDirectory", w_getUserDirectory }, - { "getAppdataDirectory", w_getAppdataDirectory }, - { "getSaveDirectory", w_getSaveDirectory }, - { "exists", w_exists }, - { "isDirectory", w_isDirectory }, - { "isFile", w_isFile }, - { "mkdir", w_mkdir }, - { "remove", w_remove }, - { "read", w_read }, - { "write", w_write }, - { "enumerate", w_enumerate }, - { "lines", w_lines }, - { "load", w_load }, - { "getLastModified", w_getLastModified }, - { "newFileData", w_newFileData }, - { 0, 0 } -}; - -static const lua_CFunction types[] = -{ - luaopen_file, - luaopen_filedata, - 0 -}; - -extern "C" int luaopen_love_filesystem(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new Filesystem(); - love::luax_register_searcher(L, loader, 1); - love::luax_register_searcher(L, extloader, 2); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - { - instance->retain(); - love::luax_register_searcher(L, loader, 1); - love::luax_register_searcher(L, extloader, 2); - } - - WrappedModule w; - w.module = instance; - w.name = "filesystem"; - w.flags = MODULE_FILESYSTEM_T; - w.functions = functions; - w.types = types; - - return luax_register_module(L, w); -} - -} // physfs -} // filesystem -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "wrap_Filesystem.h" + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +static Filesystem *instance = 0; + +bool hack_setupWriteDirectory() +{ + if (instance != 0) + return instance->setupWriteDirectory(); + return false; +} + +int w_init(lua_State *L) +{ + const char *arg0 = luaL_checkstring(L, 1); + + try + { + instance->init(arg0); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + + return 0; +} + +int w_setRelease(lua_State *L) +{ + // no error checking needed, everything, even nothing + // can be converted to a boolean + instance->setRelease(luax_toboolean(L, 1)); + return 0; +} + +int w_setIdentity(lua_State *L) +{ + const char *arg = luaL_checkstring(L, 1); + + if (!instance->setIdentity(arg)) + return luaL_error(L, "Could not set write directory."); + + return 0; +} + +int w_getIdentity(lua_State *L) +{ + lua_pushstring(L, instance->getIdentity()); + return 1; +} + +int w_setSource(lua_State *L) +{ + const char *arg = luaL_checkstring(L, 1); + + if (!instance->setSource(arg)) + return luaL_error(L, "Could not set source."); + + return 0; +} + +int w_newFile(lua_State *L) +{ + const char *filename = luaL_checkstring(L, 1); + File *t; + try + { + t = instance->newFile(filename); + } + catch(Exception e) + { + return luaL_error(L, e.what()); + } + luax_newtype(L, "File", FILESYSTEM_FILE_T, (void *)t); + return 1; +} + +int w_newFileData(lua_State *L) +{ + if (!lua_isstring(L, 1)) + return luaL_error(L, "String expected."); + if (!lua_isstring(L, 2)) + return luaL_error(L, "String expected."); + + size_t length = 0; + const char *str = lua_tolstring(L, 1, &length); + const char *filename = lua_tostring(L, 2); + const char *decstr = lua_isstring(L, 3) ? lua_tostring(L, 3) : 0; + + FileData::Decoder decoder = FileData::FILE; + + if (decstr) + FileData::getConstant(decstr, decoder); + + FileData *t = 0; + + switch (decoder) + { + case FileData::FILE: + t = instance->newFileData((void *)str, (int)length, filename); + break; + case FileData::BASE64: + t = instance->newFileData(str, filename); + break; + default: + return luaL_error(L, "Unrecognized FileData decoder: %s", decstr); + } + + luax_newtype(L, "FileData", FILESYSTEM_FILE_DATA_T, (void *)t); + return 1; +} + +int w_getWorkingDirectory(lua_State *L) +{ + lua_pushstring(L, instance->getWorkingDirectory()); + return 1; +} + +int w_getUserDirectory(lua_State *L) +{ + lua_pushstring(L, instance->getUserDirectory()); + return 1; +} + +int w_getAppdataDirectory(lua_State *L) +{ + lua_pushstring(L, instance->getAppdataDirectory()); + return 1; +} + +int w_getSaveDirectory(lua_State *L) +{ + lua_pushstring(L, instance->getSaveDirectory()); + return 1; +} + +int w_exists(lua_State *L) +{ + const char *arg = luaL_checkstring(L, 1); + lua_pushboolean(L, instance->exists(arg) ? 1 : 0); + return 1; +} + +int w_isDirectory(lua_State *L) +{ + const char *arg = luaL_checkstring(L, 1); + lua_pushboolean(L, instance->isDirectory(arg) ? 1 : 0); + return 1; +} + +int w_isFile(lua_State *L) +{ + const char *arg = luaL_checkstring(L, 1); + lua_pushboolean(L, instance->isFile(arg) ? 1 : 0); + return 1; +} + +int w_mkdir(lua_State *L) +{ + const char *arg = luaL_checkstring(L, 1); + lua_pushboolean(L, instance->mkdir(arg) ? 1 : 0); + return 1; +} + +int w_remove(lua_State *L) +{ + const char *arg = luaL_checkstring(L, 1); + lua_pushboolean(L, instance->remove(arg) ? 1 : 0); + return 1; +} + +int w_read(lua_State *L) +{ + try + { + return instance->read(L); + } + catch(Exception e) + { + return luaL_error(L, e.what()); + } +} + +int w_write(lua_State *L) +{ + try + { + return instance->write(L); + } + catch(Exception e) + { + return luaL_error(L, e.what()); + } +} + +int w_enumerate(lua_State *L) +{ + return instance->enumerate(L); +} + +int w_lines(lua_State *L) +{ + File *file; + + if (lua_isstring(L, 1)) + { + file = instance->newFile(lua_tostring(L, 1)); + try + { + if (!file->open(File::READ)) + return luaL_error(L, "Could not open file."); + } + catch(love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + luax_newtype(L, "File", FILESYSTEM_FILE_T, file); + } + else + return luaL_error(L, "Expected filename."); + + lua_pushcclosure(L, Filesystem::lines_i, 1); + return 1; +} + +int w_load(lua_State *L) +{ + try + { + return instance->load(L); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } +} + +int w_getLastModified(lua_State *L) +{ + return instance->getLastModified(L); +} + +int loader(lua_State *L) +{ + const char *filename = lua_tostring(L, -1); + + std::string tmp(filename); + tmp += ".lua"; + + int size = tmp.size(); + + for (int i=0; iexists(tmp.c_str())) + { + lua_pop(L, 1); + lua_pushstring(L, tmp.c_str()); + // Ok, load it. + return instance->load(L); + } + + tmp = filename; + size = tmp.size(); + for (int i=0; iisDirectory(tmp.c_str())) + { + tmp += "/init.lua"; + if (instance->exists(tmp.c_str())) + { + lua_pop(L, 1); + lua_pushstring(L, tmp.c_str()); + // Ok, load it. + return instance->load(L); + } + } + + lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", (tmp + ".lua").c_str()); + return 1; +} + +inline const char *library_extension() +{ +#ifdef LOVE_WINDOWS + return ".dll"; +#else + return ".so"; +#endif +} + +int extloader(lua_State *L) +{ + const char *filename = lua_tostring(L, -1); + std::string tokenized_name(filename); + std::string tokenized_function(filename); + + for (unsigned int i = 0; i < tokenized_name.size(); i++) + { + if (tokenized_name[i] == '.') + { + tokenized_name[i] = '/'; + tokenized_function[i] = '_'; + } + } + + tokenized_name += library_extension(); + + void *handle = SDL_LoadObject((std::string(instance->getAppdataDirectory()) + LOVE_PATH_SEPARATOR LOVE_APPDATA_FOLDER LOVE_PATH_SEPARATOR + tokenized_name).c_str()); + if (!handle && instance->isRelease()) + handle = SDL_LoadObject((std::string(instance->getSaveDirectory()) + LOVE_PATH_SEPARATOR + tokenized_name).c_str()); + + if (!handle) + { + lua_pushfstring(L, "\n\tno extension \"%s\" in LOVE paths.\n", filename); + return 1; + } + + void *func = SDL_LoadFunction(handle, ("loveopen_" + tokenized_function).c_str()); + if (!func) + func = SDL_LoadFunction(handle, ("luaopen_" + tokenized_function).c_str()); + + if (!func) + { + SDL_UnloadObject(handle); + lua_pushfstring(L, "\n\textension \"%s\" is incompatible.\n", filename); + return 1; + } + + lua_pushcfunction(L, (lua_CFunction) func); + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "init", w_init }, + { "setRelease", w_setRelease }, + { "setIdentity", w_setIdentity }, + { "getIdentity", w_getIdentity }, + { "setSource", w_setSource }, + { "newFile", w_newFile }, + { "getWorkingDirectory", w_getWorkingDirectory }, + { "getUserDirectory", w_getUserDirectory }, + { "getAppdataDirectory", w_getAppdataDirectory }, + { "getSaveDirectory", w_getSaveDirectory }, + { "exists", w_exists }, + { "isDirectory", w_isDirectory }, + { "isFile", w_isFile }, + { "mkdir", w_mkdir }, + { "remove", w_remove }, + { "read", w_read }, + { "write", w_write }, + { "enumerate", w_enumerate }, + { "lines", w_lines }, + { "load", w_load }, + { "getLastModified", w_getLastModified }, + { "newFileData", w_newFileData }, + { 0, 0 } +}; + +static const lua_CFunction types[] = +{ + luaopen_file, + luaopen_filedata, + 0 +}; + +extern "C" int luaopen_love_filesystem(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new Filesystem(); + love::luax_register_searcher(L, loader, 1); + love::luax_register_searcher(L, extloader, 2); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + { + instance->retain(); + love::luax_register_searcher(L, loader, 1); + love::luax_register_searcher(L, extloader, 2); + } + + WrappedModule w; + w.module = instance; + w.name = "filesystem"; + w.flags = MODULE_FILESYSTEM_T; + w.functions = functions; + w.types = types; + + return luax_register_module(L, w); +} + +} // physfs +} // filesystem +} // love diff --git a/src/modules/filesystem/physfs/wrap_Filesystem.h b/src/modules/filesystem/physfs/wrap_Filesystem.h index 25532804b..15356d230 100644 --- a/src/modules/filesystem/physfs/wrap_Filesystem.h +++ b/src/modules/filesystem/physfs/wrap_Filesystem.h @@ -1,75 +1,75 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FILESYSTEM_PHYSFS_WRAP_FILESYSTEM_H -#define LOVE_FILESYSTEM_PHYSFS_WRAP_FILESYSTEM_H - -// LOVE -#include "Filesystem.h" -#include "wrap_File.h" -#include "wrap_FileData.h" - -// SDL -#include - -namespace love -{ -namespace filesystem -{ -namespace physfs -{ - -bool hack_setupWriteDirectory(); -int w_init(lua_State *L); -int w_setRelease(lua_State *L); -int w_setIdentity(lua_State *L); -int w_getIdentity(lua_State *L); -int w_setSource(lua_State *L); -int w_newFile(lua_State *L); -int w_newFileData(lua_State *L); -int w_getWorkingDirectory(lua_State *L); -int w_getUserDirectory(lua_State *L); -int w_getAppdataDirectory(lua_State *L); -int w_getSaveDirectory(lua_State *L); -int w_exists(lua_State *L); -int w_isDirectory(lua_State *L); -int w_isFile(lua_State *L); -int w_mkdir(lua_State *L); -int w_remove(lua_State *L); -int w_open(lua_State *L); -int w_close(lua_State *L); -int w_read(lua_State *L); -int w_write(lua_State *L); -int w_eof(lua_State *L); -int w_tell(lua_State *L); -int w_seek(lua_State *L); -int w_enumerate(lua_State *L); -int w_lines(lua_State *L); -int w_load(lua_State *L); -int w_getLastModified(lua_State *L); -int loader(lua_State *L); -int extloader(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_filesystem(lua_State *L); - -} // physfs -} // filesystem -} // love - -#endif // LOVE_FILESYSTEM_PHYSFS_WRAP_FILESYSTEM_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FILESYSTEM_PHYSFS_WRAP_FILESYSTEM_H +#define LOVE_FILESYSTEM_PHYSFS_WRAP_FILESYSTEM_H + +// LOVE +#include "Filesystem.h" +#include "wrap_File.h" +#include "wrap_FileData.h" + +// SDL +#include + +namespace love +{ +namespace filesystem +{ +namespace physfs +{ + +bool hack_setupWriteDirectory(); +int w_init(lua_State *L); +int w_setRelease(lua_State *L); +int w_setIdentity(lua_State *L); +int w_getIdentity(lua_State *L); +int w_setSource(lua_State *L); +int w_newFile(lua_State *L); +int w_newFileData(lua_State *L); +int w_getWorkingDirectory(lua_State *L); +int w_getUserDirectory(lua_State *L); +int w_getAppdataDirectory(lua_State *L); +int w_getSaveDirectory(lua_State *L); +int w_exists(lua_State *L); +int w_isDirectory(lua_State *L); +int w_isFile(lua_State *L); +int w_mkdir(lua_State *L); +int w_remove(lua_State *L); +int w_open(lua_State *L); +int w_close(lua_State *L); +int w_read(lua_State *L); +int w_write(lua_State *L); +int w_eof(lua_State *L); +int w_tell(lua_State *L); +int w_seek(lua_State *L); +int w_enumerate(lua_State *L); +int w_lines(lua_State *L); +int w_load(lua_State *L); +int w_getLastModified(lua_State *L); +int loader(lua_State *L); +int extloader(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_filesystem(lua_State *L); + +} // physfs +} // filesystem +} // love + +#endif // LOVE_FILESYSTEM_PHYSFS_WRAP_FILESYSTEM_H diff --git a/src/modules/font/Font.h b/src/modules/font/Font.h index 744b1e837..5529015b9 100644 --- a/src/modules/font/Font.h +++ b/src/modules/font/Font.h @@ -1,55 +1,55 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FONT_FONT_H -#define LOVE_FONT_FONT_H - -// LOVE -#include "Rasterizer.h" -#include "image/ImageData.h" -#include "common/Module.h" - -// STD -#include - -namespace love -{ -namespace font -{ - -class Font : public Module -{ - -public: - - virtual Rasterizer *newRasterizer(Data *data, int size) = 0; - virtual Rasterizer *newRasterizer(love::image::ImageData *data, std::string glyphs) = 0; - virtual Rasterizer *newRasterizer(love::image::ImageData *data, unsigned short *glyphs, int length) = 0; - virtual GlyphData *newGlyphData(Rasterizer *r, unsigned short glyph) = 0; - - // Implement Module - virtual const char *getName() const = 0; - -}; // Font - -} // font -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_FONT_H +#define LOVE_FONT_FONT_H + +// LOVE +#include "Rasterizer.h" +#include "image/ImageData.h" +#include "common/Module.h" + +// STD +#include + +namespace love +{ +namespace font +{ + +class Font : public Module +{ + +public: + + virtual Rasterizer *newRasterizer(Data *data, int size) = 0; + virtual Rasterizer *newRasterizer(love::image::ImageData *data, std::string glyphs) = 0; + virtual Rasterizer *newRasterizer(love::image::ImageData *data, unsigned short *glyphs, int length) = 0; + virtual GlyphData *newGlyphData(Rasterizer *r, unsigned short glyph) = 0; + + // Implement Module + virtual const char *getName() const = 0; + +}; // Font + +} // font +} // love + #endif // LOVE_FONT_FONT_H \ No newline at end of file diff --git a/src/modules/font/GlyphData.cpp b/src/modules/font/GlyphData.cpp index 242e54f40..8bd690108 100644 --- a/src/modules/font/GlyphData.cpp +++ b/src/modules/font/GlyphData.cpp @@ -1,127 +1,127 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "GlyphData.h" - -#include - -namespace love -{ -namespace font -{ - -GlyphData::GlyphData(unsigned short glyph, GlyphMetrics glyphMetrics, GlyphData::Format f) - : glyph(glyph) - , metrics(glyphMetrics) - , data(0) - , format(f) -{ - if (metrics.width && metrics.height) - { - switch (f) - { - case GlyphData::FORMAT_LUMINANCE_ALPHA: - data = new unsigned char[metrics.width * metrics.height * 2]; - break; - case GlyphData::FORMAT_RGBA: - default: - data = new unsigned char[metrics.width * metrics.height * 4]; - break; - } - } -} - -GlyphData::~GlyphData() -{ - delete[] data; -} - -void *GlyphData::getData() const -{ - return (void *) data; -} - -int GlyphData::getSize() const -{ - switch (format) - { - case GlyphData::FORMAT_LUMINANCE_ALPHA: - return getWidth() * getHeight() * 2; - break; - case GlyphData::FORMAT_RGBA: - default: - return getWidth() * getHeight() * 4; - break; - } - -} - -int GlyphData::getHeight() const -{ - return metrics.height; -} - -int GlyphData::getWidth() const -{ - return metrics.width; -} - -int GlyphData::getAdvance() const -{ - return metrics.advance; -} - -int GlyphData::getBearingX() const -{ - return metrics.bearingX; -} - -int GlyphData::getBearingY() const -{ - return metrics.bearingY; -} - -int GlyphData::getMinX() const -{ - return this->getBearingX(); -} - -int GlyphData::getMinY() const -{ - return this->getHeight() - this->getBearingY(); -} - -int GlyphData::getMaxX() const -{ - return this->getBearingX() + this->getWidth(); -} - -int GlyphData::getMaxY() const -{ - return this->getBearingY(); -} - -GlyphData::Format GlyphData::getFormat() const -{ - return format; -} - -} // font -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "GlyphData.h" + +#include + +namespace love +{ +namespace font +{ + +GlyphData::GlyphData(unsigned short glyph, GlyphMetrics glyphMetrics, GlyphData::Format f) + : glyph(glyph) + , metrics(glyphMetrics) + , data(0) + , format(f) +{ + if (metrics.width && metrics.height) + { + switch (f) + { + case GlyphData::FORMAT_LUMINANCE_ALPHA: + data = new unsigned char[metrics.width * metrics.height * 2]; + break; + case GlyphData::FORMAT_RGBA: + default: + data = new unsigned char[metrics.width * metrics.height * 4]; + break; + } + } +} + +GlyphData::~GlyphData() +{ + delete[] data; +} + +void *GlyphData::getData() const +{ + return (void *) data; +} + +int GlyphData::getSize() const +{ + switch (format) + { + case GlyphData::FORMAT_LUMINANCE_ALPHA: + return getWidth() * getHeight() * 2; + break; + case GlyphData::FORMAT_RGBA: + default: + return getWidth() * getHeight() * 4; + break; + } + +} + +int GlyphData::getHeight() const +{ + return metrics.height; +} + +int GlyphData::getWidth() const +{ + return metrics.width; +} + +int GlyphData::getAdvance() const +{ + return metrics.advance; +} + +int GlyphData::getBearingX() const +{ + return metrics.bearingX; +} + +int GlyphData::getBearingY() const +{ + return metrics.bearingY; +} + +int GlyphData::getMinX() const +{ + return this->getBearingX(); +} + +int GlyphData::getMinY() const +{ + return this->getHeight() - this->getBearingY(); +} + +int GlyphData::getMaxX() const +{ + return this->getBearingX() + this->getWidth(); +} + +int GlyphData::getMaxY() const +{ + return this->getBearingY(); +} + +GlyphData::Format GlyphData::getFormat() const +{ + return format; +} + +} // font +} // love diff --git a/src/modules/font/GlyphData.h b/src/modules/font/GlyphData.h index 233612b81..8cbb315eb 100644 --- a/src/modules/font/GlyphData.h +++ b/src/modules/font/GlyphData.h @@ -1,134 +1,134 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FONT_GLYPH_DATA_H -#define LOVE_FONT_GLYPH_DATA_H - -// LOVE -#include "common/config.h" -#include "common/Data.h" - -namespace love -{ -namespace font -{ - -/** - * Holds the specific glyph data. - **/ -struct GlyphMetrics -{ - int height; - int width; - int advance; - int bearingX; - int bearingY; - int spacing; -}; - -/** - * Holds data for a specic glyph object. - **/ -class GlyphData : public Data -{ - -public: - enum Format - { - FORMAT_LUMINANCE_ALPHA, - FORMAT_RGBA - }; - - GlyphData(unsigned short glyph, GlyphMetrics glyphMetrics, Format f); - virtual ~GlyphData(); - - // Implements Data. - void *getData() const; - int getSize() const; - - /** - * Gets the height of the glyph. - **/ - virtual int getHeight() const; - - /** - * Gets the width of the glyph. - **/ - virtual int getWidth() const; - - /** - * Gets the advance (the space the glyph takes up) of the glyph. - **/ - int getAdvance() const; - - /** - * Gets bearing (the spacing from origin) along the x-axis of the glyph. - **/ - int getBearingX() const; - - /** - * Gets bearing (the spacing from origin) along the y-axis of the glyph. - **/ - int getBearingY() const; - - /** - * Gets the min x value of the glyph. - **/ - int getMinX() const; - - /** - * Gets the min y value of the glyph. - **/ - int getMinY() const; - - /** - * Gets the max x value of the glyph. - **/ - int getMaxX() const; - - /** - * Gets the max y value of the glyph. - **/ - int getMaxY() const; - - /** - * Gets the format of the glyph data. - **/ - Format getFormat() const; - -private: - // The glyph itself - unsigned short glyph; - - // Glyph metrics - GlyphMetrics metrics; - - // Glyph texture data - unsigned char *data; - - // The format the data's in - Format format; - -}; // GlyphData - -} // font -} // love - -#endif // LOVE_FONT_GLYPH_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_GLYPH_DATA_H +#define LOVE_FONT_GLYPH_DATA_H + +// LOVE +#include "common/config.h" +#include "common/Data.h" + +namespace love +{ +namespace font +{ + +/** + * Holds the specific glyph data. + **/ +struct GlyphMetrics +{ + int height; + int width; + int advance; + int bearingX; + int bearingY; + int spacing; +}; + +/** + * Holds data for a specic glyph object. + **/ +class GlyphData : public Data +{ + +public: + enum Format + { + FORMAT_LUMINANCE_ALPHA, + FORMAT_RGBA + }; + + GlyphData(unsigned short glyph, GlyphMetrics glyphMetrics, Format f); + virtual ~GlyphData(); + + // Implements Data. + void *getData() const; + int getSize() const; + + /** + * Gets the height of the glyph. + **/ + virtual int getHeight() const; + + /** + * Gets the width of the glyph. + **/ + virtual int getWidth() const; + + /** + * Gets the advance (the space the glyph takes up) of the glyph. + **/ + int getAdvance() const; + + /** + * Gets bearing (the spacing from origin) along the x-axis of the glyph. + **/ + int getBearingX() const; + + /** + * Gets bearing (the spacing from origin) along the y-axis of the glyph. + **/ + int getBearingY() const; + + /** + * Gets the min x value of the glyph. + **/ + int getMinX() const; + + /** + * Gets the min y value of the glyph. + **/ + int getMinY() const; + + /** + * Gets the max x value of the glyph. + **/ + int getMaxX() const; + + /** + * Gets the max y value of the glyph. + **/ + int getMaxY() const; + + /** + * Gets the format of the glyph data. + **/ + Format getFormat() const; + +private: + // The glyph itself + unsigned short glyph; + + // Glyph metrics + GlyphMetrics metrics; + + // Glyph texture data + unsigned char *data; + + // The format the data's in + Format format; + +}; // GlyphData + +} // font +} // love + +#endif // LOVE_FONT_GLYPH_DATA_H diff --git a/src/modules/font/ImageRasterizer.cpp b/src/modules/font/ImageRasterizer.cpp index ccb4d96ac..9891a18fa 100644 --- a/src/modules/font/ImageRasterizer.cpp +++ b/src/modules/font/ImageRasterizer.cpp @@ -1,153 +1,153 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "ImageRasterizer.h" - -#include "common/Exception.h" -#include - -namespace love -{ -namespace font -{ - -inline bool equal(const love::image::pixel &a, const love::image::pixel &b) -{ - return (a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a); -} - -ImageRasterizer::ImageRasterizer(love::image::ImageData *data, unsigned short *glyphs, int length) - : imageData(data) - , glyphs(glyphs) - , length(length) -{ - imageData->retain(); - positions = new unsigned int[MAX_CHARS]; - memset(positions, 0, MAX_CHARS*4); - widths = new unsigned int[MAX_CHARS]; - memset(widths, 0, MAX_CHARS*4); - spacing = new unsigned int[MAX_CHARS]; - memset(spacing, 0, MAX_CHARS*4); - load(); -} - -ImageRasterizer::~ImageRasterizer() -{ - imageData->release(); - delete[] positions; - delete[] widths; - delete[] spacing; -} - -int ImageRasterizer::getLineHeight() const -{ - return getHeight(); -} - -GlyphData *ImageRasterizer::getGlyphData(unsigned short glyph) const -{ - GlyphMetrics gm; - gm.height = metrics.height; - gm.width = widths[glyph]; - gm.advance = spacing[glyph] + widths[glyph]; - gm.bearingX = 0; - gm.bearingY = 0; - GlyphData *g = new GlyphData(glyph, gm, GlyphData::FORMAT_RGBA); - if (gm.width == 0) return g; - unsigned char *gd = (unsigned char *)g->getData(); - love::image::pixel *pixels = (love::image::pixel *)(imageData->getData()); - for (unsigned int i = 0; i < widths[glyph]*getHeight(); i++) - { - love::image::pixel p = pixels[ positions[glyph] + (i % widths[glyph]) + (imageData->getWidth() * (i / widths[glyph])) ]; - gd[i*4] = p.r; - gd[i*4+1] = p.g; - gd[i*4+2] = p.b; - gd[i*4+3] = p.a; - } - return g; -} - -void ImageRasterizer::load() -{ - love::image::pixel *pixels = (love::image::pixel *)(imageData->getData()); - - unsigned imgw = (unsigned)imageData->getWidth(); - unsigned imgh = (unsigned)imageData->getHeight(); - unsigned imgs = imgw*imgh; - - // Set the only metric that matters - metrics.height = imgh; - - // Reading texture data begins - love::image::pixel spacer = pixels[0]; - - unsigned int start = 0; - unsigned int end = 0; - - for (unsigned int i = 0; i < length; ++i) - { - if (i >= MAX_CHARS) - break; - - start = end; - - // Finds out where the first character starts - while (start < imgw && equal(pixels[start], spacer)) - ++start; - - if (i > 0) - spacing[glyphs[i - 1]] = (start > end) ? (start - end) : 0; - - end = start; - - // Find where glyph ends. - while (end < imgw && !equal(pixels[end], spacer)) - ++end; - - if (start >= end) - break; - - unsigned c = glyphs[i]; - - positions[c] = start; - widths[c] = (end - start); - } - - // Replace spacer color with an empty pixel - for (unsigned int i = 0; i < imgs; ++i) - { - if (equal(pixels[i], spacer)) - { - pixels[i].r = 0; - pixels[i].g = 0; - pixels[i].b = 0; - pixels[i].a = 0; - } - } -} - -int ImageRasterizer::getNumGlyphs() const -{ - return length; -} - -} // font -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "ImageRasterizer.h" + +#include "common/Exception.h" +#include + +namespace love +{ +namespace font +{ + +inline bool equal(const love::image::pixel &a, const love::image::pixel &b) +{ + return (a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a); +} + +ImageRasterizer::ImageRasterizer(love::image::ImageData *data, unsigned short *glyphs, int length) + : imageData(data) + , glyphs(glyphs) + , length(length) +{ + imageData->retain(); + positions = new unsigned int[MAX_CHARS]; + memset(positions, 0, MAX_CHARS*4); + widths = new unsigned int[MAX_CHARS]; + memset(widths, 0, MAX_CHARS*4); + spacing = new unsigned int[MAX_CHARS]; + memset(spacing, 0, MAX_CHARS*4); + load(); +} + +ImageRasterizer::~ImageRasterizer() +{ + imageData->release(); + delete[] positions; + delete[] widths; + delete[] spacing; +} + +int ImageRasterizer::getLineHeight() const +{ + return getHeight(); +} + +GlyphData *ImageRasterizer::getGlyphData(unsigned short glyph) const +{ + GlyphMetrics gm; + gm.height = metrics.height; + gm.width = widths[glyph]; + gm.advance = spacing[glyph] + widths[glyph]; + gm.bearingX = 0; + gm.bearingY = 0; + GlyphData *g = new GlyphData(glyph, gm, GlyphData::FORMAT_RGBA); + if (gm.width == 0) return g; + unsigned char *gd = (unsigned char *)g->getData(); + love::image::pixel *pixels = (love::image::pixel *)(imageData->getData()); + for (unsigned int i = 0; i < widths[glyph]*getHeight(); i++) + { + love::image::pixel p = pixels[ positions[glyph] + (i % widths[glyph]) + (imageData->getWidth() * (i / widths[glyph])) ]; + gd[i*4] = p.r; + gd[i*4+1] = p.g; + gd[i*4+2] = p.b; + gd[i*4+3] = p.a; + } + return g; +} + +void ImageRasterizer::load() +{ + love::image::pixel *pixels = (love::image::pixel *)(imageData->getData()); + + unsigned imgw = (unsigned)imageData->getWidth(); + unsigned imgh = (unsigned)imageData->getHeight(); + unsigned imgs = imgw*imgh; + + // Set the only metric that matters + metrics.height = imgh; + + // Reading texture data begins + love::image::pixel spacer = pixels[0]; + + unsigned int start = 0; + unsigned int end = 0; + + for (unsigned int i = 0; i < length; ++i) + { + if (i >= MAX_CHARS) + break; + + start = end; + + // Finds out where the first character starts + while (start < imgw && equal(pixels[start], spacer)) + ++start; + + if (i > 0) + spacing[glyphs[i - 1]] = (start > end) ? (start - end) : 0; + + end = start; + + // Find where glyph ends. + while (end < imgw && !equal(pixels[end], spacer)) + ++end; + + if (start >= end) + break; + + unsigned c = glyphs[i]; + + positions[c] = start; + widths[c] = (end - start); + } + + // Replace spacer color with an empty pixel + for (unsigned int i = 0; i < imgs; ++i) + { + if (equal(pixels[i], spacer)) + { + pixels[i].r = 0; + pixels[i].g = 0; + pixels[i].b = 0; + pixels[i].a = 0; + } + } +} + +int ImageRasterizer::getNumGlyphs() const +{ + return length; +} + +} // font +} // love diff --git a/src/modules/font/ImageRasterizer.h b/src/modules/font/ImageRasterizer.h index 9934690d3..da649cfb5 100644 --- a/src/modules/font/ImageRasterizer.h +++ b/src/modules/font/ImageRasterizer.h @@ -1,72 +1,72 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FONT_IMAGE_RASTERIZER_H -#define LOVE_FONT_IMAGE_RASTERIZER_H - -// LOVE -#include "filesystem/File.h" -#include "font/Rasterizer.h" -#include "image/ImageData.h" - -namespace love -{ -namespace font -{ - -/** - * Holds data for a font object. - **/ -class ImageRasterizer : public Rasterizer -{ -private: - // Load all the glyph positions into memory - void load(); - - // The image data - love::image::ImageData *imageData; - // The glyphs in the font - unsigned short *glyphs; - // The length of the glyph array - unsigned int length; - // The positions of each glyph - unsigned int *positions; - // The widths of each glyph - unsigned int *widths; - // The spacing of each glyph - unsigned int *spacing; - -public: - ImageRasterizer(love::image::ImageData *imageData, unsigned short *glyphs, int length); - virtual ~ImageRasterizer(); - - // Implement Rasterizer - virtual int getLineHeight() const; - virtual GlyphData *getGlyphData(unsigned short glyph) const; - virtual int getNumGlyphs() const; - - static const unsigned int MAX_CHARS = 256; - -}; // ImageRasterizer - -} // font -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_IMAGE_RASTERIZER_H +#define LOVE_FONT_IMAGE_RASTERIZER_H + +// LOVE +#include "filesystem/File.h" +#include "font/Rasterizer.h" +#include "image/ImageData.h" + +namespace love +{ +namespace font +{ + +/** + * Holds data for a font object. + **/ +class ImageRasterizer : public Rasterizer +{ +private: + // Load all the glyph positions into memory + void load(); + + // The image data + love::image::ImageData *imageData; + // The glyphs in the font + unsigned short *glyphs; + // The length of the glyph array + unsigned int length; + // The positions of each glyph + unsigned int *positions; + // The widths of each glyph + unsigned int *widths; + // The spacing of each glyph + unsigned int *spacing; + +public: + ImageRasterizer(love::image::ImageData *imageData, unsigned short *glyphs, int length); + virtual ~ImageRasterizer(); + + // Implement Rasterizer + virtual int getLineHeight() const; + virtual GlyphData *getGlyphData(unsigned short glyph) const; + virtual int getNumGlyphs() const; + + static const unsigned int MAX_CHARS = 256; + +}; // ImageRasterizer + +} // font +} // love + #endif // LOVE_FONT_IMAGE_RASTERIZER_H \ No newline at end of file diff --git a/src/modules/font/Rasterizer.cpp b/src/modules/font/Rasterizer.cpp index 1d6843254..e60ebe222 100644 --- a/src/modules/font/Rasterizer.cpp +++ b/src/modules/font/Rasterizer.cpp @@ -1,54 +1,54 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "Rasterizer.h" - -namespace love -{ -namespace font -{ - -Rasterizer::~Rasterizer() -{ -} - -int Rasterizer::getHeight() const -{ - return metrics.height; -} - -int Rasterizer::getAdvance() const -{ - return metrics.advance; -} - -int Rasterizer::getAscent() const -{ - return metrics.ascent; -} - -int Rasterizer::getDescent() const -{ - return metrics.descent; -} - -} // font +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "Rasterizer.h" + +namespace love +{ +namespace font +{ + +Rasterizer::~Rasterizer() +{ +} + +int Rasterizer::getHeight() const +{ + return metrics.height; +} + +int Rasterizer::getAdvance() const +{ + return metrics.advance; +} + +int Rasterizer::getAscent() const +{ + return metrics.ascent; +} + +int Rasterizer::getDescent() const +{ + return metrics.descent; +} + +} // font } // love \ No newline at end of file diff --git a/src/modules/font/Rasterizer.h b/src/modules/font/Rasterizer.h index 799503e69..46e27143b 100644 --- a/src/modules/font/Rasterizer.h +++ b/src/modules/font/Rasterizer.h @@ -1,98 +1,98 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FONT_RASTERIZER_H -#define LOVE_FONT_RASTERIZER_H - -// LOVE -#include "common/Object.h" -#include "GlyphData.h" - -namespace love -{ -namespace font -{ - -/** - * Holds the specific font metrics. - **/ -struct FontMetrics -{ - int advance; - int ascent; - int descent; - int height; -}; - -/** - * Holds data for a font object. - **/ -class Rasterizer : public Object -{ -protected: - FontMetrics metrics; - -public: - - virtual ~Rasterizer(); - - /** - * Gets the max height of the glyphs. - **/ - virtual int getHeight() const; - - /** - * Gets the max advance of the glyphs. - **/ - virtual int getAdvance() const; - - /** - * Gets the max ascent (height above baseline) for the font. - **/ - virtual int getAscent() const; - - /** - * Gets the max descent (height below baseline) for the font. - **/ - virtual int getDescent() const; - - /** - * Gets the line height of the font. - **/ - virtual int getLineHeight() const = 0; - - /** - * Gets a specific glyph. - * @param glyph The (UNICODE) glyph to get data for - **/ - virtual GlyphData *getGlyphData(unsigned short glyph) const = 0; - - /** - * Gets the number of glyphs the rasterizer has data for. - **/ - virtual int getNumGlyphs() const = 0; - - -}; // Rasterizer - -} // font -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_RASTERIZER_H +#define LOVE_FONT_RASTERIZER_H + +// LOVE +#include "common/Object.h" +#include "GlyphData.h" + +namespace love +{ +namespace font +{ + +/** + * Holds the specific font metrics. + **/ +struct FontMetrics +{ + int advance; + int ascent; + int descent; + int height; +}; + +/** + * Holds data for a font object. + **/ +class Rasterizer : public Object +{ +protected: + FontMetrics metrics; + +public: + + virtual ~Rasterizer(); + + /** + * Gets the max height of the glyphs. + **/ + virtual int getHeight() const; + + /** + * Gets the max advance of the glyphs. + **/ + virtual int getAdvance() const; + + /** + * Gets the max ascent (height above baseline) for the font. + **/ + virtual int getAscent() const; + + /** + * Gets the max descent (height below baseline) for the font. + **/ + virtual int getDescent() const; + + /** + * Gets the line height of the font. + **/ + virtual int getLineHeight() const = 0; + + /** + * Gets a specific glyph. + * @param glyph The (UNICODE) glyph to get data for + **/ + virtual GlyphData *getGlyphData(unsigned short glyph) const = 0; + + /** + * Gets the number of glyphs the rasterizer has data for. + **/ + virtual int getNumGlyphs() const = 0; + + +}; // Rasterizer + +} // font +} // love + #endif // LOVE_FONT_RASTERIZER_H \ No newline at end of file diff --git a/src/modules/font/freetype/Font.cpp b/src/modules/font/freetype/Font.cpp index 6e8159340..d4a893212 100644 --- a/src/modules/font/freetype/Font.cpp +++ b/src/modules/font/freetype/Font.cpp @@ -1,79 +1,79 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Font.h" - -#include "TrueTypeRasterizer.h" -#include "font/ImageRasterizer.h" - -namespace love -{ -namespace font -{ -namespace freetype -{ - -Font::Font() -{ - if (FT_Init_FreeType(&library)) - throw love::Exception("TrueTypeFont Loading error: FT_Init_FreeType failed\n"); -} - -Font::~Font() -{ - FT_Done_FreeType(library); -} - -Rasterizer *Font::newRasterizer(Data *data, int size) -{ - return new TrueTypeRasterizer(library, data, size); -} - -Rasterizer *Font::newRasterizer(love::image::ImageData *data, std::string glyphs) -{ - int length = glyphs.size(); - unsigned short *g = new unsigned short[length]; - for (int i = 0; i < length; i++) - { - g[i] = (unsigned char)glyphs[i]; - } - Rasterizer *r = newRasterizer(data, g, length); - delete [] g; - return r; -} - -Rasterizer *Font::newRasterizer(love::image::ImageData *data, unsigned short *glyphs, int length) -{ - return new ImageRasterizer(data, glyphs, length); -} - -GlyphData *Font::newGlyphData(Rasterizer *r, unsigned short glyph) -{ - return r->getGlyphData(glyph); -} - -const char *Font::getName() const -{ - return "love.font.freetype"; -} - -} // freetype -} // font -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Font.h" + +#include "TrueTypeRasterizer.h" +#include "font/ImageRasterizer.h" + +namespace love +{ +namespace font +{ +namespace freetype +{ + +Font::Font() +{ + if (FT_Init_FreeType(&library)) + throw love::Exception("TrueTypeFont Loading error: FT_Init_FreeType failed\n"); +} + +Font::~Font() +{ + FT_Done_FreeType(library); +} + +Rasterizer *Font::newRasterizer(Data *data, int size) +{ + return new TrueTypeRasterizer(library, data, size); +} + +Rasterizer *Font::newRasterizer(love::image::ImageData *data, std::string glyphs) +{ + int length = glyphs.size(); + unsigned short *g = new unsigned short[length]; + for (int i = 0; i < length; i++) + { + g[i] = (unsigned char)glyphs[i]; + } + Rasterizer *r = newRasterizer(data, g, length); + delete [] g; + return r; +} + +Rasterizer *Font::newRasterizer(love::image::ImageData *data, unsigned short *glyphs, int length) +{ + return new ImageRasterizer(data, glyphs, length); +} + +GlyphData *Font::newGlyphData(Rasterizer *r, unsigned short glyph) +{ + return r->getGlyphData(glyph); +} + +const char *Font::getName() const +{ + return "love.font.freetype"; +} + +} // freetype +} // font +} // love diff --git a/src/modules/font/freetype/Font.h b/src/modules/font/freetype/Font.h index 575ebd052..4bdc67ea9 100644 --- a/src/modules/font/freetype/Font.h +++ b/src/modules/font/freetype/Font.h @@ -1,75 +1,75 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FONT_FREETYPE_FONT_H -#define LOVE_FONT_FREETYPE_FONT_H - -// LOVE -#include "font/Font.h" - -// FreeType2 -#ifdef LOVE_MACOSX -#include -#else -#include -#endif -#include -#include -#include -#include - -namespace love -{ -namespace font -{ -namespace freetype -{ - -class Font : public love::font::Font -{ -public: - - Font(); - - /** - * Destructor. - **/ - virtual ~Font(); - - // Implements Font - Rasterizer *newRasterizer(Data *data, int size); - Rasterizer *newRasterizer(love::image::ImageData *data, std::string glyphs); - Rasterizer *newRasterizer(love::image::ImageData *data, unsigned short *glyphs, int length); - GlyphData *newGlyphData(Rasterizer *r, unsigned short glyph); - - // Implement Module - const char *getName() const; - -private: - - // FreeType library - FT_Library library; -}; // Font - -} // freetype -} // font -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_FREETYPE_FONT_H +#define LOVE_FONT_FREETYPE_FONT_H + +// LOVE +#include "font/Font.h" + +// FreeType2 +#ifdef LOVE_MACOSX +#include +#else +#include +#endif +#include +#include +#include +#include + +namespace love +{ +namespace font +{ +namespace freetype +{ + +class Font : public love::font::Font +{ +public: + + Font(); + + /** + * Destructor. + **/ + virtual ~Font(); + + // Implements Font + Rasterizer *newRasterizer(Data *data, int size); + Rasterizer *newRasterizer(love::image::ImageData *data, std::string glyphs); + Rasterizer *newRasterizer(love::image::ImageData *data, unsigned short *glyphs, int length); + GlyphData *newGlyphData(Rasterizer *r, unsigned short glyph); + + // Implement Module + const char *getName() const; + +private: + + // FreeType library + FT_Library library; +}; // Font + +} // freetype +} // font +} // love + #endif // LOVE_FONT_FREETYPE_FONT_H \ No newline at end of file diff --git a/src/modules/font/freetype/TrueTypeRasterizer.cpp b/src/modules/font/freetype/TrueTypeRasterizer.cpp index f1bbc8b2b..f302b2de5 100644 --- a/src/modules/font/freetype/TrueTypeRasterizer.cpp +++ b/src/modules/font/freetype/TrueTypeRasterizer.cpp @@ -1,123 +1,123 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "TrueTypeRasterizer.h" - -#include "common/Exception.h" - -namespace love -{ -namespace font -{ -namespace freetype -{ - -struct la -{ - unsigned char l,a; -}; - -TrueTypeRasterizer::TrueTypeRasterizer(FT_Library library, Data *data, int size) - : data(data) -{ - data->retain(); - - if (FT_New_Memory_Face(library, - (const FT_Byte *)data->getData(), /* first byte in memory */ - data->getSize(), /* size in bytes */ - 0, /* face_index */ - &face)) - throw love::Exception("TrueTypeFont Loading error: FT_New_Face failed (there is probably a problem with your font file)\n"); - - FT_Set_Pixel_Sizes(face, size, size); - - // Set global metrics - FT_Size_Metrics s = face->size->metrics; - metrics.advance = s.max_advance >> 6; - metrics.ascent = s.ascender >> 6; - metrics.descent = s.descender >> 6; - metrics.height = s.height >> 6; -} - -TrueTypeRasterizer::~TrueTypeRasterizer() -{ - FT_Done_Face(face); - data->release(); -} - -int TrueTypeRasterizer::getLineHeight() const -{ - return (int)(getHeight() * 1.25); -} - -GlyphData *TrueTypeRasterizer::getGlyphData(unsigned short glyph) const -{ - love::font::GlyphMetrics glyphMetrics; - FT_Glyph ftglyph; - - // Initialize - if (FT_Load_Glyph(face, FT_Get_Char_Index(face, glyph), FT_LOAD_DEFAULT)) - throw love::Exception("TrueTypeFont Loading vm->error: FT_Load_Glyph failed\n"); - - if (FT_Get_Glyph(face->glyph, &ftglyph)) - throw love::Exception("TrueTypeFont Loading vm->error: FT_Get_Glyph failed\n"); - - FT_Glyph_To_Bitmap(&ftglyph, FT_RENDER_MODE_NORMAL, 0, 1); - FT_BitmapGlyph bitmap_glyph = (FT_BitmapGlyph)ftglyph; - FT_Bitmap &bitmap = bitmap_glyph->bitmap; //just to make things easier - - // Get metrics - glyphMetrics.bearingX = face->glyph->metrics.horiBearingX >> 6; - glyphMetrics.bearingY = face->glyph->metrics.horiBearingY >> 6; - glyphMetrics.height = bitmap.rows; - glyphMetrics.width = bitmap.width; - glyphMetrics.advance = face->glyph->metrics.horiAdvance >> 6; - - GlyphData *glyphData = new GlyphData(glyph, glyphMetrics, GlyphData::FORMAT_LUMINANCE_ALPHA); - - { - int size = bitmap.rows*bitmap.width; - unsigned char *dst = (unsigned char *)glyphData->getData(); - - // Note that bitmap.buffer contains only luminosity. We copy that single value to - // our luminosity-alpha format. - for (int i = 0; iretain(); + + if (FT_New_Memory_Face(library, + (const FT_Byte *)data->getData(), /* first byte in memory */ + data->getSize(), /* size in bytes */ + 0, /* face_index */ + &face)) + throw love::Exception("TrueTypeFont Loading error: FT_New_Face failed (there is probably a problem with your font file)\n"); + + FT_Set_Pixel_Sizes(face, size, size); + + // Set global metrics + FT_Size_Metrics s = face->size->metrics; + metrics.advance = s.max_advance >> 6; + metrics.ascent = s.ascender >> 6; + metrics.descent = s.descender >> 6; + metrics.height = s.height >> 6; +} + +TrueTypeRasterizer::~TrueTypeRasterizer() +{ + FT_Done_Face(face); + data->release(); +} + +int TrueTypeRasterizer::getLineHeight() const +{ + return (int)(getHeight() * 1.25); +} + +GlyphData *TrueTypeRasterizer::getGlyphData(unsigned short glyph) const +{ + love::font::GlyphMetrics glyphMetrics; + FT_Glyph ftglyph; + + // Initialize + if (FT_Load_Glyph(face, FT_Get_Char_Index(face, glyph), FT_LOAD_DEFAULT)) + throw love::Exception("TrueTypeFont Loading vm->error: FT_Load_Glyph failed\n"); + + if (FT_Get_Glyph(face->glyph, &ftglyph)) + throw love::Exception("TrueTypeFont Loading vm->error: FT_Get_Glyph failed\n"); + + FT_Glyph_To_Bitmap(&ftglyph, FT_RENDER_MODE_NORMAL, 0, 1); + FT_BitmapGlyph bitmap_glyph = (FT_BitmapGlyph)ftglyph; + FT_Bitmap &bitmap = bitmap_glyph->bitmap; //just to make things easier + + // Get metrics + glyphMetrics.bearingX = face->glyph->metrics.horiBearingX >> 6; + glyphMetrics.bearingY = face->glyph->metrics.horiBearingY >> 6; + glyphMetrics.height = bitmap.rows; + glyphMetrics.width = bitmap.width; + glyphMetrics.advance = face->glyph->metrics.horiAdvance >> 6; + + GlyphData *glyphData = new GlyphData(glyph, glyphMetrics, GlyphData::FORMAT_LUMINANCE_ALPHA); + + { + int size = bitmap.rows*bitmap.width; + unsigned char *dst = (unsigned char *)glyphData->getData(); + + // Note that bitmap.buffer contains only luminosity. We copy that single value to + // our luminosity-alpha format. + for (int i = 0; i -#include -#include -#include -#include - -namespace love -{ -namespace font -{ -namespace freetype -{ - -/** - * Holds data for a font object. - **/ -class TrueTypeRasterizer : public Rasterizer -{ -public: - TrueTypeRasterizer(FT_Library library, Data *data, int size); - virtual ~TrueTypeRasterizer(); - - // Implement Rasterizer - virtual int getLineHeight() const; - virtual GlyphData *getGlyphData(unsigned short glyph) const; - virtual int getNumGlyphs() const; - -private: - - // TrueType face - FT_Face face; - - // File data - Data *data; -}; // FreetypeRasterizer - -} // freetype -} // font -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_FREETYPE_TRUE_TYPE_RASTERIZER_H +#define LOVE_FONT_FREETYPE_TRUE_TYPE_RASTERIZER_H + +// LOVE +#include "filesystem/File.h" +#include "font/Rasterizer.h" + +// TrueType2 +#include +#include +#include +#include +#include + +namespace love +{ +namespace font +{ +namespace freetype +{ + +/** + * Holds data for a font object. + **/ +class TrueTypeRasterizer : public Rasterizer +{ +public: + TrueTypeRasterizer(FT_Library library, Data *data, int size); + virtual ~TrueTypeRasterizer(); + + // Implement Rasterizer + virtual int getLineHeight() const; + virtual GlyphData *getGlyphData(unsigned short glyph) const; + virtual int getNumGlyphs() const; + +private: + + // TrueType face + FT_Face face; + + // File data + Data *data; +}; // FreetypeRasterizer + +} // freetype +} // font +} // love + #endif // LOVE_FONT_FREETYPE_TRUE_TYPE_RASTERIZER_H \ No newline at end of file diff --git a/src/modules/font/freetype/wrap_Font.cpp b/src/modules/font/freetype/wrap_Font.cpp index 62d1fcdb3..441276e49 100644 --- a/src/modules/font/freetype/wrap_Font.cpp +++ b/src/modules/font/freetype/wrap_Font.cpp @@ -1,113 +1,113 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Font.h" - -#include "Font.h" - -#include "font/wrap_GlyphData.h" -#include "font/wrap_Rasterizer.h" - -#include "TrueTypeRasterizer.h" - -namespace love -{ -namespace font -{ -namespace freetype -{ - -static Font *instance = 0; - -int w_newRasterizer(lua_State *L) -{ - Rasterizer *t = NULL; - if (luax_istype(L, 1, IMAGE_IMAGE_DATA_T)) - { - love::image::ImageData *d = luax_checktype(L, 1, "ImageData", IMAGE_IMAGE_DATA_T); - const char *g = luaL_checkstring(L, 2); - std::string glyphs(g); - t = instance->newRasterizer(d, glyphs); - } - else if (luax_istype(L, 1, DATA_T)) - { - Data *d = luax_checkdata(L, 1); - int size = luaL_checkint(L, 2); - t = instance->newRasterizer(d, size); - } - - luax_newtype(L, "Rasterizer", FONT_RASTERIZER_T, t); - return 1; -} - -int w_newGlyphData(lua_State *L) -{ - Rasterizer *r = luax_checkrasterizer(L, 1); - unsigned short g = (unsigned short)luaL_checkint(L, 2); - - GlyphData *t = instance->newGlyphData(r, g); - luax_newtype(L, "GlyphData", FONT_GLYPH_DATA_T, t); - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "newRasterizer", w_newRasterizer }, - { "newGlyphData", w_newGlyphData }, - { 0, 0 } -}; - -static const lua_CFunction types[] = -{ - luaopen_glyphdata, - luaopen_rasterizer, - 0 -}; - -extern "C" int luaopen_love_font(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new Font(); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "font"; - w.flags = MODULE_T; - w.functions = functions; - w.types = types; - - return luax_register_module(L, w); -} - -} // freetype -} // font -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Font.h" + +#include "Font.h" + +#include "font/wrap_GlyphData.h" +#include "font/wrap_Rasterizer.h" + +#include "TrueTypeRasterizer.h" + +namespace love +{ +namespace font +{ +namespace freetype +{ + +static Font *instance = 0; + +int w_newRasterizer(lua_State *L) +{ + Rasterizer *t = NULL; + if (luax_istype(L, 1, IMAGE_IMAGE_DATA_T)) + { + love::image::ImageData *d = luax_checktype(L, 1, "ImageData", IMAGE_IMAGE_DATA_T); + const char *g = luaL_checkstring(L, 2); + std::string glyphs(g); + t = instance->newRasterizer(d, glyphs); + } + else if (luax_istype(L, 1, DATA_T)) + { + Data *d = luax_checkdata(L, 1); + int size = luaL_checkint(L, 2); + t = instance->newRasterizer(d, size); + } + + luax_newtype(L, "Rasterizer", FONT_RASTERIZER_T, t); + return 1; +} + +int w_newGlyphData(lua_State *L) +{ + Rasterizer *r = luax_checkrasterizer(L, 1); + unsigned short g = (unsigned short)luaL_checkint(L, 2); + + GlyphData *t = instance->newGlyphData(r, g); + luax_newtype(L, "GlyphData", FONT_GLYPH_DATA_T, t); + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "newRasterizer", w_newRasterizer }, + { "newGlyphData", w_newGlyphData }, + { 0, 0 } +}; + +static const lua_CFunction types[] = +{ + luaopen_glyphdata, + luaopen_rasterizer, + 0 +}; + +extern "C" int luaopen_love_font(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new Font(); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "font"; + w.flags = MODULE_T; + w.functions = functions; + w.types = types; + + return luax_register_module(L, w); +} + +} // freetype +} // font +} // love diff --git a/src/modules/font/freetype/wrap_Font.h b/src/modules/font/freetype/wrap_Font.h index f2cb77390..04b89272b 100644 --- a/src/modules/font/freetype/wrap_Font.h +++ b/src/modules/font/freetype/wrap_Font.h @@ -1,43 +1,43 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FONT_FREETYPE_WRAP_FONT_H -#define LOVE_FONT_FREETYPE_WRAP_FONT_H - -// LOVE -#include "common/config.h" -#include "common/runtime.h" - -namespace love -{ -namespace font -{ -namespace freetype -{ - -int w_newRasterizer(lua_State *L); -int w_newGlyphData(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_font(lua_State *L); - -} // freetype -} // font -} // love - -#endif // LOVE_FONT_FREETYPE_WRAP_FONT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_FREETYPE_WRAP_FONT_H +#define LOVE_FONT_FREETYPE_WRAP_FONT_H + +// LOVE +#include "common/config.h" +#include "common/runtime.h" + +namespace love +{ +namespace font +{ +namespace freetype +{ + +int w_newRasterizer(lua_State *L); +int w_newGlyphData(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_font(lua_State *L); + +} // freetype +} // font +} // love + +#endif // LOVE_FONT_FREETYPE_WRAP_FONT_H diff --git a/src/modules/font/wrap_GlyphData.cpp b/src/modules/font/wrap_GlyphData.cpp index 16f9ca3be..30b647b16 100644 --- a/src/modules/font/wrap_GlyphData.cpp +++ b/src/modules/font/wrap_GlyphData.cpp @@ -1,46 +1,46 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_GlyphData.h" - -namespace love -{ -namespace font -{ - -GlyphData *luax_checkglyphdata(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "GlyphData", FONT_GLYPH_DATA_T); -} - -static const luaL_Reg functions[] = -{ - { "getPointer", w_Data_getPointer }, - { "getSize", w_Data_getSize }, - { 0, 0 } -}; - -extern "C" int luaopen_glyphdata(lua_State *L) -{ - return luax_register_type(L, "GlyphData", functions); -} - -} // font -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_GlyphData.h" + +namespace love +{ +namespace font +{ + +GlyphData *luax_checkglyphdata(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "GlyphData", FONT_GLYPH_DATA_T); +} + +static const luaL_Reg functions[] = +{ + { "getPointer", w_Data_getPointer }, + { "getSize", w_Data_getSize }, + { 0, 0 } +}; + +extern "C" int luaopen_glyphdata(lua_State *L) +{ + return luax_register_type(L, "GlyphData", functions); +} + +} // font +} // love diff --git a/src/modules/font/wrap_GlyphData.h b/src/modules/font/wrap_GlyphData.h index 3651b66c5..177f33184 100644 --- a/src/modules/font/wrap_GlyphData.h +++ b/src/modules/font/wrap_GlyphData.h @@ -1,41 +1,41 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FONT_WRAP_GLYPH_DATA_H -#define LOVE_FONT_WRAP_GLYPH_DATA_H - -// LOVE -#include "common/runtime.h" -#include "common/wrap_Data.h" - -#include "GlyphData.h" - -namespace love -{ -namespace font -{ - -GlyphData *luax_checkglyphdata(lua_State *L, int idx); -extern "C" int luaopen_glyphdata(lua_State *L); - -} // font -} // love - -#endif // LOVE_FONT_WRAP_GLYPH_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_WRAP_GLYPH_DATA_H +#define LOVE_FONT_WRAP_GLYPH_DATA_H + +// LOVE +#include "common/runtime.h" +#include "common/wrap_Data.h" + +#include "GlyphData.h" + +namespace love +{ +namespace font +{ + +GlyphData *luax_checkglyphdata(lua_State *L, int idx); +extern "C" int luaopen_glyphdata(lua_State *L); + +} // font +} // love + +#endif // LOVE_FONT_WRAP_GLYPH_DATA_H diff --git a/src/modules/font/wrap_Rasterizer.cpp b/src/modules/font/wrap_Rasterizer.cpp index e3cc04c74..86a4839aa 100644 --- a/src/modules/font/wrap_Rasterizer.cpp +++ b/src/modules/font/wrap_Rasterizer.cpp @@ -1,46 +1,46 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Rasterizer.h" - -#include "common/wrap_Data.h" - -namespace love -{ -namespace font -{ - -Rasterizer *luax_checkrasterizer(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Rasterizer", FONT_RASTERIZER_T); -} - -static const luaL_Reg functions[] = -{ - { 0, 0 } -}; - -extern "C" int luaopen_rasterizer(lua_State *L) -{ - return luax_register_type(L, "Rasterizer", functions); -} - -} // font -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Rasterizer.h" + +#include "common/wrap_Data.h" + +namespace love +{ +namespace font +{ + +Rasterizer *luax_checkrasterizer(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Rasterizer", FONT_RASTERIZER_T); +} + +static const luaL_Reg functions[] = +{ + { 0, 0 } +}; + +extern "C" int luaopen_rasterizer(lua_State *L) +{ + return luax_register_type(L, "Rasterizer", functions); +} + +} // font +} // love diff --git a/src/modules/font/wrap_Rasterizer.h b/src/modules/font/wrap_Rasterizer.h index 2215eb5f2..0b665d2b2 100644 --- a/src/modules/font/wrap_Rasterizer.h +++ b/src/modules/font/wrap_Rasterizer.h @@ -1,39 +1,39 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_FONT_WRAP_RASTERIZER_H -#define LOVE_FONT_WRAP_RASTERIZER_H - -// LOVE -#include "common/runtime.h" -#include "Rasterizer.h" - -namespace love -{ -namespace font -{ - -Rasterizer *luax_checkrasterizer(lua_State *L, int idx); -extern "C" int luaopen_rasterizer(lua_State *L); - -} // font -} // love - -#endif // LOVE_FONT_WRAP_RASTERIZER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_FONT_WRAP_RASTERIZER_H +#define LOVE_FONT_WRAP_RASTERIZER_H + +// LOVE +#include "common/runtime.h" +#include "Rasterizer.h" + +namespace love +{ +namespace font +{ + +Rasterizer *luax_checkrasterizer(lua_State *L, int idx); +extern "C" int luaopen_rasterizer(lua_State *L); + +} // font +} // love + +#endif // LOVE_FONT_WRAP_RASTERIZER_H diff --git a/src/modules/graphics/Color.h b/src/modules/graphics/Color.h index 235a0e59a..1019e0cd5 100644 --- a/src/modules/graphics/Color.h +++ b/src/modules/graphics/Color.h @@ -1,109 +1,109 @@ -/** - * Copyright (c) 2006-2011 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_COLOR_H -#define LOVE_GRAPHICS_COLOR_H - -namespace love -{ -namespace graphics -{ - -template -struct ColorT -{ - T r; - T g; - T b; - T a; - - ColorT() : r(0), g(0), b(0), a(0) {} - ColorT(T r_, T g_, T b_, T a_) : r(r_), g(g_), b(b_), a(a_) {} - void set(T r_, T g_, T b_, T a_) - { - r = r_; - g = g_; - b = b_; - a = a_; - } - - ColorT operator+=(const ColorT &other); - ColorT operator*=(T s); - ColorT operator/=(T s); -}; - -template -ColorT ColorT::operator+=(const ColorT &other) -{ - r += other.r; - g += other.g; - b += other.b; - a += other.a; - return *this; -} - -template -ColorT ColorT::operator*=(T s) -{ - r *= s; - g *= s; - b *= s; - a *= s; - return *this; -} - -template -ColorT ColorT::operator/=(T s) -{ - r /= s; - g /= s; - b /= s; - a /= s; - return *this; -} - -template -ColorT operator+(const ColorT &a, const ColorT &b) -{ - ColorT tmp(a); - return tmp += b; -} - -template -ColorT operator*(const ColorT &a, T s) -{ - ColorT tmp(a); - return tmp *= s; -} - -template -ColorT operator/(const ColorT &a, T s) -{ - ColorT tmp(a); - return tmp /= s; -} - -typedef ColorT Color; -typedef ColorT Colorf; - -} // graphics -} // love - -#endif // LOVE_GRAPHICS_COLOR_H +/** + * Copyright (c) 2006-2011 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_COLOR_H +#define LOVE_GRAPHICS_COLOR_H + +namespace love +{ +namespace graphics +{ + +template +struct ColorT +{ + T r; + T g; + T b; + T a; + + ColorT() : r(0), g(0), b(0), a(0) {} + ColorT(T r_, T g_, T b_, T a_) : r(r_), g(g_), b(b_), a(a_) {} + void set(T r_, T g_, T b_, T a_) + { + r = r_; + g = g_; + b = b_; + a = a_; + } + + ColorT operator+=(const ColorT &other); + ColorT operator*=(T s); + ColorT operator/=(T s); +}; + +template +ColorT ColorT::operator+=(const ColorT &other) +{ + r += other.r; + g += other.g; + b += other.b; + a += other.a; + return *this; +} + +template +ColorT ColorT::operator*=(T s) +{ + r *= s; + g *= s; + b *= s; + a *= s; + return *this; +} + +template +ColorT ColorT::operator/=(T s) +{ + r /= s; + g /= s; + b /= s; + a /= s; + return *this; +} + +template +ColorT operator+(const ColorT &a, const ColorT &b) +{ + ColorT tmp(a); + return tmp += b; +} + +template +ColorT operator*(const ColorT &a, T s) +{ + ColorT tmp(a); + return tmp *= s; +} + +template +ColorT operator/(const ColorT &a, T s) +{ + ColorT tmp(a); + return tmp /= s; +} + +typedef ColorT Color; +typedef ColorT Colorf; + +} // graphics +} // love + +#endif // LOVE_GRAPHICS_COLOR_H diff --git a/src/modules/graphics/DrawQable.cpp b/src/modules/graphics/DrawQable.cpp index 98ca52a07..88eee68d7 100644 --- a/src/modules/graphics/DrawQable.cpp +++ b/src/modules/graphics/DrawQable.cpp @@ -1,33 +1,33 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "DrawQable.h" - -namespace love -{ -namespace graphics -{ - -DrawQable::~DrawQable() -{ -} - -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "DrawQable.h" + +namespace love +{ +namespace graphics +{ + +DrawQable::~DrawQable() +{ +} + +} // graphics +} // love diff --git a/src/modules/graphics/DrawQable.h b/src/modules/graphics/DrawQable.h index 51854c104..515d274e3 100644 --- a/src/modules/graphics/DrawQable.h +++ b/src/modules/graphics/DrawQable.h @@ -1,65 +1,65 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_DRAWQABLE_H -#define LOVE_GRAPHICS_DRAWQABLE_H - -// LOVE -#include "Drawable.h" -#include "Quad.h" - -namespace love -{ -namespace graphics -{ - -/** - * A DrawQable is anything that be drawn in part with a Quad. - **/ -class DrawQable : public Drawable -{ -public: - - /** - * Destructor. - **/ - virtual ~DrawQable(); - - /** - * Draws the object with the specified transformation. - * - * @param quad The Quad to use to draw the object. - * @param x The position of the object along the x-axis. - * @param y The position of the object along the y-axis. - * @param angle The angle of the object (in radians). - * @param sx The scale factor along the x-axis. - * @param sy The scale factor along the y-axis. - * @param ox The origin offset along the x-axis. - * @param oy The origin offset along the y-axis. - * @param kx Shear along the x-axis. - * @param ky Shear along the y-axis. - **/ - virtual void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const = 0; -}; - -} // graphics -} // love - -#endif // LOVE_GRAPHICS_DRAWQABLE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_DRAWQABLE_H +#define LOVE_GRAPHICS_DRAWQABLE_H + +// LOVE +#include "Drawable.h" +#include "Quad.h" + +namespace love +{ +namespace graphics +{ + +/** + * A DrawQable is anything that be drawn in part with a Quad. + **/ +class DrawQable : public Drawable +{ +public: + + /** + * Destructor. + **/ + virtual ~DrawQable(); + + /** + * Draws the object with the specified transformation. + * + * @param quad The Quad to use to draw the object. + * @param x The position of the object along the x-axis. + * @param y The position of the object along the y-axis. + * @param angle The angle of the object (in radians). + * @param sx The scale factor along the x-axis. + * @param sy The scale factor along the y-axis. + * @param ox The origin offset along the x-axis. + * @param oy The origin offset along the y-axis. + * @param kx Shear along the x-axis. + * @param ky Shear along the y-axis. + **/ + virtual void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const = 0; +}; + +} // graphics +} // love + +#endif // LOVE_GRAPHICS_DRAWQABLE_H diff --git a/src/modules/graphics/Drawable.cpp b/src/modules/graphics/Drawable.cpp index 6f504f433..921317274 100644 --- a/src/modules/graphics/Drawable.cpp +++ b/src/modules/graphics/Drawable.cpp @@ -1,33 +1,33 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Drawable.h" - -namespace love -{ -namespace graphics -{ - -Drawable::~Drawable() -{ -} - -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Drawable.h" + +namespace love +{ +namespace graphics +{ + +Drawable::~Drawable() +{ +} + +} // graphics +} // love diff --git a/src/modules/graphics/Drawable.h b/src/modules/graphics/Drawable.h index 4dfe01503..9d70abd40 100644 --- a/src/modules/graphics/Drawable.h +++ b/src/modules/graphics/Drawable.h @@ -1,64 +1,64 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_DRAWABLE_H -#define LOVE_GRAPHICS_DRAWABLE_H - -// LOVE -#include "common/Object.h" - -namespace love -{ -namespace graphics -{ - -/** - * A Drawable is anything that can be drawn on screen with a - * position, scale and orientation. - **/ -class Drawable : public Object -{ -public: - - /** - * Destructor. - **/ - virtual ~Drawable(); - - /** - * Draws the object with the specified transformation. - * - * @param x The position of the object along the x-axis. - * @param y The position of the object along the y-axis. - * @param angle The angle of the object (in radians). - * @param sx The scale factor along the x-axis. - * @param sy The scale factor along the y-axis. - * @param ox The origin offset along the x-axis. - * @param oy The origin offset along the y-axis. - * @param kx Shear along the x-axis. - * @param ky Shear along the y-axis. - **/ - virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const = 0; -}; - -} // graphics -} // love - -#endif // LOVE_GRAPHICS_DRAWABLE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_DRAWABLE_H +#define LOVE_GRAPHICS_DRAWABLE_H + +// LOVE +#include "common/Object.h" + +namespace love +{ +namespace graphics +{ + +/** + * A Drawable is anything that can be drawn on screen with a + * position, scale and orientation. + **/ +class Drawable : public Object +{ +public: + + /** + * Destructor. + **/ + virtual ~Drawable(); + + /** + * Draws the object with the specified transformation. + * + * @param x The position of the object along the x-axis. + * @param y The position of the object along the y-axis. + * @param angle The angle of the object (in radians). + * @param sx The scale factor along the x-axis. + * @param sy The scale factor along the y-axis. + * @param ox The origin offset along the x-axis. + * @param oy The origin offset along the y-axis. + * @param kx Shear along the x-axis. + * @param ky Shear along the y-axis. + **/ + virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const = 0; +}; + +} // graphics +} // love + +#endif // LOVE_GRAPHICS_DRAWABLE_H diff --git a/src/modules/graphics/Graphics.cpp b/src/modules/graphics/Graphics.cpp index 2e0867019..c55bb5d6b 100644 --- a/src/modules/graphics/Graphics.cpp +++ b/src/modules/graphics/Graphics.cpp @@ -1,166 +1,166 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Graphics.h" - -namespace love -{ -namespace graphics -{ - -Graphics::~Graphics() -{ -} - -bool Graphics::getConstant(const char *in, DrawMode &out) -{ - return drawModes.find(in, out); -} - -bool Graphics::getConstant(DrawMode in, const char *&out) -{ - return drawModes.find(in, out); -} - -bool Graphics::getConstant(const char *in, AlignMode &out) -{ - return alignModes.find(in, out); -} - -bool Graphics::getConstant(AlignMode in, const char *&out) -{ - return alignModes.find(in, out); -} - -bool Graphics::getConstant(const char *in, BlendMode &out) -{ - return blendModes.find(in, out); -} - -bool Graphics::getConstant(BlendMode in, const char *&out) -{ - return blendModes.find(in, out); -} - -bool Graphics::getConstant(const char *in, ColorMode &out) -{ - return colorModes.find(in, out); -} - -bool Graphics::getConstant(ColorMode in, const char *&out) -{ - return colorModes.find(in, out); -} - -bool Graphics::getConstant(const char *in, LineStyle &out) -{ - return lineStyles.find(in, out); -} - -bool Graphics::getConstant(LineStyle in, const char *&out) -{ - return lineStyles.find(in, out); -} - -bool Graphics::getConstant(const char *in, PointStyle &out) -{ - return pointStyles.find(in, out); -} - -bool Graphics::getConstant(PointStyle in, const char *&out) -{ - return pointStyles.find(in, out); -} - -bool Graphics::getConstant(const char *in, Support &out) -{ - return support.find(in, out); -} - -bool Graphics::getConstant(Support in, const char *&out) -{ - return support.find(in, out); -} - -StringMap::Entry Graphics::drawModeEntries[] = -{ - { "line", Graphics::DRAW_LINE }, - { "fill", Graphics::DRAW_FILL }, -}; - -StringMap Graphics::drawModes(Graphics::drawModeEntries, sizeof(Graphics::drawModeEntries)); - -StringMap::Entry Graphics::alignModeEntries[] = -{ - { "left", Graphics::ALIGN_LEFT }, - { "right", Graphics::ALIGN_RIGHT }, - { "center", Graphics::ALIGN_CENTER }, -}; - -StringMap Graphics::alignModes(Graphics::alignModeEntries, sizeof(Graphics::alignModeEntries)); - -StringMap::Entry Graphics::blendModeEntries[] = -{ - { "alpha", Graphics::BLEND_ALPHA }, - { "additive", Graphics::BLEND_ADDITIVE }, - { "subtractive", Graphics::BLEND_SUBTRACTIVE }, - { "multiplicative", Graphics::BLEND_MULTIPLICATIVE }, - { "premultiplied", Graphics::BLEND_PREMULTIPLIED }, -}; - -StringMap Graphics::blendModes(Graphics::blendModeEntries, sizeof(Graphics::blendModeEntries)); - -StringMap::Entry Graphics::colorModeEntries[] = -{ - { "replace", Graphics::COLOR_REPLACE }, - { "modulate", Graphics::COLOR_MODULATE }, - { "combine", Graphics::COLOR_COMBINE }, -}; - -StringMap Graphics::colorModes(Graphics::colorModeEntries, sizeof(Graphics::colorModeEntries)); - -StringMap::Entry Graphics::lineStyleEntries[] = -{ - { "smooth", Graphics::LINE_SMOOTH }, - { "rough", Graphics::LINE_ROUGH } -}; - -StringMap Graphics::lineStyles(Graphics::lineStyleEntries, sizeof(Graphics::lineStyleEntries)); - -StringMap::Entry Graphics::pointStyleEntries[] = -{ - { "smooth", Graphics::POINT_SMOOTH }, - { "rough", Graphics::POINT_ROUGH } -}; - -StringMap Graphics::pointStyles(Graphics::pointStyleEntries, sizeof(Graphics::pointStyleEntries)); - -StringMap::Entry Graphics::supportEntries[] = -{ - { "canvas", Graphics::SUPPORT_CANVAS }, - { "pixeleffect", Graphics::SUPPORT_PIXELEFFECT }, - { "npot", Graphics::SUPPORT_NPOT }, - { "subtractive", Graphics::SUPPORT_SUBTRACTIVE }, -}; - -StringMap Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries)); - -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Graphics.h" + +namespace love +{ +namespace graphics +{ + +Graphics::~Graphics() +{ +} + +bool Graphics::getConstant(const char *in, DrawMode &out) +{ + return drawModes.find(in, out); +} + +bool Graphics::getConstant(DrawMode in, const char *&out) +{ + return drawModes.find(in, out); +} + +bool Graphics::getConstant(const char *in, AlignMode &out) +{ + return alignModes.find(in, out); +} + +bool Graphics::getConstant(AlignMode in, const char *&out) +{ + return alignModes.find(in, out); +} + +bool Graphics::getConstant(const char *in, BlendMode &out) +{ + return blendModes.find(in, out); +} + +bool Graphics::getConstant(BlendMode in, const char *&out) +{ + return blendModes.find(in, out); +} + +bool Graphics::getConstant(const char *in, ColorMode &out) +{ + return colorModes.find(in, out); +} + +bool Graphics::getConstant(ColorMode in, const char *&out) +{ + return colorModes.find(in, out); +} + +bool Graphics::getConstant(const char *in, LineStyle &out) +{ + return lineStyles.find(in, out); +} + +bool Graphics::getConstant(LineStyle in, const char *&out) +{ + return lineStyles.find(in, out); +} + +bool Graphics::getConstant(const char *in, PointStyle &out) +{ + return pointStyles.find(in, out); +} + +bool Graphics::getConstant(PointStyle in, const char *&out) +{ + return pointStyles.find(in, out); +} + +bool Graphics::getConstant(const char *in, Support &out) +{ + return support.find(in, out); +} + +bool Graphics::getConstant(Support in, const char *&out) +{ + return support.find(in, out); +} + +StringMap::Entry Graphics::drawModeEntries[] = +{ + { "line", Graphics::DRAW_LINE }, + { "fill", Graphics::DRAW_FILL }, +}; + +StringMap Graphics::drawModes(Graphics::drawModeEntries, sizeof(Graphics::drawModeEntries)); + +StringMap::Entry Graphics::alignModeEntries[] = +{ + { "left", Graphics::ALIGN_LEFT }, + { "right", Graphics::ALIGN_RIGHT }, + { "center", Graphics::ALIGN_CENTER }, +}; + +StringMap Graphics::alignModes(Graphics::alignModeEntries, sizeof(Graphics::alignModeEntries)); + +StringMap::Entry Graphics::blendModeEntries[] = +{ + { "alpha", Graphics::BLEND_ALPHA }, + { "additive", Graphics::BLEND_ADDITIVE }, + { "subtractive", Graphics::BLEND_SUBTRACTIVE }, + { "multiplicative", Graphics::BLEND_MULTIPLICATIVE }, + { "premultiplied", Graphics::BLEND_PREMULTIPLIED }, +}; + +StringMap Graphics::blendModes(Graphics::blendModeEntries, sizeof(Graphics::blendModeEntries)); + +StringMap::Entry Graphics::colorModeEntries[] = +{ + { "replace", Graphics::COLOR_REPLACE }, + { "modulate", Graphics::COLOR_MODULATE }, + { "combine", Graphics::COLOR_COMBINE }, +}; + +StringMap Graphics::colorModes(Graphics::colorModeEntries, sizeof(Graphics::colorModeEntries)); + +StringMap::Entry Graphics::lineStyleEntries[] = +{ + { "smooth", Graphics::LINE_SMOOTH }, + { "rough", Graphics::LINE_ROUGH } +}; + +StringMap Graphics::lineStyles(Graphics::lineStyleEntries, sizeof(Graphics::lineStyleEntries)); + +StringMap::Entry Graphics::pointStyleEntries[] = +{ + { "smooth", Graphics::POINT_SMOOTH }, + { "rough", Graphics::POINT_ROUGH } +}; + +StringMap Graphics::pointStyles(Graphics::pointStyleEntries, sizeof(Graphics::pointStyleEntries)); + +StringMap::Entry Graphics::supportEntries[] = +{ + { "canvas", Graphics::SUPPORT_CANVAS }, + { "pixeleffect", Graphics::SUPPORT_PIXELEFFECT }, + { "npot", Graphics::SUPPORT_NPOT }, + { "subtractive", Graphics::SUPPORT_SUBTRACTIVE }, +}; + +StringMap Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries)); + +} // graphics +} // love diff --git a/src/modules/graphics/Graphics.h b/src/modules/graphics/Graphics.h index dfda6d25e..1325d94ce 100644 --- a/src/modules/graphics/Graphics.h +++ b/src/modules/graphics/Graphics.h @@ -1,144 +1,144 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_GRAPHICS_H -#define LOVE_GRAPHICS_GRAPHICS_H - -// LOVE -#include "common/Module.h" -#include "common/StringMap.h" - -namespace love -{ -namespace graphics -{ - -class Graphics : public Module -{ -public: - - enum DrawMode - { - DRAW_LINE = 1, - DRAW_FILL, - DRAW_MAX_ENUM - }; - - enum AlignMode - { - ALIGN_LEFT = 1, - ALIGN_CENTER, - ALIGN_RIGHT, - ALIGN_MAX_ENUM - }; - - enum BlendMode - { - BLEND_ALPHA = 1, - BLEND_ADDITIVE, - BLEND_SUBTRACTIVE, - BLEND_MULTIPLICATIVE, - BLEND_PREMULTIPLIED, - BLEND_MAX_ENUM - }; - - enum ColorMode - { - COLOR_MODULATE = 1, - COLOR_REPLACE, - COLOR_COMBINE, - COLOR_MAX_ENUM - }; - - enum LineStyle - { - LINE_ROUGH = 1, - LINE_SMOOTH, - LINE_MAX_ENUM - }; - - enum PointStyle - { - POINT_ROUGH = 1, - POINT_SMOOTH, - POINT_MAX_ENUM - }; - - enum Support - { - SUPPORT_CANVAS = 1, - SUPPORT_PIXELEFFECT, - SUPPORT_NPOT, - SUPPORT_SUBTRACTIVE, - SUPPORT_MAX_ENUM - }; - - virtual ~Graphics(); - - static bool getConstant(const char *in, DrawMode &out); - static bool getConstant(DrawMode in, const char *&out); - - static bool getConstant(const char *in, AlignMode &out); - static bool getConstant(AlignMode in, const char *&out); - - static bool getConstant(const char *in, BlendMode &out); - static bool getConstant(BlendMode in, const char *&out); - - static bool getConstant(const char *in, ColorMode &out); - static bool getConstant(ColorMode in, const char *&out); - - static bool getConstant(const char *in, LineStyle &out); - static bool getConstant(LineStyle in, const char *&out); - - static bool getConstant(const char *in, PointStyle &out); - static bool getConstant(PointStyle in, const char *&out); - - static bool getConstant(const char *in, Support &out); - static bool getConstant(Support in, const char *&out); - -private: - - static StringMap::Entry drawModeEntries[]; - static StringMap drawModes; - - static StringMap::Entry alignModeEntries[]; - static StringMap alignModes; - - static StringMap::Entry blendModeEntries[]; - static StringMap blendModes; - - static StringMap::Entry colorModeEntries[]; - static StringMap colorModes; - - static StringMap::Entry lineStyleEntries[]; - static StringMap lineStyles; - - static StringMap::Entry pointStyleEntries[]; - static StringMap pointStyles; - - static StringMap::Entry supportEntries[]; - static StringMap support; - -}; // Graphics - -} // graphics -} // love - -#endif // LOVE_GRAPHICS_GRAPHICS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_GRAPHICS_H +#define LOVE_GRAPHICS_GRAPHICS_H + +// LOVE +#include "common/Module.h" +#include "common/StringMap.h" + +namespace love +{ +namespace graphics +{ + +class Graphics : public Module +{ +public: + + enum DrawMode + { + DRAW_LINE = 1, + DRAW_FILL, + DRAW_MAX_ENUM + }; + + enum AlignMode + { + ALIGN_LEFT = 1, + ALIGN_CENTER, + ALIGN_RIGHT, + ALIGN_MAX_ENUM + }; + + enum BlendMode + { + BLEND_ALPHA = 1, + BLEND_ADDITIVE, + BLEND_SUBTRACTIVE, + BLEND_MULTIPLICATIVE, + BLEND_PREMULTIPLIED, + BLEND_MAX_ENUM + }; + + enum ColorMode + { + COLOR_MODULATE = 1, + COLOR_REPLACE, + COLOR_COMBINE, + COLOR_MAX_ENUM + }; + + enum LineStyle + { + LINE_ROUGH = 1, + LINE_SMOOTH, + LINE_MAX_ENUM + }; + + enum PointStyle + { + POINT_ROUGH = 1, + POINT_SMOOTH, + POINT_MAX_ENUM + }; + + enum Support + { + SUPPORT_CANVAS = 1, + SUPPORT_PIXELEFFECT, + SUPPORT_NPOT, + SUPPORT_SUBTRACTIVE, + SUPPORT_MAX_ENUM + }; + + virtual ~Graphics(); + + static bool getConstant(const char *in, DrawMode &out); + static bool getConstant(DrawMode in, const char *&out); + + static bool getConstant(const char *in, AlignMode &out); + static bool getConstant(AlignMode in, const char *&out); + + static bool getConstant(const char *in, BlendMode &out); + static bool getConstant(BlendMode in, const char *&out); + + static bool getConstant(const char *in, ColorMode &out); + static bool getConstant(ColorMode in, const char *&out); + + static bool getConstant(const char *in, LineStyle &out); + static bool getConstant(LineStyle in, const char *&out); + + static bool getConstant(const char *in, PointStyle &out); + static bool getConstant(PointStyle in, const char *&out); + + static bool getConstant(const char *in, Support &out); + static bool getConstant(Support in, const char *&out); + +private: + + static StringMap::Entry drawModeEntries[]; + static StringMap drawModes; + + static StringMap::Entry alignModeEntries[]; + static StringMap alignModes; + + static StringMap::Entry blendModeEntries[]; + static StringMap blendModes; + + static StringMap::Entry colorModeEntries[]; + static StringMap colorModes; + + static StringMap::Entry lineStyleEntries[]; + static StringMap lineStyles; + + static StringMap::Entry pointStyleEntries[]; + static StringMap pointStyles; + + static StringMap::Entry supportEntries[]; + static StringMap support; + +}; // Graphics + +} // graphics +} // love + +#endif // LOVE_GRAPHICS_GRAPHICS_H diff --git a/src/modules/graphics/Image.cpp b/src/modules/graphics/Image.cpp index 7a4f0e3d6..fa9a105aa 100644 --- a/src/modules/graphics/Image.cpp +++ b/src/modules/graphics/Image.cpp @@ -1,82 +1,82 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Image.h" - -namespace love -{ -namespace graphics -{ - -Image::Filter::Filter() - : min(FILTER_LINEAR) - , mag(FILTER_LINEAR) -{ -} - -Image::Wrap::Wrap() - : s(WRAP_CLAMP) - , t(WRAP_CLAMP) -{ -} - -Image::~Image() -{ -} - -bool Image::getConstant(const char *in, FilterMode &out) -{ - return filterModes.find(in, out); -} - -bool Image::getConstant(FilterMode in, const char *&out) -{ - return filterModes.find(in, out); -} - -bool Image::getConstant(const char *in, WrapMode &out) -{ - return wrapModes.find(in, out); -} - -bool Image::getConstant(WrapMode in, const char *&out) -{ - return wrapModes.find(in, out); -} - -StringMap::Entry Image::filterModeEntries[] = -{ - { "linear", Image::FILTER_LINEAR }, - { "nearest", Image::FILTER_NEAREST }, -}; - -StringMap Image::filterModes(Image::filterModeEntries, sizeof(Image::filterModeEntries)); - -StringMap::Entry Image::wrapModeEntries[] = -{ - { "clamp", Image::WRAP_CLAMP }, - { "repeat", Image::WRAP_REPEAT }, -}; - -StringMap Image::wrapModes(Image::wrapModeEntries, sizeof(Image::wrapModeEntries)); - - -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Image.h" + +namespace love +{ +namespace graphics +{ + +Image::Filter::Filter() + : min(FILTER_LINEAR) + , mag(FILTER_LINEAR) +{ +} + +Image::Wrap::Wrap() + : s(WRAP_CLAMP) + , t(WRAP_CLAMP) +{ +} + +Image::~Image() +{ +} + +bool Image::getConstant(const char *in, FilterMode &out) +{ + return filterModes.find(in, out); +} + +bool Image::getConstant(FilterMode in, const char *&out) +{ + return filterModes.find(in, out); +} + +bool Image::getConstant(const char *in, WrapMode &out) +{ + return wrapModes.find(in, out); +} + +bool Image::getConstant(WrapMode in, const char *&out) +{ + return wrapModes.find(in, out); +} + +StringMap::Entry Image::filterModeEntries[] = +{ + { "linear", Image::FILTER_LINEAR }, + { "nearest", Image::FILTER_NEAREST }, +}; + +StringMap Image::filterModes(Image::filterModeEntries, sizeof(Image::filterModeEntries)); + +StringMap::Entry Image::wrapModeEntries[] = +{ + { "clamp", Image::WRAP_CLAMP }, + { "repeat", Image::WRAP_REPEAT }, +}; + +StringMap Image::wrapModes(Image::wrapModeEntries, sizeof(Image::wrapModeEntries)); + + +} // graphics +} // love diff --git a/src/modules/graphics/Image.h b/src/modules/graphics/Image.h index a8e871a8b..5e060616c 100644 --- a/src/modules/graphics/Image.h +++ b/src/modules/graphics/Image.h @@ -1,85 +1,85 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_IMAGE_H -#define LOVE_GRAPHICS_IMAGE_H - -// LOVE -#include "graphics/Volatile.h" -#include "graphics/DrawQable.h" -#include "common/StringMap.h" - -namespace love -{ -namespace graphics -{ - -class Image : public DrawQable, public Volatile -{ -public: - - enum WrapMode - { - WRAP_CLAMP = 1, - WRAP_REPEAT, - WRAP_MAX_ENUM - }; - - enum FilterMode - { - FILTER_LINEAR = 1, - FILTER_NEAREST, - FILTER_MAX_ENUM - }; - - struct Filter - { - Filter(); - FilterMode min; - FilterMode mag; - }; - - struct Wrap - { - Wrap(); - WrapMode s; - WrapMode t; - }; - - virtual ~Image(); - - static bool getConstant(const char *in, FilterMode &out); - static bool getConstant(FilterMode in, const char *&out); - static bool getConstant(const char *in, WrapMode &out); - static bool getConstant(WrapMode in, const char *&out); - -private: - - static StringMap::Entry filterModeEntries[]; - static StringMap filterModes; - static StringMap::Entry wrapModeEntries[]; - static StringMap wrapModes; - -}; // Image - -} // graphics -} // love - -#endif // LOVE_GRAPHICS_IMAGE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_IMAGE_H +#define LOVE_GRAPHICS_IMAGE_H + +// LOVE +#include "graphics/Volatile.h" +#include "graphics/DrawQable.h" +#include "common/StringMap.h" + +namespace love +{ +namespace graphics +{ + +class Image : public DrawQable, public Volatile +{ +public: + + enum WrapMode + { + WRAP_CLAMP = 1, + WRAP_REPEAT, + WRAP_MAX_ENUM + }; + + enum FilterMode + { + FILTER_LINEAR = 1, + FILTER_NEAREST, + FILTER_MAX_ENUM + }; + + struct Filter + { + Filter(); + FilterMode min; + FilterMode mag; + }; + + struct Wrap + { + Wrap(); + WrapMode s; + WrapMode t; + }; + + virtual ~Image(); + + static bool getConstant(const char *in, FilterMode &out); + static bool getConstant(FilterMode in, const char *&out); + static bool getConstant(const char *in, WrapMode &out); + static bool getConstant(WrapMode in, const char *&out); + +private: + + static StringMap::Entry filterModeEntries[]; + static StringMap filterModes; + static StringMap::Entry wrapModeEntries[]; + static StringMap wrapModes; + +}; // Image + +} // graphics +} // love + +#endif // LOVE_GRAPHICS_IMAGE_H diff --git a/src/modules/graphics/Quad.cpp b/src/modules/graphics/Quad.cpp index d86925451..b1b6aacc6 100644 --- a/src/modules/graphics/Quad.cpp +++ b/src/modules/graphics/Quad.cpp @@ -1,37 +1,37 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Quad.h" - -namespace love -{ -namespace graphics -{ - -Quad::Quad() -{ -} - -Quad::~Quad() -{ -} - -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Quad.h" + +namespace love +{ +namespace graphics +{ + +Quad::Quad() +{ +} + +Quad::~Quad() +{ +} + +} // graphics +} // love diff --git a/src/modules/graphics/Quad.h b/src/modules/graphics/Quad.h index a617ccad9..341bc224d 100644 --- a/src/modules/graphics/Quad.h +++ b/src/modules/graphics/Quad.h @@ -1,66 +1,66 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_QUAD_H -#define LOVE_GRAPHICS_QUAD_H - -// LOVE -#include "common/Object.h" -#include "common/math.h" - -namespace love -{ -namespace graphics -{ - -class Quad : public Object -{ -public: - - struct Viewport - { - float x, y, w, h; - }; - - Quad(); - - virtual ~Quad(); - - virtual void refresh(const Viewport &v, float sw, float sh) = 0; - - virtual void setViewport(const Viewport &v) = 0; - virtual Viewport getViewport() const = 0; - - virtual void flip(bool x, bool y) = 0; - - /** - * Mirror texture coordinates around 0.5 - */ - virtual void mirror(bool x, bool y) = 0; - - /** - * Gets a pointer to the vertices. - **/ - virtual const vertex *getVertices() const = 0; -}; -} // graphics -} // love - -#endif // LOVE_GRAPHICS_QUAD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_QUAD_H +#define LOVE_GRAPHICS_QUAD_H + +// LOVE +#include "common/Object.h" +#include "common/math.h" + +namespace love +{ +namespace graphics +{ + +class Quad : public Object +{ +public: + + struct Viewport + { + float x, y, w, h; + }; + + Quad(); + + virtual ~Quad(); + + virtual void refresh(const Viewport &v, float sw, float sh) = 0; + + virtual void setViewport(const Viewport &v) = 0; + virtual Viewport getViewport() const = 0; + + virtual void flip(bool x, bool y) = 0; + + /** + * Mirror texture coordinates around 0.5 + */ + virtual void mirror(bool x, bool y) = 0; + + /** + * Gets a pointer to the vertices. + **/ + virtual const vertex *getVertices() const = 0; +}; +} // graphics +} // love + +#endif // LOVE_GRAPHICS_QUAD_H diff --git a/src/modules/graphics/Volatile.cpp b/src/modules/graphics/Volatile.cpp index ae3e4635f..14aa0d834 100644 --- a/src/modules/graphics/Volatile.cpp +++ b/src/modules/graphics/Volatile.cpp @@ -1,69 +1,69 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Volatile.h" - -namespace love -{ -namespace graphics -{ - -// Static members. -std::list Volatile::all; - -Volatile::Volatile() -{ - // Insert this object into "all". - all.push_back(this); -} - -Volatile::~Volatile() -{ - // Remove the pointer to this object. - all.remove(this); -} - -bool Volatile::loadAll() -{ - bool success = true; - std::list::iterator i = all.begin(); - - while (i != all.end()) - { - success = success && (*i)->loadVolatile(); - i++; - } - - return success; -} - -void Volatile::unloadAll() -{ - std::list::iterator i = all.begin(); - - while (i != all.end()) - { - (*i)->unloadVolatile(); - i++; - } -} - -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Volatile.h" + +namespace love +{ +namespace graphics +{ + +// Static members. +std::list Volatile::all; + +Volatile::Volatile() +{ + // Insert this object into "all". + all.push_back(this); +} + +Volatile::~Volatile() +{ + // Remove the pointer to this object. + all.remove(this); +} + +bool Volatile::loadAll() +{ + bool success = true; + std::list::iterator i = all.begin(); + + while (i != all.end()) + { + success = success && (*i)->loadVolatile(); + i++; + } + + return success; +} + +void Volatile::unloadAll() +{ + std::list::iterator i = all.begin(); + + while (i != all.end()) + { + (*i)->unloadVolatile(); + i++; + } +} + +} // graphics +} // love diff --git a/src/modules/graphics/Volatile.h b/src/modules/graphics/Volatile.h index 294aa8b38..c1cfd7a97 100644 --- a/src/modules/graphics/Volatile.h +++ b/src/modules/graphics/Volatile.h @@ -1,93 +1,93 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_VOLATILE_H -#define LOVE_GRAPHICS_VOLATILE_H - -// STL -#include - -namespace love -{ -namespace graphics -{ - -/** - * This class is the superclass of all objects which must completely or - * partially reload when the user changes the display resolution. All - * volatile objects will be notified when the display mode changes. - * - * @author Anders Ruud - **/ -class Volatile -{ -private: - - // A list of all Volatile object currently alive. - static std::list all; - -public: - - /** - * Constructor. Automatically adds \c this into the list - * of volatile objects. - **/ - Volatile(); - - /** - * Destructor. Removes \c this from the list of volatile - * objects. - **/ - virtual ~Volatile(); - - /** - * Loads the part(s) of the object which is destroyed when - * the display mode is changed. - * - * @return True if successful, false on errors. - **/ - virtual bool loadVolatile() = 0; - - /** - * Unloads the part(s) of the objects which would be destroyed - * anyway when the display mode is changed. - **/ - virtual void unloadVolatile() = 0; - - // Static: - - /** - * Calls \c loadVolatile() on each element in the list of volatiles. - * - * @return True if all elements succeeded, false if one or more failed. - **/ - static bool loadAll(); - - /** - * Calls \c unloadVolatile() on each element in the list of volatiles. - **/ - static void unloadAll(); - -}; // Volatile - -} // graphics -} // love - -#endif // LOVE_GRAPHICS_VOLATILE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_VOLATILE_H +#define LOVE_GRAPHICS_VOLATILE_H + +// STL +#include + +namespace love +{ +namespace graphics +{ + +/** + * This class is the superclass of all objects which must completely or + * partially reload when the user changes the display resolution. All + * volatile objects will be notified when the display mode changes. + * + * @author Anders Ruud + **/ +class Volatile +{ +private: + + // A list of all Volatile object currently alive. + static std::list all; + +public: + + /** + * Constructor. Automatically adds \c this into the list + * of volatile objects. + **/ + Volatile(); + + /** + * Destructor. Removes \c this from the list of volatile + * objects. + **/ + virtual ~Volatile(); + + /** + * Loads the part(s) of the object which is destroyed when + * the display mode is changed. + * + * @return True if successful, false on errors. + **/ + virtual bool loadVolatile() = 0; + + /** + * Unloads the part(s) of the objects which would be destroyed + * anyway when the display mode is changed. + **/ + virtual void unloadVolatile() = 0; + + // Static: + + /** + * Calls \c loadVolatile() on each element in the list of volatiles. + * + * @return True if all elements succeeded, false if one or more failed. + **/ + static bool loadAll(); + + /** + * Calls \c unloadVolatile() on each element in the list of volatiles. + **/ + static void unloadAll(); + +}; // Volatile + +} // graphics +} // love + +#endif // LOVE_GRAPHICS_VOLATILE_H diff --git a/src/modules/graphics/opengl/Canvas.cpp b/src/modules/graphics/opengl/Canvas.cpp index 9a22d8c7a..88f50586b 100644 --- a/src/modules/graphics/opengl/Canvas.cpp +++ b/src/modules/graphics/opengl/Canvas.cpp @@ -1,452 +1,452 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Canvas.h" -#include "Graphics.h" -#include "common/Matrix.h" - -#include // For memcpy - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -// strategy for fbo creation, interchangable at runtime: -// none, opengl >= 3.0, extensions -struct FramebufferStrategy -{ - /// create a new framebuffer, depth_stencil and texture - /** - * @param[out] framebuffer Framebuffer name - * @param[out] depth_stencil Name for packed depth and stencil buffer - * @param[out] img Texture name - * @param[in] width Width of framebuffer - * @param[in] height Height of framebuffer - * @return Creation status - */ - virtual GLenum createFBO(GLuint &, GLuint &, GLuint &, int, int) - { - return GL_FRAMEBUFFER_UNSUPPORTED; - } - /// remove objects - /** - * @param[in] framebuffer Framebuffer name - * @param[in] depth_stencil Name for packed depth and stencil buffer - * @param[in] img Texture name - */ - virtual void deleteFBO(GLuint, GLuint, GLuint) {} - virtual void bindFBO(GLuint) {} -}; - -struct FramebufferStrategyGL3 : public FramebufferStrategy -{ - virtual GLenum createFBO(GLuint &framebuffer, GLuint &depth_stencil, GLuint &img, int width, int height) - { - // get currently bound fbo to reset to it later - GLint current_fbo; - glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); - - // create framebuffer - glGenFramebuffers(1, &framebuffer); - glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); - - // create stencil buffer - glGenRenderbuffers(1, &depth_stencil); - glBindRenderbuffer(GL_RENDERBUFFER, depth_stencil); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL, width, height); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, - GL_RENDERBUFFER, depth_stencil); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, - GL_RENDERBUFFER, depth_stencil); - - // generate texture save target - glGenTextures(1, &img); - bindTexture(img); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, - 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - bindTexture(0); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, img, 0); - - // check status - GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - - // unbind framebuffer - glBindRenderbuffer(GL_RENDERBUFFER, 0); - glBindFramebuffer(GL_FRAMEBUFFER, (GLuint)current_fbo); - return status; - } - virtual void deleteFBO(GLuint framebuffer, GLuint depth_stencil, GLuint img) - { - deleteTexture(img); - glDeleteRenderbuffers(1, &depth_stencil); - glDeleteFramebuffers(1, &framebuffer); - } - - virtual void bindFBO(GLuint framebuffer) - { - glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); - } -}; - -struct FramebufferStrategyEXT : public FramebufferStrategy -{ - - virtual GLenum createFBO(GLuint &framebuffer, GLuint &depth_stencil, GLuint &img, int width, int height) - { - GLint current_fbo; - glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING_EXT, ¤t_fbo); - - // create framebuffer - glGenFramebuffersEXT(1, &framebuffer); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer); - - // create stencil buffer - glGenRenderbuffersEXT(1, &depth_stencil); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_stencil); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_EXT, width, height); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, depth_stencil); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, depth_stencil); - - // generate texture save target - glGenTextures(1, &img); - bindTexture(img); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, - 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - bindTexture(0); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, - GL_TEXTURE_2D, img, 0); - - // check status - GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); - - // unbind framebuffer - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, (GLuint)current_fbo); - return status; - } - - virtual void deleteFBO(GLuint framebuffer, GLuint depth_stencil, GLuint img) - { - deleteTexture(img); - glDeleteRenderbuffersEXT(1, &depth_stencil); - glDeleteFramebuffersEXT(1, &framebuffer); - } - - virtual void bindFBO(GLuint framebuffer) - { - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer); - } -}; - -FramebufferStrategy *strategy = NULL; - -FramebufferStrategy strategyNone; - -FramebufferStrategyGL3 strategyGL3; - -FramebufferStrategyEXT strategyEXT; - -Canvas *Canvas::current = NULL; - -static void loadStrategy() -{ - if (!strategy) - { - if (GLEE_VERSION_3_0 || GLEE_ARB_framebuffer_object) - strategy = &strategyGL3; - else if (GLEE_EXT_framebuffer_object && GLEE_EXT_packed_depth_stencil) - strategy = &strategyEXT; - else - strategy = &strategyNone; - } -} - -Canvas::Canvas(int width, int height) - : width(width) - , height(height) -{ - float w = static_cast(width); - float h = static_cast(height); - - // world coordinates - vertices[0].x = 0; - vertices[0].y = 0; - vertices[1].x = 0; - vertices[1].y = h; - vertices[2].x = w; - vertices[2].y = h; - vertices[3].x = w; - vertices[3].y = 0; - - // texture coordinates - vertices[0].s = 0; - vertices[0].t = 1; - vertices[1].s = 0; - vertices[1].t = 0; - vertices[2].s = 1; - vertices[2].t = 0; - vertices[3].s = 1; - vertices[3].t = 1; - - loadStrategy(); - - loadVolatile(); -} - -Canvas::~Canvas() -{ - // reset framebuffer if still using this one - if (current == this) - stopGrab(); - - unloadVolatile(); -} - -bool Canvas::isSupported() -{ - loadStrategy(); - return (strategy != &strategyNone); -} - -void Canvas::bindDefaultCanvas() -{ - if (current != NULL) - current->stopGrab(); -} - -void Canvas::startGrab() -{ - // already grabbing - if (current == this) - return; - - // cleanup after previous fbo - if (current != NULL) - current->stopGrab(); - - // bind buffer and clear screen - glPushAttrib(GL_VIEWPORT_BIT | GL_TRANSFORM_BIT); - strategy->bindFBO(fbo); - glViewport(0, 0, width, height); - - // Reset the projection matrix - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - - // Set up orthographic view (no depth) - glOrtho(0.0, width, height, 0.0, -1.0, 1.0); - - // Switch back to modelview matrix - glMatrixMode(GL_MODELVIEW); - - // indicate we are using this fbo - current = this; -} - -void Canvas::stopGrab() -{ - // i am not grabbing. leave me alone - if (current != this) - return; - - // bind default - strategy->bindFBO(0); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glPopAttrib(); - current = NULL; -} - - -void Canvas::clear(const Color &c) -{ - GLuint previous = 0; - if (current != NULL) - previous = current->fbo; - - strategy->bindFBO(fbo); - glPushAttrib(GL_COLOR_BUFFER_BIT); - glClearColor((float)c.r/255.0f, (float)c.g/255.0f, (float)c.b/255.0f, (float)c.a/255.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - glPopAttrib(); - - strategy->bindFBO(previous); -} - -void Canvas::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const -{ - static Matrix t; - t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); - - drawv(t, vertices); -} - -void Canvas::drawq(love::graphics::Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const -{ - static Matrix t; - quad->mirror(false, true); - const vertex *v = quad->getVertices(); - - t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); - drawv(t, v); - quad->mirror(false, true); -} - -love::image::ImageData *Canvas::getImageData(love::image::Image *image) -{ - int row = 4 * width; - int size = row * height; - GLubyte *pixels = new GLubyte[size]; - GLubyte *screenshot = new GLubyte[size]; - - strategy->bindFBO(fbo); - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); - if (current) - strategy->bindFBO(current->fbo); - else - strategy->bindFBO(0); - - GLubyte *src = pixels - row; // second line of source image - GLubyte *dst = screenshot + size; // last row of destination image - - for (int i = 0; i < height; ++i) - memcpy(dst -= row, src += row, row); - - love::image::ImageData *img = image->newImageData(width, height, (void *)screenshot); - - delete[] screenshot; - delete[] pixels; - - return img; -} - -void Canvas::setFilter(const Image::Filter &f) -{ - GLint gmin = (f.min == Image::FILTER_NEAREST) ? GL_NEAREST : GL_LINEAR; - GLint gmag = (f.mag == Image::FILTER_NEAREST) ? GL_NEAREST : GL_LINEAR; - - bindTexture(img); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gmin); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gmag); -} - -Image::Filter Canvas::getFilter() const -{ - GLint gmin, gmag; - - bindTexture(img); - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &gmin); - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &gmag); - - Image::Filter f; - f.min = (gmin == GL_NEAREST) ? Image::FILTER_NEAREST : Image::FILTER_LINEAR; - f.mag = (gmag == GL_NEAREST) ? Image::FILTER_NEAREST : Image::FILTER_LINEAR; - return f; -} - -void Canvas::setWrap(const Image::Wrap &w) -{ - GLint wrap_s = (w.s == Image::WRAP_CLAMP) ? GL_CLAMP_TO_EDGE : GL_REPEAT; - GLint wrap_t = (w.t == Image::WRAP_CLAMP) ? GL_CLAMP_TO_EDGE : GL_REPEAT; - - bindTexture(img); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_t); -} - -Image::Wrap Canvas::getWrap() const -{ - GLint wrap_s, wrap_t; - bindTexture(img); - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &wrap_s); - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, &wrap_t); - - Image::Wrap w; - w.s = (wrap_s == GL_CLAMP_TO_EDGE) ? Image::WRAP_CLAMP : Image::WRAP_REPEAT; - w.t = (wrap_t == GL_CLAMP_TO_EDGE) ? Image::WRAP_CLAMP : Image::WRAP_REPEAT; - - return w; -} - -bool Canvas::loadVolatile() -{ - status = strategy->createFBO(fbo, depth_stencil, img, width, height); - if (status != GL_FRAMEBUFFER_COMPLETE) - return false; - - setFilter(settings.filter); - setWrap(settings.wrap); - Color c; - c.r = c.g = c.b = c.a = 0; - clear(c); - return true; -} - -void Canvas::unloadVolatile() -{ - settings.filter = getFilter(); - settings.wrap = getWrap(); - strategy->deleteFBO(fbo, depth_stencil, img); -} - -int Canvas::getWidth() -{ - return width; -} - -int Canvas::getHeight() -{ - return height; -} - -void Canvas::drawv(const Matrix &t, const vertex *v) const -{ - glPushMatrix(); - - glMultMatrixf((const GLfloat *)t.getElements()); - - bindTexture(img); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&v[0].x); - glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&v[0].s); - glDrawArrays(GL_QUADS, 0, 4); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_VERTEX_ARRAY); - - glPopMatrix(); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Canvas.h" +#include "Graphics.h" +#include "common/Matrix.h" + +#include // For memcpy + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +// strategy for fbo creation, interchangable at runtime: +// none, opengl >= 3.0, extensions +struct FramebufferStrategy +{ + /// create a new framebuffer, depth_stencil and texture + /** + * @param[out] framebuffer Framebuffer name + * @param[out] depth_stencil Name for packed depth and stencil buffer + * @param[out] img Texture name + * @param[in] width Width of framebuffer + * @param[in] height Height of framebuffer + * @return Creation status + */ + virtual GLenum createFBO(GLuint &, GLuint &, GLuint &, int, int) + { + return GL_FRAMEBUFFER_UNSUPPORTED; + } + /// remove objects + /** + * @param[in] framebuffer Framebuffer name + * @param[in] depth_stencil Name for packed depth and stencil buffer + * @param[in] img Texture name + */ + virtual void deleteFBO(GLuint, GLuint, GLuint) {} + virtual void bindFBO(GLuint) {} +}; + +struct FramebufferStrategyGL3 : public FramebufferStrategy +{ + virtual GLenum createFBO(GLuint &framebuffer, GLuint &depth_stencil, GLuint &img, int width, int height) + { + // get currently bound fbo to reset to it later + GLint current_fbo; + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); + + // create framebuffer + glGenFramebuffers(1, &framebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); + + // create stencil buffer + glGenRenderbuffers(1, &depth_stencil); + glBindRenderbuffer(GL_RENDERBUFFER, depth_stencil); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL, width, height); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, + GL_RENDERBUFFER, depth_stencil); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_RENDERBUFFER, depth_stencil); + + // generate texture save target + glGenTextures(1, &img); + bindTexture(img); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, + 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + bindTexture(0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, img, 0); + + // check status + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + + // unbind framebuffer + glBindRenderbuffer(GL_RENDERBUFFER, 0); + glBindFramebuffer(GL_FRAMEBUFFER, (GLuint)current_fbo); + return status; + } + virtual void deleteFBO(GLuint framebuffer, GLuint depth_stencil, GLuint img) + { + deleteTexture(img); + glDeleteRenderbuffers(1, &depth_stencil); + glDeleteFramebuffers(1, &framebuffer); + } + + virtual void bindFBO(GLuint framebuffer) + { + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); + } +}; + +struct FramebufferStrategyEXT : public FramebufferStrategy +{ + + virtual GLenum createFBO(GLuint &framebuffer, GLuint &depth_stencil, GLuint &img, int width, int height) + { + GLint current_fbo; + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING_EXT, ¤t_fbo); + + // create framebuffer + glGenFramebuffersEXT(1, &framebuffer); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer); + + // create stencil buffer + glGenRenderbuffersEXT(1, &depth_stencil); + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_stencil); + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_EXT, width, height); + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, + GL_RENDERBUFFER_EXT, depth_stencil); + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, + GL_RENDERBUFFER_EXT, depth_stencil); + + // generate texture save target + glGenTextures(1, &img); + bindTexture(img); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, + 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + bindTexture(0); + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + GL_TEXTURE_2D, img, 0); + + // check status + GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + + // unbind framebuffer + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, (GLuint)current_fbo); + return status; + } + + virtual void deleteFBO(GLuint framebuffer, GLuint depth_stencil, GLuint img) + { + deleteTexture(img); + glDeleteRenderbuffersEXT(1, &depth_stencil); + glDeleteFramebuffersEXT(1, &framebuffer); + } + + virtual void bindFBO(GLuint framebuffer) + { + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer); + } +}; + +FramebufferStrategy *strategy = NULL; + +FramebufferStrategy strategyNone; + +FramebufferStrategyGL3 strategyGL3; + +FramebufferStrategyEXT strategyEXT; + +Canvas *Canvas::current = NULL; + +static void loadStrategy() +{ + if (!strategy) + { + if (GLEE_VERSION_3_0 || GLEE_ARB_framebuffer_object) + strategy = &strategyGL3; + else if (GLEE_EXT_framebuffer_object && GLEE_EXT_packed_depth_stencil) + strategy = &strategyEXT; + else + strategy = &strategyNone; + } +} + +Canvas::Canvas(int width, int height) + : width(width) + , height(height) +{ + float w = static_cast(width); + float h = static_cast(height); + + // world coordinates + vertices[0].x = 0; + vertices[0].y = 0; + vertices[1].x = 0; + vertices[1].y = h; + vertices[2].x = w; + vertices[2].y = h; + vertices[3].x = w; + vertices[3].y = 0; + + // texture coordinates + vertices[0].s = 0; + vertices[0].t = 1; + vertices[1].s = 0; + vertices[1].t = 0; + vertices[2].s = 1; + vertices[2].t = 0; + vertices[3].s = 1; + vertices[3].t = 1; + + loadStrategy(); + + loadVolatile(); +} + +Canvas::~Canvas() +{ + // reset framebuffer if still using this one + if (current == this) + stopGrab(); + + unloadVolatile(); +} + +bool Canvas::isSupported() +{ + loadStrategy(); + return (strategy != &strategyNone); +} + +void Canvas::bindDefaultCanvas() +{ + if (current != NULL) + current->stopGrab(); +} + +void Canvas::startGrab() +{ + // already grabbing + if (current == this) + return; + + // cleanup after previous fbo + if (current != NULL) + current->stopGrab(); + + // bind buffer and clear screen + glPushAttrib(GL_VIEWPORT_BIT | GL_TRANSFORM_BIT); + strategy->bindFBO(fbo); + glViewport(0, 0, width, height); + + // Reset the projection matrix + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + + // Set up orthographic view (no depth) + glOrtho(0.0, width, height, 0.0, -1.0, 1.0); + + // Switch back to modelview matrix + glMatrixMode(GL_MODELVIEW); + + // indicate we are using this fbo + current = this; +} + +void Canvas::stopGrab() +{ + // i am not grabbing. leave me alone + if (current != this) + return; + + // bind default + strategy->bindFBO(0); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glPopAttrib(); + current = NULL; +} + + +void Canvas::clear(const Color &c) +{ + GLuint previous = 0; + if (current != NULL) + previous = current->fbo; + + strategy->bindFBO(fbo); + glPushAttrib(GL_COLOR_BUFFER_BIT); + glClearColor((float)c.r/255.0f, (float)c.g/255.0f, (float)c.b/255.0f, (float)c.a/255.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + glPopAttrib(); + + strategy->bindFBO(previous); +} + +void Canvas::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const +{ + static Matrix t; + t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); + + drawv(t, vertices); +} + +void Canvas::drawq(love::graphics::Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const +{ + static Matrix t; + quad->mirror(false, true); + const vertex *v = quad->getVertices(); + + t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); + drawv(t, v); + quad->mirror(false, true); +} + +love::image::ImageData *Canvas::getImageData(love::image::Image *image) +{ + int row = 4 * width; + int size = row * height; + GLubyte *pixels = new GLubyte[size]; + GLubyte *screenshot = new GLubyte[size]; + + strategy->bindFBO(fbo); + glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); + if (current) + strategy->bindFBO(current->fbo); + else + strategy->bindFBO(0); + + GLubyte *src = pixels - row; // second line of source image + GLubyte *dst = screenshot + size; // last row of destination image + + for (int i = 0; i < height; ++i) + memcpy(dst -= row, src += row, row); + + love::image::ImageData *img = image->newImageData(width, height, (void *)screenshot); + + delete[] screenshot; + delete[] pixels; + + return img; +} + +void Canvas::setFilter(const Image::Filter &f) +{ + GLint gmin = (f.min == Image::FILTER_NEAREST) ? GL_NEAREST : GL_LINEAR; + GLint gmag = (f.mag == Image::FILTER_NEAREST) ? GL_NEAREST : GL_LINEAR; + + bindTexture(img); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gmin); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gmag); +} + +Image::Filter Canvas::getFilter() const +{ + GLint gmin, gmag; + + bindTexture(img); + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &gmin); + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &gmag); + + Image::Filter f; + f.min = (gmin == GL_NEAREST) ? Image::FILTER_NEAREST : Image::FILTER_LINEAR; + f.mag = (gmag == GL_NEAREST) ? Image::FILTER_NEAREST : Image::FILTER_LINEAR; + return f; +} + +void Canvas::setWrap(const Image::Wrap &w) +{ + GLint wrap_s = (w.s == Image::WRAP_CLAMP) ? GL_CLAMP_TO_EDGE : GL_REPEAT; + GLint wrap_t = (w.t == Image::WRAP_CLAMP) ? GL_CLAMP_TO_EDGE : GL_REPEAT; + + bindTexture(img); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_t); +} + +Image::Wrap Canvas::getWrap() const +{ + GLint wrap_s, wrap_t; + bindTexture(img); + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &wrap_s); + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, &wrap_t); + + Image::Wrap w; + w.s = (wrap_s == GL_CLAMP_TO_EDGE) ? Image::WRAP_CLAMP : Image::WRAP_REPEAT; + w.t = (wrap_t == GL_CLAMP_TO_EDGE) ? Image::WRAP_CLAMP : Image::WRAP_REPEAT; + + return w; +} + +bool Canvas::loadVolatile() +{ + status = strategy->createFBO(fbo, depth_stencil, img, width, height); + if (status != GL_FRAMEBUFFER_COMPLETE) + return false; + + setFilter(settings.filter); + setWrap(settings.wrap); + Color c; + c.r = c.g = c.b = c.a = 0; + clear(c); + return true; +} + +void Canvas::unloadVolatile() +{ + settings.filter = getFilter(); + settings.wrap = getWrap(); + strategy->deleteFBO(fbo, depth_stencil, img); +} + +int Canvas::getWidth() +{ + return width; +} + +int Canvas::getHeight() +{ + return height; +} + +void Canvas::drawv(const Matrix &t, const vertex *v) const +{ + glPushMatrix(); + + glMultMatrixf((const GLfloat *)t.getElements()); + + bindTexture(img); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&v[0].x); + glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&v[0].s); + glDrawArrays(GL_QUADS, 0, 4); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); + + glPopMatrix(); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/Canvas.h b/src/modules/graphics/opengl/Canvas.h index 2ac7fd099..b226a36d1 100644 --- a/src/modules/graphics/opengl/Canvas.h +++ b/src/modules/graphics/opengl/Canvas.h @@ -1,114 +1,114 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_CANVAS_H -#define LOVE_GRAPHICS_OPENGL_CANVAS_H - -#include "graphics/DrawQable.h" -#include "graphics/Volatile.h" -#include "graphics/Image.h" -#include "graphics/Color.h" -#include "image/Image.h" -#include "image/ImageData.h" -#include "common/math.h" -#include "common/Matrix.h" -#include "OpenGL.h" -#include "GLee.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -class Canvas : public DrawQable, public Volatile -{ -public: - Canvas(int width, int height); - virtual ~Canvas(); - - static bool isSupported(); - - unsigned int getStatus() const - { - return status; - } - - static Canvas *current; - static void bindDefaultCanvas(); - - void startGrab(); - void stopGrab(); - - void clear(const Color &c); - - virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; - - /** - * @copydoc DrawQable::drawq() - **/ - void drawq(love::graphics::Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; - - love::image::ImageData *getImageData(love::image::Image *image); - - void setFilter(const Image::Filter &f); - Image::Filter getFilter() const; - - void setWrap(const Image::Wrap &w); - Image::Wrap getWrap() const; - - int getWidth(); - int getHeight(); - - bool loadVolatile(); - void unloadVolatile(); - -private: - friend class PixelEffect; - GLuint getTextureName() const - { - return img; - } - - GLsizei width; - GLsizei height; - GLuint fbo; - GLuint depth_stencil; - GLuint img; - - vertex vertices[4]; - - GLenum status; - - struct - { - Image::Filter filter; - Image::Wrap wrap; - } settings; - - void drawv(const Matrix &t, const vertex *v) const; -}; - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_CANVAS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_CANVAS_H +#define LOVE_GRAPHICS_OPENGL_CANVAS_H + +#include "graphics/DrawQable.h" +#include "graphics/Volatile.h" +#include "graphics/Image.h" +#include "graphics/Color.h" +#include "image/Image.h" +#include "image/ImageData.h" +#include "common/math.h" +#include "common/Matrix.h" +#include "OpenGL.h" +#include "GLee.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +class Canvas : public DrawQable, public Volatile +{ +public: + Canvas(int width, int height); + virtual ~Canvas(); + + static bool isSupported(); + + unsigned int getStatus() const + { + return status; + } + + static Canvas *current; + static void bindDefaultCanvas(); + + void startGrab(); + void stopGrab(); + + void clear(const Color &c); + + virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; + + /** + * @copydoc DrawQable::drawq() + **/ + void drawq(love::graphics::Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; + + love::image::ImageData *getImageData(love::image::Image *image); + + void setFilter(const Image::Filter &f); + Image::Filter getFilter() const; + + void setWrap(const Image::Wrap &w); + Image::Wrap getWrap() const; + + int getWidth(); + int getHeight(); + + bool loadVolatile(); + void unloadVolatile(); + +private: + friend class PixelEffect; + GLuint getTextureName() const + { + return img; + } + + GLsizei width; + GLsizei height; + GLuint fbo; + GLuint depth_stencil; + GLuint img; + + vertex vertices[4]; + + GLenum status; + + struct + { + Image::Filter filter; + Image::Wrap wrap; + } settings; + + void drawv(const Matrix &t, const vertex *v) const; +}; + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_CANVAS_H diff --git a/src/modules/graphics/opengl/Font.cpp b/src/modules/graphics/opengl/Font.cpp index 5abe546e1..044073aeb 100644 --- a/src/modules/graphics/opengl/Font.cpp +++ b/src/modules/graphics/opengl/Font.cpp @@ -1,385 +1,385 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ -#include "common/config.h" -#include "Font.h" -#include "font/GlyphData.h" -#include "Quad.h" - -#include "libraries/utf8/utf8.h" - -#include "common/math.h" -#include "common/Matrix.h" -#include - -#include - -#include // for max - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Font::Font(love::font::Rasterizer *r, const Image::Filter &filter) - : rasterizer(r) - , height(r->getHeight()) - , lineHeight(1) - , mSpacing(1) - , filter(filter) -{ - r->retain(); - love::font::GlyphData *gd = r->getGlyphData(32); - type = (gd->getFormat() == love::font::GlyphData::FORMAT_LUMINANCE_ALPHA ? FONT_TRUETYPE : FONT_IMAGE); - delete gd; - createTexture(); -} - -Font::~Font() -{ - rasterizer->release(); - unloadVolatile(); -} - -void Font::createTexture() -{ - texture_x = texture_y = rowHeight = TEXTURE_PADDING; - GLuint t; - glGenTextures(1, &t); - textures.push_back(t); - bindTexture(t); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, - (filter.mag == Image::FILTER_LINEAR) ? GL_LINEAR : GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - (filter.min == Image::FILTER_LINEAR) ? GL_LINEAR : GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - GLint format = (type == FONT_TRUETYPE ? GL_LUMINANCE_ALPHA : GL_RGBA); - // Initialize the texture - glTexImage2D(GL_TEXTURE_2D, - 0, - GL_RGBA, - (GLsizei)TEXTURE_WIDTH, - (GLsizei)TEXTURE_HEIGHT, - 0, - format, - GL_UNSIGNED_BYTE, - NULL); - // Fill the texture with transparent black - std::vector emptyData(TEXTURE_WIDTH * TEXTURE_HEIGHT * (type == FONT_TRUETYPE ? 2 : 4), 0); - glTexSubImage2D(GL_TEXTURE_2D, - 0, - 0, - 0, - (GLsizei)TEXTURE_WIDTH, - (GLsizei)TEXTURE_HEIGHT, - format, - GL_UNSIGNED_BYTE, - &emptyData[0]); -} - -Font::Glyph *Font::addGlyph(int glyph) -{ - love::font::GlyphData *gd = rasterizer->getGlyphData(glyph); - int w = gd->getWidth(); - int h = gd->getHeight(); - - if (texture_x + w + TEXTURE_PADDING > TEXTURE_WIDTH) - { - // out of space - new row! - texture_x = TEXTURE_PADDING; - texture_y += rowHeight; - rowHeight = TEXTURE_PADDING; - } - if (texture_y + h + TEXTURE_PADDING > TEXTURE_HEIGHT) - { - // totally out of space - new texture! - createTexture(); - } - - Glyph *g = new Glyph; - g->list = g->texture = 0; - g->spacing = gd->getAdvance(); - - // don't waste space for empty glyphs. also fixes a division by zero bug with ati drivers - if (w > 0 && h > 0) - { - g->list = glGenLists(1); - if (0 == g->list) - { - delete g; - return NULL; - } - - GLuint t = textures.back(); - bindTexture(t); - glTexSubImage2D(GL_TEXTURE_2D, 0, texture_x, texture_y, w, h, (type == FONT_TRUETYPE ? GL_LUMINANCE_ALPHA : GL_RGBA), GL_UNSIGNED_BYTE, gd->getData()); - - g->texture = t; - - Quad::Viewport v; - v.x = (float) texture_x; - v.y = (float) texture_y; - v.w = (float) w; - v.h = (float) h; - Quad *q = new Quad(v, (const float) TEXTURE_WIDTH, (const float) TEXTURE_HEIGHT); - const vertex *verts = q->getVertices(); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&verts[0].x); - glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&verts[0].s); - - glNewList(g->list, GL_COMPILE); - glPushMatrix(); - glTranslatef(static_cast(gd->getBearingX()), static_cast(-gd->getBearingY()), 0.0f); - glDrawArrays(GL_QUADS, 0, 4); - glPopMatrix(); - glEndList(); - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_VERTEX_ARRAY); - - delete q; - } - - if (w > 0) - texture_x += (w + TEXTURE_PADDING); - if (h > 0) - rowHeight = std::max(rowHeight, h + TEXTURE_PADDING); - - delete gd; - glyphs[glyph] = g; - return g; -} - -float Font::getHeight() const -{ - return static_cast(height); -} - -void Font::print(std::string text, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) -{ - float dx = 0.0f; // spacing counter for newline handling - glPushMatrix(); - - Matrix t; - t.setTransformation(ceil(x), ceil(y), angle, sx, sy, ox, oy, kx, ky); - glMultMatrixf((const GLfloat *)t.getElements()); - try - { - utf8::iterator i(text.begin(), text.begin(), text.end()); - utf8::iterator end(text.end(), text.begin(), text.end()); - while (i != end) - { - int g = *i++; - if (g == '\n') - { - // wrap newline, but do not print it - glTranslatef(-dx, floor(getHeight() * getLineHeight() + 0.5f), 0); - dx = 0.0f; - continue; - } - Glyph *glyph = glyphs[g]; - if (!glyph) glyph = addGlyph(g); - glPushMatrix(); - // 1.25 is magic line height for true type fonts - if (type == FONT_TRUETYPE) glTranslatef(0, floor(getHeight() / 1.25f + 0.5f), 0); - bindTexture(glyph->texture); - glCallList(glyph->list); - glPopMatrix(); - glTranslatef(static_cast(glyph->spacing), 0, 0); - dx += glyph->spacing; - } - } - catch(utf8::exception &e) - { - glPopMatrix(); - throw love::Exception("%s", e.what()); - } - glPopMatrix(); -} - -void Font::print(char character, float x, float y) -{ - Glyph *glyph = glyphs[character]; - if (!glyph) glyph = addGlyph(character); - - if (0 != glyph->texture) - { - glPushMatrix(); - glTranslatef(x, floor(y+getHeight() + 0.5f), 0.0f); - bindTexture(glyph->texture); - glCallList(glyph->list); - glPopMatrix(); - } -} - -int Font::getWidth(const std::string &line) -{ - if (line.size() == 0) return 0; - int temp = 0; - - Glyph *g; - - try - { - utf8::iterator i(line.begin(), line.begin(), line.end()); - utf8::iterator end(line.end(), line.begin(), line.end()); - while (i != end) - { - int c = *i++; - g = glyphs[c]; - if (!g) g = addGlyph(c); - temp += static_cast(g->spacing * mSpacing); - } - } - catch(utf8::exception &e) - { - throw love::Exception("%s", e.what()); - } - - return temp; -} - -int Font::getWidth(const char *line) -{ - return this->getWidth(std::string(line)); -} - -int Font::getWidth(const char character) -{ - Glyph *g = glyphs[character]; - if (!g) g = addGlyph(character); - return g->spacing; -} - -std::vector Font::getWrap(const std::string text, float wrap, int *max_width) -{ - using namespace std; - const float width_space = static_cast(getWidth(' ')); - vector lines_to_draw; - int maxw = 0; - - //split text at newlines - istringstream iss(text); - string line; - ostringstream string_builder; - while (getline(iss, line, '\n')) - { - // split line into words - vector words; - istringstream word_iss(line); - copy(istream_iterator(word_iss), istream_iterator(), - back_inserter< vector >(words)); - - // put words back together until a wrap occurs - float width = 0.0f; - float oldwidth = 0.0f; - string_builder.str(""); - vector::const_iterator word_iter, wend = words.end(); - for (word_iter = words.begin(); word_iter != wend; ++word_iter) - { - const string &word = *word_iter; - width += getWidth(word); - - // on wordwrap, push line to line buffer and clear string builder - if (width >= wrap && oldwidth > 0) - { - int realw = (int) width; - - // remove trailing space - string tmp = string_builder.str(); - lines_to_draw.push_back(tmp.substr(0,tmp.size()-1)); - string_builder.str(""); - width = static_cast(getWidth(word)); - realw -= (int) width; - if (realw > maxw) - maxw = realw; - } - string_builder << word << " "; - width += width_space; - oldwidth = width; - } - // push last line - if (width > maxw) - maxw = (int) width; - string tmp = string_builder.str(); - lines_to_draw.push_back(tmp.substr(0,tmp.size()-1)); - } - - if (max_width) - *max_width = maxw; - - return lines_to_draw; -} - -void Font::setLineHeight(float height) -{ - this->lineHeight = height; -} - -float Font::getLineHeight() const -{ - return lineHeight; -} - -void Font::setSpacing(float amount) -{ - mSpacing = amount; -} - -float Font::getSpacing() const -{ - return mSpacing; -} - -bool Font::loadVolatile() -{ - createTexture(); - return true; -} - -void Font::unloadVolatile() -{ - // nuke everything from orbit - std::map::iterator it = glyphs.begin(); - Glyph *g; - while (it != glyphs.end()) - { - g = it->second; - glDeleteLists(g->list, 1); - delete g; - glyphs.erase(it++); - } - std::vector::iterator iter = textures.begin(); - while (iter != textures.end()) - { - deleteTexture(*iter); - iter++; - } - textures.clear(); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ +#include "common/config.h" +#include "Font.h" +#include "font/GlyphData.h" +#include "Quad.h" + +#include "libraries/utf8/utf8.h" + +#include "common/math.h" +#include "common/Matrix.h" +#include + +#include + +#include // for max + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Font::Font(love::font::Rasterizer *r, const Image::Filter &filter) + : rasterizer(r) + , height(r->getHeight()) + , lineHeight(1) + , mSpacing(1) + , filter(filter) +{ + r->retain(); + love::font::GlyphData *gd = r->getGlyphData(32); + type = (gd->getFormat() == love::font::GlyphData::FORMAT_LUMINANCE_ALPHA ? FONT_TRUETYPE : FONT_IMAGE); + delete gd; + createTexture(); +} + +Font::~Font() +{ + rasterizer->release(); + unloadVolatile(); +} + +void Font::createTexture() +{ + texture_x = texture_y = rowHeight = TEXTURE_PADDING; + GLuint t; + glGenTextures(1, &t); + textures.push_back(t); + bindTexture(t); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, + (filter.mag == Image::FILTER_LINEAR) ? GL_LINEAR : GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, + (filter.min == Image::FILTER_LINEAR) ? GL_LINEAR : GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + GLint format = (type == FONT_TRUETYPE ? GL_LUMINANCE_ALPHA : GL_RGBA); + // Initialize the texture + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGBA, + (GLsizei)TEXTURE_WIDTH, + (GLsizei)TEXTURE_HEIGHT, + 0, + format, + GL_UNSIGNED_BYTE, + NULL); + // Fill the texture with transparent black + std::vector emptyData(TEXTURE_WIDTH * TEXTURE_HEIGHT * (type == FONT_TRUETYPE ? 2 : 4), 0); + glTexSubImage2D(GL_TEXTURE_2D, + 0, + 0, + 0, + (GLsizei)TEXTURE_WIDTH, + (GLsizei)TEXTURE_HEIGHT, + format, + GL_UNSIGNED_BYTE, + &emptyData[0]); +} + +Font::Glyph *Font::addGlyph(int glyph) +{ + love::font::GlyphData *gd = rasterizer->getGlyphData(glyph); + int w = gd->getWidth(); + int h = gd->getHeight(); + + if (texture_x + w + TEXTURE_PADDING > TEXTURE_WIDTH) + { + // out of space - new row! + texture_x = TEXTURE_PADDING; + texture_y += rowHeight; + rowHeight = TEXTURE_PADDING; + } + if (texture_y + h + TEXTURE_PADDING > TEXTURE_HEIGHT) + { + // totally out of space - new texture! + createTexture(); + } + + Glyph *g = new Glyph; + g->list = g->texture = 0; + g->spacing = gd->getAdvance(); + + // don't waste space for empty glyphs. also fixes a division by zero bug with ati drivers + if (w > 0 && h > 0) + { + g->list = glGenLists(1); + if (0 == g->list) + { + delete g; + return NULL; + } + + GLuint t = textures.back(); + bindTexture(t); + glTexSubImage2D(GL_TEXTURE_2D, 0, texture_x, texture_y, w, h, (type == FONT_TRUETYPE ? GL_LUMINANCE_ALPHA : GL_RGBA), GL_UNSIGNED_BYTE, gd->getData()); + + g->texture = t; + + Quad::Viewport v; + v.x = (float) texture_x; + v.y = (float) texture_y; + v.w = (float) w; + v.h = (float) h; + Quad *q = new Quad(v, (const float) TEXTURE_WIDTH, (const float) TEXTURE_HEIGHT); + const vertex *verts = q->getVertices(); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&verts[0].x); + glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&verts[0].s); + + glNewList(g->list, GL_COMPILE); + glPushMatrix(); + glTranslatef(static_cast(gd->getBearingX()), static_cast(-gd->getBearingY()), 0.0f); + glDrawArrays(GL_QUADS, 0, 4); + glPopMatrix(); + glEndList(); + + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); + + delete q; + } + + if (w > 0) + texture_x += (w + TEXTURE_PADDING); + if (h > 0) + rowHeight = std::max(rowHeight, h + TEXTURE_PADDING); + + delete gd; + glyphs[glyph] = g; + return g; +} + +float Font::getHeight() const +{ + return static_cast(height); +} + +void Font::print(std::string text, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) +{ + float dx = 0.0f; // spacing counter for newline handling + glPushMatrix(); + + Matrix t; + t.setTransformation(ceil(x), ceil(y), angle, sx, sy, ox, oy, kx, ky); + glMultMatrixf((const GLfloat *)t.getElements()); + try + { + utf8::iterator i(text.begin(), text.begin(), text.end()); + utf8::iterator end(text.end(), text.begin(), text.end()); + while (i != end) + { + int g = *i++; + if (g == '\n') + { + // wrap newline, but do not print it + glTranslatef(-dx, floor(getHeight() * getLineHeight() + 0.5f), 0); + dx = 0.0f; + continue; + } + Glyph *glyph = glyphs[g]; + if (!glyph) glyph = addGlyph(g); + glPushMatrix(); + // 1.25 is magic line height for true type fonts + if (type == FONT_TRUETYPE) glTranslatef(0, floor(getHeight() / 1.25f + 0.5f), 0); + bindTexture(glyph->texture); + glCallList(glyph->list); + glPopMatrix(); + glTranslatef(static_cast(glyph->spacing), 0, 0); + dx += glyph->spacing; + } + } + catch(utf8::exception &e) + { + glPopMatrix(); + throw love::Exception("%s", e.what()); + } + glPopMatrix(); +} + +void Font::print(char character, float x, float y) +{ + Glyph *glyph = glyphs[character]; + if (!glyph) glyph = addGlyph(character); + + if (0 != glyph->texture) + { + glPushMatrix(); + glTranslatef(x, floor(y+getHeight() + 0.5f), 0.0f); + bindTexture(glyph->texture); + glCallList(glyph->list); + glPopMatrix(); + } +} + +int Font::getWidth(const std::string &line) +{ + if (line.size() == 0) return 0; + int temp = 0; + + Glyph *g; + + try + { + utf8::iterator i(line.begin(), line.begin(), line.end()); + utf8::iterator end(line.end(), line.begin(), line.end()); + while (i != end) + { + int c = *i++; + g = glyphs[c]; + if (!g) g = addGlyph(c); + temp += static_cast(g->spacing * mSpacing); + } + } + catch(utf8::exception &e) + { + throw love::Exception("%s", e.what()); + } + + return temp; +} + +int Font::getWidth(const char *line) +{ + return this->getWidth(std::string(line)); +} + +int Font::getWidth(const char character) +{ + Glyph *g = glyphs[character]; + if (!g) g = addGlyph(character); + return g->spacing; +} + +std::vector Font::getWrap(const std::string text, float wrap, int *max_width) +{ + using namespace std; + const float width_space = static_cast(getWidth(' ')); + vector lines_to_draw; + int maxw = 0; + + //split text at newlines + istringstream iss(text); + string line; + ostringstream string_builder; + while (getline(iss, line, '\n')) + { + // split line into words + vector words; + istringstream word_iss(line); + copy(istream_iterator(word_iss), istream_iterator(), + back_inserter< vector >(words)); + + // put words back together until a wrap occurs + float width = 0.0f; + float oldwidth = 0.0f; + string_builder.str(""); + vector::const_iterator word_iter, wend = words.end(); + for (word_iter = words.begin(); word_iter != wend; ++word_iter) + { + const string &word = *word_iter; + width += getWidth(word); + + // on wordwrap, push line to line buffer and clear string builder + if (width >= wrap && oldwidth > 0) + { + int realw = (int) width; + + // remove trailing space + string tmp = string_builder.str(); + lines_to_draw.push_back(tmp.substr(0,tmp.size()-1)); + string_builder.str(""); + width = static_cast(getWidth(word)); + realw -= (int) width; + if (realw > maxw) + maxw = realw; + } + string_builder << word << " "; + width += width_space; + oldwidth = width; + } + // push last line + if (width > maxw) + maxw = (int) width; + string tmp = string_builder.str(); + lines_to_draw.push_back(tmp.substr(0,tmp.size()-1)); + } + + if (max_width) + *max_width = maxw; + + return lines_to_draw; +} + +void Font::setLineHeight(float height) +{ + this->lineHeight = height; +} + +float Font::getLineHeight() const +{ + return lineHeight; +} + +void Font::setSpacing(float amount) +{ + mSpacing = amount; +} + +float Font::getSpacing() const +{ + return mSpacing; +} + +bool Font::loadVolatile() +{ + createTexture(); + return true; +} + +void Font::unloadVolatile() +{ + // nuke everything from orbit + std::map::iterator it = glyphs.begin(); + Glyph *g; + while (it != glyphs.end()) + { + g = it->second; + glDeleteLists(g->list, 1); + delete g; + glyphs.erase(it++); + } + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + deleteTexture(*iter); + iter++; + } + textures.clear(); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/Font.h b/src/modules/graphics/opengl/Font.h index ec6d37c4b..d771cd084 100644 --- a/src/modules/graphics/opengl/Font.h +++ b/src/modules/graphics/opengl/Font.h @@ -1,182 +1,182 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_FONT_H -#define LOVE_GRAPHICS_OPENGL_FONT_H - -// STD -#include -#include -#include - -// LOVE -#include "common/Object.h" -#include "font/Rasterizer.h" -#include "graphics/Image.h" - -#include "OpenGL.h" -#include "GLee.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -class Font : public Object, public Volatile -{ -public: - - /** - * Default constructor. - * - * @param data The font data to construct from. - **/ - Font(love::font::Rasterizer *r, const Image::Filter &filter = Image::Filter()); - - virtual ~Font(); - - /** - * Prints the text at the designated position with rotation and scaling. - * - * @param text A string. - * @param x The x-coordinate. - * @param y The y-coordinate. - * @param angle The amount of rotation. - * @param sx Scale along the x axis. - * @param sy Scale along the y axis. - * @param ox The origin offset along the x-axis. - * @param oy The origin offset along the y-axis. - * @param kx Shear along the x axis. - * @param ky Shear along the y axis. - **/ - void print(std::string text, float x, float y, float angle = 0.0f, float sx = 1.0f, float sy = 1.0f, float ox = 0.0f, float oy = 0.0f, float kx = 0.0f, float ky = 0.0f); - - /** - * Prints the character at the designated position. - * - * @param character A character. - * @param x The x-coordinate. - * @param y The y-coordinate. - **/ - void print(char character, float x, float y); - - /** - * Returns the height of the font. - **/ - float getHeight() const; - - /** - * Returns the width of the passed string. - * - * @param line A line of text. - **/ - int getWidth(const std::string &line); - int getWidth(const char *line); - - /** - * Returns the width of the passed character. - * - * @param character A character. - **/ - int getWidth(const char character); - - /** - * Returns the maximal width of a wrapped string - * and optionally the number of lines - * - * @param text The input text - * @param wrap The number of pixels to wrap at - * @param max_width Optional output of the maximum width - * Returns a vector with the lines. - **/ - std::vector getWrap(const std::string text, float wrap, int *max_width = 0); - - /** - * Sets the line height (which should be a number to multiply the font size by, - * example: line height = 1.2 and size = 12 means that rendered line height = 12*1.2) - * @param height The new line height. - **/ - void setLineHeight(float height); - - /** - * Returns the line height. - **/ - float getLineHeight() const; - - /** - * Sets the spacing modifier (changes the spacing between the characters the - * same way that the line height does [multiplication]). - * Note: The spacing must be set BEFORE the font is loaded to have any effect. - * @param amount The amount of modification. - **/ - void setSpacing(float amount); - - /** - * Returns the spacing modifier. - **/ - float getSpacing() const; - - // Implements Volatile. - bool loadVolatile(); - void unloadVolatile(); -private: - - enum FontType - { - FONT_TRUETYPE = 1, - FONT_IMAGE, - FONT_UNKNOWN - }; - - struct Glyph - { - GLuint list; - GLuint texture; - int spacing; - }; - - love::font::Rasterizer *rasterizer; - - int height; - float lineHeight; - float mSpacing; // modifies the spacing by multiplying it with this value - std::vector textures; // vector of packed textures - std::map glyphs; // maps glyphs to display lists - FontType type; - Image::Filter filter; - - static const int TEXTURE_WIDTH = 512; - static const int TEXTURE_HEIGHT = 512; - static const int TEXTURE_PADDING = 1; - - int texture_x, texture_y; - int rowHeight; - - void createTexture(); - Glyph *addGlyph(int glyph); -}; // Font - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_FONT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_FONT_H +#define LOVE_GRAPHICS_OPENGL_FONT_H + +// STD +#include +#include +#include + +// LOVE +#include "common/Object.h" +#include "font/Rasterizer.h" +#include "graphics/Image.h" + +#include "OpenGL.h" +#include "GLee.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +class Font : public Object, public Volatile +{ +public: + + /** + * Default constructor. + * + * @param data The font data to construct from. + **/ + Font(love::font::Rasterizer *r, const Image::Filter &filter = Image::Filter()); + + virtual ~Font(); + + /** + * Prints the text at the designated position with rotation and scaling. + * + * @param text A string. + * @param x The x-coordinate. + * @param y The y-coordinate. + * @param angle The amount of rotation. + * @param sx Scale along the x axis. + * @param sy Scale along the y axis. + * @param ox The origin offset along the x-axis. + * @param oy The origin offset along the y-axis. + * @param kx Shear along the x axis. + * @param ky Shear along the y axis. + **/ + void print(std::string text, float x, float y, float angle = 0.0f, float sx = 1.0f, float sy = 1.0f, float ox = 0.0f, float oy = 0.0f, float kx = 0.0f, float ky = 0.0f); + + /** + * Prints the character at the designated position. + * + * @param character A character. + * @param x The x-coordinate. + * @param y The y-coordinate. + **/ + void print(char character, float x, float y); + + /** + * Returns the height of the font. + **/ + float getHeight() const; + + /** + * Returns the width of the passed string. + * + * @param line A line of text. + **/ + int getWidth(const std::string &line); + int getWidth(const char *line); + + /** + * Returns the width of the passed character. + * + * @param character A character. + **/ + int getWidth(const char character); + + /** + * Returns the maximal width of a wrapped string + * and optionally the number of lines + * + * @param text The input text + * @param wrap The number of pixels to wrap at + * @param max_width Optional output of the maximum width + * Returns a vector with the lines. + **/ + std::vector getWrap(const std::string text, float wrap, int *max_width = 0); + + /** + * Sets the line height (which should be a number to multiply the font size by, + * example: line height = 1.2 and size = 12 means that rendered line height = 12*1.2) + * @param height The new line height. + **/ + void setLineHeight(float height); + + /** + * Returns the line height. + **/ + float getLineHeight() const; + + /** + * Sets the spacing modifier (changes the spacing between the characters the + * same way that the line height does [multiplication]). + * Note: The spacing must be set BEFORE the font is loaded to have any effect. + * @param amount The amount of modification. + **/ + void setSpacing(float amount); + + /** + * Returns the spacing modifier. + **/ + float getSpacing() const; + + // Implements Volatile. + bool loadVolatile(); + void unloadVolatile(); +private: + + enum FontType + { + FONT_TRUETYPE = 1, + FONT_IMAGE, + FONT_UNKNOWN + }; + + struct Glyph + { + GLuint list; + GLuint texture; + int spacing; + }; + + love::font::Rasterizer *rasterizer; + + int height; + float lineHeight; + float mSpacing; // modifies the spacing by multiplying it with this value + std::vector textures; // vector of packed textures + std::map glyphs; // maps glyphs to display lists + FontType type; + Image::Filter filter; + + static const int TEXTURE_WIDTH = 512; + static const int TEXTURE_HEIGHT = 512; + static const int TEXTURE_PADDING = 1; + + int texture_x, texture_y; + int rowHeight; + + void createTexture(); + Glyph *addGlyph(int glyph); +}; // Font + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_FONT_H diff --git a/src/modules/graphics/opengl/GLee.c b/src/modules/graphics/opengl/GLee.c index ccca8cef9..a52a300e9 100644 --- a/src/modules/graphics/opengl/GLee.c +++ b/src/modules/graphics/opengl/GLee.c @@ -1,12981 +1,12981 @@ -/*************************************************************************** -* -* GLee.c -* GLee (OpenGL Easy Extension library) -* Version : 5.33 -* -* Copyright (c)2008 Ben Woodhouse All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are -* met: -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer as -* the first lines of this file unmodified. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BEN WOODHOUSE ``AS IS'' AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -* IN NO EVENT SHALL BEN WOODHOUSE BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -* Web: http://elf-stone.com/glee.php -* -* [This file was automatically generated by GLeeGen 6.0 -* -***************************************************************************/ - -#ifdef _MSC_VER - #pragma optimize( "g", off ) -#endif - -#include -#include -#include -#include "GLee.h" - -#if defined(__APPLE__) || defined(__APPLE_CC__) - #include -#endif - -typedef GLuint(*GLEE_LINK_FUNCTION)(void); - -GLboolean __GLeeInited=GL_FALSE; - -#ifndef _WIN32 - #define __stdcall /* nothing */ -#endif - -void * __GLeeGetProcAddress(const char *extname) -{ -#ifdef WIN32 - return (void*)wglGetProcAddress(extname); -#elif defined(__APPLE__) || defined(__APPLE_CC__) - CFBundleRef bundle; - CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/System/Library/Frameworks/OpenGL.framework"), kCFURLPOSIXPathStyle, true); - - CFStringRef functionName = CFStringCreateWithCString(kCFAllocatorDefault, extname, kCFStringEncodingASCII); - - void *function; - - bundle = CFBundleCreate(kCFAllocatorDefault, bundleURL); - assert(bundle != NULL); - - function = CFBundleGetFunctionPointerForName(bundle, functionName); - - CFRelease(bundleURL); - CFRelease(functionName); - CFRelease(bundle); - - return function; -#else - return (void*)glXGetProcAddressARB((const GLubyte *)extname); -#endif -} - - - - -/* Extension querying variables */ - -GLboolean _GLEE_VERSION_1_2 = GL_FALSE; -GLboolean _GLEE_ARB_imaging = GL_FALSE; -GLboolean _GLEE_VERSION_1_3 = GL_FALSE; -GLboolean _GLEE_VERSION_1_4 = GL_FALSE; -GLboolean _GLEE_VERSION_1_5 = GL_FALSE; -GLboolean _GLEE_VERSION_2_0 = GL_FALSE; -GLboolean _GLEE_VERSION_2_1 = GL_FALSE; -GLboolean _GLEE_VERSION_3_0 = GL_FALSE; -GLboolean _GLEE_ARB_multitexture = GL_FALSE; -GLboolean _GLEE_ARB_transpose_matrix = GL_FALSE; -GLboolean _GLEE_ARB_multisample = GL_FALSE; -GLboolean _GLEE_ARB_texture_env_add = GL_FALSE; -GLboolean _GLEE_ARB_texture_cube_map = GL_FALSE; -GLboolean _GLEE_ARB_texture_compression = GL_FALSE; -GLboolean _GLEE_ARB_texture_border_clamp = GL_FALSE; -GLboolean _GLEE_ARB_point_parameters = GL_FALSE; -GLboolean _GLEE_ARB_vertex_blend = GL_FALSE; -GLboolean _GLEE_ARB_matrix_palette = GL_FALSE; -GLboolean _GLEE_ARB_texture_env_combine = GL_FALSE; -GLboolean _GLEE_ARB_texture_env_crossbar = GL_FALSE; -GLboolean _GLEE_ARB_texture_env_dot3 = GL_FALSE; -GLboolean _GLEE_ARB_texture_mirrored_repeat = GL_FALSE; -GLboolean _GLEE_ARB_depth_texture = GL_FALSE; -GLboolean _GLEE_ARB_shadow = GL_FALSE; -GLboolean _GLEE_ARB_shadow_ambient = GL_FALSE; -GLboolean _GLEE_ARB_window_pos = GL_FALSE; -GLboolean _GLEE_ARB_vertex_program = GL_FALSE; -GLboolean _GLEE_ARB_fragment_program = GL_FALSE; -GLboolean _GLEE_ARB_vertex_buffer_object = GL_FALSE; -GLboolean _GLEE_ARB_occlusion_query = GL_FALSE; -GLboolean _GLEE_ARB_shader_objects = GL_FALSE; -GLboolean _GLEE_ARB_vertex_shader = GL_FALSE; -GLboolean _GLEE_ARB_fragment_shader = GL_FALSE; -GLboolean _GLEE_ARB_shading_language_100 = GL_FALSE; -GLboolean _GLEE_ARB_texture_non_power_of_two = GL_FALSE; -GLboolean _GLEE_ARB_point_sprite = GL_FALSE; -GLboolean _GLEE_ARB_fragment_program_shadow = GL_FALSE; -GLboolean _GLEE_ARB_draw_buffers = GL_FALSE; -GLboolean _GLEE_ARB_texture_rectangle = GL_FALSE; -GLboolean _GLEE_ARB_color_buffer_float = GL_FALSE; -GLboolean _GLEE_ARB_half_float_pixel = GL_FALSE; -GLboolean _GLEE_ARB_texture_float = GL_FALSE; -GLboolean _GLEE_ARB_pixel_buffer_object = GL_FALSE; -GLboolean _GLEE_ARB_depth_buffer_float = GL_FALSE; -GLboolean _GLEE_ARB_drawinstanced = GL_FALSE; -GLboolean _GLEE_ARB_framebuffer_object = GL_FALSE; -GLboolean _GLEE_ARB_framebuffer_sRGB = GL_FALSE; -GLboolean _GLEE_ARB_geometry_shader4 = GL_FALSE; -GLboolean _GLEE_ARB_half_float_vertex = GL_FALSE; -GLboolean _GLEE_ARBinstanced_arrays = GL_FALSE; -GLboolean _GLEE_ARB_map_buffer_range = GL_FALSE; -GLboolean _GLEE_ARB_texture_buffer_object = GL_FALSE; -GLboolean _GLEE_ARB_texture_compression_rgtc = GL_FALSE; -GLboolean _GLEE_ARB_texture_rg = GL_FALSE; -GLboolean _GLEE_ARB_vertex_array_object = GL_FALSE; -GLboolean _GLEE_EXT_abgr = GL_FALSE; -GLboolean _GLEE_EXT_blend_color = GL_FALSE; -GLboolean _GLEE_EXT_polygon_offset = GL_FALSE; -GLboolean _GLEE_EXT_texture = GL_FALSE; -GLboolean _GLEE_EXT_texture3D = GL_FALSE; -GLboolean _GLEE_SGIS_texture_filter4 = GL_FALSE; -GLboolean _GLEE_EXT_subtexture = GL_FALSE; -GLboolean _GLEE_EXT_copy_texture = GL_FALSE; -GLboolean _GLEE_EXT_histogram = GL_FALSE; -GLboolean _GLEE_EXT_convolution = GL_FALSE; -GLboolean _GLEE_SGI_color_matrix = GL_FALSE; -GLboolean _GLEE_SGI_color_table = GL_FALSE; -GLboolean _GLEE_SGIS_pixel_texture = GL_FALSE; -GLboolean _GLEE_SGIX_pixel_texture = GL_FALSE; -GLboolean _GLEE_SGIS_texture4D = GL_FALSE; -GLboolean _GLEE_SGI_texture_color_table = GL_FALSE; -GLboolean _GLEE_EXT_cmyka = GL_FALSE; -GLboolean _GLEE_EXT_texture_object = GL_FALSE; -GLboolean _GLEE_SGIS_detail_texture = GL_FALSE; -GLboolean _GLEE_SGIS_sharpen_texture = GL_FALSE; -GLboolean _GLEE_EXT_packed_pixels = GL_FALSE; -GLboolean _GLEE_SGIS_texture_lod = GL_FALSE; -GLboolean _GLEE_SGIS_multisample = GL_FALSE; -GLboolean _GLEE_EXT_rescale_normal = GL_FALSE; -GLboolean _GLEE_EXT_vertex_array = GL_FALSE; -GLboolean _GLEE_EXT_misc_attribute = GL_FALSE; -GLboolean _GLEE_SGIS_generate_mipmap = GL_FALSE; -GLboolean _GLEE_SGIX_clipmap = GL_FALSE; -GLboolean _GLEE_SGIX_shadow = GL_FALSE; -GLboolean _GLEE_SGIS_texture_edge_clamp = GL_FALSE; -GLboolean _GLEE_SGIS_texture_border_clamp = GL_FALSE; -GLboolean _GLEE_EXT_blend_minmax = GL_FALSE; -GLboolean _GLEE_EXT_blend_subtract = GL_FALSE; -GLboolean _GLEE_EXT_blend_logic_op = GL_FALSE; -GLboolean _GLEE_SGIX_interlace = GL_FALSE; -GLboolean _GLEE_SGIX_pixel_tiles = GL_FALSE; -GLboolean _GLEE_SGIS_texture_select = GL_FALSE; -GLboolean _GLEE_SGIX_sprite = GL_FALSE; -GLboolean _GLEE_SGIX_texture_multi_buffer = GL_FALSE; -GLboolean _GLEE_EXT_point_parameters = GL_FALSE; -GLboolean _GLEE_SGIS_point_parameters = GL_FALSE; -GLboolean _GLEE_SGIX_instruments = GL_FALSE; -GLboolean _GLEE_SGIX_texture_scale_bias = GL_FALSE; -GLboolean _GLEE_SGIX_framezoom = GL_FALSE; -GLboolean _GLEE_SGIX_tag_sample_buffer = GL_FALSE; -GLboolean _GLEE_FfdMaskSGIX = GL_FALSE; -GLboolean _GLEE_SGIX_polynomial_ffd = GL_FALSE; -GLboolean _GLEE_SGIX_reference_plane = GL_FALSE; -GLboolean _GLEE_SGIX_flush_raster = GL_FALSE; -GLboolean _GLEE_SGIX_depth_texture = GL_FALSE; -GLboolean _GLEE_SGIS_fog_function = GL_FALSE; -GLboolean _GLEE_SGIX_fog_offset = GL_FALSE; -GLboolean _GLEE_HP_image_transform = GL_FALSE; -GLboolean _GLEE_HP_convolution_border_modes = GL_FALSE; -GLboolean _GLEE_INGR_palette_buffer = GL_FALSE; -GLboolean _GLEE_SGIX_texture_add_env = GL_FALSE; -GLboolean _GLEE_EXT_color_subtable = GL_FALSE; -GLboolean _GLEE_PGI_vertex_hints = GL_FALSE; -GLboolean _GLEE_PGI_misc_hints = GL_FALSE; -GLboolean _GLEE_EXT_paletted_texture = GL_FALSE; -GLboolean _GLEE_EXT_clip_volume_hint = GL_FALSE; -GLboolean _GLEE_SGIX_list_priority = GL_FALSE; -GLboolean _GLEE_SGIX_ir_instrument1 = GL_FALSE; -GLboolean _GLEE_SGIX_calligraphic_fragment = GL_FALSE; -GLboolean _GLEE_SGIX_texture_lod_bias = GL_FALSE; -GLboolean _GLEE_SGIX_shadow_ambient = GL_FALSE; -GLboolean _GLEE_EXT_index_texture = GL_FALSE; -GLboolean _GLEE_EXT_index_material = GL_FALSE; -GLboolean _GLEE_EXT_index_func = GL_FALSE; -GLboolean _GLEE_EXT_index_array_formats = GL_FALSE; -GLboolean _GLEE_EXT_compiled_vertex_array = GL_FALSE; -GLboolean _GLEE_EXT_cull_vertex = GL_FALSE; -GLboolean _GLEE_SGIX_ycrcb = GL_FALSE; -GLboolean _GLEE_SGIX_fragment_lighting = GL_FALSE; -GLboolean _GLEE_IBM_rasterpos_clip = GL_FALSE; -GLboolean _GLEE_HP_texture_lighting = GL_FALSE; -GLboolean _GLEE_EXT_draw_range_elements = GL_FALSE; -GLboolean _GLEE_WIN_phong_shading = GL_FALSE; -GLboolean _GLEE_WIN_specular_fog = GL_FALSE; -GLboolean _GLEE_EXT_light_texture = GL_FALSE; -GLboolean _GLEE_SGIX_blend_alpha_minmax = GL_FALSE; -GLboolean _GLEE_SGIX_impact_pixel_texture = GL_FALSE; -GLboolean _GLEE_EXT_bgra = GL_FALSE; -GLboolean _GLEE_SGIX_async = GL_FALSE; -GLboolean _GLEE_SGIX_async_pixel = GL_FALSE; -GLboolean _GLEE_SGIX_async_histogram = GL_FALSE; -GLboolean _GLEE_INTEL_texture_scissor = GL_FALSE; -GLboolean _GLEE_INTEL_parallel_arrays = GL_FALSE; -GLboolean _GLEE_HP_occlusion_test = GL_FALSE; -GLboolean _GLEE_EXT_pixel_transform = GL_FALSE; -GLboolean _GLEE_EXT_pixel_transform_color_table = GL_FALSE; -GLboolean _GLEE_EXT_shared_texture_palette = GL_FALSE; -GLboolean _GLEE_EXT_separate_specular_color = GL_FALSE; -GLboolean _GLEE_EXT_secondary_color = GL_FALSE; -GLboolean _GLEE_EXT_texture_perturb_normal = GL_FALSE; -GLboolean _GLEE_EXT_multi_draw_arrays = GL_FALSE; -GLboolean _GLEE_EXT_fog_coord = GL_FALSE; -GLboolean _GLEE_REND_screen_coordinates = GL_FALSE; -GLboolean _GLEE_EXT_coordinate_frame = GL_FALSE; -GLboolean _GLEE_EXT_texture_env_combine = GL_FALSE; -GLboolean _GLEE_APPLE_specular_vector = GL_FALSE; -GLboolean _GLEE_APPLE_transform_hint = GL_FALSE; -GLboolean _GLEE_SGIX_fog_scale = GL_FALSE; -GLboolean _GLEE_SUNX_constant_data = GL_FALSE; -GLboolean _GLEE_SUN_global_alpha = GL_FALSE; -GLboolean _GLEE_SUN_triangle_list = GL_FALSE; -GLboolean _GLEE_SUN_vertex = GL_FALSE; -GLboolean _GLEE_EXT_blend_func_separate = GL_FALSE; -GLboolean _GLEE_INGR_color_clamp = GL_FALSE; -GLboolean _GLEE_INGR_interlace_read = GL_FALSE; -GLboolean _GLEE_EXT_stencil_wrap = GL_FALSE; -GLboolean _GLEE_EXT_422_pixels = GL_FALSE; -GLboolean _GLEE_NV_texgen_reflection = GL_FALSE; -GLboolean _GLEE_EXT_texture_cube_map = GL_FALSE; -GLboolean _GLEE_SUN_convolution_border_modes = GL_FALSE; -GLboolean _GLEE_EXT_texture_env_add = GL_FALSE; -GLboolean _GLEE_EXT_texture_lod_bias = GL_FALSE; -GLboolean _GLEE_EXT_texture_filter_anisotropic = GL_FALSE; -GLboolean _GLEE_EXT_vertex_weighting = GL_FALSE; -GLboolean _GLEE_NV_light_max_exponent = GL_FALSE; -GLboolean _GLEE_NV_vertex_array_range = GL_FALSE; -GLboolean _GLEE_NV_register_combiners = GL_FALSE; -GLboolean _GLEE_NV_fog_distance = GL_FALSE; -GLboolean _GLEE_NV_texgen_emboss = GL_FALSE; -GLboolean _GLEE_NV_blend_square = GL_FALSE; -GLboolean _GLEE_NV_texture_env_combine4 = GL_FALSE; -GLboolean _GLEE_MESA_resize_buffers = GL_FALSE; -GLboolean _GLEE_MESA_window_pos = GL_FALSE; -GLboolean _GLEE_EXT_texture_compression_s3tc = GL_FALSE; -GLboolean _GLEE_IBM_cull_vertex = GL_FALSE; -GLboolean _GLEE_IBM_multimode_draw_arrays = GL_FALSE; -GLboolean _GLEE_IBM_vertex_array_lists = GL_FALSE; -GLboolean _GLEE_SGIX_subsample = GL_FALSE; -GLboolean _GLEE_SGIX_ycrcb_subsample = GL_FALSE; -GLboolean _GLEE_SGIX_ycrcba = GL_FALSE; -GLboolean _GLEE_SGI_depth_pass_instrument = GL_FALSE; -GLboolean _GLEE_3DFX_texture_compression_FXT1 = GL_FALSE; -GLboolean _GLEE_3DFX_multisample = GL_FALSE; -GLboolean _GLEE_3DFX_tbuffer = GL_FALSE; -GLboolean _GLEE_EXT_multisample = GL_FALSE; -GLboolean _GLEE_SGIX_vertex_preclip = GL_FALSE; -GLboolean _GLEE_SGIX_convolution_accuracy = GL_FALSE; -GLboolean _GLEE_SGIX_resample = GL_FALSE; -GLboolean _GLEE_SGIS_point_line_texgen = GL_FALSE; -GLboolean _GLEE_SGIS_texture_color_mask = GL_FALSE; -GLboolean _GLEE_EXT_texture_env_dot3 = GL_FALSE; -GLboolean _GLEE_ATI_texture_mirror_once = GL_FALSE; -GLboolean _GLEE_NV_fence = GL_FALSE; -GLboolean _GLEE_IBM_texture_mirrored_repeat = GL_FALSE; -GLboolean _GLEE_NV_evaluators = GL_FALSE; -GLboolean _GLEE_NV_packed_depth_stencil = GL_FALSE; -GLboolean _GLEE_NV_register_combiners2 = GL_FALSE; -GLboolean _GLEE_NV_texture_compression_vtc = GL_FALSE; -GLboolean _GLEE_NV_texture_rectangle = GL_FALSE; -GLboolean _GLEE_NV_texture_shader = GL_FALSE; -GLboolean _GLEE_NV_texture_shader2 = GL_FALSE; -GLboolean _GLEE_NV_vertex_array_range2 = GL_FALSE; -GLboolean _GLEE_NV_vertex_program = GL_FALSE; -GLboolean _GLEE_SGIX_texture_coordinate_clamp = GL_FALSE; -GLboolean _GLEE_SGIX_scalebias_hint = GL_FALSE; -GLboolean _GLEE_OML_interlace = GL_FALSE; -GLboolean _GLEE_OML_subsample = GL_FALSE; -GLboolean _GLEE_OML_resample = GL_FALSE; -GLboolean _GLEE_NV_copy_depth_to_color = GL_FALSE; -GLboolean _GLEE_ATI_envmap_bumpmap = GL_FALSE; -GLboolean _GLEE_ATI_fragment_shader = GL_FALSE; -GLboolean _GLEE_ATI_pn_triangles = GL_FALSE; -GLboolean _GLEE_ATI_vertex_array_object = GL_FALSE; -GLboolean _GLEE_EXT_vertex_shader = GL_FALSE; -GLboolean _GLEE_ATI_vertex_streams = GL_FALSE; -GLboolean _GLEE_ATI_element_array = GL_FALSE; -GLboolean _GLEE_SUN_mesh_array = GL_FALSE; -GLboolean _GLEE_SUN_slice_accum = GL_FALSE; -GLboolean _GLEE_NV_multisample_filter_hint = GL_FALSE; -GLboolean _GLEE_NV_depth_clamp = GL_FALSE; -GLboolean _GLEE_NV_occlusion_query = GL_FALSE; -GLboolean _GLEE_NV_point_sprite = GL_FALSE; -GLboolean _GLEE_NV_texture_shader3 = GL_FALSE; -GLboolean _GLEE_NV_vertex_program1_1 = GL_FALSE; -GLboolean _GLEE_EXT_shadow_funcs = GL_FALSE; -GLboolean _GLEE_EXT_stencil_two_side = GL_FALSE; -GLboolean _GLEE_ATI_text_fragment_shader = GL_FALSE; -GLboolean _GLEE_APPLE_client_storage = GL_FALSE; -GLboolean _GLEE_APPLE_element_array = GL_FALSE; -GLboolean _GLEE_APPLE_fence = GL_FALSE; -GLboolean _GLEE_APPLE_vertex_array_object = GL_FALSE; -GLboolean _GLEE_APPLE_vertex_array_range = GL_FALSE; -GLboolean _GLEE_APPLE_ycbcr_422 = GL_FALSE; -GLboolean _GLEE_S3_s3tc = GL_FALSE; -GLboolean _GLEE_ATI_draw_buffers = GL_FALSE; -GLboolean _GLEE_ATI_pixel_format_float = GL_FALSE; -GLboolean _GLEE_ATI_texture_env_combine3 = GL_FALSE; -GLboolean _GLEE_ATI_texture_float = GL_FALSE; -GLboolean _GLEE_NV_float_buffer = GL_FALSE; -GLboolean _GLEE_NV_fragment_program = GL_FALSE; -GLboolean _GLEE_NV_half_float = GL_FALSE; -GLboolean _GLEE_NV_pixel_data_range = GL_FALSE; -GLboolean _GLEE_NV_primitive_restart = GL_FALSE; -GLboolean _GLEE_NV_texture_expand_normal = GL_FALSE; -GLboolean _GLEE_NV_vertex_program2 = GL_FALSE; -GLboolean _GLEE_ATI_map_object_buffer = GL_FALSE; -GLboolean _GLEE_ATI_separate_stencil = GL_FALSE; -GLboolean _GLEE_ATI_vertex_attrib_array_object = GL_FALSE; -GLboolean _GLEE_OES_read_format = GL_FALSE; -GLboolean _GLEE_EXT_depth_bounds_test = GL_FALSE; -GLboolean _GLEE_EXT_texture_mirror_clamp = GL_FALSE; -GLboolean _GLEE_EXT_blend_equation_separate = GL_FALSE; -GLboolean _GLEE_MESA_pack_invert = GL_FALSE; -GLboolean _GLEE_MESA_ycbcr_texture = GL_FALSE; -GLboolean _GLEE_EXT_pixel_buffer_object = GL_FALSE; -GLboolean _GLEE_NV_fragment_program_option = GL_FALSE; -GLboolean _GLEE_NV_fragment_program2 = GL_FALSE; -GLboolean _GLEE_NV_vertex_program2_option = GL_FALSE; -GLboolean _GLEE_NV_vertex_program3 = GL_FALSE; -GLboolean _GLEE_EXT_framebuffer_object = GL_FALSE; -GLboolean _GLEE_GREMEDY_string_marker = GL_FALSE; -GLboolean _GLEE_EXT_packed_depth_stencil = GL_FALSE; -GLboolean _GLEE_EXT_stencil_clear_tag = GL_FALSE; -GLboolean _GLEE_EXT_texture_sRGB = GL_FALSE; -GLboolean _GLEE_EXT_framebuffer_blit = GL_FALSE; -GLboolean _GLEE_EXT_framebuffer_multisample = GL_FALSE; -GLboolean _GLEE_MESAX_texture_stack = GL_FALSE; -GLboolean _GLEE_EXT_timer_query = GL_FALSE; -GLboolean _GLEE_EXT_gpu_program_parameters = GL_FALSE; -GLboolean _GLEE_APPLE_flush_buffer_range = GL_FALSE; -GLboolean _GLEE_NV_gpu_program4 = GL_FALSE; -GLboolean _GLEE_NV_geometry_program4 = GL_FALSE; -GLboolean _GLEE_EXT_geometry_shader4 = GL_FALSE; -GLboolean _GLEE_NV_vertex_program4 = GL_FALSE; -GLboolean _GLEE_EXT_gpu_shader4 = GL_FALSE; -GLboolean _GLEE_EXT_drawinstanced = GL_FALSE; -GLboolean _GLEE_EXT_packed_float = GL_FALSE; -GLboolean _GLEE_EXT_texture_array = GL_FALSE; -GLboolean _GLEE_EXT_texture_buffer_object = GL_FALSE; -GLboolean _GLEE_EXT_texture_compression_latc = GL_FALSE; -GLboolean _GLEE_EXT_texture_compression_rgtc = GL_FALSE; -GLboolean _GLEE_EXT_texture_shared_exponent = GL_FALSE; -GLboolean _GLEE_NV_depth_buffer_float = GL_FALSE; -GLboolean _GLEE_NV_fragment_program4 = GL_FALSE; -GLboolean _GLEE_NV_framebuffer_multisample_coverage = GL_FALSE; -GLboolean _GLEE_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean _GLEE_NV_geometry_shader4 = GL_FALSE; -GLboolean _GLEE_NV_parameter_buffer_object = GL_FALSE; -GLboolean _GLEE_EXT_draw_buffers2 = GL_FALSE; -GLboolean _GLEE_NV_transform_feedback = GL_FALSE; -GLboolean _GLEE_EXT_bindable_uniform = GL_FALSE; -GLboolean _GLEE_EXT_texture_integer = GL_FALSE; -GLboolean _GLEE_GREMEDY_frame_terminator = GL_FALSE; -GLboolean _GLEE_NV_conditional_render = GL_FALSE; -GLboolean _GLEE_NV_present_video = GL_FALSE; -GLboolean _GLEE_EXT_transform_feedback = GL_FALSE; -GLboolean _GLEE_EXT_direct_state_access = GL_FALSE; -GLboolean _GLEE_EXT_vertex_array_bgra = GL_FALSE; -GLboolean _GLEE_SGIX_texture_select = GL_FALSE; -GLboolean _GLEE_INGR_blend_func_separate = GL_FALSE; -GLboolean _GLEE_SGIX_depth_pass_instrument = GL_FALSE; -GLboolean _GLEE_SGIX_igloo_interface = GL_FALSE; -GLboolean _GLEE_EXT_fragment_lighting = GL_FALSE; -GLboolean _GLEE_EXT_scene_marker = GL_FALSE; -GLboolean _GLEE_EXT_texture_compression_dxt1 = GL_FALSE; -GLboolean _GLEE_EXT_texture_env = GL_FALSE; -GLboolean _GLEE_IBM_static_data = GL_FALSE; -GLboolean _GLEE_OES_byte_coordinates = GL_FALSE; -GLboolean _GLEE_OES_compressed_paletted_texture = GL_FALSE; -GLboolean _GLEE_OES_single_precision = GL_FALSE; -GLboolean _GLEE_SGIX_pixel_texture_bits = GL_FALSE; -GLboolean _GLEE_SGIX_texture_range = GL_FALSE; - -/* GL Extension names */ - -char __GLeeGLExtensionNames[322][39]={ - "GL_VERSION_1_2", - "GL_ARB_imaging", - "GL_VERSION_1_3", - "GL_VERSION_1_4", - "GL_VERSION_1_5", - "GL_VERSION_2_0", - "GL_VERSION_2_1", - "GL_VERSION_3_0", - "GL_ARB_multitexture", - "GL_ARB_transpose_matrix", - "GL_ARB_multisample", - "GL_ARB_texture_env_add", - "GL_ARB_texture_cube_map", - "GL_ARB_texture_compression", - "GL_ARB_texture_border_clamp", - "GL_ARB_point_parameters", - "GL_ARB_vertex_blend", - "GL_ARB_matrix_palette", - "GL_ARB_texture_env_combine", - "GL_ARB_texture_env_crossbar", - "GL_ARB_texture_env_dot3", - "GL_ARB_texture_mirrored_repeat", - "GL_ARB_depth_texture", - "GL_ARB_shadow", - "GL_ARB_shadow_ambient", - "GL_ARB_window_pos", - "GL_ARB_vertex_program", - "GL_ARB_fragment_program", - "GL_ARB_vertex_buffer_object", - "GL_ARB_occlusion_query", - "GL_ARB_shader_objects", - "GL_ARB_vertex_shader", - "GL_ARB_fragment_shader", - "GL_ARB_shading_language_100", - "GL_ARB_texture_non_power_of_two", - "GL_ARB_point_sprite", - "GL_ARB_fragment_program_shadow", - "GL_ARB_draw_buffers", - "GL_ARB_texture_rectangle", - "GL_ARB_color_buffer_float", - "GL_ARB_half_float_pixel", - "GL_ARB_texture_float", - "GL_ARB_pixel_buffer_object", - "GL_ARB_depth_buffer_float", - "GL_ARB_drawinstanced", - "GL_ARB_framebuffer_object", - "GL_ARB_framebuffer_sRGB", - "GL_ARB_geometry_shader4", - "GL_ARB_half_float_vertex", - "GL_ARBinstanced_arrays", - "GL_ARB_map_buffer_range", - "GL_ARB_texture_buffer_object", - "GL_ARB_texture_compression_rgtc", - "GL_ARB_texture_rg", - "GL_ARB_vertex_array_object", - "GL_EXT_abgr", - "GL_EXT_blend_color", - "GL_EXT_polygon_offset", - "GL_EXT_texture", - "GL_EXT_texture3D", - "GL_SGIS_texture_filter4", - "GL_EXT_subtexture", - "GL_EXT_copy_texture", - "GL_EXT_histogram", - "GL_EXT_convolution", - "GL_SGI_color_matrix", - "GL_SGI_color_table", - "GL_SGIS_pixel_texture", - "GL_SGIX_pixel_texture", - "GL_SGIS_texture4D", - "GL_SGI_texture_color_table", - "GL_EXT_cmyka", - "GL_EXT_texture_object", - "GL_SGIS_detail_texture", - "GL_SGIS_sharpen_texture", - "GL_EXT_packed_pixels", - "GL_SGIS_texture_lod", - "GL_SGIS_multisample", - "GL_EXT_rescale_normal", - "GL_EXT_vertex_array", - "GL_EXT_misc_attribute", - "GL_SGIS_generate_mipmap", - "GL_SGIX_clipmap", - "GL_SGIX_shadow", - "GL_SGIS_texture_edge_clamp", - "GL_SGIS_texture_border_clamp", - "GL_EXT_blend_minmax", - "GL_EXT_blend_subtract", - "GL_EXT_blend_logic_op", - "GL_SGIX_interlace", - "GL_SGIX_pixel_tiles", - "GL_SGIS_texture_select", - "GL_SGIX_sprite", - "GL_SGIX_texture_multi_buffer", - "GL_EXT_point_parameters", - "GL_SGIS_point_parameters", - "GL_SGIX_instruments", - "GL_SGIX_texture_scale_bias", - "GL_SGIX_framezoom", - "GL_SGIX_tag_sample_buffer", - "GL_FfdMaskSGIX", - "GL_SGIX_polynomial_ffd", - "GL_SGIX_reference_plane", - "GL_SGIX_flush_raster", - "GL_SGIX_depth_texture", - "GL_SGIS_fog_function", - "GL_SGIX_fog_offset", - "GL_HP_image_transform", - "GL_HP_convolution_border_modes", - "GL_INGR_palette_buffer", - "GL_SGIX_texture_add_env", - "GL_EXT_color_subtable", - "GL_PGI_vertex_hints", - "GL_PGI_misc_hints", - "GL_EXT_paletted_texture", - "GL_EXT_clip_volume_hint", - "GL_SGIX_list_priority", - "GL_SGIX_ir_instrument1", - "GL_SGIX_calligraphic_fragment", - "GL_SGIX_texture_lod_bias", - "GL_SGIX_shadow_ambient", - "GL_EXT_index_texture", - "GL_EXT_index_material", - "GL_EXT_index_func", - "GL_EXT_index_array_formats", - "GL_EXT_compiled_vertex_array", - "GL_EXT_cull_vertex", - "GL_SGIX_ycrcb", - "GL_SGIX_fragment_lighting", - "GL_IBM_rasterpos_clip", - "GL_HP_texture_lighting", - "GL_EXT_draw_range_elements", - "GL_WIN_phong_shading", - "GL_WIN_specular_fog", - "GL_EXT_light_texture", - "GL_SGIX_blend_alpha_minmax", - "GL_SGIX_impact_pixel_texture", - "GL_EXT_bgra", - "GL_SGIX_async", - "GL_SGIX_async_pixel", - "GL_SGIX_async_histogram", - "GL_INTEL_texture_scissor", - "GL_INTEL_parallel_arrays", - "GL_HP_occlusion_test", - "GL_EXT_pixel_transform", - "GL_EXT_pixel_transform_color_table", - "GL_EXT_shared_texture_palette", - "GL_EXT_separate_specular_color", - "GL_EXT_secondary_color", - "GL_EXT_texture_perturb_normal", - "GL_EXT_multi_draw_arrays", - "GL_EXT_fog_coord", - "GL_REND_screen_coordinates", - "GL_EXT_coordinate_frame", - "GL_EXT_texture_env_combine", - "GL_APPLE_specular_vector", - "GL_APPLE_transform_hint", - "GL_SGIX_fog_scale", - "GL_SUNX_constant_data", - "GL_SUN_global_alpha", - "GL_SUN_triangle_list", - "GL_SUN_vertex", - "GL_EXT_blend_func_separate", - "GL_INGR_color_clamp", - "GL_INGR_interlace_read", - "GL_EXT_stencil_wrap", - "GL_EXT_422_pixels", - "GL_NV_texgen_reflection", - "GL_EXT_texture_cube_map", - "GL_SUN_convolution_border_modes", - "GL_EXT_texture_env_add", - "GL_EXT_texture_lod_bias", - "GL_EXT_texture_filter_anisotropic", - "GL_EXT_vertex_weighting", - "GL_NV_light_max_exponent", - "GL_NV_vertex_array_range", - "GL_NV_register_combiners", - "GL_NV_fog_distance", - "GL_NV_texgen_emboss", - "GL_NV_blend_square", - "GL_NV_texture_env_combine4", - "GL_MESA_resize_buffers", - "GL_MESA_window_pos", - "GL_EXT_texture_compression_s3tc", - "GL_IBM_cull_vertex", - "GL_IBM_multimode_draw_arrays", - "GL_IBM_vertex_array_lists", - "GL_SGIX_subsample", - "GL_SGIX_ycrcb_subsample", - "GL_SGIX_ycrcba", - "GL_SGI_depth_pass_instrument", - "GL_3DFX_texture_compression_FXT1", - "GL_3DFX_multisample", - "GL_3DFX_tbuffer", - "GL_EXT_multisample", - "GL_SGIX_vertex_preclip", - "GL_SGIX_convolution_accuracy", - "GL_SGIX_resample", - "GL_SGIS_point_line_texgen", - "GL_SGIS_texture_color_mask", - "GL_EXT_texture_env_dot3", - "GL_ATI_texture_mirror_once", - "GL_NV_fence", - "GL_IBM_texture_mirrored_repeat", - "GL_NV_evaluators", - "GL_NV_packed_depth_stencil", - "GL_NV_register_combiners2", - "GL_NV_texture_compression_vtc", - "GL_NV_texture_rectangle", - "GL_NV_texture_shader", - "GL_NV_texture_shader2", - "GL_NV_vertex_array_range2", - "GL_NV_vertex_program", - "GL_SGIX_texture_coordinate_clamp", - "GL_SGIX_scalebias_hint", - "GL_OML_interlace", - "GL_OML_subsample", - "GL_OML_resample", - "GL_NV_copy_depth_to_color", - "GL_ATI_envmap_bumpmap", - "GL_ATI_fragment_shader", - "GL_ATI_pn_triangles", - "GL_ATI_vertex_array_object", - "GL_EXT_vertex_shader", - "GL_ATI_vertex_streams", - "GL_ATI_element_array", - "GL_SUN_mesh_array", - "GL_SUN_slice_accum", - "GL_NV_multisample_filter_hint", - "GL_NV_depth_clamp", - "GL_NV_occlusion_query", - "GL_NV_point_sprite", - "GL_NV_texture_shader3", - "GL_NV_vertex_program1_1", - "GL_EXT_shadow_funcs", - "GL_EXT_stencil_two_side", - "GL_ATI_text_fragment_shader", - "GL_APPLE_client_storage", - "GL_APPLE_element_array", - "GL_APPLE_fence", - "GL_APPLE_vertex_array_object", - "GL_APPLE_vertex_array_range", - "GL_APPLE_ycbcr_422", - "GL_S3_s3tc", - "GL_ATI_draw_buffers", - "GL_ATI_pixel_format_float", - "GL_ATI_texture_env_combine3", - "GL_ATI_texture_float", - "GL_NV_float_buffer", - "GL_NV_fragment_program", - "GL_NV_half_float", - "GL_NV_pixel_data_range", - "GL_NV_primitive_restart", - "GL_NV_texture_expand_normal", - "GL_NV_vertex_program2", - "GL_ATI_map_object_buffer", - "GL_ATI_separate_stencil", - "GL_ATI_vertex_attrib_array_object", - "GL_OES_read_format", - "GL_EXT_depth_bounds_test", - "GL_EXT_texture_mirror_clamp", - "GL_EXT_blend_equation_separate", - "GL_MESA_pack_invert", - "GL_MESA_ycbcr_texture", - "GL_EXT_pixel_buffer_object", - "GL_NV_fragment_program_option", - "GL_NV_fragment_program2", - "GL_NV_vertex_program2_option", - "GL_NV_vertex_program3", - "GL_EXT_framebuffer_object", - "GL_GREMEDY_string_marker", - "GL_EXT_packed_depth_stencil", - "GL_EXT_stencil_clear_tag", - "GL_EXT_texture_sRGB", - "GL_EXT_framebuffer_blit", - "GL_EXT_framebuffer_multisample", - "GL_MESAX_texture_stack", - "GL_EXT_timer_query", - "GL_EXT_gpu_program_parameters", - "GL_APPLE_flush_buffer_range", - "GL_NV_gpu_program4", - "GL_NV_geometry_program4", - "GL_EXT_geometry_shader4", - "GL_NV_vertex_program4", - "GL_EXT_gpu_shader4", - "GL_EXT_drawinstanced", - "GL_EXT_packed_float", - "GL_EXT_texture_array", - "GL_EXT_texture_buffer_object", - "GL_EXT_texture_compression_latc", - "GL_EXT_texture_compression_rgtc", - "GL_EXT_texture_shared_exponent", - "GL_NV_depth_buffer_float", - "GL_NV_fragment_program4", - "GL_NV_framebuffer_multisample_coverage", - "GL_EXT_framebuffer_sRGB", - "GL_NV_geometry_shader4", - "GL_NV_parameter_buffer_object", - "GL_EXT_draw_buffers2", - "GL_NV_transform_feedback", - "GL_EXT_bindable_uniform", - "GL_EXT_texture_integer", - "GL_GREMEDY_frame_terminator", - "GL_NV_conditional_render", - "GL_NV_present_video", - "GL_EXT_transform_feedback", - "GL_EXT_direct_state_access", - "GL_EXT_vertex_array_bgra", - "GL_SGIX_texture_select", - "GL_INGR_blend_func_separate", - "GL_SGIX_depth_pass_instrument", - "GL_SGIX_igloo_interface", - "GL_EXT_fragment_lighting", - "GL_EXT_scene_marker", - "GL_EXT_texture_compression_dxt1", - "GL_EXT_texture_env", - "GL_IBM_static_data", - "GL_OES_byte_coordinates", - "GL_OES_compressed_paletted_texture", - "GL_OES_single_precision", - "GL_SGIX_pixel_texture_bits", - "GL_SGIX_texture_range" -}; -int __GLeeGLNumExtensions=322; - -/* GL_VERSION_1_2 */ - -#ifdef __GLEE_GL_VERSION_1_2 -void __stdcall _Lazy_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {if (GLeeInit()) glBlendColor(red, green, blue, alpha);} -void __stdcall _Lazy_glBlendEquation(GLenum mode) {if (GLeeInit()) glBlendEquation(mode);} -void __stdcall _Lazy_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) {if (GLeeInit()) glDrawRangeElements(mode, start, end, count, type, indices);} -void __stdcall _Lazy_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) {if (GLeeInit()) glColorTable(target, internalformat, width, format, type, table);} -void __stdcall _Lazy_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glColorTableParameterfv(target, pname, params);} -void __stdcall _Lazy_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glColorTableParameteriv(target, pname, params);} -void __stdcall _Lazy_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyColorTable(target, internalformat, x, y, width);} -void __stdcall _Lazy_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table) {if (GLeeInit()) glGetColorTable(target, format, type, table);} -void __stdcall _Lazy_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetColorTableParameterfv(target, pname, params);} -void __stdcall _Lazy_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetColorTableParameteriv(target, pname, params);} -void __stdcall _Lazy_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) {if (GLeeInit()) glColorSubTable(target, start, count, format, type, data);} -void __stdcall _Lazy_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyColorSubTable(target, start, x, y, width);} -void __stdcall _Lazy_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) {if (GLeeInit()) glConvolutionFilter1D(target, internalformat, width, format, type, image);} -void __stdcall _Lazy_glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) {if (GLeeInit()) glConvolutionFilter2D(target, internalformat, width, height, format, type, image);} -void __stdcall _Lazy_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params) {if (GLeeInit()) glConvolutionParameterf(target, pname, params);} -void __stdcall _Lazy_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glConvolutionParameterfv(target, pname, params);} -void __stdcall _Lazy_glConvolutionParameteri(GLenum target, GLenum pname, GLint params) {if (GLeeInit()) glConvolutionParameteri(target, pname, params);} -void __stdcall _Lazy_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glConvolutionParameteriv(target, pname, params);} -void __stdcall _Lazy_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyConvolutionFilter1D(target, internalformat, x, y, width);} -void __stdcall _Lazy_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyConvolutionFilter2D(target, internalformat, x, y, width, height);} -void __stdcall _Lazy_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image) {if (GLeeInit()) glGetConvolutionFilter(target, format, type, image);} -void __stdcall _Lazy_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetConvolutionParameterfv(target, pname, params);} -void __stdcall _Lazy_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetConvolutionParameteriv(target, pname, params);} -void __stdcall _Lazy_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) {if (GLeeInit()) glGetSeparableFilter(target, format, type, row, column, span);} -void __stdcall _Lazy_glSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) {if (GLeeInit()) glSeparableFilter2D(target, internalformat, width, height, format, type, row, column);} -void __stdcall _Lazy_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) {if (GLeeInit()) glGetHistogram(target, reset, format, type, values);} -void __stdcall _Lazy_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetHistogramParameterfv(target, pname, params);} -void __stdcall _Lazy_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetHistogramParameteriv(target, pname, params);} -void __stdcall _Lazy_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) {if (GLeeInit()) glGetMinmax(target, reset, format, type, values);} -void __stdcall _Lazy_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMinmaxParameterfv(target, pname, params);} -void __stdcall _Lazy_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMinmaxParameteriv(target, pname, params);} -void __stdcall _Lazy_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) {if (GLeeInit()) glHistogram(target, width, internalformat, sink);} -void __stdcall _Lazy_glMinmax(GLenum target, GLenum internalformat, GLboolean sink) {if (GLeeInit()) glMinmax(target, internalformat, sink);} -void __stdcall _Lazy_glResetHistogram(GLenum target) {if (GLeeInit()) glResetHistogram(target);} -void __stdcall _Lazy_glResetMinmax(GLenum target) {if (GLeeInit()) glResetMinmax(target);} -void __stdcall _Lazy_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);} -void __stdcall _Lazy_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);} -void __stdcall _Lazy_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);} -PFNGLBLENDCOLORPROC pglBlendColor=_Lazy_glBlendColor; -PFNGLBLENDEQUATIONPROC pglBlendEquation=_Lazy_glBlendEquation; -PFNGLDRAWRANGEELEMENTSPROC pglDrawRangeElements=_Lazy_glDrawRangeElements; -PFNGLCOLORTABLEPROC pglColorTable=_Lazy_glColorTable; -PFNGLCOLORTABLEPARAMETERFVPROC pglColorTableParameterfv=_Lazy_glColorTableParameterfv; -PFNGLCOLORTABLEPARAMETERIVPROC pglColorTableParameteriv=_Lazy_glColorTableParameteriv; -PFNGLCOPYCOLORTABLEPROC pglCopyColorTable=_Lazy_glCopyColorTable; -PFNGLGETCOLORTABLEPROC pglGetColorTable=_Lazy_glGetColorTable; -PFNGLGETCOLORTABLEPARAMETERFVPROC pglGetColorTableParameterfv=_Lazy_glGetColorTableParameterfv; -PFNGLGETCOLORTABLEPARAMETERIVPROC pglGetColorTableParameteriv=_Lazy_glGetColorTableParameteriv; -PFNGLCOLORSUBTABLEPROC pglColorSubTable=_Lazy_glColorSubTable; -PFNGLCOPYCOLORSUBTABLEPROC pglCopyColorSubTable=_Lazy_glCopyColorSubTable; -PFNGLCONVOLUTIONFILTER1DPROC pglConvolutionFilter1D=_Lazy_glConvolutionFilter1D; -PFNGLCONVOLUTIONFILTER2DPROC pglConvolutionFilter2D=_Lazy_glConvolutionFilter2D; -PFNGLCONVOLUTIONPARAMETERFPROC pglConvolutionParameterf=_Lazy_glConvolutionParameterf; -PFNGLCONVOLUTIONPARAMETERFVPROC pglConvolutionParameterfv=_Lazy_glConvolutionParameterfv; -PFNGLCONVOLUTIONPARAMETERIPROC pglConvolutionParameteri=_Lazy_glConvolutionParameteri; -PFNGLCONVOLUTIONPARAMETERIVPROC pglConvolutionParameteriv=_Lazy_glConvolutionParameteriv; -PFNGLCOPYCONVOLUTIONFILTER1DPROC pglCopyConvolutionFilter1D=_Lazy_glCopyConvolutionFilter1D; -PFNGLCOPYCONVOLUTIONFILTER2DPROC pglCopyConvolutionFilter2D=_Lazy_glCopyConvolutionFilter2D; -PFNGLGETCONVOLUTIONFILTERPROC pglGetConvolutionFilter=_Lazy_glGetConvolutionFilter; -PFNGLGETCONVOLUTIONPARAMETERFVPROC pglGetConvolutionParameterfv=_Lazy_glGetConvolutionParameterfv; -PFNGLGETCONVOLUTIONPARAMETERIVPROC pglGetConvolutionParameteriv=_Lazy_glGetConvolutionParameteriv; -PFNGLGETSEPARABLEFILTERPROC pglGetSeparableFilter=_Lazy_glGetSeparableFilter; -PFNGLSEPARABLEFILTER2DPROC pglSeparableFilter2D=_Lazy_glSeparableFilter2D; -PFNGLGETHISTOGRAMPROC pglGetHistogram=_Lazy_glGetHistogram; -PFNGLGETHISTOGRAMPARAMETERFVPROC pglGetHistogramParameterfv=_Lazy_glGetHistogramParameterfv; -PFNGLGETHISTOGRAMPARAMETERIVPROC pglGetHistogramParameteriv=_Lazy_glGetHistogramParameteriv; -PFNGLGETMINMAXPROC pglGetMinmax=_Lazy_glGetMinmax; -PFNGLGETMINMAXPARAMETERFVPROC pglGetMinmaxParameterfv=_Lazy_glGetMinmaxParameterfv; -PFNGLGETMINMAXPARAMETERIVPROC pglGetMinmaxParameteriv=_Lazy_glGetMinmaxParameteriv; -PFNGLHISTOGRAMPROC pglHistogram=_Lazy_glHistogram; -PFNGLMINMAXPROC pglMinmax=_Lazy_glMinmax; -PFNGLRESETHISTOGRAMPROC pglResetHistogram=_Lazy_glResetHistogram; -PFNGLRESETMINMAXPROC pglResetMinmax=_Lazy_glResetMinmax; -PFNGLTEXIMAGE3DPROC pglTexImage3D=_Lazy_glTexImage3D; -PFNGLTEXSUBIMAGE3DPROC pglTexSubImage3D=_Lazy_glTexSubImage3D; -PFNGLCOPYTEXSUBIMAGE3DPROC pglCopyTexSubImage3D=_Lazy_glCopyTexSubImage3D; -#endif - -/* GL_ARB_imaging */ - -#ifdef __GLEE_GL_ARB_imaging -#endif - -/* GL_VERSION_1_3 */ - -#ifdef __GLEE_GL_VERSION_1_3 -void __stdcall _Lazy_glActiveTexture(GLenum texture) {if (GLeeInit()) glActiveTexture(texture);} -void __stdcall _Lazy_glClientActiveTexture(GLenum texture) {if (GLeeInit()) glClientActiveTexture(texture);} -void __stdcall _Lazy_glMultiTexCoord1d(GLenum target, GLdouble s) {if (GLeeInit()) glMultiTexCoord1d(target, s);} -void __stdcall _Lazy_glMultiTexCoord1dv(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord1dv(target, v);} -void __stdcall _Lazy_glMultiTexCoord1f(GLenum target, GLfloat s) {if (GLeeInit()) glMultiTexCoord1f(target, s);} -void __stdcall _Lazy_glMultiTexCoord1fv(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord1fv(target, v);} -void __stdcall _Lazy_glMultiTexCoord1i(GLenum target, GLint s) {if (GLeeInit()) glMultiTexCoord1i(target, s);} -void __stdcall _Lazy_glMultiTexCoord1iv(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord1iv(target, v);} -void __stdcall _Lazy_glMultiTexCoord1s(GLenum target, GLshort s) {if (GLeeInit()) glMultiTexCoord1s(target, s);} -void __stdcall _Lazy_glMultiTexCoord1sv(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord1sv(target, v);} -void __stdcall _Lazy_glMultiTexCoord2d(GLenum target, GLdouble s, GLdouble t) {if (GLeeInit()) glMultiTexCoord2d(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2dv(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord2dv(target, v);} -void __stdcall _Lazy_glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t) {if (GLeeInit()) glMultiTexCoord2f(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2fv(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord2fv(target, v);} -void __stdcall _Lazy_glMultiTexCoord2i(GLenum target, GLint s, GLint t) {if (GLeeInit()) glMultiTexCoord2i(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2iv(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord2iv(target, v);} -void __stdcall _Lazy_glMultiTexCoord2s(GLenum target, GLshort s, GLshort t) {if (GLeeInit()) glMultiTexCoord2s(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2sv(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord2sv(target, v);} -void __stdcall _Lazy_glMultiTexCoord3d(GLenum target, GLdouble s, GLdouble t, GLdouble r) {if (GLeeInit()) glMultiTexCoord3d(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3dv(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord3dv(target, v);} -void __stdcall _Lazy_glMultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r) {if (GLeeInit()) glMultiTexCoord3f(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3fv(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord3fv(target, v);} -void __stdcall _Lazy_glMultiTexCoord3i(GLenum target, GLint s, GLint t, GLint r) {if (GLeeInit()) glMultiTexCoord3i(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3iv(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord3iv(target, v);} -void __stdcall _Lazy_glMultiTexCoord3s(GLenum target, GLshort s, GLshort t, GLshort r) {if (GLeeInit()) glMultiTexCoord3s(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3sv(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord3sv(target, v);} -void __stdcall _Lazy_glMultiTexCoord4d(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) {if (GLeeInit()) glMultiTexCoord4d(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4dv(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord4dv(target, v);} -void __stdcall _Lazy_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {if (GLeeInit()) glMultiTexCoord4f(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4fv(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord4fv(target, v);} -void __stdcall _Lazy_glMultiTexCoord4i(GLenum target, GLint s, GLint t, GLint r, GLint q) {if (GLeeInit()) glMultiTexCoord4i(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4iv(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord4iv(target, v);} -void __stdcall _Lazy_glMultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) {if (GLeeInit()) glMultiTexCoord4s(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4sv(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord4sv(target, v);} -void __stdcall _Lazy_glLoadTransposeMatrixf(const GLfloat * m) {if (GLeeInit()) glLoadTransposeMatrixf(m);} -void __stdcall _Lazy_glLoadTransposeMatrixd(const GLdouble * m) {if (GLeeInit()) glLoadTransposeMatrixd(m);} -void __stdcall _Lazy_glMultTransposeMatrixf(const GLfloat * m) {if (GLeeInit()) glMultTransposeMatrixf(m);} -void __stdcall _Lazy_glMultTransposeMatrixd(const GLdouble * m) {if (GLeeInit()) glMultTransposeMatrixd(m);} -void __stdcall _Lazy_glSampleCoverage(GLclampf value, GLboolean invert) {if (GLeeInit()) glSampleCoverage(value, invert);} -void __stdcall _Lazy_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);} -void __stdcall _Lazy_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);} -void __stdcall _Lazy_glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data);} -void __stdcall _Lazy_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);} -void __stdcall _Lazy_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);} -void __stdcall _Lazy_glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data);} -void __stdcall _Lazy_glGetCompressedTexImage(GLenum target, GLint level, GLvoid * img) {if (GLeeInit()) glGetCompressedTexImage(target, level, img);} -PFNGLACTIVETEXTUREPROC pglActiveTexture=_Lazy_glActiveTexture; -PFNGLCLIENTACTIVETEXTUREPROC pglClientActiveTexture=_Lazy_glClientActiveTexture; -PFNGLMULTITEXCOORD1DPROC pglMultiTexCoord1d=_Lazy_glMultiTexCoord1d; -PFNGLMULTITEXCOORD1DVPROC pglMultiTexCoord1dv=_Lazy_glMultiTexCoord1dv; -PFNGLMULTITEXCOORD1FPROC pglMultiTexCoord1f=_Lazy_glMultiTexCoord1f; -PFNGLMULTITEXCOORD1FVPROC pglMultiTexCoord1fv=_Lazy_glMultiTexCoord1fv; -PFNGLMULTITEXCOORD1IPROC pglMultiTexCoord1i=_Lazy_glMultiTexCoord1i; -PFNGLMULTITEXCOORD1IVPROC pglMultiTexCoord1iv=_Lazy_glMultiTexCoord1iv; -PFNGLMULTITEXCOORD1SPROC pglMultiTexCoord1s=_Lazy_glMultiTexCoord1s; -PFNGLMULTITEXCOORD1SVPROC pglMultiTexCoord1sv=_Lazy_glMultiTexCoord1sv; -PFNGLMULTITEXCOORD2DPROC pglMultiTexCoord2d=_Lazy_glMultiTexCoord2d; -PFNGLMULTITEXCOORD2DVPROC pglMultiTexCoord2dv=_Lazy_glMultiTexCoord2dv; -PFNGLMULTITEXCOORD2FPROC pglMultiTexCoord2f=_Lazy_glMultiTexCoord2f; -PFNGLMULTITEXCOORD2FVPROC pglMultiTexCoord2fv=_Lazy_glMultiTexCoord2fv; -PFNGLMULTITEXCOORD2IPROC pglMultiTexCoord2i=_Lazy_glMultiTexCoord2i; -PFNGLMULTITEXCOORD2IVPROC pglMultiTexCoord2iv=_Lazy_glMultiTexCoord2iv; -PFNGLMULTITEXCOORD2SPROC pglMultiTexCoord2s=_Lazy_glMultiTexCoord2s; -PFNGLMULTITEXCOORD2SVPROC pglMultiTexCoord2sv=_Lazy_glMultiTexCoord2sv; -PFNGLMULTITEXCOORD3DPROC pglMultiTexCoord3d=_Lazy_glMultiTexCoord3d; -PFNGLMULTITEXCOORD3DVPROC pglMultiTexCoord3dv=_Lazy_glMultiTexCoord3dv; -PFNGLMULTITEXCOORD3FPROC pglMultiTexCoord3f=_Lazy_glMultiTexCoord3f; -PFNGLMULTITEXCOORD3FVPROC pglMultiTexCoord3fv=_Lazy_glMultiTexCoord3fv; -PFNGLMULTITEXCOORD3IPROC pglMultiTexCoord3i=_Lazy_glMultiTexCoord3i; -PFNGLMULTITEXCOORD3IVPROC pglMultiTexCoord3iv=_Lazy_glMultiTexCoord3iv; -PFNGLMULTITEXCOORD3SPROC pglMultiTexCoord3s=_Lazy_glMultiTexCoord3s; -PFNGLMULTITEXCOORD3SVPROC pglMultiTexCoord3sv=_Lazy_glMultiTexCoord3sv; -PFNGLMULTITEXCOORD4DPROC pglMultiTexCoord4d=_Lazy_glMultiTexCoord4d; -PFNGLMULTITEXCOORD4DVPROC pglMultiTexCoord4dv=_Lazy_glMultiTexCoord4dv; -PFNGLMULTITEXCOORD4FPROC pglMultiTexCoord4f=_Lazy_glMultiTexCoord4f; -PFNGLMULTITEXCOORD4FVPROC pglMultiTexCoord4fv=_Lazy_glMultiTexCoord4fv; -PFNGLMULTITEXCOORD4IPROC pglMultiTexCoord4i=_Lazy_glMultiTexCoord4i; -PFNGLMULTITEXCOORD4IVPROC pglMultiTexCoord4iv=_Lazy_glMultiTexCoord4iv; -PFNGLMULTITEXCOORD4SPROC pglMultiTexCoord4s=_Lazy_glMultiTexCoord4s; -PFNGLMULTITEXCOORD4SVPROC pglMultiTexCoord4sv=_Lazy_glMultiTexCoord4sv; -PFNGLLOADTRANSPOSEMATRIXFPROC pglLoadTransposeMatrixf=_Lazy_glLoadTransposeMatrixf; -PFNGLLOADTRANSPOSEMATRIXDPROC pglLoadTransposeMatrixd=_Lazy_glLoadTransposeMatrixd; -PFNGLMULTTRANSPOSEMATRIXFPROC pglMultTransposeMatrixf=_Lazy_glMultTransposeMatrixf; -PFNGLMULTTRANSPOSEMATRIXDPROC pglMultTransposeMatrixd=_Lazy_glMultTransposeMatrixd; -PFNGLSAMPLECOVERAGEPROC pglSampleCoverage=_Lazy_glSampleCoverage; -PFNGLCOMPRESSEDTEXIMAGE3DPROC pglCompressedTexImage3D=_Lazy_glCompressedTexImage3D; -PFNGLCOMPRESSEDTEXIMAGE2DPROC pglCompressedTexImage2D=_Lazy_glCompressedTexImage2D; -PFNGLCOMPRESSEDTEXIMAGE1DPROC pglCompressedTexImage1D=_Lazy_glCompressedTexImage1D; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC pglCompressedTexSubImage3D=_Lazy_glCompressedTexSubImage3D; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC pglCompressedTexSubImage2D=_Lazy_glCompressedTexSubImage2D; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC pglCompressedTexSubImage1D=_Lazy_glCompressedTexSubImage1D; -PFNGLGETCOMPRESSEDTEXIMAGEPROC pglGetCompressedTexImage=_Lazy_glGetCompressedTexImage; -#endif - -/* GL_VERSION_1_4 */ - -#ifdef __GLEE_GL_VERSION_1_4 -void __stdcall _Lazy_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {if (GLeeInit()) glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);} -void __stdcall _Lazy_glFogCoordf(GLfloat coord) {if (GLeeInit()) glFogCoordf(coord);} -void __stdcall _Lazy_glFogCoordfv(const GLfloat * coord) {if (GLeeInit()) glFogCoordfv(coord);} -void __stdcall _Lazy_glFogCoordd(GLdouble coord) {if (GLeeInit()) glFogCoordd(coord);} -void __stdcall _Lazy_glFogCoorddv(const GLdouble * coord) {if (GLeeInit()) glFogCoorddv(coord);} -void __stdcall _Lazy_glFogCoordPointer(GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glFogCoordPointer(type, stride, pointer);} -void __stdcall _Lazy_glMultiDrawArrays(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) {if (GLeeInit()) glMultiDrawArrays(mode, first, count, primcount);} -void __stdcall _Lazy_glMultiDrawElements(GLenum mode, const GLsizei * count, GLenum type, const GLvoid* * indices, GLsizei primcount) {if (GLeeInit()) glMultiDrawElements(mode, count, type, indices, primcount);} -void __stdcall _Lazy_glPointParameterf(GLenum pname, GLfloat param) {if (GLeeInit()) glPointParameterf(pname, param);} -void __stdcall _Lazy_glPointParameterfv(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPointParameterfv(pname, params);} -void __stdcall _Lazy_glPointParameteri(GLenum pname, GLint param) {if (GLeeInit()) glPointParameteri(pname, param);} -void __stdcall _Lazy_glPointParameteriv(GLenum pname, const GLint * params) {if (GLeeInit()) glPointParameteriv(pname, params);} -void __stdcall _Lazy_glSecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue) {if (GLeeInit()) glSecondaryColor3b(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3bv(const GLbyte * v) {if (GLeeInit()) glSecondaryColor3bv(v);} -void __stdcall _Lazy_glSecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue) {if (GLeeInit()) glSecondaryColor3d(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3dv(const GLdouble * v) {if (GLeeInit()) glSecondaryColor3dv(v);} -void __stdcall _Lazy_glSecondaryColor3f(GLfloat red, GLfloat green, GLfloat blue) {if (GLeeInit()) glSecondaryColor3f(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3fv(const GLfloat * v) {if (GLeeInit()) glSecondaryColor3fv(v);} -void __stdcall _Lazy_glSecondaryColor3i(GLint red, GLint green, GLint blue) {if (GLeeInit()) glSecondaryColor3i(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3iv(const GLint * v) {if (GLeeInit()) glSecondaryColor3iv(v);} -void __stdcall _Lazy_glSecondaryColor3s(GLshort red, GLshort green, GLshort blue) {if (GLeeInit()) glSecondaryColor3s(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3sv(const GLshort * v) {if (GLeeInit()) glSecondaryColor3sv(v);} -void __stdcall _Lazy_glSecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue) {if (GLeeInit()) glSecondaryColor3ub(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3ubv(const GLubyte * v) {if (GLeeInit()) glSecondaryColor3ubv(v);} -void __stdcall _Lazy_glSecondaryColor3ui(GLuint red, GLuint green, GLuint blue) {if (GLeeInit()) glSecondaryColor3ui(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3uiv(const GLuint * v) {if (GLeeInit()) glSecondaryColor3uiv(v);} -void __stdcall _Lazy_glSecondaryColor3us(GLushort red, GLushort green, GLushort blue) {if (GLeeInit()) glSecondaryColor3us(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3usv(const GLushort * v) {if (GLeeInit()) glSecondaryColor3usv(v);} -void __stdcall _Lazy_glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glSecondaryColorPointer(size, type, stride, pointer);} -void __stdcall _Lazy_glWindowPos2d(GLdouble x, GLdouble y) {if (GLeeInit()) glWindowPos2d(x, y);} -void __stdcall _Lazy_glWindowPos2dv(const GLdouble * v) {if (GLeeInit()) glWindowPos2dv(v);} -void __stdcall _Lazy_glWindowPos2f(GLfloat x, GLfloat y) {if (GLeeInit()) glWindowPos2f(x, y);} -void __stdcall _Lazy_glWindowPos2fv(const GLfloat * v) {if (GLeeInit()) glWindowPos2fv(v);} -void __stdcall _Lazy_glWindowPos2i(GLint x, GLint y) {if (GLeeInit()) glWindowPos2i(x, y);} -void __stdcall _Lazy_glWindowPos2iv(const GLint * v) {if (GLeeInit()) glWindowPos2iv(v);} -void __stdcall _Lazy_glWindowPos2s(GLshort x, GLshort y) {if (GLeeInit()) glWindowPos2s(x, y);} -void __stdcall _Lazy_glWindowPos2sv(const GLshort * v) {if (GLeeInit()) glWindowPos2sv(v);} -void __stdcall _Lazy_glWindowPos3d(GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glWindowPos3d(x, y, z);} -void __stdcall _Lazy_glWindowPos3dv(const GLdouble * v) {if (GLeeInit()) glWindowPos3dv(v);} -void __stdcall _Lazy_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glWindowPos3f(x, y, z);} -void __stdcall _Lazy_glWindowPos3fv(const GLfloat * v) {if (GLeeInit()) glWindowPos3fv(v);} -void __stdcall _Lazy_glWindowPos3i(GLint x, GLint y, GLint z) {if (GLeeInit()) glWindowPos3i(x, y, z);} -void __stdcall _Lazy_glWindowPos3iv(const GLint * v) {if (GLeeInit()) glWindowPos3iv(v);} -void __stdcall _Lazy_glWindowPos3s(GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glWindowPos3s(x, y, z);} -void __stdcall _Lazy_glWindowPos3sv(const GLshort * v) {if (GLeeInit()) glWindowPos3sv(v);} -PFNGLBLENDFUNCSEPARATEPROC pglBlendFuncSeparate=_Lazy_glBlendFuncSeparate; -PFNGLFOGCOORDFPROC pglFogCoordf=_Lazy_glFogCoordf; -PFNGLFOGCOORDFVPROC pglFogCoordfv=_Lazy_glFogCoordfv; -PFNGLFOGCOORDDPROC pglFogCoordd=_Lazy_glFogCoordd; -PFNGLFOGCOORDDVPROC pglFogCoorddv=_Lazy_glFogCoorddv; -PFNGLFOGCOORDPOINTERPROC pglFogCoordPointer=_Lazy_glFogCoordPointer; -PFNGLMULTIDRAWARRAYSPROC pglMultiDrawArrays=_Lazy_glMultiDrawArrays; -PFNGLMULTIDRAWELEMENTSPROC pglMultiDrawElements=_Lazy_glMultiDrawElements; -PFNGLPOINTPARAMETERFPROC pglPointParameterf=_Lazy_glPointParameterf; -PFNGLPOINTPARAMETERFVPROC pglPointParameterfv=_Lazy_glPointParameterfv; -PFNGLPOINTPARAMETERIPROC pglPointParameteri=_Lazy_glPointParameteri; -PFNGLPOINTPARAMETERIVPROC pglPointParameteriv=_Lazy_glPointParameteriv; -PFNGLSECONDARYCOLOR3BPROC pglSecondaryColor3b=_Lazy_glSecondaryColor3b; -PFNGLSECONDARYCOLOR3BVPROC pglSecondaryColor3bv=_Lazy_glSecondaryColor3bv; -PFNGLSECONDARYCOLOR3DPROC pglSecondaryColor3d=_Lazy_glSecondaryColor3d; -PFNGLSECONDARYCOLOR3DVPROC pglSecondaryColor3dv=_Lazy_glSecondaryColor3dv; -PFNGLSECONDARYCOLOR3FPROC pglSecondaryColor3f=_Lazy_glSecondaryColor3f; -PFNGLSECONDARYCOLOR3FVPROC pglSecondaryColor3fv=_Lazy_glSecondaryColor3fv; -PFNGLSECONDARYCOLOR3IPROC pglSecondaryColor3i=_Lazy_glSecondaryColor3i; -PFNGLSECONDARYCOLOR3IVPROC pglSecondaryColor3iv=_Lazy_glSecondaryColor3iv; -PFNGLSECONDARYCOLOR3SPROC pglSecondaryColor3s=_Lazy_glSecondaryColor3s; -PFNGLSECONDARYCOLOR3SVPROC pglSecondaryColor3sv=_Lazy_glSecondaryColor3sv; -PFNGLSECONDARYCOLOR3UBPROC pglSecondaryColor3ub=_Lazy_glSecondaryColor3ub; -PFNGLSECONDARYCOLOR3UBVPROC pglSecondaryColor3ubv=_Lazy_glSecondaryColor3ubv; -PFNGLSECONDARYCOLOR3UIPROC pglSecondaryColor3ui=_Lazy_glSecondaryColor3ui; -PFNGLSECONDARYCOLOR3UIVPROC pglSecondaryColor3uiv=_Lazy_glSecondaryColor3uiv; -PFNGLSECONDARYCOLOR3USPROC pglSecondaryColor3us=_Lazy_glSecondaryColor3us; -PFNGLSECONDARYCOLOR3USVPROC pglSecondaryColor3usv=_Lazy_glSecondaryColor3usv; -PFNGLSECONDARYCOLORPOINTERPROC pglSecondaryColorPointer=_Lazy_glSecondaryColorPointer; -PFNGLWINDOWPOS2DPROC pglWindowPos2d=_Lazy_glWindowPos2d; -PFNGLWINDOWPOS2DVPROC pglWindowPos2dv=_Lazy_glWindowPos2dv; -PFNGLWINDOWPOS2FPROC pglWindowPos2f=_Lazy_glWindowPos2f; -PFNGLWINDOWPOS2FVPROC pglWindowPos2fv=_Lazy_glWindowPos2fv; -PFNGLWINDOWPOS2IPROC pglWindowPos2i=_Lazy_glWindowPos2i; -PFNGLWINDOWPOS2IVPROC pglWindowPos2iv=_Lazy_glWindowPos2iv; -PFNGLWINDOWPOS2SPROC pglWindowPos2s=_Lazy_glWindowPos2s; -PFNGLWINDOWPOS2SVPROC pglWindowPos2sv=_Lazy_glWindowPos2sv; -PFNGLWINDOWPOS3DPROC pglWindowPos3d=_Lazy_glWindowPos3d; -PFNGLWINDOWPOS3DVPROC pglWindowPos3dv=_Lazy_glWindowPos3dv; -PFNGLWINDOWPOS3FPROC pglWindowPos3f=_Lazy_glWindowPos3f; -PFNGLWINDOWPOS3FVPROC pglWindowPos3fv=_Lazy_glWindowPos3fv; -PFNGLWINDOWPOS3IPROC pglWindowPos3i=_Lazy_glWindowPos3i; -PFNGLWINDOWPOS3IVPROC pglWindowPos3iv=_Lazy_glWindowPos3iv; -PFNGLWINDOWPOS3SPROC pglWindowPos3s=_Lazy_glWindowPos3s; -PFNGLWINDOWPOS3SVPROC pglWindowPos3sv=_Lazy_glWindowPos3sv; -#endif - -/* GL_VERSION_1_5 */ - -#ifdef __GLEE_GL_VERSION_1_5 -void __stdcall _Lazy_glGenQueries(GLsizei n, GLuint * ids) {if (GLeeInit()) glGenQueries(n, ids);} -void __stdcall _Lazy_glDeleteQueries(GLsizei n, const GLuint * ids) {if (GLeeInit()) glDeleteQueries(n, ids);} -GLboolean __stdcall _Lazy_glIsQuery(GLuint id) {if (GLeeInit()) return glIsQuery(id); return (GLboolean)0;} -void __stdcall _Lazy_glBeginQuery(GLenum target, GLuint id) {if (GLeeInit()) glBeginQuery(target, id);} -void __stdcall _Lazy_glEndQuery(GLenum target) {if (GLeeInit()) glEndQuery(target);} -void __stdcall _Lazy_glGetQueryiv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetQueryiv(target, pname, params);} -void __stdcall _Lazy_glGetQueryObjectiv(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetQueryObjectiv(id, pname, params);} -void __stdcall _Lazy_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params) {if (GLeeInit()) glGetQueryObjectuiv(id, pname, params);} -void __stdcall _Lazy_glBindBuffer(GLenum target, GLuint buffer) {if (GLeeInit()) glBindBuffer(target, buffer);} -void __stdcall _Lazy_glDeleteBuffers(GLsizei n, const GLuint * buffers) {if (GLeeInit()) glDeleteBuffers(n, buffers);} -void __stdcall _Lazy_glGenBuffers(GLsizei n, GLuint * buffers) {if (GLeeInit()) glGenBuffers(n, buffers);} -GLboolean __stdcall _Lazy_glIsBuffer(GLuint buffer) {if (GLeeInit()) return glIsBuffer(buffer); return (GLboolean)0;} -void __stdcall _Lazy_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {if (GLeeInit()) glBufferData(target, size, data, usage);} -void __stdcall _Lazy_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) {if (GLeeInit()) glBufferSubData(target, offset, size, data);} -void __stdcall _Lazy_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) {if (GLeeInit()) glGetBufferSubData(target, offset, size, data);} -GLvoid* __stdcall _Lazy_glMapBuffer(GLenum target, GLenum access) {if (GLeeInit()) return glMapBuffer(target, access); return (GLvoid*)0;} -GLboolean __stdcall _Lazy_glUnmapBuffer(GLenum target) {if (GLeeInit()) return glUnmapBuffer(target); return (GLboolean)0;} -void __stdcall _Lazy_glGetBufferParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetBufferParameteriv(target, pname, params);} -void __stdcall _Lazy_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid* * params) {if (GLeeInit()) glGetBufferPointerv(target, pname, params);} -PFNGLGENQUERIESPROC pglGenQueries=_Lazy_glGenQueries; -PFNGLDELETEQUERIESPROC pglDeleteQueries=_Lazy_glDeleteQueries; -PFNGLISQUERYPROC pglIsQuery=_Lazy_glIsQuery; -PFNGLBEGINQUERYPROC pglBeginQuery=_Lazy_glBeginQuery; -PFNGLENDQUERYPROC pglEndQuery=_Lazy_glEndQuery; -PFNGLGETQUERYIVPROC pglGetQueryiv=_Lazy_glGetQueryiv; -PFNGLGETQUERYOBJECTIVPROC pglGetQueryObjectiv=_Lazy_glGetQueryObjectiv; -PFNGLGETQUERYOBJECTUIVPROC pglGetQueryObjectuiv=_Lazy_glGetQueryObjectuiv; -PFNGLBINDBUFFERPROC pglBindBuffer=_Lazy_glBindBuffer; -PFNGLDELETEBUFFERSPROC pglDeleteBuffers=_Lazy_glDeleteBuffers; -PFNGLGENBUFFERSPROC pglGenBuffers=_Lazy_glGenBuffers; -PFNGLISBUFFERPROC pglIsBuffer=_Lazy_glIsBuffer; -PFNGLBUFFERDATAPROC pglBufferData=_Lazy_glBufferData; -PFNGLBUFFERSUBDATAPROC pglBufferSubData=_Lazy_glBufferSubData; -PFNGLGETBUFFERSUBDATAPROC pglGetBufferSubData=_Lazy_glGetBufferSubData; -PFNGLMAPBUFFERPROC pglMapBuffer=_Lazy_glMapBuffer; -PFNGLUNMAPBUFFERPROC pglUnmapBuffer=_Lazy_glUnmapBuffer; -PFNGLGETBUFFERPARAMETERIVPROC pglGetBufferParameteriv=_Lazy_glGetBufferParameteriv; -PFNGLGETBUFFERPOINTERVPROC pglGetBufferPointerv=_Lazy_glGetBufferPointerv; -#endif - -/* GL_VERSION_2_0 */ - -#ifdef __GLEE_GL_VERSION_2_0 -void __stdcall _Lazy_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {if (GLeeInit()) glBlendEquationSeparate(modeRGB, modeAlpha);} -void __stdcall _Lazy_glDrawBuffers(GLsizei n, const GLenum * bufs) {if (GLeeInit()) glDrawBuffers(n, bufs);} -void __stdcall _Lazy_glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {if (GLeeInit()) glStencilOpSeparate(face, sfail, dpfail, dppass);} -void __stdcall _Lazy_glStencilFuncSeparate(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) {if (GLeeInit()) glStencilFuncSeparate(frontfunc, backfunc, ref, mask);} -void __stdcall _Lazy_glStencilMaskSeparate(GLenum face, GLuint mask) {if (GLeeInit()) glStencilMaskSeparate(face, mask);} -void __stdcall _Lazy_glAttachShader(GLuint program, GLuint shader) {if (GLeeInit()) glAttachShader(program, shader);} -void __stdcall _Lazy_glBindAttribLocation(GLuint program, GLuint index, const GLchar * name) {if (GLeeInit()) glBindAttribLocation(program, index, name);} -void __stdcall _Lazy_glCompileShader(GLuint shader) {if (GLeeInit()) glCompileShader(shader);} -GLuint __stdcall _Lazy_glCreateProgram(void) {if (GLeeInit()) return glCreateProgram(); return (GLuint)0;} -GLuint __stdcall _Lazy_glCreateShader(GLenum type) {if (GLeeInit()) return glCreateShader(type); return (GLuint)0;} -void __stdcall _Lazy_glDeleteProgram(GLuint program) {if (GLeeInit()) glDeleteProgram(program);} -void __stdcall _Lazy_glDeleteShader(GLuint shader) {if (GLeeInit()) glDeleteShader(shader);} -void __stdcall _Lazy_glDetachShader(GLuint program, GLuint shader) {if (GLeeInit()) glDetachShader(program, shader);} -void __stdcall _Lazy_glDisableVertexAttribArray(GLuint index) {if (GLeeInit()) glDisableVertexAttribArray(index);} -void __stdcall _Lazy_glEnableVertexAttribArray(GLuint index) {if (GLeeInit()) glEnableVertexAttribArray(index);} -void __stdcall _Lazy_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) {if (GLeeInit()) glGetActiveAttrib(program, index, bufSize, length, size, type, name);} -void __stdcall _Lazy_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) {if (GLeeInit()) glGetActiveUniform(program, index, bufSize, length, size, type, name);} -void __stdcall _Lazy_glGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj) {if (GLeeInit()) glGetAttachedShaders(program, maxCount, count, obj);} -GLint __stdcall _Lazy_glGetAttribLocation(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetAttribLocation(program, name); return (GLint)0;} -void __stdcall _Lazy_glGetProgramiv(GLuint program, GLenum pname, GLint * params) {if (GLeeInit()) glGetProgramiv(program, pname, params);} -void __stdcall _Lazy_glGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {if (GLeeInit()) glGetProgramInfoLog(program, bufSize, length, infoLog);} -void __stdcall _Lazy_glGetShaderiv(GLuint shader, GLenum pname, GLint * params) {if (GLeeInit()) glGetShaderiv(shader, pname, params);} -void __stdcall _Lazy_glGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {if (GLeeInit()) glGetShaderInfoLog(shader, bufSize, length, infoLog);} -void __stdcall _Lazy_glGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) {if (GLeeInit()) glGetShaderSource(shader, bufSize, length, source);} -GLint __stdcall _Lazy_glGetUniformLocation(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetUniformLocation(program, name); return (GLint)0;} -void __stdcall _Lazy_glGetUniformfv(GLuint program, GLint location, GLfloat * params) {if (GLeeInit()) glGetUniformfv(program, location, params);} -void __stdcall _Lazy_glGetUniformiv(GLuint program, GLint location, GLint * params) {if (GLeeInit()) glGetUniformiv(program, location, params);} -void __stdcall _Lazy_glGetVertexAttribdv(GLuint index, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetVertexAttribdv(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVertexAttribfv(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribiv(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribiv(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid* * pointer) {if (GLeeInit()) glGetVertexAttribPointerv(index, pname, pointer);} -GLboolean __stdcall _Lazy_glIsProgram(GLuint program) {if (GLeeInit()) return glIsProgram(program); return (GLboolean)0;} -GLboolean __stdcall _Lazy_glIsShader(GLuint shader) {if (GLeeInit()) return glIsShader(shader); return (GLboolean)0;} -void __stdcall _Lazy_glLinkProgram(GLuint program) {if (GLeeInit()) glLinkProgram(program);} -void __stdcall _Lazy_glShaderSource(GLuint shader, GLsizei count, const GLchar* * string, const GLint * length) {if (GLeeInit()) glShaderSource(shader, count, string, length);} -void __stdcall _Lazy_glUseProgram(GLuint program) {if (GLeeInit()) glUseProgram(program);} -void __stdcall _Lazy_glUniform1f(GLint location, GLfloat v0) {if (GLeeInit()) glUniform1f(location, v0);} -void __stdcall _Lazy_glUniform2f(GLint location, GLfloat v0, GLfloat v1) {if (GLeeInit()) glUniform2f(location, v0, v1);} -void __stdcall _Lazy_glUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {if (GLeeInit()) glUniform3f(location, v0, v1, v2);} -void __stdcall _Lazy_glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {if (GLeeInit()) glUniform4f(location, v0, v1, v2, v3);} -void __stdcall _Lazy_glUniform1i(GLint location, GLint v0) {if (GLeeInit()) glUniform1i(location, v0);} -void __stdcall _Lazy_glUniform2i(GLint location, GLint v0, GLint v1) {if (GLeeInit()) glUniform2i(location, v0, v1);} -void __stdcall _Lazy_glUniform3i(GLint location, GLint v0, GLint v1, GLint v2) {if (GLeeInit()) glUniform3i(location, v0, v1, v2);} -void __stdcall _Lazy_glUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {if (GLeeInit()) glUniform4i(location, v0, v1, v2, v3);} -void __stdcall _Lazy_glUniform1fv(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform1fv(location, count, value);} -void __stdcall _Lazy_glUniform2fv(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform2fv(location, count, value);} -void __stdcall _Lazy_glUniform3fv(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform3fv(location, count, value);} -void __stdcall _Lazy_glUniform4fv(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform4fv(location, count, value);} -void __stdcall _Lazy_glUniform1iv(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform1iv(location, count, value);} -void __stdcall _Lazy_glUniform2iv(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform2iv(location, count, value);} -void __stdcall _Lazy_glUniform3iv(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform3iv(location, count, value);} -void __stdcall _Lazy_glUniform4iv(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform4iv(location, count, value);} -void __stdcall _Lazy_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix2fv(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix3fv(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix4fv(location, count, transpose, value);} -void __stdcall _Lazy_glValidateProgram(GLuint program) {if (GLeeInit()) glValidateProgram(program);} -void __stdcall _Lazy_glVertexAttrib1d(GLuint index, GLdouble x) {if (GLeeInit()) glVertexAttrib1d(index, x);} -void __stdcall _Lazy_glVertexAttrib1dv(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib1dv(index, v);} -void __stdcall _Lazy_glVertexAttrib1f(GLuint index, GLfloat x) {if (GLeeInit()) glVertexAttrib1f(index, x);} -void __stdcall _Lazy_glVertexAttrib1fv(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib1fv(index, v);} -void __stdcall _Lazy_glVertexAttrib1s(GLuint index, GLshort x) {if (GLeeInit()) glVertexAttrib1s(index, x);} -void __stdcall _Lazy_glVertexAttrib1sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib1sv(index, v);} -void __stdcall _Lazy_glVertexAttrib2d(GLuint index, GLdouble x, GLdouble y) {if (GLeeInit()) glVertexAttrib2d(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2dv(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib2dv(index, v);} -void __stdcall _Lazy_glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y) {if (GLeeInit()) glVertexAttrib2f(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2fv(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib2fv(index, v);} -void __stdcall _Lazy_glVertexAttrib2s(GLuint index, GLshort x, GLshort y) {if (GLeeInit()) glVertexAttrib2s(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib2sv(index, v);} -void __stdcall _Lazy_glVertexAttrib3d(GLuint index, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glVertexAttrib3d(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3dv(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib3dv(index, v);} -void __stdcall _Lazy_glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glVertexAttrib3f(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3fv(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib3fv(index, v);} -void __stdcall _Lazy_glVertexAttrib3s(GLuint index, GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glVertexAttrib3s(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib3sv(index, v);} -void __stdcall _Lazy_glVertexAttrib4Nbv(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttrib4Nbv(index, v);} -void __stdcall _Lazy_glVertexAttrib4Niv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttrib4Niv(index, v);} -void __stdcall _Lazy_glVertexAttrib4Nsv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4Nsv(index, v);} -void __stdcall _Lazy_glVertexAttrib4Nub(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) {if (GLeeInit()) glVertexAttrib4Nub(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4Nubv(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4Nubv(index, v);} -void __stdcall _Lazy_glVertexAttrib4Nuiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttrib4Nuiv(index, v);} -void __stdcall _Lazy_glVertexAttrib4Nusv(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttrib4Nusv(index, v);} -void __stdcall _Lazy_glVertexAttrib4bv(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttrib4bv(index, v);} -void __stdcall _Lazy_glVertexAttrib4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glVertexAttrib4d(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4dv(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib4dv(index, v);} -void __stdcall _Lazy_glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glVertexAttrib4f(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4fv(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib4fv(index, v);} -void __stdcall _Lazy_glVertexAttrib4iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttrib4iv(index, v);} -void __stdcall _Lazy_glVertexAttrib4s(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glVertexAttrib4s(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4sv(index, v);} -void __stdcall _Lazy_glVertexAttrib4ubv(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4ubv(index, v);} -void __stdcall _Lazy_glVertexAttrib4uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttrib4uiv(index, v);} -void __stdcall _Lazy_glVertexAttrib4usv(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttrib4usv(index, v);} -void __stdcall _Lazy_glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribPointer(index, size, type, normalized, stride, pointer);} -PFNGLBLENDEQUATIONSEPARATEPROC pglBlendEquationSeparate=_Lazy_glBlendEquationSeparate; -PFNGLDRAWBUFFERSPROC pglDrawBuffers=_Lazy_glDrawBuffers; -PFNGLSTENCILOPSEPARATEPROC pglStencilOpSeparate=_Lazy_glStencilOpSeparate; -PFNGLSTENCILFUNCSEPARATEPROC pglStencilFuncSeparate=_Lazy_glStencilFuncSeparate; -PFNGLSTENCILMASKSEPARATEPROC pglStencilMaskSeparate=_Lazy_glStencilMaskSeparate; -PFNGLATTACHSHADERPROC pglAttachShader=_Lazy_glAttachShader; -PFNGLBINDATTRIBLOCATIONPROC pglBindAttribLocation=_Lazy_glBindAttribLocation; -PFNGLCOMPILESHADERPROC pglCompileShader=_Lazy_glCompileShader; -PFNGLCREATEPROGRAMPROC pglCreateProgram=_Lazy_glCreateProgram; -PFNGLCREATESHADERPROC pglCreateShader=_Lazy_glCreateShader; -PFNGLDELETEPROGRAMPROC pglDeleteProgram=_Lazy_glDeleteProgram; -PFNGLDELETESHADERPROC pglDeleteShader=_Lazy_glDeleteShader; -PFNGLDETACHSHADERPROC pglDetachShader=_Lazy_glDetachShader; -PFNGLDISABLEVERTEXATTRIBARRAYPROC pglDisableVertexAttribArray=_Lazy_glDisableVertexAttribArray; -PFNGLENABLEVERTEXATTRIBARRAYPROC pglEnableVertexAttribArray=_Lazy_glEnableVertexAttribArray; -PFNGLGETACTIVEATTRIBPROC pglGetActiveAttrib=_Lazy_glGetActiveAttrib; -PFNGLGETACTIVEUNIFORMPROC pglGetActiveUniform=_Lazy_glGetActiveUniform; -PFNGLGETATTACHEDSHADERSPROC pglGetAttachedShaders=_Lazy_glGetAttachedShaders; -PFNGLGETATTRIBLOCATIONPROC pglGetAttribLocation=_Lazy_glGetAttribLocation; -PFNGLGETPROGRAMIVPROC pglGetProgramiv=_Lazy_glGetProgramiv; -PFNGLGETPROGRAMINFOLOGPROC pglGetProgramInfoLog=_Lazy_glGetProgramInfoLog; -PFNGLGETSHADERIVPROC pglGetShaderiv=_Lazy_glGetShaderiv; -PFNGLGETSHADERINFOLOGPROC pglGetShaderInfoLog=_Lazy_glGetShaderInfoLog; -PFNGLGETSHADERSOURCEPROC pglGetShaderSource=_Lazy_glGetShaderSource; -PFNGLGETUNIFORMLOCATIONPROC pglGetUniformLocation=_Lazy_glGetUniformLocation; -PFNGLGETUNIFORMFVPROC pglGetUniformfv=_Lazy_glGetUniformfv; -PFNGLGETUNIFORMIVPROC pglGetUniformiv=_Lazy_glGetUniformiv; -PFNGLGETVERTEXATTRIBDVPROC pglGetVertexAttribdv=_Lazy_glGetVertexAttribdv; -PFNGLGETVERTEXATTRIBFVPROC pglGetVertexAttribfv=_Lazy_glGetVertexAttribfv; -PFNGLGETVERTEXATTRIBIVPROC pglGetVertexAttribiv=_Lazy_glGetVertexAttribiv; -PFNGLGETVERTEXATTRIBPOINTERVPROC pglGetVertexAttribPointerv=_Lazy_glGetVertexAttribPointerv; -PFNGLISPROGRAMPROC pglIsProgram=_Lazy_glIsProgram; -PFNGLISSHADERPROC pglIsShader=_Lazy_glIsShader; -PFNGLLINKPROGRAMPROC pglLinkProgram=_Lazy_glLinkProgram; -PFNGLSHADERSOURCEPROC pglShaderSource=_Lazy_glShaderSource; -PFNGLUSEPROGRAMPROC pglUseProgram=_Lazy_glUseProgram; -PFNGLUNIFORM1FPROC pglUniform1f=_Lazy_glUniform1f; -PFNGLUNIFORM2FPROC pglUniform2f=_Lazy_glUniform2f; -PFNGLUNIFORM3FPROC pglUniform3f=_Lazy_glUniform3f; -PFNGLUNIFORM4FPROC pglUniform4f=_Lazy_glUniform4f; -PFNGLUNIFORM1IPROC pglUniform1i=_Lazy_glUniform1i; -PFNGLUNIFORM2IPROC pglUniform2i=_Lazy_glUniform2i; -PFNGLUNIFORM3IPROC pglUniform3i=_Lazy_glUniform3i; -PFNGLUNIFORM4IPROC pglUniform4i=_Lazy_glUniform4i; -PFNGLUNIFORM1FVPROC pglUniform1fv=_Lazy_glUniform1fv; -PFNGLUNIFORM2FVPROC pglUniform2fv=_Lazy_glUniform2fv; -PFNGLUNIFORM3FVPROC pglUniform3fv=_Lazy_glUniform3fv; -PFNGLUNIFORM4FVPROC pglUniform4fv=_Lazy_glUniform4fv; -PFNGLUNIFORM1IVPROC pglUniform1iv=_Lazy_glUniform1iv; -PFNGLUNIFORM2IVPROC pglUniform2iv=_Lazy_glUniform2iv; -PFNGLUNIFORM3IVPROC pglUniform3iv=_Lazy_glUniform3iv; -PFNGLUNIFORM4IVPROC pglUniform4iv=_Lazy_glUniform4iv; -PFNGLUNIFORMMATRIX2FVPROC pglUniformMatrix2fv=_Lazy_glUniformMatrix2fv; -PFNGLUNIFORMMATRIX3FVPROC pglUniformMatrix3fv=_Lazy_glUniformMatrix3fv; -PFNGLUNIFORMMATRIX4FVPROC pglUniformMatrix4fv=_Lazy_glUniformMatrix4fv; -PFNGLVALIDATEPROGRAMPROC pglValidateProgram=_Lazy_glValidateProgram; -PFNGLVERTEXATTRIB1DPROC pglVertexAttrib1d=_Lazy_glVertexAttrib1d; -PFNGLVERTEXATTRIB1DVPROC pglVertexAttrib1dv=_Lazy_glVertexAttrib1dv; -PFNGLVERTEXATTRIB1FPROC pglVertexAttrib1f=_Lazy_glVertexAttrib1f; -PFNGLVERTEXATTRIB1FVPROC pglVertexAttrib1fv=_Lazy_glVertexAttrib1fv; -PFNGLVERTEXATTRIB1SPROC pglVertexAttrib1s=_Lazy_glVertexAttrib1s; -PFNGLVERTEXATTRIB1SVPROC pglVertexAttrib1sv=_Lazy_glVertexAttrib1sv; -PFNGLVERTEXATTRIB2DPROC pglVertexAttrib2d=_Lazy_glVertexAttrib2d; -PFNGLVERTEXATTRIB2DVPROC pglVertexAttrib2dv=_Lazy_glVertexAttrib2dv; -PFNGLVERTEXATTRIB2FPROC pglVertexAttrib2f=_Lazy_glVertexAttrib2f; -PFNGLVERTEXATTRIB2FVPROC pglVertexAttrib2fv=_Lazy_glVertexAttrib2fv; -PFNGLVERTEXATTRIB2SPROC pglVertexAttrib2s=_Lazy_glVertexAttrib2s; -PFNGLVERTEXATTRIB2SVPROC pglVertexAttrib2sv=_Lazy_glVertexAttrib2sv; -PFNGLVERTEXATTRIB3DPROC pglVertexAttrib3d=_Lazy_glVertexAttrib3d; -PFNGLVERTEXATTRIB3DVPROC pglVertexAttrib3dv=_Lazy_glVertexAttrib3dv; -PFNGLVERTEXATTRIB3FPROC pglVertexAttrib3f=_Lazy_glVertexAttrib3f; -PFNGLVERTEXATTRIB3FVPROC pglVertexAttrib3fv=_Lazy_glVertexAttrib3fv; -PFNGLVERTEXATTRIB3SPROC pglVertexAttrib3s=_Lazy_glVertexAttrib3s; -PFNGLVERTEXATTRIB3SVPROC pglVertexAttrib3sv=_Lazy_glVertexAttrib3sv; -PFNGLVERTEXATTRIB4NBVPROC pglVertexAttrib4Nbv=_Lazy_glVertexAttrib4Nbv; -PFNGLVERTEXATTRIB4NIVPROC pglVertexAttrib4Niv=_Lazy_glVertexAttrib4Niv; -PFNGLVERTEXATTRIB4NSVPROC pglVertexAttrib4Nsv=_Lazy_glVertexAttrib4Nsv; -PFNGLVERTEXATTRIB4NUBPROC pglVertexAttrib4Nub=_Lazy_glVertexAttrib4Nub; -PFNGLVERTEXATTRIB4NUBVPROC pglVertexAttrib4Nubv=_Lazy_glVertexAttrib4Nubv; -PFNGLVERTEXATTRIB4NUIVPROC pglVertexAttrib4Nuiv=_Lazy_glVertexAttrib4Nuiv; -PFNGLVERTEXATTRIB4NUSVPROC pglVertexAttrib4Nusv=_Lazy_glVertexAttrib4Nusv; -PFNGLVERTEXATTRIB4BVPROC pglVertexAttrib4bv=_Lazy_glVertexAttrib4bv; -PFNGLVERTEXATTRIB4DPROC pglVertexAttrib4d=_Lazy_glVertexAttrib4d; -PFNGLVERTEXATTRIB4DVPROC pglVertexAttrib4dv=_Lazy_glVertexAttrib4dv; -PFNGLVERTEXATTRIB4FPROC pglVertexAttrib4f=_Lazy_glVertexAttrib4f; -PFNGLVERTEXATTRIB4FVPROC pglVertexAttrib4fv=_Lazy_glVertexAttrib4fv; -PFNGLVERTEXATTRIB4IVPROC pglVertexAttrib4iv=_Lazy_glVertexAttrib4iv; -PFNGLVERTEXATTRIB4SPROC pglVertexAttrib4s=_Lazy_glVertexAttrib4s; -PFNGLVERTEXATTRIB4SVPROC pglVertexAttrib4sv=_Lazy_glVertexAttrib4sv; -PFNGLVERTEXATTRIB4UBVPROC pglVertexAttrib4ubv=_Lazy_glVertexAttrib4ubv; -PFNGLVERTEXATTRIB4UIVPROC pglVertexAttrib4uiv=_Lazy_glVertexAttrib4uiv; -PFNGLVERTEXATTRIB4USVPROC pglVertexAttrib4usv=_Lazy_glVertexAttrib4usv; -PFNGLVERTEXATTRIBPOINTERPROC pglVertexAttribPointer=_Lazy_glVertexAttribPointer; -#endif - -/* GL_VERSION_2_1 */ - -#ifdef __GLEE_GL_VERSION_2_1 -void __stdcall _Lazy_glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix2x3fv(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix3x2fv(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix2x4fv(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix4x2fv(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix3x4fv(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix4x3fv(location, count, transpose, value);} -PFNGLUNIFORMMATRIX2X3FVPROC pglUniformMatrix2x3fv=_Lazy_glUniformMatrix2x3fv; -PFNGLUNIFORMMATRIX3X2FVPROC pglUniformMatrix3x2fv=_Lazy_glUniformMatrix3x2fv; -PFNGLUNIFORMMATRIX2X4FVPROC pglUniformMatrix2x4fv=_Lazy_glUniformMatrix2x4fv; -PFNGLUNIFORMMATRIX4X2FVPROC pglUniformMatrix4x2fv=_Lazy_glUniformMatrix4x2fv; -PFNGLUNIFORMMATRIX3X4FVPROC pglUniformMatrix3x4fv=_Lazy_glUniformMatrix3x4fv; -PFNGLUNIFORMMATRIX4X3FVPROC pglUniformMatrix4x3fv=_Lazy_glUniformMatrix4x3fv; -#endif - -/* GL_VERSION_3_0 */ - -#ifdef __GLEE_GL_VERSION_3_0 -void __stdcall _Lazy_glColorMaski(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {if (GLeeInit()) glColorMaski(index, r, g, b, a);} -void __stdcall _Lazy_glGetBooleani_v(GLenum target, GLuint index, GLboolean * data) {if (GLeeInit()) glGetBooleani_v(target, index, data);} -void __stdcall _Lazy_glGetIntegeri_v(GLenum target, GLuint index, GLint * data) {if (GLeeInit()) glGetIntegeri_v(target, index, data);} -void __stdcall _Lazy_glEnablei(GLenum target, GLuint index) {if (GLeeInit()) glEnablei(target, index);} -void __stdcall _Lazy_glDisablei(GLenum target, GLuint index) {if (GLeeInit()) glDisablei(target, index);} -GLboolean __stdcall _Lazy_glIsEnabledi(GLenum target, GLuint index) {if (GLeeInit()) return glIsEnabledi(target, index); return (GLboolean)0;} -void __stdcall _Lazy_glBeginTransformFeedback(GLenum primitiveMode) {if (GLeeInit()) glBeginTransformFeedback(primitiveMode);} -void __stdcall _Lazy_glEndTransformFeedback(void) {if (GLeeInit()) glEndTransformFeedback();} -void __stdcall _Lazy_glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {if (GLeeInit()) glBindBufferRange(target, index, buffer, offset, size);} -void __stdcall _Lazy_glBindBufferBase(GLenum target, GLuint index, GLuint buffer) {if (GLeeInit()) glBindBufferBase(target, index, buffer);} -void __stdcall _Lazy_glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode) {if (GLeeInit()) glTransformFeedbackVaryings(program, count, locations, bufferMode);} -void __stdcall _Lazy_glGetTransformFeedbackVarying(GLuint program, GLuint index, GLint * location) {if (GLeeInit()) glGetTransformFeedbackVarying(program, index, location);} -void __stdcall _Lazy_glClampColor(GLenum target, GLenum clamp) {if (GLeeInit()) glClampColor(target, clamp);} -void __stdcall _Lazy_glBeginConditionalRender(GLuint id, GLenum mode) {if (GLeeInit()) glBeginConditionalRender(id, mode);} -void __stdcall _Lazy_glEndConditionalRender(void) {if (GLeeInit()) glEndConditionalRender();} -void __stdcall _Lazy_glVertexAttribI1i(GLuint index, GLint x) {if (GLeeInit()) glVertexAttribI1i(index, x);} -void __stdcall _Lazy_glVertexAttribI2i(GLuint index, GLint x, GLint y) {if (GLeeInit()) glVertexAttribI2i(index, x, y);} -void __stdcall _Lazy_glVertexAttribI3i(GLuint index, GLint x, GLint y, GLint z) {if (GLeeInit()) glVertexAttribI3i(index, x, y, z);} -void __stdcall _Lazy_glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glVertexAttribI4i(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttribI1ui(GLuint index, GLuint x) {if (GLeeInit()) glVertexAttribI1ui(index, x);} -void __stdcall _Lazy_glVertexAttribI2ui(GLuint index, GLuint x, GLuint y) {if (GLeeInit()) glVertexAttribI2ui(index, x, y);} -void __stdcall _Lazy_glVertexAttribI3ui(GLuint index, GLuint x, GLuint y, GLuint z) {if (GLeeInit()) glVertexAttribI3ui(index, x, y, z);} -void __stdcall _Lazy_glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glVertexAttribI4ui(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttribI1iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI1iv(index, v);} -void __stdcall _Lazy_glVertexAttribI2iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI2iv(index, v);} -void __stdcall _Lazy_glVertexAttribI3iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI3iv(index, v);} -void __stdcall _Lazy_glVertexAttribI4iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI4iv(index, v);} -void __stdcall _Lazy_glVertexAttribI1uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI1uiv(index, v);} -void __stdcall _Lazy_glVertexAttribI2uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI2uiv(index, v);} -void __stdcall _Lazy_glVertexAttribI3uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI3uiv(index, v);} -void __stdcall _Lazy_glVertexAttribI4uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI4uiv(index, v);} -void __stdcall _Lazy_glVertexAttribI4bv(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttribI4bv(index, v);} -void __stdcall _Lazy_glVertexAttribI4sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttribI4sv(index, v);} -void __stdcall _Lazy_glVertexAttribI4ubv(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttribI4ubv(index, v);} -void __stdcall _Lazy_glVertexAttribI4usv(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttribI4usv(index, v);} -void __stdcall _Lazy_glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribIPointer(index, size, type, stride, pointer);} -void __stdcall _Lazy_glGetVertexAttribIiv(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribIiv(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint * params) {if (GLeeInit()) glGetVertexAttribIuiv(index, pname, params);} -void __stdcall _Lazy_glGetUniformuiv(GLuint program, GLint location, GLuint * params) {if (GLeeInit()) glGetUniformuiv(program, location, params);} -void __stdcall _Lazy_glBindFragDataLocation(GLuint program, GLuint color, const GLchar * name) {if (GLeeInit()) glBindFragDataLocation(program, color, name);} -GLint __stdcall _Lazy_glGetFragDataLocation(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetFragDataLocation(program, name); return (GLint)0;} -void __stdcall _Lazy_glUniform1ui(GLint location, GLuint v0) {if (GLeeInit()) glUniform1ui(location, v0);} -void __stdcall _Lazy_glUniform2ui(GLint location, GLuint v0, GLuint v1) {if (GLeeInit()) glUniform2ui(location, v0, v1);} -void __stdcall _Lazy_glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) {if (GLeeInit()) glUniform3ui(location, v0, v1, v2);} -void __stdcall _Lazy_glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {if (GLeeInit()) glUniform4ui(location, v0, v1, v2, v3);} -void __stdcall _Lazy_glUniform1uiv(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform1uiv(location, count, value);} -void __stdcall _Lazy_glUniform2uiv(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform2uiv(location, count, value);} -void __stdcall _Lazy_glUniform3uiv(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform3uiv(location, count, value);} -void __stdcall _Lazy_glUniform4uiv(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform4uiv(location, count, value);} -void __stdcall _Lazy_glTexParameterIiv(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glTexParameterIiv(target, pname, params);} -void __stdcall _Lazy_glTexParameterIuiv(GLenum target, GLenum pname, const GLuint * params) {if (GLeeInit()) glTexParameterIuiv(target, pname, params);} -void __stdcall _Lazy_glGetTexParameterIiv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetTexParameterIiv(target, pname, params);} -void __stdcall _Lazy_glGetTexParameterIuiv(GLenum target, GLenum pname, GLuint * params) {if (GLeeInit()) glGetTexParameterIuiv(target, pname, params);} -void __stdcall _Lazy_glClearBufferiv(GLenum buffer, const GLint * value) {if (GLeeInit()) glClearBufferiv(buffer, value);} -void __stdcall _Lazy_glClearBufferuiv(GLenum buffer, const GLuint * value) {if (GLeeInit()) glClearBufferuiv(buffer, value);} -void __stdcall _Lazy_glClearBufferfv(GLenum buffer, const GLfloat * value) {if (GLeeInit()) glClearBufferfv(buffer, value);} -void __stdcall _Lazy_glClearBufferfi(GLenum buffer, GLfloat depth, GLint stencil) {if (GLeeInit()) glClearBufferfi(buffer, depth, stencil);} -const GLubyte * __stdcall _Lazy_glGetStringi(GLenum name, GLuint index) {if (GLeeInit()) return glGetStringi(name, index); return (const GLubyte *)0;} -PFNGLCOLORMASKIPROC pglColorMaski=_Lazy_glColorMaski; -PFNGLGETBOOLEANI_VPROC pglGetBooleani_v=_Lazy_glGetBooleani_v; -PFNGLGETINTEGERI_VPROC pglGetIntegeri_v=_Lazy_glGetIntegeri_v; -PFNGLENABLEIPROC pglEnablei=_Lazy_glEnablei; -PFNGLDISABLEIPROC pglDisablei=_Lazy_glDisablei; -PFNGLISENABLEDIPROC pglIsEnabledi=_Lazy_glIsEnabledi; -PFNGLBEGINTRANSFORMFEEDBACKPROC pglBeginTransformFeedback=_Lazy_glBeginTransformFeedback; -PFNGLENDTRANSFORMFEEDBACKPROC pglEndTransformFeedback=_Lazy_glEndTransformFeedback; -PFNGLBINDBUFFERRANGEPROC pglBindBufferRange=_Lazy_glBindBufferRange; -PFNGLBINDBUFFERBASEPROC pglBindBufferBase=_Lazy_glBindBufferBase; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC pglTransformFeedbackVaryings=_Lazy_glTransformFeedbackVaryings; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC pglGetTransformFeedbackVarying=_Lazy_glGetTransformFeedbackVarying; -PFNGLCLAMPCOLORPROC pglClampColor=_Lazy_glClampColor; -PFNGLBEGINCONDITIONALRENDERPROC pglBeginConditionalRender=_Lazy_glBeginConditionalRender; -PFNGLENDCONDITIONALRENDERPROC pglEndConditionalRender=_Lazy_glEndConditionalRender; -PFNGLVERTEXATTRIBI1IPROC pglVertexAttribI1i=_Lazy_glVertexAttribI1i; -PFNGLVERTEXATTRIBI2IPROC pglVertexAttribI2i=_Lazy_glVertexAttribI2i; -PFNGLVERTEXATTRIBI3IPROC pglVertexAttribI3i=_Lazy_glVertexAttribI3i; -PFNGLVERTEXATTRIBI4IPROC pglVertexAttribI4i=_Lazy_glVertexAttribI4i; -PFNGLVERTEXATTRIBI1UIPROC pglVertexAttribI1ui=_Lazy_glVertexAttribI1ui; -PFNGLVERTEXATTRIBI2UIPROC pglVertexAttribI2ui=_Lazy_glVertexAttribI2ui; -PFNGLVERTEXATTRIBI3UIPROC pglVertexAttribI3ui=_Lazy_glVertexAttribI3ui; -PFNGLVERTEXATTRIBI4UIPROC pglVertexAttribI4ui=_Lazy_glVertexAttribI4ui; -PFNGLVERTEXATTRIBI1IVPROC pglVertexAttribI1iv=_Lazy_glVertexAttribI1iv; -PFNGLVERTEXATTRIBI2IVPROC pglVertexAttribI2iv=_Lazy_glVertexAttribI2iv; -PFNGLVERTEXATTRIBI3IVPROC pglVertexAttribI3iv=_Lazy_glVertexAttribI3iv; -PFNGLVERTEXATTRIBI4IVPROC pglVertexAttribI4iv=_Lazy_glVertexAttribI4iv; -PFNGLVERTEXATTRIBI1UIVPROC pglVertexAttribI1uiv=_Lazy_glVertexAttribI1uiv; -PFNGLVERTEXATTRIBI2UIVPROC pglVertexAttribI2uiv=_Lazy_glVertexAttribI2uiv; -PFNGLVERTEXATTRIBI3UIVPROC pglVertexAttribI3uiv=_Lazy_glVertexAttribI3uiv; -PFNGLVERTEXATTRIBI4UIVPROC pglVertexAttribI4uiv=_Lazy_glVertexAttribI4uiv; -PFNGLVERTEXATTRIBI4BVPROC pglVertexAttribI4bv=_Lazy_glVertexAttribI4bv; -PFNGLVERTEXATTRIBI4SVPROC pglVertexAttribI4sv=_Lazy_glVertexAttribI4sv; -PFNGLVERTEXATTRIBI4UBVPROC pglVertexAttribI4ubv=_Lazy_glVertexAttribI4ubv; -PFNGLVERTEXATTRIBI4USVPROC pglVertexAttribI4usv=_Lazy_glVertexAttribI4usv; -PFNGLVERTEXATTRIBIPOINTERPROC pglVertexAttribIPointer=_Lazy_glVertexAttribIPointer; -PFNGLGETVERTEXATTRIBIIVPROC pglGetVertexAttribIiv=_Lazy_glGetVertexAttribIiv; -PFNGLGETVERTEXATTRIBIUIVPROC pglGetVertexAttribIuiv=_Lazy_glGetVertexAttribIuiv; -PFNGLGETUNIFORMUIVPROC pglGetUniformuiv=_Lazy_glGetUniformuiv; -PFNGLBINDFRAGDATALOCATIONPROC pglBindFragDataLocation=_Lazy_glBindFragDataLocation; -PFNGLGETFRAGDATALOCATIONPROC pglGetFragDataLocation=_Lazy_glGetFragDataLocation; -PFNGLUNIFORM1UIPROC pglUniform1ui=_Lazy_glUniform1ui; -PFNGLUNIFORM2UIPROC pglUniform2ui=_Lazy_glUniform2ui; -PFNGLUNIFORM3UIPROC pglUniform3ui=_Lazy_glUniform3ui; -PFNGLUNIFORM4UIPROC pglUniform4ui=_Lazy_glUniform4ui; -PFNGLUNIFORM1UIVPROC pglUniform1uiv=_Lazy_glUniform1uiv; -PFNGLUNIFORM2UIVPROC pglUniform2uiv=_Lazy_glUniform2uiv; -PFNGLUNIFORM3UIVPROC pglUniform3uiv=_Lazy_glUniform3uiv; -PFNGLUNIFORM4UIVPROC pglUniform4uiv=_Lazy_glUniform4uiv; -PFNGLTEXPARAMETERIIVPROC pglTexParameterIiv=_Lazy_glTexParameterIiv; -PFNGLTEXPARAMETERIUIVPROC pglTexParameterIuiv=_Lazy_glTexParameterIuiv; -PFNGLGETTEXPARAMETERIIVPROC pglGetTexParameterIiv=_Lazy_glGetTexParameterIiv; -PFNGLGETTEXPARAMETERIUIVPROC pglGetTexParameterIuiv=_Lazy_glGetTexParameterIuiv; -PFNGLCLEARBUFFERIVPROC pglClearBufferiv=_Lazy_glClearBufferiv; -PFNGLCLEARBUFFERUIVPROC pglClearBufferuiv=_Lazy_glClearBufferuiv; -PFNGLCLEARBUFFERFVPROC pglClearBufferfv=_Lazy_glClearBufferfv; -PFNGLCLEARBUFFERFIPROC pglClearBufferfi=_Lazy_glClearBufferfi; -PFNGLGETSTRINGIPROC pglGetStringi=_Lazy_glGetStringi; -#endif - -/* GL_ARB_multitexture */ - -#ifdef __GLEE_GL_ARB_multitexture -void __stdcall _Lazy_glActiveTextureARB(GLenum texture) {if (GLeeInit()) glActiveTextureARB(texture);} -void __stdcall _Lazy_glClientActiveTextureARB(GLenum texture) {if (GLeeInit()) glClientActiveTextureARB(texture);} -void __stdcall _Lazy_glMultiTexCoord1dARB(GLenum target, GLdouble s) {if (GLeeInit()) glMultiTexCoord1dARB(target, s);} -void __stdcall _Lazy_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord1dvARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord1fARB(GLenum target, GLfloat s) {if (GLeeInit()) glMultiTexCoord1fARB(target, s);} -void __stdcall _Lazy_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord1fvARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord1iARB(GLenum target, GLint s) {if (GLeeInit()) glMultiTexCoord1iARB(target, s);} -void __stdcall _Lazy_glMultiTexCoord1ivARB(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord1ivARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord1sARB(GLenum target, GLshort s) {if (GLeeInit()) glMultiTexCoord1sARB(target, s);} -void __stdcall _Lazy_glMultiTexCoord1svARB(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord1svARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t) {if (GLeeInit()) glMultiTexCoord2dARB(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord2dvARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) {if (GLeeInit()) glMultiTexCoord2fARB(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord2fvARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t) {if (GLeeInit()) glMultiTexCoord2iARB(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2ivARB(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord2ivARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t) {if (GLeeInit()) glMultiTexCoord2sARB(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2svARB(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord2svARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r) {if (GLeeInit()) glMultiTexCoord3dARB(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3dvARB(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord3dvARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r) {if (GLeeInit()) glMultiTexCoord3fARB(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord3fvARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r) {if (GLeeInit()) glMultiTexCoord3iARB(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3ivARB(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord3ivARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r) {if (GLeeInit()) glMultiTexCoord3sARB(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3svARB(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord3svARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) {if (GLeeInit()) glMultiTexCoord4dARB(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4dvARB(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord4dvARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {if (GLeeInit()) glMultiTexCoord4fARB(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord4fvARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q) {if (GLeeInit()) glMultiTexCoord4iARB(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4ivARB(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord4ivARB(target, v);} -void __stdcall _Lazy_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) {if (GLeeInit()) glMultiTexCoord4sARB(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4svARB(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord4svARB(target, v);} -PFNGLACTIVETEXTUREARBPROC pglActiveTextureARB=_Lazy_glActiveTextureARB; -PFNGLCLIENTACTIVETEXTUREARBPROC pglClientActiveTextureARB=_Lazy_glClientActiveTextureARB; -PFNGLMULTITEXCOORD1DARBPROC pglMultiTexCoord1dARB=_Lazy_glMultiTexCoord1dARB; -PFNGLMULTITEXCOORD1DVARBPROC pglMultiTexCoord1dvARB=_Lazy_glMultiTexCoord1dvARB; -PFNGLMULTITEXCOORD1FARBPROC pglMultiTexCoord1fARB=_Lazy_glMultiTexCoord1fARB; -PFNGLMULTITEXCOORD1FVARBPROC pglMultiTexCoord1fvARB=_Lazy_glMultiTexCoord1fvARB; -PFNGLMULTITEXCOORD1IARBPROC pglMultiTexCoord1iARB=_Lazy_glMultiTexCoord1iARB; -PFNGLMULTITEXCOORD1IVARBPROC pglMultiTexCoord1ivARB=_Lazy_glMultiTexCoord1ivARB; -PFNGLMULTITEXCOORD1SARBPROC pglMultiTexCoord1sARB=_Lazy_glMultiTexCoord1sARB; -PFNGLMULTITEXCOORD1SVARBPROC pglMultiTexCoord1svARB=_Lazy_glMultiTexCoord1svARB; -PFNGLMULTITEXCOORD2DARBPROC pglMultiTexCoord2dARB=_Lazy_glMultiTexCoord2dARB; -PFNGLMULTITEXCOORD2DVARBPROC pglMultiTexCoord2dvARB=_Lazy_glMultiTexCoord2dvARB; -PFNGLMULTITEXCOORD2FARBPROC pglMultiTexCoord2fARB=_Lazy_glMultiTexCoord2fARB; -PFNGLMULTITEXCOORD2FVARBPROC pglMultiTexCoord2fvARB=_Lazy_glMultiTexCoord2fvARB; -PFNGLMULTITEXCOORD2IARBPROC pglMultiTexCoord2iARB=_Lazy_glMultiTexCoord2iARB; -PFNGLMULTITEXCOORD2IVARBPROC pglMultiTexCoord2ivARB=_Lazy_glMultiTexCoord2ivARB; -PFNGLMULTITEXCOORD2SARBPROC pglMultiTexCoord2sARB=_Lazy_glMultiTexCoord2sARB; -PFNGLMULTITEXCOORD2SVARBPROC pglMultiTexCoord2svARB=_Lazy_glMultiTexCoord2svARB; -PFNGLMULTITEXCOORD3DARBPROC pglMultiTexCoord3dARB=_Lazy_glMultiTexCoord3dARB; -PFNGLMULTITEXCOORD3DVARBPROC pglMultiTexCoord3dvARB=_Lazy_glMultiTexCoord3dvARB; -PFNGLMULTITEXCOORD3FARBPROC pglMultiTexCoord3fARB=_Lazy_glMultiTexCoord3fARB; -PFNGLMULTITEXCOORD3FVARBPROC pglMultiTexCoord3fvARB=_Lazy_glMultiTexCoord3fvARB; -PFNGLMULTITEXCOORD3IARBPROC pglMultiTexCoord3iARB=_Lazy_glMultiTexCoord3iARB; -PFNGLMULTITEXCOORD3IVARBPROC pglMultiTexCoord3ivARB=_Lazy_glMultiTexCoord3ivARB; -PFNGLMULTITEXCOORD3SARBPROC pglMultiTexCoord3sARB=_Lazy_glMultiTexCoord3sARB; -PFNGLMULTITEXCOORD3SVARBPROC pglMultiTexCoord3svARB=_Lazy_glMultiTexCoord3svARB; -PFNGLMULTITEXCOORD4DARBPROC pglMultiTexCoord4dARB=_Lazy_glMultiTexCoord4dARB; -PFNGLMULTITEXCOORD4DVARBPROC pglMultiTexCoord4dvARB=_Lazy_glMultiTexCoord4dvARB; -PFNGLMULTITEXCOORD4FARBPROC pglMultiTexCoord4fARB=_Lazy_glMultiTexCoord4fARB; -PFNGLMULTITEXCOORD4FVARBPROC pglMultiTexCoord4fvARB=_Lazy_glMultiTexCoord4fvARB; -PFNGLMULTITEXCOORD4IARBPROC pglMultiTexCoord4iARB=_Lazy_glMultiTexCoord4iARB; -PFNGLMULTITEXCOORD4IVARBPROC pglMultiTexCoord4ivARB=_Lazy_glMultiTexCoord4ivARB; -PFNGLMULTITEXCOORD4SARBPROC pglMultiTexCoord4sARB=_Lazy_glMultiTexCoord4sARB; -PFNGLMULTITEXCOORD4SVARBPROC pglMultiTexCoord4svARB=_Lazy_glMultiTexCoord4svARB; -#endif - -/* GL_ARB_transpose_matrix */ - -#ifdef __GLEE_GL_ARB_transpose_matrix -void __stdcall _Lazy_glLoadTransposeMatrixfARB(const GLfloat * m) {if (GLeeInit()) glLoadTransposeMatrixfARB(m);} -void __stdcall _Lazy_glLoadTransposeMatrixdARB(const GLdouble * m) {if (GLeeInit()) glLoadTransposeMatrixdARB(m);} -void __stdcall _Lazy_glMultTransposeMatrixfARB(const GLfloat * m) {if (GLeeInit()) glMultTransposeMatrixfARB(m);} -void __stdcall _Lazy_glMultTransposeMatrixdARB(const GLdouble * m) {if (GLeeInit()) glMultTransposeMatrixdARB(m);} -PFNGLLOADTRANSPOSEMATRIXFARBPROC pglLoadTransposeMatrixfARB=_Lazy_glLoadTransposeMatrixfARB; -PFNGLLOADTRANSPOSEMATRIXDARBPROC pglLoadTransposeMatrixdARB=_Lazy_glLoadTransposeMatrixdARB; -PFNGLMULTTRANSPOSEMATRIXFARBPROC pglMultTransposeMatrixfARB=_Lazy_glMultTransposeMatrixfARB; -PFNGLMULTTRANSPOSEMATRIXDARBPROC pglMultTransposeMatrixdARB=_Lazy_glMultTransposeMatrixdARB; -#endif - -/* GL_ARB_multisample */ - -#ifdef __GLEE_GL_ARB_multisample -void __stdcall _Lazy_glSampleCoverageARB(GLclampf value, GLboolean invert) {if (GLeeInit()) glSampleCoverageARB(value, invert);} -PFNGLSAMPLECOVERAGEARBPROC pglSampleCoverageARB=_Lazy_glSampleCoverageARB; -#endif - -/* GL_ARB_texture_env_add */ - -#ifdef __GLEE_GL_ARB_texture_env_add -#endif - -/* GL_ARB_texture_cube_map */ - -#ifdef __GLEE_GL_ARB_texture_cube_map -#endif - -/* GL_ARB_texture_compression */ - -#ifdef __GLEE_GL_ARB_texture_compression -void __stdcall _Lazy_glCompressedTexImage3DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, data);} -void __stdcall _Lazy_glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, data);} -void __stdcall _Lazy_glCompressedTexImage1DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, data);} -void __stdcall _Lazy_glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);} -void __stdcall _Lazy_glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data);} -void __stdcall _Lazy_glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, data);} -void __stdcall _Lazy_glGetCompressedTexImageARB(GLenum target, GLint level, GLvoid * img) {if (GLeeInit()) glGetCompressedTexImageARB(target, level, img);} -PFNGLCOMPRESSEDTEXIMAGE3DARBPROC pglCompressedTexImage3DARB=_Lazy_glCompressedTexImage3DARB; -PFNGLCOMPRESSEDTEXIMAGE2DARBPROC pglCompressedTexImage2DARB=_Lazy_glCompressedTexImage2DARB; -PFNGLCOMPRESSEDTEXIMAGE1DARBPROC pglCompressedTexImage1DARB=_Lazy_glCompressedTexImage1DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC pglCompressedTexSubImage3DARB=_Lazy_glCompressedTexSubImage3DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC pglCompressedTexSubImage2DARB=_Lazy_glCompressedTexSubImage2DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC pglCompressedTexSubImage1DARB=_Lazy_glCompressedTexSubImage1DARB; -PFNGLGETCOMPRESSEDTEXIMAGEARBPROC pglGetCompressedTexImageARB=_Lazy_glGetCompressedTexImageARB; -#endif - -/* GL_ARB_texture_border_clamp */ - -#ifdef __GLEE_GL_ARB_texture_border_clamp -#endif - -/* GL_ARB_point_parameters */ - -#ifdef __GLEE_GL_ARB_point_parameters -void __stdcall _Lazy_glPointParameterfARB(GLenum pname, GLfloat param) {if (GLeeInit()) glPointParameterfARB(pname, param);} -void __stdcall _Lazy_glPointParameterfvARB(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPointParameterfvARB(pname, params);} -PFNGLPOINTPARAMETERFARBPROC pglPointParameterfARB=_Lazy_glPointParameterfARB; -PFNGLPOINTPARAMETERFVARBPROC pglPointParameterfvARB=_Lazy_glPointParameterfvARB; -#endif - -/* GL_ARB_vertex_blend */ - -#ifdef __GLEE_GL_ARB_vertex_blend -void __stdcall _Lazy_glWeightbvARB(GLint size, const GLbyte * weights) {if (GLeeInit()) glWeightbvARB(size, weights);} -void __stdcall _Lazy_glWeightsvARB(GLint size, const GLshort * weights) {if (GLeeInit()) glWeightsvARB(size, weights);} -void __stdcall _Lazy_glWeightivARB(GLint size, const GLint * weights) {if (GLeeInit()) glWeightivARB(size, weights);} -void __stdcall _Lazy_glWeightfvARB(GLint size, const GLfloat * weights) {if (GLeeInit()) glWeightfvARB(size, weights);} -void __stdcall _Lazy_glWeightdvARB(GLint size, const GLdouble * weights) {if (GLeeInit()) glWeightdvARB(size, weights);} -void __stdcall _Lazy_glWeightubvARB(GLint size, const GLubyte * weights) {if (GLeeInit()) glWeightubvARB(size, weights);} -void __stdcall _Lazy_glWeightusvARB(GLint size, const GLushort * weights) {if (GLeeInit()) glWeightusvARB(size, weights);} -void __stdcall _Lazy_glWeightuivARB(GLint size, const GLuint * weights) {if (GLeeInit()) glWeightuivARB(size, weights);} -void __stdcall _Lazy_glWeightPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glWeightPointerARB(size, type, stride, pointer);} -void __stdcall _Lazy_glVertexBlendARB(GLint count) {if (GLeeInit()) glVertexBlendARB(count);} -PFNGLWEIGHTBVARBPROC pglWeightbvARB=_Lazy_glWeightbvARB; -PFNGLWEIGHTSVARBPROC pglWeightsvARB=_Lazy_glWeightsvARB; -PFNGLWEIGHTIVARBPROC pglWeightivARB=_Lazy_glWeightivARB; -PFNGLWEIGHTFVARBPROC pglWeightfvARB=_Lazy_glWeightfvARB; -PFNGLWEIGHTDVARBPROC pglWeightdvARB=_Lazy_glWeightdvARB; -PFNGLWEIGHTUBVARBPROC pglWeightubvARB=_Lazy_glWeightubvARB; -PFNGLWEIGHTUSVARBPROC pglWeightusvARB=_Lazy_glWeightusvARB; -PFNGLWEIGHTUIVARBPROC pglWeightuivARB=_Lazy_glWeightuivARB; -PFNGLWEIGHTPOINTERARBPROC pglWeightPointerARB=_Lazy_glWeightPointerARB; -PFNGLVERTEXBLENDARBPROC pglVertexBlendARB=_Lazy_glVertexBlendARB; -#endif - -/* GL_ARB_matrix_palette */ - -#ifdef __GLEE_GL_ARB_matrix_palette -void __stdcall _Lazy_glCurrentPaletteMatrixARB(GLint index) {if (GLeeInit()) glCurrentPaletteMatrixARB(index);} -void __stdcall _Lazy_glMatrixIndexubvARB(GLint size, const GLubyte * indices) {if (GLeeInit()) glMatrixIndexubvARB(size, indices);} -void __stdcall _Lazy_glMatrixIndexusvARB(GLint size, const GLushort * indices) {if (GLeeInit()) glMatrixIndexusvARB(size, indices);} -void __stdcall _Lazy_glMatrixIndexuivARB(GLint size, const GLuint * indices) {if (GLeeInit()) glMatrixIndexuivARB(size, indices);} -void __stdcall _Lazy_glMatrixIndexPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glMatrixIndexPointerARB(size, type, stride, pointer);} -PFNGLCURRENTPALETTEMATRIXARBPROC pglCurrentPaletteMatrixARB=_Lazy_glCurrentPaletteMatrixARB; -PFNGLMATRIXINDEXUBVARBPROC pglMatrixIndexubvARB=_Lazy_glMatrixIndexubvARB; -PFNGLMATRIXINDEXUSVARBPROC pglMatrixIndexusvARB=_Lazy_glMatrixIndexusvARB; -PFNGLMATRIXINDEXUIVARBPROC pglMatrixIndexuivARB=_Lazy_glMatrixIndexuivARB; -PFNGLMATRIXINDEXPOINTERARBPROC pglMatrixIndexPointerARB=_Lazy_glMatrixIndexPointerARB; -#endif - -/* GL_ARB_texture_env_combine */ - -#ifdef __GLEE_GL_ARB_texture_env_combine -#endif - -/* GL_ARB_texture_env_crossbar */ - -#ifdef __GLEE_GL_ARB_texture_env_crossbar -#endif - -/* GL_ARB_texture_env_dot3 */ - -#ifdef __GLEE_GL_ARB_texture_env_dot3 -#endif - -/* GL_ARB_texture_mirrored_repeat */ - -#ifdef __GLEE_GL_ARB_texture_mirrored_repeat -#endif - -/* GL_ARB_depth_texture */ - -#ifdef __GLEE_GL_ARB_depth_texture -#endif - -/* GL_ARB_shadow */ - -#ifdef __GLEE_GL_ARB_shadow -#endif - -/* GL_ARB_shadow_ambient */ - -#ifdef __GLEE_GL_ARB_shadow_ambient -#endif - -/* GL_ARB_window_pos */ - -#ifdef __GLEE_GL_ARB_window_pos -void __stdcall _Lazy_glWindowPos2dARB(GLdouble x, GLdouble y) {if (GLeeInit()) glWindowPos2dARB(x, y);} -void __stdcall _Lazy_glWindowPos2dvARB(const GLdouble * v) {if (GLeeInit()) glWindowPos2dvARB(v);} -void __stdcall _Lazy_glWindowPos2fARB(GLfloat x, GLfloat y) {if (GLeeInit()) glWindowPos2fARB(x, y);} -void __stdcall _Lazy_glWindowPos2fvARB(const GLfloat * v) {if (GLeeInit()) glWindowPos2fvARB(v);} -void __stdcall _Lazy_glWindowPos2iARB(GLint x, GLint y) {if (GLeeInit()) glWindowPos2iARB(x, y);} -void __stdcall _Lazy_glWindowPos2ivARB(const GLint * v) {if (GLeeInit()) glWindowPos2ivARB(v);} -void __stdcall _Lazy_glWindowPos2sARB(GLshort x, GLshort y) {if (GLeeInit()) glWindowPos2sARB(x, y);} -void __stdcall _Lazy_glWindowPos2svARB(const GLshort * v) {if (GLeeInit()) glWindowPos2svARB(v);} -void __stdcall _Lazy_glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glWindowPos3dARB(x, y, z);} -void __stdcall _Lazy_glWindowPos3dvARB(const GLdouble * v) {if (GLeeInit()) glWindowPos3dvARB(v);} -void __stdcall _Lazy_glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glWindowPos3fARB(x, y, z);} -void __stdcall _Lazy_glWindowPos3fvARB(const GLfloat * v) {if (GLeeInit()) glWindowPos3fvARB(v);} -void __stdcall _Lazy_glWindowPos3iARB(GLint x, GLint y, GLint z) {if (GLeeInit()) glWindowPos3iARB(x, y, z);} -void __stdcall _Lazy_glWindowPos3ivARB(const GLint * v) {if (GLeeInit()) glWindowPos3ivARB(v);} -void __stdcall _Lazy_glWindowPos3sARB(GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glWindowPos3sARB(x, y, z);} -void __stdcall _Lazy_glWindowPos3svARB(const GLshort * v) {if (GLeeInit()) glWindowPos3svARB(v);} -PFNGLWINDOWPOS2DARBPROC pglWindowPos2dARB=_Lazy_glWindowPos2dARB; -PFNGLWINDOWPOS2DVARBPROC pglWindowPos2dvARB=_Lazy_glWindowPos2dvARB; -PFNGLWINDOWPOS2FARBPROC pglWindowPos2fARB=_Lazy_glWindowPos2fARB; -PFNGLWINDOWPOS2FVARBPROC pglWindowPos2fvARB=_Lazy_glWindowPos2fvARB; -PFNGLWINDOWPOS2IARBPROC pglWindowPos2iARB=_Lazy_glWindowPos2iARB; -PFNGLWINDOWPOS2IVARBPROC pglWindowPos2ivARB=_Lazy_glWindowPos2ivARB; -PFNGLWINDOWPOS2SARBPROC pglWindowPos2sARB=_Lazy_glWindowPos2sARB; -PFNGLWINDOWPOS2SVARBPROC pglWindowPos2svARB=_Lazy_glWindowPos2svARB; -PFNGLWINDOWPOS3DARBPROC pglWindowPos3dARB=_Lazy_glWindowPos3dARB; -PFNGLWINDOWPOS3DVARBPROC pglWindowPos3dvARB=_Lazy_glWindowPos3dvARB; -PFNGLWINDOWPOS3FARBPROC pglWindowPos3fARB=_Lazy_glWindowPos3fARB; -PFNGLWINDOWPOS3FVARBPROC pglWindowPos3fvARB=_Lazy_glWindowPos3fvARB; -PFNGLWINDOWPOS3IARBPROC pglWindowPos3iARB=_Lazy_glWindowPos3iARB; -PFNGLWINDOWPOS3IVARBPROC pglWindowPos3ivARB=_Lazy_glWindowPos3ivARB; -PFNGLWINDOWPOS3SARBPROC pglWindowPos3sARB=_Lazy_glWindowPos3sARB; -PFNGLWINDOWPOS3SVARBPROC pglWindowPos3svARB=_Lazy_glWindowPos3svARB; -#endif - -/* GL_ARB_vertex_program */ - -#ifdef __GLEE_GL_ARB_vertex_program -void __stdcall _Lazy_glVertexAttrib1dARB(GLuint index, GLdouble x) {if (GLeeInit()) glVertexAttrib1dARB(index, x);} -void __stdcall _Lazy_glVertexAttrib1dvARB(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib1dvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib1fARB(GLuint index, GLfloat x) {if (GLeeInit()) glVertexAttrib1fARB(index, x);} -void __stdcall _Lazy_glVertexAttrib1fvARB(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib1fvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib1sARB(GLuint index, GLshort x) {if (GLeeInit()) glVertexAttrib1sARB(index, x);} -void __stdcall _Lazy_glVertexAttrib1svARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib1svARB(index, v);} -void __stdcall _Lazy_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y) {if (GLeeInit()) glVertexAttrib2dARB(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2dvARB(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib2dvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) {if (GLeeInit()) glVertexAttrib2fARB(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2fvARB(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib2fvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y) {if (GLeeInit()) glVertexAttrib2sARB(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2svARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib2svARB(index, v);} -void __stdcall _Lazy_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glVertexAttrib3dARB(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3dvARB(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib3dvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glVertexAttrib3fARB(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3fvARB(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib3fvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glVertexAttrib3sARB(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3svARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib3svARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4NbvARB(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttrib4NbvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4NivARB(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttrib4NivARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4NsvARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4NsvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) {if (GLeeInit()) glVertexAttrib4NubARB(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4NubvARB(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4NubvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4NuivARB(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttrib4NuivARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4NusvARB(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttrib4NusvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4bvARB(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttrib4bvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glVertexAttrib4dARB(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4dvARB(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib4dvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glVertexAttrib4fARB(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4fvARB(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib4fvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4ivARB(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttrib4ivARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glVertexAttrib4sARB(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4svARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4svARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4ubvARB(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4ubvARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4uivARB(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttrib4uivARB(index, v);} -void __stdcall _Lazy_glVertexAttrib4usvARB(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttrib4usvARB(index, v);} -void __stdcall _Lazy_glVertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribPointerARB(index, size, type, normalized, stride, pointer);} -void __stdcall _Lazy_glEnableVertexAttribArrayARB(GLuint index) {if (GLeeInit()) glEnableVertexAttribArrayARB(index);} -void __stdcall _Lazy_glDisableVertexAttribArrayARB(GLuint index) {if (GLeeInit()) glDisableVertexAttribArrayARB(index);} -void __stdcall _Lazy_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string) {if (GLeeInit()) glProgramStringARB(target, format, len, string);} -void __stdcall _Lazy_glBindProgramARB(GLenum target, GLuint program) {if (GLeeInit()) glBindProgramARB(target, program);} -void __stdcall _Lazy_glDeleteProgramsARB(GLsizei n, const GLuint * programs) {if (GLeeInit()) glDeleteProgramsARB(n, programs);} -void __stdcall _Lazy_glGenProgramsARB(GLsizei n, GLuint * programs) {if (GLeeInit()) glGenProgramsARB(n, programs);} -void __stdcall _Lazy_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glProgramEnvParameter4dARB(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) {if (GLeeInit()) glProgramEnvParameter4dvARB(target, index, params);} -void __stdcall _Lazy_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glProgramEnvParameter4fARB(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) {if (GLeeInit()) glProgramEnvParameter4fvARB(target, index, params);} -void __stdcall _Lazy_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glProgramLocalParameter4dARB(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) {if (GLeeInit()) glProgramLocalParameter4dvARB(target, index, params);} -void __stdcall _Lazy_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glProgramLocalParameter4fARB(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) {if (GLeeInit()) glProgramLocalParameter4fvARB(target, index, params);} -void __stdcall _Lazy_glGetProgramEnvParameterdvARB(GLenum target, GLuint index, GLdouble * params) {if (GLeeInit()) glGetProgramEnvParameterdvARB(target, index, params);} -void __stdcall _Lazy_glGetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat * params) {if (GLeeInit()) glGetProgramEnvParameterfvARB(target, index, params);} -void __stdcall _Lazy_glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble * params) {if (GLeeInit()) glGetProgramLocalParameterdvARB(target, index, params);} -void __stdcall _Lazy_glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat * params) {if (GLeeInit()) glGetProgramLocalParameterfvARB(target, index, params);} -void __stdcall _Lazy_glGetProgramivARB(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetProgramivARB(target, pname, params);} -void __stdcall _Lazy_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) {if (GLeeInit()) glGetProgramStringARB(target, pname, string);} -void __stdcall _Lazy_glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetVertexAttribdvARB(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVertexAttribfvARB(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribivARB(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid* * pointer) {if (GLeeInit()) glGetVertexAttribPointervARB(index, pname, pointer);} -GLboolean __stdcall _Lazy_glIsProgramARB(GLuint program) {if (GLeeInit()) return glIsProgramARB(program); return (GLboolean)0;} -PFNGLVERTEXATTRIB1DARBPROC pglVertexAttrib1dARB=_Lazy_glVertexAttrib1dARB; -PFNGLVERTEXATTRIB1DVARBPROC pglVertexAttrib1dvARB=_Lazy_glVertexAttrib1dvARB; -PFNGLVERTEXATTRIB1FARBPROC pglVertexAttrib1fARB=_Lazy_glVertexAttrib1fARB; -PFNGLVERTEXATTRIB1FVARBPROC pglVertexAttrib1fvARB=_Lazy_glVertexAttrib1fvARB; -PFNGLVERTEXATTRIB1SARBPROC pglVertexAttrib1sARB=_Lazy_glVertexAttrib1sARB; -PFNGLVERTEXATTRIB1SVARBPROC pglVertexAttrib1svARB=_Lazy_glVertexAttrib1svARB; -PFNGLVERTEXATTRIB2DARBPROC pglVertexAttrib2dARB=_Lazy_glVertexAttrib2dARB; -PFNGLVERTEXATTRIB2DVARBPROC pglVertexAttrib2dvARB=_Lazy_glVertexAttrib2dvARB; -PFNGLVERTEXATTRIB2FARBPROC pglVertexAttrib2fARB=_Lazy_glVertexAttrib2fARB; -PFNGLVERTEXATTRIB2FVARBPROC pglVertexAttrib2fvARB=_Lazy_glVertexAttrib2fvARB; -PFNGLVERTEXATTRIB2SARBPROC pglVertexAttrib2sARB=_Lazy_glVertexAttrib2sARB; -PFNGLVERTEXATTRIB2SVARBPROC pglVertexAttrib2svARB=_Lazy_glVertexAttrib2svARB; -PFNGLVERTEXATTRIB3DARBPROC pglVertexAttrib3dARB=_Lazy_glVertexAttrib3dARB; -PFNGLVERTEXATTRIB3DVARBPROC pglVertexAttrib3dvARB=_Lazy_glVertexAttrib3dvARB; -PFNGLVERTEXATTRIB3FARBPROC pglVertexAttrib3fARB=_Lazy_glVertexAttrib3fARB; -PFNGLVERTEXATTRIB3FVARBPROC pglVertexAttrib3fvARB=_Lazy_glVertexAttrib3fvARB; -PFNGLVERTEXATTRIB3SARBPROC pglVertexAttrib3sARB=_Lazy_glVertexAttrib3sARB; -PFNGLVERTEXATTRIB3SVARBPROC pglVertexAttrib3svARB=_Lazy_glVertexAttrib3svARB; -PFNGLVERTEXATTRIB4NBVARBPROC pglVertexAttrib4NbvARB=_Lazy_glVertexAttrib4NbvARB; -PFNGLVERTEXATTRIB4NIVARBPROC pglVertexAttrib4NivARB=_Lazy_glVertexAttrib4NivARB; -PFNGLVERTEXATTRIB4NSVARBPROC pglVertexAttrib4NsvARB=_Lazy_glVertexAttrib4NsvARB; -PFNGLVERTEXATTRIB4NUBARBPROC pglVertexAttrib4NubARB=_Lazy_glVertexAttrib4NubARB; -PFNGLVERTEXATTRIB4NUBVARBPROC pglVertexAttrib4NubvARB=_Lazy_glVertexAttrib4NubvARB; -PFNGLVERTEXATTRIB4NUIVARBPROC pglVertexAttrib4NuivARB=_Lazy_glVertexAttrib4NuivARB; -PFNGLVERTEXATTRIB4NUSVARBPROC pglVertexAttrib4NusvARB=_Lazy_glVertexAttrib4NusvARB; -PFNGLVERTEXATTRIB4BVARBPROC pglVertexAttrib4bvARB=_Lazy_glVertexAttrib4bvARB; -PFNGLVERTEXATTRIB4DARBPROC pglVertexAttrib4dARB=_Lazy_glVertexAttrib4dARB; -PFNGLVERTEXATTRIB4DVARBPROC pglVertexAttrib4dvARB=_Lazy_glVertexAttrib4dvARB; -PFNGLVERTEXATTRIB4FARBPROC pglVertexAttrib4fARB=_Lazy_glVertexAttrib4fARB; -PFNGLVERTEXATTRIB4FVARBPROC pglVertexAttrib4fvARB=_Lazy_glVertexAttrib4fvARB; -PFNGLVERTEXATTRIB4IVARBPROC pglVertexAttrib4ivARB=_Lazy_glVertexAttrib4ivARB; -PFNGLVERTEXATTRIB4SARBPROC pglVertexAttrib4sARB=_Lazy_glVertexAttrib4sARB; -PFNGLVERTEXATTRIB4SVARBPROC pglVertexAttrib4svARB=_Lazy_glVertexAttrib4svARB; -PFNGLVERTEXATTRIB4UBVARBPROC pglVertexAttrib4ubvARB=_Lazy_glVertexAttrib4ubvARB; -PFNGLVERTEXATTRIB4UIVARBPROC pglVertexAttrib4uivARB=_Lazy_glVertexAttrib4uivARB; -PFNGLVERTEXATTRIB4USVARBPROC pglVertexAttrib4usvARB=_Lazy_glVertexAttrib4usvARB; -PFNGLVERTEXATTRIBPOINTERARBPROC pglVertexAttribPointerARB=_Lazy_glVertexAttribPointerARB; -PFNGLENABLEVERTEXATTRIBARRAYARBPROC pglEnableVertexAttribArrayARB=_Lazy_glEnableVertexAttribArrayARB; -PFNGLDISABLEVERTEXATTRIBARRAYARBPROC pglDisableVertexAttribArrayARB=_Lazy_glDisableVertexAttribArrayARB; -PFNGLPROGRAMSTRINGARBPROC pglProgramStringARB=_Lazy_glProgramStringARB; -PFNGLBINDPROGRAMARBPROC pglBindProgramARB=_Lazy_glBindProgramARB; -PFNGLDELETEPROGRAMSARBPROC pglDeleteProgramsARB=_Lazy_glDeleteProgramsARB; -PFNGLGENPROGRAMSARBPROC pglGenProgramsARB=_Lazy_glGenProgramsARB; -PFNGLPROGRAMENVPARAMETER4DARBPROC pglProgramEnvParameter4dARB=_Lazy_glProgramEnvParameter4dARB; -PFNGLPROGRAMENVPARAMETER4DVARBPROC pglProgramEnvParameter4dvARB=_Lazy_glProgramEnvParameter4dvARB; -PFNGLPROGRAMENVPARAMETER4FARBPROC pglProgramEnvParameter4fARB=_Lazy_glProgramEnvParameter4fARB; -PFNGLPROGRAMENVPARAMETER4FVARBPROC pglProgramEnvParameter4fvARB=_Lazy_glProgramEnvParameter4fvARB; -PFNGLPROGRAMLOCALPARAMETER4DARBPROC pglProgramLocalParameter4dARB=_Lazy_glProgramLocalParameter4dARB; -PFNGLPROGRAMLOCALPARAMETER4DVARBPROC pglProgramLocalParameter4dvARB=_Lazy_glProgramLocalParameter4dvARB; -PFNGLPROGRAMLOCALPARAMETER4FARBPROC pglProgramLocalParameter4fARB=_Lazy_glProgramLocalParameter4fARB; -PFNGLPROGRAMLOCALPARAMETER4FVARBPROC pglProgramLocalParameter4fvARB=_Lazy_glProgramLocalParameter4fvARB; -PFNGLGETPROGRAMENVPARAMETERDVARBPROC pglGetProgramEnvParameterdvARB=_Lazy_glGetProgramEnvParameterdvARB; -PFNGLGETPROGRAMENVPARAMETERFVARBPROC pglGetProgramEnvParameterfvARB=_Lazy_glGetProgramEnvParameterfvARB; -PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC pglGetProgramLocalParameterdvARB=_Lazy_glGetProgramLocalParameterdvARB; -PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC pglGetProgramLocalParameterfvARB=_Lazy_glGetProgramLocalParameterfvARB; -PFNGLGETPROGRAMIVARBPROC pglGetProgramivARB=_Lazy_glGetProgramivARB; -PFNGLGETPROGRAMSTRINGARBPROC pglGetProgramStringARB=_Lazy_glGetProgramStringARB; -PFNGLGETVERTEXATTRIBDVARBPROC pglGetVertexAttribdvARB=_Lazy_glGetVertexAttribdvARB; -PFNGLGETVERTEXATTRIBFVARBPROC pglGetVertexAttribfvARB=_Lazy_glGetVertexAttribfvARB; -PFNGLGETVERTEXATTRIBIVARBPROC pglGetVertexAttribivARB=_Lazy_glGetVertexAttribivARB; -PFNGLGETVERTEXATTRIBPOINTERVARBPROC pglGetVertexAttribPointervARB=_Lazy_glGetVertexAttribPointervARB; -PFNGLISPROGRAMARBPROC pglIsProgramARB=_Lazy_glIsProgramARB; -#endif - -/* GL_ARB_fragment_program */ - -#ifdef __GLEE_GL_ARB_fragment_program -#endif - -/* GL_ARB_vertex_buffer_object */ - -#ifdef __GLEE_GL_ARB_vertex_buffer_object -void __stdcall _Lazy_glBindBufferARB(GLenum target, GLuint buffer) {if (GLeeInit()) glBindBufferARB(target, buffer);} -void __stdcall _Lazy_glDeleteBuffersARB(GLsizei n, const GLuint * buffers) {if (GLeeInit()) glDeleteBuffersARB(n, buffers);} -void __stdcall _Lazy_glGenBuffersARB(GLsizei n, GLuint * buffers) {if (GLeeInit()) glGenBuffersARB(n, buffers);} -GLboolean __stdcall _Lazy_glIsBufferARB(GLuint buffer) {if (GLeeInit()) return glIsBufferARB(buffer); return (GLboolean)0;} -void __stdcall _Lazy_glBufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage) {if (GLeeInit()) glBufferDataARB(target, size, data, usage);} -void __stdcall _Lazy_glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data) {if (GLeeInit()) glBufferSubDataARB(target, offset, size, data);} -void __stdcall _Lazy_glGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data) {if (GLeeInit()) glGetBufferSubDataARB(target, offset, size, data);} -GLvoid* __stdcall _Lazy_glMapBufferARB(GLenum target, GLenum access) {if (GLeeInit()) return glMapBufferARB(target, access); return (GLvoid*)0;} -GLboolean __stdcall _Lazy_glUnmapBufferARB(GLenum target) {if (GLeeInit()) return glUnmapBufferARB(target); return (GLboolean)0;} -void __stdcall _Lazy_glGetBufferParameterivARB(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetBufferParameterivARB(target, pname, params);} -void __stdcall _Lazy_glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid* * params) {if (GLeeInit()) glGetBufferPointervARB(target, pname, params);} -PFNGLBINDBUFFERARBPROC pglBindBufferARB=_Lazy_glBindBufferARB; -PFNGLDELETEBUFFERSARBPROC pglDeleteBuffersARB=_Lazy_glDeleteBuffersARB; -PFNGLGENBUFFERSARBPROC pglGenBuffersARB=_Lazy_glGenBuffersARB; -PFNGLISBUFFERARBPROC pglIsBufferARB=_Lazy_glIsBufferARB; -PFNGLBUFFERDATAARBPROC pglBufferDataARB=_Lazy_glBufferDataARB; -PFNGLBUFFERSUBDATAARBPROC pglBufferSubDataARB=_Lazy_glBufferSubDataARB; -PFNGLGETBUFFERSUBDATAARBPROC pglGetBufferSubDataARB=_Lazy_glGetBufferSubDataARB; -PFNGLMAPBUFFERARBPROC pglMapBufferARB=_Lazy_glMapBufferARB; -PFNGLUNMAPBUFFERARBPROC pglUnmapBufferARB=_Lazy_glUnmapBufferARB; -PFNGLGETBUFFERPARAMETERIVARBPROC pglGetBufferParameterivARB=_Lazy_glGetBufferParameterivARB; -PFNGLGETBUFFERPOINTERVARBPROC pglGetBufferPointervARB=_Lazy_glGetBufferPointervARB; -#endif - -/* GL_ARB_occlusion_query */ - -#ifdef __GLEE_GL_ARB_occlusion_query -void __stdcall _Lazy_glGenQueriesARB(GLsizei n, GLuint * ids) {if (GLeeInit()) glGenQueriesARB(n, ids);} -void __stdcall _Lazy_glDeleteQueriesARB(GLsizei n, const GLuint * ids) {if (GLeeInit()) glDeleteQueriesARB(n, ids);} -GLboolean __stdcall _Lazy_glIsQueryARB(GLuint id) {if (GLeeInit()) return glIsQueryARB(id); return (GLboolean)0;} -void __stdcall _Lazy_glBeginQueryARB(GLenum target, GLuint id) {if (GLeeInit()) glBeginQueryARB(target, id);} -void __stdcall _Lazy_glEndQueryARB(GLenum target) {if (GLeeInit()) glEndQueryARB(target);} -void __stdcall _Lazy_glGetQueryivARB(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetQueryivARB(target, pname, params);} -void __stdcall _Lazy_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetQueryObjectivARB(id, pname, params);} -void __stdcall _Lazy_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params) {if (GLeeInit()) glGetQueryObjectuivARB(id, pname, params);} -PFNGLGENQUERIESARBPROC pglGenQueriesARB=_Lazy_glGenQueriesARB; -PFNGLDELETEQUERIESARBPROC pglDeleteQueriesARB=_Lazy_glDeleteQueriesARB; -PFNGLISQUERYARBPROC pglIsQueryARB=_Lazy_glIsQueryARB; -PFNGLBEGINQUERYARBPROC pglBeginQueryARB=_Lazy_glBeginQueryARB; -PFNGLENDQUERYARBPROC pglEndQueryARB=_Lazy_glEndQueryARB; -PFNGLGETQUERYIVARBPROC pglGetQueryivARB=_Lazy_glGetQueryivARB; -PFNGLGETQUERYOBJECTIVARBPROC pglGetQueryObjectivARB=_Lazy_glGetQueryObjectivARB; -PFNGLGETQUERYOBJECTUIVARBPROC pglGetQueryObjectuivARB=_Lazy_glGetQueryObjectuivARB; -#endif - -/* GL_ARB_shader_objects */ - -#ifdef __GLEE_GL_ARB_shader_objects -void __stdcall _Lazy_glDeleteObjectARB(GLhandleARB obj) {if (GLeeInit()) glDeleteObjectARB(obj);} -GLhandleARB __stdcall _Lazy_glGetHandleARB(GLenum pname) {if (GLeeInit()) return glGetHandleARB(pname); return (GLhandleARB)0;} -void __stdcall _Lazy_glDetachObjectARB(GLhandleARB containerObj, GLhandleARB attachedObj) {if (GLeeInit()) glDetachObjectARB(containerObj, attachedObj);} -GLhandleARB __stdcall _Lazy_glCreateShaderObjectARB(GLenum shaderType) {if (GLeeInit()) return glCreateShaderObjectARB(shaderType); return (GLhandleARB)0;} -void __stdcall _Lazy_glShaderSourceARB(GLhandleARB shaderObj, GLsizei count, const GLcharARB* * string, const GLint * length) {if (GLeeInit()) glShaderSourceARB(shaderObj, count, string, length);} -void __stdcall _Lazy_glCompileShaderARB(GLhandleARB shaderObj) {if (GLeeInit()) glCompileShaderARB(shaderObj);} -GLhandleARB __stdcall _Lazy_glCreateProgramObjectARB(void) {if (GLeeInit()) return glCreateProgramObjectARB(); return (GLhandleARB)0;} -void __stdcall _Lazy_glAttachObjectARB(GLhandleARB containerObj, GLhandleARB obj) {if (GLeeInit()) glAttachObjectARB(containerObj, obj);} -void __stdcall _Lazy_glLinkProgramARB(GLhandleARB programObj) {if (GLeeInit()) glLinkProgramARB(programObj);} -void __stdcall _Lazy_glUseProgramObjectARB(GLhandleARB programObj) {if (GLeeInit()) glUseProgramObjectARB(programObj);} -void __stdcall _Lazy_glValidateProgramARB(GLhandleARB programObj) {if (GLeeInit()) glValidateProgramARB(programObj);} -void __stdcall _Lazy_glUniform1fARB(GLint location, GLfloat v0) {if (GLeeInit()) glUniform1fARB(location, v0);} -void __stdcall _Lazy_glUniform2fARB(GLint location, GLfloat v0, GLfloat v1) {if (GLeeInit()) glUniform2fARB(location, v0, v1);} -void __stdcall _Lazy_glUniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {if (GLeeInit()) glUniform3fARB(location, v0, v1, v2);} -void __stdcall _Lazy_glUniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {if (GLeeInit()) glUniform4fARB(location, v0, v1, v2, v3);} -void __stdcall _Lazy_glUniform1iARB(GLint location, GLint v0) {if (GLeeInit()) glUniform1iARB(location, v0);} -void __stdcall _Lazy_glUniform2iARB(GLint location, GLint v0, GLint v1) {if (GLeeInit()) glUniform2iARB(location, v0, v1);} -void __stdcall _Lazy_glUniform3iARB(GLint location, GLint v0, GLint v1, GLint v2) {if (GLeeInit()) glUniform3iARB(location, v0, v1, v2);} -void __stdcall _Lazy_glUniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {if (GLeeInit()) glUniform4iARB(location, v0, v1, v2, v3);} -void __stdcall _Lazy_glUniform1fvARB(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform1fvARB(location, count, value);} -void __stdcall _Lazy_glUniform2fvARB(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform2fvARB(location, count, value);} -void __stdcall _Lazy_glUniform3fvARB(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform3fvARB(location, count, value);} -void __stdcall _Lazy_glUniform4fvARB(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform4fvARB(location, count, value);} -void __stdcall _Lazy_glUniform1ivARB(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform1ivARB(location, count, value);} -void __stdcall _Lazy_glUniform2ivARB(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform2ivARB(location, count, value);} -void __stdcall _Lazy_glUniform3ivARB(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform3ivARB(location, count, value);} -void __stdcall _Lazy_glUniform4ivARB(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform4ivARB(location, count, value);} -void __stdcall _Lazy_glUniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix2fvARB(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix3fvARB(location, count, transpose, value);} -void __stdcall _Lazy_glUniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix4fvARB(location, count, transpose, value);} -void __stdcall _Lazy_glGetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetObjectParameterfvARB(obj, pname, params);} -void __stdcall _Lazy_glGetObjectParameterivARB(GLhandleARB obj, GLenum pname, GLint * params) {if (GLeeInit()) glGetObjectParameterivARB(obj, pname, params);} -void __stdcall _Lazy_glGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog) {if (GLeeInit()) glGetInfoLogARB(obj, maxLength, length, infoLog);} -void __stdcall _Lazy_glGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj) {if (GLeeInit()) glGetAttachedObjectsARB(containerObj, maxCount, count, obj);} -GLint __stdcall _Lazy_glGetUniformLocationARB(GLhandleARB programObj, const GLcharARB * name) {if (GLeeInit()) return glGetUniformLocationARB(programObj, name); return (GLint)0;} -void __stdcall _Lazy_glGetActiveUniformARB(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) {if (GLeeInit()) glGetActiveUniformARB(programObj, index, maxLength, length, size, type, name);} -void __stdcall _Lazy_glGetUniformfvARB(GLhandleARB programObj, GLint location, GLfloat * params) {if (GLeeInit()) glGetUniformfvARB(programObj, location, params);} -void __stdcall _Lazy_glGetUniformivARB(GLhandleARB programObj, GLint location, GLint * params) {if (GLeeInit()) glGetUniformivARB(programObj, location, params);} -void __stdcall _Lazy_glGetShaderSourceARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source) {if (GLeeInit()) glGetShaderSourceARB(obj, maxLength, length, source);} -PFNGLDELETEOBJECTARBPROC pglDeleteObjectARB=_Lazy_glDeleteObjectARB; -PFNGLGETHANDLEARBPROC pglGetHandleARB=_Lazy_glGetHandleARB; -PFNGLDETACHOBJECTARBPROC pglDetachObjectARB=_Lazy_glDetachObjectARB; -PFNGLCREATESHADEROBJECTARBPROC pglCreateShaderObjectARB=_Lazy_glCreateShaderObjectARB; -PFNGLSHADERSOURCEARBPROC pglShaderSourceARB=_Lazy_glShaderSourceARB; -PFNGLCOMPILESHADERARBPROC pglCompileShaderARB=_Lazy_glCompileShaderARB; -PFNGLCREATEPROGRAMOBJECTARBPROC pglCreateProgramObjectARB=_Lazy_glCreateProgramObjectARB; -PFNGLATTACHOBJECTARBPROC pglAttachObjectARB=_Lazy_glAttachObjectARB; -PFNGLLINKPROGRAMARBPROC pglLinkProgramARB=_Lazy_glLinkProgramARB; -PFNGLUSEPROGRAMOBJECTARBPROC pglUseProgramObjectARB=_Lazy_glUseProgramObjectARB; -PFNGLVALIDATEPROGRAMARBPROC pglValidateProgramARB=_Lazy_glValidateProgramARB; -PFNGLUNIFORM1FARBPROC pglUniform1fARB=_Lazy_glUniform1fARB; -PFNGLUNIFORM2FARBPROC pglUniform2fARB=_Lazy_glUniform2fARB; -PFNGLUNIFORM3FARBPROC pglUniform3fARB=_Lazy_glUniform3fARB; -PFNGLUNIFORM4FARBPROC pglUniform4fARB=_Lazy_glUniform4fARB; -PFNGLUNIFORM1IARBPROC pglUniform1iARB=_Lazy_glUniform1iARB; -PFNGLUNIFORM2IARBPROC pglUniform2iARB=_Lazy_glUniform2iARB; -PFNGLUNIFORM3IARBPROC pglUniform3iARB=_Lazy_glUniform3iARB; -PFNGLUNIFORM4IARBPROC pglUniform4iARB=_Lazy_glUniform4iARB; -PFNGLUNIFORM1FVARBPROC pglUniform1fvARB=_Lazy_glUniform1fvARB; -PFNGLUNIFORM2FVARBPROC pglUniform2fvARB=_Lazy_glUniform2fvARB; -PFNGLUNIFORM3FVARBPROC pglUniform3fvARB=_Lazy_glUniform3fvARB; -PFNGLUNIFORM4FVARBPROC pglUniform4fvARB=_Lazy_glUniform4fvARB; -PFNGLUNIFORM1IVARBPROC pglUniform1ivARB=_Lazy_glUniform1ivARB; -PFNGLUNIFORM2IVARBPROC pglUniform2ivARB=_Lazy_glUniform2ivARB; -PFNGLUNIFORM3IVARBPROC pglUniform3ivARB=_Lazy_glUniform3ivARB; -PFNGLUNIFORM4IVARBPROC pglUniform4ivARB=_Lazy_glUniform4ivARB; -PFNGLUNIFORMMATRIX2FVARBPROC pglUniformMatrix2fvARB=_Lazy_glUniformMatrix2fvARB; -PFNGLUNIFORMMATRIX3FVARBPROC pglUniformMatrix3fvARB=_Lazy_glUniformMatrix3fvARB; -PFNGLUNIFORMMATRIX4FVARBPROC pglUniformMatrix4fvARB=_Lazy_glUniformMatrix4fvARB; -PFNGLGETOBJECTPARAMETERFVARBPROC pglGetObjectParameterfvARB=_Lazy_glGetObjectParameterfvARB; -PFNGLGETOBJECTPARAMETERIVARBPROC pglGetObjectParameterivARB=_Lazy_glGetObjectParameterivARB; -PFNGLGETINFOLOGARBPROC pglGetInfoLogARB=_Lazy_glGetInfoLogARB; -PFNGLGETATTACHEDOBJECTSARBPROC pglGetAttachedObjectsARB=_Lazy_glGetAttachedObjectsARB; -PFNGLGETUNIFORMLOCATIONARBPROC pglGetUniformLocationARB=_Lazy_glGetUniformLocationARB; -PFNGLGETACTIVEUNIFORMARBPROC pglGetActiveUniformARB=_Lazy_glGetActiveUniformARB; -PFNGLGETUNIFORMFVARBPROC pglGetUniformfvARB=_Lazy_glGetUniformfvARB; -PFNGLGETUNIFORMIVARBPROC pglGetUniformivARB=_Lazy_glGetUniformivARB; -PFNGLGETSHADERSOURCEARBPROC pglGetShaderSourceARB=_Lazy_glGetShaderSourceARB; -#endif - -/* GL_ARB_vertex_shader */ - -#ifdef __GLEE_GL_ARB_vertex_shader -void __stdcall _Lazy_glBindAttribLocationARB(GLhandleARB programObj, GLuint index, const GLcharARB * name) {if (GLeeInit()) glBindAttribLocationARB(programObj, index, name);} -void __stdcall _Lazy_glGetActiveAttribARB(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) {if (GLeeInit()) glGetActiveAttribARB(programObj, index, maxLength, length, size, type, name);} -GLint __stdcall _Lazy_glGetAttribLocationARB(GLhandleARB programObj, const GLcharARB * name) {if (GLeeInit()) return glGetAttribLocationARB(programObj, name); return (GLint)0;} -PFNGLBINDATTRIBLOCATIONARBPROC pglBindAttribLocationARB=_Lazy_glBindAttribLocationARB; -PFNGLGETACTIVEATTRIBARBPROC pglGetActiveAttribARB=_Lazy_glGetActiveAttribARB; -PFNGLGETATTRIBLOCATIONARBPROC pglGetAttribLocationARB=_Lazy_glGetAttribLocationARB; -#endif - -/* GL_ARB_fragment_shader */ - -#ifdef __GLEE_GL_ARB_fragment_shader -#endif - -/* GL_ARB_shading_language_100 */ - -#ifdef __GLEE_GL_ARB_shading_language_100 -#endif - -/* GL_ARB_texture_non_power_of_two */ - -#ifdef __GLEE_GL_ARB_texture_non_power_of_two -#endif - -/* GL_ARB_point_sprite */ - -#ifdef __GLEE_GL_ARB_point_sprite -#endif - -/* GL_ARB_fragment_program_shadow */ - -#ifdef __GLEE_GL_ARB_fragment_program_shadow -#endif - -/* GL_ARB_draw_buffers */ - -#ifdef __GLEE_GL_ARB_draw_buffers -void __stdcall _Lazy_glDrawBuffersARB(GLsizei n, const GLenum * bufs) {if (GLeeInit()) glDrawBuffersARB(n, bufs);} -PFNGLDRAWBUFFERSARBPROC pglDrawBuffersARB=_Lazy_glDrawBuffersARB; -#endif - -/* GL_ARB_texture_rectangle */ - -#ifdef __GLEE_GL_ARB_texture_rectangle -#endif - -/* GL_ARB_color_buffer_float */ - -#ifdef __GLEE_GL_ARB_color_buffer_float -void __stdcall _Lazy_glClampColorARB(GLenum target, GLenum clamp) {if (GLeeInit()) glClampColorARB(target, clamp);} -PFNGLCLAMPCOLORARBPROC pglClampColorARB=_Lazy_glClampColorARB; -#endif - -/* GL_ARB_half_float_pixel */ - -#ifdef __GLEE_GL_ARB_half_float_pixel -#endif - -/* GL_ARB_texture_float */ - -#ifdef __GLEE_GL_ARB_texture_float -#endif - -/* GL_ARB_pixel_buffer_object */ - -#ifdef __GLEE_GL_ARB_pixel_buffer_object -#endif - -/* GL_ARB_depth_buffer_float */ - -#ifdef __GLEE_GL_ARB_depth_buffer_float -#endif - -/* GL_ARB_drawinstanced */ - -#ifdef __GLEE_GL_ARB_drawinstanced -void __stdcall _Lazy_glDrawArraysInstancedARB(GLenum mode, GLint first, GLsizei count, GLsizei primcount) {if (GLeeInit()) glDrawArraysInstancedARB(mode, first, count, primcount);} -void __stdcall _Lazy_glDrawElementsInstancedARB(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount) {if (GLeeInit()) glDrawElementsInstancedARB(mode, count, type, indices, primcount);} -PFNGLDRAWARRAYSINSTANCEDARBPROC pglDrawArraysInstancedARB=_Lazy_glDrawArraysInstancedARB; -PFNGLDRAWELEMENTSINSTANCEDARBPROC pglDrawElementsInstancedARB=_Lazy_glDrawElementsInstancedARB; -#endif - -/* GL_ARB_framebuffer_object */ - -#ifdef __GLEE_GL_ARB_framebuffer_object -GLboolean __stdcall _Lazy_glIsRenderbuffer(GLuint renderbuffer) {if (GLeeInit()) return glIsRenderbuffer(renderbuffer); return (GLboolean)0;} -void __stdcall _Lazy_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {if (GLeeInit()) glBindRenderbuffer(target, renderbuffer);} -void __stdcall _Lazy_glDeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers) {if (GLeeInit()) glDeleteRenderbuffers(n, renderbuffers);} -void __stdcall _Lazy_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) {if (GLeeInit()) glGenRenderbuffers(n, renderbuffers);} -void __stdcall _Lazy_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorage(target, internalformat, width, height);} -void __stdcall _Lazy_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetRenderbufferParameteriv(target, pname, params);} -GLboolean __stdcall _Lazy_glIsFramebuffer(GLuint framebuffer) {if (GLeeInit()) return glIsFramebuffer(framebuffer); return (GLboolean)0;} -void __stdcall _Lazy_glBindFramebuffer(GLenum target, GLuint framebuffer) {if (GLeeInit()) glBindFramebuffer(target, framebuffer);} -void __stdcall _Lazy_glDeleteFramebuffers(GLsizei n, const GLuint * framebuffers) {if (GLeeInit()) glDeleteFramebuffers(n, framebuffers);} -void __stdcall _Lazy_glGenFramebuffers(GLsizei n, GLuint * framebuffers) {if (GLeeInit()) glGenFramebuffers(n, framebuffers);} -GLenum __stdcall _Lazy_glCheckFramebufferStatus(GLenum target) {if (GLeeInit()) return glCheckFramebufferStatus(target); return (GLenum)0;} -void __stdcall _Lazy_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTexture1D(target, attachment, textarget, texture, level);} -void __stdcall _Lazy_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTexture2D(target, attachment, textarget, texture, level);} -void __stdcall _Lazy_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {if (GLeeInit()) glFramebufferTexture3D(target, attachment, textarget, texture, level, zoffset);} -void __stdcall _Lazy_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {if (GLeeInit()) glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);} -void __stdcall _Lazy_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) {if (GLeeInit()) glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);} -void __stdcall _Lazy_glGenerateMipmap(GLenum target) {if (GLeeInit()) glGenerateMipmap(target);} -void __stdcall _Lazy_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {if (GLeeInit()) glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);} -void __stdcall _Lazy_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorageMultisample(target, samples, internalformat, width, height);} -void __stdcall _Lazy_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {if (GLeeInit()) glFramebufferTextureLayer(target, attachment, texture, level, layer);} -PFNGLISRENDERBUFFERPROC pglIsRenderbuffer=_Lazy_glIsRenderbuffer; -PFNGLBINDRENDERBUFFERPROC pglBindRenderbuffer=_Lazy_glBindRenderbuffer; -PFNGLDELETERENDERBUFFERSPROC pglDeleteRenderbuffers=_Lazy_glDeleteRenderbuffers; -PFNGLGENRENDERBUFFERSPROC pglGenRenderbuffers=_Lazy_glGenRenderbuffers; -PFNGLRENDERBUFFERSTORAGEPROC pglRenderbufferStorage=_Lazy_glRenderbufferStorage; -PFNGLGETRENDERBUFFERPARAMETERIVPROC pglGetRenderbufferParameteriv=_Lazy_glGetRenderbufferParameteriv; -PFNGLISFRAMEBUFFERPROC pglIsFramebuffer=_Lazy_glIsFramebuffer; -PFNGLBINDFRAMEBUFFERPROC pglBindFramebuffer=_Lazy_glBindFramebuffer; -PFNGLDELETEFRAMEBUFFERSPROC pglDeleteFramebuffers=_Lazy_glDeleteFramebuffers; -PFNGLGENFRAMEBUFFERSPROC pglGenFramebuffers=_Lazy_glGenFramebuffers; -PFNGLCHECKFRAMEBUFFERSTATUSPROC pglCheckFramebufferStatus=_Lazy_glCheckFramebufferStatus; -PFNGLFRAMEBUFFERTEXTURE1DPROC pglFramebufferTexture1D=_Lazy_glFramebufferTexture1D; -PFNGLFRAMEBUFFERTEXTURE2DPROC pglFramebufferTexture2D=_Lazy_glFramebufferTexture2D; -PFNGLFRAMEBUFFERTEXTURE3DPROC pglFramebufferTexture3D=_Lazy_glFramebufferTexture3D; -PFNGLFRAMEBUFFERRENDERBUFFERPROC pglFramebufferRenderbuffer=_Lazy_glFramebufferRenderbuffer; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC pglGetFramebufferAttachmentParameteriv=_Lazy_glGetFramebufferAttachmentParameteriv; -PFNGLGENERATEMIPMAPPROC pglGenerateMipmap=_Lazy_glGenerateMipmap; -PFNGLBLITFRAMEBUFFERPROC pglBlitFramebuffer=_Lazy_glBlitFramebuffer; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC pglRenderbufferStorageMultisample=_Lazy_glRenderbufferStorageMultisample; -PFNGLFRAMEBUFFERTEXTURELAYERPROC pglFramebufferTextureLayer=_Lazy_glFramebufferTextureLayer; -#endif - -/* GL_ARB_framebuffer_sRGB */ - -#ifdef __GLEE_GL_ARB_framebuffer_sRGB -#endif - -/* GL_ARB_geometry_shader4 */ - -#ifdef __GLEE_GL_ARB_geometry_shader4 -void __stdcall _Lazy_glProgramParameteriARB(GLuint program, GLenum pname, GLint value) {if (GLeeInit()) glProgramParameteriARB(program, pname, value);} -void __stdcall _Lazy_glFramebufferTextureARB(GLenum target, GLenum attachment, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTextureARB(target, attachment, texture, level);} -void __stdcall _Lazy_glFramebufferTextureLayerARB(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {if (GLeeInit()) glFramebufferTextureLayerARB(target, attachment, texture, level, layer);} -void __stdcall _Lazy_glFramebufferTextureFaceARB(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) {if (GLeeInit()) glFramebufferTextureFaceARB(target, attachment, texture, level, face);} -PFNGLPROGRAMPARAMETERIARBPROC pglProgramParameteriARB=_Lazy_glProgramParameteriARB; -PFNGLFRAMEBUFFERTEXTUREARBPROC pglFramebufferTextureARB=_Lazy_glFramebufferTextureARB; -PFNGLFRAMEBUFFERTEXTURELAYERARBPROC pglFramebufferTextureLayerARB=_Lazy_glFramebufferTextureLayerARB; -PFNGLFRAMEBUFFERTEXTUREFACEARBPROC pglFramebufferTextureFaceARB=_Lazy_glFramebufferTextureFaceARB; -#endif - -/* GL_ARB_half_float_vertex */ - -#ifdef __GLEE_GL_ARB_half_float_vertex -#endif - -/* GL_ARBinstanced_arrays */ - -#ifdef __GLEE_GL_ARBinstanced_arrays -void __stdcall _Lazy_glVertexAttribDivisor(GLuint index, GLuint divisor) {if (GLeeInit()) glVertexAttribDivisor(index, divisor);} -PFNGLVERTEXATTRIBDIVISORPROC pglVertexAttribDivisor=_Lazy_glVertexAttribDivisor; -#endif - -/* GL_ARB_map_buffer_range */ - -#ifdef __GLEE_GL_ARB_map_buffer_range -void __stdcall _Lazy_glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {if (GLeeInit()) glMapBufferRange(target, offset, length, access);} -void __stdcall _Lazy_glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) {if (GLeeInit()) glFlushMappedBufferRange(target, offset, length);} -PFNGLMAPBUFFERRANGEPROC pglMapBufferRange=_Lazy_glMapBufferRange; -PFNGLFLUSHMAPPEDBUFFERRANGEPROC pglFlushMappedBufferRange=_Lazy_glFlushMappedBufferRange; -#endif - -/* GL_ARB_texture_buffer_object */ - -#ifdef __GLEE_GL_ARB_texture_buffer_object -void __stdcall _Lazy_glTexBufferARB(GLenum target, GLenum internalformat, GLuint buffer) {if (GLeeInit()) glTexBufferARB(target, internalformat, buffer);} -PFNGLTEXBUFFERARBPROC pglTexBufferARB=_Lazy_glTexBufferARB; -#endif - -/* GL_ARB_texture_compression_rgtc */ - -#ifdef __GLEE_GL_ARB_texture_compression_rgtc -#endif - -/* GL_ARB_texture_rg */ - -#ifdef __GLEE_GL_ARB_texture_rg -#endif - -/* GL_ARB_vertex_array_object */ - -#ifdef __GLEE_GL_ARB_vertex_array_object -void __stdcall _Lazy_glBindVertexArray(GLuint array) {if (GLeeInit()) glBindVertexArray(array);} -void __stdcall _Lazy_glDeleteVertexArrays(GLsizei n, const GLuint * arrays) {if (GLeeInit()) glDeleteVertexArrays(n, arrays);} -void __stdcall _Lazy_glGenVertexArrays(GLsizei n, GLuint * arrays) {if (GLeeInit()) glGenVertexArrays(n, arrays);} -GLboolean __stdcall _Lazy_glIsVertexArray(GLuint array) {if (GLeeInit()) return glIsVertexArray(array); return (GLboolean)0;} -PFNGLBINDVERTEXARRAYPROC pglBindVertexArray=_Lazy_glBindVertexArray; -PFNGLDELETEVERTEXARRAYSPROC pglDeleteVertexArrays=_Lazy_glDeleteVertexArrays; -PFNGLGENVERTEXARRAYSPROC pglGenVertexArrays=_Lazy_glGenVertexArrays; -PFNGLISVERTEXARRAYPROC pglIsVertexArray=_Lazy_glIsVertexArray; -#endif - -/* GL_EXT_abgr */ - -#ifdef __GLEE_GL_EXT_abgr -#endif - -/* GL_EXT_blend_color */ - -#ifdef __GLEE_GL_EXT_blend_color -void __stdcall _Lazy_glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {if (GLeeInit()) glBlendColorEXT(red, green, blue, alpha);} -PFNGLBLENDCOLOREXTPROC pglBlendColorEXT=_Lazy_glBlendColorEXT; -#endif - -/* GL_EXT_polygon_offset */ - -#ifdef __GLEE_GL_EXT_polygon_offset -void __stdcall _Lazy_glPolygonOffsetEXT(GLfloat factor, GLfloat bias) {if (GLeeInit()) glPolygonOffsetEXT(factor, bias);} -PFNGLPOLYGONOFFSETEXTPROC pglPolygonOffsetEXT=_Lazy_glPolygonOffsetEXT; -#endif - -/* GL_EXT_texture */ - -#ifdef __GLEE_GL_EXT_texture -#endif - -/* GL_EXT_texture3D */ - -#ifdef __GLEE_GL_EXT_texture3D -void __stdcall _Lazy_glTexImage3DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexImage3DEXT(target, level, internalformat, width, height, depth, border, format, type, pixels);} -void __stdcall _Lazy_glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage3DEXT(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);} -PFNGLTEXIMAGE3DEXTPROC pglTexImage3DEXT=_Lazy_glTexImage3DEXT; -PFNGLTEXSUBIMAGE3DEXTPROC pglTexSubImage3DEXT=_Lazy_glTexSubImage3DEXT; -#endif - -/* GL_SGIS_texture_filter4 */ - -#ifdef __GLEE_GL_SGIS_texture_filter4 -void __stdcall _Lazy_glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat * weights) {if (GLeeInit()) glGetTexFilterFuncSGIS(target, filter, weights);} -void __stdcall _Lazy_glTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat * weights) {if (GLeeInit()) glTexFilterFuncSGIS(target, filter, n, weights);} -PFNGLGETTEXFILTERFUNCSGISPROC pglGetTexFilterFuncSGIS=_Lazy_glGetTexFilterFuncSGIS; -PFNGLTEXFILTERFUNCSGISPROC pglTexFilterFuncSGIS=_Lazy_glTexFilterFuncSGIS; -#endif - -/* GL_EXT_subtexture */ - -#ifdef __GLEE_GL_EXT_subtexture -void __stdcall _Lazy_glTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage1DEXT(target, level, xoffset, width, format, type, pixels);} -void __stdcall _Lazy_glTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage2DEXT(target, level, xoffset, yoffset, width, height, format, type, pixels);} -PFNGLTEXSUBIMAGE1DEXTPROC pglTexSubImage1DEXT=_Lazy_glTexSubImage1DEXT; -PFNGLTEXSUBIMAGE2DEXTPROC pglTexSubImage2DEXT=_Lazy_glTexSubImage2DEXT; -#endif - -/* GL_EXT_copy_texture */ - -#ifdef __GLEE_GL_EXT_copy_texture -void __stdcall _Lazy_glCopyTexImage1DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {if (GLeeInit()) glCopyTexImage1DEXT(target, level, internalformat, x, y, width, border);} -void __stdcall _Lazy_glCopyTexImage2DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {if (GLeeInit()) glCopyTexImage2DEXT(target, level, internalformat, x, y, width, height, border);} -void __stdcall _Lazy_glCopyTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyTexSubImage1DEXT(target, level, xoffset, x, y, width);} -void __stdcall _Lazy_glCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTexSubImage2DEXT(target, level, xoffset, yoffset, x, y, width, height);} -void __stdcall _Lazy_glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTexSubImage3DEXT(target, level, xoffset, yoffset, zoffset, x, y, width, height);} -PFNGLCOPYTEXIMAGE1DEXTPROC pglCopyTexImage1DEXT=_Lazy_glCopyTexImage1DEXT; -PFNGLCOPYTEXIMAGE2DEXTPROC pglCopyTexImage2DEXT=_Lazy_glCopyTexImage2DEXT; -PFNGLCOPYTEXSUBIMAGE1DEXTPROC pglCopyTexSubImage1DEXT=_Lazy_glCopyTexSubImage1DEXT; -PFNGLCOPYTEXSUBIMAGE2DEXTPROC pglCopyTexSubImage2DEXT=_Lazy_glCopyTexSubImage2DEXT; -PFNGLCOPYTEXSUBIMAGE3DEXTPROC pglCopyTexSubImage3DEXT=_Lazy_glCopyTexSubImage3DEXT; -#endif - -/* GL_EXT_histogram */ - -#ifdef __GLEE_GL_EXT_histogram -void __stdcall _Lazy_glGetHistogramEXT(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) {if (GLeeInit()) glGetHistogramEXT(target, reset, format, type, values);} -void __stdcall _Lazy_glGetHistogramParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetHistogramParameterfvEXT(target, pname, params);} -void __stdcall _Lazy_glGetHistogramParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetHistogramParameterivEXT(target, pname, params);} -void __stdcall _Lazy_glGetMinmaxEXT(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) {if (GLeeInit()) glGetMinmaxEXT(target, reset, format, type, values);} -void __stdcall _Lazy_glGetMinmaxParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMinmaxParameterfvEXT(target, pname, params);} -void __stdcall _Lazy_glGetMinmaxParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMinmaxParameterivEXT(target, pname, params);} -void __stdcall _Lazy_glHistogramEXT(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) {if (GLeeInit()) glHistogramEXT(target, width, internalformat, sink);} -void __stdcall _Lazy_glMinmaxEXT(GLenum target, GLenum internalformat, GLboolean sink) {if (GLeeInit()) glMinmaxEXT(target, internalformat, sink);} -void __stdcall _Lazy_glResetHistogramEXT(GLenum target) {if (GLeeInit()) glResetHistogramEXT(target);} -void __stdcall _Lazy_glResetMinmaxEXT(GLenum target) {if (GLeeInit()) glResetMinmaxEXT(target);} -PFNGLGETHISTOGRAMEXTPROC pglGetHistogramEXT=_Lazy_glGetHistogramEXT; -PFNGLGETHISTOGRAMPARAMETERFVEXTPROC pglGetHistogramParameterfvEXT=_Lazy_glGetHistogramParameterfvEXT; -PFNGLGETHISTOGRAMPARAMETERIVEXTPROC pglGetHistogramParameterivEXT=_Lazy_glGetHistogramParameterivEXT; -PFNGLGETMINMAXEXTPROC pglGetMinmaxEXT=_Lazy_glGetMinmaxEXT; -PFNGLGETMINMAXPARAMETERFVEXTPROC pglGetMinmaxParameterfvEXT=_Lazy_glGetMinmaxParameterfvEXT; -PFNGLGETMINMAXPARAMETERIVEXTPROC pglGetMinmaxParameterivEXT=_Lazy_glGetMinmaxParameterivEXT; -PFNGLHISTOGRAMEXTPROC pglHistogramEXT=_Lazy_glHistogramEXT; -PFNGLMINMAXEXTPROC pglMinmaxEXT=_Lazy_glMinmaxEXT; -PFNGLRESETHISTOGRAMEXTPROC pglResetHistogramEXT=_Lazy_glResetHistogramEXT; -PFNGLRESETMINMAXEXTPROC pglResetMinmaxEXT=_Lazy_glResetMinmaxEXT; -#endif - -/* GL_EXT_convolution */ - -#ifdef __GLEE_GL_EXT_convolution -void __stdcall _Lazy_glConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) {if (GLeeInit()) glConvolutionFilter1DEXT(target, internalformat, width, format, type, image);} -void __stdcall _Lazy_glConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) {if (GLeeInit()) glConvolutionFilter2DEXT(target, internalformat, width, height, format, type, image);} -void __stdcall _Lazy_glConvolutionParameterfEXT(GLenum target, GLenum pname, GLfloat params) {if (GLeeInit()) glConvolutionParameterfEXT(target, pname, params);} -void __stdcall _Lazy_glConvolutionParameterfvEXT(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glConvolutionParameterfvEXT(target, pname, params);} -void __stdcall _Lazy_glConvolutionParameteriEXT(GLenum target, GLenum pname, GLint params) {if (GLeeInit()) glConvolutionParameteriEXT(target, pname, params);} -void __stdcall _Lazy_glConvolutionParameterivEXT(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glConvolutionParameterivEXT(target, pname, params);} -void __stdcall _Lazy_glCopyConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyConvolutionFilter1DEXT(target, internalformat, x, y, width);} -void __stdcall _Lazy_glCopyConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyConvolutionFilter2DEXT(target, internalformat, x, y, width, height);} -void __stdcall _Lazy_glGetConvolutionFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid * image) {if (GLeeInit()) glGetConvolutionFilterEXT(target, format, type, image);} -void __stdcall _Lazy_glGetConvolutionParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetConvolutionParameterfvEXT(target, pname, params);} -void __stdcall _Lazy_glGetConvolutionParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetConvolutionParameterivEXT(target, pname, params);} -void __stdcall _Lazy_glGetSeparableFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) {if (GLeeInit()) glGetSeparableFilterEXT(target, format, type, row, column, span);} -void __stdcall _Lazy_glSeparableFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) {if (GLeeInit()) glSeparableFilter2DEXT(target, internalformat, width, height, format, type, row, column);} -PFNGLCONVOLUTIONFILTER1DEXTPROC pglConvolutionFilter1DEXT=_Lazy_glConvolutionFilter1DEXT; -PFNGLCONVOLUTIONFILTER2DEXTPROC pglConvolutionFilter2DEXT=_Lazy_glConvolutionFilter2DEXT; -PFNGLCONVOLUTIONPARAMETERFEXTPROC pglConvolutionParameterfEXT=_Lazy_glConvolutionParameterfEXT; -PFNGLCONVOLUTIONPARAMETERFVEXTPROC pglConvolutionParameterfvEXT=_Lazy_glConvolutionParameterfvEXT; -PFNGLCONVOLUTIONPARAMETERIEXTPROC pglConvolutionParameteriEXT=_Lazy_glConvolutionParameteriEXT; -PFNGLCONVOLUTIONPARAMETERIVEXTPROC pglConvolutionParameterivEXT=_Lazy_glConvolutionParameterivEXT; -PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC pglCopyConvolutionFilter1DEXT=_Lazy_glCopyConvolutionFilter1DEXT; -PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC pglCopyConvolutionFilter2DEXT=_Lazy_glCopyConvolutionFilter2DEXT; -PFNGLGETCONVOLUTIONFILTEREXTPROC pglGetConvolutionFilterEXT=_Lazy_glGetConvolutionFilterEXT; -PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC pglGetConvolutionParameterfvEXT=_Lazy_glGetConvolutionParameterfvEXT; -PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC pglGetConvolutionParameterivEXT=_Lazy_glGetConvolutionParameterivEXT; -PFNGLGETSEPARABLEFILTEREXTPROC pglGetSeparableFilterEXT=_Lazy_glGetSeparableFilterEXT; -PFNGLSEPARABLEFILTER2DEXTPROC pglSeparableFilter2DEXT=_Lazy_glSeparableFilter2DEXT; -#endif - -/* GL_SGI_color_matrix */ - -#ifdef __GLEE_GL_SGI_color_matrix -#endif - -/* GL_SGI_color_table */ - -#ifdef __GLEE_GL_SGI_color_table -void __stdcall _Lazy_glColorTableSGI(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) {if (GLeeInit()) glColorTableSGI(target, internalformat, width, format, type, table);} -void __stdcall _Lazy_glColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glColorTableParameterfvSGI(target, pname, params);} -void __stdcall _Lazy_glColorTableParameterivSGI(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glColorTableParameterivSGI(target, pname, params);} -void __stdcall _Lazy_glCopyColorTableSGI(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyColorTableSGI(target, internalformat, x, y, width);} -void __stdcall _Lazy_glGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid * table) {if (GLeeInit()) glGetColorTableSGI(target, format, type, table);} -void __stdcall _Lazy_glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetColorTableParameterfvSGI(target, pname, params);} -void __stdcall _Lazy_glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetColorTableParameterivSGI(target, pname, params);} -PFNGLCOLORTABLESGIPROC pglColorTableSGI=_Lazy_glColorTableSGI; -PFNGLCOLORTABLEPARAMETERFVSGIPROC pglColorTableParameterfvSGI=_Lazy_glColorTableParameterfvSGI; -PFNGLCOLORTABLEPARAMETERIVSGIPROC pglColorTableParameterivSGI=_Lazy_glColorTableParameterivSGI; -PFNGLCOPYCOLORTABLESGIPROC pglCopyColorTableSGI=_Lazy_glCopyColorTableSGI; -PFNGLGETCOLORTABLESGIPROC pglGetColorTableSGI=_Lazy_glGetColorTableSGI; -PFNGLGETCOLORTABLEPARAMETERFVSGIPROC pglGetColorTableParameterfvSGI=_Lazy_glGetColorTableParameterfvSGI; -PFNGLGETCOLORTABLEPARAMETERIVSGIPROC pglGetColorTableParameterivSGI=_Lazy_glGetColorTableParameterivSGI; -#endif - -/* GL_SGIS_pixel_texture */ - -#ifdef __GLEE_GL_SGIS_pixel_texture -void __stdcall _Lazy_glPixelTexGenParameteriSGIS(GLenum pname, GLint param) {if (GLeeInit()) glPixelTexGenParameteriSGIS(pname, param);} -void __stdcall _Lazy_glPixelTexGenParameterivSGIS(GLenum pname, const GLint * params) {if (GLeeInit()) glPixelTexGenParameterivSGIS(pname, params);} -void __stdcall _Lazy_glPixelTexGenParameterfSGIS(GLenum pname, GLfloat param) {if (GLeeInit()) glPixelTexGenParameterfSGIS(pname, param);} -void __stdcall _Lazy_glPixelTexGenParameterfvSGIS(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPixelTexGenParameterfvSGIS(pname, params);} -void __stdcall _Lazy_glGetPixelTexGenParameterivSGIS(GLenum pname, GLint * params) {if (GLeeInit()) glGetPixelTexGenParameterivSGIS(pname, params);} -void __stdcall _Lazy_glGetPixelTexGenParameterfvSGIS(GLenum pname, GLfloat * params) {if (GLeeInit()) glGetPixelTexGenParameterfvSGIS(pname, params);} -PFNGLPIXELTEXGENPARAMETERISGISPROC pglPixelTexGenParameteriSGIS=_Lazy_glPixelTexGenParameteriSGIS; -PFNGLPIXELTEXGENPARAMETERIVSGISPROC pglPixelTexGenParameterivSGIS=_Lazy_glPixelTexGenParameterivSGIS; -PFNGLPIXELTEXGENPARAMETERFSGISPROC pglPixelTexGenParameterfSGIS=_Lazy_glPixelTexGenParameterfSGIS; -PFNGLPIXELTEXGENPARAMETERFVSGISPROC pglPixelTexGenParameterfvSGIS=_Lazy_glPixelTexGenParameterfvSGIS; -PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC pglGetPixelTexGenParameterivSGIS=_Lazy_glGetPixelTexGenParameterivSGIS; -PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC pglGetPixelTexGenParameterfvSGIS=_Lazy_glGetPixelTexGenParameterfvSGIS; -#endif - -/* GL_SGIX_pixel_texture */ - -#ifdef __GLEE_GL_SGIX_pixel_texture -void __stdcall _Lazy_glPixelTexGenSGIX(GLenum mode) {if (GLeeInit()) glPixelTexGenSGIX(mode);} -PFNGLPIXELTEXGENSGIXPROC pglPixelTexGenSGIX=_Lazy_glPixelTexGenSGIX; -#endif - -/* GL_SGIS_texture4D */ - -#ifdef __GLEE_GL_SGIS_texture4D -void __stdcall _Lazy_glTexImage4DSGIS(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexImage4DSGIS(target, level, internalformat, width, height, depth, size4d, border, format, type, pixels);} -void __stdcall _Lazy_glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage4DSGIS(target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, size4d, format, type, pixels);} -PFNGLTEXIMAGE4DSGISPROC pglTexImage4DSGIS=_Lazy_glTexImage4DSGIS; -PFNGLTEXSUBIMAGE4DSGISPROC pglTexSubImage4DSGIS=_Lazy_glTexSubImage4DSGIS; -#endif - -/* GL_SGI_texture_color_table */ - -#ifdef __GLEE_GL_SGI_texture_color_table -#endif - -/* GL_EXT_cmyka */ - -#ifdef __GLEE_GL_EXT_cmyka -#endif - -/* GL_EXT_texture_object */ - -#ifdef __GLEE_GL_EXT_texture_object -GLboolean __stdcall _Lazy_glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences) {if (GLeeInit()) return glAreTexturesResidentEXT(n, textures, residences); return (GLboolean)0;} -void __stdcall _Lazy_glBindTextureEXT(GLenum target, GLuint texture) {if (GLeeInit()) glBindTextureEXT(target, texture);} -void __stdcall _Lazy_glDeleteTexturesEXT(GLsizei n, const GLuint * textures) {if (GLeeInit()) glDeleteTexturesEXT(n, textures);} -void __stdcall _Lazy_glGenTexturesEXT(GLsizei n, GLuint * textures) {if (GLeeInit()) glGenTexturesEXT(n, textures);} -GLboolean __stdcall _Lazy_glIsTextureEXT(GLuint texture) {if (GLeeInit()) return glIsTextureEXT(texture); return (GLboolean)0;} -void __stdcall _Lazy_glPrioritizeTexturesEXT(GLsizei n, const GLuint * textures, const GLclampf * priorities) {if (GLeeInit()) glPrioritizeTexturesEXT(n, textures, priorities);} -PFNGLARETEXTURESRESIDENTEXTPROC pglAreTexturesResidentEXT=_Lazy_glAreTexturesResidentEXT; -PFNGLBINDTEXTUREEXTPROC pglBindTextureEXT=_Lazy_glBindTextureEXT; -PFNGLDELETETEXTURESEXTPROC pglDeleteTexturesEXT=_Lazy_glDeleteTexturesEXT; -PFNGLGENTEXTURESEXTPROC pglGenTexturesEXT=_Lazy_glGenTexturesEXT; -PFNGLISTEXTUREEXTPROC pglIsTextureEXT=_Lazy_glIsTextureEXT; -PFNGLPRIORITIZETEXTURESEXTPROC pglPrioritizeTexturesEXT=_Lazy_glPrioritizeTexturesEXT; -#endif - -/* GL_SGIS_detail_texture */ - -#ifdef __GLEE_GL_SGIS_detail_texture -void __stdcall _Lazy_glDetailTexFuncSGIS(GLenum target, GLsizei n, const GLfloat * points) {if (GLeeInit()) glDetailTexFuncSGIS(target, n, points);} -void __stdcall _Lazy_glGetDetailTexFuncSGIS(GLenum target, GLfloat * points) {if (GLeeInit()) glGetDetailTexFuncSGIS(target, points);} -PFNGLDETAILTEXFUNCSGISPROC pglDetailTexFuncSGIS=_Lazy_glDetailTexFuncSGIS; -PFNGLGETDETAILTEXFUNCSGISPROC pglGetDetailTexFuncSGIS=_Lazy_glGetDetailTexFuncSGIS; -#endif - -/* GL_SGIS_sharpen_texture */ - -#ifdef __GLEE_GL_SGIS_sharpen_texture -void __stdcall _Lazy_glSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat * points) {if (GLeeInit()) glSharpenTexFuncSGIS(target, n, points);} -void __stdcall _Lazy_glGetSharpenTexFuncSGIS(GLenum target, GLfloat * points) {if (GLeeInit()) glGetSharpenTexFuncSGIS(target, points);} -PFNGLSHARPENTEXFUNCSGISPROC pglSharpenTexFuncSGIS=_Lazy_glSharpenTexFuncSGIS; -PFNGLGETSHARPENTEXFUNCSGISPROC pglGetSharpenTexFuncSGIS=_Lazy_glGetSharpenTexFuncSGIS; -#endif - -/* GL_EXT_packed_pixels */ - -#ifdef __GLEE_GL_EXT_packed_pixels -#endif - -/* GL_SGIS_texture_lod */ - -#ifdef __GLEE_GL_SGIS_texture_lod -#endif - -/* GL_SGIS_multisample */ - -#ifdef __GLEE_GL_SGIS_multisample -void __stdcall _Lazy_glSampleMaskSGIS(GLclampf value, GLboolean invert) {if (GLeeInit()) glSampleMaskSGIS(value, invert);} -void __stdcall _Lazy_glSamplePatternSGIS(GLenum pattern) {if (GLeeInit()) glSamplePatternSGIS(pattern);} -PFNGLSAMPLEMASKSGISPROC pglSampleMaskSGIS=_Lazy_glSampleMaskSGIS; -PFNGLSAMPLEPATTERNSGISPROC pglSamplePatternSGIS=_Lazy_glSamplePatternSGIS; -#endif - -/* GL_EXT_rescale_normal */ - -#ifdef __GLEE_GL_EXT_rescale_normal -#endif - -/* GL_EXT_vertex_array */ - -#ifdef __GLEE_GL_EXT_vertex_array -void __stdcall _Lazy_glArrayElementEXT(GLint i) {if (GLeeInit()) glArrayElementEXT(i);} -void __stdcall _Lazy_glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glColorPointerEXT(size, type, stride, count, pointer);} -void __stdcall _Lazy_glDrawArraysEXT(GLenum mode, GLint first, GLsizei count) {if (GLeeInit()) glDrawArraysEXT(mode, first, count);} -void __stdcall _Lazy_glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean * pointer) {if (GLeeInit()) glEdgeFlagPointerEXT(stride, count, pointer);} -void __stdcall _Lazy_glGetPointervEXT(GLenum pname, GLvoid* * params) {if (GLeeInit()) glGetPointervEXT(pname, params);} -void __stdcall _Lazy_glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glIndexPointerEXT(type, stride, count, pointer);} -void __stdcall _Lazy_glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glNormalPointerEXT(type, stride, count, pointer);} -void __stdcall _Lazy_glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glTexCoordPointerEXT(size, type, stride, count, pointer);} -void __stdcall _Lazy_glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glVertexPointerEXT(size, type, stride, count, pointer);} -PFNGLARRAYELEMENTEXTPROC pglArrayElementEXT=_Lazy_glArrayElementEXT; -PFNGLCOLORPOINTEREXTPROC pglColorPointerEXT=_Lazy_glColorPointerEXT; -PFNGLDRAWARRAYSEXTPROC pglDrawArraysEXT=_Lazy_glDrawArraysEXT; -PFNGLEDGEFLAGPOINTEREXTPROC pglEdgeFlagPointerEXT=_Lazy_glEdgeFlagPointerEXT; -PFNGLGETPOINTERVEXTPROC pglGetPointervEXT=_Lazy_glGetPointervEXT; -PFNGLINDEXPOINTEREXTPROC pglIndexPointerEXT=_Lazy_glIndexPointerEXT; -PFNGLNORMALPOINTEREXTPROC pglNormalPointerEXT=_Lazy_glNormalPointerEXT; -PFNGLTEXCOORDPOINTEREXTPROC pglTexCoordPointerEXT=_Lazy_glTexCoordPointerEXT; -PFNGLVERTEXPOINTEREXTPROC pglVertexPointerEXT=_Lazy_glVertexPointerEXT; -#endif - -/* GL_EXT_misc_attribute */ - -#ifdef __GLEE_GL_EXT_misc_attribute -#endif - -/* GL_SGIS_generate_mipmap */ - -#ifdef __GLEE_GL_SGIS_generate_mipmap -#endif - -/* GL_SGIX_clipmap */ - -#ifdef __GLEE_GL_SGIX_clipmap -#endif - -/* GL_SGIX_shadow */ - -#ifdef __GLEE_GL_SGIX_shadow -#endif - -/* GL_SGIS_texture_edge_clamp */ - -#ifdef __GLEE_GL_SGIS_texture_edge_clamp -#endif - -/* GL_SGIS_texture_border_clamp */ - -#ifdef __GLEE_GL_SGIS_texture_border_clamp -#endif - -/* GL_EXT_blend_minmax */ - -#ifdef __GLEE_GL_EXT_blend_minmax -void __stdcall _Lazy_glBlendEquationEXT(GLenum mode) {if (GLeeInit()) glBlendEquationEXT(mode);} -PFNGLBLENDEQUATIONEXTPROC pglBlendEquationEXT=_Lazy_glBlendEquationEXT; -#endif - -/* GL_EXT_blend_subtract */ - -#ifdef __GLEE_GL_EXT_blend_subtract -#endif - -/* GL_EXT_blend_logic_op */ - -#ifdef __GLEE_GL_EXT_blend_logic_op -#endif - -/* GL_SGIX_interlace */ - -#ifdef __GLEE_GL_SGIX_interlace -#endif - -/* GL_SGIX_pixel_tiles */ - -#ifdef __GLEE_GL_SGIX_pixel_tiles -#endif - -/* GL_SGIS_texture_select */ - -#ifdef __GLEE_GL_SGIS_texture_select -#endif - -/* GL_SGIX_sprite */ - -#ifdef __GLEE_GL_SGIX_sprite -void __stdcall _Lazy_glSpriteParameterfSGIX(GLenum pname, GLfloat param) {if (GLeeInit()) glSpriteParameterfSGIX(pname, param);} -void __stdcall _Lazy_glSpriteParameterfvSGIX(GLenum pname, const GLfloat * params) {if (GLeeInit()) glSpriteParameterfvSGIX(pname, params);} -void __stdcall _Lazy_glSpriteParameteriSGIX(GLenum pname, GLint param) {if (GLeeInit()) glSpriteParameteriSGIX(pname, param);} -void __stdcall _Lazy_glSpriteParameterivSGIX(GLenum pname, const GLint * params) {if (GLeeInit()) glSpriteParameterivSGIX(pname, params);} -PFNGLSPRITEPARAMETERFSGIXPROC pglSpriteParameterfSGIX=_Lazy_glSpriteParameterfSGIX; -PFNGLSPRITEPARAMETERFVSGIXPROC pglSpriteParameterfvSGIX=_Lazy_glSpriteParameterfvSGIX; -PFNGLSPRITEPARAMETERISGIXPROC pglSpriteParameteriSGIX=_Lazy_glSpriteParameteriSGIX; -PFNGLSPRITEPARAMETERIVSGIXPROC pglSpriteParameterivSGIX=_Lazy_glSpriteParameterivSGIX; -#endif - -/* GL_SGIX_texture_multi_buffer */ - -#ifdef __GLEE_GL_SGIX_texture_multi_buffer -#endif - -/* GL_EXT_point_parameters */ - -#ifdef __GLEE_GL_EXT_point_parameters -void __stdcall _Lazy_glPointParameterfEXT(GLenum pname, GLfloat param) {if (GLeeInit()) glPointParameterfEXT(pname, param);} -void __stdcall _Lazy_glPointParameterfvEXT(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPointParameterfvEXT(pname, params);} -PFNGLPOINTPARAMETERFEXTPROC pglPointParameterfEXT=_Lazy_glPointParameterfEXT; -PFNGLPOINTPARAMETERFVEXTPROC pglPointParameterfvEXT=_Lazy_glPointParameterfvEXT; -#endif - -/* GL_SGIS_point_parameters */ - -#ifdef __GLEE_GL_SGIS_point_parameters -void __stdcall _Lazy_glPointParameterfSGIS(GLenum pname, GLfloat param) {if (GLeeInit()) glPointParameterfSGIS(pname, param);} -void __stdcall _Lazy_glPointParameterfvSGIS(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPointParameterfvSGIS(pname, params);} -PFNGLPOINTPARAMETERFSGISPROC pglPointParameterfSGIS=_Lazy_glPointParameterfSGIS; -PFNGLPOINTPARAMETERFVSGISPROC pglPointParameterfvSGIS=_Lazy_glPointParameterfvSGIS; -#endif - -/* GL_SGIX_instruments */ - -#ifdef __GLEE_GL_SGIX_instruments -GLint __stdcall _Lazy_glGetInstrumentsSGIX(void) {if (GLeeInit()) return glGetInstrumentsSGIX(); return (GLint)0;} -void __stdcall _Lazy_glInstrumentsBufferSGIX(GLsizei size, GLint * buffer) {if (GLeeInit()) glInstrumentsBufferSGIX(size, buffer);} -GLint __stdcall _Lazy_glPollInstrumentsSGIX(GLint * marker_p) {if (GLeeInit()) return glPollInstrumentsSGIX(marker_p); return (GLint)0;} -void __stdcall _Lazy_glReadInstrumentsSGIX(GLint marker) {if (GLeeInit()) glReadInstrumentsSGIX(marker);} -void __stdcall _Lazy_glStartInstrumentsSGIX(void) {if (GLeeInit()) glStartInstrumentsSGIX();} -void __stdcall _Lazy_glStopInstrumentsSGIX(GLint marker) {if (GLeeInit()) glStopInstrumentsSGIX(marker);} -PFNGLGETINSTRUMENTSSGIXPROC pglGetInstrumentsSGIX=_Lazy_glGetInstrumentsSGIX; -PFNGLINSTRUMENTSBUFFERSGIXPROC pglInstrumentsBufferSGIX=_Lazy_glInstrumentsBufferSGIX; -PFNGLPOLLINSTRUMENTSSGIXPROC pglPollInstrumentsSGIX=_Lazy_glPollInstrumentsSGIX; -PFNGLREADINSTRUMENTSSGIXPROC pglReadInstrumentsSGIX=_Lazy_glReadInstrumentsSGIX; -PFNGLSTARTINSTRUMENTSSGIXPROC pglStartInstrumentsSGIX=_Lazy_glStartInstrumentsSGIX; -PFNGLSTOPINSTRUMENTSSGIXPROC pglStopInstrumentsSGIX=_Lazy_glStopInstrumentsSGIX; -#endif - -/* GL_SGIX_texture_scale_bias */ - -#ifdef __GLEE_GL_SGIX_texture_scale_bias -#endif - -/* GL_SGIX_framezoom */ - -#ifdef __GLEE_GL_SGIX_framezoom -void __stdcall _Lazy_glFrameZoomSGIX(GLint factor) {if (GLeeInit()) glFrameZoomSGIX(factor);} -PFNGLFRAMEZOOMSGIXPROC pglFrameZoomSGIX=_Lazy_glFrameZoomSGIX; -#endif - -/* GL_SGIX_tag_sample_buffer */ - -#ifdef __GLEE_GL_SGIX_tag_sample_buffer -void __stdcall _Lazy_glTagSampleBufferSGIX(void) {if (GLeeInit()) glTagSampleBufferSGIX();} -PFNGLTAGSAMPLEBUFFERSGIXPROC pglTagSampleBufferSGIX=_Lazy_glTagSampleBufferSGIX; -#endif - -/* GL_FfdMaskSGIX */ - -#ifdef __GLEE_GL_FfdMaskSGIX -#endif - -/* GL_SGIX_polynomial_ffd */ - -#ifdef __GLEE_GL_SGIX_polynomial_ffd -void __stdcall _Lazy_glDeformationMap3dSGIX(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble * points) {if (GLeeInit()) glDeformationMap3dSGIX(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points);} -void __stdcall _Lazy_glDeformationMap3fSGIX(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat * points) {if (GLeeInit()) glDeformationMap3fSGIX(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points);} -void __stdcall _Lazy_glDeformSGIX(GLbitfield mask) {if (GLeeInit()) glDeformSGIX(mask);} -void __stdcall _Lazy_glLoadIdentityDeformationMapSGIX(GLbitfield mask) {if (GLeeInit()) glLoadIdentityDeformationMapSGIX(mask);} -PFNGLDEFORMATIONMAP3DSGIXPROC pglDeformationMap3dSGIX=_Lazy_glDeformationMap3dSGIX; -PFNGLDEFORMATIONMAP3FSGIXPROC pglDeformationMap3fSGIX=_Lazy_glDeformationMap3fSGIX; -PFNGLDEFORMSGIXPROC pglDeformSGIX=_Lazy_glDeformSGIX; -PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC pglLoadIdentityDeformationMapSGIX=_Lazy_glLoadIdentityDeformationMapSGIX; -#endif - -/* GL_SGIX_reference_plane */ - -#ifdef __GLEE_GL_SGIX_reference_plane -void __stdcall _Lazy_glReferencePlaneSGIX(const GLdouble * equation) {if (GLeeInit()) glReferencePlaneSGIX(equation);} -PFNGLREFERENCEPLANESGIXPROC pglReferencePlaneSGIX=_Lazy_glReferencePlaneSGIX; -#endif - -/* GL_SGIX_flush_raster */ - -#ifdef __GLEE_GL_SGIX_flush_raster -void __stdcall _Lazy_glFlushRasterSGIX(void) {if (GLeeInit()) glFlushRasterSGIX();} -PFNGLFLUSHRASTERSGIXPROC pglFlushRasterSGIX=_Lazy_glFlushRasterSGIX; -#endif - -/* GL_SGIX_depth_texture */ - -#ifdef __GLEE_GL_SGIX_depth_texture -#endif - -/* GL_SGIS_fog_function */ - -#ifdef __GLEE_GL_SGIS_fog_function -void __stdcall _Lazy_glFogFuncSGIS(GLsizei n, const GLfloat * points) {if (GLeeInit()) glFogFuncSGIS(n, points);} -void __stdcall _Lazy_glGetFogFuncSGIS(GLfloat * points) {if (GLeeInit()) glGetFogFuncSGIS(points);} -PFNGLFOGFUNCSGISPROC pglFogFuncSGIS=_Lazy_glFogFuncSGIS; -PFNGLGETFOGFUNCSGISPROC pglGetFogFuncSGIS=_Lazy_glGetFogFuncSGIS; -#endif - -/* GL_SGIX_fog_offset */ - -#ifdef __GLEE_GL_SGIX_fog_offset -#endif - -/* GL_HP_image_transform */ - -#ifdef __GLEE_GL_HP_image_transform -void __stdcall _Lazy_glImageTransformParameteriHP(GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glImageTransformParameteriHP(target, pname, param);} -void __stdcall _Lazy_glImageTransformParameterfHP(GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glImageTransformParameterfHP(target, pname, param);} -void __stdcall _Lazy_glImageTransformParameterivHP(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glImageTransformParameterivHP(target, pname, params);} -void __stdcall _Lazy_glImageTransformParameterfvHP(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glImageTransformParameterfvHP(target, pname, params);} -void __stdcall _Lazy_glGetImageTransformParameterivHP(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetImageTransformParameterivHP(target, pname, params);} -void __stdcall _Lazy_glGetImageTransformParameterfvHP(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetImageTransformParameterfvHP(target, pname, params);} -PFNGLIMAGETRANSFORMPARAMETERIHPPROC pglImageTransformParameteriHP=_Lazy_glImageTransformParameteriHP; -PFNGLIMAGETRANSFORMPARAMETERFHPPROC pglImageTransformParameterfHP=_Lazy_glImageTransformParameterfHP; -PFNGLIMAGETRANSFORMPARAMETERIVHPPROC pglImageTransformParameterivHP=_Lazy_glImageTransformParameterivHP; -PFNGLIMAGETRANSFORMPARAMETERFVHPPROC pglImageTransformParameterfvHP=_Lazy_glImageTransformParameterfvHP; -PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC pglGetImageTransformParameterivHP=_Lazy_glGetImageTransformParameterivHP; -PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC pglGetImageTransformParameterfvHP=_Lazy_glGetImageTransformParameterfvHP; -#endif - -/* GL_HP_convolution_border_modes */ - -#ifdef __GLEE_GL_HP_convolution_border_modes -#endif - -/* GL_INGR_palette_buffer */ - -#ifdef __GLEE_GL_INGR_palette_buffer -#endif - -/* GL_SGIX_texture_add_env */ - -#ifdef __GLEE_GL_SGIX_texture_add_env -#endif - -/* GL_EXT_color_subtable */ - -#ifdef __GLEE_GL_EXT_color_subtable -void __stdcall _Lazy_glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) {if (GLeeInit()) glColorSubTableEXT(target, start, count, format, type, data);} -void __stdcall _Lazy_glCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyColorSubTableEXT(target, start, x, y, width);} -PFNGLCOLORSUBTABLEEXTPROC pglColorSubTableEXT=_Lazy_glColorSubTableEXT; -PFNGLCOPYCOLORSUBTABLEEXTPROC pglCopyColorSubTableEXT=_Lazy_glCopyColorSubTableEXT; -#endif - -/* GL_PGI_vertex_hints */ - -#ifdef __GLEE_GL_PGI_vertex_hints -#endif - -/* GL_PGI_misc_hints */ - -#ifdef __GLEE_GL_PGI_misc_hints -void __stdcall _Lazy_glHintPGI(GLenum target, GLint mode) {if (GLeeInit()) glHintPGI(target, mode);} -PFNGLHINTPGIPROC pglHintPGI=_Lazy_glHintPGI; -#endif - -/* GL_EXT_paletted_texture */ - -#ifdef __GLEE_GL_EXT_paletted_texture -void __stdcall _Lazy_glColorTableEXT(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) {if (GLeeInit()) glColorTableEXT(target, internalFormat, width, format, type, table);} -void __stdcall _Lazy_glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * data) {if (GLeeInit()) glGetColorTableEXT(target, format, type, data);} -void __stdcall _Lazy_glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetColorTableParameterivEXT(target, pname, params);} -void __stdcall _Lazy_glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetColorTableParameterfvEXT(target, pname, params);} -PFNGLCOLORTABLEEXTPROC pglColorTableEXT=_Lazy_glColorTableEXT; -PFNGLGETCOLORTABLEEXTPROC pglGetColorTableEXT=_Lazy_glGetColorTableEXT; -PFNGLGETCOLORTABLEPARAMETERIVEXTPROC pglGetColorTableParameterivEXT=_Lazy_glGetColorTableParameterivEXT; -PFNGLGETCOLORTABLEPARAMETERFVEXTPROC pglGetColorTableParameterfvEXT=_Lazy_glGetColorTableParameterfvEXT; -#endif - -/* GL_EXT_clip_volume_hint */ - -#ifdef __GLEE_GL_EXT_clip_volume_hint -#endif - -/* GL_SGIX_list_priority */ - -#ifdef __GLEE_GL_SGIX_list_priority -void __stdcall _Lazy_glGetListParameterfvSGIX(GLuint list, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetListParameterfvSGIX(list, pname, params);} -void __stdcall _Lazy_glGetListParameterivSGIX(GLuint list, GLenum pname, GLint * params) {if (GLeeInit()) glGetListParameterivSGIX(list, pname, params);} -void __stdcall _Lazy_glListParameterfSGIX(GLuint list, GLenum pname, GLfloat param) {if (GLeeInit()) glListParameterfSGIX(list, pname, param);} -void __stdcall _Lazy_glListParameterfvSGIX(GLuint list, GLenum pname, const GLfloat * params) {if (GLeeInit()) glListParameterfvSGIX(list, pname, params);} -void __stdcall _Lazy_glListParameteriSGIX(GLuint list, GLenum pname, GLint param) {if (GLeeInit()) glListParameteriSGIX(list, pname, param);} -void __stdcall _Lazy_glListParameterivSGIX(GLuint list, GLenum pname, const GLint * params) {if (GLeeInit()) glListParameterivSGIX(list, pname, params);} -PFNGLGETLISTPARAMETERFVSGIXPROC pglGetListParameterfvSGIX=_Lazy_glGetListParameterfvSGIX; -PFNGLGETLISTPARAMETERIVSGIXPROC pglGetListParameterivSGIX=_Lazy_glGetListParameterivSGIX; -PFNGLLISTPARAMETERFSGIXPROC pglListParameterfSGIX=_Lazy_glListParameterfSGIX; -PFNGLLISTPARAMETERFVSGIXPROC pglListParameterfvSGIX=_Lazy_glListParameterfvSGIX; -PFNGLLISTPARAMETERISGIXPROC pglListParameteriSGIX=_Lazy_glListParameteriSGIX; -PFNGLLISTPARAMETERIVSGIXPROC pglListParameterivSGIX=_Lazy_glListParameterivSGIX; -#endif - -/* GL_SGIX_ir_instrument1 */ - -#ifdef __GLEE_GL_SGIX_ir_instrument1 -#endif - -/* GL_SGIX_calligraphic_fragment */ - -#ifdef __GLEE_GL_SGIX_calligraphic_fragment -#endif - -/* GL_SGIX_texture_lod_bias */ - -#ifdef __GLEE_GL_SGIX_texture_lod_bias -#endif - -/* GL_SGIX_shadow_ambient */ - -#ifdef __GLEE_GL_SGIX_shadow_ambient -#endif - -/* GL_EXT_index_texture */ - -#ifdef __GLEE_GL_EXT_index_texture -#endif - -/* GL_EXT_index_material */ - -#ifdef __GLEE_GL_EXT_index_material -void __stdcall _Lazy_glIndexMaterialEXT(GLenum face, GLenum mode) {if (GLeeInit()) glIndexMaterialEXT(face, mode);} -PFNGLINDEXMATERIALEXTPROC pglIndexMaterialEXT=_Lazy_glIndexMaterialEXT; -#endif - -/* GL_EXT_index_func */ - -#ifdef __GLEE_GL_EXT_index_func -void __stdcall _Lazy_glIndexFuncEXT(GLenum func, GLclampf ref) {if (GLeeInit()) glIndexFuncEXT(func, ref);} -PFNGLINDEXFUNCEXTPROC pglIndexFuncEXT=_Lazy_glIndexFuncEXT; -#endif - -/* GL_EXT_index_array_formats */ - -#ifdef __GLEE_GL_EXT_index_array_formats -#endif - -/* GL_EXT_compiled_vertex_array */ - -#ifdef __GLEE_GL_EXT_compiled_vertex_array -void __stdcall _Lazy_glLockArraysEXT(GLint first, GLsizei count) {if (GLeeInit()) glLockArraysEXT(first, count);} -void __stdcall _Lazy_glUnlockArraysEXT(void) {if (GLeeInit()) glUnlockArraysEXT();} -PFNGLLOCKARRAYSEXTPROC pglLockArraysEXT=_Lazy_glLockArraysEXT; -PFNGLUNLOCKARRAYSEXTPROC pglUnlockArraysEXT=_Lazy_glUnlockArraysEXT; -#endif - -/* GL_EXT_cull_vertex */ - -#ifdef __GLEE_GL_EXT_cull_vertex -void __stdcall _Lazy_glCullParameterdvEXT(GLenum pname, GLdouble * params) {if (GLeeInit()) glCullParameterdvEXT(pname, params);} -void __stdcall _Lazy_glCullParameterfvEXT(GLenum pname, GLfloat * params) {if (GLeeInit()) glCullParameterfvEXT(pname, params);} -PFNGLCULLPARAMETERDVEXTPROC pglCullParameterdvEXT=_Lazy_glCullParameterdvEXT; -PFNGLCULLPARAMETERFVEXTPROC pglCullParameterfvEXT=_Lazy_glCullParameterfvEXT; -#endif - -/* GL_SGIX_ycrcb */ - -#ifdef __GLEE_GL_SGIX_ycrcb -#endif - -/* GL_SGIX_fragment_lighting */ - -#ifdef __GLEE_GL_SGIX_fragment_lighting -void __stdcall _Lazy_glFragmentColorMaterialSGIX(GLenum face, GLenum mode) {if (GLeeInit()) glFragmentColorMaterialSGIX(face, mode);} -void __stdcall _Lazy_glFragmentLightfSGIX(GLenum light, GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentLightfSGIX(light, pname, param);} -void __stdcall _Lazy_glFragmentLightfvSGIX(GLenum light, GLenum pname, const GLfloat * params) {if (GLeeInit()) glFragmentLightfvSGIX(light, pname, params);} -void __stdcall _Lazy_glFragmentLightiSGIX(GLenum light, GLenum pname, GLint param) {if (GLeeInit()) glFragmentLightiSGIX(light, pname, param);} -void __stdcall _Lazy_glFragmentLightivSGIX(GLenum light, GLenum pname, const GLint * params) {if (GLeeInit()) glFragmentLightivSGIX(light, pname, params);} -void __stdcall _Lazy_glFragmentLightModelfSGIX(GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentLightModelfSGIX(pname, param);} -void __stdcall _Lazy_glFragmentLightModelfvSGIX(GLenum pname, const GLfloat * params) {if (GLeeInit()) glFragmentLightModelfvSGIX(pname, params);} -void __stdcall _Lazy_glFragmentLightModeliSGIX(GLenum pname, GLint param) {if (GLeeInit()) glFragmentLightModeliSGIX(pname, param);} -void __stdcall _Lazy_glFragmentLightModelivSGIX(GLenum pname, const GLint * params) {if (GLeeInit()) glFragmentLightModelivSGIX(pname, params);} -void __stdcall _Lazy_glFragmentMaterialfSGIX(GLenum face, GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentMaterialfSGIX(face, pname, param);} -void __stdcall _Lazy_glFragmentMaterialfvSGIX(GLenum face, GLenum pname, const GLfloat * params) {if (GLeeInit()) glFragmentMaterialfvSGIX(face, pname, params);} -void __stdcall _Lazy_glFragmentMaterialiSGIX(GLenum face, GLenum pname, GLint param) {if (GLeeInit()) glFragmentMaterialiSGIX(face, pname, param);} -void __stdcall _Lazy_glFragmentMaterialivSGIX(GLenum face, GLenum pname, const GLint * params) {if (GLeeInit()) glFragmentMaterialivSGIX(face, pname, params);} -void __stdcall _Lazy_glGetFragmentLightfvSGIX(GLenum light, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetFragmentLightfvSGIX(light, pname, params);} -void __stdcall _Lazy_glGetFragmentLightivSGIX(GLenum light, GLenum pname, GLint * params) {if (GLeeInit()) glGetFragmentLightivSGIX(light, pname, params);} -void __stdcall _Lazy_glGetFragmentMaterialfvSGIX(GLenum face, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetFragmentMaterialfvSGIX(face, pname, params);} -void __stdcall _Lazy_glGetFragmentMaterialivSGIX(GLenum face, GLenum pname, GLint * params) {if (GLeeInit()) glGetFragmentMaterialivSGIX(face, pname, params);} -void __stdcall _Lazy_glLightEnviSGIX(GLenum pname, GLint param) {if (GLeeInit()) glLightEnviSGIX(pname, param);} -PFNGLFRAGMENTCOLORMATERIALSGIXPROC pglFragmentColorMaterialSGIX=_Lazy_glFragmentColorMaterialSGIX; -PFNGLFRAGMENTLIGHTFSGIXPROC pglFragmentLightfSGIX=_Lazy_glFragmentLightfSGIX; -PFNGLFRAGMENTLIGHTFVSGIXPROC pglFragmentLightfvSGIX=_Lazy_glFragmentLightfvSGIX; -PFNGLFRAGMENTLIGHTISGIXPROC pglFragmentLightiSGIX=_Lazy_glFragmentLightiSGIX; -PFNGLFRAGMENTLIGHTIVSGIXPROC pglFragmentLightivSGIX=_Lazy_glFragmentLightivSGIX; -PFNGLFRAGMENTLIGHTMODELFSGIXPROC pglFragmentLightModelfSGIX=_Lazy_glFragmentLightModelfSGIX; -PFNGLFRAGMENTLIGHTMODELFVSGIXPROC pglFragmentLightModelfvSGIX=_Lazy_glFragmentLightModelfvSGIX; -PFNGLFRAGMENTLIGHTMODELISGIXPROC pglFragmentLightModeliSGIX=_Lazy_glFragmentLightModeliSGIX; -PFNGLFRAGMENTLIGHTMODELIVSGIXPROC pglFragmentLightModelivSGIX=_Lazy_glFragmentLightModelivSGIX; -PFNGLFRAGMENTMATERIALFSGIXPROC pglFragmentMaterialfSGIX=_Lazy_glFragmentMaterialfSGIX; -PFNGLFRAGMENTMATERIALFVSGIXPROC pglFragmentMaterialfvSGIX=_Lazy_glFragmentMaterialfvSGIX; -PFNGLFRAGMENTMATERIALISGIXPROC pglFragmentMaterialiSGIX=_Lazy_glFragmentMaterialiSGIX; -PFNGLFRAGMENTMATERIALIVSGIXPROC pglFragmentMaterialivSGIX=_Lazy_glFragmentMaterialivSGIX; -PFNGLGETFRAGMENTLIGHTFVSGIXPROC pglGetFragmentLightfvSGIX=_Lazy_glGetFragmentLightfvSGIX; -PFNGLGETFRAGMENTLIGHTIVSGIXPROC pglGetFragmentLightivSGIX=_Lazy_glGetFragmentLightivSGIX; -PFNGLGETFRAGMENTMATERIALFVSGIXPROC pglGetFragmentMaterialfvSGIX=_Lazy_glGetFragmentMaterialfvSGIX; -PFNGLGETFRAGMENTMATERIALIVSGIXPROC pglGetFragmentMaterialivSGIX=_Lazy_glGetFragmentMaterialivSGIX; -PFNGLLIGHTENVISGIXPROC pglLightEnviSGIX=_Lazy_glLightEnviSGIX; -#endif - -/* GL_IBM_rasterpos_clip */ - -#ifdef __GLEE_GL_IBM_rasterpos_clip -#endif - -/* GL_HP_texture_lighting */ - -#ifdef __GLEE_GL_HP_texture_lighting -#endif - -/* GL_EXT_draw_range_elements */ - -#ifdef __GLEE_GL_EXT_draw_range_elements -void __stdcall _Lazy_glDrawRangeElementsEXT(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) {if (GLeeInit()) glDrawRangeElementsEXT(mode, start, end, count, type, indices);} -PFNGLDRAWRANGEELEMENTSEXTPROC pglDrawRangeElementsEXT=_Lazy_glDrawRangeElementsEXT; -#endif - -/* GL_WIN_phong_shading */ - -#ifdef __GLEE_GL_WIN_phong_shading -#endif - -/* GL_WIN_specular_fog */ - -#ifdef __GLEE_GL_WIN_specular_fog -#endif - -/* GL_EXT_light_texture */ - -#ifdef __GLEE_GL_EXT_light_texture -void __stdcall _Lazy_glApplyTextureEXT(GLenum mode) {if (GLeeInit()) glApplyTextureEXT(mode);} -void __stdcall _Lazy_glTextureLightEXT(GLenum pname) {if (GLeeInit()) glTextureLightEXT(pname);} -void __stdcall _Lazy_glTextureMaterialEXT(GLenum face, GLenum mode) {if (GLeeInit()) glTextureMaterialEXT(face, mode);} -PFNGLAPPLYTEXTUREEXTPROC pglApplyTextureEXT=_Lazy_glApplyTextureEXT; -PFNGLTEXTURELIGHTEXTPROC pglTextureLightEXT=_Lazy_glTextureLightEXT; -PFNGLTEXTUREMATERIALEXTPROC pglTextureMaterialEXT=_Lazy_glTextureMaterialEXT; -#endif - -/* GL_SGIX_blend_alpha_minmax */ - -#ifdef __GLEE_GL_SGIX_blend_alpha_minmax -#endif - -/* GL_SGIX_impact_pixel_texture */ - -#ifdef __GLEE_GL_SGIX_impact_pixel_texture -#endif - -/* GL_EXT_bgra */ - -#ifdef __GLEE_GL_EXT_bgra -#endif - -/* GL_SGIX_async */ - -#ifdef __GLEE_GL_SGIX_async -void __stdcall _Lazy_glAsyncMarkerSGIX(GLuint marker) {if (GLeeInit()) glAsyncMarkerSGIX(marker);} -GLint __stdcall _Lazy_glFinishAsyncSGIX(GLuint * markerp) {if (GLeeInit()) return glFinishAsyncSGIX(markerp); return (GLint)0;} -GLint __stdcall _Lazy_glPollAsyncSGIX(GLuint * markerp) {if (GLeeInit()) return glPollAsyncSGIX(markerp); return (GLint)0;} -GLuint __stdcall _Lazy_glGenAsyncMarkersSGIX(GLsizei range) {if (GLeeInit()) return glGenAsyncMarkersSGIX(range); return (GLuint)0;} -void __stdcall _Lazy_glDeleteAsyncMarkersSGIX(GLuint marker, GLsizei range) {if (GLeeInit()) glDeleteAsyncMarkersSGIX(marker, range);} -GLboolean __stdcall _Lazy_glIsAsyncMarkerSGIX(GLuint marker) {if (GLeeInit()) return glIsAsyncMarkerSGIX(marker); return (GLboolean)0;} -PFNGLASYNCMARKERSGIXPROC pglAsyncMarkerSGIX=_Lazy_glAsyncMarkerSGIX; -PFNGLFINISHASYNCSGIXPROC pglFinishAsyncSGIX=_Lazy_glFinishAsyncSGIX; -PFNGLPOLLASYNCSGIXPROC pglPollAsyncSGIX=_Lazy_glPollAsyncSGIX; -PFNGLGENASYNCMARKERSSGIXPROC pglGenAsyncMarkersSGIX=_Lazy_glGenAsyncMarkersSGIX; -PFNGLDELETEASYNCMARKERSSGIXPROC pglDeleteAsyncMarkersSGIX=_Lazy_glDeleteAsyncMarkersSGIX; -PFNGLISASYNCMARKERSGIXPROC pglIsAsyncMarkerSGIX=_Lazy_glIsAsyncMarkerSGIX; -#endif - -/* GL_SGIX_async_pixel */ - -#ifdef __GLEE_GL_SGIX_async_pixel -#endif - -/* GL_SGIX_async_histogram */ - -#ifdef __GLEE_GL_SGIX_async_histogram -#endif - -/* GL_INTEL_texture_scissor */ - -#ifdef __GLEE_GL_INTEL_texture_scissor -#endif - -/* GL_INTEL_parallel_arrays */ - -#ifdef __GLEE_GL_INTEL_parallel_arrays -void __stdcall _Lazy_glVertexPointervINTEL(GLint size, GLenum type, const GLvoid* * pointer) {if (GLeeInit()) glVertexPointervINTEL(size, type, pointer);} -void __stdcall _Lazy_glNormalPointervINTEL(GLenum type, const GLvoid* * pointer) {if (GLeeInit()) glNormalPointervINTEL(type, pointer);} -void __stdcall _Lazy_glColorPointervINTEL(GLint size, GLenum type, const GLvoid* * pointer) {if (GLeeInit()) glColorPointervINTEL(size, type, pointer);} -void __stdcall _Lazy_glTexCoordPointervINTEL(GLint size, GLenum type, const GLvoid* * pointer) {if (GLeeInit()) glTexCoordPointervINTEL(size, type, pointer);} -PFNGLVERTEXPOINTERVINTELPROC pglVertexPointervINTEL=_Lazy_glVertexPointervINTEL; -PFNGLNORMALPOINTERVINTELPROC pglNormalPointervINTEL=_Lazy_glNormalPointervINTEL; -PFNGLCOLORPOINTERVINTELPROC pglColorPointervINTEL=_Lazy_glColorPointervINTEL; -PFNGLTEXCOORDPOINTERVINTELPROC pglTexCoordPointervINTEL=_Lazy_glTexCoordPointervINTEL; -#endif - -/* GL_HP_occlusion_test */ - -#ifdef __GLEE_GL_HP_occlusion_test -#endif - -/* GL_EXT_pixel_transform */ - -#ifdef __GLEE_GL_EXT_pixel_transform -void __stdcall _Lazy_glPixelTransformParameteriEXT(GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glPixelTransformParameteriEXT(target, pname, param);} -void __stdcall _Lazy_glPixelTransformParameterfEXT(GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glPixelTransformParameterfEXT(target, pname, param);} -void __stdcall _Lazy_glPixelTransformParameterivEXT(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glPixelTransformParameterivEXT(target, pname, params);} -void __stdcall _Lazy_glPixelTransformParameterfvEXT(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glPixelTransformParameterfvEXT(target, pname, params);} -PFNGLPIXELTRANSFORMPARAMETERIEXTPROC pglPixelTransformParameteriEXT=_Lazy_glPixelTransformParameteriEXT; -PFNGLPIXELTRANSFORMPARAMETERFEXTPROC pglPixelTransformParameterfEXT=_Lazy_glPixelTransformParameterfEXT; -PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC pglPixelTransformParameterivEXT=_Lazy_glPixelTransformParameterivEXT; -PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC pglPixelTransformParameterfvEXT=_Lazy_glPixelTransformParameterfvEXT; -#endif - -/* GL_EXT_pixel_transform_color_table */ - -#ifdef __GLEE_GL_EXT_pixel_transform_color_table -#endif - -/* GL_EXT_shared_texture_palette */ - -#ifdef __GLEE_GL_EXT_shared_texture_palette -#endif - -/* GL_EXT_separate_specular_color */ - -#ifdef __GLEE_GL_EXT_separate_specular_color -#endif - -/* GL_EXT_secondary_color */ - -#ifdef __GLEE_GL_EXT_secondary_color -void __stdcall _Lazy_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue) {if (GLeeInit()) glSecondaryColor3bEXT(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3bvEXT(const GLbyte * v) {if (GLeeInit()) glSecondaryColor3bvEXT(v);} -void __stdcall _Lazy_glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue) {if (GLeeInit()) glSecondaryColor3dEXT(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3dvEXT(const GLdouble * v) {if (GLeeInit()) glSecondaryColor3dvEXT(v);} -void __stdcall _Lazy_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue) {if (GLeeInit()) glSecondaryColor3fEXT(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3fvEXT(const GLfloat * v) {if (GLeeInit()) glSecondaryColor3fvEXT(v);} -void __stdcall _Lazy_glSecondaryColor3iEXT(GLint red, GLint green, GLint blue) {if (GLeeInit()) glSecondaryColor3iEXT(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3ivEXT(const GLint * v) {if (GLeeInit()) glSecondaryColor3ivEXT(v);} -void __stdcall _Lazy_glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue) {if (GLeeInit()) glSecondaryColor3sEXT(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3svEXT(const GLshort * v) {if (GLeeInit()) glSecondaryColor3svEXT(v);} -void __stdcall _Lazy_glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue) {if (GLeeInit()) glSecondaryColor3ubEXT(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3ubvEXT(const GLubyte * v) {if (GLeeInit()) glSecondaryColor3ubvEXT(v);} -void __stdcall _Lazy_glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue) {if (GLeeInit()) glSecondaryColor3uiEXT(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3uivEXT(const GLuint * v) {if (GLeeInit()) glSecondaryColor3uivEXT(v);} -void __stdcall _Lazy_glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue) {if (GLeeInit()) glSecondaryColor3usEXT(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3usvEXT(const GLushort * v) {if (GLeeInit()) glSecondaryColor3usvEXT(v);} -void __stdcall _Lazy_glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glSecondaryColorPointerEXT(size, type, stride, pointer);} -PFNGLSECONDARYCOLOR3BEXTPROC pglSecondaryColor3bEXT=_Lazy_glSecondaryColor3bEXT; -PFNGLSECONDARYCOLOR3BVEXTPROC pglSecondaryColor3bvEXT=_Lazy_glSecondaryColor3bvEXT; -PFNGLSECONDARYCOLOR3DEXTPROC pglSecondaryColor3dEXT=_Lazy_glSecondaryColor3dEXT; -PFNGLSECONDARYCOLOR3DVEXTPROC pglSecondaryColor3dvEXT=_Lazy_glSecondaryColor3dvEXT; -PFNGLSECONDARYCOLOR3FEXTPROC pglSecondaryColor3fEXT=_Lazy_glSecondaryColor3fEXT; -PFNGLSECONDARYCOLOR3FVEXTPROC pglSecondaryColor3fvEXT=_Lazy_glSecondaryColor3fvEXT; -PFNGLSECONDARYCOLOR3IEXTPROC pglSecondaryColor3iEXT=_Lazy_glSecondaryColor3iEXT; -PFNGLSECONDARYCOLOR3IVEXTPROC pglSecondaryColor3ivEXT=_Lazy_glSecondaryColor3ivEXT; -PFNGLSECONDARYCOLOR3SEXTPROC pglSecondaryColor3sEXT=_Lazy_glSecondaryColor3sEXT; -PFNGLSECONDARYCOLOR3SVEXTPROC pglSecondaryColor3svEXT=_Lazy_glSecondaryColor3svEXT; -PFNGLSECONDARYCOLOR3UBEXTPROC pglSecondaryColor3ubEXT=_Lazy_glSecondaryColor3ubEXT; -PFNGLSECONDARYCOLOR3UBVEXTPROC pglSecondaryColor3ubvEXT=_Lazy_glSecondaryColor3ubvEXT; -PFNGLSECONDARYCOLOR3UIEXTPROC pglSecondaryColor3uiEXT=_Lazy_glSecondaryColor3uiEXT; -PFNGLSECONDARYCOLOR3UIVEXTPROC pglSecondaryColor3uivEXT=_Lazy_glSecondaryColor3uivEXT; -PFNGLSECONDARYCOLOR3USEXTPROC pglSecondaryColor3usEXT=_Lazy_glSecondaryColor3usEXT; -PFNGLSECONDARYCOLOR3USVEXTPROC pglSecondaryColor3usvEXT=_Lazy_glSecondaryColor3usvEXT; -PFNGLSECONDARYCOLORPOINTEREXTPROC pglSecondaryColorPointerEXT=_Lazy_glSecondaryColorPointerEXT; -#endif - -/* GL_EXT_texture_perturb_normal */ - -#ifdef __GLEE_GL_EXT_texture_perturb_normal -void __stdcall _Lazy_glTextureNormalEXT(GLenum mode) {if (GLeeInit()) glTextureNormalEXT(mode);} -PFNGLTEXTURENORMALEXTPROC pglTextureNormalEXT=_Lazy_glTextureNormalEXT; -#endif - -/* GL_EXT_multi_draw_arrays */ - -#ifdef __GLEE_GL_EXT_multi_draw_arrays -void __stdcall _Lazy_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) {if (GLeeInit()) glMultiDrawArraysEXT(mode, first, count, primcount);} -void __stdcall _Lazy_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid* * indices, GLsizei primcount) {if (GLeeInit()) glMultiDrawElementsEXT(mode, count, type, indices, primcount);} -PFNGLMULTIDRAWARRAYSEXTPROC pglMultiDrawArraysEXT=_Lazy_glMultiDrawArraysEXT; -PFNGLMULTIDRAWELEMENTSEXTPROC pglMultiDrawElementsEXT=_Lazy_glMultiDrawElementsEXT; -#endif - -/* GL_EXT_fog_coord */ - -#ifdef __GLEE_GL_EXT_fog_coord -void __stdcall _Lazy_glFogCoordfEXT(GLfloat coord) {if (GLeeInit()) glFogCoordfEXT(coord);} -void __stdcall _Lazy_glFogCoordfvEXT(const GLfloat * coord) {if (GLeeInit()) glFogCoordfvEXT(coord);} -void __stdcall _Lazy_glFogCoorddEXT(GLdouble coord) {if (GLeeInit()) glFogCoorddEXT(coord);} -void __stdcall _Lazy_glFogCoorddvEXT(const GLdouble * coord) {if (GLeeInit()) glFogCoorddvEXT(coord);} -void __stdcall _Lazy_glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glFogCoordPointerEXT(type, stride, pointer);} -PFNGLFOGCOORDFEXTPROC pglFogCoordfEXT=_Lazy_glFogCoordfEXT; -PFNGLFOGCOORDFVEXTPROC pglFogCoordfvEXT=_Lazy_glFogCoordfvEXT; -PFNGLFOGCOORDDEXTPROC pglFogCoorddEXT=_Lazy_glFogCoorddEXT; -PFNGLFOGCOORDDVEXTPROC pglFogCoorddvEXT=_Lazy_glFogCoorddvEXT; -PFNGLFOGCOORDPOINTEREXTPROC pglFogCoordPointerEXT=_Lazy_glFogCoordPointerEXT; -#endif - -/* GL_REND_screen_coordinates */ - -#ifdef __GLEE_GL_REND_screen_coordinates -#endif - -/* GL_EXT_coordinate_frame */ - -#ifdef __GLEE_GL_EXT_coordinate_frame -void __stdcall _Lazy_glTangent3bEXT(GLbyte tx, GLbyte ty, GLbyte tz) {if (GLeeInit()) glTangent3bEXT(tx, ty, tz);} -void __stdcall _Lazy_glTangent3bvEXT(const GLbyte * v) {if (GLeeInit()) glTangent3bvEXT(v);} -void __stdcall _Lazy_glTangent3dEXT(GLdouble tx, GLdouble ty, GLdouble tz) {if (GLeeInit()) glTangent3dEXT(tx, ty, tz);} -void __stdcall _Lazy_glTangent3dvEXT(const GLdouble * v) {if (GLeeInit()) glTangent3dvEXT(v);} -void __stdcall _Lazy_glTangent3fEXT(GLfloat tx, GLfloat ty, GLfloat tz) {if (GLeeInit()) glTangent3fEXT(tx, ty, tz);} -void __stdcall _Lazy_glTangent3fvEXT(const GLfloat * v) {if (GLeeInit()) glTangent3fvEXT(v);} -void __stdcall _Lazy_glTangent3iEXT(GLint tx, GLint ty, GLint tz) {if (GLeeInit()) glTangent3iEXT(tx, ty, tz);} -void __stdcall _Lazy_glTangent3ivEXT(const GLint * v) {if (GLeeInit()) glTangent3ivEXT(v);} -void __stdcall _Lazy_glTangent3sEXT(GLshort tx, GLshort ty, GLshort tz) {if (GLeeInit()) glTangent3sEXT(tx, ty, tz);} -void __stdcall _Lazy_glTangent3svEXT(const GLshort * v) {if (GLeeInit()) glTangent3svEXT(v);} -void __stdcall _Lazy_glBinormal3bEXT(GLbyte bx, GLbyte by, GLbyte bz) {if (GLeeInit()) glBinormal3bEXT(bx, by, bz);} -void __stdcall _Lazy_glBinormal3bvEXT(const GLbyte * v) {if (GLeeInit()) glBinormal3bvEXT(v);} -void __stdcall _Lazy_glBinormal3dEXT(GLdouble bx, GLdouble by, GLdouble bz) {if (GLeeInit()) glBinormal3dEXT(bx, by, bz);} -void __stdcall _Lazy_glBinormal3dvEXT(const GLdouble * v) {if (GLeeInit()) glBinormal3dvEXT(v);} -void __stdcall _Lazy_glBinormal3fEXT(GLfloat bx, GLfloat by, GLfloat bz) {if (GLeeInit()) glBinormal3fEXT(bx, by, bz);} -void __stdcall _Lazy_glBinormal3fvEXT(const GLfloat * v) {if (GLeeInit()) glBinormal3fvEXT(v);} -void __stdcall _Lazy_glBinormal3iEXT(GLint bx, GLint by, GLint bz) {if (GLeeInit()) glBinormal3iEXT(bx, by, bz);} -void __stdcall _Lazy_glBinormal3ivEXT(const GLint * v) {if (GLeeInit()) glBinormal3ivEXT(v);} -void __stdcall _Lazy_glBinormal3sEXT(GLshort bx, GLshort by, GLshort bz) {if (GLeeInit()) glBinormal3sEXT(bx, by, bz);} -void __stdcall _Lazy_glBinormal3svEXT(const GLshort * v) {if (GLeeInit()) glBinormal3svEXT(v);} -void __stdcall _Lazy_glTangentPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glTangentPointerEXT(type, stride, pointer);} -void __stdcall _Lazy_glBinormalPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glBinormalPointerEXT(type, stride, pointer);} -PFNGLTANGENT3BEXTPROC pglTangent3bEXT=_Lazy_glTangent3bEXT; -PFNGLTANGENT3BVEXTPROC pglTangent3bvEXT=_Lazy_glTangent3bvEXT; -PFNGLTANGENT3DEXTPROC pglTangent3dEXT=_Lazy_glTangent3dEXT; -PFNGLTANGENT3DVEXTPROC pglTangent3dvEXT=_Lazy_glTangent3dvEXT; -PFNGLTANGENT3FEXTPROC pglTangent3fEXT=_Lazy_glTangent3fEXT; -PFNGLTANGENT3FVEXTPROC pglTangent3fvEXT=_Lazy_glTangent3fvEXT; -PFNGLTANGENT3IEXTPROC pglTangent3iEXT=_Lazy_glTangent3iEXT; -PFNGLTANGENT3IVEXTPROC pglTangent3ivEXT=_Lazy_glTangent3ivEXT; -PFNGLTANGENT3SEXTPROC pglTangent3sEXT=_Lazy_glTangent3sEXT; -PFNGLTANGENT3SVEXTPROC pglTangent3svEXT=_Lazy_glTangent3svEXT; -PFNGLBINORMAL3BEXTPROC pglBinormal3bEXT=_Lazy_glBinormal3bEXT; -PFNGLBINORMAL3BVEXTPROC pglBinormal3bvEXT=_Lazy_glBinormal3bvEXT; -PFNGLBINORMAL3DEXTPROC pglBinormal3dEXT=_Lazy_glBinormal3dEXT; -PFNGLBINORMAL3DVEXTPROC pglBinormal3dvEXT=_Lazy_glBinormal3dvEXT; -PFNGLBINORMAL3FEXTPROC pglBinormal3fEXT=_Lazy_glBinormal3fEXT; -PFNGLBINORMAL3FVEXTPROC pglBinormal3fvEXT=_Lazy_glBinormal3fvEXT; -PFNGLBINORMAL3IEXTPROC pglBinormal3iEXT=_Lazy_glBinormal3iEXT; -PFNGLBINORMAL3IVEXTPROC pglBinormal3ivEXT=_Lazy_glBinormal3ivEXT; -PFNGLBINORMAL3SEXTPROC pglBinormal3sEXT=_Lazy_glBinormal3sEXT; -PFNGLBINORMAL3SVEXTPROC pglBinormal3svEXT=_Lazy_glBinormal3svEXT; -PFNGLTANGENTPOINTEREXTPROC pglTangentPointerEXT=_Lazy_glTangentPointerEXT; -PFNGLBINORMALPOINTEREXTPROC pglBinormalPointerEXT=_Lazy_glBinormalPointerEXT; -#endif - -/* GL_EXT_texture_env_combine */ - -#ifdef __GLEE_GL_EXT_texture_env_combine -#endif - -/* GL_APPLE_specular_vector */ - -#ifdef __GLEE_GL_APPLE_specular_vector -#endif - -/* GL_APPLE_transform_hint */ - -#ifdef __GLEE_GL_APPLE_transform_hint -#endif - -/* GL_SGIX_fog_scale */ - -#ifdef __GLEE_GL_SGIX_fog_scale -#endif - -/* GL_SUNX_constant_data */ - -#ifdef __GLEE_GL_SUNX_constant_data -void __stdcall _Lazy_glFinishTextureSUNX(void) {if (GLeeInit()) glFinishTextureSUNX();} -PFNGLFINISHTEXTURESUNXPROC pglFinishTextureSUNX=_Lazy_glFinishTextureSUNX; -#endif - -/* GL_SUN_global_alpha */ - -#ifdef __GLEE_GL_SUN_global_alpha -void __stdcall _Lazy_glGlobalAlphaFactorbSUN(GLbyte factor) {if (GLeeInit()) glGlobalAlphaFactorbSUN(factor);} -void __stdcall _Lazy_glGlobalAlphaFactorsSUN(GLshort factor) {if (GLeeInit()) glGlobalAlphaFactorsSUN(factor);} -void __stdcall _Lazy_glGlobalAlphaFactoriSUN(GLint factor) {if (GLeeInit()) glGlobalAlphaFactoriSUN(factor);} -void __stdcall _Lazy_glGlobalAlphaFactorfSUN(GLfloat factor) {if (GLeeInit()) glGlobalAlphaFactorfSUN(factor);} -void __stdcall _Lazy_glGlobalAlphaFactordSUN(GLdouble factor) {if (GLeeInit()) glGlobalAlphaFactordSUN(factor);} -void __stdcall _Lazy_glGlobalAlphaFactorubSUN(GLubyte factor) {if (GLeeInit()) glGlobalAlphaFactorubSUN(factor);} -void __stdcall _Lazy_glGlobalAlphaFactorusSUN(GLushort factor) {if (GLeeInit()) glGlobalAlphaFactorusSUN(factor);} -void __stdcall _Lazy_glGlobalAlphaFactoruiSUN(GLuint factor) {if (GLeeInit()) glGlobalAlphaFactoruiSUN(factor);} -PFNGLGLOBALALPHAFACTORBSUNPROC pglGlobalAlphaFactorbSUN=_Lazy_glGlobalAlphaFactorbSUN; -PFNGLGLOBALALPHAFACTORSSUNPROC pglGlobalAlphaFactorsSUN=_Lazy_glGlobalAlphaFactorsSUN; -PFNGLGLOBALALPHAFACTORISUNPROC pglGlobalAlphaFactoriSUN=_Lazy_glGlobalAlphaFactoriSUN; -PFNGLGLOBALALPHAFACTORFSUNPROC pglGlobalAlphaFactorfSUN=_Lazy_glGlobalAlphaFactorfSUN; -PFNGLGLOBALALPHAFACTORDSUNPROC pglGlobalAlphaFactordSUN=_Lazy_glGlobalAlphaFactordSUN; -PFNGLGLOBALALPHAFACTORUBSUNPROC pglGlobalAlphaFactorubSUN=_Lazy_glGlobalAlphaFactorubSUN; -PFNGLGLOBALALPHAFACTORUSSUNPROC pglGlobalAlphaFactorusSUN=_Lazy_glGlobalAlphaFactorusSUN; -PFNGLGLOBALALPHAFACTORUISUNPROC pglGlobalAlphaFactoruiSUN=_Lazy_glGlobalAlphaFactoruiSUN; -#endif - -/* GL_SUN_triangle_list */ - -#ifdef __GLEE_GL_SUN_triangle_list -void __stdcall _Lazy_glReplacementCodeuiSUN(GLuint code) {if (GLeeInit()) glReplacementCodeuiSUN(code);} -void __stdcall _Lazy_glReplacementCodeusSUN(GLushort code) {if (GLeeInit()) glReplacementCodeusSUN(code);} -void __stdcall _Lazy_glReplacementCodeubSUN(GLubyte code) {if (GLeeInit()) glReplacementCodeubSUN(code);} -void __stdcall _Lazy_glReplacementCodeuivSUN(const GLuint * code) {if (GLeeInit()) glReplacementCodeuivSUN(code);} -void __stdcall _Lazy_glReplacementCodeusvSUN(const GLushort * code) {if (GLeeInit()) glReplacementCodeusvSUN(code);} -void __stdcall _Lazy_glReplacementCodeubvSUN(const GLubyte * code) {if (GLeeInit()) glReplacementCodeubvSUN(code);} -void __stdcall _Lazy_glReplacementCodePointerSUN(GLenum type, GLsizei stride, const GLvoid* * pointer) {if (GLeeInit()) glReplacementCodePointerSUN(type, stride, pointer);} -PFNGLREPLACEMENTCODEUISUNPROC pglReplacementCodeuiSUN=_Lazy_glReplacementCodeuiSUN; -PFNGLREPLACEMENTCODEUSSUNPROC pglReplacementCodeusSUN=_Lazy_glReplacementCodeusSUN; -PFNGLREPLACEMENTCODEUBSUNPROC pglReplacementCodeubSUN=_Lazy_glReplacementCodeubSUN; -PFNGLREPLACEMENTCODEUIVSUNPROC pglReplacementCodeuivSUN=_Lazy_glReplacementCodeuivSUN; -PFNGLREPLACEMENTCODEUSVSUNPROC pglReplacementCodeusvSUN=_Lazy_glReplacementCodeusvSUN; -PFNGLREPLACEMENTCODEUBVSUNPROC pglReplacementCodeubvSUN=_Lazy_glReplacementCodeubvSUN; -PFNGLREPLACEMENTCODEPOINTERSUNPROC pglReplacementCodePointerSUN=_Lazy_glReplacementCodePointerSUN; -#endif - -/* GL_SUN_vertex */ - -#ifdef __GLEE_GL_SUN_vertex -void __stdcall _Lazy_glColor4ubVertex2fSUN(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y) {if (GLeeInit()) glColor4ubVertex2fSUN(r, g, b, a, x, y);} -void __stdcall _Lazy_glColor4ubVertex2fvSUN(const GLubyte * c, const GLfloat * v) {if (GLeeInit()) glColor4ubVertex2fvSUN(c, v);} -void __stdcall _Lazy_glColor4ubVertex3fSUN(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glColor4ubVertex3fSUN(r, g, b, a, x, y, z);} -void __stdcall _Lazy_glColor4ubVertex3fvSUN(const GLubyte * c, const GLfloat * v) {if (GLeeInit()) glColor4ubVertex3fvSUN(c, v);} -void __stdcall _Lazy_glColor3fVertex3fSUN(GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glColor3fVertex3fSUN(r, g, b, x, y, z);} -void __stdcall _Lazy_glColor3fVertex3fvSUN(const GLfloat * c, const GLfloat * v) {if (GLeeInit()) glColor3fVertex3fvSUN(c, v);} -void __stdcall _Lazy_glNormal3fVertex3fSUN(GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glNormal3fVertex3fSUN(nx, ny, nz, x, y, z);} -void __stdcall _Lazy_glNormal3fVertex3fvSUN(const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glNormal3fVertex3fvSUN(n, v);} -void __stdcall _Lazy_glColor4fNormal3fVertex3fSUN(GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glColor4fNormal3fVertex3fSUN(r, g, b, a, nx, ny, nz, x, y, z);} -void __stdcall _Lazy_glColor4fNormal3fVertex3fvSUN(const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glColor4fNormal3fVertex3fvSUN(c, n, v);} -void __stdcall _Lazy_glTexCoord2fVertex3fSUN(GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fVertex3fSUN(s, t, x, y, z);} -void __stdcall _Lazy_glTexCoord2fVertex3fvSUN(const GLfloat * tc, const GLfloat * v) {if (GLeeInit()) glTexCoord2fVertex3fvSUN(tc, v);} -void __stdcall _Lazy_glTexCoord4fVertex4fSUN(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glTexCoord4fVertex4fSUN(s, t, p, q, x, y, z, w);} -void __stdcall _Lazy_glTexCoord4fVertex4fvSUN(const GLfloat * tc, const GLfloat * v) {if (GLeeInit()) glTexCoord4fVertex4fvSUN(tc, v);} -void __stdcall _Lazy_glTexCoord2fColor4ubVertex3fSUN(GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fColor4ubVertex3fSUN(s, t, r, g, b, a, x, y, z);} -void __stdcall _Lazy_glTexCoord2fColor4ubVertex3fvSUN(const GLfloat * tc, const GLubyte * c, const GLfloat * v) {if (GLeeInit()) glTexCoord2fColor4ubVertex3fvSUN(tc, c, v);} -void __stdcall _Lazy_glTexCoord2fColor3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fColor3fVertex3fSUN(s, t, r, g, b, x, y, z);} -void __stdcall _Lazy_glTexCoord2fColor3fVertex3fvSUN(const GLfloat * tc, const GLfloat * c, const GLfloat * v) {if (GLeeInit()) glTexCoord2fColor3fVertex3fvSUN(tc, c, v);} -void __stdcall _Lazy_glTexCoord2fNormal3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fNormal3fVertex3fSUN(s, t, nx, ny, nz, x, y, z);} -void __stdcall _Lazy_glTexCoord2fNormal3fVertex3fvSUN(const GLfloat * tc, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glTexCoord2fNormal3fVertex3fvSUN(tc, n, v);} -void __stdcall _Lazy_glTexCoord2fColor4fNormal3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fColor4fNormal3fVertex3fSUN(s, t, r, g, b, a, nx, ny, nz, x, y, z);} -void __stdcall _Lazy_glTexCoord2fColor4fNormal3fVertex3fvSUN(const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glTexCoord2fColor4fNormal3fVertex3fvSUN(tc, c, n, v);} -void __stdcall _Lazy_glTexCoord4fColor4fNormal3fVertex4fSUN(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glTexCoord4fColor4fNormal3fVertex4fSUN(s, t, p, q, r, g, b, a, nx, ny, nz, x, y, z, w);} -void __stdcall _Lazy_glTexCoord4fColor4fNormal3fVertex4fvSUN(const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glTexCoord4fColor4fNormal3fVertex4fvSUN(tc, c, n, v);} -void __stdcall _Lazy_glReplacementCodeuiVertex3fSUN(GLuint rc, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiVertex3fSUN(rc, x, y, z);} -void __stdcall _Lazy_glReplacementCodeuiVertex3fvSUN(const GLuint * rc, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiVertex3fvSUN(rc, v);} -void __stdcall _Lazy_glReplacementCodeuiColor4ubVertex3fSUN(GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiColor4ubVertex3fSUN(rc, r, g, b, a, x, y, z);} -void __stdcall _Lazy_glReplacementCodeuiColor4ubVertex3fvSUN(const GLuint * rc, const GLubyte * c, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiColor4ubVertex3fvSUN(rc, c, v);} -void __stdcall _Lazy_glReplacementCodeuiColor3fVertex3fSUN(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiColor3fVertex3fSUN(rc, r, g, b, x, y, z);} -void __stdcall _Lazy_glReplacementCodeuiColor3fVertex3fvSUN(const GLuint * rc, const GLfloat * c, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiColor3fVertex3fvSUN(rc, c, v);} -void __stdcall _Lazy_glReplacementCodeuiNormal3fVertex3fSUN(GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiNormal3fVertex3fSUN(rc, nx, ny, nz, x, y, z);} -void __stdcall _Lazy_glReplacementCodeuiNormal3fVertex3fvSUN(const GLuint * rc, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiNormal3fVertex3fvSUN(rc, n, v);} -void __stdcall _Lazy_glReplacementCodeuiColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiColor4fNormal3fVertex3fSUN(rc, r, g, b, a, nx, ny, nz, x, y, z);} -void __stdcall _Lazy_glReplacementCodeuiColor4fNormal3fVertex3fvSUN(const GLuint * rc, const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiColor4fNormal3fVertex3fvSUN(rc, c, n, v);} -void __stdcall _Lazy_glReplacementCodeuiTexCoord2fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiTexCoord2fVertex3fSUN(rc, s, t, x, y, z);} -void __stdcall _Lazy_glReplacementCodeuiTexCoord2fVertex3fvSUN(const GLuint * rc, const GLfloat * tc, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiTexCoord2fVertex3fvSUN(rc, tc, v);} -void __stdcall _Lazy_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(rc, s, t, nx, ny, nz, x, y, z);} -void __stdcall _Lazy_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(const GLuint * rc, const GLfloat * tc, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(rc, tc, n, v);} -void __stdcall _Lazy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(rc, s, t, r, g, b, a, nx, ny, nz, x, y, z);} -void __stdcall _Lazy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(const GLuint * rc, const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(rc, tc, c, n, v);} -PFNGLCOLOR4UBVERTEX2FSUNPROC pglColor4ubVertex2fSUN=_Lazy_glColor4ubVertex2fSUN; -PFNGLCOLOR4UBVERTEX2FVSUNPROC pglColor4ubVertex2fvSUN=_Lazy_glColor4ubVertex2fvSUN; -PFNGLCOLOR4UBVERTEX3FSUNPROC pglColor4ubVertex3fSUN=_Lazy_glColor4ubVertex3fSUN; -PFNGLCOLOR4UBVERTEX3FVSUNPROC pglColor4ubVertex3fvSUN=_Lazy_glColor4ubVertex3fvSUN; -PFNGLCOLOR3FVERTEX3FSUNPROC pglColor3fVertex3fSUN=_Lazy_glColor3fVertex3fSUN; -PFNGLCOLOR3FVERTEX3FVSUNPROC pglColor3fVertex3fvSUN=_Lazy_glColor3fVertex3fvSUN; -PFNGLNORMAL3FVERTEX3FSUNPROC pglNormal3fVertex3fSUN=_Lazy_glNormal3fVertex3fSUN; -PFNGLNORMAL3FVERTEX3FVSUNPROC pglNormal3fVertex3fvSUN=_Lazy_glNormal3fVertex3fvSUN; -PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC pglColor4fNormal3fVertex3fSUN=_Lazy_glColor4fNormal3fVertex3fSUN; -PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglColor4fNormal3fVertex3fvSUN=_Lazy_glColor4fNormal3fVertex3fvSUN; -PFNGLTEXCOORD2FVERTEX3FSUNPROC pglTexCoord2fVertex3fSUN=_Lazy_glTexCoord2fVertex3fSUN; -PFNGLTEXCOORD2FVERTEX3FVSUNPROC pglTexCoord2fVertex3fvSUN=_Lazy_glTexCoord2fVertex3fvSUN; -PFNGLTEXCOORD4FVERTEX4FSUNPROC pglTexCoord4fVertex4fSUN=_Lazy_glTexCoord4fVertex4fSUN; -PFNGLTEXCOORD4FVERTEX4FVSUNPROC pglTexCoord4fVertex4fvSUN=_Lazy_glTexCoord4fVertex4fvSUN; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC pglTexCoord2fColor4ubVertex3fSUN=_Lazy_glTexCoord2fColor4ubVertex3fSUN; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC pglTexCoord2fColor4ubVertex3fvSUN=_Lazy_glTexCoord2fColor4ubVertex3fvSUN; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC pglTexCoord2fColor3fVertex3fSUN=_Lazy_glTexCoord2fColor3fVertex3fSUN; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC pglTexCoord2fColor3fVertex3fvSUN=_Lazy_glTexCoord2fColor3fVertex3fvSUN; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC pglTexCoord2fNormal3fVertex3fSUN=_Lazy_glTexCoord2fNormal3fVertex3fSUN; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC pglTexCoord2fNormal3fVertex3fvSUN=_Lazy_glTexCoord2fNormal3fVertex3fvSUN; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC pglTexCoord2fColor4fNormal3fVertex3fSUN=_Lazy_glTexCoord2fColor4fNormal3fVertex3fSUN; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglTexCoord2fColor4fNormal3fVertex3fvSUN=_Lazy_glTexCoord2fColor4fNormal3fVertex3fvSUN; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC pglTexCoord4fColor4fNormal3fVertex4fSUN=_Lazy_glTexCoord4fColor4fNormal3fVertex4fSUN; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC pglTexCoord4fColor4fNormal3fVertex4fvSUN=_Lazy_glTexCoord4fColor4fNormal3fVertex4fvSUN; -PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC pglReplacementCodeuiVertex3fSUN=_Lazy_glReplacementCodeuiVertex3fSUN; -PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC pglReplacementCodeuiVertex3fvSUN=_Lazy_glReplacementCodeuiVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC pglReplacementCodeuiColor4ubVertex3fSUN=_Lazy_glReplacementCodeuiColor4ubVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC pglReplacementCodeuiColor4ubVertex3fvSUN=_Lazy_glReplacementCodeuiColor4ubVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC pglReplacementCodeuiColor3fVertex3fSUN=_Lazy_glReplacementCodeuiColor3fVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC pglReplacementCodeuiColor3fVertex3fvSUN=_Lazy_glReplacementCodeuiColor3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiNormal3fVertex3fSUN=_Lazy_glReplacementCodeuiNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiNormal3fVertex3fvSUN=_Lazy_glReplacementCodeuiNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiColor4fNormal3fVertex3fSUN=_Lazy_glReplacementCodeuiColor4fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiColor4fNormal3fVertex3fvSUN=_Lazy_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fVertex3fSUN=_Lazy_glReplacementCodeuiTexCoord2fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fVertex3fvSUN=_Lazy_glReplacementCodeuiTexCoord2fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fNormal3fVertex3fSUN=_Lazy_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN=_Lazy_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN=_Lazy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN=_Lazy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -#endif - -/* GL_EXT_blend_func_separate */ - -#ifdef __GLEE_GL_EXT_blend_func_separate -void __stdcall _Lazy_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {if (GLeeInit()) glBlendFuncSeparateEXT(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);} -PFNGLBLENDFUNCSEPARATEEXTPROC pglBlendFuncSeparateEXT=_Lazy_glBlendFuncSeparateEXT; -#endif - -/* GL_INGR_color_clamp */ - -#ifdef __GLEE_GL_INGR_color_clamp -#endif - -/* GL_INGR_interlace_read */ - -#ifdef __GLEE_GL_INGR_interlace_read -#endif - -/* GL_EXT_stencil_wrap */ - -#ifdef __GLEE_GL_EXT_stencil_wrap -#endif - -/* GL_EXT_422_pixels */ - -#ifdef __GLEE_GL_EXT_422_pixels -#endif - -/* GL_NV_texgen_reflection */ - -#ifdef __GLEE_GL_NV_texgen_reflection -#endif - -/* GL_EXT_texture_cube_map */ - -#ifdef __GLEE_GL_EXT_texture_cube_map -#endif - -/* GL_SUN_convolution_border_modes */ - -#ifdef __GLEE_GL_SUN_convolution_border_modes -#endif - -/* GL_EXT_texture_env_add */ - -#ifdef __GLEE_GL_EXT_texture_env_add -#endif - -/* GL_EXT_texture_lod_bias */ - -#ifdef __GLEE_GL_EXT_texture_lod_bias -#endif - -/* GL_EXT_texture_filter_anisotropic */ - -#ifdef __GLEE_GL_EXT_texture_filter_anisotropic -#endif - -/* GL_EXT_vertex_weighting */ - -#ifdef __GLEE_GL_EXT_vertex_weighting -void __stdcall _Lazy_glVertexWeightfEXT(GLfloat weight) {if (GLeeInit()) glVertexWeightfEXT(weight);} -void __stdcall _Lazy_glVertexWeightfvEXT(const GLfloat * weight) {if (GLeeInit()) glVertexWeightfvEXT(weight);} -void __stdcall _Lazy_glVertexWeightPointerEXT(GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexWeightPointerEXT(size, type, stride, pointer);} -PFNGLVERTEXWEIGHTFEXTPROC pglVertexWeightfEXT=_Lazy_glVertexWeightfEXT; -PFNGLVERTEXWEIGHTFVEXTPROC pglVertexWeightfvEXT=_Lazy_glVertexWeightfvEXT; -PFNGLVERTEXWEIGHTPOINTEREXTPROC pglVertexWeightPointerEXT=_Lazy_glVertexWeightPointerEXT; -#endif - -/* GL_NV_light_max_exponent */ - -#ifdef __GLEE_GL_NV_light_max_exponent -#endif - -/* GL_NV_vertex_array_range */ - -#ifdef __GLEE_GL_NV_vertex_array_range -void __stdcall _Lazy_glFlushVertexArrayRangeNV(void) {if (GLeeInit()) glFlushVertexArrayRangeNV();} -void __stdcall _Lazy_glVertexArrayRangeNV(GLsizei length, const GLvoid * pointer) {if (GLeeInit()) glVertexArrayRangeNV(length, pointer);} -PFNGLFLUSHVERTEXARRAYRANGENVPROC pglFlushVertexArrayRangeNV=_Lazy_glFlushVertexArrayRangeNV; -PFNGLVERTEXARRAYRANGENVPROC pglVertexArrayRangeNV=_Lazy_glVertexArrayRangeNV; -#endif - -/* GL_NV_register_combiners */ - -#ifdef __GLEE_GL_NV_register_combiners -void __stdcall _Lazy_glCombinerParameterfvNV(GLenum pname, const GLfloat * params) {if (GLeeInit()) glCombinerParameterfvNV(pname, params);} -void __stdcall _Lazy_glCombinerParameterfNV(GLenum pname, GLfloat param) {if (GLeeInit()) glCombinerParameterfNV(pname, param);} -void __stdcall _Lazy_glCombinerParameterivNV(GLenum pname, const GLint * params) {if (GLeeInit()) glCombinerParameterivNV(pname, params);} -void __stdcall _Lazy_glCombinerParameteriNV(GLenum pname, GLint param) {if (GLeeInit()) glCombinerParameteriNV(pname, param);} -void __stdcall _Lazy_glCombinerInputNV(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) {if (GLeeInit()) glCombinerInputNV(stage, portion, variable, input, mapping, componentUsage);} -void __stdcall _Lazy_glCombinerOutputNV(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum) {if (GLeeInit()) glCombinerOutputNV(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum);} -void __stdcall _Lazy_glFinalCombinerInputNV(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) {if (GLeeInit()) glFinalCombinerInputNV(variable, input, mapping, componentUsage);} -void __stdcall _Lazy_glGetCombinerInputParameterfvNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetCombinerInputParameterfvNV(stage, portion, variable, pname, params);} -void __stdcall _Lazy_glGetCombinerInputParameterivNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params) {if (GLeeInit()) glGetCombinerInputParameterivNV(stage, portion, variable, pname, params);} -void __stdcall _Lazy_glGetCombinerOutputParameterfvNV(GLenum stage, GLenum portion, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetCombinerOutputParameterfvNV(stage, portion, pname, params);} -void __stdcall _Lazy_glGetCombinerOutputParameterivNV(GLenum stage, GLenum portion, GLenum pname, GLint * params) {if (GLeeInit()) glGetCombinerOutputParameterivNV(stage, portion, pname, params);} -void __stdcall _Lazy_glGetFinalCombinerInputParameterfvNV(GLenum variable, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetFinalCombinerInputParameterfvNV(variable, pname, params);} -void __stdcall _Lazy_glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum pname, GLint * params) {if (GLeeInit()) glGetFinalCombinerInputParameterivNV(variable, pname, params);} -PFNGLCOMBINERPARAMETERFVNVPROC pglCombinerParameterfvNV=_Lazy_glCombinerParameterfvNV; -PFNGLCOMBINERPARAMETERFNVPROC pglCombinerParameterfNV=_Lazy_glCombinerParameterfNV; -PFNGLCOMBINERPARAMETERIVNVPROC pglCombinerParameterivNV=_Lazy_glCombinerParameterivNV; -PFNGLCOMBINERPARAMETERINVPROC pglCombinerParameteriNV=_Lazy_glCombinerParameteriNV; -PFNGLCOMBINERINPUTNVPROC pglCombinerInputNV=_Lazy_glCombinerInputNV; -PFNGLCOMBINEROUTPUTNVPROC pglCombinerOutputNV=_Lazy_glCombinerOutputNV; -PFNGLFINALCOMBINERINPUTNVPROC pglFinalCombinerInputNV=_Lazy_glFinalCombinerInputNV; -PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC pglGetCombinerInputParameterfvNV=_Lazy_glGetCombinerInputParameterfvNV; -PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC pglGetCombinerInputParameterivNV=_Lazy_glGetCombinerInputParameterivNV; -PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC pglGetCombinerOutputParameterfvNV=_Lazy_glGetCombinerOutputParameterfvNV; -PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC pglGetCombinerOutputParameterivNV=_Lazy_glGetCombinerOutputParameterivNV; -PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC pglGetFinalCombinerInputParameterfvNV=_Lazy_glGetFinalCombinerInputParameterfvNV; -PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC pglGetFinalCombinerInputParameterivNV=_Lazy_glGetFinalCombinerInputParameterivNV; -#endif - -/* GL_NV_fog_distance */ - -#ifdef __GLEE_GL_NV_fog_distance -#endif - -/* GL_NV_texgen_emboss */ - -#ifdef __GLEE_GL_NV_texgen_emboss -#endif - -/* GL_NV_blend_square */ - -#ifdef __GLEE_GL_NV_blend_square -#endif - -/* GL_NV_texture_env_combine4 */ - -#ifdef __GLEE_GL_NV_texture_env_combine4 -#endif - -/* GL_MESA_resize_buffers */ - -#ifdef __GLEE_GL_MESA_resize_buffers -void __stdcall _Lazy_glResizeBuffersMESA(void) {if (GLeeInit()) glResizeBuffersMESA();} -PFNGLRESIZEBUFFERSMESAPROC pglResizeBuffersMESA=_Lazy_glResizeBuffersMESA; -#endif - -/* GL_MESA_window_pos */ - -#ifdef __GLEE_GL_MESA_window_pos -void __stdcall _Lazy_glWindowPos2dMESA(GLdouble x, GLdouble y) {if (GLeeInit()) glWindowPos2dMESA(x, y);} -void __stdcall _Lazy_glWindowPos2dvMESA(const GLdouble * v) {if (GLeeInit()) glWindowPos2dvMESA(v);} -void __stdcall _Lazy_glWindowPos2fMESA(GLfloat x, GLfloat y) {if (GLeeInit()) glWindowPos2fMESA(x, y);} -void __stdcall _Lazy_glWindowPos2fvMESA(const GLfloat * v) {if (GLeeInit()) glWindowPos2fvMESA(v);} -void __stdcall _Lazy_glWindowPos2iMESA(GLint x, GLint y) {if (GLeeInit()) glWindowPos2iMESA(x, y);} -void __stdcall _Lazy_glWindowPos2ivMESA(const GLint * v) {if (GLeeInit()) glWindowPos2ivMESA(v);} -void __stdcall _Lazy_glWindowPos2sMESA(GLshort x, GLshort y) {if (GLeeInit()) glWindowPos2sMESA(x, y);} -void __stdcall _Lazy_glWindowPos2svMESA(const GLshort * v) {if (GLeeInit()) glWindowPos2svMESA(v);} -void __stdcall _Lazy_glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glWindowPos3dMESA(x, y, z);} -void __stdcall _Lazy_glWindowPos3dvMESA(const GLdouble * v) {if (GLeeInit()) glWindowPos3dvMESA(v);} -void __stdcall _Lazy_glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glWindowPos3fMESA(x, y, z);} -void __stdcall _Lazy_glWindowPos3fvMESA(const GLfloat * v) {if (GLeeInit()) glWindowPos3fvMESA(v);} -void __stdcall _Lazy_glWindowPos3iMESA(GLint x, GLint y, GLint z) {if (GLeeInit()) glWindowPos3iMESA(x, y, z);} -void __stdcall _Lazy_glWindowPos3ivMESA(const GLint * v) {if (GLeeInit()) glWindowPos3ivMESA(v);} -void __stdcall _Lazy_glWindowPos3sMESA(GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glWindowPos3sMESA(x, y, z);} -void __stdcall _Lazy_glWindowPos3svMESA(const GLshort * v) {if (GLeeInit()) glWindowPos3svMESA(v);} -void __stdcall _Lazy_glWindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glWindowPos4dMESA(x, y, z, w);} -void __stdcall _Lazy_glWindowPos4dvMESA(const GLdouble * v) {if (GLeeInit()) glWindowPos4dvMESA(v);} -void __stdcall _Lazy_glWindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glWindowPos4fMESA(x, y, z, w);} -void __stdcall _Lazy_glWindowPos4fvMESA(const GLfloat * v) {if (GLeeInit()) glWindowPos4fvMESA(v);} -void __stdcall _Lazy_glWindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glWindowPos4iMESA(x, y, z, w);} -void __stdcall _Lazy_glWindowPos4ivMESA(const GLint * v) {if (GLeeInit()) glWindowPos4ivMESA(v);} -void __stdcall _Lazy_glWindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glWindowPos4sMESA(x, y, z, w);} -void __stdcall _Lazy_glWindowPos4svMESA(const GLshort * v) {if (GLeeInit()) glWindowPos4svMESA(v);} -PFNGLWINDOWPOS2DMESAPROC pglWindowPos2dMESA=_Lazy_glWindowPos2dMESA; -PFNGLWINDOWPOS2DVMESAPROC pglWindowPos2dvMESA=_Lazy_glWindowPos2dvMESA; -PFNGLWINDOWPOS2FMESAPROC pglWindowPos2fMESA=_Lazy_glWindowPos2fMESA; -PFNGLWINDOWPOS2FVMESAPROC pglWindowPos2fvMESA=_Lazy_glWindowPos2fvMESA; -PFNGLWINDOWPOS2IMESAPROC pglWindowPos2iMESA=_Lazy_glWindowPos2iMESA; -PFNGLWINDOWPOS2IVMESAPROC pglWindowPos2ivMESA=_Lazy_glWindowPos2ivMESA; -PFNGLWINDOWPOS2SMESAPROC pglWindowPos2sMESA=_Lazy_glWindowPos2sMESA; -PFNGLWINDOWPOS2SVMESAPROC pglWindowPos2svMESA=_Lazy_glWindowPos2svMESA; -PFNGLWINDOWPOS3DMESAPROC pglWindowPos3dMESA=_Lazy_glWindowPos3dMESA; -PFNGLWINDOWPOS3DVMESAPROC pglWindowPos3dvMESA=_Lazy_glWindowPos3dvMESA; -PFNGLWINDOWPOS3FMESAPROC pglWindowPos3fMESA=_Lazy_glWindowPos3fMESA; -PFNGLWINDOWPOS3FVMESAPROC pglWindowPos3fvMESA=_Lazy_glWindowPos3fvMESA; -PFNGLWINDOWPOS3IMESAPROC pglWindowPos3iMESA=_Lazy_glWindowPos3iMESA; -PFNGLWINDOWPOS3IVMESAPROC pglWindowPos3ivMESA=_Lazy_glWindowPos3ivMESA; -PFNGLWINDOWPOS3SMESAPROC pglWindowPos3sMESA=_Lazy_glWindowPos3sMESA; -PFNGLWINDOWPOS3SVMESAPROC pglWindowPos3svMESA=_Lazy_glWindowPos3svMESA; -PFNGLWINDOWPOS4DMESAPROC pglWindowPos4dMESA=_Lazy_glWindowPos4dMESA; -PFNGLWINDOWPOS4DVMESAPROC pglWindowPos4dvMESA=_Lazy_glWindowPos4dvMESA; -PFNGLWINDOWPOS4FMESAPROC pglWindowPos4fMESA=_Lazy_glWindowPos4fMESA; -PFNGLWINDOWPOS4FVMESAPROC pglWindowPos4fvMESA=_Lazy_glWindowPos4fvMESA; -PFNGLWINDOWPOS4IMESAPROC pglWindowPos4iMESA=_Lazy_glWindowPos4iMESA; -PFNGLWINDOWPOS4IVMESAPROC pglWindowPos4ivMESA=_Lazy_glWindowPos4ivMESA; -PFNGLWINDOWPOS4SMESAPROC pglWindowPos4sMESA=_Lazy_glWindowPos4sMESA; -PFNGLWINDOWPOS4SVMESAPROC pglWindowPos4svMESA=_Lazy_glWindowPos4svMESA; -#endif - -/* GL_EXT_texture_compression_s3tc */ - -#ifdef __GLEE_GL_EXT_texture_compression_s3tc -#endif - -/* GL_IBM_cull_vertex */ - -#ifdef __GLEE_GL_IBM_cull_vertex -#endif - -/* GL_IBM_multimode_draw_arrays */ - -#ifdef __GLEE_GL_IBM_multimode_draw_arrays -void __stdcall _Lazy_glMultiModeDrawArraysIBM(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) {if (GLeeInit()) glMultiModeDrawArraysIBM(mode, first, count, primcount, modestride);} -void __stdcall _Lazy_glMultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid* const * indices, GLsizei primcount, GLint modestride) {if (GLeeInit()) glMultiModeDrawElementsIBM(mode, count, type, indices, primcount, modestride);} -PFNGLMULTIMODEDRAWARRAYSIBMPROC pglMultiModeDrawArraysIBM=_Lazy_glMultiModeDrawArraysIBM; -PFNGLMULTIMODEDRAWELEMENTSIBMPROC pglMultiModeDrawElementsIBM=_Lazy_glMultiModeDrawElementsIBM; -#endif - -/* GL_IBM_vertex_array_lists */ - -#ifdef __GLEE_GL_IBM_vertex_array_lists -void __stdcall _Lazy_glColorPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glColorPointerListIBM(size, type, stride, pointer, ptrstride);} -void __stdcall _Lazy_glSecondaryColorPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glSecondaryColorPointerListIBM(size, type, stride, pointer, ptrstride);} -void __stdcall _Lazy_glEdgeFlagPointerListIBM(GLint stride, const GLboolean* * pointer, GLint ptrstride) {if (GLeeInit()) glEdgeFlagPointerListIBM(stride, pointer, ptrstride);} -void __stdcall _Lazy_glFogCoordPointerListIBM(GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glFogCoordPointerListIBM(type, stride, pointer, ptrstride);} -void __stdcall _Lazy_glIndexPointerListIBM(GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glIndexPointerListIBM(type, stride, pointer, ptrstride);} -void __stdcall _Lazy_glNormalPointerListIBM(GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glNormalPointerListIBM(type, stride, pointer, ptrstride);} -void __stdcall _Lazy_glTexCoordPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glTexCoordPointerListIBM(size, type, stride, pointer, ptrstride);} -void __stdcall _Lazy_glVertexPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glVertexPointerListIBM(size, type, stride, pointer, ptrstride);} -PFNGLCOLORPOINTERLISTIBMPROC pglColorPointerListIBM=_Lazy_glColorPointerListIBM; -PFNGLSECONDARYCOLORPOINTERLISTIBMPROC pglSecondaryColorPointerListIBM=_Lazy_glSecondaryColorPointerListIBM; -PFNGLEDGEFLAGPOINTERLISTIBMPROC pglEdgeFlagPointerListIBM=_Lazy_glEdgeFlagPointerListIBM; -PFNGLFOGCOORDPOINTERLISTIBMPROC pglFogCoordPointerListIBM=_Lazy_glFogCoordPointerListIBM; -PFNGLINDEXPOINTERLISTIBMPROC pglIndexPointerListIBM=_Lazy_glIndexPointerListIBM; -PFNGLNORMALPOINTERLISTIBMPROC pglNormalPointerListIBM=_Lazy_glNormalPointerListIBM; -PFNGLTEXCOORDPOINTERLISTIBMPROC pglTexCoordPointerListIBM=_Lazy_glTexCoordPointerListIBM; -PFNGLVERTEXPOINTERLISTIBMPROC pglVertexPointerListIBM=_Lazy_glVertexPointerListIBM; -#endif - -/* GL_SGIX_subsample */ - -#ifdef __GLEE_GL_SGIX_subsample -#endif - -/* GL_SGIX_ycrcb_subsample */ - -#ifdef __GLEE_GL_SGIX_ycrcb_subsample -#endif - -/* GL_SGIX_ycrcba */ - -#ifdef __GLEE_GL_SGIX_ycrcba -#endif - -/* GL_SGI_depth_pass_instrument */ - -#ifdef __GLEE_GL_SGI_depth_pass_instrument -#endif - -/* GL_3DFX_texture_compression_FXT1 */ - -#ifdef __GLEE_GL_3DFX_texture_compression_FXT1 -#endif - -/* GL_3DFX_multisample */ - -#ifdef __GLEE_GL_3DFX_multisample -#endif - -/* GL_3DFX_tbuffer */ - -#ifdef __GLEE_GL_3DFX_tbuffer -void __stdcall _Lazy_glTbufferMask3DFX(GLuint mask) {if (GLeeInit()) glTbufferMask3DFX(mask);} -PFNGLTBUFFERMASK3DFXPROC pglTbufferMask3DFX=_Lazy_glTbufferMask3DFX; -#endif - -/* GL_EXT_multisample */ - -#ifdef __GLEE_GL_EXT_multisample -void __stdcall _Lazy_glSampleMaskEXT(GLclampf value, GLboolean invert) {if (GLeeInit()) glSampleMaskEXT(value, invert);} -void __stdcall _Lazy_glSamplePatternEXT(GLenum pattern) {if (GLeeInit()) glSamplePatternEXT(pattern);} -PFNGLSAMPLEMASKEXTPROC pglSampleMaskEXT=_Lazy_glSampleMaskEXT; -PFNGLSAMPLEPATTERNEXTPROC pglSamplePatternEXT=_Lazy_glSamplePatternEXT; -#endif - -/* GL_SGIX_vertex_preclip */ - -#ifdef __GLEE_GL_SGIX_vertex_preclip -#endif - -/* GL_SGIX_convolution_accuracy */ - -#ifdef __GLEE_GL_SGIX_convolution_accuracy -#endif - -/* GL_SGIX_resample */ - -#ifdef __GLEE_GL_SGIX_resample -#endif - -/* GL_SGIS_point_line_texgen */ - -#ifdef __GLEE_GL_SGIS_point_line_texgen -#endif - -/* GL_SGIS_texture_color_mask */ - -#ifdef __GLEE_GL_SGIS_texture_color_mask -void __stdcall _Lazy_glTextureColorMaskSGIS(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {if (GLeeInit()) glTextureColorMaskSGIS(red, green, blue, alpha);} -PFNGLTEXTURECOLORMASKSGISPROC pglTextureColorMaskSGIS=_Lazy_glTextureColorMaskSGIS; -#endif - -/* GL_EXT_texture_env_dot3 */ - -#ifdef __GLEE_GL_EXT_texture_env_dot3 -#endif - -/* GL_ATI_texture_mirror_once */ - -#ifdef __GLEE_GL_ATI_texture_mirror_once -#endif - -/* GL_NV_fence */ - -#ifdef __GLEE_GL_NV_fence -void __stdcall _Lazy_glDeleteFencesNV(GLsizei n, const GLuint * fences) {if (GLeeInit()) glDeleteFencesNV(n, fences);} -void __stdcall _Lazy_glGenFencesNV(GLsizei n, GLuint * fences) {if (GLeeInit()) glGenFencesNV(n, fences);} -GLboolean __stdcall _Lazy_glIsFenceNV(GLuint fence) {if (GLeeInit()) return glIsFenceNV(fence); return (GLboolean)0;} -GLboolean __stdcall _Lazy_glTestFenceNV(GLuint fence) {if (GLeeInit()) return glTestFenceNV(fence); return (GLboolean)0;} -void __stdcall _Lazy_glGetFenceivNV(GLuint fence, GLenum pname, GLint * params) {if (GLeeInit()) glGetFenceivNV(fence, pname, params);} -void __stdcall _Lazy_glFinishFenceNV(GLuint fence) {if (GLeeInit()) glFinishFenceNV(fence);} -void __stdcall _Lazy_glSetFenceNV(GLuint fence, GLenum condition) {if (GLeeInit()) glSetFenceNV(fence, condition);} -PFNGLDELETEFENCESNVPROC pglDeleteFencesNV=_Lazy_glDeleteFencesNV; -PFNGLGENFENCESNVPROC pglGenFencesNV=_Lazy_glGenFencesNV; -PFNGLISFENCENVPROC pglIsFenceNV=_Lazy_glIsFenceNV; -PFNGLTESTFENCENVPROC pglTestFenceNV=_Lazy_glTestFenceNV; -PFNGLGETFENCEIVNVPROC pglGetFenceivNV=_Lazy_glGetFenceivNV; -PFNGLFINISHFENCENVPROC pglFinishFenceNV=_Lazy_glFinishFenceNV; -PFNGLSETFENCENVPROC pglSetFenceNV=_Lazy_glSetFenceNV; -#endif - -/* GL_IBM_texture_mirrored_repeat */ - -#ifdef __GLEE_GL_IBM_texture_mirrored_repeat -#endif - -/* GL_NV_evaluators */ - -#ifdef __GLEE_GL_NV_evaluators -void __stdcall _Lazy_glMapControlPointsNV(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid * points) {if (GLeeInit()) glMapControlPointsNV(target, index, type, ustride, vstride, uorder, vorder, packed, points);} -void __stdcall _Lazy_glMapParameterivNV(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glMapParameterivNV(target, pname, params);} -void __stdcall _Lazy_glMapParameterfvNV(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glMapParameterfvNV(target, pname, params);} -void __stdcall _Lazy_glGetMapControlPointsNV(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid * points) {if (GLeeInit()) glGetMapControlPointsNV(target, index, type, ustride, vstride, packed, points);} -void __stdcall _Lazy_glGetMapParameterivNV(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMapParameterivNV(target, pname, params);} -void __stdcall _Lazy_glGetMapParameterfvNV(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMapParameterfvNV(target, pname, params);} -void __stdcall _Lazy_glGetMapAttribParameterivNV(GLenum target, GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetMapAttribParameterivNV(target, index, pname, params);} -void __stdcall _Lazy_glGetMapAttribParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMapAttribParameterfvNV(target, index, pname, params);} -void __stdcall _Lazy_glEvalMapsNV(GLenum target, GLenum mode) {if (GLeeInit()) glEvalMapsNV(target, mode);} -PFNGLMAPCONTROLPOINTSNVPROC pglMapControlPointsNV=_Lazy_glMapControlPointsNV; -PFNGLMAPPARAMETERIVNVPROC pglMapParameterivNV=_Lazy_glMapParameterivNV; -PFNGLMAPPARAMETERFVNVPROC pglMapParameterfvNV=_Lazy_glMapParameterfvNV; -PFNGLGETMAPCONTROLPOINTSNVPROC pglGetMapControlPointsNV=_Lazy_glGetMapControlPointsNV; -PFNGLGETMAPPARAMETERIVNVPROC pglGetMapParameterivNV=_Lazy_glGetMapParameterivNV; -PFNGLGETMAPPARAMETERFVNVPROC pglGetMapParameterfvNV=_Lazy_glGetMapParameterfvNV; -PFNGLGETMAPATTRIBPARAMETERIVNVPROC pglGetMapAttribParameterivNV=_Lazy_glGetMapAttribParameterivNV; -PFNGLGETMAPATTRIBPARAMETERFVNVPROC pglGetMapAttribParameterfvNV=_Lazy_glGetMapAttribParameterfvNV; -PFNGLEVALMAPSNVPROC pglEvalMapsNV=_Lazy_glEvalMapsNV; -#endif - -/* GL_NV_packed_depth_stencil */ - -#ifdef __GLEE_GL_NV_packed_depth_stencil -#endif - -/* GL_NV_register_combiners2 */ - -#ifdef __GLEE_GL_NV_register_combiners2 -void __stdcall _Lazy_glCombinerStageParameterfvNV(GLenum stage, GLenum pname, const GLfloat * params) {if (GLeeInit()) glCombinerStageParameterfvNV(stage, pname, params);} -void __stdcall _Lazy_glGetCombinerStageParameterfvNV(GLenum stage, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetCombinerStageParameterfvNV(stage, pname, params);} -PFNGLCOMBINERSTAGEPARAMETERFVNVPROC pglCombinerStageParameterfvNV=_Lazy_glCombinerStageParameterfvNV; -PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC pglGetCombinerStageParameterfvNV=_Lazy_glGetCombinerStageParameterfvNV; -#endif - -/* GL_NV_texture_compression_vtc */ - -#ifdef __GLEE_GL_NV_texture_compression_vtc -#endif - -/* GL_NV_texture_rectangle */ - -#ifdef __GLEE_GL_NV_texture_rectangle -#endif - -/* GL_NV_texture_shader */ - -#ifdef __GLEE_GL_NV_texture_shader -#endif - -/* GL_NV_texture_shader2 */ - -#ifdef __GLEE_GL_NV_texture_shader2 -#endif - -/* GL_NV_vertex_array_range2 */ - -#ifdef __GLEE_GL_NV_vertex_array_range2 -#endif - -/* GL_NV_vertex_program */ - -#ifdef __GLEE_GL_NV_vertex_program -GLboolean __stdcall _Lazy_glAreProgramsResidentNV(GLsizei n, const GLuint * programs, GLboolean * residences) {if (GLeeInit()) return glAreProgramsResidentNV(n, programs, residences); return (GLboolean)0;} -void __stdcall _Lazy_glBindProgramNV(GLenum target, GLuint id) {if (GLeeInit()) glBindProgramNV(target, id);} -void __stdcall _Lazy_glDeleteProgramsNV(GLsizei n, const GLuint * programs) {if (GLeeInit()) glDeleteProgramsNV(n, programs);} -void __stdcall _Lazy_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params) {if (GLeeInit()) glExecuteProgramNV(target, id, params);} -void __stdcall _Lazy_glGenProgramsNV(GLsizei n, GLuint * programs) {if (GLeeInit()) glGenProgramsNV(n, programs);} -void __stdcall _Lazy_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetProgramParameterdvNV(target, index, pname, params);} -void __stdcall _Lazy_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetProgramParameterfvNV(target, index, pname, params);} -void __stdcall _Lazy_glGetProgramivNV(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetProgramivNV(id, pname, params);} -void __stdcall _Lazy_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program) {if (GLeeInit()) glGetProgramStringNV(id, pname, program);} -void __stdcall _Lazy_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params) {if (GLeeInit()) glGetTrackMatrixivNV(target, address, pname, params);} -void __stdcall _Lazy_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetVertexAttribdvNV(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVertexAttribfvNV(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribivNV(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid* * pointer) {if (GLeeInit()) glGetVertexAttribPointervNV(index, pname, pointer);} -GLboolean __stdcall _Lazy_glIsProgramNV(GLuint id) {if (GLeeInit()) return glIsProgramNV(id); return (GLboolean)0;} -void __stdcall _Lazy_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program) {if (GLeeInit()) glLoadProgramNV(target, id, len, program);} -void __stdcall _Lazy_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glProgramParameter4dNV(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble * v) {if (GLeeInit()) glProgramParameter4dvNV(target, index, v);} -void __stdcall _Lazy_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glProgramParameter4fNV(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat * v) {if (GLeeInit()) glProgramParameter4fvNV(target, index, v);} -void __stdcall _Lazy_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint count, const GLdouble * v) {if (GLeeInit()) glProgramParameters4dvNV(target, index, count, v);} -void __stdcall _Lazy_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint count, const GLfloat * v) {if (GLeeInit()) glProgramParameters4fvNV(target, index, count, v);} -void __stdcall _Lazy_glRequestResidentProgramsNV(GLsizei n, const GLuint * programs) {if (GLeeInit()) glRequestResidentProgramsNV(n, programs);} -void __stdcall _Lazy_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform) {if (GLeeInit()) glTrackMatrixNV(target, address, matrix, transform);} -void __stdcall _Lazy_glVertexAttribPointerNV(GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribPointerNV(index, fsize, type, stride, pointer);} -void __stdcall _Lazy_glVertexAttrib1dNV(GLuint index, GLdouble x) {if (GLeeInit()) glVertexAttrib1dNV(index, x);} -void __stdcall _Lazy_glVertexAttrib1dvNV(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib1dvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib1fNV(GLuint index, GLfloat x) {if (GLeeInit()) glVertexAttrib1fNV(index, x);} -void __stdcall _Lazy_glVertexAttrib1fvNV(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib1fvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib1sNV(GLuint index, GLshort x) {if (GLeeInit()) glVertexAttrib1sNV(index, x);} -void __stdcall _Lazy_glVertexAttrib1svNV(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib1svNV(index, v);} -void __stdcall _Lazy_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y) {if (GLeeInit()) glVertexAttrib2dNV(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2dvNV(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib2dvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) {if (GLeeInit()) glVertexAttrib2fNV(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2fvNV(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib2fvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y) {if (GLeeInit()) glVertexAttrib2sNV(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2svNV(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib2svNV(index, v);} -void __stdcall _Lazy_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glVertexAttrib3dNV(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3dvNV(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib3dvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glVertexAttrib3fNV(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3fvNV(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib3fvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glVertexAttrib3sNV(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3svNV(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib3svNV(index, v);} -void __stdcall _Lazy_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glVertexAttrib4dNV(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4dvNV(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib4dvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glVertexAttrib4fNV(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4fvNV(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib4fvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glVertexAttrib4sNV(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4svNV(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4svNV(index, v);} -void __stdcall _Lazy_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) {if (GLeeInit()) glVertexAttrib4ubNV(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4ubvNV(index, v);} -void __stdcall _Lazy_glVertexAttribs1dvNV(GLuint index, GLsizei count, const GLdouble * v) {if (GLeeInit()) glVertexAttribs1dvNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs1fvNV(GLuint index, GLsizei count, const GLfloat * v) {if (GLeeInit()) glVertexAttribs1fvNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs1svNV(GLuint index, GLsizei count, const GLshort * v) {if (GLeeInit()) glVertexAttribs1svNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs2dvNV(GLuint index, GLsizei count, const GLdouble * v) {if (GLeeInit()) glVertexAttribs2dvNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs2fvNV(GLuint index, GLsizei count, const GLfloat * v) {if (GLeeInit()) glVertexAttribs2fvNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs2svNV(GLuint index, GLsizei count, const GLshort * v) {if (GLeeInit()) glVertexAttribs2svNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs3dvNV(GLuint index, GLsizei count, const GLdouble * v) {if (GLeeInit()) glVertexAttribs3dvNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs3fvNV(GLuint index, GLsizei count, const GLfloat * v) {if (GLeeInit()) glVertexAttribs3fvNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs3svNV(GLuint index, GLsizei count, const GLshort * v) {if (GLeeInit()) glVertexAttribs3svNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs4dvNV(GLuint index, GLsizei count, const GLdouble * v) {if (GLeeInit()) glVertexAttribs4dvNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs4fvNV(GLuint index, GLsizei count, const GLfloat * v) {if (GLeeInit()) glVertexAttribs4fvNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs4svNV(GLuint index, GLsizei count, const GLshort * v) {if (GLeeInit()) glVertexAttribs4svNV(index, count, v);} -void __stdcall _Lazy_glVertexAttribs4ubvNV(GLuint index, GLsizei count, const GLubyte * v) {if (GLeeInit()) glVertexAttribs4ubvNV(index, count, v);} -PFNGLAREPROGRAMSRESIDENTNVPROC pglAreProgramsResidentNV=_Lazy_glAreProgramsResidentNV; -PFNGLBINDPROGRAMNVPROC pglBindProgramNV=_Lazy_glBindProgramNV; -PFNGLDELETEPROGRAMSNVPROC pglDeleteProgramsNV=_Lazy_glDeleteProgramsNV; -PFNGLEXECUTEPROGRAMNVPROC pglExecuteProgramNV=_Lazy_glExecuteProgramNV; -PFNGLGENPROGRAMSNVPROC pglGenProgramsNV=_Lazy_glGenProgramsNV; -PFNGLGETPROGRAMPARAMETERDVNVPROC pglGetProgramParameterdvNV=_Lazy_glGetProgramParameterdvNV; -PFNGLGETPROGRAMPARAMETERFVNVPROC pglGetProgramParameterfvNV=_Lazy_glGetProgramParameterfvNV; -PFNGLGETPROGRAMIVNVPROC pglGetProgramivNV=_Lazy_glGetProgramivNV; -PFNGLGETPROGRAMSTRINGNVPROC pglGetProgramStringNV=_Lazy_glGetProgramStringNV; -PFNGLGETTRACKMATRIXIVNVPROC pglGetTrackMatrixivNV=_Lazy_glGetTrackMatrixivNV; -PFNGLGETVERTEXATTRIBDVNVPROC pglGetVertexAttribdvNV=_Lazy_glGetVertexAttribdvNV; -PFNGLGETVERTEXATTRIBFVNVPROC pglGetVertexAttribfvNV=_Lazy_glGetVertexAttribfvNV; -PFNGLGETVERTEXATTRIBIVNVPROC pglGetVertexAttribivNV=_Lazy_glGetVertexAttribivNV; -PFNGLGETVERTEXATTRIBPOINTERVNVPROC pglGetVertexAttribPointervNV=_Lazy_glGetVertexAttribPointervNV; -PFNGLISPROGRAMNVPROC pglIsProgramNV=_Lazy_glIsProgramNV; -PFNGLLOADPROGRAMNVPROC pglLoadProgramNV=_Lazy_glLoadProgramNV; -PFNGLPROGRAMPARAMETER4DNVPROC pglProgramParameter4dNV=_Lazy_glProgramParameter4dNV; -PFNGLPROGRAMPARAMETER4DVNVPROC pglProgramParameter4dvNV=_Lazy_glProgramParameter4dvNV; -PFNGLPROGRAMPARAMETER4FNVPROC pglProgramParameter4fNV=_Lazy_glProgramParameter4fNV; -PFNGLPROGRAMPARAMETER4FVNVPROC pglProgramParameter4fvNV=_Lazy_glProgramParameter4fvNV; -PFNGLPROGRAMPARAMETERS4DVNVPROC pglProgramParameters4dvNV=_Lazy_glProgramParameters4dvNV; -PFNGLPROGRAMPARAMETERS4FVNVPROC pglProgramParameters4fvNV=_Lazy_glProgramParameters4fvNV; -PFNGLREQUESTRESIDENTPROGRAMSNVPROC pglRequestResidentProgramsNV=_Lazy_glRequestResidentProgramsNV; -PFNGLTRACKMATRIXNVPROC pglTrackMatrixNV=_Lazy_glTrackMatrixNV; -PFNGLVERTEXATTRIBPOINTERNVPROC pglVertexAttribPointerNV=_Lazy_glVertexAttribPointerNV; -PFNGLVERTEXATTRIB1DNVPROC pglVertexAttrib1dNV=_Lazy_glVertexAttrib1dNV; -PFNGLVERTEXATTRIB1DVNVPROC pglVertexAttrib1dvNV=_Lazy_glVertexAttrib1dvNV; -PFNGLVERTEXATTRIB1FNVPROC pglVertexAttrib1fNV=_Lazy_glVertexAttrib1fNV; -PFNGLVERTEXATTRIB1FVNVPROC pglVertexAttrib1fvNV=_Lazy_glVertexAttrib1fvNV; -PFNGLVERTEXATTRIB1SNVPROC pglVertexAttrib1sNV=_Lazy_glVertexAttrib1sNV; -PFNGLVERTEXATTRIB1SVNVPROC pglVertexAttrib1svNV=_Lazy_glVertexAttrib1svNV; -PFNGLVERTEXATTRIB2DNVPROC pglVertexAttrib2dNV=_Lazy_glVertexAttrib2dNV; -PFNGLVERTEXATTRIB2DVNVPROC pglVertexAttrib2dvNV=_Lazy_glVertexAttrib2dvNV; -PFNGLVERTEXATTRIB2FNVPROC pglVertexAttrib2fNV=_Lazy_glVertexAttrib2fNV; -PFNGLVERTEXATTRIB2FVNVPROC pglVertexAttrib2fvNV=_Lazy_glVertexAttrib2fvNV; -PFNGLVERTEXATTRIB2SNVPROC pglVertexAttrib2sNV=_Lazy_glVertexAttrib2sNV; -PFNGLVERTEXATTRIB2SVNVPROC pglVertexAttrib2svNV=_Lazy_glVertexAttrib2svNV; -PFNGLVERTEXATTRIB3DNVPROC pglVertexAttrib3dNV=_Lazy_glVertexAttrib3dNV; -PFNGLVERTEXATTRIB3DVNVPROC pglVertexAttrib3dvNV=_Lazy_glVertexAttrib3dvNV; -PFNGLVERTEXATTRIB3FNVPROC pglVertexAttrib3fNV=_Lazy_glVertexAttrib3fNV; -PFNGLVERTEXATTRIB3FVNVPROC pglVertexAttrib3fvNV=_Lazy_glVertexAttrib3fvNV; -PFNGLVERTEXATTRIB3SNVPROC pglVertexAttrib3sNV=_Lazy_glVertexAttrib3sNV; -PFNGLVERTEXATTRIB3SVNVPROC pglVertexAttrib3svNV=_Lazy_glVertexAttrib3svNV; -PFNGLVERTEXATTRIB4DNVPROC pglVertexAttrib4dNV=_Lazy_glVertexAttrib4dNV; -PFNGLVERTEXATTRIB4DVNVPROC pglVertexAttrib4dvNV=_Lazy_glVertexAttrib4dvNV; -PFNGLVERTEXATTRIB4FNVPROC pglVertexAttrib4fNV=_Lazy_glVertexAttrib4fNV; -PFNGLVERTEXATTRIB4FVNVPROC pglVertexAttrib4fvNV=_Lazy_glVertexAttrib4fvNV; -PFNGLVERTEXATTRIB4SNVPROC pglVertexAttrib4sNV=_Lazy_glVertexAttrib4sNV; -PFNGLVERTEXATTRIB4SVNVPROC pglVertexAttrib4svNV=_Lazy_glVertexAttrib4svNV; -PFNGLVERTEXATTRIB4UBNVPROC pglVertexAttrib4ubNV=_Lazy_glVertexAttrib4ubNV; -PFNGLVERTEXATTRIB4UBVNVPROC pglVertexAttrib4ubvNV=_Lazy_glVertexAttrib4ubvNV; -PFNGLVERTEXATTRIBS1DVNVPROC pglVertexAttribs1dvNV=_Lazy_glVertexAttribs1dvNV; -PFNGLVERTEXATTRIBS1FVNVPROC pglVertexAttribs1fvNV=_Lazy_glVertexAttribs1fvNV; -PFNGLVERTEXATTRIBS1SVNVPROC pglVertexAttribs1svNV=_Lazy_glVertexAttribs1svNV; -PFNGLVERTEXATTRIBS2DVNVPROC pglVertexAttribs2dvNV=_Lazy_glVertexAttribs2dvNV; -PFNGLVERTEXATTRIBS2FVNVPROC pglVertexAttribs2fvNV=_Lazy_glVertexAttribs2fvNV; -PFNGLVERTEXATTRIBS2SVNVPROC pglVertexAttribs2svNV=_Lazy_glVertexAttribs2svNV; -PFNGLVERTEXATTRIBS3DVNVPROC pglVertexAttribs3dvNV=_Lazy_glVertexAttribs3dvNV; -PFNGLVERTEXATTRIBS3FVNVPROC pglVertexAttribs3fvNV=_Lazy_glVertexAttribs3fvNV; -PFNGLVERTEXATTRIBS3SVNVPROC pglVertexAttribs3svNV=_Lazy_glVertexAttribs3svNV; -PFNGLVERTEXATTRIBS4DVNVPROC pglVertexAttribs4dvNV=_Lazy_glVertexAttribs4dvNV; -PFNGLVERTEXATTRIBS4FVNVPROC pglVertexAttribs4fvNV=_Lazy_glVertexAttribs4fvNV; -PFNGLVERTEXATTRIBS4SVNVPROC pglVertexAttribs4svNV=_Lazy_glVertexAttribs4svNV; -PFNGLVERTEXATTRIBS4UBVNVPROC pglVertexAttribs4ubvNV=_Lazy_glVertexAttribs4ubvNV; -#endif - -/* GL_SGIX_texture_coordinate_clamp */ - -#ifdef __GLEE_GL_SGIX_texture_coordinate_clamp -#endif - -/* GL_SGIX_scalebias_hint */ - -#ifdef __GLEE_GL_SGIX_scalebias_hint -#endif - -/* GL_OML_interlace */ - -#ifdef __GLEE_GL_OML_interlace -#endif - -/* GL_OML_subsample */ - -#ifdef __GLEE_GL_OML_subsample -#endif - -/* GL_OML_resample */ - -#ifdef __GLEE_GL_OML_resample -#endif - -/* GL_NV_copy_depth_to_color */ - -#ifdef __GLEE_GL_NV_copy_depth_to_color -#endif - -/* GL_ATI_envmap_bumpmap */ - -#ifdef __GLEE_GL_ATI_envmap_bumpmap -void __stdcall _Lazy_glTexBumpParameterivATI(GLenum pname, const GLint * param) {if (GLeeInit()) glTexBumpParameterivATI(pname, param);} -void __stdcall _Lazy_glTexBumpParameterfvATI(GLenum pname, const GLfloat * param) {if (GLeeInit()) glTexBumpParameterfvATI(pname, param);} -void __stdcall _Lazy_glGetTexBumpParameterivATI(GLenum pname, GLint * param) {if (GLeeInit()) glGetTexBumpParameterivATI(pname, param);} -void __stdcall _Lazy_glGetTexBumpParameterfvATI(GLenum pname, GLfloat * param) {if (GLeeInit()) glGetTexBumpParameterfvATI(pname, param);} -PFNGLTEXBUMPPARAMETERIVATIPROC pglTexBumpParameterivATI=_Lazy_glTexBumpParameterivATI; -PFNGLTEXBUMPPARAMETERFVATIPROC pglTexBumpParameterfvATI=_Lazy_glTexBumpParameterfvATI; -PFNGLGETTEXBUMPPARAMETERIVATIPROC pglGetTexBumpParameterivATI=_Lazy_glGetTexBumpParameterivATI; -PFNGLGETTEXBUMPPARAMETERFVATIPROC pglGetTexBumpParameterfvATI=_Lazy_glGetTexBumpParameterfvATI; -#endif - -/* GL_ATI_fragment_shader */ - -#ifdef __GLEE_GL_ATI_fragment_shader -GLuint __stdcall _Lazy_glGenFragmentShadersATI(GLuint range) {if (GLeeInit()) return glGenFragmentShadersATI(range); return (GLuint)0;} -void __stdcall _Lazy_glBindFragmentShaderATI(GLuint id) {if (GLeeInit()) glBindFragmentShaderATI(id);} -void __stdcall _Lazy_glDeleteFragmentShaderATI(GLuint id) {if (GLeeInit()) glDeleteFragmentShaderATI(id);} -void __stdcall _Lazy_glBeginFragmentShaderATI(void) {if (GLeeInit()) glBeginFragmentShaderATI();} -void __stdcall _Lazy_glEndFragmentShaderATI(void) {if (GLeeInit()) glEndFragmentShaderATI();} -void __stdcall _Lazy_glPassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle) {if (GLeeInit()) glPassTexCoordATI(dst, coord, swizzle);} -void __stdcall _Lazy_glSampleMapATI(GLuint dst, GLuint interp, GLenum swizzle) {if (GLeeInit()) glSampleMapATI(dst, interp, swizzle);} -void __stdcall _Lazy_glColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) {if (GLeeInit()) glColorFragmentOp1ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod);} -void __stdcall _Lazy_glColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) {if (GLeeInit()) glColorFragmentOp2ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod);} -void __stdcall _Lazy_glColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) {if (GLeeInit()) glColorFragmentOp3ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod);} -void __stdcall _Lazy_glAlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) {if (GLeeInit()) glAlphaFragmentOp1ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod);} -void __stdcall _Lazy_glAlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) {if (GLeeInit()) glAlphaFragmentOp2ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod);} -void __stdcall _Lazy_glAlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) {if (GLeeInit()) glAlphaFragmentOp3ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod);} -void __stdcall _Lazy_glSetFragmentShaderConstantATI(GLuint dst, const GLfloat * value) {if (GLeeInit()) glSetFragmentShaderConstantATI(dst, value);} -PFNGLGENFRAGMENTSHADERSATIPROC pglGenFragmentShadersATI=_Lazy_glGenFragmentShadersATI; -PFNGLBINDFRAGMENTSHADERATIPROC pglBindFragmentShaderATI=_Lazy_glBindFragmentShaderATI; -PFNGLDELETEFRAGMENTSHADERATIPROC pglDeleteFragmentShaderATI=_Lazy_glDeleteFragmentShaderATI; -PFNGLBEGINFRAGMENTSHADERATIPROC pglBeginFragmentShaderATI=_Lazy_glBeginFragmentShaderATI; -PFNGLENDFRAGMENTSHADERATIPROC pglEndFragmentShaderATI=_Lazy_glEndFragmentShaderATI; -PFNGLPASSTEXCOORDATIPROC pglPassTexCoordATI=_Lazy_glPassTexCoordATI; -PFNGLSAMPLEMAPATIPROC pglSampleMapATI=_Lazy_glSampleMapATI; -PFNGLCOLORFRAGMENTOP1ATIPROC pglColorFragmentOp1ATI=_Lazy_glColorFragmentOp1ATI; -PFNGLCOLORFRAGMENTOP2ATIPROC pglColorFragmentOp2ATI=_Lazy_glColorFragmentOp2ATI; -PFNGLCOLORFRAGMENTOP3ATIPROC pglColorFragmentOp3ATI=_Lazy_glColorFragmentOp3ATI; -PFNGLALPHAFRAGMENTOP1ATIPROC pglAlphaFragmentOp1ATI=_Lazy_glAlphaFragmentOp1ATI; -PFNGLALPHAFRAGMENTOP2ATIPROC pglAlphaFragmentOp2ATI=_Lazy_glAlphaFragmentOp2ATI; -PFNGLALPHAFRAGMENTOP3ATIPROC pglAlphaFragmentOp3ATI=_Lazy_glAlphaFragmentOp3ATI; -PFNGLSETFRAGMENTSHADERCONSTANTATIPROC pglSetFragmentShaderConstantATI=_Lazy_glSetFragmentShaderConstantATI; -#endif - -/* GL_ATI_pn_triangles */ - -#ifdef __GLEE_GL_ATI_pn_triangles -void __stdcall _Lazy_glPNTrianglesiATI(GLenum pname, GLint param) {if (GLeeInit()) glPNTrianglesiATI(pname, param);} -void __stdcall _Lazy_glPNTrianglesfATI(GLenum pname, GLfloat param) {if (GLeeInit()) glPNTrianglesfATI(pname, param);} -PFNGLPNTRIANGLESIATIPROC pglPNTrianglesiATI=_Lazy_glPNTrianglesiATI; -PFNGLPNTRIANGLESFATIPROC pglPNTrianglesfATI=_Lazy_glPNTrianglesfATI; -#endif - -/* GL_ATI_vertex_array_object */ - -#ifdef __GLEE_GL_ATI_vertex_array_object -GLuint __stdcall _Lazy_glNewObjectBufferATI(GLsizei size, const GLvoid * pointer, GLenum usage) {if (GLeeInit()) return glNewObjectBufferATI(size, pointer, usage); return (GLuint)0;} -GLboolean __stdcall _Lazy_glIsObjectBufferATI(GLuint buffer) {if (GLeeInit()) return glIsObjectBufferATI(buffer); return (GLboolean)0;} -void __stdcall _Lazy_glUpdateObjectBufferATI(GLuint buffer, GLuint offset, GLsizei size, const GLvoid * pointer, GLenum preserve) {if (GLeeInit()) glUpdateObjectBufferATI(buffer, offset, size, pointer, preserve);} -void __stdcall _Lazy_glGetObjectBufferfvATI(GLuint buffer, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetObjectBufferfvATI(buffer, pname, params);} -void __stdcall _Lazy_glGetObjectBufferivATI(GLuint buffer, GLenum pname, GLint * params) {if (GLeeInit()) glGetObjectBufferivATI(buffer, pname, params);} -void __stdcall _Lazy_glFreeObjectBufferATI(GLuint buffer) {if (GLeeInit()) glFreeObjectBufferATI(buffer);} -void __stdcall _Lazy_glArrayObjectATI(GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) {if (GLeeInit()) glArrayObjectATI(array, size, type, stride, buffer, offset);} -void __stdcall _Lazy_glGetArrayObjectfvATI(GLenum array, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetArrayObjectfvATI(array, pname, params);} -void __stdcall _Lazy_glGetArrayObjectivATI(GLenum array, GLenum pname, GLint * params) {if (GLeeInit()) glGetArrayObjectivATI(array, pname, params);} -void __stdcall _Lazy_glVariantArrayObjectATI(GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) {if (GLeeInit()) glVariantArrayObjectATI(id, type, stride, buffer, offset);} -void __stdcall _Lazy_glGetVariantArrayObjectfvATI(GLuint id, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVariantArrayObjectfvATI(id, pname, params);} -void __stdcall _Lazy_glGetVariantArrayObjectivATI(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetVariantArrayObjectivATI(id, pname, params);} -PFNGLNEWOBJECTBUFFERATIPROC pglNewObjectBufferATI=_Lazy_glNewObjectBufferATI; -PFNGLISOBJECTBUFFERATIPROC pglIsObjectBufferATI=_Lazy_glIsObjectBufferATI; -PFNGLUPDATEOBJECTBUFFERATIPROC pglUpdateObjectBufferATI=_Lazy_glUpdateObjectBufferATI; -PFNGLGETOBJECTBUFFERFVATIPROC pglGetObjectBufferfvATI=_Lazy_glGetObjectBufferfvATI; -PFNGLGETOBJECTBUFFERIVATIPROC pglGetObjectBufferivATI=_Lazy_glGetObjectBufferivATI; -PFNGLFREEOBJECTBUFFERATIPROC pglFreeObjectBufferATI=_Lazy_glFreeObjectBufferATI; -PFNGLARRAYOBJECTATIPROC pglArrayObjectATI=_Lazy_glArrayObjectATI; -PFNGLGETARRAYOBJECTFVATIPROC pglGetArrayObjectfvATI=_Lazy_glGetArrayObjectfvATI; -PFNGLGETARRAYOBJECTIVATIPROC pglGetArrayObjectivATI=_Lazy_glGetArrayObjectivATI; -PFNGLVARIANTARRAYOBJECTATIPROC pglVariantArrayObjectATI=_Lazy_glVariantArrayObjectATI; -PFNGLGETVARIANTARRAYOBJECTFVATIPROC pglGetVariantArrayObjectfvATI=_Lazy_glGetVariantArrayObjectfvATI; -PFNGLGETVARIANTARRAYOBJECTIVATIPROC pglGetVariantArrayObjectivATI=_Lazy_glGetVariantArrayObjectivATI; -#endif - -/* GL_EXT_vertex_shader */ - -#ifdef __GLEE_GL_EXT_vertex_shader -void __stdcall _Lazy_glBeginVertexShaderEXT(void) {if (GLeeInit()) glBeginVertexShaderEXT();} -void __stdcall _Lazy_glEndVertexShaderEXT(void) {if (GLeeInit()) glEndVertexShaderEXT();} -void __stdcall _Lazy_glBindVertexShaderEXT(GLuint id) {if (GLeeInit()) glBindVertexShaderEXT(id);} -GLuint __stdcall _Lazy_glGenVertexShadersEXT(GLuint range) {if (GLeeInit()) return glGenVertexShadersEXT(range); return (GLuint)0;} -void __stdcall _Lazy_glDeleteVertexShaderEXT(GLuint id) {if (GLeeInit()) glDeleteVertexShaderEXT(id);} -void __stdcall _Lazy_glShaderOp1EXT(GLenum op, GLuint res, GLuint arg1) {if (GLeeInit()) glShaderOp1EXT(op, res, arg1);} -void __stdcall _Lazy_glShaderOp2EXT(GLenum op, GLuint res, GLuint arg1, GLuint arg2) {if (GLeeInit()) glShaderOp2EXT(op, res, arg1, arg2);} -void __stdcall _Lazy_glShaderOp3EXT(GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3) {if (GLeeInit()) glShaderOp3EXT(op, res, arg1, arg2, arg3);} -void __stdcall _Lazy_glSwizzleEXT(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) {if (GLeeInit()) glSwizzleEXT(res, in, outX, outY, outZ, outW);} -void __stdcall _Lazy_glWriteMaskEXT(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) {if (GLeeInit()) glWriteMaskEXT(res, in, outX, outY, outZ, outW);} -void __stdcall _Lazy_glInsertComponentEXT(GLuint res, GLuint src, GLuint num) {if (GLeeInit()) glInsertComponentEXT(res, src, num);} -void __stdcall _Lazy_glExtractComponentEXT(GLuint res, GLuint src, GLuint num) {if (GLeeInit()) glExtractComponentEXT(res, src, num);} -GLuint __stdcall _Lazy_glGenSymbolsEXT(GLenum datatype, GLenum storagetype, GLenum range, GLuint components) {if (GLeeInit()) return glGenSymbolsEXT(datatype, storagetype, range, components); return (GLuint)0;} -void __stdcall _Lazy_glSetInvariantEXT(GLuint id, GLenum type, const GLvoid * addr) {if (GLeeInit()) glSetInvariantEXT(id, type, addr);} -void __stdcall _Lazy_glSetLocalConstantEXT(GLuint id, GLenum type, const GLvoid * addr) {if (GLeeInit()) glSetLocalConstantEXT(id, type, addr);} -void __stdcall _Lazy_glVariantbvEXT(GLuint id, const GLbyte * addr) {if (GLeeInit()) glVariantbvEXT(id, addr);} -void __stdcall _Lazy_glVariantsvEXT(GLuint id, const GLshort * addr) {if (GLeeInit()) glVariantsvEXT(id, addr);} -void __stdcall _Lazy_glVariantivEXT(GLuint id, const GLint * addr) {if (GLeeInit()) glVariantivEXT(id, addr);} -void __stdcall _Lazy_glVariantfvEXT(GLuint id, const GLfloat * addr) {if (GLeeInit()) glVariantfvEXT(id, addr);} -void __stdcall _Lazy_glVariantdvEXT(GLuint id, const GLdouble * addr) {if (GLeeInit()) glVariantdvEXT(id, addr);} -void __stdcall _Lazy_glVariantubvEXT(GLuint id, const GLubyte * addr) {if (GLeeInit()) glVariantubvEXT(id, addr);} -void __stdcall _Lazy_glVariantusvEXT(GLuint id, const GLushort * addr) {if (GLeeInit()) glVariantusvEXT(id, addr);} -void __stdcall _Lazy_glVariantuivEXT(GLuint id, const GLuint * addr) {if (GLeeInit()) glVariantuivEXT(id, addr);} -void __stdcall _Lazy_glVariantPointerEXT(GLuint id, GLenum type, GLuint stride, const GLvoid * addr) {if (GLeeInit()) glVariantPointerEXT(id, type, stride, addr);} -void __stdcall _Lazy_glEnableVariantClientStateEXT(GLuint id) {if (GLeeInit()) glEnableVariantClientStateEXT(id);} -void __stdcall _Lazy_glDisableVariantClientStateEXT(GLuint id) {if (GLeeInit()) glDisableVariantClientStateEXT(id);} -GLuint __stdcall _Lazy_glBindLightParameterEXT(GLenum light, GLenum value) {if (GLeeInit()) return glBindLightParameterEXT(light, value); return (GLuint)0;} -GLuint __stdcall _Lazy_glBindMaterialParameterEXT(GLenum face, GLenum value) {if (GLeeInit()) return glBindMaterialParameterEXT(face, value); return (GLuint)0;} -GLuint __stdcall _Lazy_glBindTexGenParameterEXT(GLenum unit, GLenum coord, GLenum value) {if (GLeeInit()) return glBindTexGenParameterEXT(unit, coord, value); return (GLuint)0;} -GLuint __stdcall _Lazy_glBindTextureUnitParameterEXT(GLenum unit, GLenum value) {if (GLeeInit()) return glBindTextureUnitParameterEXT(unit, value); return (GLuint)0;} -GLuint __stdcall _Lazy_glBindParameterEXT(GLenum value) {if (GLeeInit()) return glBindParameterEXT(value); return (GLuint)0;} -GLboolean __stdcall _Lazy_glIsVariantEnabledEXT(GLuint id, GLenum cap) {if (GLeeInit()) return glIsVariantEnabledEXT(id, cap); return (GLboolean)0;} -void __stdcall _Lazy_glGetVariantBooleanvEXT(GLuint id, GLenum value, GLboolean * data) {if (GLeeInit()) glGetVariantBooleanvEXT(id, value, data);} -void __stdcall _Lazy_glGetVariantIntegervEXT(GLuint id, GLenum value, GLint * data) {if (GLeeInit()) glGetVariantIntegervEXT(id, value, data);} -void __stdcall _Lazy_glGetVariantFloatvEXT(GLuint id, GLenum value, GLfloat * data) {if (GLeeInit()) glGetVariantFloatvEXT(id, value, data);} -void __stdcall _Lazy_glGetVariantPointervEXT(GLuint id, GLenum value, GLvoid* * data) {if (GLeeInit()) glGetVariantPointervEXT(id, value, data);} -void __stdcall _Lazy_glGetInvariantBooleanvEXT(GLuint id, GLenum value, GLboolean * data) {if (GLeeInit()) glGetInvariantBooleanvEXT(id, value, data);} -void __stdcall _Lazy_glGetInvariantIntegervEXT(GLuint id, GLenum value, GLint * data) {if (GLeeInit()) glGetInvariantIntegervEXT(id, value, data);} -void __stdcall _Lazy_glGetInvariantFloatvEXT(GLuint id, GLenum value, GLfloat * data) {if (GLeeInit()) glGetInvariantFloatvEXT(id, value, data);} -void __stdcall _Lazy_glGetLocalConstantBooleanvEXT(GLuint id, GLenum value, GLboolean * data) {if (GLeeInit()) glGetLocalConstantBooleanvEXT(id, value, data);} -void __stdcall _Lazy_glGetLocalConstantIntegervEXT(GLuint id, GLenum value, GLint * data) {if (GLeeInit()) glGetLocalConstantIntegervEXT(id, value, data);} -void __stdcall _Lazy_glGetLocalConstantFloatvEXT(GLuint id, GLenum value, GLfloat * data) {if (GLeeInit()) glGetLocalConstantFloatvEXT(id, value, data);} -PFNGLBEGINVERTEXSHADEREXTPROC pglBeginVertexShaderEXT=_Lazy_glBeginVertexShaderEXT; -PFNGLENDVERTEXSHADEREXTPROC pglEndVertexShaderEXT=_Lazy_glEndVertexShaderEXT; -PFNGLBINDVERTEXSHADEREXTPROC pglBindVertexShaderEXT=_Lazy_glBindVertexShaderEXT; -PFNGLGENVERTEXSHADERSEXTPROC pglGenVertexShadersEXT=_Lazy_glGenVertexShadersEXT; -PFNGLDELETEVERTEXSHADEREXTPROC pglDeleteVertexShaderEXT=_Lazy_glDeleteVertexShaderEXT; -PFNGLSHADEROP1EXTPROC pglShaderOp1EXT=_Lazy_glShaderOp1EXT; -PFNGLSHADEROP2EXTPROC pglShaderOp2EXT=_Lazy_glShaderOp2EXT; -PFNGLSHADEROP3EXTPROC pglShaderOp3EXT=_Lazy_glShaderOp3EXT; -PFNGLSWIZZLEEXTPROC pglSwizzleEXT=_Lazy_glSwizzleEXT; -PFNGLWRITEMASKEXTPROC pglWriteMaskEXT=_Lazy_glWriteMaskEXT; -PFNGLINSERTCOMPONENTEXTPROC pglInsertComponentEXT=_Lazy_glInsertComponentEXT; -PFNGLEXTRACTCOMPONENTEXTPROC pglExtractComponentEXT=_Lazy_glExtractComponentEXT; -PFNGLGENSYMBOLSEXTPROC pglGenSymbolsEXT=_Lazy_glGenSymbolsEXT; -PFNGLSETINVARIANTEXTPROC pglSetInvariantEXT=_Lazy_glSetInvariantEXT; -PFNGLSETLOCALCONSTANTEXTPROC pglSetLocalConstantEXT=_Lazy_glSetLocalConstantEXT; -PFNGLVARIANTBVEXTPROC pglVariantbvEXT=_Lazy_glVariantbvEXT; -PFNGLVARIANTSVEXTPROC pglVariantsvEXT=_Lazy_glVariantsvEXT; -PFNGLVARIANTIVEXTPROC pglVariantivEXT=_Lazy_glVariantivEXT; -PFNGLVARIANTFVEXTPROC pglVariantfvEXT=_Lazy_glVariantfvEXT; -PFNGLVARIANTDVEXTPROC pglVariantdvEXT=_Lazy_glVariantdvEXT; -PFNGLVARIANTUBVEXTPROC pglVariantubvEXT=_Lazy_glVariantubvEXT; -PFNGLVARIANTUSVEXTPROC pglVariantusvEXT=_Lazy_glVariantusvEXT; -PFNGLVARIANTUIVEXTPROC pglVariantuivEXT=_Lazy_glVariantuivEXT; -PFNGLVARIANTPOINTEREXTPROC pglVariantPointerEXT=_Lazy_glVariantPointerEXT; -PFNGLENABLEVARIANTCLIENTSTATEEXTPROC pglEnableVariantClientStateEXT=_Lazy_glEnableVariantClientStateEXT; -PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC pglDisableVariantClientStateEXT=_Lazy_glDisableVariantClientStateEXT; -PFNGLBINDLIGHTPARAMETEREXTPROC pglBindLightParameterEXT=_Lazy_glBindLightParameterEXT; -PFNGLBINDMATERIALPARAMETEREXTPROC pglBindMaterialParameterEXT=_Lazy_glBindMaterialParameterEXT; -PFNGLBINDTEXGENPARAMETEREXTPROC pglBindTexGenParameterEXT=_Lazy_glBindTexGenParameterEXT; -PFNGLBINDTEXTUREUNITPARAMETEREXTPROC pglBindTextureUnitParameterEXT=_Lazy_glBindTextureUnitParameterEXT; -PFNGLBINDPARAMETEREXTPROC pglBindParameterEXT=_Lazy_glBindParameterEXT; -PFNGLISVARIANTENABLEDEXTPROC pglIsVariantEnabledEXT=_Lazy_glIsVariantEnabledEXT; -PFNGLGETVARIANTBOOLEANVEXTPROC pglGetVariantBooleanvEXT=_Lazy_glGetVariantBooleanvEXT; -PFNGLGETVARIANTINTEGERVEXTPROC pglGetVariantIntegervEXT=_Lazy_glGetVariantIntegervEXT; -PFNGLGETVARIANTFLOATVEXTPROC pglGetVariantFloatvEXT=_Lazy_glGetVariantFloatvEXT; -PFNGLGETVARIANTPOINTERVEXTPROC pglGetVariantPointervEXT=_Lazy_glGetVariantPointervEXT; -PFNGLGETINVARIANTBOOLEANVEXTPROC pglGetInvariantBooleanvEXT=_Lazy_glGetInvariantBooleanvEXT; -PFNGLGETINVARIANTINTEGERVEXTPROC pglGetInvariantIntegervEXT=_Lazy_glGetInvariantIntegervEXT; -PFNGLGETINVARIANTFLOATVEXTPROC pglGetInvariantFloatvEXT=_Lazy_glGetInvariantFloatvEXT; -PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC pglGetLocalConstantBooleanvEXT=_Lazy_glGetLocalConstantBooleanvEXT; -PFNGLGETLOCALCONSTANTINTEGERVEXTPROC pglGetLocalConstantIntegervEXT=_Lazy_glGetLocalConstantIntegervEXT; -PFNGLGETLOCALCONSTANTFLOATVEXTPROC pglGetLocalConstantFloatvEXT=_Lazy_glGetLocalConstantFloatvEXT; -#endif - -/* GL_ATI_vertex_streams */ - -#ifdef __GLEE_GL_ATI_vertex_streams -void __stdcall _Lazy_glVertexStream1sATI(GLenum stream, GLshort x) {if (GLeeInit()) glVertexStream1sATI(stream, x);} -void __stdcall _Lazy_glVertexStream1svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glVertexStream1svATI(stream, coords);} -void __stdcall _Lazy_glVertexStream1iATI(GLenum stream, GLint x) {if (GLeeInit()) glVertexStream1iATI(stream, x);} -void __stdcall _Lazy_glVertexStream1ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glVertexStream1ivATI(stream, coords);} -void __stdcall _Lazy_glVertexStream1fATI(GLenum stream, GLfloat x) {if (GLeeInit()) glVertexStream1fATI(stream, x);} -void __stdcall _Lazy_glVertexStream1fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glVertexStream1fvATI(stream, coords);} -void __stdcall _Lazy_glVertexStream1dATI(GLenum stream, GLdouble x) {if (GLeeInit()) glVertexStream1dATI(stream, x);} -void __stdcall _Lazy_glVertexStream1dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glVertexStream1dvATI(stream, coords);} -void __stdcall _Lazy_glVertexStream2sATI(GLenum stream, GLshort x, GLshort y) {if (GLeeInit()) glVertexStream2sATI(stream, x, y);} -void __stdcall _Lazy_glVertexStream2svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glVertexStream2svATI(stream, coords);} -void __stdcall _Lazy_glVertexStream2iATI(GLenum stream, GLint x, GLint y) {if (GLeeInit()) glVertexStream2iATI(stream, x, y);} -void __stdcall _Lazy_glVertexStream2ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glVertexStream2ivATI(stream, coords);} -void __stdcall _Lazy_glVertexStream2fATI(GLenum stream, GLfloat x, GLfloat y) {if (GLeeInit()) glVertexStream2fATI(stream, x, y);} -void __stdcall _Lazy_glVertexStream2fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glVertexStream2fvATI(stream, coords);} -void __stdcall _Lazy_glVertexStream2dATI(GLenum stream, GLdouble x, GLdouble y) {if (GLeeInit()) glVertexStream2dATI(stream, x, y);} -void __stdcall _Lazy_glVertexStream2dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glVertexStream2dvATI(stream, coords);} -void __stdcall _Lazy_glVertexStream3sATI(GLenum stream, GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glVertexStream3sATI(stream, x, y, z);} -void __stdcall _Lazy_glVertexStream3svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glVertexStream3svATI(stream, coords);} -void __stdcall _Lazy_glVertexStream3iATI(GLenum stream, GLint x, GLint y, GLint z) {if (GLeeInit()) glVertexStream3iATI(stream, x, y, z);} -void __stdcall _Lazy_glVertexStream3ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glVertexStream3ivATI(stream, coords);} -void __stdcall _Lazy_glVertexStream3fATI(GLenum stream, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glVertexStream3fATI(stream, x, y, z);} -void __stdcall _Lazy_glVertexStream3fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glVertexStream3fvATI(stream, coords);} -void __stdcall _Lazy_glVertexStream3dATI(GLenum stream, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glVertexStream3dATI(stream, x, y, z);} -void __stdcall _Lazy_glVertexStream3dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glVertexStream3dvATI(stream, coords);} -void __stdcall _Lazy_glVertexStream4sATI(GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glVertexStream4sATI(stream, x, y, z, w);} -void __stdcall _Lazy_glVertexStream4svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glVertexStream4svATI(stream, coords);} -void __stdcall _Lazy_glVertexStream4iATI(GLenum stream, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glVertexStream4iATI(stream, x, y, z, w);} -void __stdcall _Lazy_glVertexStream4ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glVertexStream4ivATI(stream, coords);} -void __stdcall _Lazy_glVertexStream4fATI(GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glVertexStream4fATI(stream, x, y, z, w);} -void __stdcall _Lazy_glVertexStream4fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glVertexStream4fvATI(stream, coords);} -void __stdcall _Lazy_glVertexStream4dATI(GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glVertexStream4dATI(stream, x, y, z, w);} -void __stdcall _Lazy_glVertexStream4dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glVertexStream4dvATI(stream, coords);} -void __stdcall _Lazy_glNormalStream3bATI(GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz) {if (GLeeInit()) glNormalStream3bATI(stream, nx, ny, nz);} -void __stdcall _Lazy_glNormalStream3bvATI(GLenum stream, const GLbyte * coords) {if (GLeeInit()) glNormalStream3bvATI(stream, coords);} -void __stdcall _Lazy_glNormalStream3sATI(GLenum stream, GLshort nx, GLshort ny, GLshort nz) {if (GLeeInit()) glNormalStream3sATI(stream, nx, ny, nz);} -void __stdcall _Lazy_glNormalStream3svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glNormalStream3svATI(stream, coords);} -void __stdcall _Lazy_glNormalStream3iATI(GLenum stream, GLint nx, GLint ny, GLint nz) {if (GLeeInit()) glNormalStream3iATI(stream, nx, ny, nz);} -void __stdcall _Lazy_glNormalStream3ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glNormalStream3ivATI(stream, coords);} -void __stdcall _Lazy_glNormalStream3fATI(GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz) {if (GLeeInit()) glNormalStream3fATI(stream, nx, ny, nz);} -void __stdcall _Lazy_glNormalStream3fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glNormalStream3fvATI(stream, coords);} -void __stdcall _Lazy_glNormalStream3dATI(GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz) {if (GLeeInit()) glNormalStream3dATI(stream, nx, ny, nz);} -void __stdcall _Lazy_glNormalStream3dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glNormalStream3dvATI(stream, coords);} -void __stdcall _Lazy_glClientActiveVertexStreamATI(GLenum stream) {if (GLeeInit()) glClientActiveVertexStreamATI(stream);} -void __stdcall _Lazy_glVertexBlendEnviATI(GLenum pname, GLint param) {if (GLeeInit()) glVertexBlendEnviATI(pname, param);} -void __stdcall _Lazy_glVertexBlendEnvfATI(GLenum pname, GLfloat param) {if (GLeeInit()) glVertexBlendEnvfATI(pname, param);} -PFNGLVERTEXSTREAM1SATIPROC pglVertexStream1sATI=_Lazy_glVertexStream1sATI; -PFNGLVERTEXSTREAM1SVATIPROC pglVertexStream1svATI=_Lazy_glVertexStream1svATI; -PFNGLVERTEXSTREAM1IATIPROC pglVertexStream1iATI=_Lazy_glVertexStream1iATI; -PFNGLVERTEXSTREAM1IVATIPROC pglVertexStream1ivATI=_Lazy_glVertexStream1ivATI; -PFNGLVERTEXSTREAM1FATIPROC pglVertexStream1fATI=_Lazy_glVertexStream1fATI; -PFNGLVERTEXSTREAM1FVATIPROC pglVertexStream1fvATI=_Lazy_glVertexStream1fvATI; -PFNGLVERTEXSTREAM1DATIPROC pglVertexStream1dATI=_Lazy_glVertexStream1dATI; -PFNGLVERTEXSTREAM1DVATIPROC pglVertexStream1dvATI=_Lazy_glVertexStream1dvATI; -PFNGLVERTEXSTREAM2SATIPROC pglVertexStream2sATI=_Lazy_glVertexStream2sATI; -PFNGLVERTEXSTREAM2SVATIPROC pglVertexStream2svATI=_Lazy_glVertexStream2svATI; -PFNGLVERTEXSTREAM2IATIPROC pglVertexStream2iATI=_Lazy_glVertexStream2iATI; -PFNGLVERTEXSTREAM2IVATIPROC pglVertexStream2ivATI=_Lazy_glVertexStream2ivATI; -PFNGLVERTEXSTREAM2FATIPROC pglVertexStream2fATI=_Lazy_glVertexStream2fATI; -PFNGLVERTEXSTREAM2FVATIPROC pglVertexStream2fvATI=_Lazy_glVertexStream2fvATI; -PFNGLVERTEXSTREAM2DATIPROC pglVertexStream2dATI=_Lazy_glVertexStream2dATI; -PFNGLVERTEXSTREAM2DVATIPROC pglVertexStream2dvATI=_Lazy_glVertexStream2dvATI; -PFNGLVERTEXSTREAM3SATIPROC pglVertexStream3sATI=_Lazy_glVertexStream3sATI; -PFNGLVERTEXSTREAM3SVATIPROC pglVertexStream3svATI=_Lazy_glVertexStream3svATI; -PFNGLVERTEXSTREAM3IATIPROC pglVertexStream3iATI=_Lazy_glVertexStream3iATI; -PFNGLVERTEXSTREAM3IVATIPROC pglVertexStream3ivATI=_Lazy_glVertexStream3ivATI; -PFNGLVERTEXSTREAM3FATIPROC pglVertexStream3fATI=_Lazy_glVertexStream3fATI; -PFNGLVERTEXSTREAM3FVATIPROC pglVertexStream3fvATI=_Lazy_glVertexStream3fvATI; -PFNGLVERTEXSTREAM3DATIPROC pglVertexStream3dATI=_Lazy_glVertexStream3dATI; -PFNGLVERTEXSTREAM3DVATIPROC pglVertexStream3dvATI=_Lazy_glVertexStream3dvATI; -PFNGLVERTEXSTREAM4SATIPROC pglVertexStream4sATI=_Lazy_glVertexStream4sATI; -PFNGLVERTEXSTREAM4SVATIPROC pglVertexStream4svATI=_Lazy_glVertexStream4svATI; -PFNGLVERTEXSTREAM4IATIPROC pglVertexStream4iATI=_Lazy_glVertexStream4iATI; -PFNGLVERTEXSTREAM4IVATIPROC pglVertexStream4ivATI=_Lazy_glVertexStream4ivATI; -PFNGLVERTEXSTREAM4FATIPROC pglVertexStream4fATI=_Lazy_glVertexStream4fATI; -PFNGLVERTEXSTREAM4FVATIPROC pglVertexStream4fvATI=_Lazy_glVertexStream4fvATI; -PFNGLVERTEXSTREAM4DATIPROC pglVertexStream4dATI=_Lazy_glVertexStream4dATI; -PFNGLVERTEXSTREAM4DVATIPROC pglVertexStream4dvATI=_Lazy_glVertexStream4dvATI; -PFNGLNORMALSTREAM3BATIPROC pglNormalStream3bATI=_Lazy_glNormalStream3bATI; -PFNGLNORMALSTREAM3BVATIPROC pglNormalStream3bvATI=_Lazy_glNormalStream3bvATI; -PFNGLNORMALSTREAM3SATIPROC pglNormalStream3sATI=_Lazy_glNormalStream3sATI; -PFNGLNORMALSTREAM3SVATIPROC pglNormalStream3svATI=_Lazy_glNormalStream3svATI; -PFNGLNORMALSTREAM3IATIPROC pglNormalStream3iATI=_Lazy_glNormalStream3iATI; -PFNGLNORMALSTREAM3IVATIPROC pglNormalStream3ivATI=_Lazy_glNormalStream3ivATI; -PFNGLNORMALSTREAM3FATIPROC pglNormalStream3fATI=_Lazy_glNormalStream3fATI; -PFNGLNORMALSTREAM3FVATIPROC pglNormalStream3fvATI=_Lazy_glNormalStream3fvATI; -PFNGLNORMALSTREAM3DATIPROC pglNormalStream3dATI=_Lazy_glNormalStream3dATI; -PFNGLNORMALSTREAM3DVATIPROC pglNormalStream3dvATI=_Lazy_glNormalStream3dvATI; -PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC pglClientActiveVertexStreamATI=_Lazy_glClientActiveVertexStreamATI; -PFNGLVERTEXBLENDENVIATIPROC pglVertexBlendEnviATI=_Lazy_glVertexBlendEnviATI; -PFNGLVERTEXBLENDENVFATIPROC pglVertexBlendEnvfATI=_Lazy_glVertexBlendEnvfATI; -#endif - -/* GL_ATI_element_array */ - -#ifdef __GLEE_GL_ATI_element_array -void __stdcall _Lazy_glElementPointerATI(GLenum type, const GLvoid * pointer) {if (GLeeInit()) glElementPointerATI(type, pointer);} -void __stdcall _Lazy_glDrawElementArrayATI(GLenum mode, GLsizei count) {if (GLeeInit()) glDrawElementArrayATI(mode, count);} -void __stdcall _Lazy_glDrawRangeElementArrayATI(GLenum mode, GLuint start, GLuint end, GLsizei count) {if (GLeeInit()) glDrawRangeElementArrayATI(mode, start, end, count);} -PFNGLELEMENTPOINTERATIPROC pglElementPointerATI=_Lazy_glElementPointerATI; -PFNGLDRAWELEMENTARRAYATIPROC pglDrawElementArrayATI=_Lazy_glDrawElementArrayATI; -PFNGLDRAWRANGEELEMENTARRAYATIPROC pglDrawRangeElementArrayATI=_Lazy_glDrawRangeElementArrayATI; -#endif - -/* GL_SUN_mesh_array */ - -#ifdef __GLEE_GL_SUN_mesh_array -void __stdcall _Lazy_glDrawMeshArraysSUN(GLenum mode, GLint first, GLsizei count, GLsizei width) {if (GLeeInit()) glDrawMeshArraysSUN(mode, first, count, width);} -PFNGLDRAWMESHARRAYSSUNPROC pglDrawMeshArraysSUN=_Lazy_glDrawMeshArraysSUN; -#endif - -/* GL_SUN_slice_accum */ - -#ifdef __GLEE_GL_SUN_slice_accum -#endif - -/* GL_NV_multisample_filter_hint */ - -#ifdef __GLEE_GL_NV_multisample_filter_hint -#endif - -/* GL_NV_depth_clamp */ - -#ifdef __GLEE_GL_NV_depth_clamp -#endif - -/* GL_NV_occlusion_query */ - -#ifdef __GLEE_GL_NV_occlusion_query -void __stdcall _Lazy_glGenOcclusionQueriesNV(GLsizei n, GLuint * ids) {if (GLeeInit()) glGenOcclusionQueriesNV(n, ids);} -void __stdcall _Lazy_glDeleteOcclusionQueriesNV(GLsizei n, const GLuint * ids) {if (GLeeInit()) glDeleteOcclusionQueriesNV(n, ids);} -GLboolean __stdcall _Lazy_glIsOcclusionQueryNV(GLuint id) {if (GLeeInit()) return glIsOcclusionQueryNV(id); return (GLboolean)0;} -void __stdcall _Lazy_glBeginOcclusionQueryNV(GLuint id) {if (GLeeInit()) glBeginOcclusionQueryNV(id);} -void __stdcall _Lazy_glEndOcclusionQueryNV(void) {if (GLeeInit()) glEndOcclusionQueryNV();} -void __stdcall _Lazy_glGetOcclusionQueryivNV(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetOcclusionQueryivNV(id, pname, params);} -void __stdcall _Lazy_glGetOcclusionQueryuivNV(GLuint id, GLenum pname, GLuint * params) {if (GLeeInit()) glGetOcclusionQueryuivNV(id, pname, params);} -PFNGLGENOCCLUSIONQUERIESNVPROC pglGenOcclusionQueriesNV=_Lazy_glGenOcclusionQueriesNV; -PFNGLDELETEOCCLUSIONQUERIESNVPROC pglDeleteOcclusionQueriesNV=_Lazy_glDeleteOcclusionQueriesNV; -PFNGLISOCCLUSIONQUERYNVPROC pglIsOcclusionQueryNV=_Lazy_glIsOcclusionQueryNV; -PFNGLBEGINOCCLUSIONQUERYNVPROC pglBeginOcclusionQueryNV=_Lazy_glBeginOcclusionQueryNV; -PFNGLENDOCCLUSIONQUERYNVPROC pglEndOcclusionQueryNV=_Lazy_glEndOcclusionQueryNV; -PFNGLGETOCCLUSIONQUERYIVNVPROC pglGetOcclusionQueryivNV=_Lazy_glGetOcclusionQueryivNV; -PFNGLGETOCCLUSIONQUERYUIVNVPROC pglGetOcclusionQueryuivNV=_Lazy_glGetOcclusionQueryuivNV; -#endif - -/* GL_NV_point_sprite */ - -#ifdef __GLEE_GL_NV_point_sprite -void __stdcall _Lazy_glPointParameteriNV(GLenum pname, GLint param) {if (GLeeInit()) glPointParameteriNV(pname, param);} -void __stdcall _Lazy_glPointParameterivNV(GLenum pname, const GLint * params) {if (GLeeInit()) glPointParameterivNV(pname, params);} -PFNGLPOINTPARAMETERINVPROC pglPointParameteriNV=_Lazy_glPointParameteriNV; -PFNGLPOINTPARAMETERIVNVPROC pglPointParameterivNV=_Lazy_glPointParameterivNV; -#endif - -/* GL_NV_texture_shader3 */ - -#ifdef __GLEE_GL_NV_texture_shader3 -#endif - -/* GL_NV_vertex_program1_1 */ - -#ifdef __GLEE_GL_NV_vertex_program1_1 -#endif - -/* GL_EXT_shadow_funcs */ - -#ifdef __GLEE_GL_EXT_shadow_funcs -#endif - -/* GL_EXT_stencil_two_side */ - -#ifdef __GLEE_GL_EXT_stencil_two_side -void __stdcall _Lazy_glActiveStencilFaceEXT(GLenum face) {if (GLeeInit()) glActiveStencilFaceEXT(face);} -PFNGLACTIVESTENCILFACEEXTPROC pglActiveStencilFaceEXT=_Lazy_glActiveStencilFaceEXT; -#endif - -/* GL_ATI_text_fragment_shader */ - -#ifdef __GLEE_GL_ATI_text_fragment_shader -#endif - -/* GL_APPLE_client_storage */ - -#ifdef __GLEE_GL_APPLE_client_storage -#endif - -/* GL_APPLE_element_array */ - -#ifdef __GLEE_GL_APPLE_element_array -void __stdcall _Lazy_glElementPointerAPPLE(GLenum type, const GLvoid * pointer) {if (GLeeInit()) glElementPointerAPPLE(type, pointer);} -void __stdcall _Lazy_glDrawElementArrayAPPLE(GLenum mode, GLint first, GLsizei count) {if (GLeeInit()) glDrawElementArrayAPPLE(mode, first, count);} -void __stdcall _Lazy_glDrawRangeElementArrayAPPLE(GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count) {if (GLeeInit()) glDrawRangeElementArrayAPPLE(mode, start, end, first, count);} -void __stdcall _Lazy_glMultiDrawElementArrayAPPLE(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount) {if (GLeeInit()) glMultiDrawElementArrayAPPLE(mode, first, count, primcount);} -void __stdcall _Lazy_glMultiDrawRangeElementArrayAPPLE(GLenum mode, GLuint start, GLuint end, const GLint * first, const GLsizei * count, GLsizei primcount) {if (GLeeInit()) glMultiDrawRangeElementArrayAPPLE(mode, start, end, first, count, primcount);} -PFNGLELEMENTPOINTERAPPLEPROC pglElementPointerAPPLE=_Lazy_glElementPointerAPPLE; -PFNGLDRAWELEMENTARRAYAPPLEPROC pglDrawElementArrayAPPLE=_Lazy_glDrawElementArrayAPPLE; -PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC pglDrawRangeElementArrayAPPLE=_Lazy_glDrawRangeElementArrayAPPLE; -PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC pglMultiDrawElementArrayAPPLE=_Lazy_glMultiDrawElementArrayAPPLE; -PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC pglMultiDrawRangeElementArrayAPPLE=_Lazy_glMultiDrawRangeElementArrayAPPLE; -#endif - -/* GL_APPLE_fence */ - -#ifdef __GLEE_GL_APPLE_fence -void __stdcall _Lazy_glGenFencesAPPLE(GLsizei n, GLuint * fences) {if (GLeeInit()) glGenFencesAPPLE(n, fences);} -void __stdcall _Lazy_glDeleteFencesAPPLE(GLsizei n, const GLuint * fences) {if (GLeeInit()) glDeleteFencesAPPLE(n, fences);} -void __stdcall _Lazy_glSetFenceAPPLE(GLuint fence) {if (GLeeInit()) glSetFenceAPPLE(fence);} -GLboolean __stdcall _Lazy_glIsFenceAPPLE(GLuint fence) {if (GLeeInit()) return glIsFenceAPPLE(fence); return (GLboolean)0;} -GLboolean __stdcall _Lazy_glTestFenceAPPLE(GLuint fence) {if (GLeeInit()) return glTestFenceAPPLE(fence); return (GLboolean)0;} -void __stdcall _Lazy_glFinishFenceAPPLE(GLuint fence) {if (GLeeInit()) glFinishFenceAPPLE(fence);} -GLboolean __stdcall _Lazy_glTestObjectAPPLE(GLenum object, GLuint name) {if (GLeeInit()) return glTestObjectAPPLE(object, name); return (GLboolean)0;} -void __stdcall _Lazy_glFinishObjectAPPLE(GLenum object, GLint name) {if (GLeeInit()) glFinishObjectAPPLE(object, name);} -PFNGLGENFENCESAPPLEPROC pglGenFencesAPPLE=_Lazy_glGenFencesAPPLE; -PFNGLDELETEFENCESAPPLEPROC pglDeleteFencesAPPLE=_Lazy_glDeleteFencesAPPLE; -PFNGLSETFENCEAPPLEPROC pglSetFenceAPPLE=_Lazy_glSetFenceAPPLE; -PFNGLISFENCEAPPLEPROC pglIsFenceAPPLE=_Lazy_glIsFenceAPPLE; -PFNGLTESTFENCEAPPLEPROC pglTestFenceAPPLE=_Lazy_glTestFenceAPPLE; -PFNGLFINISHFENCEAPPLEPROC pglFinishFenceAPPLE=_Lazy_glFinishFenceAPPLE; -PFNGLTESTOBJECTAPPLEPROC pglTestObjectAPPLE=_Lazy_glTestObjectAPPLE; -PFNGLFINISHOBJECTAPPLEPROC pglFinishObjectAPPLE=_Lazy_glFinishObjectAPPLE; -#endif - -/* GL_APPLE_vertex_array_object */ - -#ifdef __GLEE_GL_APPLE_vertex_array_object -void __stdcall _Lazy_glBindVertexArrayAPPLE(GLuint array) {if (GLeeInit()) glBindVertexArrayAPPLE(array);} -void __stdcall _Lazy_glDeleteVertexArraysAPPLE(GLsizei n, const GLuint * arrays) {if (GLeeInit()) glDeleteVertexArraysAPPLE(n, arrays);} -void __stdcall _Lazy_glGenVertexArraysAPPLE(GLsizei n, GLuint * arrays) {if (GLeeInit()) glGenVertexArraysAPPLE(n, arrays);} -GLboolean __stdcall _Lazy_glIsVertexArrayAPPLE(GLuint array) {if (GLeeInit()) return glIsVertexArrayAPPLE(array); return (GLboolean)0;} -PFNGLBINDVERTEXARRAYAPPLEPROC pglBindVertexArrayAPPLE=_Lazy_glBindVertexArrayAPPLE; -PFNGLDELETEVERTEXARRAYSAPPLEPROC pglDeleteVertexArraysAPPLE=_Lazy_glDeleteVertexArraysAPPLE; -PFNGLGENVERTEXARRAYSAPPLEPROC pglGenVertexArraysAPPLE=_Lazy_glGenVertexArraysAPPLE; -PFNGLISVERTEXARRAYAPPLEPROC pglIsVertexArrayAPPLE=_Lazy_glIsVertexArrayAPPLE; -#endif - -/* GL_APPLE_vertex_array_range */ - -#ifdef __GLEE_GL_APPLE_vertex_array_range -void __stdcall _Lazy_glVertexArrayRangeAPPLE(GLsizei length, GLvoid * pointer) {if (GLeeInit()) glVertexArrayRangeAPPLE(length, pointer);} -void __stdcall _Lazy_glFlushVertexArrayRangeAPPLE(GLsizei length, GLvoid * pointer) {if (GLeeInit()) glFlushVertexArrayRangeAPPLE(length, pointer);} -void __stdcall _Lazy_glVertexArrayParameteriAPPLE(GLenum pname, GLint param) {if (GLeeInit()) glVertexArrayParameteriAPPLE(pname, param);} -PFNGLVERTEXARRAYRANGEAPPLEPROC pglVertexArrayRangeAPPLE=_Lazy_glVertexArrayRangeAPPLE; -PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC pglFlushVertexArrayRangeAPPLE=_Lazy_glFlushVertexArrayRangeAPPLE; -PFNGLVERTEXARRAYPARAMETERIAPPLEPROC pglVertexArrayParameteriAPPLE=_Lazy_glVertexArrayParameteriAPPLE; -#endif - -/* GL_APPLE_ycbcr_422 */ - -#ifdef __GLEE_GL_APPLE_ycbcr_422 -#endif - -/* GL_S3_s3tc */ - -#ifdef __GLEE_GL_S3_s3tc -#endif - -/* GL_ATI_draw_buffers */ - -#ifdef __GLEE_GL_ATI_draw_buffers -void __stdcall _Lazy_glDrawBuffersATI(GLsizei n, const GLenum * bufs) {if (GLeeInit()) glDrawBuffersATI(n, bufs);} -PFNGLDRAWBUFFERSATIPROC pglDrawBuffersATI=_Lazy_glDrawBuffersATI; -#endif - -/* GL_ATI_pixel_format_float */ - -#ifdef __GLEE_GL_ATI_pixel_format_float -#endif - -/* GL_ATI_texture_env_combine3 */ - -#ifdef __GLEE_GL_ATI_texture_env_combine3 -#endif - -/* GL_ATI_texture_float */ - -#ifdef __GLEE_GL_ATI_texture_float -#endif - -/* GL_NV_float_buffer */ - -#ifdef __GLEE_GL_NV_float_buffer -#endif - -/* GL_NV_fragment_program */ - -#ifdef __GLEE_GL_NV_fragment_program -void __stdcall _Lazy_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glProgramNamedParameter4fNV(id, len, name, x, y, z, w);} -void __stdcall _Lazy_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glProgramNamedParameter4dNV(id, len, name, x, y, z, w);} -void __stdcall _Lazy_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v) {if (GLeeInit()) glProgramNamedParameter4fvNV(id, len, name, v);} -void __stdcall _Lazy_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v) {if (GLeeInit()) glProgramNamedParameter4dvNV(id, len, name, v);} -void __stdcall _Lazy_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params) {if (GLeeInit()) glGetProgramNamedParameterfvNV(id, len, name, params);} -void __stdcall _Lazy_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params) {if (GLeeInit()) glGetProgramNamedParameterdvNV(id, len, name, params);} -PFNGLPROGRAMNAMEDPARAMETER4FNVPROC pglProgramNamedParameter4fNV=_Lazy_glProgramNamedParameter4fNV; -PFNGLPROGRAMNAMEDPARAMETER4DNVPROC pglProgramNamedParameter4dNV=_Lazy_glProgramNamedParameter4dNV; -PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC pglProgramNamedParameter4fvNV=_Lazy_glProgramNamedParameter4fvNV; -PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC pglProgramNamedParameter4dvNV=_Lazy_glProgramNamedParameter4dvNV; -PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC pglGetProgramNamedParameterfvNV=_Lazy_glGetProgramNamedParameterfvNV; -PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC pglGetProgramNamedParameterdvNV=_Lazy_glGetProgramNamedParameterdvNV; -#endif - -/* GL_NV_half_float */ - -#ifdef __GLEE_GL_NV_half_float -void __stdcall _Lazy_glVertex2hNV(GLhalfNV x, GLhalfNV y) {if (GLeeInit()) glVertex2hNV(x, y);} -void __stdcall _Lazy_glVertex2hvNV(const GLhalfNV * v) {if (GLeeInit()) glVertex2hvNV(v);} -void __stdcall _Lazy_glVertex3hNV(GLhalfNV x, GLhalfNV y, GLhalfNV z) {if (GLeeInit()) glVertex3hNV(x, y, z);} -void __stdcall _Lazy_glVertex3hvNV(const GLhalfNV * v) {if (GLeeInit()) glVertex3hvNV(v);} -void __stdcall _Lazy_glVertex4hNV(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) {if (GLeeInit()) glVertex4hNV(x, y, z, w);} -void __stdcall _Lazy_glVertex4hvNV(const GLhalfNV * v) {if (GLeeInit()) glVertex4hvNV(v);} -void __stdcall _Lazy_glNormal3hNV(GLhalfNV nx, GLhalfNV ny, GLhalfNV nz) {if (GLeeInit()) glNormal3hNV(nx, ny, nz);} -void __stdcall _Lazy_glNormal3hvNV(const GLhalfNV * v) {if (GLeeInit()) glNormal3hvNV(v);} -void __stdcall _Lazy_glColor3hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue) {if (GLeeInit()) glColor3hNV(red, green, blue);} -void __stdcall _Lazy_glColor3hvNV(const GLhalfNV * v) {if (GLeeInit()) glColor3hvNV(v);} -void __stdcall _Lazy_glColor4hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha) {if (GLeeInit()) glColor4hNV(red, green, blue, alpha);} -void __stdcall _Lazy_glColor4hvNV(const GLhalfNV * v) {if (GLeeInit()) glColor4hvNV(v);} -void __stdcall _Lazy_glTexCoord1hNV(GLhalfNV s) {if (GLeeInit()) glTexCoord1hNV(s);} -void __stdcall _Lazy_glTexCoord1hvNV(const GLhalfNV * v) {if (GLeeInit()) glTexCoord1hvNV(v);} -void __stdcall _Lazy_glTexCoord2hNV(GLhalfNV s, GLhalfNV t) {if (GLeeInit()) glTexCoord2hNV(s, t);} -void __stdcall _Lazy_glTexCoord2hvNV(const GLhalfNV * v) {if (GLeeInit()) glTexCoord2hvNV(v);} -void __stdcall _Lazy_glTexCoord3hNV(GLhalfNV s, GLhalfNV t, GLhalfNV r) {if (GLeeInit()) glTexCoord3hNV(s, t, r);} -void __stdcall _Lazy_glTexCoord3hvNV(const GLhalfNV * v) {if (GLeeInit()) glTexCoord3hvNV(v);} -void __stdcall _Lazy_glTexCoord4hNV(GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q) {if (GLeeInit()) glTexCoord4hNV(s, t, r, q);} -void __stdcall _Lazy_glTexCoord4hvNV(const GLhalfNV * v) {if (GLeeInit()) glTexCoord4hvNV(v);} -void __stdcall _Lazy_glMultiTexCoord1hNV(GLenum target, GLhalfNV s) {if (GLeeInit()) glMultiTexCoord1hNV(target, s);} -void __stdcall _Lazy_glMultiTexCoord1hvNV(GLenum target, const GLhalfNV * v) {if (GLeeInit()) glMultiTexCoord1hvNV(target, v);} -void __stdcall _Lazy_glMultiTexCoord2hNV(GLenum target, GLhalfNV s, GLhalfNV t) {if (GLeeInit()) glMultiTexCoord2hNV(target, s, t);} -void __stdcall _Lazy_glMultiTexCoord2hvNV(GLenum target, const GLhalfNV * v) {if (GLeeInit()) glMultiTexCoord2hvNV(target, v);} -void __stdcall _Lazy_glMultiTexCoord3hNV(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r) {if (GLeeInit()) glMultiTexCoord3hNV(target, s, t, r);} -void __stdcall _Lazy_glMultiTexCoord3hvNV(GLenum target, const GLhalfNV * v) {if (GLeeInit()) glMultiTexCoord3hvNV(target, v);} -void __stdcall _Lazy_glMultiTexCoord4hNV(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q) {if (GLeeInit()) glMultiTexCoord4hNV(target, s, t, r, q);} -void __stdcall _Lazy_glMultiTexCoord4hvNV(GLenum target, const GLhalfNV * v) {if (GLeeInit()) glMultiTexCoord4hvNV(target, v);} -void __stdcall _Lazy_glFogCoordhNV(GLhalfNV fog) {if (GLeeInit()) glFogCoordhNV(fog);} -void __stdcall _Lazy_glFogCoordhvNV(const GLhalfNV * fog) {if (GLeeInit()) glFogCoordhvNV(fog);} -void __stdcall _Lazy_glSecondaryColor3hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue) {if (GLeeInit()) glSecondaryColor3hNV(red, green, blue);} -void __stdcall _Lazy_glSecondaryColor3hvNV(const GLhalfNV * v) {if (GLeeInit()) glSecondaryColor3hvNV(v);} -void __stdcall _Lazy_glVertexWeighthNV(GLhalfNV weight) {if (GLeeInit()) glVertexWeighthNV(weight);} -void __stdcall _Lazy_glVertexWeighthvNV(const GLhalfNV * weight) {if (GLeeInit()) glVertexWeighthvNV(weight);} -void __stdcall _Lazy_glVertexAttrib1hNV(GLuint index, GLhalfNV x) {if (GLeeInit()) glVertexAttrib1hNV(index, x);} -void __stdcall _Lazy_glVertexAttrib1hvNV(GLuint index, const GLhalfNV * v) {if (GLeeInit()) glVertexAttrib1hvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib2hNV(GLuint index, GLhalfNV x, GLhalfNV y) {if (GLeeInit()) glVertexAttrib2hNV(index, x, y);} -void __stdcall _Lazy_glVertexAttrib2hvNV(GLuint index, const GLhalfNV * v) {if (GLeeInit()) glVertexAttrib2hvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib3hNV(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z) {if (GLeeInit()) glVertexAttrib3hNV(index, x, y, z);} -void __stdcall _Lazy_glVertexAttrib3hvNV(GLuint index, const GLhalfNV * v) {if (GLeeInit()) glVertexAttrib3hvNV(index, v);} -void __stdcall _Lazy_glVertexAttrib4hNV(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) {if (GLeeInit()) glVertexAttrib4hNV(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttrib4hvNV(GLuint index, const GLhalfNV * v) {if (GLeeInit()) glVertexAttrib4hvNV(index, v);} -void __stdcall _Lazy_glVertexAttribs1hvNV(GLuint index, GLsizei n, const GLhalfNV * v) {if (GLeeInit()) glVertexAttribs1hvNV(index, n, v);} -void __stdcall _Lazy_glVertexAttribs2hvNV(GLuint index, GLsizei n, const GLhalfNV * v) {if (GLeeInit()) glVertexAttribs2hvNV(index, n, v);} -void __stdcall _Lazy_glVertexAttribs3hvNV(GLuint index, GLsizei n, const GLhalfNV * v) {if (GLeeInit()) glVertexAttribs3hvNV(index, n, v);} -void __stdcall _Lazy_glVertexAttribs4hvNV(GLuint index, GLsizei n, const GLhalfNV * v) {if (GLeeInit()) glVertexAttribs4hvNV(index, n, v);} -PFNGLVERTEX2HNVPROC pglVertex2hNV=_Lazy_glVertex2hNV; -PFNGLVERTEX2HVNVPROC pglVertex2hvNV=_Lazy_glVertex2hvNV; -PFNGLVERTEX3HNVPROC pglVertex3hNV=_Lazy_glVertex3hNV; -PFNGLVERTEX3HVNVPROC pglVertex3hvNV=_Lazy_glVertex3hvNV; -PFNGLVERTEX4HNVPROC pglVertex4hNV=_Lazy_glVertex4hNV; -PFNGLVERTEX4HVNVPROC pglVertex4hvNV=_Lazy_glVertex4hvNV; -PFNGLNORMAL3HNVPROC pglNormal3hNV=_Lazy_glNormal3hNV; -PFNGLNORMAL3HVNVPROC pglNormal3hvNV=_Lazy_glNormal3hvNV; -PFNGLCOLOR3HNVPROC pglColor3hNV=_Lazy_glColor3hNV; -PFNGLCOLOR3HVNVPROC pglColor3hvNV=_Lazy_glColor3hvNV; -PFNGLCOLOR4HNVPROC pglColor4hNV=_Lazy_glColor4hNV; -PFNGLCOLOR4HVNVPROC pglColor4hvNV=_Lazy_glColor4hvNV; -PFNGLTEXCOORD1HNVPROC pglTexCoord1hNV=_Lazy_glTexCoord1hNV; -PFNGLTEXCOORD1HVNVPROC pglTexCoord1hvNV=_Lazy_glTexCoord1hvNV; -PFNGLTEXCOORD2HNVPROC pglTexCoord2hNV=_Lazy_glTexCoord2hNV; -PFNGLTEXCOORD2HVNVPROC pglTexCoord2hvNV=_Lazy_glTexCoord2hvNV; -PFNGLTEXCOORD3HNVPROC pglTexCoord3hNV=_Lazy_glTexCoord3hNV; -PFNGLTEXCOORD3HVNVPROC pglTexCoord3hvNV=_Lazy_glTexCoord3hvNV; -PFNGLTEXCOORD4HNVPROC pglTexCoord4hNV=_Lazy_glTexCoord4hNV; -PFNGLTEXCOORD4HVNVPROC pglTexCoord4hvNV=_Lazy_glTexCoord4hvNV; -PFNGLMULTITEXCOORD1HNVPROC pglMultiTexCoord1hNV=_Lazy_glMultiTexCoord1hNV; -PFNGLMULTITEXCOORD1HVNVPROC pglMultiTexCoord1hvNV=_Lazy_glMultiTexCoord1hvNV; -PFNGLMULTITEXCOORD2HNVPROC pglMultiTexCoord2hNV=_Lazy_glMultiTexCoord2hNV; -PFNGLMULTITEXCOORD2HVNVPROC pglMultiTexCoord2hvNV=_Lazy_glMultiTexCoord2hvNV; -PFNGLMULTITEXCOORD3HNVPROC pglMultiTexCoord3hNV=_Lazy_glMultiTexCoord3hNV; -PFNGLMULTITEXCOORD3HVNVPROC pglMultiTexCoord3hvNV=_Lazy_glMultiTexCoord3hvNV; -PFNGLMULTITEXCOORD4HNVPROC pglMultiTexCoord4hNV=_Lazy_glMultiTexCoord4hNV; -PFNGLMULTITEXCOORD4HVNVPROC pglMultiTexCoord4hvNV=_Lazy_glMultiTexCoord4hvNV; -PFNGLFOGCOORDHNVPROC pglFogCoordhNV=_Lazy_glFogCoordhNV; -PFNGLFOGCOORDHVNVPROC pglFogCoordhvNV=_Lazy_glFogCoordhvNV; -PFNGLSECONDARYCOLOR3HNVPROC pglSecondaryColor3hNV=_Lazy_glSecondaryColor3hNV; -PFNGLSECONDARYCOLOR3HVNVPROC pglSecondaryColor3hvNV=_Lazy_glSecondaryColor3hvNV; -PFNGLVERTEXWEIGHTHNVPROC pglVertexWeighthNV=_Lazy_glVertexWeighthNV; -PFNGLVERTEXWEIGHTHVNVPROC pglVertexWeighthvNV=_Lazy_glVertexWeighthvNV; -PFNGLVERTEXATTRIB1HNVPROC pglVertexAttrib1hNV=_Lazy_glVertexAttrib1hNV; -PFNGLVERTEXATTRIB1HVNVPROC pglVertexAttrib1hvNV=_Lazy_glVertexAttrib1hvNV; -PFNGLVERTEXATTRIB2HNVPROC pglVertexAttrib2hNV=_Lazy_glVertexAttrib2hNV; -PFNGLVERTEXATTRIB2HVNVPROC pglVertexAttrib2hvNV=_Lazy_glVertexAttrib2hvNV; -PFNGLVERTEXATTRIB3HNVPROC pglVertexAttrib3hNV=_Lazy_glVertexAttrib3hNV; -PFNGLVERTEXATTRIB3HVNVPROC pglVertexAttrib3hvNV=_Lazy_glVertexAttrib3hvNV; -PFNGLVERTEXATTRIB4HNVPROC pglVertexAttrib4hNV=_Lazy_glVertexAttrib4hNV; -PFNGLVERTEXATTRIB4HVNVPROC pglVertexAttrib4hvNV=_Lazy_glVertexAttrib4hvNV; -PFNGLVERTEXATTRIBS1HVNVPROC pglVertexAttribs1hvNV=_Lazy_glVertexAttribs1hvNV; -PFNGLVERTEXATTRIBS2HVNVPROC pglVertexAttribs2hvNV=_Lazy_glVertexAttribs2hvNV; -PFNGLVERTEXATTRIBS3HVNVPROC pglVertexAttribs3hvNV=_Lazy_glVertexAttribs3hvNV; -PFNGLVERTEXATTRIBS4HVNVPROC pglVertexAttribs4hvNV=_Lazy_glVertexAttribs4hvNV; -#endif - -/* GL_NV_pixel_data_range */ - -#ifdef __GLEE_GL_NV_pixel_data_range -void __stdcall _Lazy_glPixelDataRangeNV(GLenum target, GLsizei length, GLvoid * pointer) {if (GLeeInit()) glPixelDataRangeNV(target, length, pointer);} -void __stdcall _Lazy_glFlushPixelDataRangeNV(GLenum target) {if (GLeeInit()) glFlushPixelDataRangeNV(target);} -PFNGLPIXELDATARANGENVPROC pglPixelDataRangeNV=_Lazy_glPixelDataRangeNV; -PFNGLFLUSHPIXELDATARANGENVPROC pglFlushPixelDataRangeNV=_Lazy_glFlushPixelDataRangeNV; -#endif - -/* GL_NV_primitive_restart */ - -#ifdef __GLEE_GL_NV_primitive_restart -void __stdcall _Lazy_glPrimitiveRestartNV(void) {if (GLeeInit()) glPrimitiveRestartNV();} -void __stdcall _Lazy_glPrimitiveRestartIndexNV(GLuint index) {if (GLeeInit()) glPrimitiveRestartIndexNV(index);} -PFNGLPRIMITIVERESTARTNVPROC pglPrimitiveRestartNV=_Lazy_glPrimitiveRestartNV; -PFNGLPRIMITIVERESTARTINDEXNVPROC pglPrimitiveRestartIndexNV=_Lazy_glPrimitiveRestartIndexNV; -#endif - -/* GL_NV_texture_expand_normal */ - -#ifdef __GLEE_GL_NV_texture_expand_normal -#endif - -/* GL_NV_vertex_program2 */ - -#ifdef __GLEE_GL_NV_vertex_program2 -#endif - -/* GL_ATI_map_object_buffer */ - -#ifdef __GLEE_GL_ATI_map_object_buffer -GLvoid* __stdcall _Lazy_glMapObjectBufferATI(GLuint buffer) {if (GLeeInit()) return glMapObjectBufferATI(buffer); return (GLvoid*)0;} -void __stdcall _Lazy_glUnmapObjectBufferATI(GLuint buffer) {if (GLeeInit()) glUnmapObjectBufferATI(buffer);} -PFNGLMAPOBJECTBUFFERATIPROC pglMapObjectBufferATI=_Lazy_glMapObjectBufferATI; -PFNGLUNMAPOBJECTBUFFERATIPROC pglUnmapObjectBufferATI=_Lazy_glUnmapObjectBufferATI; -#endif - -/* GL_ATI_separate_stencil */ - -#ifdef __GLEE_GL_ATI_separate_stencil -void __stdcall _Lazy_glStencilOpSeparateATI(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {if (GLeeInit()) glStencilOpSeparateATI(face, sfail, dpfail, dppass);} -void __stdcall _Lazy_glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) {if (GLeeInit()) glStencilFuncSeparateATI(frontfunc, backfunc, ref, mask);} -PFNGLSTENCILOPSEPARATEATIPROC pglStencilOpSeparateATI=_Lazy_glStencilOpSeparateATI; -PFNGLSTENCILFUNCSEPARATEATIPROC pglStencilFuncSeparateATI=_Lazy_glStencilFuncSeparateATI; -#endif - -/* GL_ATI_vertex_attrib_array_object */ - -#ifdef __GLEE_GL_ATI_vertex_attrib_array_object -void __stdcall _Lazy_glVertexAttribArrayObjectATI(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset) {if (GLeeInit()) glVertexAttribArrayObjectATI(index, size, type, normalized, stride, buffer, offset);} -void __stdcall _Lazy_glGetVertexAttribArrayObjectfvATI(GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVertexAttribArrayObjectfvATI(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribArrayObjectivATI(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribArrayObjectivATI(index, pname, params);} -PFNGLVERTEXATTRIBARRAYOBJECTATIPROC pglVertexAttribArrayObjectATI=_Lazy_glVertexAttribArrayObjectATI; -PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC pglGetVertexAttribArrayObjectfvATI=_Lazy_glGetVertexAttribArrayObjectfvATI; -PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC pglGetVertexAttribArrayObjectivATI=_Lazy_glGetVertexAttribArrayObjectivATI; -#endif - -/* GL_OES_read_format */ - -#ifdef __GLEE_GL_OES_read_format -#endif - -/* GL_EXT_depth_bounds_test */ - -#ifdef __GLEE_GL_EXT_depth_bounds_test -void __stdcall _Lazy_glDepthBoundsEXT(GLclampd zmin, GLclampd zmax) {if (GLeeInit()) glDepthBoundsEXT(zmin, zmax);} -PFNGLDEPTHBOUNDSEXTPROC pglDepthBoundsEXT=_Lazy_glDepthBoundsEXT; -#endif - -/* GL_EXT_texture_mirror_clamp */ - -#ifdef __GLEE_GL_EXT_texture_mirror_clamp -#endif - -/* GL_EXT_blend_equation_separate */ - -#ifdef __GLEE_GL_EXT_blend_equation_separate -void __stdcall _Lazy_glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeAlpha) {if (GLeeInit()) glBlendEquationSeparateEXT(modeRGB, modeAlpha);} -PFNGLBLENDEQUATIONSEPARATEEXTPROC pglBlendEquationSeparateEXT=_Lazy_glBlendEquationSeparateEXT; -#endif - -/* GL_MESA_pack_invert */ - -#ifdef __GLEE_GL_MESA_pack_invert -#endif - -/* GL_MESA_ycbcr_texture */ - -#ifdef __GLEE_GL_MESA_ycbcr_texture -#endif - -/* GL_EXT_pixel_buffer_object */ - -#ifdef __GLEE_GL_EXT_pixel_buffer_object -#endif - -/* GL_NV_fragment_program_option */ - -#ifdef __GLEE_GL_NV_fragment_program_option -#endif - -/* GL_NV_fragment_program2 */ - -#ifdef __GLEE_GL_NV_fragment_program2 -#endif - -/* GL_NV_vertex_program2_option */ - -#ifdef __GLEE_GL_NV_vertex_program2_option -#endif - -/* GL_NV_vertex_program3 */ - -#ifdef __GLEE_GL_NV_vertex_program3 -#endif - -/* GL_EXT_framebuffer_object */ - -#ifdef __GLEE_GL_EXT_framebuffer_object -GLboolean __stdcall _Lazy_glIsRenderbufferEXT(GLuint renderbuffer) {if (GLeeInit()) return glIsRenderbufferEXT(renderbuffer); return (GLboolean)0;} -void __stdcall _Lazy_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) {if (GLeeInit()) glBindRenderbufferEXT(target, renderbuffer);} -void __stdcall _Lazy_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers) {if (GLeeInit()) glDeleteRenderbuffersEXT(n, renderbuffers);} -void __stdcall _Lazy_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers) {if (GLeeInit()) glGenRenderbuffersEXT(n, renderbuffers);} -void __stdcall _Lazy_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorageEXT(target, internalformat, width, height);} -void __stdcall _Lazy_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetRenderbufferParameterivEXT(target, pname, params);} -GLboolean __stdcall _Lazy_glIsFramebufferEXT(GLuint framebuffer) {if (GLeeInit()) return glIsFramebufferEXT(framebuffer); return (GLboolean)0;} -void __stdcall _Lazy_glBindFramebufferEXT(GLenum target, GLuint framebuffer) {if (GLeeInit()) glBindFramebufferEXT(target, framebuffer);} -void __stdcall _Lazy_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers) {if (GLeeInit()) glDeleteFramebuffersEXT(n, framebuffers);} -void __stdcall _Lazy_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers) {if (GLeeInit()) glGenFramebuffersEXT(n, framebuffers);} -GLenum __stdcall _Lazy_glCheckFramebufferStatusEXT(GLenum target) {if (GLeeInit()) return glCheckFramebufferStatusEXT(target); return (GLenum)0;} -void __stdcall _Lazy_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTexture1DEXT(target, attachment, textarget, texture, level);} -void __stdcall _Lazy_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);} -void __stdcall _Lazy_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {if (GLeeInit()) glFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);} -void __stdcall _Lazy_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {if (GLeeInit()) glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);} -void __stdcall _Lazy_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params) {if (GLeeInit()) glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params);} -void __stdcall _Lazy_glGenerateMipmapEXT(GLenum target) {if (GLeeInit()) glGenerateMipmapEXT(target);} -PFNGLISRENDERBUFFEREXTPROC pglIsRenderbufferEXT=_Lazy_glIsRenderbufferEXT; -PFNGLBINDRENDERBUFFEREXTPROC pglBindRenderbufferEXT=_Lazy_glBindRenderbufferEXT; -PFNGLDELETERENDERBUFFERSEXTPROC pglDeleteRenderbuffersEXT=_Lazy_glDeleteRenderbuffersEXT; -PFNGLGENRENDERBUFFERSEXTPROC pglGenRenderbuffersEXT=_Lazy_glGenRenderbuffersEXT; -PFNGLRENDERBUFFERSTORAGEEXTPROC pglRenderbufferStorageEXT=_Lazy_glRenderbufferStorageEXT; -PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC pglGetRenderbufferParameterivEXT=_Lazy_glGetRenderbufferParameterivEXT; -PFNGLISFRAMEBUFFEREXTPROC pglIsFramebufferEXT=_Lazy_glIsFramebufferEXT; -PFNGLBINDFRAMEBUFFEREXTPROC pglBindFramebufferEXT=_Lazy_glBindFramebufferEXT; -PFNGLDELETEFRAMEBUFFERSEXTPROC pglDeleteFramebuffersEXT=_Lazy_glDeleteFramebuffersEXT; -PFNGLGENFRAMEBUFFERSEXTPROC pglGenFramebuffersEXT=_Lazy_glGenFramebuffersEXT; -PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC pglCheckFramebufferStatusEXT=_Lazy_glCheckFramebufferStatusEXT; -PFNGLFRAMEBUFFERTEXTURE1DEXTPROC pglFramebufferTexture1DEXT=_Lazy_glFramebufferTexture1DEXT; -PFNGLFRAMEBUFFERTEXTURE2DEXTPROC pglFramebufferTexture2DEXT=_Lazy_glFramebufferTexture2DEXT; -PFNGLFRAMEBUFFERTEXTURE3DEXTPROC pglFramebufferTexture3DEXT=_Lazy_glFramebufferTexture3DEXT; -PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC pglFramebufferRenderbufferEXT=_Lazy_glFramebufferRenderbufferEXT; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC pglGetFramebufferAttachmentParameterivEXT=_Lazy_glGetFramebufferAttachmentParameterivEXT; -PFNGLGENERATEMIPMAPEXTPROC pglGenerateMipmapEXT=_Lazy_glGenerateMipmapEXT; -#endif - -/* GL_GREMEDY_string_marker */ - -#ifdef __GLEE_GL_GREMEDY_string_marker -void __stdcall _Lazy_glStringMarkerGREMEDY(GLsizei len, const GLvoid * string) {if (GLeeInit()) glStringMarkerGREMEDY(len, string);} -PFNGLSTRINGMARKERGREMEDYPROC pglStringMarkerGREMEDY=_Lazy_glStringMarkerGREMEDY; -#endif - -/* GL_EXT_packed_depth_stencil */ - -#ifdef __GLEE_GL_EXT_packed_depth_stencil -#endif - -/* GL_EXT_stencil_clear_tag */ - -#ifdef __GLEE_GL_EXT_stencil_clear_tag -void __stdcall _Lazy_glStencilClearTagEXT(GLsizei stencilTagBits, GLuint stencilClearTag) {if (GLeeInit()) glStencilClearTagEXT(stencilTagBits, stencilClearTag);} -PFNGLSTENCILCLEARTAGEXTPROC pglStencilClearTagEXT=_Lazy_glStencilClearTagEXT; -#endif - -/* GL_EXT_texture_sRGB */ - -#ifdef __GLEE_GL_EXT_texture_sRGB -#endif - -/* GL_EXT_framebuffer_blit */ - -#ifdef __GLEE_GL_EXT_framebuffer_blit -void __stdcall _Lazy_glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {if (GLeeInit()) glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);} -PFNGLBLITFRAMEBUFFEREXTPROC pglBlitFramebufferEXT=_Lazy_glBlitFramebufferEXT; -#endif - -/* GL_EXT_framebuffer_multisample */ - -#ifdef __GLEE_GL_EXT_framebuffer_multisample -void __stdcall _Lazy_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);} -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pglRenderbufferStorageMultisampleEXT=_Lazy_glRenderbufferStorageMultisampleEXT; -#endif - -/* GL_MESAX_texture_stack */ - -#ifdef __GLEE_GL_MESAX_texture_stack -#endif - -/* GL_EXT_timer_query */ - -#ifdef __GLEE_GL_EXT_timer_query -void __stdcall _Lazy_glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT * params) {if (GLeeInit()) glGetQueryObjecti64vEXT(id, pname, params);} -void __stdcall _Lazy_glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT * params) {if (GLeeInit()) glGetQueryObjectui64vEXT(id, pname, params);} -PFNGLGETQUERYOBJECTI64VEXTPROC pglGetQueryObjecti64vEXT=_Lazy_glGetQueryObjecti64vEXT; -PFNGLGETQUERYOBJECTUI64VEXTPROC pglGetQueryObjectui64vEXT=_Lazy_glGetQueryObjectui64vEXT; -#endif - -/* GL_EXT_gpu_program_parameters */ - -#ifdef __GLEE_GL_EXT_gpu_program_parameters -void __stdcall _Lazy_glProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * params) {if (GLeeInit()) glProgramEnvParameters4fvEXT(target, index, count, params);} -void __stdcall _Lazy_glProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * params) {if (GLeeInit()) glProgramLocalParameters4fvEXT(target, index, count, params);} -PFNGLPROGRAMENVPARAMETERS4FVEXTPROC pglProgramEnvParameters4fvEXT=_Lazy_glProgramEnvParameters4fvEXT; -PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC pglProgramLocalParameters4fvEXT=_Lazy_glProgramLocalParameters4fvEXT; -#endif - -/* GL_APPLE_flush_buffer_range */ - -#ifdef __GLEE_GL_APPLE_flush_buffer_range -void __stdcall _Lazy_glBufferParameteriAPPLE(GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glBufferParameteriAPPLE(target, pname, param);} -void __stdcall _Lazy_glFlushMappedBufferRangeAPPLE(GLenum target, GLintptr offset, GLsizeiptr size) {if (GLeeInit()) glFlushMappedBufferRangeAPPLE(target, offset, size);} -PFNGLBUFFERPARAMETERIAPPLEPROC pglBufferParameteriAPPLE=_Lazy_glBufferParameteriAPPLE; -PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC pglFlushMappedBufferRangeAPPLE=_Lazy_glFlushMappedBufferRangeAPPLE; -#endif - -/* GL_NV_gpu_program4 */ - -#ifdef __GLEE_GL_NV_gpu_program4 -void __stdcall _Lazy_glProgramLocalParameterI4iNV(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glProgramLocalParameterI4iNV(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramLocalParameterI4ivNV(GLenum target, GLuint index, const GLint * params) {if (GLeeInit()) glProgramLocalParameterI4ivNV(target, index, params);} -void __stdcall _Lazy_glProgramLocalParametersI4ivNV(GLenum target, GLuint index, GLsizei count, const GLint * params) {if (GLeeInit()) glProgramLocalParametersI4ivNV(target, index, count, params);} -void __stdcall _Lazy_glProgramLocalParameterI4uiNV(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glProgramLocalParameterI4uiNV(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramLocalParameterI4uivNV(GLenum target, GLuint index, const GLuint * params) {if (GLeeInit()) glProgramLocalParameterI4uivNV(target, index, params);} -void __stdcall _Lazy_glProgramLocalParametersI4uivNV(GLenum target, GLuint index, GLsizei count, const GLuint * params) {if (GLeeInit()) glProgramLocalParametersI4uivNV(target, index, count, params);} -void __stdcall _Lazy_glProgramEnvParameterI4iNV(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glProgramEnvParameterI4iNV(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramEnvParameterI4ivNV(GLenum target, GLuint index, const GLint * params) {if (GLeeInit()) glProgramEnvParameterI4ivNV(target, index, params);} -void __stdcall _Lazy_glProgramEnvParametersI4ivNV(GLenum target, GLuint index, GLsizei count, const GLint * params) {if (GLeeInit()) glProgramEnvParametersI4ivNV(target, index, count, params);} -void __stdcall _Lazy_glProgramEnvParameterI4uiNV(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glProgramEnvParameterI4uiNV(target, index, x, y, z, w);} -void __stdcall _Lazy_glProgramEnvParameterI4uivNV(GLenum target, GLuint index, const GLuint * params) {if (GLeeInit()) glProgramEnvParameterI4uivNV(target, index, params);} -void __stdcall _Lazy_glProgramEnvParametersI4uivNV(GLenum target, GLuint index, GLsizei count, const GLuint * params) {if (GLeeInit()) glProgramEnvParametersI4uivNV(target, index, count, params);} -void __stdcall _Lazy_glGetProgramLocalParameterIivNV(GLenum target, GLuint index, GLint * params) {if (GLeeInit()) glGetProgramLocalParameterIivNV(target, index, params);} -void __stdcall _Lazy_glGetProgramLocalParameterIuivNV(GLenum target, GLuint index, GLuint * params) {if (GLeeInit()) glGetProgramLocalParameterIuivNV(target, index, params);} -void __stdcall _Lazy_glGetProgramEnvParameterIivNV(GLenum target, GLuint index, GLint * params) {if (GLeeInit()) glGetProgramEnvParameterIivNV(target, index, params);} -void __stdcall _Lazy_glGetProgramEnvParameterIuivNV(GLenum target, GLuint index, GLuint * params) {if (GLeeInit()) glGetProgramEnvParameterIuivNV(target, index, params);} -PFNGLPROGRAMLOCALPARAMETERI4INVPROC pglProgramLocalParameterI4iNV=_Lazy_glProgramLocalParameterI4iNV; -PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC pglProgramLocalParameterI4ivNV=_Lazy_glProgramLocalParameterI4ivNV; -PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC pglProgramLocalParametersI4ivNV=_Lazy_glProgramLocalParametersI4ivNV; -PFNGLPROGRAMLOCALPARAMETERI4UINVPROC pglProgramLocalParameterI4uiNV=_Lazy_glProgramLocalParameterI4uiNV; -PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC pglProgramLocalParameterI4uivNV=_Lazy_glProgramLocalParameterI4uivNV; -PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC pglProgramLocalParametersI4uivNV=_Lazy_glProgramLocalParametersI4uivNV; -PFNGLPROGRAMENVPARAMETERI4INVPROC pglProgramEnvParameterI4iNV=_Lazy_glProgramEnvParameterI4iNV; -PFNGLPROGRAMENVPARAMETERI4IVNVPROC pglProgramEnvParameterI4ivNV=_Lazy_glProgramEnvParameterI4ivNV; -PFNGLPROGRAMENVPARAMETERSI4IVNVPROC pglProgramEnvParametersI4ivNV=_Lazy_glProgramEnvParametersI4ivNV; -PFNGLPROGRAMENVPARAMETERI4UINVPROC pglProgramEnvParameterI4uiNV=_Lazy_glProgramEnvParameterI4uiNV; -PFNGLPROGRAMENVPARAMETERI4UIVNVPROC pglProgramEnvParameterI4uivNV=_Lazy_glProgramEnvParameterI4uivNV; -PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC pglProgramEnvParametersI4uivNV=_Lazy_glProgramEnvParametersI4uivNV; -PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC pglGetProgramLocalParameterIivNV=_Lazy_glGetProgramLocalParameterIivNV; -PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC pglGetProgramLocalParameterIuivNV=_Lazy_glGetProgramLocalParameterIuivNV; -PFNGLGETPROGRAMENVPARAMETERIIVNVPROC pglGetProgramEnvParameterIivNV=_Lazy_glGetProgramEnvParameterIivNV; -PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC pglGetProgramEnvParameterIuivNV=_Lazy_glGetProgramEnvParameterIuivNV; -#endif - -/* GL_NV_geometry_program4 */ - -#ifdef __GLEE_GL_NV_geometry_program4 -void __stdcall _Lazy_glProgramVertexLimitNV(GLenum target, GLint limit) {if (GLeeInit()) glProgramVertexLimitNV(target, limit);} -void __stdcall _Lazy_glFramebufferTextureEXT(GLenum target, GLenum attachment, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTextureEXT(target, attachment, texture, level);} -void __stdcall _Lazy_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {if (GLeeInit()) glFramebufferTextureLayerEXT(target, attachment, texture, level, layer);} -void __stdcall _Lazy_glFramebufferTextureFaceEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) {if (GLeeInit()) glFramebufferTextureFaceEXT(target, attachment, texture, level, face);} -PFNGLPROGRAMVERTEXLIMITNVPROC pglProgramVertexLimitNV=_Lazy_glProgramVertexLimitNV; -PFNGLFRAMEBUFFERTEXTUREEXTPROC pglFramebufferTextureEXT=_Lazy_glFramebufferTextureEXT; -PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC pglFramebufferTextureLayerEXT=_Lazy_glFramebufferTextureLayerEXT; -PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC pglFramebufferTextureFaceEXT=_Lazy_glFramebufferTextureFaceEXT; -#endif - -/* GL_EXT_geometry_shader4 */ - -#ifdef __GLEE_GL_EXT_geometry_shader4 -void __stdcall _Lazy_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value) {if (GLeeInit()) glProgramParameteriEXT(program, pname, value);} -PFNGLPROGRAMPARAMETERIEXTPROC pglProgramParameteriEXT=_Lazy_glProgramParameteriEXT; -#endif - -/* GL_NV_vertex_program4 */ - -#ifdef __GLEE_GL_NV_vertex_program4 -void __stdcall _Lazy_glVertexAttribI1iEXT(GLuint index, GLint x) {if (GLeeInit()) glVertexAttribI1iEXT(index, x);} -void __stdcall _Lazy_glVertexAttribI2iEXT(GLuint index, GLint x, GLint y) {if (GLeeInit()) glVertexAttribI2iEXT(index, x, y);} -void __stdcall _Lazy_glVertexAttribI3iEXT(GLuint index, GLint x, GLint y, GLint z) {if (GLeeInit()) glVertexAttribI3iEXT(index, x, y, z);} -void __stdcall _Lazy_glVertexAttribI4iEXT(GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glVertexAttribI4iEXT(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttribI1uiEXT(GLuint index, GLuint x) {if (GLeeInit()) glVertexAttribI1uiEXT(index, x);} -void __stdcall _Lazy_glVertexAttribI2uiEXT(GLuint index, GLuint x, GLuint y) {if (GLeeInit()) glVertexAttribI2uiEXT(index, x, y);} -void __stdcall _Lazy_glVertexAttribI3uiEXT(GLuint index, GLuint x, GLuint y, GLuint z) {if (GLeeInit()) glVertexAttribI3uiEXT(index, x, y, z);} -void __stdcall _Lazy_glVertexAttribI4uiEXT(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glVertexAttribI4uiEXT(index, x, y, z, w);} -void __stdcall _Lazy_glVertexAttribI1ivEXT(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI1ivEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI2ivEXT(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI2ivEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI3ivEXT(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI3ivEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI4ivEXT(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI4ivEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI1uivEXT(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI1uivEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI2uivEXT(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI2uivEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI3uivEXT(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI3uivEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI4uivEXT(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI4uivEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI4bvEXT(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttribI4bvEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI4svEXT(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttribI4svEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI4ubvEXT(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttribI4ubvEXT(index, v);} -void __stdcall _Lazy_glVertexAttribI4usvEXT(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttribI4usvEXT(index, v);} -void __stdcall _Lazy_glVertexAttribIPointerEXT(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribIPointerEXT(index, size, type, stride, pointer);} -void __stdcall _Lazy_glGetVertexAttribIivEXT(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribIivEXT(index, pname, params);} -void __stdcall _Lazy_glGetVertexAttribIuivEXT(GLuint index, GLenum pname, GLuint * params) {if (GLeeInit()) glGetVertexAttribIuivEXT(index, pname, params);} -PFNGLVERTEXATTRIBI1IEXTPROC pglVertexAttribI1iEXT=_Lazy_glVertexAttribI1iEXT; -PFNGLVERTEXATTRIBI2IEXTPROC pglVertexAttribI2iEXT=_Lazy_glVertexAttribI2iEXT; -PFNGLVERTEXATTRIBI3IEXTPROC pglVertexAttribI3iEXT=_Lazy_glVertexAttribI3iEXT; -PFNGLVERTEXATTRIBI4IEXTPROC pglVertexAttribI4iEXT=_Lazy_glVertexAttribI4iEXT; -PFNGLVERTEXATTRIBI1UIEXTPROC pglVertexAttribI1uiEXT=_Lazy_glVertexAttribI1uiEXT; -PFNGLVERTEXATTRIBI2UIEXTPROC pglVertexAttribI2uiEXT=_Lazy_glVertexAttribI2uiEXT; -PFNGLVERTEXATTRIBI3UIEXTPROC pglVertexAttribI3uiEXT=_Lazy_glVertexAttribI3uiEXT; -PFNGLVERTEXATTRIBI4UIEXTPROC pglVertexAttribI4uiEXT=_Lazy_glVertexAttribI4uiEXT; -PFNGLVERTEXATTRIBI1IVEXTPROC pglVertexAttribI1ivEXT=_Lazy_glVertexAttribI1ivEXT; -PFNGLVERTEXATTRIBI2IVEXTPROC pglVertexAttribI2ivEXT=_Lazy_glVertexAttribI2ivEXT; -PFNGLVERTEXATTRIBI3IVEXTPROC pglVertexAttribI3ivEXT=_Lazy_glVertexAttribI3ivEXT; -PFNGLVERTEXATTRIBI4IVEXTPROC pglVertexAttribI4ivEXT=_Lazy_glVertexAttribI4ivEXT; -PFNGLVERTEXATTRIBI1UIVEXTPROC pglVertexAttribI1uivEXT=_Lazy_glVertexAttribI1uivEXT; -PFNGLVERTEXATTRIBI2UIVEXTPROC pglVertexAttribI2uivEXT=_Lazy_glVertexAttribI2uivEXT; -PFNGLVERTEXATTRIBI3UIVEXTPROC pglVertexAttribI3uivEXT=_Lazy_glVertexAttribI3uivEXT; -PFNGLVERTEXATTRIBI4UIVEXTPROC pglVertexAttribI4uivEXT=_Lazy_glVertexAttribI4uivEXT; -PFNGLVERTEXATTRIBI4BVEXTPROC pglVertexAttribI4bvEXT=_Lazy_glVertexAttribI4bvEXT; -PFNGLVERTEXATTRIBI4SVEXTPROC pglVertexAttribI4svEXT=_Lazy_glVertexAttribI4svEXT; -PFNGLVERTEXATTRIBI4UBVEXTPROC pglVertexAttribI4ubvEXT=_Lazy_glVertexAttribI4ubvEXT; -PFNGLVERTEXATTRIBI4USVEXTPROC pglVertexAttribI4usvEXT=_Lazy_glVertexAttribI4usvEXT; -PFNGLVERTEXATTRIBIPOINTEREXTPROC pglVertexAttribIPointerEXT=_Lazy_glVertexAttribIPointerEXT; -PFNGLGETVERTEXATTRIBIIVEXTPROC pglGetVertexAttribIivEXT=_Lazy_glGetVertexAttribIivEXT; -PFNGLGETVERTEXATTRIBIUIVEXTPROC pglGetVertexAttribIuivEXT=_Lazy_glGetVertexAttribIuivEXT; -#endif - -/* GL_EXT_gpu_shader4 */ - -#ifdef __GLEE_GL_EXT_gpu_shader4 -void __stdcall _Lazy_glGetUniformuivEXT(GLuint program, GLint location, GLuint * params) {if (GLeeInit()) glGetUniformuivEXT(program, location, params);} -void __stdcall _Lazy_glBindFragDataLocationEXT(GLuint program, GLuint color, const GLchar * name) {if (GLeeInit()) glBindFragDataLocationEXT(program, color, name);} -GLint __stdcall _Lazy_glGetFragDataLocationEXT(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetFragDataLocationEXT(program, name); return (GLint)0;} -void __stdcall _Lazy_glUniform1uiEXT(GLint location, GLuint v0) {if (GLeeInit()) glUniform1uiEXT(location, v0);} -void __stdcall _Lazy_glUniform2uiEXT(GLint location, GLuint v0, GLuint v1) {if (GLeeInit()) glUniform2uiEXT(location, v0, v1);} -void __stdcall _Lazy_glUniform3uiEXT(GLint location, GLuint v0, GLuint v1, GLuint v2) {if (GLeeInit()) glUniform3uiEXT(location, v0, v1, v2);} -void __stdcall _Lazy_glUniform4uiEXT(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {if (GLeeInit()) glUniform4uiEXT(location, v0, v1, v2, v3);} -void __stdcall _Lazy_glUniform1uivEXT(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform1uivEXT(location, count, value);} -void __stdcall _Lazy_glUniform2uivEXT(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform2uivEXT(location, count, value);} -void __stdcall _Lazy_glUniform3uivEXT(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform3uivEXT(location, count, value);} -void __stdcall _Lazy_glUniform4uivEXT(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform4uivEXT(location, count, value);} -PFNGLGETUNIFORMUIVEXTPROC pglGetUniformuivEXT=_Lazy_glGetUniformuivEXT; -PFNGLBINDFRAGDATALOCATIONEXTPROC pglBindFragDataLocationEXT=_Lazy_glBindFragDataLocationEXT; -PFNGLGETFRAGDATALOCATIONEXTPROC pglGetFragDataLocationEXT=_Lazy_glGetFragDataLocationEXT; -PFNGLUNIFORM1UIEXTPROC pglUniform1uiEXT=_Lazy_glUniform1uiEXT; -PFNGLUNIFORM2UIEXTPROC pglUniform2uiEXT=_Lazy_glUniform2uiEXT; -PFNGLUNIFORM3UIEXTPROC pglUniform3uiEXT=_Lazy_glUniform3uiEXT; -PFNGLUNIFORM4UIEXTPROC pglUniform4uiEXT=_Lazy_glUniform4uiEXT; -PFNGLUNIFORM1UIVEXTPROC pglUniform1uivEXT=_Lazy_glUniform1uivEXT; -PFNGLUNIFORM2UIVEXTPROC pglUniform2uivEXT=_Lazy_glUniform2uivEXT; -PFNGLUNIFORM3UIVEXTPROC pglUniform3uivEXT=_Lazy_glUniform3uivEXT; -PFNGLUNIFORM4UIVEXTPROC pglUniform4uivEXT=_Lazy_glUniform4uivEXT; -#endif - -/* GL_EXT_drawinstanced */ - -#ifdef __GLEE_GL_EXT_drawinstanced -void __stdcall _Lazy_glDrawArraysInstancedEXT(GLenum mode, GLint start, GLsizei count, GLsizei primcount) {if (GLeeInit()) glDrawArraysInstancedEXT(mode, start, count, primcount);} -void __stdcall _Lazy_glDrawElementsInstancedEXT(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount) {if (GLeeInit()) glDrawElementsInstancedEXT(mode, count, type, indices, primcount);} -PFNGLDRAWARRAYSINSTANCEDEXTPROC pglDrawArraysInstancedEXT=_Lazy_glDrawArraysInstancedEXT; -PFNGLDRAWELEMENTSINSTANCEDEXTPROC pglDrawElementsInstancedEXT=_Lazy_glDrawElementsInstancedEXT; -#endif - -/* GL_EXT_packed_float */ - -#ifdef __GLEE_GL_EXT_packed_float -#endif - -/* GL_EXT_texture_array */ - -#ifdef __GLEE_GL_EXT_texture_array -#endif - -/* GL_EXT_texture_buffer_object */ - -#ifdef __GLEE_GL_EXT_texture_buffer_object -void __stdcall _Lazy_glTexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer) {if (GLeeInit()) glTexBufferEXT(target, internalformat, buffer);} -PFNGLTEXBUFFEREXTPROC pglTexBufferEXT=_Lazy_glTexBufferEXT; -#endif - -/* GL_EXT_texture_compression_latc */ - -#ifdef __GLEE_GL_EXT_texture_compression_latc -#endif - -/* GL_EXT_texture_compression_rgtc */ - -#ifdef __GLEE_GL_EXT_texture_compression_rgtc -#endif - -/* GL_EXT_texture_shared_exponent */ - -#ifdef __GLEE_GL_EXT_texture_shared_exponent -#endif - -/* GL_NV_depth_buffer_float */ - -#ifdef __GLEE_GL_NV_depth_buffer_float -void __stdcall _Lazy_glDepthRangedNV(GLdouble zNear, GLdouble zFar) {if (GLeeInit()) glDepthRangedNV(zNear, zFar);} -void __stdcall _Lazy_glClearDepthdNV(GLdouble depth) {if (GLeeInit()) glClearDepthdNV(depth);} -void __stdcall _Lazy_glDepthBoundsdNV(GLdouble zmin, GLdouble zmax) {if (GLeeInit()) glDepthBoundsdNV(zmin, zmax);} -PFNGLDEPTHRANGEDNVPROC pglDepthRangedNV=_Lazy_glDepthRangedNV; -PFNGLCLEARDEPTHDNVPROC pglClearDepthdNV=_Lazy_glClearDepthdNV; -PFNGLDEPTHBOUNDSDNVPROC pglDepthBoundsdNV=_Lazy_glDepthBoundsdNV; -#endif - -/* GL_NV_fragment_program4 */ - -#ifdef __GLEE_GL_NV_fragment_program4 -#endif - -/* GL_NV_framebuffer_multisample_coverage */ - -#ifdef __GLEE_GL_NV_framebuffer_multisample_coverage -void __stdcall _Lazy_glRenderbufferStorageMultisampleCoverageNV(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorageMultisampleCoverageNV(target, coverageSamples, colorSamples, internalformat, width, height);} -PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC pglRenderbufferStorageMultisampleCoverageNV=_Lazy_glRenderbufferStorageMultisampleCoverageNV; -#endif - -/* GL_EXT_framebuffer_sRGB */ - -#ifdef __GLEE_GL_EXT_framebuffer_sRGB -#endif - -/* GL_NV_geometry_shader4 */ - -#ifdef __GLEE_GL_NV_geometry_shader4 -#endif - -/* GL_NV_parameter_buffer_object */ - -#ifdef __GLEE_GL_NV_parameter_buffer_object -void __stdcall _Lazy_glProgramBufferParametersfvNV(GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat * params) {if (GLeeInit()) glProgramBufferParametersfvNV(target, buffer, index, count, params);} -void __stdcall _Lazy_glProgramBufferParametersIivNV(GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint * params) {if (GLeeInit()) glProgramBufferParametersIivNV(target, buffer, index, count, params);} -void __stdcall _Lazy_glProgramBufferParametersIuivNV(GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint * params) {if (GLeeInit()) glProgramBufferParametersIuivNV(target, buffer, index, count, params);} -PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC pglProgramBufferParametersfvNV=_Lazy_glProgramBufferParametersfvNV; -PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC pglProgramBufferParametersIivNV=_Lazy_glProgramBufferParametersIivNV; -PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC pglProgramBufferParametersIuivNV=_Lazy_glProgramBufferParametersIuivNV; -#endif - -/* GL_EXT_draw_buffers2 */ - -#ifdef __GLEE_GL_EXT_draw_buffers2 -void __stdcall _Lazy_glColorMaskIndexedEXT(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {if (GLeeInit()) glColorMaskIndexedEXT(index, r, g, b, a);} -void __stdcall _Lazy_glGetBooleanIndexedvEXT(GLenum target, GLuint index, GLboolean * data) {if (GLeeInit()) glGetBooleanIndexedvEXT(target, index, data);} -void __stdcall _Lazy_glGetIntegerIndexedvEXT(GLenum target, GLuint index, GLint * data) {if (GLeeInit()) glGetIntegerIndexedvEXT(target, index, data);} -void __stdcall _Lazy_glEnableIndexedEXT(GLenum target, GLuint index) {if (GLeeInit()) glEnableIndexedEXT(target, index);} -void __stdcall _Lazy_glDisableIndexedEXT(GLenum target, GLuint index) {if (GLeeInit()) glDisableIndexedEXT(target, index);} -GLboolean __stdcall _Lazy_glIsEnabledIndexedEXT(GLenum target, GLuint index) {if (GLeeInit()) return glIsEnabledIndexedEXT(target, index); return (GLboolean)0;} -PFNGLCOLORMASKINDEXEDEXTPROC pglColorMaskIndexedEXT=_Lazy_glColorMaskIndexedEXT; -PFNGLGETBOOLEANINDEXEDVEXTPROC pglGetBooleanIndexedvEXT=_Lazy_glGetBooleanIndexedvEXT; -PFNGLGETINTEGERINDEXEDVEXTPROC pglGetIntegerIndexedvEXT=_Lazy_glGetIntegerIndexedvEXT; -PFNGLENABLEINDEXEDEXTPROC pglEnableIndexedEXT=_Lazy_glEnableIndexedEXT; -PFNGLDISABLEINDEXEDEXTPROC pglDisableIndexedEXT=_Lazy_glDisableIndexedEXT; -PFNGLISENABLEDINDEXEDEXTPROC pglIsEnabledIndexedEXT=_Lazy_glIsEnabledIndexedEXT; -#endif - -/* GL_NV_transform_feedback */ - -#ifdef __GLEE_GL_NV_transform_feedback -void __stdcall _Lazy_glBeginTransformFeedbackNV(GLenum primitiveMode) {if (GLeeInit()) glBeginTransformFeedbackNV(primitiveMode);} -void __stdcall _Lazy_glEndTransformFeedbackNV(void) {if (GLeeInit()) glEndTransformFeedbackNV();} -void __stdcall _Lazy_glTransformFeedbackAttribsNV(GLuint count, const GLint * attribs, GLenum bufferMode) {if (GLeeInit()) glTransformFeedbackAttribsNV(count, attribs, bufferMode);} -void __stdcall _Lazy_glBindBufferRangeNV(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {if (GLeeInit()) glBindBufferRangeNV(target, index, buffer, offset, size);} -void __stdcall _Lazy_glBindBufferOffsetNV(GLenum target, GLuint index, GLuint buffer, GLintptr offset) {if (GLeeInit()) glBindBufferOffsetNV(target, index, buffer, offset);} -void __stdcall _Lazy_glBindBufferBaseNV(GLenum target, GLuint index, GLuint buffer) {if (GLeeInit()) glBindBufferBaseNV(target, index, buffer);} -void __stdcall _Lazy_glTransformFeedbackVaryingsNV(GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode) {if (GLeeInit()) glTransformFeedbackVaryingsNV(program, count, locations, bufferMode);} -void __stdcall _Lazy_glActiveVaryingNV(GLuint program, const GLchar * name) {if (GLeeInit()) glActiveVaryingNV(program, name);} -GLint __stdcall _Lazy_glGetVaryingLocationNV(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetVaryingLocationNV(program, name); return (GLint)0;} -void __stdcall _Lazy_glGetActiveVaryingNV(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name) {if (GLeeInit()) glGetActiveVaryingNV(program, index, bufSize, length, size, type, name);} -void __stdcall _Lazy_glGetTransformFeedbackVaryingNV(GLuint program, GLuint index, GLint * location) {if (GLeeInit()) glGetTransformFeedbackVaryingNV(program, index, location);} -PFNGLBEGINTRANSFORMFEEDBACKNVPROC pglBeginTransformFeedbackNV=_Lazy_glBeginTransformFeedbackNV; -PFNGLENDTRANSFORMFEEDBACKNVPROC pglEndTransformFeedbackNV=_Lazy_glEndTransformFeedbackNV; -PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC pglTransformFeedbackAttribsNV=_Lazy_glTransformFeedbackAttribsNV; -PFNGLBINDBUFFERRANGENVPROC pglBindBufferRangeNV=_Lazy_glBindBufferRangeNV; -PFNGLBINDBUFFEROFFSETNVPROC pglBindBufferOffsetNV=_Lazy_glBindBufferOffsetNV; -PFNGLBINDBUFFERBASENVPROC pglBindBufferBaseNV=_Lazy_glBindBufferBaseNV; -PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC pglTransformFeedbackVaryingsNV=_Lazy_glTransformFeedbackVaryingsNV; -PFNGLACTIVEVARYINGNVPROC pglActiveVaryingNV=_Lazy_glActiveVaryingNV; -PFNGLGETVARYINGLOCATIONNVPROC pglGetVaryingLocationNV=_Lazy_glGetVaryingLocationNV; -PFNGLGETACTIVEVARYINGNVPROC pglGetActiveVaryingNV=_Lazy_glGetActiveVaryingNV; -PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC pglGetTransformFeedbackVaryingNV=_Lazy_glGetTransformFeedbackVaryingNV; -#endif - -/* GL_EXT_bindable_uniform */ - -#ifdef __GLEE_GL_EXT_bindable_uniform -void __stdcall _Lazy_glUniformBufferEXT(GLuint program, GLint location, GLuint buffer) {if (GLeeInit()) glUniformBufferEXT(program, location, buffer);} -GLint __stdcall _Lazy_glGetUniformBufferSizeEXT(GLuint program, GLint location) {if (GLeeInit()) return glGetUniformBufferSizeEXT(program, location); return (GLint)0;} -GLintptr __stdcall _Lazy_glGetUniformOffsetEXT(GLuint program, GLint location) {if (GLeeInit()) return glGetUniformOffsetEXT(program, location); return (GLintptr)0;} -PFNGLUNIFORMBUFFEREXTPROC pglUniformBufferEXT=_Lazy_glUniformBufferEXT; -PFNGLGETUNIFORMBUFFERSIZEEXTPROC pglGetUniformBufferSizeEXT=_Lazy_glGetUniformBufferSizeEXT; -PFNGLGETUNIFORMOFFSETEXTPROC pglGetUniformOffsetEXT=_Lazy_glGetUniformOffsetEXT; -#endif - -/* GL_EXT_texture_integer */ - -#ifdef __GLEE_GL_EXT_texture_integer -void __stdcall _Lazy_glTexParameterIivEXT(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glTexParameterIivEXT(target, pname, params);} -void __stdcall _Lazy_glTexParameterIuivEXT(GLenum target, GLenum pname, const GLuint * params) {if (GLeeInit()) glTexParameterIuivEXT(target, pname, params);} -void __stdcall _Lazy_glGetTexParameterIivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetTexParameterIivEXT(target, pname, params);} -void __stdcall _Lazy_glGetTexParameterIuivEXT(GLenum target, GLenum pname, GLuint * params) {if (GLeeInit()) glGetTexParameterIuivEXT(target, pname, params);} -void __stdcall _Lazy_glClearColorIiEXT(GLint red, GLint green, GLint blue, GLint alpha) {if (GLeeInit()) glClearColorIiEXT(red, green, blue, alpha);} -void __stdcall _Lazy_glClearColorIuiEXT(GLuint red, GLuint green, GLuint blue, GLuint alpha) {if (GLeeInit()) glClearColorIuiEXT(red, green, blue, alpha);} -PFNGLTEXPARAMETERIIVEXTPROC pglTexParameterIivEXT=_Lazy_glTexParameterIivEXT; -PFNGLTEXPARAMETERIUIVEXTPROC pglTexParameterIuivEXT=_Lazy_glTexParameterIuivEXT; -PFNGLGETTEXPARAMETERIIVEXTPROC pglGetTexParameterIivEXT=_Lazy_glGetTexParameterIivEXT; -PFNGLGETTEXPARAMETERIUIVEXTPROC pglGetTexParameterIuivEXT=_Lazy_glGetTexParameterIuivEXT; -PFNGLCLEARCOLORIIEXTPROC pglClearColorIiEXT=_Lazy_glClearColorIiEXT; -PFNGLCLEARCOLORIUIEXTPROC pglClearColorIuiEXT=_Lazy_glClearColorIuiEXT; -#endif - -/* GL_GREMEDY_frame_terminator */ - -#ifdef __GLEE_GL_GREMEDY_frame_terminator -void __stdcall _Lazy_glFrameTerminatorGREMEDY(void) {if (GLeeInit()) glFrameTerminatorGREMEDY();} -PFNGLFRAMETERMINATORGREMEDYPROC pglFrameTerminatorGREMEDY=_Lazy_glFrameTerminatorGREMEDY; -#endif - -/* GL_NV_conditional_render */ - -#ifdef __GLEE_GL_NV_conditional_render -void __stdcall _Lazy_glBeginConditionalRenderNV(GLuint id, GLenum mode) {if (GLeeInit()) glBeginConditionalRenderNV(id, mode);} -void __stdcall _Lazy_glEndConditionalRenderNV(void) {if (GLeeInit()) glEndConditionalRenderNV();} -PFNGLBEGINCONDITIONALRENDERNVPROC pglBeginConditionalRenderNV=_Lazy_glBeginConditionalRenderNV; -PFNGLENDCONDITIONALRENDERNVPROC pglEndConditionalRenderNV=_Lazy_glEndConditionalRenderNV; -#endif - -/* GL_NV_present_video */ - -#ifdef __GLEE_GL_NV_present_video -#endif - -/* GL_EXT_transform_feedback */ - -#ifdef __GLEE_GL_EXT_transform_feedback -void __stdcall _Lazy_glBeginTransformFeedbackEXT(GLenum primitiveMode) {if (GLeeInit()) glBeginTransformFeedbackEXT(primitiveMode);} -void __stdcall _Lazy_glEndTransformFeedbackEXT(void) {if (GLeeInit()) glEndTransformFeedbackEXT();} -void __stdcall _Lazy_glBindBufferRangeEXT(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {if (GLeeInit()) glBindBufferRangeEXT(target, index, buffer, offset, size);} -void __stdcall _Lazy_glBindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer, GLintptr offset) {if (GLeeInit()) glBindBufferOffsetEXT(target, index, buffer, offset);} -void __stdcall _Lazy_glBindBufferBaseEXT(GLenum target, GLuint index, GLuint buffer) {if (GLeeInit()) glBindBufferBaseEXT(target, index, buffer);} -void __stdcall _Lazy_glTransformFeedbackVaryingsEXT(GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode) {if (GLeeInit()) glTransformFeedbackVaryingsEXT(program, count, locations, bufferMode);} -void __stdcall _Lazy_glGetTransformFeedbackVaryingEXT(GLuint program, GLuint index, GLint * location) {if (GLeeInit()) glGetTransformFeedbackVaryingEXT(program, index, location);} -PFNGLBEGINTRANSFORMFEEDBACKEXTPROC pglBeginTransformFeedbackEXT=_Lazy_glBeginTransformFeedbackEXT; -PFNGLENDTRANSFORMFEEDBACKEXTPROC pglEndTransformFeedbackEXT=_Lazy_glEndTransformFeedbackEXT; -PFNGLBINDBUFFERRANGEEXTPROC pglBindBufferRangeEXT=_Lazy_glBindBufferRangeEXT; -PFNGLBINDBUFFEROFFSETEXTPROC pglBindBufferOffsetEXT=_Lazy_glBindBufferOffsetEXT; -PFNGLBINDBUFFERBASEEXTPROC pglBindBufferBaseEXT=_Lazy_glBindBufferBaseEXT; -PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC pglTransformFeedbackVaryingsEXT=_Lazy_glTransformFeedbackVaryingsEXT; -PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC pglGetTransformFeedbackVaryingEXT=_Lazy_glGetTransformFeedbackVaryingEXT; -#endif - -/* GL_EXT_direct_state_access */ - -#ifdef __GLEE_GL_EXT_direct_state_access -void __stdcall _Lazy_glClientAttribDefaultEXT(GLbitfield mask) {if (GLeeInit()) glClientAttribDefaultEXT(mask);} -void __stdcall _Lazy_glPushClientAttribDefaultEXT(GLbitfield mask) {if (GLeeInit()) glPushClientAttribDefaultEXT(mask);} -void __stdcall _Lazy_glMatrixLoadfEXT(GLenum mode, const GLfloat * m) {if (GLeeInit()) glMatrixLoadfEXT(mode, m);} -void __stdcall _Lazy_glMatrixLoaddEXT(GLenum mode, const GLdouble * m) {if (GLeeInit()) glMatrixLoaddEXT(mode, m);} -void __stdcall _Lazy_glMatrixMultfEXT(GLenum mode, const GLfloat * m) {if (GLeeInit()) glMatrixMultfEXT(mode, m);} -void __stdcall _Lazy_glMatrixMultdEXT(GLenum mode, const GLdouble * m) {if (GLeeInit()) glMatrixMultdEXT(mode, m);} -void __stdcall _Lazy_glMatrixLoadIdentityEXT(GLenum mode) {if (GLeeInit()) glMatrixLoadIdentityEXT(mode);} -void __stdcall _Lazy_glMatrixRotatefEXT(GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glMatrixRotatefEXT(mode, angle, x, y, z);} -void __stdcall _Lazy_glMatrixRotatedEXT(GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glMatrixRotatedEXT(mode, angle, x, y, z);} -void __stdcall _Lazy_glMatrixScalefEXT(GLenum mode, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glMatrixScalefEXT(mode, x, y, z);} -void __stdcall _Lazy_glMatrixScaledEXT(GLenum mode, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glMatrixScaledEXT(mode, x, y, z);} -void __stdcall _Lazy_glMatrixTranslatefEXT(GLenum mode, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glMatrixTranslatefEXT(mode, x, y, z);} -void __stdcall _Lazy_glMatrixTranslatedEXT(GLenum mode, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glMatrixTranslatedEXT(mode, x, y, z);} -void __stdcall _Lazy_glMatrixFrustumEXT(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) {if (GLeeInit()) glMatrixFrustumEXT(mode, left, right, bottom, top, zNear, zFar);} -void __stdcall _Lazy_glMatrixOrthoEXT(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) {if (GLeeInit()) glMatrixOrthoEXT(mode, left, right, bottom, top, zNear, zFar);} -void __stdcall _Lazy_glMatrixPopEXT(GLenum mode) {if (GLeeInit()) glMatrixPopEXT(mode);} -void __stdcall _Lazy_glMatrixPushEXT(GLenum mode) {if (GLeeInit()) glMatrixPushEXT(mode);} -void __stdcall _Lazy_glMatrixLoadTransposefEXT(GLenum mode, const GLfloat * m) {if (GLeeInit()) glMatrixLoadTransposefEXT(mode, m);} -void __stdcall _Lazy_glMatrixLoadTransposedEXT(GLenum mode, const GLdouble * m) {if (GLeeInit()) glMatrixLoadTransposedEXT(mode, m);} -void __stdcall _Lazy_glMatrixMultTransposefEXT(GLenum mode, const GLfloat * m) {if (GLeeInit()) glMatrixMultTransposefEXT(mode, m);} -void __stdcall _Lazy_glMatrixMultTransposedEXT(GLenum mode, const GLdouble * m) {if (GLeeInit()) glMatrixMultTransposedEXT(mode, m);} -void __stdcall _Lazy_glTextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glTextureParameterfEXT(texture, target, pname, param);} -void __stdcall _Lazy_glTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glTextureParameterfvEXT(texture, target, pname, params);} -void __stdcall _Lazy_glTextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glTextureParameteriEXT(texture, target, pname, param);} -void __stdcall _Lazy_glTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glTextureParameterivEXT(texture, target, pname, params);} -void __stdcall _Lazy_glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, pixels);} -void __stdcall _Lazy_glTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, pixels);} -void __stdcall _Lazy_glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, pixels);} -void __stdcall _Lazy_glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, pixels);} -void __stdcall _Lazy_glCopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {if (GLeeInit()) glCopyTextureImage1DEXT(texture, target, level, internalformat, x, y, width, border);} -void __stdcall _Lazy_glCopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {if (GLeeInit()) glCopyTextureImage2DEXT(texture, target, level, internalformat, x, y, width, height, border);} -void __stdcall _Lazy_glCopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyTextureSubImage1DEXT(texture, target, level, xoffset, x, y, width);} -void __stdcall _Lazy_glCopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, x, y, width, height);} -void __stdcall _Lazy_glGetTextureImageEXT(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) {if (GLeeInit()) glGetTextureImageEXT(texture, target, level, format, type, pixels);} -void __stdcall _Lazy_glGetTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetTextureParameterfvEXT(texture, target, pname, params);} -void __stdcall _Lazy_glGetTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetTextureParameterivEXT(texture, target, pname, params);} -void __stdcall _Lazy_glGetTextureLevelParameterfvEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetTextureLevelParameterfvEXT(texture, target, level, pname, params);} -void __stdcall _Lazy_glGetTextureLevelParameterivEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLint * params) {if (GLeeInit()) glGetTextureLevelParameterivEXT(texture, target, level, pname, params);} -void __stdcall _Lazy_glTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, pixels);} -void __stdcall _Lazy_glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);} -void __stdcall _Lazy_glCopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, x, y, width, height);} -void __stdcall _Lazy_glMultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glMultiTexParameterfEXT(texunit, target, pname, param);} -void __stdcall _Lazy_glMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glMultiTexParameterfvEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glMultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glMultiTexParameteriEXT(texunit, target, pname, param);} -void __stdcall _Lazy_glMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glMultiTexParameterivEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, pixels);} -void __stdcall _Lazy_glMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, pixels);} -void __stdcall _Lazy_glMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, pixels);} -void __stdcall _Lazy_glMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels);} -void __stdcall _Lazy_glCopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {if (GLeeInit()) glCopyMultiTexImage1DEXT(texunit, target, level, internalformat, x, y, width, border);} -void __stdcall _Lazy_glCopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {if (GLeeInit()) glCopyMultiTexImage2DEXT(texunit, target, level, internalformat, x, y, width, height, border);} -void __stdcall _Lazy_glCopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyMultiTexSubImage1DEXT(texunit, target, level, xoffset, x, y, width);} -void __stdcall _Lazy_glCopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, x, y, width, height);} -void __stdcall _Lazy_glGetMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) {if (GLeeInit()) glGetMultiTexImageEXT(texunit, target, level, format, type, pixels);} -void __stdcall _Lazy_glGetMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMultiTexParameterfvEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glGetMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexParameterivEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glGetMultiTexLevelParameterfvEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMultiTexLevelParameterfvEXT(texunit, target, level, pname, params);} -void __stdcall _Lazy_glGetMultiTexLevelParameterivEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexLevelParameterivEXT(texunit, target, level, pname, params);} -void __stdcall _Lazy_glMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels);} -void __stdcall _Lazy_glMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);} -void __stdcall _Lazy_glCopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, x, y, width, height);} -void __stdcall _Lazy_glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture) {if (GLeeInit()) glBindMultiTextureEXT(texunit, target, texture);} -void __stdcall _Lazy_glEnableClientStateIndexedEXT(GLenum array, GLuint index) {if (GLeeInit()) glEnableClientStateIndexedEXT(array, index);} -void __stdcall _Lazy_glDisableClientStateIndexedEXT(GLenum array, GLuint index) {if (GLeeInit()) glDisableClientStateIndexedEXT(array, index);} -void __stdcall _Lazy_glMultiTexCoordPointerEXT(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glMultiTexCoordPointerEXT(texunit, size, type, stride, pointer);} -void __stdcall _Lazy_glMultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glMultiTexEnvfEXT(texunit, target, pname, param);} -void __stdcall _Lazy_glMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glMultiTexEnvfvEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glMultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glMultiTexEnviEXT(texunit, target, pname, param);} -void __stdcall _Lazy_glMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glMultiTexEnvivEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glMultiTexGendEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) {if (GLeeInit()) glMultiTexGendEXT(texunit, coord, pname, param);} -void __stdcall _Lazy_glMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLdouble * params) {if (GLeeInit()) glMultiTexGendvEXT(texunit, coord, pname, params);} -void __stdcall _Lazy_glMultiTexGenfEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) {if (GLeeInit()) glMultiTexGenfEXT(texunit, coord, pname, param);} -void __stdcall _Lazy_glMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLfloat * params) {if (GLeeInit()) glMultiTexGenfvEXT(texunit, coord, pname, params);} -void __stdcall _Lazy_glMultiTexGeniEXT(GLenum texunit, GLenum coord, GLenum pname, GLint param) {if (GLeeInit()) glMultiTexGeniEXT(texunit, coord, pname, param);} -void __stdcall _Lazy_glMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, const GLint * params) {if (GLeeInit()) glMultiTexGenivEXT(texunit, coord, pname, params);} -void __stdcall _Lazy_glGetMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMultiTexEnvfvEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glGetMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexEnvivEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glGetMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetMultiTexGendvEXT(texunit, coord, pname, params);} -void __stdcall _Lazy_glGetMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMultiTexGenfvEXT(texunit, coord, pname, params);} -void __stdcall _Lazy_glGetMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexGenivEXT(texunit, coord, pname, params);} -void __stdcall _Lazy_glGetFloatIndexedvEXT(GLenum target, GLuint index, GLfloat * data) {if (GLeeInit()) glGetFloatIndexedvEXT(target, index, data);} -void __stdcall _Lazy_glGetDoubleIndexedvEXT(GLenum target, GLuint index, GLdouble * data) {if (GLeeInit()) glGetDoubleIndexedvEXT(target, index, data);} -void __stdcall _Lazy_glGetPointerIndexedvEXT(GLenum target, GLuint index, GLvoid* * data) {if (GLeeInit()) glGetPointerIndexedvEXT(target, index, data);} -void __stdcall _Lazy_glCompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, imageSize, bits);} -void __stdcall _Lazy_glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureImage2DEXT(texture, target, level, internalformat, width, height, border, imageSize, bits);} -void __stdcall _Lazy_glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureImage1DEXT(texture, target, level, internalformat, width, border, imageSize, bits);} -void __stdcall _Lazy_glCompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);} -void __stdcall _Lazy_glCompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, imageSize, bits);} -void __stdcall _Lazy_glCompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureSubImage1DEXT(texture, target, level, xoffset, width, format, imageSize, bits);} -void __stdcall _Lazy_glGetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint lod, GLvoid * img) {if (GLeeInit()) glGetCompressedTextureImageEXT(texture, target, lod, img);} -void __stdcall _Lazy_glCompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, imageSize, bits);} -void __stdcall _Lazy_glCompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, imageSize, bits);} -void __stdcall _Lazy_glCompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, imageSize, bits);} -void __stdcall _Lazy_glCompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);} -void __stdcall _Lazy_glCompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, imageSize, bits);} -void __stdcall _Lazy_glCompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, imageSize, bits);} -void __stdcall _Lazy_glGetCompressedMultiTexImageEXT(GLenum texunit, GLenum target, GLint lod, GLvoid * img) {if (GLeeInit()) glGetCompressedMultiTexImageEXT(texunit, target, lod, img);} -void __stdcall _Lazy_glNamedProgramStringEXT(GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid * string) {if (GLeeInit()) glNamedProgramStringEXT(program, target, format, len, string);} -void __stdcall _Lazy_glNamedProgramLocalParameter4dEXT(GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glNamedProgramLocalParameter4dEXT(program, target, index, x, y, z, w);} -void __stdcall _Lazy_glNamedProgramLocalParameter4dvEXT(GLuint program, GLenum target, GLuint index, const GLdouble * params) {if (GLeeInit()) glNamedProgramLocalParameter4dvEXT(program, target, index, params);} -void __stdcall _Lazy_glNamedProgramLocalParameter4fEXT(GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glNamedProgramLocalParameter4fEXT(program, target, index, x, y, z, w);} -void __stdcall _Lazy_glNamedProgramLocalParameter4fvEXT(GLuint program, GLenum target, GLuint index, const GLfloat * params) {if (GLeeInit()) glNamedProgramLocalParameter4fvEXT(program, target, index, params);} -void __stdcall _Lazy_glGetNamedProgramLocalParameterdvEXT(GLuint program, GLenum target, GLuint index, GLdouble * params) {if (GLeeInit()) glGetNamedProgramLocalParameterdvEXT(program, target, index, params);} -void __stdcall _Lazy_glGetNamedProgramLocalParameterfvEXT(GLuint program, GLenum target, GLuint index, GLfloat * params) {if (GLeeInit()) glGetNamedProgramLocalParameterfvEXT(program, target, index, params);} -void __stdcall _Lazy_glGetNamedProgramivEXT(GLuint program, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetNamedProgramivEXT(program, target, pname, params);} -void __stdcall _Lazy_glGetNamedProgramStringEXT(GLuint program, GLenum target, GLenum pname, GLvoid * string) {if (GLeeInit()) glGetNamedProgramStringEXT(program, target, pname, string);} -void __stdcall _Lazy_glNamedProgramLocalParameters4fvEXT(GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat * params) {if (GLeeInit()) glNamedProgramLocalParameters4fvEXT(program, target, index, count, params);} -void __stdcall _Lazy_glNamedProgramLocalParameterI4iEXT(GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glNamedProgramLocalParameterI4iEXT(program, target, index, x, y, z, w);} -void __stdcall _Lazy_glNamedProgramLocalParameterI4ivEXT(GLuint program, GLenum target, GLuint index, const GLint * params) {if (GLeeInit()) glNamedProgramLocalParameterI4ivEXT(program, target, index, params);} -void __stdcall _Lazy_glNamedProgramLocalParametersI4ivEXT(GLuint program, GLenum target, GLuint index, GLsizei count, const GLint * params) {if (GLeeInit()) glNamedProgramLocalParametersI4ivEXT(program, target, index, count, params);} -void __stdcall _Lazy_glNamedProgramLocalParameterI4uiEXT(GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glNamedProgramLocalParameterI4uiEXT(program, target, index, x, y, z, w);} -void __stdcall _Lazy_glNamedProgramLocalParameterI4uivEXT(GLuint program, GLenum target, GLuint index, const GLuint * params) {if (GLeeInit()) glNamedProgramLocalParameterI4uivEXT(program, target, index, params);} -void __stdcall _Lazy_glNamedProgramLocalParametersI4uivEXT(GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint * params) {if (GLeeInit()) glNamedProgramLocalParametersI4uivEXT(program, target, index, count, params);} -void __stdcall _Lazy_glGetNamedProgramLocalParameterIivEXT(GLuint program, GLenum target, GLuint index, GLint * params) {if (GLeeInit()) glGetNamedProgramLocalParameterIivEXT(program, target, index, params);} -void __stdcall _Lazy_glGetNamedProgramLocalParameterIuivEXT(GLuint program, GLenum target, GLuint index, GLuint * params) {if (GLeeInit()) glGetNamedProgramLocalParameterIuivEXT(program, target, index, params);} -void __stdcall _Lazy_glTextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glTextureParameterIivEXT(texture, target, pname, params);} -void __stdcall _Lazy_glTextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, const GLuint * params) {if (GLeeInit()) glTextureParameterIuivEXT(texture, target, pname, params);} -void __stdcall _Lazy_glGetTextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetTextureParameterIivEXT(texture, target, pname, params);} -void __stdcall _Lazy_glGetTextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, GLuint * params) {if (GLeeInit()) glGetTextureParameterIuivEXT(texture, target, pname, params);} -void __stdcall _Lazy_glMultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glMultiTexParameterIivEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glMultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, const GLuint * params) {if (GLeeInit()) glMultiTexParameterIuivEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glGetMultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexParameterIivEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glGetMultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, GLuint * params) {if (GLeeInit()) glGetMultiTexParameterIuivEXT(texunit, target, pname, params);} -void __stdcall _Lazy_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat v0) {if (GLeeInit()) glProgramUniform1fEXT(program, location, v0);} -void __stdcall _Lazy_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1) {if (GLeeInit()) glProgramUniform2fEXT(program, location, v0, v1);} -void __stdcall _Lazy_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {if (GLeeInit()) glProgramUniform3fEXT(program, location, v0, v1, v2);} -void __stdcall _Lazy_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {if (GLeeInit()) glProgramUniform4fEXT(program, location, v0, v1, v2, v3);} -void __stdcall _Lazy_glProgramUniform1iEXT(GLuint program, GLint location, GLint v0) {if (GLeeInit()) glProgramUniform1iEXT(program, location, v0);} -void __stdcall _Lazy_glProgramUniform2iEXT(GLuint program, GLint location, GLint v0, GLint v1) {if (GLeeInit()) glProgramUniform2iEXT(program, location, v0, v1);} -void __stdcall _Lazy_glProgramUniform3iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2) {if (GLeeInit()) glProgramUniform3iEXT(program, location, v0, v1, v2);} -void __stdcall _Lazy_glProgramUniform4iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {if (GLeeInit()) glProgramUniform4iEXT(program, location, v0, v1, v2, v3);} -void __stdcall _Lazy_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glProgramUniform1fvEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glProgramUniform2fvEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glProgramUniform3fvEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glProgramUniform4fvEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glProgramUniform1ivEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glProgramUniform2ivEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glProgramUniform3ivEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glProgramUniform4ivEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix2fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix3fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix4fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniformMatrix2x3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix2x3fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniformMatrix3x2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix3x2fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniformMatrix2x4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix2x4fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniformMatrix4x2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix4x2fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniformMatrix3x4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix3x4fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniformMatrix4x3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix4x3fvEXT(program, location, count, transpose, value);} -void __stdcall _Lazy_glProgramUniform1uiEXT(GLuint program, GLint location, GLuint v0) {if (GLeeInit()) glProgramUniform1uiEXT(program, location, v0);} -void __stdcall _Lazy_glProgramUniform2uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1) {if (GLeeInit()) glProgramUniform2uiEXT(program, location, v0, v1);} -void __stdcall _Lazy_glProgramUniform3uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) {if (GLeeInit()) glProgramUniform3uiEXT(program, location, v0, v1, v2);} -void __stdcall _Lazy_glProgramUniform4uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {if (GLeeInit()) glProgramUniform4uiEXT(program, location, v0, v1, v2, v3);} -void __stdcall _Lazy_glProgramUniform1uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glProgramUniform1uivEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform2uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glProgramUniform2uivEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform3uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glProgramUniform3uivEXT(program, location, count, value);} -void __stdcall _Lazy_glProgramUniform4uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glProgramUniform4uivEXT(program, location, count, value);} -void __stdcall _Lazy_glNamedBufferDataEXT(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLenum usage) {if (GLeeInit()) glNamedBufferDataEXT(buffer, size, data, usage);} -void __stdcall _Lazy_glNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid * data) {if (GLeeInit()) glNamedBufferSubDataEXT(buffer, offset, size, data);} -GLvoid* __stdcall _Lazy_glMapNamedBufferEXT(GLuint buffer, GLenum access) {if (GLeeInit()) return glMapNamedBufferEXT(buffer, access); return (GLvoid*)0;} -GLboolean __stdcall _Lazy_glUnmapNamedBufferEXT(GLuint buffer) {if (GLeeInit()) return glUnmapNamedBufferEXT(buffer); return (GLboolean)0;} -void __stdcall _Lazy_glGetNamedBufferParameterivEXT(GLuint buffer, GLenum pname, GLint * params) {if (GLeeInit()) glGetNamedBufferParameterivEXT(buffer, pname, params);} -void __stdcall _Lazy_glGetNamedBufferPointervEXT(GLuint buffer, GLenum pname, GLvoid* * params) {if (GLeeInit()) glGetNamedBufferPointervEXT(buffer, pname, params);} -void __stdcall _Lazy_glGetNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data) {if (GLeeInit()) glGetNamedBufferSubDataEXT(buffer, offset, size, data);} -void __stdcall _Lazy_glTextureBufferEXT(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer) {if (GLeeInit()) glTextureBufferEXT(texture, target, internalformat, buffer);} -void __stdcall _Lazy_glMultiTexBufferEXT(GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer) {if (GLeeInit()) glMultiTexBufferEXT(texunit, target, internalformat, buffer);} -void __stdcall _Lazy_glNamedRenderbufferStorageEXT(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glNamedRenderbufferStorageEXT(renderbuffer, internalformat, width, height);} -void __stdcall _Lazy_glGetNamedRenderbufferParameterivEXT(GLuint renderbuffer, GLenum pname, GLint * params) {if (GLeeInit()) glGetNamedRenderbufferParameterivEXT(renderbuffer, pname, params);} -GLenum __stdcall _Lazy_glCheckNamedFramebufferStatusEXT(GLuint framebuffer, GLenum target) {if (GLeeInit()) return glCheckNamedFramebufferStatusEXT(framebuffer, target); return (GLenum)0;} -void __stdcall _Lazy_glNamedFramebufferTexture1DEXT(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glNamedFramebufferTexture1DEXT(framebuffer, attachment, textarget, texture, level);} -void __stdcall _Lazy_glNamedFramebufferTexture2DEXT(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glNamedFramebufferTexture2DEXT(framebuffer, attachment, textarget, texture, level);} -void __stdcall _Lazy_glNamedFramebufferTexture3DEXT(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {if (GLeeInit()) glNamedFramebufferTexture3DEXT(framebuffer, attachment, textarget, texture, level, zoffset);} -void __stdcall _Lazy_glNamedFramebufferRenderbufferEXT(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {if (GLeeInit()) glNamedFramebufferRenderbufferEXT(framebuffer, attachment, renderbuffertarget, renderbuffer);} -void __stdcall _Lazy_glGetNamedFramebufferAttachmentParameterivEXT(GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params) {if (GLeeInit()) glGetNamedFramebufferAttachmentParameterivEXT(framebuffer, attachment, pname, params);} -void __stdcall _Lazy_glGenerateTextureMipmapEXT(GLuint texture, GLenum target) {if (GLeeInit()) glGenerateTextureMipmapEXT(texture, target);} -void __stdcall _Lazy_glGenerateMultiTexMipmapEXT(GLenum texunit, GLenum target) {if (GLeeInit()) glGenerateMultiTexMipmapEXT(texunit, target);} -void __stdcall _Lazy_glFramebufferDrawBufferEXT(GLuint framebuffer, GLenum mode) {if (GLeeInit()) glFramebufferDrawBufferEXT(framebuffer, mode);} -void __stdcall _Lazy_glFramebufferDrawBuffersEXT(GLuint framebuffer, GLsizei n, const GLenum * bufs) {if (GLeeInit()) glFramebufferDrawBuffersEXT(framebuffer, n, bufs);} -void __stdcall _Lazy_glFramebufferReadBufferEXT(GLuint framebuffer, GLenum mode) {if (GLeeInit()) glFramebufferReadBufferEXT(framebuffer, mode);} -void __stdcall _Lazy_glGetFramebufferParameterivEXT(GLuint framebuffer, GLenum pname, GLint * params) {if (GLeeInit()) glGetFramebufferParameterivEXT(framebuffer, pname, params);} -void __stdcall _Lazy_glNamedRenderbufferStorageMultisampleEXT(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glNamedRenderbufferStorageMultisampleEXT(renderbuffer, samples, internalformat, width, height);} -void __stdcall _Lazy_glNamedRenderbufferStorageMultisampleCoverageEXT(GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glNamedRenderbufferStorageMultisampleCoverageEXT(renderbuffer, coverageSamples, colorSamples, internalformat, width, height);} -void __stdcall _Lazy_glNamedFramebufferTextureEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) {if (GLeeInit()) glNamedFramebufferTextureEXT(framebuffer, attachment, texture, level);} -void __stdcall _Lazy_glNamedFramebufferTextureLayerEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer) {if (GLeeInit()) glNamedFramebufferTextureLayerEXT(framebuffer, attachment, texture, level, layer);} -void __stdcall _Lazy_glNamedFramebufferTextureFaceEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face) {if (GLeeInit()) glNamedFramebufferTextureFaceEXT(framebuffer, attachment, texture, level, face);} -void __stdcall _Lazy_glTextureRenderbufferEXT(GLuint texture, GLenum target, GLuint renderbuffer) {if (GLeeInit()) glTextureRenderbufferEXT(texture, target, renderbuffer);} -void __stdcall _Lazy_glMultiTexRenderbufferEXT(GLenum texunit, GLenum target, GLuint renderbuffer) {if (GLeeInit()) glMultiTexRenderbufferEXT(texunit, target, renderbuffer);} -PFNGLCLIENTATTRIBDEFAULTEXTPROC pglClientAttribDefaultEXT=_Lazy_glClientAttribDefaultEXT; -PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC pglPushClientAttribDefaultEXT=_Lazy_glPushClientAttribDefaultEXT; -PFNGLMATRIXLOADFEXTPROC pglMatrixLoadfEXT=_Lazy_glMatrixLoadfEXT; -PFNGLMATRIXLOADDEXTPROC pglMatrixLoaddEXT=_Lazy_glMatrixLoaddEXT; -PFNGLMATRIXMULTFEXTPROC pglMatrixMultfEXT=_Lazy_glMatrixMultfEXT; -PFNGLMATRIXMULTDEXTPROC pglMatrixMultdEXT=_Lazy_glMatrixMultdEXT; -PFNGLMATRIXLOADIDENTITYEXTPROC pglMatrixLoadIdentityEXT=_Lazy_glMatrixLoadIdentityEXT; -PFNGLMATRIXROTATEFEXTPROC pglMatrixRotatefEXT=_Lazy_glMatrixRotatefEXT; -PFNGLMATRIXROTATEDEXTPROC pglMatrixRotatedEXT=_Lazy_glMatrixRotatedEXT; -PFNGLMATRIXSCALEFEXTPROC pglMatrixScalefEXT=_Lazy_glMatrixScalefEXT; -PFNGLMATRIXSCALEDEXTPROC pglMatrixScaledEXT=_Lazy_glMatrixScaledEXT; -PFNGLMATRIXTRANSLATEFEXTPROC pglMatrixTranslatefEXT=_Lazy_glMatrixTranslatefEXT; -PFNGLMATRIXTRANSLATEDEXTPROC pglMatrixTranslatedEXT=_Lazy_glMatrixTranslatedEXT; -PFNGLMATRIXFRUSTUMEXTPROC pglMatrixFrustumEXT=_Lazy_glMatrixFrustumEXT; -PFNGLMATRIXORTHOEXTPROC pglMatrixOrthoEXT=_Lazy_glMatrixOrthoEXT; -PFNGLMATRIXPOPEXTPROC pglMatrixPopEXT=_Lazy_glMatrixPopEXT; -PFNGLMATRIXPUSHEXTPROC pglMatrixPushEXT=_Lazy_glMatrixPushEXT; -PFNGLMATRIXLOADTRANSPOSEFEXTPROC pglMatrixLoadTransposefEXT=_Lazy_glMatrixLoadTransposefEXT; -PFNGLMATRIXLOADTRANSPOSEDEXTPROC pglMatrixLoadTransposedEXT=_Lazy_glMatrixLoadTransposedEXT; -PFNGLMATRIXMULTTRANSPOSEFEXTPROC pglMatrixMultTransposefEXT=_Lazy_glMatrixMultTransposefEXT; -PFNGLMATRIXMULTTRANSPOSEDEXTPROC pglMatrixMultTransposedEXT=_Lazy_glMatrixMultTransposedEXT; -PFNGLTEXTUREPARAMETERFEXTPROC pglTextureParameterfEXT=_Lazy_glTextureParameterfEXT; -PFNGLTEXTUREPARAMETERFVEXTPROC pglTextureParameterfvEXT=_Lazy_glTextureParameterfvEXT; -PFNGLTEXTUREPARAMETERIEXTPROC pglTextureParameteriEXT=_Lazy_glTextureParameteriEXT; -PFNGLTEXTUREPARAMETERIVEXTPROC pglTextureParameterivEXT=_Lazy_glTextureParameterivEXT; -PFNGLTEXTUREIMAGE1DEXTPROC pglTextureImage1DEXT=_Lazy_glTextureImage1DEXT; -PFNGLTEXTUREIMAGE2DEXTPROC pglTextureImage2DEXT=_Lazy_glTextureImage2DEXT; -PFNGLTEXTURESUBIMAGE1DEXTPROC pglTextureSubImage1DEXT=_Lazy_glTextureSubImage1DEXT; -PFNGLTEXTURESUBIMAGE2DEXTPROC pglTextureSubImage2DEXT=_Lazy_glTextureSubImage2DEXT; -PFNGLCOPYTEXTUREIMAGE1DEXTPROC pglCopyTextureImage1DEXT=_Lazy_glCopyTextureImage1DEXT; -PFNGLCOPYTEXTUREIMAGE2DEXTPROC pglCopyTextureImage2DEXT=_Lazy_glCopyTextureImage2DEXT; -PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC pglCopyTextureSubImage1DEXT=_Lazy_glCopyTextureSubImage1DEXT; -PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC pglCopyTextureSubImage2DEXT=_Lazy_glCopyTextureSubImage2DEXT; -PFNGLGETTEXTUREIMAGEEXTPROC pglGetTextureImageEXT=_Lazy_glGetTextureImageEXT; -PFNGLGETTEXTUREPARAMETERFVEXTPROC pglGetTextureParameterfvEXT=_Lazy_glGetTextureParameterfvEXT; -PFNGLGETTEXTUREPARAMETERIVEXTPROC pglGetTextureParameterivEXT=_Lazy_glGetTextureParameterivEXT; -PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC pglGetTextureLevelParameterfvEXT=_Lazy_glGetTextureLevelParameterfvEXT; -PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC pglGetTextureLevelParameterivEXT=_Lazy_glGetTextureLevelParameterivEXT; -PFNGLTEXTUREIMAGE3DEXTPROC pglTextureImage3DEXT=_Lazy_glTextureImage3DEXT; -PFNGLTEXTURESUBIMAGE3DEXTPROC pglTextureSubImage3DEXT=_Lazy_glTextureSubImage3DEXT; -PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC pglCopyTextureSubImage3DEXT=_Lazy_glCopyTextureSubImage3DEXT; -PFNGLMULTITEXPARAMETERFEXTPROC pglMultiTexParameterfEXT=_Lazy_glMultiTexParameterfEXT; -PFNGLMULTITEXPARAMETERFVEXTPROC pglMultiTexParameterfvEXT=_Lazy_glMultiTexParameterfvEXT; -PFNGLMULTITEXPARAMETERIEXTPROC pglMultiTexParameteriEXT=_Lazy_glMultiTexParameteriEXT; -PFNGLMULTITEXPARAMETERIVEXTPROC pglMultiTexParameterivEXT=_Lazy_glMultiTexParameterivEXT; -PFNGLMULTITEXIMAGE1DEXTPROC pglMultiTexImage1DEXT=_Lazy_glMultiTexImage1DEXT; -PFNGLMULTITEXIMAGE2DEXTPROC pglMultiTexImage2DEXT=_Lazy_glMultiTexImage2DEXT; -PFNGLMULTITEXSUBIMAGE1DEXTPROC pglMultiTexSubImage1DEXT=_Lazy_glMultiTexSubImage1DEXT; -PFNGLMULTITEXSUBIMAGE2DEXTPROC pglMultiTexSubImage2DEXT=_Lazy_glMultiTexSubImage2DEXT; -PFNGLCOPYMULTITEXIMAGE1DEXTPROC pglCopyMultiTexImage1DEXT=_Lazy_glCopyMultiTexImage1DEXT; -PFNGLCOPYMULTITEXIMAGE2DEXTPROC pglCopyMultiTexImage2DEXT=_Lazy_glCopyMultiTexImage2DEXT; -PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC pglCopyMultiTexSubImage1DEXT=_Lazy_glCopyMultiTexSubImage1DEXT; -PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC pglCopyMultiTexSubImage2DEXT=_Lazy_glCopyMultiTexSubImage2DEXT; -PFNGLGETMULTITEXIMAGEEXTPROC pglGetMultiTexImageEXT=_Lazy_glGetMultiTexImageEXT; -PFNGLGETMULTITEXPARAMETERFVEXTPROC pglGetMultiTexParameterfvEXT=_Lazy_glGetMultiTexParameterfvEXT; -PFNGLGETMULTITEXPARAMETERIVEXTPROC pglGetMultiTexParameterivEXT=_Lazy_glGetMultiTexParameterivEXT; -PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC pglGetMultiTexLevelParameterfvEXT=_Lazy_glGetMultiTexLevelParameterfvEXT; -PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC pglGetMultiTexLevelParameterivEXT=_Lazy_glGetMultiTexLevelParameterivEXT; -PFNGLMULTITEXIMAGE3DEXTPROC pglMultiTexImage3DEXT=_Lazy_glMultiTexImage3DEXT; -PFNGLMULTITEXSUBIMAGE3DEXTPROC pglMultiTexSubImage3DEXT=_Lazy_glMultiTexSubImage3DEXT; -PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC pglCopyMultiTexSubImage3DEXT=_Lazy_glCopyMultiTexSubImage3DEXT; -PFNGLBINDMULTITEXTUREEXTPROC pglBindMultiTextureEXT=_Lazy_glBindMultiTextureEXT; -PFNGLENABLECLIENTSTATEINDEXEDEXTPROC pglEnableClientStateIndexedEXT=_Lazy_glEnableClientStateIndexedEXT; -PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC pglDisableClientStateIndexedEXT=_Lazy_glDisableClientStateIndexedEXT; -PFNGLMULTITEXCOORDPOINTEREXTPROC pglMultiTexCoordPointerEXT=_Lazy_glMultiTexCoordPointerEXT; -PFNGLMULTITEXENVFEXTPROC pglMultiTexEnvfEXT=_Lazy_glMultiTexEnvfEXT; -PFNGLMULTITEXENVFVEXTPROC pglMultiTexEnvfvEXT=_Lazy_glMultiTexEnvfvEXT; -PFNGLMULTITEXENVIEXTPROC pglMultiTexEnviEXT=_Lazy_glMultiTexEnviEXT; -PFNGLMULTITEXENVIVEXTPROC pglMultiTexEnvivEXT=_Lazy_glMultiTexEnvivEXT; -PFNGLMULTITEXGENDEXTPROC pglMultiTexGendEXT=_Lazy_glMultiTexGendEXT; -PFNGLMULTITEXGENDVEXTPROC pglMultiTexGendvEXT=_Lazy_glMultiTexGendvEXT; -PFNGLMULTITEXGENFEXTPROC pglMultiTexGenfEXT=_Lazy_glMultiTexGenfEXT; -PFNGLMULTITEXGENFVEXTPROC pglMultiTexGenfvEXT=_Lazy_glMultiTexGenfvEXT; -PFNGLMULTITEXGENIEXTPROC pglMultiTexGeniEXT=_Lazy_glMultiTexGeniEXT; -PFNGLMULTITEXGENIVEXTPROC pglMultiTexGenivEXT=_Lazy_glMultiTexGenivEXT; -PFNGLGETMULTITEXENVFVEXTPROC pglGetMultiTexEnvfvEXT=_Lazy_glGetMultiTexEnvfvEXT; -PFNGLGETMULTITEXENVIVEXTPROC pglGetMultiTexEnvivEXT=_Lazy_glGetMultiTexEnvivEXT; -PFNGLGETMULTITEXGENDVEXTPROC pglGetMultiTexGendvEXT=_Lazy_glGetMultiTexGendvEXT; -PFNGLGETMULTITEXGENFVEXTPROC pglGetMultiTexGenfvEXT=_Lazy_glGetMultiTexGenfvEXT; -PFNGLGETMULTITEXGENIVEXTPROC pglGetMultiTexGenivEXT=_Lazy_glGetMultiTexGenivEXT; -PFNGLGETFLOATINDEXEDVEXTPROC pglGetFloatIndexedvEXT=_Lazy_glGetFloatIndexedvEXT; -PFNGLGETDOUBLEINDEXEDVEXTPROC pglGetDoubleIndexedvEXT=_Lazy_glGetDoubleIndexedvEXT; -PFNGLGETPOINTERINDEXEDVEXTPROC pglGetPointerIndexedvEXT=_Lazy_glGetPointerIndexedvEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC pglCompressedTextureImage3DEXT=_Lazy_glCompressedTextureImage3DEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC pglCompressedTextureImage2DEXT=_Lazy_glCompressedTextureImage2DEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC pglCompressedTextureImage1DEXT=_Lazy_glCompressedTextureImage1DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC pglCompressedTextureSubImage3DEXT=_Lazy_glCompressedTextureSubImage3DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC pglCompressedTextureSubImage2DEXT=_Lazy_glCompressedTextureSubImage2DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC pglCompressedTextureSubImage1DEXT=_Lazy_glCompressedTextureSubImage1DEXT; -PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC pglGetCompressedTextureImageEXT=_Lazy_glGetCompressedTextureImageEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC pglCompressedMultiTexImage3DEXT=_Lazy_glCompressedMultiTexImage3DEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC pglCompressedMultiTexImage2DEXT=_Lazy_glCompressedMultiTexImage2DEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC pglCompressedMultiTexImage1DEXT=_Lazy_glCompressedMultiTexImage1DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC pglCompressedMultiTexSubImage3DEXT=_Lazy_glCompressedMultiTexSubImage3DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC pglCompressedMultiTexSubImage2DEXT=_Lazy_glCompressedMultiTexSubImage2DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC pglCompressedMultiTexSubImage1DEXT=_Lazy_glCompressedMultiTexSubImage1DEXT; -PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC pglGetCompressedMultiTexImageEXT=_Lazy_glGetCompressedMultiTexImageEXT; -PFNGLNAMEDPROGRAMSTRINGEXTPROC pglNamedProgramStringEXT=_Lazy_glNamedProgramStringEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC pglNamedProgramLocalParameter4dEXT=_Lazy_glNamedProgramLocalParameter4dEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC pglNamedProgramLocalParameter4dvEXT=_Lazy_glNamedProgramLocalParameter4dvEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC pglNamedProgramLocalParameter4fEXT=_Lazy_glNamedProgramLocalParameter4fEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC pglNamedProgramLocalParameter4fvEXT=_Lazy_glNamedProgramLocalParameter4fvEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC pglGetNamedProgramLocalParameterdvEXT=_Lazy_glGetNamedProgramLocalParameterdvEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC pglGetNamedProgramLocalParameterfvEXT=_Lazy_glGetNamedProgramLocalParameterfvEXT; -PFNGLGETNAMEDPROGRAMIVEXTPROC pglGetNamedProgramivEXT=_Lazy_glGetNamedProgramivEXT; -PFNGLGETNAMEDPROGRAMSTRINGEXTPROC pglGetNamedProgramStringEXT=_Lazy_glGetNamedProgramStringEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC pglNamedProgramLocalParameters4fvEXT=_Lazy_glNamedProgramLocalParameters4fvEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC pglNamedProgramLocalParameterI4iEXT=_Lazy_glNamedProgramLocalParameterI4iEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC pglNamedProgramLocalParameterI4ivEXT=_Lazy_glNamedProgramLocalParameterI4ivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC pglNamedProgramLocalParametersI4ivEXT=_Lazy_glNamedProgramLocalParametersI4ivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC pglNamedProgramLocalParameterI4uiEXT=_Lazy_glNamedProgramLocalParameterI4uiEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC pglNamedProgramLocalParameterI4uivEXT=_Lazy_glNamedProgramLocalParameterI4uivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC pglNamedProgramLocalParametersI4uivEXT=_Lazy_glNamedProgramLocalParametersI4uivEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC pglGetNamedProgramLocalParameterIivEXT=_Lazy_glGetNamedProgramLocalParameterIivEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC pglGetNamedProgramLocalParameterIuivEXT=_Lazy_glGetNamedProgramLocalParameterIuivEXT; -PFNGLTEXTUREPARAMETERIIVEXTPROC pglTextureParameterIivEXT=_Lazy_glTextureParameterIivEXT; -PFNGLTEXTUREPARAMETERIUIVEXTPROC pglTextureParameterIuivEXT=_Lazy_glTextureParameterIuivEXT; -PFNGLGETTEXTUREPARAMETERIIVEXTPROC pglGetTextureParameterIivEXT=_Lazy_glGetTextureParameterIivEXT; -PFNGLGETTEXTUREPARAMETERIUIVEXTPROC pglGetTextureParameterIuivEXT=_Lazy_glGetTextureParameterIuivEXT; -PFNGLMULTITEXPARAMETERIIVEXTPROC pglMultiTexParameterIivEXT=_Lazy_glMultiTexParameterIivEXT; -PFNGLMULTITEXPARAMETERIUIVEXTPROC pglMultiTexParameterIuivEXT=_Lazy_glMultiTexParameterIuivEXT; -PFNGLGETMULTITEXPARAMETERIIVEXTPROC pglGetMultiTexParameterIivEXT=_Lazy_glGetMultiTexParameterIivEXT; -PFNGLGETMULTITEXPARAMETERIUIVEXTPROC pglGetMultiTexParameterIuivEXT=_Lazy_glGetMultiTexParameterIuivEXT; -PFNGLPROGRAMUNIFORM1FEXTPROC pglProgramUniform1fEXT=_Lazy_glProgramUniform1fEXT; -PFNGLPROGRAMUNIFORM2FEXTPROC pglProgramUniform2fEXT=_Lazy_glProgramUniform2fEXT; -PFNGLPROGRAMUNIFORM3FEXTPROC pglProgramUniform3fEXT=_Lazy_glProgramUniform3fEXT; -PFNGLPROGRAMUNIFORM4FEXTPROC pglProgramUniform4fEXT=_Lazy_glProgramUniform4fEXT; -PFNGLPROGRAMUNIFORM1IEXTPROC pglProgramUniform1iEXT=_Lazy_glProgramUniform1iEXT; -PFNGLPROGRAMUNIFORM2IEXTPROC pglProgramUniform2iEXT=_Lazy_glProgramUniform2iEXT; -PFNGLPROGRAMUNIFORM3IEXTPROC pglProgramUniform3iEXT=_Lazy_glProgramUniform3iEXT; -PFNGLPROGRAMUNIFORM4IEXTPROC pglProgramUniform4iEXT=_Lazy_glProgramUniform4iEXT; -PFNGLPROGRAMUNIFORM1FVEXTPROC pglProgramUniform1fvEXT=_Lazy_glProgramUniform1fvEXT; -PFNGLPROGRAMUNIFORM2FVEXTPROC pglProgramUniform2fvEXT=_Lazy_glProgramUniform2fvEXT; -PFNGLPROGRAMUNIFORM3FVEXTPROC pglProgramUniform3fvEXT=_Lazy_glProgramUniform3fvEXT; -PFNGLPROGRAMUNIFORM4FVEXTPROC pglProgramUniform4fvEXT=_Lazy_glProgramUniform4fvEXT; -PFNGLPROGRAMUNIFORM1IVEXTPROC pglProgramUniform1ivEXT=_Lazy_glProgramUniform1ivEXT; -PFNGLPROGRAMUNIFORM2IVEXTPROC pglProgramUniform2ivEXT=_Lazy_glProgramUniform2ivEXT; -PFNGLPROGRAMUNIFORM3IVEXTPROC pglProgramUniform3ivEXT=_Lazy_glProgramUniform3ivEXT; -PFNGLPROGRAMUNIFORM4IVEXTPROC pglProgramUniform4ivEXT=_Lazy_glProgramUniform4ivEXT; -PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC pglProgramUniformMatrix2fvEXT=_Lazy_glProgramUniformMatrix2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC pglProgramUniformMatrix3fvEXT=_Lazy_glProgramUniformMatrix3fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC pglProgramUniformMatrix4fvEXT=_Lazy_glProgramUniformMatrix4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC pglProgramUniformMatrix2x3fvEXT=_Lazy_glProgramUniformMatrix2x3fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC pglProgramUniformMatrix3x2fvEXT=_Lazy_glProgramUniformMatrix3x2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC pglProgramUniformMatrix2x4fvEXT=_Lazy_glProgramUniformMatrix2x4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC pglProgramUniformMatrix4x2fvEXT=_Lazy_glProgramUniformMatrix4x2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC pglProgramUniformMatrix3x4fvEXT=_Lazy_glProgramUniformMatrix3x4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC pglProgramUniformMatrix4x3fvEXT=_Lazy_glProgramUniformMatrix4x3fvEXT; -PFNGLPROGRAMUNIFORM1UIEXTPROC pglProgramUniform1uiEXT=_Lazy_glProgramUniform1uiEXT; -PFNGLPROGRAMUNIFORM2UIEXTPROC pglProgramUniform2uiEXT=_Lazy_glProgramUniform2uiEXT; -PFNGLPROGRAMUNIFORM3UIEXTPROC pglProgramUniform3uiEXT=_Lazy_glProgramUniform3uiEXT; -PFNGLPROGRAMUNIFORM4UIEXTPROC pglProgramUniform4uiEXT=_Lazy_glProgramUniform4uiEXT; -PFNGLPROGRAMUNIFORM1UIVEXTPROC pglProgramUniform1uivEXT=_Lazy_glProgramUniform1uivEXT; -PFNGLPROGRAMUNIFORM2UIVEXTPROC pglProgramUniform2uivEXT=_Lazy_glProgramUniform2uivEXT; -PFNGLPROGRAMUNIFORM3UIVEXTPROC pglProgramUniform3uivEXT=_Lazy_glProgramUniform3uivEXT; -PFNGLPROGRAMUNIFORM4UIVEXTPROC pglProgramUniform4uivEXT=_Lazy_glProgramUniform4uivEXT; -PFNGLNAMEDBUFFERDATAEXTPROC pglNamedBufferDataEXT=_Lazy_glNamedBufferDataEXT; -PFNGLNAMEDBUFFERSUBDATAEXTPROC pglNamedBufferSubDataEXT=_Lazy_glNamedBufferSubDataEXT; -PFNGLMAPNAMEDBUFFEREXTPROC pglMapNamedBufferEXT=_Lazy_glMapNamedBufferEXT; -PFNGLUNMAPNAMEDBUFFEREXTPROC pglUnmapNamedBufferEXT=_Lazy_glUnmapNamedBufferEXT; -PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC pglGetNamedBufferParameterivEXT=_Lazy_glGetNamedBufferParameterivEXT; -PFNGLGETNAMEDBUFFERPOINTERVEXTPROC pglGetNamedBufferPointervEXT=_Lazy_glGetNamedBufferPointervEXT; -PFNGLGETNAMEDBUFFERSUBDATAEXTPROC pglGetNamedBufferSubDataEXT=_Lazy_glGetNamedBufferSubDataEXT; -PFNGLTEXTUREBUFFEREXTPROC pglTextureBufferEXT=_Lazy_glTextureBufferEXT; -PFNGLMULTITEXBUFFEREXTPROC pglMultiTexBufferEXT=_Lazy_glMultiTexBufferEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC pglNamedRenderbufferStorageEXT=_Lazy_glNamedRenderbufferStorageEXT; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC pglGetNamedRenderbufferParameterivEXT=_Lazy_glGetNamedRenderbufferParameterivEXT; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC pglCheckNamedFramebufferStatusEXT=_Lazy_glCheckNamedFramebufferStatusEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC pglNamedFramebufferTexture1DEXT=_Lazy_glNamedFramebufferTexture1DEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC pglNamedFramebufferTexture2DEXT=_Lazy_glNamedFramebufferTexture2DEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC pglNamedFramebufferTexture3DEXT=_Lazy_glNamedFramebufferTexture3DEXT; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC pglNamedFramebufferRenderbufferEXT=_Lazy_glNamedFramebufferRenderbufferEXT; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC pglGetNamedFramebufferAttachmentParameterivEXT=_Lazy_glGetNamedFramebufferAttachmentParameterivEXT; -PFNGLGENERATETEXTUREMIPMAPEXTPROC pglGenerateTextureMipmapEXT=_Lazy_glGenerateTextureMipmapEXT; -PFNGLGENERATEMULTITEXMIPMAPEXTPROC pglGenerateMultiTexMipmapEXT=_Lazy_glGenerateMultiTexMipmapEXT; -PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC pglFramebufferDrawBufferEXT=_Lazy_glFramebufferDrawBufferEXT; -PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC pglFramebufferDrawBuffersEXT=_Lazy_glFramebufferDrawBuffersEXT; -PFNGLFRAMEBUFFERREADBUFFEREXTPROC pglFramebufferReadBufferEXT=_Lazy_glFramebufferReadBufferEXT; -PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC pglGetFramebufferParameterivEXT=_Lazy_glGetFramebufferParameterivEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pglNamedRenderbufferStorageMultisampleEXT=_Lazy_glNamedRenderbufferStorageMultisampleEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC pglNamedRenderbufferStorageMultisampleCoverageEXT=_Lazy_glNamedRenderbufferStorageMultisampleCoverageEXT; -PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC pglNamedFramebufferTextureEXT=_Lazy_glNamedFramebufferTextureEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC pglNamedFramebufferTextureLayerEXT=_Lazy_glNamedFramebufferTextureLayerEXT; -PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC pglNamedFramebufferTextureFaceEXT=_Lazy_glNamedFramebufferTextureFaceEXT; -PFNGLTEXTURERENDERBUFFEREXTPROC pglTextureRenderbufferEXT=_Lazy_glTextureRenderbufferEXT; -PFNGLMULTITEXRENDERBUFFEREXTPROC pglMultiTexRenderbufferEXT=_Lazy_glMultiTexRenderbufferEXT; -#endif - -/* GL_EXT_vertex_array_bgra */ - -#ifdef __GLEE_GL_EXT_vertex_array_bgra -#endif - -/* GL_SGIX_texture_select */ - -#ifdef __GLEE_GL_SGIX_texture_select -#endif - -/* GL_INGR_blend_func_separate */ - -#ifdef __GLEE_GL_INGR_blend_func_separate -void __stdcall _Lazy_glBlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {if (GLeeInit()) glBlendFuncSeparateINGR(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);} -PFNGLBLENDFUNCSEPARATEINGRPROC pglBlendFuncSeparateINGR=_Lazy_glBlendFuncSeparateINGR; -#endif - -/* GL_SGIX_depth_pass_instrument */ - -#ifdef __GLEE_GL_SGIX_depth_pass_instrument -#endif - -/* GL_SGIX_igloo_interface */ - -#ifdef __GLEE_GL_SGIX_igloo_interface -void __stdcall _Lazy_glIglooInterfaceSGIX(GLenum pname, const GLvoid * params) {if (GLeeInit()) glIglooInterfaceSGIX(pname, params);} -PFNGLIGLOOINTERFACESGIXPROC pglIglooInterfaceSGIX=_Lazy_glIglooInterfaceSGIX; -#endif - -/* GL_EXT_fragment_lighting */ - -#ifdef __GLEE_GL_EXT_fragment_lighting -GLvoid __stdcall _Lazy_glFragmentLightModeliEXT(GLenum pname, GLint param) {if (GLeeInit()) glFragmentLightModeliEXT(pname, param);} -GLvoid __stdcall _Lazy_glFragmentLightModelfEXT(GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentLightModelfEXT(pname, param);} -GLvoid __stdcall _Lazy_glFragmentLightModelivEXT(GLenum pname, GLint * params) {if (GLeeInit()) glFragmentLightModelivEXT(pname, params);} -GLvoid __stdcall _Lazy_glFragmentLightModelfvEXT(GLenum pname, GLfloat * params) {if (GLeeInit()) glFragmentLightModelfvEXT(pname, params);} -GLvoid __stdcall _Lazy_glFragmentLightiEXT(GLenum light, GLenum pname, GLint param) {if (GLeeInit()) glFragmentLightiEXT(light, pname, param);} -GLvoid __stdcall _Lazy_glFragmentLightfEXT(GLenum light, GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentLightfEXT(light, pname, param);} -GLvoid __stdcall _Lazy_glFragmentLightivEXT(GLenum light, GLenum pname, GLint * params) {if (GLeeInit()) glFragmentLightivEXT(light, pname, params);} -GLvoid __stdcall _Lazy_glFragmentLightfvEXT(GLenum light, GLenum pname, GLfloat * params) {if (GLeeInit()) glFragmentLightfvEXT(light, pname, params);} -GLvoid __stdcall _Lazy_glGetFragmentLightivEXT(GLenum light, GLenum pname, GLint * params) {if (GLeeInit()) glGetFragmentLightivEXT(light, pname, params);} -GLvoid __stdcall _Lazy_glGetFragmentLightfvEXT(GLenum light, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetFragmentLightfvEXT(light, pname, params);} -GLvoid __stdcall _Lazy_glFragmentMaterialfEXT(GLenum face, GLenum pname, const GLfloat param) {if (GLeeInit()) glFragmentMaterialfEXT(face, pname, param);} -GLvoid __stdcall _Lazy_glFragmentMaterialiEXT(GLenum face, GLenum pname, const GLint param) {if (GLeeInit()) glFragmentMaterialiEXT(face, pname, param);} -GLvoid __stdcall _Lazy_glFragmentMaterialfvEXT(GLenum face, GLenum pname, const GLfloat * params) {if (GLeeInit()) glFragmentMaterialfvEXT(face, pname, params);} -GLvoid __stdcall _Lazy_glFragmentMaterialivEXT(GLenum face, GLenum pname, const GLint * params) {if (GLeeInit()) glFragmentMaterialivEXT(face, pname, params);} -GLvoid __stdcall _Lazy_glFragmentColorMaterialEXT(GLenum face, GLenum mode) {if (GLeeInit()) glFragmentColorMaterialEXT(face, mode);} -GLvoid __stdcall _Lazy_glGetFragmentMaterialfvEXT(GLenum face, GLenum pname, const GLfloat * params) {if (GLeeInit()) glGetFragmentMaterialfvEXT(face, pname, params);} -GLvoid __stdcall _Lazy_glGetFragmentMaterialivEXT(GLenum face, GLenum pname, const GLint * params) {if (GLeeInit()) glGetFragmentMaterialivEXT(face, pname, params);} -GLvoid __stdcall _Lazy_glLightEnviEXT(GLenum pname, GLint param) {if (GLeeInit()) glLightEnviEXT(pname, param);} -PFNGLFRAGMENTLIGHTMODELIEXTPROC pglFragmentLightModeliEXT=_Lazy_glFragmentLightModeliEXT; -PFNGLFRAGMENTLIGHTMODELFEXTPROC pglFragmentLightModelfEXT=_Lazy_glFragmentLightModelfEXT; -PFNGLFRAGMENTLIGHTMODELIVEXTPROC pglFragmentLightModelivEXT=_Lazy_glFragmentLightModelivEXT; -PFNGLFRAGMENTLIGHTMODELFVEXTPROC pglFragmentLightModelfvEXT=_Lazy_glFragmentLightModelfvEXT; -PFNGLFRAGMENTLIGHTIEXTPROC pglFragmentLightiEXT=_Lazy_glFragmentLightiEXT; -PFNGLFRAGMENTLIGHTFEXTPROC pglFragmentLightfEXT=_Lazy_glFragmentLightfEXT; -PFNGLFRAGMENTLIGHTIVEXTPROC pglFragmentLightivEXT=_Lazy_glFragmentLightivEXT; -PFNGLFRAGMENTLIGHTFVEXTPROC pglFragmentLightfvEXT=_Lazy_glFragmentLightfvEXT; -PFNGLGETFRAGMENTLIGHTIVEXTPROC pglGetFragmentLightivEXT=_Lazy_glGetFragmentLightivEXT; -PFNGLGETFRAGMENTLIGHTFVEXTPROC pglGetFragmentLightfvEXT=_Lazy_glGetFragmentLightfvEXT; -PFNGLFRAGMENTMATERIALFEXTPROC pglFragmentMaterialfEXT=_Lazy_glFragmentMaterialfEXT; -PFNGLFRAGMENTMATERIALIEXTPROC pglFragmentMaterialiEXT=_Lazy_glFragmentMaterialiEXT; -PFNGLFRAGMENTMATERIALFVEXTPROC pglFragmentMaterialfvEXT=_Lazy_glFragmentMaterialfvEXT; -PFNGLFRAGMENTMATERIALIVEXTPROC pglFragmentMaterialivEXT=_Lazy_glFragmentMaterialivEXT; -PFNGLFRAGMENTCOLORMATERIALEXTPROC pglFragmentColorMaterialEXT=_Lazy_glFragmentColorMaterialEXT; -PFNGLGETFRAGMENTMATERIALFVEXTPROC pglGetFragmentMaterialfvEXT=_Lazy_glGetFragmentMaterialfvEXT; -PFNGLGETFRAGMENTMATERIALIVEXTPROC pglGetFragmentMaterialivEXT=_Lazy_glGetFragmentMaterialivEXT; -PFNGLLIGHTENVIEXTPROC pglLightEnviEXT=_Lazy_glLightEnviEXT; -#endif - -/* GL_EXT_scene_marker */ - -#ifdef __GLEE_GL_EXT_scene_marker -GLvoid __stdcall _Lazy_glBeginSceneEXT(void) {if (GLeeInit()) glBeginSceneEXT();} -GLvoid __stdcall _Lazy_glEndSceneEXT(void) {if (GLeeInit()) glEndSceneEXT();} -PFNGLBEGINSCENEEXTPROC pglBeginSceneEXT=_Lazy_glBeginSceneEXT; -PFNGLENDSCENEEXTPROC pglEndSceneEXT=_Lazy_glEndSceneEXT; -#endif - -/* GL_EXT_texture_compression_dxt1 */ - -#ifdef __GLEE_GL_EXT_texture_compression_dxt1 -#endif - -/* GL_EXT_texture_env */ - -#ifdef __GLEE_GL_EXT_texture_env -#endif - -/* GL_IBM_static_data */ - -#ifdef __GLEE_GL_IBM_static_data -#endif - -/* GL_OES_byte_coordinates */ - -#ifdef __GLEE_GL_OES_byte_coordinates -#endif - -/* GL_OES_compressed_paletted_texture */ - -#ifdef __GLEE_GL_OES_compressed_paletted_texture -#endif - -/* GL_OES_single_precision */ - -#ifdef __GLEE_GL_OES_single_precision -GLvoid __stdcall _Lazy_glDepthRangefOES(GLclampf n, GLclampf f) {if (GLeeInit()) glDepthRangefOES(n, f);} -GLvoid __stdcall _Lazy_glFrustumfOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) {if (GLeeInit()) glFrustumfOES(l, r, b, t, n, f);} -GLvoid __stdcall _Lazy_glOrthofOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) {if (GLeeInit()) glOrthofOES(l, r, b, t, n, f);} -GLvoid __stdcall _Lazy_glClipPlanefOES(GLenum plane, const GLfloat* equation) {if (GLeeInit()) glClipPlanefOES(plane, equation);} -GLvoid __stdcall _Lazy_glGetClipPlanefOES(GLenum plane, GLfloat* equation) {if (GLeeInit()) glGetClipPlanefOES(plane, equation);} -GLvoid __stdcall _Lazy_glClearDepthfOES(GLclampd depth) {if (GLeeInit()) glClearDepthfOES(depth);} -PFNGLDEPTHRANGEFOESPROC pglDepthRangefOES=_Lazy_glDepthRangefOES; -PFNGLFRUSTUMFOESPROC pglFrustumfOES=_Lazy_glFrustumfOES; -PFNGLORTHOFOESPROC pglOrthofOES=_Lazy_glOrthofOES; -PFNGLCLIPPLANEFOESPROC pglClipPlanefOES=_Lazy_glClipPlanefOES; -PFNGLGETCLIPPLANEFOESPROC pglGetClipPlanefOES=_Lazy_glGetClipPlanefOES; -PFNGLCLEARDEPTHFOESPROC pglClearDepthfOES=_Lazy_glClearDepthfOES; -#endif - -/* GL_SGIX_pixel_texture_bits */ - -#ifdef __GLEE_GL_SGIX_pixel_texture_bits -#endif - -/* GL_SGIX_texture_range */ - -#ifdef __GLEE_GL_SGIX_texture_range -#endif - -/* WGL */ - -#ifdef WIN32 - -/* Extension querying variables */ - -GLboolean _GLEE_WGL_ARB_buffer_region = GL_FALSE; -GLboolean _GLEE_WGL_ARB_multisample = GL_FALSE; -GLboolean _GLEE_WGL_ARB_extensions_string = GL_FALSE; -GLboolean _GLEE_WGL_ARB_pixel_format = GL_FALSE; -GLboolean _GLEE_WGL_ARB_make_current_read = GL_FALSE; -GLboolean _GLEE_WGL_ARB_pbuffer = GL_FALSE; -GLboolean _GLEE_WGL_ARB_render_texture = GL_FALSE; -GLboolean _GLEE_WGL_ARB_pixel_format_float = GL_FALSE; -GLboolean _GLEE_WGL_ARB_create_context = GL_FALSE; -GLboolean _GLEE_WGL_EXT_make_current_read = GL_FALSE; -GLboolean _GLEE_WGL_EXT_pixel_format = GL_FALSE; -GLboolean _GLEE_WGL_EXT_pbuffer = GL_FALSE; -GLboolean _GLEE_WGL_EXT_depth_float = GL_FALSE; -GLboolean _GLEE_WGL_3DFX_multisample = GL_FALSE; -GLboolean _GLEE_WGL_EXT_multisample = GL_FALSE; -GLboolean _GLEE_WGL_I3D_digital_video_control = GL_FALSE; -GLboolean _GLEE_WGL_I3D_gamma = GL_FALSE; -GLboolean _GLEE_WGL_I3D_genlock = GL_FALSE; -GLboolean _GLEE_WGL_I3D_image_buffer = GL_FALSE; -GLboolean _GLEE_WGL_I3D_swap_frame_lock = GL_FALSE; -GLboolean _GLEE_WGL_NV_render_depth_texture = GL_FALSE; -GLboolean _GLEE_WGL_NV_render_texture_rectangle = GL_FALSE; -GLboolean _GLEE_WGL_ATI_pixel_format_float = GL_FALSE; -GLboolean _GLEE_WGL_NV_float_buffer = GL_FALSE; -GLboolean _GLEE_WGL_3DL_stereo_control = GL_FALSE; -GLboolean _GLEE_WGL_EXT_pixel_format_packed_float = GL_FALSE; -GLboolean _GLEE_WGL_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean _GLEE_WGL_NV_present_video = GL_FALSE; -GLboolean _GLEE_WGL_NV_video_out = GL_FALSE; -GLboolean _GLEE_WGL_NV_swap_group = GL_FALSE; -GLboolean _GLEE_WGL_EXT_display_color_table = GL_FALSE; -GLboolean _GLEE_WGL_EXT_extensions_string = GL_FALSE; -GLboolean _GLEE_WGL_EXT_swap_control = GL_FALSE; -GLboolean _GLEE_WGL_NV_vertex_array_range = GL_FALSE; -GLboolean _GLEE_WGL_OML_sync_control = GL_FALSE; -GLboolean _GLEE_WGL_I3D_swap_frame_usage = GL_FALSE; -GLboolean _GLEE_WGL_NV_video_output = GL_FALSE; - -/* WGL Extension names */ - -char __GLeeWGLExtensionNames[37][34]={ - "WGL_ARB_buffer_region", - "WGL_ARB_multisample", - "WGL_ARB_extensions_string", - "WGL_ARB_pixel_format", - "WGL_ARB_make_current_read", - "WGL_ARB_pbuffer", - "WGL_ARB_render_texture", - "WGL_ARB_pixel_format_float", - "WGL_ARB_create_context", - "WGL_EXT_make_current_read", - "WGL_EXT_pixel_format", - "WGL_EXT_pbuffer", - "WGL_EXT_depth_float", - "WGL_3DFX_multisample", - "WGL_EXT_multisample", - "WGL_I3D_digital_video_control", - "WGL_I3D_gamma", - "WGL_I3D_genlock", - "WGL_I3D_image_buffer", - "WGL_I3D_swap_frame_lock", - "WGL_NV_render_depth_texture", - "WGL_NV_render_texture_rectangle", - "WGL_ATI_pixel_format_float", - "WGL_NV_float_buffer", - "WGL_3DL_stereo_control", - "WGL_EXT_pixel_format_packed_float", - "WGL_EXT_framebuffer_sRGB", - "WGL_NV_present_video", - "WGL_NV_video_out", - "WGL_NV_swap_group", - "WGL_EXT_display_color_table", - "WGL_EXT_extensions_string", - "WGL_EXT_swap_control", - "WGL_NV_vertex_array_range", - "WGL_OML_sync_control", - "WGL_I3D_swap_frame_usage", - "WGL_NV_video_output" -}; -int __GLeeWGLNumExtensions=37; - -/* WGL_ARB_buffer_region */ - -#ifdef __GLEE_WGL_ARB_buffer_region -HANDLE __stdcall _Lazy_wglCreateBufferRegionARB(HDC hDC, int iLayerPlane, UINT uType) {if (GLeeInit()) return wglCreateBufferRegionARB(hDC, iLayerPlane, uType); return (HANDLE)0;} -VOID __stdcall _Lazy_wglDeleteBufferRegionARB(HANDLE hRegion) {if (GLeeInit()) wglDeleteBufferRegionARB(hRegion);} -BOOL __stdcall _Lazy_wglSaveBufferRegionARB(HANDLE hRegion, int x, int y, int width, int height) {if (GLeeInit()) return wglSaveBufferRegionARB(hRegion, x, y, width, height); return (BOOL)0;} -BOOL __stdcall _Lazy_wglRestoreBufferRegionARB(HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc) {if (GLeeInit()) return wglRestoreBufferRegionARB(hRegion, x, y, width, height, xSrc, ySrc); return (BOOL)0;} -PFNWGLCREATEBUFFERREGIONARBPROC pwglCreateBufferRegionARB=_Lazy_wglCreateBufferRegionARB; -PFNWGLDELETEBUFFERREGIONARBPROC pwglDeleteBufferRegionARB=_Lazy_wglDeleteBufferRegionARB; -PFNWGLSAVEBUFFERREGIONARBPROC pwglSaveBufferRegionARB=_Lazy_wglSaveBufferRegionARB; -PFNWGLRESTOREBUFFERREGIONARBPROC pwglRestoreBufferRegionARB=_Lazy_wglRestoreBufferRegionARB; -#endif - -/* WGL_ARB_multisample */ - -#ifdef __GLEE_WGL_ARB_multisample -#endif - -/* WGL_ARB_extensions_string */ - -#ifdef __GLEE_WGL_ARB_extensions_string -const char * __stdcall _Lazy_wglGetExtensionsStringARB(HDC hdc) {if (GLeeInit()) return wglGetExtensionsStringARB(hdc); return (const char *)0;} -PFNWGLGETEXTENSIONSSTRINGARBPROC pwglGetExtensionsStringARB=_Lazy_wglGetExtensionsStringARB; -#endif - -/* WGL_ARB_pixel_format */ - -#ifdef __GLEE_WGL_ARB_pixel_format -BOOL __stdcall _Lazy_wglGetPixelFormatAttribivARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, int * piValues) {if (GLeeInit()) return wglGetPixelFormatAttribivARB(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, FLOAT * pfValues) {if (GLeeInit()) return wglGetPixelFormatAttribfvARB(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); return (BOOL)0;} -BOOL __stdcall _Lazy_wglChoosePixelFormatARB(HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats) {if (GLeeInit()) return wglChoosePixelFormatARB(hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats); return (BOOL)0;} -PFNWGLGETPIXELFORMATATTRIBIVARBPROC pwglGetPixelFormatAttribivARB=_Lazy_wglGetPixelFormatAttribivARB; -PFNWGLGETPIXELFORMATATTRIBFVARBPROC pwglGetPixelFormatAttribfvARB=_Lazy_wglGetPixelFormatAttribfvARB; -PFNWGLCHOOSEPIXELFORMATARBPROC pwglChoosePixelFormatARB=_Lazy_wglChoosePixelFormatARB; -#endif - -/* WGL_ARB_make_current_read */ - -#ifdef __GLEE_WGL_ARB_make_current_read -BOOL __stdcall _Lazy_wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglrc) {if (GLeeInit()) return wglMakeContextCurrentARB(hDrawDC, hReadDC, hglrc); return (BOOL)0;} -HDC __stdcall _Lazy_wglGetCurrentReadDCARB(void) {if (GLeeInit()) return wglGetCurrentReadDCARB(); return (HDC)0;} -PFNWGLMAKECONTEXTCURRENTARBPROC pwglMakeContextCurrentARB=_Lazy_wglMakeContextCurrentARB; -PFNWGLGETCURRENTREADDCARBPROC pwglGetCurrentReadDCARB=_Lazy_wglGetCurrentReadDCARB; -#endif - -/* WGL_ARB_pbuffer */ - -#ifdef __GLEE_WGL_ARB_pbuffer -HPBUFFERARB __stdcall _Lazy_wglCreatePbufferARB(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList) {if (GLeeInit()) return wglCreatePbufferARB(hDC, iPixelFormat, iWidth, iHeight, piAttribList); return (HPBUFFERARB)0;} -HDC __stdcall _Lazy_wglGetPbufferDCARB(HPBUFFERARB hPbuffer) {if (GLeeInit()) return wglGetPbufferDCARB(hPbuffer); return (HDC)0;} -int __stdcall _Lazy_wglReleasePbufferDCARB(HPBUFFERARB hPbuffer, HDC hDC) {if (GLeeInit()) return wglReleasePbufferDCARB(hPbuffer, hDC); return (int)0;} -BOOL __stdcall _Lazy_wglDestroyPbufferARB(HPBUFFERARB hPbuffer) {if (GLeeInit()) return wglDestroyPbufferARB(hPbuffer); return (BOOL)0;} -BOOL __stdcall _Lazy_wglQueryPbufferARB(HPBUFFERARB hPbuffer, int iAttribute, int * piValue) {if (GLeeInit()) return wglQueryPbufferARB(hPbuffer, iAttribute, piValue); return (BOOL)0;} -PFNWGLCREATEPBUFFERARBPROC pwglCreatePbufferARB=_Lazy_wglCreatePbufferARB; -PFNWGLGETPBUFFERDCARBPROC pwglGetPbufferDCARB=_Lazy_wglGetPbufferDCARB; -PFNWGLRELEASEPBUFFERDCARBPROC pwglReleasePbufferDCARB=_Lazy_wglReleasePbufferDCARB; -PFNWGLDESTROYPBUFFERARBPROC pwglDestroyPbufferARB=_Lazy_wglDestroyPbufferARB; -PFNWGLQUERYPBUFFERARBPROC pwglQueryPbufferARB=_Lazy_wglQueryPbufferARB; -#endif - -/* WGL_ARB_render_texture */ - -#ifdef __GLEE_WGL_ARB_render_texture -BOOL __stdcall _Lazy_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuffer) {if (GLeeInit()) return wglBindTexImageARB(hPbuffer, iBuffer); return (BOOL)0;} -BOOL __stdcall _Lazy_wglReleaseTexImageARB(HPBUFFERARB hPbuffer, int iBuffer) {if (GLeeInit()) return wglReleaseTexImageARB(hPbuffer, iBuffer); return (BOOL)0;} -BOOL __stdcall _Lazy_wglSetPbufferAttribARB(HPBUFFERARB hPbuffer, const int * piAttribList) {if (GLeeInit()) return wglSetPbufferAttribARB(hPbuffer, piAttribList); return (BOOL)0;} -PFNWGLBINDTEXIMAGEARBPROC pwglBindTexImageARB=_Lazy_wglBindTexImageARB; -PFNWGLRELEASETEXIMAGEARBPROC pwglReleaseTexImageARB=_Lazy_wglReleaseTexImageARB; -PFNWGLSETPBUFFERATTRIBARBPROC pwglSetPbufferAttribARB=_Lazy_wglSetPbufferAttribARB; -#endif - -/* WGL_ARB_pixel_format_float */ - -#ifdef __GLEE_WGL_ARB_pixel_format_float -#endif - -/* WGL_ARB_create_context */ - -#ifdef __GLEE_WGL_ARB_create_context -HGLRC __stdcall _Lazy_wglCreateContextAttribsARB(HDC hDC, HGLRC hShareContext, const int * attribList) {if (GLeeInit()) return wglCreateContextAttribsARB(hDC, hShareContext, attribList); return (HGLRC)0;} -PFNWGLCREATECONTEXTATTRIBSARBPROC pwglCreateContextAttribsARB=_Lazy_wglCreateContextAttribsARB; -#endif - -/* WGL_EXT_make_current_read */ - -#ifdef __GLEE_WGL_EXT_make_current_read -BOOL __stdcall _Lazy_wglMakeContextCurrentEXT(HDC hDrawDC, HDC hReadDC, HGLRC hglrc) {if (GLeeInit()) return wglMakeContextCurrentEXT(hDrawDC, hReadDC, hglrc); return (BOOL)0;} -HDC __stdcall _Lazy_wglGetCurrentReadDCEXT(void) {if (GLeeInit()) return wglGetCurrentReadDCEXT(); return (HDC)0;} -PFNWGLMAKECONTEXTCURRENTEXTPROC pwglMakeContextCurrentEXT=_Lazy_wglMakeContextCurrentEXT; -PFNWGLGETCURRENTREADDCEXTPROC pwglGetCurrentReadDCEXT=_Lazy_wglGetCurrentReadDCEXT; -#endif - -/* WGL_EXT_pixel_format */ - -#ifdef __GLEE_WGL_EXT_pixel_format -BOOL __stdcall _Lazy_wglGetPixelFormatAttribivEXT(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int * piAttributes, int * piValues) {if (GLeeInit()) return wglGetPixelFormatAttribivEXT(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetPixelFormatAttribfvEXT(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int * piAttributes, FLOAT * pfValues) {if (GLeeInit()) return wglGetPixelFormatAttribfvEXT(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); return (BOOL)0;} -BOOL __stdcall _Lazy_wglChoosePixelFormatEXT(HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats) {if (GLeeInit()) return wglChoosePixelFormatEXT(hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats); return (BOOL)0;} -PFNWGLGETPIXELFORMATATTRIBIVEXTPROC pwglGetPixelFormatAttribivEXT=_Lazy_wglGetPixelFormatAttribivEXT; -PFNWGLGETPIXELFORMATATTRIBFVEXTPROC pwglGetPixelFormatAttribfvEXT=_Lazy_wglGetPixelFormatAttribfvEXT; -PFNWGLCHOOSEPIXELFORMATEXTPROC pwglChoosePixelFormatEXT=_Lazy_wglChoosePixelFormatEXT; -#endif - -/* WGL_EXT_pbuffer */ - -#ifdef __GLEE_WGL_EXT_pbuffer -HPBUFFEREXT __stdcall _Lazy_wglCreatePbufferEXT(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList) {if (GLeeInit()) return wglCreatePbufferEXT(hDC, iPixelFormat, iWidth, iHeight, piAttribList); return (HPBUFFEREXT)0;} -HDC __stdcall _Lazy_wglGetPbufferDCEXT(HPBUFFEREXT hPbuffer) {if (GLeeInit()) return wglGetPbufferDCEXT(hPbuffer); return (HDC)0;} -int __stdcall _Lazy_wglReleasePbufferDCEXT(HPBUFFEREXT hPbuffer, HDC hDC) {if (GLeeInit()) return wglReleasePbufferDCEXT(hPbuffer, hDC); return (int)0;} -BOOL __stdcall _Lazy_wglDestroyPbufferEXT(HPBUFFEREXT hPbuffer) {if (GLeeInit()) return wglDestroyPbufferEXT(hPbuffer); return (BOOL)0;} -BOOL __stdcall _Lazy_wglQueryPbufferEXT(HPBUFFEREXT hPbuffer, int iAttribute, int * piValue) {if (GLeeInit()) return wglQueryPbufferEXT(hPbuffer, iAttribute, piValue); return (BOOL)0;} -PFNWGLCREATEPBUFFEREXTPROC pwglCreatePbufferEXT=_Lazy_wglCreatePbufferEXT; -PFNWGLGETPBUFFERDCEXTPROC pwglGetPbufferDCEXT=_Lazy_wglGetPbufferDCEXT; -PFNWGLRELEASEPBUFFERDCEXTPROC pwglReleasePbufferDCEXT=_Lazy_wglReleasePbufferDCEXT; -PFNWGLDESTROYPBUFFEREXTPROC pwglDestroyPbufferEXT=_Lazy_wglDestroyPbufferEXT; -PFNWGLQUERYPBUFFEREXTPROC pwglQueryPbufferEXT=_Lazy_wglQueryPbufferEXT; -#endif - -/* WGL_EXT_depth_float */ - -#ifdef __GLEE_WGL_EXT_depth_float -#endif - -/* WGL_3DFX_multisample */ - -#ifdef __GLEE_WGL_3DFX_multisample -#endif - -/* WGL_EXT_multisample */ - -#ifdef __GLEE_WGL_EXT_multisample -#endif - -/* WGL_I3D_digital_video_control */ - -#ifdef __GLEE_WGL_I3D_digital_video_control -BOOL __stdcall _Lazy_wglGetDigitalVideoParametersI3D(HDC hDC, int iAttribute, int * piValue) {if (GLeeInit()) return wglGetDigitalVideoParametersI3D(hDC, iAttribute, piValue); return (BOOL)0;} -BOOL __stdcall _Lazy_wglSetDigitalVideoParametersI3D(HDC hDC, int iAttribute, const int * piValue) {if (GLeeInit()) return wglSetDigitalVideoParametersI3D(hDC, iAttribute, piValue); return (BOOL)0;} -PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC pwglGetDigitalVideoParametersI3D=_Lazy_wglGetDigitalVideoParametersI3D; -PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC pwglSetDigitalVideoParametersI3D=_Lazy_wglSetDigitalVideoParametersI3D; -#endif - -/* WGL_I3D_gamma */ - -#ifdef __GLEE_WGL_I3D_gamma -BOOL __stdcall _Lazy_wglGetGammaTableParametersI3D(HDC hDC, int iAttribute, int * piValue) {if (GLeeInit()) return wglGetGammaTableParametersI3D(hDC, iAttribute, piValue); return (BOOL)0;} -BOOL __stdcall _Lazy_wglSetGammaTableParametersI3D(HDC hDC, int iAttribute, const int * piValue) {if (GLeeInit()) return wglSetGammaTableParametersI3D(hDC, iAttribute, piValue); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetGammaTableI3D(HDC hDC, int iEntries, USHORT * puRed, USHORT * puGreen, USHORT * puBlue) {if (GLeeInit()) return wglGetGammaTableI3D(hDC, iEntries, puRed, puGreen, puBlue); return (BOOL)0;} -BOOL __stdcall _Lazy_wglSetGammaTableI3D(HDC hDC, int iEntries, const USHORT * puRed, const USHORT * puGreen, const USHORT * puBlue) {if (GLeeInit()) return wglSetGammaTableI3D(hDC, iEntries, puRed, puGreen, puBlue); return (BOOL)0;} -PFNWGLGETGAMMATABLEPARAMETERSI3DPROC pwglGetGammaTableParametersI3D=_Lazy_wglGetGammaTableParametersI3D; -PFNWGLSETGAMMATABLEPARAMETERSI3DPROC pwglSetGammaTableParametersI3D=_Lazy_wglSetGammaTableParametersI3D; -PFNWGLGETGAMMATABLEI3DPROC pwglGetGammaTableI3D=_Lazy_wglGetGammaTableI3D; -PFNWGLSETGAMMATABLEI3DPROC pwglSetGammaTableI3D=_Lazy_wglSetGammaTableI3D; -#endif - -/* WGL_I3D_genlock */ - -#ifdef __GLEE_WGL_I3D_genlock -BOOL __stdcall _Lazy_wglEnableGenlockI3D(HDC hDC) {if (GLeeInit()) return wglEnableGenlockI3D(hDC); return (BOOL)0;} -BOOL __stdcall _Lazy_wglDisableGenlockI3D(HDC hDC) {if (GLeeInit()) return wglDisableGenlockI3D(hDC); return (BOOL)0;} -BOOL __stdcall _Lazy_wglIsEnabledGenlockI3D(HDC hDC, BOOL * pFlag) {if (GLeeInit()) return wglIsEnabledGenlockI3D(hDC, pFlag); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGenlockSourceI3D(HDC hDC, UINT uSource) {if (GLeeInit()) return wglGenlockSourceI3D(hDC, uSource); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetGenlockSourceI3D(HDC hDC, UINT * uSource) {if (GLeeInit()) return wglGetGenlockSourceI3D(hDC, uSource); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGenlockSourceEdgeI3D(HDC hDC, UINT uEdge) {if (GLeeInit()) return wglGenlockSourceEdgeI3D(hDC, uEdge); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetGenlockSourceEdgeI3D(HDC hDC, UINT * uEdge) {if (GLeeInit()) return wglGetGenlockSourceEdgeI3D(hDC, uEdge); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGenlockSampleRateI3D(HDC hDC, UINT uRate) {if (GLeeInit()) return wglGenlockSampleRateI3D(hDC, uRate); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetGenlockSampleRateI3D(HDC hDC, UINT * uRate) {if (GLeeInit()) return wglGetGenlockSampleRateI3D(hDC, uRate); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGenlockSourceDelayI3D(HDC hDC, UINT uDelay) {if (GLeeInit()) return wglGenlockSourceDelayI3D(hDC, uDelay); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetGenlockSourceDelayI3D(HDC hDC, UINT * uDelay) {if (GLeeInit()) return wglGetGenlockSourceDelayI3D(hDC, uDelay); return (BOOL)0;} -BOOL __stdcall _Lazy_wglQueryGenlockMaxSourceDelayI3D(HDC hDC, UINT * uMaxLineDelay, UINT * uMaxPixelDelay) {if (GLeeInit()) return wglQueryGenlockMaxSourceDelayI3D(hDC, uMaxLineDelay, uMaxPixelDelay); return (BOOL)0;} -PFNWGLENABLEGENLOCKI3DPROC pwglEnableGenlockI3D=_Lazy_wglEnableGenlockI3D; -PFNWGLDISABLEGENLOCKI3DPROC pwglDisableGenlockI3D=_Lazy_wglDisableGenlockI3D; -PFNWGLISENABLEDGENLOCKI3DPROC pwglIsEnabledGenlockI3D=_Lazy_wglIsEnabledGenlockI3D; -PFNWGLGENLOCKSOURCEI3DPROC pwglGenlockSourceI3D=_Lazy_wglGenlockSourceI3D; -PFNWGLGETGENLOCKSOURCEI3DPROC pwglGetGenlockSourceI3D=_Lazy_wglGetGenlockSourceI3D; -PFNWGLGENLOCKSOURCEEDGEI3DPROC pwglGenlockSourceEdgeI3D=_Lazy_wglGenlockSourceEdgeI3D; -PFNWGLGETGENLOCKSOURCEEDGEI3DPROC pwglGetGenlockSourceEdgeI3D=_Lazy_wglGetGenlockSourceEdgeI3D; -PFNWGLGENLOCKSAMPLERATEI3DPROC pwglGenlockSampleRateI3D=_Lazy_wglGenlockSampleRateI3D; -PFNWGLGETGENLOCKSAMPLERATEI3DPROC pwglGetGenlockSampleRateI3D=_Lazy_wglGetGenlockSampleRateI3D; -PFNWGLGENLOCKSOURCEDELAYI3DPROC pwglGenlockSourceDelayI3D=_Lazy_wglGenlockSourceDelayI3D; -PFNWGLGETGENLOCKSOURCEDELAYI3DPROC pwglGetGenlockSourceDelayI3D=_Lazy_wglGetGenlockSourceDelayI3D; -PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC pwglQueryGenlockMaxSourceDelayI3D=_Lazy_wglQueryGenlockMaxSourceDelayI3D; -#endif - -/* WGL_I3D_image_buffer */ - -#ifdef __GLEE_WGL_I3D_image_buffer -LPVOID __stdcall _Lazy_wglCreateImageBufferI3D(HDC hDC, DWORD dwSize, UINT uFlags) {if (GLeeInit()) return wglCreateImageBufferI3D(hDC, dwSize, uFlags); return (LPVOID)0;} -BOOL __stdcall _Lazy_wglDestroyImageBufferI3D(HDC hDC, LPVOID pAddress) {if (GLeeInit()) return wglDestroyImageBufferI3D(hDC, pAddress); return (BOOL)0;} -BOOL __stdcall _Lazy_wglAssociateImageBufferEventsI3D(HDC hDC, const HANDLE * pEvent, const LPVOID * pAddress, const DWORD * pSize, UINT count) {if (GLeeInit()) return wglAssociateImageBufferEventsI3D(hDC, pEvent, pAddress, pSize, count); return (BOOL)0;} -BOOL __stdcall _Lazy_wglReleaseImageBufferEventsI3D(HDC hDC, const LPVOID * pAddress, UINT count) {if (GLeeInit()) return wglReleaseImageBufferEventsI3D(hDC, pAddress, count); return (BOOL)0;} -PFNWGLCREATEIMAGEBUFFERI3DPROC pwglCreateImageBufferI3D=_Lazy_wglCreateImageBufferI3D; -PFNWGLDESTROYIMAGEBUFFERI3DPROC pwglDestroyImageBufferI3D=_Lazy_wglDestroyImageBufferI3D; -PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC pwglAssociateImageBufferEventsI3D=_Lazy_wglAssociateImageBufferEventsI3D; -PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC pwglReleaseImageBufferEventsI3D=_Lazy_wglReleaseImageBufferEventsI3D; -#endif - -/* WGL_I3D_swap_frame_lock */ - -#ifdef __GLEE_WGL_I3D_swap_frame_lock -BOOL __stdcall _Lazy_wglEnableFrameLockI3D(void) {if (GLeeInit()) return wglEnableFrameLockI3D(); return (BOOL)0;} -BOOL __stdcall _Lazy_wglDisableFrameLockI3D(void) {if (GLeeInit()) return wglDisableFrameLockI3D(); return (BOOL)0;} -BOOL __stdcall _Lazy_wglIsEnabledFrameLockI3D(BOOL * pFlag) {if (GLeeInit()) return wglIsEnabledFrameLockI3D(pFlag); return (BOOL)0;} -BOOL __stdcall _Lazy_wglQueryFrameLockMasterI3D(BOOL * pFlag) {if (GLeeInit()) return wglQueryFrameLockMasterI3D(pFlag); return (BOOL)0;} -PFNWGLENABLEFRAMELOCKI3DPROC pwglEnableFrameLockI3D=_Lazy_wglEnableFrameLockI3D; -PFNWGLDISABLEFRAMELOCKI3DPROC pwglDisableFrameLockI3D=_Lazy_wglDisableFrameLockI3D; -PFNWGLISENABLEDFRAMELOCKI3DPROC pwglIsEnabledFrameLockI3D=_Lazy_wglIsEnabledFrameLockI3D; -PFNWGLQUERYFRAMELOCKMASTERI3DPROC pwglQueryFrameLockMasterI3D=_Lazy_wglQueryFrameLockMasterI3D; -#endif - -/* WGL_NV_render_depth_texture */ - -#ifdef __GLEE_WGL_NV_render_depth_texture -#endif - -/* WGL_NV_render_texture_rectangle */ - -#ifdef __GLEE_WGL_NV_render_texture_rectangle -#endif - -/* WGL_ATI_pixel_format_float */ - -#ifdef __GLEE_WGL_ATI_pixel_format_float -#endif - -/* WGL_NV_float_buffer */ - -#ifdef __GLEE_WGL_NV_float_buffer -#endif - -/* WGL_3DL_stereo_control */ - -#ifdef __GLEE_WGL_3DL_stereo_control -#endif - -/* WGL_EXT_pixel_format_packed_float */ - -#ifdef __GLEE_WGL_EXT_pixel_format_packed_float -#endif - -/* WGL_EXT_framebuffer_sRGB */ - -#ifdef __GLEE_WGL_EXT_framebuffer_sRGB -#endif - -/* WGL_NV_present_video */ - -#ifdef __GLEE_WGL_NV_present_video -#endif - -/* WGL_NV_video_out */ - -#ifdef __GLEE_WGL_NV_video_out -#endif - -/* WGL_NV_swap_group */ - -#ifdef __GLEE_WGL_NV_swap_group -#endif - -/* WGL_EXT_display_color_table */ - -#ifdef __GLEE_WGL_EXT_display_color_table -GLboolean __stdcall _Lazy_wglCreateDisplayColorTableEXT(GLushort id) {if (GLeeInit()) return wglCreateDisplayColorTableEXT(id); return (GLboolean)0;} -GLboolean __stdcall _Lazy_wglLoadDisplayColorTableEXT(const GLushort * table, GLuint length) {if (GLeeInit()) return wglLoadDisplayColorTableEXT(table, length); return (GLboolean)0;} -GLboolean __stdcall _Lazy_wglBindDisplayColorTableEXT(GLushort id) {if (GLeeInit()) return wglBindDisplayColorTableEXT(id); return (GLboolean)0;} -VOID __stdcall _Lazy_wglDestroyDisplayColorTableEXT(GLushort id) {if (GLeeInit()) wglDestroyDisplayColorTableEXT(id);} -PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC pwglCreateDisplayColorTableEXT=_Lazy_wglCreateDisplayColorTableEXT; -PFNWGLLOADDISPLAYCOLORTABLEEXTPROC pwglLoadDisplayColorTableEXT=_Lazy_wglLoadDisplayColorTableEXT; -PFNWGLBINDDISPLAYCOLORTABLEEXTPROC pwglBindDisplayColorTableEXT=_Lazy_wglBindDisplayColorTableEXT; -PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC pwglDestroyDisplayColorTableEXT=_Lazy_wglDestroyDisplayColorTableEXT; -#endif - -/* WGL_EXT_extensions_string */ - -#ifdef __GLEE_WGL_EXT_extensions_string -const char * __stdcall _Lazy_wglGetExtensionsStringEXT(void) {if (GLeeInit()) return wglGetExtensionsStringEXT(); return (const char *)0;} -PFNWGLGETEXTENSIONSSTRINGEXTPROC pwglGetExtensionsStringEXT=_Lazy_wglGetExtensionsStringEXT; -#endif - -/* WGL_EXT_swap_control */ - -#ifdef __GLEE_WGL_EXT_swap_control -BOOL __stdcall _Lazy_wglSwapIntervalEXT(int interval) {if (GLeeInit()) return wglSwapIntervalEXT(interval); return (BOOL)0;} -int __stdcall _Lazy_wglGetSwapIntervalEXT(void) {if (GLeeInit()) return wglGetSwapIntervalEXT(); return (int)0;} -PFNWGLSWAPINTERVALEXTPROC pwglSwapIntervalEXT=_Lazy_wglSwapIntervalEXT; -PFNWGLGETSWAPINTERVALEXTPROC pwglGetSwapIntervalEXT=_Lazy_wglGetSwapIntervalEXT; -#endif - -/* WGL_NV_vertex_array_range */ - -#ifdef __GLEE_WGL_NV_vertex_array_range -void* __stdcall _Lazy_wglAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority) {if (GLeeInit()) return wglAllocateMemoryNV(size, readfreq, writefreq, priority); return (void*)0;} -void __stdcall _Lazy_wglFreeMemoryNV(void * pointer) {if (GLeeInit()) wglFreeMemoryNV(pointer);} -PFNWGLALLOCATEMEMORYNVPROC pwglAllocateMemoryNV=_Lazy_wglAllocateMemoryNV; -PFNWGLFREEMEMORYNVPROC pwglFreeMemoryNV=_Lazy_wglFreeMemoryNV; -#endif - -/* WGL_OML_sync_control */ - -#ifdef __GLEE_WGL_OML_sync_control -BOOL __stdcall _Lazy_wglGetSyncValuesOML(HDC hdc, INT64 * ust, INT64 * msc, INT64 * sbc) {if (GLeeInit()) return wglGetSyncValuesOML(hdc, ust, msc, sbc); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetMscRateOML(HDC hdc, INT32 * numerator, INT32 * denominator) {if (GLeeInit()) return wglGetMscRateOML(hdc, numerator, denominator); return (BOOL)0;} -INT64 __stdcall _Lazy_wglSwapBuffersMscOML(HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder) {if (GLeeInit()) return wglSwapBuffersMscOML(hdc, target_msc, divisor, remainder); return (INT64)0;} -INT64 __stdcall _Lazy_wglSwapLayerBuffersMscOML(HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder) {if (GLeeInit()) return wglSwapLayerBuffersMscOML(hdc, fuPlanes, target_msc, divisor, remainder); return (INT64)0;} -BOOL __stdcall _Lazy_wglWaitForMscOML(HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 * ust, INT64 * msc, INT64 * sbc) {if (GLeeInit()) return wglWaitForMscOML(hdc, target_msc, divisor, remainder, ust, msc, sbc); return (BOOL)0;} -BOOL __stdcall _Lazy_wglWaitForSbcOML(HDC hdc, INT64 target_sbc, INT64 * ust, INT64 * msc, INT64 * sbc) {if (GLeeInit()) return wglWaitForSbcOML(hdc, target_sbc, ust, msc, sbc); return (BOOL)0;} -PFNWGLGETSYNCVALUESOMLPROC pwglGetSyncValuesOML=_Lazy_wglGetSyncValuesOML; -PFNWGLGETMSCRATEOMLPROC pwglGetMscRateOML=_Lazy_wglGetMscRateOML; -PFNWGLSWAPBUFFERSMSCOMLPROC pwglSwapBuffersMscOML=_Lazy_wglSwapBuffersMscOML; -PFNWGLSWAPLAYERBUFFERSMSCOMLPROC pwglSwapLayerBuffersMscOML=_Lazy_wglSwapLayerBuffersMscOML; -PFNWGLWAITFORMSCOMLPROC pwglWaitForMscOML=_Lazy_wglWaitForMscOML; -PFNWGLWAITFORSBCOMLPROC pwglWaitForSbcOML=_Lazy_wglWaitForSbcOML; -#endif - -/* WGL_I3D_swap_frame_usage */ - -#ifdef __GLEE_WGL_I3D_swap_frame_usage -BOOL __stdcall _Lazy_wglGetFrameUsageI3D(float * pUsage) {if (GLeeInit()) return wglGetFrameUsageI3D(pUsage); return (BOOL)0;} -BOOL __stdcall _Lazy_wglBeginFrameTrackingI3D(void) {if (GLeeInit()) return wglBeginFrameTrackingI3D(); return (BOOL)0;} -BOOL __stdcall _Lazy_wglEndFrameTrackingI3D(void) {if (GLeeInit()) return wglEndFrameTrackingI3D(); return (BOOL)0;} -BOOL __stdcall _Lazy_wglQueryFrameTrackingI3D(DWORD * pFrameCount, DWORD * pMissedFrames, float * pLastMissedUsage) {if (GLeeInit()) return wglQueryFrameTrackingI3D(pFrameCount, pMissedFrames, pLastMissedUsage); return (BOOL)0;} -PFNWGLGETFRAMEUSAGEI3DPROC pwglGetFrameUsageI3D=_Lazy_wglGetFrameUsageI3D; -PFNWGLBEGINFRAMETRACKINGI3DPROC pwglBeginFrameTrackingI3D=_Lazy_wglBeginFrameTrackingI3D; -PFNWGLENDFRAMETRACKINGI3DPROC pwglEndFrameTrackingI3D=_Lazy_wglEndFrameTrackingI3D; -PFNWGLQUERYFRAMETRACKINGI3DPROC pwglQueryFrameTrackingI3D=_Lazy_wglQueryFrameTrackingI3D; -#endif - -/* WGL_NV_video_output */ - -#ifdef __GLEE_WGL_NV_video_output -BOOL __stdcall _Lazy_wglGetVideoDeviceNV(HDC hDC, int numDevices, HPVIDEODEV * hVideoDevice) {if (GLeeInit()) return wglGetVideoDeviceNV(hDC, numDevices, hVideoDevice); return (BOOL)0;} -BOOL __stdcall _Lazy_wglReleaseVideoDeviceNV(HPVIDEODEV hVideoDevice) {if (GLeeInit()) return wglReleaseVideoDeviceNV(hVideoDevice); return (BOOL)0;} -BOOL __stdcall _Lazy_wglBindVideoImageNV(HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer) {if (GLeeInit()) return wglBindVideoImageNV(hVideoDevice, hPbuffer, iVideoBuffer); return (BOOL)0;} -BOOL __stdcall _Lazy_wglReleaseVideoImageNV(HPBUFFERARB hPbuffer, int iVideoBuffer) {if (GLeeInit()) return wglReleaseVideoImageNV(hPbuffer, iVideoBuffer); return (BOOL)0;} -BOOL __stdcall _Lazy_wglSendPbufferToVideoNV(HPBUFFERARB hPbuffer, int iBufferType, unsigned long * pulCounterPbuffer, BOOL bBlock) {if (GLeeInit()) return wglSendPbufferToVideoNV(hPbuffer, iBufferType, pulCounterPbuffer, bBlock); return (BOOL)0;} -BOOL __stdcall _Lazy_wglGetVideoInfoNV(HPVIDEODEV hpVideoDevice, unsigned long * pulCounterOutputPbuffer, unsigned long * pulCounterOutputVideo) {if (GLeeInit()) return wglGetVideoInfoNV(hpVideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo); return (BOOL)0;} -PFNWGLGETVIDEODEVICENVPROC pwglGetVideoDeviceNV=_Lazy_wglGetVideoDeviceNV; -PFNWGLRELEASEVIDEODEVICENVPROC pwglReleaseVideoDeviceNV=_Lazy_wglReleaseVideoDeviceNV; -PFNWGLBINDVIDEOIMAGENVPROC pwglBindVideoImageNV=_Lazy_wglBindVideoImageNV; -PFNWGLRELEASEVIDEOIMAGENVPROC pwglReleaseVideoImageNV=_Lazy_wglReleaseVideoImageNV; -PFNWGLSENDPBUFFERTOVIDEONVPROC pwglSendPbufferToVideoNV=_Lazy_wglSendPbufferToVideoNV; -PFNWGLGETVIDEOINFONVPROC pwglGetVideoInfoNV=_Lazy_wglGetVideoInfoNV; -#endif -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else /* GLX */ - -/* Extension querying variables */ - -GLboolean _GLEE_GLX_VERSION_1_3 = GL_FALSE; -GLboolean _GLEE_GLX_VERSION_1_4 = GL_FALSE; -GLboolean _GLEE_GLX_ARB_multisample = GL_FALSE; -GLboolean _GLEE_GLX_ARB_fbconfig_float = GL_FALSE; -GLboolean _GLEE_GLX_SGIS_multisample = GL_FALSE; -GLboolean _GLEE_GLX_EXT_visual_info = GL_FALSE; -GLboolean _GLEE_GLX_SGI_swap_control = GL_FALSE; -GLboolean _GLEE_GLX_SGI_video_sync = GL_FALSE; -GLboolean _GLEE_GLX_SGI_make_current_read = GL_FALSE; -GLboolean _GLEE_GLX_EXT_visual_rating = GL_FALSE; -GLboolean _GLEE_GLX_EXT_import_context = GL_FALSE; -GLboolean _GLEE_GLX_SGIX_fbconfig = GL_FALSE; -GLboolean _GLEE_GLX_SGIX_pbuffer = GL_FALSE; -GLboolean _GLEE_GLX_SGI_cushion = GL_FALSE; -GLboolean _GLEE_GLX_SGIX_video_resize = GL_FALSE; -GLboolean _GLEE_GLX_SGIX_swap_group = GL_FALSE; -GLboolean _GLEE_GLX_SGIX_swap_barrier = GL_FALSE; -GLboolean _GLEE_GLX_SGIS_blended_overlay = GL_FALSE; -GLboolean _GLEE_GLX_SGIS_shared_multisample = GL_FALSE; -GLboolean _GLEE_GLX_SUN_get_transparent_index = GL_FALSE; -GLboolean _GLEE_GLX_3DFX_multisample = GL_FALSE; -GLboolean _GLEE_GLX_MESA_copy_sub_buffer = GL_FALSE; -GLboolean _GLEE_GLX_MESA_pixmap_colormap = GL_FALSE; -GLboolean _GLEE_GLX_MESA_release_buffers = GL_FALSE; -GLboolean _GLEE_GLX_MESA_set_3dfx_mode = GL_FALSE; -GLboolean _GLEE_GLX_SGIX_visual_select_group = GL_FALSE; -GLboolean _GLEE_GLX_OML_swap_method = GL_FALSE; -GLboolean _GLEE_GLX_OML_sync_control = GL_FALSE; -GLboolean _GLEE_GLX_NV_float_buffer = GL_FALSE; -GLboolean _GLEE_GLX_SGIX_hyperpipe = GL_FALSE; -GLboolean _GLEE_GLX_MESA_agp_offset = GL_FALSE; -GLboolean _GLEE_GLX_EXT_fbconfig_packed_float = GL_FALSE; -GLboolean _GLEE_GLX_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean _GLEE_GLX_EXT_texture_from_pixmap = GL_FALSE; -GLboolean _GLEE_GLX_NV_present_video = GL_FALSE; -GLboolean _GLEE_GLX_NV_video_out = GL_FALSE; -GLboolean _GLEE_GLX_NV_swap_group = GL_FALSE; -GLboolean _GLEE_GLX_EXT_scene_marker = GL_FALSE; -GLboolean _GLEE_GLX_NV_video_output = GL_FALSE; - -/* GLX Extension names */ - -char __GLeeGLXExtensionNames[39][30]={ - "GLX_VERSION_1_3", - "GLX_VERSION_1_4", - "GLX_ARB_multisample", - "GLX_ARB_fbconfig_float", - "GLX_SGIS_multisample", - "GLX_EXT_visual_info", - "GLX_SGI_swap_control", - "GLX_SGI_video_sync", - "GLX_SGI_make_current_read", - "GLX_EXT_visual_rating", - "GLX_EXT_import_context", - "GLX_SGIX_fbconfig", - "GLX_SGIX_pbuffer", - "GLX_SGI_cushion", - "GLX_SGIX_video_resize", - "GLX_SGIX_swap_group", - "GLX_SGIX_swap_barrier", - "GLX_SGIS_blended_overlay", - "GLX_SGIS_shared_multisample", - "GLX_SUN_get_transparent_index", - "GLX_3DFX_multisample", - "GLX_MESA_copy_sub_buffer", - "GLX_MESA_pixmap_colormap", - "GLX_MESA_release_buffers", - "GLX_MESA_set_3dfx_mode", - "GLX_SGIX_visual_select_group", - "GLX_OML_swap_method", - "GLX_OML_sync_control", - "GLX_NV_float_buffer", - "GLX_SGIX_hyperpipe", - "GLX_MESA_agp_offset", - "GLX_EXT_fbconfig_packed_float", - "GLX_EXT_framebuffer_sRGB", - "GLX_EXT_texture_from_pixmap", - "GLX_NV_present_video", - "GLX_NV_video_out", - "GLX_NV_swap_group", - "GLX_EXT_scene_marker", - "GLX_NV_video_output" -}; -int __GLeeGLXNumExtensions=39; - -/* GLX_VERSION_1_3 */ - -#ifdef __GLEE_GLX_VERSION_1_3 -GLXFBConfig * __stdcall _Lazy_glXGetFBConfigs(Display * dpy, int screen, int * nelements) {if (GLeeInit()) return glXGetFBConfigs(dpy, screen, nelements); return (GLXFBConfig *)0;} -GLXFBConfig * __stdcall _Lazy_glXChooseFBConfig(Display * dpy, int screen, const int * attrib_list, int * nelements) {if (GLeeInit()) return glXChooseFBConfig(dpy, screen, attrib_list, nelements); return (GLXFBConfig *)0;} -int __stdcall _Lazy_glXGetFBConfigAttrib(Display * dpy, GLXFBConfig config, int attribute, int * value) {if (GLeeInit()) return glXGetFBConfigAttrib(dpy, config, attribute, value); return (int)0;} -XVisualInfo * __stdcall _Lazy_glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig config) {if (GLeeInit()) return glXGetVisualFromFBConfig(dpy, config); return (XVisualInfo *)0;} -GLXWindow __stdcall _Lazy_glXCreateWindow(Display * dpy, GLXFBConfig config, Window win, const int * attrib_list) {if (GLeeInit()) return glXCreateWindow(dpy, config, win, attrib_list); return (GLXWindow)0;} -void __stdcall _Lazy_glXDestroyWindow(Display * dpy, GLXWindow win) {if (GLeeInit()) glXDestroyWindow(dpy, win);} -GLXPixmap __stdcall _Lazy_glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap, const int * attrib_list) {if (GLeeInit()) return glXCreatePixmap(dpy, config, pixmap, attrib_list); return (GLXPixmap)0;} -void __stdcall _Lazy_glXDestroyPixmap(Display * dpy, GLXPixmap pixmap) {if (GLeeInit()) glXDestroyPixmap(dpy, pixmap);} -GLXPbuffer __stdcall _Lazy_glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int * attrib_list) {if (GLeeInit()) return glXCreatePbuffer(dpy, config, attrib_list); return (GLXPbuffer)0;} -void __stdcall _Lazy_glXDestroyPbuffer(Display * dpy, GLXPbuffer pbuf) {if (GLeeInit()) glXDestroyPbuffer(dpy, pbuf);} -void __stdcall _Lazy_glXQueryDrawable(Display * dpy, GLXDrawable draw, int attribute, unsigned int * value) {if (GLeeInit()) glXQueryDrawable(dpy, draw, attribute, value);} -GLXContext __stdcall _Lazy_glXCreateNewContext(Display * dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct) {if (GLeeInit()) return glXCreateNewContext(dpy, config, render_type, share_list, direct); return (GLXContext)0;} -Bool __stdcall _Lazy_glXMakeContextCurrent(Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) {if (GLeeInit()) return glXMakeContextCurrent(dpy, draw, read, ctx); return (Bool)0;} -GLXDrawable __stdcall _Lazy_glXGetCurrentReadDrawable(void) {if (GLeeInit()) return glXGetCurrentReadDrawable(); return (GLXDrawable)0;} -Display * __stdcall _Lazy_glXGetCurrentDisplay(void) {if (GLeeInit()) return glXGetCurrentDisplay(); return (Display *)0;} -int __stdcall _Lazy_glXQueryContext(Display * dpy, GLXContext ctx, int attribute, int * value) {if (GLeeInit()) return glXQueryContext(dpy, ctx, attribute, value); return (int)0;} -void __stdcall _Lazy_glXSelectEvent(Display * dpy, GLXDrawable draw, unsigned long event_mask) {if (GLeeInit()) glXSelectEvent(dpy, draw, event_mask);} -void __stdcall _Lazy_glXGetSelectedEvent(Display * dpy, GLXDrawable draw, unsigned long * event_mask) {if (GLeeInit()) glXGetSelectedEvent(dpy, draw, event_mask);} -PFNGLXGETFBCONFIGSPROC pglXGetFBConfigs=_Lazy_glXGetFBConfigs; -PFNGLXCHOOSEFBCONFIGPROC pglXChooseFBConfig=_Lazy_glXChooseFBConfig; -PFNGLXGETFBCONFIGATTRIBPROC pglXGetFBConfigAttrib=_Lazy_glXGetFBConfigAttrib; -PFNGLXGETVISUALFROMFBCONFIGPROC pglXGetVisualFromFBConfig=_Lazy_glXGetVisualFromFBConfig; -PFNGLXCREATEWINDOWPROC pglXCreateWindow=_Lazy_glXCreateWindow; -PFNGLXDESTROYWINDOWPROC pglXDestroyWindow=_Lazy_glXDestroyWindow; -PFNGLXCREATEPIXMAPPROC pglXCreatePixmap=_Lazy_glXCreatePixmap; -PFNGLXDESTROYPIXMAPPROC pglXDestroyPixmap=_Lazy_glXDestroyPixmap; -PFNGLXCREATEPBUFFERPROC pglXCreatePbuffer=_Lazy_glXCreatePbuffer; -PFNGLXDESTROYPBUFFERPROC pglXDestroyPbuffer=_Lazy_glXDestroyPbuffer; -PFNGLXQUERYDRAWABLEPROC pglXQueryDrawable=_Lazy_glXQueryDrawable; -PFNGLXCREATENEWCONTEXTPROC pglXCreateNewContext=_Lazy_glXCreateNewContext; -PFNGLXMAKECONTEXTCURRENTPROC pglXMakeContextCurrent=_Lazy_glXMakeContextCurrent; -PFNGLXGETCURRENTREADDRAWABLEPROC pglXGetCurrentReadDrawable=_Lazy_glXGetCurrentReadDrawable; -PFNGLXGETCURRENTDISPLAYPROC pglXGetCurrentDisplay=_Lazy_glXGetCurrentDisplay; -PFNGLXQUERYCONTEXTPROC pglXQueryContext=_Lazy_glXQueryContext; -PFNGLXSELECTEVENTPROC pglXSelectEvent=_Lazy_glXSelectEvent; -PFNGLXGETSELECTEDEVENTPROC pglXGetSelectedEvent=_Lazy_glXGetSelectedEvent; -#endif - -/* GLX_VERSION_1_4 */ - -#ifdef __GLEE_GLX_VERSION_1_4 -__GLXextFuncPtr __stdcall _Lazy_glXGetProcAddress(const GLubyte * procName) {if (GLeeInit()) return glXGetProcAddress(procName); return (__GLXextFuncPtr)0;} -PFNGLXGETPROCADDRESSPROC pglXGetProcAddress=_Lazy_glXGetProcAddress; -#endif - -/* GLX_ARB_multisample */ - -#ifdef __GLEE_GLX_ARB_multisample -#endif - -/* GLX_ARB_fbconfig_float */ - -#ifdef __GLEE_GLX_ARB_fbconfig_float -#endif - -/* GLX_SGIS_multisample */ - -#ifdef __GLEE_GLX_SGIS_multisample -#endif - -/* GLX_EXT_visual_info */ - -#ifdef __GLEE_GLX_EXT_visual_info -#endif - -/* GLX_SGI_swap_control */ - -#ifdef __GLEE_GLX_SGI_swap_control -int __stdcall _Lazy_glXSwapIntervalSGI(int interval) {if (GLeeInit()) return glXSwapIntervalSGI(interval); return (int)0;} -PFNGLXSWAPINTERVALSGIPROC pglXSwapIntervalSGI=_Lazy_glXSwapIntervalSGI; -#endif - -/* GLX_SGI_video_sync */ - -#ifdef __GLEE_GLX_SGI_video_sync -int __stdcall _Lazy_glXGetVideoSyncSGI(unsigned int * count) {if (GLeeInit()) return glXGetVideoSyncSGI(count); return (int)0;} -int __stdcall _Lazy_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int * count) {if (GLeeInit()) return glXWaitVideoSyncSGI(divisor, remainder, count); return (int)0;} -PFNGLXGETVIDEOSYNCSGIPROC pglXGetVideoSyncSGI=_Lazy_glXGetVideoSyncSGI; -PFNGLXWAITVIDEOSYNCSGIPROC pglXWaitVideoSyncSGI=_Lazy_glXWaitVideoSyncSGI; -#endif - -/* GLX_SGI_make_current_read */ - -#ifdef __GLEE_GLX_SGI_make_current_read -Bool __stdcall _Lazy_glXMakeCurrentReadSGI(Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) {if (GLeeInit()) return glXMakeCurrentReadSGI(dpy, draw, read, ctx); return (Bool)0;} -GLXDrawable __stdcall _Lazy_glXGetCurrentReadDrawableSGI(void) {if (GLeeInit()) return glXGetCurrentReadDrawableSGI(); return (GLXDrawable)0;} -PFNGLXMAKECURRENTREADSGIPROC pglXMakeCurrentReadSGI=_Lazy_glXMakeCurrentReadSGI; -PFNGLXGETCURRENTREADDRAWABLESGIPROC pglXGetCurrentReadDrawableSGI=_Lazy_glXGetCurrentReadDrawableSGI; -#endif - -/* GLX_EXT_visual_rating */ - -#ifdef __GLEE_GLX_EXT_visual_rating -#endif - -/* GLX_EXT_import_context */ - -#ifdef __GLEE_GLX_EXT_import_context -Display * __stdcall _Lazy_glXGetCurrentDisplayEXT(void) {if (GLeeInit()) return glXGetCurrentDisplayEXT(); return (Display *)0;} -int __stdcall _Lazy_glXQueryContextInfoEXT(Display * dpy, GLXContext context, int attribute, int * value) {if (GLeeInit()) return glXQueryContextInfoEXT(dpy, context, attribute, value); return (int)0;} -GLXContextID __stdcall _Lazy_glXGetContextIDEXT(const GLXContext context) {if (GLeeInit()) return glXGetContextIDEXT(context); return (GLXContextID)0;} -GLXContext __stdcall _Lazy_glXImportContextEXT(Display * dpy, GLXContextID contextID) {if (GLeeInit()) return glXImportContextEXT(dpy, contextID); return (GLXContext)0;} -void __stdcall _Lazy_glXFreeContextEXT(Display * dpy, GLXContext context) {if (GLeeInit()) glXFreeContextEXT(dpy, context);} -PFNGLXGETCURRENTDISPLAYEXTPROC pglXGetCurrentDisplayEXT=_Lazy_glXGetCurrentDisplayEXT; -PFNGLXQUERYCONTEXTINFOEXTPROC pglXQueryContextInfoEXT=_Lazy_glXQueryContextInfoEXT; -PFNGLXGETCONTEXTIDEXTPROC pglXGetContextIDEXT=_Lazy_glXGetContextIDEXT; -PFNGLXIMPORTCONTEXTEXTPROC pglXImportContextEXT=_Lazy_glXImportContextEXT; -PFNGLXFREECONTEXTEXTPROC pglXFreeContextEXT=_Lazy_glXFreeContextEXT; -#endif - -/* GLX_SGIX_fbconfig */ - -#ifdef __GLEE_GLX_SGIX_fbconfig -int __stdcall _Lazy_glXGetFBConfigAttribSGIX(Display * dpy, GLXFBConfigSGIX config, int attribute, int * value) {if (GLeeInit()) return glXGetFBConfigAttribSGIX(dpy, config, attribute, value); return (int)0;} -GLXFBConfigSGIX * __stdcall _Lazy_glXChooseFBConfigSGIX(Display * dpy, int screen, int * attrib_list, int * nelements) {if (GLeeInit()) return glXChooseFBConfigSGIX(dpy, screen, attrib_list, nelements); return (GLXFBConfigSGIX *)0;} -GLXPixmap __stdcall _Lazy_glXCreateGLXPixmapWithConfigSGIX(Display * dpy, GLXFBConfigSGIX config, Pixmap pixmap) {if (GLeeInit()) return glXCreateGLXPixmapWithConfigSGIX(dpy, config, pixmap); return (GLXPixmap)0;} -GLXContext __stdcall _Lazy_glXCreateContextWithConfigSGIX(Display * dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct) {if (GLeeInit()) return glXCreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct); return (GLXContext)0;} -XVisualInfo * __stdcall _Lazy_glXGetVisualFromFBConfigSGIX(Display * dpy, GLXFBConfigSGIX config) {if (GLeeInit()) return glXGetVisualFromFBConfigSGIX(dpy, config); return (XVisualInfo *)0;} -GLXFBConfigSGIX __stdcall _Lazy_glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis) {if (GLeeInit()) return glXGetFBConfigFromVisualSGIX(dpy, vis); return (GLXFBConfigSGIX)0;} -PFNGLXGETFBCONFIGATTRIBSGIXPROC pglXGetFBConfigAttribSGIX=_Lazy_glXGetFBConfigAttribSGIX; -PFNGLXCHOOSEFBCONFIGSGIXPROC pglXChooseFBConfigSGIX=_Lazy_glXChooseFBConfigSGIX; -PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC pglXCreateGLXPixmapWithConfigSGIX=_Lazy_glXCreateGLXPixmapWithConfigSGIX; -PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC pglXCreateContextWithConfigSGIX=_Lazy_glXCreateContextWithConfigSGIX; -PFNGLXGETVISUALFROMFBCONFIGSGIXPROC pglXGetVisualFromFBConfigSGIX=_Lazy_glXGetVisualFromFBConfigSGIX; -PFNGLXGETFBCONFIGFROMVISUALSGIXPROC pglXGetFBConfigFromVisualSGIX=_Lazy_glXGetFBConfigFromVisualSGIX; -#endif - -/* GLX_SGIX_pbuffer */ - -#ifdef __GLEE_GLX_SGIX_pbuffer -GLXPbufferSGIX __stdcall _Lazy_glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int * attrib_list) {if (GLeeInit()) return glXCreateGLXPbufferSGIX(dpy, config, width, height, attrib_list); return (GLXPbufferSGIX)0;} -void __stdcall _Lazy_glXDestroyGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX pbuf) {if (GLeeInit()) glXDestroyGLXPbufferSGIX(dpy, pbuf);} -int __stdcall _Lazy_glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int * value) {if (GLeeInit()) return glXQueryGLXPbufferSGIX(dpy, pbuf, attribute, value); return (int)0;} -void __stdcall _Lazy_glXSelectEventSGIX(Display * dpy, GLXDrawable drawable, unsigned long mask) {if (GLeeInit()) glXSelectEventSGIX(dpy, drawable, mask);} -void __stdcall _Lazy_glXGetSelectedEventSGIX(Display * dpy, GLXDrawable drawable, unsigned long * mask) {if (GLeeInit()) glXGetSelectedEventSGIX(dpy, drawable, mask);} -PFNGLXCREATEGLXPBUFFERSGIXPROC pglXCreateGLXPbufferSGIX=_Lazy_glXCreateGLXPbufferSGIX; -PFNGLXDESTROYGLXPBUFFERSGIXPROC pglXDestroyGLXPbufferSGIX=_Lazy_glXDestroyGLXPbufferSGIX; -PFNGLXQUERYGLXPBUFFERSGIXPROC pglXQueryGLXPbufferSGIX=_Lazy_glXQueryGLXPbufferSGIX; -PFNGLXSELECTEVENTSGIXPROC pglXSelectEventSGIX=_Lazy_glXSelectEventSGIX; -PFNGLXGETSELECTEDEVENTSGIXPROC pglXGetSelectedEventSGIX=_Lazy_glXGetSelectedEventSGIX; -#endif - -/* GLX_SGI_cushion */ - -#ifdef __GLEE_GLX_SGI_cushion -void __stdcall _Lazy_glXCushionSGI(Display * dpy, Window window, float cushion) {if (GLeeInit()) glXCushionSGI(dpy, window, cushion);} -PFNGLXCUSHIONSGIPROC pglXCushionSGI=_Lazy_glXCushionSGI; -#endif - -/* GLX_SGIX_video_resize */ - -#ifdef __GLEE_GLX_SGIX_video_resize -int __stdcall _Lazy_glXBindChannelToWindowSGIX(Display * display, int screen, int channel, Window window) {if (GLeeInit()) return glXBindChannelToWindowSGIX(display, screen, channel, window); return (int)0;} -int __stdcall _Lazy_glXChannelRectSGIX(Display * display, int screen, int channel, int x, int y, int w, int h) {if (GLeeInit()) return glXChannelRectSGIX(display, screen, channel, x, y, w, h); return (int)0;} -int __stdcall _Lazy_glXQueryChannelRectSGIX(Display * display, int screen, int channel, int * dx, int * dy, int * dw, int * dh) {if (GLeeInit()) return glXQueryChannelRectSGIX(display, screen, channel, dx, dy, dw, dh); return (int)0;} -int __stdcall _Lazy_glXQueryChannelDeltasSGIX(Display * display, int screen, int channel, int * x, int * y, int * w, int * h) {if (GLeeInit()) return glXQueryChannelDeltasSGIX(display, screen, channel, x, y, w, h); return (int)0;} -int __stdcall _Lazy_glXChannelRectSyncSGIX(Display * display, int screen, int channel, GLenum synctype) {if (GLeeInit()) return glXChannelRectSyncSGIX(display, screen, channel, synctype); return (int)0;} -PFNGLXBINDCHANNELTOWINDOWSGIXPROC pglXBindChannelToWindowSGIX=_Lazy_glXBindChannelToWindowSGIX; -PFNGLXCHANNELRECTSGIXPROC pglXChannelRectSGIX=_Lazy_glXChannelRectSGIX; -PFNGLXQUERYCHANNELRECTSGIXPROC pglXQueryChannelRectSGIX=_Lazy_glXQueryChannelRectSGIX; -PFNGLXQUERYCHANNELDELTASSGIXPROC pglXQueryChannelDeltasSGIX=_Lazy_glXQueryChannelDeltasSGIX; -PFNGLXCHANNELRECTSYNCSGIXPROC pglXChannelRectSyncSGIX=_Lazy_glXChannelRectSyncSGIX; -#endif - -/* GLX_SGIX_swap_group */ - -#ifdef __GLEE_GLX_SGIX_swap_group -void __stdcall _Lazy_glXJoinSwapGroupSGIX(Display * dpy, GLXDrawable drawable, GLXDrawable member) {if (GLeeInit()) glXJoinSwapGroupSGIX(dpy, drawable, member);} -PFNGLXJOINSWAPGROUPSGIXPROC pglXJoinSwapGroupSGIX=_Lazy_glXJoinSwapGroupSGIX; -#endif - -/* GLX_SGIX_swap_barrier */ - -#ifdef __GLEE_GLX_SGIX_swap_barrier -void __stdcall _Lazy_glXBindSwapBarrierSGIX(Display * dpy, GLXDrawable drawable, int barrier) {if (GLeeInit()) glXBindSwapBarrierSGIX(dpy, drawable, barrier);} -Bool __stdcall _Lazy_glXQueryMaxSwapBarriersSGIX(Display * dpy, int screen, int * max) {if (GLeeInit()) return glXQueryMaxSwapBarriersSGIX(dpy, screen, max); return (Bool)0;} -PFNGLXBINDSWAPBARRIERSGIXPROC pglXBindSwapBarrierSGIX=_Lazy_glXBindSwapBarrierSGIX; -PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC pglXQueryMaxSwapBarriersSGIX=_Lazy_glXQueryMaxSwapBarriersSGIX; -#endif - -/* GLX_SGIS_blended_overlay */ - -#ifdef __GLEE_GLX_SGIS_blended_overlay -#endif - -/* GLX_SGIS_shared_multisample */ - -#ifdef __GLEE_GLX_SGIS_shared_multisample -#endif - -/* GLX_SUN_get_transparent_index */ - -#ifdef __GLEE_GLX_SUN_get_transparent_index -Status __stdcall _Lazy_glXGetTransparentIndexSUN(Display * dpy, Window overlay, Window underlay, long * pTransparentIndex) {if (GLeeInit()) return glXGetTransparentIndexSUN(dpy, overlay, underlay, pTransparentIndex); return (Status)0;} -PFNGLXGETTRANSPARENTINDEXSUNPROC pglXGetTransparentIndexSUN=_Lazy_glXGetTransparentIndexSUN; -#endif - -/* GLX_3DFX_multisample */ - -#ifdef __GLEE_GLX_3DFX_multisample -#endif - -/* GLX_MESA_copy_sub_buffer */ - -#ifdef __GLEE_GLX_MESA_copy_sub_buffer -void __stdcall _Lazy_glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable, int x, int y, int width, int height) {if (GLeeInit()) glXCopySubBufferMESA(dpy, drawable, x, y, width, height);} -PFNGLXCOPYSUBBUFFERMESAPROC pglXCopySubBufferMESA=_Lazy_glXCopySubBufferMESA; -#endif - -/* GLX_MESA_pixmap_colormap */ - -#ifdef __GLEE_GLX_MESA_pixmap_colormap -GLXPixmap __stdcall _Lazy_glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual, Pixmap pixmap, Colormap cmap) {if (GLeeInit()) return glXCreateGLXPixmapMESA(dpy, visual, pixmap, cmap); return (GLXPixmap)0;} -PFNGLXCREATEGLXPIXMAPMESAPROC pglXCreateGLXPixmapMESA=_Lazy_glXCreateGLXPixmapMESA; -#endif - -/* GLX_MESA_release_buffers */ - -#ifdef __GLEE_GLX_MESA_release_buffers -Bool __stdcall _Lazy_glXReleaseBuffersMESA(Display * dpy, GLXDrawable drawable) {if (GLeeInit()) return glXReleaseBuffersMESA(dpy, drawable); return (Bool)0;} -PFNGLXRELEASEBUFFERSMESAPROC pglXReleaseBuffersMESA=_Lazy_glXReleaseBuffersMESA; -#endif - -/* GLX_MESA_set_3dfx_mode */ - -#ifdef __GLEE_GLX_MESA_set_3dfx_mode -Bool __stdcall _Lazy_glXSet3DfxModeMESA(int mode) {if (GLeeInit()) return glXSet3DfxModeMESA(mode); return (Bool)0;} -PFNGLXSET3DFXMODEMESAPROC pglXSet3DfxModeMESA=_Lazy_glXSet3DfxModeMESA; -#endif - -/* GLX_SGIX_visual_select_group */ - -#ifdef __GLEE_GLX_SGIX_visual_select_group -#endif - -/* GLX_OML_swap_method */ - -#ifdef __GLEE_GLX_OML_swap_method -#endif - -/* GLX_OML_sync_control */ - -#ifdef __GLEE_GLX_OML_sync_control -Bool __stdcall _Lazy_glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable, int64_t * ust, int64_t * msc, int64_t * sbc) {if (GLeeInit()) return glXGetSyncValuesOML(dpy, drawable, ust, msc, sbc); return (Bool)0;} -Bool __stdcall _Lazy_glXGetMscRateOML(Display * dpy, GLXDrawable drawable, int32_t * numerator, int32_t * denominator) {if (GLeeInit()) return glXGetMscRateOML(dpy, drawable, numerator, denominator); return (Bool)0;} -int64_t __stdcall _Lazy_glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder) {if (GLeeInit()) return glXSwapBuffersMscOML(dpy, drawable, target_msc, divisor, remainder); return (int64_t)0;} -Bool __stdcall _Lazy_glXWaitForMscOML(Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * ust, int64_t * msc, int64_t * sbc) {if (GLeeInit()) return glXWaitForMscOML(dpy, drawable, target_msc, divisor, remainder, ust, msc, sbc); return (Bool)0;} -Bool __stdcall _Lazy_glXWaitForSbcOML(Display * dpy, GLXDrawable drawable, int64_t target_sbc, int64_t * ust, int64_t * msc, int64_t * sbc) {if (GLeeInit()) return glXWaitForSbcOML(dpy, drawable, target_sbc, ust, msc, sbc); return (Bool)0;} -PFNGLXGETSYNCVALUESOMLPROC pglXGetSyncValuesOML=_Lazy_glXGetSyncValuesOML; -PFNGLXGETMSCRATEOMLPROC pglXGetMscRateOML=_Lazy_glXGetMscRateOML; -PFNGLXSWAPBUFFERSMSCOMLPROC pglXSwapBuffersMscOML=_Lazy_glXSwapBuffersMscOML; -PFNGLXWAITFORMSCOMLPROC pglXWaitForMscOML=_Lazy_glXWaitForMscOML; -PFNGLXWAITFORSBCOMLPROC pglXWaitForSbcOML=_Lazy_glXWaitForSbcOML; -#endif - -/* GLX_NV_float_buffer */ - -#ifdef __GLEE_GLX_NV_float_buffer -#endif - -/* GLX_SGIX_hyperpipe */ - -#ifdef __GLEE_GLX_SGIX_hyperpipe -GLXHyperpipeNetworkSGIX * __stdcall _Lazy_glXQueryHyperpipeNetworkSGIX(Display * dpy, int * npipes) {if (GLeeInit()) return glXQueryHyperpipeNetworkSGIX(dpy, npipes); return (GLXHyperpipeNetworkSGIX *)0;} -int __stdcall _Lazy_glXHyperpipeConfigSGIX(Display * dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX * cfg, int * hpId) {if (GLeeInit()) return glXHyperpipeConfigSGIX(dpy, networkId, npipes, cfg, hpId); return (int)0;} -GLXHyperpipeConfigSGIX * __stdcall _Lazy_glXQueryHyperpipeConfigSGIX(Display * dpy, int hpId, int * npipes) {if (GLeeInit()) return glXQueryHyperpipeConfigSGIX(dpy, hpId, npipes); return (GLXHyperpipeConfigSGIX *)0;} -int __stdcall _Lazy_glXDestroyHyperpipeConfigSGIX(Display * dpy, int hpId) {if (GLeeInit()) return glXDestroyHyperpipeConfigSGIX(dpy, hpId); return (int)0;} -int __stdcall _Lazy_glXBindHyperpipeSGIX(Display * dpy, int hpId) {if (GLeeInit()) return glXBindHyperpipeSGIX(dpy, hpId); return (int)0;} -int __stdcall _Lazy_glXQueryHyperpipeBestAttribSGIX(Display * dpy, int timeSlice, int attrib, int size, void * attribList, void * returnAttribList) {if (GLeeInit()) return glXQueryHyperpipeBestAttribSGIX(dpy, timeSlice, attrib, size, attribList, returnAttribList); return (int)0;} -int __stdcall _Lazy_glXHyperpipeAttribSGIX(Display * dpy, int timeSlice, int attrib, int size, void * attribList) {if (GLeeInit()) return glXHyperpipeAttribSGIX(dpy, timeSlice, attrib, size, attribList); return (int)0;} -int __stdcall _Lazy_glXQueryHyperpipeAttribSGIX(Display * dpy, int timeSlice, int attrib, int size, void * returnAttribList) {if (GLeeInit()) return glXQueryHyperpipeAttribSGIX(dpy, timeSlice, attrib, size, returnAttribList); return (int)0;} -PFNGLXQUERYHYPERPIPENETWORKSGIXPROC pglXQueryHyperpipeNetworkSGIX=_Lazy_glXQueryHyperpipeNetworkSGIX; -PFNGLXHYPERPIPECONFIGSGIXPROC pglXHyperpipeConfigSGIX=_Lazy_glXHyperpipeConfigSGIX; -PFNGLXQUERYHYPERPIPECONFIGSGIXPROC pglXQueryHyperpipeConfigSGIX=_Lazy_glXQueryHyperpipeConfigSGIX; -PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC pglXDestroyHyperpipeConfigSGIX=_Lazy_glXDestroyHyperpipeConfigSGIX; -PFNGLXBINDHYPERPIPESGIXPROC pglXBindHyperpipeSGIX=_Lazy_glXBindHyperpipeSGIX; -PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC pglXQueryHyperpipeBestAttribSGIX=_Lazy_glXQueryHyperpipeBestAttribSGIX; -PFNGLXHYPERPIPEATTRIBSGIXPROC pglXHyperpipeAttribSGIX=_Lazy_glXHyperpipeAttribSGIX; -PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC pglXQueryHyperpipeAttribSGIX=_Lazy_glXQueryHyperpipeAttribSGIX; -#endif - -/* GLX_MESA_agp_offset */ - -#ifdef __GLEE_GLX_MESA_agp_offset -unsigned int __stdcall _Lazy_glXGetAGPOffsetMESA(const void * pointer) {if (GLeeInit()) return glXGetAGPOffsetMESA(pointer); return (unsigned int)0;} -PFNGLXGETAGPOFFSETMESAPROC pglXGetAGPOffsetMESA=_Lazy_glXGetAGPOffsetMESA; -#endif - -/* GLX_EXT_fbconfig_packed_float */ - -#ifdef __GLEE_GLX_EXT_fbconfig_packed_float -#endif - -/* GLX_EXT_framebuffer_sRGB */ - -#ifdef __GLEE_GLX_EXT_framebuffer_sRGB -#endif - -/* GLX_EXT_texture_from_pixmap */ - -#ifdef __GLEE_GLX_EXT_texture_from_pixmap -void __stdcall _Lazy_glXBindTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer, const int * attrib_list) {if (GLeeInit()) glXBindTexImageEXT(dpy, drawable, buffer, attrib_list);} -void __stdcall _Lazy_glXReleaseTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer) {if (GLeeInit()) glXReleaseTexImageEXT(dpy, drawable, buffer);} -PFNGLXBINDTEXIMAGEEXTPROC pglXBindTexImageEXT=_Lazy_glXBindTexImageEXT; -PFNGLXRELEASETEXIMAGEEXTPROC pglXReleaseTexImageEXT=_Lazy_glXReleaseTexImageEXT; -#endif - -/* GLX_NV_present_video */ - -#ifdef __GLEE_GLX_NV_present_video -#endif - -/* GLX_NV_video_out */ - -#ifdef __GLEE_GLX_NV_video_out -#endif - -/* GLX_NV_swap_group */ - -#ifdef __GLEE_GLX_NV_swap_group -#endif - -/* GLX_EXT_scene_marker */ - -#ifdef __GLEE_GLX_EXT_scene_marker -#endif - -/* GLX_NV_video_output */ - -#ifdef __GLEE_GLX_NV_video_output -int __stdcall _Lazy_glXGetVideoDeviceNV(Display * dpy, int screen, int numVideoDevices, GLXVideoDeviceNV * pVideoDevice) {if (GLeeInit()) return glXGetVideoDeviceNV(dpy, screen, numVideoDevices, pVideoDevice); return (int)0;} -int __stdcall _Lazy_glXReleaseVideoDeviceNV(Display * dpy, int screen, GLXVideoDeviceNV VideoDevice) {if (GLeeInit()) return glXReleaseVideoDeviceNV(dpy, screen, VideoDevice); return (int)0;} -int __stdcall _Lazy_glXBindVideoImageNV(Display * dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer) {if (GLeeInit()) return glXBindVideoImageNV(dpy, VideoDevice, pbuf, iVideoBuffer); return (int)0;} -int __stdcall _Lazy_glXReleaseVideoImageNV(Display * dpy, GLXPbuffer pbuf) {if (GLeeInit()) return glXReleaseVideoImageNV(dpy, pbuf); return (int)0;} -int __stdcall _Lazy_glXSendPbufferToVideoNV(Display * dpy, GLXPbuffer pbuf, int iBufferType, unsigned long * pulCounterPbuffer, GLboolean bBlock) {if (GLeeInit()) return glXSendPbufferToVideoNV(dpy, pbuf, iBufferType, pulCounterPbuffer, bBlock); return (int)0;} -int __stdcall _Lazy_glXGetVideoInfoNV(Display * dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long * pulCounterOutputPbuffer, unsigned long * pulCounterOutputVideo) {if (GLeeInit()) return glXGetVideoInfoNV(dpy, screen, VideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo); return (int)0;} -PFNGLXGETVIDEODEVICENVPROC pglXGetVideoDeviceNV=_Lazy_glXGetVideoDeviceNV; -PFNGLXRELEASEVIDEODEVICENVPROC pglXReleaseVideoDeviceNV=_Lazy_glXReleaseVideoDeviceNV; -PFNGLXBINDVIDEOIMAGENVPROC pglXBindVideoImageNV=_Lazy_glXBindVideoImageNV; -PFNGLXRELEASEVIDEOIMAGENVPROC pglXReleaseVideoImageNV=_Lazy_glXReleaseVideoImageNV; -PFNGLXSENDPBUFFERTOVIDEONVPROC pglXSendPbufferToVideoNV=_Lazy_glXSendPbufferToVideoNV; -PFNGLXGETVIDEOINFONVPROC pglXGetVideoInfoNV=_Lazy_glXGetVideoInfoNV; -#endif -#endif /* end GLX */ -/***************************************************************** -* Extension link functions -*****************************************************************/ - -GLuint __GLeeLink_GL_VERSION_1_2(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_VERSION_1_2 - if ((pglBlendColor = (PFNGLBLENDCOLORPROC) __GLeeGetProcAddress("glBlendColor"))!=0) nLinked++; - if ((pglBlendEquation = (PFNGLBLENDEQUATIONPROC) __GLeeGetProcAddress("glBlendEquation"))!=0) nLinked++; - if ((pglDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) __GLeeGetProcAddress("glDrawRangeElements"))!=0) nLinked++; - if ((pglColorTable = (PFNGLCOLORTABLEPROC) __GLeeGetProcAddress("glColorTable"))!=0) nLinked++; - if ((pglColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC) __GLeeGetProcAddress("glColorTableParameterfv"))!=0) nLinked++; - if ((pglColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC) __GLeeGetProcAddress("glColorTableParameteriv"))!=0) nLinked++; - if ((pglCopyColorTable = (PFNGLCOPYCOLORTABLEPROC) __GLeeGetProcAddress("glCopyColorTable"))!=0) nLinked++; - if ((pglGetColorTable = (PFNGLGETCOLORTABLEPROC) __GLeeGetProcAddress("glGetColorTable"))!=0) nLinked++; - if ((pglGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC) __GLeeGetProcAddress("glGetColorTableParameterfv"))!=0) nLinked++; - if ((pglGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC) __GLeeGetProcAddress("glGetColorTableParameteriv"))!=0) nLinked++; - if ((pglColorSubTable = (PFNGLCOLORSUBTABLEPROC) __GLeeGetProcAddress("glColorSubTable"))!=0) nLinked++; - if ((pglCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC) __GLeeGetProcAddress("glCopyColorSubTable"))!=0) nLinked++; - if ((pglConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC) __GLeeGetProcAddress("glConvolutionFilter1D"))!=0) nLinked++; - if ((pglConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC) __GLeeGetProcAddress("glConvolutionFilter2D"))!=0) nLinked++; - if ((pglConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC) __GLeeGetProcAddress("glConvolutionParameterf"))!=0) nLinked++; - if ((pglConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC) __GLeeGetProcAddress("glConvolutionParameterfv"))!=0) nLinked++; - if ((pglConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC) __GLeeGetProcAddress("glConvolutionParameteri"))!=0) nLinked++; - if ((pglConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC) __GLeeGetProcAddress("glConvolutionParameteriv"))!=0) nLinked++; - if ((pglCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC) __GLeeGetProcAddress("glCopyConvolutionFilter1D"))!=0) nLinked++; - if ((pglCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC) __GLeeGetProcAddress("glCopyConvolutionFilter2D"))!=0) nLinked++; - if ((pglGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC) __GLeeGetProcAddress("glGetConvolutionFilter"))!=0) nLinked++; - if ((pglGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC) __GLeeGetProcAddress("glGetConvolutionParameterfv"))!=0) nLinked++; - if ((pglGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC) __GLeeGetProcAddress("glGetConvolutionParameteriv"))!=0) nLinked++; - if ((pglGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC) __GLeeGetProcAddress("glGetSeparableFilter"))!=0) nLinked++; - if ((pglSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC) __GLeeGetProcAddress("glSeparableFilter2D"))!=0) nLinked++; - if ((pglGetHistogram = (PFNGLGETHISTOGRAMPROC) __GLeeGetProcAddress("glGetHistogram"))!=0) nLinked++; - if ((pglGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC) __GLeeGetProcAddress("glGetHistogramParameterfv"))!=0) nLinked++; - if ((pglGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC) __GLeeGetProcAddress("glGetHistogramParameteriv"))!=0) nLinked++; - if ((pglGetMinmax = (PFNGLGETMINMAXPROC) __GLeeGetProcAddress("glGetMinmax"))!=0) nLinked++; - if ((pglGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC) __GLeeGetProcAddress("glGetMinmaxParameterfv"))!=0) nLinked++; - if ((pglGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC) __GLeeGetProcAddress("glGetMinmaxParameteriv"))!=0) nLinked++; - if ((pglHistogram = (PFNGLHISTOGRAMPROC) __GLeeGetProcAddress("glHistogram"))!=0) nLinked++; - if ((pglMinmax = (PFNGLMINMAXPROC) __GLeeGetProcAddress("glMinmax"))!=0) nLinked++; - if ((pglResetHistogram = (PFNGLRESETHISTOGRAMPROC) __GLeeGetProcAddress("glResetHistogram"))!=0) nLinked++; - if ((pglResetMinmax = (PFNGLRESETMINMAXPROC) __GLeeGetProcAddress("glResetMinmax"))!=0) nLinked++; - if ((pglTexImage3D = (PFNGLTEXIMAGE3DPROC) __GLeeGetProcAddress("glTexImage3D"))!=0) nLinked++; - if ((pglTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) __GLeeGetProcAddress("glTexSubImage3D"))!=0) nLinked++; - if ((pglCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) __GLeeGetProcAddress("glCopyTexSubImage3D"))!=0) nLinked++; -#endif - if (nLinked==38) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_imaging(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_VERSION_1_3(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_VERSION_1_3 - if ((pglActiveTexture = (PFNGLACTIVETEXTUREPROC) __GLeeGetProcAddress("glActiveTexture"))!=0) nLinked++; - if ((pglClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC) __GLeeGetProcAddress("glClientActiveTexture"))!=0) nLinked++; - if ((pglMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC) __GLeeGetProcAddress("glMultiTexCoord1d"))!=0) nLinked++; - if ((pglMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC) __GLeeGetProcAddress("glMultiTexCoord1dv"))!=0) nLinked++; - if ((pglMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC) __GLeeGetProcAddress("glMultiTexCoord1f"))!=0) nLinked++; - if ((pglMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC) __GLeeGetProcAddress("glMultiTexCoord1fv"))!=0) nLinked++; - if ((pglMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC) __GLeeGetProcAddress("glMultiTexCoord1i"))!=0) nLinked++; - if ((pglMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC) __GLeeGetProcAddress("glMultiTexCoord1iv"))!=0) nLinked++; - if ((pglMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC) __GLeeGetProcAddress("glMultiTexCoord1s"))!=0) nLinked++; - if ((pglMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC) __GLeeGetProcAddress("glMultiTexCoord1sv"))!=0) nLinked++; - if ((pglMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC) __GLeeGetProcAddress("glMultiTexCoord2d"))!=0) nLinked++; - if ((pglMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC) __GLeeGetProcAddress("glMultiTexCoord2dv"))!=0) nLinked++; - if ((pglMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC) __GLeeGetProcAddress("glMultiTexCoord2f"))!=0) nLinked++; - if ((pglMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC) __GLeeGetProcAddress("glMultiTexCoord2fv"))!=0) nLinked++; - if ((pglMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC) __GLeeGetProcAddress("glMultiTexCoord2i"))!=0) nLinked++; - if ((pglMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC) __GLeeGetProcAddress("glMultiTexCoord2iv"))!=0) nLinked++; - if ((pglMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC) __GLeeGetProcAddress("glMultiTexCoord2s"))!=0) nLinked++; - if ((pglMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC) __GLeeGetProcAddress("glMultiTexCoord2sv"))!=0) nLinked++; - if ((pglMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC) __GLeeGetProcAddress("glMultiTexCoord3d"))!=0) nLinked++; - if ((pglMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC) __GLeeGetProcAddress("glMultiTexCoord3dv"))!=0) nLinked++; - if ((pglMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC) __GLeeGetProcAddress("glMultiTexCoord3f"))!=0) nLinked++; - if ((pglMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC) __GLeeGetProcAddress("glMultiTexCoord3fv"))!=0) nLinked++; - if ((pglMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC) __GLeeGetProcAddress("glMultiTexCoord3i"))!=0) nLinked++; - if ((pglMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC) __GLeeGetProcAddress("glMultiTexCoord3iv"))!=0) nLinked++; - if ((pglMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC) __GLeeGetProcAddress("glMultiTexCoord3s"))!=0) nLinked++; - if ((pglMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC) __GLeeGetProcAddress("glMultiTexCoord3sv"))!=0) nLinked++; - if ((pglMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC) __GLeeGetProcAddress("glMultiTexCoord4d"))!=0) nLinked++; - if ((pglMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC) __GLeeGetProcAddress("glMultiTexCoord4dv"))!=0) nLinked++; - if ((pglMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC) __GLeeGetProcAddress("glMultiTexCoord4f"))!=0) nLinked++; - if ((pglMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC) __GLeeGetProcAddress("glMultiTexCoord4fv"))!=0) nLinked++; - if ((pglMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC) __GLeeGetProcAddress("glMultiTexCoord4i"))!=0) nLinked++; - if ((pglMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC) __GLeeGetProcAddress("glMultiTexCoord4iv"))!=0) nLinked++; - if ((pglMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC) __GLeeGetProcAddress("glMultiTexCoord4s"))!=0) nLinked++; - if ((pglMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC) __GLeeGetProcAddress("glMultiTexCoord4sv"))!=0) nLinked++; - if ((pglLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC) __GLeeGetProcAddress("glLoadTransposeMatrixf"))!=0) nLinked++; - if ((pglLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC) __GLeeGetProcAddress("glLoadTransposeMatrixd"))!=0) nLinked++; - if ((pglMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC) __GLeeGetProcAddress("glMultTransposeMatrixf"))!=0) nLinked++; - if ((pglMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC) __GLeeGetProcAddress("glMultTransposeMatrixd"))!=0) nLinked++; - if ((pglSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) __GLeeGetProcAddress("glSampleCoverage"))!=0) nLinked++; - if ((pglCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) __GLeeGetProcAddress("glCompressedTexImage3D"))!=0) nLinked++; - if ((pglCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) __GLeeGetProcAddress("glCompressedTexImage2D"))!=0) nLinked++; - if ((pglCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC) __GLeeGetProcAddress("glCompressedTexImage1D"))!=0) nLinked++; - if ((pglCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) __GLeeGetProcAddress("glCompressedTexSubImage3D"))!=0) nLinked++; - if ((pglCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) __GLeeGetProcAddress("glCompressedTexSubImage2D"))!=0) nLinked++; - if ((pglCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) __GLeeGetProcAddress("glCompressedTexSubImage1D"))!=0) nLinked++; - if ((pglGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC) __GLeeGetProcAddress("glGetCompressedTexImage"))!=0) nLinked++; -#endif - if (nLinked==46) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_VERSION_1_4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_VERSION_1_4 - if ((pglBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) __GLeeGetProcAddress("glBlendFuncSeparate"))!=0) nLinked++; - if ((pglFogCoordf = (PFNGLFOGCOORDFPROC) __GLeeGetProcAddress("glFogCoordf"))!=0) nLinked++; - if ((pglFogCoordfv = (PFNGLFOGCOORDFVPROC) __GLeeGetProcAddress("glFogCoordfv"))!=0) nLinked++; - if ((pglFogCoordd = (PFNGLFOGCOORDDPROC) __GLeeGetProcAddress("glFogCoordd"))!=0) nLinked++; - if ((pglFogCoorddv = (PFNGLFOGCOORDDVPROC) __GLeeGetProcAddress("glFogCoorddv"))!=0) nLinked++; - if ((pglFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC) __GLeeGetProcAddress("glFogCoordPointer"))!=0) nLinked++; - if ((pglMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC) __GLeeGetProcAddress("glMultiDrawArrays"))!=0) nLinked++; - if ((pglMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC) __GLeeGetProcAddress("glMultiDrawElements"))!=0) nLinked++; - if ((pglPointParameterf = (PFNGLPOINTPARAMETERFPROC) __GLeeGetProcAddress("glPointParameterf"))!=0) nLinked++; - if ((pglPointParameterfv = (PFNGLPOINTPARAMETERFVPROC) __GLeeGetProcAddress("glPointParameterfv"))!=0) nLinked++; - if ((pglPointParameteri = (PFNGLPOINTPARAMETERIPROC) __GLeeGetProcAddress("glPointParameteri"))!=0) nLinked++; - if ((pglPointParameteriv = (PFNGLPOINTPARAMETERIVPROC) __GLeeGetProcAddress("glPointParameteriv"))!=0) nLinked++; - if ((pglSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC) __GLeeGetProcAddress("glSecondaryColor3b"))!=0) nLinked++; - if ((pglSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC) __GLeeGetProcAddress("glSecondaryColor3bv"))!=0) nLinked++; - if ((pglSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC) __GLeeGetProcAddress("glSecondaryColor3d"))!=0) nLinked++; - if ((pglSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC) __GLeeGetProcAddress("glSecondaryColor3dv"))!=0) nLinked++; - if ((pglSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC) __GLeeGetProcAddress("glSecondaryColor3f"))!=0) nLinked++; - if ((pglSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC) __GLeeGetProcAddress("glSecondaryColor3fv"))!=0) nLinked++; - if ((pglSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC) __GLeeGetProcAddress("glSecondaryColor3i"))!=0) nLinked++; - if ((pglSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC) __GLeeGetProcAddress("glSecondaryColor3iv"))!=0) nLinked++; - if ((pglSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC) __GLeeGetProcAddress("glSecondaryColor3s"))!=0) nLinked++; - if ((pglSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC) __GLeeGetProcAddress("glSecondaryColor3sv"))!=0) nLinked++; - if ((pglSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC) __GLeeGetProcAddress("glSecondaryColor3ub"))!=0) nLinked++; - if ((pglSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC) __GLeeGetProcAddress("glSecondaryColor3ubv"))!=0) nLinked++; - if ((pglSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC) __GLeeGetProcAddress("glSecondaryColor3ui"))!=0) nLinked++; - if ((pglSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC) __GLeeGetProcAddress("glSecondaryColor3uiv"))!=0) nLinked++; - if ((pglSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC) __GLeeGetProcAddress("glSecondaryColor3us"))!=0) nLinked++; - if ((pglSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC) __GLeeGetProcAddress("glSecondaryColor3usv"))!=0) nLinked++; - if ((pglSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC) __GLeeGetProcAddress("glSecondaryColorPointer"))!=0) nLinked++; - if ((pglWindowPos2d = (PFNGLWINDOWPOS2DPROC) __GLeeGetProcAddress("glWindowPos2d"))!=0) nLinked++; - if ((pglWindowPos2dv = (PFNGLWINDOWPOS2DVPROC) __GLeeGetProcAddress("glWindowPos2dv"))!=0) nLinked++; - if ((pglWindowPos2f = (PFNGLWINDOWPOS2FPROC) __GLeeGetProcAddress("glWindowPos2f"))!=0) nLinked++; - if ((pglWindowPos2fv = (PFNGLWINDOWPOS2FVPROC) __GLeeGetProcAddress("glWindowPos2fv"))!=0) nLinked++; - if ((pglWindowPos2i = (PFNGLWINDOWPOS2IPROC) __GLeeGetProcAddress("glWindowPos2i"))!=0) nLinked++; - if ((pglWindowPos2iv = (PFNGLWINDOWPOS2IVPROC) __GLeeGetProcAddress("glWindowPos2iv"))!=0) nLinked++; - if ((pglWindowPos2s = (PFNGLWINDOWPOS2SPROC) __GLeeGetProcAddress("glWindowPos2s"))!=0) nLinked++; - if ((pglWindowPos2sv = (PFNGLWINDOWPOS2SVPROC) __GLeeGetProcAddress("glWindowPos2sv"))!=0) nLinked++; - if ((pglWindowPos3d = (PFNGLWINDOWPOS3DPROC) __GLeeGetProcAddress("glWindowPos3d"))!=0) nLinked++; - if ((pglWindowPos3dv = (PFNGLWINDOWPOS3DVPROC) __GLeeGetProcAddress("glWindowPos3dv"))!=0) nLinked++; - if ((pglWindowPos3f = (PFNGLWINDOWPOS3FPROC) __GLeeGetProcAddress("glWindowPos3f"))!=0) nLinked++; - if ((pglWindowPos3fv = (PFNGLWINDOWPOS3FVPROC) __GLeeGetProcAddress("glWindowPos3fv"))!=0) nLinked++; - if ((pglWindowPos3i = (PFNGLWINDOWPOS3IPROC) __GLeeGetProcAddress("glWindowPos3i"))!=0) nLinked++; - if ((pglWindowPos3iv = (PFNGLWINDOWPOS3IVPROC) __GLeeGetProcAddress("glWindowPos3iv"))!=0) nLinked++; - if ((pglWindowPos3s = (PFNGLWINDOWPOS3SPROC) __GLeeGetProcAddress("glWindowPos3s"))!=0) nLinked++; - if ((pglWindowPos3sv = (PFNGLWINDOWPOS3SVPROC) __GLeeGetProcAddress("glWindowPos3sv"))!=0) nLinked++; -#endif - if (nLinked==45) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_VERSION_1_5(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_VERSION_1_5 - if ((pglGenQueries = (PFNGLGENQUERIESPROC) __GLeeGetProcAddress("glGenQueries"))!=0) nLinked++; - if ((pglDeleteQueries = (PFNGLDELETEQUERIESPROC) __GLeeGetProcAddress("glDeleteQueries"))!=0) nLinked++; - if ((pglIsQuery = (PFNGLISQUERYPROC) __GLeeGetProcAddress("glIsQuery"))!=0) nLinked++; - if ((pglBeginQuery = (PFNGLBEGINQUERYPROC) __GLeeGetProcAddress("glBeginQuery"))!=0) nLinked++; - if ((pglEndQuery = (PFNGLENDQUERYPROC) __GLeeGetProcAddress("glEndQuery"))!=0) nLinked++; - if ((pglGetQueryiv = (PFNGLGETQUERYIVPROC) __GLeeGetProcAddress("glGetQueryiv"))!=0) nLinked++; - if ((pglGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC) __GLeeGetProcAddress("glGetQueryObjectiv"))!=0) nLinked++; - if ((pglGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) __GLeeGetProcAddress("glGetQueryObjectuiv"))!=0) nLinked++; - if ((pglBindBuffer = (PFNGLBINDBUFFERPROC) __GLeeGetProcAddress("glBindBuffer"))!=0) nLinked++; - if ((pglDeleteBuffers = (PFNGLDELETEBUFFERSPROC) __GLeeGetProcAddress("glDeleteBuffers"))!=0) nLinked++; - if ((pglGenBuffers = (PFNGLGENBUFFERSPROC) __GLeeGetProcAddress("glGenBuffers"))!=0) nLinked++; - if ((pglIsBuffer = (PFNGLISBUFFERPROC) __GLeeGetProcAddress("glIsBuffer"))!=0) nLinked++; - if ((pglBufferData = (PFNGLBUFFERDATAPROC) __GLeeGetProcAddress("glBufferData"))!=0) nLinked++; - if ((pglBufferSubData = (PFNGLBUFFERSUBDATAPROC) __GLeeGetProcAddress("glBufferSubData"))!=0) nLinked++; - if ((pglGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) __GLeeGetProcAddress("glGetBufferSubData"))!=0) nLinked++; - if ((pglMapBuffer = (PFNGLMAPBUFFERPROC) __GLeeGetProcAddress("glMapBuffer"))!=0) nLinked++; - if ((pglUnmapBuffer = (PFNGLUNMAPBUFFERPROC) __GLeeGetProcAddress("glUnmapBuffer"))!=0) nLinked++; - if ((pglGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) __GLeeGetProcAddress("glGetBufferParameteriv"))!=0) nLinked++; - if ((pglGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) __GLeeGetProcAddress("glGetBufferPointerv"))!=0) nLinked++; -#endif - if (nLinked==19) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_VERSION_2_0(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_VERSION_2_0 - if ((pglBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) __GLeeGetProcAddress("glBlendEquationSeparate"))!=0) nLinked++; - if ((pglDrawBuffers = (PFNGLDRAWBUFFERSPROC) __GLeeGetProcAddress("glDrawBuffers"))!=0) nLinked++; - if ((pglStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) __GLeeGetProcAddress("glStencilOpSeparate"))!=0) nLinked++; - if ((pglStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) __GLeeGetProcAddress("glStencilFuncSeparate"))!=0) nLinked++; - if ((pglStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) __GLeeGetProcAddress("glStencilMaskSeparate"))!=0) nLinked++; - if ((pglAttachShader = (PFNGLATTACHSHADERPROC) __GLeeGetProcAddress("glAttachShader"))!=0) nLinked++; - if ((pglBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) __GLeeGetProcAddress("glBindAttribLocation"))!=0) nLinked++; - if ((pglCompileShader = (PFNGLCOMPILESHADERPROC) __GLeeGetProcAddress("glCompileShader"))!=0) nLinked++; - if ((pglCreateProgram = (PFNGLCREATEPROGRAMPROC) __GLeeGetProcAddress("glCreateProgram"))!=0) nLinked++; - if ((pglCreateShader = (PFNGLCREATESHADERPROC) __GLeeGetProcAddress("glCreateShader"))!=0) nLinked++; - if ((pglDeleteProgram = (PFNGLDELETEPROGRAMPROC) __GLeeGetProcAddress("glDeleteProgram"))!=0) nLinked++; - if ((pglDeleteShader = (PFNGLDELETESHADERPROC) __GLeeGetProcAddress("glDeleteShader"))!=0) nLinked++; - if ((pglDetachShader = (PFNGLDETACHSHADERPROC) __GLeeGetProcAddress("glDetachShader"))!=0) nLinked++; - if ((pglDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) __GLeeGetProcAddress("glDisableVertexAttribArray"))!=0) nLinked++; - if ((pglEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) __GLeeGetProcAddress("glEnableVertexAttribArray"))!=0) nLinked++; - if ((pglGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) __GLeeGetProcAddress("glGetActiveAttrib"))!=0) nLinked++; - if ((pglGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) __GLeeGetProcAddress("glGetActiveUniform"))!=0) nLinked++; - if ((pglGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) __GLeeGetProcAddress("glGetAttachedShaders"))!=0) nLinked++; - if ((pglGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) __GLeeGetProcAddress("glGetAttribLocation"))!=0) nLinked++; - if ((pglGetProgramiv = (PFNGLGETPROGRAMIVPROC) __GLeeGetProcAddress("glGetProgramiv"))!=0) nLinked++; - if ((pglGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) __GLeeGetProcAddress("glGetProgramInfoLog"))!=0) nLinked++; - if ((pglGetShaderiv = (PFNGLGETSHADERIVPROC) __GLeeGetProcAddress("glGetShaderiv"))!=0) nLinked++; - if ((pglGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) __GLeeGetProcAddress("glGetShaderInfoLog"))!=0) nLinked++; - if ((pglGetShaderSource = (PFNGLGETSHADERSOURCEPROC) __GLeeGetProcAddress("glGetShaderSource"))!=0) nLinked++; - if ((pglGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) __GLeeGetProcAddress("glGetUniformLocation"))!=0) nLinked++; - if ((pglGetUniformfv = (PFNGLGETUNIFORMFVPROC) __GLeeGetProcAddress("glGetUniformfv"))!=0) nLinked++; - if ((pglGetUniformiv = (PFNGLGETUNIFORMIVPROC) __GLeeGetProcAddress("glGetUniformiv"))!=0) nLinked++; - if ((pglGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC) __GLeeGetProcAddress("glGetVertexAttribdv"))!=0) nLinked++; - if ((pglGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) __GLeeGetProcAddress("glGetVertexAttribfv"))!=0) nLinked++; - if ((pglGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) __GLeeGetProcAddress("glGetVertexAttribiv"))!=0) nLinked++; - if ((pglGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) __GLeeGetProcAddress("glGetVertexAttribPointerv"))!=0) nLinked++; - if ((pglIsProgram = (PFNGLISPROGRAMPROC) __GLeeGetProcAddress("glIsProgram"))!=0) nLinked++; - if ((pglIsShader = (PFNGLISSHADERPROC) __GLeeGetProcAddress("glIsShader"))!=0) nLinked++; - if ((pglLinkProgram = (PFNGLLINKPROGRAMPROC) __GLeeGetProcAddress("glLinkProgram"))!=0) nLinked++; - if ((pglShaderSource = (PFNGLSHADERSOURCEPROC) __GLeeGetProcAddress("glShaderSource"))!=0) nLinked++; - if ((pglUseProgram = (PFNGLUSEPROGRAMPROC) __GLeeGetProcAddress("glUseProgram"))!=0) nLinked++; - if ((pglUniform1f = (PFNGLUNIFORM1FPROC) __GLeeGetProcAddress("glUniform1f"))!=0) nLinked++; - if ((pglUniform2f = (PFNGLUNIFORM2FPROC) __GLeeGetProcAddress("glUniform2f"))!=0) nLinked++; - if ((pglUniform3f = (PFNGLUNIFORM3FPROC) __GLeeGetProcAddress("glUniform3f"))!=0) nLinked++; - if ((pglUniform4f = (PFNGLUNIFORM4FPROC) __GLeeGetProcAddress("glUniform4f"))!=0) nLinked++; - if ((pglUniform1i = (PFNGLUNIFORM1IPROC) __GLeeGetProcAddress("glUniform1i"))!=0) nLinked++; - if ((pglUniform2i = (PFNGLUNIFORM2IPROC) __GLeeGetProcAddress("glUniform2i"))!=0) nLinked++; - if ((pglUniform3i = (PFNGLUNIFORM3IPROC) __GLeeGetProcAddress("glUniform3i"))!=0) nLinked++; - if ((pglUniform4i = (PFNGLUNIFORM4IPROC) __GLeeGetProcAddress("glUniform4i"))!=0) nLinked++; - if ((pglUniform1fv = (PFNGLUNIFORM1FVPROC) __GLeeGetProcAddress("glUniform1fv"))!=0) nLinked++; - if ((pglUniform2fv = (PFNGLUNIFORM2FVPROC) __GLeeGetProcAddress("glUniform2fv"))!=0) nLinked++; - if ((pglUniform3fv = (PFNGLUNIFORM3FVPROC) __GLeeGetProcAddress("glUniform3fv"))!=0) nLinked++; - if ((pglUniform4fv = (PFNGLUNIFORM4FVPROC) __GLeeGetProcAddress("glUniform4fv"))!=0) nLinked++; - if ((pglUniform1iv = (PFNGLUNIFORM1IVPROC) __GLeeGetProcAddress("glUniform1iv"))!=0) nLinked++; - if ((pglUniform2iv = (PFNGLUNIFORM2IVPROC) __GLeeGetProcAddress("glUniform2iv"))!=0) nLinked++; - if ((pglUniform3iv = (PFNGLUNIFORM3IVPROC) __GLeeGetProcAddress("glUniform3iv"))!=0) nLinked++; - if ((pglUniform4iv = (PFNGLUNIFORM4IVPROC) __GLeeGetProcAddress("glUniform4iv"))!=0) nLinked++; - if ((pglUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) __GLeeGetProcAddress("glUniformMatrix2fv"))!=0) nLinked++; - if ((pglUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) __GLeeGetProcAddress("glUniformMatrix3fv"))!=0) nLinked++; - if ((pglUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) __GLeeGetProcAddress("glUniformMatrix4fv"))!=0) nLinked++; - if ((pglValidateProgram = (PFNGLVALIDATEPROGRAMPROC) __GLeeGetProcAddress("glValidateProgram"))!=0) nLinked++; - if ((pglVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC) __GLeeGetProcAddress("glVertexAttrib1d"))!=0) nLinked++; - if ((pglVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC) __GLeeGetProcAddress("glVertexAttrib1dv"))!=0) nLinked++; - if ((pglVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) __GLeeGetProcAddress("glVertexAttrib1f"))!=0) nLinked++; - if ((pglVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) __GLeeGetProcAddress("glVertexAttrib1fv"))!=0) nLinked++; - if ((pglVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC) __GLeeGetProcAddress("glVertexAttrib1s"))!=0) nLinked++; - if ((pglVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC) __GLeeGetProcAddress("glVertexAttrib1sv"))!=0) nLinked++; - if ((pglVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC) __GLeeGetProcAddress("glVertexAttrib2d"))!=0) nLinked++; - if ((pglVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC) __GLeeGetProcAddress("glVertexAttrib2dv"))!=0) nLinked++; - if ((pglVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) __GLeeGetProcAddress("glVertexAttrib2f"))!=0) nLinked++; - if ((pglVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) __GLeeGetProcAddress("glVertexAttrib2fv"))!=0) nLinked++; - if ((pglVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC) __GLeeGetProcAddress("glVertexAttrib2s"))!=0) nLinked++; - if ((pglVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC) __GLeeGetProcAddress("glVertexAttrib2sv"))!=0) nLinked++; - if ((pglVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC) __GLeeGetProcAddress("glVertexAttrib3d"))!=0) nLinked++; - if ((pglVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC) __GLeeGetProcAddress("glVertexAttrib3dv"))!=0) nLinked++; - if ((pglVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) __GLeeGetProcAddress("glVertexAttrib3f"))!=0) nLinked++; - if ((pglVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) __GLeeGetProcAddress("glVertexAttrib3fv"))!=0) nLinked++; - if ((pglVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC) __GLeeGetProcAddress("glVertexAttrib3s"))!=0) nLinked++; - if ((pglVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC) __GLeeGetProcAddress("glVertexAttrib3sv"))!=0) nLinked++; - if ((pglVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC) __GLeeGetProcAddress("glVertexAttrib4Nbv"))!=0) nLinked++; - if ((pglVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC) __GLeeGetProcAddress("glVertexAttrib4Niv"))!=0) nLinked++; - if ((pglVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC) __GLeeGetProcAddress("glVertexAttrib4Nsv"))!=0) nLinked++; - if ((pglVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC) __GLeeGetProcAddress("glVertexAttrib4Nub"))!=0) nLinked++; - if ((pglVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC) __GLeeGetProcAddress("glVertexAttrib4Nubv"))!=0) nLinked++; - if ((pglVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC) __GLeeGetProcAddress("glVertexAttrib4Nuiv"))!=0) nLinked++; - if ((pglVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC) __GLeeGetProcAddress("glVertexAttrib4Nusv"))!=0) nLinked++; - if ((pglVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC) __GLeeGetProcAddress("glVertexAttrib4bv"))!=0) nLinked++; - if ((pglVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC) __GLeeGetProcAddress("glVertexAttrib4d"))!=0) nLinked++; - if ((pglVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC) __GLeeGetProcAddress("glVertexAttrib4dv"))!=0) nLinked++; - if ((pglVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) __GLeeGetProcAddress("glVertexAttrib4f"))!=0) nLinked++; - if ((pglVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) __GLeeGetProcAddress("glVertexAttrib4fv"))!=0) nLinked++; - if ((pglVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC) __GLeeGetProcAddress("glVertexAttrib4iv"))!=0) nLinked++; - if ((pglVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC) __GLeeGetProcAddress("glVertexAttrib4s"))!=0) nLinked++; - if ((pglVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC) __GLeeGetProcAddress("glVertexAttrib4sv"))!=0) nLinked++; - if ((pglVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC) __GLeeGetProcAddress("glVertexAttrib4ubv"))!=0) nLinked++; - if ((pglVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC) __GLeeGetProcAddress("glVertexAttrib4uiv"))!=0) nLinked++; - if ((pglVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC) __GLeeGetProcAddress("glVertexAttrib4usv"))!=0) nLinked++; - if ((pglVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) __GLeeGetProcAddress("glVertexAttribPointer"))!=0) nLinked++; -#endif - if (nLinked==93) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_VERSION_2_1(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_VERSION_2_1 - if ((pglUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) __GLeeGetProcAddress("glUniformMatrix2x3fv"))!=0) nLinked++; - if ((pglUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) __GLeeGetProcAddress("glUniformMatrix3x2fv"))!=0) nLinked++; - if ((pglUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) __GLeeGetProcAddress("glUniformMatrix2x4fv"))!=0) nLinked++; - if ((pglUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) __GLeeGetProcAddress("glUniformMatrix4x2fv"))!=0) nLinked++; - if ((pglUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) __GLeeGetProcAddress("glUniformMatrix3x4fv"))!=0) nLinked++; - if ((pglUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) __GLeeGetProcAddress("glUniformMatrix4x3fv"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_VERSION_3_0(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_VERSION_3_0 - if ((pglColorMaski = (PFNGLCOLORMASKIPROC) __GLeeGetProcAddress("glColorMaski"))!=0) nLinked++; - if ((pglGetBooleani_v = (PFNGLGETBOOLEANI_VPROC) __GLeeGetProcAddress("glGetBooleani_v"))!=0) nLinked++; - if ((pglGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) __GLeeGetProcAddress("glGetIntegeri_v"))!=0) nLinked++; - if ((pglEnablei = (PFNGLENABLEIPROC) __GLeeGetProcAddress("glEnablei"))!=0) nLinked++; - if ((pglDisablei = (PFNGLDISABLEIPROC) __GLeeGetProcAddress("glDisablei"))!=0) nLinked++; - if ((pglIsEnabledi = (PFNGLISENABLEDIPROC) __GLeeGetProcAddress("glIsEnabledi"))!=0) nLinked++; - if ((pglBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) __GLeeGetProcAddress("glBeginTransformFeedback"))!=0) nLinked++; - if ((pglEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) __GLeeGetProcAddress("glEndTransformFeedback"))!=0) nLinked++; - if ((pglBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) __GLeeGetProcAddress("glBindBufferRange"))!=0) nLinked++; - if ((pglBindBufferBase = (PFNGLBINDBUFFERBASEPROC) __GLeeGetProcAddress("glBindBufferBase"))!=0) nLinked++; - if ((pglTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) __GLeeGetProcAddress("glTransformFeedbackVaryings"))!=0) nLinked++; - if ((pglGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) __GLeeGetProcAddress("glGetTransformFeedbackVarying"))!=0) nLinked++; - if ((pglClampColor = (PFNGLCLAMPCOLORPROC) __GLeeGetProcAddress("glClampColor"))!=0) nLinked++; - if ((pglBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC) __GLeeGetProcAddress("glBeginConditionalRender"))!=0) nLinked++; - if ((pglEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC) __GLeeGetProcAddress("glEndConditionalRender"))!=0) nLinked++; - if ((pglVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC) __GLeeGetProcAddress("glVertexAttribI1i"))!=0) nLinked++; - if ((pglVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC) __GLeeGetProcAddress("glVertexAttribI2i"))!=0) nLinked++; - if ((pglVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC) __GLeeGetProcAddress("glVertexAttribI3i"))!=0) nLinked++; - if ((pglVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) __GLeeGetProcAddress("glVertexAttribI4i"))!=0) nLinked++; - if ((pglVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC) __GLeeGetProcAddress("glVertexAttribI1ui"))!=0) nLinked++; - if ((pglVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC) __GLeeGetProcAddress("glVertexAttribI2ui"))!=0) nLinked++; - if ((pglVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC) __GLeeGetProcAddress("glVertexAttribI3ui"))!=0) nLinked++; - if ((pglVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) __GLeeGetProcAddress("glVertexAttribI4ui"))!=0) nLinked++; - if ((pglVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC) __GLeeGetProcAddress("glVertexAttribI1iv"))!=0) nLinked++; - if ((pglVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC) __GLeeGetProcAddress("glVertexAttribI2iv"))!=0) nLinked++; - if ((pglVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC) __GLeeGetProcAddress("glVertexAttribI3iv"))!=0) nLinked++; - if ((pglVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) __GLeeGetProcAddress("glVertexAttribI4iv"))!=0) nLinked++; - if ((pglVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC) __GLeeGetProcAddress("glVertexAttribI1uiv"))!=0) nLinked++; - if ((pglVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC) __GLeeGetProcAddress("glVertexAttribI2uiv"))!=0) nLinked++; - if ((pglVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC) __GLeeGetProcAddress("glVertexAttribI3uiv"))!=0) nLinked++; - if ((pglVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) __GLeeGetProcAddress("glVertexAttribI4uiv"))!=0) nLinked++; - if ((pglVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC) __GLeeGetProcAddress("glVertexAttribI4bv"))!=0) nLinked++; - if ((pglVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC) __GLeeGetProcAddress("glVertexAttribI4sv"))!=0) nLinked++; - if ((pglVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC) __GLeeGetProcAddress("glVertexAttribI4ubv"))!=0) nLinked++; - if ((pglVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC) __GLeeGetProcAddress("glVertexAttribI4usv"))!=0) nLinked++; - if ((pglVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) __GLeeGetProcAddress("glVertexAttribIPointer"))!=0) nLinked++; - if ((pglGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) __GLeeGetProcAddress("glGetVertexAttribIiv"))!=0) nLinked++; - if ((pglGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) __GLeeGetProcAddress("glGetVertexAttribIuiv"))!=0) nLinked++; - if ((pglGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) __GLeeGetProcAddress("glGetUniformuiv"))!=0) nLinked++; - if ((pglBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC) __GLeeGetProcAddress("glBindFragDataLocation"))!=0) nLinked++; - if ((pglGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) __GLeeGetProcAddress("glGetFragDataLocation"))!=0) nLinked++; - if ((pglUniform1ui = (PFNGLUNIFORM1UIPROC) __GLeeGetProcAddress("glUniform1ui"))!=0) nLinked++; - if ((pglUniform2ui = (PFNGLUNIFORM2UIPROC) __GLeeGetProcAddress("glUniform2ui"))!=0) nLinked++; - if ((pglUniform3ui = (PFNGLUNIFORM3UIPROC) __GLeeGetProcAddress("glUniform3ui"))!=0) nLinked++; - if ((pglUniform4ui = (PFNGLUNIFORM4UIPROC) __GLeeGetProcAddress("glUniform4ui"))!=0) nLinked++; - if ((pglUniform1uiv = (PFNGLUNIFORM1UIVPROC) __GLeeGetProcAddress("glUniform1uiv"))!=0) nLinked++; - if ((pglUniform2uiv = (PFNGLUNIFORM2UIVPROC) __GLeeGetProcAddress("glUniform2uiv"))!=0) nLinked++; - if ((pglUniform3uiv = (PFNGLUNIFORM3UIVPROC) __GLeeGetProcAddress("glUniform3uiv"))!=0) nLinked++; - if ((pglUniform4uiv = (PFNGLUNIFORM4UIVPROC) __GLeeGetProcAddress("glUniform4uiv"))!=0) nLinked++; - if ((pglTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC) __GLeeGetProcAddress("glTexParameterIiv"))!=0) nLinked++; - if ((pglTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC) __GLeeGetProcAddress("glTexParameterIuiv"))!=0) nLinked++; - if ((pglGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC) __GLeeGetProcAddress("glGetTexParameterIiv"))!=0) nLinked++; - if ((pglGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC) __GLeeGetProcAddress("glGetTexParameterIuiv"))!=0) nLinked++; - if ((pglClearBufferiv = (PFNGLCLEARBUFFERIVPROC) __GLeeGetProcAddress("glClearBufferiv"))!=0) nLinked++; - if ((pglClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) __GLeeGetProcAddress("glClearBufferuiv"))!=0) nLinked++; - if ((pglClearBufferfv = (PFNGLCLEARBUFFERFVPROC) __GLeeGetProcAddress("glClearBufferfv"))!=0) nLinked++; - if ((pglClearBufferfi = (PFNGLCLEARBUFFERFIPROC) __GLeeGetProcAddress("glClearBufferfi"))!=0) nLinked++; - if ((pglGetStringi = (PFNGLGETSTRINGIPROC) __GLeeGetProcAddress("glGetStringi"))!=0) nLinked++; -#endif - if (nLinked==58) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_multitexture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_multitexture - if ((pglActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) __GLeeGetProcAddress("glActiveTextureARB"))!=0) nLinked++; - if ((pglClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) __GLeeGetProcAddress("glClientActiveTextureARB"))!=0) nLinked++; - if ((pglMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC) __GLeeGetProcAddress("glMultiTexCoord1dARB"))!=0) nLinked++; - if ((pglMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC) __GLeeGetProcAddress("glMultiTexCoord1dvARB"))!=0) nLinked++; - if ((pglMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC) __GLeeGetProcAddress("glMultiTexCoord1fARB"))!=0) nLinked++; - if ((pglMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC) __GLeeGetProcAddress("glMultiTexCoord1fvARB"))!=0) nLinked++; - if ((pglMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC) __GLeeGetProcAddress("glMultiTexCoord1iARB"))!=0) nLinked++; - if ((pglMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC) __GLeeGetProcAddress("glMultiTexCoord1ivARB"))!=0) nLinked++; - if ((pglMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC) __GLeeGetProcAddress("glMultiTexCoord1sARB"))!=0) nLinked++; - if ((pglMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC) __GLeeGetProcAddress("glMultiTexCoord1svARB"))!=0) nLinked++; - if ((pglMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC) __GLeeGetProcAddress("glMultiTexCoord2dARB"))!=0) nLinked++; - if ((pglMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC) __GLeeGetProcAddress("glMultiTexCoord2dvARB"))!=0) nLinked++; - if ((pglMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) __GLeeGetProcAddress("glMultiTexCoord2fARB"))!=0) nLinked++; - if ((pglMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC) __GLeeGetProcAddress("glMultiTexCoord2fvARB"))!=0) nLinked++; - if ((pglMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC) __GLeeGetProcAddress("glMultiTexCoord2iARB"))!=0) nLinked++; - if ((pglMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC) __GLeeGetProcAddress("glMultiTexCoord2ivARB"))!=0) nLinked++; - if ((pglMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC) __GLeeGetProcAddress("glMultiTexCoord2sARB"))!=0) nLinked++; - if ((pglMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC) __GLeeGetProcAddress("glMultiTexCoord2svARB"))!=0) nLinked++; - if ((pglMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC) __GLeeGetProcAddress("glMultiTexCoord3dARB"))!=0) nLinked++; - if ((pglMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC) __GLeeGetProcAddress("glMultiTexCoord3dvARB"))!=0) nLinked++; - if ((pglMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC) __GLeeGetProcAddress("glMultiTexCoord3fARB"))!=0) nLinked++; - if ((pglMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC) __GLeeGetProcAddress("glMultiTexCoord3fvARB"))!=0) nLinked++; - if ((pglMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC) __GLeeGetProcAddress("glMultiTexCoord3iARB"))!=0) nLinked++; - if ((pglMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC) __GLeeGetProcAddress("glMultiTexCoord3ivARB"))!=0) nLinked++; - if ((pglMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC) __GLeeGetProcAddress("glMultiTexCoord3sARB"))!=0) nLinked++; - if ((pglMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC) __GLeeGetProcAddress("glMultiTexCoord3svARB"))!=0) nLinked++; - if ((pglMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC) __GLeeGetProcAddress("glMultiTexCoord4dARB"))!=0) nLinked++; - if ((pglMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC) __GLeeGetProcAddress("glMultiTexCoord4dvARB"))!=0) nLinked++; - if ((pglMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC) __GLeeGetProcAddress("glMultiTexCoord4fARB"))!=0) nLinked++; - if ((pglMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC) __GLeeGetProcAddress("glMultiTexCoord4fvARB"))!=0) nLinked++; - if ((pglMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC) __GLeeGetProcAddress("glMultiTexCoord4iARB"))!=0) nLinked++; - if ((pglMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC) __GLeeGetProcAddress("glMultiTexCoord4ivARB"))!=0) nLinked++; - if ((pglMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC) __GLeeGetProcAddress("glMultiTexCoord4sARB"))!=0) nLinked++; - if ((pglMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC) __GLeeGetProcAddress("glMultiTexCoord4svARB"))!=0) nLinked++; -#endif - if (nLinked==34) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_transpose_matrix(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_transpose_matrix - if ((pglLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC) __GLeeGetProcAddress("glLoadTransposeMatrixfARB"))!=0) nLinked++; - if ((pglLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC) __GLeeGetProcAddress("glLoadTransposeMatrixdARB"))!=0) nLinked++; - if ((pglMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC) __GLeeGetProcAddress("glMultTransposeMatrixfARB"))!=0) nLinked++; - if ((pglMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC) __GLeeGetProcAddress("glMultTransposeMatrixdARB"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_multisample(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_multisample - if ((pglSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC) __GLeeGetProcAddress("glSampleCoverageARB"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_texture_env_add(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_texture_cube_map(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_texture_compression(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_texture_compression - if ((pglCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) __GLeeGetProcAddress("glCompressedTexImage3DARB"))!=0) nLinked++; - if ((pglCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) __GLeeGetProcAddress("glCompressedTexImage2DARB"))!=0) nLinked++; - if ((pglCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) __GLeeGetProcAddress("glCompressedTexImage1DARB"))!=0) nLinked++; - if ((pglCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) __GLeeGetProcAddress("glCompressedTexSubImage3DARB"))!=0) nLinked++; - if ((pglCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) __GLeeGetProcAddress("glCompressedTexSubImage2DARB"))!=0) nLinked++; - if ((pglCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) __GLeeGetProcAddress("glCompressedTexSubImage1DARB"))!=0) nLinked++; - if ((pglGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) __GLeeGetProcAddress("glGetCompressedTexImageARB"))!=0) nLinked++; -#endif - if (nLinked==7) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_texture_border_clamp(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_point_parameters(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_point_parameters - if ((pglPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC) __GLeeGetProcAddress("glPointParameterfARB"))!=0) nLinked++; - if ((pglPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC) __GLeeGetProcAddress("glPointParameterfvARB"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_vertex_blend(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_vertex_blend - if ((pglWeightbvARB = (PFNGLWEIGHTBVARBPROC) __GLeeGetProcAddress("glWeightbvARB"))!=0) nLinked++; - if ((pglWeightsvARB = (PFNGLWEIGHTSVARBPROC) __GLeeGetProcAddress("glWeightsvARB"))!=0) nLinked++; - if ((pglWeightivARB = (PFNGLWEIGHTIVARBPROC) __GLeeGetProcAddress("glWeightivARB"))!=0) nLinked++; - if ((pglWeightfvARB = (PFNGLWEIGHTFVARBPROC) __GLeeGetProcAddress("glWeightfvARB"))!=0) nLinked++; - if ((pglWeightdvARB = (PFNGLWEIGHTDVARBPROC) __GLeeGetProcAddress("glWeightdvARB"))!=0) nLinked++; - if ((pglWeightubvARB = (PFNGLWEIGHTUBVARBPROC) __GLeeGetProcAddress("glWeightubvARB"))!=0) nLinked++; - if ((pglWeightusvARB = (PFNGLWEIGHTUSVARBPROC) __GLeeGetProcAddress("glWeightusvARB"))!=0) nLinked++; - if ((pglWeightuivARB = (PFNGLWEIGHTUIVARBPROC) __GLeeGetProcAddress("glWeightuivARB"))!=0) nLinked++; - if ((pglWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC) __GLeeGetProcAddress("glWeightPointerARB"))!=0) nLinked++; - if ((pglVertexBlendARB = (PFNGLVERTEXBLENDARBPROC) __GLeeGetProcAddress("glVertexBlendARB"))!=0) nLinked++; -#endif - if (nLinked==10) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_matrix_palette(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_matrix_palette - if ((pglCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC) __GLeeGetProcAddress("glCurrentPaletteMatrixARB"))!=0) nLinked++; - if ((pglMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC) __GLeeGetProcAddress("glMatrixIndexubvARB"))!=0) nLinked++; - if ((pglMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC) __GLeeGetProcAddress("glMatrixIndexusvARB"))!=0) nLinked++; - if ((pglMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC) __GLeeGetProcAddress("glMatrixIndexuivARB"))!=0) nLinked++; - if ((pglMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC) __GLeeGetProcAddress("glMatrixIndexPointerARB"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_texture_env_combine(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_texture_env_crossbar(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_texture_env_dot3(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_texture_mirrored_repeat(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_depth_texture(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_shadow(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_shadow_ambient(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_window_pos(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_window_pos - if ((pglWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC) __GLeeGetProcAddress("glWindowPos2dARB"))!=0) nLinked++; - if ((pglWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC) __GLeeGetProcAddress("glWindowPos2dvARB"))!=0) nLinked++; - if ((pglWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC) __GLeeGetProcAddress("glWindowPos2fARB"))!=0) nLinked++; - if ((pglWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC) __GLeeGetProcAddress("glWindowPos2fvARB"))!=0) nLinked++; - if ((pglWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC) __GLeeGetProcAddress("glWindowPos2iARB"))!=0) nLinked++; - if ((pglWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC) __GLeeGetProcAddress("glWindowPos2ivARB"))!=0) nLinked++; - if ((pglWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC) __GLeeGetProcAddress("glWindowPos2sARB"))!=0) nLinked++; - if ((pglWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC) __GLeeGetProcAddress("glWindowPos2svARB"))!=0) nLinked++; - if ((pglWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC) __GLeeGetProcAddress("glWindowPos3dARB"))!=0) nLinked++; - if ((pglWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC) __GLeeGetProcAddress("glWindowPos3dvARB"))!=0) nLinked++; - if ((pglWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC) __GLeeGetProcAddress("glWindowPos3fARB"))!=0) nLinked++; - if ((pglWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC) __GLeeGetProcAddress("glWindowPos3fvARB"))!=0) nLinked++; - if ((pglWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC) __GLeeGetProcAddress("glWindowPos3iARB"))!=0) nLinked++; - if ((pglWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC) __GLeeGetProcAddress("glWindowPos3ivARB"))!=0) nLinked++; - if ((pglWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC) __GLeeGetProcAddress("glWindowPos3sARB"))!=0) nLinked++; - if ((pglWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC) __GLeeGetProcAddress("glWindowPos3svARB"))!=0) nLinked++; -#endif - if (nLinked==16) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_vertex_program(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_vertex_program - if ((pglVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC) __GLeeGetProcAddress("glVertexAttrib1dARB"))!=0) nLinked++; - if ((pglVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC) __GLeeGetProcAddress("glVertexAttrib1dvARB"))!=0) nLinked++; - if ((pglVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC) __GLeeGetProcAddress("glVertexAttrib1fARB"))!=0) nLinked++; - if ((pglVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC) __GLeeGetProcAddress("glVertexAttrib1fvARB"))!=0) nLinked++; - if ((pglVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC) __GLeeGetProcAddress("glVertexAttrib1sARB"))!=0) nLinked++; - if ((pglVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC) __GLeeGetProcAddress("glVertexAttrib1svARB"))!=0) nLinked++; - if ((pglVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC) __GLeeGetProcAddress("glVertexAttrib2dARB"))!=0) nLinked++; - if ((pglVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC) __GLeeGetProcAddress("glVertexAttrib2dvARB"))!=0) nLinked++; - if ((pglVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC) __GLeeGetProcAddress("glVertexAttrib2fARB"))!=0) nLinked++; - if ((pglVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC) __GLeeGetProcAddress("glVertexAttrib2fvARB"))!=0) nLinked++; - if ((pglVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC) __GLeeGetProcAddress("glVertexAttrib2sARB"))!=0) nLinked++; - if ((pglVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC) __GLeeGetProcAddress("glVertexAttrib2svARB"))!=0) nLinked++; - if ((pglVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC) __GLeeGetProcAddress("glVertexAttrib3dARB"))!=0) nLinked++; - if ((pglVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC) __GLeeGetProcAddress("glVertexAttrib3dvARB"))!=0) nLinked++; - if ((pglVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC) __GLeeGetProcAddress("glVertexAttrib3fARB"))!=0) nLinked++; - if ((pglVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC) __GLeeGetProcAddress("glVertexAttrib3fvARB"))!=0) nLinked++; - if ((pglVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC) __GLeeGetProcAddress("glVertexAttrib3sARB"))!=0) nLinked++; - if ((pglVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC) __GLeeGetProcAddress("glVertexAttrib3svARB"))!=0) nLinked++; - if ((pglVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NbvARB"))!=0) nLinked++; - if ((pglVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NivARB"))!=0) nLinked++; - if ((pglVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NsvARB"))!=0) nLinked++; - if ((pglVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC) __GLeeGetProcAddress("glVertexAttrib4NubARB"))!=0) nLinked++; - if ((pglVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NubvARB"))!=0) nLinked++; - if ((pglVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NuivARB"))!=0) nLinked++; - if ((pglVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NusvARB"))!=0) nLinked++; - if ((pglVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC) __GLeeGetProcAddress("glVertexAttrib4bvARB"))!=0) nLinked++; - if ((pglVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC) __GLeeGetProcAddress("glVertexAttrib4dARB"))!=0) nLinked++; - if ((pglVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC) __GLeeGetProcAddress("glVertexAttrib4dvARB"))!=0) nLinked++; - if ((pglVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC) __GLeeGetProcAddress("glVertexAttrib4fARB"))!=0) nLinked++; - if ((pglVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC) __GLeeGetProcAddress("glVertexAttrib4fvARB"))!=0) nLinked++; - if ((pglVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC) __GLeeGetProcAddress("glVertexAttrib4ivARB"))!=0) nLinked++; - if ((pglVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC) __GLeeGetProcAddress("glVertexAttrib4sARB"))!=0) nLinked++; - if ((pglVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC) __GLeeGetProcAddress("glVertexAttrib4svARB"))!=0) nLinked++; - if ((pglVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC) __GLeeGetProcAddress("glVertexAttrib4ubvARB"))!=0) nLinked++; - if ((pglVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC) __GLeeGetProcAddress("glVertexAttrib4uivARB"))!=0) nLinked++; - if ((pglVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC) __GLeeGetProcAddress("glVertexAttrib4usvARB"))!=0) nLinked++; - if ((pglVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC) __GLeeGetProcAddress("glVertexAttribPointerARB"))!=0) nLinked++; - if ((pglEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC) __GLeeGetProcAddress("glEnableVertexAttribArrayARB"))!=0) nLinked++; - if ((pglDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) __GLeeGetProcAddress("glDisableVertexAttribArrayARB"))!=0) nLinked++; - if ((pglProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) __GLeeGetProcAddress("glProgramStringARB"))!=0) nLinked++; - if ((pglBindProgramARB = (PFNGLBINDPROGRAMARBPROC) __GLeeGetProcAddress("glBindProgramARB"))!=0) nLinked++; - if ((pglDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC) __GLeeGetProcAddress("glDeleteProgramsARB"))!=0) nLinked++; - if ((pglGenProgramsARB = (PFNGLGENPROGRAMSARBPROC) __GLeeGetProcAddress("glGenProgramsARB"))!=0) nLinked++; - if ((pglProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC) __GLeeGetProcAddress("glProgramEnvParameter4dARB"))!=0) nLinked++; - if ((pglProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC) __GLeeGetProcAddress("glProgramEnvParameter4dvARB"))!=0) nLinked++; - if ((pglProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC) __GLeeGetProcAddress("glProgramEnvParameter4fARB"))!=0) nLinked++; - if ((pglProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC) __GLeeGetProcAddress("glProgramEnvParameter4fvARB"))!=0) nLinked++; - if ((pglProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC) __GLeeGetProcAddress("glProgramLocalParameter4dARB"))!=0) nLinked++; - if ((pglProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) __GLeeGetProcAddress("glProgramLocalParameter4dvARB"))!=0) nLinked++; - if ((pglProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC) __GLeeGetProcAddress("glProgramLocalParameter4fARB"))!=0) nLinked++; - if ((pglProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) __GLeeGetProcAddress("glProgramLocalParameter4fvARB"))!=0) nLinked++; - if ((pglGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC) __GLeeGetProcAddress("glGetProgramEnvParameterdvARB"))!=0) nLinked++; - if ((pglGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC) __GLeeGetProcAddress("glGetProgramEnvParameterfvARB"))!=0) nLinked++; - if ((pglGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) __GLeeGetProcAddress("glGetProgramLocalParameterdvARB"))!=0) nLinked++; - if ((pglGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) __GLeeGetProcAddress("glGetProgramLocalParameterfvARB"))!=0) nLinked++; - if ((pglGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC) __GLeeGetProcAddress("glGetProgramivARB"))!=0) nLinked++; - if ((pglGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC) __GLeeGetProcAddress("glGetProgramStringARB"))!=0) nLinked++; - if ((pglGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC) __GLeeGetProcAddress("glGetVertexAttribdvARB"))!=0) nLinked++; - if ((pglGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) __GLeeGetProcAddress("glGetVertexAttribfvARB"))!=0) nLinked++; - if ((pglGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC) __GLeeGetProcAddress("glGetVertexAttribivARB"))!=0) nLinked++; - if ((pglGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC) __GLeeGetProcAddress("glGetVertexAttribPointervARB"))!=0) nLinked++; - if ((pglIsProgramARB = (PFNGLISPROGRAMARBPROC) __GLeeGetProcAddress("glIsProgramARB"))!=0) nLinked++; -#endif - if (nLinked==62) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_fragment_program(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_vertex_buffer_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_vertex_buffer_object - if ((pglBindBufferARB = (PFNGLBINDBUFFERARBPROC) __GLeeGetProcAddress("glBindBufferARB"))!=0) nLinked++; - if ((pglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC) __GLeeGetProcAddress("glDeleteBuffersARB"))!=0) nLinked++; - if ((pglGenBuffersARB = (PFNGLGENBUFFERSARBPROC) __GLeeGetProcAddress("glGenBuffersARB"))!=0) nLinked++; - if ((pglIsBufferARB = (PFNGLISBUFFERARBPROC) __GLeeGetProcAddress("glIsBufferARB"))!=0) nLinked++; - if ((pglBufferDataARB = (PFNGLBUFFERDATAARBPROC) __GLeeGetProcAddress("glBufferDataARB"))!=0) nLinked++; - if ((pglBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC) __GLeeGetProcAddress("glBufferSubDataARB"))!=0) nLinked++; - if ((pglGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC) __GLeeGetProcAddress("glGetBufferSubDataARB"))!=0) nLinked++; - if ((pglMapBufferARB = (PFNGLMAPBUFFERARBPROC) __GLeeGetProcAddress("glMapBufferARB"))!=0) nLinked++; - if ((pglUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC) __GLeeGetProcAddress("glUnmapBufferARB"))!=0) nLinked++; - if ((pglGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC) __GLeeGetProcAddress("glGetBufferParameterivARB"))!=0) nLinked++; - if ((pglGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC) __GLeeGetProcAddress("glGetBufferPointervARB"))!=0) nLinked++; -#endif - if (nLinked==11) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_occlusion_query(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_occlusion_query - if ((pglGenQueriesARB = (PFNGLGENQUERIESARBPROC) __GLeeGetProcAddress("glGenQueriesARB"))!=0) nLinked++; - if ((pglDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC) __GLeeGetProcAddress("glDeleteQueriesARB"))!=0) nLinked++; - if ((pglIsQueryARB = (PFNGLISQUERYARBPROC) __GLeeGetProcAddress("glIsQueryARB"))!=0) nLinked++; - if ((pglBeginQueryARB = (PFNGLBEGINQUERYARBPROC) __GLeeGetProcAddress("glBeginQueryARB"))!=0) nLinked++; - if ((pglEndQueryARB = (PFNGLENDQUERYARBPROC) __GLeeGetProcAddress("glEndQueryARB"))!=0) nLinked++; - if ((pglGetQueryivARB = (PFNGLGETQUERYIVARBPROC) __GLeeGetProcAddress("glGetQueryivARB"))!=0) nLinked++; - if ((pglGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC) __GLeeGetProcAddress("glGetQueryObjectivARB"))!=0) nLinked++; - if ((pglGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC) __GLeeGetProcAddress("glGetQueryObjectuivARB"))!=0) nLinked++; -#endif - if (nLinked==8) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_shader_objects(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_shader_objects - if ((pglDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) __GLeeGetProcAddress("glDeleteObjectARB"))!=0) nLinked++; - if ((pglGetHandleARB = (PFNGLGETHANDLEARBPROC) __GLeeGetProcAddress("glGetHandleARB"))!=0) nLinked++; - if ((pglDetachObjectARB = (PFNGLDETACHOBJECTARBPROC) __GLeeGetProcAddress("glDetachObjectARB"))!=0) nLinked++; - if ((pglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) __GLeeGetProcAddress("glCreateShaderObjectARB"))!=0) nLinked++; - if ((pglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) __GLeeGetProcAddress("glShaderSourceARB"))!=0) nLinked++; - if ((pglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) __GLeeGetProcAddress("glCompileShaderARB"))!=0) nLinked++; - if ((pglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) __GLeeGetProcAddress("glCreateProgramObjectARB"))!=0) nLinked++; - if ((pglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) __GLeeGetProcAddress("glAttachObjectARB"))!=0) nLinked++; - if ((pglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) __GLeeGetProcAddress("glLinkProgramARB"))!=0) nLinked++; - if ((pglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) __GLeeGetProcAddress("glUseProgramObjectARB"))!=0) nLinked++; - if ((pglValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC) __GLeeGetProcAddress("glValidateProgramARB"))!=0) nLinked++; - if ((pglUniform1fARB = (PFNGLUNIFORM1FARBPROC) __GLeeGetProcAddress("glUniform1fARB"))!=0) nLinked++; - if ((pglUniform2fARB = (PFNGLUNIFORM2FARBPROC) __GLeeGetProcAddress("glUniform2fARB"))!=0) nLinked++; - if ((pglUniform3fARB = (PFNGLUNIFORM3FARBPROC) __GLeeGetProcAddress("glUniform3fARB"))!=0) nLinked++; - if ((pglUniform4fARB = (PFNGLUNIFORM4FARBPROC) __GLeeGetProcAddress("glUniform4fARB"))!=0) nLinked++; - if ((pglUniform1iARB = (PFNGLUNIFORM1IARBPROC) __GLeeGetProcAddress("glUniform1iARB"))!=0) nLinked++; - if ((pglUniform2iARB = (PFNGLUNIFORM2IARBPROC) __GLeeGetProcAddress("glUniform2iARB"))!=0) nLinked++; - if ((pglUniform3iARB = (PFNGLUNIFORM3IARBPROC) __GLeeGetProcAddress("glUniform3iARB"))!=0) nLinked++; - if ((pglUniform4iARB = (PFNGLUNIFORM4IARBPROC) __GLeeGetProcAddress("glUniform4iARB"))!=0) nLinked++; - if ((pglUniform1fvARB = (PFNGLUNIFORM1FVARBPROC) __GLeeGetProcAddress("glUniform1fvARB"))!=0) nLinked++; - if ((pglUniform2fvARB = (PFNGLUNIFORM2FVARBPROC) __GLeeGetProcAddress("glUniform2fvARB"))!=0) nLinked++; - if ((pglUniform3fvARB = (PFNGLUNIFORM3FVARBPROC) __GLeeGetProcAddress("glUniform3fvARB"))!=0) nLinked++; - if ((pglUniform4fvARB = (PFNGLUNIFORM4FVARBPROC) __GLeeGetProcAddress("glUniform4fvARB"))!=0) nLinked++; - if ((pglUniform1ivARB = (PFNGLUNIFORM1IVARBPROC) __GLeeGetProcAddress("glUniform1ivARB"))!=0) nLinked++; - if ((pglUniform2ivARB = (PFNGLUNIFORM2IVARBPROC) __GLeeGetProcAddress("glUniform2ivARB"))!=0) nLinked++; - if ((pglUniform3ivARB = (PFNGLUNIFORM3IVARBPROC) __GLeeGetProcAddress("glUniform3ivARB"))!=0) nLinked++; - if ((pglUniform4ivARB = (PFNGLUNIFORM4IVARBPROC) __GLeeGetProcAddress("glUniform4ivARB"))!=0) nLinked++; - if ((pglUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC) __GLeeGetProcAddress("glUniformMatrix2fvARB"))!=0) nLinked++; - if ((pglUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC) __GLeeGetProcAddress("glUniformMatrix3fvARB"))!=0) nLinked++; - if ((pglUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC) __GLeeGetProcAddress("glUniformMatrix4fvARB"))!=0) nLinked++; - if ((pglGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC) __GLeeGetProcAddress("glGetObjectParameterfvARB"))!=0) nLinked++; - if ((pglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) __GLeeGetProcAddress("glGetObjectParameterivARB"))!=0) nLinked++; - if ((pglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) __GLeeGetProcAddress("glGetInfoLogARB"))!=0) nLinked++; - if ((pglGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC) __GLeeGetProcAddress("glGetAttachedObjectsARB"))!=0) nLinked++; - if ((pglGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) __GLeeGetProcAddress("glGetUniformLocationARB"))!=0) nLinked++; - if ((pglGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC) __GLeeGetProcAddress("glGetActiveUniformARB"))!=0) nLinked++; - if ((pglGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC) __GLeeGetProcAddress("glGetUniformfvARB"))!=0) nLinked++; - if ((pglGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC) __GLeeGetProcAddress("glGetUniformivARB"))!=0) nLinked++; - if ((pglGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC) __GLeeGetProcAddress("glGetShaderSourceARB"))!=0) nLinked++; -#endif - if (nLinked==39) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_vertex_shader(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_vertex_shader - if ((pglBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC) __GLeeGetProcAddress("glBindAttribLocationARB"))!=0) nLinked++; - if ((pglGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC) __GLeeGetProcAddress("glGetActiveAttribARB"))!=0) nLinked++; - if ((pglGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC) __GLeeGetProcAddress("glGetAttribLocationARB"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_fragment_shader(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_shading_language_100(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_texture_non_power_of_two(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_point_sprite(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_fragment_program_shadow(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_draw_buffers(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_draw_buffers - if ((pglDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC) __GLeeGetProcAddress("glDrawBuffersARB"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_texture_rectangle(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_color_buffer_float(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_color_buffer_float - if ((pglClampColorARB = (PFNGLCLAMPCOLORARBPROC) __GLeeGetProcAddress("glClampColorARB"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_half_float_pixel(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_texture_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_pixel_buffer_object(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_depth_buffer_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_drawinstanced(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_drawinstanced - if ((pglDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC) __GLeeGetProcAddress("glDrawArraysInstancedARB"))!=0) nLinked++; - if ((pglDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC) __GLeeGetProcAddress("glDrawElementsInstancedARB"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_framebuffer_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_framebuffer_object - if ((pglIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) __GLeeGetProcAddress("glIsRenderbuffer"))!=0) nLinked++; - if ((pglBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) __GLeeGetProcAddress("glBindRenderbuffer"))!=0) nLinked++; - if ((pglDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) __GLeeGetProcAddress("glDeleteRenderbuffers"))!=0) nLinked++; - if ((pglGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) __GLeeGetProcAddress("glGenRenderbuffers"))!=0) nLinked++; - if ((pglRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) __GLeeGetProcAddress("glRenderbufferStorage"))!=0) nLinked++; - if ((pglGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) __GLeeGetProcAddress("glGetRenderbufferParameteriv"))!=0) nLinked++; - if ((pglIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) __GLeeGetProcAddress("glIsFramebuffer"))!=0) nLinked++; - if ((pglBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) __GLeeGetProcAddress("glBindFramebuffer"))!=0) nLinked++; - if ((pglDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) __GLeeGetProcAddress("glDeleteFramebuffers"))!=0) nLinked++; - if ((pglGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) __GLeeGetProcAddress("glGenFramebuffers"))!=0) nLinked++; - if ((pglCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) __GLeeGetProcAddress("glCheckFramebufferStatus"))!=0) nLinked++; - if ((pglFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) __GLeeGetProcAddress("glFramebufferTexture1D"))!=0) nLinked++; - if ((pglFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) __GLeeGetProcAddress("glFramebufferTexture2D"))!=0) nLinked++; - if ((pglFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) __GLeeGetProcAddress("glFramebufferTexture3D"))!=0) nLinked++; - if ((pglFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) __GLeeGetProcAddress("glFramebufferRenderbuffer"))!=0) nLinked++; - if ((pglGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) __GLeeGetProcAddress("glGetFramebufferAttachmentParameteriv"))!=0) nLinked++; - if ((pglGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) __GLeeGetProcAddress("glGenerateMipmap"))!=0) nLinked++; - if ((pglBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) __GLeeGetProcAddress("glBlitFramebuffer"))!=0) nLinked++; - if ((pglRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) __GLeeGetProcAddress("glRenderbufferStorageMultisample"))!=0) nLinked++; - if ((pglFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) __GLeeGetProcAddress("glFramebufferTextureLayer"))!=0) nLinked++; -#endif - if (nLinked==20) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_framebuffer_sRGB(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_geometry_shader4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_geometry_shader4 - if ((pglProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC) __GLeeGetProcAddress("glProgramParameteriARB"))!=0) nLinked++; - if ((pglFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC) __GLeeGetProcAddress("glFramebufferTextureARB"))!=0) nLinked++; - if ((pglFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) __GLeeGetProcAddress("glFramebufferTextureLayerARB"))!=0) nLinked++; - if ((pglFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) __GLeeGetProcAddress("glFramebufferTextureFaceARB"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_half_float_vertex(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARBinstanced_arrays(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARBinstanced_arrays - if ((pglVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) __GLeeGetProcAddress("glVertexAttribDivisor"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_map_buffer_range(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_map_buffer_range - if ((pglMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) __GLeeGetProcAddress("glMapBufferRange"))!=0) nLinked++; - if ((pglFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) __GLeeGetProcAddress("glFlushMappedBufferRange"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_texture_buffer_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_texture_buffer_object - if ((pglTexBufferARB = (PFNGLTEXBUFFERARBPROC) __GLeeGetProcAddress("glTexBufferARB"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ARB_texture_compression_rgtc(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_texture_rg(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ARB_vertex_array_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ARB_vertex_array_object - if ((pglBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) __GLeeGetProcAddress("glBindVertexArray"))!=0) nLinked++; - if ((pglDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) __GLeeGetProcAddress("glDeleteVertexArrays"))!=0) nLinked++; - if ((pglGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) __GLeeGetProcAddress("glGenVertexArrays"))!=0) nLinked++; - if ((pglIsVertexArray = (PFNGLISVERTEXARRAYPROC) __GLeeGetProcAddress("glIsVertexArray"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_abgr(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_blend_color(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_blend_color - if ((pglBlendColorEXT = (PFNGLBLENDCOLOREXTPROC) __GLeeGetProcAddress("glBlendColorEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_polygon_offset(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_polygon_offset - if ((pglPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC) __GLeeGetProcAddress("glPolygonOffsetEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture3D(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_texture3D - if ((pglTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC) __GLeeGetProcAddress("glTexImage3DEXT"))!=0) nLinked++; - if ((pglTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glTexSubImage3DEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIS_texture_filter4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_texture_filter4 - if ((pglGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC) __GLeeGetProcAddress("glGetTexFilterFuncSGIS"))!=0) nLinked++; - if ((pglTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC) __GLeeGetProcAddress("glTexFilterFuncSGIS"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_subtexture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_subtexture - if ((pglTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glTexSubImage1DEXT"))!=0) nLinked++; - if ((pglTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glTexSubImage2DEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_copy_texture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_copy_texture - if ((pglCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyTexImage1DEXT"))!=0) nLinked++; - if ((pglCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyTexImage2DEXT"))!=0) nLinked++; - if ((pglCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyTexSubImage1DEXT"))!=0) nLinked++; - if ((pglCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyTexSubImage2DEXT"))!=0) nLinked++; - if ((pglCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCopyTexSubImage3DEXT"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_histogram(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_histogram - if ((pglGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC) __GLeeGetProcAddress("glGetHistogramEXT"))!=0) nLinked++; - if ((pglGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetHistogramParameterfvEXT"))!=0) nLinked++; - if ((pglGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetHistogramParameterivEXT"))!=0) nLinked++; - if ((pglGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC) __GLeeGetProcAddress("glGetMinmaxEXT"))!=0) nLinked++; - if ((pglGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetMinmaxParameterfvEXT"))!=0) nLinked++; - if ((pglGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetMinmaxParameterivEXT"))!=0) nLinked++; - if ((pglHistogramEXT = (PFNGLHISTOGRAMEXTPROC) __GLeeGetProcAddress("glHistogramEXT"))!=0) nLinked++; - if ((pglMinmaxEXT = (PFNGLMINMAXEXTPROC) __GLeeGetProcAddress("glMinmaxEXT"))!=0) nLinked++; - if ((pglResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC) __GLeeGetProcAddress("glResetHistogramEXT"))!=0) nLinked++; - if ((pglResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC) __GLeeGetProcAddress("glResetMinmaxEXT"))!=0) nLinked++; -#endif - if (nLinked==10) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_convolution(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_convolution - if ((pglConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC) __GLeeGetProcAddress("glConvolutionFilter1DEXT"))!=0) nLinked++; - if ((pglConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC) __GLeeGetProcAddress("glConvolutionFilter2DEXT"))!=0) nLinked++; - if ((pglConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC) __GLeeGetProcAddress("glConvolutionParameterfEXT"))!=0) nLinked++; - if ((pglConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC) __GLeeGetProcAddress("glConvolutionParameterfvEXT"))!=0) nLinked++; - if ((pglConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC) __GLeeGetProcAddress("glConvolutionParameteriEXT"))!=0) nLinked++; - if ((pglConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC) __GLeeGetProcAddress("glConvolutionParameterivEXT"))!=0) nLinked++; - if ((pglCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) __GLeeGetProcAddress("glCopyConvolutionFilter1DEXT"))!=0) nLinked++; - if ((pglCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) __GLeeGetProcAddress("glCopyConvolutionFilter2DEXT"))!=0) nLinked++; - if ((pglGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC) __GLeeGetProcAddress("glGetConvolutionFilterEXT"))!=0) nLinked++; - if ((pglGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetConvolutionParameterfvEXT"))!=0) nLinked++; - if ((pglGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetConvolutionParameterivEXT"))!=0) nLinked++; - if ((pglGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC) __GLeeGetProcAddress("glGetSeparableFilterEXT"))!=0) nLinked++; - if ((pglSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC) __GLeeGetProcAddress("glSeparableFilter2DEXT"))!=0) nLinked++; -#endif - if (nLinked==13) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGI_color_matrix(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGI_color_table(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGI_color_table - if ((pglColorTableSGI = (PFNGLCOLORTABLESGIPROC) __GLeeGetProcAddress("glColorTableSGI"))!=0) nLinked++; - if ((pglColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC) __GLeeGetProcAddress("glColorTableParameterfvSGI"))!=0) nLinked++; - if ((pglColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC) __GLeeGetProcAddress("glColorTableParameterivSGI"))!=0) nLinked++; - if ((pglCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC) __GLeeGetProcAddress("glCopyColorTableSGI"))!=0) nLinked++; - if ((pglGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC) __GLeeGetProcAddress("glGetColorTableSGI"))!=0) nLinked++; - if ((pglGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) __GLeeGetProcAddress("glGetColorTableParameterfvSGI"))!=0) nLinked++; - if ((pglGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) __GLeeGetProcAddress("glGetColorTableParameterivSGI"))!=0) nLinked++; -#endif - if (nLinked==7) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIS_pixel_texture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_pixel_texture - if ((pglPixelTexGenParameteriSGIS = (PFNGLPIXELTEXGENPARAMETERISGISPROC) __GLeeGetProcAddress("glPixelTexGenParameteriSGIS"))!=0) nLinked++; - if ((pglPixelTexGenParameterivSGIS = (PFNGLPIXELTEXGENPARAMETERIVSGISPROC) __GLeeGetProcAddress("glPixelTexGenParameterivSGIS"))!=0) nLinked++; - if ((pglPixelTexGenParameterfSGIS = (PFNGLPIXELTEXGENPARAMETERFSGISPROC) __GLeeGetProcAddress("glPixelTexGenParameterfSGIS"))!=0) nLinked++; - if ((pglPixelTexGenParameterfvSGIS = (PFNGLPIXELTEXGENPARAMETERFVSGISPROC) __GLeeGetProcAddress("glPixelTexGenParameterfvSGIS"))!=0) nLinked++; - if ((pglGetPixelTexGenParameterivSGIS = (PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) __GLeeGetProcAddress("glGetPixelTexGenParameterivSGIS"))!=0) nLinked++; - if ((pglGetPixelTexGenParameterfvSGIS = (PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) __GLeeGetProcAddress("glGetPixelTexGenParameterfvSGIS"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_pixel_texture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_pixel_texture - if ((pglPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC) __GLeeGetProcAddress("glPixelTexGenSGIX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIS_texture4D(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_texture4D - if ((pglTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC) __GLeeGetProcAddress("glTexImage4DSGIS"))!=0) nLinked++; - if ((pglTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC) __GLeeGetProcAddress("glTexSubImage4DSGIS"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGI_texture_color_table(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_cmyka(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_texture_object - if ((pglAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC) __GLeeGetProcAddress("glAreTexturesResidentEXT"))!=0) nLinked++; - if ((pglBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC) __GLeeGetProcAddress("glBindTextureEXT"))!=0) nLinked++; - if ((pglDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC) __GLeeGetProcAddress("glDeleteTexturesEXT"))!=0) nLinked++; - if ((pglGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC) __GLeeGetProcAddress("glGenTexturesEXT"))!=0) nLinked++; - if ((pglIsTextureEXT = (PFNGLISTEXTUREEXTPROC) __GLeeGetProcAddress("glIsTextureEXT"))!=0) nLinked++; - if ((pglPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC) __GLeeGetProcAddress("glPrioritizeTexturesEXT"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIS_detail_texture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_detail_texture - if ((pglDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC) __GLeeGetProcAddress("glDetailTexFuncSGIS"))!=0) nLinked++; - if ((pglGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC) __GLeeGetProcAddress("glGetDetailTexFuncSGIS"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIS_sharpen_texture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_sharpen_texture - if ((pglSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC) __GLeeGetProcAddress("glSharpenTexFuncSGIS"))!=0) nLinked++; - if ((pglGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC) __GLeeGetProcAddress("glGetSharpenTexFuncSGIS"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_packed_pixels(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_texture_lod(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_multisample(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_multisample - if ((pglSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC) __GLeeGetProcAddress("glSampleMaskSGIS"))!=0) nLinked++; - if ((pglSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC) __GLeeGetProcAddress("glSamplePatternSGIS"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_rescale_normal(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_vertex_array(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_vertex_array - if ((pglArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC) __GLeeGetProcAddress("glArrayElementEXT"))!=0) nLinked++; - if ((pglColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC) __GLeeGetProcAddress("glColorPointerEXT"))!=0) nLinked++; - if ((pglDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC) __GLeeGetProcAddress("glDrawArraysEXT"))!=0) nLinked++; - if ((pglEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC) __GLeeGetProcAddress("glEdgeFlagPointerEXT"))!=0) nLinked++; - if ((pglGetPointervEXT = (PFNGLGETPOINTERVEXTPROC) __GLeeGetProcAddress("glGetPointervEXT"))!=0) nLinked++; - if ((pglIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC) __GLeeGetProcAddress("glIndexPointerEXT"))!=0) nLinked++; - if ((pglNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC) __GLeeGetProcAddress("glNormalPointerEXT"))!=0) nLinked++; - if ((pglTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC) __GLeeGetProcAddress("glTexCoordPointerEXT"))!=0) nLinked++; - if ((pglVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC) __GLeeGetProcAddress("glVertexPointerEXT"))!=0) nLinked++; -#endif - if (nLinked==9) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_misc_attribute(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_generate_mipmap(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_clipmap(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_shadow(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_texture_edge_clamp(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_texture_border_clamp(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_blend_minmax(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_blend_minmax - if ((pglBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC) __GLeeGetProcAddress("glBlendEquationEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_blend_subtract(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_blend_logic_op(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_interlace(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_pixel_tiles(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_texture_select(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_sprite(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_sprite - if ((pglSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC) __GLeeGetProcAddress("glSpriteParameterfSGIX"))!=0) nLinked++; - if ((pglSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC) __GLeeGetProcAddress("glSpriteParameterfvSGIX"))!=0) nLinked++; - if ((pglSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC) __GLeeGetProcAddress("glSpriteParameteriSGIX"))!=0) nLinked++; - if ((pglSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC) __GLeeGetProcAddress("glSpriteParameterivSGIX"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_texture_multi_buffer(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_point_parameters(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_point_parameters - if ((pglPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC) __GLeeGetProcAddress("glPointParameterfEXT"))!=0) nLinked++; - if ((pglPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC) __GLeeGetProcAddress("glPointParameterfvEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIS_point_parameters(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_point_parameters - if ((pglPointParameterfSGIS = (PFNGLPOINTPARAMETERFSGISPROC) __GLeeGetProcAddress("glPointParameterfSGIS"))!=0) nLinked++; - if ((pglPointParameterfvSGIS = (PFNGLPOINTPARAMETERFVSGISPROC) __GLeeGetProcAddress("glPointParameterfvSGIS"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_instruments(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_instruments - if ((pglGetInstrumentsSGIX = (PFNGLGETINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glGetInstrumentsSGIX"))!=0) nLinked++; - if ((pglInstrumentsBufferSGIX = (PFNGLINSTRUMENTSBUFFERSGIXPROC) __GLeeGetProcAddress("glInstrumentsBufferSGIX"))!=0) nLinked++; - if ((pglPollInstrumentsSGIX = (PFNGLPOLLINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glPollInstrumentsSGIX"))!=0) nLinked++; - if ((pglReadInstrumentsSGIX = (PFNGLREADINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glReadInstrumentsSGIX"))!=0) nLinked++; - if ((pglStartInstrumentsSGIX = (PFNGLSTARTINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glStartInstrumentsSGIX"))!=0) nLinked++; - if ((pglStopInstrumentsSGIX = (PFNGLSTOPINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glStopInstrumentsSGIX"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_texture_scale_bias(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_framezoom(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_framezoom - if ((pglFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC) __GLeeGetProcAddress("glFrameZoomSGIX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_tag_sample_buffer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_tag_sample_buffer - if ((pglTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC) __GLeeGetProcAddress("glTagSampleBufferSGIX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_FfdMaskSGIX(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_polynomial_ffd(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_polynomial_ffd - if ((pglDeformationMap3dSGIX = (PFNGLDEFORMATIONMAP3DSGIXPROC) __GLeeGetProcAddress("glDeformationMap3dSGIX"))!=0) nLinked++; - if ((pglDeformationMap3fSGIX = (PFNGLDEFORMATIONMAP3FSGIXPROC) __GLeeGetProcAddress("glDeformationMap3fSGIX"))!=0) nLinked++; - if ((pglDeformSGIX = (PFNGLDEFORMSGIXPROC) __GLeeGetProcAddress("glDeformSGIX"))!=0) nLinked++; - if ((pglLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) __GLeeGetProcAddress("glLoadIdentityDeformationMapSGIX"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_reference_plane(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_reference_plane - if ((pglReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC) __GLeeGetProcAddress("glReferencePlaneSGIX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_flush_raster(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_flush_raster - if ((pglFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC) __GLeeGetProcAddress("glFlushRasterSGIX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_depth_texture(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_fog_function(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_fog_function - if ((pglFogFuncSGIS = (PFNGLFOGFUNCSGISPROC) __GLeeGetProcAddress("glFogFuncSGIS"))!=0) nLinked++; - if ((pglGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC) __GLeeGetProcAddress("glGetFogFuncSGIS"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_fog_offset(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_HP_image_transform(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_HP_image_transform - if ((pglImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC) __GLeeGetProcAddress("glImageTransformParameteriHP"))!=0) nLinked++; - if ((pglImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC) __GLeeGetProcAddress("glImageTransformParameterfHP"))!=0) nLinked++; - if ((pglImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) __GLeeGetProcAddress("glImageTransformParameterivHP"))!=0) nLinked++; - if ((pglImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) __GLeeGetProcAddress("glImageTransformParameterfvHP"))!=0) nLinked++; - if ((pglGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) __GLeeGetProcAddress("glGetImageTransformParameterivHP"))!=0) nLinked++; - if ((pglGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) __GLeeGetProcAddress("glGetImageTransformParameterfvHP"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_HP_convolution_border_modes(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_INGR_palette_buffer(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_texture_add_env(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_color_subtable(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_color_subtable - if ((pglColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC) __GLeeGetProcAddress("glColorSubTableEXT"))!=0) nLinked++; - if ((pglCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC) __GLeeGetProcAddress("glCopyColorSubTableEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_PGI_vertex_hints(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_PGI_misc_hints(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_PGI_misc_hints - if ((pglHintPGI = (PFNGLHINTPGIPROC) __GLeeGetProcAddress("glHintPGI"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_paletted_texture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_paletted_texture - if ((pglColorTableEXT = (PFNGLCOLORTABLEEXTPROC) __GLeeGetProcAddress("glColorTableEXT"))!=0) nLinked++; - if ((pglGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC) __GLeeGetProcAddress("glGetColorTableEXT"))!=0) nLinked++; - if ((pglGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetColorTableParameterivEXT"))!=0) nLinked++; - if ((pglGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetColorTableParameterfvEXT"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_clip_volume_hint(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_list_priority(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_list_priority - if ((pglGetListParameterfvSGIX = (PFNGLGETLISTPARAMETERFVSGIXPROC) __GLeeGetProcAddress("glGetListParameterfvSGIX"))!=0) nLinked++; - if ((pglGetListParameterivSGIX = (PFNGLGETLISTPARAMETERIVSGIXPROC) __GLeeGetProcAddress("glGetListParameterivSGIX"))!=0) nLinked++; - if ((pglListParameterfSGIX = (PFNGLLISTPARAMETERFSGIXPROC) __GLeeGetProcAddress("glListParameterfSGIX"))!=0) nLinked++; - if ((pglListParameterfvSGIX = (PFNGLLISTPARAMETERFVSGIXPROC) __GLeeGetProcAddress("glListParameterfvSGIX"))!=0) nLinked++; - if ((pglListParameteriSGIX = (PFNGLLISTPARAMETERISGIXPROC) __GLeeGetProcAddress("glListParameteriSGIX"))!=0) nLinked++; - if ((pglListParameterivSGIX = (PFNGLLISTPARAMETERIVSGIXPROC) __GLeeGetProcAddress("glListParameterivSGIX"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_ir_instrument1(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_calligraphic_fragment(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_texture_lod_bias(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_shadow_ambient(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_index_texture(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_index_material(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_index_material - if ((pglIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC) __GLeeGetProcAddress("glIndexMaterialEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_index_func(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_index_func - if ((pglIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC) __GLeeGetProcAddress("glIndexFuncEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_index_array_formats(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_compiled_vertex_array(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_compiled_vertex_array - if ((pglLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC) __GLeeGetProcAddress("glLockArraysEXT"))!=0) nLinked++; - if ((pglUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC) __GLeeGetProcAddress("glUnlockArraysEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_cull_vertex(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_cull_vertex - if ((pglCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC) __GLeeGetProcAddress("glCullParameterdvEXT"))!=0) nLinked++; - if ((pglCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC) __GLeeGetProcAddress("glCullParameterfvEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_ycrcb(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_fragment_lighting(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_fragment_lighting - if ((pglFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC) __GLeeGetProcAddress("glFragmentColorMaterialSGIX"))!=0) nLinked++; - if ((pglFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC) __GLeeGetProcAddress("glFragmentLightfSGIX"))!=0) nLinked++; - if ((pglFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC) __GLeeGetProcAddress("glFragmentLightfvSGIX"))!=0) nLinked++; - if ((pglFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC) __GLeeGetProcAddress("glFragmentLightiSGIX"))!=0) nLinked++; - if ((pglFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC) __GLeeGetProcAddress("glFragmentLightivSGIX"))!=0) nLinked++; - if ((pglFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC) __GLeeGetProcAddress("glFragmentLightModelfSGIX"))!=0) nLinked++; - if ((pglFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) __GLeeGetProcAddress("glFragmentLightModelfvSGIX"))!=0) nLinked++; - if ((pglFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC) __GLeeGetProcAddress("glFragmentLightModeliSGIX"))!=0) nLinked++; - if ((pglFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) __GLeeGetProcAddress("glFragmentLightModelivSGIX"))!=0) nLinked++; - if ((pglFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC) __GLeeGetProcAddress("glFragmentMaterialfSGIX"))!=0) nLinked++; - if ((pglFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC) __GLeeGetProcAddress("glFragmentMaterialfvSGIX"))!=0) nLinked++; - if ((pglFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC) __GLeeGetProcAddress("glFragmentMaterialiSGIX"))!=0) nLinked++; - if ((pglFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC) __GLeeGetProcAddress("glFragmentMaterialivSGIX"))!=0) nLinked++; - if ((pglGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC) __GLeeGetProcAddress("glGetFragmentLightfvSGIX"))!=0) nLinked++; - if ((pglGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC) __GLeeGetProcAddress("glGetFragmentLightivSGIX"))!=0) nLinked++; - if ((pglGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC) __GLeeGetProcAddress("glGetFragmentMaterialfvSGIX"))!=0) nLinked++; - if ((pglGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC) __GLeeGetProcAddress("glGetFragmentMaterialivSGIX"))!=0) nLinked++; - if ((pglLightEnviSGIX = (PFNGLLIGHTENVISGIXPROC) __GLeeGetProcAddress("glLightEnviSGIX"))!=0) nLinked++; -#endif - if (nLinked==18) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_IBM_rasterpos_clip(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_HP_texture_lighting(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_draw_range_elements(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_draw_range_elements - if ((pglDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC) __GLeeGetProcAddress("glDrawRangeElementsEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_WIN_phong_shading(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_WIN_specular_fog(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_light_texture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_light_texture - if ((pglApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC) __GLeeGetProcAddress("glApplyTextureEXT"))!=0) nLinked++; - if ((pglTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC) __GLeeGetProcAddress("glTextureLightEXT"))!=0) nLinked++; - if ((pglTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC) __GLeeGetProcAddress("glTextureMaterialEXT"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_blend_alpha_minmax(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_impact_pixel_texture(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_bgra(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_async(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_async - if ((pglAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC) __GLeeGetProcAddress("glAsyncMarkerSGIX"))!=0) nLinked++; - if ((pglFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC) __GLeeGetProcAddress("glFinishAsyncSGIX"))!=0) nLinked++; - if ((pglPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC) __GLeeGetProcAddress("glPollAsyncSGIX"))!=0) nLinked++; - if ((pglGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC) __GLeeGetProcAddress("glGenAsyncMarkersSGIX"))!=0) nLinked++; - if ((pglDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC) __GLeeGetProcAddress("glDeleteAsyncMarkersSGIX"))!=0) nLinked++; - if ((pglIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC) __GLeeGetProcAddress("glIsAsyncMarkerSGIX"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_async_pixel(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_async_histogram(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_INTEL_texture_scissor(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_INTEL_parallel_arrays(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_INTEL_parallel_arrays - if ((pglVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC) __GLeeGetProcAddress("glVertexPointervINTEL"))!=0) nLinked++; - if ((pglNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC) __GLeeGetProcAddress("glNormalPointervINTEL"))!=0) nLinked++; - if ((pglColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC) __GLeeGetProcAddress("glColorPointervINTEL"))!=0) nLinked++; - if ((pglTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC) __GLeeGetProcAddress("glTexCoordPointervINTEL"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_HP_occlusion_test(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_pixel_transform(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_pixel_transform - if ((pglPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) __GLeeGetProcAddress("glPixelTransformParameteriEXT"))!=0) nLinked++; - if ((pglPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) __GLeeGetProcAddress("glPixelTransformParameterfEXT"))!=0) nLinked++; - if ((pglPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) __GLeeGetProcAddress("glPixelTransformParameterivEXT"))!=0) nLinked++; - if ((pglPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) __GLeeGetProcAddress("glPixelTransformParameterfvEXT"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_pixel_transform_color_table(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_shared_texture_palette(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_separate_specular_color(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_secondary_color(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_secondary_color - if ((pglSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC) __GLeeGetProcAddress("glSecondaryColor3bEXT"))!=0) nLinked++; - if ((pglSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3bvEXT"))!=0) nLinked++; - if ((pglSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC) __GLeeGetProcAddress("glSecondaryColor3dEXT"))!=0) nLinked++; - if ((pglSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3dvEXT"))!=0) nLinked++; - if ((pglSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC) __GLeeGetProcAddress("glSecondaryColor3fEXT"))!=0) nLinked++; - if ((pglSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3fvEXT"))!=0) nLinked++; - if ((pglSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC) __GLeeGetProcAddress("glSecondaryColor3iEXT"))!=0) nLinked++; - if ((pglSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3ivEXT"))!=0) nLinked++; - if ((pglSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC) __GLeeGetProcAddress("glSecondaryColor3sEXT"))!=0) nLinked++; - if ((pglSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3svEXT"))!=0) nLinked++; - if ((pglSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC) __GLeeGetProcAddress("glSecondaryColor3ubEXT"))!=0) nLinked++; - if ((pglSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3ubvEXT"))!=0) nLinked++; - if ((pglSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC) __GLeeGetProcAddress("glSecondaryColor3uiEXT"))!=0) nLinked++; - if ((pglSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3uivEXT"))!=0) nLinked++; - if ((pglSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC) __GLeeGetProcAddress("glSecondaryColor3usEXT"))!=0) nLinked++; - if ((pglSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3usvEXT"))!=0) nLinked++; - if ((pglSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC) __GLeeGetProcAddress("glSecondaryColorPointerEXT"))!=0) nLinked++; -#endif - if (nLinked==17) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_perturb_normal(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_texture_perturb_normal - if ((pglTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC) __GLeeGetProcAddress("glTextureNormalEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_multi_draw_arrays(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_multi_draw_arrays - if ((pglMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC) __GLeeGetProcAddress("glMultiDrawArraysEXT"))!=0) nLinked++; - if ((pglMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC) __GLeeGetProcAddress("glMultiDrawElementsEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_fog_coord(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_fog_coord - if ((pglFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC) __GLeeGetProcAddress("glFogCoordfEXT"))!=0) nLinked++; - if ((pglFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC) __GLeeGetProcAddress("glFogCoordfvEXT"))!=0) nLinked++; - if ((pglFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC) __GLeeGetProcAddress("glFogCoorddEXT"))!=0) nLinked++; - if ((pglFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC) __GLeeGetProcAddress("glFogCoorddvEXT"))!=0) nLinked++; - if ((pglFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC) __GLeeGetProcAddress("glFogCoordPointerEXT"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_REND_screen_coordinates(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_coordinate_frame(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_coordinate_frame - if ((pglTangent3bEXT = (PFNGLTANGENT3BEXTPROC) __GLeeGetProcAddress("glTangent3bEXT"))!=0) nLinked++; - if ((pglTangent3bvEXT = (PFNGLTANGENT3BVEXTPROC) __GLeeGetProcAddress("glTangent3bvEXT"))!=0) nLinked++; - if ((pglTangent3dEXT = (PFNGLTANGENT3DEXTPROC) __GLeeGetProcAddress("glTangent3dEXT"))!=0) nLinked++; - if ((pglTangent3dvEXT = (PFNGLTANGENT3DVEXTPROC) __GLeeGetProcAddress("glTangent3dvEXT"))!=0) nLinked++; - if ((pglTangent3fEXT = (PFNGLTANGENT3FEXTPROC) __GLeeGetProcAddress("glTangent3fEXT"))!=0) nLinked++; - if ((pglTangent3fvEXT = (PFNGLTANGENT3FVEXTPROC) __GLeeGetProcAddress("glTangent3fvEXT"))!=0) nLinked++; - if ((pglTangent3iEXT = (PFNGLTANGENT3IEXTPROC) __GLeeGetProcAddress("glTangent3iEXT"))!=0) nLinked++; - if ((pglTangent3ivEXT = (PFNGLTANGENT3IVEXTPROC) __GLeeGetProcAddress("glTangent3ivEXT"))!=0) nLinked++; - if ((pglTangent3sEXT = (PFNGLTANGENT3SEXTPROC) __GLeeGetProcAddress("glTangent3sEXT"))!=0) nLinked++; - if ((pglTangent3svEXT = (PFNGLTANGENT3SVEXTPROC) __GLeeGetProcAddress("glTangent3svEXT"))!=0) nLinked++; - if ((pglBinormal3bEXT = (PFNGLBINORMAL3BEXTPROC) __GLeeGetProcAddress("glBinormal3bEXT"))!=0) nLinked++; - if ((pglBinormal3bvEXT = (PFNGLBINORMAL3BVEXTPROC) __GLeeGetProcAddress("glBinormal3bvEXT"))!=0) nLinked++; - if ((pglBinormal3dEXT = (PFNGLBINORMAL3DEXTPROC) __GLeeGetProcAddress("glBinormal3dEXT"))!=0) nLinked++; - if ((pglBinormal3dvEXT = (PFNGLBINORMAL3DVEXTPROC) __GLeeGetProcAddress("glBinormal3dvEXT"))!=0) nLinked++; - if ((pglBinormal3fEXT = (PFNGLBINORMAL3FEXTPROC) __GLeeGetProcAddress("glBinormal3fEXT"))!=0) nLinked++; - if ((pglBinormal3fvEXT = (PFNGLBINORMAL3FVEXTPROC) __GLeeGetProcAddress("glBinormal3fvEXT"))!=0) nLinked++; - if ((pglBinormal3iEXT = (PFNGLBINORMAL3IEXTPROC) __GLeeGetProcAddress("glBinormal3iEXT"))!=0) nLinked++; - if ((pglBinormal3ivEXT = (PFNGLBINORMAL3IVEXTPROC) __GLeeGetProcAddress("glBinormal3ivEXT"))!=0) nLinked++; - if ((pglBinormal3sEXT = (PFNGLBINORMAL3SEXTPROC) __GLeeGetProcAddress("glBinormal3sEXT"))!=0) nLinked++; - if ((pglBinormal3svEXT = (PFNGLBINORMAL3SVEXTPROC) __GLeeGetProcAddress("glBinormal3svEXT"))!=0) nLinked++; - if ((pglTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC) __GLeeGetProcAddress("glTangentPointerEXT"))!=0) nLinked++; - if ((pglBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC) __GLeeGetProcAddress("glBinormalPointerEXT"))!=0) nLinked++; -#endif - if (nLinked==22) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_env_combine(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_APPLE_specular_vector(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_APPLE_transform_hint(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_fog_scale(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SUNX_constant_data(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SUNX_constant_data - if ((pglFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC) __GLeeGetProcAddress("glFinishTextureSUNX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SUN_global_alpha(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SUN_global_alpha - if ((pglGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorbSUN"))!=0) nLinked++; - if ((pglGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorsSUN"))!=0) nLinked++; - if ((pglGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactoriSUN"))!=0) nLinked++; - if ((pglGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorfSUN"))!=0) nLinked++; - if ((pglGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactordSUN"))!=0) nLinked++; - if ((pglGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorubSUN"))!=0) nLinked++; - if ((pglGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorusSUN"))!=0) nLinked++; - if ((pglGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactoruiSUN"))!=0) nLinked++; -#endif - if (nLinked==8) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SUN_triangle_list(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SUN_triangle_list - if ((pglReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC) __GLeeGetProcAddress("glReplacementCodeuiSUN"))!=0) nLinked++; - if ((pglReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC) __GLeeGetProcAddress("glReplacementCodeusSUN"))!=0) nLinked++; - if ((pglReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC) __GLeeGetProcAddress("glReplacementCodeubSUN"))!=0) nLinked++; - if ((pglReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuivSUN"))!=0) nLinked++; - if ((pglReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC) __GLeeGetProcAddress("glReplacementCodeusvSUN"))!=0) nLinked++; - if ((pglReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC) __GLeeGetProcAddress("glReplacementCodeubvSUN"))!=0) nLinked++; - if ((pglReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC) __GLeeGetProcAddress("glReplacementCodePointerSUN"))!=0) nLinked++; -#endif - if (nLinked==7) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SUN_vertex(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SUN_vertex - if ((pglColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC) __GLeeGetProcAddress("glColor4ubVertex2fSUN"))!=0) nLinked++; - if ((pglColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC) __GLeeGetProcAddress("glColor4ubVertex2fvSUN"))!=0) nLinked++; - if ((pglColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC) __GLeeGetProcAddress("glColor4ubVertex3fSUN"))!=0) nLinked++; - if ((pglColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC) __GLeeGetProcAddress("glColor4ubVertex3fvSUN"))!=0) nLinked++; - if ((pglColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glColor3fVertex3fSUN"))!=0) nLinked++; - if ((pglColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glColor3fVertex3fvSUN"))!=0) nLinked++; - if ((pglNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glNormal3fVertex3fSUN"))!=0) nLinked++; - if ((pglNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glNormal3fVertex3fvSUN"))!=0) nLinked++; - if ((pglColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glColor4fNormal3fVertex3fSUN"))!=0) nLinked++; - if ((pglColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glColor4fNormal3fVertex3fvSUN"))!=0) nLinked++; - if ((pglTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fVertex3fSUN"))!=0) nLinked++; - if ((pglTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fVertex3fvSUN"))!=0) nLinked++; - if ((pglTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC) __GLeeGetProcAddress("glTexCoord4fVertex4fSUN"))!=0) nLinked++; - if ((pglTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC) __GLeeGetProcAddress("glTexCoord4fVertex4fvSUN"))!=0) nLinked++; - if ((pglTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor4ubVertex3fSUN"))!=0) nLinked++; - if ((pglTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor4ubVertex3fvSUN"))!=0) nLinked++; - if ((pglTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor3fVertex3fSUN"))!=0) nLinked++; - if ((pglTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor3fVertex3fvSUN"))!=0) nLinked++; - if ((pglTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fNormal3fVertex3fSUN"))!=0) nLinked++; - if ((pglTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fNormal3fVertex3fvSUN"))!=0) nLinked++; - if ((pglTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor4fNormal3fVertex3fSUN"))!=0) nLinked++; - if ((pglTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor4fNormal3fVertex3fvSUN"))!=0) nLinked++; - if ((pglTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) __GLeeGetProcAddress("glTexCoord4fColor4fNormal3fVertex4fSUN"))!=0) nLinked++; - if ((pglTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) __GLeeGetProcAddress("glTexCoord4fColor4fNormal3fVertex4fvSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiVertex3fSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiVertex3fvSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor4ubVertex3fSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor4ubVertex3fvSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor3fVertex3fSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor3fVertex3fvSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiNormal3fVertex3fSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiNormal3fVertex3fvSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor4fNormal3fVertex3fSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor4fNormal3fVertex3fvSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fVertex3fSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fVertex3fvSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN"))!=0) nLinked++; - if ((pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN"))!=0) nLinked++; -#endif - if (nLinked==40) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_blend_func_separate(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_blend_func_separate - if ((pglBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC) __GLeeGetProcAddress("glBlendFuncSeparateEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_INGR_color_clamp(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_INGR_interlace_read(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_stencil_wrap(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_422_pixels(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_texgen_reflection(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_cube_map(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SUN_convolution_border_modes(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_env_add(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_lod_bias(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_filter_anisotropic(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_vertex_weighting(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_vertex_weighting - if ((pglVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC) __GLeeGetProcAddress("glVertexWeightfEXT"))!=0) nLinked++; - if ((pglVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC) __GLeeGetProcAddress("glVertexWeightfvEXT"))!=0) nLinked++; - if ((pglVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC) __GLeeGetProcAddress("glVertexWeightPointerEXT"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_light_max_exponent(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_vertex_array_range(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_vertex_array_range - if ((pglFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC) __GLeeGetProcAddress("glFlushVertexArrayRangeNV"))!=0) nLinked++; - if ((pglVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC) __GLeeGetProcAddress("glVertexArrayRangeNV"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_register_combiners(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_register_combiners - if ((pglCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC) __GLeeGetProcAddress("glCombinerParameterfvNV"))!=0) nLinked++; - if ((pglCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC) __GLeeGetProcAddress("glCombinerParameterfNV"))!=0) nLinked++; - if ((pglCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC) __GLeeGetProcAddress("glCombinerParameterivNV"))!=0) nLinked++; - if ((pglCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC) __GLeeGetProcAddress("glCombinerParameteriNV"))!=0) nLinked++; - if ((pglCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC) __GLeeGetProcAddress("glCombinerInputNV"))!=0) nLinked++; - if ((pglCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC) __GLeeGetProcAddress("glCombinerOutputNV"))!=0) nLinked++; - if ((pglFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC) __GLeeGetProcAddress("glFinalCombinerInputNV"))!=0) nLinked++; - if ((pglGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetCombinerInputParameterfvNV"))!=0) nLinked++; - if ((pglGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetCombinerInputParameterivNV"))!=0) nLinked++; - if ((pglGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetCombinerOutputParameterfvNV"))!=0) nLinked++; - if ((pglGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetCombinerOutputParameterivNV"))!=0) nLinked++; - if ((pglGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetFinalCombinerInputParameterfvNV"))!=0) nLinked++; - if ((pglGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetFinalCombinerInputParameterivNV"))!=0) nLinked++; -#endif - if (nLinked==13) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_fog_distance(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_texgen_emboss(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_blend_square(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_texture_env_combine4(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_MESA_resize_buffers(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_MESA_resize_buffers - if ((pglResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC) __GLeeGetProcAddress("glResizeBuffersMESA"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_MESA_window_pos(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_MESA_window_pos - if ((pglWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC) __GLeeGetProcAddress("glWindowPos2dMESA"))!=0) nLinked++; - if ((pglWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC) __GLeeGetProcAddress("glWindowPos2dvMESA"))!=0) nLinked++; - if ((pglWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC) __GLeeGetProcAddress("glWindowPos2fMESA"))!=0) nLinked++; - if ((pglWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC) __GLeeGetProcAddress("glWindowPos2fvMESA"))!=0) nLinked++; - if ((pglWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC) __GLeeGetProcAddress("glWindowPos2iMESA"))!=0) nLinked++; - if ((pglWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC) __GLeeGetProcAddress("glWindowPos2ivMESA"))!=0) nLinked++; - if ((pglWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC) __GLeeGetProcAddress("glWindowPos2sMESA"))!=0) nLinked++; - if ((pglWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC) __GLeeGetProcAddress("glWindowPos2svMESA"))!=0) nLinked++; - if ((pglWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC) __GLeeGetProcAddress("glWindowPos3dMESA"))!=0) nLinked++; - if ((pglWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC) __GLeeGetProcAddress("glWindowPos3dvMESA"))!=0) nLinked++; - if ((pglWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC) __GLeeGetProcAddress("glWindowPos3fMESA"))!=0) nLinked++; - if ((pglWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC) __GLeeGetProcAddress("glWindowPos3fvMESA"))!=0) nLinked++; - if ((pglWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC) __GLeeGetProcAddress("glWindowPos3iMESA"))!=0) nLinked++; - if ((pglWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC) __GLeeGetProcAddress("glWindowPos3ivMESA"))!=0) nLinked++; - if ((pglWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC) __GLeeGetProcAddress("glWindowPos3sMESA"))!=0) nLinked++; - if ((pglWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC) __GLeeGetProcAddress("glWindowPos3svMESA"))!=0) nLinked++; - if ((pglWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC) __GLeeGetProcAddress("glWindowPos4dMESA"))!=0) nLinked++; - if ((pglWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC) __GLeeGetProcAddress("glWindowPos4dvMESA"))!=0) nLinked++; - if ((pglWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC) __GLeeGetProcAddress("glWindowPos4fMESA"))!=0) nLinked++; - if ((pglWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC) __GLeeGetProcAddress("glWindowPos4fvMESA"))!=0) nLinked++; - if ((pglWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC) __GLeeGetProcAddress("glWindowPos4iMESA"))!=0) nLinked++; - if ((pglWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC) __GLeeGetProcAddress("glWindowPos4ivMESA"))!=0) nLinked++; - if ((pglWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC) __GLeeGetProcAddress("glWindowPos4sMESA"))!=0) nLinked++; - if ((pglWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC) __GLeeGetProcAddress("glWindowPos4svMESA"))!=0) nLinked++; -#endif - if (nLinked==24) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_compression_s3tc(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_IBM_cull_vertex(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_IBM_multimode_draw_arrays(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_IBM_multimode_draw_arrays - if ((pglMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC) __GLeeGetProcAddress("glMultiModeDrawArraysIBM"))!=0) nLinked++; - if ((pglMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC) __GLeeGetProcAddress("glMultiModeDrawElementsIBM"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_IBM_vertex_array_lists(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_IBM_vertex_array_lists - if ((pglColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC) __GLeeGetProcAddress("glColorPointerListIBM"))!=0) nLinked++; - if ((pglSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) __GLeeGetProcAddress("glSecondaryColorPointerListIBM"))!=0) nLinked++; - if ((pglEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC) __GLeeGetProcAddress("glEdgeFlagPointerListIBM"))!=0) nLinked++; - if ((pglFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC) __GLeeGetProcAddress("glFogCoordPointerListIBM"))!=0) nLinked++; - if ((pglIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC) __GLeeGetProcAddress("glIndexPointerListIBM"))!=0) nLinked++; - if ((pglNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC) __GLeeGetProcAddress("glNormalPointerListIBM"))!=0) nLinked++; - if ((pglTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC) __GLeeGetProcAddress("glTexCoordPointerListIBM"))!=0) nLinked++; - if ((pglVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC) __GLeeGetProcAddress("glVertexPointerListIBM"))!=0) nLinked++; -#endif - if (nLinked==8) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_subsample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_ycrcb_subsample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_ycrcba(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGI_depth_pass_instrument(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_3DFX_texture_compression_FXT1(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_3DFX_multisample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_3DFX_tbuffer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_3DFX_tbuffer - if ((pglTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC) __GLeeGetProcAddress("glTbufferMask3DFX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_multisample(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_multisample - if ((pglSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC) __GLeeGetProcAddress("glSampleMaskEXT"))!=0) nLinked++; - if ((pglSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC) __GLeeGetProcAddress("glSamplePatternEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_vertex_preclip(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_convolution_accuracy(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_resample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_point_line_texgen(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIS_texture_color_mask(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIS_texture_color_mask - if ((pglTextureColorMaskSGIS = (PFNGLTEXTURECOLORMASKSGISPROC) __GLeeGetProcAddress("glTextureColorMaskSGIS"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_env_dot3(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ATI_texture_mirror_once(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_fence(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_fence - if ((pglDeleteFencesNV = (PFNGLDELETEFENCESNVPROC) __GLeeGetProcAddress("glDeleteFencesNV"))!=0) nLinked++; - if ((pglGenFencesNV = (PFNGLGENFENCESNVPROC) __GLeeGetProcAddress("glGenFencesNV"))!=0) nLinked++; - if ((pglIsFenceNV = (PFNGLISFENCENVPROC) __GLeeGetProcAddress("glIsFenceNV"))!=0) nLinked++; - if ((pglTestFenceNV = (PFNGLTESTFENCENVPROC) __GLeeGetProcAddress("glTestFenceNV"))!=0) nLinked++; - if ((pglGetFenceivNV = (PFNGLGETFENCEIVNVPROC) __GLeeGetProcAddress("glGetFenceivNV"))!=0) nLinked++; - if ((pglFinishFenceNV = (PFNGLFINISHFENCENVPROC) __GLeeGetProcAddress("glFinishFenceNV"))!=0) nLinked++; - if ((pglSetFenceNV = (PFNGLSETFENCENVPROC) __GLeeGetProcAddress("glSetFenceNV"))!=0) nLinked++; -#endif - if (nLinked==7) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_IBM_texture_mirrored_repeat(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_evaluators(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_evaluators - if ((pglMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC) __GLeeGetProcAddress("glMapControlPointsNV"))!=0) nLinked++; - if ((pglMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC) __GLeeGetProcAddress("glMapParameterivNV"))!=0) nLinked++; - if ((pglMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC) __GLeeGetProcAddress("glMapParameterfvNV"))!=0) nLinked++; - if ((pglGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC) __GLeeGetProcAddress("glGetMapControlPointsNV"))!=0) nLinked++; - if ((pglGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetMapParameterivNV"))!=0) nLinked++; - if ((pglGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetMapParameterfvNV"))!=0) nLinked++; - if ((pglGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetMapAttribParameterivNV"))!=0) nLinked++; - if ((pglGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetMapAttribParameterfvNV"))!=0) nLinked++; - if ((pglEvalMapsNV = (PFNGLEVALMAPSNVPROC) __GLeeGetProcAddress("glEvalMapsNV"))!=0) nLinked++; -#endif - if (nLinked==9) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_packed_depth_stencil(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_register_combiners2(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_register_combiners2 - if ((pglCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) __GLeeGetProcAddress("glCombinerStageParameterfvNV"))!=0) nLinked++; - if ((pglGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetCombinerStageParameterfvNV"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_texture_compression_vtc(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_texture_rectangle(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_texture_shader(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_texture_shader2(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_vertex_array_range2(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_vertex_program(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_vertex_program - if ((pglAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC) __GLeeGetProcAddress("glAreProgramsResidentNV"))!=0) nLinked++; - if ((pglBindProgramNV = (PFNGLBINDPROGRAMNVPROC) __GLeeGetProcAddress("glBindProgramNV"))!=0) nLinked++; - if ((pglDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC) __GLeeGetProcAddress("glDeleteProgramsNV"))!=0) nLinked++; - if ((pglExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC) __GLeeGetProcAddress("glExecuteProgramNV"))!=0) nLinked++; - if ((pglGenProgramsNV = (PFNGLGENPROGRAMSNVPROC) __GLeeGetProcAddress("glGenProgramsNV"))!=0) nLinked++; - if ((pglGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC) __GLeeGetProcAddress("glGetProgramParameterdvNV"))!=0) nLinked++; - if ((pglGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetProgramParameterfvNV"))!=0) nLinked++; - if ((pglGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC) __GLeeGetProcAddress("glGetProgramivNV"))!=0) nLinked++; - if ((pglGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC) __GLeeGetProcAddress("glGetProgramStringNV"))!=0) nLinked++; - if ((pglGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC) __GLeeGetProcAddress("glGetTrackMatrixivNV"))!=0) nLinked++; - if ((pglGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC) __GLeeGetProcAddress("glGetVertexAttribdvNV"))!=0) nLinked++; - if ((pglGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) __GLeeGetProcAddress("glGetVertexAttribfvNV"))!=0) nLinked++; - if ((pglGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC) __GLeeGetProcAddress("glGetVertexAttribivNV"))!=0) nLinked++; - if ((pglGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC) __GLeeGetProcAddress("glGetVertexAttribPointervNV"))!=0) nLinked++; - if ((pglIsProgramNV = (PFNGLISPROGRAMNVPROC) __GLeeGetProcAddress("glIsProgramNV"))!=0) nLinked++; - if ((pglLoadProgramNV = (PFNGLLOADPROGRAMNVPROC) __GLeeGetProcAddress("glLoadProgramNV"))!=0) nLinked++; - if ((pglProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC) __GLeeGetProcAddress("glProgramParameter4dNV"))!=0) nLinked++; - if ((pglProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC) __GLeeGetProcAddress("glProgramParameter4dvNV"))!=0) nLinked++; - if ((pglProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC) __GLeeGetProcAddress("glProgramParameter4fNV"))!=0) nLinked++; - if ((pglProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC) __GLeeGetProcAddress("glProgramParameter4fvNV"))!=0) nLinked++; - if ((pglProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC) __GLeeGetProcAddress("glProgramParameters4dvNV"))!=0) nLinked++; - if ((pglProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC) __GLeeGetProcAddress("glProgramParameters4fvNV"))!=0) nLinked++; - if ((pglRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC) __GLeeGetProcAddress("glRequestResidentProgramsNV"))!=0) nLinked++; - if ((pglTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC) __GLeeGetProcAddress("glTrackMatrixNV"))!=0) nLinked++; - if ((pglVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC) __GLeeGetProcAddress("glVertexAttribPointerNV"))!=0) nLinked++; - if ((pglVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC) __GLeeGetProcAddress("glVertexAttrib1dNV"))!=0) nLinked++; - if ((pglVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC) __GLeeGetProcAddress("glVertexAttrib1dvNV"))!=0) nLinked++; - if ((pglVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC) __GLeeGetProcAddress("glVertexAttrib1fNV"))!=0) nLinked++; - if ((pglVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC) __GLeeGetProcAddress("glVertexAttrib1fvNV"))!=0) nLinked++; - if ((pglVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC) __GLeeGetProcAddress("glVertexAttrib1sNV"))!=0) nLinked++; - if ((pglVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC) __GLeeGetProcAddress("glVertexAttrib1svNV"))!=0) nLinked++; - if ((pglVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC) __GLeeGetProcAddress("glVertexAttrib2dNV"))!=0) nLinked++; - if ((pglVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC) __GLeeGetProcAddress("glVertexAttrib2dvNV"))!=0) nLinked++; - if ((pglVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC) __GLeeGetProcAddress("glVertexAttrib2fNV"))!=0) nLinked++; - if ((pglVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC) __GLeeGetProcAddress("glVertexAttrib2fvNV"))!=0) nLinked++; - if ((pglVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC) __GLeeGetProcAddress("glVertexAttrib2sNV"))!=0) nLinked++; - if ((pglVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC) __GLeeGetProcAddress("glVertexAttrib2svNV"))!=0) nLinked++; - if ((pglVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC) __GLeeGetProcAddress("glVertexAttrib3dNV"))!=0) nLinked++; - if ((pglVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC) __GLeeGetProcAddress("glVertexAttrib3dvNV"))!=0) nLinked++; - if ((pglVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC) __GLeeGetProcAddress("glVertexAttrib3fNV"))!=0) nLinked++; - if ((pglVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC) __GLeeGetProcAddress("glVertexAttrib3fvNV"))!=0) nLinked++; - if ((pglVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC) __GLeeGetProcAddress("glVertexAttrib3sNV"))!=0) nLinked++; - if ((pglVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC) __GLeeGetProcAddress("glVertexAttrib3svNV"))!=0) nLinked++; - if ((pglVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC) __GLeeGetProcAddress("glVertexAttrib4dNV"))!=0) nLinked++; - if ((pglVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC) __GLeeGetProcAddress("glVertexAttrib4dvNV"))!=0) nLinked++; - if ((pglVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC) __GLeeGetProcAddress("glVertexAttrib4fNV"))!=0) nLinked++; - if ((pglVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC) __GLeeGetProcAddress("glVertexAttrib4fvNV"))!=0) nLinked++; - if ((pglVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC) __GLeeGetProcAddress("glVertexAttrib4sNV"))!=0) nLinked++; - if ((pglVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC) __GLeeGetProcAddress("glVertexAttrib4svNV"))!=0) nLinked++; - if ((pglVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC) __GLeeGetProcAddress("glVertexAttrib4ubNV"))!=0) nLinked++; - if ((pglVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC) __GLeeGetProcAddress("glVertexAttrib4ubvNV"))!=0) nLinked++; - if ((pglVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC) __GLeeGetProcAddress("glVertexAttribs1dvNV"))!=0) nLinked++; - if ((pglVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC) __GLeeGetProcAddress("glVertexAttribs1fvNV"))!=0) nLinked++; - if ((pglVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC) __GLeeGetProcAddress("glVertexAttribs1svNV"))!=0) nLinked++; - if ((pglVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC) __GLeeGetProcAddress("glVertexAttribs2dvNV"))!=0) nLinked++; - if ((pglVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC) __GLeeGetProcAddress("glVertexAttribs2fvNV"))!=0) nLinked++; - if ((pglVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC) __GLeeGetProcAddress("glVertexAttribs2svNV"))!=0) nLinked++; - if ((pglVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC) __GLeeGetProcAddress("glVertexAttribs3dvNV"))!=0) nLinked++; - if ((pglVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC) __GLeeGetProcAddress("glVertexAttribs3fvNV"))!=0) nLinked++; - if ((pglVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC) __GLeeGetProcAddress("glVertexAttribs3svNV"))!=0) nLinked++; - if ((pglVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC) __GLeeGetProcAddress("glVertexAttribs4dvNV"))!=0) nLinked++; - if ((pglVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC) __GLeeGetProcAddress("glVertexAttribs4fvNV"))!=0) nLinked++; - if ((pglVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC) __GLeeGetProcAddress("glVertexAttribs4svNV"))!=0) nLinked++; - if ((pglVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC) __GLeeGetProcAddress("glVertexAttribs4ubvNV"))!=0) nLinked++; -#endif - if (nLinked==64) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_texture_coordinate_clamp(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_scalebias_hint(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_OML_interlace(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_OML_subsample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_OML_resample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_copy_depth_to_color(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ATI_envmap_bumpmap(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_envmap_bumpmap - if ((pglTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC) __GLeeGetProcAddress("glTexBumpParameterivATI"))!=0) nLinked++; - if ((pglTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC) __GLeeGetProcAddress("glTexBumpParameterfvATI"))!=0) nLinked++; - if ((pglGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC) __GLeeGetProcAddress("glGetTexBumpParameterivATI"))!=0) nLinked++; - if ((pglGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC) __GLeeGetProcAddress("glGetTexBumpParameterfvATI"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_fragment_shader(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_fragment_shader - if ((pglGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC) __GLeeGetProcAddress("glGenFragmentShadersATI"))!=0) nLinked++; - if ((pglBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC) __GLeeGetProcAddress("glBindFragmentShaderATI"))!=0) nLinked++; - if ((pglDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC) __GLeeGetProcAddress("glDeleteFragmentShaderATI"))!=0) nLinked++; - if ((pglBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC) __GLeeGetProcAddress("glBeginFragmentShaderATI"))!=0) nLinked++; - if ((pglEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC) __GLeeGetProcAddress("glEndFragmentShaderATI"))!=0) nLinked++; - if ((pglPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC) __GLeeGetProcAddress("glPassTexCoordATI"))!=0) nLinked++; - if ((pglSampleMapATI = (PFNGLSAMPLEMAPATIPROC) __GLeeGetProcAddress("glSampleMapATI"))!=0) nLinked++; - if ((pglColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC) __GLeeGetProcAddress("glColorFragmentOp1ATI"))!=0) nLinked++; - if ((pglColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC) __GLeeGetProcAddress("glColorFragmentOp2ATI"))!=0) nLinked++; - if ((pglColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC) __GLeeGetProcAddress("glColorFragmentOp3ATI"))!=0) nLinked++; - if ((pglAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC) __GLeeGetProcAddress("glAlphaFragmentOp1ATI"))!=0) nLinked++; - if ((pglAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC) __GLeeGetProcAddress("glAlphaFragmentOp2ATI"))!=0) nLinked++; - if ((pglAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC) __GLeeGetProcAddress("glAlphaFragmentOp3ATI"))!=0) nLinked++; - if ((pglSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) __GLeeGetProcAddress("glSetFragmentShaderConstantATI"))!=0) nLinked++; -#endif - if (nLinked==14) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_pn_triangles(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_pn_triangles - if ((pglPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC) __GLeeGetProcAddress("glPNTrianglesiATI"))!=0) nLinked++; - if ((pglPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC) __GLeeGetProcAddress("glPNTrianglesfATI"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_vertex_array_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_vertex_array_object - if ((pglNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glNewObjectBufferATI"))!=0) nLinked++; - if ((pglIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glIsObjectBufferATI"))!=0) nLinked++; - if ((pglUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glUpdateObjectBufferATI"))!=0) nLinked++; - if ((pglGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC) __GLeeGetProcAddress("glGetObjectBufferfvATI"))!=0) nLinked++; - if ((pglGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC) __GLeeGetProcAddress("glGetObjectBufferivATI"))!=0) nLinked++; - if ((pglFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glFreeObjectBufferATI"))!=0) nLinked++; - if ((pglArrayObjectATI = (PFNGLARRAYOBJECTATIPROC) __GLeeGetProcAddress("glArrayObjectATI"))!=0) nLinked++; - if ((pglGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC) __GLeeGetProcAddress("glGetArrayObjectfvATI"))!=0) nLinked++; - if ((pglGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC) __GLeeGetProcAddress("glGetArrayObjectivATI"))!=0) nLinked++; - if ((pglVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC) __GLeeGetProcAddress("glVariantArrayObjectATI"))!=0) nLinked++; - if ((pglGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC) __GLeeGetProcAddress("glGetVariantArrayObjectfvATI"))!=0) nLinked++; - if ((pglGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC) __GLeeGetProcAddress("glGetVariantArrayObjectivATI"))!=0) nLinked++; -#endif - if (nLinked==12) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_vertex_shader(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_vertex_shader - if ((pglBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC) __GLeeGetProcAddress("glBeginVertexShaderEXT"))!=0) nLinked++; - if ((pglEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC) __GLeeGetProcAddress("glEndVertexShaderEXT"))!=0) nLinked++; - if ((pglBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC) __GLeeGetProcAddress("glBindVertexShaderEXT"))!=0) nLinked++; - if ((pglGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC) __GLeeGetProcAddress("glGenVertexShadersEXT"))!=0) nLinked++; - if ((pglDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC) __GLeeGetProcAddress("glDeleteVertexShaderEXT"))!=0) nLinked++; - if ((pglShaderOp1EXT = (PFNGLSHADEROP1EXTPROC) __GLeeGetProcAddress("glShaderOp1EXT"))!=0) nLinked++; - if ((pglShaderOp2EXT = (PFNGLSHADEROP2EXTPROC) __GLeeGetProcAddress("glShaderOp2EXT"))!=0) nLinked++; - if ((pglShaderOp3EXT = (PFNGLSHADEROP3EXTPROC) __GLeeGetProcAddress("glShaderOp3EXT"))!=0) nLinked++; - if ((pglSwizzleEXT = (PFNGLSWIZZLEEXTPROC) __GLeeGetProcAddress("glSwizzleEXT"))!=0) nLinked++; - if ((pglWriteMaskEXT = (PFNGLWRITEMASKEXTPROC) __GLeeGetProcAddress("glWriteMaskEXT"))!=0) nLinked++; - if ((pglInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC) __GLeeGetProcAddress("glInsertComponentEXT"))!=0) nLinked++; - if ((pglExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC) __GLeeGetProcAddress("glExtractComponentEXT"))!=0) nLinked++; - if ((pglGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC) __GLeeGetProcAddress("glGenSymbolsEXT"))!=0) nLinked++; - if ((pglSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC) __GLeeGetProcAddress("glSetInvariantEXT"))!=0) nLinked++; - if ((pglSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC) __GLeeGetProcAddress("glSetLocalConstantEXT"))!=0) nLinked++; - if ((pglVariantbvEXT = (PFNGLVARIANTBVEXTPROC) __GLeeGetProcAddress("glVariantbvEXT"))!=0) nLinked++; - if ((pglVariantsvEXT = (PFNGLVARIANTSVEXTPROC) __GLeeGetProcAddress("glVariantsvEXT"))!=0) nLinked++; - if ((pglVariantivEXT = (PFNGLVARIANTIVEXTPROC) __GLeeGetProcAddress("glVariantivEXT"))!=0) nLinked++; - if ((pglVariantfvEXT = (PFNGLVARIANTFVEXTPROC) __GLeeGetProcAddress("glVariantfvEXT"))!=0) nLinked++; - if ((pglVariantdvEXT = (PFNGLVARIANTDVEXTPROC) __GLeeGetProcAddress("glVariantdvEXT"))!=0) nLinked++; - if ((pglVariantubvEXT = (PFNGLVARIANTUBVEXTPROC) __GLeeGetProcAddress("glVariantubvEXT"))!=0) nLinked++; - if ((pglVariantusvEXT = (PFNGLVARIANTUSVEXTPROC) __GLeeGetProcAddress("glVariantusvEXT"))!=0) nLinked++; - if ((pglVariantuivEXT = (PFNGLVARIANTUIVEXTPROC) __GLeeGetProcAddress("glVariantuivEXT"))!=0) nLinked++; - if ((pglVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC) __GLeeGetProcAddress("glVariantPointerEXT"))!=0) nLinked++; - if ((pglEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) __GLeeGetProcAddress("glEnableVariantClientStateEXT"))!=0) nLinked++; - if ((pglDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) __GLeeGetProcAddress("glDisableVariantClientStateEXT"))!=0) nLinked++; - if ((pglBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC) __GLeeGetProcAddress("glBindLightParameterEXT"))!=0) nLinked++; - if ((pglBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC) __GLeeGetProcAddress("glBindMaterialParameterEXT"))!=0) nLinked++; - if ((pglBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC) __GLeeGetProcAddress("glBindTexGenParameterEXT"))!=0) nLinked++; - if ((pglBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) __GLeeGetProcAddress("glBindTextureUnitParameterEXT"))!=0) nLinked++; - if ((pglBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC) __GLeeGetProcAddress("glBindParameterEXT"))!=0) nLinked++; - if ((pglIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC) __GLeeGetProcAddress("glIsVariantEnabledEXT"))!=0) nLinked++; - if ((pglGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC) __GLeeGetProcAddress("glGetVariantBooleanvEXT"))!=0) nLinked++; - if ((pglGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC) __GLeeGetProcAddress("glGetVariantIntegervEXT"))!=0) nLinked++; - if ((pglGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC) __GLeeGetProcAddress("glGetVariantFloatvEXT"))!=0) nLinked++; - if ((pglGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC) __GLeeGetProcAddress("glGetVariantPointervEXT"))!=0) nLinked++; - if ((pglGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC) __GLeeGetProcAddress("glGetInvariantBooleanvEXT"))!=0) nLinked++; - if ((pglGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC) __GLeeGetProcAddress("glGetInvariantIntegervEXT"))!=0) nLinked++; - if ((pglGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC) __GLeeGetProcAddress("glGetInvariantFloatvEXT"))!=0) nLinked++; - if ((pglGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) __GLeeGetProcAddress("glGetLocalConstantBooleanvEXT"))!=0) nLinked++; - if ((pglGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) __GLeeGetProcAddress("glGetLocalConstantIntegervEXT"))!=0) nLinked++; - if ((pglGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC) __GLeeGetProcAddress("glGetLocalConstantFloatvEXT"))!=0) nLinked++; -#endif - if (nLinked==42) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_vertex_streams(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_vertex_streams - if ((pglVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC) __GLeeGetProcAddress("glVertexStream1sATI"))!=0) nLinked++; - if ((pglVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC) __GLeeGetProcAddress("glVertexStream1svATI"))!=0) nLinked++; - if ((pglVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC) __GLeeGetProcAddress("glVertexStream1iATI"))!=0) nLinked++; - if ((pglVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC) __GLeeGetProcAddress("glVertexStream1ivATI"))!=0) nLinked++; - if ((pglVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC) __GLeeGetProcAddress("glVertexStream1fATI"))!=0) nLinked++; - if ((pglVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC) __GLeeGetProcAddress("glVertexStream1fvATI"))!=0) nLinked++; - if ((pglVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC) __GLeeGetProcAddress("glVertexStream1dATI"))!=0) nLinked++; - if ((pglVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC) __GLeeGetProcAddress("glVertexStream1dvATI"))!=0) nLinked++; - if ((pglVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC) __GLeeGetProcAddress("glVertexStream2sATI"))!=0) nLinked++; - if ((pglVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC) __GLeeGetProcAddress("glVertexStream2svATI"))!=0) nLinked++; - if ((pglVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC) __GLeeGetProcAddress("glVertexStream2iATI"))!=0) nLinked++; - if ((pglVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC) __GLeeGetProcAddress("glVertexStream2ivATI"))!=0) nLinked++; - if ((pglVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC) __GLeeGetProcAddress("glVertexStream2fATI"))!=0) nLinked++; - if ((pglVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC) __GLeeGetProcAddress("glVertexStream2fvATI"))!=0) nLinked++; - if ((pglVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC) __GLeeGetProcAddress("glVertexStream2dATI"))!=0) nLinked++; - if ((pglVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC) __GLeeGetProcAddress("glVertexStream2dvATI"))!=0) nLinked++; - if ((pglVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC) __GLeeGetProcAddress("glVertexStream3sATI"))!=0) nLinked++; - if ((pglVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC) __GLeeGetProcAddress("glVertexStream3svATI"))!=0) nLinked++; - if ((pglVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC) __GLeeGetProcAddress("glVertexStream3iATI"))!=0) nLinked++; - if ((pglVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC) __GLeeGetProcAddress("glVertexStream3ivATI"))!=0) nLinked++; - if ((pglVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC) __GLeeGetProcAddress("glVertexStream3fATI"))!=0) nLinked++; - if ((pglVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC) __GLeeGetProcAddress("glVertexStream3fvATI"))!=0) nLinked++; - if ((pglVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC) __GLeeGetProcAddress("glVertexStream3dATI"))!=0) nLinked++; - if ((pglVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC) __GLeeGetProcAddress("glVertexStream3dvATI"))!=0) nLinked++; - if ((pglVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC) __GLeeGetProcAddress("glVertexStream4sATI"))!=0) nLinked++; - if ((pglVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC) __GLeeGetProcAddress("glVertexStream4svATI"))!=0) nLinked++; - if ((pglVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC) __GLeeGetProcAddress("glVertexStream4iATI"))!=0) nLinked++; - if ((pglVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC) __GLeeGetProcAddress("glVertexStream4ivATI"))!=0) nLinked++; - if ((pglVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC) __GLeeGetProcAddress("glVertexStream4fATI"))!=0) nLinked++; - if ((pglVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC) __GLeeGetProcAddress("glVertexStream4fvATI"))!=0) nLinked++; - if ((pglVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC) __GLeeGetProcAddress("glVertexStream4dATI"))!=0) nLinked++; - if ((pglVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC) __GLeeGetProcAddress("glVertexStream4dvATI"))!=0) nLinked++; - if ((pglNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC) __GLeeGetProcAddress("glNormalStream3bATI"))!=0) nLinked++; - if ((pglNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC) __GLeeGetProcAddress("glNormalStream3bvATI"))!=0) nLinked++; - if ((pglNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC) __GLeeGetProcAddress("glNormalStream3sATI"))!=0) nLinked++; - if ((pglNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC) __GLeeGetProcAddress("glNormalStream3svATI"))!=0) nLinked++; - if ((pglNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC) __GLeeGetProcAddress("glNormalStream3iATI"))!=0) nLinked++; - if ((pglNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC) __GLeeGetProcAddress("glNormalStream3ivATI"))!=0) nLinked++; - if ((pglNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC) __GLeeGetProcAddress("glNormalStream3fATI"))!=0) nLinked++; - if ((pglNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC) __GLeeGetProcAddress("glNormalStream3fvATI"))!=0) nLinked++; - if ((pglNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC) __GLeeGetProcAddress("glNormalStream3dATI"))!=0) nLinked++; - if ((pglNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC) __GLeeGetProcAddress("glNormalStream3dvATI"))!=0) nLinked++; - if ((pglClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) __GLeeGetProcAddress("glClientActiveVertexStreamATI"))!=0) nLinked++; - if ((pglVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC) __GLeeGetProcAddress("glVertexBlendEnviATI"))!=0) nLinked++; - if ((pglVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC) __GLeeGetProcAddress("glVertexBlendEnvfATI"))!=0) nLinked++; -#endif - if (nLinked==45) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_element_array(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_element_array - if ((pglElementPointerATI = (PFNGLELEMENTPOINTERATIPROC) __GLeeGetProcAddress("glElementPointerATI"))!=0) nLinked++; - if ((pglDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC) __GLeeGetProcAddress("glDrawElementArrayATI"))!=0) nLinked++; - if ((pglDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC) __GLeeGetProcAddress("glDrawRangeElementArrayATI"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SUN_mesh_array(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SUN_mesh_array - if ((pglDrawMeshArraysSUN = (PFNGLDRAWMESHARRAYSSUNPROC) __GLeeGetProcAddress("glDrawMeshArraysSUN"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SUN_slice_accum(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_multisample_filter_hint(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_depth_clamp(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_occlusion_query(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_occlusion_query - if ((pglGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC) __GLeeGetProcAddress("glGenOcclusionQueriesNV"))!=0) nLinked++; - if ((pglDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC) __GLeeGetProcAddress("glDeleteOcclusionQueriesNV"))!=0) nLinked++; - if ((pglIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC) __GLeeGetProcAddress("glIsOcclusionQueryNV"))!=0) nLinked++; - if ((pglBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC) __GLeeGetProcAddress("glBeginOcclusionQueryNV"))!=0) nLinked++; - if ((pglEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC) __GLeeGetProcAddress("glEndOcclusionQueryNV"))!=0) nLinked++; - if ((pglGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC) __GLeeGetProcAddress("glGetOcclusionQueryivNV"))!=0) nLinked++; - if ((pglGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC) __GLeeGetProcAddress("glGetOcclusionQueryuivNV"))!=0) nLinked++; -#endif - if (nLinked==7) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_point_sprite(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_point_sprite - if ((pglPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC) __GLeeGetProcAddress("glPointParameteriNV"))!=0) nLinked++; - if ((pglPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC) __GLeeGetProcAddress("glPointParameterivNV"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_texture_shader3(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_vertex_program1_1(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_shadow_funcs(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_stencil_two_side(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_stencil_two_side - if ((pglActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC) __GLeeGetProcAddress("glActiveStencilFaceEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_text_fragment_shader(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_APPLE_client_storage(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_APPLE_element_array(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_APPLE_element_array - if ((pglElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC) __GLeeGetProcAddress("glElementPointerAPPLE"))!=0) nLinked++; - if ((pglDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC) __GLeeGetProcAddress("glDrawElementArrayAPPLE"))!=0) nLinked++; - if ((pglDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) __GLeeGetProcAddress("glDrawRangeElementArrayAPPLE"))!=0) nLinked++; - if ((pglMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) __GLeeGetProcAddress("glMultiDrawElementArrayAPPLE"))!=0) nLinked++; - if ((pglMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) __GLeeGetProcAddress("glMultiDrawRangeElementArrayAPPLE"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_APPLE_fence(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_APPLE_fence - if ((pglGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC) __GLeeGetProcAddress("glGenFencesAPPLE"))!=0) nLinked++; - if ((pglDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC) __GLeeGetProcAddress("glDeleteFencesAPPLE"))!=0) nLinked++; - if ((pglSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC) __GLeeGetProcAddress("glSetFenceAPPLE"))!=0) nLinked++; - if ((pglIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC) __GLeeGetProcAddress("glIsFenceAPPLE"))!=0) nLinked++; - if ((pglTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC) __GLeeGetProcAddress("glTestFenceAPPLE"))!=0) nLinked++; - if ((pglFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC) __GLeeGetProcAddress("glFinishFenceAPPLE"))!=0) nLinked++; - if ((pglTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC) __GLeeGetProcAddress("glTestObjectAPPLE"))!=0) nLinked++; - if ((pglFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC) __GLeeGetProcAddress("glFinishObjectAPPLE"))!=0) nLinked++; -#endif - if (nLinked==8) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_APPLE_vertex_array_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_APPLE_vertex_array_object - if ((pglBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC) __GLeeGetProcAddress("glBindVertexArrayAPPLE"))!=0) nLinked++; - if ((pglDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC) __GLeeGetProcAddress("glDeleteVertexArraysAPPLE"))!=0) nLinked++; - if ((pglGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC) __GLeeGetProcAddress("glGenVertexArraysAPPLE"))!=0) nLinked++; - if ((pglIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC) __GLeeGetProcAddress("glIsVertexArrayAPPLE"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_APPLE_vertex_array_range(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_APPLE_vertex_array_range - if ((pglVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC) __GLeeGetProcAddress("glVertexArrayRangeAPPLE"))!=0) nLinked++; - if ((pglFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) __GLeeGetProcAddress("glFlushVertexArrayRangeAPPLE"))!=0) nLinked++; - if ((pglVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) __GLeeGetProcAddress("glVertexArrayParameteriAPPLE"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_APPLE_ycbcr_422(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_S3_s3tc(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ATI_draw_buffers(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_draw_buffers - if ((pglDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC) __GLeeGetProcAddress("glDrawBuffersATI"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_pixel_format_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ATI_texture_env_combine3(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ATI_texture_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_float_buffer(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_fragment_program(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_fragment_program - if ((pglProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) __GLeeGetProcAddress("glProgramNamedParameter4fNV"))!=0) nLinked++; - if ((pglProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) __GLeeGetProcAddress("glProgramNamedParameter4dNV"))!=0) nLinked++; - if ((pglProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) __GLeeGetProcAddress("glProgramNamedParameter4fvNV"))!=0) nLinked++; - if ((pglProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) __GLeeGetProcAddress("glProgramNamedParameter4dvNV"))!=0) nLinked++; - if ((pglGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetProgramNamedParameterfvNV"))!=0) nLinked++; - if ((pglGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) __GLeeGetProcAddress("glGetProgramNamedParameterdvNV"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_half_float(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_half_float - if ((pglVertex2hNV = (PFNGLVERTEX2HNVPROC) __GLeeGetProcAddress("glVertex2hNV"))!=0) nLinked++; - if ((pglVertex2hvNV = (PFNGLVERTEX2HVNVPROC) __GLeeGetProcAddress("glVertex2hvNV"))!=0) nLinked++; - if ((pglVertex3hNV = (PFNGLVERTEX3HNVPROC) __GLeeGetProcAddress("glVertex3hNV"))!=0) nLinked++; - if ((pglVertex3hvNV = (PFNGLVERTEX3HVNVPROC) __GLeeGetProcAddress("glVertex3hvNV"))!=0) nLinked++; - if ((pglVertex4hNV = (PFNGLVERTEX4HNVPROC) __GLeeGetProcAddress("glVertex4hNV"))!=0) nLinked++; - if ((pglVertex4hvNV = (PFNGLVERTEX4HVNVPROC) __GLeeGetProcAddress("glVertex4hvNV"))!=0) nLinked++; - if ((pglNormal3hNV = (PFNGLNORMAL3HNVPROC) __GLeeGetProcAddress("glNormal3hNV"))!=0) nLinked++; - if ((pglNormal3hvNV = (PFNGLNORMAL3HVNVPROC) __GLeeGetProcAddress("glNormal3hvNV"))!=0) nLinked++; - if ((pglColor3hNV = (PFNGLCOLOR3HNVPROC) __GLeeGetProcAddress("glColor3hNV"))!=0) nLinked++; - if ((pglColor3hvNV = (PFNGLCOLOR3HVNVPROC) __GLeeGetProcAddress("glColor3hvNV"))!=0) nLinked++; - if ((pglColor4hNV = (PFNGLCOLOR4HNVPROC) __GLeeGetProcAddress("glColor4hNV"))!=0) nLinked++; - if ((pglColor4hvNV = (PFNGLCOLOR4HVNVPROC) __GLeeGetProcAddress("glColor4hvNV"))!=0) nLinked++; - if ((pglTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC) __GLeeGetProcAddress("glTexCoord1hNV"))!=0) nLinked++; - if ((pglTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC) __GLeeGetProcAddress("glTexCoord1hvNV"))!=0) nLinked++; - if ((pglTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC) __GLeeGetProcAddress("glTexCoord2hNV"))!=0) nLinked++; - if ((pglTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC) __GLeeGetProcAddress("glTexCoord2hvNV"))!=0) nLinked++; - if ((pglTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC) __GLeeGetProcAddress("glTexCoord3hNV"))!=0) nLinked++; - if ((pglTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC) __GLeeGetProcAddress("glTexCoord3hvNV"))!=0) nLinked++; - if ((pglTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC) __GLeeGetProcAddress("glTexCoord4hNV"))!=0) nLinked++; - if ((pglTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC) __GLeeGetProcAddress("glTexCoord4hvNV"))!=0) nLinked++; - if ((pglMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC) __GLeeGetProcAddress("glMultiTexCoord1hNV"))!=0) nLinked++; - if ((pglMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC) __GLeeGetProcAddress("glMultiTexCoord1hvNV"))!=0) nLinked++; - if ((pglMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC) __GLeeGetProcAddress("glMultiTexCoord2hNV"))!=0) nLinked++; - if ((pglMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC) __GLeeGetProcAddress("glMultiTexCoord2hvNV"))!=0) nLinked++; - if ((pglMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC) __GLeeGetProcAddress("glMultiTexCoord3hNV"))!=0) nLinked++; - if ((pglMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC) __GLeeGetProcAddress("glMultiTexCoord3hvNV"))!=0) nLinked++; - if ((pglMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC) __GLeeGetProcAddress("glMultiTexCoord4hNV"))!=0) nLinked++; - if ((pglMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC) __GLeeGetProcAddress("glMultiTexCoord4hvNV"))!=0) nLinked++; - if ((pglFogCoordhNV = (PFNGLFOGCOORDHNVPROC) __GLeeGetProcAddress("glFogCoordhNV"))!=0) nLinked++; - if ((pglFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC) __GLeeGetProcAddress("glFogCoordhvNV"))!=0) nLinked++; - if ((pglSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC) __GLeeGetProcAddress("glSecondaryColor3hNV"))!=0) nLinked++; - if ((pglSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC) __GLeeGetProcAddress("glSecondaryColor3hvNV"))!=0) nLinked++; - if ((pglVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC) __GLeeGetProcAddress("glVertexWeighthNV"))!=0) nLinked++; - if ((pglVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC) __GLeeGetProcAddress("glVertexWeighthvNV"))!=0) nLinked++; - if ((pglVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC) __GLeeGetProcAddress("glVertexAttrib1hNV"))!=0) nLinked++; - if ((pglVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC) __GLeeGetProcAddress("glVertexAttrib1hvNV"))!=0) nLinked++; - if ((pglVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC) __GLeeGetProcAddress("glVertexAttrib2hNV"))!=0) nLinked++; - if ((pglVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC) __GLeeGetProcAddress("glVertexAttrib2hvNV"))!=0) nLinked++; - if ((pglVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC) __GLeeGetProcAddress("glVertexAttrib3hNV"))!=0) nLinked++; - if ((pglVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC) __GLeeGetProcAddress("glVertexAttrib3hvNV"))!=0) nLinked++; - if ((pglVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC) __GLeeGetProcAddress("glVertexAttrib4hNV"))!=0) nLinked++; - if ((pglVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC) __GLeeGetProcAddress("glVertexAttrib4hvNV"))!=0) nLinked++; - if ((pglVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC) __GLeeGetProcAddress("glVertexAttribs1hvNV"))!=0) nLinked++; - if ((pglVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC) __GLeeGetProcAddress("glVertexAttribs2hvNV"))!=0) nLinked++; - if ((pglVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC) __GLeeGetProcAddress("glVertexAttribs3hvNV"))!=0) nLinked++; - if ((pglVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC) __GLeeGetProcAddress("glVertexAttribs4hvNV"))!=0) nLinked++; -#endif - if (nLinked==46) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_pixel_data_range(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_pixel_data_range - if ((pglPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC) __GLeeGetProcAddress("glPixelDataRangeNV"))!=0) nLinked++; - if ((pglFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC) __GLeeGetProcAddress("glFlushPixelDataRangeNV"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_primitive_restart(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_primitive_restart - if ((pglPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC) __GLeeGetProcAddress("glPrimitiveRestartNV"))!=0) nLinked++; - if ((pglPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC) __GLeeGetProcAddress("glPrimitiveRestartIndexNV"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_texture_expand_normal(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_vertex_program2(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_ATI_map_object_buffer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_map_object_buffer - if ((pglMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glMapObjectBufferATI"))!=0) nLinked++; - if ((pglUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glUnmapObjectBufferATI"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_separate_stencil(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_separate_stencil - if ((pglStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC) __GLeeGetProcAddress("glStencilOpSeparateATI"))!=0) nLinked++; - if ((pglStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC) __GLeeGetProcAddress("glStencilFuncSeparateATI"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_ATI_vertex_attrib_array_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_ATI_vertex_attrib_array_object - if ((pglVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) __GLeeGetProcAddress("glVertexAttribArrayObjectATI"))!=0) nLinked++; - if ((pglGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) __GLeeGetProcAddress("glGetVertexAttribArrayObjectfvATI"))!=0) nLinked++; - if ((pglGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) __GLeeGetProcAddress("glGetVertexAttribArrayObjectivATI"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_OES_read_format(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_depth_bounds_test(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_depth_bounds_test - if ((pglDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC) __GLeeGetProcAddress("glDepthBoundsEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_mirror_clamp(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_blend_equation_separate(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_blend_equation_separate - if ((pglBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC) __GLeeGetProcAddress("glBlendEquationSeparateEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_MESA_pack_invert(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_MESA_ycbcr_texture(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_pixel_buffer_object(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_fragment_program_option(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_fragment_program2(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_vertex_program2_option(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_vertex_program3(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_framebuffer_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_framebuffer_object - if ((pglIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glIsRenderbufferEXT"))!=0) nLinked++; - if ((pglBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glBindRenderbufferEXT"))!=0) nLinked++; - if ((pglDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC) __GLeeGetProcAddress("glDeleteRenderbuffersEXT"))!=0) nLinked++; - if ((pglGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC) __GLeeGetProcAddress("glGenRenderbuffersEXT"))!=0) nLinked++; - if ((pglRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC) __GLeeGetProcAddress("glRenderbufferStorageEXT"))!=0) nLinked++; - if ((pglGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetRenderbufferParameterivEXT"))!=0) nLinked++; - if ((pglIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC) __GLeeGetProcAddress("glIsFramebufferEXT"))!=0) nLinked++; - if ((pglBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC) __GLeeGetProcAddress("glBindFramebufferEXT"))!=0) nLinked++; - if ((pglDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC) __GLeeGetProcAddress("glDeleteFramebuffersEXT"))!=0) nLinked++; - if ((pglGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) __GLeeGetProcAddress("glGenFramebuffersEXT"))!=0) nLinked++; - if ((pglCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) __GLeeGetProcAddress("glCheckFramebufferStatusEXT"))!=0) nLinked++; - if ((pglFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) __GLeeGetProcAddress("glFramebufferTexture1DEXT"))!=0) nLinked++; - if ((pglFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) __GLeeGetProcAddress("glFramebufferTexture2DEXT"))!=0) nLinked++; - if ((pglFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) __GLeeGetProcAddress("glFramebufferTexture3DEXT"))!=0) nLinked++; - if ((pglFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glFramebufferRenderbufferEXT"))!=0) nLinked++; - if ((pglGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetFramebufferAttachmentParameterivEXT"))!=0) nLinked++; - if ((pglGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC) __GLeeGetProcAddress("glGenerateMipmapEXT"))!=0) nLinked++; -#endif - if (nLinked==17) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_GREMEDY_string_marker(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_GREMEDY_string_marker - if ((pglStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC) __GLeeGetProcAddress("glStringMarkerGREMEDY"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_packed_depth_stencil(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_stencil_clear_tag(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_stencil_clear_tag - if ((pglStencilClearTagEXT = (PFNGLSTENCILCLEARTAGEXTPROC) __GLeeGetProcAddress("glStencilClearTagEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_sRGB(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_framebuffer_blit(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_framebuffer_blit - if ((pglBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC) __GLeeGetProcAddress("glBlitFramebufferEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_framebuffer_multisample(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_framebuffer_multisample - if ((pglRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) __GLeeGetProcAddress("glRenderbufferStorageMultisampleEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_MESAX_texture_stack(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_timer_query(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_timer_query - if ((pglGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC) __GLeeGetProcAddress("glGetQueryObjecti64vEXT"))!=0) nLinked++; - if ((pglGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC) __GLeeGetProcAddress("glGetQueryObjectui64vEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_gpu_program_parameters(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_gpu_program_parameters - if ((pglProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) __GLeeGetProcAddress("glProgramEnvParameters4fvEXT"))!=0) nLinked++; - if ((pglProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) __GLeeGetProcAddress("glProgramLocalParameters4fvEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_APPLE_flush_buffer_range(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_APPLE_flush_buffer_range - if ((pglBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC) __GLeeGetProcAddress("glBufferParameteriAPPLE"))!=0) nLinked++; - if ((pglFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) __GLeeGetProcAddress("glFlushMappedBufferRangeAPPLE"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_gpu_program4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_gpu_program4 - if ((pglProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC) __GLeeGetProcAddress("glProgramLocalParameterI4iNV"))!=0) nLinked++; - if ((pglProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) __GLeeGetProcAddress("glProgramLocalParameterI4ivNV"))!=0) nLinked++; - if ((pglProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) __GLeeGetProcAddress("glProgramLocalParametersI4ivNV"))!=0) nLinked++; - if ((pglProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) __GLeeGetProcAddress("glProgramLocalParameterI4uiNV"))!=0) nLinked++; - if ((pglProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) __GLeeGetProcAddress("glProgramLocalParameterI4uivNV"))!=0) nLinked++; - if ((pglProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) __GLeeGetProcAddress("glProgramLocalParametersI4uivNV"))!=0) nLinked++; - if ((pglProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC) __GLeeGetProcAddress("glProgramEnvParameterI4iNV"))!=0) nLinked++; - if ((pglProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC) __GLeeGetProcAddress("glProgramEnvParameterI4ivNV"))!=0) nLinked++; - if ((pglProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) __GLeeGetProcAddress("glProgramEnvParametersI4ivNV"))!=0) nLinked++; - if ((pglProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC) __GLeeGetProcAddress("glProgramEnvParameterI4uiNV"))!=0) nLinked++; - if ((pglProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) __GLeeGetProcAddress("glProgramEnvParameterI4uivNV"))!=0) nLinked++; - if ((pglProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) __GLeeGetProcAddress("glProgramEnvParametersI4uivNV"))!=0) nLinked++; - if ((pglGetProgramLocalParameterIivNV = (PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) __GLeeGetProcAddress("glGetProgramLocalParameterIivNV"))!=0) nLinked++; - if ((pglGetProgramLocalParameterIuivNV = (PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) __GLeeGetProcAddress("glGetProgramLocalParameterIuivNV"))!=0) nLinked++; - if ((pglGetProgramEnvParameterIivNV = (PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) __GLeeGetProcAddress("glGetProgramEnvParameterIivNV"))!=0) nLinked++; - if ((pglGetProgramEnvParameterIuivNV = (PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) __GLeeGetProcAddress("glGetProgramEnvParameterIuivNV"))!=0) nLinked++; -#endif - if (nLinked==16) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_geometry_program4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_geometry_program4 - if ((pglProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC) __GLeeGetProcAddress("glProgramVertexLimitNV"))!=0) nLinked++; - if ((pglFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC) __GLeeGetProcAddress("glFramebufferTextureEXT"))!=0) nLinked++; - if ((pglFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) __GLeeGetProcAddress("glFramebufferTextureLayerEXT"))!=0) nLinked++; - if ((pglFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) __GLeeGetProcAddress("glFramebufferTextureFaceEXT"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_geometry_shader4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_geometry_shader4 - if ((pglProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC) __GLeeGetProcAddress("glProgramParameteriEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_vertex_program4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_vertex_program4 - if ((pglVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC) __GLeeGetProcAddress("glVertexAttribI1iEXT"))!=0) nLinked++; - if ((pglVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC) __GLeeGetProcAddress("glVertexAttribI2iEXT"))!=0) nLinked++; - if ((pglVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC) __GLeeGetProcAddress("glVertexAttribI3iEXT"))!=0) nLinked++; - if ((pglVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC) __GLeeGetProcAddress("glVertexAttribI4iEXT"))!=0) nLinked++; - if ((pglVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC) __GLeeGetProcAddress("glVertexAttribI1uiEXT"))!=0) nLinked++; - if ((pglVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC) __GLeeGetProcAddress("glVertexAttribI2uiEXT"))!=0) nLinked++; - if ((pglVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC) __GLeeGetProcAddress("glVertexAttribI3uiEXT"))!=0) nLinked++; - if ((pglVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC) __GLeeGetProcAddress("glVertexAttribI4uiEXT"))!=0) nLinked++; - if ((pglVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC) __GLeeGetProcAddress("glVertexAttribI1ivEXT"))!=0) nLinked++; - if ((pglVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC) __GLeeGetProcAddress("glVertexAttribI2ivEXT"))!=0) nLinked++; - if ((pglVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC) __GLeeGetProcAddress("glVertexAttribI3ivEXT"))!=0) nLinked++; - if ((pglVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4ivEXT"))!=0) nLinked++; - if ((pglVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC) __GLeeGetProcAddress("glVertexAttribI1uivEXT"))!=0) nLinked++; - if ((pglVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC) __GLeeGetProcAddress("glVertexAttribI2uivEXT"))!=0) nLinked++; - if ((pglVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC) __GLeeGetProcAddress("glVertexAttribI3uivEXT"))!=0) nLinked++; - if ((pglVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4uivEXT"))!=0) nLinked++; - if ((pglVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4bvEXT"))!=0) nLinked++; - if ((pglVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4svEXT"))!=0) nLinked++; - if ((pglVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4ubvEXT"))!=0) nLinked++; - if ((pglVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4usvEXT"))!=0) nLinked++; - if ((pglVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC) __GLeeGetProcAddress("glVertexAttribIPointerEXT"))!=0) nLinked++; - if ((pglGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC) __GLeeGetProcAddress("glGetVertexAttribIivEXT"))!=0) nLinked++; - if ((pglGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC) __GLeeGetProcAddress("glGetVertexAttribIuivEXT"))!=0) nLinked++; -#endif - if (nLinked==23) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_gpu_shader4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_gpu_shader4 - if ((pglGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC) __GLeeGetProcAddress("glGetUniformuivEXT"))!=0) nLinked++; - if ((pglBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC) __GLeeGetProcAddress("glBindFragDataLocationEXT"))!=0) nLinked++; - if ((pglGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC) __GLeeGetProcAddress("glGetFragDataLocationEXT"))!=0) nLinked++; - if ((pglUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC) __GLeeGetProcAddress("glUniform1uiEXT"))!=0) nLinked++; - if ((pglUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC) __GLeeGetProcAddress("glUniform2uiEXT"))!=0) nLinked++; - if ((pglUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC) __GLeeGetProcAddress("glUniform3uiEXT"))!=0) nLinked++; - if ((pglUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC) __GLeeGetProcAddress("glUniform4uiEXT"))!=0) nLinked++; - if ((pglUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC) __GLeeGetProcAddress("glUniform1uivEXT"))!=0) nLinked++; - if ((pglUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC) __GLeeGetProcAddress("glUniform2uivEXT"))!=0) nLinked++; - if ((pglUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC) __GLeeGetProcAddress("glUniform3uivEXT"))!=0) nLinked++; - if ((pglUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC) __GLeeGetProcAddress("glUniform4uivEXT"))!=0) nLinked++; -#endif - if (nLinked==11) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_drawinstanced(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_drawinstanced - if ((pglDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC) __GLeeGetProcAddress("glDrawArraysInstancedEXT"))!=0) nLinked++; - if ((pglDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC) __GLeeGetProcAddress("glDrawElementsInstancedEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_packed_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_array(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_buffer_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_texture_buffer_object - if ((pglTexBufferEXT = (PFNGLTEXBUFFEREXTPROC) __GLeeGetProcAddress("glTexBufferEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_compression_latc(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_compression_rgtc(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_shared_exponent(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_depth_buffer_float(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_depth_buffer_float - if ((pglDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC) __GLeeGetProcAddress("glDepthRangedNV"))!=0) nLinked++; - if ((pglClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC) __GLeeGetProcAddress("glClearDepthdNV"))!=0) nLinked++; - if ((pglDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC) __GLeeGetProcAddress("glDepthBoundsdNV"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_fragment_program4(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_framebuffer_multisample_coverage(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_framebuffer_multisample_coverage - if ((pglRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) __GLeeGetProcAddress("glRenderbufferStorageMultisampleCoverageNV"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_framebuffer_sRGB(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_geometry_shader4(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_NV_parameter_buffer_object(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_parameter_buffer_object - if ((pglProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) __GLeeGetProcAddress("glProgramBufferParametersfvNV"))!=0) nLinked++; - if ((pglProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) __GLeeGetProcAddress("glProgramBufferParametersIivNV"))!=0) nLinked++; - if ((pglProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) __GLeeGetProcAddress("glProgramBufferParametersIuivNV"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_draw_buffers2(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_draw_buffers2 - if ((pglColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC) __GLeeGetProcAddress("glColorMaskIndexedEXT"))!=0) nLinked++; - if ((pglGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetBooleanIndexedvEXT"))!=0) nLinked++; - if ((pglGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetIntegerIndexedvEXT"))!=0) nLinked++; - if ((pglEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC) __GLeeGetProcAddress("glEnableIndexedEXT"))!=0) nLinked++; - if ((pglDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC) __GLeeGetProcAddress("glDisableIndexedEXT"))!=0) nLinked++; - if ((pglIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC) __GLeeGetProcAddress("glIsEnabledIndexedEXT"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_transform_feedback(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_transform_feedback - if ((pglBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC) __GLeeGetProcAddress("glBeginTransformFeedbackNV"))!=0) nLinked++; - if ((pglEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC) __GLeeGetProcAddress("glEndTransformFeedbackNV"))!=0) nLinked++; - if ((pglTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) __GLeeGetProcAddress("glTransformFeedbackAttribsNV"))!=0) nLinked++; - if ((pglBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC) __GLeeGetProcAddress("glBindBufferRangeNV"))!=0) nLinked++; - if ((pglBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC) __GLeeGetProcAddress("glBindBufferOffsetNV"))!=0) nLinked++; - if ((pglBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC) __GLeeGetProcAddress("glBindBufferBaseNV"))!=0) nLinked++; - if ((pglTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) __GLeeGetProcAddress("glTransformFeedbackVaryingsNV"))!=0) nLinked++; - if ((pglActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC) __GLeeGetProcAddress("glActiveVaryingNV"))!=0) nLinked++; - if ((pglGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC) __GLeeGetProcAddress("glGetVaryingLocationNV"))!=0) nLinked++; - if ((pglGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC) __GLeeGetProcAddress("glGetActiveVaryingNV"))!=0) nLinked++; - if ((pglGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) __GLeeGetProcAddress("glGetTransformFeedbackVaryingNV"))!=0) nLinked++; -#endif - if (nLinked==11) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_bindable_uniform(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_bindable_uniform - if ((pglUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC) __GLeeGetProcAddress("glUniformBufferEXT"))!=0) nLinked++; - if ((pglGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC) __GLeeGetProcAddress("glGetUniformBufferSizeEXT"))!=0) nLinked++; - if ((pglGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC) __GLeeGetProcAddress("glGetUniformOffsetEXT"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_integer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_texture_integer - if ((pglTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glTexParameterIivEXT"))!=0) nLinked++; - if ((pglTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glTexParameterIuivEXT"))!=0) nLinked++; - if ((pglGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glGetTexParameterIivEXT"))!=0) nLinked++; - if ((pglGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glGetTexParameterIuivEXT"))!=0) nLinked++; - if ((pglClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC) __GLeeGetProcAddress("glClearColorIiEXT"))!=0) nLinked++; - if ((pglClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC) __GLeeGetProcAddress("glClearColorIuiEXT"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_GREMEDY_frame_terminator(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_GREMEDY_frame_terminator - if ((pglFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC) __GLeeGetProcAddress("glFrameTerminatorGREMEDY"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_conditional_render(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_NV_conditional_render - if ((pglBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC) __GLeeGetProcAddress("glBeginConditionalRenderNV"))!=0) nLinked++; - if ((pglEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC) __GLeeGetProcAddress("glEndConditionalRenderNV"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_NV_present_video(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_transform_feedback(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_transform_feedback - if ((pglBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) __GLeeGetProcAddress("glBeginTransformFeedbackEXT"))!=0) nLinked++; - if ((pglEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC) __GLeeGetProcAddress("glEndTransformFeedbackEXT"))!=0) nLinked++; - if ((pglBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC) __GLeeGetProcAddress("glBindBufferRangeEXT"))!=0) nLinked++; - if ((pglBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC) __GLeeGetProcAddress("glBindBufferOffsetEXT"))!=0) nLinked++; - if ((pglBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC) __GLeeGetProcAddress("glBindBufferBaseEXT"))!=0) nLinked++; - if ((pglTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) __GLeeGetProcAddress("glTransformFeedbackVaryingsEXT"))!=0) nLinked++; - if ((pglGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) __GLeeGetProcAddress("glGetTransformFeedbackVaryingEXT"))!=0) nLinked++; -#endif - if (nLinked==7) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_direct_state_access(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_direct_state_access - if ((pglClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC) __GLeeGetProcAddress("glClientAttribDefaultEXT"))!=0) nLinked++; - if ((pglPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) __GLeeGetProcAddress("glPushClientAttribDefaultEXT"))!=0) nLinked++; - if ((pglMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC) __GLeeGetProcAddress("glMatrixLoadfEXT"))!=0) nLinked++; - if ((pglMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC) __GLeeGetProcAddress("glMatrixLoaddEXT"))!=0) nLinked++; - if ((pglMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC) __GLeeGetProcAddress("glMatrixMultfEXT"))!=0) nLinked++; - if ((pglMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC) __GLeeGetProcAddress("glMatrixMultdEXT"))!=0) nLinked++; - if ((pglMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC) __GLeeGetProcAddress("glMatrixLoadIdentityEXT"))!=0) nLinked++; - if ((pglMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC) __GLeeGetProcAddress("glMatrixRotatefEXT"))!=0) nLinked++; - if ((pglMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC) __GLeeGetProcAddress("glMatrixRotatedEXT"))!=0) nLinked++; - if ((pglMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC) __GLeeGetProcAddress("glMatrixScalefEXT"))!=0) nLinked++; - if ((pglMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC) __GLeeGetProcAddress("glMatrixScaledEXT"))!=0) nLinked++; - if ((pglMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC) __GLeeGetProcAddress("glMatrixTranslatefEXT"))!=0) nLinked++; - if ((pglMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC) __GLeeGetProcAddress("glMatrixTranslatedEXT"))!=0) nLinked++; - if ((pglMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC) __GLeeGetProcAddress("glMatrixFrustumEXT"))!=0) nLinked++; - if ((pglMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC) __GLeeGetProcAddress("glMatrixOrthoEXT"))!=0) nLinked++; - if ((pglMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC) __GLeeGetProcAddress("glMatrixPopEXT"))!=0) nLinked++; - if ((pglMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC) __GLeeGetProcAddress("glMatrixPushEXT"))!=0) nLinked++; - if ((pglMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC) __GLeeGetProcAddress("glMatrixLoadTransposefEXT"))!=0) nLinked++; - if ((pglMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC) __GLeeGetProcAddress("glMatrixLoadTransposedEXT"))!=0) nLinked++; - if ((pglMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC) __GLeeGetProcAddress("glMatrixMultTransposefEXT"))!=0) nLinked++; - if ((pglMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC) __GLeeGetProcAddress("glMatrixMultTransposedEXT"))!=0) nLinked++; - if ((pglTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC) __GLeeGetProcAddress("glTextureParameterfEXT"))!=0) nLinked++; - if ((pglTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC) __GLeeGetProcAddress("glTextureParameterfvEXT"))!=0) nLinked++; - if ((pglTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC) __GLeeGetProcAddress("glTextureParameteriEXT"))!=0) nLinked++; - if ((pglTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC) __GLeeGetProcAddress("glTextureParameterivEXT"))!=0) nLinked++; - if ((pglTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC) __GLeeGetProcAddress("glTextureImage1DEXT"))!=0) nLinked++; - if ((pglTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC) __GLeeGetProcAddress("glTextureImage2DEXT"))!=0) nLinked++; - if ((pglTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glTextureSubImage1DEXT"))!=0) nLinked++; - if ((pglTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glTextureSubImage2DEXT"))!=0) nLinked++; - if ((pglCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyTextureImage1DEXT"))!=0) nLinked++; - if ((pglCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyTextureImage2DEXT"))!=0) nLinked++; - if ((pglCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyTextureSubImage1DEXT"))!=0) nLinked++; - if ((pglCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyTextureSubImage2DEXT"))!=0) nLinked++; - if ((pglGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC) __GLeeGetProcAddress("glGetTextureImageEXT"))!=0) nLinked++; - if ((pglGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetTextureParameterfvEXT"))!=0) nLinked++; - if ((pglGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetTextureParameterivEXT"))!=0) nLinked++; - if ((pglGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetTextureLevelParameterfvEXT"))!=0) nLinked++; - if ((pglGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetTextureLevelParameterivEXT"))!=0) nLinked++; - if ((pglTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC) __GLeeGetProcAddress("glTextureImage3DEXT"))!=0) nLinked++; - if ((pglTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glTextureSubImage3DEXT"))!=0) nLinked++; - if ((pglCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCopyTextureSubImage3DEXT"))!=0) nLinked++; - if ((pglMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC) __GLeeGetProcAddress("glMultiTexParameterfEXT"))!=0) nLinked++; - if ((pglMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC) __GLeeGetProcAddress("glMultiTexParameterfvEXT"))!=0) nLinked++; - if ((pglMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC) __GLeeGetProcAddress("glMultiTexParameteriEXT"))!=0) nLinked++; - if ((pglMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC) __GLeeGetProcAddress("glMultiTexParameterivEXT"))!=0) nLinked++; - if ((pglMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC) __GLeeGetProcAddress("glMultiTexImage1DEXT"))!=0) nLinked++; - if ((pglMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC) __GLeeGetProcAddress("glMultiTexImage2DEXT"))!=0) nLinked++; - if ((pglMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glMultiTexSubImage1DEXT"))!=0) nLinked++; - if ((pglMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glMultiTexSubImage2DEXT"))!=0) nLinked++; - if ((pglCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexImage1DEXT"))!=0) nLinked++; - if ((pglCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexImage2DEXT"))!=0) nLinked++; - if ((pglCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexSubImage1DEXT"))!=0) nLinked++; - if ((pglCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexSubImage2DEXT"))!=0) nLinked++; - if ((pglGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC) __GLeeGetProcAddress("glGetMultiTexImageEXT"))!=0) nLinked++; - if ((pglGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetMultiTexParameterfvEXT"))!=0) nLinked++; - if ((pglGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexParameterivEXT"))!=0) nLinked++; - if ((pglGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetMultiTexLevelParameterfvEXT"))!=0) nLinked++; - if ((pglGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexLevelParameterivEXT"))!=0) nLinked++; - if ((pglMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC) __GLeeGetProcAddress("glMultiTexImage3DEXT"))!=0) nLinked++; - if ((pglMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glMultiTexSubImage3DEXT"))!=0) nLinked++; - if ((pglCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexSubImage3DEXT"))!=0) nLinked++; - if ((pglBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC) __GLeeGetProcAddress("glBindMultiTextureEXT"))!=0) nLinked++; - if ((pglEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) __GLeeGetProcAddress("glEnableClientStateIndexedEXT"))!=0) nLinked++; - if ((pglDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) __GLeeGetProcAddress("glDisableClientStateIndexedEXT"))!=0) nLinked++; - if ((pglMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC) __GLeeGetProcAddress("glMultiTexCoordPointerEXT"))!=0) nLinked++; - if ((pglMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC) __GLeeGetProcAddress("glMultiTexEnvfEXT"))!=0) nLinked++; - if ((pglMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC) __GLeeGetProcAddress("glMultiTexEnvfvEXT"))!=0) nLinked++; - if ((pglMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC) __GLeeGetProcAddress("glMultiTexEnviEXT"))!=0) nLinked++; - if ((pglMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC) __GLeeGetProcAddress("glMultiTexEnvivEXT"))!=0) nLinked++; - if ((pglMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC) __GLeeGetProcAddress("glMultiTexGendEXT"))!=0) nLinked++; - if ((pglMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC) __GLeeGetProcAddress("glMultiTexGendvEXT"))!=0) nLinked++; - if ((pglMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC) __GLeeGetProcAddress("glMultiTexGenfEXT"))!=0) nLinked++; - if ((pglMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC) __GLeeGetProcAddress("glMultiTexGenfvEXT"))!=0) nLinked++; - if ((pglMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC) __GLeeGetProcAddress("glMultiTexGeniEXT"))!=0) nLinked++; - if ((pglMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC) __GLeeGetProcAddress("glMultiTexGenivEXT"))!=0) nLinked++; - if ((pglGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC) __GLeeGetProcAddress("glGetMultiTexEnvfvEXT"))!=0) nLinked++; - if ((pglGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexEnvivEXT"))!=0) nLinked++; - if ((pglGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC) __GLeeGetProcAddress("glGetMultiTexGendvEXT"))!=0) nLinked++; - if ((pglGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC) __GLeeGetProcAddress("glGetMultiTexGenfvEXT"))!=0) nLinked++; - if ((pglGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexGenivEXT"))!=0) nLinked++; - if ((pglGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetFloatIndexedvEXT"))!=0) nLinked++; - if ((pglGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetDoubleIndexedvEXT"))!=0) nLinked++; - if ((pglGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetPointerIndexedvEXT"))!=0) nLinked++; - if ((pglCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) __GLeeGetProcAddress("glCompressedTextureImage3DEXT"))!=0) nLinked++; - if ((pglCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) __GLeeGetProcAddress("glCompressedTextureImage2DEXT"))!=0) nLinked++; - if ((pglCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) __GLeeGetProcAddress("glCompressedTextureImage1DEXT"))!=0) nLinked++; - if ((pglCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCompressedTextureSubImage3DEXT"))!=0) nLinked++; - if ((pglCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCompressedTextureSubImage2DEXT"))!=0) nLinked++; - if ((pglCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCompressedTextureSubImage1DEXT"))!=0) nLinked++; - if ((pglGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) __GLeeGetProcAddress("glGetCompressedTextureImageEXT"))!=0) nLinked++; - if ((pglCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexImage3DEXT"))!=0) nLinked++; - if ((pglCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexImage2DEXT"))!=0) nLinked++; - if ((pglCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexImage1DEXT"))!=0) nLinked++; - if ((pglCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexSubImage3DEXT"))!=0) nLinked++; - if ((pglCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexSubImage2DEXT"))!=0) nLinked++; - if ((pglCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexSubImage1DEXT"))!=0) nLinked++; - if ((pglGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) __GLeeGetProcAddress("glGetCompressedMultiTexImageEXT"))!=0) nLinked++; - if ((pglNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC) __GLeeGetProcAddress("glNamedProgramStringEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameter4dEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameter4dvEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameter4fEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameter4fvEXT"))!=0) nLinked++; - if ((pglGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramLocalParameterdvEXT"))!=0) nLinked++; - if ((pglGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramLocalParameterfvEXT"))!=0) nLinked++; - if ((pglGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramivEXT"))!=0) nLinked++; - if ((pglGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) __GLeeGetProcAddress("glGetNamedProgramStringEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameters4fvEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameterI4iEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameterI4ivEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParametersI4ivEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameterI4uiEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameterI4uivEXT"))!=0) nLinked++; - if ((pglNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParametersI4uivEXT"))!=0) nLinked++; - if ((pglGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramLocalParameterIivEXT"))!=0) nLinked++; - if ((pglGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramLocalParameterIuivEXT"))!=0) nLinked++; - if ((pglTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glTextureParameterIivEXT"))!=0) nLinked++; - if ((pglTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glTextureParameterIuivEXT"))!=0) nLinked++; - if ((pglGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glGetTextureParameterIivEXT"))!=0) nLinked++; - if ((pglGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glGetTextureParameterIuivEXT"))!=0) nLinked++; - if ((pglMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glMultiTexParameterIivEXT"))!=0) nLinked++; - if ((pglMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glMultiTexParameterIuivEXT"))!=0) nLinked++; - if ((pglGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexParameterIivEXT"))!=0) nLinked++; - if ((pglGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexParameterIuivEXT"))!=0) nLinked++; - if ((pglProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC) __GLeeGetProcAddress("glProgramUniform1fEXT"))!=0) nLinked++; - if ((pglProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC) __GLeeGetProcAddress("glProgramUniform2fEXT"))!=0) nLinked++; - if ((pglProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC) __GLeeGetProcAddress("glProgramUniform3fEXT"))!=0) nLinked++; - if ((pglProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC) __GLeeGetProcAddress("glProgramUniform4fEXT"))!=0) nLinked++; - if ((pglProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC) __GLeeGetProcAddress("glProgramUniform1iEXT"))!=0) nLinked++; - if ((pglProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC) __GLeeGetProcAddress("glProgramUniform2iEXT"))!=0) nLinked++; - if ((pglProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC) __GLeeGetProcAddress("glProgramUniform3iEXT"))!=0) nLinked++; - if ((pglProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC) __GLeeGetProcAddress("glProgramUniform4iEXT"))!=0) nLinked++; - if ((pglProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC) __GLeeGetProcAddress("glProgramUniform1fvEXT"))!=0) nLinked++; - if ((pglProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC) __GLeeGetProcAddress("glProgramUniform2fvEXT"))!=0) nLinked++; - if ((pglProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC) __GLeeGetProcAddress("glProgramUniform3fvEXT"))!=0) nLinked++; - if ((pglProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC) __GLeeGetProcAddress("glProgramUniform4fvEXT"))!=0) nLinked++; - if ((pglProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC) __GLeeGetProcAddress("glProgramUniform1ivEXT"))!=0) nLinked++; - if ((pglProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC) __GLeeGetProcAddress("glProgramUniform2ivEXT"))!=0) nLinked++; - if ((pglProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC) __GLeeGetProcAddress("glProgramUniform3ivEXT"))!=0) nLinked++; - if ((pglProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC) __GLeeGetProcAddress("glProgramUniform4ivEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix2fvEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix3fvEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix4fvEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix2x3fvEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix3x2fvEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix2x4fvEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix4x2fvEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix3x4fvEXT"))!=0) nLinked++; - if ((pglProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix4x3fvEXT"))!=0) nLinked++; - if ((pglProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC) __GLeeGetProcAddress("glProgramUniform1uiEXT"))!=0) nLinked++; - if ((pglProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC) __GLeeGetProcAddress("glProgramUniform2uiEXT"))!=0) nLinked++; - if ((pglProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC) __GLeeGetProcAddress("glProgramUniform3uiEXT"))!=0) nLinked++; - if ((pglProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC) __GLeeGetProcAddress("glProgramUniform4uiEXT"))!=0) nLinked++; - if ((pglProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC) __GLeeGetProcAddress("glProgramUniform1uivEXT"))!=0) nLinked++; - if ((pglProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC) __GLeeGetProcAddress("glProgramUniform2uivEXT"))!=0) nLinked++; - if ((pglProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC) __GLeeGetProcAddress("glProgramUniform3uivEXT"))!=0) nLinked++; - if ((pglProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC) __GLeeGetProcAddress("glProgramUniform4uivEXT"))!=0) nLinked++; - if ((pglNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC) __GLeeGetProcAddress("glNamedBufferDataEXT"))!=0) nLinked++; - if ((pglNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC) __GLeeGetProcAddress("glNamedBufferSubDataEXT"))!=0) nLinked++; - if ((pglMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC) __GLeeGetProcAddress("glMapNamedBufferEXT"))!=0) nLinked++; - if ((pglUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC) __GLeeGetProcAddress("glUnmapNamedBufferEXT"))!=0) nLinked++; - if ((pglGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetNamedBufferParameterivEXT"))!=0) nLinked++; - if ((pglGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) __GLeeGetProcAddress("glGetNamedBufferPointervEXT"))!=0) nLinked++; - if ((pglGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) __GLeeGetProcAddress("glGetNamedBufferSubDataEXT"))!=0) nLinked++; - if ((pglTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC) __GLeeGetProcAddress("glTextureBufferEXT"))!=0) nLinked++; - if ((pglMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC) __GLeeGetProcAddress("glMultiTexBufferEXT"))!=0) nLinked++; - if ((pglNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) __GLeeGetProcAddress("glNamedRenderbufferStorageEXT"))!=0) nLinked++; - if ((pglGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetNamedRenderbufferParameterivEXT"))!=0) nLinked++; - if ((pglCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) __GLeeGetProcAddress("glCheckNamedFramebufferStatusEXT"))!=0) nLinked++; - if ((pglNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTexture1DEXT"))!=0) nLinked++; - if ((pglNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTexture2DEXT"))!=0) nLinked++; - if ((pglNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTexture3DEXT"))!=0) nLinked++; - if ((pglNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glNamedFramebufferRenderbufferEXT"))!=0) nLinked++; - if ((pglGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetNamedFramebufferAttachmentParameterivEXT"))!=0) nLinked++; - if ((pglGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC) __GLeeGetProcAddress("glGenerateTextureMipmapEXT"))!=0) nLinked++; - if ((pglGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC) __GLeeGetProcAddress("glGenerateMultiTexMipmapEXT"))!=0) nLinked++; - if ((pglFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) __GLeeGetProcAddress("glFramebufferDrawBufferEXT"))!=0) nLinked++; - if ((pglFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) __GLeeGetProcAddress("glFramebufferDrawBuffersEXT"))!=0) nLinked++; - if ((pglFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC) __GLeeGetProcAddress("glFramebufferReadBufferEXT"))!=0) nLinked++; - if ((pglGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetFramebufferParameterivEXT"))!=0) nLinked++; - if ((pglNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) __GLeeGetProcAddress("glNamedRenderbufferStorageMultisampleEXT"))!=0) nLinked++; - if ((pglNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) __GLeeGetProcAddress("glNamedRenderbufferStorageMultisampleCoverageEXT"))!=0) nLinked++; - if ((pglNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTextureEXT"))!=0) nLinked++; - if ((pglNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) __GLeeGetProcAddress("glNamedFramebufferTextureLayerEXT"))!=0) nLinked++; - if ((pglNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTextureFaceEXT"))!=0) nLinked++; - if ((pglTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC) __GLeeGetProcAddress("glTextureRenderbufferEXT"))!=0) nLinked++; - if ((pglMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glMultiTexRenderbufferEXT"))!=0) nLinked++; -#endif - if (nLinked==186) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_vertex_array_bgra(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_texture_select(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_INGR_blend_func_separate(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_INGR_blend_func_separate - if ((pglBlendFuncSeparateINGR = (PFNGLBLENDFUNCSEPARATEINGRPROC) __GLeeGetProcAddress("glBlendFuncSeparateINGR"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_depth_pass_instrument(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_igloo_interface(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_SGIX_igloo_interface - if ((pglIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC) __GLeeGetProcAddress("glIglooInterfaceSGIX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_fragment_lighting(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_fragment_lighting - if ((pglFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC) __GLeeGetProcAddress("glFragmentLightModeliEXT"))!=0) nLinked++; - if ((pglFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC) __GLeeGetProcAddress("glFragmentLightModelfEXT"))!=0) nLinked++; - if ((pglFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC) __GLeeGetProcAddress("glFragmentLightModelivEXT"))!=0) nLinked++; - if ((pglFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC) __GLeeGetProcAddress("glFragmentLightModelfvEXT"))!=0) nLinked++; - if ((pglFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC) __GLeeGetProcAddress("glFragmentLightiEXT"))!=0) nLinked++; - if ((pglFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC) __GLeeGetProcAddress("glFragmentLightfEXT"))!=0) nLinked++; - if ((pglFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC) __GLeeGetProcAddress("glFragmentLightivEXT"))!=0) nLinked++; - if ((pglFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC) __GLeeGetProcAddress("glFragmentLightfvEXT"))!=0) nLinked++; - if ((pglGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC) __GLeeGetProcAddress("glGetFragmentLightivEXT"))!=0) nLinked++; - if ((pglGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC) __GLeeGetProcAddress("glGetFragmentLightfvEXT"))!=0) nLinked++; - if ((pglFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC) __GLeeGetProcAddress("glFragmentMaterialfEXT"))!=0) nLinked++; - if ((pglFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC) __GLeeGetProcAddress("glFragmentMaterialiEXT"))!=0) nLinked++; - if ((pglFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC) __GLeeGetProcAddress("glFragmentMaterialfvEXT"))!=0) nLinked++; - if ((pglFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC) __GLeeGetProcAddress("glFragmentMaterialivEXT"))!=0) nLinked++; - if ((pglFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC) __GLeeGetProcAddress("glFragmentColorMaterialEXT"))!=0) nLinked++; - if ((pglGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC) __GLeeGetProcAddress("glGetFragmentMaterialfvEXT"))!=0) nLinked++; - if ((pglGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC) __GLeeGetProcAddress("glGetFragmentMaterialivEXT"))!=0) nLinked++; - if ((pglLightEnviEXT = (PFNGLLIGHTENVIEXTPROC) __GLeeGetProcAddress("glLightEnviEXT"))!=0) nLinked++; -#endif - if (nLinked==18) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_scene_marker(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_EXT_scene_marker - if ((pglBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC) __GLeeGetProcAddress("glBeginSceneEXT"))!=0) nLinked++; - if ((pglEndSceneEXT = (PFNGLENDSCENEEXTPROC) __GLeeGetProcAddress("glEndSceneEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_EXT_texture_compression_dxt1(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_EXT_texture_env(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_IBM_static_data(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_OES_byte_coordinates(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_OES_compressed_paletted_texture(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_OES_single_precision(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GL_OES_single_precision - if ((pglDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC) __GLeeGetProcAddress("glDepthRangefOES"))!=0) nLinked++; - if ((pglFrustumfOES = (PFNGLFRUSTUMFOESPROC) __GLeeGetProcAddress("glFrustumfOES"))!=0) nLinked++; - if ((pglOrthofOES = (PFNGLORTHOFOESPROC) __GLeeGetProcAddress("glOrthofOES"))!=0) nLinked++; - if ((pglClipPlanefOES = (PFNGLCLIPPLANEFOESPROC) __GLeeGetProcAddress("glClipPlanefOES"))!=0) nLinked++; - if ((pglGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC) __GLeeGetProcAddress("glGetClipPlanefOES"))!=0) nLinked++; - if ((pglClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC) __GLeeGetProcAddress("glClearDepthfOES"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GL_SGIX_pixel_texture_bits(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GL_SGIX_texture_range(void) {return GLEE_LINK_COMPLETE;} - -GLEE_LINK_FUNCTION __GLeeGLLoadFunction[322]; - -void initGLLoadFunctions(void) -{ - __GLeeGLLoadFunction[0]=__GLeeLink_GL_VERSION_1_2; - __GLeeGLLoadFunction[1]=__GLeeLink_GL_ARB_imaging; - __GLeeGLLoadFunction[2]=__GLeeLink_GL_VERSION_1_3; - __GLeeGLLoadFunction[3]=__GLeeLink_GL_VERSION_1_4; - __GLeeGLLoadFunction[4]=__GLeeLink_GL_VERSION_1_5; - __GLeeGLLoadFunction[5]=__GLeeLink_GL_VERSION_2_0; - __GLeeGLLoadFunction[6]=__GLeeLink_GL_VERSION_2_1; - __GLeeGLLoadFunction[7]=__GLeeLink_GL_VERSION_3_0; - __GLeeGLLoadFunction[8]=__GLeeLink_GL_ARB_multitexture; - __GLeeGLLoadFunction[9]=__GLeeLink_GL_ARB_transpose_matrix; - __GLeeGLLoadFunction[10]=__GLeeLink_GL_ARB_multisample; - __GLeeGLLoadFunction[11]=__GLeeLink_GL_ARB_texture_env_add; - __GLeeGLLoadFunction[12]=__GLeeLink_GL_ARB_texture_cube_map; - __GLeeGLLoadFunction[13]=__GLeeLink_GL_ARB_texture_compression; - __GLeeGLLoadFunction[14]=__GLeeLink_GL_ARB_texture_border_clamp; - __GLeeGLLoadFunction[15]=__GLeeLink_GL_ARB_point_parameters; - __GLeeGLLoadFunction[16]=__GLeeLink_GL_ARB_vertex_blend; - __GLeeGLLoadFunction[17]=__GLeeLink_GL_ARB_matrix_palette; - __GLeeGLLoadFunction[18]=__GLeeLink_GL_ARB_texture_env_combine; - __GLeeGLLoadFunction[19]=__GLeeLink_GL_ARB_texture_env_crossbar; - __GLeeGLLoadFunction[20]=__GLeeLink_GL_ARB_texture_env_dot3; - __GLeeGLLoadFunction[21]=__GLeeLink_GL_ARB_texture_mirrored_repeat; - __GLeeGLLoadFunction[22]=__GLeeLink_GL_ARB_depth_texture; - __GLeeGLLoadFunction[23]=__GLeeLink_GL_ARB_shadow; - __GLeeGLLoadFunction[24]=__GLeeLink_GL_ARB_shadow_ambient; - __GLeeGLLoadFunction[25]=__GLeeLink_GL_ARB_window_pos; - __GLeeGLLoadFunction[26]=__GLeeLink_GL_ARB_vertex_program; - __GLeeGLLoadFunction[27]=__GLeeLink_GL_ARB_fragment_program; - __GLeeGLLoadFunction[28]=__GLeeLink_GL_ARB_vertex_buffer_object; - __GLeeGLLoadFunction[29]=__GLeeLink_GL_ARB_occlusion_query; - __GLeeGLLoadFunction[30]=__GLeeLink_GL_ARB_shader_objects; - __GLeeGLLoadFunction[31]=__GLeeLink_GL_ARB_vertex_shader; - __GLeeGLLoadFunction[32]=__GLeeLink_GL_ARB_fragment_shader; - __GLeeGLLoadFunction[33]=__GLeeLink_GL_ARB_shading_language_100; - __GLeeGLLoadFunction[34]=__GLeeLink_GL_ARB_texture_non_power_of_two; - __GLeeGLLoadFunction[35]=__GLeeLink_GL_ARB_point_sprite; - __GLeeGLLoadFunction[36]=__GLeeLink_GL_ARB_fragment_program_shadow; - __GLeeGLLoadFunction[37]=__GLeeLink_GL_ARB_draw_buffers; - __GLeeGLLoadFunction[38]=__GLeeLink_GL_ARB_texture_rectangle; - __GLeeGLLoadFunction[39]=__GLeeLink_GL_ARB_color_buffer_float; - __GLeeGLLoadFunction[40]=__GLeeLink_GL_ARB_half_float_pixel; - __GLeeGLLoadFunction[41]=__GLeeLink_GL_ARB_texture_float; - __GLeeGLLoadFunction[42]=__GLeeLink_GL_ARB_pixel_buffer_object; - __GLeeGLLoadFunction[43]=__GLeeLink_GL_ARB_depth_buffer_float; - __GLeeGLLoadFunction[44]=__GLeeLink_GL_ARB_drawinstanced; - __GLeeGLLoadFunction[45]=__GLeeLink_GL_ARB_framebuffer_object; - __GLeeGLLoadFunction[46]=__GLeeLink_GL_ARB_framebuffer_sRGB; - __GLeeGLLoadFunction[47]=__GLeeLink_GL_ARB_geometry_shader4; - __GLeeGLLoadFunction[48]=__GLeeLink_GL_ARB_half_float_vertex; - __GLeeGLLoadFunction[49]=__GLeeLink_GL_ARBinstanced_arrays; - __GLeeGLLoadFunction[50]=__GLeeLink_GL_ARB_map_buffer_range; - __GLeeGLLoadFunction[51]=__GLeeLink_GL_ARB_texture_buffer_object; - __GLeeGLLoadFunction[52]=__GLeeLink_GL_ARB_texture_compression_rgtc; - __GLeeGLLoadFunction[53]=__GLeeLink_GL_ARB_texture_rg; - __GLeeGLLoadFunction[54]=__GLeeLink_GL_ARB_vertex_array_object; - __GLeeGLLoadFunction[55]=__GLeeLink_GL_EXT_abgr; - __GLeeGLLoadFunction[56]=__GLeeLink_GL_EXT_blend_color; - __GLeeGLLoadFunction[57]=__GLeeLink_GL_EXT_polygon_offset; - __GLeeGLLoadFunction[58]=__GLeeLink_GL_EXT_texture; - __GLeeGLLoadFunction[59]=__GLeeLink_GL_EXT_texture3D; - __GLeeGLLoadFunction[60]=__GLeeLink_GL_SGIS_texture_filter4; - __GLeeGLLoadFunction[61]=__GLeeLink_GL_EXT_subtexture; - __GLeeGLLoadFunction[62]=__GLeeLink_GL_EXT_copy_texture; - __GLeeGLLoadFunction[63]=__GLeeLink_GL_EXT_histogram; - __GLeeGLLoadFunction[64]=__GLeeLink_GL_EXT_convolution; - __GLeeGLLoadFunction[65]=__GLeeLink_GL_SGI_color_matrix; - __GLeeGLLoadFunction[66]=__GLeeLink_GL_SGI_color_table; - __GLeeGLLoadFunction[67]=__GLeeLink_GL_SGIS_pixel_texture; - __GLeeGLLoadFunction[68]=__GLeeLink_GL_SGIX_pixel_texture; - __GLeeGLLoadFunction[69]=__GLeeLink_GL_SGIS_texture4D; - __GLeeGLLoadFunction[70]=__GLeeLink_GL_SGI_texture_color_table; - __GLeeGLLoadFunction[71]=__GLeeLink_GL_EXT_cmyka; - __GLeeGLLoadFunction[72]=__GLeeLink_GL_EXT_texture_object; - __GLeeGLLoadFunction[73]=__GLeeLink_GL_SGIS_detail_texture; - __GLeeGLLoadFunction[74]=__GLeeLink_GL_SGIS_sharpen_texture; - __GLeeGLLoadFunction[75]=__GLeeLink_GL_EXT_packed_pixels; - __GLeeGLLoadFunction[76]=__GLeeLink_GL_SGIS_texture_lod; - __GLeeGLLoadFunction[77]=__GLeeLink_GL_SGIS_multisample; - __GLeeGLLoadFunction[78]=__GLeeLink_GL_EXT_rescale_normal; - __GLeeGLLoadFunction[79]=__GLeeLink_GL_EXT_vertex_array; - __GLeeGLLoadFunction[80]=__GLeeLink_GL_EXT_misc_attribute; - __GLeeGLLoadFunction[81]=__GLeeLink_GL_SGIS_generate_mipmap; - __GLeeGLLoadFunction[82]=__GLeeLink_GL_SGIX_clipmap; - __GLeeGLLoadFunction[83]=__GLeeLink_GL_SGIX_shadow; - __GLeeGLLoadFunction[84]=__GLeeLink_GL_SGIS_texture_edge_clamp; - __GLeeGLLoadFunction[85]=__GLeeLink_GL_SGIS_texture_border_clamp; - __GLeeGLLoadFunction[86]=__GLeeLink_GL_EXT_blend_minmax; - __GLeeGLLoadFunction[87]=__GLeeLink_GL_EXT_blend_subtract; - __GLeeGLLoadFunction[88]=__GLeeLink_GL_EXT_blend_logic_op; - __GLeeGLLoadFunction[89]=__GLeeLink_GL_SGIX_interlace; - __GLeeGLLoadFunction[90]=__GLeeLink_GL_SGIX_pixel_tiles; - __GLeeGLLoadFunction[91]=__GLeeLink_GL_SGIS_texture_select; - __GLeeGLLoadFunction[92]=__GLeeLink_GL_SGIX_sprite; - __GLeeGLLoadFunction[93]=__GLeeLink_GL_SGIX_texture_multi_buffer; - __GLeeGLLoadFunction[94]=__GLeeLink_GL_EXT_point_parameters; - __GLeeGLLoadFunction[95]=__GLeeLink_GL_SGIS_point_parameters; - __GLeeGLLoadFunction[96]=__GLeeLink_GL_SGIX_instruments; - __GLeeGLLoadFunction[97]=__GLeeLink_GL_SGIX_texture_scale_bias; - __GLeeGLLoadFunction[98]=__GLeeLink_GL_SGIX_framezoom; - __GLeeGLLoadFunction[99]=__GLeeLink_GL_SGIX_tag_sample_buffer; - __GLeeGLLoadFunction[100]=__GLeeLink_GL_FfdMaskSGIX; - __GLeeGLLoadFunction[101]=__GLeeLink_GL_SGIX_polynomial_ffd; - __GLeeGLLoadFunction[102]=__GLeeLink_GL_SGIX_reference_plane; - __GLeeGLLoadFunction[103]=__GLeeLink_GL_SGIX_flush_raster; - __GLeeGLLoadFunction[104]=__GLeeLink_GL_SGIX_depth_texture; - __GLeeGLLoadFunction[105]=__GLeeLink_GL_SGIS_fog_function; - __GLeeGLLoadFunction[106]=__GLeeLink_GL_SGIX_fog_offset; - __GLeeGLLoadFunction[107]=__GLeeLink_GL_HP_image_transform; - __GLeeGLLoadFunction[108]=__GLeeLink_GL_HP_convolution_border_modes; - __GLeeGLLoadFunction[109]=__GLeeLink_GL_INGR_palette_buffer; - __GLeeGLLoadFunction[110]=__GLeeLink_GL_SGIX_texture_add_env; - __GLeeGLLoadFunction[111]=__GLeeLink_GL_EXT_color_subtable; - __GLeeGLLoadFunction[112]=__GLeeLink_GL_PGI_vertex_hints; - __GLeeGLLoadFunction[113]=__GLeeLink_GL_PGI_misc_hints; - __GLeeGLLoadFunction[114]=__GLeeLink_GL_EXT_paletted_texture; - __GLeeGLLoadFunction[115]=__GLeeLink_GL_EXT_clip_volume_hint; - __GLeeGLLoadFunction[116]=__GLeeLink_GL_SGIX_list_priority; - __GLeeGLLoadFunction[117]=__GLeeLink_GL_SGIX_ir_instrument1; - __GLeeGLLoadFunction[118]=__GLeeLink_GL_SGIX_calligraphic_fragment; - __GLeeGLLoadFunction[119]=__GLeeLink_GL_SGIX_texture_lod_bias; - __GLeeGLLoadFunction[120]=__GLeeLink_GL_SGIX_shadow_ambient; - __GLeeGLLoadFunction[121]=__GLeeLink_GL_EXT_index_texture; - __GLeeGLLoadFunction[122]=__GLeeLink_GL_EXT_index_material; - __GLeeGLLoadFunction[123]=__GLeeLink_GL_EXT_index_func; - __GLeeGLLoadFunction[124]=__GLeeLink_GL_EXT_index_array_formats; - __GLeeGLLoadFunction[125]=__GLeeLink_GL_EXT_compiled_vertex_array; - __GLeeGLLoadFunction[126]=__GLeeLink_GL_EXT_cull_vertex; - __GLeeGLLoadFunction[127]=__GLeeLink_GL_SGIX_ycrcb; - __GLeeGLLoadFunction[128]=__GLeeLink_GL_SGIX_fragment_lighting; - __GLeeGLLoadFunction[129]=__GLeeLink_GL_IBM_rasterpos_clip; - __GLeeGLLoadFunction[130]=__GLeeLink_GL_HP_texture_lighting; - __GLeeGLLoadFunction[131]=__GLeeLink_GL_EXT_draw_range_elements; - __GLeeGLLoadFunction[132]=__GLeeLink_GL_WIN_phong_shading; - __GLeeGLLoadFunction[133]=__GLeeLink_GL_WIN_specular_fog; - __GLeeGLLoadFunction[134]=__GLeeLink_GL_EXT_light_texture; - __GLeeGLLoadFunction[135]=__GLeeLink_GL_SGIX_blend_alpha_minmax; - __GLeeGLLoadFunction[136]=__GLeeLink_GL_SGIX_impact_pixel_texture; - __GLeeGLLoadFunction[137]=__GLeeLink_GL_EXT_bgra; - __GLeeGLLoadFunction[138]=__GLeeLink_GL_SGIX_async; - __GLeeGLLoadFunction[139]=__GLeeLink_GL_SGIX_async_pixel; - __GLeeGLLoadFunction[140]=__GLeeLink_GL_SGIX_async_histogram; - __GLeeGLLoadFunction[141]=__GLeeLink_GL_INTEL_texture_scissor; - __GLeeGLLoadFunction[142]=__GLeeLink_GL_INTEL_parallel_arrays; - __GLeeGLLoadFunction[143]=__GLeeLink_GL_HP_occlusion_test; - __GLeeGLLoadFunction[144]=__GLeeLink_GL_EXT_pixel_transform; - __GLeeGLLoadFunction[145]=__GLeeLink_GL_EXT_pixel_transform_color_table; - __GLeeGLLoadFunction[146]=__GLeeLink_GL_EXT_shared_texture_palette; - __GLeeGLLoadFunction[147]=__GLeeLink_GL_EXT_separate_specular_color; - __GLeeGLLoadFunction[148]=__GLeeLink_GL_EXT_secondary_color; - __GLeeGLLoadFunction[149]=__GLeeLink_GL_EXT_texture_perturb_normal; - __GLeeGLLoadFunction[150]=__GLeeLink_GL_EXT_multi_draw_arrays; - __GLeeGLLoadFunction[151]=__GLeeLink_GL_EXT_fog_coord; - __GLeeGLLoadFunction[152]=__GLeeLink_GL_REND_screen_coordinates; - __GLeeGLLoadFunction[153]=__GLeeLink_GL_EXT_coordinate_frame; - __GLeeGLLoadFunction[154]=__GLeeLink_GL_EXT_texture_env_combine; - __GLeeGLLoadFunction[155]=__GLeeLink_GL_APPLE_specular_vector; - __GLeeGLLoadFunction[156]=__GLeeLink_GL_APPLE_transform_hint; - __GLeeGLLoadFunction[157]=__GLeeLink_GL_SGIX_fog_scale; - __GLeeGLLoadFunction[158]=__GLeeLink_GL_SUNX_constant_data; - __GLeeGLLoadFunction[159]=__GLeeLink_GL_SUN_global_alpha; - __GLeeGLLoadFunction[160]=__GLeeLink_GL_SUN_triangle_list; - __GLeeGLLoadFunction[161]=__GLeeLink_GL_SUN_vertex; - __GLeeGLLoadFunction[162]=__GLeeLink_GL_EXT_blend_func_separate; - __GLeeGLLoadFunction[163]=__GLeeLink_GL_INGR_color_clamp; - __GLeeGLLoadFunction[164]=__GLeeLink_GL_INGR_interlace_read; - __GLeeGLLoadFunction[165]=__GLeeLink_GL_EXT_stencil_wrap; - __GLeeGLLoadFunction[166]=__GLeeLink_GL_EXT_422_pixels; - __GLeeGLLoadFunction[167]=__GLeeLink_GL_NV_texgen_reflection; - __GLeeGLLoadFunction[168]=__GLeeLink_GL_EXT_texture_cube_map; - __GLeeGLLoadFunction[169]=__GLeeLink_GL_SUN_convolution_border_modes; - __GLeeGLLoadFunction[170]=__GLeeLink_GL_EXT_texture_env_add; - __GLeeGLLoadFunction[171]=__GLeeLink_GL_EXT_texture_lod_bias; - __GLeeGLLoadFunction[172]=__GLeeLink_GL_EXT_texture_filter_anisotropic; - __GLeeGLLoadFunction[173]=__GLeeLink_GL_EXT_vertex_weighting; - __GLeeGLLoadFunction[174]=__GLeeLink_GL_NV_light_max_exponent; - __GLeeGLLoadFunction[175]=__GLeeLink_GL_NV_vertex_array_range; - __GLeeGLLoadFunction[176]=__GLeeLink_GL_NV_register_combiners; - __GLeeGLLoadFunction[177]=__GLeeLink_GL_NV_fog_distance; - __GLeeGLLoadFunction[178]=__GLeeLink_GL_NV_texgen_emboss; - __GLeeGLLoadFunction[179]=__GLeeLink_GL_NV_blend_square; - __GLeeGLLoadFunction[180]=__GLeeLink_GL_NV_texture_env_combine4; - __GLeeGLLoadFunction[181]=__GLeeLink_GL_MESA_resize_buffers; - __GLeeGLLoadFunction[182]=__GLeeLink_GL_MESA_window_pos; - __GLeeGLLoadFunction[183]=__GLeeLink_GL_EXT_texture_compression_s3tc; - __GLeeGLLoadFunction[184]=__GLeeLink_GL_IBM_cull_vertex; - __GLeeGLLoadFunction[185]=__GLeeLink_GL_IBM_multimode_draw_arrays; - __GLeeGLLoadFunction[186]=__GLeeLink_GL_IBM_vertex_array_lists; - __GLeeGLLoadFunction[187]=__GLeeLink_GL_SGIX_subsample; - __GLeeGLLoadFunction[188]=__GLeeLink_GL_SGIX_ycrcb_subsample; - __GLeeGLLoadFunction[189]=__GLeeLink_GL_SGIX_ycrcba; - __GLeeGLLoadFunction[190]=__GLeeLink_GL_SGI_depth_pass_instrument; - __GLeeGLLoadFunction[191]=__GLeeLink_GL_3DFX_texture_compression_FXT1; - __GLeeGLLoadFunction[192]=__GLeeLink_GL_3DFX_multisample; - __GLeeGLLoadFunction[193]=__GLeeLink_GL_3DFX_tbuffer; - __GLeeGLLoadFunction[194]=__GLeeLink_GL_EXT_multisample; - __GLeeGLLoadFunction[195]=__GLeeLink_GL_SGIX_vertex_preclip; - __GLeeGLLoadFunction[196]=__GLeeLink_GL_SGIX_convolution_accuracy; - __GLeeGLLoadFunction[197]=__GLeeLink_GL_SGIX_resample; - __GLeeGLLoadFunction[198]=__GLeeLink_GL_SGIS_point_line_texgen; - __GLeeGLLoadFunction[199]=__GLeeLink_GL_SGIS_texture_color_mask; - __GLeeGLLoadFunction[200]=__GLeeLink_GL_EXT_texture_env_dot3; - __GLeeGLLoadFunction[201]=__GLeeLink_GL_ATI_texture_mirror_once; - __GLeeGLLoadFunction[202]=__GLeeLink_GL_NV_fence; - __GLeeGLLoadFunction[203]=__GLeeLink_GL_IBM_texture_mirrored_repeat; - __GLeeGLLoadFunction[204]=__GLeeLink_GL_NV_evaluators; - __GLeeGLLoadFunction[205]=__GLeeLink_GL_NV_packed_depth_stencil; - __GLeeGLLoadFunction[206]=__GLeeLink_GL_NV_register_combiners2; - __GLeeGLLoadFunction[207]=__GLeeLink_GL_NV_texture_compression_vtc; - __GLeeGLLoadFunction[208]=__GLeeLink_GL_NV_texture_rectangle; - __GLeeGLLoadFunction[209]=__GLeeLink_GL_NV_texture_shader; - __GLeeGLLoadFunction[210]=__GLeeLink_GL_NV_texture_shader2; - __GLeeGLLoadFunction[211]=__GLeeLink_GL_NV_vertex_array_range2; - __GLeeGLLoadFunction[212]=__GLeeLink_GL_NV_vertex_program; - __GLeeGLLoadFunction[213]=__GLeeLink_GL_SGIX_texture_coordinate_clamp; - __GLeeGLLoadFunction[214]=__GLeeLink_GL_SGIX_scalebias_hint; - __GLeeGLLoadFunction[215]=__GLeeLink_GL_OML_interlace; - __GLeeGLLoadFunction[216]=__GLeeLink_GL_OML_subsample; - __GLeeGLLoadFunction[217]=__GLeeLink_GL_OML_resample; - __GLeeGLLoadFunction[218]=__GLeeLink_GL_NV_copy_depth_to_color; - __GLeeGLLoadFunction[219]=__GLeeLink_GL_ATI_envmap_bumpmap; - __GLeeGLLoadFunction[220]=__GLeeLink_GL_ATI_fragment_shader; - __GLeeGLLoadFunction[221]=__GLeeLink_GL_ATI_pn_triangles; - __GLeeGLLoadFunction[222]=__GLeeLink_GL_ATI_vertex_array_object; - __GLeeGLLoadFunction[223]=__GLeeLink_GL_EXT_vertex_shader; - __GLeeGLLoadFunction[224]=__GLeeLink_GL_ATI_vertex_streams; - __GLeeGLLoadFunction[225]=__GLeeLink_GL_ATI_element_array; - __GLeeGLLoadFunction[226]=__GLeeLink_GL_SUN_mesh_array; - __GLeeGLLoadFunction[227]=__GLeeLink_GL_SUN_slice_accum; - __GLeeGLLoadFunction[228]=__GLeeLink_GL_NV_multisample_filter_hint; - __GLeeGLLoadFunction[229]=__GLeeLink_GL_NV_depth_clamp; - __GLeeGLLoadFunction[230]=__GLeeLink_GL_NV_occlusion_query; - __GLeeGLLoadFunction[231]=__GLeeLink_GL_NV_point_sprite; - __GLeeGLLoadFunction[232]=__GLeeLink_GL_NV_texture_shader3; - __GLeeGLLoadFunction[233]=__GLeeLink_GL_NV_vertex_program1_1; - __GLeeGLLoadFunction[234]=__GLeeLink_GL_EXT_shadow_funcs; - __GLeeGLLoadFunction[235]=__GLeeLink_GL_EXT_stencil_two_side; - __GLeeGLLoadFunction[236]=__GLeeLink_GL_ATI_text_fragment_shader; - __GLeeGLLoadFunction[237]=__GLeeLink_GL_APPLE_client_storage; - __GLeeGLLoadFunction[238]=__GLeeLink_GL_APPLE_element_array; - __GLeeGLLoadFunction[239]=__GLeeLink_GL_APPLE_fence; - __GLeeGLLoadFunction[240]=__GLeeLink_GL_APPLE_vertex_array_object; - __GLeeGLLoadFunction[241]=__GLeeLink_GL_APPLE_vertex_array_range; - __GLeeGLLoadFunction[242]=__GLeeLink_GL_APPLE_ycbcr_422; - __GLeeGLLoadFunction[243]=__GLeeLink_GL_S3_s3tc; - __GLeeGLLoadFunction[244]=__GLeeLink_GL_ATI_draw_buffers; - __GLeeGLLoadFunction[245]=__GLeeLink_GL_ATI_pixel_format_float; - __GLeeGLLoadFunction[246]=__GLeeLink_GL_ATI_texture_env_combine3; - __GLeeGLLoadFunction[247]=__GLeeLink_GL_ATI_texture_float; - __GLeeGLLoadFunction[248]=__GLeeLink_GL_NV_float_buffer; - __GLeeGLLoadFunction[249]=__GLeeLink_GL_NV_fragment_program; - __GLeeGLLoadFunction[250]=__GLeeLink_GL_NV_half_float; - __GLeeGLLoadFunction[251]=__GLeeLink_GL_NV_pixel_data_range; - __GLeeGLLoadFunction[252]=__GLeeLink_GL_NV_primitive_restart; - __GLeeGLLoadFunction[253]=__GLeeLink_GL_NV_texture_expand_normal; - __GLeeGLLoadFunction[254]=__GLeeLink_GL_NV_vertex_program2; - __GLeeGLLoadFunction[255]=__GLeeLink_GL_ATI_map_object_buffer; - __GLeeGLLoadFunction[256]=__GLeeLink_GL_ATI_separate_stencil; - __GLeeGLLoadFunction[257]=__GLeeLink_GL_ATI_vertex_attrib_array_object; - __GLeeGLLoadFunction[258]=__GLeeLink_GL_OES_read_format; - __GLeeGLLoadFunction[259]=__GLeeLink_GL_EXT_depth_bounds_test; - __GLeeGLLoadFunction[260]=__GLeeLink_GL_EXT_texture_mirror_clamp; - __GLeeGLLoadFunction[261]=__GLeeLink_GL_EXT_blend_equation_separate; - __GLeeGLLoadFunction[262]=__GLeeLink_GL_MESA_pack_invert; - __GLeeGLLoadFunction[263]=__GLeeLink_GL_MESA_ycbcr_texture; - __GLeeGLLoadFunction[264]=__GLeeLink_GL_EXT_pixel_buffer_object; - __GLeeGLLoadFunction[265]=__GLeeLink_GL_NV_fragment_program_option; - __GLeeGLLoadFunction[266]=__GLeeLink_GL_NV_fragment_program2; - __GLeeGLLoadFunction[267]=__GLeeLink_GL_NV_vertex_program2_option; - __GLeeGLLoadFunction[268]=__GLeeLink_GL_NV_vertex_program3; - __GLeeGLLoadFunction[269]=__GLeeLink_GL_EXT_framebuffer_object; - __GLeeGLLoadFunction[270]=__GLeeLink_GL_GREMEDY_string_marker; - __GLeeGLLoadFunction[271]=__GLeeLink_GL_EXT_packed_depth_stencil; - __GLeeGLLoadFunction[272]=__GLeeLink_GL_EXT_stencil_clear_tag; - __GLeeGLLoadFunction[273]=__GLeeLink_GL_EXT_texture_sRGB; - __GLeeGLLoadFunction[274]=__GLeeLink_GL_EXT_framebuffer_blit; - __GLeeGLLoadFunction[275]=__GLeeLink_GL_EXT_framebuffer_multisample; - __GLeeGLLoadFunction[276]=__GLeeLink_GL_MESAX_texture_stack; - __GLeeGLLoadFunction[277]=__GLeeLink_GL_EXT_timer_query; - __GLeeGLLoadFunction[278]=__GLeeLink_GL_EXT_gpu_program_parameters; - __GLeeGLLoadFunction[279]=__GLeeLink_GL_APPLE_flush_buffer_range; - __GLeeGLLoadFunction[280]=__GLeeLink_GL_NV_gpu_program4; - __GLeeGLLoadFunction[281]=__GLeeLink_GL_NV_geometry_program4; - __GLeeGLLoadFunction[282]=__GLeeLink_GL_EXT_geometry_shader4; - __GLeeGLLoadFunction[283]=__GLeeLink_GL_NV_vertex_program4; - __GLeeGLLoadFunction[284]=__GLeeLink_GL_EXT_gpu_shader4; - __GLeeGLLoadFunction[285]=__GLeeLink_GL_EXT_drawinstanced; - __GLeeGLLoadFunction[286]=__GLeeLink_GL_EXT_packed_float; - __GLeeGLLoadFunction[287]=__GLeeLink_GL_EXT_texture_array; - __GLeeGLLoadFunction[288]=__GLeeLink_GL_EXT_texture_buffer_object; - __GLeeGLLoadFunction[289]=__GLeeLink_GL_EXT_texture_compression_latc; - __GLeeGLLoadFunction[290]=__GLeeLink_GL_EXT_texture_compression_rgtc; - __GLeeGLLoadFunction[291]=__GLeeLink_GL_EXT_texture_shared_exponent; - __GLeeGLLoadFunction[292]=__GLeeLink_GL_NV_depth_buffer_float; - __GLeeGLLoadFunction[293]=__GLeeLink_GL_NV_fragment_program4; - __GLeeGLLoadFunction[294]=__GLeeLink_GL_NV_framebuffer_multisample_coverage; - __GLeeGLLoadFunction[295]=__GLeeLink_GL_EXT_framebuffer_sRGB; - __GLeeGLLoadFunction[296]=__GLeeLink_GL_NV_geometry_shader4; - __GLeeGLLoadFunction[297]=__GLeeLink_GL_NV_parameter_buffer_object; - __GLeeGLLoadFunction[298]=__GLeeLink_GL_EXT_draw_buffers2; - __GLeeGLLoadFunction[299]=__GLeeLink_GL_NV_transform_feedback; - __GLeeGLLoadFunction[300]=__GLeeLink_GL_EXT_bindable_uniform; - __GLeeGLLoadFunction[301]=__GLeeLink_GL_EXT_texture_integer; - __GLeeGLLoadFunction[302]=__GLeeLink_GL_GREMEDY_frame_terminator; - __GLeeGLLoadFunction[303]=__GLeeLink_GL_NV_conditional_render; - __GLeeGLLoadFunction[304]=__GLeeLink_GL_NV_present_video; - __GLeeGLLoadFunction[305]=__GLeeLink_GL_EXT_transform_feedback; - __GLeeGLLoadFunction[306]=__GLeeLink_GL_EXT_direct_state_access; - __GLeeGLLoadFunction[307]=__GLeeLink_GL_EXT_vertex_array_bgra; - __GLeeGLLoadFunction[308]=__GLeeLink_GL_SGIX_texture_select; - __GLeeGLLoadFunction[309]=__GLeeLink_GL_INGR_blend_func_separate; - __GLeeGLLoadFunction[310]=__GLeeLink_GL_SGIX_depth_pass_instrument; - __GLeeGLLoadFunction[311]=__GLeeLink_GL_SGIX_igloo_interface; - __GLeeGLLoadFunction[312]=__GLeeLink_GL_EXT_fragment_lighting; - __GLeeGLLoadFunction[313]=__GLeeLink_GL_EXT_scene_marker; - __GLeeGLLoadFunction[314]=__GLeeLink_GL_EXT_texture_compression_dxt1; - __GLeeGLLoadFunction[315]=__GLeeLink_GL_EXT_texture_env; - __GLeeGLLoadFunction[316]=__GLeeLink_GL_IBM_static_data; - __GLeeGLLoadFunction[317]=__GLeeLink_GL_OES_byte_coordinates; - __GLeeGLLoadFunction[318]=__GLeeLink_GL_OES_compressed_paletted_texture; - __GLeeGLLoadFunction[319]=__GLeeLink_GL_OES_single_precision; - __GLeeGLLoadFunction[320]=__GLeeLink_GL_SGIX_pixel_texture_bits; - __GLeeGLLoadFunction[321]=__GLeeLink_GL_SGIX_texture_range; -} - -#ifdef WIN32 -GLuint __GLeeLink_WGL_ARB_buffer_region(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_ARB_buffer_region - if ((pwglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC) __GLeeGetProcAddress("wglCreateBufferRegionARB"))!=0) nLinked++; - if ((pwglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC) __GLeeGetProcAddress("wglDeleteBufferRegionARB"))!=0) nLinked++; - if ((pwglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC) __GLeeGetProcAddress("wglSaveBufferRegionARB"))!=0) nLinked++; - if ((pwglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC) __GLeeGetProcAddress("wglRestoreBufferRegionARB"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_ARB_multisample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_ARB_extensions_string(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_ARB_extensions_string - if ((pwglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) __GLeeGetProcAddress("wglGetExtensionsStringARB"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_ARB_pixel_format(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_ARB_pixel_format - if ((pwglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC) __GLeeGetProcAddress("wglGetPixelFormatAttribivARB"))!=0) nLinked++; - if ((pwglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC) __GLeeGetProcAddress("wglGetPixelFormatAttribfvARB"))!=0) nLinked++; - if ((pwglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC) __GLeeGetProcAddress("wglChoosePixelFormatARB"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_ARB_make_current_read(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_ARB_make_current_read - if ((pwglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC) __GLeeGetProcAddress("wglMakeContextCurrentARB"))!=0) nLinked++; - if ((pwglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC) __GLeeGetProcAddress("wglGetCurrentReadDCARB"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_ARB_pbuffer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_ARB_pbuffer - if ((pwglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC) __GLeeGetProcAddress("wglCreatePbufferARB"))!=0) nLinked++; - if ((pwglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC) __GLeeGetProcAddress("wglGetPbufferDCARB"))!=0) nLinked++; - if ((pwglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC) __GLeeGetProcAddress("wglReleasePbufferDCARB"))!=0) nLinked++; - if ((pwglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC) __GLeeGetProcAddress("wglDestroyPbufferARB"))!=0) nLinked++; - if ((pwglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC) __GLeeGetProcAddress("wglQueryPbufferARB"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_ARB_render_texture(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_ARB_render_texture - if ((pwglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC) __GLeeGetProcAddress("wglBindTexImageARB"))!=0) nLinked++; - if ((pwglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC) __GLeeGetProcAddress("wglReleaseTexImageARB"))!=0) nLinked++; - if ((pwglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC) __GLeeGetProcAddress("wglSetPbufferAttribARB"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_ARB_pixel_format_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_ARB_create_context(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_ARB_create_context - if ((pwglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) __GLeeGetProcAddress("wglCreateContextAttribsARB"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_EXT_make_current_read(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_EXT_make_current_read - if ((pwglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC) __GLeeGetProcAddress("wglMakeContextCurrentEXT"))!=0) nLinked++; - if ((pwglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC) __GLeeGetProcAddress("wglGetCurrentReadDCEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_EXT_pixel_format(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_EXT_pixel_format - if ((pwglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) __GLeeGetProcAddress("wglGetPixelFormatAttribivEXT"))!=0) nLinked++; - if ((pwglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) __GLeeGetProcAddress("wglGetPixelFormatAttribfvEXT"))!=0) nLinked++; - if ((pwglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC) __GLeeGetProcAddress("wglChoosePixelFormatEXT"))!=0) nLinked++; -#endif - if (nLinked==3) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_EXT_pbuffer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_EXT_pbuffer - if ((pwglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC) __GLeeGetProcAddress("wglCreatePbufferEXT"))!=0) nLinked++; - if ((pwglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC) __GLeeGetProcAddress("wglGetPbufferDCEXT"))!=0) nLinked++; - if ((pwglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC) __GLeeGetProcAddress("wglReleasePbufferDCEXT"))!=0) nLinked++; - if ((pwglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC) __GLeeGetProcAddress("wglDestroyPbufferEXT"))!=0) nLinked++; - if ((pwglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC) __GLeeGetProcAddress("wglQueryPbufferEXT"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_EXT_depth_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_3DFX_multisample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_EXT_multisample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_I3D_digital_video_control(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_I3D_digital_video_control - if ((pwglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) __GLeeGetProcAddress("wglGetDigitalVideoParametersI3D"))!=0) nLinked++; - if ((pwglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) __GLeeGetProcAddress("wglSetDigitalVideoParametersI3D"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_I3D_gamma(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_I3D_gamma - if ((pwglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) __GLeeGetProcAddress("wglGetGammaTableParametersI3D"))!=0) nLinked++; - if ((pwglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) __GLeeGetProcAddress("wglSetGammaTableParametersI3D"))!=0) nLinked++; - if ((pwglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC) __GLeeGetProcAddress("wglGetGammaTableI3D"))!=0) nLinked++; - if ((pwglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC) __GLeeGetProcAddress("wglSetGammaTableI3D"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_I3D_genlock(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_I3D_genlock - if ((pwglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC) __GLeeGetProcAddress("wglEnableGenlockI3D"))!=0) nLinked++; - if ((pwglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC) __GLeeGetProcAddress("wglDisableGenlockI3D"))!=0) nLinked++; - if ((pwglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC) __GLeeGetProcAddress("wglIsEnabledGenlockI3D"))!=0) nLinked++; - if ((pwglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC) __GLeeGetProcAddress("wglGenlockSourceI3D"))!=0) nLinked++; - if ((pwglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC) __GLeeGetProcAddress("wglGetGenlockSourceI3D"))!=0) nLinked++; - if ((pwglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC) __GLeeGetProcAddress("wglGenlockSourceEdgeI3D"))!=0) nLinked++; - if ((pwglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) __GLeeGetProcAddress("wglGetGenlockSourceEdgeI3D"))!=0) nLinked++; - if ((pwglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC) __GLeeGetProcAddress("wglGenlockSampleRateI3D"))!=0) nLinked++; - if ((pwglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC) __GLeeGetProcAddress("wglGetGenlockSampleRateI3D"))!=0) nLinked++; - if ((pwglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC) __GLeeGetProcAddress("wglGenlockSourceDelayI3D"))!=0) nLinked++; - if ((pwglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) __GLeeGetProcAddress("wglGetGenlockSourceDelayI3D"))!=0) nLinked++; - if ((pwglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) __GLeeGetProcAddress("wglQueryGenlockMaxSourceDelayI3D"))!=0) nLinked++; -#endif - if (nLinked==12) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_I3D_image_buffer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_I3D_image_buffer - if ((pwglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC) __GLeeGetProcAddress("wglCreateImageBufferI3D"))!=0) nLinked++; - if ((pwglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC) __GLeeGetProcAddress("wglDestroyImageBufferI3D"))!=0) nLinked++; - if ((pwglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) __GLeeGetProcAddress("wglAssociateImageBufferEventsI3D"))!=0) nLinked++; - if ((pwglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) __GLeeGetProcAddress("wglReleaseImageBufferEventsI3D"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_I3D_swap_frame_lock(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_I3D_swap_frame_lock - if ((pwglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC) __GLeeGetProcAddress("wglEnableFrameLockI3D"))!=0) nLinked++; - if ((pwglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC) __GLeeGetProcAddress("wglDisableFrameLockI3D"))!=0) nLinked++; - if ((pwglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC) __GLeeGetProcAddress("wglIsEnabledFrameLockI3D"))!=0) nLinked++; - if ((pwglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC) __GLeeGetProcAddress("wglQueryFrameLockMasterI3D"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_NV_render_depth_texture(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_NV_render_texture_rectangle(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_ATI_pixel_format_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_NV_float_buffer(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_3DL_stereo_control(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_EXT_pixel_format_packed_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_EXT_framebuffer_sRGB(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_NV_present_video(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_NV_video_out(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_NV_swap_group(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_WGL_EXT_display_color_table(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_EXT_display_color_table - if ((pwglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) __GLeeGetProcAddress("wglCreateDisplayColorTableEXT"))!=0) nLinked++; - if ((pwglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) __GLeeGetProcAddress("wglLoadDisplayColorTableEXT"))!=0) nLinked++; - if ((pwglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) __GLeeGetProcAddress("wglBindDisplayColorTableEXT"))!=0) nLinked++; - if ((pwglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) __GLeeGetProcAddress("wglDestroyDisplayColorTableEXT"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_EXT_extensions_string(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_EXT_extensions_string - if ((pwglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) __GLeeGetProcAddress("wglGetExtensionsStringEXT"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_EXT_swap_control(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_EXT_swap_control - if ((pwglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) __GLeeGetProcAddress("wglSwapIntervalEXT"))!=0) nLinked++; - if ((pwglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC) __GLeeGetProcAddress("wglGetSwapIntervalEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_NV_vertex_array_range(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_NV_vertex_array_range - if ((pwglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC) __GLeeGetProcAddress("wglAllocateMemoryNV"))!=0) nLinked++; - if ((pwglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC) __GLeeGetProcAddress("wglFreeMemoryNV"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_OML_sync_control(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_OML_sync_control - if ((pwglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC) __GLeeGetProcAddress("wglGetSyncValuesOML"))!=0) nLinked++; - if ((pwglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC) __GLeeGetProcAddress("wglGetMscRateOML"))!=0) nLinked++; - if ((pwglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC) __GLeeGetProcAddress("wglSwapBuffersMscOML"))!=0) nLinked++; - if ((pwglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) __GLeeGetProcAddress("wglSwapLayerBuffersMscOML"))!=0) nLinked++; - if ((pwglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC) __GLeeGetProcAddress("wglWaitForMscOML"))!=0) nLinked++; - if ((pwglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC) __GLeeGetProcAddress("wglWaitForSbcOML"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_I3D_swap_frame_usage(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_I3D_swap_frame_usage - if ((pwglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC) __GLeeGetProcAddress("wglGetFrameUsageI3D"))!=0) nLinked++; - if ((pwglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC) __GLeeGetProcAddress("wglBeginFrameTrackingI3D"))!=0) nLinked++; - if ((pwglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC) __GLeeGetProcAddress("wglEndFrameTrackingI3D"))!=0) nLinked++; - if ((pwglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC) __GLeeGetProcAddress("wglQueryFrameTrackingI3D"))!=0) nLinked++; -#endif - if (nLinked==4) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_WGL_NV_video_output(void) -{ - GLint nLinked=0; -#ifdef __GLEE_WGL_NV_video_output - if ((pwglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC) __GLeeGetProcAddress("wglGetVideoDeviceNV"))!=0) nLinked++; - if ((pwglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC) __GLeeGetProcAddress("wglReleaseVideoDeviceNV"))!=0) nLinked++; - if ((pwglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC) __GLeeGetProcAddress("wglBindVideoImageNV"))!=0) nLinked++; - if ((pwglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC) __GLeeGetProcAddress("wglReleaseVideoImageNV"))!=0) nLinked++; - if ((pwglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC) __GLeeGetProcAddress("wglSendPbufferToVideoNV"))!=0) nLinked++; - if ((pwglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC) __GLeeGetProcAddress("wglGetVideoInfoNV"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLEE_LINK_FUNCTION __GLeeWGLLoadFunction[37]; - -void initWGLLoadFunctions(void) -{ - __GLeeWGLLoadFunction[0]=__GLeeLink_WGL_ARB_buffer_region; - __GLeeWGLLoadFunction[1]=__GLeeLink_WGL_ARB_multisample; - __GLeeWGLLoadFunction[2]=__GLeeLink_WGL_ARB_extensions_string; - __GLeeWGLLoadFunction[3]=__GLeeLink_WGL_ARB_pixel_format; - __GLeeWGLLoadFunction[4]=__GLeeLink_WGL_ARB_make_current_read; - __GLeeWGLLoadFunction[5]=__GLeeLink_WGL_ARB_pbuffer; - __GLeeWGLLoadFunction[6]=__GLeeLink_WGL_ARB_render_texture; - __GLeeWGLLoadFunction[7]=__GLeeLink_WGL_ARB_pixel_format_float; - __GLeeWGLLoadFunction[8]=__GLeeLink_WGL_ARB_create_context; - __GLeeWGLLoadFunction[9]=__GLeeLink_WGL_EXT_make_current_read; - __GLeeWGLLoadFunction[10]=__GLeeLink_WGL_EXT_pixel_format; - __GLeeWGLLoadFunction[11]=__GLeeLink_WGL_EXT_pbuffer; - __GLeeWGLLoadFunction[12]=__GLeeLink_WGL_EXT_depth_float; - __GLeeWGLLoadFunction[13]=__GLeeLink_WGL_3DFX_multisample; - __GLeeWGLLoadFunction[14]=__GLeeLink_WGL_EXT_multisample; - __GLeeWGLLoadFunction[15]=__GLeeLink_WGL_I3D_digital_video_control; - __GLeeWGLLoadFunction[16]=__GLeeLink_WGL_I3D_gamma; - __GLeeWGLLoadFunction[17]=__GLeeLink_WGL_I3D_genlock; - __GLeeWGLLoadFunction[18]=__GLeeLink_WGL_I3D_image_buffer; - __GLeeWGLLoadFunction[19]=__GLeeLink_WGL_I3D_swap_frame_lock; - __GLeeWGLLoadFunction[20]=__GLeeLink_WGL_NV_render_depth_texture; - __GLeeWGLLoadFunction[21]=__GLeeLink_WGL_NV_render_texture_rectangle; - __GLeeWGLLoadFunction[22]=__GLeeLink_WGL_ATI_pixel_format_float; - __GLeeWGLLoadFunction[23]=__GLeeLink_WGL_NV_float_buffer; - __GLeeWGLLoadFunction[24]=__GLeeLink_WGL_3DL_stereo_control; - __GLeeWGLLoadFunction[25]=__GLeeLink_WGL_EXT_pixel_format_packed_float; - __GLeeWGLLoadFunction[26]=__GLeeLink_WGL_EXT_framebuffer_sRGB; - __GLeeWGLLoadFunction[27]=__GLeeLink_WGL_NV_present_video; - __GLeeWGLLoadFunction[28]=__GLeeLink_WGL_NV_video_out; - __GLeeWGLLoadFunction[29]=__GLeeLink_WGL_NV_swap_group; - __GLeeWGLLoadFunction[30]=__GLeeLink_WGL_EXT_display_color_table; - __GLeeWGLLoadFunction[31]=__GLeeLink_WGL_EXT_extensions_string; - __GLeeWGLLoadFunction[32]=__GLeeLink_WGL_EXT_swap_control; - __GLeeWGLLoadFunction[33]=__GLeeLink_WGL_NV_vertex_array_range; - __GLeeWGLLoadFunction[34]=__GLeeLink_WGL_OML_sync_control; - __GLeeWGLLoadFunction[35]=__GLeeLink_WGL_I3D_swap_frame_usage; - __GLeeWGLLoadFunction[36]=__GLeeLink_WGL_NV_video_output; -} - -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else /* Linux */ -GLuint __GLeeLink_GLX_VERSION_1_3(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_VERSION_1_3 - if ((pglXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC) __GLeeGetProcAddress("glXGetFBConfigs"))!=0) nLinked++; - if ((pglXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) __GLeeGetProcAddress("glXChooseFBConfig"))!=0) nLinked++; - if ((pglXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC) __GLeeGetProcAddress("glXGetFBConfigAttrib"))!=0) nLinked++; - if ((pglXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC) __GLeeGetProcAddress("glXGetVisualFromFBConfig"))!=0) nLinked++; - if ((pglXCreateWindow = (PFNGLXCREATEWINDOWPROC) __GLeeGetProcAddress("glXCreateWindow"))!=0) nLinked++; - if ((pglXDestroyWindow = (PFNGLXDESTROYWINDOWPROC) __GLeeGetProcAddress("glXDestroyWindow"))!=0) nLinked++; - if ((pglXCreatePixmap = (PFNGLXCREATEPIXMAPPROC) __GLeeGetProcAddress("glXCreatePixmap"))!=0) nLinked++; - if ((pglXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC) __GLeeGetProcAddress("glXDestroyPixmap"))!=0) nLinked++; - if ((pglXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC) __GLeeGetProcAddress("glXCreatePbuffer"))!=0) nLinked++; - if ((pglXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC) __GLeeGetProcAddress("glXDestroyPbuffer"))!=0) nLinked++; - if ((pglXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC) __GLeeGetProcAddress("glXQueryDrawable"))!=0) nLinked++; - if ((pglXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC) __GLeeGetProcAddress("glXCreateNewContext"))!=0) nLinked++; - if ((pglXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC) __GLeeGetProcAddress("glXMakeContextCurrent"))!=0) nLinked++; - if ((pglXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC) __GLeeGetProcAddress("glXGetCurrentReadDrawable"))!=0) nLinked++; - if ((pglXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC) __GLeeGetProcAddress("glXGetCurrentDisplay"))!=0) nLinked++; - if ((pglXQueryContext = (PFNGLXQUERYCONTEXTPROC) __GLeeGetProcAddress("glXQueryContext"))!=0) nLinked++; - if ((pglXSelectEvent = (PFNGLXSELECTEVENTPROC) __GLeeGetProcAddress("glXSelectEvent"))!=0) nLinked++; - if ((pglXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC) __GLeeGetProcAddress("glXGetSelectedEvent"))!=0) nLinked++; -#endif - if (nLinked==18) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_VERSION_1_4(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_VERSION_1_4 - if ((pglXGetProcAddress = (PFNGLXGETPROCADDRESSPROC) __GLeeGetProcAddress("glXGetProcAddress"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_ARB_multisample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_ARB_fbconfig_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_SGIS_multisample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_EXT_visual_info(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_SGI_swap_control(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGI_swap_control - if ((pglXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC) __GLeeGetProcAddress("glXSwapIntervalSGI"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGI_video_sync(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGI_video_sync - if ((pglXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC) __GLeeGetProcAddress("glXGetVideoSyncSGI"))!=0) nLinked++; - if ((pglXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC) __GLeeGetProcAddress("glXWaitVideoSyncSGI"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGI_make_current_read(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGI_make_current_read - if ((pglXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC) __GLeeGetProcAddress("glXMakeCurrentReadSGI"))!=0) nLinked++; - if ((pglXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC) __GLeeGetProcAddress("glXGetCurrentReadDrawableSGI"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_EXT_visual_rating(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_EXT_import_context(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_EXT_import_context - if ((pglXGetCurrentDisplayEXT = (PFNGLXGETCURRENTDISPLAYEXTPROC) __GLeeGetProcAddress("glXGetCurrentDisplayEXT"))!=0) nLinked++; - if ((pglXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC) __GLeeGetProcAddress("glXQueryContextInfoEXT"))!=0) nLinked++; - if ((pglXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC) __GLeeGetProcAddress("glXGetContextIDEXT"))!=0) nLinked++; - if ((pglXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC) __GLeeGetProcAddress("glXImportContextEXT"))!=0) nLinked++; - if ((pglXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC) __GLeeGetProcAddress("glXFreeContextEXT"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGIX_fbconfig(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGIX_fbconfig - if ((pglXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC) __GLeeGetProcAddress("glXGetFBConfigAttribSGIX"))!=0) nLinked++; - if ((pglXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC) __GLeeGetProcAddress("glXChooseFBConfigSGIX"))!=0) nLinked++; - if ((pglXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) __GLeeGetProcAddress("glXCreateGLXPixmapWithConfigSGIX"))!=0) nLinked++; - if ((pglXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) __GLeeGetProcAddress("glXCreateContextWithConfigSGIX"))!=0) nLinked++; - if ((pglXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) __GLeeGetProcAddress("glXGetVisualFromFBConfigSGIX"))!=0) nLinked++; - if ((pglXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) __GLeeGetProcAddress("glXGetFBConfigFromVisualSGIX"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGIX_pbuffer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGIX_pbuffer - if ((pglXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC) __GLeeGetProcAddress("glXCreateGLXPbufferSGIX"))!=0) nLinked++; - if ((pglXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC) __GLeeGetProcAddress("glXDestroyGLXPbufferSGIX"))!=0) nLinked++; - if ((pglXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC) __GLeeGetProcAddress("glXQueryGLXPbufferSGIX"))!=0) nLinked++; - if ((pglXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC) __GLeeGetProcAddress("glXSelectEventSGIX"))!=0) nLinked++; - if ((pglXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC) __GLeeGetProcAddress("glXGetSelectedEventSGIX"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGI_cushion(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGI_cushion - if ((pglXCushionSGI = (PFNGLXCUSHIONSGIPROC) __GLeeGetProcAddress("glXCushionSGI"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGIX_video_resize(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGIX_video_resize - if ((pglXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC) __GLeeGetProcAddress("glXBindChannelToWindowSGIX"))!=0) nLinked++; - if ((pglXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC) __GLeeGetProcAddress("glXChannelRectSGIX"))!=0) nLinked++; - if ((pglXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC) __GLeeGetProcAddress("glXQueryChannelRectSGIX"))!=0) nLinked++; - if ((pglXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC) __GLeeGetProcAddress("glXQueryChannelDeltasSGIX"))!=0) nLinked++; - if ((pglXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC) __GLeeGetProcAddress("glXChannelRectSyncSGIX"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGIX_swap_group(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGIX_swap_group - if ((pglXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC) __GLeeGetProcAddress("glXJoinSwapGroupSGIX"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGIX_swap_barrier(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGIX_swap_barrier - if ((pglXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC) __GLeeGetProcAddress("glXBindSwapBarrierSGIX"))!=0) nLinked++; - if ((pglXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) __GLeeGetProcAddress("glXQueryMaxSwapBarriersSGIX"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGIS_blended_overlay(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_SGIS_shared_multisample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_SUN_get_transparent_index(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SUN_get_transparent_index - if ((pglXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC) __GLeeGetProcAddress("glXGetTransparentIndexSUN"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_3DFX_multisample(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_MESA_copy_sub_buffer(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_MESA_copy_sub_buffer - if ((pglXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC) __GLeeGetProcAddress("glXCopySubBufferMESA"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_MESA_pixmap_colormap(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_MESA_pixmap_colormap - if ((pglXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC) __GLeeGetProcAddress("glXCreateGLXPixmapMESA"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_MESA_release_buffers(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_MESA_release_buffers - if ((pglXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC) __GLeeGetProcAddress("glXReleaseBuffersMESA"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_MESA_set_3dfx_mode(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_MESA_set_3dfx_mode - if ((pglXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC) __GLeeGetProcAddress("glXSet3DfxModeMESA"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_SGIX_visual_select_group(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_OML_swap_method(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_OML_sync_control(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_OML_sync_control - if ((pglXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC) __GLeeGetProcAddress("glXGetSyncValuesOML"))!=0) nLinked++; - if ((pglXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC) __GLeeGetProcAddress("glXGetMscRateOML"))!=0) nLinked++; - if ((pglXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC) __GLeeGetProcAddress("glXSwapBuffersMscOML"))!=0) nLinked++; - if ((pglXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC) __GLeeGetProcAddress("glXWaitForMscOML"))!=0) nLinked++; - if ((pglXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC) __GLeeGetProcAddress("glXWaitForSbcOML"))!=0) nLinked++; -#endif - if (nLinked==5) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_NV_float_buffer(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_SGIX_hyperpipe(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_SGIX_hyperpipe - if ((pglXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeNetworkSGIX"))!=0) nLinked++; - if ((pglXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXHyperpipeConfigSGIX"))!=0) nLinked++; - if ((pglXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeConfigSGIX"))!=0) nLinked++; - if ((pglXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXDestroyHyperpipeConfigSGIX"))!=0) nLinked++; - if ((pglXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC) __GLeeGetProcAddress("glXBindHyperpipeSGIX"))!=0) nLinked++; - if ((pglXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeBestAttribSGIX"))!=0) nLinked++; - if ((pglXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC) __GLeeGetProcAddress("glXHyperpipeAttribSGIX"))!=0) nLinked++; - if ((pglXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeAttribSGIX"))!=0) nLinked++; -#endif - if (nLinked==8) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_MESA_agp_offset(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_MESA_agp_offset - if ((pglXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC) __GLeeGetProcAddress("glXGetAGPOffsetMESA"))!=0) nLinked++; -#endif - if (nLinked==1) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_EXT_fbconfig_packed_float(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_EXT_framebuffer_sRGB(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_EXT_texture_from_pixmap(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_EXT_texture_from_pixmap - if ((pglXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC) __GLeeGetProcAddress("glXBindTexImageEXT"))!=0) nLinked++; - if ((pglXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC) __GLeeGetProcAddress("glXReleaseTexImageEXT"))!=0) nLinked++; -#endif - if (nLinked==2) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLuint __GLeeLink_GLX_NV_present_video(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_NV_video_out(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_NV_swap_group(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_EXT_scene_marker(void) {return GLEE_LINK_COMPLETE;} - -GLuint __GLeeLink_GLX_NV_video_output(void) -{ - GLint nLinked=0; -#ifdef __GLEE_GLX_NV_video_output - if ((pglXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC) __GLeeGetProcAddress("glXGetVideoDeviceNV"))!=0) nLinked++; - if ((pglXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC) __GLeeGetProcAddress("glXReleaseVideoDeviceNV"))!=0) nLinked++; - if ((pglXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC) __GLeeGetProcAddress("glXBindVideoImageNV"))!=0) nLinked++; - if ((pglXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC) __GLeeGetProcAddress("glXReleaseVideoImageNV"))!=0) nLinked++; - if ((pglXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC) __GLeeGetProcAddress("glXSendPbufferToVideoNV"))!=0) nLinked++; - if ((pglXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC) __GLeeGetProcAddress("glXGetVideoInfoNV"))!=0) nLinked++; -#endif - if (nLinked==6) return GLEE_LINK_COMPLETE; - if (nLinked==0) return GLEE_LINK_FAIL; - return GLEE_LINK_PARTIAL; -} - -GLEE_LINK_FUNCTION __GLeeGLXLoadFunction[39]; - -void initGLXLoadFunctions(void) -{ - __GLeeGLXLoadFunction[0]=__GLeeLink_GLX_VERSION_1_3; - __GLeeGLXLoadFunction[1]=__GLeeLink_GLX_VERSION_1_4; - __GLeeGLXLoadFunction[2]=__GLeeLink_GLX_ARB_multisample; - __GLeeGLXLoadFunction[3]=__GLeeLink_GLX_ARB_fbconfig_float; - __GLeeGLXLoadFunction[4]=__GLeeLink_GLX_SGIS_multisample; - __GLeeGLXLoadFunction[5]=__GLeeLink_GLX_EXT_visual_info; - __GLeeGLXLoadFunction[6]=__GLeeLink_GLX_SGI_swap_control; - __GLeeGLXLoadFunction[7]=__GLeeLink_GLX_SGI_video_sync; - __GLeeGLXLoadFunction[8]=__GLeeLink_GLX_SGI_make_current_read; - __GLeeGLXLoadFunction[9]=__GLeeLink_GLX_EXT_visual_rating; - __GLeeGLXLoadFunction[10]=__GLeeLink_GLX_EXT_import_context; - __GLeeGLXLoadFunction[11]=__GLeeLink_GLX_SGIX_fbconfig; - __GLeeGLXLoadFunction[12]=__GLeeLink_GLX_SGIX_pbuffer; - __GLeeGLXLoadFunction[13]=__GLeeLink_GLX_SGI_cushion; - __GLeeGLXLoadFunction[14]=__GLeeLink_GLX_SGIX_video_resize; - __GLeeGLXLoadFunction[15]=__GLeeLink_GLX_SGIX_swap_group; - __GLeeGLXLoadFunction[16]=__GLeeLink_GLX_SGIX_swap_barrier; - __GLeeGLXLoadFunction[17]=__GLeeLink_GLX_SGIS_blended_overlay; - __GLeeGLXLoadFunction[18]=__GLeeLink_GLX_SGIS_shared_multisample; - __GLeeGLXLoadFunction[19]=__GLeeLink_GLX_SUN_get_transparent_index; - __GLeeGLXLoadFunction[20]=__GLeeLink_GLX_3DFX_multisample; - __GLeeGLXLoadFunction[21]=__GLeeLink_GLX_MESA_copy_sub_buffer; - __GLeeGLXLoadFunction[22]=__GLeeLink_GLX_MESA_pixmap_colormap; - __GLeeGLXLoadFunction[23]=__GLeeLink_GLX_MESA_release_buffers; - __GLeeGLXLoadFunction[24]=__GLeeLink_GLX_MESA_set_3dfx_mode; - __GLeeGLXLoadFunction[25]=__GLeeLink_GLX_SGIX_visual_select_group; - __GLeeGLXLoadFunction[26]=__GLeeLink_GLX_OML_swap_method; - __GLeeGLXLoadFunction[27]=__GLeeLink_GLX_OML_sync_control; - __GLeeGLXLoadFunction[28]=__GLeeLink_GLX_NV_float_buffer; - __GLeeGLXLoadFunction[29]=__GLeeLink_GLX_SGIX_hyperpipe; - __GLeeGLXLoadFunction[30]=__GLeeLink_GLX_MESA_agp_offset; - __GLeeGLXLoadFunction[31]=__GLeeLink_GLX_EXT_fbconfig_packed_float; - __GLeeGLXLoadFunction[32]=__GLeeLink_GLX_EXT_framebuffer_sRGB; - __GLeeGLXLoadFunction[33]=__GLeeLink_GLX_EXT_texture_from_pixmap; - __GLeeGLXLoadFunction[34]=__GLeeLink_GLX_NV_present_video; - __GLeeGLXLoadFunction[35]=__GLeeLink_GLX_NV_video_out; - __GLeeGLXLoadFunction[36]=__GLeeLink_GLX_NV_swap_group; - __GLeeGLXLoadFunction[37]=__GLeeLink_GLX_EXT_scene_marker; - __GLeeGLXLoadFunction[38]=__GLeeLink_GLX_NV_video_output; -} - -#endif /* end Linux */ - - -/***************************************************************** - * GLee internal types - *****************************************************************/ -typedef struct -{ - char ** names; - int * lengths; - int numNames; -}ExtensionList; - - -/***************************************************************** - * GLee internal variables - *****************************************************************/ -char GLeeErrorString[256]=""; - - -/***************************************************************** - * GLee internal functions - *****************************************************************/ - -void __GLeeExtList_init(ExtensionList *extList) -{ - extList->names=0; - extList->lengths=0; - extList->numNames=0; -} - -void __GLeeExtList_clean(ExtensionList *extList) -{ - int a; - for (a=0;anumNames;a++) - { - if (extList->names[a]!=0) free((void *)extList->names[a]); - } - if (extList->names!=0) free((void *)extList->names); - if (extList->lengths!=0) free((void *)extList->lengths); - extList->names=0; - extList->lengths=0; - extList->numNames=0; -} - -void __GLeeExtList_add(ExtensionList *extList, const char * extName) -{ - int length=strlen(extName)+1; - int i=extList->numNames; - int n=i+1; - if (i==0) - { - extList->lengths=(int *)malloc(sizeof(int)); - extList->names=(char **)malloc(sizeof(char *)); - }else - { - extList->lengths=(int *)realloc((void *)extList->lengths, n*sizeof(int)); - extList->names=(char **)realloc((void *)extList->names, n*sizeof(char *)); - } - extList->names[i]=(char *)malloc(length*sizeof(char)); - strcpy(extList->names[i],extName); - extList->lengths[i]=length; - extList->numNames++; -} - -const char *__GLeeGetExtStrPlat( void ) -{ -#ifdef WIN32 - if (!_GLEE_WGL_ARB_extensions_string) - pwglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB"); - - if (pwglGetExtensionsStringARB) - return (const char *)pwglGetExtensionsStringARB(wglGetCurrentDC()); -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else - Display *dpy=glXGetCurrentDisplay(); - if(dpy) - { - int dpynr=DefaultScreen(dpy); - return (const char*)glXQueryExtensionsString(dpy,dpynr); - } -#endif - return 0; -} - -void __GLeeWriteError(const char * errorStr) -{ - int a=0; - for (a=0;a<256;a++) - { - GLeeErrorString[a]=errorStr[a]; - } - GLeeErrorString[255]='\0'; -} - -int __GLeeGetVersionNumber(char *versionStr) -{ - int major=(int)versionStr[0]-(int)'0'; - int minor=(int)versionStr[2]-(int)'0'; - return major<<8 | minor; -} - -GLboolean __GLeeGetExtensions(ExtensionList* extList) -{ - const char * platExtStr; - const char * glExtStr; - char * extStr; - char emptyString[1] = ""; - char extensionName[1024]; - int a,b; - int totalExtStrLen; - int platExtStrLen; - int addASpace; - - /* read the platform specific extension string */ - platExtStr=__GLeeGetExtStrPlat(); - if (!platExtStr) platExtStr=emptyString; - - glExtStr=(const char *)glGetString(GL_EXTENSIONS); - if (glExtStr==0) - { - __GLeeWriteError("glGetString(GL_EXTENSIONS) failed."); - return GL_FALSE; - } - - /* allocate the extension string */ - platExtStrLen = strlen(platExtStr); - totalExtStrLen = platExtStrLen + strlen(glExtStr); - extStr=(char *)malloc( (totalExtStrLen+2) * sizeof(char) ); /* we add 2 to allow for an extra space and a null terminator */ - - /* If the last character of platExtStr is not a space, we need to add one when we concatenate the extension strings*/ - addASpace = 0; - if ( platExtStrLen > 2 ) - { - if ( platExtStr[ platExtStrLen-1 ] != ' ') - { - addASpace = 1; - } - } - - /* concatenate the two extension strings */ - if ( addASpace ) - { - sprintf(extStr,"%s %s",platExtStr,glExtStr); - } - else - { - sprintf(extStr,"%s%s",platExtStr,glExtStr); - } - - /* extract the extensions */ - for ( a=0;anumNames; - int a; - for (a=0;anames[a],name)==0) - return GL_TRUE; - } - return GL_FALSE; -} - -GLEE_EXTERN GLint __GLeeGetExtensionNumber(const char *extensionName, int type) -{ - int a; - switch (type) - { - case 0: - for (a=0;a<__GLeeGLNumExtensions;a++) - if (strcmp(extensionName,__GLeeGLExtensionNames[a])==0) return a; - return -1; -#ifdef WIN32 - case 1: - for (a=0;a<__GLeeWGLNumExtensions;a++) - if (strcmp(extensionName,__GLeeWGLExtensionNames[a])==0) return a; - return -1; -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else - case 2: - for (a=0;a<__GLeeGLXNumExtensions;a++) - if (strcmp(extensionName,__GLeeGLXExtensionNames[a])==0) return a; - return -1; -#endif - } - return -1; -} - -/***************************************************************** - * GLee external functions - *****************************************************************/ - -#ifdef WIN32 -GLEE_EXTERN const char * GLeeGetExtStrWGL( void ) -{ - return __GLeeGetExtStrPlat(); -} -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else -GLEE_EXTERN const char * GLeeGetExtStrGLX( void ) -{ - return __GLeeGetExtStrPlat(); -} -#endif - -GLEE_EXTERN const char * GLeeGetExtStrGL( void ) -{ - return (const char *)glGetString(GL_EXTENSIONS); -} - -GLEE_EXTERN const char * GLeeGetErrorString( void ) -{ - return GLeeErrorString; -} - -GLboolean __GLeeInitedLoadFunctions=GL_FALSE; - -GLEE_EXTERN GLint GLeeForceLink(const char * extensionName) -{ - int type=0; - int extNum; - int len=strlen(extensionName); - if (len<5) return GLEE_LINK_FAIL; - if (!__GLeeInitedLoadFunctions) - { - if (!__GLeeInited) GLeeInit(); - initGLLoadFunctions(); -#ifdef WIN32 - initWGLLoadFunctions(); -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else - initGLXLoadFunctions(); -#endif - __GLeeInitedLoadFunctions=GL_TRUE; - } - if (extensionName[0]=='W') type=1; - else if (extensionName[2]=='X') type=2; - extNum=__GLeeGetExtensionNumber(extensionName,type); - if (extNum==-1) return GLEE_LINK_FAIL; - if (type==0) return __GLeeGLLoadFunction[extNum](); -#ifdef WIN32 - if (type==1) return __GLeeWGLLoadFunction[extNum](); -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else - if (type==2) return __GLeeGLXLoadFunction[extNum](); -#endif - return GLEE_LINK_FAIL; -} - -GLEE_EXTERN GLboolean GLeeEnabled(GLboolean * extensionQueryingVariable) -{ - if (!__GLeeInited) GLeeInit(); - return *extensionQueryingVariable; -} - -GLEE_EXTERN GLboolean GLeeInit( void ) -{ - int version; - ExtensionList extensionNames; - - if (__GLeeInited) - { - return GL_FALSE; - } - - __GLeeExtList_init(&extensionNames); - if (!__GLeeGetExtensions(&extensionNames)) - { - __GLeeWriteError("GL extension querying failed."); - __GLeeExtList_clean(&extensionNames); - return GL_FALSE; - } - - version=__GLeeGetVersionNumber((char *)glGetString(GL_VERSION)); - - __GLeeInited = GL_TRUE; - - -/***************************************************************** - * Autogenerated linking functions - *****************************************************************/ - if (version>=258) - { - _GLEE_VERSION_1_2 = GL_TRUE; - __GLeeLink_GL_VERSION_1_2(); - } - if (__GLeeCheckExtension("GL_ARB_imaging", &extensionNames) ) - { - _GLEE_ARB_imaging = GL_TRUE; - __GLeeLink_GL_ARB_imaging(); - } - if (version>=259) - { - _GLEE_VERSION_1_3 = GL_TRUE; - __GLeeLink_GL_VERSION_1_3(); - } - if (version>=260) - { - _GLEE_VERSION_1_4 = GL_TRUE; - __GLeeLink_GL_VERSION_1_4(); - } - if (version>=261) - { - _GLEE_VERSION_1_5 = GL_TRUE; - __GLeeLink_GL_VERSION_1_5(); - } - if (version>=512) - { - _GLEE_VERSION_2_0 = GL_TRUE; - __GLeeLink_GL_VERSION_2_0(); - } - if (version>=513) - { - _GLEE_VERSION_2_1 = GL_TRUE; - __GLeeLink_GL_VERSION_2_1(); - } - if (version>=768) - { - _GLEE_VERSION_3_0 = GL_TRUE; - __GLeeLink_GL_VERSION_3_0(); - } - if (__GLeeCheckExtension("GL_ARB_multitexture", &extensionNames) ) - { - _GLEE_ARB_multitexture = GL_TRUE; - __GLeeLink_GL_ARB_multitexture(); - } - if (__GLeeCheckExtension("GL_ARB_transpose_matrix", &extensionNames) ) - { - _GLEE_ARB_transpose_matrix = GL_TRUE; - __GLeeLink_GL_ARB_transpose_matrix(); - } - if (__GLeeCheckExtension("GL_ARB_multisample", &extensionNames) ) - { - _GLEE_ARB_multisample = GL_TRUE; - __GLeeLink_GL_ARB_multisample(); - } - if (__GLeeCheckExtension("GL_ARB_texture_env_add", &extensionNames) ) - { - _GLEE_ARB_texture_env_add = GL_TRUE; - __GLeeLink_GL_ARB_texture_env_add(); - } - if (__GLeeCheckExtension("GL_ARB_texture_cube_map", &extensionNames) ) - { - _GLEE_ARB_texture_cube_map = GL_TRUE; - __GLeeLink_GL_ARB_texture_cube_map(); - } - if (__GLeeCheckExtension("GL_ARB_texture_compression", &extensionNames) ) - { - _GLEE_ARB_texture_compression = GL_TRUE; - __GLeeLink_GL_ARB_texture_compression(); - } - if (__GLeeCheckExtension("GL_ARB_texture_border_clamp", &extensionNames) ) - { - _GLEE_ARB_texture_border_clamp = GL_TRUE; - __GLeeLink_GL_ARB_texture_border_clamp(); - } - if (__GLeeCheckExtension("GL_ARB_point_parameters", &extensionNames) ) - { - _GLEE_ARB_point_parameters = GL_TRUE; - __GLeeLink_GL_ARB_point_parameters(); - } - if (__GLeeCheckExtension("GL_ARB_vertex_blend", &extensionNames) ) - { - _GLEE_ARB_vertex_blend = GL_TRUE; - __GLeeLink_GL_ARB_vertex_blend(); - } - if (__GLeeCheckExtension("GL_ARB_matrix_palette", &extensionNames) ) - { - _GLEE_ARB_matrix_palette = GL_TRUE; - __GLeeLink_GL_ARB_matrix_palette(); - } - if (__GLeeCheckExtension("GL_ARB_texture_env_combine", &extensionNames) ) - { - _GLEE_ARB_texture_env_combine = GL_TRUE; - __GLeeLink_GL_ARB_texture_env_combine(); - } - if (__GLeeCheckExtension("GL_ARB_texture_env_crossbar", &extensionNames) ) - { - _GLEE_ARB_texture_env_crossbar = GL_TRUE; - __GLeeLink_GL_ARB_texture_env_crossbar(); - } - if (__GLeeCheckExtension("GL_ARB_texture_env_dot3", &extensionNames) ) - { - _GLEE_ARB_texture_env_dot3 = GL_TRUE; - __GLeeLink_GL_ARB_texture_env_dot3(); - } - if (__GLeeCheckExtension("GL_ARB_texture_mirrored_repeat", &extensionNames) ) - { - _GLEE_ARB_texture_mirrored_repeat = GL_TRUE; - __GLeeLink_GL_ARB_texture_mirrored_repeat(); - } - if (__GLeeCheckExtension("GL_ARB_depth_texture", &extensionNames) ) - { - _GLEE_ARB_depth_texture = GL_TRUE; - __GLeeLink_GL_ARB_depth_texture(); - } - if (__GLeeCheckExtension("GL_ARB_shadow", &extensionNames) ) - { - _GLEE_ARB_shadow = GL_TRUE; - __GLeeLink_GL_ARB_shadow(); - } - if (__GLeeCheckExtension("GL_ARB_shadow_ambient", &extensionNames) ) - { - _GLEE_ARB_shadow_ambient = GL_TRUE; - __GLeeLink_GL_ARB_shadow_ambient(); - } - if (__GLeeCheckExtension("GL_ARB_window_pos", &extensionNames) ) - { - _GLEE_ARB_window_pos = GL_TRUE; - __GLeeLink_GL_ARB_window_pos(); - } - if (__GLeeCheckExtension("GL_ARB_vertex_program", &extensionNames) ) - { - _GLEE_ARB_vertex_program = GL_TRUE; - __GLeeLink_GL_ARB_vertex_program(); - } - if (__GLeeCheckExtension("GL_ARB_fragment_program", &extensionNames) ) - { - _GLEE_ARB_fragment_program = GL_TRUE; - __GLeeLink_GL_ARB_fragment_program(); - } - if (__GLeeCheckExtension("GL_ARB_vertex_buffer_object", &extensionNames) ) - { - _GLEE_ARB_vertex_buffer_object = GL_TRUE; - __GLeeLink_GL_ARB_vertex_buffer_object(); - } - if (__GLeeCheckExtension("GL_ARB_occlusion_query", &extensionNames) ) - { - _GLEE_ARB_occlusion_query = GL_TRUE; - __GLeeLink_GL_ARB_occlusion_query(); - } - if (__GLeeCheckExtension("GL_ARB_shader_objects", &extensionNames) ) - { - _GLEE_ARB_shader_objects = GL_TRUE; - __GLeeLink_GL_ARB_shader_objects(); - } - if (__GLeeCheckExtension("GL_ARB_vertex_shader", &extensionNames) ) - { - _GLEE_ARB_vertex_shader = GL_TRUE; - __GLeeLink_GL_ARB_vertex_shader(); - } - if (__GLeeCheckExtension("GL_ARB_fragment_shader", &extensionNames) ) - { - _GLEE_ARB_fragment_shader = GL_TRUE; - __GLeeLink_GL_ARB_fragment_shader(); - } - if (__GLeeCheckExtension("GL_ARB_shading_language_100", &extensionNames) ) - { - _GLEE_ARB_shading_language_100 = GL_TRUE; - __GLeeLink_GL_ARB_shading_language_100(); - } - if (__GLeeCheckExtension("GL_ARB_texture_non_power_of_two", &extensionNames) ) - { - _GLEE_ARB_texture_non_power_of_two = GL_TRUE; - __GLeeLink_GL_ARB_texture_non_power_of_two(); - } - if (__GLeeCheckExtension("GL_ARB_point_sprite", &extensionNames) ) - { - _GLEE_ARB_point_sprite = GL_TRUE; - __GLeeLink_GL_ARB_point_sprite(); - } - if (__GLeeCheckExtension("GL_ARB_fragment_program_shadow", &extensionNames) ) - { - _GLEE_ARB_fragment_program_shadow = GL_TRUE; - __GLeeLink_GL_ARB_fragment_program_shadow(); - } - if (__GLeeCheckExtension("GL_ARB_draw_buffers", &extensionNames) ) - { - _GLEE_ARB_draw_buffers = GL_TRUE; - __GLeeLink_GL_ARB_draw_buffers(); - } - if (__GLeeCheckExtension("GL_ARB_texture_rectangle", &extensionNames) ) - { - _GLEE_ARB_texture_rectangle = GL_TRUE; - __GLeeLink_GL_ARB_texture_rectangle(); - } - if (__GLeeCheckExtension("GL_ARB_color_buffer_float", &extensionNames) ) - { - _GLEE_ARB_color_buffer_float = GL_TRUE; - __GLeeLink_GL_ARB_color_buffer_float(); - } - if (__GLeeCheckExtension("GL_ARB_half_float_pixel", &extensionNames) ) - { - _GLEE_ARB_half_float_pixel = GL_TRUE; - __GLeeLink_GL_ARB_half_float_pixel(); - } - if (__GLeeCheckExtension("GL_ARB_texture_float", &extensionNames) ) - { - _GLEE_ARB_texture_float = GL_TRUE; - __GLeeLink_GL_ARB_texture_float(); - } - if (__GLeeCheckExtension("GL_ARB_pixel_buffer_object", &extensionNames) ) - { - _GLEE_ARB_pixel_buffer_object = GL_TRUE; - __GLeeLink_GL_ARB_pixel_buffer_object(); - } - if (__GLeeCheckExtension("GL_ARB_depth_buffer_float", &extensionNames) ) - { - _GLEE_ARB_depth_buffer_float = GL_TRUE; - __GLeeLink_GL_ARB_depth_buffer_float(); - } - if (__GLeeCheckExtension("GL_ARB_drawinstanced", &extensionNames) ) - { - _GLEE_ARB_drawinstanced = GL_TRUE; - __GLeeLink_GL_ARB_drawinstanced(); - } - if (__GLeeCheckExtension("GL_ARB_framebuffer_object", &extensionNames) ) - { - _GLEE_ARB_framebuffer_object = GL_TRUE; - __GLeeLink_GL_ARB_framebuffer_object(); - } - if (__GLeeCheckExtension("GL_ARB_framebuffer_sRGB", &extensionNames) ) - { - _GLEE_ARB_framebuffer_sRGB = GL_TRUE; - __GLeeLink_GL_ARB_framebuffer_sRGB(); - } - if (__GLeeCheckExtension("GL_ARB_geometry_shader4", &extensionNames) ) - { - _GLEE_ARB_geometry_shader4 = GL_TRUE; - __GLeeLink_GL_ARB_geometry_shader4(); - } - if (__GLeeCheckExtension("GL_ARB_half_float_vertex", &extensionNames) ) - { - _GLEE_ARB_half_float_vertex = GL_TRUE; - __GLeeLink_GL_ARB_half_float_vertex(); - } - if (__GLeeCheckExtension("GL_ARBinstanced_arrays", &extensionNames) ) - { - _GLEE_ARBinstanced_arrays = GL_TRUE; - __GLeeLink_GL_ARBinstanced_arrays(); - } - if (__GLeeCheckExtension("GL_ARB_map_buffer_range", &extensionNames) ) - { - _GLEE_ARB_map_buffer_range = GL_TRUE; - __GLeeLink_GL_ARB_map_buffer_range(); - } - if (__GLeeCheckExtension("GL_ARB_texture_buffer_object", &extensionNames) ) - { - _GLEE_ARB_texture_buffer_object = GL_TRUE; - __GLeeLink_GL_ARB_texture_buffer_object(); - } - if (__GLeeCheckExtension("GL_ARB_texture_compression_rgtc", &extensionNames) ) - { - _GLEE_ARB_texture_compression_rgtc = GL_TRUE; - __GLeeLink_GL_ARB_texture_compression_rgtc(); - } - if (__GLeeCheckExtension("GL_ARB_texture_rg", &extensionNames) ) - { - _GLEE_ARB_texture_rg = GL_TRUE; - __GLeeLink_GL_ARB_texture_rg(); - } - if (__GLeeCheckExtension("GL_ARB_vertex_array_object", &extensionNames) ) - { - _GLEE_ARB_vertex_array_object = GL_TRUE; - __GLeeLink_GL_ARB_vertex_array_object(); - } - if (__GLeeCheckExtension("GL_EXT_abgr", &extensionNames) ) - { - _GLEE_EXT_abgr = GL_TRUE; - __GLeeLink_GL_EXT_abgr(); - } - if (__GLeeCheckExtension("GL_EXT_blend_color", &extensionNames) ) - { - _GLEE_EXT_blend_color = GL_TRUE; - __GLeeLink_GL_EXT_blend_color(); - } - if (__GLeeCheckExtension("GL_EXT_polygon_offset", &extensionNames) ) - { - _GLEE_EXT_polygon_offset = GL_TRUE; - __GLeeLink_GL_EXT_polygon_offset(); - } - if (__GLeeCheckExtension("GL_EXT_texture", &extensionNames) ) - { - _GLEE_EXT_texture = GL_TRUE; - __GLeeLink_GL_EXT_texture(); - } - if (__GLeeCheckExtension("GL_EXT_texture3D", &extensionNames) ) - { - _GLEE_EXT_texture3D = GL_TRUE; - __GLeeLink_GL_EXT_texture3D(); - } - if (__GLeeCheckExtension("GL_SGIS_texture_filter4", &extensionNames) ) - { - _GLEE_SGIS_texture_filter4 = GL_TRUE; - __GLeeLink_GL_SGIS_texture_filter4(); - } - if (__GLeeCheckExtension("GL_EXT_subtexture", &extensionNames) ) - { - _GLEE_EXT_subtexture = GL_TRUE; - __GLeeLink_GL_EXT_subtexture(); - } - if (__GLeeCheckExtension("GL_EXT_copy_texture", &extensionNames) ) - { - _GLEE_EXT_copy_texture = GL_TRUE; - __GLeeLink_GL_EXT_copy_texture(); - } - if (__GLeeCheckExtension("GL_EXT_histogram", &extensionNames) ) - { - _GLEE_EXT_histogram = GL_TRUE; - __GLeeLink_GL_EXT_histogram(); - } - if (__GLeeCheckExtension("GL_EXT_convolution", &extensionNames) ) - { - _GLEE_EXT_convolution = GL_TRUE; - __GLeeLink_GL_EXT_convolution(); - } - if (__GLeeCheckExtension("GL_SGI_color_matrix", &extensionNames) ) - { - _GLEE_SGI_color_matrix = GL_TRUE; - __GLeeLink_GL_SGI_color_matrix(); - } - if (__GLeeCheckExtension("GL_SGI_color_table", &extensionNames) ) - { - _GLEE_SGI_color_table = GL_TRUE; - __GLeeLink_GL_SGI_color_table(); - } - if (__GLeeCheckExtension("GL_SGIS_pixel_texture", &extensionNames) ) - { - _GLEE_SGIS_pixel_texture = GL_TRUE; - __GLeeLink_GL_SGIS_pixel_texture(); - } - if (__GLeeCheckExtension("GL_SGIX_pixel_texture", &extensionNames) ) - { - _GLEE_SGIX_pixel_texture = GL_TRUE; - __GLeeLink_GL_SGIX_pixel_texture(); - } - if (__GLeeCheckExtension("GL_SGIS_texture4D", &extensionNames) ) - { - _GLEE_SGIS_texture4D = GL_TRUE; - __GLeeLink_GL_SGIS_texture4D(); - } - if (__GLeeCheckExtension("GL_SGI_texture_color_table", &extensionNames) ) - { - _GLEE_SGI_texture_color_table = GL_TRUE; - __GLeeLink_GL_SGI_texture_color_table(); - } - if (__GLeeCheckExtension("GL_EXT_cmyka", &extensionNames) ) - { - _GLEE_EXT_cmyka = GL_TRUE; - __GLeeLink_GL_EXT_cmyka(); - } - if (__GLeeCheckExtension("GL_EXT_texture_object", &extensionNames) ) - { - _GLEE_EXT_texture_object = GL_TRUE; - __GLeeLink_GL_EXT_texture_object(); - } - if (__GLeeCheckExtension("GL_SGIS_detail_texture", &extensionNames) ) - { - _GLEE_SGIS_detail_texture = GL_TRUE; - __GLeeLink_GL_SGIS_detail_texture(); - } - if (__GLeeCheckExtension("GL_SGIS_sharpen_texture", &extensionNames) ) - { - _GLEE_SGIS_sharpen_texture = GL_TRUE; - __GLeeLink_GL_SGIS_sharpen_texture(); - } - if (__GLeeCheckExtension("GL_EXT_packed_pixels", &extensionNames) ) - { - _GLEE_EXT_packed_pixels = GL_TRUE; - __GLeeLink_GL_EXT_packed_pixels(); - } - if (__GLeeCheckExtension("GL_SGIS_texture_lod", &extensionNames) ) - { - _GLEE_SGIS_texture_lod = GL_TRUE; - __GLeeLink_GL_SGIS_texture_lod(); - } - if (__GLeeCheckExtension("GL_SGIS_multisample", &extensionNames) ) - { - _GLEE_SGIS_multisample = GL_TRUE; - __GLeeLink_GL_SGIS_multisample(); - } - if (__GLeeCheckExtension("GL_EXT_rescale_normal", &extensionNames) ) - { - _GLEE_EXT_rescale_normal = GL_TRUE; - __GLeeLink_GL_EXT_rescale_normal(); - } - if (__GLeeCheckExtension("GL_EXT_vertex_array", &extensionNames) ) - { - _GLEE_EXT_vertex_array = GL_TRUE; - __GLeeLink_GL_EXT_vertex_array(); - } - if (__GLeeCheckExtension("GL_EXT_misc_attribute", &extensionNames) ) - { - _GLEE_EXT_misc_attribute = GL_TRUE; - __GLeeLink_GL_EXT_misc_attribute(); - } - if (__GLeeCheckExtension("GL_SGIS_generate_mipmap", &extensionNames) ) - { - _GLEE_SGIS_generate_mipmap = GL_TRUE; - __GLeeLink_GL_SGIS_generate_mipmap(); - } - if (__GLeeCheckExtension("GL_SGIX_clipmap", &extensionNames) ) - { - _GLEE_SGIX_clipmap = GL_TRUE; - __GLeeLink_GL_SGIX_clipmap(); - } - if (__GLeeCheckExtension("GL_SGIX_shadow", &extensionNames) ) - { - _GLEE_SGIX_shadow = GL_TRUE; - __GLeeLink_GL_SGIX_shadow(); - } - if (__GLeeCheckExtension("GL_SGIS_texture_edge_clamp", &extensionNames) ) - { - _GLEE_SGIS_texture_edge_clamp = GL_TRUE; - __GLeeLink_GL_SGIS_texture_edge_clamp(); - } - if (__GLeeCheckExtension("GL_SGIS_texture_border_clamp", &extensionNames) ) - { - _GLEE_SGIS_texture_border_clamp = GL_TRUE; - __GLeeLink_GL_SGIS_texture_border_clamp(); - } - if (__GLeeCheckExtension("GL_EXT_blend_minmax", &extensionNames) ) - { - _GLEE_EXT_blend_minmax = GL_TRUE; - __GLeeLink_GL_EXT_blend_minmax(); - } - if (__GLeeCheckExtension("GL_EXT_blend_subtract", &extensionNames) ) - { - _GLEE_EXT_blend_subtract = GL_TRUE; - __GLeeLink_GL_EXT_blend_subtract(); - } - if (__GLeeCheckExtension("GL_EXT_blend_logic_op", &extensionNames) ) - { - _GLEE_EXT_blend_logic_op = GL_TRUE; - __GLeeLink_GL_EXT_blend_logic_op(); - } - if (__GLeeCheckExtension("GL_SGIX_interlace", &extensionNames) ) - { - _GLEE_SGIX_interlace = GL_TRUE; - __GLeeLink_GL_SGIX_interlace(); - } - if (__GLeeCheckExtension("GL_SGIX_pixel_tiles", &extensionNames) ) - { - _GLEE_SGIX_pixel_tiles = GL_TRUE; - __GLeeLink_GL_SGIX_pixel_tiles(); - } - if (__GLeeCheckExtension("GL_SGIS_texture_select", &extensionNames) ) - { - _GLEE_SGIS_texture_select = GL_TRUE; - __GLeeLink_GL_SGIS_texture_select(); - } - if (__GLeeCheckExtension("GL_SGIX_sprite", &extensionNames) ) - { - _GLEE_SGIX_sprite = GL_TRUE; - __GLeeLink_GL_SGIX_sprite(); - } - if (__GLeeCheckExtension("GL_SGIX_texture_multi_buffer", &extensionNames) ) - { - _GLEE_SGIX_texture_multi_buffer = GL_TRUE; - __GLeeLink_GL_SGIX_texture_multi_buffer(); - } - if (__GLeeCheckExtension("GL_EXT_point_parameters", &extensionNames) ) - { - _GLEE_EXT_point_parameters = GL_TRUE; - __GLeeLink_GL_EXT_point_parameters(); - } - if (__GLeeCheckExtension("GL_SGIS_point_parameters", &extensionNames) ) - { - _GLEE_SGIS_point_parameters = GL_TRUE; - __GLeeLink_GL_SGIS_point_parameters(); - } - if (__GLeeCheckExtension("GL_SGIX_instruments", &extensionNames) ) - { - _GLEE_SGIX_instruments = GL_TRUE; - __GLeeLink_GL_SGIX_instruments(); - } - if (__GLeeCheckExtension("GL_SGIX_texture_scale_bias", &extensionNames) ) - { - _GLEE_SGIX_texture_scale_bias = GL_TRUE; - __GLeeLink_GL_SGIX_texture_scale_bias(); - } - if (__GLeeCheckExtension("GL_SGIX_framezoom", &extensionNames) ) - { - _GLEE_SGIX_framezoom = GL_TRUE; - __GLeeLink_GL_SGIX_framezoom(); - } - if (__GLeeCheckExtension("GL_SGIX_tag_sample_buffer", &extensionNames) ) - { - _GLEE_SGIX_tag_sample_buffer = GL_TRUE; - __GLeeLink_GL_SGIX_tag_sample_buffer(); - } - if (__GLeeCheckExtension("GL_FfdMaskSGIX", &extensionNames) ) - { - _GLEE_FfdMaskSGIX = GL_TRUE; - __GLeeLink_GL_FfdMaskSGIX(); - } - if (__GLeeCheckExtension("GL_SGIX_polynomial_ffd", &extensionNames) ) - { - _GLEE_SGIX_polynomial_ffd = GL_TRUE; - __GLeeLink_GL_SGIX_polynomial_ffd(); - } - if (__GLeeCheckExtension("GL_SGIX_reference_plane", &extensionNames) ) - { - _GLEE_SGIX_reference_plane = GL_TRUE; - __GLeeLink_GL_SGIX_reference_plane(); - } - if (__GLeeCheckExtension("GL_SGIX_flush_raster", &extensionNames) ) - { - _GLEE_SGIX_flush_raster = GL_TRUE; - __GLeeLink_GL_SGIX_flush_raster(); - } - if (__GLeeCheckExtension("GL_SGIX_depth_texture", &extensionNames) ) - { - _GLEE_SGIX_depth_texture = GL_TRUE; - __GLeeLink_GL_SGIX_depth_texture(); - } - if (__GLeeCheckExtension("GL_SGIS_fog_function", &extensionNames) ) - { - _GLEE_SGIS_fog_function = GL_TRUE; - __GLeeLink_GL_SGIS_fog_function(); - } - if (__GLeeCheckExtension("GL_SGIX_fog_offset", &extensionNames) ) - { - _GLEE_SGIX_fog_offset = GL_TRUE; - __GLeeLink_GL_SGIX_fog_offset(); - } - if (__GLeeCheckExtension("GL_HP_image_transform", &extensionNames) ) - { - _GLEE_HP_image_transform = GL_TRUE; - __GLeeLink_GL_HP_image_transform(); - } - if (__GLeeCheckExtension("GL_HP_convolution_border_modes", &extensionNames) ) - { - _GLEE_HP_convolution_border_modes = GL_TRUE; - __GLeeLink_GL_HP_convolution_border_modes(); - } - if (__GLeeCheckExtension("GL_INGR_palette_buffer", &extensionNames) ) - { - _GLEE_INGR_palette_buffer = GL_TRUE; - __GLeeLink_GL_INGR_palette_buffer(); - } - if (__GLeeCheckExtension("GL_SGIX_texture_add_env", &extensionNames) ) - { - _GLEE_SGIX_texture_add_env = GL_TRUE; - __GLeeLink_GL_SGIX_texture_add_env(); - } - if (__GLeeCheckExtension("GL_EXT_color_subtable", &extensionNames) ) - { - _GLEE_EXT_color_subtable = GL_TRUE; - __GLeeLink_GL_EXT_color_subtable(); - } - if (__GLeeCheckExtension("GL_PGI_vertex_hints", &extensionNames) ) - { - _GLEE_PGI_vertex_hints = GL_TRUE; - __GLeeLink_GL_PGI_vertex_hints(); - } - if (__GLeeCheckExtension("GL_PGI_misc_hints", &extensionNames) ) - { - _GLEE_PGI_misc_hints = GL_TRUE; - __GLeeLink_GL_PGI_misc_hints(); - } - if (__GLeeCheckExtension("GL_EXT_paletted_texture", &extensionNames) ) - { - _GLEE_EXT_paletted_texture = GL_TRUE; - __GLeeLink_GL_EXT_paletted_texture(); - } - if (__GLeeCheckExtension("GL_EXT_clip_volume_hint", &extensionNames) ) - { - _GLEE_EXT_clip_volume_hint = GL_TRUE; - __GLeeLink_GL_EXT_clip_volume_hint(); - } - if (__GLeeCheckExtension("GL_SGIX_list_priority", &extensionNames) ) - { - _GLEE_SGIX_list_priority = GL_TRUE; - __GLeeLink_GL_SGIX_list_priority(); - } - if (__GLeeCheckExtension("GL_SGIX_ir_instrument1", &extensionNames) ) - { - _GLEE_SGIX_ir_instrument1 = GL_TRUE; - __GLeeLink_GL_SGIX_ir_instrument1(); - } - if (__GLeeCheckExtension("GL_SGIX_calligraphic_fragment", &extensionNames) ) - { - _GLEE_SGIX_calligraphic_fragment = GL_TRUE; - __GLeeLink_GL_SGIX_calligraphic_fragment(); - } - if (__GLeeCheckExtension("GL_SGIX_texture_lod_bias", &extensionNames) ) - { - _GLEE_SGIX_texture_lod_bias = GL_TRUE; - __GLeeLink_GL_SGIX_texture_lod_bias(); - } - if (__GLeeCheckExtension("GL_SGIX_shadow_ambient", &extensionNames) ) - { - _GLEE_SGIX_shadow_ambient = GL_TRUE; - __GLeeLink_GL_SGIX_shadow_ambient(); - } - if (__GLeeCheckExtension("GL_EXT_index_texture", &extensionNames) ) - { - _GLEE_EXT_index_texture = GL_TRUE; - __GLeeLink_GL_EXT_index_texture(); - } - if (__GLeeCheckExtension("GL_EXT_index_material", &extensionNames) ) - { - _GLEE_EXT_index_material = GL_TRUE; - __GLeeLink_GL_EXT_index_material(); - } - if (__GLeeCheckExtension("GL_EXT_index_func", &extensionNames) ) - { - _GLEE_EXT_index_func = GL_TRUE; - __GLeeLink_GL_EXT_index_func(); - } - if (__GLeeCheckExtension("GL_EXT_index_array_formats", &extensionNames) ) - { - _GLEE_EXT_index_array_formats = GL_TRUE; - __GLeeLink_GL_EXT_index_array_formats(); - } - if (__GLeeCheckExtension("GL_EXT_compiled_vertex_array", &extensionNames) ) - { - _GLEE_EXT_compiled_vertex_array = GL_TRUE; - __GLeeLink_GL_EXT_compiled_vertex_array(); - } - if (__GLeeCheckExtension("GL_EXT_cull_vertex", &extensionNames) ) - { - _GLEE_EXT_cull_vertex = GL_TRUE; - __GLeeLink_GL_EXT_cull_vertex(); - } - if (__GLeeCheckExtension("GL_SGIX_ycrcb", &extensionNames) ) - { - _GLEE_SGIX_ycrcb = GL_TRUE; - __GLeeLink_GL_SGIX_ycrcb(); - } - if (__GLeeCheckExtension("GL_SGIX_fragment_lighting", &extensionNames) ) - { - _GLEE_SGIX_fragment_lighting = GL_TRUE; - __GLeeLink_GL_SGIX_fragment_lighting(); - } - if (__GLeeCheckExtension("GL_IBM_rasterpos_clip", &extensionNames) ) - { - _GLEE_IBM_rasterpos_clip = GL_TRUE; - __GLeeLink_GL_IBM_rasterpos_clip(); - } - if (__GLeeCheckExtension("GL_HP_texture_lighting", &extensionNames) ) - { - _GLEE_HP_texture_lighting = GL_TRUE; - __GLeeLink_GL_HP_texture_lighting(); - } - if (__GLeeCheckExtension("GL_EXT_draw_range_elements", &extensionNames) ) - { - _GLEE_EXT_draw_range_elements = GL_TRUE; - __GLeeLink_GL_EXT_draw_range_elements(); - } - if (__GLeeCheckExtension("GL_WIN_phong_shading", &extensionNames) ) - { - _GLEE_WIN_phong_shading = GL_TRUE; - __GLeeLink_GL_WIN_phong_shading(); - } - if (__GLeeCheckExtension("GL_WIN_specular_fog", &extensionNames) ) - { - _GLEE_WIN_specular_fog = GL_TRUE; - __GLeeLink_GL_WIN_specular_fog(); - } - if (__GLeeCheckExtension("GL_EXT_light_texture", &extensionNames) ) - { - _GLEE_EXT_light_texture = GL_TRUE; - __GLeeLink_GL_EXT_light_texture(); - } - if (__GLeeCheckExtension("GL_SGIX_blend_alpha_minmax", &extensionNames) ) - { - _GLEE_SGIX_blend_alpha_minmax = GL_TRUE; - __GLeeLink_GL_SGIX_blend_alpha_minmax(); - } - if (__GLeeCheckExtension("GL_SGIX_impact_pixel_texture", &extensionNames) ) - { - _GLEE_SGIX_impact_pixel_texture = GL_TRUE; - __GLeeLink_GL_SGIX_impact_pixel_texture(); - } - if (__GLeeCheckExtension("GL_EXT_bgra", &extensionNames) ) - { - _GLEE_EXT_bgra = GL_TRUE; - __GLeeLink_GL_EXT_bgra(); - } - if (__GLeeCheckExtension("GL_SGIX_async", &extensionNames) ) - { - _GLEE_SGIX_async = GL_TRUE; - __GLeeLink_GL_SGIX_async(); - } - if (__GLeeCheckExtension("GL_SGIX_async_pixel", &extensionNames) ) - { - _GLEE_SGIX_async_pixel = GL_TRUE; - __GLeeLink_GL_SGIX_async_pixel(); - } - if (__GLeeCheckExtension("GL_SGIX_async_histogram", &extensionNames) ) - { - _GLEE_SGIX_async_histogram = GL_TRUE; - __GLeeLink_GL_SGIX_async_histogram(); - } - if (__GLeeCheckExtension("GL_INTEL_texture_scissor", &extensionNames) ) - { - _GLEE_INTEL_texture_scissor = GL_TRUE; - __GLeeLink_GL_INTEL_texture_scissor(); - } - if (__GLeeCheckExtension("GL_INTEL_parallel_arrays", &extensionNames) ) - { - _GLEE_INTEL_parallel_arrays = GL_TRUE; - __GLeeLink_GL_INTEL_parallel_arrays(); - } - if (__GLeeCheckExtension("GL_HP_occlusion_test", &extensionNames) ) - { - _GLEE_HP_occlusion_test = GL_TRUE; - __GLeeLink_GL_HP_occlusion_test(); - } - if (__GLeeCheckExtension("GL_EXT_pixel_transform", &extensionNames) ) - { - _GLEE_EXT_pixel_transform = GL_TRUE; - __GLeeLink_GL_EXT_pixel_transform(); - } - if (__GLeeCheckExtension("GL_EXT_pixel_transform_color_table", &extensionNames) ) - { - _GLEE_EXT_pixel_transform_color_table = GL_TRUE; - __GLeeLink_GL_EXT_pixel_transform_color_table(); - } - if (__GLeeCheckExtension("GL_EXT_shared_texture_palette", &extensionNames) ) - { - _GLEE_EXT_shared_texture_palette = GL_TRUE; - __GLeeLink_GL_EXT_shared_texture_palette(); - } - if (__GLeeCheckExtension("GL_EXT_separate_specular_color", &extensionNames) ) - { - _GLEE_EXT_separate_specular_color = GL_TRUE; - __GLeeLink_GL_EXT_separate_specular_color(); - } - if (__GLeeCheckExtension("GL_EXT_secondary_color", &extensionNames) ) - { - _GLEE_EXT_secondary_color = GL_TRUE; - __GLeeLink_GL_EXT_secondary_color(); - } - if (__GLeeCheckExtension("GL_EXT_texture_perturb_normal", &extensionNames) ) - { - _GLEE_EXT_texture_perturb_normal = GL_TRUE; - __GLeeLink_GL_EXT_texture_perturb_normal(); - } - if (__GLeeCheckExtension("GL_EXT_multi_draw_arrays", &extensionNames) ) - { - _GLEE_EXT_multi_draw_arrays = GL_TRUE; - __GLeeLink_GL_EXT_multi_draw_arrays(); - } - if (__GLeeCheckExtension("GL_EXT_fog_coord", &extensionNames) ) - { - _GLEE_EXT_fog_coord = GL_TRUE; - __GLeeLink_GL_EXT_fog_coord(); - } - if (__GLeeCheckExtension("GL_REND_screen_coordinates", &extensionNames) ) - { - _GLEE_REND_screen_coordinates = GL_TRUE; - __GLeeLink_GL_REND_screen_coordinates(); - } - if (__GLeeCheckExtension("GL_EXT_coordinate_frame", &extensionNames) ) - { - _GLEE_EXT_coordinate_frame = GL_TRUE; - __GLeeLink_GL_EXT_coordinate_frame(); - } - if (__GLeeCheckExtension("GL_EXT_texture_env_combine", &extensionNames) ) - { - _GLEE_EXT_texture_env_combine = GL_TRUE; - __GLeeLink_GL_EXT_texture_env_combine(); - } - if (__GLeeCheckExtension("GL_APPLE_specular_vector", &extensionNames) ) - { - _GLEE_APPLE_specular_vector = GL_TRUE; - __GLeeLink_GL_APPLE_specular_vector(); - } - if (__GLeeCheckExtension("GL_APPLE_transform_hint", &extensionNames) ) - { - _GLEE_APPLE_transform_hint = GL_TRUE; - __GLeeLink_GL_APPLE_transform_hint(); - } - if (__GLeeCheckExtension("GL_SGIX_fog_scale", &extensionNames) ) - { - _GLEE_SGIX_fog_scale = GL_TRUE; - __GLeeLink_GL_SGIX_fog_scale(); - } - if (__GLeeCheckExtension("GL_SUNX_constant_data", &extensionNames) ) - { - _GLEE_SUNX_constant_data = GL_TRUE; - __GLeeLink_GL_SUNX_constant_data(); - } - if (__GLeeCheckExtension("GL_SUN_global_alpha", &extensionNames) ) - { - _GLEE_SUN_global_alpha = GL_TRUE; - __GLeeLink_GL_SUN_global_alpha(); - } - if (__GLeeCheckExtension("GL_SUN_triangle_list", &extensionNames) ) - { - _GLEE_SUN_triangle_list = GL_TRUE; - __GLeeLink_GL_SUN_triangle_list(); - } - if (__GLeeCheckExtension("GL_SUN_vertex", &extensionNames) ) - { - _GLEE_SUN_vertex = GL_TRUE; - __GLeeLink_GL_SUN_vertex(); - } - if (__GLeeCheckExtension("GL_EXT_blend_func_separate", &extensionNames) ) - { - _GLEE_EXT_blend_func_separate = GL_TRUE; - __GLeeLink_GL_EXT_blend_func_separate(); - } - if (__GLeeCheckExtension("GL_INGR_color_clamp", &extensionNames) ) - { - _GLEE_INGR_color_clamp = GL_TRUE; - __GLeeLink_GL_INGR_color_clamp(); - } - if (__GLeeCheckExtension("GL_INGR_interlace_read", &extensionNames) ) - { - _GLEE_INGR_interlace_read = GL_TRUE; - __GLeeLink_GL_INGR_interlace_read(); - } - if (__GLeeCheckExtension("GL_EXT_stencil_wrap", &extensionNames) ) - { - _GLEE_EXT_stencil_wrap = GL_TRUE; - __GLeeLink_GL_EXT_stencil_wrap(); - } - if (__GLeeCheckExtension("GL_EXT_422_pixels", &extensionNames) ) - { - _GLEE_EXT_422_pixels = GL_TRUE; - __GLeeLink_GL_EXT_422_pixels(); - } - if (__GLeeCheckExtension("GL_NV_texgen_reflection", &extensionNames) ) - { - _GLEE_NV_texgen_reflection = GL_TRUE; - __GLeeLink_GL_NV_texgen_reflection(); - } - if (__GLeeCheckExtension("GL_EXT_texture_cube_map", &extensionNames) ) - { - _GLEE_EXT_texture_cube_map = GL_TRUE; - __GLeeLink_GL_EXT_texture_cube_map(); - } - if (__GLeeCheckExtension("GL_SUN_convolution_border_modes", &extensionNames) ) - { - _GLEE_SUN_convolution_border_modes = GL_TRUE; - __GLeeLink_GL_SUN_convolution_border_modes(); - } - if (__GLeeCheckExtension("GL_EXT_texture_env_add", &extensionNames) ) - { - _GLEE_EXT_texture_env_add = GL_TRUE; - __GLeeLink_GL_EXT_texture_env_add(); - } - if (__GLeeCheckExtension("GL_EXT_texture_lod_bias", &extensionNames) ) - { - _GLEE_EXT_texture_lod_bias = GL_TRUE; - __GLeeLink_GL_EXT_texture_lod_bias(); - } - if (__GLeeCheckExtension("GL_EXT_texture_filter_anisotropic", &extensionNames) ) - { - _GLEE_EXT_texture_filter_anisotropic = GL_TRUE; - __GLeeLink_GL_EXT_texture_filter_anisotropic(); - } - if (__GLeeCheckExtension("GL_EXT_vertex_weighting", &extensionNames) ) - { - _GLEE_EXT_vertex_weighting = GL_TRUE; - __GLeeLink_GL_EXT_vertex_weighting(); - } - if (__GLeeCheckExtension("GL_NV_light_max_exponent", &extensionNames) ) - { - _GLEE_NV_light_max_exponent = GL_TRUE; - __GLeeLink_GL_NV_light_max_exponent(); - } - if (__GLeeCheckExtension("GL_NV_vertex_array_range", &extensionNames) ) - { - _GLEE_NV_vertex_array_range = GL_TRUE; - __GLeeLink_GL_NV_vertex_array_range(); - } - if (__GLeeCheckExtension("GL_NV_register_combiners", &extensionNames) ) - { - _GLEE_NV_register_combiners = GL_TRUE; - __GLeeLink_GL_NV_register_combiners(); - } - if (__GLeeCheckExtension("GL_NV_fog_distance", &extensionNames) ) - { - _GLEE_NV_fog_distance = GL_TRUE; - __GLeeLink_GL_NV_fog_distance(); - } - if (__GLeeCheckExtension("GL_NV_texgen_emboss", &extensionNames) ) - { - _GLEE_NV_texgen_emboss = GL_TRUE; - __GLeeLink_GL_NV_texgen_emboss(); - } - if (__GLeeCheckExtension("GL_NV_blend_square", &extensionNames) ) - { - _GLEE_NV_blend_square = GL_TRUE; - __GLeeLink_GL_NV_blend_square(); - } - if (__GLeeCheckExtension("GL_NV_texture_env_combine4", &extensionNames) ) - { - _GLEE_NV_texture_env_combine4 = GL_TRUE; - __GLeeLink_GL_NV_texture_env_combine4(); - } - if (__GLeeCheckExtension("GL_MESA_resize_buffers", &extensionNames) ) - { - _GLEE_MESA_resize_buffers = GL_TRUE; - __GLeeLink_GL_MESA_resize_buffers(); - } - if (__GLeeCheckExtension("GL_MESA_window_pos", &extensionNames) ) - { - _GLEE_MESA_window_pos = GL_TRUE; - __GLeeLink_GL_MESA_window_pos(); - } - if (__GLeeCheckExtension("GL_EXT_texture_compression_s3tc", &extensionNames) ) - { - _GLEE_EXT_texture_compression_s3tc = GL_TRUE; - __GLeeLink_GL_EXT_texture_compression_s3tc(); - } - if (__GLeeCheckExtension("GL_IBM_cull_vertex", &extensionNames) ) - { - _GLEE_IBM_cull_vertex = GL_TRUE; - __GLeeLink_GL_IBM_cull_vertex(); - } - if (__GLeeCheckExtension("GL_IBM_multimode_draw_arrays", &extensionNames) ) - { - _GLEE_IBM_multimode_draw_arrays = GL_TRUE; - __GLeeLink_GL_IBM_multimode_draw_arrays(); - } - if (__GLeeCheckExtension("GL_IBM_vertex_array_lists", &extensionNames) ) - { - _GLEE_IBM_vertex_array_lists = GL_TRUE; - __GLeeLink_GL_IBM_vertex_array_lists(); - } - if (__GLeeCheckExtension("GL_SGIX_subsample", &extensionNames) ) - { - _GLEE_SGIX_subsample = GL_TRUE; - __GLeeLink_GL_SGIX_subsample(); - } - if (__GLeeCheckExtension("GL_SGIX_ycrcb_subsample", &extensionNames) ) - { - _GLEE_SGIX_ycrcb_subsample = GL_TRUE; - __GLeeLink_GL_SGIX_ycrcb_subsample(); - } - if (__GLeeCheckExtension("GL_SGIX_ycrcba", &extensionNames) ) - { - _GLEE_SGIX_ycrcba = GL_TRUE; - __GLeeLink_GL_SGIX_ycrcba(); - } - if (__GLeeCheckExtension("GL_SGI_depth_pass_instrument", &extensionNames) ) - { - _GLEE_SGI_depth_pass_instrument = GL_TRUE; - __GLeeLink_GL_SGI_depth_pass_instrument(); - } - if (__GLeeCheckExtension("GL_3DFX_texture_compression_FXT1", &extensionNames) ) - { - _GLEE_3DFX_texture_compression_FXT1 = GL_TRUE; - __GLeeLink_GL_3DFX_texture_compression_FXT1(); - } - if (__GLeeCheckExtension("GL_3DFX_multisample", &extensionNames) ) - { - _GLEE_3DFX_multisample = GL_TRUE; - __GLeeLink_GL_3DFX_multisample(); - } - if (__GLeeCheckExtension("GL_3DFX_tbuffer", &extensionNames) ) - { - _GLEE_3DFX_tbuffer = GL_TRUE; - __GLeeLink_GL_3DFX_tbuffer(); - } - if (__GLeeCheckExtension("GL_EXT_multisample", &extensionNames) ) - { - _GLEE_EXT_multisample = GL_TRUE; - __GLeeLink_GL_EXT_multisample(); - } - if (__GLeeCheckExtension("GL_SGIX_vertex_preclip", &extensionNames) ) - { - _GLEE_SGIX_vertex_preclip = GL_TRUE; - __GLeeLink_GL_SGIX_vertex_preclip(); - } - if (__GLeeCheckExtension("GL_SGIX_convolution_accuracy", &extensionNames) ) - { - _GLEE_SGIX_convolution_accuracy = GL_TRUE; - __GLeeLink_GL_SGIX_convolution_accuracy(); - } - if (__GLeeCheckExtension("GL_SGIX_resample", &extensionNames) ) - { - _GLEE_SGIX_resample = GL_TRUE; - __GLeeLink_GL_SGIX_resample(); - } - if (__GLeeCheckExtension("GL_SGIS_point_line_texgen", &extensionNames) ) - { - _GLEE_SGIS_point_line_texgen = GL_TRUE; - __GLeeLink_GL_SGIS_point_line_texgen(); - } - if (__GLeeCheckExtension("GL_SGIS_texture_color_mask", &extensionNames) ) - { - _GLEE_SGIS_texture_color_mask = GL_TRUE; - __GLeeLink_GL_SGIS_texture_color_mask(); - } - if (__GLeeCheckExtension("GL_EXT_texture_env_dot3", &extensionNames) ) - { - _GLEE_EXT_texture_env_dot3 = GL_TRUE; - __GLeeLink_GL_EXT_texture_env_dot3(); - } - if (__GLeeCheckExtension("GL_ATI_texture_mirror_once", &extensionNames) ) - { - _GLEE_ATI_texture_mirror_once = GL_TRUE; - __GLeeLink_GL_ATI_texture_mirror_once(); - } - if (__GLeeCheckExtension("GL_NV_fence", &extensionNames) ) - { - _GLEE_NV_fence = GL_TRUE; - __GLeeLink_GL_NV_fence(); - } - if (__GLeeCheckExtension("GL_IBM_texture_mirrored_repeat", &extensionNames) ) - { - _GLEE_IBM_texture_mirrored_repeat = GL_TRUE; - __GLeeLink_GL_IBM_texture_mirrored_repeat(); - } - if (__GLeeCheckExtension("GL_NV_evaluators", &extensionNames) ) - { - _GLEE_NV_evaluators = GL_TRUE; - __GLeeLink_GL_NV_evaluators(); - } - if (__GLeeCheckExtension("GL_NV_packed_depth_stencil", &extensionNames) ) - { - _GLEE_NV_packed_depth_stencil = GL_TRUE; - __GLeeLink_GL_NV_packed_depth_stencil(); - } - if (__GLeeCheckExtension("GL_NV_register_combiners2", &extensionNames) ) - { - _GLEE_NV_register_combiners2 = GL_TRUE; - __GLeeLink_GL_NV_register_combiners2(); - } - if (__GLeeCheckExtension("GL_NV_texture_compression_vtc", &extensionNames) ) - { - _GLEE_NV_texture_compression_vtc = GL_TRUE; - __GLeeLink_GL_NV_texture_compression_vtc(); - } - if (__GLeeCheckExtension("GL_NV_texture_rectangle", &extensionNames) ) - { - _GLEE_NV_texture_rectangle = GL_TRUE; - __GLeeLink_GL_NV_texture_rectangle(); - } - if (__GLeeCheckExtension("GL_NV_texture_shader", &extensionNames) ) - { - _GLEE_NV_texture_shader = GL_TRUE; - __GLeeLink_GL_NV_texture_shader(); - } - if (__GLeeCheckExtension("GL_NV_texture_shader2", &extensionNames) ) - { - _GLEE_NV_texture_shader2 = GL_TRUE; - __GLeeLink_GL_NV_texture_shader2(); - } - if (__GLeeCheckExtension("GL_NV_vertex_array_range2", &extensionNames) ) - { - _GLEE_NV_vertex_array_range2 = GL_TRUE; - __GLeeLink_GL_NV_vertex_array_range2(); - } - if (__GLeeCheckExtension("GL_NV_vertex_program", &extensionNames) ) - { - _GLEE_NV_vertex_program = GL_TRUE; - __GLeeLink_GL_NV_vertex_program(); - } - if (__GLeeCheckExtension("GL_SGIX_texture_coordinate_clamp", &extensionNames) ) - { - _GLEE_SGIX_texture_coordinate_clamp = GL_TRUE; - __GLeeLink_GL_SGIX_texture_coordinate_clamp(); - } - if (__GLeeCheckExtension("GL_SGIX_scalebias_hint", &extensionNames) ) - { - _GLEE_SGIX_scalebias_hint = GL_TRUE; - __GLeeLink_GL_SGIX_scalebias_hint(); - } - if (__GLeeCheckExtension("GL_OML_interlace", &extensionNames) ) - { - _GLEE_OML_interlace = GL_TRUE; - __GLeeLink_GL_OML_interlace(); - } - if (__GLeeCheckExtension("GL_OML_subsample", &extensionNames) ) - { - _GLEE_OML_subsample = GL_TRUE; - __GLeeLink_GL_OML_subsample(); - } - if (__GLeeCheckExtension("GL_OML_resample", &extensionNames) ) - { - _GLEE_OML_resample = GL_TRUE; - __GLeeLink_GL_OML_resample(); - } - if (__GLeeCheckExtension("GL_NV_copy_depth_to_color", &extensionNames) ) - { - _GLEE_NV_copy_depth_to_color = GL_TRUE; - __GLeeLink_GL_NV_copy_depth_to_color(); - } - if (__GLeeCheckExtension("GL_ATI_envmap_bumpmap", &extensionNames) ) - { - _GLEE_ATI_envmap_bumpmap = GL_TRUE; - __GLeeLink_GL_ATI_envmap_bumpmap(); - } - if (__GLeeCheckExtension("GL_ATI_fragment_shader", &extensionNames) ) - { - _GLEE_ATI_fragment_shader = GL_TRUE; - __GLeeLink_GL_ATI_fragment_shader(); - } - if (__GLeeCheckExtension("GL_ATI_pn_triangles", &extensionNames) ) - { - _GLEE_ATI_pn_triangles = GL_TRUE; - __GLeeLink_GL_ATI_pn_triangles(); - } - if (__GLeeCheckExtension("GL_ATI_vertex_array_object", &extensionNames) ) - { - _GLEE_ATI_vertex_array_object = GL_TRUE; - __GLeeLink_GL_ATI_vertex_array_object(); - } - if (__GLeeCheckExtension("GL_EXT_vertex_shader", &extensionNames) ) - { - _GLEE_EXT_vertex_shader = GL_TRUE; - __GLeeLink_GL_EXT_vertex_shader(); - } - if (__GLeeCheckExtension("GL_ATI_vertex_streams", &extensionNames) ) - { - _GLEE_ATI_vertex_streams = GL_TRUE; - __GLeeLink_GL_ATI_vertex_streams(); - } - if (__GLeeCheckExtension("GL_ATI_element_array", &extensionNames) ) - { - _GLEE_ATI_element_array = GL_TRUE; - __GLeeLink_GL_ATI_element_array(); - } - if (__GLeeCheckExtension("GL_SUN_mesh_array", &extensionNames) ) - { - _GLEE_SUN_mesh_array = GL_TRUE; - __GLeeLink_GL_SUN_mesh_array(); - } - if (__GLeeCheckExtension("GL_SUN_slice_accum", &extensionNames) ) - { - _GLEE_SUN_slice_accum = GL_TRUE; - __GLeeLink_GL_SUN_slice_accum(); - } - if (__GLeeCheckExtension("GL_NV_multisample_filter_hint", &extensionNames) ) - { - _GLEE_NV_multisample_filter_hint = GL_TRUE; - __GLeeLink_GL_NV_multisample_filter_hint(); - } - if (__GLeeCheckExtension("GL_NV_depth_clamp", &extensionNames) ) - { - _GLEE_NV_depth_clamp = GL_TRUE; - __GLeeLink_GL_NV_depth_clamp(); - } - if (__GLeeCheckExtension("GL_NV_occlusion_query", &extensionNames) ) - { - _GLEE_NV_occlusion_query = GL_TRUE; - __GLeeLink_GL_NV_occlusion_query(); - } - if (__GLeeCheckExtension("GL_NV_point_sprite", &extensionNames) ) - { - _GLEE_NV_point_sprite = GL_TRUE; - __GLeeLink_GL_NV_point_sprite(); - } - if (__GLeeCheckExtension("GL_NV_texture_shader3", &extensionNames) ) - { - _GLEE_NV_texture_shader3 = GL_TRUE; - __GLeeLink_GL_NV_texture_shader3(); - } - if (__GLeeCheckExtension("GL_NV_vertex_program1_1", &extensionNames) ) - { - _GLEE_NV_vertex_program1_1 = GL_TRUE; - __GLeeLink_GL_NV_vertex_program1_1(); - } - if (__GLeeCheckExtension("GL_EXT_shadow_funcs", &extensionNames) ) - { - _GLEE_EXT_shadow_funcs = GL_TRUE; - __GLeeLink_GL_EXT_shadow_funcs(); - } - if (__GLeeCheckExtension("GL_EXT_stencil_two_side", &extensionNames) ) - { - _GLEE_EXT_stencil_two_side = GL_TRUE; - __GLeeLink_GL_EXT_stencil_two_side(); - } - if (__GLeeCheckExtension("GL_ATI_text_fragment_shader", &extensionNames) ) - { - _GLEE_ATI_text_fragment_shader = GL_TRUE; - __GLeeLink_GL_ATI_text_fragment_shader(); - } - if (__GLeeCheckExtension("GL_APPLE_client_storage", &extensionNames) ) - { - _GLEE_APPLE_client_storage = GL_TRUE; - __GLeeLink_GL_APPLE_client_storage(); - } - if (__GLeeCheckExtension("GL_APPLE_element_array", &extensionNames) ) - { - _GLEE_APPLE_element_array = GL_TRUE; - __GLeeLink_GL_APPLE_element_array(); - } - if (__GLeeCheckExtension("GL_APPLE_fence", &extensionNames) ) - { - _GLEE_APPLE_fence = GL_TRUE; - __GLeeLink_GL_APPLE_fence(); - } - if (__GLeeCheckExtension("GL_APPLE_vertex_array_object", &extensionNames) ) - { - _GLEE_APPLE_vertex_array_object = GL_TRUE; - __GLeeLink_GL_APPLE_vertex_array_object(); - } - if (__GLeeCheckExtension("GL_APPLE_vertex_array_range", &extensionNames) ) - { - _GLEE_APPLE_vertex_array_range = GL_TRUE; - __GLeeLink_GL_APPLE_vertex_array_range(); - } - if (__GLeeCheckExtension("GL_APPLE_ycbcr_422", &extensionNames) ) - { - _GLEE_APPLE_ycbcr_422 = GL_TRUE; - __GLeeLink_GL_APPLE_ycbcr_422(); - } - if (__GLeeCheckExtension("GL_S3_s3tc", &extensionNames) ) - { - _GLEE_S3_s3tc = GL_TRUE; - __GLeeLink_GL_S3_s3tc(); - } - if (__GLeeCheckExtension("GL_ATI_draw_buffers", &extensionNames) ) - { - _GLEE_ATI_draw_buffers = GL_TRUE; - __GLeeLink_GL_ATI_draw_buffers(); - } - if (__GLeeCheckExtension("GL_ATI_pixel_format_float", &extensionNames) ) - { - _GLEE_ATI_pixel_format_float = GL_TRUE; - __GLeeLink_GL_ATI_pixel_format_float(); - } - if (__GLeeCheckExtension("GL_ATI_texture_env_combine3", &extensionNames) ) - { - _GLEE_ATI_texture_env_combine3 = GL_TRUE; - __GLeeLink_GL_ATI_texture_env_combine3(); - } - if (__GLeeCheckExtension("GL_ATI_texture_float", &extensionNames) ) - { - _GLEE_ATI_texture_float = GL_TRUE; - __GLeeLink_GL_ATI_texture_float(); - } - if (__GLeeCheckExtension("GL_NV_float_buffer", &extensionNames) ) - { - _GLEE_NV_float_buffer = GL_TRUE; - __GLeeLink_GL_NV_float_buffer(); - } - if (__GLeeCheckExtension("GL_NV_fragment_program", &extensionNames) ) - { - _GLEE_NV_fragment_program = GL_TRUE; - __GLeeLink_GL_NV_fragment_program(); - } - if (__GLeeCheckExtension("GL_NV_half_float", &extensionNames) ) - { - _GLEE_NV_half_float = GL_TRUE; - __GLeeLink_GL_NV_half_float(); - } - if (__GLeeCheckExtension("GL_NV_pixel_data_range", &extensionNames) ) - { - _GLEE_NV_pixel_data_range = GL_TRUE; - __GLeeLink_GL_NV_pixel_data_range(); - } - if (__GLeeCheckExtension("GL_NV_primitive_restart", &extensionNames) ) - { - _GLEE_NV_primitive_restart = GL_TRUE; - __GLeeLink_GL_NV_primitive_restart(); - } - if (__GLeeCheckExtension("GL_NV_texture_expand_normal", &extensionNames) ) - { - _GLEE_NV_texture_expand_normal = GL_TRUE; - __GLeeLink_GL_NV_texture_expand_normal(); - } - if (__GLeeCheckExtension("GL_NV_vertex_program2", &extensionNames) ) - { - _GLEE_NV_vertex_program2 = GL_TRUE; - __GLeeLink_GL_NV_vertex_program2(); - } - if (__GLeeCheckExtension("GL_ATI_map_object_buffer", &extensionNames) ) - { - _GLEE_ATI_map_object_buffer = GL_TRUE; - __GLeeLink_GL_ATI_map_object_buffer(); - } - if (__GLeeCheckExtension("GL_ATI_separate_stencil", &extensionNames) ) - { - _GLEE_ATI_separate_stencil = GL_TRUE; - __GLeeLink_GL_ATI_separate_stencil(); - } - if (__GLeeCheckExtension("GL_ATI_vertex_attrib_array_object", &extensionNames) ) - { - _GLEE_ATI_vertex_attrib_array_object = GL_TRUE; - __GLeeLink_GL_ATI_vertex_attrib_array_object(); - } - if (__GLeeCheckExtension("GL_OES_read_format", &extensionNames) ) - { - _GLEE_OES_read_format = GL_TRUE; - __GLeeLink_GL_OES_read_format(); - } - if (__GLeeCheckExtension("GL_EXT_depth_bounds_test", &extensionNames) ) - { - _GLEE_EXT_depth_bounds_test = GL_TRUE; - __GLeeLink_GL_EXT_depth_bounds_test(); - } - if (__GLeeCheckExtension("GL_EXT_texture_mirror_clamp", &extensionNames) ) - { - _GLEE_EXT_texture_mirror_clamp = GL_TRUE; - __GLeeLink_GL_EXT_texture_mirror_clamp(); - } - if (__GLeeCheckExtension("GL_EXT_blend_equation_separate", &extensionNames) ) - { - _GLEE_EXT_blend_equation_separate = GL_TRUE; - __GLeeLink_GL_EXT_blend_equation_separate(); - } - if (__GLeeCheckExtension("GL_MESA_pack_invert", &extensionNames) ) - { - _GLEE_MESA_pack_invert = GL_TRUE; - __GLeeLink_GL_MESA_pack_invert(); - } - if (__GLeeCheckExtension("GL_MESA_ycbcr_texture", &extensionNames) ) - { - _GLEE_MESA_ycbcr_texture = GL_TRUE; - __GLeeLink_GL_MESA_ycbcr_texture(); - } - if (__GLeeCheckExtension("GL_EXT_pixel_buffer_object", &extensionNames) ) - { - _GLEE_EXT_pixel_buffer_object = GL_TRUE; - __GLeeLink_GL_EXT_pixel_buffer_object(); - } - if (__GLeeCheckExtension("GL_NV_fragment_program_option", &extensionNames) ) - { - _GLEE_NV_fragment_program_option = GL_TRUE; - __GLeeLink_GL_NV_fragment_program_option(); - } - if (__GLeeCheckExtension("GL_NV_fragment_program2", &extensionNames) ) - { - _GLEE_NV_fragment_program2 = GL_TRUE; - __GLeeLink_GL_NV_fragment_program2(); - } - if (__GLeeCheckExtension("GL_NV_vertex_program2_option", &extensionNames) ) - { - _GLEE_NV_vertex_program2_option = GL_TRUE; - __GLeeLink_GL_NV_vertex_program2_option(); - } - if (__GLeeCheckExtension("GL_NV_vertex_program3", &extensionNames) ) - { - _GLEE_NV_vertex_program3 = GL_TRUE; - __GLeeLink_GL_NV_vertex_program3(); - } - if (__GLeeCheckExtension("GL_EXT_framebuffer_object", &extensionNames) ) - { - _GLEE_EXT_framebuffer_object = GL_TRUE; - __GLeeLink_GL_EXT_framebuffer_object(); - } - if (__GLeeCheckExtension("GL_GREMEDY_string_marker", &extensionNames) ) - { - _GLEE_GREMEDY_string_marker = GL_TRUE; - __GLeeLink_GL_GREMEDY_string_marker(); - } - if (__GLeeCheckExtension("GL_EXT_packed_depth_stencil", &extensionNames) ) - { - _GLEE_EXT_packed_depth_stencil = GL_TRUE; - __GLeeLink_GL_EXT_packed_depth_stencil(); - } - if (__GLeeCheckExtension("GL_EXT_stencil_clear_tag", &extensionNames) ) - { - _GLEE_EXT_stencil_clear_tag = GL_TRUE; - __GLeeLink_GL_EXT_stencil_clear_tag(); - } - if (__GLeeCheckExtension("GL_EXT_texture_sRGB", &extensionNames) ) - { - _GLEE_EXT_texture_sRGB = GL_TRUE; - __GLeeLink_GL_EXT_texture_sRGB(); - } - if (__GLeeCheckExtension("GL_EXT_framebuffer_blit", &extensionNames) ) - { - _GLEE_EXT_framebuffer_blit = GL_TRUE; - __GLeeLink_GL_EXT_framebuffer_blit(); - } - if (__GLeeCheckExtension("GL_EXT_framebuffer_multisample", &extensionNames) ) - { - _GLEE_EXT_framebuffer_multisample = GL_TRUE; - __GLeeLink_GL_EXT_framebuffer_multisample(); - } - if (__GLeeCheckExtension("GL_MESAX_texture_stack", &extensionNames) ) - { - _GLEE_MESAX_texture_stack = GL_TRUE; - __GLeeLink_GL_MESAX_texture_stack(); - } - if (__GLeeCheckExtension("GL_EXT_timer_query", &extensionNames) ) - { - _GLEE_EXT_timer_query = GL_TRUE; - __GLeeLink_GL_EXT_timer_query(); - } - if (__GLeeCheckExtension("GL_EXT_gpu_program_parameters", &extensionNames) ) - { - _GLEE_EXT_gpu_program_parameters = GL_TRUE; - __GLeeLink_GL_EXT_gpu_program_parameters(); - } - if (__GLeeCheckExtension("GL_APPLE_flush_buffer_range", &extensionNames) ) - { - _GLEE_APPLE_flush_buffer_range = GL_TRUE; - __GLeeLink_GL_APPLE_flush_buffer_range(); - } - if (__GLeeCheckExtension("GL_NV_gpu_program4", &extensionNames) ) - { - _GLEE_NV_gpu_program4 = GL_TRUE; - __GLeeLink_GL_NV_gpu_program4(); - } - if (__GLeeCheckExtension("GL_NV_geometry_program4", &extensionNames) ) - { - _GLEE_NV_geometry_program4 = GL_TRUE; - __GLeeLink_GL_NV_geometry_program4(); - } - if (__GLeeCheckExtension("GL_EXT_geometry_shader4", &extensionNames) ) - { - _GLEE_EXT_geometry_shader4 = GL_TRUE; - __GLeeLink_GL_EXT_geometry_shader4(); - } - if (__GLeeCheckExtension("GL_NV_vertex_program4", &extensionNames) ) - { - _GLEE_NV_vertex_program4 = GL_TRUE; - __GLeeLink_GL_NV_vertex_program4(); - } - if (__GLeeCheckExtension("GL_EXT_gpu_shader4", &extensionNames) ) - { - _GLEE_EXT_gpu_shader4 = GL_TRUE; - __GLeeLink_GL_EXT_gpu_shader4(); - } - if (__GLeeCheckExtension("GL_EXT_drawinstanced", &extensionNames) ) - { - _GLEE_EXT_drawinstanced = GL_TRUE; - __GLeeLink_GL_EXT_drawinstanced(); - } - if (__GLeeCheckExtension("GL_EXT_packed_float", &extensionNames) ) - { - _GLEE_EXT_packed_float = GL_TRUE; - __GLeeLink_GL_EXT_packed_float(); - } - if (__GLeeCheckExtension("GL_EXT_texture_array", &extensionNames) ) - { - _GLEE_EXT_texture_array = GL_TRUE; - __GLeeLink_GL_EXT_texture_array(); - } - if (__GLeeCheckExtension("GL_EXT_texture_buffer_object", &extensionNames) ) - { - _GLEE_EXT_texture_buffer_object = GL_TRUE; - __GLeeLink_GL_EXT_texture_buffer_object(); - } - if (__GLeeCheckExtension("GL_EXT_texture_compression_latc", &extensionNames) ) - { - _GLEE_EXT_texture_compression_latc = GL_TRUE; - __GLeeLink_GL_EXT_texture_compression_latc(); - } - if (__GLeeCheckExtension("GL_EXT_texture_compression_rgtc", &extensionNames) ) - { - _GLEE_EXT_texture_compression_rgtc = GL_TRUE; - __GLeeLink_GL_EXT_texture_compression_rgtc(); - } - if (__GLeeCheckExtension("GL_EXT_texture_shared_exponent", &extensionNames) ) - { - _GLEE_EXT_texture_shared_exponent = GL_TRUE; - __GLeeLink_GL_EXT_texture_shared_exponent(); - } - if (__GLeeCheckExtension("GL_NV_depth_buffer_float", &extensionNames) ) - { - _GLEE_NV_depth_buffer_float = GL_TRUE; - __GLeeLink_GL_NV_depth_buffer_float(); - } - if (__GLeeCheckExtension("GL_NV_fragment_program4", &extensionNames) ) - { - _GLEE_NV_fragment_program4 = GL_TRUE; - __GLeeLink_GL_NV_fragment_program4(); - } - if (__GLeeCheckExtension("GL_NV_framebuffer_multisample_coverage", &extensionNames) ) - { - _GLEE_NV_framebuffer_multisample_coverage = GL_TRUE; - __GLeeLink_GL_NV_framebuffer_multisample_coverage(); - } - if (__GLeeCheckExtension("GL_EXT_framebuffer_sRGB", &extensionNames) ) - { - _GLEE_EXT_framebuffer_sRGB = GL_TRUE; - __GLeeLink_GL_EXT_framebuffer_sRGB(); - } - if (__GLeeCheckExtension("GL_NV_geometry_shader4", &extensionNames) ) - { - _GLEE_NV_geometry_shader4 = GL_TRUE; - __GLeeLink_GL_NV_geometry_shader4(); - } - if (__GLeeCheckExtension("GL_NV_parameter_buffer_object", &extensionNames) ) - { - _GLEE_NV_parameter_buffer_object = GL_TRUE; - __GLeeLink_GL_NV_parameter_buffer_object(); - } - if (__GLeeCheckExtension("GL_EXT_draw_buffers2", &extensionNames) ) - { - _GLEE_EXT_draw_buffers2 = GL_TRUE; - __GLeeLink_GL_EXT_draw_buffers2(); - } - if (__GLeeCheckExtension("GL_NV_transform_feedback", &extensionNames) ) - { - _GLEE_NV_transform_feedback = GL_TRUE; - __GLeeLink_GL_NV_transform_feedback(); - } - if (__GLeeCheckExtension("GL_EXT_bindable_uniform", &extensionNames) ) - { - _GLEE_EXT_bindable_uniform = GL_TRUE; - __GLeeLink_GL_EXT_bindable_uniform(); - } - if (__GLeeCheckExtension("GL_EXT_texture_integer", &extensionNames) ) - { - _GLEE_EXT_texture_integer = GL_TRUE; - __GLeeLink_GL_EXT_texture_integer(); - } - if (__GLeeCheckExtension("GL_GREMEDY_frame_terminator", &extensionNames) ) - { - _GLEE_GREMEDY_frame_terminator = GL_TRUE; - __GLeeLink_GL_GREMEDY_frame_terminator(); - } - if (__GLeeCheckExtension("GL_NV_conditional_render", &extensionNames) ) - { - _GLEE_NV_conditional_render = GL_TRUE; - __GLeeLink_GL_NV_conditional_render(); - } - if (__GLeeCheckExtension("GL_NV_present_video", &extensionNames) ) - { - _GLEE_NV_present_video = GL_TRUE; - __GLeeLink_GL_NV_present_video(); - } - if (__GLeeCheckExtension("GL_EXT_transform_feedback", &extensionNames) ) - { - _GLEE_EXT_transform_feedback = GL_TRUE; - __GLeeLink_GL_EXT_transform_feedback(); - } - if (__GLeeCheckExtension("GL_EXT_direct_state_access", &extensionNames) ) - { - _GLEE_EXT_direct_state_access = GL_TRUE; - __GLeeLink_GL_EXT_direct_state_access(); - } - if (__GLeeCheckExtension("GL_EXT_vertex_array_bgra", &extensionNames) ) - { - _GLEE_EXT_vertex_array_bgra = GL_TRUE; - __GLeeLink_GL_EXT_vertex_array_bgra(); - } - if (__GLeeCheckExtension("GL_SGIX_texture_select", &extensionNames) ) - { - _GLEE_SGIX_texture_select = GL_TRUE; - __GLeeLink_GL_SGIX_texture_select(); - } - if (__GLeeCheckExtension("GL_INGR_blend_func_separate", &extensionNames) ) - { - _GLEE_INGR_blend_func_separate = GL_TRUE; - __GLeeLink_GL_INGR_blend_func_separate(); - } - if (__GLeeCheckExtension("GL_SGIX_depth_pass_instrument", &extensionNames) ) - { - _GLEE_SGIX_depth_pass_instrument = GL_TRUE; - __GLeeLink_GL_SGIX_depth_pass_instrument(); - } - if (__GLeeCheckExtension("GL_SGIX_igloo_interface", &extensionNames) ) - { - _GLEE_SGIX_igloo_interface = GL_TRUE; - __GLeeLink_GL_SGIX_igloo_interface(); - } - if (__GLeeCheckExtension("GL_EXT_fragment_lighting", &extensionNames) ) - { - _GLEE_EXT_fragment_lighting = GL_TRUE; - __GLeeLink_GL_EXT_fragment_lighting(); - } - if (__GLeeCheckExtension("GL_EXT_scene_marker", &extensionNames) ) - { - _GLEE_EXT_scene_marker = GL_TRUE; - __GLeeLink_GL_EXT_scene_marker(); - } - if (__GLeeCheckExtension("GL_EXT_texture_compression_dxt1", &extensionNames) ) - { - _GLEE_EXT_texture_compression_dxt1 = GL_TRUE; - __GLeeLink_GL_EXT_texture_compression_dxt1(); - } - if (__GLeeCheckExtension("GL_EXT_texture_env", &extensionNames) ) - { - _GLEE_EXT_texture_env = GL_TRUE; - __GLeeLink_GL_EXT_texture_env(); - } - if (__GLeeCheckExtension("GL_IBM_static_data", &extensionNames) ) - { - _GLEE_IBM_static_data = GL_TRUE; - __GLeeLink_GL_IBM_static_data(); - } - if (__GLeeCheckExtension("GL_OES_byte_coordinates", &extensionNames) ) - { - _GLEE_OES_byte_coordinates = GL_TRUE; - __GLeeLink_GL_OES_byte_coordinates(); - } - if (__GLeeCheckExtension("GL_OES_compressed_paletted_texture", &extensionNames) ) - { - _GLEE_OES_compressed_paletted_texture = GL_TRUE; - __GLeeLink_GL_OES_compressed_paletted_texture(); - } - if (__GLeeCheckExtension("GL_OES_single_precision", &extensionNames) ) - { - _GLEE_OES_single_precision = GL_TRUE; - __GLeeLink_GL_OES_single_precision(); - } - if (__GLeeCheckExtension("GL_SGIX_pixel_texture_bits", &extensionNames) ) - { - _GLEE_SGIX_pixel_texture_bits = GL_TRUE; - __GLeeLink_GL_SGIX_pixel_texture_bits(); - } - if (__GLeeCheckExtension("GL_SGIX_texture_range", &extensionNames) ) - { - _GLEE_SGIX_texture_range = GL_TRUE; - __GLeeLink_GL_SGIX_texture_range(); - } -#ifdef WIN32 - if (__GLeeCheckExtension("WGL_ARB_buffer_region", &extensionNames) ) - { - _GLEE_WGL_ARB_buffer_region = GL_TRUE; - __GLeeLink_WGL_ARB_buffer_region(); - } - if (__GLeeCheckExtension("WGL_ARB_multisample", &extensionNames) ) - { - _GLEE_WGL_ARB_multisample = GL_TRUE; - __GLeeLink_WGL_ARB_multisample(); - } - if (__GLeeCheckExtension("WGL_ARB_extensions_string", &extensionNames) ) - { - _GLEE_WGL_ARB_extensions_string = GL_TRUE; - __GLeeLink_WGL_ARB_extensions_string(); - } - if (__GLeeCheckExtension("WGL_ARB_pixel_format", &extensionNames) ) - { - _GLEE_WGL_ARB_pixel_format = GL_TRUE; - __GLeeLink_WGL_ARB_pixel_format(); - } - if (__GLeeCheckExtension("WGL_ARB_make_current_read", &extensionNames) ) - { - _GLEE_WGL_ARB_make_current_read = GL_TRUE; - __GLeeLink_WGL_ARB_make_current_read(); - } - if (__GLeeCheckExtension("WGL_ARB_pbuffer", &extensionNames) ) - { - _GLEE_WGL_ARB_pbuffer = GL_TRUE; - __GLeeLink_WGL_ARB_pbuffer(); - } - if (__GLeeCheckExtension("WGL_ARB_render_texture", &extensionNames) ) - { - _GLEE_WGL_ARB_render_texture = GL_TRUE; - __GLeeLink_WGL_ARB_render_texture(); - } - if (__GLeeCheckExtension("WGL_ARB_pixel_format_float", &extensionNames) ) - { - _GLEE_WGL_ARB_pixel_format_float = GL_TRUE; - __GLeeLink_WGL_ARB_pixel_format_float(); - } - if (__GLeeCheckExtension("WGL_ARB_create_context", &extensionNames) ) - { - _GLEE_WGL_ARB_create_context = GL_TRUE; - __GLeeLink_WGL_ARB_create_context(); - } - if (__GLeeCheckExtension("WGL_EXT_make_current_read", &extensionNames) ) - { - _GLEE_WGL_EXT_make_current_read = GL_TRUE; - __GLeeLink_WGL_EXT_make_current_read(); - } - if (__GLeeCheckExtension("WGL_EXT_pixel_format", &extensionNames) ) - { - _GLEE_WGL_EXT_pixel_format = GL_TRUE; - __GLeeLink_WGL_EXT_pixel_format(); - } - if (__GLeeCheckExtension("WGL_EXT_pbuffer", &extensionNames) ) - { - _GLEE_WGL_EXT_pbuffer = GL_TRUE; - __GLeeLink_WGL_EXT_pbuffer(); - } - if (__GLeeCheckExtension("WGL_EXT_depth_float", &extensionNames) ) - { - _GLEE_WGL_EXT_depth_float = GL_TRUE; - __GLeeLink_WGL_EXT_depth_float(); - } - if (__GLeeCheckExtension("WGL_3DFX_multisample", &extensionNames) ) - { - _GLEE_WGL_3DFX_multisample = GL_TRUE; - __GLeeLink_WGL_3DFX_multisample(); - } - if (__GLeeCheckExtension("WGL_EXT_multisample", &extensionNames) ) - { - _GLEE_WGL_EXT_multisample = GL_TRUE; - __GLeeLink_WGL_EXT_multisample(); - } - if (__GLeeCheckExtension("WGL_I3D_digital_video_control", &extensionNames) ) - { - _GLEE_WGL_I3D_digital_video_control = GL_TRUE; - __GLeeLink_WGL_I3D_digital_video_control(); - } - if (__GLeeCheckExtension("WGL_I3D_gamma", &extensionNames) ) - { - _GLEE_WGL_I3D_gamma = GL_TRUE; - __GLeeLink_WGL_I3D_gamma(); - } - if (__GLeeCheckExtension("WGL_I3D_genlock", &extensionNames) ) - { - _GLEE_WGL_I3D_genlock = GL_TRUE; - __GLeeLink_WGL_I3D_genlock(); - } - if (__GLeeCheckExtension("WGL_I3D_image_buffer", &extensionNames) ) - { - _GLEE_WGL_I3D_image_buffer = GL_TRUE; - __GLeeLink_WGL_I3D_image_buffer(); - } - if (__GLeeCheckExtension("WGL_I3D_swap_frame_lock", &extensionNames) ) - { - _GLEE_WGL_I3D_swap_frame_lock = GL_TRUE; - __GLeeLink_WGL_I3D_swap_frame_lock(); - } - if (__GLeeCheckExtension("WGL_NV_render_depth_texture", &extensionNames) ) - { - _GLEE_WGL_NV_render_depth_texture = GL_TRUE; - __GLeeLink_WGL_NV_render_depth_texture(); - } - if (__GLeeCheckExtension("WGL_NV_render_texture_rectangle", &extensionNames) ) - { - _GLEE_WGL_NV_render_texture_rectangle = GL_TRUE; - __GLeeLink_WGL_NV_render_texture_rectangle(); - } - if (__GLeeCheckExtension("WGL_ATI_pixel_format_float", &extensionNames) ) - { - _GLEE_WGL_ATI_pixel_format_float = GL_TRUE; - __GLeeLink_WGL_ATI_pixel_format_float(); - } - if (__GLeeCheckExtension("WGL_NV_float_buffer", &extensionNames) ) - { - _GLEE_WGL_NV_float_buffer = GL_TRUE; - __GLeeLink_WGL_NV_float_buffer(); - } - if (__GLeeCheckExtension("WGL_3DL_stereo_control", &extensionNames) ) - { - _GLEE_WGL_3DL_stereo_control = GL_TRUE; - __GLeeLink_WGL_3DL_stereo_control(); - } - if (__GLeeCheckExtension("WGL_EXT_pixel_format_packed_float", &extensionNames) ) - { - _GLEE_WGL_EXT_pixel_format_packed_float = GL_TRUE; - __GLeeLink_WGL_EXT_pixel_format_packed_float(); - } - if (__GLeeCheckExtension("WGL_EXT_framebuffer_sRGB", &extensionNames) ) - { - _GLEE_WGL_EXT_framebuffer_sRGB = GL_TRUE; - __GLeeLink_WGL_EXT_framebuffer_sRGB(); - } - if (__GLeeCheckExtension("WGL_NV_present_video", &extensionNames) ) - { - _GLEE_WGL_NV_present_video = GL_TRUE; - __GLeeLink_WGL_NV_present_video(); - } - if (__GLeeCheckExtension("WGL_NV_video_out", &extensionNames) ) - { - _GLEE_WGL_NV_video_out = GL_TRUE; - __GLeeLink_WGL_NV_video_out(); - } - if (__GLeeCheckExtension("WGL_NV_swap_group", &extensionNames) ) - { - _GLEE_WGL_NV_swap_group = GL_TRUE; - __GLeeLink_WGL_NV_swap_group(); - } - if (__GLeeCheckExtension("WGL_EXT_display_color_table", &extensionNames) ) - { - _GLEE_WGL_EXT_display_color_table = GL_TRUE; - __GLeeLink_WGL_EXT_display_color_table(); - } - if (__GLeeCheckExtension("WGL_EXT_extensions_string", &extensionNames) ) - { - _GLEE_WGL_EXT_extensions_string = GL_TRUE; - __GLeeLink_WGL_EXT_extensions_string(); - } - if (__GLeeCheckExtension("WGL_EXT_swap_control", &extensionNames) ) - { - _GLEE_WGL_EXT_swap_control = GL_TRUE; - __GLeeLink_WGL_EXT_swap_control(); - } - if (__GLeeCheckExtension("WGL_NV_vertex_array_range", &extensionNames) ) - { - _GLEE_WGL_NV_vertex_array_range = GL_TRUE; - __GLeeLink_WGL_NV_vertex_array_range(); - } - if (__GLeeCheckExtension("WGL_OML_sync_control", &extensionNames) ) - { - _GLEE_WGL_OML_sync_control = GL_TRUE; - __GLeeLink_WGL_OML_sync_control(); - } - if (__GLeeCheckExtension("WGL_I3D_swap_frame_usage", &extensionNames) ) - { - _GLEE_WGL_I3D_swap_frame_usage = GL_TRUE; - __GLeeLink_WGL_I3D_swap_frame_usage(); - } - if (__GLeeCheckExtension("WGL_NV_video_output", &extensionNames) ) - { - _GLEE_WGL_NV_video_output = GL_TRUE; - __GLeeLink_WGL_NV_video_output(); - } -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else /* GLX */ - if (__GLeeCheckExtension("GLX_VERSION_1_3", &extensionNames) ) - { - _GLEE_GLX_VERSION_1_3 = GL_TRUE; - __GLeeLink_GLX_VERSION_1_3(); - } - if (__GLeeCheckExtension("GLX_VERSION_1_4", &extensionNames) ) - { - _GLEE_GLX_VERSION_1_4 = GL_TRUE; - __GLeeLink_GLX_VERSION_1_4(); - } - if (__GLeeCheckExtension("GLX_ARB_multisample", &extensionNames) ) - { - _GLEE_GLX_ARB_multisample = GL_TRUE; - __GLeeLink_GLX_ARB_multisample(); - } - if (__GLeeCheckExtension("GLX_ARB_fbconfig_float", &extensionNames) ) - { - _GLEE_GLX_ARB_fbconfig_float = GL_TRUE; - __GLeeLink_GLX_ARB_fbconfig_float(); - } - if (__GLeeCheckExtension("GLX_SGIS_multisample", &extensionNames) ) - { - _GLEE_GLX_SGIS_multisample = GL_TRUE; - __GLeeLink_GLX_SGIS_multisample(); - } - if (__GLeeCheckExtension("GLX_EXT_visual_info", &extensionNames) ) - { - _GLEE_GLX_EXT_visual_info = GL_TRUE; - __GLeeLink_GLX_EXT_visual_info(); - } - if (__GLeeCheckExtension("GLX_SGI_swap_control", &extensionNames) ) - { - _GLEE_GLX_SGI_swap_control = GL_TRUE; - __GLeeLink_GLX_SGI_swap_control(); - } - if (__GLeeCheckExtension("GLX_SGI_video_sync", &extensionNames) ) - { - _GLEE_GLX_SGI_video_sync = GL_TRUE; - __GLeeLink_GLX_SGI_video_sync(); - } - if (__GLeeCheckExtension("GLX_SGI_make_current_read", &extensionNames) ) - { - _GLEE_GLX_SGI_make_current_read = GL_TRUE; - __GLeeLink_GLX_SGI_make_current_read(); - } - if (__GLeeCheckExtension("GLX_EXT_visual_rating", &extensionNames) ) - { - _GLEE_GLX_EXT_visual_rating = GL_TRUE; - __GLeeLink_GLX_EXT_visual_rating(); - } - if (__GLeeCheckExtension("GLX_EXT_import_context", &extensionNames) ) - { - _GLEE_GLX_EXT_import_context = GL_TRUE; - __GLeeLink_GLX_EXT_import_context(); - } - if (__GLeeCheckExtension("GLX_SGIX_fbconfig", &extensionNames) ) - { - _GLEE_GLX_SGIX_fbconfig = GL_TRUE; - __GLeeLink_GLX_SGIX_fbconfig(); - } - if (__GLeeCheckExtension("GLX_SGIX_pbuffer", &extensionNames) ) - { - _GLEE_GLX_SGIX_pbuffer = GL_TRUE; - __GLeeLink_GLX_SGIX_pbuffer(); - } - if (__GLeeCheckExtension("GLX_SGI_cushion", &extensionNames) ) - { - _GLEE_GLX_SGI_cushion = GL_TRUE; - __GLeeLink_GLX_SGI_cushion(); - } - if (__GLeeCheckExtension("GLX_SGIX_video_resize", &extensionNames) ) - { - _GLEE_GLX_SGIX_video_resize = GL_TRUE; - __GLeeLink_GLX_SGIX_video_resize(); - } - if (__GLeeCheckExtension("GLX_SGIX_swap_group", &extensionNames) ) - { - _GLEE_GLX_SGIX_swap_group = GL_TRUE; - __GLeeLink_GLX_SGIX_swap_group(); - } - if (__GLeeCheckExtension("GLX_SGIX_swap_barrier", &extensionNames) ) - { - _GLEE_GLX_SGIX_swap_barrier = GL_TRUE; - __GLeeLink_GLX_SGIX_swap_barrier(); - } - if (__GLeeCheckExtension("GLX_SGIS_blended_overlay", &extensionNames) ) - { - _GLEE_GLX_SGIS_blended_overlay = GL_TRUE; - __GLeeLink_GLX_SGIS_blended_overlay(); - } - if (__GLeeCheckExtension("GLX_SGIS_shared_multisample", &extensionNames) ) - { - _GLEE_GLX_SGIS_shared_multisample = GL_TRUE; - __GLeeLink_GLX_SGIS_shared_multisample(); - } - if (__GLeeCheckExtension("GLX_SUN_get_transparent_index", &extensionNames) ) - { - _GLEE_GLX_SUN_get_transparent_index = GL_TRUE; - __GLeeLink_GLX_SUN_get_transparent_index(); - } - if (__GLeeCheckExtension("GLX_3DFX_multisample", &extensionNames) ) - { - _GLEE_GLX_3DFX_multisample = GL_TRUE; - __GLeeLink_GLX_3DFX_multisample(); - } - if (__GLeeCheckExtension("GLX_MESA_copy_sub_buffer", &extensionNames) ) - { - _GLEE_GLX_MESA_copy_sub_buffer = GL_TRUE; - __GLeeLink_GLX_MESA_copy_sub_buffer(); - } - if (__GLeeCheckExtension("GLX_MESA_pixmap_colormap", &extensionNames) ) - { - _GLEE_GLX_MESA_pixmap_colormap = GL_TRUE; - __GLeeLink_GLX_MESA_pixmap_colormap(); - } - if (__GLeeCheckExtension("GLX_MESA_release_buffers", &extensionNames) ) - { - _GLEE_GLX_MESA_release_buffers = GL_TRUE; - __GLeeLink_GLX_MESA_release_buffers(); - } - if (__GLeeCheckExtension("GLX_MESA_set_3dfx_mode", &extensionNames) ) - { - _GLEE_GLX_MESA_set_3dfx_mode = GL_TRUE; - __GLeeLink_GLX_MESA_set_3dfx_mode(); - } - if (__GLeeCheckExtension("GLX_SGIX_visual_select_group", &extensionNames) ) - { - _GLEE_GLX_SGIX_visual_select_group = GL_TRUE; - __GLeeLink_GLX_SGIX_visual_select_group(); - } - if (__GLeeCheckExtension("GLX_OML_swap_method", &extensionNames) ) - { - _GLEE_GLX_OML_swap_method = GL_TRUE; - __GLeeLink_GLX_OML_swap_method(); - } - if (__GLeeCheckExtension("GLX_OML_sync_control", &extensionNames) ) - { - _GLEE_GLX_OML_sync_control = GL_TRUE; - __GLeeLink_GLX_OML_sync_control(); - } - if (__GLeeCheckExtension("GLX_NV_float_buffer", &extensionNames) ) - { - _GLEE_GLX_NV_float_buffer = GL_TRUE; - __GLeeLink_GLX_NV_float_buffer(); - } - if (__GLeeCheckExtension("GLX_SGIX_hyperpipe", &extensionNames) ) - { - _GLEE_GLX_SGIX_hyperpipe = GL_TRUE; - __GLeeLink_GLX_SGIX_hyperpipe(); - } - if (__GLeeCheckExtension("GLX_MESA_agp_offset", &extensionNames) ) - { - _GLEE_GLX_MESA_agp_offset = GL_TRUE; - __GLeeLink_GLX_MESA_agp_offset(); - } - if (__GLeeCheckExtension("GLX_EXT_fbconfig_packed_float", &extensionNames) ) - { - _GLEE_GLX_EXT_fbconfig_packed_float = GL_TRUE; - __GLeeLink_GLX_EXT_fbconfig_packed_float(); - } - if (__GLeeCheckExtension("GLX_EXT_framebuffer_sRGB", &extensionNames) ) - { - _GLEE_GLX_EXT_framebuffer_sRGB = GL_TRUE; - __GLeeLink_GLX_EXT_framebuffer_sRGB(); - } - if (__GLeeCheckExtension("GLX_EXT_texture_from_pixmap", &extensionNames) ) - { - _GLEE_GLX_EXT_texture_from_pixmap = GL_TRUE; - __GLeeLink_GLX_EXT_texture_from_pixmap(); - } - if (__GLeeCheckExtension("GLX_NV_present_video", &extensionNames) ) - { - _GLEE_GLX_NV_present_video = GL_TRUE; - __GLeeLink_GLX_NV_present_video(); - } - if (__GLeeCheckExtension("GLX_NV_video_out", &extensionNames) ) - { - _GLEE_GLX_NV_video_out = GL_TRUE; - __GLeeLink_GLX_NV_video_out(); - } - if (__GLeeCheckExtension("GLX_NV_swap_group", &extensionNames) ) - { - _GLEE_GLX_NV_swap_group = GL_TRUE; - __GLeeLink_GLX_NV_swap_group(); - } - if (__GLeeCheckExtension("GLX_EXT_scene_marker", &extensionNames) ) - { - _GLEE_GLX_EXT_scene_marker = GL_TRUE; - __GLeeLink_GLX_EXT_scene_marker(); - } - if (__GLeeCheckExtension("GLX_NV_video_output", &extensionNames) ) - { - _GLEE_GLX_NV_video_output = GL_TRUE; - __GLeeLink_GLX_NV_video_output(); - } -#endif /* end GLX */ - - __GLeeExtList_clean(&extensionNames); - return GL_TRUE; -} +/*************************************************************************** +* +* GLee.c +* GLee (OpenGL Easy Extension library) +* Version : 5.33 +* +* Copyright (c)2008 Ben Woodhouse All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer as +* the first lines of this file unmodified. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BEN WOODHOUSE ``AS IS'' AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL BEN WOODHOUSE BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +* Web: http://elf-stone.com/glee.php +* +* [This file was automatically generated by GLeeGen 6.0 +* +***************************************************************************/ + +#ifdef _MSC_VER + #pragma optimize( "g", off ) +#endif + +#include +#include +#include +#include "GLee.h" + +#if defined(__APPLE__) || defined(__APPLE_CC__) + #include +#endif + +typedef GLuint(*GLEE_LINK_FUNCTION)(void); + +GLboolean __GLeeInited=GL_FALSE; + +#ifndef _WIN32 + #define __stdcall /* nothing */ +#endif + +void * __GLeeGetProcAddress(const char *extname) +{ +#ifdef WIN32 + return (void*)wglGetProcAddress(extname); +#elif defined(__APPLE__) || defined(__APPLE_CC__) + CFBundleRef bundle; + CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/System/Library/Frameworks/OpenGL.framework"), kCFURLPOSIXPathStyle, true); + + CFStringRef functionName = CFStringCreateWithCString(kCFAllocatorDefault, extname, kCFStringEncodingASCII); + + void *function; + + bundle = CFBundleCreate(kCFAllocatorDefault, bundleURL); + assert(bundle != NULL); + + function = CFBundleGetFunctionPointerForName(bundle, functionName); + + CFRelease(bundleURL); + CFRelease(functionName); + CFRelease(bundle); + + return function; +#else + return (void*)glXGetProcAddressARB((const GLubyte *)extname); +#endif +} + + + + +/* Extension querying variables */ + +GLboolean _GLEE_VERSION_1_2 = GL_FALSE; +GLboolean _GLEE_ARB_imaging = GL_FALSE; +GLboolean _GLEE_VERSION_1_3 = GL_FALSE; +GLboolean _GLEE_VERSION_1_4 = GL_FALSE; +GLboolean _GLEE_VERSION_1_5 = GL_FALSE; +GLboolean _GLEE_VERSION_2_0 = GL_FALSE; +GLboolean _GLEE_VERSION_2_1 = GL_FALSE; +GLboolean _GLEE_VERSION_3_0 = GL_FALSE; +GLboolean _GLEE_ARB_multitexture = GL_FALSE; +GLboolean _GLEE_ARB_transpose_matrix = GL_FALSE; +GLboolean _GLEE_ARB_multisample = GL_FALSE; +GLboolean _GLEE_ARB_texture_env_add = GL_FALSE; +GLboolean _GLEE_ARB_texture_cube_map = GL_FALSE; +GLboolean _GLEE_ARB_texture_compression = GL_FALSE; +GLboolean _GLEE_ARB_texture_border_clamp = GL_FALSE; +GLboolean _GLEE_ARB_point_parameters = GL_FALSE; +GLboolean _GLEE_ARB_vertex_blend = GL_FALSE; +GLboolean _GLEE_ARB_matrix_palette = GL_FALSE; +GLboolean _GLEE_ARB_texture_env_combine = GL_FALSE; +GLboolean _GLEE_ARB_texture_env_crossbar = GL_FALSE; +GLboolean _GLEE_ARB_texture_env_dot3 = GL_FALSE; +GLboolean _GLEE_ARB_texture_mirrored_repeat = GL_FALSE; +GLboolean _GLEE_ARB_depth_texture = GL_FALSE; +GLboolean _GLEE_ARB_shadow = GL_FALSE; +GLboolean _GLEE_ARB_shadow_ambient = GL_FALSE; +GLboolean _GLEE_ARB_window_pos = GL_FALSE; +GLboolean _GLEE_ARB_vertex_program = GL_FALSE; +GLboolean _GLEE_ARB_fragment_program = GL_FALSE; +GLboolean _GLEE_ARB_vertex_buffer_object = GL_FALSE; +GLboolean _GLEE_ARB_occlusion_query = GL_FALSE; +GLboolean _GLEE_ARB_shader_objects = GL_FALSE; +GLboolean _GLEE_ARB_vertex_shader = GL_FALSE; +GLboolean _GLEE_ARB_fragment_shader = GL_FALSE; +GLboolean _GLEE_ARB_shading_language_100 = GL_FALSE; +GLboolean _GLEE_ARB_texture_non_power_of_two = GL_FALSE; +GLboolean _GLEE_ARB_point_sprite = GL_FALSE; +GLboolean _GLEE_ARB_fragment_program_shadow = GL_FALSE; +GLboolean _GLEE_ARB_draw_buffers = GL_FALSE; +GLboolean _GLEE_ARB_texture_rectangle = GL_FALSE; +GLboolean _GLEE_ARB_color_buffer_float = GL_FALSE; +GLboolean _GLEE_ARB_half_float_pixel = GL_FALSE; +GLboolean _GLEE_ARB_texture_float = GL_FALSE; +GLboolean _GLEE_ARB_pixel_buffer_object = GL_FALSE; +GLboolean _GLEE_ARB_depth_buffer_float = GL_FALSE; +GLboolean _GLEE_ARB_drawinstanced = GL_FALSE; +GLboolean _GLEE_ARB_framebuffer_object = GL_FALSE; +GLboolean _GLEE_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean _GLEE_ARB_geometry_shader4 = GL_FALSE; +GLboolean _GLEE_ARB_half_float_vertex = GL_FALSE; +GLboolean _GLEE_ARBinstanced_arrays = GL_FALSE; +GLboolean _GLEE_ARB_map_buffer_range = GL_FALSE; +GLboolean _GLEE_ARB_texture_buffer_object = GL_FALSE; +GLboolean _GLEE_ARB_texture_compression_rgtc = GL_FALSE; +GLboolean _GLEE_ARB_texture_rg = GL_FALSE; +GLboolean _GLEE_ARB_vertex_array_object = GL_FALSE; +GLboolean _GLEE_EXT_abgr = GL_FALSE; +GLboolean _GLEE_EXT_blend_color = GL_FALSE; +GLboolean _GLEE_EXT_polygon_offset = GL_FALSE; +GLboolean _GLEE_EXT_texture = GL_FALSE; +GLboolean _GLEE_EXT_texture3D = GL_FALSE; +GLboolean _GLEE_SGIS_texture_filter4 = GL_FALSE; +GLboolean _GLEE_EXT_subtexture = GL_FALSE; +GLboolean _GLEE_EXT_copy_texture = GL_FALSE; +GLboolean _GLEE_EXT_histogram = GL_FALSE; +GLboolean _GLEE_EXT_convolution = GL_FALSE; +GLboolean _GLEE_SGI_color_matrix = GL_FALSE; +GLboolean _GLEE_SGI_color_table = GL_FALSE; +GLboolean _GLEE_SGIS_pixel_texture = GL_FALSE; +GLboolean _GLEE_SGIX_pixel_texture = GL_FALSE; +GLboolean _GLEE_SGIS_texture4D = GL_FALSE; +GLboolean _GLEE_SGI_texture_color_table = GL_FALSE; +GLboolean _GLEE_EXT_cmyka = GL_FALSE; +GLboolean _GLEE_EXT_texture_object = GL_FALSE; +GLboolean _GLEE_SGIS_detail_texture = GL_FALSE; +GLboolean _GLEE_SGIS_sharpen_texture = GL_FALSE; +GLboolean _GLEE_EXT_packed_pixels = GL_FALSE; +GLboolean _GLEE_SGIS_texture_lod = GL_FALSE; +GLboolean _GLEE_SGIS_multisample = GL_FALSE; +GLboolean _GLEE_EXT_rescale_normal = GL_FALSE; +GLboolean _GLEE_EXT_vertex_array = GL_FALSE; +GLboolean _GLEE_EXT_misc_attribute = GL_FALSE; +GLboolean _GLEE_SGIS_generate_mipmap = GL_FALSE; +GLboolean _GLEE_SGIX_clipmap = GL_FALSE; +GLboolean _GLEE_SGIX_shadow = GL_FALSE; +GLboolean _GLEE_SGIS_texture_edge_clamp = GL_FALSE; +GLboolean _GLEE_SGIS_texture_border_clamp = GL_FALSE; +GLboolean _GLEE_EXT_blend_minmax = GL_FALSE; +GLboolean _GLEE_EXT_blend_subtract = GL_FALSE; +GLboolean _GLEE_EXT_blend_logic_op = GL_FALSE; +GLboolean _GLEE_SGIX_interlace = GL_FALSE; +GLboolean _GLEE_SGIX_pixel_tiles = GL_FALSE; +GLboolean _GLEE_SGIS_texture_select = GL_FALSE; +GLboolean _GLEE_SGIX_sprite = GL_FALSE; +GLboolean _GLEE_SGIX_texture_multi_buffer = GL_FALSE; +GLboolean _GLEE_EXT_point_parameters = GL_FALSE; +GLboolean _GLEE_SGIS_point_parameters = GL_FALSE; +GLboolean _GLEE_SGIX_instruments = GL_FALSE; +GLboolean _GLEE_SGIX_texture_scale_bias = GL_FALSE; +GLboolean _GLEE_SGIX_framezoom = GL_FALSE; +GLboolean _GLEE_SGIX_tag_sample_buffer = GL_FALSE; +GLboolean _GLEE_FfdMaskSGIX = GL_FALSE; +GLboolean _GLEE_SGIX_polynomial_ffd = GL_FALSE; +GLboolean _GLEE_SGIX_reference_plane = GL_FALSE; +GLboolean _GLEE_SGIX_flush_raster = GL_FALSE; +GLboolean _GLEE_SGIX_depth_texture = GL_FALSE; +GLboolean _GLEE_SGIS_fog_function = GL_FALSE; +GLboolean _GLEE_SGIX_fog_offset = GL_FALSE; +GLboolean _GLEE_HP_image_transform = GL_FALSE; +GLboolean _GLEE_HP_convolution_border_modes = GL_FALSE; +GLboolean _GLEE_INGR_palette_buffer = GL_FALSE; +GLboolean _GLEE_SGIX_texture_add_env = GL_FALSE; +GLboolean _GLEE_EXT_color_subtable = GL_FALSE; +GLboolean _GLEE_PGI_vertex_hints = GL_FALSE; +GLboolean _GLEE_PGI_misc_hints = GL_FALSE; +GLboolean _GLEE_EXT_paletted_texture = GL_FALSE; +GLboolean _GLEE_EXT_clip_volume_hint = GL_FALSE; +GLboolean _GLEE_SGIX_list_priority = GL_FALSE; +GLboolean _GLEE_SGIX_ir_instrument1 = GL_FALSE; +GLboolean _GLEE_SGIX_calligraphic_fragment = GL_FALSE; +GLboolean _GLEE_SGIX_texture_lod_bias = GL_FALSE; +GLboolean _GLEE_SGIX_shadow_ambient = GL_FALSE; +GLboolean _GLEE_EXT_index_texture = GL_FALSE; +GLboolean _GLEE_EXT_index_material = GL_FALSE; +GLboolean _GLEE_EXT_index_func = GL_FALSE; +GLboolean _GLEE_EXT_index_array_formats = GL_FALSE; +GLboolean _GLEE_EXT_compiled_vertex_array = GL_FALSE; +GLboolean _GLEE_EXT_cull_vertex = GL_FALSE; +GLboolean _GLEE_SGIX_ycrcb = GL_FALSE; +GLboolean _GLEE_SGIX_fragment_lighting = GL_FALSE; +GLboolean _GLEE_IBM_rasterpos_clip = GL_FALSE; +GLboolean _GLEE_HP_texture_lighting = GL_FALSE; +GLboolean _GLEE_EXT_draw_range_elements = GL_FALSE; +GLboolean _GLEE_WIN_phong_shading = GL_FALSE; +GLboolean _GLEE_WIN_specular_fog = GL_FALSE; +GLboolean _GLEE_EXT_light_texture = GL_FALSE; +GLboolean _GLEE_SGIX_blend_alpha_minmax = GL_FALSE; +GLboolean _GLEE_SGIX_impact_pixel_texture = GL_FALSE; +GLboolean _GLEE_EXT_bgra = GL_FALSE; +GLboolean _GLEE_SGIX_async = GL_FALSE; +GLboolean _GLEE_SGIX_async_pixel = GL_FALSE; +GLboolean _GLEE_SGIX_async_histogram = GL_FALSE; +GLboolean _GLEE_INTEL_texture_scissor = GL_FALSE; +GLboolean _GLEE_INTEL_parallel_arrays = GL_FALSE; +GLboolean _GLEE_HP_occlusion_test = GL_FALSE; +GLboolean _GLEE_EXT_pixel_transform = GL_FALSE; +GLboolean _GLEE_EXT_pixel_transform_color_table = GL_FALSE; +GLboolean _GLEE_EXT_shared_texture_palette = GL_FALSE; +GLboolean _GLEE_EXT_separate_specular_color = GL_FALSE; +GLboolean _GLEE_EXT_secondary_color = GL_FALSE; +GLboolean _GLEE_EXT_texture_perturb_normal = GL_FALSE; +GLboolean _GLEE_EXT_multi_draw_arrays = GL_FALSE; +GLboolean _GLEE_EXT_fog_coord = GL_FALSE; +GLboolean _GLEE_REND_screen_coordinates = GL_FALSE; +GLboolean _GLEE_EXT_coordinate_frame = GL_FALSE; +GLboolean _GLEE_EXT_texture_env_combine = GL_FALSE; +GLboolean _GLEE_APPLE_specular_vector = GL_FALSE; +GLboolean _GLEE_APPLE_transform_hint = GL_FALSE; +GLboolean _GLEE_SGIX_fog_scale = GL_FALSE; +GLboolean _GLEE_SUNX_constant_data = GL_FALSE; +GLboolean _GLEE_SUN_global_alpha = GL_FALSE; +GLboolean _GLEE_SUN_triangle_list = GL_FALSE; +GLboolean _GLEE_SUN_vertex = GL_FALSE; +GLboolean _GLEE_EXT_blend_func_separate = GL_FALSE; +GLboolean _GLEE_INGR_color_clamp = GL_FALSE; +GLboolean _GLEE_INGR_interlace_read = GL_FALSE; +GLboolean _GLEE_EXT_stencil_wrap = GL_FALSE; +GLboolean _GLEE_EXT_422_pixels = GL_FALSE; +GLboolean _GLEE_NV_texgen_reflection = GL_FALSE; +GLboolean _GLEE_EXT_texture_cube_map = GL_FALSE; +GLboolean _GLEE_SUN_convolution_border_modes = GL_FALSE; +GLboolean _GLEE_EXT_texture_env_add = GL_FALSE; +GLboolean _GLEE_EXT_texture_lod_bias = GL_FALSE; +GLboolean _GLEE_EXT_texture_filter_anisotropic = GL_FALSE; +GLboolean _GLEE_EXT_vertex_weighting = GL_FALSE; +GLboolean _GLEE_NV_light_max_exponent = GL_FALSE; +GLboolean _GLEE_NV_vertex_array_range = GL_FALSE; +GLboolean _GLEE_NV_register_combiners = GL_FALSE; +GLboolean _GLEE_NV_fog_distance = GL_FALSE; +GLboolean _GLEE_NV_texgen_emboss = GL_FALSE; +GLboolean _GLEE_NV_blend_square = GL_FALSE; +GLboolean _GLEE_NV_texture_env_combine4 = GL_FALSE; +GLboolean _GLEE_MESA_resize_buffers = GL_FALSE; +GLboolean _GLEE_MESA_window_pos = GL_FALSE; +GLboolean _GLEE_EXT_texture_compression_s3tc = GL_FALSE; +GLboolean _GLEE_IBM_cull_vertex = GL_FALSE; +GLboolean _GLEE_IBM_multimode_draw_arrays = GL_FALSE; +GLboolean _GLEE_IBM_vertex_array_lists = GL_FALSE; +GLboolean _GLEE_SGIX_subsample = GL_FALSE; +GLboolean _GLEE_SGIX_ycrcb_subsample = GL_FALSE; +GLboolean _GLEE_SGIX_ycrcba = GL_FALSE; +GLboolean _GLEE_SGI_depth_pass_instrument = GL_FALSE; +GLboolean _GLEE_3DFX_texture_compression_FXT1 = GL_FALSE; +GLboolean _GLEE_3DFX_multisample = GL_FALSE; +GLboolean _GLEE_3DFX_tbuffer = GL_FALSE; +GLboolean _GLEE_EXT_multisample = GL_FALSE; +GLboolean _GLEE_SGIX_vertex_preclip = GL_FALSE; +GLboolean _GLEE_SGIX_convolution_accuracy = GL_FALSE; +GLboolean _GLEE_SGIX_resample = GL_FALSE; +GLboolean _GLEE_SGIS_point_line_texgen = GL_FALSE; +GLboolean _GLEE_SGIS_texture_color_mask = GL_FALSE; +GLboolean _GLEE_EXT_texture_env_dot3 = GL_FALSE; +GLboolean _GLEE_ATI_texture_mirror_once = GL_FALSE; +GLboolean _GLEE_NV_fence = GL_FALSE; +GLboolean _GLEE_IBM_texture_mirrored_repeat = GL_FALSE; +GLboolean _GLEE_NV_evaluators = GL_FALSE; +GLboolean _GLEE_NV_packed_depth_stencil = GL_FALSE; +GLboolean _GLEE_NV_register_combiners2 = GL_FALSE; +GLboolean _GLEE_NV_texture_compression_vtc = GL_FALSE; +GLboolean _GLEE_NV_texture_rectangle = GL_FALSE; +GLboolean _GLEE_NV_texture_shader = GL_FALSE; +GLboolean _GLEE_NV_texture_shader2 = GL_FALSE; +GLboolean _GLEE_NV_vertex_array_range2 = GL_FALSE; +GLboolean _GLEE_NV_vertex_program = GL_FALSE; +GLboolean _GLEE_SGIX_texture_coordinate_clamp = GL_FALSE; +GLboolean _GLEE_SGIX_scalebias_hint = GL_FALSE; +GLboolean _GLEE_OML_interlace = GL_FALSE; +GLboolean _GLEE_OML_subsample = GL_FALSE; +GLboolean _GLEE_OML_resample = GL_FALSE; +GLboolean _GLEE_NV_copy_depth_to_color = GL_FALSE; +GLboolean _GLEE_ATI_envmap_bumpmap = GL_FALSE; +GLboolean _GLEE_ATI_fragment_shader = GL_FALSE; +GLboolean _GLEE_ATI_pn_triangles = GL_FALSE; +GLboolean _GLEE_ATI_vertex_array_object = GL_FALSE; +GLboolean _GLEE_EXT_vertex_shader = GL_FALSE; +GLboolean _GLEE_ATI_vertex_streams = GL_FALSE; +GLboolean _GLEE_ATI_element_array = GL_FALSE; +GLboolean _GLEE_SUN_mesh_array = GL_FALSE; +GLboolean _GLEE_SUN_slice_accum = GL_FALSE; +GLboolean _GLEE_NV_multisample_filter_hint = GL_FALSE; +GLboolean _GLEE_NV_depth_clamp = GL_FALSE; +GLboolean _GLEE_NV_occlusion_query = GL_FALSE; +GLboolean _GLEE_NV_point_sprite = GL_FALSE; +GLboolean _GLEE_NV_texture_shader3 = GL_FALSE; +GLboolean _GLEE_NV_vertex_program1_1 = GL_FALSE; +GLboolean _GLEE_EXT_shadow_funcs = GL_FALSE; +GLboolean _GLEE_EXT_stencil_two_side = GL_FALSE; +GLboolean _GLEE_ATI_text_fragment_shader = GL_FALSE; +GLboolean _GLEE_APPLE_client_storage = GL_FALSE; +GLboolean _GLEE_APPLE_element_array = GL_FALSE; +GLboolean _GLEE_APPLE_fence = GL_FALSE; +GLboolean _GLEE_APPLE_vertex_array_object = GL_FALSE; +GLboolean _GLEE_APPLE_vertex_array_range = GL_FALSE; +GLboolean _GLEE_APPLE_ycbcr_422 = GL_FALSE; +GLboolean _GLEE_S3_s3tc = GL_FALSE; +GLboolean _GLEE_ATI_draw_buffers = GL_FALSE; +GLboolean _GLEE_ATI_pixel_format_float = GL_FALSE; +GLboolean _GLEE_ATI_texture_env_combine3 = GL_FALSE; +GLboolean _GLEE_ATI_texture_float = GL_FALSE; +GLboolean _GLEE_NV_float_buffer = GL_FALSE; +GLboolean _GLEE_NV_fragment_program = GL_FALSE; +GLboolean _GLEE_NV_half_float = GL_FALSE; +GLboolean _GLEE_NV_pixel_data_range = GL_FALSE; +GLboolean _GLEE_NV_primitive_restart = GL_FALSE; +GLboolean _GLEE_NV_texture_expand_normal = GL_FALSE; +GLboolean _GLEE_NV_vertex_program2 = GL_FALSE; +GLboolean _GLEE_ATI_map_object_buffer = GL_FALSE; +GLboolean _GLEE_ATI_separate_stencil = GL_FALSE; +GLboolean _GLEE_ATI_vertex_attrib_array_object = GL_FALSE; +GLboolean _GLEE_OES_read_format = GL_FALSE; +GLboolean _GLEE_EXT_depth_bounds_test = GL_FALSE; +GLboolean _GLEE_EXT_texture_mirror_clamp = GL_FALSE; +GLboolean _GLEE_EXT_blend_equation_separate = GL_FALSE; +GLboolean _GLEE_MESA_pack_invert = GL_FALSE; +GLboolean _GLEE_MESA_ycbcr_texture = GL_FALSE; +GLboolean _GLEE_EXT_pixel_buffer_object = GL_FALSE; +GLboolean _GLEE_NV_fragment_program_option = GL_FALSE; +GLboolean _GLEE_NV_fragment_program2 = GL_FALSE; +GLboolean _GLEE_NV_vertex_program2_option = GL_FALSE; +GLboolean _GLEE_NV_vertex_program3 = GL_FALSE; +GLboolean _GLEE_EXT_framebuffer_object = GL_FALSE; +GLboolean _GLEE_GREMEDY_string_marker = GL_FALSE; +GLboolean _GLEE_EXT_packed_depth_stencil = GL_FALSE; +GLboolean _GLEE_EXT_stencil_clear_tag = GL_FALSE; +GLboolean _GLEE_EXT_texture_sRGB = GL_FALSE; +GLboolean _GLEE_EXT_framebuffer_blit = GL_FALSE; +GLboolean _GLEE_EXT_framebuffer_multisample = GL_FALSE; +GLboolean _GLEE_MESAX_texture_stack = GL_FALSE; +GLboolean _GLEE_EXT_timer_query = GL_FALSE; +GLboolean _GLEE_EXT_gpu_program_parameters = GL_FALSE; +GLboolean _GLEE_APPLE_flush_buffer_range = GL_FALSE; +GLboolean _GLEE_NV_gpu_program4 = GL_FALSE; +GLboolean _GLEE_NV_geometry_program4 = GL_FALSE; +GLboolean _GLEE_EXT_geometry_shader4 = GL_FALSE; +GLboolean _GLEE_NV_vertex_program4 = GL_FALSE; +GLboolean _GLEE_EXT_gpu_shader4 = GL_FALSE; +GLboolean _GLEE_EXT_drawinstanced = GL_FALSE; +GLboolean _GLEE_EXT_packed_float = GL_FALSE; +GLboolean _GLEE_EXT_texture_array = GL_FALSE; +GLboolean _GLEE_EXT_texture_buffer_object = GL_FALSE; +GLboolean _GLEE_EXT_texture_compression_latc = GL_FALSE; +GLboolean _GLEE_EXT_texture_compression_rgtc = GL_FALSE; +GLboolean _GLEE_EXT_texture_shared_exponent = GL_FALSE; +GLboolean _GLEE_NV_depth_buffer_float = GL_FALSE; +GLboolean _GLEE_NV_fragment_program4 = GL_FALSE; +GLboolean _GLEE_NV_framebuffer_multisample_coverage = GL_FALSE; +GLboolean _GLEE_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean _GLEE_NV_geometry_shader4 = GL_FALSE; +GLboolean _GLEE_NV_parameter_buffer_object = GL_FALSE; +GLboolean _GLEE_EXT_draw_buffers2 = GL_FALSE; +GLboolean _GLEE_NV_transform_feedback = GL_FALSE; +GLboolean _GLEE_EXT_bindable_uniform = GL_FALSE; +GLboolean _GLEE_EXT_texture_integer = GL_FALSE; +GLboolean _GLEE_GREMEDY_frame_terminator = GL_FALSE; +GLboolean _GLEE_NV_conditional_render = GL_FALSE; +GLboolean _GLEE_NV_present_video = GL_FALSE; +GLboolean _GLEE_EXT_transform_feedback = GL_FALSE; +GLboolean _GLEE_EXT_direct_state_access = GL_FALSE; +GLboolean _GLEE_EXT_vertex_array_bgra = GL_FALSE; +GLboolean _GLEE_SGIX_texture_select = GL_FALSE; +GLboolean _GLEE_INGR_blend_func_separate = GL_FALSE; +GLboolean _GLEE_SGIX_depth_pass_instrument = GL_FALSE; +GLboolean _GLEE_SGIX_igloo_interface = GL_FALSE; +GLboolean _GLEE_EXT_fragment_lighting = GL_FALSE; +GLboolean _GLEE_EXT_scene_marker = GL_FALSE; +GLboolean _GLEE_EXT_texture_compression_dxt1 = GL_FALSE; +GLboolean _GLEE_EXT_texture_env = GL_FALSE; +GLboolean _GLEE_IBM_static_data = GL_FALSE; +GLboolean _GLEE_OES_byte_coordinates = GL_FALSE; +GLboolean _GLEE_OES_compressed_paletted_texture = GL_FALSE; +GLboolean _GLEE_OES_single_precision = GL_FALSE; +GLboolean _GLEE_SGIX_pixel_texture_bits = GL_FALSE; +GLboolean _GLEE_SGIX_texture_range = GL_FALSE; + +/* GL Extension names */ + +char __GLeeGLExtensionNames[322][39]={ + "GL_VERSION_1_2", + "GL_ARB_imaging", + "GL_VERSION_1_3", + "GL_VERSION_1_4", + "GL_VERSION_1_5", + "GL_VERSION_2_0", + "GL_VERSION_2_1", + "GL_VERSION_3_0", + "GL_ARB_multitexture", + "GL_ARB_transpose_matrix", + "GL_ARB_multisample", + "GL_ARB_texture_env_add", + "GL_ARB_texture_cube_map", + "GL_ARB_texture_compression", + "GL_ARB_texture_border_clamp", + "GL_ARB_point_parameters", + "GL_ARB_vertex_blend", + "GL_ARB_matrix_palette", + "GL_ARB_texture_env_combine", + "GL_ARB_texture_env_crossbar", + "GL_ARB_texture_env_dot3", + "GL_ARB_texture_mirrored_repeat", + "GL_ARB_depth_texture", + "GL_ARB_shadow", + "GL_ARB_shadow_ambient", + "GL_ARB_window_pos", + "GL_ARB_vertex_program", + "GL_ARB_fragment_program", + "GL_ARB_vertex_buffer_object", + "GL_ARB_occlusion_query", + "GL_ARB_shader_objects", + "GL_ARB_vertex_shader", + "GL_ARB_fragment_shader", + "GL_ARB_shading_language_100", + "GL_ARB_texture_non_power_of_two", + "GL_ARB_point_sprite", + "GL_ARB_fragment_program_shadow", + "GL_ARB_draw_buffers", + "GL_ARB_texture_rectangle", + "GL_ARB_color_buffer_float", + "GL_ARB_half_float_pixel", + "GL_ARB_texture_float", + "GL_ARB_pixel_buffer_object", + "GL_ARB_depth_buffer_float", + "GL_ARB_drawinstanced", + "GL_ARB_framebuffer_object", + "GL_ARB_framebuffer_sRGB", + "GL_ARB_geometry_shader4", + "GL_ARB_half_float_vertex", + "GL_ARBinstanced_arrays", + "GL_ARB_map_buffer_range", + "GL_ARB_texture_buffer_object", + "GL_ARB_texture_compression_rgtc", + "GL_ARB_texture_rg", + "GL_ARB_vertex_array_object", + "GL_EXT_abgr", + "GL_EXT_blend_color", + "GL_EXT_polygon_offset", + "GL_EXT_texture", + "GL_EXT_texture3D", + "GL_SGIS_texture_filter4", + "GL_EXT_subtexture", + "GL_EXT_copy_texture", + "GL_EXT_histogram", + "GL_EXT_convolution", + "GL_SGI_color_matrix", + "GL_SGI_color_table", + "GL_SGIS_pixel_texture", + "GL_SGIX_pixel_texture", + "GL_SGIS_texture4D", + "GL_SGI_texture_color_table", + "GL_EXT_cmyka", + "GL_EXT_texture_object", + "GL_SGIS_detail_texture", + "GL_SGIS_sharpen_texture", + "GL_EXT_packed_pixels", + "GL_SGIS_texture_lod", + "GL_SGIS_multisample", + "GL_EXT_rescale_normal", + "GL_EXT_vertex_array", + "GL_EXT_misc_attribute", + "GL_SGIS_generate_mipmap", + "GL_SGIX_clipmap", + "GL_SGIX_shadow", + "GL_SGIS_texture_edge_clamp", + "GL_SGIS_texture_border_clamp", + "GL_EXT_blend_minmax", + "GL_EXT_blend_subtract", + "GL_EXT_blend_logic_op", + "GL_SGIX_interlace", + "GL_SGIX_pixel_tiles", + "GL_SGIS_texture_select", + "GL_SGIX_sprite", + "GL_SGIX_texture_multi_buffer", + "GL_EXT_point_parameters", + "GL_SGIS_point_parameters", + "GL_SGIX_instruments", + "GL_SGIX_texture_scale_bias", + "GL_SGIX_framezoom", + "GL_SGIX_tag_sample_buffer", + "GL_FfdMaskSGIX", + "GL_SGIX_polynomial_ffd", + "GL_SGIX_reference_plane", + "GL_SGIX_flush_raster", + "GL_SGIX_depth_texture", + "GL_SGIS_fog_function", + "GL_SGIX_fog_offset", + "GL_HP_image_transform", + "GL_HP_convolution_border_modes", + "GL_INGR_palette_buffer", + "GL_SGIX_texture_add_env", + "GL_EXT_color_subtable", + "GL_PGI_vertex_hints", + "GL_PGI_misc_hints", + "GL_EXT_paletted_texture", + "GL_EXT_clip_volume_hint", + "GL_SGIX_list_priority", + "GL_SGIX_ir_instrument1", + "GL_SGIX_calligraphic_fragment", + "GL_SGIX_texture_lod_bias", + "GL_SGIX_shadow_ambient", + "GL_EXT_index_texture", + "GL_EXT_index_material", + "GL_EXT_index_func", + "GL_EXT_index_array_formats", + "GL_EXT_compiled_vertex_array", + "GL_EXT_cull_vertex", + "GL_SGIX_ycrcb", + "GL_SGIX_fragment_lighting", + "GL_IBM_rasterpos_clip", + "GL_HP_texture_lighting", + "GL_EXT_draw_range_elements", + "GL_WIN_phong_shading", + "GL_WIN_specular_fog", + "GL_EXT_light_texture", + "GL_SGIX_blend_alpha_minmax", + "GL_SGIX_impact_pixel_texture", + "GL_EXT_bgra", + "GL_SGIX_async", + "GL_SGIX_async_pixel", + "GL_SGIX_async_histogram", + "GL_INTEL_texture_scissor", + "GL_INTEL_parallel_arrays", + "GL_HP_occlusion_test", + "GL_EXT_pixel_transform", + "GL_EXT_pixel_transform_color_table", + "GL_EXT_shared_texture_palette", + "GL_EXT_separate_specular_color", + "GL_EXT_secondary_color", + "GL_EXT_texture_perturb_normal", + "GL_EXT_multi_draw_arrays", + "GL_EXT_fog_coord", + "GL_REND_screen_coordinates", + "GL_EXT_coordinate_frame", + "GL_EXT_texture_env_combine", + "GL_APPLE_specular_vector", + "GL_APPLE_transform_hint", + "GL_SGIX_fog_scale", + "GL_SUNX_constant_data", + "GL_SUN_global_alpha", + "GL_SUN_triangle_list", + "GL_SUN_vertex", + "GL_EXT_blend_func_separate", + "GL_INGR_color_clamp", + "GL_INGR_interlace_read", + "GL_EXT_stencil_wrap", + "GL_EXT_422_pixels", + "GL_NV_texgen_reflection", + "GL_EXT_texture_cube_map", + "GL_SUN_convolution_border_modes", + "GL_EXT_texture_env_add", + "GL_EXT_texture_lod_bias", + "GL_EXT_texture_filter_anisotropic", + "GL_EXT_vertex_weighting", + "GL_NV_light_max_exponent", + "GL_NV_vertex_array_range", + "GL_NV_register_combiners", + "GL_NV_fog_distance", + "GL_NV_texgen_emboss", + "GL_NV_blend_square", + "GL_NV_texture_env_combine4", + "GL_MESA_resize_buffers", + "GL_MESA_window_pos", + "GL_EXT_texture_compression_s3tc", + "GL_IBM_cull_vertex", + "GL_IBM_multimode_draw_arrays", + "GL_IBM_vertex_array_lists", + "GL_SGIX_subsample", + "GL_SGIX_ycrcb_subsample", + "GL_SGIX_ycrcba", + "GL_SGI_depth_pass_instrument", + "GL_3DFX_texture_compression_FXT1", + "GL_3DFX_multisample", + "GL_3DFX_tbuffer", + "GL_EXT_multisample", + "GL_SGIX_vertex_preclip", + "GL_SGIX_convolution_accuracy", + "GL_SGIX_resample", + "GL_SGIS_point_line_texgen", + "GL_SGIS_texture_color_mask", + "GL_EXT_texture_env_dot3", + "GL_ATI_texture_mirror_once", + "GL_NV_fence", + "GL_IBM_texture_mirrored_repeat", + "GL_NV_evaluators", + "GL_NV_packed_depth_stencil", + "GL_NV_register_combiners2", + "GL_NV_texture_compression_vtc", + "GL_NV_texture_rectangle", + "GL_NV_texture_shader", + "GL_NV_texture_shader2", + "GL_NV_vertex_array_range2", + "GL_NV_vertex_program", + "GL_SGIX_texture_coordinate_clamp", + "GL_SGIX_scalebias_hint", + "GL_OML_interlace", + "GL_OML_subsample", + "GL_OML_resample", + "GL_NV_copy_depth_to_color", + "GL_ATI_envmap_bumpmap", + "GL_ATI_fragment_shader", + "GL_ATI_pn_triangles", + "GL_ATI_vertex_array_object", + "GL_EXT_vertex_shader", + "GL_ATI_vertex_streams", + "GL_ATI_element_array", + "GL_SUN_mesh_array", + "GL_SUN_slice_accum", + "GL_NV_multisample_filter_hint", + "GL_NV_depth_clamp", + "GL_NV_occlusion_query", + "GL_NV_point_sprite", + "GL_NV_texture_shader3", + "GL_NV_vertex_program1_1", + "GL_EXT_shadow_funcs", + "GL_EXT_stencil_two_side", + "GL_ATI_text_fragment_shader", + "GL_APPLE_client_storage", + "GL_APPLE_element_array", + "GL_APPLE_fence", + "GL_APPLE_vertex_array_object", + "GL_APPLE_vertex_array_range", + "GL_APPLE_ycbcr_422", + "GL_S3_s3tc", + "GL_ATI_draw_buffers", + "GL_ATI_pixel_format_float", + "GL_ATI_texture_env_combine3", + "GL_ATI_texture_float", + "GL_NV_float_buffer", + "GL_NV_fragment_program", + "GL_NV_half_float", + "GL_NV_pixel_data_range", + "GL_NV_primitive_restart", + "GL_NV_texture_expand_normal", + "GL_NV_vertex_program2", + "GL_ATI_map_object_buffer", + "GL_ATI_separate_stencil", + "GL_ATI_vertex_attrib_array_object", + "GL_OES_read_format", + "GL_EXT_depth_bounds_test", + "GL_EXT_texture_mirror_clamp", + "GL_EXT_blend_equation_separate", + "GL_MESA_pack_invert", + "GL_MESA_ycbcr_texture", + "GL_EXT_pixel_buffer_object", + "GL_NV_fragment_program_option", + "GL_NV_fragment_program2", + "GL_NV_vertex_program2_option", + "GL_NV_vertex_program3", + "GL_EXT_framebuffer_object", + "GL_GREMEDY_string_marker", + "GL_EXT_packed_depth_stencil", + "GL_EXT_stencil_clear_tag", + "GL_EXT_texture_sRGB", + "GL_EXT_framebuffer_blit", + "GL_EXT_framebuffer_multisample", + "GL_MESAX_texture_stack", + "GL_EXT_timer_query", + "GL_EXT_gpu_program_parameters", + "GL_APPLE_flush_buffer_range", + "GL_NV_gpu_program4", + "GL_NV_geometry_program4", + "GL_EXT_geometry_shader4", + "GL_NV_vertex_program4", + "GL_EXT_gpu_shader4", + "GL_EXT_drawinstanced", + "GL_EXT_packed_float", + "GL_EXT_texture_array", + "GL_EXT_texture_buffer_object", + "GL_EXT_texture_compression_latc", + "GL_EXT_texture_compression_rgtc", + "GL_EXT_texture_shared_exponent", + "GL_NV_depth_buffer_float", + "GL_NV_fragment_program4", + "GL_NV_framebuffer_multisample_coverage", + "GL_EXT_framebuffer_sRGB", + "GL_NV_geometry_shader4", + "GL_NV_parameter_buffer_object", + "GL_EXT_draw_buffers2", + "GL_NV_transform_feedback", + "GL_EXT_bindable_uniform", + "GL_EXT_texture_integer", + "GL_GREMEDY_frame_terminator", + "GL_NV_conditional_render", + "GL_NV_present_video", + "GL_EXT_transform_feedback", + "GL_EXT_direct_state_access", + "GL_EXT_vertex_array_bgra", + "GL_SGIX_texture_select", + "GL_INGR_blend_func_separate", + "GL_SGIX_depth_pass_instrument", + "GL_SGIX_igloo_interface", + "GL_EXT_fragment_lighting", + "GL_EXT_scene_marker", + "GL_EXT_texture_compression_dxt1", + "GL_EXT_texture_env", + "GL_IBM_static_data", + "GL_OES_byte_coordinates", + "GL_OES_compressed_paletted_texture", + "GL_OES_single_precision", + "GL_SGIX_pixel_texture_bits", + "GL_SGIX_texture_range" +}; +int __GLeeGLNumExtensions=322; + +/* GL_VERSION_1_2 */ + +#ifdef __GLEE_GL_VERSION_1_2 +void __stdcall _Lazy_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {if (GLeeInit()) glBlendColor(red, green, blue, alpha);} +void __stdcall _Lazy_glBlendEquation(GLenum mode) {if (GLeeInit()) glBlendEquation(mode);} +void __stdcall _Lazy_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) {if (GLeeInit()) glDrawRangeElements(mode, start, end, count, type, indices);} +void __stdcall _Lazy_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) {if (GLeeInit()) glColorTable(target, internalformat, width, format, type, table);} +void __stdcall _Lazy_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glColorTableParameterfv(target, pname, params);} +void __stdcall _Lazy_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glColorTableParameteriv(target, pname, params);} +void __stdcall _Lazy_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyColorTable(target, internalformat, x, y, width);} +void __stdcall _Lazy_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table) {if (GLeeInit()) glGetColorTable(target, format, type, table);} +void __stdcall _Lazy_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetColorTableParameterfv(target, pname, params);} +void __stdcall _Lazy_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetColorTableParameteriv(target, pname, params);} +void __stdcall _Lazy_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) {if (GLeeInit()) glColorSubTable(target, start, count, format, type, data);} +void __stdcall _Lazy_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyColorSubTable(target, start, x, y, width);} +void __stdcall _Lazy_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) {if (GLeeInit()) glConvolutionFilter1D(target, internalformat, width, format, type, image);} +void __stdcall _Lazy_glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) {if (GLeeInit()) glConvolutionFilter2D(target, internalformat, width, height, format, type, image);} +void __stdcall _Lazy_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params) {if (GLeeInit()) glConvolutionParameterf(target, pname, params);} +void __stdcall _Lazy_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glConvolutionParameterfv(target, pname, params);} +void __stdcall _Lazy_glConvolutionParameteri(GLenum target, GLenum pname, GLint params) {if (GLeeInit()) glConvolutionParameteri(target, pname, params);} +void __stdcall _Lazy_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glConvolutionParameteriv(target, pname, params);} +void __stdcall _Lazy_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyConvolutionFilter1D(target, internalformat, x, y, width);} +void __stdcall _Lazy_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyConvolutionFilter2D(target, internalformat, x, y, width, height);} +void __stdcall _Lazy_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image) {if (GLeeInit()) glGetConvolutionFilter(target, format, type, image);} +void __stdcall _Lazy_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetConvolutionParameterfv(target, pname, params);} +void __stdcall _Lazy_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetConvolutionParameteriv(target, pname, params);} +void __stdcall _Lazy_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) {if (GLeeInit()) glGetSeparableFilter(target, format, type, row, column, span);} +void __stdcall _Lazy_glSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) {if (GLeeInit()) glSeparableFilter2D(target, internalformat, width, height, format, type, row, column);} +void __stdcall _Lazy_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) {if (GLeeInit()) glGetHistogram(target, reset, format, type, values);} +void __stdcall _Lazy_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetHistogramParameterfv(target, pname, params);} +void __stdcall _Lazy_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetHistogramParameteriv(target, pname, params);} +void __stdcall _Lazy_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) {if (GLeeInit()) glGetMinmax(target, reset, format, type, values);} +void __stdcall _Lazy_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMinmaxParameterfv(target, pname, params);} +void __stdcall _Lazy_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMinmaxParameteriv(target, pname, params);} +void __stdcall _Lazy_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) {if (GLeeInit()) glHistogram(target, width, internalformat, sink);} +void __stdcall _Lazy_glMinmax(GLenum target, GLenum internalformat, GLboolean sink) {if (GLeeInit()) glMinmax(target, internalformat, sink);} +void __stdcall _Lazy_glResetHistogram(GLenum target) {if (GLeeInit()) glResetHistogram(target);} +void __stdcall _Lazy_glResetMinmax(GLenum target) {if (GLeeInit()) glResetMinmax(target);} +void __stdcall _Lazy_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);} +void __stdcall _Lazy_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);} +void __stdcall _Lazy_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);} +PFNGLBLENDCOLORPROC pglBlendColor=_Lazy_glBlendColor; +PFNGLBLENDEQUATIONPROC pglBlendEquation=_Lazy_glBlendEquation; +PFNGLDRAWRANGEELEMENTSPROC pglDrawRangeElements=_Lazy_glDrawRangeElements; +PFNGLCOLORTABLEPROC pglColorTable=_Lazy_glColorTable; +PFNGLCOLORTABLEPARAMETERFVPROC pglColorTableParameterfv=_Lazy_glColorTableParameterfv; +PFNGLCOLORTABLEPARAMETERIVPROC pglColorTableParameteriv=_Lazy_glColorTableParameteriv; +PFNGLCOPYCOLORTABLEPROC pglCopyColorTable=_Lazy_glCopyColorTable; +PFNGLGETCOLORTABLEPROC pglGetColorTable=_Lazy_glGetColorTable; +PFNGLGETCOLORTABLEPARAMETERFVPROC pglGetColorTableParameterfv=_Lazy_glGetColorTableParameterfv; +PFNGLGETCOLORTABLEPARAMETERIVPROC pglGetColorTableParameteriv=_Lazy_glGetColorTableParameteriv; +PFNGLCOLORSUBTABLEPROC pglColorSubTable=_Lazy_glColorSubTable; +PFNGLCOPYCOLORSUBTABLEPROC pglCopyColorSubTable=_Lazy_glCopyColorSubTable; +PFNGLCONVOLUTIONFILTER1DPROC pglConvolutionFilter1D=_Lazy_glConvolutionFilter1D; +PFNGLCONVOLUTIONFILTER2DPROC pglConvolutionFilter2D=_Lazy_glConvolutionFilter2D; +PFNGLCONVOLUTIONPARAMETERFPROC pglConvolutionParameterf=_Lazy_glConvolutionParameterf; +PFNGLCONVOLUTIONPARAMETERFVPROC pglConvolutionParameterfv=_Lazy_glConvolutionParameterfv; +PFNGLCONVOLUTIONPARAMETERIPROC pglConvolutionParameteri=_Lazy_glConvolutionParameteri; +PFNGLCONVOLUTIONPARAMETERIVPROC pglConvolutionParameteriv=_Lazy_glConvolutionParameteriv; +PFNGLCOPYCONVOLUTIONFILTER1DPROC pglCopyConvolutionFilter1D=_Lazy_glCopyConvolutionFilter1D; +PFNGLCOPYCONVOLUTIONFILTER2DPROC pglCopyConvolutionFilter2D=_Lazy_glCopyConvolutionFilter2D; +PFNGLGETCONVOLUTIONFILTERPROC pglGetConvolutionFilter=_Lazy_glGetConvolutionFilter; +PFNGLGETCONVOLUTIONPARAMETERFVPROC pglGetConvolutionParameterfv=_Lazy_glGetConvolutionParameterfv; +PFNGLGETCONVOLUTIONPARAMETERIVPROC pglGetConvolutionParameteriv=_Lazy_glGetConvolutionParameteriv; +PFNGLGETSEPARABLEFILTERPROC pglGetSeparableFilter=_Lazy_glGetSeparableFilter; +PFNGLSEPARABLEFILTER2DPROC pglSeparableFilter2D=_Lazy_glSeparableFilter2D; +PFNGLGETHISTOGRAMPROC pglGetHistogram=_Lazy_glGetHistogram; +PFNGLGETHISTOGRAMPARAMETERFVPROC pglGetHistogramParameterfv=_Lazy_glGetHistogramParameterfv; +PFNGLGETHISTOGRAMPARAMETERIVPROC pglGetHistogramParameteriv=_Lazy_glGetHistogramParameteriv; +PFNGLGETMINMAXPROC pglGetMinmax=_Lazy_glGetMinmax; +PFNGLGETMINMAXPARAMETERFVPROC pglGetMinmaxParameterfv=_Lazy_glGetMinmaxParameterfv; +PFNGLGETMINMAXPARAMETERIVPROC pglGetMinmaxParameteriv=_Lazy_glGetMinmaxParameteriv; +PFNGLHISTOGRAMPROC pglHistogram=_Lazy_glHistogram; +PFNGLMINMAXPROC pglMinmax=_Lazy_glMinmax; +PFNGLRESETHISTOGRAMPROC pglResetHistogram=_Lazy_glResetHistogram; +PFNGLRESETMINMAXPROC pglResetMinmax=_Lazy_glResetMinmax; +PFNGLTEXIMAGE3DPROC pglTexImage3D=_Lazy_glTexImage3D; +PFNGLTEXSUBIMAGE3DPROC pglTexSubImage3D=_Lazy_glTexSubImage3D; +PFNGLCOPYTEXSUBIMAGE3DPROC pglCopyTexSubImage3D=_Lazy_glCopyTexSubImage3D; +#endif + +/* GL_ARB_imaging */ + +#ifdef __GLEE_GL_ARB_imaging +#endif + +/* GL_VERSION_1_3 */ + +#ifdef __GLEE_GL_VERSION_1_3 +void __stdcall _Lazy_glActiveTexture(GLenum texture) {if (GLeeInit()) glActiveTexture(texture);} +void __stdcall _Lazy_glClientActiveTexture(GLenum texture) {if (GLeeInit()) glClientActiveTexture(texture);} +void __stdcall _Lazy_glMultiTexCoord1d(GLenum target, GLdouble s) {if (GLeeInit()) glMultiTexCoord1d(target, s);} +void __stdcall _Lazy_glMultiTexCoord1dv(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord1dv(target, v);} +void __stdcall _Lazy_glMultiTexCoord1f(GLenum target, GLfloat s) {if (GLeeInit()) glMultiTexCoord1f(target, s);} +void __stdcall _Lazy_glMultiTexCoord1fv(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord1fv(target, v);} +void __stdcall _Lazy_glMultiTexCoord1i(GLenum target, GLint s) {if (GLeeInit()) glMultiTexCoord1i(target, s);} +void __stdcall _Lazy_glMultiTexCoord1iv(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord1iv(target, v);} +void __stdcall _Lazy_glMultiTexCoord1s(GLenum target, GLshort s) {if (GLeeInit()) glMultiTexCoord1s(target, s);} +void __stdcall _Lazy_glMultiTexCoord1sv(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord1sv(target, v);} +void __stdcall _Lazy_glMultiTexCoord2d(GLenum target, GLdouble s, GLdouble t) {if (GLeeInit()) glMultiTexCoord2d(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2dv(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord2dv(target, v);} +void __stdcall _Lazy_glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t) {if (GLeeInit()) glMultiTexCoord2f(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2fv(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord2fv(target, v);} +void __stdcall _Lazy_glMultiTexCoord2i(GLenum target, GLint s, GLint t) {if (GLeeInit()) glMultiTexCoord2i(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2iv(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord2iv(target, v);} +void __stdcall _Lazy_glMultiTexCoord2s(GLenum target, GLshort s, GLshort t) {if (GLeeInit()) glMultiTexCoord2s(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2sv(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord2sv(target, v);} +void __stdcall _Lazy_glMultiTexCoord3d(GLenum target, GLdouble s, GLdouble t, GLdouble r) {if (GLeeInit()) glMultiTexCoord3d(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3dv(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord3dv(target, v);} +void __stdcall _Lazy_glMultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r) {if (GLeeInit()) glMultiTexCoord3f(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3fv(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord3fv(target, v);} +void __stdcall _Lazy_glMultiTexCoord3i(GLenum target, GLint s, GLint t, GLint r) {if (GLeeInit()) glMultiTexCoord3i(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3iv(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord3iv(target, v);} +void __stdcall _Lazy_glMultiTexCoord3s(GLenum target, GLshort s, GLshort t, GLshort r) {if (GLeeInit()) glMultiTexCoord3s(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3sv(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord3sv(target, v);} +void __stdcall _Lazy_glMultiTexCoord4d(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) {if (GLeeInit()) glMultiTexCoord4d(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4dv(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord4dv(target, v);} +void __stdcall _Lazy_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {if (GLeeInit()) glMultiTexCoord4f(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4fv(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord4fv(target, v);} +void __stdcall _Lazy_glMultiTexCoord4i(GLenum target, GLint s, GLint t, GLint r, GLint q) {if (GLeeInit()) glMultiTexCoord4i(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4iv(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord4iv(target, v);} +void __stdcall _Lazy_glMultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) {if (GLeeInit()) glMultiTexCoord4s(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4sv(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord4sv(target, v);} +void __stdcall _Lazy_glLoadTransposeMatrixf(const GLfloat * m) {if (GLeeInit()) glLoadTransposeMatrixf(m);} +void __stdcall _Lazy_glLoadTransposeMatrixd(const GLdouble * m) {if (GLeeInit()) glLoadTransposeMatrixd(m);} +void __stdcall _Lazy_glMultTransposeMatrixf(const GLfloat * m) {if (GLeeInit()) glMultTransposeMatrixf(m);} +void __stdcall _Lazy_glMultTransposeMatrixd(const GLdouble * m) {if (GLeeInit()) glMultTransposeMatrixd(m);} +void __stdcall _Lazy_glSampleCoverage(GLclampf value, GLboolean invert) {if (GLeeInit()) glSampleCoverage(value, invert);} +void __stdcall _Lazy_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);} +void __stdcall _Lazy_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);} +void __stdcall _Lazy_glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data);} +void __stdcall _Lazy_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);} +void __stdcall _Lazy_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);} +void __stdcall _Lazy_glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data);} +void __stdcall _Lazy_glGetCompressedTexImage(GLenum target, GLint level, GLvoid * img) {if (GLeeInit()) glGetCompressedTexImage(target, level, img);} +PFNGLACTIVETEXTUREPROC pglActiveTexture=_Lazy_glActiveTexture; +PFNGLCLIENTACTIVETEXTUREPROC pglClientActiveTexture=_Lazy_glClientActiveTexture; +PFNGLMULTITEXCOORD1DPROC pglMultiTexCoord1d=_Lazy_glMultiTexCoord1d; +PFNGLMULTITEXCOORD1DVPROC pglMultiTexCoord1dv=_Lazy_glMultiTexCoord1dv; +PFNGLMULTITEXCOORD1FPROC pglMultiTexCoord1f=_Lazy_glMultiTexCoord1f; +PFNGLMULTITEXCOORD1FVPROC pglMultiTexCoord1fv=_Lazy_glMultiTexCoord1fv; +PFNGLMULTITEXCOORD1IPROC pglMultiTexCoord1i=_Lazy_glMultiTexCoord1i; +PFNGLMULTITEXCOORD1IVPROC pglMultiTexCoord1iv=_Lazy_glMultiTexCoord1iv; +PFNGLMULTITEXCOORD1SPROC pglMultiTexCoord1s=_Lazy_glMultiTexCoord1s; +PFNGLMULTITEXCOORD1SVPROC pglMultiTexCoord1sv=_Lazy_glMultiTexCoord1sv; +PFNGLMULTITEXCOORD2DPROC pglMultiTexCoord2d=_Lazy_glMultiTexCoord2d; +PFNGLMULTITEXCOORD2DVPROC pglMultiTexCoord2dv=_Lazy_glMultiTexCoord2dv; +PFNGLMULTITEXCOORD2FPROC pglMultiTexCoord2f=_Lazy_glMultiTexCoord2f; +PFNGLMULTITEXCOORD2FVPROC pglMultiTexCoord2fv=_Lazy_glMultiTexCoord2fv; +PFNGLMULTITEXCOORD2IPROC pglMultiTexCoord2i=_Lazy_glMultiTexCoord2i; +PFNGLMULTITEXCOORD2IVPROC pglMultiTexCoord2iv=_Lazy_glMultiTexCoord2iv; +PFNGLMULTITEXCOORD2SPROC pglMultiTexCoord2s=_Lazy_glMultiTexCoord2s; +PFNGLMULTITEXCOORD2SVPROC pglMultiTexCoord2sv=_Lazy_glMultiTexCoord2sv; +PFNGLMULTITEXCOORD3DPROC pglMultiTexCoord3d=_Lazy_glMultiTexCoord3d; +PFNGLMULTITEXCOORD3DVPROC pglMultiTexCoord3dv=_Lazy_glMultiTexCoord3dv; +PFNGLMULTITEXCOORD3FPROC pglMultiTexCoord3f=_Lazy_glMultiTexCoord3f; +PFNGLMULTITEXCOORD3FVPROC pglMultiTexCoord3fv=_Lazy_glMultiTexCoord3fv; +PFNGLMULTITEXCOORD3IPROC pglMultiTexCoord3i=_Lazy_glMultiTexCoord3i; +PFNGLMULTITEXCOORD3IVPROC pglMultiTexCoord3iv=_Lazy_glMultiTexCoord3iv; +PFNGLMULTITEXCOORD3SPROC pglMultiTexCoord3s=_Lazy_glMultiTexCoord3s; +PFNGLMULTITEXCOORD3SVPROC pglMultiTexCoord3sv=_Lazy_glMultiTexCoord3sv; +PFNGLMULTITEXCOORD4DPROC pglMultiTexCoord4d=_Lazy_glMultiTexCoord4d; +PFNGLMULTITEXCOORD4DVPROC pglMultiTexCoord4dv=_Lazy_glMultiTexCoord4dv; +PFNGLMULTITEXCOORD4FPROC pglMultiTexCoord4f=_Lazy_glMultiTexCoord4f; +PFNGLMULTITEXCOORD4FVPROC pglMultiTexCoord4fv=_Lazy_glMultiTexCoord4fv; +PFNGLMULTITEXCOORD4IPROC pglMultiTexCoord4i=_Lazy_glMultiTexCoord4i; +PFNGLMULTITEXCOORD4IVPROC pglMultiTexCoord4iv=_Lazy_glMultiTexCoord4iv; +PFNGLMULTITEXCOORD4SPROC pglMultiTexCoord4s=_Lazy_glMultiTexCoord4s; +PFNGLMULTITEXCOORD4SVPROC pglMultiTexCoord4sv=_Lazy_glMultiTexCoord4sv; +PFNGLLOADTRANSPOSEMATRIXFPROC pglLoadTransposeMatrixf=_Lazy_glLoadTransposeMatrixf; +PFNGLLOADTRANSPOSEMATRIXDPROC pglLoadTransposeMatrixd=_Lazy_glLoadTransposeMatrixd; +PFNGLMULTTRANSPOSEMATRIXFPROC pglMultTransposeMatrixf=_Lazy_glMultTransposeMatrixf; +PFNGLMULTTRANSPOSEMATRIXDPROC pglMultTransposeMatrixd=_Lazy_glMultTransposeMatrixd; +PFNGLSAMPLECOVERAGEPROC pglSampleCoverage=_Lazy_glSampleCoverage; +PFNGLCOMPRESSEDTEXIMAGE3DPROC pglCompressedTexImage3D=_Lazy_glCompressedTexImage3D; +PFNGLCOMPRESSEDTEXIMAGE2DPROC pglCompressedTexImage2D=_Lazy_glCompressedTexImage2D; +PFNGLCOMPRESSEDTEXIMAGE1DPROC pglCompressedTexImage1D=_Lazy_glCompressedTexImage1D; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC pglCompressedTexSubImage3D=_Lazy_glCompressedTexSubImage3D; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC pglCompressedTexSubImage2D=_Lazy_glCompressedTexSubImage2D; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC pglCompressedTexSubImage1D=_Lazy_glCompressedTexSubImage1D; +PFNGLGETCOMPRESSEDTEXIMAGEPROC pglGetCompressedTexImage=_Lazy_glGetCompressedTexImage; +#endif + +/* GL_VERSION_1_4 */ + +#ifdef __GLEE_GL_VERSION_1_4 +void __stdcall _Lazy_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {if (GLeeInit()) glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);} +void __stdcall _Lazy_glFogCoordf(GLfloat coord) {if (GLeeInit()) glFogCoordf(coord);} +void __stdcall _Lazy_glFogCoordfv(const GLfloat * coord) {if (GLeeInit()) glFogCoordfv(coord);} +void __stdcall _Lazy_glFogCoordd(GLdouble coord) {if (GLeeInit()) glFogCoordd(coord);} +void __stdcall _Lazy_glFogCoorddv(const GLdouble * coord) {if (GLeeInit()) glFogCoorddv(coord);} +void __stdcall _Lazy_glFogCoordPointer(GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glFogCoordPointer(type, stride, pointer);} +void __stdcall _Lazy_glMultiDrawArrays(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) {if (GLeeInit()) glMultiDrawArrays(mode, first, count, primcount);} +void __stdcall _Lazy_glMultiDrawElements(GLenum mode, const GLsizei * count, GLenum type, const GLvoid* * indices, GLsizei primcount) {if (GLeeInit()) glMultiDrawElements(mode, count, type, indices, primcount);} +void __stdcall _Lazy_glPointParameterf(GLenum pname, GLfloat param) {if (GLeeInit()) glPointParameterf(pname, param);} +void __stdcall _Lazy_glPointParameterfv(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPointParameterfv(pname, params);} +void __stdcall _Lazy_glPointParameteri(GLenum pname, GLint param) {if (GLeeInit()) glPointParameteri(pname, param);} +void __stdcall _Lazy_glPointParameteriv(GLenum pname, const GLint * params) {if (GLeeInit()) glPointParameteriv(pname, params);} +void __stdcall _Lazy_glSecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue) {if (GLeeInit()) glSecondaryColor3b(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3bv(const GLbyte * v) {if (GLeeInit()) glSecondaryColor3bv(v);} +void __stdcall _Lazy_glSecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue) {if (GLeeInit()) glSecondaryColor3d(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3dv(const GLdouble * v) {if (GLeeInit()) glSecondaryColor3dv(v);} +void __stdcall _Lazy_glSecondaryColor3f(GLfloat red, GLfloat green, GLfloat blue) {if (GLeeInit()) glSecondaryColor3f(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3fv(const GLfloat * v) {if (GLeeInit()) glSecondaryColor3fv(v);} +void __stdcall _Lazy_glSecondaryColor3i(GLint red, GLint green, GLint blue) {if (GLeeInit()) glSecondaryColor3i(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3iv(const GLint * v) {if (GLeeInit()) glSecondaryColor3iv(v);} +void __stdcall _Lazy_glSecondaryColor3s(GLshort red, GLshort green, GLshort blue) {if (GLeeInit()) glSecondaryColor3s(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3sv(const GLshort * v) {if (GLeeInit()) glSecondaryColor3sv(v);} +void __stdcall _Lazy_glSecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue) {if (GLeeInit()) glSecondaryColor3ub(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3ubv(const GLubyte * v) {if (GLeeInit()) glSecondaryColor3ubv(v);} +void __stdcall _Lazy_glSecondaryColor3ui(GLuint red, GLuint green, GLuint blue) {if (GLeeInit()) glSecondaryColor3ui(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3uiv(const GLuint * v) {if (GLeeInit()) glSecondaryColor3uiv(v);} +void __stdcall _Lazy_glSecondaryColor3us(GLushort red, GLushort green, GLushort blue) {if (GLeeInit()) glSecondaryColor3us(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3usv(const GLushort * v) {if (GLeeInit()) glSecondaryColor3usv(v);} +void __stdcall _Lazy_glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glSecondaryColorPointer(size, type, stride, pointer);} +void __stdcall _Lazy_glWindowPos2d(GLdouble x, GLdouble y) {if (GLeeInit()) glWindowPos2d(x, y);} +void __stdcall _Lazy_glWindowPos2dv(const GLdouble * v) {if (GLeeInit()) glWindowPos2dv(v);} +void __stdcall _Lazy_glWindowPos2f(GLfloat x, GLfloat y) {if (GLeeInit()) glWindowPos2f(x, y);} +void __stdcall _Lazy_glWindowPos2fv(const GLfloat * v) {if (GLeeInit()) glWindowPos2fv(v);} +void __stdcall _Lazy_glWindowPos2i(GLint x, GLint y) {if (GLeeInit()) glWindowPos2i(x, y);} +void __stdcall _Lazy_glWindowPos2iv(const GLint * v) {if (GLeeInit()) glWindowPos2iv(v);} +void __stdcall _Lazy_glWindowPos2s(GLshort x, GLshort y) {if (GLeeInit()) glWindowPos2s(x, y);} +void __stdcall _Lazy_glWindowPos2sv(const GLshort * v) {if (GLeeInit()) glWindowPos2sv(v);} +void __stdcall _Lazy_glWindowPos3d(GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glWindowPos3d(x, y, z);} +void __stdcall _Lazy_glWindowPos3dv(const GLdouble * v) {if (GLeeInit()) glWindowPos3dv(v);} +void __stdcall _Lazy_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glWindowPos3f(x, y, z);} +void __stdcall _Lazy_glWindowPos3fv(const GLfloat * v) {if (GLeeInit()) glWindowPos3fv(v);} +void __stdcall _Lazy_glWindowPos3i(GLint x, GLint y, GLint z) {if (GLeeInit()) glWindowPos3i(x, y, z);} +void __stdcall _Lazy_glWindowPos3iv(const GLint * v) {if (GLeeInit()) glWindowPos3iv(v);} +void __stdcall _Lazy_glWindowPos3s(GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glWindowPos3s(x, y, z);} +void __stdcall _Lazy_glWindowPos3sv(const GLshort * v) {if (GLeeInit()) glWindowPos3sv(v);} +PFNGLBLENDFUNCSEPARATEPROC pglBlendFuncSeparate=_Lazy_glBlendFuncSeparate; +PFNGLFOGCOORDFPROC pglFogCoordf=_Lazy_glFogCoordf; +PFNGLFOGCOORDFVPROC pglFogCoordfv=_Lazy_glFogCoordfv; +PFNGLFOGCOORDDPROC pglFogCoordd=_Lazy_glFogCoordd; +PFNGLFOGCOORDDVPROC pglFogCoorddv=_Lazy_glFogCoorddv; +PFNGLFOGCOORDPOINTERPROC pglFogCoordPointer=_Lazy_glFogCoordPointer; +PFNGLMULTIDRAWARRAYSPROC pglMultiDrawArrays=_Lazy_glMultiDrawArrays; +PFNGLMULTIDRAWELEMENTSPROC pglMultiDrawElements=_Lazy_glMultiDrawElements; +PFNGLPOINTPARAMETERFPROC pglPointParameterf=_Lazy_glPointParameterf; +PFNGLPOINTPARAMETERFVPROC pglPointParameterfv=_Lazy_glPointParameterfv; +PFNGLPOINTPARAMETERIPROC pglPointParameteri=_Lazy_glPointParameteri; +PFNGLPOINTPARAMETERIVPROC pglPointParameteriv=_Lazy_glPointParameteriv; +PFNGLSECONDARYCOLOR3BPROC pglSecondaryColor3b=_Lazy_glSecondaryColor3b; +PFNGLSECONDARYCOLOR3BVPROC pglSecondaryColor3bv=_Lazy_glSecondaryColor3bv; +PFNGLSECONDARYCOLOR3DPROC pglSecondaryColor3d=_Lazy_glSecondaryColor3d; +PFNGLSECONDARYCOLOR3DVPROC pglSecondaryColor3dv=_Lazy_glSecondaryColor3dv; +PFNGLSECONDARYCOLOR3FPROC pglSecondaryColor3f=_Lazy_glSecondaryColor3f; +PFNGLSECONDARYCOLOR3FVPROC pglSecondaryColor3fv=_Lazy_glSecondaryColor3fv; +PFNGLSECONDARYCOLOR3IPROC pglSecondaryColor3i=_Lazy_glSecondaryColor3i; +PFNGLSECONDARYCOLOR3IVPROC pglSecondaryColor3iv=_Lazy_glSecondaryColor3iv; +PFNGLSECONDARYCOLOR3SPROC pglSecondaryColor3s=_Lazy_glSecondaryColor3s; +PFNGLSECONDARYCOLOR3SVPROC pglSecondaryColor3sv=_Lazy_glSecondaryColor3sv; +PFNGLSECONDARYCOLOR3UBPROC pglSecondaryColor3ub=_Lazy_glSecondaryColor3ub; +PFNGLSECONDARYCOLOR3UBVPROC pglSecondaryColor3ubv=_Lazy_glSecondaryColor3ubv; +PFNGLSECONDARYCOLOR3UIPROC pglSecondaryColor3ui=_Lazy_glSecondaryColor3ui; +PFNGLSECONDARYCOLOR3UIVPROC pglSecondaryColor3uiv=_Lazy_glSecondaryColor3uiv; +PFNGLSECONDARYCOLOR3USPROC pglSecondaryColor3us=_Lazy_glSecondaryColor3us; +PFNGLSECONDARYCOLOR3USVPROC pglSecondaryColor3usv=_Lazy_glSecondaryColor3usv; +PFNGLSECONDARYCOLORPOINTERPROC pglSecondaryColorPointer=_Lazy_glSecondaryColorPointer; +PFNGLWINDOWPOS2DPROC pglWindowPos2d=_Lazy_glWindowPos2d; +PFNGLWINDOWPOS2DVPROC pglWindowPos2dv=_Lazy_glWindowPos2dv; +PFNGLWINDOWPOS2FPROC pglWindowPos2f=_Lazy_glWindowPos2f; +PFNGLWINDOWPOS2FVPROC pglWindowPos2fv=_Lazy_glWindowPos2fv; +PFNGLWINDOWPOS2IPROC pglWindowPos2i=_Lazy_glWindowPos2i; +PFNGLWINDOWPOS2IVPROC pglWindowPos2iv=_Lazy_glWindowPos2iv; +PFNGLWINDOWPOS2SPROC pglWindowPos2s=_Lazy_glWindowPos2s; +PFNGLWINDOWPOS2SVPROC pglWindowPos2sv=_Lazy_glWindowPos2sv; +PFNGLWINDOWPOS3DPROC pglWindowPos3d=_Lazy_glWindowPos3d; +PFNGLWINDOWPOS3DVPROC pglWindowPos3dv=_Lazy_glWindowPos3dv; +PFNGLWINDOWPOS3FPROC pglWindowPos3f=_Lazy_glWindowPos3f; +PFNGLWINDOWPOS3FVPROC pglWindowPos3fv=_Lazy_glWindowPos3fv; +PFNGLWINDOWPOS3IPROC pglWindowPos3i=_Lazy_glWindowPos3i; +PFNGLWINDOWPOS3IVPROC pglWindowPos3iv=_Lazy_glWindowPos3iv; +PFNGLWINDOWPOS3SPROC pglWindowPos3s=_Lazy_glWindowPos3s; +PFNGLWINDOWPOS3SVPROC pglWindowPos3sv=_Lazy_glWindowPos3sv; +#endif + +/* GL_VERSION_1_5 */ + +#ifdef __GLEE_GL_VERSION_1_5 +void __stdcall _Lazy_glGenQueries(GLsizei n, GLuint * ids) {if (GLeeInit()) glGenQueries(n, ids);} +void __stdcall _Lazy_glDeleteQueries(GLsizei n, const GLuint * ids) {if (GLeeInit()) glDeleteQueries(n, ids);} +GLboolean __stdcall _Lazy_glIsQuery(GLuint id) {if (GLeeInit()) return glIsQuery(id); return (GLboolean)0;} +void __stdcall _Lazy_glBeginQuery(GLenum target, GLuint id) {if (GLeeInit()) glBeginQuery(target, id);} +void __stdcall _Lazy_glEndQuery(GLenum target) {if (GLeeInit()) glEndQuery(target);} +void __stdcall _Lazy_glGetQueryiv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetQueryiv(target, pname, params);} +void __stdcall _Lazy_glGetQueryObjectiv(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetQueryObjectiv(id, pname, params);} +void __stdcall _Lazy_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params) {if (GLeeInit()) glGetQueryObjectuiv(id, pname, params);} +void __stdcall _Lazy_glBindBuffer(GLenum target, GLuint buffer) {if (GLeeInit()) glBindBuffer(target, buffer);} +void __stdcall _Lazy_glDeleteBuffers(GLsizei n, const GLuint * buffers) {if (GLeeInit()) glDeleteBuffers(n, buffers);} +void __stdcall _Lazy_glGenBuffers(GLsizei n, GLuint * buffers) {if (GLeeInit()) glGenBuffers(n, buffers);} +GLboolean __stdcall _Lazy_glIsBuffer(GLuint buffer) {if (GLeeInit()) return glIsBuffer(buffer); return (GLboolean)0;} +void __stdcall _Lazy_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {if (GLeeInit()) glBufferData(target, size, data, usage);} +void __stdcall _Lazy_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) {if (GLeeInit()) glBufferSubData(target, offset, size, data);} +void __stdcall _Lazy_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) {if (GLeeInit()) glGetBufferSubData(target, offset, size, data);} +GLvoid* __stdcall _Lazy_glMapBuffer(GLenum target, GLenum access) {if (GLeeInit()) return glMapBuffer(target, access); return (GLvoid*)0;} +GLboolean __stdcall _Lazy_glUnmapBuffer(GLenum target) {if (GLeeInit()) return glUnmapBuffer(target); return (GLboolean)0;} +void __stdcall _Lazy_glGetBufferParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetBufferParameteriv(target, pname, params);} +void __stdcall _Lazy_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid* * params) {if (GLeeInit()) glGetBufferPointerv(target, pname, params);} +PFNGLGENQUERIESPROC pglGenQueries=_Lazy_glGenQueries; +PFNGLDELETEQUERIESPROC pglDeleteQueries=_Lazy_glDeleteQueries; +PFNGLISQUERYPROC pglIsQuery=_Lazy_glIsQuery; +PFNGLBEGINQUERYPROC pglBeginQuery=_Lazy_glBeginQuery; +PFNGLENDQUERYPROC pglEndQuery=_Lazy_glEndQuery; +PFNGLGETQUERYIVPROC pglGetQueryiv=_Lazy_glGetQueryiv; +PFNGLGETQUERYOBJECTIVPROC pglGetQueryObjectiv=_Lazy_glGetQueryObjectiv; +PFNGLGETQUERYOBJECTUIVPROC pglGetQueryObjectuiv=_Lazy_glGetQueryObjectuiv; +PFNGLBINDBUFFERPROC pglBindBuffer=_Lazy_glBindBuffer; +PFNGLDELETEBUFFERSPROC pglDeleteBuffers=_Lazy_glDeleteBuffers; +PFNGLGENBUFFERSPROC pglGenBuffers=_Lazy_glGenBuffers; +PFNGLISBUFFERPROC pglIsBuffer=_Lazy_glIsBuffer; +PFNGLBUFFERDATAPROC pglBufferData=_Lazy_glBufferData; +PFNGLBUFFERSUBDATAPROC pglBufferSubData=_Lazy_glBufferSubData; +PFNGLGETBUFFERSUBDATAPROC pglGetBufferSubData=_Lazy_glGetBufferSubData; +PFNGLMAPBUFFERPROC pglMapBuffer=_Lazy_glMapBuffer; +PFNGLUNMAPBUFFERPROC pglUnmapBuffer=_Lazy_glUnmapBuffer; +PFNGLGETBUFFERPARAMETERIVPROC pglGetBufferParameteriv=_Lazy_glGetBufferParameteriv; +PFNGLGETBUFFERPOINTERVPROC pglGetBufferPointerv=_Lazy_glGetBufferPointerv; +#endif + +/* GL_VERSION_2_0 */ + +#ifdef __GLEE_GL_VERSION_2_0 +void __stdcall _Lazy_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {if (GLeeInit()) glBlendEquationSeparate(modeRGB, modeAlpha);} +void __stdcall _Lazy_glDrawBuffers(GLsizei n, const GLenum * bufs) {if (GLeeInit()) glDrawBuffers(n, bufs);} +void __stdcall _Lazy_glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {if (GLeeInit()) glStencilOpSeparate(face, sfail, dpfail, dppass);} +void __stdcall _Lazy_glStencilFuncSeparate(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) {if (GLeeInit()) glStencilFuncSeparate(frontfunc, backfunc, ref, mask);} +void __stdcall _Lazy_glStencilMaskSeparate(GLenum face, GLuint mask) {if (GLeeInit()) glStencilMaskSeparate(face, mask);} +void __stdcall _Lazy_glAttachShader(GLuint program, GLuint shader) {if (GLeeInit()) glAttachShader(program, shader);} +void __stdcall _Lazy_glBindAttribLocation(GLuint program, GLuint index, const GLchar * name) {if (GLeeInit()) glBindAttribLocation(program, index, name);} +void __stdcall _Lazy_glCompileShader(GLuint shader) {if (GLeeInit()) glCompileShader(shader);} +GLuint __stdcall _Lazy_glCreateProgram(void) {if (GLeeInit()) return glCreateProgram(); return (GLuint)0;} +GLuint __stdcall _Lazy_glCreateShader(GLenum type) {if (GLeeInit()) return glCreateShader(type); return (GLuint)0;} +void __stdcall _Lazy_glDeleteProgram(GLuint program) {if (GLeeInit()) glDeleteProgram(program);} +void __stdcall _Lazy_glDeleteShader(GLuint shader) {if (GLeeInit()) glDeleteShader(shader);} +void __stdcall _Lazy_glDetachShader(GLuint program, GLuint shader) {if (GLeeInit()) glDetachShader(program, shader);} +void __stdcall _Lazy_glDisableVertexAttribArray(GLuint index) {if (GLeeInit()) glDisableVertexAttribArray(index);} +void __stdcall _Lazy_glEnableVertexAttribArray(GLuint index) {if (GLeeInit()) glEnableVertexAttribArray(index);} +void __stdcall _Lazy_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) {if (GLeeInit()) glGetActiveAttrib(program, index, bufSize, length, size, type, name);} +void __stdcall _Lazy_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) {if (GLeeInit()) glGetActiveUniform(program, index, bufSize, length, size, type, name);} +void __stdcall _Lazy_glGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj) {if (GLeeInit()) glGetAttachedShaders(program, maxCount, count, obj);} +GLint __stdcall _Lazy_glGetAttribLocation(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetAttribLocation(program, name); return (GLint)0;} +void __stdcall _Lazy_glGetProgramiv(GLuint program, GLenum pname, GLint * params) {if (GLeeInit()) glGetProgramiv(program, pname, params);} +void __stdcall _Lazy_glGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {if (GLeeInit()) glGetProgramInfoLog(program, bufSize, length, infoLog);} +void __stdcall _Lazy_glGetShaderiv(GLuint shader, GLenum pname, GLint * params) {if (GLeeInit()) glGetShaderiv(shader, pname, params);} +void __stdcall _Lazy_glGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {if (GLeeInit()) glGetShaderInfoLog(shader, bufSize, length, infoLog);} +void __stdcall _Lazy_glGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) {if (GLeeInit()) glGetShaderSource(shader, bufSize, length, source);} +GLint __stdcall _Lazy_glGetUniformLocation(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetUniformLocation(program, name); return (GLint)0;} +void __stdcall _Lazy_glGetUniformfv(GLuint program, GLint location, GLfloat * params) {if (GLeeInit()) glGetUniformfv(program, location, params);} +void __stdcall _Lazy_glGetUniformiv(GLuint program, GLint location, GLint * params) {if (GLeeInit()) glGetUniformiv(program, location, params);} +void __stdcall _Lazy_glGetVertexAttribdv(GLuint index, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetVertexAttribdv(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVertexAttribfv(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribiv(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribiv(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid* * pointer) {if (GLeeInit()) glGetVertexAttribPointerv(index, pname, pointer);} +GLboolean __stdcall _Lazy_glIsProgram(GLuint program) {if (GLeeInit()) return glIsProgram(program); return (GLboolean)0;} +GLboolean __stdcall _Lazy_glIsShader(GLuint shader) {if (GLeeInit()) return glIsShader(shader); return (GLboolean)0;} +void __stdcall _Lazy_glLinkProgram(GLuint program) {if (GLeeInit()) glLinkProgram(program);} +void __stdcall _Lazy_glShaderSource(GLuint shader, GLsizei count, const GLchar* * string, const GLint * length) {if (GLeeInit()) glShaderSource(shader, count, string, length);} +void __stdcall _Lazy_glUseProgram(GLuint program) {if (GLeeInit()) glUseProgram(program);} +void __stdcall _Lazy_glUniform1f(GLint location, GLfloat v0) {if (GLeeInit()) glUniform1f(location, v0);} +void __stdcall _Lazy_glUniform2f(GLint location, GLfloat v0, GLfloat v1) {if (GLeeInit()) glUniform2f(location, v0, v1);} +void __stdcall _Lazy_glUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {if (GLeeInit()) glUniform3f(location, v0, v1, v2);} +void __stdcall _Lazy_glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {if (GLeeInit()) glUniform4f(location, v0, v1, v2, v3);} +void __stdcall _Lazy_glUniform1i(GLint location, GLint v0) {if (GLeeInit()) glUniform1i(location, v0);} +void __stdcall _Lazy_glUniform2i(GLint location, GLint v0, GLint v1) {if (GLeeInit()) glUniform2i(location, v0, v1);} +void __stdcall _Lazy_glUniform3i(GLint location, GLint v0, GLint v1, GLint v2) {if (GLeeInit()) glUniform3i(location, v0, v1, v2);} +void __stdcall _Lazy_glUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {if (GLeeInit()) glUniform4i(location, v0, v1, v2, v3);} +void __stdcall _Lazy_glUniform1fv(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform1fv(location, count, value);} +void __stdcall _Lazy_glUniform2fv(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform2fv(location, count, value);} +void __stdcall _Lazy_glUniform3fv(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform3fv(location, count, value);} +void __stdcall _Lazy_glUniform4fv(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform4fv(location, count, value);} +void __stdcall _Lazy_glUniform1iv(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform1iv(location, count, value);} +void __stdcall _Lazy_glUniform2iv(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform2iv(location, count, value);} +void __stdcall _Lazy_glUniform3iv(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform3iv(location, count, value);} +void __stdcall _Lazy_glUniform4iv(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform4iv(location, count, value);} +void __stdcall _Lazy_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix2fv(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix3fv(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix4fv(location, count, transpose, value);} +void __stdcall _Lazy_glValidateProgram(GLuint program) {if (GLeeInit()) glValidateProgram(program);} +void __stdcall _Lazy_glVertexAttrib1d(GLuint index, GLdouble x) {if (GLeeInit()) glVertexAttrib1d(index, x);} +void __stdcall _Lazy_glVertexAttrib1dv(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib1dv(index, v);} +void __stdcall _Lazy_glVertexAttrib1f(GLuint index, GLfloat x) {if (GLeeInit()) glVertexAttrib1f(index, x);} +void __stdcall _Lazy_glVertexAttrib1fv(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib1fv(index, v);} +void __stdcall _Lazy_glVertexAttrib1s(GLuint index, GLshort x) {if (GLeeInit()) glVertexAttrib1s(index, x);} +void __stdcall _Lazy_glVertexAttrib1sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib1sv(index, v);} +void __stdcall _Lazy_glVertexAttrib2d(GLuint index, GLdouble x, GLdouble y) {if (GLeeInit()) glVertexAttrib2d(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2dv(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib2dv(index, v);} +void __stdcall _Lazy_glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y) {if (GLeeInit()) glVertexAttrib2f(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2fv(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib2fv(index, v);} +void __stdcall _Lazy_glVertexAttrib2s(GLuint index, GLshort x, GLshort y) {if (GLeeInit()) glVertexAttrib2s(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib2sv(index, v);} +void __stdcall _Lazy_glVertexAttrib3d(GLuint index, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glVertexAttrib3d(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3dv(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib3dv(index, v);} +void __stdcall _Lazy_glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glVertexAttrib3f(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3fv(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib3fv(index, v);} +void __stdcall _Lazy_glVertexAttrib3s(GLuint index, GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glVertexAttrib3s(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib3sv(index, v);} +void __stdcall _Lazy_glVertexAttrib4Nbv(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttrib4Nbv(index, v);} +void __stdcall _Lazy_glVertexAttrib4Niv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttrib4Niv(index, v);} +void __stdcall _Lazy_glVertexAttrib4Nsv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4Nsv(index, v);} +void __stdcall _Lazy_glVertexAttrib4Nub(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) {if (GLeeInit()) glVertexAttrib4Nub(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4Nubv(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4Nubv(index, v);} +void __stdcall _Lazy_glVertexAttrib4Nuiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttrib4Nuiv(index, v);} +void __stdcall _Lazy_glVertexAttrib4Nusv(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttrib4Nusv(index, v);} +void __stdcall _Lazy_glVertexAttrib4bv(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttrib4bv(index, v);} +void __stdcall _Lazy_glVertexAttrib4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glVertexAttrib4d(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4dv(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib4dv(index, v);} +void __stdcall _Lazy_glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glVertexAttrib4f(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4fv(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib4fv(index, v);} +void __stdcall _Lazy_glVertexAttrib4iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttrib4iv(index, v);} +void __stdcall _Lazy_glVertexAttrib4s(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glVertexAttrib4s(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4sv(index, v);} +void __stdcall _Lazy_glVertexAttrib4ubv(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4ubv(index, v);} +void __stdcall _Lazy_glVertexAttrib4uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttrib4uiv(index, v);} +void __stdcall _Lazy_glVertexAttrib4usv(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttrib4usv(index, v);} +void __stdcall _Lazy_glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribPointer(index, size, type, normalized, stride, pointer);} +PFNGLBLENDEQUATIONSEPARATEPROC pglBlendEquationSeparate=_Lazy_glBlendEquationSeparate; +PFNGLDRAWBUFFERSPROC pglDrawBuffers=_Lazy_glDrawBuffers; +PFNGLSTENCILOPSEPARATEPROC pglStencilOpSeparate=_Lazy_glStencilOpSeparate; +PFNGLSTENCILFUNCSEPARATEPROC pglStencilFuncSeparate=_Lazy_glStencilFuncSeparate; +PFNGLSTENCILMASKSEPARATEPROC pglStencilMaskSeparate=_Lazy_glStencilMaskSeparate; +PFNGLATTACHSHADERPROC pglAttachShader=_Lazy_glAttachShader; +PFNGLBINDATTRIBLOCATIONPROC pglBindAttribLocation=_Lazy_glBindAttribLocation; +PFNGLCOMPILESHADERPROC pglCompileShader=_Lazy_glCompileShader; +PFNGLCREATEPROGRAMPROC pglCreateProgram=_Lazy_glCreateProgram; +PFNGLCREATESHADERPROC pglCreateShader=_Lazy_glCreateShader; +PFNGLDELETEPROGRAMPROC pglDeleteProgram=_Lazy_glDeleteProgram; +PFNGLDELETESHADERPROC pglDeleteShader=_Lazy_glDeleteShader; +PFNGLDETACHSHADERPROC pglDetachShader=_Lazy_glDetachShader; +PFNGLDISABLEVERTEXATTRIBARRAYPROC pglDisableVertexAttribArray=_Lazy_glDisableVertexAttribArray; +PFNGLENABLEVERTEXATTRIBARRAYPROC pglEnableVertexAttribArray=_Lazy_glEnableVertexAttribArray; +PFNGLGETACTIVEATTRIBPROC pglGetActiveAttrib=_Lazy_glGetActiveAttrib; +PFNGLGETACTIVEUNIFORMPROC pglGetActiveUniform=_Lazy_glGetActiveUniform; +PFNGLGETATTACHEDSHADERSPROC pglGetAttachedShaders=_Lazy_glGetAttachedShaders; +PFNGLGETATTRIBLOCATIONPROC pglGetAttribLocation=_Lazy_glGetAttribLocation; +PFNGLGETPROGRAMIVPROC pglGetProgramiv=_Lazy_glGetProgramiv; +PFNGLGETPROGRAMINFOLOGPROC pglGetProgramInfoLog=_Lazy_glGetProgramInfoLog; +PFNGLGETSHADERIVPROC pglGetShaderiv=_Lazy_glGetShaderiv; +PFNGLGETSHADERINFOLOGPROC pglGetShaderInfoLog=_Lazy_glGetShaderInfoLog; +PFNGLGETSHADERSOURCEPROC pglGetShaderSource=_Lazy_glGetShaderSource; +PFNGLGETUNIFORMLOCATIONPROC pglGetUniformLocation=_Lazy_glGetUniformLocation; +PFNGLGETUNIFORMFVPROC pglGetUniformfv=_Lazy_glGetUniformfv; +PFNGLGETUNIFORMIVPROC pglGetUniformiv=_Lazy_glGetUniformiv; +PFNGLGETVERTEXATTRIBDVPROC pglGetVertexAttribdv=_Lazy_glGetVertexAttribdv; +PFNGLGETVERTEXATTRIBFVPROC pglGetVertexAttribfv=_Lazy_glGetVertexAttribfv; +PFNGLGETVERTEXATTRIBIVPROC pglGetVertexAttribiv=_Lazy_glGetVertexAttribiv; +PFNGLGETVERTEXATTRIBPOINTERVPROC pglGetVertexAttribPointerv=_Lazy_glGetVertexAttribPointerv; +PFNGLISPROGRAMPROC pglIsProgram=_Lazy_glIsProgram; +PFNGLISSHADERPROC pglIsShader=_Lazy_glIsShader; +PFNGLLINKPROGRAMPROC pglLinkProgram=_Lazy_glLinkProgram; +PFNGLSHADERSOURCEPROC pglShaderSource=_Lazy_glShaderSource; +PFNGLUSEPROGRAMPROC pglUseProgram=_Lazy_glUseProgram; +PFNGLUNIFORM1FPROC pglUniform1f=_Lazy_glUniform1f; +PFNGLUNIFORM2FPROC pglUniform2f=_Lazy_glUniform2f; +PFNGLUNIFORM3FPROC pglUniform3f=_Lazy_glUniform3f; +PFNGLUNIFORM4FPROC pglUniform4f=_Lazy_glUniform4f; +PFNGLUNIFORM1IPROC pglUniform1i=_Lazy_glUniform1i; +PFNGLUNIFORM2IPROC pglUniform2i=_Lazy_glUniform2i; +PFNGLUNIFORM3IPROC pglUniform3i=_Lazy_glUniform3i; +PFNGLUNIFORM4IPROC pglUniform4i=_Lazy_glUniform4i; +PFNGLUNIFORM1FVPROC pglUniform1fv=_Lazy_glUniform1fv; +PFNGLUNIFORM2FVPROC pglUniform2fv=_Lazy_glUniform2fv; +PFNGLUNIFORM3FVPROC pglUniform3fv=_Lazy_glUniform3fv; +PFNGLUNIFORM4FVPROC pglUniform4fv=_Lazy_glUniform4fv; +PFNGLUNIFORM1IVPROC pglUniform1iv=_Lazy_glUniform1iv; +PFNGLUNIFORM2IVPROC pglUniform2iv=_Lazy_glUniform2iv; +PFNGLUNIFORM3IVPROC pglUniform3iv=_Lazy_glUniform3iv; +PFNGLUNIFORM4IVPROC pglUniform4iv=_Lazy_glUniform4iv; +PFNGLUNIFORMMATRIX2FVPROC pglUniformMatrix2fv=_Lazy_glUniformMatrix2fv; +PFNGLUNIFORMMATRIX3FVPROC pglUniformMatrix3fv=_Lazy_glUniformMatrix3fv; +PFNGLUNIFORMMATRIX4FVPROC pglUniformMatrix4fv=_Lazy_glUniformMatrix4fv; +PFNGLVALIDATEPROGRAMPROC pglValidateProgram=_Lazy_glValidateProgram; +PFNGLVERTEXATTRIB1DPROC pglVertexAttrib1d=_Lazy_glVertexAttrib1d; +PFNGLVERTEXATTRIB1DVPROC pglVertexAttrib1dv=_Lazy_glVertexAttrib1dv; +PFNGLVERTEXATTRIB1FPROC pglVertexAttrib1f=_Lazy_glVertexAttrib1f; +PFNGLVERTEXATTRIB1FVPROC pglVertexAttrib1fv=_Lazy_glVertexAttrib1fv; +PFNGLVERTEXATTRIB1SPROC pglVertexAttrib1s=_Lazy_glVertexAttrib1s; +PFNGLVERTEXATTRIB1SVPROC pglVertexAttrib1sv=_Lazy_glVertexAttrib1sv; +PFNGLVERTEXATTRIB2DPROC pglVertexAttrib2d=_Lazy_glVertexAttrib2d; +PFNGLVERTEXATTRIB2DVPROC pglVertexAttrib2dv=_Lazy_glVertexAttrib2dv; +PFNGLVERTEXATTRIB2FPROC pglVertexAttrib2f=_Lazy_glVertexAttrib2f; +PFNGLVERTEXATTRIB2FVPROC pglVertexAttrib2fv=_Lazy_glVertexAttrib2fv; +PFNGLVERTEXATTRIB2SPROC pglVertexAttrib2s=_Lazy_glVertexAttrib2s; +PFNGLVERTEXATTRIB2SVPROC pglVertexAttrib2sv=_Lazy_glVertexAttrib2sv; +PFNGLVERTEXATTRIB3DPROC pglVertexAttrib3d=_Lazy_glVertexAttrib3d; +PFNGLVERTEXATTRIB3DVPROC pglVertexAttrib3dv=_Lazy_glVertexAttrib3dv; +PFNGLVERTEXATTRIB3FPROC pglVertexAttrib3f=_Lazy_glVertexAttrib3f; +PFNGLVERTEXATTRIB3FVPROC pglVertexAttrib3fv=_Lazy_glVertexAttrib3fv; +PFNGLVERTEXATTRIB3SPROC pglVertexAttrib3s=_Lazy_glVertexAttrib3s; +PFNGLVERTEXATTRIB3SVPROC pglVertexAttrib3sv=_Lazy_glVertexAttrib3sv; +PFNGLVERTEXATTRIB4NBVPROC pglVertexAttrib4Nbv=_Lazy_glVertexAttrib4Nbv; +PFNGLVERTEXATTRIB4NIVPROC pglVertexAttrib4Niv=_Lazy_glVertexAttrib4Niv; +PFNGLVERTEXATTRIB4NSVPROC pglVertexAttrib4Nsv=_Lazy_glVertexAttrib4Nsv; +PFNGLVERTEXATTRIB4NUBPROC pglVertexAttrib4Nub=_Lazy_glVertexAttrib4Nub; +PFNGLVERTEXATTRIB4NUBVPROC pglVertexAttrib4Nubv=_Lazy_glVertexAttrib4Nubv; +PFNGLVERTEXATTRIB4NUIVPROC pglVertexAttrib4Nuiv=_Lazy_glVertexAttrib4Nuiv; +PFNGLVERTEXATTRIB4NUSVPROC pglVertexAttrib4Nusv=_Lazy_glVertexAttrib4Nusv; +PFNGLVERTEXATTRIB4BVPROC pglVertexAttrib4bv=_Lazy_glVertexAttrib4bv; +PFNGLVERTEXATTRIB4DPROC pglVertexAttrib4d=_Lazy_glVertexAttrib4d; +PFNGLVERTEXATTRIB4DVPROC pglVertexAttrib4dv=_Lazy_glVertexAttrib4dv; +PFNGLVERTEXATTRIB4FPROC pglVertexAttrib4f=_Lazy_glVertexAttrib4f; +PFNGLVERTEXATTRIB4FVPROC pglVertexAttrib4fv=_Lazy_glVertexAttrib4fv; +PFNGLVERTEXATTRIB4IVPROC pglVertexAttrib4iv=_Lazy_glVertexAttrib4iv; +PFNGLVERTEXATTRIB4SPROC pglVertexAttrib4s=_Lazy_glVertexAttrib4s; +PFNGLVERTEXATTRIB4SVPROC pglVertexAttrib4sv=_Lazy_glVertexAttrib4sv; +PFNGLVERTEXATTRIB4UBVPROC pglVertexAttrib4ubv=_Lazy_glVertexAttrib4ubv; +PFNGLVERTEXATTRIB4UIVPROC pglVertexAttrib4uiv=_Lazy_glVertexAttrib4uiv; +PFNGLVERTEXATTRIB4USVPROC pglVertexAttrib4usv=_Lazy_glVertexAttrib4usv; +PFNGLVERTEXATTRIBPOINTERPROC pglVertexAttribPointer=_Lazy_glVertexAttribPointer; +#endif + +/* GL_VERSION_2_1 */ + +#ifdef __GLEE_GL_VERSION_2_1 +void __stdcall _Lazy_glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix2x3fv(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix3x2fv(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix2x4fv(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix4x2fv(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix3x4fv(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix4x3fv(location, count, transpose, value);} +PFNGLUNIFORMMATRIX2X3FVPROC pglUniformMatrix2x3fv=_Lazy_glUniformMatrix2x3fv; +PFNGLUNIFORMMATRIX3X2FVPROC pglUniformMatrix3x2fv=_Lazy_glUniformMatrix3x2fv; +PFNGLUNIFORMMATRIX2X4FVPROC pglUniformMatrix2x4fv=_Lazy_glUniformMatrix2x4fv; +PFNGLUNIFORMMATRIX4X2FVPROC pglUniformMatrix4x2fv=_Lazy_glUniformMatrix4x2fv; +PFNGLUNIFORMMATRIX3X4FVPROC pglUniformMatrix3x4fv=_Lazy_glUniformMatrix3x4fv; +PFNGLUNIFORMMATRIX4X3FVPROC pglUniformMatrix4x3fv=_Lazy_glUniformMatrix4x3fv; +#endif + +/* GL_VERSION_3_0 */ + +#ifdef __GLEE_GL_VERSION_3_0 +void __stdcall _Lazy_glColorMaski(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {if (GLeeInit()) glColorMaski(index, r, g, b, a);} +void __stdcall _Lazy_glGetBooleani_v(GLenum target, GLuint index, GLboolean * data) {if (GLeeInit()) glGetBooleani_v(target, index, data);} +void __stdcall _Lazy_glGetIntegeri_v(GLenum target, GLuint index, GLint * data) {if (GLeeInit()) glGetIntegeri_v(target, index, data);} +void __stdcall _Lazy_glEnablei(GLenum target, GLuint index) {if (GLeeInit()) glEnablei(target, index);} +void __stdcall _Lazy_glDisablei(GLenum target, GLuint index) {if (GLeeInit()) glDisablei(target, index);} +GLboolean __stdcall _Lazy_glIsEnabledi(GLenum target, GLuint index) {if (GLeeInit()) return glIsEnabledi(target, index); return (GLboolean)0;} +void __stdcall _Lazy_glBeginTransformFeedback(GLenum primitiveMode) {if (GLeeInit()) glBeginTransformFeedback(primitiveMode);} +void __stdcall _Lazy_glEndTransformFeedback(void) {if (GLeeInit()) glEndTransformFeedback();} +void __stdcall _Lazy_glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {if (GLeeInit()) glBindBufferRange(target, index, buffer, offset, size);} +void __stdcall _Lazy_glBindBufferBase(GLenum target, GLuint index, GLuint buffer) {if (GLeeInit()) glBindBufferBase(target, index, buffer);} +void __stdcall _Lazy_glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode) {if (GLeeInit()) glTransformFeedbackVaryings(program, count, locations, bufferMode);} +void __stdcall _Lazy_glGetTransformFeedbackVarying(GLuint program, GLuint index, GLint * location) {if (GLeeInit()) glGetTransformFeedbackVarying(program, index, location);} +void __stdcall _Lazy_glClampColor(GLenum target, GLenum clamp) {if (GLeeInit()) glClampColor(target, clamp);} +void __stdcall _Lazy_glBeginConditionalRender(GLuint id, GLenum mode) {if (GLeeInit()) glBeginConditionalRender(id, mode);} +void __stdcall _Lazy_glEndConditionalRender(void) {if (GLeeInit()) glEndConditionalRender();} +void __stdcall _Lazy_glVertexAttribI1i(GLuint index, GLint x) {if (GLeeInit()) glVertexAttribI1i(index, x);} +void __stdcall _Lazy_glVertexAttribI2i(GLuint index, GLint x, GLint y) {if (GLeeInit()) glVertexAttribI2i(index, x, y);} +void __stdcall _Lazy_glVertexAttribI3i(GLuint index, GLint x, GLint y, GLint z) {if (GLeeInit()) glVertexAttribI3i(index, x, y, z);} +void __stdcall _Lazy_glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glVertexAttribI4i(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttribI1ui(GLuint index, GLuint x) {if (GLeeInit()) glVertexAttribI1ui(index, x);} +void __stdcall _Lazy_glVertexAttribI2ui(GLuint index, GLuint x, GLuint y) {if (GLeeInit()) glVertexAttribI2ui(index, x, y);} +void __stdcall _Lazy_glVertexAttribI3ui(GLuint index, GLuint x, GLuint y, GLuint z) {if (GLeeInit()) glVertexAttribI3ui(index, x, y, z);} +void __stdcall _Lazy_glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glVertexAttribI4ui(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttribI1iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI1iv(index, v);} +void __stdcall _Lazy_glVertexAttribI2iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI2iv(index, v);} +void __stdcall _Lazy_glVertexAttribI3iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI3iv(index, v);} +void __stdcall _Lazy_glVertexAttribI4iv(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI4iv(index, v);} +void __stdcall _Lazy_glVertexAttribI1uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI1uiv(index, v);} +void __stdcall _Lazy_glVertexAttribI2uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI2uiv(index, v);} +void __stdcall _Lazy_glVertexAttribI3uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI3uiv(index, v);} +void __stdcall _Lazy_glVertexAttribI4uiv(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI4uiv(index, v);} +void __stdcall _Lazy_glVertexAttribI4bv(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttribI4bv(index, v);} +void __stdcall _Lazy_glVertexAttribI4sv(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttribI4sv(index, v);} +void __stdcall _Lazy_glVertexAttribI4ubv(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttribI4ubv(index, v);} +void __stdcall _Lazy_glVertexAttribI4usv(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttribI4usv(index, v);} +void __stdcall _Lazy_glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribIPointer(index, size, type, stride, pointer);} +void __stdcall _Lazy_glGetVertexAttribIiv(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribIiv(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint * params) {if (GLeeInit()) glGetVertexAttribIuiv(index, pname, params);} +void __stdcall _Lazy_glGetUniformuiv(GLuint program, GLint location, GLuint * params) {if (GLeeInit()) glGetUniformuiv(program, location, params);} +void __stdcall _Lazy_glBindFragDataLocation(GLuint program, GLuint color, const GLchar * name) {if (GLeeInit()) glBindFragDataLocation(program, color, name);} +GLint __stdcall _Lazy_glGetFragDataLocation(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetFragDataLocation(program, name); return (GLint)0;} +void __stdcall _Lazy_glUniform1ui(GLint location, GLuint v0) {if (GLeeInit()) glUniform1ui(location, v0);} +void __stdcall _Lazy_glUniform2ui(GLint location, GLuint v0, GLuint v1) {if (GLeeInit()) glUniform2ui(location, v0, v1);} +void __stdcall _Lazy_glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) {if (GLeeInit()) glUniform3ui(location, v0, v1, v2);} +void __stdcall _Lazy_glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {if (GLeeInit()) glUniform4ui(location, v0, v1, v2, v3);} +void __stdcall _Lazy_glUniform1uiv(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform1uiv(location, count, value);} +void __stdcall _Lazy_glUniform2uiv(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform2uiv(location, count, value);} +void __stdcall _Lazy_glUniform3uiv(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform3uiv(location, count, value);} +void __stdcall _Lazy_glUniform4uiv(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform4uiv(location, count, value);} +void __stdcall _Lazy_glTexParameterIiv(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glTexParameterIiv(target, pname, params);} +void __stdcall _Lazy_glTexParameterIuiv(GLenum target, GLenum pname, const GLuint * params) {if (GLeeInit()) glTexParameterIuiv(target, pname, params);} +void __stdcall _Lazy_glGetTexParameterIiv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetTexParameterIiv(target, pname, params);} +void __stdcall _Lazy_glGetTexParameterIuiv(GLenum target, GLenum pname, GLuint * params) {if (GLeeInit()) glGetTexParameterIuiv(target, pname, params);} +void __stdcall _Lazy_glClearBufferiv(GLenum buffer, const GLint * value) {if (GLeeInit()) glClearBufferiv(buffer, value);} +void __stdcall _Lazy_glClearBufferuiv(GLenum buffer, const GLuint * value) {if (GLeeInit()) glClearBufferuiv(buffer, value);} +void __stdcall _Lazy_glClearBufferfv(GLenum buffer, const GLfloat * value) {if (GLeeInit()) glClearBufferfv(buffer, value);} +void __stdcall _Lazy_glClearBufferfi(GLenum buffer, GLfloat depth, GLint stencil) {if (GLeeInit()) glClearBufferfi(buffer, depth, stencil);} +const GLubyte * __stdcall _Lazy_glGetStringi(GLenum name, GLuint index) {if (GLeeInit()) return glGetStringi(name, index); return (const GLubyte *)0;} +PFNGLCOLORMASKIPROC pglColorMaski=_Lazy_glColorMaski; +PFNGLGETBOOLEANI_VPROC pglGetBooleani_v=_Lazy_glGetBooleani_v; +PFNGLGETINTEGERI_VPROC pglGetIntegeri_v=_Lazy_glGetIntegeri_v; +PFNGLENABLEIPROC pglEnablei=_Lazy_glEnablei; +PFNGLDISABLEIPROC pglDisablei=_Lazy_glDisablei; +PFNGLISENABLEDIPROC pglIsEnabledi=_Lazy_glIsEnabledi; +PFNGLBEGINTRANSFORMFEEDBACKPROC pglBeginTransformFeedback=_Lazy_glBeginTransformFeedback; +PFNGLENDTRANSFORMFEEDBACKPROC pglEndTransformFeedback=_Lazy_glEndTransformFeedback; +PFNGLBINDBUFFERRANGEPROC pglBindBufferRange=_Lazy_glBindBufferRange; +PFNGLBINDBUFFERBASEPROC pglBindBufferBase=_Lazy_glBindBufferBase; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC pglTransformFeedbackVaryings=_Lazy_glTransformFeedbackVaryings; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC pglGetTransformFeedbackVarying=_Lazy_glGetTransformFeedbackVarying; +PFNGLCLAMPCOLORPROC pglClampColor=_Lazy_glClampColor; +PFNGLBEGINCONDITIONALRENDERPROC pglBeginConditionalRender=_Lazy_glBeginConditionalRender; +PFNGLENDCONDITIONALRENDERPROC pglEndConditionalRender=_Lazy_glEndConditionalRender; +PFNGLVERTEXATTRIBI1IPROC pglVertexAttribI1i=_Lazy_glVertexAttribI1i; +PFNGLVERTEXATTRIBI2IPROC pglVertexAttribI2i=_Lazy_glVertexAttribI2i; +PFNGLVERTEXATTRIBI3IPROC pglVertexAttribI3i=_Lazy_glVertexAttribI3i; +PFNGLVERTEXATTRIBI4IPROC pglVertexAttribI4i=_Lazy_glVertexAttribI4i; +PFNGLVERTEXATTRIBI1UIPROC pglVertexAttribI1ui=_Lazy_glVertexAttribI1ui; +PFNGLVERTEXATTRIBI2UIPROC pglVertexAttribI2ui=_Lazy_glVertexAttribI2ui; +PFNGLVERTEXATTRIBI3UIPROC pglVertexAttribI3ui=_Lazy_glVertexAttribI3ui; +PFNGLVERTEXATTRIBI4UIPROC pglVertexAttribI4ui=_Lazy_glVertexAttribI4ui; +PFNGLVERTEXATTRIBI1IVPROC pglVertexAttribI1iv=_Lazy_glVertexAttribI1iv; +PFNGLVERTEXATTRIBI2IVPROC pglVertexAttribI2iv=_Lazy_glVertexAttribI2iv; +PFNGLVERTEXATTRIBI3IVPROC pglVertexAttribI3iv=_Lazy_glVertexAttribI3iv; +PFNGLVERTEXATTRIBI4IVPROC pglVertexAttribI4iv=_Lazy_glVertexAttribI4iv; +PFNGLVERTEXATTRIBI1UIVPROC pglVertexAttribI1uiv=_Lazy_glVertexAttribI1uiv; +PFNGLVERTEXATTRIBI2UIVPROC pglVertexAttribI2uiv=_Lazy_glVertexAttribI2uiv; +PFNGLVERTEXATTRIBI3UIVPROC pglVertexAttribI3uiv=_Lazy_glVertexAttribI3uiv; +PFNGLVERTEXATTRIBI4UIVPROC pglVertexAttribI4uiv=_Lazy_glVertexAttribI4uiv; +PFNGLVERTEXATTRIBI4BVPROC pglVertexAttribI4bv=_Lazy_glVertexAttribI4bv; +PFNGLVERTEXATTRIBI4SVPROC pglVertexAttribI4sv=_Lazy_glVertexAttribI4sv; +PFNGLVERTEXATTRIBI4UBVPROC pglVertexAttribI4ubv=_Lazy_glVertexAttribI4ubv; +PFNGLVERTEXATTRIBI4USVPROC pglVertexAttribI4usv=_Lazy_glVertexAttribI4usv; +PFNGLVERTEXATTRIBIPOINTERPROC pglVertexAttribIPointer=_Lazy_glVertexAttribIPointer; +PFNGLGETVERTEXATTRIBIIVPROC pglGetVertexAttribIiv=_Lazy_glGetVertexAttribIiv; +PFNGLGETVERTEXATTRIBIUIVPROC pglGetVertexAttribIuiv=_Lazy_glGetVertexAttribIuiv; +PFNGLGETUNIFORMUIVPROC pglGetUniformuiv=_Lazy_glGetUniformuiv; +PFNGLBINDFRAGDATALOCATIONPROC pglBindFragDataLocation=_Lazy_glBindFragDataLocation; +PFNGLGETFRAGDATALOCATIONPROC pglGetFragDataLocation=_Lazy_glGetFragDataLocation; +PFNGLUNIFORM1UIPROC pglUniform1ui=_Lazy_glUniform1ui; +PFNGLUNIFORM2UIPROC pglUniform2ui=_Lazy_glUniform2ui; +PFNGLUNIFORM3UIPROC pglUniform3ui=_Lazy_glUniform3ui; +PFNGLUNIFORM4UIPROC pglUniform4ui=_Lazy_glUniform4ui; +PFNGLUNIFORM1UIVPROC pglUniform1uiv=_Lazy_glUniform1uiv; +PFNGLUNIFORM2UIVPROC pglUniform2uiv=_Lazy_glUniform2uiv; +PFNGLUNIFORM3UIVPROC pglUniform3uiv=_Lazy_glUniform3uiv; +PFNGLUNIFORM4UIVPROC pglUniform4uiv=_Lazy_glUniform4uiv; +PFNGLTEXPARAMETERIIVPROC pglTexParameterIiv=_Lazy_glTexParameterIiv; +PFNGLTEXPARAMETERIUIVPROC pglTexParameterIuiv=_Lazy_glTexParameterIuiv; +PFNGLGETTEXPARAMETERIIVPROC pglGetTexParameterIiv=_Lazy_glGetTexParameterIiv; +PFNGLGETTEXPARAMETERIUIVPROC pglGetTexParameterIuiv=_Lazy_glGetTexParameterIuiv; +PFNGLCLEARBUFFERIVPROC pglClearBufferiv=_Lazy_glClearBufferiv; +PFNGLCLEARBUFFERUIVPROC pglClearBufferuiv=_Lazy_glClearBufferuiv; +PFNGLCLEARBUFFERFVPROC pglClearBufferfv=_Lazy_glClearBufferfv; +PFNGLCLEARBUFFERFIPROC pglClearBufferfi=_Lazy_glClearBufferfi; +PFNGLGETSTRINGIPROC pglGetStringi=_Lazy_glGetStringi; +#endif + +/* GL_ARB_multitexture */ + +#ifdef __GLEE_GL_ARB_multitexture +void __stdcall _Lazy_glActiveTextureARB(GLenum texture) {if (GLeeInit()) glActiveTextureARB(texture);} +void __stdcall _Lazy_glClientActiveTextureARB(GLenum texture) {if (GLeeInit()) glClientActiveTextureARB(texture);} +void __stdcall _Lazy_glMultiTexCoord1dARB(GLenum target, GLdouble s) {if (GLeeInit()) glMultiTexCoord1dARB(target, s);} +void __stdcall _Lazy_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord1dvARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord1fARB(GLenum target, GLfloat s) {if (GLeeInit()) glMultiTexCoord1fARB(target, s);} +void __stdcall _Lazy_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord1fvARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord1iARB(GLenum target, GLint s) {if (GLeeInit()) glMultiTexCoord1iARB(target, s);} +void __stdcall _Lazy_glMultiTexCoord1ivARB(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord1ivARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord1sARB(GLenum target, GLshort s) {if (GLeeInit()) glMultiTexCoord1sARB(target, s);} +void __stdcall _Lazy_glMultiTexCoord1svARB(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord1svARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t) {if (GLeeInit()) glMultiTexCoord2dARB(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord2dvARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) {if (GLeeInit()) glMultiTexCoord2fARB(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord2fvARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t) {if (GLeeInit()) glMultiTexCoord2iARB(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2ivARB(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord2ivARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t) {if (GLeeInit()) glMultiTexCoord2sARB(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2svARB(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord2svARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r) {if (GLeeInit()) glMultiTexCoord3dARB(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3dvARB(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord3dvARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r) {if (GLeeInit()) glMultiTexCoord3fARB(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord3fvARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r) {if (GLeeInit()) glMultiTexCoord3iARB(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3ivARB(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord3ivARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r) {if (GLeeInit()) glMultiTexCoord3sARB(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3svARB(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord3svARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) {if (GLeeInit()) glMultiTexCoord4dARB(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4dvARB(GLenum target, const GLdouble * v) {if (GLeeInit()) glMultiTexCoord4dvARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {if (GLeeInit()) glMultiTexCoord4fARB(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v) {if (GLeeInit()) glMultiTexCoord4fvARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q) {if (GLeeInit()) glMultiTexCoord4iARB(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4ivARB(GLenum target, const GLint * v) {if (GLeeInit()) glMultiTexCoord4ivARB(target, v);} +void __stdcall _Lazy_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) {if (GLeeInit()) glMultiTexCoord4sARB(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4svARB(GLenum target, const GLshort * v) {if (GLeeInit()) glMultiTexCoord4svARB(target, v);} +PFNGLACTIVETEXTUREARBPROC pglActiveTextureARB=_Lazy_glActiveTextureARB; +PFNGLCLIENTACTIVETEXTUREARBPROC pglClientActiveTextureARB=_Lazy_glClientActiveTextureARB; +PFNGLMULTITEXCOORD1DARBPROC pglMultiTexCoord1dARB=_Lazy_glMultiTexCoord1dARB; +PFNGLMULTITEXCOORD1DVARBPROC pglMultiTexCoord1dvARB=_Lazy_glMultiTexCoord1dvARB; +PFNGLMULTITEXCOORD1FARBPROC pglMultiTexCoord1fARB=_Lazy_glMultiTexCoord1fARB; +PFNGLMULTITEXCOORD1FVARBPROC pglMultiTexCoord1fvARB=_Lazy_glMultiTexCoord1fvARB; +PFNGLMULTITEXCOORD1IARBPROC pglMultiTexCoord1iARB=_Lazy_glMultiTexCoord1iARB; +PFNGLMULTITEXCOORD1IVARBPROC pglMultiTexCoord1ivARB=_Lazy_glMultiTexCoord1ivARB; +PFNGLMULTITEXCOORD1SARBPROC pglMultiTexCoord1sARB=_Lazy_glMultiTexCoord1sARB; +PFNGLMULTITEXCOORD1SVARBPROC pglMultiTexCoord1svARB=_Lazy_glMultiTexCoord1svARB; +PFNGLMULTITEXCOORD2DARBPROC pglMultiTexCoord2dARB=_Lazy_glMultiTexCoord2dARB; +PFNGLMULTITEXCOORD2DVARBPROC pglMultiTexCoord2dvARB=_Lazy_glMultiTexCoord2dvARB; +PFNGLMULTITEXCOORD2FARBPROC pglMultiTexCoord2fARB=_Lazy_glMultiTexCoord2fARB; +PFNGLMULTITEXCOORD2FVARBPROC pglMultiTexCoord2fvARB=_Lazy_glMultiTexCoord2fvARB; +PFNGLMULTITEXCOORD2IARBPROC pglMultiTexCoord2iARB=_Lazy_glMultiTexCoord2iARB; +PFNGLMULTITEXCOORD2IVARBPROC pglMultiTexCoord2ivARB=_Lazy_glMultiTexCoord2ivARB; +PFNGLMULTITEXCOORD2SARBPROC pglMultiTexCoord2sARB=_Lazy_glMultiTexCoord2sARB; +PFNGLMULTITEXCOORD2SVARBPROC pglMultiTexCoord2svARB=_Lazy_glMultiTexCoord2svARB; +PFNGLMULTITEXCOORD3DARBPROC pglMultiTexCoord3dARB=_Lazy_glMultiTexCoord3dARB; +PFNGLMULTITEXCOORD3DVARBPROC pglMultiTexCoord3dvARB=_Lazy_glMultiTexCoord3dvARB; +PFNGLMULTITEXCOORD3FARBPROC pglMultiTexCoord3fARB=_Lazy_glMultiTexCoord3fARB; +PFNGLMULTITEXCOORD3FVARBPROC pglMultiTexCoord3fvARB=_Lazy_glMultiTexCoord3fvARB; +PFNGLMULTITEXCOORD3IARBPROC pglMultiTexCoord3iARB=_Lazy_glMultiTexCoord3iARB; +PFNGLMULTITEXCOORD3IVARBPROC pglMultiTexCoord3ivARB=_Lazy_glMultiTexCoord3ivARB; +PFNGLMULTITEXCOORD3SARBPROC pglMultiTexCoord3sARB=_Lazy_glMultiTexCoord3sARB; +PFNGLMULTITEXCOORD3SVARBPROC pglMultiTexCoord3svARB=_Lazy_glMultiTexCoord3svARB; +PFNGLMULTITEXCOORD4DARBPROC pglMultiTexCoord4dARB=_Lazy_glMultiTexCoord4dARB; +PFNGLMULTITEXCOORD4DVARBPROC pglMultiTexCoord4dvARB=_Lazy_glMultiTexCoord4dvARB; +PFNGLMULTITEXCOORD4FARBPROC pglMultiTexCoord4fARB=_Lazy_glMultiTexCoord4fARB; +PFNGLMULTITEXCOORD4FVARBPROC pglMultiTexCoord4fvARB=_Lazy_glMultiTexCoord4fvARB; +PFNGLMULTITEXCOORD4IARBPROC pglMultiTexCoord4iARB=_Lazy_glMultiTexCoord4iARB; +PFNGLMULTITEXCOORD4IVARBPROC pglMultiTexCoord4ivARB=_Lazy_glMultiTexCoord4ivARB; +PFNGLMULTITEXCOORD4SARBPROC pglMultiTexCoord4sARB=_Lazy_glMultiTexCoord4sARB; +PFNGLMULTITEXCOORD4SVARBPROC pglMultiTexCoord4svARB=_Lazy_glMultiTexCoord4svARB; +#endif + +/* GL_ARB_transpose_matrix */ + +#ifdef __GLEE_GL_ARB_transpose_matrix +void __stdcall _Lazy_glLoadTransposeMatrixfARB(const GLfloat * m) {if (GLeeInit()) glLoadTransposeMatrixfARB(m);} +void __stdcall _Lazy_glLoadTransposeMatrixdARB(const GLdouble * m) {if (GLeeInit()) glLoadTransposeMatrixdARB(m);} +void __stdcall _Lazy_glMultTransposeMatrixfARB(const GLfloat * m) {if (GLeeInit()) glMultTransposeMatrixfARB(m);} +void __stdcall _Lazy_glMultTransposeMatrixdARB(const GLdouble * m) {if (GLeeInit()) glMultTransposeMatrixdARB(m);} +PFNGLLOADTRANSPOSEMATRIXFARBPROC pglLoadTransposeMatrixfARB=_Lazy_glLoadTransposeMatrixfARB; +PFNGLLOADTRANSPOSEMATRIXDARBPROC pglLoadTransposeMatrixdARB=_Lazy_glLoadTransposeMatrixdARB; +PFNGLMULTTRANSPOSEMATRIXFARBPROC pglMultTransposeMatrixfARB=_Lazy_glMultTransposeMatrixfARB; +PFNGLMULTTRANSPOSEMATRIXDARBPROC pglMultTransposeMatrixdARB=_Lazy_glMultTransposeMatrixdARB; +#endif + +/* GL_ARB_multisample */ + +#ifdef __GLEE_GL_ARB_multisample +void __stdcall _Lazy_glSampleCoverageARB(GLclampf value, GLboolean invert) {if (GLeeInit()) glSampleCoverageARB(value, invert);} +PFNGLSAMPLECOVERAGEARBPROC pglSampleCoverageARB=_Lazy_glSampleCoverageARB; +#endif + +/* GL_ARB_texture_env_add */ + +#ifdef __GLEE_GL_ARB_texture_env_add +#endif + +/* GL_ARB_texture_cube_map */ + +#ifdef __GLEE_GL_ARB_texture_cube_map +#endif + +/* GL_ARB_texture_compression */ + +#ifdef __GLEE_GL_ARB_texture_compression +void __stdcall _Lazy_glCompressedTexImage3DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, data);} +void __stdcall _Lazy_glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, data);} +void __stdcall _Lazy_glCompressedTexImage1DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, data);} +void __stdcall _Lazy_glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);} +void __stdcall _Lazy_glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data);} +void __stdcall _Lazy_glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) {if (GLeeInit()) glCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, data);} +void __stdcall _Lazy_glGetCompressedTexImageARB(GLenum target, GLint level, GLvoid * img) {if (GLeeInit()) glGetCompressedTexImageARB(target, level, img);} +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC pglCompressedTexImage3DARB=_Lazy_glCompressedTexImage3DARB; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC pglCompressedTexImage2DARB=_Lazy_glCompressedTexImage2DARB; +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC pglCompressedTexImage1DARB=_Lazy_glCompressedTexImage1DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC pglCompressedTexSubImage3DARB=_Lazy_glCompressedTexSubImage3DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC pglCompressedTexSubImage2DARB=_Lazy_glCompressedTexSubImage2DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC pglCompressedTexSubImage1DARB=_Lazy_glCompressedTexSubImage1DARB; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC pglGetCompressedTexImageARB=_Lazy_glGetCompressedTexImageARB; +#endif + +/* GL_ARB_texture_border_clamp */ + +#ifdef __GLEE_GL_ARB_texture_border_clamp +#endif + +/* GL_ARB_point_parameters */ + +#ifdef __GLEE_GL_ARB_point_parameters +void __stdcall _Lazy_glPointParameterfARB(GLenum pname, GLfloat param) {if (GLeeInit()) glPointParameterfARB(pname, param);} +void __stdcall _Lazy_glPointParameterfvARB(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPointParameterfvARB(pname, params);} +PFNGLPOINTPARAMETERFARBPROC pglPointParameterfARB=_Lazy_glPointParameterfARB; +PFNGLPOINTPARAMETERFVARBPROC pglPointParameterfvARB=_Lazy_glPointParameterfvARB; +#endif + +/* GL_ARB_vertex_blend */ + +#ifdef __GLEE_GL_ARB_vertex_blend +void __stdcall _Lazy_glWeightbvARB(GLint size, const GLbyte * weights) {if (GLeeInit()) glWeightbvARB(size, weights);} +void __stdcall _Lazy_glWeightsvARB(GLint size, const GLshort * weights) {if (GLeeInit()) glWeightsvARB(size, weights);} +void __stdcall _Lazy_glWeightivARB(GLint size, const GLint * weights) {if (GLeeInit()) glWeightivARB(size, weights);} +void __stdcall _Lazy_glWeightfvARB(GLint size, const GLfloat * weights) {if (GLeeInit()) glWeightfvARB(size, weights);} +void __stdcall _Lazy_glWeightdvARB(GLint size, const GLdouble * weights) {if (GLeeInit()) glWeightdvARB(size, weights);} +void __stdcall _Lazy_glWeightubvARB(GLint size, const GLubyte * weights) {if (GLeeInit()) glWeightubvARB(size, weights);} +void __stdcall _Lazy_glWeightusvARB(GLint size, const GLushort * weights) {if (GLeeInit()) glWeightusvARB(size, weights);} +void __stdcall _Lazy_glWeightuivARB(GLint size, const GLuint * weights) {if (GLeeInit()) glWeightuivARB(size, weights);} +void __stdcall _Lazy_glWeightPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glWeightPointerARB(size, type, stride, pointer);} +void __stdcall _Lazy_glVertexBlendARB(GLint count) {if (GLeeInit()) glVertexBlendARB(count);} +PFNGLWEIGHTBVARBPROC pglWeightbvARB=_Lazy_glWeightbvARB; +PFNGLWEIGHTSVARBPROC pglWeightsvARB=_Lazy_glWeightsvARB; +PFNGLWEIGHTIVARBPROC pglWeightivARB=_Lazy_glWeightivARB; +PFNGLWEIGHTFVARBPROC pglWeightfvARB=_Lazy_glWeightfvARB; +PFNGLWEIGHTDVARBPROC pglWeightdvARB=_Lazy_glWeightdvARB; +PFNGLWEIGHTUBVARBPROC pglWeightubvARB=_Lazy_glWeightubvARB; +PFNGLWEIGHTUSVARBPROC pglWeightusvARB=_Lazy_glWeightusvARB; +PFNGLWEIGHTUIVARBPROC pglWeightuivARB=_Lazy_glWeightuivARB; +PFNGLWEIGHTPOINTERARBPROC pglWeightPointerARB=_Lazy_glWeightPointerARB; +PFNGLVERTEXBLENDARBPROC pglVertexBlendARB=_Lazy_glVertexBlendARB; +#endif + +/* GL_ARB_matrix_palette */ + +#ifdef __GLEE_GL_ARB_matrix_palette +void __stdcall _Lazy_glCurrentPaletteMatrixARB(GLint index) {if (GLeeInit()) glCurrentPaletteMatrixARB(index);} +void __stdcall _Lazy_glMatrixIndexubvARB(GLint size, const GLubyte * indices) {if (GLeeInit()) glMatrixIndexubvARB(size, indices);} +void __stdcall _Lazy_glMatrixIndexusvARB(GLint size, const GLushort * indices) {if (GLeeInit()) glMatrixIndexusvARB(size, indices);} +void __stdcall _Lazy_glMatrixIndexuivARB(GLint size, const GLuint * indices) {if (GLeeInit()) glMatrixIndexuivARB(size, indices);} +void __stdcall _Lazy_glMatrixIndexPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glMatrixIndexPointerARB(size, type, stride, pointer);} +PFNGLCURRENTPALETTEMATRIXARBPROC pglCurrentPaletteMatrixARB=_Lazy_glCurrentPaletteMatrixARB; +PFNGLMATRIXINDEXUBVARBPROC pglMatrixIndexubvARB=_Lazy_glMatrixIndexubvARB; +PFNGLMATRIXINDEXUSVARBPROC pglMatrixIndexusvARB=_Lazy_glMatrixIndexusvARB; +PFNGLMATRIXINDEXUIVARBPROC pglMatrixIndexuivARB=_Lazy_glMatrixIndexuivARB; +PFNGLMATRIXINDEXPOINTERARBPROC pglMatrixIndexPointerARB=_Lazy_glMatrixIndexPointerARB; +#endif + +/* GL_ARB_texture_env_combine */ + +#ifdef __GLEE_GL_ARB_texture_env_combine +#endif + +/* GL_ARB_texture_env_crossbar */ + +#ifdef __GLEE_GL_ARB_texture_env_crossbar +#endif + +/* GL_ARB_texture_env_dot3 */ + +#ifdef __GLEE_GL_ARB_texture_env_dot3 +#endif + +/* GL_ARB_texture_mirrored_repeat */ + +#ifdef __GLEE_GL_ARB_texture_mirrored_repeat +#endif + +/* GL_ARB_depth_texture */ + +#ifdef __GLEE_GL_ARB_depth_texture +#endif + +/* GL_ARB_shadow */ + +#ifdef __GLEE_GL_ARB_shadow +#endif + +/* GL_ARB_shadow_ambient */ + +#ifdef __GLEE_GL_ARB_shadow_ambient +#endif + +/* GL_ARB_window_pos */ + +#ifdef __GLEE_GL_ARB_window_pos +void __stdcall _Lazy_glWindowPos2dARB(GLdouble x, GLdouble y) {if (GLeeInit()) glWindowPos2dARB(x, y);} +void __stdcall _Lazy_glWindowPos2dvARB(const GLdouble * v) {if (GLeeInit()) glWindowPos2dvARB(v);} +void __stdcall _Lazy_glWindowPos2fARB(GLfloat x, GLfloat y) {if (GLeeInit()) glWindowPos2fARB(x, y);} +void __stdcall _Lazy_glWindowPos2fvARB(const GLfloat * v) {if (GLeeInit()) glWindowPos2fvARB(v);} +void __stdcall _Lazy_glWindowPos2iARB(GLint x, GLint y) {if (GLeeInit()) glWindowPos2iARB(x, y);} +void __stdcall _Lazy_glWindowPos2ivARB(const GLint * v) {if (GLeeInit()) glWindowPos2ivARB(v);} +void __stdcall _Lazy_glWindowPos2sARB(GLshort x, GLshort y) {if (GLeeInit()) glWindowPos2sARB(x, y);} +void __stdcall _Lazy_glWindowPos2svARB(const GLshort * v) {if (GLeeInit()) glWindowPos2svARB(v);} +void __stdcall _Lazy_glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glWindowPos3dARB(x, y, z);} +void __stdcall _Lazy_glWindowPos3dvARB(const GLdouble * v) {if (GLeeInit()) glWindowPos3dvARB(v);} +void __stdcall _Lazy_glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glWindowPos3fARB(x, y, z);} +void __stdcall _Lazy_glWindowPos3fvARB(const GLfloat * v) {if (GLeeInit()) glWindowPos3fvARB(v);} +void __stdcall _Lazy_glWindowPos3iARB(GLint x, GLint y, GLint z) {if (GLeeInit()) glWindowPos3iARB(x, y, z);} +void __stdcall _Lazy_glWindowPos3ivARB(const GLint * v) {if (GLeeInit()) glWindowPos3ivARB(v);} +void __stdcall _Lazy_glWindowPos3sARB(GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glWindowPos3sARB(x, y, z);} +void __stdcall _Lazy_glWindowPos3svARB(const GLshort * v) {if (GLeeInit()) glWindowPos3svARB(v);} +PFNGLWINDOWPOS2DARBPROC pglWindowPos2dARB=_Lazy_glWindowPos2dARB; +PFNGLWINDOWPOS2DVARBPROC pglWindowPos2dvARB=_Lazy_glWindowPos2dvARB; +PFNGLWINDOWPOS2FARBPROC pglWindowPos2fARB=_Lazy_glWindowPos2fARB; +PFNGLWINDOWPOS2FVARBPROC pglWindowPos2fvARB=_Lazy_glWindowPos2fvARB; +PFNGLWINDOWPOS2IARBPROC pglWindowPos2iARB=_Lazy_glWindowPos2iARB; +PFNGLWINDOWPOS2IVARBPROC pglWindowPos2ivARB=_Lazy_glWindowPos2ivARB; +PFNGLWINDOWPOS2SARBPROC pglWindowPos2sARB=_Lazy_glWindowPos2sARB; +PFNGLWINDOWPOS2SVARBPROC pglWindowPos2svARB=_Lazy_glWindowPos2svARB; +PFNGLWINDOWPOS3DARBPROC pglWindowPos3dARB=_Lazy_glWindowPos3dARB; +PFNGLWINDOWPOS3DVARBPROC pglWindowPos3dvARB=_Lazy_glWindowPos3dvARB; +PFNGLWINDOWPOS3FARBPROC pglWindowPos3fARB=_Lazy_glWindowPos3fARB; +PFNGLWINDOWPOS3FVARBPROC pglWindowPos3fvARB=_Lazy_glWindowPos3fvARB; +PFNGLWINDOWPOS3IARBPROC pglWindowPos3iARB=_Lazy_glWindowPos3iARB; +PFNGLWINDOWPOS3IVARBPROC pglWindowPos3ivARB=_Lazy_glWindowPos3ivARB; +PFNGLWINDOWPOS3SARBPROC pglWindowPos3sARB=_Lazy_glWindowPos3sARB; +PFNGLWINDOWPOS3SVARBPROC pglWindowPos3svARB=_Lazy_glWindowPos3svARB; +#endif + +/* GL_ARB_vertex_program */ + +#ifdef __GLEE_GL_ARB_vertex_program +void __stdcall _Lazy_glVertexAttrib1dARB(GLuint index, GLdouble x) {if (GLeeInit()) glVertexAttrib1dARB(index, x);} +void __stdcall _Lazy_glVertexAttrib1dvARB(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib1dvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib1fARB(GLuint index, GLfloat x) {if (GLeeInit()) glVertexAttrib1fARB(index, x);} +void __stdcall _Lazy_glVertexAttrib1fvARB(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib1fvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib1sARB(GLuint index, GLshort x) {if (GLeeInit()) glVertexAttrib1sARB(index, x);} +void __stdcall _Lazy_glVertexAttrib1svARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib1svARB(index, v);} +void __stdcall _Lazy_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y) {if (GLeeInit()) glVertexAttrib2dARB(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2dvARB(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib2dvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) {if (GLeeInit()) glVertexAttrib2fARB(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2fvARB(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib2fvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y) {if (GLeeInit()) glVertexAttrib2sARB(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2svARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib2svARB(index, v);} +void __stdcall _Lazy_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glVertexAttrib3dARB(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3dvARB(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib3dvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glVertexAttrib3fARB(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3fvARB(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib3fvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glVertexAttrib3sARB(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3svARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib3svARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4NbvARB(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttrib4NbvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4NivARB(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttrib4NivARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4NsvARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4NsvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) {if (GLeeInit()) glVertexAttrib4NubARB(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4NubvARB(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4NubvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4NuivARB(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttrib4NuivARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4NusvARB(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttrib4NusvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4bvARB(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttrib4bvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glVertexAttrib4dARB(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4dvARB(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib4dvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glVertexAttrib4fARB(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4fvARB(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib4fvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4ivARB(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttrib4ivARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glVertexAttrib4sARB(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4svARB(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4svARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4ubvARB(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4ubvARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4uivARB(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttrib4uivARB(index, v);} +void __stdcall _Lazy_glVertexAttrib4usvARB(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttrib4usvARB(index, v);} +void __stdcall _Lazy_glVertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribPointerARB(index, size, type, normalized, stride, pointer);} +void __stdcall _Lazy_glEnableVertexAttribArrayARB(GLuint index) {if (GLeeInit()) glEnableVertexAttribArrayARB(index);} +void __stdcall _Lazy_glDisableVertexAttribArrayARB(GLuint index) {if (GLeeInit()) glDisableVertexAttribArrayARB(index);} +void __stdcall _Lazy_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string) {if (GLeeInit()) glProgramStringARB(target, format, len, string);} +void __stdcall _Lazy_glBindProgramARB(GLenum target, GLuint program) {if (GLeeInit()) glBindProgramARB(target, program);} +void __stdcall _Lazy_glDeleteProgramsARB(GLsizei n, const GLuint * programs) {if (GLeeInit()) glDeleteProgramsARB(n, programs);} +void __stdcall _Lazy_glGenProgramsARB(GLsizei n, GLuint * programs) {if (GLeeInit()) glGenProgramsARB(n, programs);} +void __stdcall _Lazy_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glProgramEnvParameter4dARB(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) {if (GLeeInit()) glProgramEnvParameter4dvARB(target, index, params);} +void __stdcall _Lazy_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glProgramEnvParameter4fARB(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) {if (GLeeInit()) glProgramEnvParameter4fvARB(target, index, params);} +void __stdcall _Lazy_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glProgramLocalParameter4dARB(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) {if (GLeeInit()) glProgramLocalParameter4dvARB(target, index, params);} +void __stdcall _Lazy_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glProgramLocalParameter4fARB(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) {if (GLeeInit()) glProgramLocalParameter4fvARB(target, index, params);} +void __stdcall _Lazy_glGetProgramEnvParameterdvARB(GLenum target, GLuint index, GLdouble * params) {if (GLeeInit()) glGetProgramEnvParameterdvARB(target, index, params);} +void __stdcall _Lazy_glGetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat * params) {if (GLeeInit()) glGetProgramEnvParameterfvARB(target, index, params);} +void __stdcall _Lazy_glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble * params) {if (GLeeInit()) glGetProgramLocalParameterdvARB(target, index, params);} +void __stdcall _Lazy_glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat * params) {if (GLeeInit()) glGetProgramLocalParameterfvARB(target, index, params);} +void __stdcall _Lazy_glGetProgramivARB(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetProgramivARB(target, pname, params);} +void __stdcall _Lazy_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) {if (GLeeInit()) glGetProgramStringARB(target, pname, string);} +void __stdcall _Lazy_glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetVertexAttribdvARB(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVertexAttribfvARB(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribivARB(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid* * pointer) {if (GLeeInit()) glGetVertexAttribPointervARB(index, pname, pointer);} +GLboolean __stdcall _Lazy_glIsProgramARB(GLuint program) {if (GLeeInit()) return glIsProgramARB(program); return (GLboolean)0;} +PFNGLVERTEXATTRIB1DARBPROC pglVertexAttrib1dARB=_Lazy_glVertexAttrib1dARB; +PFNGLVERTEXATTRIB1DVARBPROC pglVertexAttrib1dvARB=_Lazy_glVertexAttrib1dvARB; +PFNGLVERTEXATTRIB1FARBPROC pglVertexAttrib1fARB=_Lazy_glVertexAttrib1fARB; +PFNGLVERTEXATTRIB1FVARBPROC pglVertexAttrib1fvARB=_Lazy_glVertexAttrib1fvARB; +PFNGLVERTEXATTRIB1SARBPROC pglVertexAttrib1sARB=_Lazy_glVertexAttrib1sARB; +PFNGLVERTEXATTRIB1SVARBPROC pglVertexAttrib1svARB=_Lazy_glVertexAttrib1svARB; +PFNGLVERTEXATTRIB2DARBPROC pglVertexAttrib2dARB=_Lazy_glVertexAttrib2dARB; +PFNGLVERTEXATTRIB2DVARBPROC pglVertexAttrib2dvARB=_Lazy_glVertexAttrib2dvARB; +PFNGLVERTEXATTRIB2FARBPROC pglVertexAttrib2fARB=_Lazy_glVertexAttrib2fARB; +PFNGLVERTEXATTRIB2FVARBPROC pglVertexAttrib2fvARB=_Lazy_glVertexAttrib2fvARB; +PFNGLVERTEXATTRIB2SARBPROC pglVertexAttrib2sARB=_Lazy_glVertexAttrib2sARB; +PFNGLVERTEXATTRIB2SVARBPROC pglVertexAttrib2svARB=_Lazy_glVertexAttrib2svARB; +PFNGLVERTEXATTRIB3DARBPROC pglVertexAttrib3dARB=_Lazy_glVertexAttrib3dARB; +PFNGLVERTEXATTRIB3DVARBPROC pglVertexAttrib3dvARB=_Lazy_glVertexAttrib3dvARB; +PFNGLVERTEXATTRIB3FARBPROC pglVertexAttrib3fARB=_Lazy_glVertexAttrib3fARB; +PFNGLVERTEXATTRIB3FVARBPROC pglVertexAttrib3fvARB=_Lazy_glVertexAttrib3fvARB; +PFNGLVERTEXATTRIB3SARBPROC pglVertexAttrib3sARB=_Lazy_glVertexAttrib3sARB; +PFNGLVERTEXATTRIB3SVARBPROC pglVertexAttrib3svARB=_Lazy_glVertexAttrib3svARB; +PFNGLVERTEXATTRIB4NBVARBPROC pglVertexAttrib4NbvARB=_Lazy_glVertexAttrib4NbvARB; +PFNGLVERTEXATTRIB4NIVARBPROC pglVertexAttrib4NivARB=_Lazy_glVertexAttrib4NivARB; +PFNGLVERTEXATTRIB4NSVARBPROC pglVertexAttrib4NsvARB=_Lazy_glVertexAttrib4NsvARB; +PFNGLVERTEXATTRIB4NUBARBPROC pglVertexAttrib4NubARB=_Lazy_glVertexAttrib4NubARB; +PFNGLVERTEXATTRIB4NUBVARBPROC pglVertexAttrib4NubvARB=_Lazy_glVertexAttrib4NubvARB; +PFNGLVERTEXATTRIB4NUIVARBPROC pglVertexAttrib4NuivARB=_Lazy_glVertexAttrib4NuivARB; +PFNGLVERTEXATTRIB4NUSVARBPROC pglVertexAttrib4NusvARB=_Lazy_glVertexAttrib4NusvARB; +PFNGLVERTEXATTRIB4BVARBPROC pglVertexAttrib4bvARB=_Lazy_glVertexAttrib4bvARB; +PFNGLVERTEXATTRIB4DARBPROC pglVertexAttrib4dARB=_Lazy_glVertexAttrib4dARB; +PFNGLVERTEXATTRIB4DVARBPROC pglVertexAttrib4dvARB=_Lazy_glVertexAttrib4dvARB; +PFNGLVERTEXATTRIB4FARBPROC pglVertexAttrib4fARB=_Lazy_glVertexAttrib4fARB; +PFNGLVERTEXATTRIB4FVARBPROC pglVertexAttrib4fvARB=_Lazy_glVertexAttrib4fvARB; +PFNGLVERTEXATTRIB4IVARBPROC pglVertexAttrib4ivARB=_Lazy_glVertexAttrib4ivARB; +PFNGLVERTEXATTRIB4SARBPROC pglVertexAttrib4sARB=_Lazy_glVertexAttrib4sARB; +PFNGLVERTEXATTRIB4SVARBPROC pglVertexAttrib4svARB=_Lazy_glVertexAttrib4svARB; +PFNGLVERTEXATTRIB4UBVARBPROC pglVertexAttrib4ubvARB=_Lazy_glVertexAttrib4ubvARB; +PFNGLVERTEXATTRIB4UIVARBPROC pglVertexAttrib4uivARB=_Lazy_glVertexAttrib4uivARB; +PFNGLVERTEXATTRIB4USVARBPROC pglVertexAttrib4usvARB=_Lazy_glVertexAttrib4usvARB; +PFNGLVERTEXATTRIBPOINTERARBPROC pglVertexAttribPointerARB=_Lazy_glVertexAttribPointerARB; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC pglEnableVertexAttribArrayARB=_Lazy_glEnableVertexAttribArrayARB; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC pglDisableVertexAttribArrayARB=_Lazy_glDisableVertexAttribArrayARB; +PFNGLPROGRAMSTRINGARBPROC pglProgramStringARB=_Lazy_glProgramStringARB; +PFNGLBINDPROGRAMARBPROC pglBindProgramARB=_Lazy_glBindProgramARB; +PFNGLDELETEPROGRAMSARBPROC pglDeleteProgramsARB=_Lazy_glDeleteProgramsARB; +PFNGLGENPROGRAMSARBPROC pglGenProgramsARB=_Lazy_glGenProgramsARB; +PFNGLPROGRAMENVPARAMETER4DARBPROC pglProgramEnvParameter4dARB=_Lazy_glProgramEnvParameter4dARB; +PFNGLPROGRAMENVPARAMETER4DVARBPROC pglProgramEnvParameter4dvARB=_Lazy_glProgramEnvParameter4dvARB; +PFNGLPROGRAMENVPARAMETER4FARBPROC pglProgramEnvParameter4fARB=_Lazy_glProgramEnvParameter4fARB; +PFNGLPROGRAMENVPARAMETER4FVARBPROC pglProgramEnvParameter4fvARB=_Lazy_glProgramEnvParameter4fvARB; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC pglProgramLocalParameter4dARB=_Lazy_glProgramLocalParameter4dARB; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC pglProgramLocalParameter4dvARB=_Lazy_glProgramLocalParameter4dvARB; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC pglProgramLocalParameter4fARB=_Lazy_glProgramLocalParameter4fARB; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC pglProgramLocalParameter4fvARB=_Lazy_glProgramLocalParameter4fvARB; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC pglGetProgramEnvParameterdvARB=_Lazy_glGetProgramEnvParameterdvARB; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC pglGetProgramEnvParameterfvARB=_Lazy_glGetProgramEnvParameterfvARB; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC pglGetProgramLocalParameterdvARB=_Lazy_glGetProgramLocalParameterdvARB; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC pglGetProgramLocalParameterfvARB=_Lazy_glGetProgramLocalParameterfvARB; +PFNGLGETPROGRAMIVARBPROC pglGetProgramivARB=_Lazy_glGetProgramivARB; +PFNGLGETPROGRAMSTRINGARBPROC pglGetProgramStringARB=_Lazy_glGetProgramStringARB; +PFNGLGETVERTEXATTRIBDVARBPROC pglGetVertexAttribdvARB=_Lazy_glGetVertexAttribdvARB; +PFNGLGETVERTEXATTRIBFVARBPROC pglGetVertexAttribfvARB=_Lazy_glGetVertexAttribfvARB; +PFNGLGETVERTEXATTRIBIVARBPROC pglGetVertexAttribivARB=_Lazy_glGetVertexAttribivARB; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC pglGetVertexAttribPointervARB=_Lazy_glGetVertexAttribPointervARB; +PFNGLISPROGRAMARBPROC pglIsProgramARB=_Lazy_glIsProgramARB; +#endif + +/* GL_ARB_fragment_program */ + +#ifdef __GLEE_GL_ARB_fragment_program +#endif + +/* GL_ARB_vertex_buffer_object */ + +#ifdef __GLEE_GL_ARB_vertex_buffer_object +void __stdcall _Lazy_glBindBufferARB(GLenum target, GLuint buffer) {if (GLeeInit()) glBindBufferARB(target, buffer);} +void __stdcall _Lazy_glDeleteBuffersARB(GLsizei n, const GLuint * buffers) {if (GLeeInit()) glDeleteBuffersARB(n, buffers);} +void __stdcall _Lazy_glGenBuffersARB(GLsizei n, GLuint * buffers) {if (GLeeInit()) glGenBuffersARB(n, buffers);} +GLboolean __stdcall _Lazy_glIsBufferARB(GLuint buffer) {if (GLeeInit()) return glIsBufferARB(buffer); return (GLboolean)0;} +void __stdcall _Lazy_glBufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage) {if (GLeeInit()) glBufferDataARB(target, size, data, usage);} +void __stdcall _Lazy_glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data) {if (GLeeInit()) glBufferSubDataARB(target, offset, size, data);} +void __stdcall _Lazy_glGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data) {if (GLeeInit()) glGetBufferSubDataARB(target, offset, size, data);} +GLvoid* __stdcall _Lazy_glMapBufferARB(GLenum target, GLenum access) {if (GLeeInit()) return glMapBufferARB(target, access); return (GLvoid*)0;} +GLboolean __stdcall _Lazy_glUnmapBufferARB(GLenum target) {if (GLeeInit()) return glUnmapBufferARB(target); return (GLboolean)0;} +void __stdcall _Lazy_glGetBufferParameterivARB(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetBufferParameterivARB(target, pname, params);} +void __stdcall _Lazy_glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid* * params) {if (GLeeInit()) glGetBufferPointervARB(target, pname, params);} +PFNGLBINDBUFFERARBPROC pglBindBufferARB=_Lazy_glBindBufferARB; +PFNGLDELETEBUFFERSARBPROC pglDeleteBuffersARB=_Lazy_glDeleteBuffersARB; +PFNGLGENBUFFERSARBPROC pglGenBuffersARB=_Lazy_glGenBuffersARB; +PFNGLISBUFFERARBPROC pglIsBufferARB=_Lazy_glIsBufferARB; +PFNGLBUFFERDATAARBPROC pglBufferDataARB=_Lazy_glBufferDataARB; +PFNGLBUFFERSUBDATAARBPROC pglBufferSubDataARB=_Lazy_glBufferSubDataARB; +PFNGLGETBUFFERSUBDATAARBPROC pglGetBufferSubDataARB=_Lazy_glGetBufferSubDataARB; +PFNGLMAPBUFFERARBPROC pglMapBufferARB=_Lazy_glMapBufferARB; +PFNGLUNMAPBUFFERARBPROC pglUnmapBufferARB=_Lazy_glUnmapBufferARB; +PFNGLGETBUFFERPARAMETERIVARBPROC pglGetBufferParameterivARB=_Lazy_glGetBufferParameterivARB; +PFNGLGETBUFFERPOINTERVARBPROC pglGetBufferPointervARB=_Lazy_glGetBufferPointervARB; +#endif + +/* GL_ARB_occlusion_query */ + +#ifdef __GLEE_GL_ARB_occlusion_query +void __stdcall _Lazy_glGenQueriesARB(GLsizei n, GLuint * ids) {if (GLeeInit()) glGenQueriesARB(n, ids);} +void __stdcall _Lazy_glDeleteQueriesARB(GLsizei n, const GLuint * ids) {if (GLeeInit()) glDeleteQueriesARB(n, ids);} +GLboolean __stdcall _Lazy_glIsQueryARB(GLuint id) {if (GLeeInit()) return glIsQueryARB(id); return (GLboolean)0;} +void __stdcall _Lazy_glBeginQueryARB(GLenum target, GLuint id) {if (GLeeInit()) glBeginQueryARB(target, id);} +void __stdcall _Lazy_glEndQueryARB(GLenum target) {if (GLeeInit()) glEndQueryARB(target);} +void __stdcall _Lazy_glGetQueryivARB(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetQueryivARB(target, pname, params);} +void __stdcall _Lazy_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetQueryObjectivARB(id, pname, params);} +void __stdcall _Lazy_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params) {if (GLeeInit()) glGetQueryObjectuivARB(id, pname, params);} +PFNGLGENQUERIESARBPROC pglGenQueriesARB=_Lazy_glGenQueriesARB; +PFNGLDELETEQUERIESARBPROC pglDeleteQueriesARB=_Lazy_glDeleteQueriesARB; +PFNGLISQUERYARBPROC pglIsQueryARB=_Lazy_glIsQueryARB; +PFNGLBEGINQUERYARBPROC pglBeginQueryARB=_Lazy_glBeginQueryARB; +PFNGLENDQUERYARBPROC pglEndQueryARB=_Lazy_glEndQueryARB; +PFNGLGETQUERYIVARBPROC pglGetQueryivARB=_Lazy_glGetQueryivARB; +PFNGLGETQUERYOBJECTIVARBPROC pglGetQueryObjectivARB=_Lazy_glGetQueryObjectivARB; +PFNGLGETQUERYOBJECTUIVARBPROC pglGetQueryObjectuivARB=_Lazy_glGetQueryObjectuivARB; +#endif + +/* GL_ARB_shader_objects */ + +#ifdef __GLEE_GL_ARB_shader_objects +void __stdcall _Lazy_glDeleteObjectARB(GLhandleARB obj) {if (GLeeInit()) glDeleteObjectARB(obj);} +GLhandleARB __stdcall _Lazy_glGetHandleARB(GLenum pname) {if (GLeeInit()) return glGetHandleARB(pname); return (GLhandleARB)0;} +void __stdcall _Lazy_glDetachObjectARB(GLhandleARB containerObj, GLhandleARB attachedObj) {if (GLeeInit()) glDetachObjectARB(containerObj, attachedObj);} +GLhandleARB __stdcall _Lazy_glCreateShaderObjectARB(GLenum shaderType) {if (GLeeInit()) return glCreateShaderObjectARB(shaderType); return (GLhandleARB)0;} +void __stdcall _Lazy_glShaderSourceARB(GLhandleARB shaderObj, GLsizei count, const GLcharARB* * string, const GLint * length) {if (GLeeInit()) glShaderSourceARB(shaderObj, count, string, length);} +void __stdcall _Lazy_glCompileShaderARB(GLhandleARB shaderObj) {if (GLeeInit()) glCompileShaderARB(shaderObj);} +GLhandleARB __stdcall _Lazy_glCreateProgramObjectARB(void) {if (GLeeInit()) return glCreateProgramObjectARB(); return (GLhandleARB)0;} +void __stdcall _Lazy_glAttachObjectARB(GLhandleARB containerObj, GLhandleARB obj) {if (GLeeInit()) glAttachObjectARB(containerObj, obj);} +void __stdcall _Lazy_glLinkProgramARB(GLhandleARB programObj) {if (GLeeInit()) glLinkProgramARB(programObj);} +void __stdcall _Lazy_glUseProgramObjectARB(GLhandleARB programObj) {if (GLeeInit()) glUseProgramObjectARB(programObj);} +void __stdcall _Lazy_glValidateProgramARB(GLhandleARB programObj) {if (GLeeInit()) glValidateProgramARB(programObj);} +void __stdcall _Lazy_glUniform1fARB(GLint location, GLfloat v0) {if (GLeeInit()) glUniform1fARB(location, v0);} +void __stdcall _Lazy_glUniform2fARB(GLint location, GLfloat v0, GLfloat v1) {if (GLeeInit()) glUniform2fARB(location, v0, v1);} +void __stdcall _Lazy_glUniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {if (GLeeInit()) glUniform3fARB(location, v0, v1, v2);} +void __stdcall _Lazy_glUniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {if (GLeeInit()) glUniform4fARB(location, v0, v1, v2, v3);} +void __stdcall _Lazy_glUniform1iARB(GLint location, GLint v0) {if (GLeeInit()) glUniform1iARB(location, v0);} +void __stdcall _Lazy_glUniform2iARB(GLint location, GLint v0, GLint v1) {if (GLeeInit()) glUniform2iARB(location, v0, v1);} +void __stdcall _Lazy_glUniform3iARB(GLint location, GLint v0, GLint v1, GLint v2) {if (GLeeInit()) glUniform3iARB(location, v0, v1, v2);} +void __stdcall _Lazy_glUniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {if (GLeeInit()) glUniform4iARB(location, v0, v1, v2, v3);} +void __stdcall _Lazy_glUniform1fvARB(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform1fvARB(location, count, value);} +void __stdcall _Lazy_glUniform2fvARB(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform2fvARB(location, count, value);} +void __stdcall _Lazy_glUniform3fvARB(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform3fvARB(location, count, value);} +void __stdcall _Lazy_glUniform4fvARB(GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glUniform4fvARB(location, count, value);} +void __stdcall _Lazy_glUniform1ivARB(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform1ivARB(location, count, value);} +void __stdcall _Lazy_glUniform2ivARB(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform2ivARB(location, count, value);} +void __stdcall _Lazy_glUniform3ivARB(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform3ivARB(location, count, value);} +void __stdcall _Lazy_glUniform4ivARB(GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glUniform4ivARB(location, count, value);} +void __stdcall _Lazy_glUniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix2fvARB(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix3fvARB(location, count, transpose, value);} +void __stdcall _Lazy_glUniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glUniformMatrix4fvARB(location, count, transpose, value);} +void __stdcall _Lazy_glGetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetObjectParameterfvARB(obj, pname, params);} +void __stdcall _Lazy_glGetObjectParameterivARB(GLhandleARB obj, GLenum pname, GLint * params) {if (GLeeInit()) glGetObjectParameterivARB(obj, pname, params);} +void __stdcall _Lazy_glGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog) {if (GLeeInit()) glGetInfoLogARB(obj, maxLength, length, infoLog);} +void __stdcall _Lazy_glGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj) {if (GLeeInit()) glGetAttachedObjectsARB(containerObj, maxCount, count, obj);} +GLint __stdcall _Lazy_glGetUniformLocationARB(GLhandleARB programObj, const GLcharARB * name) {if (GLeeInit()) return glGetUniformLocationARB(programObj, name); return (GLint)0;} +void __stdcall _Lazy_glGetActiveUniformARB(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) {if (GLeeInit()) glGetActiveUniformARB(programObj, index, maxLength, length, size, type, name);} +void __stdcall _Lazy_glGetUniformfvARB(GLhandleARB programObj, GLint location, GLfloat * params) {if (GLeeInit()) glGetUniformfvARB(programObj, location, params);} +void __stdcall _Lazy_glGetUniformivARB(GLhandleARB programObj, GLint location, GLint * params) {if (GLeeInit()) glGetUniformivARB(programObj, location, params);} +void __stdcall _Lazy_glGetShaderSourceARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source) {if (GLeeInit()) glGetShaderSourceARB(obj, maxLength, length, source);} +PFNGLDELETEOBJECTARBPROC pglDeleteObjectARB=_Lazy_glDeleteObjectARB; +PFNGLGETHANDLEARBPROC pglGetHandleARB=_Lazy_glGetHandleARB; +PFNGLDETACHOBJECTARBPROC pglDetachObjectARB=_Lazy_glDetachObjectARB; +PFNGLCREATESHADEROBJECTARBPROC pglCreateShaderObjectARB=_Lazy_glCreateShaderObjectARB; +PFNGLSHADERSOURCEARBPROC pglShaderSourceARB=_Lazy_glShaderSourceARB; +PFNGLCOMPILESHADERARBPROC pglCompileShaderARB=_Lazy_glCompileShaderARB; +PFNGLCREATEPROGRAMOBJECTARBPROC pglCreateProgramObjectARB=_Lazy_glCreateProgramObjectARB; +PFNGLATTACHOBJECTARBPROC pglAttachObjectARB=_Lazy_glAttachObjectARB; +PFNGLLINKPROGRAMARBPROC pglLinkProgramARB=_Lazy_glLinkProgramARB; +PFNGLUSEPROGRAMOBJECTARBPROC pglUseProgramObjectARB=_Lazy_glUseProgramObjectARB; +PFNGLVALIDATEPROGRAMARBPROC pglValidateProgramARB=_Lazy_glValidateProgramARB; +PFNGLUNIFORM1FARBPROC pglUniform1fARB=_Lazy_glUniform1fARB; +PFNGLUNIFORM2FARBPROC pglUniform2fARB=_Lazy_glUniform2fARB; +PFNGLUNIFORM3FARBPROC pglUniform3fARB=_Lazy_glUniform3fARB; +PFNGLUNIFORM4FARBPROC pglUniform4fARB=_Lazy_glUniform4fARB; +PFNGLUNIFORM1IARBPROC pglUniform1iARB=_Lazy_glUniform1iARB; +PFNGLUNIFORM2IARBPROC pglUniform2iARB=_Lazy_glUniform2iARB; +PFNGLUNIFORM3IARBPROC pglUniform3iARB=_Lazy_glUniform3iARB; +PFNGLUNIFORM4IARBPROC pglUniform4iARB=_Lazy_glUniform4iARB; +PFNGLUNIFORM1FVARBPROC pglUniform1fvARB=_Lazy_glUniform1fvARB; +PFNGLUNIFORM2FVARBPROC pglUniform2fvARB=_Lazy_glUniform2fvARB; +PFNGLUNIFORM3FVARBPROC pglUniform3fvARB=_Lazy_glUniform3fvARB; +PFNGLUNIFORM4FVARBPROC pglUniform4fvARB=_Lazy_glUniform4fvARB; +PFNGLUNIFORM1IVARBPROC pglUniform1ivARB=_Lazy_glUniform1ivARB; +PFNGLUNIFORM2IVARBPROC pglUniform2ivARB=_Lazy_glUniform2ivARB; +PFNGLUNIFORM3IVARBPROC pglUniform3ivARB=_Lazy_glUniform3ivARB; +PFNGLUNIFORM4IVARBPROC pglUniform4ivARB=_Lazy_glUniform4ivARB; +PFNGLUNIFORMMATRIX2FVARBPROC pglUniformMatrix2fvARB=_Lazy_glUniformMatrix2fvARB; +PFNGLUNIFORMMATRIX3FVARBPROC pglUniformMatrix3fvARB=_Lazy_glUniformMatrix3fvARB; +PFNGLUNIFORMMATRIX4FVARBPROC pglUniformMatrix4fvARB=_Lazy_glUniformMatrix4fvARB; +PFNGLGETOBJECTPARAMETERFVARBPROC pglGetObjectParameterfvARB=_Lazy_glGetObjectParameterfvARB; +PFNGLGETOBJECTPARAMETERIVARBPROC pglGetObjectParameterivARB=_Lazy_glGetObjectParameterivARB; +PFNGLGETINFOLOGARBPROC pglGetInfoLogARB=_Lazy_glGetInfoLogARB; +PFNGLGETATTACHEDOBJECTSARBPROC pglGetAttachedObjectsARB=_Lazy_glGetAttachedObjectsARB; +PFNGLGETUNIFORMLOCATIONARBPROC pglGetUniformLocationARB=_Lazy_glGetUniformLocationARB; +PFNGLGETACTIVEUNIFORMARBPROC pglGetActiveUniformARB=_Lazy_glGetActiveUniformARB; +PFNGLGETUNIFORMFVARBPROC pglGetUniformfvARB=_Lazy_glGetUniformfvARB; +PFNGLGETUNIFORMIVARBPROC pglGetUniformivARB=_Lazy_glGetUniformivARB; +PFNGLGETSHADERSOURCEARBPROC pglGetShaderSourceARB=_Lazy_glGetShaderSourceARB; +#endif + +/* GL_ARB_vertex_shader */ + +#ifdef __GLEE_GL_ARB_vertex_shader +void __stdcall _Lazy_glBindAttribLocationARB(GLhandleARB programObj, GLuint index, const GLcharARB * name) {if (GLeeInit()) glBindAttribLocationARB(programObj, index, name);} +void __stdcall _Lazy_glGetActiveAttribARB(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) {if (GLeeInit()) glGetActiveAttribARB(programObj, index, maxLength, length, size, type, name);} +GLint __stdcall _Lazy_glGetAttribLocationARB(GLhandleARB programObj, const GLcharARB * name) {if (GLeeInit()) return glGetAttribLocationARB(programObj, name); return (GLint)0;} +PFNGLBINDATTRIBLOCATIONARBPROC pglBindAttribLocationARB=_Lazy_glBindAttribLocationARB; +PFNGLGETACTIVEATTRIBARBPROC pglGetActiveAttribARB=_Lazy_glGetActiveAttribARB; +PFNGLGETATTRIBLOCATIONARBPROC pglGetAttribLocationARB=_Lazy_glGetAttribLocationARB; +#endif + +/* GL_ARB_fragment_shader */ + +#ifdef __GLEE_GL_ARB_fragment_shader +#endif + +/* GL_ARB_shading_language_100 */ + +#ifdef __GLEE_GL_ARB_shading_language_100 +#endif + +/* GL_ARB_texture_non_power_of_two */ + +#ifdef __GLEE_GL_ARB_texture_non_power_of_two +#endif + +/* GL_ARB_point_sprite */ + +#ifdef __GLEE_GL_ARB_point_sprite +#endif + +/* GL_ARB_fragment_program_shadow */ + +#ifdef __GLEE_GL_ARB_fragment_program_shadow +#endif + +/* GL_ARB_draw_buffers */ + +#ifdef __GLEE_GL_ARB_draw_buffers +void __stdcall _Lazy_glDrawBuffersARB(GLsizei n, const GLenum * bufs) {if (GLeeInit()) glDrawBuffersARB(n, bufs);} +PFNGLDRAWBUFFERSARBPROC pglDrawBuffersARB=_Lazy_glDrawBuffersARB; +#endif + +/* GL_ARB_texture_rectangle */ + +#ifdef __GLEE_GL_ARB_texture_rectangle +#endif + +/* GL_ARB_color_buffer_float */ + +#ifdef __GLEE_GL_ARB_color_buffer_float +void __stdcall _Lazy_glClampColorARB(GLenum target, GLenum clamp) {if (GLeeInit()) glClampColorARB(target, clamp);} +PFNGLCLAMPCOLORARBPROC pglClampColorARB=_Lazy_glClampColorARB; +#endif + +/* GL_ARB_half_float_pixel */ + +#ifdef __GLEE_GL_ARB_half_float_pixel +#endif + +/* GL_ARB_texture_float */ + +#ifdef __GLEE_GL_ARB_texture_float +#endif + +/* GL_ARB_pixel_buffer_object */ + +#ifdef __GLEE_GL_ARB_pixel_buffer_object +#endif + +/* GL_ARB_depth_buffer_float */ + +#ifdef __GLEE_GL_ARB_depth_buffer_float +#endif + +/* GL_ARB_drawinstanced */ + +#ifdef __GLEE_GL_ARB_drawinstanced +void __stdcall _Lazy_glDrawArraysInstancedARB(GLenum mode, GLint first, GLsizei count, GLsizei primcount) {if (GLeeInit()) glDrawArraysInstancedARB(mode, first, count, primcount);} +void __stdcall _Lazy_glDrawElementsInstancedARB(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount) {if (GLeeInit()) glDrawElementsInstancedARB(mode, count, type, indices, primcount);} +PFNGLDRAWARRAYSINSTANCEDARBPROC pglDrawArraysInstancedARB=_Lazy_glDrawArraysInstancedARB; +PFNGLDRAWELEMENTSINSTANCEDARBPROC pglDrawElementsInstancedARB=_Lazy_glDrawElementsInstancedARB; +#endif + +/* GL_ARB_framebuffer_object */ + +#ifdef __GLEE_GL_ARB_framebuffer_object +GLboolean __stdcall _Lazy_glIsRenderbuffer(GLuint renderbuffer) {if (GLeeInit()) return glIsRenderbuffer(renderbuffer); return (GLboolean)0;} +void __stdcall _Lazy_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {if (GLeeInit()) glBindRenderbuffer(target, renderbuffer);} +void __stdcall _Lazy_glDeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers) {if (GLeeInit()) glDeleteRenderbuffers(n, renderbuffers);} +void __stdcall _Lazy_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) {if (GLeeInit()) glGenRenderbuffers(n, renderbuffers);} +void __stdcall _Lazy_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorage(target, internalformat, width, height);} +void __stdcall _Lazy_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetRenderbufferParameteriv(target, pname, params);} +GLboolean __stdcall _Lazy_glIsFramebuffer(GLuint framebuffer) {if (GLeeInit()) return glIsFramebuffer(framebuffer); return (GLboolean)0;} +void __stdcall _Lazy_glBindFramebuffer(GLenum target, GLuint framebuffer) {if (GLeeInit()) glBindFramebuffer(target, framebuffer);} +void __stdcall _Lazy_glDeleteFramebuffers(GLsizei n, const GLuint * framebuffers) {if (GLeeInit()) glDeleteFramebuffers(n, framebuffers);} +void __stdcall _Lazy_glGenFramebuffers(GLsizei n, GLuint * framebuffers) {if (GLeeInit()) glGenFramebuffers(n, framebuffers);} +GLenum __stdcall _Lazy_glCheckFramebufferStatus(GLenum target) {if (GLeeInit()) return glCheckFramebufferStatus(target); return (GLenum)0;} +void __stdcall _Lazy_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTexture1D(target, attachment, textarget, texture, level);} +void __stdcall _Lazy_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTexture2D(target, attachment, textarget, texture, level);} +void __stdcall _Lazy_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {if (GLeeInit()) glFramebufferTexture3D(target, attachment, textarget, texture, level, zoffset);} +void __stdcall _Lazy_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {if (GLeeInit()) glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);} +void __stdcall _Lazy_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) {if (GLeeInit()) glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);} +void __stdcall _Lazy_glGenerateMipmap(GLenum target) {if (GLeeInit()) glGenerateMipmap(target);} +void __stdcall _Lazy_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {if (GLeeInit()) glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);} +void __stdcall _Lazy_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorageMultisample(target, samples, internalformat, width, height);} +void __stdcall _Lazy_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {if (GLeeInit()) glFramebufferTextureLayer(target, attachment, texture, level, layer);} +PFNGLISRENDERBUFFERPROC pglIsRenderbuffer=_Lazy_glIsRenderbuffer; +PFNGLBINDRENDERBUFFERPROC pglBindRenderbuffer=_Lazy_glBindRenderbuffer; +PFNGLDELETERENDERBUFFERSPROC pglDeleteRenderbuffers=_Lazy_glDeleteRenderbuffers; +PFNGLGENRENDERBUFFERSPROC pglGenRenderbuffers=_Lazy_glGenRenderbuffers; +PFNGLRENDERBUFFERSTORAGEPROC pglRenderbufferStorage=_Lazy_glRenderbufferStorage; +PFNGLGETRENDERBUFFERPARAMETERIVPROC pglGetRenderbufferParameteriv=_Lazy_glGetRenderbufferParameteriv; +PFNGLISFRAMEBUFFERPROC pglIsFramebuffer=_Lazy_glIsFramebuffer; +PFNGLBINDFRAMEBUFFERPROC pglBindFramebuffer=_Lazy_glBindFramebuffer; +PFNGLDELETEFRAMEBUFFERSPROC pglDeleteFramebuffers=_Lazy_glDeleteFramebuffers; +PFNGLGENFRAMEBUFFERSPROC pglGenFramebuffers=_Lazy_glGenFramebuffers; +PFNGLCHECKFRAMEBUFFERSTATUSPROC pglCheckFramebufferStatus=_Lazy_glCheckFramebufferStatus; +PFNGLFRAMEBUFFERTEXTURE1DPROC pglFramebufferTexture1D=_Lazy_glFramebufferTexture1D; +PFNGLFRAMEBUFFERTEXTURE2DPROC pglFramebufferTexture2D=_Lazy_glFramebufferTexture2D; +PFNGLFRAMEBUFFERTEXTURE3DPROC pglFramebufferTexture3D=_Lazy_glFramebufferTexture3D; +PFNGLFRAMEBUFFERRENDERBUFFERPROC pglFramebufferRenderbuffer=_Lazy_glFramebufferRenderbuffer; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC pglGetFramebufferAttachmentParameteriv=_Lazy_glGetFramebufferAttachmentParameteriv; +PFNGLGENERATEMIPMAPPROC pglGenerateMipmap=_Lazy_glGenerateMipmap; +PFNGLBLITFRAMEBUFFERPROC pglBlitFramebuffer=_Lazy_glBlitFramebuffer; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC pglRenderbufferStorageMultisample=_Lazy_glRenderbufferStorageMultisample; +PFNGLFRAMEBUFFERTEXTURELAYERPROC pglFramebufferTextureLayer=_Lazy_glFramebufferTextureLayer; +#endif + +/* GL_ARB_framebuffer_sRGB */ + +#ifdef __GLEE_GL_ARB_framebuffer_sRGB +#endif + +/* GL_ARB_geometry_shader4 */ + +#ifdef __GLEE_GL_ARB_geometry_shader4 +void __stdcall _Lazy_glProgramParameteriARB(GLuint program, GLenum pname, GLint value) {if (GLeeInit()) glProgramParameteriARB(program, pname, value);} +void __stdcall _Lazy_glFramebufferTextureARB(GLenum target, GLenum attachment, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTextureARB(target, attachment, texture, level);} +void __stdcall _Lazy_glFramebufferTextureLayerARB(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {if (GLeeInit()) glFramebufferTextureLayerARB(target, attachment, texture, level, layer);} +void __stdcall _Lazy_glFramebufferTextureFaceARB(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) {if (GLeeInit()) glFramebufferTextureFaceARB(target, attachment, texture, level, face);} +PFNGLPROGRAMPARAMETERIARBPROC pglProgramParameteriARB=_Lazy_glProgramParameteriARB; +PFNGLFRAMEBUFFERTEXTUREARBPROC pglFramebufferTextureARB=_Lazy_glFramebufferTextureARB; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC pglFramebufferTextureLayerARB=_Lazy_glFramebufferTextureLayerARB; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC pglFramebufferTextureFaceARB=_Lazy_glFramebufferTextureFaceARB; +#endif + +/* GL_ARB_half_float_vertex */ + +#ifdef __GLEE_GL_ARB_half_float_vertex +#endif + +/* GL_ARBinstanced_arrays */ + +#ifdef __GLEE_GL_ARBinstanced_arrays +void __stdcall _Lazy_glVertexAttribDivisor(GLuint index, GLuint divisor) {if (GLeeInit()) glVertexAttribDivisor(index, divisor);} +PFNGLVERTEXATTRIBDIVISORPROC pglVertexAttribDivisor=_Lazy_glVertexAttribDivisor; +#endif + +/* GL_ARB_map_buffer_range */ + +#ifdef __GLEE_GL_ARB_map_buffer_range +void __stdcall _Lazy_glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {if (GLeeInit()) glMapBufferRange(target, offset, length, access);} +void __stdcall _Lazy_glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) {if (GLeeInit()) glFlushMappedBufferRange(target, offset, length);} +PFNGLMAPBUFFERRANGEPROC pglMapBufferRange=_Lazy_glMapBufferRange; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC pglFlushMappedBufferRange=_Lazy_glFlushMappedBufferRange; +#endif + +/* GL_ARB_texture_buffer_object */ + +#ifdef __GLEE_GL_ARB_texture_buffer_object +void __stdcall _Lazy_glTexBufferARB(GLenum target, GLenum internalformat, GLuint buffer) {if (GLeeInit()) glTexBufferARB(target, internalformat, buffer);} +PFNGLTEXBUFFERARBPROC pglTexBufferARB=_Lazy_glTexBufferARB; +#endif + +/* GL_ARB_texture_compression_rgtc */ + +#ifdef __GLEE_GL_ARB_texture_compression_rgtc +#endif + +/* GL_ARB_texture_rg */ + +#ifdef __GLEE_GL_ARB_texture_rg +#endif + +/* GL_ARB_vertex_array_object */ + +#ifdef __GLEE_GL_ARB_vertex_array_object +void __stdcall _Lazy_glBindVertexArray(GLuint array) {if (GLeeInit()) glBindVertexArray(array);} +void __stdcall _Lazy_glDeleteVertexArrays(GLsizei n, const GLuint * arrays) {if (GLeeInit()) glDeleteVertexArrays(n, arrays);} +void __stdcall _Lazy_glGenVertexArrays(GLsizei n, GLuint * arrays) {if (GLeeInit()) glGenVertexArrays(n, arrays);} +GLboolean __stdcall _Lazy_glIsVertexArray(GLuint array) {if (GLeeInit()) return glIsVertexArray(array); return (GLboolean)0;} +PFNGLBINDVERTEXARRAYPROC pglBindVertexArray=_Lazy_glBindVertexArray; +PFNGLDELETEVERTEXARRAYSPROC pglDeleteVertexArrays=_Lazy_glDeleteVertexArrays; +PFNGLGENVERTEXARRAYSPROC pglGenVertexArrays=_Lazy_glGenVertexArrays; +PFNGLISVERTEXARRAYPROC pglIsVertexArray=_Lazy_glIsVertexArray; +#endif + +/* GL_EXT_abgr */ + +#ifdef __GLEE_GL_EXT_abgr +#endif + +/* GL_EXT_blend_color */ + +#ifdef __GLEE_GL_EXT_blend_color +void __stdcall _Lazy_glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {if (GLeeInit()) glBlendColorEXT(red, green, blue, alpha);} +PFNGLBLENDCOLOREXTPROC pglBlendColorEXT=_Lazy_glBlendColorEXT; +#endif + +/* GL_EXT_polygon_offset */ + +#ifdef __GLEE_GL_EXT_polygon_offset +void __stdcall _Lazy_glPolygonOffsetEXT(GLfloat factor, GLfloat bias) {if (GLeeInit()) glPolygonOffsetEXT(factor, bias);} +PFNGLPOLYGONOFFSETEXTPROC pglPolygonOffsetEXT=_Lazy_glPolygonOffsetEXT; +#endif + +/* GL_EXT_texture */ + +#ifdef __GLEE_GL_EXT_texture +#endif + +/* GL_EXT_texture3D */ + +#ifdef __GLEE_GL_EXT_texture3D +void __stdcall _Lazy_glTexImage3DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexImage3DEXT(target, level, internalformat, width, height, depth, border, format, type, pixels);} +void __stdcall _Lazy_glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage3DEXT(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);} +PFNGLTEXIMAGE3DEXTPROC pglTexImage3DEXT=_Lazy_glTexImage3DEXT; +PFNGLTEXSUBIMAGE3DEXTPROC pglTexSubImage3DEXT=_Lazy_glTexSubImage3DEXT; +#endif + +/* GL_SGIS_texture_filter4 */ + +#ifdef __GLEE_GL_SGIS_texture_filter4 +void __stdcall _Lazy_glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat * weights) {if (GLeeInit()) glGetTexFilterFuncSGIS(target, filter, weights);} +void __stdcall _Lazy_glTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat * weights) {if (GLeeInit()) glTexFilterFuncSGIS(target, filter, n, weights);} +PFNGLGETTEXFILTERFUNCSGISPROC pglGetTexFilterFuncSGIS=_Lazy_glGetTexFilterFuncSGIS; +PFNGLTEXFILTERFUNCSGISPROC pglTexFilterFuncSGIS=_Lazy_glTexFilterFuncSGIS; +#endif + +/* GL_EXT_subtexture */ + +#ifdef __GLEE_GL_EXT_subtexture +void __stdcall _Lazy_glTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage1DEXT(target, level, xoffset, width, format, type, pixels);} +void __stdcall _Lazy_glTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage2DEXT(target, level, xoffset, yoffset, width, height, format, type, pixels);} +PFNGLTEXSUBIMAGE1DEXTPROC pglTexSubImage1DEXT=_Lazy_glTexSubImage1DEXT; +PFNGLTEXSUBIMAGE2DEXTPROC pglTexSubImage2DEXT=_Lazy_glTexSubImage2DEXT; +#endif + +/* GL_EXT_copy_texture */ + +#ifdef __GLEE_GL_EXT_copy_texture +void __stdcall _Lazy_glCopyTexImage1DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {if (GLeeInit()) glCopyTexImage1DEXT(target, level, internalformat, x, y, width, border);} +void __stdcall _Lazy_glCopyTexImage2DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {if (GLeeInit()) glCopyTexImage2DEXT(target, level, internalformat, x, y, width, height, border);} +void __stdcall _Lazy_glCopyTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyTexSubImage1DEXT(target, level, xoffset, x, y, width);} +void __stdcall _Lazy_glCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTexSubImage2DEXT(target, level, xoffset, yoffset, x, y, width, height);} +void __stdcall _Lazy_glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTexSubImage3DEXT(target, level, xoffset, yoffset, zoffset, x, y, width, height);} +PFNGLCOPYTEXIMAGE1DEXTPROC pglCopyTexImage1DEXT=_Lazy_glCopyTexImage1DEXT; +PFNGLCOPYTEXIMAGE2DEXTPROC pglCopyTexImage2DEXT=_Lazy_glCopyTexImage2DEXT; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC pglCopyTexSubImage1DEXT=_Lazy_glCopyTexSubImage1DEXT; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC pglCopyTexSubImage2DEXT=_Lazy_glCopyTexSubImage2DEXT; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC pglCopyTexSubImage3DEXT=_Lazy_glCopyTexSubImage3DEXT; +#endif + +/* GL_EXT_histogram */ + +#ifdef __GLEE_GL_EXT_histogram +void __stdcall _Lazy_glGetHistogramEXT(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) {if (GLeeInit()) glGetHistogramEXT(target, reset, format, type, values);} +void __stdcall _Lazy_glGetHistogramParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetHistogramParameterfvEXT(target, pname, params);} +void __stdcall _Lazy_glGetHistogramParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetHistogramParameterivEXT(target, pname, params);} +void __stdcall _Lazy_glGetMinmaxEXT(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) {if (GLeeInit()) glGetMinmaxEXT(target, reset, format, type, values);} +void __stdcall _Lazy_glGetMinmaxParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMinmaxParameterfvEXT(target, pname, params);} +void __stdcall _Lazy_glGetMinmaxParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMinmaxParameterivEXT(target, pname, params);} +void __stdcall _Lazy_glHistogramEXT(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) {if (GLeeInit()) glHistogramEXT(target, width, internalformat, sink);} +void __stdcall _Lazy_glMinmaxEXT(GLenum target, GLenum internalformat, GLboolean sink) {if (GLeeInit()) glMinmaxEXT(target, internalformat, sink);} +void __stdcall _Lazy_glResetHistogramEXT(GLenum target) {if (GLeeInit()) glResetHistogramEXT(target);} +void __stdcall _Lazy_glResetMinmaxEXT(GLenum target) {if (GLeeInit()) glResetMinmaxEXT(target);} +PFNGLGETHISTOGRAMEXTPROC pglGetHistogramEXT=_Lazy_glGetHistogramEXT; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC pglGetHistogramParameterfvEXT=_Lazy_glGetHistogramParameterfvEXT; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC pglGetHistogramParameterivEXT=_Lazy_glGetHistogramParameterivEXT; +PFNGLGETMINMAXEXTPROC pglGetMinmaxEXT=_Lazy_glGetMinmaxEXT; +PFNGLGETMINMAXPARAMETERFVEXTPROC pglGetMinmaxParameterfvEXT=_Lazy_glGetMinmaxParameterfvEXT; +PFNGLGETMINMAXPARAMETERIVEXTPROC pglGetMinmaxParameterivEXT=_Lazy_glGetMinmaxParameterivEXT; +PFNGLHISTOGRAMEXTPROC pglHistogramEXT=_Lazy_glHistogramEXT; +PFNGLMINMAXEXTPROC pglMinmaxEXT=_Lazy_glMinmaxEXT; +PFNGLRESETHISTOGRAMEXTPROC pglResetHistogramEXT=_Lazy_glResetHistogramEXT; +PFNGLRESETMINMAXEXTPROC pglResetMinmaxEXT=_Lazy_glResetMinmaxEXT; +#endif + +/* GL_EXT_convolution */ + +#ifdef __GLEE_GL_EXT_convolution +void __stdcall _Lazy_glConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) {if (GLeeInit()) glConvolutionFilter1DEXT(target, internalformat, width, format, type, image);} +void __stdcall _Lazy_glConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) {if (GLeeInit()) glConvolutionFilter2DEXT(target, internalformat, width, height, format, type, image);} +void __stdcall _Lazy_glConvolutionParameterfEXT(GLenum target, GLenum pname, GLfloat params) {if (GLeeInit()) glConvolutionParameterfEXT(target, pname, params);} +void __stdcall _Lazy_glConvolutionParameterfvEXT(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glConvolutionParameterfvEXT(target, pname, params);} +void __stdcall _Lazy_glConvolutionParameteriEXT(GLenum target, GLenum pname, GLint params) {if (GLeeInit()) glConvolutionParameteriEXT(target, pname, params);} +void __stdcall _Lazy_glConvolutionParameterivEXT(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glConvolutionParameterivEXT(target, pname, params);} +void __stdcall _Lazy_glCopyConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyConvolutionFilter1DEXT(target, internalformat, x, y, width);} +void __stdcall _Lazy_glCopyConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyConvolutionFilter2DEXT(target, internalformat, x, y, width, height);} +void __stdcall _Lazy_glGetConvolutionFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid * image) {if (GLeeInit()) glGetConvolutionFilterEXT(target, format, type, image);} +void __stdcall _Lazy_glGetConvolutionParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetConvolutionParameterfvEXT(target, pname, params);} +void __stdcall _Lazy_glGetConvolutionParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetConvolutionParameterivEXT(target, pname, params);} +void __stdcall _Lazy_glGetSeparableFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) {if (GLeeInit()) glGetSeparableFilterEXT(target, format, type, row, column, span);} +void __stdcall _Lazy_glSeparableFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) {if (GLeeInit()) glSeparableFilter2DEXT(target, internalformat, width, height, format, type, row, column);} +PFNGLCONVOLUTIONFILTER1DEXTPROC pglConvolutionFilter1DEXT=_Lazy_glConvolutionFilter1DEXT; +PFNGLCONVOLUTIONFILTER2DEXTPROC pglConvolutionFilter2DEXT=_Lazy_glConvolutionFilter2DEXT; +PFNGLCONVOLUTIONPARAMETERFEXTPROC pglConvolutionParameterfEXT=_Lazy_glConvolutionParameterfEXT; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC pglConvolutionParameterfvEXT=_Lazy_glConvolutionParameterfvEXT; +PFNGLCONVOLUTIONPARAMETERIEXTPROC pglConvolutionParameteriEXT=_Lazy_glConvolutionParameteriEXT; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC pglConvolutionParameterivEXT=_Lazy_glConvolutionParameterivEXT; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC pglCopyConvolutionFilter1DEXT=_Lazy_glCopyConvolutionFilter1DEXT; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC pglCopyConvolutionFilter2DEXT=_Lazy_glCopyConvolutionFilter2DEXT; +PFNGLGETCONVOLUTIONFILTEREXTPROC pglGetConvolutionFilterEXT=_Lazy_glGetConvolutionFilterEXT; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC pglGetConvolutionParameterfvEXT=_Lazy_glGetConvolutionParameterfvEXT; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC pglGetConvolutionParameterivEXT=_Lazy_glGetConvolutionParameterivEXT; +PFNGLGETSEPARABLEFILTEREXTPROC pglGetSeparableFilterEXT=_Lazy_glGetSeparableFilterEXT; +PFNGLSEPARABLEFILTER2DEXTPROC pglSeparableFilter2DEXT=_Lazy_glSeparableFilter2DEXT; +#endif + +/* GL_SGI_color_matrix */ + +#ifdef __GLEE_GL_SGI_color_matrix +#endif + +/* GL_SGI_color_table */ + +#ifdef __GLEE_GL_SGI_color_table +void __stdcall _Lazy_glColorTableSGI(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) {if (GLeeInit()) glColorTableSGI(target, internalformat, width, format, type, table);} +void __stdcall _Lazy_glColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glColorTableParameterfvSGI(target, pname, params);} +void __stdcall _Lazy_glColorTableParameterivSGI(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glColorTableParameterivSGI(target, pname, params);} +void __stdcall _Lazy_glCopyColorTableSGI(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyColorTableSGI(target, internalformat, x, y, width);} +void __stdcall _Lazy_glGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid * table) {if (GLeeInit()) glGetColorTableSGI(target, format, type, table);} +void __stdcall _Lazy_glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetColorTableParameterfvSGI(target, pname, params);} +void __stdcall _Lazy_glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetColorTableParameterivSGI(target, pname, params);} +PFNGLCOLORTABLESGIPROC pglColorTableSGI=_Lazy_glColorTableSGI; +PFNGLCOLORTABLEPARAMETERFVSGIPROC pglColorTableParameterfvSGI=_Lazy_glColorTableParameterfvSGI; +PFNGLCOLORTABLEPARAMETERIVSGIPROC pglColorTableParameterivSGI=_Lazy_glColorTableParameterivSGI; +PFNGLCOPYCOLORTABLESGIPROC pglCopyColorTableSGI=_Lazy_glCopyColorTableSGI; +PFNGLGETCOLORTABLESGIPROC pglGetColorTableSGI=_Lazy_glGetColorTableSGI; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC pglGetColorTableParameterfvSGI=_Lazy_glGetColorTableParameterfvSGI; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC pglGetColorTableParameterivSGI=_Lazy_glGetColorTableParameterivSGI; +#endif + +/* GL_SGIS_pixel_texture */ + +#ifdef __GLEE_GL_SGIS_pixel_texture +void __stdcall _Lazy_glPixelTexGenParameteriSGIS(GLenum pname, GLint param) {if (GLeeInit()) glPixelTexGenParameteriSGIS(pname, param);} +void __stdcall _Lazy_glPixelTexGenParameterivSGIS(GLenum pname, const GLint * params) {if (GLeeInit()) glPixelTexGenParameterivSGIS(pname, params);} +void __stdcall _Lazy_glPixelTexGenParameterfSGIS(GLenum pname, GLfloat param) {if (GLeeInit()) glPixelTexGenParameterfSGIS(pname, param);} +void __stdcall _Lazy_glPixelTexGenParameterfvSGIS(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPixelTexGenParameterfvSGIS(pname, params);} +void __stdcall _Lazy_glGetPixelTexGenParameterivSGIS(GLenum pname, GLint * params) {if (GLeeInit()) glGetPixelTexGenParameterivSGIS(pname, params);} +void __stdcall _Lazy_glGetPixelTexGenParameterfvSGIS(GLenum pname, GLfloat * params) {if (GLeeInit()) glGetPixelTexGenParameterfvSGIS(pname, params);} +PFNGLPIXELTEXGENPARAMETERISGISPROC pglPixelTexGenParameteriSGIS=_Lazy_glPixelTexGenParameteriSGIS; +PFNGLPIXELTEXGENPARAMETERIVSGISPROC pglPixelTexGenParameterivSGIS=_Lazy_glPixelTexGenParameterivSGIS; +PFNGLPIXELTEXGENPARAMETERFSGISPROC pglPixelTexGenParameterfSGIS=_Lazy_glPixelTexGenParameterfSGIS; +PFNGLPIXELTEXGENPARAMETERFVSGISPROC pglPixelTexGenParameterfvSGIS=_Lazy_glPixelTexGenParameterfvSGIS; +PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC pglGetPixelTexGenParameterivSGIS=_Lazy_glGetPixelTexGenParameterivSGIS; +PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC pglGetPixelTexGenParameterfvSGIS=_Lazy_glGetPixelTexGenParameterfvSGIS; +#endif + +/* GL_SGIX_pixel_texture */ + +#ifdef __GLEE_GL_SGIX_pixel_texture +void __stdcall _Lazy_glPixelTexGenSGIX(GLenum mode) {if (GLeeInit()) glPixelTexGenSGIX(mode);} +PFNGLPIXELTEXGENSGIXPROC pglPixelTexGenSGIX=_Lazy_glPixelTexGenSGIX; +#endif + +/* GL_SGIS_texture4D */ + +#ifdef __GLEE_GL_SGIS_texture4D +void __stdcall _Lazy_glTexImage4DSGIS(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexImage4DSGIS(target, level, internalformat, width, height, depth, size4d, border, format, type, pixels);} +void __stdcall _Lazy_glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTexSubImage4DSGIS(target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, size4d, format, type, pixels);} +PFNGLTEXIMAGE4DSGISPROC pglTexImage4DSGIS=_Lazy_glTexImage4DSGIS; +PFNGLTEXSUBIMAGE4DSGISPROC pglTexSubImage4DSGIS=_Lazy_glTexSubImage4DSGIS; +#endif + +/* GL_SGI_texture_color_table */ + +#ifdef __GLEE_GL_SGI_texture_color_table +#endif + +/* GL_EXT_cmyka */ + +#ifdef __GLEE_GL_EXT_cmyka +#endif + +/* GL_EXT_texture_object */ + +#ifdef __GLEE_GL_EXT_texture_object +GLboolean __stdcall _Lazy_glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences) {if (GLeeInit()) return glAreTexturesResidentEXT(n, textures, residences); return (GLboolean)0;} +void __stdcall _Lazy_glBindTextureEXT(GLenum target, GLuint texture) {if (GLeeInit()) glBindTextureEXT(target, texture);} +void __stdcall _Lazy_glDeleteTexturesEXT(GLsizei n, const GLuint * textures) {if (GLeeInit()) glDeleteTexturesEXT(n, textures);} +void __stdcall _Lazy_glGenTexturesEXT(GLsizei n, GLuint * textures) {if (GLeeInit()) glGenTexturesEXT(n, textures);} +GLboolean __stdcall _Lazy_glIsTextureEXT(GLuint texture) {if (GLeeInit()) return glIsTextureEXT(texture); return (GLboolean)0;} +void __stdcall _Lazy_glPrioritizeTexturesEXT(GLsizei n, const GLuint * textures, const GLclampf * priorities) {if (GLeeInit()) glPrioritizeTexturesEXT(n, textures, priorities);} +PFNGLARETEXTURESRESIDENTEXTPROC pglAreTexturesResidentEXT=_Lazy_glAreTexturesResidentEXT; +PFNGLBINDTEXTUREEXTPROC pglBindTextureEXT=_Lazy_glBindTextureEXT; +PFNGLDELETETEXTURESEXTPROC pglDeleteTexturesEXT=_Lazy_glDeleteTexturesEXT; +PFNGLGENTEXTURESEXTPROC pglGenTexturesEXT=_Lazy_glGenTexturesEXT; +PFNGLISTEXTUREEXTPROC pglIsTextureEXT=_Lazy_glIsTextureEXT; +PFNGLPRIORITIZETEXTURESEXTPROC pglPrioritizeTexturesEXT=_Lazy_glPrioritizeTexturesEXT; +#endif + +/* GL_SGIS_detail_texture */ + +#ifdef __GLEE_GL_SGIS_detail_texture +void __stdcall _Lazy_glDetailTexFuncSGIS(GLenum target, GLsizei n, const GLfloat * points) {if (GLeeInit()) glDetailTexFuncSGIS(target, n, points);} +void __stdcall _Lazy_glGetDetailTexFuncSGIS(GLenum target, GLfloat * points) {if (GLeeInit()) glGetDetailTexFuncSGIS(target, points);} +PFNGLDETAILTEXFUNCSGISPROC pglDetailTexFuncSGIS=_Lazy_glDetailTexFuncSGIS; +PFNGLGETDETAILTEXFUNCSGISPROC pglGetDetailTexFuncSGIS=_Lazy_glGetDetailTexFuncSGIS; +#endif + +/* GL_SGIS_sharpen_texture */ + +#ifdef __GLEE_GL_SGIS_sharpen_texture +void __stdcall _Lazy_glSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat * points) {if (GLeeInit()) glSharpenTexFuncSGIS(target, n, points);} +void __stdcall _Lazy_glGetSharpenTexFuncSGIS(GLenum target, GLfloat * points) {if (GLeeInit()) glGetSharpenTexFuncSGIS(target, points);} +PFNGLSHARPENTEXFUNCSGISPROC pglSharpenTexFuncSGIS=_Lazy_glSharpenTexFuncSGIS; +PFNGLGETSHARPENTEXFUNCSGISPROC pglGetSharpenTexFuncSGIS=_Lazy_glGetSharpenTexFuncSGIS; +#endif + +/* GL_EXT_packed_pixels */ + +#ifdef __GLEE_GL_EXT_packed_pixels +#endif + +/* GL_SGIS_texture_lod */ + +#ifdef __GLEE_GL_SGIS_texture_lod +#endif + +/* GL_SGIS_multisample */ + +#ifdef __GLEE_GL_SGIS_multisample +void __stdcall _Lazy_glSampleMaskSGIS(GLclampf value, GLboolean invert) {if (GLeeInit()) glSampleMaskSGIS(value, invert);} +void __stdcall _Lazy_glSamplePatternSGIS(GLenum pattern) {if (GLeeInit()) glSamplePatternSGIS(pattern);} +PFNGLSAMPLEMASKSGISPROC pglSampleMaskSGIS=_Lazy_glSampleMaskSGIS; +PFNGLSAMPLEPATTERNSGISPROC pglSamplePatternSGIS=_Lazy_glSamplePatternSGIS; +#endif + +/* GL_EXT_rescale_normal */ + +#ifdef __GLEE_GL_EXT_rescale_normal +#endif + +/* GL_EXT_vertex_array */ + +#ifdef __GLEE_GL_EXT_vertex_array +void __stdcall _Lazy_glArrayElementEXT(GLint i) {if (GLeeInit()) glArrayElementEXT(i);} +void __stdcall _Lazy_glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glColorPointerEXT(size, type, stride, count, pointer);} +void __stdcall _Lazy_glDrawArraysEXT(GLenum mode, GLint first, GLsizei count) {if (GLeeInit()) glDrawArraysEXT(mode, first, count);} +void __stdcall _Lazy_glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean * pointer) {if (GLeeInit()) glEdgeFlagPointerEXT(stride, count, pointer);} +void __stdcall _Lazy_glGetPointervEXT(GLenum pname, GLvoid* * params) {if (GLeeInit()) glGetPointervEXT(pname, params);} +void __stdcall _Lazy_glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glIndexPointerEXT(type, stride, count, pointer);} +void __stdcall _Lazy_glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glNormalPointerEXT(type, stride, count, pointer);} +void __stdcall _Lazy_glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glTexCoordPointerEXT(size, type, stride, count, pointer);} +void __stdcall _Lazy_glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) {if (GLeeInit()) glVertexPointerEXT(size, type, stride, count, pointer);} +PFNGLARRAYELEMENTEXTPROC pglArrayElementEXT=_Lazy_glArrayElementEXT; +PFNGLCOLORPOINTEREXTPROC pglColorPointerEXT=_Lazy_glColorPointerEXT; +PFNGLDRAWARRAYSEXTPROC pglDrawArraysEXT=_Lazy_glDrawArraysEXT; +PFNGLEDGEFLAGPOINTEREXTPROC pglEdgeFlagPointerEXT=_Lazy_glEdgeFlagPointerEXT; +PFNGLGETPOINTERVEXTPROC pglGetPointervEXT=_Lazy_glGetPointervEXT; +PFNGLINDEXPOINTEREXTPROC pglIndexPointerEXT=_Lazy_glIndexPointerEXT; +PFNGLNORMALPOINTEREXTPROC pglNormalPointerEXT=_Lazy_glNormalPointerEXT; +PFNGLTEXCOORDPOINTEREXTPROC pglTexCoordPointerEXT=_Lazy_glTexCoordPointerEXT; +PFNGLVERTEXPOINTEREXTPROC pglVertexPointerEXT=_Lazy_glVertexPointerEXT; +#endif + +/* GL_EXT_misc_attribute */ + +#ifdef __GLEE_GL_EXT_misc_attribute +#endif + +/* GL_SGIS_generate_mipmap */ + +#ifdef __GLEE_GL_SGIS_generate_mipmap +#endif + +/* GL_SGIX_clipmap */ + +#ifdef __GLEE_GL_SGIX_clipmap +#endif + +/* GL_SGIX_shadow */ + +#ifdef __GLEE_GL_SGIX_shadow +#endif + +/* GL_SGIS_texture_edge_clamp */ + +#ifdef __GLEE_GL_SGIS_texture_edge_clamp +#endif + +/* GL_SGIS_texture_border_clamp */ + +#ifdef __GLEE_GL_SGIS_texture_border_clamp +#endif + +/* GL_EXT_blend_minmax */ + +#ifdef __GLEE_GL_EXT_blend_minmax +void __stdcall _Lazy_glBlendEquationEXT(GLenum mode) {if (GLeeInit()) glBlendEquationEXT(mode);} +PFNGLBLENDEQUATIONEXTPROC pglBlendEquationEXT=_Lazy_glBlendEquationEXT; +#endif + +/* GL_EXT_blend_subtract */ + +#ifdef __GLEE_GL_EXT_blend_subtract +#endif + +/* GL_EXT_blend_logic_op */ + +#ifdef __GLEE_GL_EXT_blend_logic_op +#endif + +/* GL_SGIX_interlace */ + +#ifdef __GLEE_GL_SGIX_interlace +#endif + +/* GL_SGIX_pixel_tiles */ + +#ifdef __GLEE_GL_SGIX_pixel_tiles +#endif + +/* GL_SGIS_texture_select */ + +#ifdef __GLEE_GL_SGIS_texture_select +#endif + +/* GL_SGIX_sprite */ + +#ifdef __GLEE_GL_SGIX_sprite +void __stdcall _Lazy_glSpriteParameterfSGIX(GLenum pname, GLfloat param) {if (GLeeInit()) glSpriteParameterfSGIX(pname, param);} +void __stdcall _Lazy_glSpriteParameterfvSGIX(GLenum pname, const GLfloat * params) {if (GLeeInit()) glSpriteParameterfvSGIX(pname, params);} +void __stdcall _Lazy_glSpriteParameteriSGIX(GLenum pname, GLint param) {if (GLeeInit()) glSpriteParameteriSGIX(pname, param);} +void __stdcall _Lazy_glSpriteParameterivSGIX(GLenum pname, const GLint * params) {if (GLeeInit()) glSpriteParameterivSGIX(pname, params);} +PFNGLSPRITEPARAMETERFSGIXPROC pglSpriteParameterfSGIX=_Lazy_glSpriteParameterfSGIX; +PFNGLSPRITEPARAMETERFVSGIXPROC pglSpriteParameterfvSGIX=_Lazy_glSpriteParameterfvSGIX; +PFNGLSPRITEPARAMETERISGIXPROC pglSpriteParameteriSGIX=_Lazy_glSpriteParameteriSGIX; +PFNGLSPRITEPARAMETERIVSGIXPROC pglSpriteParameterivSGIX=_Lazy_glSpriteParameterivSGIX; +#endif + +/* GL_SGIX_texture_multi_buffer */ + +#ifdef __GLEE_GL_SGIX_texture_multi_buffer +#endif + +/* GL_EXT_point_parameters */ + +#ifdef __GLEE_GL_EXT_point_parameters +void __stdcall _Lazy_glPointParameterfEXT(GLenum pname, GLfloat param) {if (GLeeInit()) glPointParameterfEXT(pname, param);} +void __stdcall _Lazy_glPointParameterfvEXT(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPointParameterfvEXT(pname, params);} +PFNGLPOINTPARAMETERFEXTPROC pglPointParameterfEXT=_Lazy_glPointParameterfEXT; +PFNGLPOINTPARAMETERFVEXTPROC pglPointParameterfvEXT=_Lazy_glPointParameterfvEXT; +#endif + +/* GL_SGIS_point_parameters */ + +#ifdef __GLEE_GL_SGIS_point_parameters +void __stdcall _Lazy_glPointParameterfSGIS(GLenum pname, GLfloat param) {if (GLeeInit()) glPointParameterfSGIS(pname, param);} +void __stdcall _Lazy_glPointParameterfvSGIS(GLenum pname, const GLfloat * params) {if (GLeeInit()) glPointParameterfvSGIS(pname, params);} +PFNGLPOINTPARAMETERFSGISPROC pglPointParameterfSGIS=_Lazy_glPointParameterfSGIS; +PFNGLPOINTPARAMETERFVSGISPROC pglPointParameterfvSGIS=_Lazy_glPointParameterfvSGIS; +#endif + +/* GL_SGIX_instruments */ + +#ifdef __GLEE_GL_SGIX_instruments +GLint __stdcall _Lazy_glGetInstrumentsSGIX(void) {if (GLeeInit()) return glGetInstrumentsSGIX(); return (GLint)0;} +void __stdcall _Lazy_glInstrumentsBufferSGIX(GLsizei size, GLint * buffer) {if (GLeeInit()) glInstrumentsBufferSGIX(size, buffer);} +GLint __stdcall _Lazy_glPollInstrumentsSGIX(GLint * marker_p) {if (GLeeInit()) return glPollInstrumentsSGIX(marker_p); return (GLint)0;} +void __stdcall _Lazy_glReadInstrumentsSGIX(GLint marker) {if (GLeeInit()) glReadInstrumentsSGIX(marker);} +void __stdcall _Lazy_glStartInstrumentsSGIX(void) {if (GLeeInit()) glStartInstrumentsSGIX();} +void __stdcall _Lazy_glStopInstrumentsSGIX(GLint marker) {if (GLeeInit()) glStopInstrumentsSGIX(marker);} +PFNGLGETINSTRUMENTSSGIXPROC pglGetInstrumentsSGIX=_Lazy_glGetInstrumentsSGIX; +PFNGLINSTRUMENTSBUFFERSGIXPROC pglInstrumentsBufferSGIX=_Lazy_glInstrumentsBufferSGIX; +PFNGLPOLLINSTRUMENTSSGIXPROC pglPollInstrumentsSGIX=_Lazy_glPollInstrumentsSGIX; +PFNGLREADINSTRUMENTSSGIXPROC pglReadInstrumentsSGIX=_Lazy_glReadInstrumentsSGIX; +PFNGLSTARTINSTRUMENTSSGIXPROC pglStartInstrumentsSGIX=_Lazy_glStartInstrumentsSGIX; +PFNGLSTOPINSTRUMENTSSGIXPROC pglStopInstrumentsSGIX=_Lazy_glStopInstrumentsSGIX; +#endif + +/* GL_SGIX_texture_scale_bias */ + +#ifdef __GLEE_GL_SGIX_texture_scale_bias +#endif + +/* GL_SGIX_framezoom */ + +#ifdef __GLEE_GL_SGIX_framezoom +void __stdcall _Lazy_glFrameZoomSGIX(GLint factor) {if (GLeeInit()) glFrameZoomSGIX(factor);} +PFNGLFRAMEZOOMSGIXPROC pglFrameZoomSGIX=_Lazy_glFrameZoomSGIX; +#endif + +/* GL_SGIX_tag_sample_buffer */ + +#ifdef __GLEE_GL_SGIX_tag_sample_buffer +void __stdcall _Lazy_glTagSampleBufferSGIX(void) {if (GLeeInit()) glTagSampleBufferSGIX();} +PFNGLTAGSAMPLEBUFFERSGIXPROC pglTagSampleBufferSGIX=_Lazy_glTagSampleBufferSGIX; +#endif + +/* GL_FfdMaskSGIX */ + +#ifdef __GLEE_GL_FfdMaskSGIX +#endif + +/* GL_SGIX_polynomial_ffd */ + +#ifdef __GLEE_GL_SGIX_polynomial_ffd +void __stdcall _Lazy_glDeformationMap3dSGIX(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble * points) {if (GLeeInit()) glDeformationMap3dSGIX(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points);} +void __stdcall _Lazy_glDeformationMap3fSGIX(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat * points) {if (GLeeInit()) glDeformationMap3fSGIX(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points);} +void __stdcall _Lazy_glDeformSGIX(GLbitfield mask) {if (GLeeInit()) glDeformSGIX(mask);} +void __stdcall _Lazy_glLoadIdentityDeformationMapSGIX(GLbitfield mask) {if (GLeeInit()) glLoadIdentityDeformationMapSGIX(mask);} +PFNGLDEFORMATIONMAP3DSGIXPROC pglDeformationMap3dSGIX=_Lazy_glDeformationMap3dSGIX; +PFNGLDEFORMATIONMAP3FSGIXPROC pglDeformationMap3fSGIX=_Lazy_glDeformationMap3fSGIX; +PFNGLDEFORMSGIXPROC pglDeformSGIX=_Lazy_glDeformSGIX; +PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC pglLoadIdentityDeformationMapSGIX=_Lazy_glLoadIdentityDeformationMapSGIX; +#endif + +/* GL_SGIX_reference_plane */ + +#ifdef __GLEE_GL_SGIX_reference_plane +void __stdcall _Lazy_glReferencePlaneSGIX(const GLdouble * equation) {if (GLeeInit()) glReferencePlaneSGIX(equation);} +PFNGLREFERENCEPLANESGIXPROC pglReferencePlaneSGIX=_Lazy_glReferencePlaneSGIX; +#endif + +/* GL_SGIX_flush_raster */ + +#ifdef __GLEE_GL_SGIX_flush_raster +void __stdcall _Lazy_glFlushRasterSGIX(void) {if (GLeeInit()) glFlushRasterSGIX();} +PFNGLFLUSHRASTERSGIXPROC pglFlushRasterSGIX=_Lazy_glFlushRasterSGIX; +#endif + +/* GL_SGIX_depth_texture */ + +#ifdef __GLEE_GL_SGIX_depth_texture +#endif + +/* GL_SGIS_fog_function */ + +#ifdef __GLEE_GL_SGIS_fog_function +void __stdcall _Lazy_glFogFuncSGIS(GLsizei n, const GLfloat * points) {if (GLeeInit()) glFogFuncSGIS(n, points);} +void __stdcall _Lazy_glGetFogFuncSGIS(GLfloat * points) {if (GLeeInit()) glGetFogFuncSGIS(points);} +PFNGLFOGFUNCSGISPROC pglFogFuncSGIS=_Lazy_glFogFuncSGIS; +PFNGLGETFOGFUNCSGISPROC pglGetFogFuncSGIS=_Lazy_glGetFogFuncSGIS; +#endif + +/* GL_SGIX_fog_offset */ + +#ifdef __GLEE_GL_SGIX_fog_offset +#endif + +/* GL_HP_image_transform */ + +#ifdef __GLEE_GL_HP_image_transform +void __stdcall _Lazy_glImageTransformParameteriHP(GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glImageTransformParameteriHP(target, pname, param);} +void __stdcall _Lazy_glImageTransformParameterfHP(GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glImageTransformParameterfHP(target, pname, param);} +void __stdcall _Lazy_glImageTransformParameterivHP(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glImageTransformParameterivHP(target, pname, params);} +void __stdcall _Lazy_glImageTransformParameterfvHP(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glImageTransformParameterfvHP(target, pname, params);} +void __stdcall _Lazy_glGetImageTransformParameterivHP(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetImageTransformParameterivHP(target, pname, params);} +void __stdcall _Lazy_glGetImageTransformParameterfvHP(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetImageTransformParameterfvHP(target, pname, params);} +PFNGLIMAGETRANSFORMPARAMETERIHPPROC pglImageTransformParameteriHP=_Lazy_glImageTransformParameteriHP; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC pglImageTransformParameterfHP=_Lazy_glImageTransformParameterfHP; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC pglImageTransformParameterivHP=_Lazy_glImageTransformParameterivHP; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC pglImageTransformParameterfvHP=_Lazy_glImageTransformParameterfvHP; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC pglGetImageTransformParameterivHP=_Lazy_glGetImageTransformParameterivHP; +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC pglGetImageTransformParameterfvHP=_Lazy_glGetImageTransformParameterfvHP; +#endif + +/* GL_HP_convolution_border_modes */ + +#ifdef __GLEE_GL_HP_convolution_border_modes +#endif + +/* GL_INGR_palette_buffer */ + +#ifdef __GLEE_GL_INGR_palette_buffer +#endif + +/* GL_SGIX_texture_add_env */ + +#ifdef __GLEE_GL_SGIX_texture_add_env +#endif + +/* GL_EXT_color_subtable */ + +#ifdef __GLEE_GL_EXT_color_subtable +void __stdcall _Lazy_glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) {if (GLeeInit()) glColorSubTableEXT(target, start, count, format, type, data);} +void __stdcall _Lazy_glCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyColorSubTableEXT(target, start, x, y, width);} +PFNGLCOLORSUBTABLEEXTPROC pglColorSubTableEXT=_Lazy_glColorSubTableEXT; +PFNGLCOPYCOLORSUBTABLEEXTPROC pglCopyColorSubTableEXT=_Lazy_glCopyColorSubTableEXT; +#endif + +/* GL_PGI_vertex_hints */ + +#ifdef __GLEE_GL_PGI_vertex_hints +#endif + +/* GL_PGI_misc_hints */ + +#ifdef __GLEE_GL_PGI_misc_hints +void __stdcall _Lazy_glHintPGI(GLenum target, GLint mode) {if (GLeeInit()) glHintPGI(target, mode);} +PFNGLHINTPGIPROC pglHintPGI=_Lazy_glHintPGI; +#endif + +/* GL_EXT_paletted_texture */ + +#ifdef __GLEE_GL_EXT_paletted_texture +void __stdcall _Lazy_glColorTableEXT(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) {if (GLeeInit()) glColorTableEXT(target, internalFormat, width, format, type, table);} +void __stdcall _Lazy_glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * data) {if (GLeeInit()) glGetColorTableEXT(target, format, type, data);} +void __stdcall _Lazy_glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetColorTableParameterivEXT(target, pname, params);} +void __stdcall _Lazy_glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetColorTableParameterfvEXT(target, pname, params);} +PFNGLCOLORTABLEEXTPROC pglColorTableEXT=_Lazy_glColorTableEXT; +PFNGLGETCOLORTABLEEXTPROC pglGetColorTableEXT=_Lazy_glGetColorTableEXT; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC pglGetColorTableParameterivEXT=_Lazy_glGetColorTableParameterivEXT; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC pglGetColorTableParameterfvEXT=_Lazy_glGetColorTableParameterfvEXT; +#endif + +/* GL_EXT_clip_volume_hint */ + +#ifdef __GLEE_GL_EXT_clip_volume_hint +#endif + +/* GL_SGIX_list_priority */ + +#ifdef __GLEE_GL_SGIX_list_priority +void __stdcall _Lazy_glGetListParameterfvSGIX(GLuint list, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetListParameterfvSGIX(list, pname, params);} +void __stdcall _Lazy_glGetListParameterivSGIX(GLuint list, GLenum pname, GLint * params) {if (GLeeInit()) glGetListParameterivSGIX(list, pname, params);} +void __stdcall _Lazy_glListParameterfSGIX(GLuint list, GLenum pname, GLfloat param) {if (GLeeInit()) glListParameterfSGIX(list, pname, param);} +void __stdcall _Lazy_glListParameterfvSGIX(GLuint list, GLenum pname, const GLfloat * params) {if (GLeeInit()) glListParameterfvSGIX(list, pname, params);} +void __stdcall _Lazy_glListParameteriSGIX(GLuint list, GLenum pname, GLint param) {if (GLeeInit()) glListParameteriSGIX(list, pname, param);} +void __stdcall _Lazy_glListParameterivSGIX(GLuint list, GLenum pname, const GLint * params) {if (GLeeInit()) glListParameterivSGIX(list, pname, params);} +PFNGLGETLISTPARAMETERFVSGIXPROC pglGetListParameterfvSGIX=_Lazy_glGetListParameterfvSGIX; +PFNGLGETLISTPARAMETERIVSGIXPROC pglGetListParameterivSGIX=_Lazy_glGetListParameterivSGIX; +PFNGLLISTPARAMETERFSGIXPROC pglListParameterfSGIX=_Lazy_glListParameterfSGIX; +PFNGLLISTPARAMETERFVSGIXPROC pglListParameterfvSGIX=_Lazy_glListParameterfvSGIX; +PFNGLLISTPARAMETERISGIXPROC pglListParameteriSGIX=_Lazy_glListParameteriSGIX; +PFNGLLISTPARAMETERIVSGIXPROC pglListParameterivSGIX=_Lazy_glListParameterivSGIX; +#endif + +/* GL_SGIX_ir_instrument1 */ + +#ifdef __GLEE_GL_SGIX_ir_instrument1 +#endif + +/* GL_SGIX_calligraphic_fragment */ + +#ifdef __GLEE_GL_SGIX_calligraphic_fragment +#endif + +/* GL_SGIX_texture_lod_bias */ + +#ifdef __GLEE_GL_SGIX_texture_lod_bias +#endif + +/* GL_SGIX_shadow_ambient */ + +#ifdef __GLEE_GL_SGIX_shadow_ambient +#endif + +/* GL_EXT_index_texture */ + +#ifdef __GLEE_GL_EXT_index_texture +#endif + +/* GL_EXT_index_material */ + +#ifdef __GLEE_GL_EXT_index_material +void __stdcall _Lazy_glIndexMaterialEXT(GLenum face, GLenum mode) {if (GLeeInit()) glIndexMaterialEXT(face, mode);} +PFNGLINDEXMATERIALEXTPROC pglIndexMaterialEXT=_Lazy_glIndexMaterialEXT; +#endif + +/* GL_EXT_index_func */ + +#ifdef __GLEE_GL_EXT_index_func +void __stdcall _Lazy_glIndexFuncEXT(GLenum func, GLclampf ref) {if (GLeeInit()) glIndexFuncEXT(func, ref);} +PFNGLINDEXFUNCEXTPROC pglIndexFuncEXT=_Lazy_glIndexFuncEXT; +#endif + +/* GL_EXT_index_array_formats */ + +#ifdef __GLEE_GL_EXT_index_array_formats +#endif + +/* GL_EXT_compiled_vertex_array */ + +#ifdef __GLEE_GL_EXT_compiled_vertex_array +void __stdcall _Lazy_glLockArraysEXT(GLint first, GLsizei count) {if (GLeeInit()) glLockArraysEXT(first, count);} +void __stdcall _Lazy_glUnlockArraysEXT(void) {if (GLeeInit()) glUnlockArraysEXT();} +PFNGLLOCKARRAYSEXTPROC pglLockArraysEXT=_Lazy_glLockArraysEXT; +PFNGLUNLOCKARRAYSEXTPROC pglUnlockArraysEXT=_Lazy_glUnlockArraysEXT; +#endif + +/* GL_EXT_cull_vertex */ + +#ifdef __GLEE_GL_EXT_cull_vertex +void __stdcall _Lazy_glCullParameterdvEXT(GLenum pname, GLdouble * params) {if (GLeeInit()) glCullParameterdvEXT(pname, params);} +void __stdcall _Lazy_glCullParameterfvEXT(GLenum pname, GLfloat * params) {if (GLeeInit()) glCullParameterfvEXT(pname, params);} +PFNGLCULLPARAMETERDVEXTPROC pglCullParameterdvEXT=_Lazy_glCullParameterdvEXT; +PFNGLCULLPARAMETERFVEXTPROC pglCullParameterfvEXT=_Lazy_glCullParameterfvEXT; +#endif + +/* GL_SGIX_ycrcb */ + +#ifdef __GLEE_GL_SGIX_ycrcb +#endif + +/* GL_SGIX_fragment_lighting */ + +#ifdef __GLEE_GL_SGIX_fragment_lighting +void __stdcall _Lazy_glFragmentColorMaterialSGIX(GLenum face, GLenum mode) {if (GLeeInit()) glFragmentColorMaterialSGIX(face, mode);} +void __stdcall _Lazy_glFragmentLightfSGIX(GLenum light, GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentLightfSGIX(light, pname, param);} +void __stdcall _Lazy_glFragmentLightfvSGIX(GLenum light, GLenum pname, const GLfloat * params) {if (GLeeInit()) glFragmentLightfvSGIX(light, pname, params);} +void __stdcall _Lazy_glFragmentLightiSGIX(GLenum light, GLenum pname, GLint param) {if (GLeeInit()) glFragmentLightiSGIX(light, pname, param);} +void __stdcall _Lazy_glFragmentLightivSGIX(GLenum light, GLenum pname, const GLint * params) {if (GLeeInit()) glFragmentLightivSGIX(light, pname, params);} +void __stdcall _Lazy_glFragmentLightModelfSGIX(GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentLightModelfSGIX(pname, param);} +void __stdcall _Lazy_glFragmentLightModelfvSGIX(GLenum pname, const GLfloat * params) {if (GLeeInit()) glFragmentLightModelfvSGIX(pname, params);} +void __stdcall _Lazy_glFragmentLightModeliSGIX(GLenum pname, GLint param) {if (GLeeInit()) glFragmentLightModeliSGIX(pname, param);} +void __stdcall _Lazy_glFragmentLightModelivSGIX(GLenum pname, const GLint * params) {if (GLeeInit()) glFragmentLightModelivSGIX(pname, params);} +void __stdcall _Lazy_glFragmentMaterialfSGIX(GLenum face, GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentMaterialfSGIX(face, pname, param);} +void __stdcall _Lazy_glFragmentMaterialfvSGIX(GLenum face, GLenum pname, const GLfloat * params) {if (GLeeInit()) glFragmentMaterialfvSGIX(face, pname, params);} +void __stdcall _Lazy_glFragmentMaterialiSGIX(GLenum face, GLenum pname, GLint param) {if (GLeeInit()) glFragmentMaterialiSGIX(face, pname, param);} +void __stdcall _Lazy_glFragmentMaterialivSGIX(GLenum face, GLenum pname, const GLint * params) {if (GLeeInit()) glFragmentMaterialivSGIX(face, pname, params);} +void __stdcall _Lazy_glGetFragmentLightfvSGIX(GLenum light, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetFragmentLightfvSGIX(light, pname, params);} +void __stdcall _Lazy_glGetFragmentLightivSGIX(GLenum light, GLenum pname, GLint * params) {if (GLeeInit()) glGetFragmentLightivSGIX(light, pname, params);} +void __stdcall _Lazy_glGetFragmentMaterialfvSGIX(GLenum face, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetFragmentMaterialfvSGIX(face, pname, params);} +void __stdcall _Lazy_glGetFragmentMaterialivSGIX(GLenum face, GLenum pname, GLint * params) {if (GLeeInit()) glGetFragmentMaterialivSGIX(face, pname, params);} +void __stdcall _Lazy_glLightEnviSGIX(GLenum pname, GLint param) {if (GLeeInit()) glLightEnviSGIX(pname, param);} +PFNGLFRAGMENTCOLORMATERIALSGIXPROC pglFragmentColorMaterialSGIX=_Lazy_glFragmentColorMaterialSGIX; +PFNGLFRAGMENTLIGHTFSGIXPROC pglFragmentLightfSGIX=_Lazy_glFragmentLightfSGIX; +PFNGLFRAGMENTLIGHTFVSGIXPROC pglFragmentLightfvSGIX=_Lazy_glFragmentLightfvSGIX; +PFNGLFRAGMENTLIGHTISGIXPROC pglFragmentLightiSGIX=_Lazy_glFragmentLightiSGIX; +PFNGLFRAGMENTLIGHTIVSGIXPROC pglFragmentLightivSGIX=_Lazy_glFragmentLightivSGIX; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC pglFragmentLightModelfSGIX=_Lazy_glFragmentLightModelfSGIX; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC pglFragmentLightModelfvSGIX=_Lazy_glFragmentLightModelfvSGIX; +PFNGLFRAGMENTLIGHTMODELISGIXPROC pglFragmentLightModeliSGIX=_Lazy_glFragmentLightModeliSGIX; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC pglFragmentLightModelivSGIX=_Lazy_glFragmentLightModelivSGIX; +PFNGLFRAGMENTMATERIALFSGIXPROC pglFragmentMaterialfSGIX=_Lazy_glFragmentMaterialfSGIX; +PFNGLFRAGMENTMATERIALFVSGIXPROC pglFragmentMaterialfvSGIX=_Lazy_glFragmentMaterialfvSGIX; +PFNGLFRAGMENTMATERIALISGIXPROC pglFragmentMaterialiSGIX=_Lazy_glFragmentMaterialiSGIX; +PFNGLFRAGMENTMATERIALIVSGIXPROC pglFragmentMaterialivSGIX=_Lazy_glFragmentMaterialivSGIX; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC pglGetFragmentLightfvSGIX=_Lazy_glGetFragmentLightfvSGIX; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC pglGetFragmentLightivSGIX=_Lazy_glGetFragmentLightivSGIX; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC pglGetFragmentMaterialfvSGIX=_Lazy_glGetFragmentMaterialfvSGIX; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC pglGetFragmentMaterialivSGIX=_Lazy_glGetFragmentMaterialivSGIX; +PFNGLLIGHTENVISGIXPROC pglLightEnviSGIX=_Lazy_glLightEnviSGIX; +#endif + +/* GL_IBM_rasterpos_clip */ + +#ifdef __GLEE_GL_IBM_rasterpos_clip +#endif + +/* GL_HP_texture_lighting */ + +#ifdef __GLEE_GL_HP_texture_lighting +#endif + +/* GL_EXT_draw_range_elements */ + +#ifdef __GLEE_GL_EXT_draw_range_elements +void __stdcall _Lazy_glDrawRangeElementsEXT(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) {if (GLeeInit()) glDrawRangeElementsEXT(mode, start, end, count, type, indices);} +PFNGLDRAWRANGEELEMENTSEXTPROC pglDrawRangeElementsEXT=_Lazy_glDrawRangeElementsEXT; +#endif + +/* GL_WIN_phong_shading */ + +#ifdef __GLEE_GL_WIN_phong_shading +#endif + +/* GL_WIN_specular_fog */ + +#ifdef __GLEE_GL_WIN_specular_fog +#endif + +/* GL_EXT_light_texture */ + +#ifdef __GLEE_GL_EXT_light_texture +void __stdcall _Lazy_glApplyTextureEXT(GLenum mode) {if (GLeeInit()) glApplyTextureEXT(mode);} +void __stdcall _Lazy_glTextureLightEXT(GLenum pname) {if (GLeeInit()) glTextureLightEXT(pname);} +void __stdcall _Lazy_glTextureMaterialEXT(GLenum face, GLenum mode) {if (GLeeInit()) glTextureMaterialEXT(face, mode);} +PFNGLAPPLYTEXTUREEXTPROC pglApplyTextureEXT=_Lazy_glApplyTextureEXT; +PFNGLTEXTURELIGHTEXTPROC pglTextureLightEXT=_Lazy_glTextureLightEXT; +PFNGLTEXTUREMATERIALEXTPROC pglTextureMaterialEXT=_Lazy_glTextureMaterialEXT; +#endif + +/* GL_SGIX_blend_alpha_minmax */ + +#ifdef __GLEE_GL_SGIX_blend_alpha_minmax +#endif + +/* GL_SGIX_impact_pixel_texture */ + +#ifdef __GLEE_GL_SGIX_impact_pixel_texture +#endif + +/* GL_EXT_bgra */ + +#ifdef __GLEE_GL_EXT_bgra +#endif + +/* GL_SGIX_async */ + +#ifdef __GLEE_GL_SGIX_async +void __stdcall _Lazy_glAsyncMarkerSGIX(GLuint marker) {if (GLeeInit()) glAsyncMarkerSGIX(marker);} +GLint __stdcall _Lazy_glFinishAsyncSGIX(GLuint * markerp) {if (GLeeInit()) return glFinishAsyncSGIX(markerp); return (GLint)0;} +GLint __stdcall _Lazy_glPollAsyncSGIX(GLuint * markerp) {if (GLeeInit()) return glPollAsyncSGIX(markerp); return (GLint)0;} +GLuint __stdcall _Lazy_glGenAsyncMarkersSGIX(GLsizei range) {if (GLeeInit()) return glGenAsyncMarkersSGIX(range); return (GLuint)0;} +void __stdcall _Lazy_glDeleteAsyncMarkersSGIX(GLuint marker, GLsizei range) {if (GLeeInit()) glDeleteAsyncMarkersSGIX(marker, range);} +GLboolean __stdcall _Lazy_glIsAsyncMarkerSGIX(GLuint marker) {if (GLeeInit()) return glIsAsyncMarkerSGIX(marker); return (GLboolean)0;} +PFNGLASYNCMARKERSGIXPROC pglAsyncMarkerSGIX=_Lazy_glAsyncMarkerSGIX; +PFNGLFINISHASYNCSGIXPROC pglFinishAsyncSGIX=_Lazy_glFinishAsyncSGIX; +PFNGLPOLLASYNCSGIXPROC pglPollAsyncSGIX=_Lazy_glPollAsyncSGIX; +PFNGLGENASYNCMARKERSSGIXPROC pglGenAsyncMarkersSGIX=_Lazy_glGenAsyncMarkersSGIX; +PFNGLDELETEASYNCMARKERSSGIXPROC pglDeleteAsyncMarkersSGIX=_Lazy_glDeleteAsyncMarkersSGIX; +PFNGLISASYNCMARKERSGIXPROC pglIsAsyncMarkerSGIX=_Lazy_glIsAsyncMarkerSGIX; +#endif + +/* GL_SGIX_async_pixel */ + +#ifdef __GLEE_GL_SGIX_async_pixel +#endif + +/* GL_SGIX_async_histogram */ + +#ifdef __GLEE_GL_SGIX_async_histogram +#endif + +/* GL_INTEL_texture_scissor */ + +#ifdef __GLEE_GL_INTEL_texture_scissor +#endif + +/* GL_INTEL_parallel_arrays */ + +#ifdef __GLEE_GL_INTEL_parallel_arrays +void __stdcall _Lazy_glVertexPointervINTEL(GLint size, GLenum type, const GLvoid* * pointer) {if (GLeeInit()) glVertexPointervINTEL(size, type, pointer);} +void __stdcall _Lazy_glNormalPointervINTEL(GLenum type, const GLvoid* * pointer) {if (GLeeInit()) glNormalPointervINTEL(type, pointer);} +void __stdcall _Lazy_glColorPointervINTEL(GLint size, GLenum type, const GLvoid* * pointer) {if (GLeeInit()) glColorPointervINTEL(size, type, pointer);} +void __stdcall _Lazy_glTexCoordPointervINTEL(GLint size, GLenum type, const GLvoid* * pointer) {if (GLeeInit()) glTexCoordPointervINTEL(size, type, pointer);} +PFNGLVERTEXPOINTERVINTELPROC pglVertexPointervINTEL=_Lazy_glVertexPointervINTEL; +PFNGLNORMALPOINTERVINTELPROC pglNormalPointervINTEL=_Lazy_glNormalPointervINTEL; +PFNGLCOLORPOINTERVINTELPROC pglColorPointervINTEL=_Lazy_glColorPointervINTEL; +PFNGLTEXCOORDPOINTERVINTELPROC pglTexCoordPointervINTEL=_Lazy_glTexCoordPointervINTEL; +#endif + +/* GL_HP_occlusion_test */ + +#ifdef __GLEE_GL_HP_occlusion_test +#endif + +/* GL_EXT_pixel_transform */ + +#ifdef __GLEE_GL_EXT_pixel_transform +void __stdcall _Lazy_glPixelTransformParameteriEXT(GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glPixelTransformParameteriEXT(target, pname, param);} +void __stdcall _Lazy_glPixelTransformParameterfEXT(GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glPixelTransformParameterfEXT(target, pname, param);} +void __stdcall _Lazy_glPixelTransformParameterivEXT(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glPixelTransformParameterivEXT(target, pname, params);} +void __stdcall _Lazy_glPixelTransformParameterfvEXT(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glPixelTransformParameterfvEXT(target, pname, params);} +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC pglPixelTransformParameteriEXT=_Lazy_glPixelTransformParameteriEXT; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC pglPixelTransformParameterfEXT=_Lazy_glPixelTransformParameterfEXT; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC pglPixelTransformParameterivEXT=_Lazy_glPixelTransformParameterivEXT; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC pglPixelTransformParameterfvEXT=_Lazy_glPixelTransformParameterfvEXT; +#endif + +/* GL_EXT_pixel_transform_color_table */ + +#ifdef __GLEE_GL_EXT_pixel_transform_color_table +#endif + +/* GL_EXT_shared_texture_palette */ + +#ifdef __GLEE_GL_EXT_shared_texture_palette +#endif + +/* GL_EXT_separate_specular_color */ + +#ifdef __GLEE_GL_EXT_separate_specular_color +#endif + +/* GL_EXT_secondary_color */ + +#ifdef __GLEE_GL_EXT_secondary_color +void __stdcall _Lazy_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue) {if (GLeeInit()) glSecondaryColor3bEXT(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3bvEXT(const GLbyte * v) {if (GLeeInit()) glSecondaryColor3bvEXT(v);} +void __stdcall _Lazy_glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue) {if (GLeeInit()) glSecondaryColor3dEXT(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3dvEXT(const GLdouble * v) {if (GLeeInit()) glSecondaryColor3dvEXT(v);} +void __stdcall _Lazy_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue) {if (GLeeInit()) glSecondaryColor3fEXT(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3fvEXT(const GLfloat * v) {if (GLeeInit()) glSecondaryColor3fvEXT(v);} +void __stdcall _Lazy_glSecondaryColor3iEXT(GLint red, GLint green, GLint blue) {if (GLeeInit()) glSecondaryColor3iEXT(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3ivEXT(const GLint * v) {if (GLeeInit()) glSecondaryColor3ivEXT(v);} +void __stdcall _Lazy_glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue) {if (GLeeInit()) glSecondaryColor3sEXT(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3svEXT(const GLshort * v) {if (GLeeInit()) glSecondaryColor3svEXT(v);} +void __stdcall _Lazy_glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue) {if (GLeeInit()) glSecondaryColor3ubEXT(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3ubvEXT(const GLubyte * v) {if (GLeeInit()) glSecondaryColor3ubvEXT(v);} +void __stdcall _Lazy_glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue) {if (GLeeInit()) glSecondaryColor3uiEXT(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3uivEXT(const GLuint * v) {if (GLeeInit()) glSecondaryColor3uivEXT(v);} +void __stdcall _Lazy_glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue) {if (GLeeInit()) glSecondaryColor3usEXT(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3usvEXT(const GLushort * v) {if (GLeeInit()) glSecondaryColor3usvEXT(v);} +void __stdcall _Lazy_glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glSecondaryColorPointerEXT(size, type, stride, pointer);} +PFNGLSECONDARYCOLOR3BEXTPROC pglSecondaryColor3bEXT=_Lazy_glSecondaryColor3bEXT; +PFNGLSECONDARYCOLOR3BVEXTPROC pglSecondaryColor3bvEXT=_Lazy_glSecondaryColor3bvEXT; +PFNGLSECONDARYCOLOR3DEXTPROC pglSecondaryColor3dEXT=_Lazy_glSecondaryColor3dEXT; +PFNGLSECONDARYCOLOR3DVEXTPROC pglSecondaryColor3dvEXT=_Lazy_glSecondaryColor3dvEXT; +PFNGLSECONDARYCOLOR3FEXTPROC pglSecondaryColor3fEXT=_Lazy_glSecondaryColor3fEXT; +PFNGLSECONDARYCOLOR3FVEXTPROC pglSecondaryColor3fvEXT=_Lazy_glSecondaryColor3fvEXT; +PFNGLSECONDARYCOLOR3IEXTPROC pglSecondaryColor3iEXT=_Lazy_glSecondaryColor3iEXT; +PFNGLSECONDARYCOLOR3IVEXTPROC pglSecondaryColor3ivEXT=_Lazy_glSecondaryColor3ivEXT; +PFNGLSECONDARYCOLOR3SEXTPROC pglSecondaryColor3sEXT=_Lazy_glSecondaryColor3sEXT; +PFNGLSECONDARYCOLOR3SVEXTPROC pglSecondaryColor3svEXT=_Lazy_glSecondaryColor3svEXT; +PFNGLSECONDARYCOLOR3UBEXTPROC pglSecondaryColor3ubEXT=_Lazy_glSecondaryColor3ubEXT; +PFNGLSECONDARYCOLOR3UBVEXTPROC pglSecondaryColor3ubvEXT=_Lazy_glSecondaryColor3ubvEXT; +PFNGLSECONDARYCOLOR3UIEXTPROC pglSecondaryColor3uiEXT=_Lazy_glSecondaryColor3uiEXT; +PFNGLSECONDARYCOLOR3UIVEXTPROC pglSecondaryColor3uivEXT=_Lazy_glSecondaryColor3uivEXT; +PFNGLSECONDARYCOLOR3USEXTPROC pglSecondaryColor3usEXT=_Lazy_glSecondaryColor3usEXT; +PFNGLSECONDARYCOLOR3USVEXTPROC pglSecondaryColor3usvEXT=_Lazy_glSecondaryColor3usvEXT; +PFNGLSECONDARYCOLORPOINTEREXTPROC pglSecondaryColorPointerEXT=_Lazy_glSecondaryColorPointerEXT; +#endif + +/* GL_EXT_texture_perturb_normal */ + +#ifdef __GLEE_GL_EXT_texture_perturb_normal +void __stdcall _Lazy_glTextureNormalEXT(GLenum mode) {if (GLeeInit()) glTextureNormalEXT(mode);} +PFNGLTEXTURENORMALEXTPROC pglTextureNormalEXT=_Lazy_glTextureNormalEXT; +#endif + +/* GL_EXT_multi_draw_arrays */ + +#ifdef __GLEE_GL_EXT_multi_draw_arrays +void __stdcall _Lazy_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) {if (GLeeInit()) glMultiDrawArraysEXT(mode, first, count, primcount);} +void __stdcall _Lazy_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid* * indices, GLsizei primcount) {if (GLeeInit()) glMultiDrawElementsEXT(mode, count, type, indices, primcount);} +PFNGLMULTIDRAWARRAYSEXTPROC pglMultiDrawArraysEXT=_Lazy_glMultiDrawArraysEXT; +PFNGLMULTIDRAWELEMENTSEXTPROC pglMultiDrawElementsEXT=_Lazy_glMultiDrawElementsEXT; +#endif + +/* GL_EXT_fog_coord */ + +#ifdef __GLEE_GL_EXT_fog_coord +void __stdcall _Lazy_glFogCoordfEXT(GLfloat coord) {if (GLeeInit()) glFogCoordfEXT(coord);} +void __stdcall _Lazy_glFogCoordfvEXT(const GLfloat * coord) {if (GLeeInit()) glFogCoordfvEXT(coord);} +void __stdcall _Lazy_glFogCoorddEXT(GLdouble coord) {if (GLeeInit()) glFogCoorddEXT(coord);} +void __stdcall _Lazy_glFogCoorddvEXT(const GLdouble * coord) {if (GLeeInit()) glFogCoorddvEXT(coord);} +void __stdcall _Lazy_glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glFogCoordPointerEXT(type, stride, pointer);} +PFNGLFOGCOORDFEXTPROC pglFogCoordfEXT=_Lazy_glFogCoordfEXT; +PFNGLFOGCOORDFVEXTPROC pglFogCoordfvEXT=_Lazy_glFogCoordfvEXT; +PFNGLFOGCOORDDEXTPROC pglFogCoorddEXT=_Lazy_glFogCoorddEXT; +PFNGLFOGCOORDDVEXTPROC pglFogCoorddvEXT=_Lazy_glFogCoorddvEXT; +PFNGLFOGCOORDPOINTEREXTPROC pglFogCoordPointerEXT=_Lazy_glFogCoordPointerEXT; +#endif + +/* GL_REND_screen_coordinates */ + +#ifdef __GLEE_GL_REND_screen_coordinates +#endif + +/* GL_EXT_coordinate_frame */ + +#ifdef __GLEE_GL_EXT_coordinate_frame +void __stdcall _Lazy_glTangent3bEXT(GLbyte tx, GLbyte ty, GLbyte tz) {if (GLeeInit()) glTangent3bEXT(tx, ty, tz);} +void __stdcall _Lazy_glTangent3bvEXT(const GLbyte * v) {if (GLeeInit()) glTangent3bvEXT(v);} +void __stdcall _Lazy_glTangent3dEXT(GLdouble tx, GLdouble ty, GLdouble tz) {if (GLeeInit()) glTangent3dEXT(tx, ty, tz);} +void __stdcall _Lazy_glTangent3dvEXT(const GLdouble * v) {if (GLeeInit()) glTangent3dvEXT(v);} +void __stdcall _Lazy_glTangent3fEXT(GLfloat tx, GLfloat ty, GLfloat tz) {if (GLeeInit()) glTangent3fEXT(tx, ty, tz);} +void __stdcall _Lazy_glTangent3fvEXT(const GLfloat * v) {if (GLeeInit()) glTangent3fvEXT(v);} +void __stdcall _Lazy_glTangent3iEXT(GLint tx, GLint ty, GLint tz) {if (GLeeInit()) glTangent3iEXT(tx, ty, tz);} +void __stdcall _Lazy_glTangent3ivEXT(const GLint * v) {if (GLeeInit()) glTangent3ivEXT(v);} +void __stdcall _Lazy_glTangent3sEXT(GLshort tx, GLshort ty, GLshort tz) {if (GLeeInit()) glTangent3sEXT(tx, ty, tz);} +void __stdcall _Lazy_glTangent3svEXT(const GLshort * v) {if (GLeeInit()) glTangent3svEXT(v);} +void __stdcall _Lazy_glBinormal3bEXT(GLbyte bx, GLbyte by, GLbyte bz) {if (GLeeInit()) glBinormal3bEXT(bx, by, bz);} +void __stdcall _Lazy_glBinormal3bvEXT(const GLbyte * v) {if (GLeeInit()) glBinormal3bvEXT(v);} +void __stdcall _Lazy_glBinormal3dEXT(GLdouble bx, GLdouble by, GLdouble bz) {if (GLeeInit()) glBinormal3dEXT(bx, by, bz);} +void __stdcall _Lazy_glBinormal3dvEXT(const GLdouble * v) {if (GLeeInit()) glBinormal3dvEXT(v);} +void __stdcall _Lazy_glBinormal3fEXT(GLfloat bx, GLfloat by, GLfloat bz) {if (GLeeInit()) glBinormal3fEXT(bx, by, bz);} +void __stdcall _Lazy_glBinormal3fvEXT(const GLfloat * v) {if (GLeeInit()) glBinormal3fvEXT(v);} +void __stdcall _Lazy_glBinormal3iEXT(GLint bx, GLint by, GLint bz) {if (GLeeInit()) glBinormal3iEXT(bx, by, bz);} +void __stdcall _Lazy_glBinormal3ivEXT(const GLint * v) {if (GLeeInit()) glBinormal3ivEXT(v);} +void __stdcall _Lazy_glBinormal3sEXT(GLshort bx, GLshort by, GLshort bz) {if (GLeeInit()) glBinormal3sEXT(bx, by, bz);} +void __stdcall _Lazy_glBinormal3svEXT(const GLshort * v) {if (GLeeInit()) glBinormal3svEXT(v);} +void __stdcall _Lazy_glTangentPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glTangentPointerEXT(type, stride, pointer);} +void __stdcall _Lazy_glBinormalPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glBinormalPointerEXT(type, stride, pointer);} +PFNGLTANGENT3BEXTPROC pglTangent3bEXT=_Lazy_glTangent3bEXT; +PFNGLTANGENT3BVEXTPROC pglTangent3bvEXT=_Lazy_glTangent3bvEXT; +PFNGLTANGENT3DEXTPROC pglTangent3dEXT=_Lazy_glTangent3dEXT; +PFNGLTANGENT3DVEXTPROC pglTangent3dvEXT=_Lazy_glTangent3dvEXT; +PFNGLTANGENT3FEXTPROC pglTangent3fEXT=_Lazy_glTangent3fEXT; +PFNGLTANGENT3FVEXTPROC pglTangent3fvEXT=_Lazy_glTangent3fvEXT; +PFNGLTANGENT3IEXTPROC pglTangent3iEXT=_Lazy_glTangent3iEXT; +PFNGLTANGENT3IVEXTPROC pglTangent3ivEXT=_Lazy_glTangent3ivEXT; +PFNGLTANGENT3SEXTPROC pglTangent3sEXT=_Lazy_glTangent3sEXT; +PFNGLTANGENT3SVEXTPROC pglTangent3svEXT=_Lazy_glTangent3svEXT; +PFNGLBINORMAL3BEXTPROC pglBinormal3bEXT=_Lazy_glBinormal3bEXT; +PFNGLBINORMAL3BVEXTPROC pglBinormal3bvEXT=_Lazy_glBinormal3bvEXT; +PFNGLBINORMAL3DEXTPROC pglBinormal3dEXT=_Lazy_glBinormal3dEXT; +PFNGLBINORMAL3DVEXTPROC pglBinormal3dvEXT=_Lazy_glBinormal3dvEXT; +PFNGLBINORMAL3FEXTPROC pglBinormal3fEXT=_Lazy_glBinormal3fEXT; +PFNGLBINORMAL3FVEXTPROC pglBinormal3fvEXT=_Lazy_glBinormal3fvEXT; +PFNGLBINORMAL3IEXTPROC pglBinormal3iEXT=_Lazy_glBinormal3iEXT; +PFNGLBINORMAL3IVEXTPROC pglBinormal3ivEXT=_Lazy_glBinormal3ivEXT; +PFNGLBINORMAL3SEXTPROC pglBinormal3sEXT=_Lazy_glBinormal3sEXT; +PFNGLBINORMAL3SVEXTPROC pglBinormal3svEXT=_Lazy_glBinormal3svEXT; +PFNGLTANGENTPOINTEREXTPROC pglTangentPointerEXT=_Lazy_glTangentPointerEXT; +PFNGLBINORMALPOINTEREXTPROC pglBinormalPointerEXT=_Lazy_glBinormalPointerEXT; +#endif + +/* GL_EXT_texture_env_combine */ + +#ifdef __GLEE_GL_EXT_texture_env_combine +#endif + +/* GL_APPLE_specular_vector */ + +#ifdef __GLEE_GL_APPLE_specular_vector +#endif + +/* GL_APPLE_transform_hint */ + +#ifdef __GLEE_GL_APPLE_transform_hint +#endif + +/* GL_SGIX_fog_scale */ + +#ifdef __GLEE_GL_SGIX_fog_scale +#endif + +/* GL_SUNX_constant_data */ + +#ifdef __GLEE_GL_SUNX_constant_data +void __stdcall _Lazy_glFinishTextureSUNX(void) {if (GLeeInit()) glFinishTextureSUNX();} +PFNGLFINISHTEXTURESUNXPROC pglFinishTextureSUNX=_Lazy_glFinishTextureSUNX; +#endif + +/* GL_SUN_global_alpha */ + +#ifdef __GLEE_GL_SUN_global_alpha +void __stdcall _Lazy_glGlobalAlphaFactorbSUN(GLbyte factor) {if (GLeeInit()) glGlobalAlphaFactorbSUN(factor);} +void __stdcall _Lazy_glGlobalAlphaFactorsSUN(GLshort factor) {if (GLeeInit()) glGlobalAlphaFactorsSUN(factor);} +void __stdcall _Lazy_glGlobalAlphaFactoriSUN(GLint factor) {if (GLeeInit()) glGlobalAlphaFactoriSUN(factor);} +void __stdcall _Lazy_glGlobalAlphaFactorfSUN(GLfloat factor) {if (GLeeInit()) glGlobalAlphaFactorfSUN(factor);} +void __stdcall _Lazy_glGlobalAlphaFactordSUN(GLdouble factor) {if (GLeeInit()) glGlobalAlphaFactordSUN(factor);} +void __stdcall _Lazy_glGlobalAlphaFactorubSUN(GLubyte factor) {if (GLeeInit()) glGlobalAlphaFactorubSUN(factor);} +void __stdcall _Lazy_glGlobalAlphaFactorusSUN(GLushort factor) {if (GLeeInit()) glGlobalAlphaFactorusSUN(factor);} +void __stdcall _Lazy_glGlobalAlphaFactoruiSUN(GLuint factor) {if (GLeeInit()) glGlobalAlphaFactoruiSUN(factor);} +PFNGLGLOBALALPHAFACTORBSUNPROC pglGlobalAlphaFactorbSUN=_Lazy_glGlobalAlphaFactorbSUN; +PFNGLGLOBALALPHAFACTORSSUNPROC pglGlobalAlphaFactorsSUN=_Lazy_glGlobalAlphaFactorsSUN; +PFNGLGLOBALALPHAFACTORISUNPROC pglGlobalAlphaFactoriSUN=_Lazy_glGlobalAlphaFactoriSUN; +PFNGLGLOBALALPHAFACTORFSUNPROC pglGlobalAlphaFactorfSUN=_Lazy_glGlobalAlphaFactorfSUN; +PFNGLGLOBALALPHAFACTORDSUNPROC pglGlobalAlphaFactordSUN=_Lazy_glGlobalAlphaFactordSUN; +PFNGLGLOBALALPHAFACTORUBSUNPROC pglGlobalAlphaFactorubSUN=_Lazy_glGlobalAlphaFactorubSUN; +PFNGLGLOBALALPHAFACTORUSSUNPROC pglGlobalAlphaFactorusSUN=_Lazy_glGlobalAlphaFactorusSUN; +PFNGLGLOBALALPHAFACTORUISUNPROC pglGlobalAlphaFactoruiSUN=_Lazy_glGlobalAlphaFactoruiSUN; +#endif + +/* GL_SUN_triangle_list */ + +#ifdef __GLEE_GL_SUN_triangle_list +void __stdcall _Lazy_glReplacementCodeuiSUN(GLuint code) {if (GLeeInit()) glReplacementCodeuiSUN(code);} +void __stdcall _Lazy_glReplacementCodeusSUN(GLushort code) {if (GLeeInit()) glReplacementCodeusSUN(code);} +void __stdcall _Lazy_glReplacementCodeubSUN(GLubyte code) {if (GLeeInit()) glReplacementCodeubSUN(code);} +void __stdcall _Lazy_glReplacementCodeuivSUN(const GLuint * code) {if (GLeeInit()) glReplacementCodeuivSUN(code);} +void __stdcall _Lazy_glReplacementCodeusvSUN(const GLushort * code) {if (GLeeInit()) glReplacementCodeusvSUN(code);} +void __stdcall _Lazy_glReplacementCodeubvSUN(const GLubyte * code) {if (GLeeInit()) glReplacementCodeubvSUN(code);} +void __stdcall _Lazy_glReplacementCodePointerSUN(GLenum type, GLsizei stride, const GLvoid* * pointer) {if (GLeeInit()) glReplacementCodePointerSUN(type, stride, pointer);} +PFNGLREPLACEMENTCODEUISUNPROC pglReplacementCodeuiSUN=_Lazy_glReplacementCodeuiSUN; +PFNGLREPLACEMENTCODEUSSUNPROC pglReplacementCodeusSUN=_Lazy_glReplacementCodeusSUN; +PFNGLREPLACEMENTCODEUBSUNPROC pglReplacementCodeubSUN=_Lazy_glReplacementCodeubSUN; +PFNGLREPLACEMENTCODEUIVSUNPROC pglReplacementCodeuivSUN=_Lazy_glReplacementCodeuivSUN; +PFNGLREPLACEMENTCODEUSVSUNPROC pglReplacementCodeusvSUN=_Lazy_glReplacementCodeusvSUN; +PFNGLREPLACEMENTCODEUBVSUNPROC pglReplacementCodeubvSUN=_Lazy_glReplacementCodeubvSUN; +PFNGLREPLACEMENTCODEPOINTERSUNPROC pglReplacementCodePointerSUN=_Lazy_glReplacementCodePointerSUN; +#endif + +/* GL_SUN_vertex */ + +#ifdef __GLEE_GL_SUN_vertex +void __stdcall _Lazy_glColor4ubVertex2fSUN(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y) {if (GLeeInit()) glColor4ubVertex2fSUN(r, g, b, a, x, y);} +void __stdcall _Lazy_glColor4ubVertex2fvSUN(const GLubyte * c, const GLfloat * v) {if (GLeeInit()) glColor4ubVertex2fvSUN(c, v);} +void __stdcall _Lazy_glColor4ubVertex3fSUN(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glColor4ubVertex3fSUN(r, g, b, a, x, y, z);} +void __stdcall _Lazy_glColor4ubVertex3fvSUN(const GLubyte * c, const GLfloat * v) {if (GLeeInit()) glColor4ubVertex3fvSUN(c, v);} +void __stdcall _Lazy_glColor3fVertex3fSUN(GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glColor3fVertex3fSUN(r, g, b, x, y, z);} +void __stdcall _Lazy_glColor3fVertex3fvSUN(const GLfloat * c, const GLfloat * v) {if (GLeeInit()) glColor3fVertex3fvSUN(c, v);} +void __stdcall _Lazy_glNormal3fVertex3fSUN(GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glNormal3fVertex3fSUN(nx, ny, nz, x, y, z);} +void __stdcall _Lazy_glNormal3fVertex3fvSUN(const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glNormal3fVertex3fvSUN(n, v);} +void __stdcall _Lazy_glColor4fNormal3fVertex3fSUN(GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glColor4fNormal3fVertex3fSUN(r, g, b, a, nx, ny, nz, x, y, z);} +void __stdcall _Lazy_glColor4fNormal3fVertex3fvSUN(const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glColor4fNormal3fVertex3fvSUN(c, n, v);} +void __stdcall _Lazy_glTexCoord2fVertex3fSUN(GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fVertex3fSUN(s, t, x, y, z);} +void __stdcall _Lazy_glTexCoord2fVertex3fvSUN(const GLfloat * tc, const GLfloat * v) {if (GLeeInit()) glTexCoord2fVertex3fvSUN(tc, v);} +void __stdcall _Lazy_glTexCoord4fVertex4fSUN(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glTexCoord4fVertex4fSUN(s, t, p, q, x, y, z, w);} +void __stdcall _Lazy_glTexCoord4fVertex4fvSUN(const GLfloat * tc, const GLfloat * v) {if (GLeeInit()) glTexCoord4fVertex4fvSUN(tc, v);} +void __stdcall _Lazy_glTexCoord2fColor4ubVertex3fSUN(GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fColor4ubVertex3fSUN(s, t, r, g, b, a, x, y, z);} +void __stdcall _Lazy_glTexCoord2fColor4ubVertex3fvSUN(const GLfloat * tc, const GLubyte * c, const GLfloat * v) {if (GLeeInit()) glTexCoord2fColor4ubVertex3fvSUN(tc, c, v);} +void __stdcall _Lazy_glTexCoord2fColor3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fColor3fVertex3fSUN(s, t, r, g, b, x, y, z);} +void __stdcall _Lazy_glTexCoord2fColor3fVertex3fvSUN(const GLfloat * tc, const GLfloat * c, const GLfloat * v) {if (GLeeInit()) glTexCoord2fColor3fVertex3fvSUN(tc, c, v);} +void __stdcall _Lazy_glTexCoord2fNormal3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fNormal3fVertex3fSUN(s, t, nx, ny, nz, x, y, z);} +void __stdcall _Lazy_glTexCoord2fNormal3fVertex3fvSUN(const GLfloat * tc, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glTexCoord2fNormal3fVertex3fvSUN(tc, n, v);} +void __stdcall _Lazy_glTexCoord2fColor4fNormal3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glTexCoord2fColor4fNormal3fVertex3fSUN(s, t, r, g, b, a, nx, ny, nz, x, y, z);} +void __stdcall _Lazy_glTexCoord2fColor4fNormal3fVertex3fvSUN(const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glTexCoord2fColor4fNormal3fVertex3fvSUN(tc, c, n, v);} +void __stdcall _Lazy_glTexCoord4fColor4fNormal3fVertex4fSUN(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glTexCoord4fColor4fNormal3fVertex4fSUN(s, t, p, q, r, g, b, a, nx, ny, nz, x, y, z, w);} +void __stdcall _Lazy_glTexCoord4fColor4fNormal3fVertex4fvSUN(const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glTexCoord4fColor4fNormal3fVertex4fvSUN(tc, c, n, v);} +void __stdcall _Lazy_glReplacementCodeuiVertex3fSUN(GLuint rc, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiVertex3fSUN(rc, x, y, z);} +void __stdcall _Lazy_glReplacementCodeuiVertex3fvSUN(const GLuint * rc, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiVertex3fvSUN(rc, v);} +void __stdcall _Lazy_glReplacementCodeuiColor4ubVertex3fSUN(GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiColor4ubVertex3fSUN(rc, r, g, b, a, x, y, z);} +void __stdcall _Lazy_glReplacementCodeuiColor4ubVertex3fvSUN(const GLuint * rc, const GLubyte * c, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiColor4ubVertex3fvSUN(rc, c, v);} +void __stdcall _Lazy_glReplacementCodeuiColor3fVertex3fSUN(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiColor3fVertex3fSUN(rc, r, g, b, x, y, z);} +void __stdcall _Lazy_glReplacementCodeuiColor3fVertex3fvSUN(const GLuint * rc, const GLfloat * c, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiColor3fVertex3fvSUN(rc, c, v);} +void __stdcall _Lazy_glReplacementCodeuiNormal3fVertex3fSUN(GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiNormal3fVertex3fSUN(rc, nx, ny, nz, x, y, z);} +void __stdcall _Lazy_glReplacementCodeuiNormal3fVertex3fvSUN(const GLuint * rc, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiNormal3fVertex3fvSUN(rc, n, v);} +void __stdcall _Lazy_glReplacementCodeuiColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiColor4fNormal3fVertex3fSUN(rc, r, g, b, a, nx, ny, nz, x, y, z);} +void __stdcall _Lazy_glReplacementCodeuiColor4fNormal3fVertex3fvSUN(const GLuint * rc, const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiColor4fNormal3fVertex3fvSUN(rc, c, n, v);} +void __stdcall _Lazy_glReplacementCodeuiTexCoord2fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiTexCoord2fVertex3fSUN(rc, s, t, x, y, z);} +void __stdcall _Lazy_glReplacementCodeuiTexCoord2fVertex3fvSUN(const GLuint * rc, const GLfloat * tc, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiTexCoord2fVertex3fvSUN(rc, tc, v);} +void __stdcall _Lazy_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(rc, s, t, nx, ny, nz, x, y, z);} +void __stdcall _Lazy_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(const GLuint * rc, const GLfloat * tc, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(rc, tc, n, v);} +void __stdcall _Lazy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(rc, s, t, r, g, b, a, nx, ny, nz, x, y, z);} +void __stdcall _Lazy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(const GLuint * rc, const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v) {if (GLeeInit()) glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(rc, tc, c, n, v);} +PFNGLCOLOR4UBVERTEX2FSUNPROC pglColor4ubVertex2fSUN=_Lazy_glColor4ubVertex2fSUN; +PFNGLCOLOR4UBVERTEX2FVSUNPROC pglColor4ubVertex2fvSUN=_Lazy_glColor4ubVertex2fvSUN; +PFNGLCOLOR4UBVERTEX3FSUNPROC pglColor4ubVertex3fSUN=_Lazy_glColor4ubVertex3fSUN; +PFNGLCOLOR4UBVERTEX3FVSUNPROC pglColor4ubVertex3fvSUN=_Lazy_glColor4ubVertex3fvSUN; +PFNGLCOLOR3FVERTEX3FSUNPROC pglColor3fVertex3fSUN=_Lazy_glColor3fVertex3fSUN; +PFNGLCOLOR3FVERTEX3FVSUNPROC pglColor3fVertex3fvSUN=_Lazy_glColor3fVertex3fvSUN; +PFNGLNORMAL3FVERTEX3FSUNPROC pglNormal3fVertex3fSUN=_Lazy_glNormal3fVertex3fSUN; +PFNGLNORMAL3FVERTEX3FVSUNPROC pglNormal3fVertex3fvSUN=_Lazy_glNormal3fVertex3fvSUN; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC pglColor4fNormal3fVertex3fSUN=_Lazy_glColor4fNormal3fVertex3fSUN; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglColor4fNormal3fVertex3fvSUN=_Lazy_glColor4fNormal3fVertex3fvSUN; +PFNGLTEXCOORD2FVERTEX3FSUNPROC pglTexCoord2fVertex3fSUN=_Lazy_glTexCoord2fVertex3fSUN; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC pglTexCoord2fVertex3fvSUN=_Lazy_glTexCoord2fVertex3fvSUN; +PFNGLTEXCOORD4FVERTEX4FSUNPROC pglTexCoord4fVertex4fSUN=_Lazy_glTexCoord4fVertex4fSUN; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC pglTexCoord4fVertex4fvSUN=_Lazy_glTexCoord4fVertex4fvSUN; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC pglTexCoord2fColor4ubVertex3fSUN=_Lazy_glTexCoord2fColor4ubVertex3fSUN; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC pglTexCoord2fColor4ubVertex3fvSUN=_Lazy_glTexCoord2fColor4ubVertex3fvSUN; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC pglTexCoord2fColor3fVertex3fSUN=_Lazy_glTexCoord2fColor3fVertex3fSUN; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC pglTexCoord2fColor3fVertex3fvSUN=_Lazy_glTexCoord2fColor3fVertex3fvSUN; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC pglTexCoord2fNormal3fVertex3fSUN=_Lazy_glTexCoord2fNormal3fVertex3fSUN; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC pglTexCoord2fNormal3fVertex3fvSUN=_Lazy_glTexCoord2fNormal3fVertex3fvSUN; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC pglTexCoord2fColor4fNormal3fVertex3fSUN=_Lazy_glTexCoord2fColor4fNormal3fVertex3fSUN; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglTexCoord2fColor4fNormal3fVertex3fvSUN=_Lazy_glTexCoord2fColor4fNormal3fVertex3fvSUN; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC pglTexCoord4fColor4fNormal3fVertex4fSUN=_Lazy_glTexCoord4fColor4fNormal3fVertex4fSUN; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC pglTexCoord4fColor4fNormal3fVertex4fvSUN=_Lazy_glTexCoord4fColor4fNormal3fVertex4fvSUN; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC pglReplacementCodeuiVertex3fSUN=_Lazy_glReplacementCodeuiVertex3fSUN; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC pglReplacementCodeuiVertex3fvSUN=_Lazy_glReplacementCodeuiVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC pglReplacementCodeuiColor4ubVertex3fSUN=_Lazy_glReplacementCodeuiColor4ubVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC pglReplacementCodeuiColor4ubVertex3fvSUN=_Lazy_glReplacementCodeuiColor4ubVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC pglReplacementCodeuiColor3fVertex3fSUN=_Lazy_glReplacementCodeuiColor3fVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC pglReplacementCodeuiColor3fVertex3fvSUN=_Lazy_glReplacementCodeuiColor3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiNormal3fVertex3fSUN=_Lazy_glReplacementCodeuiNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiNormal3fVertex3fvSUN=_Lazy_glReplacementCodeuiNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiColor4fNormal3fVertex3fSUN=_Lazy_glReplacementCodeuiColor4fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiColor4fNormal3fVertex3fvSUN=_Lazy_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fVertex3fSUN=_Lazy_glReplacementCodeuiTexCoord2fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fVertex3fvSUN=_Lazy_glReplacementCodeuiTexCoord2fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fNormal3fVertex3fSUN=_Lazy_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN=_Lazy_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN=_Lazy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN=_Lazy_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +#endif + +/* GL_EXT_blend_func_separate */ + +#ifdef __GLEE_GL_EXT_blend_func_separate +void __stdcall _Lazy_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {if (GLeeInit()) glBlendFuncSeparateEXT(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);} +PFNGLBLENDFUNCSEPARATEEXTPROC pglBlendFuncSeparateEXT=_Lazy_glBlendFuncSeparateEXT; +#endif + +/* GL_INGR_color_clamp */ + +#ifdef __GLEE_GL_INGR_color_clamp +#endif + +/* GL_INGR_interlace_read */ + +#ifdef __GLEE_GL_INGR_interlace_read +#endif + +/* GL_EXT_stencil_wrap */ + +#ifdef __GLEE_GL_EXT_stencil_wrap +#endif + +/* GL_EXT_422_pixels */ + +#ifdef __GLEE_GL_EXT_422_pixels +#endif + +/* GL_NV_texgen_reflection */ + +#ifdef __GLEE_GL_NV_texgen_reflection +#endif + +/* GL_EXT_texture_cube_map */ + +#ifdef __GLEE_GL_EXT_texture_cube_map +#endif + +/* GL_SUN_convolution_border_modes */ + +#ifdef __GLEE_GL_SUN_convolution_border_modes +#endif + +/* GL_EXT_texture_env_add */ + +#ifdef __GLEE_GL_EXT_texture_env_add +#endif + +/* GL_EXT_texture_lod_bias */ + +#ifdef __GLEE_GL_EXT_texture_lod_bias +#endif + +/* GL_EXT_texture_filter_anisotropic */ + +#ifdef __GLEE_GL_EXT_texture_filter_anisotropic +#endif + +/* GL_EXT_vertex_weighting */ + +#ifdef __GLEE_GL_EXT_vertex_weighting +void __stdcall _Lazy_glVertexWeightfEXT(GLfloat weight) {if (GLeeInit()) glVertexWeightfEXT(weight);} +void __stdcall _Lazy_glVertexWeightfvEXT(const GLfloat * weight) {if (GLeeInit()) glVertexWeightfvEXT(weight);} +void __stdcall _Lazy_glVertexWeightPointerEXT(GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexWeightPointerEXT(size, type, stride, pointer);} +PFNGLVERTEXWEIGHTFEXTPROC pglVertexWeightfEXT=_Lazy_glVertexWeightfEXT; +PFNGLVERTEXWEIGHTFVEXTPROC pglVertexWeightfvEXT=_Lazy_glVertexWeightfvEXT; +PFNGLVERTEXWEIGHTPOINTEREXTPROC pglVertexWeightPointerEXT=_Lazy_glVertexWeightPointerEXT; +#endif + +/* GL_NV_light_max_exponent */ + +#ifdef __GLEE_GL_NV_light_max_exponent +#endif + +/* GL_NV_vertex_array_range */ + +#ifdef __GLEE_GL_NV_vertex_array_range +void __stdcall _Lazy_glFlushVertexArrayRangeNV(void) {if (GLeeInit()) glFlushVertexArrayRangeNV();} +void __stdcall _Lazy_glVertexArrayRangeNV(GLsizei length, const GLvoid * pointer) {if (GLeeInit()) glVertexArrayRangeNV(length, pointer);} +PFNGLFLUSHVERTEXARRAYRANGENVPROC pglFlushVertexArrayRangeNV=_Lazy_glFlushVertexArrayRangeNV; +PFNGLVERTEXARRAYRANGENVPROC pglVertexArrayRangeNV=_Lazy_glVertexArrayRangeNV; +#endif + +/* GL_NV_register_combiners */ + +#ifdef __GLEE_GL_NV_register_combiners +void __stdcall _Lazy_glCombinerParameterfvNV(GLenum pname, const GLfloat * params) {if (GLeeInit()) glCombinerParameterfvNV(pname, params);} +void __stdcall _Lazy_glCombinerParameterfNV(GLenum pname, GLfloat param) {if (GLeeInit()) glCombinerParameterfNV(pname, param);} +void __stdcall _Lazy_glCombinerParameterivNV(GLenum pname, const GLint * params) {if (GLeeInit()) glCombinerParameterivNV(pname, params);} +void __stdcall _Lazy_glCombinerParameteriNV(GLenum pname, GLint param) {if (GLeeInit()) glCombinerParameteriNV(pname, param);} +void __stdcall _Lazy_glCombinerInputNV(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) {if (GLeeInit()) glCombinerInputNV(stage, portion, variable, input, mapping, componentUsage);} +void __stdcall _Lazy_glCombinerOutputNV(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum) {if (GLeeInit()) glCombinerOutputNV(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum);} +void __stdcall _Lazy_glFinalCombinerInputNV(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) {if (GLeeInit()) glFinalCombinerInputNV(variable, input, mapping, componentUsage);} +void __stdcall _Lazy_glGetCombinerInputParameterfvNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetCombinerInputParameterfvNV(stage, portion, variable, pname, params);} +void __stdcall _Lazy_glGetCombinerInputParameterivNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params) {if (GLeeInit()) glGetCombinerInputParameterivNV(stage, portion, variable, pname, params);} +void __stdcall _Lazy_glGetCombinerOutputParameterfvNV(GLenum stage, GLenum portion, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetCombinerOutputParameterfvNV(stage, portion, pname, params);} +void __stdcall _Lazy_glGetCombinerOutputParameterivNV(GLenum stage, GLenum portion, GLenum pname, GLint * params) {if (GLeeInit()) glGetCombinerOutputParameterivNV(stage, portion, pname, params);} +void __stdcall _Lazy_glGetFinalCombinerInputParameterfvNV(GLenum variable, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetFinalCombinerInputParameterfvNV(variable, pname, params);} +void __stdcall _Lazy_glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum pname, GLint * params) {if (GLeeInit()) glGetFinalCombinerInputParameterivNV(variable, pname, params);} +PFNGLCOMBINERPARAMETERFVNVPROC pglCombinerParameterfvNV=_Lazy_glCombinerParameterfvNV; +PFNGLCOMBINERPARAMETERFNVPROC pglCombinerParameterfNV=_Lazy_glCombinerParameterfNV; +PFNGLCOMBINERPARAMETERIVNVPROC pglCombinerParameterivNV=_Lazy_glCombinerParameterivNV; +PFNGLCOMBINERPARAMETERINVPROC pglCombinerParameteriNV=_Lazy_glCombinerParameteriNV; +PFNGLCOMBINERINPUTNVPROC pglCombinerInputNV=_Lazy_glCombinerInputNV; +PFNGLCOMBINEROUTPUTNVPROC pglCombinerOutputNV=_Lazy_glCombinerOutputNV; +PFNGLFINALCOMBINERINPUTNVPROC pglFinalCombinerInputNV=_Lazy_glFinalCombinerInputNV; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC pglGetCombinerInputParameterfvNV=_Lazy_glGetCombinerInputParameterfvNV; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC pglGetCombinerInputParameterivNV=_Lazy_glGetCombinerInputParameterivNV; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC pglGetCombinerOutputParameterfvNV=_Lazy_glGetCombinerOutputParameterfvNV; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC pglGetCombinerOutputParameterivNV=_Lazy_glGetCombinerOutputParameterivNV; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC pglGetFinalCombinerInputParameterfvNV=_Lazy_glGetFinalCombinerInputParameterfvNV; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC pglGetFinalCombinerInputParameterivNV=_Lazy_glGetFinalCombinerInputParameterivNV; +#endif + +/* GL_NV_fog_distance */ + +#ifdef __GLEE_GL_NV_fog_distance +#endif + +/* GL_NV_texgen_emboss */ + +#ifdef __GLEE_GL_NV_texgen_emboss +#endif + +/* GL_NV_blend_square */ + +#ifdef __GLEE_GL_NV_blend_square +#endif + +/* GL_NV_texture_env_combine4 */ + +#ifdef __GLEE_GL_NV_texture_env_combine4 +#endif + +/* GL_MESA_resize_buffers */ + +#ifdef __GLEE_GL_MESA_resize_buffers +void __stdcall _Lazy_glResizeBuffersMESA(void) {if (GLeeInit()) glResizeBuffersMESA();} +PFNGLRESIZEBUFFERSMESAPROC pglResizeBuffersMESA=_Lazy_glResizeBuffersMESA; +#endif + +/* GL_MESA_window_pos */ + +#ifdef __GLEE_GL_MESA_window_pos +void __stdcall _Lazy_glWindowPos2dMESA(GLdouble x, GLdouble y) {if (GLeeInit()) glWindowPos2dMESA(x, y);} +void __stdcall _Lazy_glWindowPos2dvMESA(const GLdouble * v) {if (GLeeInit()) glWindowPos2dvMESA(v);} +void __stdcall _Lazy_glWindowPos2fMESA(GLfloat x, GLfloat y) {if (GLeeInit()) glWindowPos2fMESA(x, y);} +void __stdcall _Lazy_glWindowPos2fvMESA(const GLfloat * v) {if (GLeeInit()) glWindowPos2fvMESA(v);} +void __stdcall _Lazy_glWindowPos2iMESA(GLint x, GLint y) {if (GLeeInit()) glWindowPos2iMESA(x, y);} +void __stdcall _Lazy_glWindowPos2ivMESA(const GLint * v) {if (GLeeInit()) glWindowPos2ivMESA(v);} +void __stdcall _Lazy_glWindowPos2sMESA(GLshort x, GLshort y) {if (GLeeInit()) glWindowPos2sMESA(x, y);} +void __stdcall _Lazy_glWindowPos2svMESA(const GLshort * v) {if (GLeeInit()) glWindowPos2svMESA(v);} +void __stdcall _Lazy_glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glWindowPos3dMESA(x, y, z);} +void __stdcall _Lazy_glWindowPos3dvMESA(const GLdouble * v) {if (GLeeInit()) glWindowPos3dvMESA(v);} +void __stdcall _Lazy_glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glWindowPos3fMESA(x, y, z);} +void __stdcall _Lazy_glWindowPos3fvMESA(const GLfloat * v) {if (GLeeInit()) glWindowPos3fvMESA(v);} +void __stdcall _Lazy_glWindowPos3iMESA(GLint x, GLint y, GLint z) {if (GLeeInit()) glWindowPos3iMESA(x, y, z);} +void __stdcall _Lazy_glWindowPos3ivMESA(const GLint * v) {if (GLeeInit()) glWindowPos3ivMESA(v);} +void __stdcall _Lazy_glWindowPos3sMESA(GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glWindowPos3sMESA(x, y, z);} +void __stdcall _Lazy_glWindowPos3svMESA(const GLshort * v) {if (GLeeInit()) glWindowPos3svMESA(v);} +void __stdcall _Lazy_glWindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glWindowPos4dMESA(x, y, z, w);} +void __stdcall _Lazy_glWindowPos4dvMESA(const GLdouble * v) {if (GLeeInit()) glWindowPos4dvMESA(v);} +void __stdcall _Lazy_glWindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glWindowPos4fMESA(x, y, z, w);} +void __stdcall _Lazy_glWindowPos4fvMESA(const GLfloat * v) {if (GLeeInit()) glWindowPos4fvMESA(v);} +void __stdcall _Lazy_glWindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glWindowPos4iMESA(x, y, z, w);} +void __stdcall _Lazy_glWindowPos4ivMESA(const GLint * v) {if (GLeeInit()) glWindowPos4ivMESA(v);} +void __stdcall _Lazy_glWindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glWindowPos4sMESA(x, y, z, w);} +void __stdcall _Lazy_glWindowPos4svMESA(const GLshort * v) {if (GLeeInit()) glWindowPos4svMESA(v);} +PFNGLWINDOWPOS2DMESAPROC pglWindowPos2dMESA=_Lazy_glWindowPos2dMESA; +PFNGLWINDOWPOS2DVMESAPROC pglWindowPos2dvMESA=_Lazy_glWindowPos2dvMESA; +PFNGLWINDOWPOS2FMESAPROC pglWindowPos2fMESA=_Lazy_glWindowPos2fMESA; +PFNGLWINDOWPOS2FVMESAPROC pglWindowPos2fvMESA=_Lazy_glWindowPos2fvMESA; +PFNGLWINDOWPOS2IMESAPROC pglWindowPos2iMESA=_Lazy_glWindowPos2iMESA; +PFNGLWINDOWPOS2IVMESAPROC pglWindowPos2ivMESA=_Lazy_glWindowPos2ivMESA; +PFNGLWINDOWPOS2SMESAPROC pglWindowPos2sMESA=_Lazy_glWindowPos2sMESA; +PFNGLWINDOWPOS2SVMESAPROC pglWindowPos2svMESA=_Lazy_glWindowPos2svMESA; +PFNGLWINDOWPOS3DMESAPROC pglWindowPos3dMESA=_Lazy_glWindowPos3dMESA; +PFNGLWINDOWPOS3DVMESAPROC pglWindowPos3dvMESA=_Lazy_glWindowPos3dvMESA; +PFNGLWINDOWPOS3FMESAPROC pglWindowPos3fMESA=_Lazy_glWindowPos3fMESA; +PFNGLWINDOWPOS3FVMESAPROC pglWindowPos3fvMESA=_Lazy_glWindowPos3fvMESA; +PFNGLWINDOWPOS3IMESAPROC pglWindowPos3iMESA=_Lazy_glWindowPos3iMESA; +PFNGLWINDOWPOS3IVMESAPROC pglWindowPos3ivMESA=_Lazy_glWindowPos3ivMESA; +PFNGLWINDOWPOS3SMESAPROC pglWindowPos3sMESA=_Lazy_glWindowPos3sMESA; +PFNGLWINDOWPOS3SVMESAPROC pglWindowPos3svMESA=_Lazy_glWindowPos3svMESA; +PFNGLWINDOWPOS4DMESAPROC pglWindowPos4dMESA=_Lazy_glWindowPos4dMESA; +PFNGLWINDOWPOS4DVMESAPROC pglWindowPos4dvMESA=_Lazy_glWindowPos4dvMESA; +PFNGLWINDOWPOS4FMESAPROC pglWindowPos4fMESA=_Lazy_glWindowPos4fMESA; +PFNGLWINDOWPOS4FVMESAPROC pglWindowPos4fvMESA=_Lazy_glWindowPos4fvMESA; +PFNGLWINDOWPOS4IMESAPROC pglWindowPos4iMESA=_Lazy_glWindowPos4iMESA; +PFNGLWINDOWPOS4IVMESAPROC pglWindowPos4ivMESA=_Lazy_glWindowPos4ivMESA; +PFNGLWINDOWPOS4SMESAPROC pglWindowPos4sMESA=_Lazy_glWindowPos4sMESA; +PFNGLWINDOWPOS4SVMESAPROC pglWindowPos4svMESA=_Lazy_glWindowPos4svMESA; +#endif + +/* GL_EXT_texture_compression_s3tc */ + +#ifdef __GLEE_GL_EXT_texture_compression_s3tc +#endif + +/* GL_IBM_cull_vertex */ + +#ifdef __GLEE_GL_IBM_cull_vertex +#endif + +/* GL_IBM_multimode_draw_arrays */ + +#ifdef __GLEE_GL_IBM_multimode_draw_arrays +void __stdcall _Lazy_glMultiModeDrawArraysIBM(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) {if (GLeeInit()) glMultiModeDrawArraysIBM(mode, first, count, primcount, modestride);} +void __stdcall _Lazy_glMultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid* const * indices, GLsizei primcount, GLint modestride) {if (GLeeInit()) glMultiModeDrawElementsIBM(mode, count, type, indices, primcount, modestride);} +PFNGLMULTIMODEDRAWARRAYSIBMPROC pglMultiModeDrawArraysIBM=_Lazy_glMultiModeDrawArraysIBM; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC pglMultiModeDrawElementsIBM=_Lazy_glMultiModeDrawElementsIBM; +#endif + +/* GL_IBM_vertex_array_lists */ + +#ifdef __GLEE_GL_IBM_vertex_array_lists +void __stdcall _Lazy_glColorPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glColorPointerListIBM(size, type, stride, pointer, ptrstride);} +void __stdcall _Lazy_glSecondaryColorPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glSecondaryColorPointerListIBM(size, type, stride, pointer, ptrstride);} +void __stdcall _Lazy_glEdgeFlagPointerListIBM(GLint stride, const GLboolean* * pointer, GLint ptrstride) {if (GLeeInit()) glEdgeFlagPointerListIBM(stride, pointer, ptrstride);} +void __stdcall _Lazy_glFogCoordPointerListIBM(GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glFogCoordPointerListIBM(type, stride, pointer, ptrstride);} +void __stdcall _Lazy_glIndexPointerListIBM(GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glIndexPointerListIBM(type, stride, pointer, ptrstride);} +void __stdcall _Lazy_glNormalPointerListIBM(GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glNormalPointerListIBM(type, stride, pointer, ptrstride);} +void __stdcall _Lazy_glTexCoordPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glTexCoordPointerListIBM(size, type, stride, pointer, ptrstride);} +void __stdcall _Lazy_glVertexPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride) {if (GLeeInit()) glVertexPointerListIBM(size, type, stride, pointer, ptrstride);} +PFNGLCOLORPOINTERLISTIBMPROC pglColorPointerListIBM=_Lazy_glColorPointerListIBM; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC pglSecondaryColorPointerListIBM=_Lazy_glSecondaryColorPointerListIBM; +PFNGLEDGEFLAGPOINTERLISTIBMPROC pglEdgeFlagPointerListIBM=_Lazy_glEdgeFlagPointerListIBM; +PFNGLFOGCOORDPOINTERLISTIBMPROC pglFogCoordPointerListIBM=_Lazy_glFogCoordPointerListIBM; +PFNGLINDEXPOINTERLISTIBMPROC pglIndexPointerListIBM=_Lazy_glIndexPointerListIBM; +PFNGLNORMALPOINTERLISTIBMPROC pglNormalPointerListIBM=_Lazy_glNormalPointerListIBM; +PFNGLTEXCOORDPOINTERLISTIBMPROC pglTexCoordPointerListIBM=_Lazy_glTexCoordPointerListIBM; +PFNGLVERTEXPOINTERLISTIBMPROC pglVertexPointerListIBM=_Lazy_glVertexPointerListIBM; +#endif + +/* GL_SGIX_subsample */ + +#ifdef __GLEE_GL_SGIX_subsample +#endif + +/* GL_SGIX_ycrcb_subsample */ + +#ifdef __GLEE_GL_SGIX_ycrcb_subsample +#endif + +/* GL_SGIX_ycrcba */ + +#ifdef __GLEE_GL_SGIX_ycrcba +#endif + +/* GL_SGI_depth_pass_instrument */ + +#ifdef __GLEE_GL_SGI_depth_pass_instrument +#endif + +/* GL_3DFX_texture_compression_FXT1 */ + +#ifdef __GLEE_GL_3DFX_texture_compression_FXT1 +#endif + +/* GL_3DFX_multisample */ + +#ifdef __GLEE_GL_3DFX_multisample +#endif + +/* GL_3DFX_tbuffer */ + +#ifdef __GLEE_GL_3DFX_tbuffer +void __stdcall _Lazy_glTbufferMask3DFX(GLuint mask) {if (GLeeInit()) glTbufferMask3DFX(mask);} +PFNGLTBUFFERMASK3DFXPROC pglTbufferMask3DFX=_Lazy_glTbufferMask3DFX; +#endif + +/* GL_EXT_multisample */ + +#ifdef __GLEE_GL_EXT_multisample +void __stdcall _Lazy_glSampleMaskEXT(GLclampf value, GLboolean invert) {if (GLeeInit()) glSampleMaskEXT(value, invert);} +void __stdcall _Lazy_glSamplePatternEXT(GLenum pattern) {if (GLeeInit()) glSamplePatternEXT(pattern);} +PFNGLSAMPLEMASKEXTPROC pglSampleMaskEXT=_Lazy_glSampleMaskEXT; +PFNGLSAMPLEPATTERNEXTPROC pglSamplePatternEXT=_Lazy_glSamplePatternEXT; +#endif + +/* GL_SGIX_vertex_preclip */ + +#ifdef __GLEE_GL_SGIX_vertex_preclip +#endif + +/* GL_SGIX_convolution_accuracy */ + +#ifdef __GLEE_GL_SGIX_convolution_accuracy +#endif + +/* GL_SGIX_resample */ + +#ifdef __GLEE_GL_SGIX_resample +#endif + +/* GL_SGIS_point_line_texgen */ + +#ifdef __GLEE_GL_SGIS_point_line_texgen +#endif + +/* GL_SGIS_texture_color_mask */ + +#ifdef __GLEE_GL_SGIS_texture_color_mask +void __stdcall _Lazy_glTextureColorMaskSGIS(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {if (GLeeInit()) glTextureColorMaskSGIS(red, green, blue, alpha);} +PFNGLTEXTURECOLORMASKSGISPROC pglTextureColorMaskSGIS=_Lazy_glTextureColorMaskSGIS; +#endif + +/* GL_EXT_texture_env_dot3 */ + +#ifdef __GLEE_GL_EXT_texture_env_dot3 +#endif + +/* GL_ATI_texture_mirror_once */ + +#ifdef __GLEE_GL_ATI_texture_mirror_once +#endif + +/* GL_NV_fence */ + +#ifdef __GLEE_GL_NV_fence +void __stdcall _Lazy_glDeleteFencesNV(GLsizei n, const GLuint * fences) {if (GLeeInit()) glDeleteFencesNV(n, fences);} +void __stdcall _Lazy_glGenFencesNV(GLsizei n, GLuint * fences) {if (GLeeInit()) glGenFencesNV(n, fences);} +GLboolean __stdcall _Lazy_glIsFenceNV(GLuint fence) {if (GLeeInit()) return glIsFenceNV(fence); return (GLboolean)0;} +GLboolean __stdcall _Lazy_glTestFenceNV(GLuint fence) {if (GLeeInit()) return glTestFenceNV(fence); return (GLboolean)0;} +void __stdcall _Lazy_glGetFenceivNV(GLuint fence, GLenum pname, GLint * params) {if (GLeeInit()) glGetFenceivNV(fence, pname, params);} +void __stdcall _Lazy_glFinishFenceNV(GLuint fence) {if (GLeeInit()) glFinishFenceNV(fence);} +void __stdcall _Lazy_glSetFenceNV(GLuint fence, GLenum condition) {if (GLeeInit()) glSetFenceNV(fence, condition);} +PFNGLDELETEFENCESNVPROC pglDeleteFencesNV=_Lazy_glDeleteFencesNV; +PFNGLGENFENCESNVPROC pglGenFencesNV=_Lazy_glGenFencesNV; +PFNGLISFENCENVPROC pglIsFenceNV=_Lazy_glIsFenceNV; +PFNGLTESTFENCENVPROC pglTestFenceNV=_Lazy_glTestFenceNV; +PFNGLGETFENCEIVNVPROC pglGetFenceivNV=_Lazy_glGetFenceivNV; +PFNGLFINISHFENCENVPROC pglFinishFenceNV=_Lazy_glFinishFenceNV; +PFNGLSETFENCENVPROC pglSetFenceNV=_Lazy_glSetFenceNV; +#endif + +/* GL_IBM_texture_mirrored_repeat */ + +#ifdef __GLEE_GL_IBM_texture_mirrored_repeat +#endif + +/* GL_NV_evaluators */ + +#ifdef __GLEE_GL_NV_evaluators +void __stdcall _Lazy_glMapControlPointsNV(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid * points) {if (GLeeInit()) glMapControlPointsNV(target, index, type, ustride, vstride, uorder, vorder, packed, points);} +void __stdcall _Lazy_glMapParameterivNV(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glMapParameterivNV(target, pname, params);} +void __stdcall _Lazy_glMapParameterfvNV(GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glMapParameterfvNV(target, pname, params);} +void __stdcall _Lazy_glGetMapControlPointsNV(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid * points) {if (GLeeInit()) glGetMapControlPointsNV(target, index, type, ustride, vstride, packed, points);} +void __stdcall _Lazy_glGetMapParameterivNV(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMapParameterivNV(target, pname, params);} +void __stdcall _Lazy_glGetMapParameterfvNV(GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMapParameterfvNV(target, pname, params);} +void __stdcall _Lazy_glGetMapAttribParameterivNV(GLenum target, GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetMapAttribParameterivNV(target, index, pname, params);} +void __stdcall _Lazy_glGetMapAttribParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMapAttribParameterfvNV(target, index, pname, params);} +void __stdcall _Lazy_glEvalMapsNV(GLenum target, GLenum mode) {if (GLeeInit()) glEvalMapsNV(target, mode);} +PFNGLMAPCONTROLPOINTSNVPROC pglMapControlPointsNV=_Lazy_glMapControlPointsNV; +PFNGLMAPPARAMETERIVNVPROC pglMapParameterivNV=_Lazy_glMapParameterivNV; +PFNGLMAPPARAMETERFVNVPROC pglMapParameterfvNV=_Lazy_glMapParameterfvNV; +PFNGLGETMAPCONTROLPOINTSNVPROC pglGetMapControlPointsNV=_Lazy_glGetMapControlPointsNV; +PFNGLGETMAPPARAMETERIVNVPROC pglGetMapParameterivNV=_Lazy_glGetMapParameterivNV; +PFNGLGETMAPPARAMETERFVNVPROC pglGetMapParameterfvNV=_Lazy_glGetMapParameterfvNV; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC pglGetMapAttribParameterivNV=_Lazy_glGetMapAttribParameterivNV; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC pglGetMapAttribParameterfvNV=_Lazy_glGetMapAttribParameterfvNV; +PFNGLEVALMAPSNVPROC pglEvalMapsNV=_Lazy_glEvalMapsNV; +#endif + +/* GL_NV_packed_depth_stencil */ + +#ifdef __GLEE_GL_NV_packed_depth_stencil +#endif + +/* GL_NV_register_combiners2 */ + +#ifdef __GLEE_GL_NV_register_combiners2 +void __stdcall _Lazy_glCombinerStageParameterfvNV(GLenum stage, GLenum pname, const GLfloat * params) {if (GLeeInit()) glCombinerStageParameterfvNV(stage, pname, params);} +void __stdcall _Lazy_glGetCombinerStageParameterfvNV(GLenum stage, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetCombinerStageParameterfvNV(stage, pname, params);} +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC pglCombinerStageParameterfvNV=_Lazy_glCombinerStageParameterfvNV; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC pglGetCombinerStageParameterfvNV=_Lazy_glGetCombinerStageParameterfvNV; +#endif + +/* GL_NV_texture_compression_vtc */ + +#ifdef __GLEE_GL_NV_texture_compression_vtc +#endif + +/* GL_NV_texture_rectangle */ + +#ifdef __GLEE_GL_NV_texture_rectangle +#endif + +/* GL_NV_texture_shader */ + +#ifdef __GLEE_GL_NV_texture_shader +#endif + +/* GL_NV_texture_shader2 */ + +#ifdef __GLEE_GL_NV_texture_shader2 +#endif + +/* GL_NV_vertex_array_range2 */ + +#ifdef __GLEE_GL_NV_vertex_array_range2 +#endif + +/* GL_NV_vertex_program */ + +#ifdef __GLEE_GL_NV_vertex_program +GLboolean __stdcall _Lazy_glAreProgramsResidentNV(GLsizei n, const GLuint * programs, GLboolean * residences) {if (GLeeInit()) return glAreProgramsResidentNV(n, programs, residences); return (GLboolean)0;} +void __stdcall _Lazy_glBindProgramNV(GLenum target, GLuint id) {if (GLeeInit()) glBindProgramNV(target, id);} +void __stdcall _Lazy_glDeleteProgramsNV(GLsizei n, const GLuint * programs) {if (GLeeInit()) glDeleteProgramsNV(n, programs);} +void __stdcall _Lazy_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params) {if (GLeeInit()) glExecuteProgramNV(target, id, params);} +void __stdcall _Lazy_glGenProgramsNV(GLsizei n, GLuint * programs) {if (GLeeInit()) glGenProgramsNV(n, programs);} +void __stdcall _Lazy_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetProgramParameterdvNV(target, index, pname, params);} +void __stdcall _Lazy_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetProgramParameterfvNV(target, index, pname, params);} +void __stdcall _Lazy_glGetProgramivNV(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetProgramivNV(id, pname, params);} +void __stdcall _Lazy_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program) {if (GLeeInit()) glGetProgramStringNV(id, pname, program);} +void __stdcall _Lazy_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params) {if (GLeeInit()) glGetTrackMatrixivNV(target, address, pname, params);} +void __stdcall _Lazy_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetVertexAttribdvNV(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVertexAttribfvNV(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribivNV(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid* * pointer) {if (GLeeInit()) glGetVertexAttribPointervNV(index, pname, pointer);} +GLboolean __stdcall _Lazy_glIsProgramNV(GLuint id) {if (GLeeInit()) return glIsProgramNV(id); return (GLboolean)0;} +void __stdcall _Lazy_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program) {if (GLeeInit()) glLoadProgramNV(target, id, len, program);} +void __stdcall _Lazy_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glProgramParameter4dNV(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble * v) {if (GLeeInit()) glProgramParameter4dvNV(target, index, v);} +void __stdcall _Lazy_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glProgramParameter4fNV(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat * v) {if (GLeeInit()) glProgramParameter4fvNV(target, index, v);} +void __stdcall _Lazy_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint count, const GLdouble * v) {if (GLeeInit()) glProgramParameters4dvNV(target, index, count, v);} +void __stdcall _Lazy_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint count, const GLfloat * v) {if (GLeeInit()) glProgramParameters4fvNV(target, index, count, v);} +void __stdcall _Lazy_glRequestResidentProgramsNV(GLsizei n, const GLuint * programs) {if (GLeeInit()) glRequestResidentProgramsNV(n, programs);} +void __stdcall _Lazy_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform) {if (GLeeInit()) glTrackMatrixNV(target, address, matrix, transform);} +void __stdcall _Lazy_glVertexAttribPointerNV(GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribPointerNV(index, fsize, type, stride, pointer);} +void __stdcall _Lazy_glVertexAttrib1dNV(GLuint index, GLdouble x) {if (GLeeInit()) glVertexAttrib1dNV(index, x);} +void __stdcall _Lazy_glVertexAttrib1dvNV(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib1dvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib1fNV(GLuint index, GLfloat x) {if (GLeeInit()) glVertexAttrib1fNV(index, x);} +void __stdcall _Lazy_glVertexAttrib1fvNV(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib1fvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib1sNV(GLuint index, GLshort x) {if (GLeeInit()) glVertexAttrib1sNV(index, x);} +void __stdcall _Lazy_glVertexAttrib1svNV(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib1svNV(index, v);} +void __stdcall _Lazy_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y) {if (GLeeInit()) glVertexAttrib2dNV(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2dvNV(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib2dvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) {if (GLeeInit()) glVertexAttrib2fNV(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2fvNV(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib2fvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y) {if (GLeeInit()) glVertexAttrib2sNV(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2svNV(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib2svNV(index, v);} +void __stdcall _Lazy_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glVertexAttrib3dNV(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3dvNV(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib3dvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glVertexAttrib3fNV(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3fvNV(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib3fvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glVertexAttrib3sNV(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3svNV(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib3svNV(index, v);} +void __stdcall _Lazy_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glVertexAttrib4dNV(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4dvNV(GLuint index, const GLdouble * v) {if (GLeeInit()) glVertexAttrib4dvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glVertexAttrib4fNV(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4fvNV(GLuint index, const GLfloat * v) {if (GLeeInit()) glVertexAttrib4fvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glVertexAttrib4sNV(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4svNV(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttrib4svNV(index, v);} +void __stdcall _Lazy_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) {if (GLeeInit()) glVertexAttrib4ubNV(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttrib4ubvNV(index, v);} +void __stdcall _Lazy_glVertexAttribs1dvNV(GLuint index, GLsizei count, const GLdouble * v) {if (GLeeInit()) glVertexAttribs1dvNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs1fvNV(GLuint index, GLsizei count, const GLfloat * v) {if (GLeeInit()) glVertexAttribs1fvNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs1svNV(GLuint index, GLsizei count, const GLshort * v) {if (GLeeInit()) glVertexAttribs1svNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs2dvNV(GLuint index, GLsizei count, const GLdouble * v) {if (GLeeInit()) glVertexAttribs2dvNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs2fvNV(GLuint index, GLsizei count, const GLfloat * v) {if (GLeeInit()) glVertexAttribs2fvNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs2svNV(GLuint index, GLsizei count, const GLshort * v) {if (GLeeInit()) glVertexAttribs2svNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs3dvNV(GLuint index, GLsizei count, const GLdouble * v) {if (GLeeInit()) glVertexAttribs3dvNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs3fvNV(GLuint index, GLsizei count, const GLfloat * v) {if (GLeeInit()) glVertexAttribs3fvNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs3svNV(GLuint index, GLsizei count, const GLshort * v) {if (GLeeInit()) glVertexAttribs3svNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs4dvNV(GLuint index, GLsizei count, const GLdouble * v) {if (GLeeInit()) glVertexAttribs4dvNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs4fvNV(GLuint index, GLsizei count, const GLfloat * v) {if (GLeeInit()) glVertexAttribs4fvNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs4svNV(GLuint index, GLsizei count, const GLshort * v) {if (GLeeInit()) glVertexAttribs4svNV(index, count, v);} +void __stdcall _Lazy_glVertexAttribs4ubvNV(GLuint index, GLsizei count, const GLubyte * v) {if (GLeeInit()) glVertexAttribs4ubvNV(index, count, v);} +PFNGLAREPROGRAMSRESIDENTNVPROC pglAreProgramsResidentNV=_Lazy_glAreProgramsResidentNV; +PFNGLBINDPROGRAMNVPROC pglBindProgramNV=_Lazy_glBindProgramNV; +PFNGLDELETEPROGRAMSNVPROC pglDeleteProgramsNV=_Lazy_glDeleteProgramsNV; +PFNGLEXECUTEPROGRAMNVPROC pglExecuteProgramNV=_Lazy_glExecuteProgramNV; +PFNGLGENPROGRAMSNVPROC pglGenProgramsNV=_Lazy_glGenProgramsNV; +PFNGLGETPROGRAMPARAMETERDVNVPROC pglGetProgramParameterdvNV=_Lazy_glGetProgramParameterdvNV; +PFNGLGETPROGRAMPARAMETERFVNVPROC pglGetProgramParameterfvNV=_Lazy_glGetProgramParameterfvNV; +PFNGLGETPROGRAMIVNVPROC pglGetProgramivNV=_Lazy_glGetProgramivNV; +PFNGLGETPROGRAMSTRINGNVPROC pglGetProgramStringNV=_Lazy_glGetProgramStringNV; +PFNGLGETTRACKMATRIXIVNVPROC pglGetTrackMatrixivNV=_Lazy_glGetTrackMatrixivNV; +PFNGLGETVERTEXATTRIBDVNVPROC pglGetVertexAttribdvNV=_Lazy_glGetVertexAttribdvNV; +PFNGLGETVERTEXATTRIBFVNVPROC pglGetVertexAttribfvNV=_Lazy_glGetVertexAttribfvNV; +PFNGLGETVERTEXATTRIBIVNVPROC pglGetVertexAttribivNV=_Lazy_glGetVertexAttribivNV; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC pglGetVertexAttribPointervNV=_Lazy_glGetVertexAttribPointervNV; +PFNGLISPROGRAMNVPROC pglIsProgramNV=_Lazy_glIsProgramNV; +PFNGLLOADPROGRAMNVPROC pglLoadProgramNV=_Lazy_glLoadProgramNV; +PFNGLPROGRAMPARAMETER4DNVPROC pglProgramParameter4dNV=_Lazy_glProgramParameter4dNV; +PFNGLPROGRAMPARAMETER4DVNVPROC pglProgramParameter4dvNV=_Lazy_glProgramParameter4dvNV; +PFNGLPROGRAMPARAMETER4FNVPROC pglProgramParameter4fNV=_Lazy_glProgramParameter4fNV; +PFNGLPROGRAMPARAMETER4FVNVPROC pglProgramParameter4fvNV=_Lazy_glProgramParameter4fvNV; +PFNGLPROGRAMPARAMETERS4DVNVPROC pglProgramParameters4dvNV=_Lazy_glProgramParameters4dvNV; +PFNGLPROGRAMPARAMETERS4FVNVPROC pglProgramParameters4fvNV=_Lazy_glProgramParameters4fvNV; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC pglRequestResidentProgramsNV=_Lazy_glRequestResidentProgramsNV; +PFNGLTRACKMATRIXNVPROC pglTrackMatrixNV=_Lazy_glTrackMatrixNV; +PFNGLVERTEXATTRIBPOINTERNVPROC pglVertexAttribPointerNV=_Lazy_glVertexAttribPointerNV; +PFNGLVERTEXATTRIB1DNVPROC pglVertexAttrib1dNV=_Lazy_glVertexAttrib1dNV; +PFNGLVERTEXATTRIB1DVNVPROC pglVertexAttrib1dvNV=_Lazy_glVertexAttrib1dvNV; +PFNGLVERTEXATTRIB1FNVPROC pglVertexAttrib1fNV=_Lazy_glVertexAttrib1fNV; +PFNGLVERTEXATTRIB1FVNVPROC pglVertexAttrib1fvNV=_Lazy_glVertexAttrib1fvNV; +PFNGLVERTEXATTRIB1SNVPROC pglVertexAttrib1sNV=_Lazy_glVertexAttrib1sNV; +PFNGLVERTEXATTRIB1SVNVPROC pglVertexAttrib1svNV=_Lazy_glVertexAttrib1svNV; +PFNGLVERTEXATTRIB2DNVPROC pglVertexAttrib2dNV=_Lazy_glVertexAttrib2dNV; +PFNGLVERTEXATTRIB2DVNVPROC pglVertexAttrib2dvNV=_Lazy_glVertexAttrib2dvNV; +PFNGLVERTEXATTRIB2FNVPROC pglVertexAttrib2fNV=_Lazy_glVertexAttrib2fNV; +PFNGLVERTEXATTRIB2FVNVPROC pglVertexAttrib2fvNV=_Lazy_glVertexAttrib2fvNV; +PFNGLVERTEXATTRIB2SNVPROC pglVertexAttrib2sNV=_Lazy_glVertexAttrib2sNV; +PFNGLVERTEXATTRIB2SVNVPROC pglVertexAttrib2svNV=_Lazy_glVertexAttrib2svNV; +PFNGLVERTEXATTRIB3DNVPROC pglVertexAttrib3dNV=_Lazy_glVertexAttrib3dNV; +PFNGLVERTEXATTRIB3DVNVPROC pglVertexAttrib3dvNV=_Lazy_glVertexAttrib3dvNV; +PFNGLVERTEXATTRIB3FNVPROC pglVertexAttrib3fNV=_Lazy_glVertexAttrib3fNV; +PFNGLVERTEXATTRIB3FVNVPROC pglVertexAttrib3fvNV=_Lazy_glVertexAttrib3fvNV; +PFNGLVERTEXATTRIB3SNVPROC pglVertexAttrib3sNV=_Lazy_glVertexAttrib3sNV; +PFNGLVERTEXATTRIB3SVNVPROC pglVertexAttrib3svNV=_Lazy_glVertexAttrib3svNV; +PFNGLVERTEXATTRIB4DNVPROC pglVertexAttrib4dNV=_Lazy_glVertexAttrib4dNV; +PFNGLVERTEXATTRIB4DVNVPROC pglVertexAttrib4dvNV=_Lazy_glVertexAttrib4dvNV; +PFNGLVERTEXATTRIB4FNVPROC pglVertexAttrib4fNV=_Lazy_glVertexAttrib4fNV; +PFNGLVERTEXATTRIB4FVNVPROC pglVertexAttrib4fvNV=_Lazy_glVertexAttrib4fvNV; +PFNGLVERTEXATTRIB4SNVPROC pglVertexAttrib4sNV=_Lazy_glVertexAttrib4sNV; +PFNGLVERTEXATTRIB4SVNVPROC pglVertexAttrib4svNV=_Lazy_glVertexAttrib4svNV; +PFNGLVERTEXATTRIB4UBNVPROC pglVertexAttrib4ubNV=_Lazy_glVertexAttrib4ubNV; +PFNGLVERTEXATTRIB4UBVNVPROC pglVertexAttrib4ubvNV=_Lazy_glVertexAttrib4ubvNV; +PFNGLVERTEXATTRIBS1DVNVPROC pglVertexAttribs1dvNV=_Lazy_glVertexAttribs1dvNV; +PFNGLVERTEXATTRIBS1FVNVPROC pglVertexAttribs1fvNV=_Lazy_glVertexAttribs1fvNV; +PFNGLVERTEXATTRIBS1SVNVPROC pglVertexAttribs1svNV=_Lazy_glVertexAttribs1svNV; +PFNGLVERTEXATTRIBS2DVNVPROC pglVertexAttribs2dvNV=_Lazy_glVertexAttribs2dvNV; +PFNGLVERTEXATTRIBS2FVNVPROC pglVertexAttribs2fvNV=_Lazy_glVertexAttribs2fvNV; +PFNGLVERTEXATTRIBS2SVNVPROC pglVertexAttribs2svNV=_Lazy_glVertexAttribs2svNV; +PFNGLVERTEXATTRIBS3DVNVPROC pglVertexAttribs3dvNV=_Lazy_glVertexAttribs3dvNV; +PFNGLVERTEXATTRIBS3FVNVPROC pglVertexAttribs3fvNV=_Lazy_glVertexAttribs3fvNV; +PFNGLVERTEXATTRIBS3SVNVPROC pglVertexAttribs3svNV=_Lazy_glVertexAttribs3svNV; +PFNGLVERTEXATTRIBS4DVNVPROC pglVertexAttribs4dvNV=_Lazy_glVertexAttribs4dvNV; +PFNGLVERTEXATTRIBS4FVNVPROC pglVertexAttribs4fvNV=_Lazy_glVertexAttribs4fvNV; +PFNGLVERTEXATTRIBS4SVNVPROC pglVertexAttribs4svNV=_Lazy_glVertexAttribs4svNV; +PFNGLVERTEXATTRIBS4UBVNVPROC pglVertexAttribs4ubvNV=_Lazy_glVertexAttribs4ubvNV; +#endif + +/* GL_SGIX_texture_coordinate_clamp */ + +#ifdef __GLEE_GL_SGIX_texture_coordinate_clamp +#endif + +/* GL_SGIX_scalebias_hint */ + +#ifdef __GLEE_GL_SGIX_scalebias_hint +#endif + +/* GL_OML_interlace */ + +#ifdef __GLEE_GL_OML_interlace +#endif + +/* GL_OML_subsample */ + +#ifdef __GLEE_GL_OML_subsample +#endif + +/* GL_OML_resample */ + +#ifdef __GLEE_GL_OML_resample +#endif + +/* GL_NV_copy_depth_to_color */ + +#ifdef __GLEE_GL_NV_copy_depth_to_color +#endif + +/* GL_ATI_envmap_bumpmap */ + +#ifdef __GLEE_GL_ATI_envmap_bumpmap +void __stdcall _Lazy_glTexBumpParameterivATI(GLenum pname, const GLint * param) {if (GLeeInit()) glTexBumpParameterivATI(pname, param);} +void __stdcall _Lazy_glTexBumpParameterfvATI(GLenum pname, const GLfloat * param) {if (GLeeInit()) glTexBumpParameterfvATI(pname, param);} +void __stdcall _Lazy_glGetTexBumpParameterivATI(GLenum pname, GLint * param) {if (GLeeInit()) glGetTexBumpParameterivATI(pname, param);} +void __stdcall _Lazy_glGetTexBumpParameterfvATI(GLenum pname, GLfloat * param) {if (GLeeInit()) glGetTexBumpParameterfvATI(pname, param);} +PFNGLTEXBUMPPARAMETERIVATIPROC pglTexBumpParameterivATI=_Lazy_glTexBumpParameterivATI; +PFNGLTEXBUMPPARAMETERFVATIPROC pglTexBumpParameterfvATI=_Lazy_glTexBumpParameterfvATI; +PFNGLGETTEXBUMPPARAMETERIVATIPROC pglGetTexBumpParameterivATI=_Lazy_glGetTexBumpParameterivATI; +PFNGLGETTEXBUMPPARAMETERFVATIPROC pglGetTexBumpParameterfvATI=_Lazy_glGetTexBumpParameterfvATI; +#endif + +/* GL_ATI_fragment_shader */ + +#ifdef __GLEE_GL_ATI_fragment_shader +GLuint __stdcall _Lazy_glGenFragmentShadersATI(GLuint range) {if (GLeeInit()) return glGenFragmentShadersATI(range); return (GLuint)0;} +void __stdcall _Lazy_glBindFragmentShaderATI(GLuint id) {if (GLeeInit()) glBindFragmentShaderATI(id);} +void __stdcall _Lazy_glDeleteFragmentShaderATI(GLuint id) {if (GLeeInit()) glDeleteFragmentShaderATI(id);} +void __stdcall _Lazy_glBeginFragmentShaderATI(void) {if (GLeeInit()) glBeginFragmentShaderATI();} +void __stdcall _Lazy_glEndFragmentShaderATI(void) {if (GLeeInit()) glEndFragmentShaderATI();} +void __stdcall _Lazy_glPassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle) {if (GLeeInit()) glPassTexCoordATI(dst, coord, swizzle);} +void __stdcall _Lazy_glSampleMapATI(GLuint dst, GLuint interp, GLenum swizzle) {if (GLeeInit()) glSampleMapATI(dst, interp, swizzle);} +void __stdcall _Lazy_glColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) {if (GLeeInit()) glColorFragmentOp1ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod);} +void __stdcall _Lazy_glColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) {if (GLeeInit()) glColorFragmentOp2ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod);} +void __stdcall _Lazy_glColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) {if (GLeeInit()) glColorFragmentOp3ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod);} +void __stdcall _Lazy_glAlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) {if (GLeeInit()) glAlphaFragmentOp1ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod);} +void __stdcall _Lazy_glAlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) {if (GLeeInit()) glAlphaFragmentOp2ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod);} +void __stdcall _Lazy_glAlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) {if (GLeeInit()) glAlphaFragmentOp3ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod);} +void __stdcall _Lazy_glSetFragmentShaderConstantATI(GLuint dst, const GLfloat * value) {if (GLeeInit()) glSetFragmentShaderConstantATI(dst, value);} +PFNGLGENFRAGMENTSHADERSATIPROC pglGenFragmentShadersATI=_Lazy_glGenFragmentShadersATI; +PFNGLBINDFRAGMENTSHADERATIPROC pglBindFragmentShaderATI=_Lazy_glBindFragmentShaderATI; +PFNGLDELETEFRAGMENTSHADERATIPROC pglDeleteFragmentShaderATI=_Lazy_glDeleteFragmentShaderATI; +PFNGLBEGINFRAGMENTSHADERATIPROC pglBeginFragmentShaderATI=_Lazy_glBeginFragmentShaderATI; +PFNGLENDFRAGMENTSHADERATIPROC pglEndFragmentShaderATI=_Lazy_glEndFragmentShaderATI; +PFNGLPASSTEXCOORDATIPROC pglPassTexCoordATI=_Lazy_glPassTexCoordATI; +PFNGLSAMPLEMAPATIPROC pglSampleMapATI=_Lazy_glSampleMapATI; +PFNGLCOLORFRAGMENTOP1ATIPROC pglColorFragmentOp1ATI=_Lazy_glColorFragmentOp1ATI; +PFNGLCOLORFRAGMENTOP2ATIPROC pglColorFragmentOp2ATI=_Lazy_glColorFragmentOp2ATI; +PFNGLCOLORFRAGMENTOP3ATIPROC pglColorFragmentOp3ATI=_Lazy_glColorFragmentOp3ATI; +PFNGLALPHAFRAGMENTOP1ATIPROC pglAlphaFragmentOp1ATI=_Lazy_glAlphaFragmentOp1ATI; +PFNGLALPHAFRAGMENTOP2ATIPROC pglAlphaFragmentOp2ATI=_Lazy_glAlphaFragmentOp2ATI; +PFNGLALPHAFRAGMENTOP3ATIPROC pglAlphaFragmentOp3ATI=_Lazy_glAlphaFragmentOp3ATI; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC pglSetFragmentShaderConstantATI=_Lazy_glSetFragmentShaderConstantATI; +#endif + +/* GL_ATI_pn_triangles */ + +#ifdef __GLEE_GL_ATI_pn_triangles +void __stdcall _Lazy_glPNTrianglesiATI(GLenum pname, GLint param) {if (GLeeInit()) glPNTrianglesiATI(pname, param);} +void __stdcall _Lazy_glPNTrianglesfATI(GLenum pname, GLfloat param) {if (GLeeInit()) glPNTrianglesfATI(pname, param);} +PFNGLPNTRIANGLESIATIPROC pglPNTrianglesiATI=_Lazy_glPNTrianglesiATI; +PFNGLPNTRIANGLESFATIPROC pglPNTrianglesfATI=_Lazy_glPNTrianglesfATI; +#endif + +/* GL_ATI_vertex_array_object */ + +#ifdef __GLEE_GL_ATI_vertex_array_object +GLuint __stdcall _Lazy_glNewObjectBufferATI(GLsizei size, const GLvoid * pointer, GLenum usage) {if (GLeeInit()) return glNewObjectBufferATI(size, pointer, usage); return (GLuint)0;} +GLboolean __stdcall _Lazy_glIsObjectBufferATI(GLuint buffer) {if (GLeeInit()) return glIsObjectBufferATI(buffer); return (GLboolean)0;} +void __stdcall _Lazy_glUpdateObjectBufferATI(GLuint buffer, GLuint offset, GLsizei size, const GLvoid * pointer, GLenum preserve) {if (GLeeInit()) glUpdateObjectBufferATI(buffer, offset, size, pointer, preserve);} +void __stdcall _Lazy_glGetObjectBufferfvATI(GLuint buffer, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetObjectBufferfvATI(buffer, pname, params);} +void __stdcall _Lazy_glGetObjectBufferivATI(GLuint buffer, GLenum pname, GLint * params) {if (GLeeInit()) glGetObjectBufferivATI(buffer, pname, params);} +void __stdcall _Lazy_glFreeObjectBufferATI(GLuint buffer) {if (GLeeInit()) glFreeObjectBufferATI(buffer);} +void __stdcall _Lazy_glArrayObjectATI(GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) {if (GLeeInit()) glArrayObjectATI(array, size, type, stride, buffer, offset);} +void __stdcall _Lazy_glGetArrayObjectfvATI(GLenum array, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetArrayObjectfvATI(array, pname, params);} +void __stdcall _Lazy_glGetArrayObjectivATI(GLenum array, GLenum pname, GLint * params) {if (GLeeInit()) glGetArrayObjectivATI(array, pname, params);} +void __stdcall _Lazy_glVariantArrayObjectATI(GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) {if (GLeeInit()) glVariantArrayObjectATI(id, type, stride, buffer, offset);} +void __stdcall _Lazy_glGetVariantArrayObjectfvATI(GLuint id, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVariantArrayObjectfvATI(id, pname, params);} +void __stdcall _Lazy_glGetVariantArrayObjectivATI(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetVariantArrayObjectivATI(id, pname, params);} +PFNGLNEWOBJECTBUFFERATIPROC pglNewObjectBufferATI=_Lazy_glNewObjectBufferATI; +PFNGLISOBJECTBUFFERATIPROC pglIsObjectBufferATI=_Lazy_glIsObjectBufferATI; +PFNGLUPDATEOBJECTBUFFERATIPROC pglUpdateObjectBufferATI=_Lazy_glUpdateObjectBufferATI; +PFNGLGETOBJECTBUFFERFVATIPROC pglGetObjectBufferfvATI=_Lazy_glGetObjectBufferfvATI; +PFNGLGETOBJECTBUFFERIVATIPROC pglGetObjectBufferivATI=_Lazy_glGetObjectBufferivATI; +PFNGLFREEOBJECTBUFFERATIPROC pglFreeObjectBufferATI=_Lazy_glFreeObjectBufferATI; +PFNGLARRAYOBJECTATIPROC pglArrayObjectATI=_Lazy_glArrayObjectATI; +PFNGLGETARRAYOBJECTFVATIPROC pglGetArrayObjectfvATI=_Lazy_glGetArrayObjectfvATI; +PFNGLGETARRAYOBJECTIVATIPROC pglGetArrayObjectivATI=_Lazy_glGetArrayObjectivATI; +PFNGLVARIANTARRAYOBJECTATIPROC pglVariantArrayObjectATI=_Lazy_glVariantArrayObjectATI; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC pglGetVariantArrayObjectfvATI=_Lazy_glGetVariantArrayObjectfvATI; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC pglGetVariantArrayObjectivATI=_Lazy_glGetVariantArrayObjectivATI; +#endif + +/* GL_EXT_vertex_shader */ + +#ifdef __GLEE_GL_EXT_vertex_shader +void __stdcall _Lazy_glBeginVertexShaderEXT(void) {if (GLeeInit()) glBeginVertexShaderEXT();} +void __stdcall _Lazy_glEndVertexShaderEXT(void) {if (GLeeInit()) glEndVertexShaderEXT();} +void __stdcall _Lazy_glBindVertexShaderEXT(GLuint id) {if (GLeeInit()) glBindVertexShaderEXT(id);} +GLuint __stdcall _Lazy_glGenVertexShadersEXT(GLuint range) {if (GLeeInit()) return glGenVertexShadersEXT(range); return (GLuint)0;} +void __stdcall _Lazy_glDeleteVertexShaderEXT(GLuint id) {if (GLeeInit()) glDeleteVertexShaderEXT(id);} +void __stdcall _Lazy_glShaderOp1EXT(GLenum op, GLuint res, GLuint arg1) {if (GLeeInit()) glShaderOp1EXT(op, res, arg1);} +void __stdcall _Lazy_glShaderOp2EXT(GLenum op, GLuint res, GLuint arg1, GLuint arg2) {if (GLeeInit()) glShaderOp2EXT(op, res, arg1, arg2);} +void __stdcall _Lazy_glShaderOp3EXT(GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3) {if (GLeeInit()) glShaderOp3EXT(op, res, arg1, arg2, arg3);} +void __stdcall _Lazy_glSwizzleEXT(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) {if (GLeeInit()) glSwizzleEXT(res, in, outX, outY, outZ, outW);} +void __stdcall _Lazy_glWriteMaskEXT(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) {if (GLeeInit()) glWriteMaskEXT(res, in, outX, outY, outZ, outW);} +void __stdcall _Lazy_glInsertComponentEXT(GLuint res, GLuint src, GLuint num) {if (GLeeInit()) glInsertComponentEXT(res, src, num);} +void __stdcall _Lazy_glExtractComponentEXT(GLuint res, GLuint src, GLuint num) {if (GLeeInit()) glExtractComponentEXT(res, src, num);} +GLuint __stdcall _Lazy_glGenSymbolsEXT(GLenum datatype, GLenum storagetype, GLenum range, GLuint components) {if (GLeeInit()) return glGenSymbolsEXT(datatype, storagetype, range, components); return (GLuint)0;} +void __stdcall _Lazy_glSetInvariantEXT(GLuint id, GLenum type, const GLvoid * addr) {if (GLeeInit()) glSetInvariantEXT(id, type, addr);} +void __stdcall _Lazy_glSetLocalConstantEXT(GLuint id, GLenum type, const GLvoid * addr) {if (GLeeInit()) glSetLocalConstantEXT(id, type, addr);} +void __stdcall _Lazy_glVariantbvEXT(GLuint id, const GLbyte * addr) {if (GLeeInit()) glVariantbvEXT(id, addr);} +void __stdcall _Lazy_glVariantsvEXT(GLuint id, const GLshort * addr) {if (GLeeInit()) glVariantsvEXT(id, addr);} +void __stdcall _Lazy_glVariantivEXT(GLuint id, const GLint * addr) {if (GLeeInit()) glVariantivEXT(id, addr);} +void __stdcall _Lazy_glVariantfvEXT(GLuint id, const GLfloat * addr) {if (GLeeInit()) glVariantfvEXT(id, addr);} +void __stdcall _Lazy_glVariantdvEXT(GLuint id, const GLdouble * addr) {if (GLeeInit()) glVariantdvEXT(id, addr);} +void __stdcall _Lazy_glVariantubvEXT(GLuint id, const GLubyte * addr) {if (GLeeInit()) glVariantubvEXT(id, addr);} +void __stdcall _Lazy_glVariantusvEXT(GLuint id, const GLushort * addr) {if (GLeeInit()) glVariantusvEXT(id, addr);} +void __stdcall _Lazy_glVariantuivEXT(GLuint id, const GLuint * addr) {if (GLeeInit()) glVariantuivEXT(id, addr);} +void __stdcall _Lazy_glVariantPointerEXT(GLuint id, GLenum type, GLuint stride, const GLvoid * addr) {if (GLeeInit()) glVariantPointerEXT(id, type, stride, addr);} +void __stdcall _Lazy_glEnableVariantClientStateEXT(GLuint id) {if (GLeeInit()) glEnableVariantClientStateEXT(id);} +void __stdcall _Lazy_glDisableVariantClientStateEXT(GLuint id) {if (GLeeInit()) glDisableVariantClientStateEXT(id);} +GLuint __stdcall _Lazy_glBindLightParameterEXT(GLenum light, GLenum value) {if (GLeeInit()) return glBindLightParameterEXT(light, value); return (GLuint)0;} +GLuint __stdcall _Lazy_glBindMaterialParameterEXT(GLenum face, GLenum value) {if (GLeeInit()) return glBindMaterialParameterEXT(face, value); return (GLuint)0;} +GLuint __stdcall _Lazy_glBindTexGenParameterEXT(GLenum unit, GLenum coord, GLenum value) {if (GLeeInit()) return glBindTexGenParameterEXT(unit, coord, value); return (GLuint)0;} +GLuint __stdcall _Lazy_glBindTextureUnitParameterEXT(GLenum unit, GLenum value) {if (GLeeInit()) return glBindTextureUnitParameterEXT(unit, value); return (GLuint)0;} +GLuint __stdcall _Lazy_glBindParameterEXT(GLenum value) {if (GLeeInit()) return glBindParameterEXT(value); return (GLuint)0;} +GLboolean __stdcall _Lazy_glIsVariantEnabledEXT(GLuint id, GLenum cap) {if (GLeeInit()) return glIsVariantEnabledEXT(id, cap); return (GLboolean)0;} +void __stdcall _Lazy_glGetVariantBooleanvEXT(GLuint id, GLenum value, GLboolean * data) {if (GLeeInit()) glGetVariantBooleanvEXT(id, value, data);} +void __stdcall _Lazy_glGetVariantIntegervEXT(GLuint id, GLenum value, GLint * data) {if (GLeeInit()) glGetVariantIntegervEXT(id, value, data);} +void __stdcall _Lazy_glGetVariantFloatvEXT(GLuint id, GLenum value, GLfloat * data) {if (GLeeInit()) glGetVariantFloatvEXT(id, value, data);} +void __stdcall _Lazy_glGetVariantPointervEXT(GLuint id, GLenum value, GLvoid* * data) {if (GLeeInit()) glGetVariantPointervEXT(id, value, data);} +void __stdcall _Lazy_glGetInvariantBooleanvEXT(GLuint id, GLenum value, GLboolean * data) {if (GLeeInit()) glGetInvariantBooleanvEXT(id, value, data);} +void __stdcall _Lazy_glGetInvariantIntegervEXT(GLuint id, GLenum value, GLint * data) {if (GLeeInit()) glGetInvariantIntegervEXT(id, value, data);} +void __stdcall _Lazy_glGetInvariantFloatvEXT(GLuint id, GLenum value, GLfloat * data) {if (GLeeInit()) glGetInvariantFloatvEXT(id, value, data);} +void __stdcall _Lazy_glGetLocalConstantBooleanvEXT(GLuint id, GLenum value, GLboolean * data) {if (GLeeInit()) glGetLocalConstantBooleanvEXT(id, value, data);} +void __stdcall _Lazy_glGetLocalConstantIntegervEXT(GLuint id, GLenum value, GLint * data) {if (GLeeInit()) glGetLocalConstantIntegervEXT(id, value, data);} +void __stdcall _Lazy_glGetLocalConstantFloatvEXT(GLuint id, GLenum value, GLfloat * data) {if (GLeeInit()) glGetLocalConstantFloatvEXT(id, value, data);} +PFNGLBEGINVERTEXSHADEREXTPROC pglBeginVertexShaderEXT=_Lazy_glBeginVertexShaderEXT; +PFNGLENDVERTEXSHADEREXTPROC pglEndVertexShaderEXT=_Lazy_glEndVertexShaderEXT; +PFNGLBINDVERTEXSHADEREXTPROC pglBindVertexShaderEXT=_Lazy_glBindVertexShaderEXT; +PFNGLGENVERTEXSHADERSEXTPROC pglGenVertexShadersEXT=_Lazy_glGenVertexShadersEXT; +PFNGLDELETEVERTEXSHADEREXTPROC pglDeleteVertexShaderEXT=_Lazy_glDeleteVertexShaderEXT; +PFNGLSHADEROP1EXTPROC pglShaderOp1EXT=_Lazy_glShaderOp1EXT; +PFNGLSHADEROP2EXTPROC pglShaderOp2EXT=_Lazy_glShaderOp2EXT; +PFNGLSHADEROP3EXTPROC pglShaderOp3EXT=_Lazy_glShaderOp3EXT; +PFNGLSWIZZLEEXTPROC pglSwizzleEXT=_Lazy_glSwizzleEXT; +PFNGLWRITEMASKEXTPROC pglWriteMaskEXT=_Lazy_glWriteMaskEXT; +PFNGLINSERTCOMPONENTEXTPROC pglInsertComponentEXT=_Lazy_glInsertComponentEXT; +PFNGLEXTRACTCOMPONENTEXTPROC pglExtractComponentEXT=_Lazy_glExtractComponentEXT; +PFNGLGENSYMBOLSEXTPROC pglGenSymbolsEXT=_Lazy_glGenSymbolsEXT; +PFNGLSETINVARIANTEXTPROC pglSetInvariantEXT=_Lazy_glSetInvariantEXT; +PFNGLSETLOCALCONSTANTEXTPROC pglSetLocalConstantEXT=_Lazy_glSetLocalConstantEXT; +PFNGLVARIANTBVEXTPROC pglVariantbvEXT=_Lazy_glVariantbvEXT; +PFNGLVARIANTSVEXTPROC pglVariantsvEXT=_Lazy_glVariantsvEXT; +PFNGLVARIANTIVEXTPROC pglVariantivEXT=_Lazy_glVariantivEXT; +PFNGLVARIANTFVEXTPROC pglVariantfvEXT=_Lazy_glVariantfvEXT; +PFNGLVARIANTDVEXTPROC pglVariantdvEXT=_Lazy_glVariantdvEXT; +PFNGLVARIANTUBVEXTPROC pglVariantubvEXT=_Lazy_glVariantubvEXT; +PFNGLVARIANTUSVEXTPROC pglVariantusvEXT=_Lazy_glVariantusvEXT; +PFNGLVARIANTUIVEXTPROC pglVariantuivEXT=_Lazy_glVariantuivEXT; +PFNGLVARIANTPOINTEREXTPROC pglVariantPointerEXT=_Lazy_glVariantPointerEXT; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC pglEnableVariantClientStateEXT=_Lazy_glEnableVariantClientStateEXT; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC pglDisableVariantClientStateEXT=_Lazy_glDisableVariantClientStateEXT; +PFNGLBINDLIGHTPARAMETEREXTPROC pglBindLightParameterEXT=_Lazy_glBindLightParameterEXT; +PFNGLBINDMATERIALPARAMETEREXTPROC pglBindMaterialParameterEXT=_Lazy_glBindMaterialParameterEXT; +PFNGLBINDTEXGENPARAMETEREXTPROC pglBindTexGenParameterEXT=_Lazy_glBindTexGenParameterEXT; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC pglBindTextureUnitParameterEXT=_Lazy_glBindTextureUnitParameterEXT; +PFNGLBINDPARAMETEREXTPROC pglBindParameterEXT=_Lazy_glBindParameterEXT; +PFNGLISVARIANTENABLEDEXTPROC pglIsVariantEnabledEXT=_Lazy_glIsVariantEnabledEXT; +PFNGLGETVARIANTBOOLEANVEXTPROC pglGetVariantBooleanvEXT=_Lazy_glGetVariantBooleanvEXT; +PFNGLGETVARIANTINTEGERVEXTPROC pglGetVariantIntegervEXT=_Lazy_glGetVariantIntegervEXT; +PFNGLGETVARIANTFLOATVEXTPROC pglGetVariantFloatvEXT=_Lazy_glGetVariantFloatvEXT; +PFNGLGETVARIANTPOINTERVEXTPROC pglGetVariantPointervEXT=_Lazy_glGetVariantPointervEXT; +PFNGLGETINVARIANTBOOLEANVEXTPROC pglGetInvariantBooleanvEXT=_Lazy_glGetInvariantBooleanvEXT; +PFNGLGETINVARIANTINTEGERVEXTPROC pglGetInvariantIntegervEXT=_Lazy_glGetInvariantIntegervEXT; +PFNGLGETINVARIANTFLOATVEXTPROC pglGetInvariantFloatvEXT=_Lazy_glGetInvariantFloatvEXT; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC pglGetLocalConstantBooleanvEXT=_Lazy_glGetLocalConstantBooleanvEXT; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC pglGetLocalConstantIntegervEXT=_Lazy_glGetLocalConstantIntegervEXT; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC pglGetLocalConstantFloatvEXT=_Lazy_glGetLocalConstantFloatvEXT; +#endif + +/* GL_ATI_vertex_streams */ + +#ifdef __GLEE_GL_ATI_vertex_streams +void __stdcall _Lazy_glVertexStream1sATI(GLenum stream, GLshort x) {if (GLeeInit()) glVertexStream1sATI(stream, x);} +void __stdcall _Lazy_glVertexStream1svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glVertexStream1svATI(stream, coords);} +void __stdcall _Lazy_glVertexStream1iATI(GLenum stream, GLint x) {if (GLeeInit()) glVertexStream1iATI(stream, x);} +void __stdcall _Lazy_glVertexStream1ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glVertexStream1ivATI(stream, coords);} +void __stdcall _Lazy_glVertexStream1fATI(GLenum stream, GLfloat x) {if (GLeeInit()) glVertexStream1fATI(stream, x);} +void __stdcall _Lazy_glVertexStream1fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glVertexStream1fvATI(stream, coords);} +void __stdcall _Lazy_glVertexStream1dATI(GLenum stream, GLdouble x) {if (GLeeInit()) glVertexStream1dATI(stream, x);} +void __stdcall _Lazy_glVertexStream1dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glVertexStream1dvATI(stream, coords);} +void __stdcall _Lazy_glVertexStream2sATI(GLenum stream, GLshort x, GLshort y) {if (GLeeInit()) glVertexStream2sATI(stream, x, y);} +void __stdcall _Lazy_glVertexStream2svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glVertexStream2svATI(stream, coords);} +void __stdcall _Lazy_glVertexStream2iATI(GLenum stream, GLint x, GLint y) {if (GLeeInit()) glVertexStream2iATI(stream, x, y);} +void __stdcall _Lazy_glVertexStream2ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glVertexStream2ivATI(stream, coords);} +void __stdcall _Lazy_glVertexStream2fATI(GLenum stream, GLfloat x, GLfloat y) {if (GLeeInit()) glVertexStream2fATI(stream, x, y);} +void __stdcall _Lazy_glVertexStream2fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glVertexStream2fvATI(stream, coords);} +void __stdcall _Lazy_glVertexStream2dATI(GLenum stream, GLdouble x, GLdouble y) {if (GLeeInit()) glVertexStream2dATI(stream, x, y);} +void __stdcall _Lazy_glVertexStream2dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glVertexStream2dvATI(stream, coords);} +void __stdcall _Lazy_glVertexStream3sATI(GLenum stream, GLshort x, GLshort y, GLshort z) {if (GLeeInit()) glVertexStream3sATI(stream, x, y, z);} +void __stdcall _Lazy_glVertexStream3svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glVertexStream3svATI(stream, coords);} +void __stdcall _Lazy_glVertexStream3iATI(GLenum stream, GLint x, GLint y, GLint z) {if (GLeeInit()) glVertexStream3iATI(stream, x, y, z);} +void __stdcall _Lazy_glVertexStream3ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glVertexStream3ivATI(stream, coords);} +void __stdcall _Lazy_glVertexStream3fATI(GLenum stream, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glVertexStream3fATI(stream, x, y, z);} +void __stdcall _Lazy_glVertexStream3fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glVertexStream3fvATI(stream, coords);} +void __stdcall _Lazy_glVertexStream3dATI(GLenum stream, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glVertexStream3dATI(stream, x, y, z);} +void __stdcall _Lazy_glVertexStream3dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glVertexStream3dvATI(stream, coords);} +void __stdcall _Lazy_glVertexStream4sATI(GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w) {if (GLeeInit()) glVertexStream4sATI(stream, x, y, z, w);} +void __stdcall _Lazy_glVertexStream4svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glVertexStream4svATI(stream, coords);} +void __stdcall _Lazy_glVertexStream4iATI(GLenum stream, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glVertexStream4iATI(stream, x, y, z, w);} +void __stdcall _Lazy_glVertexStream4ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glVertexStream4ivATI(stream, coords);} +void __stdcall _Lazy_glVertexStream4fATI(GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glVertexStream4fATI(stream, x, y, z, w);} +void __stdcall _Lazy_glVertexStream4fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glVertexStream4fvATI(stream, coords);} +void __stdcall _Lazy_glVertexStream4dATI(GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glVertexStream4dATI(stream, x, y, z, w);} +void __stdcall _Lazy_glVertexStream4dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glVertexStream4dvATI(stream, coords);} +void __stdcall _Lazy_glNormalStream3bATI(GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz) {if (GLeeInit()) glNormalStream3bATI(stream, nx, ny, nz);} +void __stdcall _Lazy_glNormalStream3bvATI(GLenum stream, const GLbyte * coords) {if (GLeeInit()) glNormalStream3bvATI(stream, coords);} +void __stdcall _Lazy_glNormalStream3sATI(GLenum stream, GLshort nx, GLshort ny, GLshort nz) {if (GLeeInit()) glNormalStream3sATI(stream, nx, ny, nz);} +void __stdcall _Lazy_glNormalStream3svATI(GLenum stream, const GLshort * coords) {if (GLeeInit()) glNormalStream3svATI(stream, coords);} +void __stdcall _Lazy_glNormalStream3iATI(GLenum stream, GLint nx, GLint ny, GLint nz) {if (GLeeInit()) glNormalStream3iATI(stream, nx, ny, nz);} +void __stdcall _Lazy_glNormalStream3ivATI(GLenum stream, const GLint * coords) {if (GLeeInit()) glNormalStream3ivATI(stream, coords);} +void __stdcall _Lazy_glNormalStream3fATI(GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz) {if (GLeeInit()) glNormalStream3fATI(stream, nx, ny, nz);} +void __stdcall _Lazy_glNormalStream3fvATI(GLenum stream, const GLfloat * coords) {if (GLeeInit()) glNormalStream3fvATI(stream, coords);} +void __stdcall _Lazy_glNormalStream3dATI(GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz) {if (GLeeInit()) glNormalStream3dATI(stream, nx, ny, nz);} +void __stdcall _Lazy_glNormalStream3dvATI(GLenum stream, const GLdouble * coords) {if (GLeeInit()) glNormalStream3dvATI(stream, coords);} +void __stdcall _Lazy_glClientActiveVertexStreamATI(GLenum stream) {if (GLeeInit()) glClientActiveVertexStreamATI(stream);} +void __stdcall _Lazy_glVertexBlendEnviATI(GLenum pname, GLint param) {if (GLeeInit()) glVertexBlendEnviATI(pname, param);} +void __stdcall _Lazy_glVertexBlendEnvfATI(GLenum pname, GLfloat param) {if (GLeeInit()) glVertexBlendEnvfATI(pname, param);} +PFNGLVERTEXSTREAM1SATIPROC pglVertexStream1sATI=_Lazy_glVertexStream1sATI; +PFNGLVERTEXSTREAM1SVATIPROC pglVertexStream1svATI=_Lazy_glVertexStream1svATI; +PFNGLVERTEXSTREAM1IATIPROC pglVertexStream1iATI=_Lazy_glVertexStream1iATI; +PFNGLVERTEXSTREAM1IVATIPROC pglVertexStream1ivATI=_Lazy_glVertexStream1ivATI; +PFNGLVERTEXSTREAM1FATIPROC pglVertexStream1fATI=_Lazy_glVertexStream1fATI; +PFNGLVERTEXSTREAM1FVATIPROC pglVertexStream1fvATI=_Lazy_glVertexStream1fvATI; +PFNGLVERTEXSTREAM1DATIPROC pglVertexStream1dATI=_Lazy_glVertexStream1dATI; +PFNGLVERTEXSTREAM1DVATIPROC pglVertexStream1dvATI=_Lazy_glVertexStream1dvATI; +PFNGLVERTEXSTREAM2SATIPROC pglVertexStream2sATI=_Lazy_glVertexStream2sATI; +PFNGLVERTEXSTREAM2SVATIPROC pglVertexStream2svATI=_Lazy_glVertexStream2svATI; +PFNGLVERTEXSTREAM2IATIPROC pglVertexStream2iATI=_Lazy_glVertexStream2iATI; +PFNGLVERTEXSTREAM2IVATIPROC pglVertexStream2ivATI=_Lazy_glVertexStream2ivATI; +PFNGLVERTEXSTREAM2FATIPROC pglVertexStream2fATI=_Lazy_glVertexStream2fATI; +PFNGLVERTEXSTREAM2FVATIPROC pglVertexStream2fvATI=_Lazy_glVertexStream2fvATI; +PFNGLVERTEXSTREAM2DATIPROC pglVertexStream2dATI=_Lazy_glVertexStream2dATI; +PFNGLVERTEXSTREAM2DVATIPROC pglVertexStream2dvATI=_Lazy_glVertexStream2dvATI; +PFNGLVERTEXSTREAM3SATIPROC pglVertexStream3sATI=_Lazy_glVertexStream3sATI; +PFNGLVERTEXSTREAM3SVATIPROC pglVertexStream3svATI=_Lazy_glVertexStream3svATI; +PFNGLVERTEXSTREAM3IATIPROC pglVertexStream3iATI=_Lazy_glVertexStream3iATI; +PFNGLVERTEXSTREAM3IVATIPROC pglVertexStream3ivATI=_Lazy_glVertexStream3ivATI; +PFNGLVERTEXSTREAM3FATIPROC pglVertexStream3fATI=_Lazy_glVertexStream3fATI; +PFNGLVERTEXSTREAM3FVATIPROC pglVertexStream3fvATI=_Lazy_glVertexStream3fvATI; +PFNGLVERTEXSTREAM3DATIPROC pglVertexStream3dATI=_Lazy_glVertexStream3dATI; +PFNGLVERTEXSTREAM3DVATIPROC pglVertexStream3dvATI=_Lazy_glVertexStream3dvATI; +PFNGLVERTEXSTREAM4SATIPROC pglVertexStream4sATI=_Lazy_glVertexStream4sATI; +PFNGLVERTEXSTREAM4SVATIPROC pglVertexStream4svATI=_Lazy_glVertexStream4svATI; +PFNGLVERTEXSTREAM4IATIPROC pglVertexStream4iATI=_Lazy_glVertexStream4iATI; +PFNGLVERTEXSTREAM4IVATIPROC pglVertexStream4ivATI=_Lazy_glVertexStream4ivATI; +PFNGLVERTEXSTREAM4FATIPROC pglVertexStream4fATI=_Lazy_glVertexStream4fATI; +PFNGLVERTEXSTREAM4FVATIPROC pglVertexStream4fvATI=_Lazy_glVertexStream4fvATI; +PFNGLVERTEXSTREAM4DATIPROC pglVertexStream4dATI=_Lazy_glVertexStream4dATI; +PFNGLVERTEXSTREAM4DVATIPROC pglVertexStream4dvATI=_Lazy_glVertexStream4dvATI; +PFNGLNORMALSTREAM3BATIPROC pglNormalStream3bATI=_Lazy_glNormalStream3bATI; +PFNGLNORMALSTREAM3BVATIPROC pglNormalStream3bvATI=_Lazy_glNormalStream3bvATI; +PFNGLNORMALSTREAM3SATIPROC pglNormalStream3sATI=_Lazy_glNormalStream3sATI; +PFNGLNORMALSTREAM3SVATIPROC pglNormalStream3svATI=_Lazy_glNormalStream3svATI; +PFNGLNORMALSTREAM3IATIPROC pglNormalStream3iATI=_Lazy_glNormalStream3iATI; +PFNGLNORMALSTREAM3IVATIPROC pglNormalStream3ivATI=_Lazy_glNormalStream3ivATI; +PFNGLNORMALSTREAM3FATIPROC pglNormalStream3fATI=_Lazy_glNormalStream3fATI; +PFNGLNORMALSTREAM3FVATIPROC pglNormalStream3fvATI=_Lazy_glNormalStream3fvATI; +PFNGLNORMALSTREAM3DATIPROC pglNormalStream3dATI=_Lazy_glNormalStream3dATI; +PFNGLNORMALSTREAM3DVATIPROC pglNormalStream3dvATI=_Lazy_glNormalStream3dvATI; +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC pglClientActiveVertexStreamATI=_Lazy_glClientActiveVertexStreamATI; +PFNGLVERTEXBLENDENVIATIPROC pglVertexBlendEnviATI=_Lazy_glVertexBlendEnviATI; +PFNGLVERTEXBLENDENVFATIPROC pglVertexBlendEnvfATI=_Lazy_glVertexBlendEnvfATI; +#endif + +/* GL_ATI_element_array */ + +#ifdef __GLEE_GL_ATI_element_array +void __stdcall _Lazy_glElementPointerATI(GLenum type, const GLvoid * pointer) {if (GLeeInit()) glElementPointerATI(type, pointer);} +void __stdcall _Lazy_glDrawElementArrayATI(GLenum mode, GLsizei count) {if (GLeeInit()) glDrawElementArrayATI(mode, count);} +void __stdcall _Lazy_glDrawRangeElementArrayATI(GLenum mode, GLuint start, GLuint end, GLsizei count) {if (GLeeInit()) glDrawRangeElementArrayATI(mode, start, end, count);} +PFNGLELEMENTPOINTERATIPROC pglElementPointerATI=_Lazy_glElementPointerATI; +PFNGLDRAWELEMENTARRAYATIPROC pglDrawElementArrayATI=_Lazy_glDrawElementArrayATI; +PFNGLDRAWRANGEELEMENTARRAYATIPROC pglDrawRangeElementArrayATI=_Lazy_glDrawRangeElementArrayATI; +#endif + +/* GL_SUN_mesh_array */ + +#ifdef __GLEE_GL_SUN_mesh_array +void __stdcall _Lazy_glDrawMeshArraysSUN(GLenum mode, GLint first, GLsizei count, GLsizei width) {if (GLeeInit()) glDrawMeshArraysSUN(mode, first, count, width);} +PFNGLDRAWMESHARRAYSSUNPROC pglDrawMeshArraysSUN=_Lazy_glDrawMeshArraysSUN; +#endif + +/* GL_SUN_slice_accum */ + +#ifdef __GLEE_GL_SUN_slice_accum +#endif + +/* GL_NV_multisample_filter_hint */ + +#ifdef __GLEE_GL_NV_multisample_filter_hint +#endif + +/* GL_NV_depth_clamp */ + +#ifdef __GLEE_GL_NV_depth_clamp +#endif + +/* GL_NV_occlusion_query */ + +#ifdef __GLEE_GL_NV_occlusion_query +void __stdcall _Lazy_glGenOcclusionQueriesNV(GLsizei n, GLuint * ids) {if (GLeeInit()) glGenOcclusionQueriesNV(n, ids);} +void __stdcall _Lazy_glDeleteOcclusionQueriesNV(GLsizei n, const GLuint * ids) {if (GLeeInit()) glDeleteOcclusionQueriesNV(n, ids);} +GLboolean __stdcall _Lazy_glIsOcclusionQueryNV(GLuint id) {if (GLeeInit()) return glIsOcclusionQueryNV(id); return (GLboolean)0;} +void __stdcall _Lazy_glBeginOcclusionQueryNV(GLuint id) {if (GLeeInit()) glBeginOcclusionQueryNV(id);} +void __stdcall _Lazy_glEndOcclusionQueryNV(void) {if (GLeeInit()) glEndOcclusionQueryNV();} +void __stdcall _Lazy_glGetOcclusionQueryivNV(GLuint id, GLenum pname, GLint * params) {if (GLeeInit()) glGetOcclusionQueryivNV(id, pname, params);} +void __stdcall _Lazy_glGetOcclusionQueryuivNV(GLuint id, GLenum pname, GLuint * params) {if (GLeeInit()) glGetOcclusionQueryuivNV(id, pname, params);} +PFNGLGENOCCLUSIONQUERIESNVPROC pglGenOcclusionQueriesNV=_Lazy_glGenOcclusionQueriesNV; +PFNGLDELETEOCCLUSIONQUERIESNVPROC pglDeleteOcclusionQueriesNV=_Lazy_glDeleteOcclusionQueriesNV; +PFNGLISOCCLUSIONQUERYNVPROC pglIsOcclusionQueryNV=_Lazy_glIsOcclusionQueryNV; +PFNGLBEGINOCCLUSIONQUERYNVPROC pglBeginOcclusionQueryNV=_Lazy_glBeginOcclusionQueryNV; +PFNGLENDOCCLUSIONQUERYNVPROC pglEndOcclusionQueryNV=_Lazy_glEndOcclusionQueryNV; +PFNGLGETOCCLUSIONQUERYIVNVPROC pglGetOcclusionQueryivNV=_Lazy_glGetOcclusionQueryivNV; +PFNGLGETOCCLUSIONQUERYUIVNVPROC pglGetOcclusionQueryuivNV=_Lazy_glGetOcclusionQueryuivNV; +#endif + +/* GL_NV_point_sprite */ + +#ifdef __GLEE_GL_NV_point_sprite +void __stdcall _Lazy_glPointParameteriNV(GLenum pname, GLint param) {if (GLeeInit()) glPointParameteriNV(pname, param);} +void __stdcall _Lazy_glPointParameterivNV(GLenum pname, const GLint * params) {if (GLeeInit()) glPointParameterivNV(pname, params);} +PFNGLPOINTPARAMETERINVPROC pglPointParameteriNV=_Lazy_glPointParameteriNV; +PFNGLPOINTPARAMETERIVNVPROC pglPointParameterivNV=_Lazy_glPointParameterivNV; +#endif + +/* GL_NV_texture_shader3 */ + +#ifdef __GLEE_GL_NV_texture_shader3 +#endif + +/* GL_NV_vertex_program1_1 */ + +#ifdef __GLEE_GL_NV_vertex_program1_1 +#endif + +/* GL_EXT_shadow_funcs */ + +#ifdef __GLEE_GL_EXT_shadow_funcs +#endif + +/* GL_EXT_stencil_two_side */ + +#ifdef __GLEE_GL_EXT_stencil_two_side +void __stdcall _Lazy_glActiveStencilFaceEXT(GLenum face) {if (GLeeInit()) glActiveStencilFaceEXT(face);} +PFNGLACTIVESTENCILFACEEXTPROC pglActiveStencilFaceEXT=_Lazy_glActiveStencilFaceEXT; +#endif + +/* GL_ATI_text_fragment_shader */ + +#ifdef __GLEE_GL_ATI_text_fragment_shader +#endif + +/* GL_APPLE_client_storage */ + +#ifdef __GLEE_GL_APPLE_client_storage +#endif + +/* GL_APPLE_element_array */ + +#ifdef __GLEE_GL_APPLE_element_array +void __stdcall _Lazy_glElementPointerAPPLE(GLenum type, const GLvoid * pointer) {if (GLeeInit()) glElementPointerAPPLE(type, pointer);} +void __stdcall _Lazy_glDrawElementArrayAPPLE(GLenum mode, GLint first, GLsizei count) {if (GLeeInit()) glDrawElementArrayAPPLE(mode, first, count);} +void __stdcall _Lazy_glDrawRangeElementArrayAPPLE(GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count) {if (GLeeInit()) glDrawRangeElementArrayAPPLE(mode, start, end, first, count);} +void __stdcall _Lazy_glMultiDrawElementArrayAPPLE(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount) {if (GLeeInit()) glMultiDrawElementArrayAPPLE(mode, first, count, primcount);} +void __stdcall _Lazy_glMultiDrawRangeElementArrayAPPLE(GLenum mode, GLuint start, GLuint end, const GLint * first, const GLsizei * count, GLsizei primcount) {if (GLeeInit()) glMultiDrawRangeElementArrayAPPLE(mode, start, end, first, count, primcount);} +PFNGLELEMENTPOINTERAPPLEPROC pglElementPointerAPPLE=_Lazy_glElementPointerAPPLE; +PFNGLDRAWELEMENTARRAYAPPLEPROC pglDrawElementArrayAPPLE=_Lazy_glDrawElementArrayAPPLE; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC pglDrawRangeElementArrayAPPLE=_Lazy_glDrawRangeElementArrayAPPLE; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC pglMultiDrawElementArrayAPPLE=_Lazy_glMultiDrawElementArrayAPPLE; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC pglMultiDrawRangeElementArrayAPPLE=_Lazy_glMultiDrawRangeElementArrayAPPLE; +#endif + +/* GL_APPLE_fence */ + +#ifdef __GLEE_GL_APPLE_fence +void __stdcall _Lazy_glGenFencesAPPLE(GLsizei n, GLuint * fences) {if (GLeeInit()) glGenFencesAPPLE(n, fences);} +void __stdcall _Lazy_glDeleteFencesAPPLE(GLsizei n, const GLuint * fences) {if (GLeeInit()) glDeleteFencesAPPLE(n, fences);} +void __stdcall _Lazy_glSetFenceAPPLE(GLuint fence) {if (GLeeInit()) glSetFenceAPPLE(fence);} +GLboolean __stdcall _Lazy_glIsFenceAPPLE(GLuint fence) {if (GLeeInit()) return glIsFenceAPPLE(fence); return (GLboolean)0;} +GLboolean __stdcall _Lazy_glTestFenceAPPLE(GLuint fence) {if (GLeeInit()) return glTestFenceAPPLE(fence); return (GLboolean)0;} +void __stdcall _Lazy_glFinishFenceAPPLE(GLuint fence) {if (GLeeInit()) glFinishFenceAPPLE(fence);} +GLboolean __stdcall _Lazy_glTestObjectAPPLE(GLenum object, GLuint name) {if (GLeeInit()) return glTestObjectAPPLE(object, name); return (GLboolean)0;} +void __stdcall _Lazy_glFinishObjectAPPLE(GLenum object, GLint name) {if (GLeeInit()) glFinishObjectAPPLE(object, name);} +PFNGLGENFENCESAPPLEPROC pglGenFencesAPPLE=_Lazy_glGenFencesAPPLE; +PFNGLDELETEFENCESAPPLEPROC pglDeleteFencesAPPLE=_Lazy_glDeleteFencesAPPLE; +PFNGLSETFENCEAPPLEPROC pglSetFenceAPPLE=_Lazy_glSetFenceAPPLE; +PFNGLISFENCEAPPLEPROC pglIsFenceAPPLE=_Lazy_glIsFenceAPPLE; +PFNGLTESTFENCEAPPLEPROC pglTestFenceAPPLE=_Lazy_glTestFenceAPPLE; +PFNGLFINISHFENCEAPPLEPROC pglFinishFenceAPPLE=_Lazy_glFinishFenceAPPLE; +PFNGLTESTOBJECTAPPLEPROC pglTestObjectAPPLE=_Lazy_glTestObjectAPPLE; +PFNGLFINISHOBJECTAPPLEPROC pglFinishObjectAPPLE=_Lazy_glFinishObjectAPPLE; +#endif + +/* GL_APPLE_vertex_array_object */ + +#ifdef __GLEE_GL_APPLE_vertex_array_object +void __stdcall _Lazy_glBindVertexArrayAPPLE(GLuint array) {if (GLeeInit()) glBindVertexArrayAPPLE(array);} +void __stdcall _Lazy_glDeleteVertexArraysAPPLE(GLsizei n, const GLuint * arrays) {if (GLeeInit()) glDeleteVertexArraysAPPLE(n, arrays);} +void __stdcall _Lazy_glGenVertexArraysAPPLE(GLsizei n, GLuint * arrays) {if (GLeeInit()) glGenVertexArraysAPPLE(n, arrays);} +GLboolean __stdcall _Lazy_glIsVertexArrayAPPLE(GLuint array) {if (GLeeInit()) return glIsVertexArrayAPPLE(array); return (GLboolean)0;} +PFNGLBINDVERTEXARRAYAPPLEPROC pglBindVertexArrayAPPLE=_Lazy_glBindVertexArrayAPPLE; +PFNGLDELETEVERTEXARRAYSAPPLEPROC pglDeleteVertexArraysAPPLE=_Lazy_glDeleteVertexArraysAPPLE; +PFNGLGENVERTEXARRAYSAPPLEPROC pglGenVertexArraysAPPLE=_Lazy_glGenVertexArraysAPPLE; +PFNGLISVERTEXARRAYAPPLEPROC pglIsVertexArrayAPPLE=_Lazy_glIsVertexArrayAPPLE; +#endif + +/* GL_APPLE_vertex_array_range */ + +#ifdef __GLEE_GL_APPLE_vertex_array_range +void __stdcall _Lazy_glVertexArrayRangeAPPLE(GLsizei length, GLvoid * pointer) {if (GLeeInit()) glVertexArrayRangeAPPLE(length, pointer);} +void __stdcall _Lazy_glFlushVertexArrayRangeAPPLE(GLsizei length, GLvoid * pointer) {if (GLeeInit()) glFlushVertexArrayRangeAPPLE(length, pointer);} +void __stdcall _Lazy_glVertexArrayParameteriAPPLE(GLenum pname, GLint param) {if (GLeeInit()) glVertexArrayParameteriAPPLE(pname, param);} +PFNGLVERTEXARRAYRANGEAPPLEPROC pglVertexArrayRangeAPPLE=_Lazy_glVertexArrayRangeAPPLE; +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC pglFlushVertexArrayRangeAPPLE=_Lazy_glFlushVertexArrayRangeAPPLE; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC pglVertexArrayParameteriAPPLE=_Lazy_glVertexArrayParameteriAPPLE; +#endif + +/* GL_APPLE_ycbcr_422 */ + +#ifdef __GLEE_GL_APPLE_ycbcr_422 +#endif + +/* GL_S3_s3tc */ + +#ifdef __GLEE_GL_S3_s3tc +#endif + +/* GL_ATI_draw_buffers */ + +#ifdef __GLEE_GL_ATI_draw_buffers +void __stdcall _Lazy_glDrawBuffersATI(GLsizei n, const GLenum * bufs) {if (GLeeInit()) glDrawBuffersATI(n, bufs);} +PFNGLDRAWBUFFERSATIPROC pglDrawBuffersATI=_Lazy_glDrawBuffersATI; +#endif + +/* GL_ATI_pixel_format_float */ + +#ifdef __GLEE_GL_ATI_pixel_format_float +#endif + +/* GL_ATI_texture_env_combine3 */ + +#ifdef __GLEE_GL_ATI_texture_env_combine3 +#endif + +/* GL_ATI_texture_float */ + +#ifdef __GLEE_GL_ATI_texture_float +#endif + +/* GL_NV_float_buffer */ + +#ifdef __GLEE_GL_NV_float_buffer +#endif + +/* GL_NV_fragment_program */ + +#ifdef __GLEE_GL_NV_fragment_program +void __stdcall _Lazy_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glProgramNamedParameter4fNV(id, len, name, x, y, z, w);} +void __stdcall _Lazy_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glProgramNamedParameter4dNV(id, len, name, x, y, z, w);} +void __stdcall _Lazy_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v) {if (GLeeInit()) glProgramNamedParameter4fvNV(id, len, name, v);} +void __stdcall _Lazy_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v) {if (GLeeInit()) glProgramNamedParameter4dvNV(id, len, name, v);} +void __stdcall _Lazy_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params) {if (GLeeInit()) glGetProgramNamedParameterfvNV(id, len, name, params);} +void __stdcall _Lazy_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params) {if (GLeeInit()) glGetProgramNamedParameterdvNV(id, len, name, params);} +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC pglProgramNamedParameter4fNV=_Lazy_glProgramNamedParameter4fNV; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC pglProgramNamedParameter4dNV=_Lazy_glProgramNamedParameter4dNV; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC pglProgramNamedParameter4fvNV=_Lazy_glProgramNamedParameter4fvNV; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC pglProgramNamedParameter4dvNV=_Lazy_glProgramNamedParameter4dvNV; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC pglGetProgramNamedParameterfvNV=_Lazy_glGetProgramNamedParameterfvNV; +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC pglGetProgramNamedParameterdvNV=_Lazy_glGetProgramNamedParameterdvNV; +#endif + +/* GL_NV_half_float */ + +#ifdef __GLEE_GL_NV_half_float +void __stdcall _Lazy_glVertex2hNV(GLhalfNV x, GLhalfNV y) {if (GLeeInit()) glVertex2hNV(x, y);} +void __stdcall _Lazy_glVertex2hvNV(const GLhalfNV * v) {if (GLeeInit()) glVertex2hvNV(v);} +void __stdcall _Lazy_glVertex3hNV(GLhalfNV x, GLhalfNV y, GLhalfNV z) {if (GLeeInit()) glVertex3hNV(x, y, z);} +void __stdcall _Lazy_glVertex3hvNV(const GLhalfNV * v) {if (GLeeInit()) glVertex3hvNV(v);} +void __stdcall _Lazy_glVertex4hNV(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) {if (GLeeInit()) glVertex4hNV(x, y, z, w);} +void __stdcall _Lazy_glVertex4hvNV(const GLhalfNV * v) {if (GLeeInit()) glVertex4hvNV(v);} +void __stdcall _Lazy_glNormal3hNV(GLhalfNV nx, GLhalfNV ny, GLhalfNV nz) {if (GLeeInit()) glNormal3hNV(nx, ny, nz);} +void __stdcall _Lazy_glNormal3hvNV(const GLhalfNV * v) {if (GLeeInit()) glNormal3hvNV(v);} +void __stdcall _Lazy_glColor3hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue) {if (GLeeInit()) glColor3hNV(red, green, blue);} +void __stdcall _Lazy_glColor3hvNV(const GLhalfNV * v) {if (GLeeInit()) glColor3hvNV(v);} +void __stdcall _Lazy_glColor4hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha) {if (GLeeInit()) glColor4hNV(red, green, blue, alpha);} +void __stdcall _Lazy_glColor4hvNV(const GLhalfNV * v) {if (GLeeInit()) glColor4hvNV(v);} +void __stdcall _Lazy_glTexCoord1hNV(GLhalfNV s) {if (GLeeInit()) glTexCoord1hNV(s);} +void __stdcall _Lazy_glTexCoord1hvNV(const GLhalfNV * v) {if (GLeeInit()) glTexCoord1hvNV(v);} +void __stdcall _Lazy_glTexCoord2hNV(GLhalfNV s, GLhalfNV t) {if (GLeeInit()) glTexCoord2hNV(s, t);} +void __stdcall _Lazy_glTexCoord2hvNV(const GLhalfNV * v) {if (GLeeInit()) glTexCoord2hvNV(v);} +void __stdcall _Lazy_glTexCoord3hNV(GLhalfNV s, GLhalfNV t, GLhalfNV r) {if (GLeeInit()) glTexCoord3hNV(s, t, r);} +void __stdcall _Lazy_glTexCoord3hvNV(const GLhalfNV * v) {if (GLeeInit()) glTexCoord3hvNV(v);} +void __stdcall _Lazy_glTexCoord4hNV(GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q) {if (GLeeInit()) glTexCoord4hNV(s, t, r, q);} +void __stdcall _Lazy_glTexCoord4hvNV(const GLhalfNV * v) {if (GLeeInit()) glTexCoord4hvNV(v);} +void __stdcall _Lazy_glMultiTexCoord1hNV(GLenum target, GLhalfNV s) {if (GLeeInit()) glMultiTexCoord1hNV(target, s);} +void __stdcall _Lazy_glMultiTexCoord1hvNV(GLenum target, const GLhalfNV * v) {if (GLeeInit()) glMultiTexCoord1hvNV(target, v);} +void __stdcall _Lazy_glMultiTexCoord2hNV(GLenum target, GLhalfNV s, GLhalfNV t) {if (GLeeInit()) glMultiTexCoord2hNV(target, s, t);} +void __stdcall _Lazy_glMultiTexCoord2hvNV(GLenum target, const GLhalfNV * v) {if (GLeeInit()) glMultiTexCoord2hvNV(target, v);} +void __stdcall _Lazy_glMultiTexCoord3hNV(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r) {if (GLeeInit()) glMultiTexCoord3hNV(target, s, t, r);} +void __stdcall _Lazy_glMultiTexCoord3hvNV(GLenum target, const GLhalfNV * v) {if (GLeeInit()) glMultiTexCoord3hvNV(target, v);} +void __stdcall _Lazy_glMultiTexCoord4hNV(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q) {if (GLeeInit()) glMultiTexCoord4hNV(target, s, t, r, q);} +void __stdcall _Lazy_glMultiTexCoord4hvNV(GLenum target, const GLhalfNV * v) {if (GLeeInit()) glMultiTexCoord4hvNV(target, v);} +void __stdcall _Lazy_glFogCoordhNV(GLhalfNV fog) {if (GLeeInit()) glFogCoordhNV(fog);} +void __stdcall _Lazy_glFogCoordhvNV(const GLhalfNV * fog) {if (GLeeInit()) glFogCoordhvNV(fog);} +void __stdcall _Lazy_glSecondaryColor3hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue) {if (GLeeInit()) glSecondaryColor3hNV(red, green, blue);} +void __stdcall _Lazy_glSecondaryColor3hvNV(const GLhalfNV * v) {if (GLeeInit()) glSecondaryColor3hvNV(v);} +void __stdcall _Lazy_glVertexWeighthNV(GLhalfNV weight) {if (GLeeInit()) glVertexWeighthNV(weight);} +void __stdcall _Lazy_glVertexWeighthvNV(const GLhalfNV * weight) {if (GLeeInit()) glVertexWeighthvNV(weight);} +void __stdcall _Lazy_glVertexAttrib1hNV(GLuint index, GLhalfNV x) {if (GLeeInit()) glVertexAttrib1hNV(index, x);} +void __stdcall _Lazy_glVertexAttrib1hvNV(GLuint index, const GLhalfNV * v) {if (GLeeInit()) glVertexAttrib1hvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib2hNV(GLuint index, GLhalfNV x, GLhalfNV y) {if (GLeeInit()) glVertexAttrib2hNV(index, x, y);} +void __stdcall _Lazy_glVertexAttrib2hvNV(GLuint index, const GLhalfNV * v) {if (GLeeInit()) glVertexAttrib2hvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib3hNV(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z) {if (GLeeInit()) glVertexAttrib3hNV(index, x, y, z);} +void __stdcall _Lazy_glVertexAttrib3hvNV(GLuint index, const GLhalfNV * v) {if (GLeeInit()) glVertexAttrib3hvNV(index, v);} +void __stdcall _Lazy_glVertexAttrib4hNV(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) {if (GLeeInit()) glVertexAttrib4hNV(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttrib4hvNV(GLuint index, const GLhalfNV * v) {if (GLeeInit()) glVertexAttrib4hvNV(index, v);} +void __stdcall _Lazy_glVertexAttribs1hvNV(GLuint index, GLsizei n, const GLhalfNV * v) {if (GLeeInit()) glVertexAttribs1hvNV(index, n, v);} +void __stdcall _Lazy_glVertexAttribs2hvNV(GLuint index, GLsizei n, const GLhalfNV * v) {if (GLeeInit()) glVertexAttribs2hvNV(index, n, v);} +void __stdcall _Lazy_glVertexAttribs3hvNV(GLuint index, GLsizei n, const GLhalfNV * v) {if (GLeeInit()) glVertexAttribs3hvNV(index, n, v);} +void __stdcall _Lazy_glVertexAttribs4hvNV(GLuint index, GLsizei n, const GLhalfNV * v) {if (GLeeInit()) glVertexAttribs4hvNV(index, n, v);} +PFNGLVERTEX2HNVPROC pglVertex2hNV=_Lazy_glVertex2hNV; +PFNGLVERTEX2HVNVPROC pglVertex2hvNV=_Lazy_glVertex2hvNV; +PFNGLVERTEX3HNVPROC pglVertex3hNV=_Lazy_glVertex3hNV; +PFNGLVERTEX3HVNVPROC pglVertex3hvNV=_Lazy_glVertex3hvNV; +PFNGLVERTEX4HNVPROC pglVertex4hNV=_Lazy_glVertex4hNV; +PFNGLVERTEX4HVNVPROC pglVertex4hvNV=_Lazy_glVertex4hvNV; +PFNGLNORMAL3HNVPROC pglNormal3hNV=_Lazy_glNormal3hNV; +PFNGLNORMAL3HVNVPROC pglNormal3hvNV=_Lazy_glNormal3hvNV; +PFNGLCOLOR3HNVPROC pglColor3hNV=_Lazy_glColor3hNV; +PFNGLCOLOR3HVNVPROC pglColor3hvNV=_Lazy_glColor3hvNV; +PFNGLCOLOR4HNVPROC pglColor4hNV=_Lazy_glColor4hNV; +PFNGLCOLOR4HVNVPROC pglColor4hvNV=_Lazy_glColor4hvNV; +PFNGLTEXCOORD1HNVPROC pglTexCoord1hNV=_Lazy_glTexCoord1hNV; +PFNGLTEXCOORD1HVNVPROC pglTexCoord1hvNV=_Lazy_glTexCoord1hvNV; +PFNGLTEXCOORD2HNVPROC pglTexCoord2hNV=_Lazy_glTexCoord2hNV; +PFNGLTEXCOORD2HVNVPROC pglTexCoord2hvNV=_Lazy_glTexCoord2hvNV; +PFNGLTEXCOORD3HNVPROC pglTexCoord3hNV=_Lazy_glTexCoord3hNV; +PFNGLTEXCOORD3HVNVPROC pglTexCoord3hvNV=_Lazy_glTexCoord3hvNV; +PFNGLTEXCOORD4HNVPROC pglTexCoord4hNV=_Lazy_glTexCoord4hNV; +PFNGLTEXCOORD4HVNVPROC pglTexCoord4hvNV=_Lazy_glTexCoord4hvNV; +PFNGLMULTITEXCOORD1HNVPROC pglMultiTexCoord1hNV=_Lazy_glMultiTexCoord1hNV; +PFNGLMULTITEXCOORD1HVNVPROC pglMultiTexCoord1hvNV=_Lazy_glMultiTexCoord1hvNV; +PFNGLMULTITEXCOORD2HNVPROC pglMultiTexCoord2hNV=_Lazy_glMultiTexCoord2hNV; +PFNGLMULTITEXCOORD2HVNVPROC pglMultiTexCoord2hvNV=_Lazy_glMultiTexCoord2hvNV; +PFNGLMULTITEXCOORD3HNVPROC pglMultiTexCoord3hNV=_Lazy_glMultiTexCoord3hNV; +PFNGLMULTITEXCOORD3HVNVPROC pglMultiTexCoord3hvNV=_Lazy_glMultiTexCoord3hvNV; +PFNGLMULTITEXCOORD4HNVPROC pglMultiTexCoord4hNV=_Lazy_glMultiTexCoord4hNV; +PFNGLMULTITEXCOORD4HVNVPROC pglMultiTexCoord4hvNV=_Lazy_glMultiTexCoord4hvNV; +PFNGLFOGCOORDHNVPROC pglFogCoordhNV=_Lazy_glFogCoordhNV; +PFNGLFOGCOORDHVNVPROC pglFogCoordhvNV=_Lazy_glFogCoordhvNV; +PFNGLSECONDARYCOLOR3HNVPROC pglSecondaryColor3hNV=_Lazy_glSecondaryColor3hNV; +PFNGLSECONDARYCOLOR3HVNVPROC pglSecondaryColor3hvNV=_Lazy_glSecondaryColor3hvNV; +PFNGLVERTEXWEIGHTHNVPROC pglVertexWeighthNV=_Lazy_glVertexWeighthNV; +PFNGLVERTEXWEIGHTHVNVPROC pglVertexWeighthvNV=_Lazy_glVertexWeighthvNV; +PFNGLVERTEXATTRIB1HNVPROC pglVertexAttrib1hNV=_Lazy_glVertexAttrib1hNV; +PFNGLVERTEXATTRIB1HVNVPROC pglVertexAttrib1hvNV=_Lazy_glVertexAttrib1hvNV; +PFNGLVERTEXATTRIB2HNVPROC pglVertexAttrib2hNV=_Lazy_glVertexAttrib2hNV; +PFNGLVERTEXATTRIB2HVNVPROC pglVertexAttrib2hvNV=_Lazy_glVertexAttrib2hvNV; +PFNGLVERTEXATTRIB3HNVPROC pglVertexAttrib3hNV=_Lazy_glVertexAttrib3hNV; +PFNGLVERTEXATTRIB3HVNVPROC pglVertexAttrib3hvNV=_Lazy_glVertexAttrib3hvNV; +PFNGLVERTEXATTRIB4HNVPROC pglVertexAttrib4hNV=_Lazy_glVertexAttrib4hNV; +PFNGLVERTEXATTRIB4HVNVPROC pglVertexAttrib4hvNV=_Lazy_glVertexAttrib4hvNV; +PFNGLVERTEXATTRIBS1HVNVPROC pglVertexAttribs1hvNV=_Lazy_glVertexAttribs1hvNV; +PFNGLVERTEXATTRIBS2HVNVPROC pglVertexAttribs2hvNV=_Lazy_glVertexAttribs2hvNV; +PFNGLVERTEXATTRIBS3HVNVPROC pglVertexAttribs3hvNV=_Lazy_glVertexAttribs3hvNV; +PFNGLVERTEXATTRIBS4HVNVPROC pglVertexAttribs4hvNV=_Lazy_glVertexAttribs4hvNV; +#endif + +/* GL_NV_pixel_data_range */ + +#ifdef __GLEE_GL_NV_pixel_data_range +void __stdcall _Lazy_glPixelDataRangeNV(GLenum target, GLsizei length, GLvoid * pointer) {if (GLeeInit()) glPixelDataRangeNV(target, length, pointer);} +void __stdcall _Lazy_glFlushPixelDataRangeNV(GLenum target) {if (GLeeInit()) glFlushPixelDataRangeNV(target);} +PFNGLPIXELDATARANGENVPROC pglPixelDataRangeNV=_Lazy_glPixelDataRangeNV; +PFNGLFLUSHPIXELDATARANGENVPROC pglFlushPixelDataRangeNV=_Lazy_glFlushPixelDataRangeNV; +#endif + +/* GL_NV_primitive_restart */ + +#ifdef __GLEE_GL_NV_primitive_restart +void __stdcall _Lazy_glPrimitiveRestartNV(void) {if (GLeeInit()) glPrimitiveRestartNV();} +void __stdcall _Lazy_glPrimitiveRestartIndexNV(GLuint index) {if (GLeeInit()) glPrimitiveRestartIndexNV(index);} +PFNGLPRIMITIVERESTARTNVPROC pglPrimitiveRestartNV=_Lazy_glPrimitiveRestartNV; +PFNGLPRIMITIVERESTARTINDEXNVPROC pglPrimitiveRestartIndexNV=_Lazy_glPrimitiveRestartIndexNV; +#endif + +/* GL_NV_texture_expand_normal */ + +#ifdef __GLEE_GL_NV_texture_expand_normal +#endif + +/* GL_NV_vertex_program2 */ + +#ifdef __GLEE_GL_NV_vertex_program2 +#endif + +/* GL_ATI_map_object_buffer */ + +#ifdef __GLEE_GL_ATI_map_object_buffer +GLvoid* __stdcall _Lazy_glMapObjectBufferATI(GLuint buffer) {if (GLeeInit()) return glMapObjectBufferATI(buffer); return (GLvoid*)0;} +void __stdcall _Lazy_glUnmapObjectBufferATI(GLuint buffer) {if (GLeeInit()) glUnmapObjectBufferATI(buffer);} +PFNGLMAPOBJECTBUFFERATIPROC pglMapObjectBufferATI=_Lazy_glMapObjectBufferATI; +PFNGLUNMAPOBJECTBUFFERATIPROC pglUnmapObjectBufferATI=_Lazy_glUnmapObjectBufferATI; +#endif + +/* GL_ATI_separate_stencil */ + +#ifdef __GLEE_GL_ATI_separate_stencil +void __stdcall _Lazy_glStencilOpSeparateATI(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {if (GLeeInit()) glStencilOpSeparateATI(face, sfail, dpfail, dppass);} +void __stdcall _Lazy_glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) {if (GLeeInit()) glStencilFuncSeparateATI(frontfunc, backfunc, ref, mask);} +PFNGLSTENCILOPSEPARATEATIPROC pglStencilOpSeparateATI=_Lazy_glStencilOpSeparateATI; +PFNGLSTENCILFUNCSEPARATEATIPROC pglStencilFuncSeparateATI=_Lazy_glStencilFuncSeparateATI; +#endif + +/* GL_ATI_vertex_attrib_array_object */ + +#ifdef __GLEE_GL_ATI_vertex_attrib_array_object +void __stdcall _Lazy_glVertexAttribArrayObjectATI(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset) {if (GLeeInit()) glVertexAttribArrayObjectATI(index, size, type, normalized, stride, buffer, offset);} +void __stdcall _Lazy_glGetVertexAttribArrayObjectfvATI(GLuint index, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetVertexAttribArrayObjectfvATI(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribArrayObjectivATI(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribArrayObjectivATI(index, pname, params);} +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC pglVertexAttribArrayObjectATI=_Lazy_glVertexAttribArrayObjectATI; +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC pglGetVertexAttribArrayObjectfvATI=_Lazy_glGetVertexAttribArrayObjectfvATI; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC pglGetVertexAttribArrayObjectivATI=_Lazy_glGetVertexAttribArrayObjectivATI; +#endif + +/* GL_OES_read_format */ + +#ifdef __GLEE_GL_OES_read_format +#endif + +/* GL_EXT_depth_bounds_test */ + +#ifdef __GLEE_GL_EXT_depth_bounds_test +void __stdcall _Lazy_glDepthBoundsEXT(GLclampd zmin, GLclampd zmax) {if (GLeeInit()) glDepthBoundsEXT(zmin, zmax);} +PFNGLDEPTHBOUNDSEXTPROC pglDepthBoundsEXT=_Lazy_glDepthBoundsEXT; +#endif + +/* GL_EXT_texture_mirror_clamp */ + +#ifdef __GLEE_GL_EXT_texture_mirror_clamp +#endif + +/* GL_EXT_blend_equation_separate */ + +#ifdef __GLEE_GL_EXT_blend_equation_separate +void __stdcall _Lazy_glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeAlpha) {if (GLeeInit()) glBlendEquationSeparateEXT(modeRGB, modeAlpha);} +PFNGLBLENDEQUATIONSEPARATEEXTPROC pglBlendEquationSeparateEXT=_Lazy_glBlendEquationSeparateEXT; +#endif + +/* GL_MESA_pack_invert */ + +#ifdef __GLEE_GL_MESA_pack_invert +#endif + +/* GL_MESA_ycbcr_texture */ + +#ifdef __GLEE_GL_MESA_ycbcr_texture +#endif + +/* GL_EXT_pixel_buffer_object */ + +#ifdef __GLEE_GL_EXT_pixel_buffer_object +#endif + +/* GL_NV_fragment_program_option */ + +#ifdef __GLEE_GL_NV_fragment_program_option +#endif + +/* GL_NV_fragment_program2 */ + +#ifdef __GLEE_GL_NV_fragment_program2 +#endif + +/* GL_NV_vertex_program2_option */ + +#ifdef __GLEE_GL_NV_vertex_program2_option +#endif + +/* GL_NV_vertex_program3 */ + +#ifdef __GLEE_GL_NV_vertex_program3 +#endif + +/* GL_EXT_framebuffer_object */ + +#ifdef __GLEE_GL_EXT_framebuffer_object +GLboolean __stdcall _Lazy_glIsRenderbufferEXT(GLuint renderbuffer) {if (GLeeInit()) return glIsRenderbufferEXT(renderbuffer); return (GLboolean)0;} +void __stdcall _Lazy_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) {if (GLeeInit()) glBindRenderbufferEXT(target, renderbuffer);} +void __stdcall _Lazy_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers) {if (GLeeInit()) glDeleteRenderbuffersEXT(n, renderbuffers);} +void __stdcall _Lazy_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers) {if (GLeeInit()) glGenRenderbuffersEXT(n, renderbuffers);} +void __stdcall _Lazy_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorageEXT(target, internalformat, width, height);} +void __stdcall _Lazy_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetRenderbufferParameterivEXT(target, pname, params);} +GLboolean __stdcall _Lazy_glIsFramebufferEXT(GLuint framebuffer) {if (GLeeInit()) return glIsFramebufferEXT(framebuffer); return (GLboolean)0;} +void __stdcall _Lazy_glBindFramebufferEXT(GLenum target, GLuint framebuffer) {if (GLeeInit()) glBindFramebufferEXT(target, framebuffer);} +void __stdcall _Lazy_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers) {if (GLeeInit()) glDeleteFramebuffersEXT(n, framebuffers);} +void __stdcall _Lazy_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers) {if (GLeeInit()) glGenFramebuffersEXT(n, framebuffers);} +GLenum __stdcall _Lazy_glCheckFramebufferStatusEXT(GLenum target) {if (GLeeInit()) return glCheckFramebufferStatusEXT(target); return (GLenum)0;} +void __stdcall _Lazy_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTexture1DEXT(target, attachment, textarget, texture, level);} +void __stdcall _Lazy_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);} +void __stdcall _Lazy_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {if (GLeeInit()) glFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);} +void __stdcall _Lazy_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {if (GLeeInit()) glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);} +void __stdcall _Lazy_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params) {if (GLeeInit()) glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params);} +void __stdcall _Lazy_glGenerateMipmapEXT(GLenum target) {if (GLeeInit()) glGenerateMipmapEXT(target);} +PFNGLISRENDERBUFFEREXTPROC pglIsRenderbufferEXT=_Lazy_glIsRenderbufferEXT; +PFNGLBINDRENDERBUFFEREXTPROC pglBindRenderbufferEXT=_Lazy_glBindRenderbufferEXT; +PFNGLDELETERENDERBUFFERSEXTPROC pglDeleteRenderbuffersEXT=_Lazy_glDeleteRenderbuffersEXT; +PFNGLGENRENDERBUFFERSEXTPROC pglGenRenderbuffersEXT=_Lazy_glGenRenderbuffersEXT; +PFNGLRENDERBUFFERSTORAGEEXTPROC pglRenderbufferStorageEXT=_Lazy_glRenderbufferStorageEXT; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC pglGetRenderbufferParameterivEXT=_Lazy_glGetRenderbufferParameterivEXT; +PFNGLISFRAMEBUFFEREXTPROC pglIsFramebufferEXT=_Lazy_glIsFramebufferEXT; +PFNGLBINDFRAMEBUFFEREXTPROC pglBindFramebufferEXT=_Lazy_glBindFramebufferEXT; +PFNGLDELETEFRAMEBUFFERSEXTPROC pglDeleteFramebuffersEXT=_Lazy_glDeleteFramebuffersEXT; +PFNGLGENFRAMEBUFFERSEXTPROC pglGenFramebuffersEXT=_Lazy_glGenFramebuffersEXT; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC pglCheckFramebufferStatusEXT=_Lazy_glCheckFramebufferStatusEXT; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC pglFramebufferTexture1DEXT=_Lazy_glFramebufferTexture1DEXT; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC pglFramebufferTexture2DEXT=_Lazy_glFramebufferTexture2DEXT; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC pglFramebufferTexture3DEXT=_Lazy_glFramebufferTexture3DEXT; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC pglFramebufferRenderbufferEXT=_Lazy_glFramebufferRenderbufferEXT; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC pglGetFramebufferAttachmentParameterivEXT=_Lazy_glGetFramebufferAttachmentParameterivEXT; +PFNGLGENERATEMIPMAPEXTPROC pglGenerateMipmapEXT=_Lazy_glGenerateMipmapEXT; +#endif + +/* GL_GREMEDY_string_marker */ + +#ifdef __GLEE_GL_GREMEDY_string_marker +void __stdcall _Lazy_glStringMarkerGREMEDY(GLsizei len, const GLvoid * string) {if (GLeeInit()) glStringMarkerGREMEDY(len, string);} +PFNGLSTRINGMARKERGREMEDYPROC pglStringMarkerGREMEDY=_Lazy_glStringMarkerGREMEDY; +#endif + +/* GL_EXT_packed_depth_stencil */ + +#ifdef __GLEE_GL_EXT_packed_depth_stencil +#endif + +/* GL_EXT_stencil_clear_tag */ + +#ifdef __GLEE_GL_EXT_stencil_clear_tag +void __stdcall _Lazy_glStencilClearTagEXT(GLsizei stencilTagBits, GLuint stencilClearTag) {if (GLeeInit()) glStencilClearTagEXT(stencilTagBits, stencilClearTag);} +PFNGLSTENCILCLEARTAGEXTPROC pglStencilClearTagEXT=_Lazy_glStencilClearTagEXT; +#endif + +/* GL_EXT_texture_sRGB */ + +#ifdef __GLEE_GL_EXT_texture_sRGB +#endif + +/* GL_EXT_framebuffer_blit */ + +#ifdef __GLEE_GL_EXT_framebuffer_blit +void __stdcall _Lazy_glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {if (GLeeInit()) glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);} +PFNGLBLITFRAMEBUFFEREXTPROC pglBlitFramebufferEXT=_Lazy_glBlitFramebufferEXT; +#endif + +/* GL_EXT_framebuffer_multisample */ + +#ifdef __GLEE_GL_EXT_framebuffer_multisample +void __stdcall _Lazy_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);} +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pglRenderbufferStorageMultisampleEXT=_Lazy_glRenderbufferStorageMultisampleEXT; +#endif + +/* GL_MESAX_texture_stack */ + +#ifdef __GLEE_GL_MESAX_texture_stack +#endif + +/* GL_EXT_timer_query */ + +#ifdef __GLEE_GL_EXT_timer_query +void __stdcall _Lazy_glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT * params) {if (GLeeInit()) glGetQueryObjecti64vEXT(id, pname, params);} +void __stdcall _Lazy_glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT * params) {if (GLeeInit()) glGetQueryObjectui64vEXT(id, pname, params);} +PFNGLGETQUERYOBJECTI64VEXTPROC pglGetQueryObjecti64vEXT=_Lazy_glGetQueryObjecti64vEXT; +PFNGLGETQUERYOBJECTUI64VEXTPROC pglGetQueryObjectui64vEXT=_Lazy_glGetQueryObjectui64vEXT; +#endif + +/* GL_EXT_gpu_program_parameters */ + +#ifdef __GLEE_GL_EXT_gpu_program_parameters +void __stdcall _Lazy_glProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * params) {if (GLeeInit()) glProgramEnvParameters4fvEXT(target, index, count, params);} +void __stdcall _Lazy_glProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * params) {if (GLeeInit()) glProgramLocalParameters4fvEXT(target, index, count, params);} +PFNGLPROGRAMENVPARAMETERS4FVEXTPROC pglProgramEnvParameters4fvEXT=_Lazy_glProgramEnvParameters4fvEXT; +PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC pglProgramLocalParameters4fvEXT=_Lazy_glProgramLocalParameters4fvEXT; +#endif + +/* GL_APPLE_flush_buffer_range */ + +#ifdef __GLEE_GL_APPLE_flush_buffer_range +void __stdcall _Lazy_glBufferParameteriAPPLE(GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glBufferParameteriAPPLE(target, pname, param);} +void __stdcall _Lazy_glFlushMappedBufferRangeAPPLE(GLenum target, GLintptr offset, GLsizeiptr size) {if (GLeeInit()) glFlushMappedBufferRangeAPPLE(target, offset, size);} +PFNGLBUFFERPARAMETERIAPPLEPROC pglBufferParameteriAPPLE=_Lazy_glBufferParameteriAPPLE; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC pglFlushMappedBufferRangeAPPLE=_Lazy_glFlushMappedBufferRangeAPPLE; +#endif + +/* GL_NV_gpu_program4 */ + +#ifdef __GLEE_GL_NV_gpu_program4 +void __stdcall _Lazy_glProgramLocalParameterI4iNV(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glProgramLocalParameterI4iNV(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramLocalParameterI4ivNV(GLenum target, GLuint index, const GLint * params) {if (GLeeInit()) glProgramLocalParameterI4ivNV(target, index, params);} +void __stdcall _Lazy_glProgramLocalParametersI4ivNV(GLenum target, GLuint index, GLsizei count, const GLint * params) {if (GLeeInit()) glProgramLocalParametersI4ivNV(target, index, count, params);} +void __stdcall _Lazy_glProgramLocalParameterI4uiNV(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glProgramLocalParameterI4uiNV(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramLocalParameterI4uivNV(GLenum target, GLuint index, const GLuint * params) {if (GLeeInit()) glProgramLocalParameterI4uivNV(target, index, params);} +void __stdcall _Lazy_glProgramLocalParametersI4uivNV(GLenum target, GLuint index, GLsizei count, const GLuint * params) {if (GLeeInit()) glProgramLocalParametersI4uivNV(target, index, count, params);} +void __stdcall _Lazy_glProgramEnvParameterI4iNV(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glProgramEnvParameterI4iNV(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramEnvParameterI4ivNV(GLenum target, GLuint index, const GLint * params) {if (GLeeInit()) glProgramEnvParameterI4ivNV(target, index, params);} +void __stdcall _Lazy_glProgramEnvParametersI4ivNV(GLenum target, GLuint index, GLsizei count, const GLint * params) {if (GLeeInit()) glProgramEnvParametersI4ivNV(target, index, count, params);} +void __stdcall _Lazy_glProgramEnvParameterI4uiNV(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glProgramEnvParameterI4uiNV(target, index, x, y, z, w);} +void __stdcall _Lazy_glProgramEnvParameterI4uivNV(GLenum target, GLuint index, const GLuint * params) {if (GLeeInit()) glProgramEnvParameterI4uivNV(target, index, params);} +void __stdcall _Lazy_glProgramEnvParametersI4uivNV(GLenum target, GLuint index, GLsizei count, const GLuint * params) {if (GLeeInit()) glProgramEnvParametersI4uivNV(target, index, count, params);} +void __stdcall _Lazy_glGetProgramLocalParameterIivNV(GLenum target, GLuint index, GLint * params) {if (GLeeInit()) glGetProgramLocalParameterIivNV(target, index, params);} +void __stdcall _Lazy_glGetProgramLocalParameterIuivNV(GLenum target, GLuint index, GLuint * params) {if (GLeeInit()) glGetProgramLocalParameterIuivNV(target, index, params);} +void __stdcall _Lazy_glGetProgramEnvParameterIivNV(GLenum target, GLuint index, GLint * params) {if (GLeeInit()) glGetProgramEnvParameterIivNV(target, index, params);} +void __stdcall _Lazy_glGetProgramEnvParameterIuivNV(GLenum target, GLuint index, GLuint * params) {if (GLeeInit()) glGetProgramEnvParameterIuivNV(target, index, params);} +PFNGLPROGRAMLOCALPARAMETERI4INVPROC pglProgramLocalParameterI4iNV=_Lazy_glProgramLocalParameterI4iNV; +PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC pglProgramLocalParameterI4ivNV=_Lazy_glProgramLocalParameterI4ivNV; +PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC pglProgramLocalParametersI4ivNV=_Lazy_glProgramLocalParametersI4ivNV; +PFNGLPROGRAMLOCALPARAMETERI4UINVPROC pglProgramLocalParameterI4uiNV=_Lazy_glProgramLocalParameterI4uiNV; +PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC pglProgramLocalParameterI4uivNV=_Lazy_glProgramLocalParameterI4uivNV; +PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC pglProgramLocalParametersI4uivNV=_Lazy_glProgramLocalParametersI4uivNV; +PFNGLPROGRAMENVPARAMETERI4INVPROC pglProgramEnvParameterI4iNV=_Lazy_glProgramEnvParameterI4iNV; +PFNGLPROGRAMENVPARAMETERI4IVNVPROC pglProgramEnvParameterI4ivNV=_Lazy_glProgramEnvParameterI4ivNV; +PFNGLPROGRAMENVPARAMETERSI4IVNVPROC pglProgramEnvParametersI4ivNV=_Lazy_glProgramEnvParametersI4ivNV; +PFNGLPROGRAMENVPARAMETERI4UINVPROC pglProgramEnvParameterI4uiNV=_Lazy_glProgramEnvParameterI4uiNV; +PFNGLPROGRAMENVPARAMETERI4UIVNVPROC pglProgramEnvParameterI4uivNV=_Lazy_glProgramEnvParameterI4uivNV; +PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC pglProgramEnvParametersI4uivNV=_Lazy_glProgramEnvParametersI4uivNV; +PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC pglGetProgramLocalParameterIivNV=_Lazy_glGetProgramLocalParameterIivNV; +PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC pglGetProgramLocalParameterIuivNV=_Lazy_glGetProgramLocalParameterIuivNV; +PFNGLGETPROGRAMENVPARAMETERIIVNVPROC pglGetProgramEnvParameterIivNV=_Lazy_glGetProgramEnvParameterIivNV; +PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC pglGetProgramEnvParameterIuivNV=_Lazy_glGetProgramEnvParameterIuivNV; +#endif + +/* GL_NV_geometry_program4 */ + +#ifdef __GLEE_GL_NV_geometry_program4 +void __stdcall _Lazy_glProgramVertexLimitNV(GLenum target, GLint limit) {if (GLeeInit()) glProgramVertexLimitNV(target, limit);} +void __stdcall _Lazy_glFramebufferTextureEXT(GLenum target, GLenum attachment, GLuint texture, GLint level) {if (GLeeInit()) glFramebufferTextureEXT(target, attachment, texture, level);} +void __stdcall _Lazy_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {if (GLeeInit()) glFramebufferTextureLayerEXT(target, attachment, texture, level, layer);} +void __stdcall _Lazy_glFramebufferTextureFaceEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) {if (GLeeInit()) glFramebufferTextureFaceEXT(target, attachment, texture, level, face);} +PFNGLPROGRAMVERTEXLIMITNVPROC pglProgramVertexLimitNV=_Lazy_glProgramVertexLimitNV; +PFNGLFRAMEBUFFERTEXTUREEXTPROC pglFramebufferTextureEXT=_Lazy_glFramebufferTextureEXT; +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC pglFramebufferTextureLayerEXT=_Lazy_glFramebufferTextureLayerEXT; +PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC pglFramebufferTextureFaceEXT=_Lazy_glFramebufferTextureFaceEXT; +#endif + +/* GL_EXT_geometry_shader4 */ + +#ifdef __GLEE_GL_EXT_geometry_shader4 +void __stdcall _Lazy_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value) {if (GLeeInit()) glProgramParameteriEXT(program, pname, value);} +PFNGLPROGRAMPARAMETERIEXTPROC pglProgramParameteriEXT=_Lazy_glProgramParameteriEXT; +#endif + +/* GL_NV_vertex_program4 */ + +#ifdef __GLEE_GL_NV_vertex_program4 +void __stdcall _Lazy_glVertexAttribI1iEXT(GLuint index, GLint x) {if (GLeeInit()) glVertexAttribI1iEXT(index, x);} +void __stdcall _Lazy_glVertexAttribI2iEXT(GLuint index, GLint x, GLint y) {if (GLeeInit()) glVertexAttribI2iEXT(index, x, y);} +void __stdcall _Lazy_glVertexAttribI3iEXT(GLuint index, GLint x, GLint y, GLint z) {if (GLeeInit()) glVertexAttribI3iEXT(index, x, y, z);} +void __stdcall _Lazy_glVertexAttribI4iEXT(GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glVertexAttribI4iEXT(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttribI1uiEXT(GLuint index, GLuint x) {if (GLeeInit()) glVertexAttribI1uiEXT(index, x);} +void __stdcall _Lazy_glVertexAttribI2uiEXT(GLuint index, GLuint x, GLuint y) {if (GLeeInit()) glVertexAttribI2uiEXT(index, x, y);} +void __stdcall _Lazy_glVertexAttribI3uiEXT(GLuint index, GLuint x, GLuint y, GLuint z) {if (GLeeInit()) glVertexAttribI3uiEXT(index, x, y, z);} +void __stdcall _Lazy_glVertexAttribI4uiEXT(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glVertexAttribI4uiEXT(index, x, y, z, w);} +void __stdcall _Lazy_glVertexAttribI1ivEXT(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI1ivEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI2ivEXT(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI2ivEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI3ivEXT(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI3ivEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI4ivEXT(GLuint index, const GLint * v) {if (GLeeInit()) glVertexAttribI4ivEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI1uivEXT(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI1uivEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI2uivEXT(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI2uivEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI3uivEXT(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI3uivEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI4uivEXT(GLuint index, const GLuint * v) {if (GLeeInit()) glVertexAttribI4uivEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI4bvEXT(GLuint index, const GLbyte * v) {if (GLeeInit()) glVertexAttribI4bvEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI4svEXT(GLuint index, const GLshort * v) {if (GLeeInit()) glVertexAttribI4svEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI4ubvEXT(GLuint index, const GLubyte * v) {if (GLeeInit()) glVertexAttribI4ubvEXT(index, v);} +void __stdcall _Lazy_glVertexAttribI4usvEXT(GLuint index, const GLushort * v) {if (GLeeInit()) glVertexAttribI4usvEXT(index, v);} +void __stdcall _Lazy_glVertexAttribIPointerEXT(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glVertexAttribIPointerEXT(index, size, type, stride, pointer);} +void __stdcall _Lazy_glGetVertexAttribIivEXT(GLuint index, GLenum pname, GLint * params) {if (GLeeInit()) glGetVertexAttribIivEXT(index, pname, params);} +void __stdcall _Lazy_glGetVertexAttribIuivEXT(GLuint index, GLenum pname, GLuint * params) {if (GLeeInit()) glGetVertexAttribIuivEXT(index, pname, params);} +PFNGLVERTEXATTRIBI1IEXTPROC pglVertexAttribI1iEXT=_Lazy_glVertexAttribI1iEXT; +PFNGLVERTEXATTRIBI2IEXTPROC pglVertexAttribI2iEXT=_Lazy_glVertexAttribI2iEXT; +PFNGLVERTEXATTRIBI3IEXTPROC pglVertexAttribI3iEXT=_Lazy_glVertexAttribI3iEXT; +PFNGLVERTEXATTRIBI4IEXTPROC pglVertexAttribI4iEXT=_Lazy_glVertexAttribI4iEXT; +PFNGLVERTEXATTRIBI1UIEXTPROC pglVertexAttribI1uiEXT=_Lazy_glVertexAttribI1uiEXT; +PFNGLVERTEXATTRIBI2UIEXTPROC pglVertexAttribI2uiEXT=_Lazy_glVertexAttribI2uiEXT; +PFNGLVERTEXATTRIBI3UIEXTPROC pglVertexAttribI3uiEXT=_Lazy_glVertexAttribI3uiEXT; +PFNGLVERTEXATTRIBI4UIEXTPROC pglVertexAttribI4uiEXT=_Lazy_glVertexAttribI4uiEXT; +PFNGLVERTEXATTRIBI1IVEXTPROC pglVertexAttribI1ivEXT=_Lazy_glVertexAttribI1ivEXT; +PFNGLVERTEXATTRIBI2IVEXTPROC pglVertexAttribI2ivEXT=_Lazy_glVertexAttribI2ivEXT; +PFNGLVERTEXATTRIBI3IVEXTPROC pglVertexAttribI3ivEXT=_Lazy_glVertexAttribI3ivEXT; +PFNGLVERTEXATTRIBI4IVEXTPROC pglVertexAttribI4ivEXT=_Lazy_glVertexAttribI4ivEXT; +PFNGLVERTEXATTRIBI1UIVEXTPROC pglVertexAttribI1uivEXT=_Lazy_glVertexAttribI1uivEXT; +PFNGLVERTEXATTRIBI2UIVEXTPROC pglVertexAttribI2uivEXT=_Lazy_glVertexAttribI2uivEXT; +PFNGLVERTEXATTRIBI3UIVEXTPROC pglVertexAttribI3uivEXT=_Lazy_glVertexAttribI3uivEXT; +PFNGLVERTEXATTRIBI4UIVEXTPROC pglVertexAttribI4uivEXT=_Lazy_glVertexAttribI4uivEXT; +PFNGLVERTEXATTRIBI4BVEXTPROC pglVertexAttribI4bvEXT=_Lazy_glVertexAttribI4bvEXT; +PFNGLVERTEXATTRIBI4SVEXTPROC pglVertexAttribI4svEXT=_Lazy_glVertexAttribI4svEXT; +PFNGLVERTEXATTRIBI4UBVEXTPROC pglVertexAttribI4ubvEXT=_Lazy_glVertexAttribI4ubvEXT; +PFNGLVERTEXATTRIBI4USVEXTPROC pglVertexAttribI4usvEXT=_Lazy_glVertexAttribI4usvEXT; +PFNGLVERTEXATTRIBIPOINTEREXTPROC pglVertexAttribIPointerEXT=_Lazy_glVertexAttribIPointerEXT; +PFNGLGETVERTEXATTRIBIIVEXTPROC pglGetVertexAttribIivEXT=_Lazy_glGetVertexAttribIivEXT; +PFNGLGETVERTEXATTRIBIUIVEXTPROC pglGetVertexAttribIuivEXT=_Lazy_glGetVertexAttribIuivEXT; +#endif + +/* GL_EXT_gpu_shader4 */ + +#ifdef __GLEE_GL_EXT_gpu_shader4 +void __stdcall _Lazy_glGetUniformuivEXT(GLuint program, GLint location, GLuint * params) {if (GLeeInit()) glGetUniformuivEXT(program, location, params);} +void __stdcall _Lazy_glBindFragDataLocationEXT(GLuint program, GLuint color, const GLchar * name) {if (GLeeInit()) glBindFragDataLocationEXT(program, color, name);} +GLint __stdcall _Lazy_glGetFragDataLocationEXT(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetFragDataLocationEXT(program, name); return (GLint)0;} +void __stdcall _Lazy_glUniform1uiEXT(GLint location, GLuint v0) {if (GLeeInit()) glUniform1uiEXT(location, v0);} +void __stdcall _Lazy_glUniform2uiEXT(GLint location, GLuint v0, GLuint v1) {if (GLeeInit()) glUniform2uiEXT(location, v0, v1);} +void __stdcall _Lazy_glUniform3uiEXT(GLint location, GLuint v0, GLuint v1, GLuint v2) {if (GLeeInit()) glUniform3uiEXT(location, v0, v1, v2);} +void __stdcall _Lazy_glUniform4uiEXT(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {if (GLeeInit()) glUniform4uiEXT(location, v0, v1, v2, v3);} +void __stdcall _Lazy_glUniform1uivEXT(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform1uivEXT(location, count, value);} +void __stdcall _Lazy_glUniform2uivEXT(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform2uivEXT(location, count, value);} +void __stdcall _Lazy_glUniform3uivEXT(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform3uivEXT(location, count, value);} +void __stdcall _Lazy_glUniform4uivEXT(GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glUniform4uivEXT(location, count, value);} +PFNGLGETUNIFORMUIVEXTPROC pglGetUniformuivEXT=_Lazy_glGetUniformuivEXT; +PFNGLBINDFRAGDATALOCATIONEXTPROC pglBindFragDataLocationEXT=_Lazy_glBindFragDataLocationEXT; +PFNGLGETFRAGDATALOCATIONEXTPROC pglGetFragDataLocationEXT=_Lazy_glGetFragDataLocationEXT; +PFNGLUNIFORM1UIEXTPROC pglUniform1uiEXT=_Lazy_glUniform1uiEXT; +PFNGLUNIFORM2UIEXTPROC pglUniform2uiEXT=_Lazy_glUniform2uiEXT; +PFNGLUNIFORM3UIEXTPROC pglUniform3uiEXT=_Lazy_glUniform3uiEXT; +PFNGLUNIFORM4UIEXTPROC pglUniform4uiEXT=_Lazy_glUniform4uiEXT; +PFNGLUNIFORM1UIVEXTPROC pglUniform1uivEXT=_Lazy_glUniform1uivEXT; +PFNGLUNIFORM2UIVEXTPROC pglUniform2uivEXT=_Lazy_glUniform2uivEXT; +PFNGLUNIFORM3UIVEXTPROC pglUniform3uivEXT=_Lazy_glUniform3uivEXT; +PFNGLUNIFORM4UIVEXTPROC pglUniform4uivEXT=_Lazy_glUniform4uivEXT; +#endif + +/* GL_EXT_drawinstanced */ + +#ifdef __GLEE_GL_EXT_drawinstanced +void __stdcall _Lazy_glDrawArraysInstancedEXT(GLenum mode, GLint start, GLsizei count, GLsizei primcount) {if (GLeeInit()) glDrawArraysInstancedEXT(mode, start, count, primcount);} +void __stdcall _Lazy_glDrawElementsInstancedEXT(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount) {if (GLeeInit()) glDrawElementsInstancedEXT(mode, count, type, indices, primcount);} +PFNGLDRAWARRAYSINSTANCEDEXTPROC pglDrawArraysInstancedEXT=_Lazy_glDrawArraysInstancedEXT; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC pglDrawElementsInstancedEXT=_Lazy_glDrawElementsInstancedEXT; +#endif + +/* GL_EXT_packed_float */ + +#ifdef __GLEE_GL_EXT_packed_float +#endif + +/* GL_EXT_texture_array */ + +#ifdef __GLEE_GL_EXT_texture_array +#endif + +/* GL_EXT_texture_buffer_object */ + +#ifdef __GLEE_GL_EXT_texture_buffer_object +void __stdcall _Lazy_glTexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer) {if (GLeeInit()) glTexBufferEXT(target, internalformat, buffer);} +PFNGLTEXBUFFEREXTPROC pglTexBufferEXT=_Lazy_glTexBufferEXT; +#endif + +/* GL_EXT_texture_compression_latc */ + +#ifdef __GLEE_GL_EXT_texture_compression_latc +#endif + +/* GL_EXT_texture_compression_rgtc */ + +#ifdef __GLEE_GL_EXT_texture_compression_rgtc +#endif + +/* GL_EXT_texture_shared_exponent */ + +#ifdef __GLEE_GL_EXT_texture_shared_exponent +#endif + +/* GL_NV_depth_buffer_float */ + +#ifdef __GLEE_GL_NV_depth_buffer_float +void __stdcall _Lazy_glDepthRangedNV(GLdouble zNear, GLdouble zFar) {if (GLeeInit()) glDepthRangedNV(zNear, zFar);} +void __stdcall _Lazy_glClearDepthdNV(GLdouble depth) {if (GLeeInit()) glClearDepthdNV(depth);} +void __stdcall _Lazy_glDepthBoundsdNV(GLdouble zmin, GLdouble zmax) {if (GLeeInit()) glDepthBoundsdNV(zmin, zmax);} +PFNGLDEPTHRANGEDNVPROC pglDepthRangedNV=_Lazy_glDepthRangedNV; +PFNGLCLEARDEPTHDNVPROC pglClearDepthdNV=_Lazy_glClearDepthdNV; +PFNGLDEPTHBOUNDSDNVPROC pglDepthBoundsdNV=_Lazy_glDepthBoundsdNV; +#endif + +/* GL_NV_fragment_program4 */ + +#ifdef __GLEE_GL_NV_fragment_program4 +#endif + +/* GL_NV_framebuffer_multisample_coverage */ + +#ifdef __GLEE_GL_NV_framebuffer_multisample_coverage +void __stdcall _Lazy_glRenderbufferStorageMultisampleCoverageNV(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glRenderbufferStorageMultisampleCoverageNV(target, coverageSamples, colorSamples, internalformat, width, height);} +PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC pglRenderbufferStorageMultisampleCoverageNV=_Lazy_glRenderbufferStorageMultisampleCoverageNV; +#endif + +/* GL_EXT_framebuffer_sRGB */ + +#ifdef __GLEE_GL_EXT_framebuffer_sRGB +#endif + +/* GL_NV_geometry_shader4 */ + +#ifdef __GLEE_GL_NV_geometry_shader4 +#endif + +/* GL_NV_parameter_buffer_object */ + +#ifdef __GLEE_GL_NV_parameter_buffer_object +void __stdcall _Lazy_glProgramBufferParametersfvNV(GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat * params) {if (GLeeInit()) glProgramBufferParametersfvNV(target, buffer, index, count, params);} +void __stdcall _Lazy_glProgramBufferParametersIivNV(GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint * params) {if (GLeeInit()) glProgramBufferParametersIivNV(target, buffer, index, count, params);} +void __stdcall _Lazy_glProgramBufferParametersIuivNV(GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint * params) {if (GLeeInit()) glProgramBufferParametersIuivNV(target, buffer, index, count, params);} +PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC pglProgramBufferParametersfvNV=_Lazy_glProgramBufferParametersfvNV; +PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC pglProgramBufferParametersIivNV=_Lazy_glProgramBufferParametersIivNV; +PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC pglProgramBufferParametersIuivNV=_Lazy_glProgramBufferParametersIuivNV; +#endif + +/* GL_EXT_draw_buffers2 */ + +#ifdef __GLEE_GL_EXT_draw_buffers2 +void __stdcall _Lazy_glColorMaskIndexedEXT(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {if (GLeeInit()) glColorMaskIndexedEXT(index, r, g, b, a);} +void __stdcall _Lazy_glGetBooleanIndexedvEXT(GLenum target, GLuint index, GLboolean * data) {if (GLeeInit()) glGetBooleanIndexedvEXT(target, index, data);} +void __stdcall _Lazy_glGetIntegerIndexedvEXT(GLenum target, GLuint index, GLint * data) {if (GLeeInit()) glGetIntegerIndexedvEXT(target, index, data);} +void __stdcall _Lazy_glEnableIndexedEXT(GLenum target, GLuint index) {if (GLeeInit()) glEnableIndexedEXT(target, index);} +void __stdcall _Lazy_glDisableIndexedEXT(GLenum target, GLuint index) {if (GLeeInit()) glDisableIndexedEXT(target, index);} +GLboolean __stdcall _Lazy_glIsEnabledIndexedEXT(GLenum target, GLuint index) {if (GLeeInit()) return glIsEnabledIndexedEXT(target, index); return (GLboolean)0;} +PFNGLCOLORMASKINDEXEDEXTPROC pglColorMaskIndexedEXT=_Lazy_glColorMaskIndexedEXT; +PFNGLGETBOOLEANINDEXEDVEXTPROC pglGetBooleanIndexedvEXT=_Lazy_glGetBooleanIndexedvEXT; +PFNGLGETINTEGERINDEXEDVEXTPROC pglGetIntegerIndexedvEXT=_Lazy_glGetIntegerIndexedvEXT; +PFNGLENABLEINDEXEDEXTPROC pglEnableIndexedEXT=_Lazy_glEnableIndexedEXT; +PFNGLDISABLEINDEXEDEXTPROC pglDisableIndexedEXT=_Lazy_glDisableIndexedEXT; +PFNGLISENABLEDINDEXEDEXTPROC pglIsEnabledIndexedEXT=_Lazy_glIsEnabledIndexedEXT; +#endif + +/* GL_NV_transform_feedback */ + +#ifdef __GLEE_GL_NV_transform_feedback +void __stdcall _Lazy_glBeginTransformFeedbackNV(GLenum primitiveMode) {if (GLeeInit()) glBeginTransformFeedbackNV(primitiveMode);} +void __stdcall _Lazy_glEndTransformFeedbackNV(void) {if (GLeeInit()) glEndTransformFeedbackNV();} +void __stdcall _Lazy_glTransformFeedbackAttribsNV(GLuint count, const GLint * attribs, GLenum bufferMode) {if (GLeeInit()) glTransformFeedbackAttribsNV(count, attribs, bufferMode);} +void __stdcall _Lazy_glBindBufferRangeNV(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {if (GLeeInit()) glBindBufferRangeNV(target, index, buffer, offset, size);} +void __stdcall _Lazy_glBindBufferOffsetNV(GLenum target, GLuint index, GLuint buffer, GLintptr offset) {if (GLeeInit()) glBindBufferOffsetNV(target, index, buffer, offset);} +void __stdcall _Lazy_glBindBufferBaseNV(GLenum target, GLuint index, GLuint buffer) {if (GLeeInit()) glBindBufferBaseNV(target, index, buffer);} +void __stdcall _Lazy_glTransformFeedbackVaryingsNV(GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode) {if (GLeeInit()) glTransformFeedbackVaryingsNV(program, count, locations, bufferMode);} +void __stdcall _Lazy_glActiveVaryingNV(GLuint program, const GLchar * name) {if (GLeeInit()) glActiveVaryingNV(program, name);} +GLint __stdcall _Lazy_glGetVaryingLocationNV(GLuint program, const GLchar * name) {if (GLeeInit()) return glGetVaryingLocationNV(program, name); return (GLint)0;} +void __stdcall _Lazy_glGetActiveVaryingNV(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name) {if (GLeeInit()) glGetActiveVaryingNV(program, index, bufSize, length, size, type, name);} +void __stdcall _Lazy_glGetTransformFeedbackVaryingNV(GLuint program, GLuint index, GLint * location) {if (GLeeInit()) glGetTransformFeedbackVaryingNV(program, index, location);} +PFNGLBEGINTRANSFORMFEEDBACKNVPROC pglBeginTransformFeedbackNV=_Lazy_glBeginTransformFeedbackNV; +PFNGLENDTRANSFORMFEEDBACKNVPROC pglEndTransformFeedbackNV=_Lazy_glEndTransformFeedbackNV; +PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC pglTransformFeedbackAttribsNV=_Lazy_glTransformFeedbackAttribsNV; +PFNGLBINDBUFFERRANGENVPROC pglBindBufferRangeNV=_Lazy_glBindBufferRangeNV; +PFNGLBINDBUFFEROFFSETNVPROC pglBindBufferOffsetNV=_Lazy_glBindBufferOffsetNV; +PFNGLBINDBUFFERBASENVPROC pglBindBufferBaseNV=_Lazy_glBindBufferBaseNV; +PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC pglTransformFeedbackVaryingsNV=_Lazy_glTransformFeedbackVaryingsNV; +PFNGLACTIVEVARYINGNVPROC pglActiveVaryingNV=_Lazy_glActiveVaryingNV; +PFNGLGETVARYINGLOCATIONNVPROC pglGetVaryingLocationNV=_Lazy_glGetVaryingLocationNV; +PFNGLGETACTIVEVARYINGNVPROC pglGetActiveVaryingNV=_Lazy_glGetActiveVaryingNV; +PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC pglGetTransformFeedbackVaryingNV=_Lazy_glGetTransformFeedbackVaryingNV; +#endif + +/* GL_EXT_bindable_uniform */ + +#ifdef __GLEE_GL_EXT_bindable_uniform +void __stdcall _Lazy_glUniformBufferEXT(GLuint program, GLint location, GLuint buffer) {if (GLeeInit()) glUniformBufferEXT(program, location, buffer);} +GLint __stdcall _Lazy_glGetUniformBufferSizeEXT(GLuint program, GLint location) {if (GLeeInit()) return glGetUniformBufferSizeEXT(program, location); return (GLint)0;} +GLintptr __stdcall _Lazy_glGetUniformOffsetEXT(GLuint program, GLint location) {if (GLeeInit()) return glGetUniformOffsetEXT(program, location); return (GLintptr)0;} +PFNGLUNIFORMBUFFEREXTPROC pglUniformBufferEXT=_Lazy_glUniformBufferEXT; +PFNGLGETUNIFORMBUFFERSIZEEXTPROC pglGetUniformBufferSizeEXT=_Lazy_glGetUniformBufferSizeEXT; +PFNGLGETUNIFORMOFFSETEXTPROC pglGetUniformOffsetEXT=_Lazy_glGetUniformOffsetEXT; +#endif + +/* GL_EXT_texture_integer */ + +#ifdef __GLEE_GL_EXT_texture_integer +void __stdcall _Lazy_glTexParameterIivEXT(GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glTexParameterIivEXT(target, pname, params);} +void __stdcall _Lazy_glTexParameterIuivEXT(GLenum target, GLenum pname, const GLuint * params) {if (GLeeInit()) glTexParameterIuivEXT(target, pname, params);} +void __stdcall _Lazy_glGetTexParameterIivEXT(GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetTexParameterIivEXT(target, pname, params);} +void __stdcall _Lazy_glGetTexParameterIuivEXT(GLenum target, GLenum pname, GLuint * params) {if (GLeeInit()) glGetTexParameterIuivEXT(target, pname, params);} +void __stdcall _Lazy_glClearColorIiEXT(GLint red, GLint green, GLint blue, GLint alpha) {if (GLeeInit()) glClearColorIiEXT(red, green, blue, alpha);} +void __stdcall _Lazy_glClearColorIuiEXT(GLuint red, GLuint green, GLuint blue, GLuint alpha) {if (GLeeInit()) glClearColorIuiEXT(red, green, blue, alpha);} +PFNGLTEXPARAMETERIIVEXTPROC pglTexParameterIivEXT=_Lazy_glTexParameterIivEXT; +PFNGLTEXPARAMETERIUIVEXTPROC pglTexParameterIuivEXT=_Lazy_glTexParameterIuivEXT; +PFNGLGETTEXPARAMETERIIVEXTPROC pglGetTexParameterIivEXT=_Lazy_glGetTexParameterIivEXT; +PFNGLGETTEXPARAMETERIUIVEXTPROC pglGetTexParameterIuivEXT=_Lazy_glGetTexParameterIuivEXT; +PFNGLCLEARCOLORIIEXTPROC pglClearColorIiEXT=_Lazy_glClearColorIiEXT; +PFNGLCLEARCOLORIUIEXTPROC pglClearColorIuiEXT=_Lazy_glClearColorIuiEXT; +#endif + +/* GL_GREMEDY_frame_terminator */ + +#ifdef __GLEE_GL_GREMEDY_frame_terminator +void __stdcall _Lazy_glFrameTerminatorGREMEDY(void) {if (GLeeInit()) glFrameTerminatorGREMEDY();} +PFNGLFRAMETERMINATORGREMEDYPROC pglFrameTerminatorGREMEDY=_Lazy_glFrameTerminatorGREMEDY; +#endif + +/* GL_NV_conditional_render */ + +#ifdef __GLEE_GL_NV_conditional_render +void __stdcall _Lazy_glBeginConditionalRenderNV(GLuint id, GLenum mode) {if (GLeeInit()) glBeginConditionalRenderNV(id, mode);} +void __stdcall _Lazy_glEndConditionalRenderNV(void) {if (GLeeInit()) glEndConditionalRenderNV();} +PFNGLBEGINCONDITIONALRENDERNVPROC pglBeginConditionalRenderNV=_Lazy_glBeginConditionalRenderNV; +PFNGLENDCONDITIONALRENDERNVPROC pglEndConditionalRenderNV=_Lazy_glEndConditionalRenderNV; +#endif + +/* GL_NV_present_video */ + +#ifdef __GLEE_GL_NV_present_video +#endif + +/* GL_EXT_transform_feedback */ + +#ifdef __GLEE_GL_EXT_transform_feedback +void __stdcall _Lazy_glBeginTransformFeedbackEXT(GLenum primitiveMode) {if (GLeeInit()) glBeginTransformFeedbackEXT(primitiveMode);} +void __stdcall _Lazy_glEndTransformFeedbackEXT(void) {if (GLeeInit()) glEndTransformFeedbackEXT();} +void __stdcall _Lazy_glBindBufferRangeEXT(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {if (GLeeInit()) glBindBufferRangeEXT(target, index, buffer, offset, size);} +void __stdcall _Lazy_glBindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer, GLintptr offset) {if (GLeeInit()) glBindBufferOffsetEXT(target, index, buffer, offset);} +void __stdcall _Lazy_glBindBufferBaseEXT(GLenum target, GLuint index, GLuint buffer) {if (GLeeInit()) glBindBufferBaseEXT(target, index, buffer);} +void __stdcall _Lazy_glTransformFeedbackVaryingsEXT(GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode) {if (GLeeInit()) glTransformFeedbackVaryingsEXT(program, count, locations, bufferMode);} +void __stdcall _Lazy_glGetTransformFeedbackVaryingEXT(GLuint program, GLuint index, GLint * location) {if (GLeeInit()) glGetTransformFeedbackVaryingEXT(program, index, location);} +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC pglBeginTransformFeedbackEXT=_Lazy_glBeginTransformFeedbackEXT; +PFNGLENDTRANSFORMFEEDBACKEXTPROC pglEndTransformFeedbackEXT=_Lazy_glEndTransformFeedbackEXT; +PFNGLBINDBUFFERRANGEEXTPROC pglBindBufferRangeEXT=_Lazy_glBindBufferRangeEXT; +PFNGLBINDBUFFEROFFSETEXTPROC pglBindBufferOffsetEXT=_Lazy_glBindBufferOffsetEXT; +PFNGLBINDBUFFERBASEEXTPROC pglBindBufferBaseEXT=_Lazy_glBindBufferBaseEXT; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC pglTransformFeedbackVaryingsEXT=_Lazy_glTransformFeedbackVaryingsEXT; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC pglGetTransformFeedbackVaryingEXT=_Lazy_glGetTransformFeedbackVaryingEXT; +#endif + +/* GL_EXT_direct_state_access */ + +#ifdef __GLEE_GL_EXT_direct_state_access +void __stdcall _Lazy_glClientAttribDefaultEXT(GLbitfield mask) {if (GLeeInit()) glClientAttribDefaultEXT(mask);} +void __stdcall _Lazy_glPushClientAttribDefaultEXT(GLbitfield mask) {if (GLeeInit()) glPushClientAttribDefaultEXT(mask);} +void __stdcall _Lazy_glMatrixLoadfEXT(GLenum mode, const GLfloat * m) {if (GLeeInit()) glMatrixLoadfEXT(mode, m);} +void __stdcall _Lazy_glMatrixLoaddEXT(GLenum mode, const GLdouble * m) {if (GLeeInit()) glMatrixLoaddEXT(mode, m);} +void __stdcall _Lazy_glMatrixMultfEXT(GLenum mode, const GLfloat * m) {if (GLeeInit()) glMatrixMultfEXT(mode, m);} +void __stdcall _Lazy_glMatrixMultdEXT(GLenum mode, const GLdouble * m) {if (GLeeInit()) glMatrixMultdEXT(mode, m);} +void __stdcall _Lazy_glMatrixLoadIdentityEXT(GLenum mode) {if (GLeeInit()) glMatrixLoadIdentityEXT(mode);} +void __stdcall _Lazy_glMatrixRotatefEXT(GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glMatrixRotatefEXT(mode, angle, x, y, z);} +void __stdcall _Lazy_glMatrixRotatedEXT(GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glMatrixRotatedEXT(mode, angle, x, y, z);} +void __stdcall _Lazy_glMatrixScalefEXT(GLenum mode, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glMatrixScalefEXT(mode, x, y, z);} +void __stdcall _Lazy_glMatrixScaledEXT(GLenum mode, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glMatrixScaledEXT(mode, x, y, z);} +void __stdcall _Lazy_glMatrixTranslatefEXT(GLenum mode, GLfloat x, GLfloat y, GLfloat z) {if (GLeeInit()) glMatrixTranslatefEXT(mode, x, y, z);} +void __stdcall _Lazy_glMatrixTranslatedEXT(GLenum mode, GLdouble x, GLdouble y, GLdouble z) {if (GLeeInit()) glMatrixTranslatedEXT(mode, x, y, z);} +void __stdcall _Lazy_glMatrixFrustumEXT(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) {if (GLeeInit()) glMatrixFrustumEXT(mode, left, right, bottom, top, zNear, zFar);} +void __stdcall _Lazy_glMatrixOrthoEXT(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) {if (GLeeInit()) glMatrixOrthoEXT(mode, left, right, bottom, top, zNear, zFar);} +void __stdcall _Lazy_glMatrixPopEXT(GLenum mode) {if (GLeeInit()) glMatrixPopEXT(mode);} +void __stdcall _Lazy_glMatrixPushEXT(GLenum mode) {if (GLeeInit()) glMatrixPushEXT(mode);} +void __stdcall _Lazy_glMatrixLoadTransposefEXT(GLenum mode, const GLfloat * m) {if (GLeeInit()) glMatrixLoadTransposefEXT(mode, m);} +void __stdcall _Lazy_glMatrixLoadTransposedEXT(GLenum mode, const GLdouble * m) {if (GLeeInit()) glMatrixLoadTransposedEXT(mode, m);} +void __stdcall _Lazy_glMatrixMultTransposefEXT(GLenum mode, const GLfloat * m) {if (GLeeInit()) glMatrixMultTransposefEXT(mode, m);} +void __stdcall _Lazy_glMatrixMultTransposedEXT(GLenum mode, const GLdouble * m) {if (GLeeInit()) glMatrixMultTransposedEXT(mode, m);} +void __stdcall _Lazy_glTextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glTextureParameterfEXT(texture, target, pname, param);} +void __stdcall _Lazy_glTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glTextureParameterfvEXT(texture, target, pname, params);} +void __stdcall _Lazy_glTextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glTextureParameteriEXT(texture, target, pname, param);} +void __stdcall _Lazy_glTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glTextureParameterivEXT(texture, target, pname, params);} +void __stdcall _Lazy_glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, pixels);} +void __stdcall _Lazy_glTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, pixels);} +void __stdcall _Lazy_glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, pixels);} +void __stdcall _Lazy_glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, pixels);} +void __stdcall _Lazy_glCopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {if (GLeeInit()) glCopyTextureImage1DEXT(texture, target, level, internalformat, x, y, width, border);} +void __stdcall _Lazy_glCopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {if (GLeeInit()) glCopyTextureImage2DEXT(texture, target, level, internalformat, x, y, width, height, border);} +void __stdcall _Lazy_glCopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyTextureSubImage1DEXT(texture, target, level, xoffset, x, y, width);} +void __stdcall _Lazy_glCopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, x, y, width, height);} +void __stdcall _Lazy_glGetTextureImageEXT(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) {if (GLeeInit()) glGetTextureImageEXT(texture, target, level, format, type, pixels);} +void __stdcall _Lazy_glGetTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetTextureParameterfvEXT(texture, target, pname, params);} +void __stdcall _Lazy_glGetTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetTextureParameterivEXT(texture, target, pname, params);} +void __stdcall _Lazy_glGetTextureLevelParameterfvEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetTextureLevelParameterfvEXT(texture, target, level, pname, params);} +void __stdcall _Lazy_glGetTextureLevelParameterivEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLint * params) {if (GLeeInit()) glGetTextureLevelParameterivEXT(texture, target, level, pname, params);} +void __stdcall _Lazy_glTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, pixels);} +void __stdcall _Lazy_glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);} +void __stdcall _Lazy_glCopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, x, y, width, height);} +void __stdcall _Lazy_glMultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glMultiTexParameterfEXT(texunit, target, pname, param);} +void __stdcall _Lazy_glMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glMultiTexParameterfvEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glMultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glMultiTexParameteriEXT(texunit, target, pname, param);} +void __stdcall _Lazy_glMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glMultiTexParameterivEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, pixels);} +void __stdcall _Lazy_glMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, pixels);} +void __stdcall _Lazy_glMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, pixels);} +void __stdcall _Lazy_glMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels);} +void __stdcall _Lazy_glCopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {if (GLeeInit()) glCopyMultiTexImage1DEXT(texunit, target, level, internalformat, x, y, width, border);} +void __stdcall _Lazy_glCopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {if (GLeeInit()) glCopyMultiTexImage2DEXT(texunit, target, level, internalformat, x, y, width, height, border);} +void __stdcall _Lazy_glCopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {if (GLeeInit()) glCopyMultiTexSubImage1DEXT(texunit, target, level, xoffset, x, y, width);} +void __stdcall _Lazy_glCopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, x, y, width, height);} +void __stdcall _Lazy_glGetMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) {if (GLeeInit()) glGetMultiTexImageEXT(texunit, target, level, format, type, pixels);} +void __stdcall _Lazy_glGetMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMultiTexParameterfvEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glGetMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexParameterivEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glGetMultiTexLevelParameterfvEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMultiTexLevelParameterfvEXT(texunit, target, level, pname, params);} +void __stdcall _Lazy_glGetMultiTexLevelParameterivEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexLevelParameterivEXT(texunit, target, level, pname, params);} +void __stdcall _Lazy_glMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels);} +void __stdcall _Lazy_glMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) {if (GLeeInit()) glMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);} +void __stdcall _Lazy_glCopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {if (GLeeInit()) glCopyMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, x, y, width, height);} +void __stdcall _Lazy_glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture) {if (GLeeInit()) glBindMultiTextureEXT(texunit, target, texture);} +void __stdcall _Lazy_glEnableClientStateIndexedEXT(GLenum array, GLuint index) {if (GLeeInit()) glEnableClientStateIndexedEXT(array, index);} +void __stdcall _Lazy_glDisableClientStateIndexedEXT(GLenum array, GLuint index) {if (GLeeInit()) glDisableClientStateIndexedEXT(array, index);} +void __stdcall _Lazy_glMultiTexCoordPointerEXT(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {if (GLeeInit()) glMultiTexCoordPointerEXT(texunit, size, type, stride, pointer);} +void __stdcall _Lazy_glMultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {if (GLeeInit()) glMultiTexEnvfEXT(texunit, target, pname, param);} +void __stdcall _Lazy_glMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat * params) {if (GLeeInit()) glMultiTexEnvfvEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glMultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) {if (GLeeInit()) glMultiTexEnviEXT(texunit, target, pname, param);} +void __stdcall _Lazy_glMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glMultiTexEnvivEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glMultiTexGendEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) {if (GLeeInit()) glMultiTexGendEXT(texunit, coord, pname, param);} +void __stdcall _Lazy_glMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLdouble * params) {if (GLeeInit()) glMultiTexGendvEXT(texunit, coord, pname, params);} +void __stdcall _Lazy_glMultiTexGenfEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) {if (GLeeInit()) glMultiTexGenfEXT(texunit, coord, pname, param);} +void __stdcall _Lazy_glMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLfloat * params) {if (GLeeInit()) glMultiTexGenfvEXT(texunit, coord, pname, params);} +void __stdcall _Lazy_glMultiTexGeniEXT(GLenum texunit, GLenum coord, GLenum pname, GLint param) {if (GLeeInit()) glMultiTexGeniEXT(texunit, coord, pname, param);} +void __stdcall _Lazy_glMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, const GLint * params) {if (GLeeInit()) glMultiTexGenivEXT(texunit, coord, pname, params);} +void __stdcall _Lazy_glGetMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMultiTexEnvfvEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glGetMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexEnvivEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glGetMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble * params) {if (GLeeInit()) glGetMultiTexGendvEXT(texunit, coord, pname, params);} +void __stdcall _Lazy_glGetMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetMultiTexGenfvEXT(texunit, coord, pname, params);} +void __stdcall _Lazy_glGetMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexGenivEXT(texunit, coord, pname, params);} +void __stdcall _Lazy_glGetFloatIndexedvEXT(GLenum target, GLuint index, GLfloat * data) {if (GLeeInit()) glGetFloatIndexedvEXT(target, index, data);} +void __stdcall _Lazy_glGetDoubleIndexedvEXT(GLenum target, GLuint index, GLdouble * data) {if (GLeeInit()) glGetDoubleIndexedvEXT(target, index, data);} +void __stdcall _Lazy_glGetPointerIndexedvEXT(GLenum target, GLuint index, GLvoid* * data) {if (GLeeInit()) glGetPointerIndexedvEXT(target, index, data);} +void __stdcall _Lazy_glCompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, imageSize, bits);} +void __stdcall _Lazy_glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureImage2DEXT(texture, target, level, internalformat, width, height, border, imageSize, bits);} +void __stdcall _Lazy_glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureImage1DEXT(texture, target, level, internalformat, width, border, imageSize, bits);} +void __stdcall _Lazy_glCompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);} +void __stdcall _Lazy_glCompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, imageSize, bits);} +void __stdcall _Lazy_glCompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedTextureSubImage1DEXT(texture, target, level, xoffset, width, format, imageSize, bits);} +void __stdcall _Lazy_glGetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint lod, GLvoid * img) {if (GLeeInit()) glGetCompressedTextureImageEXT(texture, target, lod, img);} +void __stdcall _Lazy_glCompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, imageSize, bits);} +void __stdcall _Lazy_glCompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, imageSize, bits);} +void __stdcall _Lazy_glCompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, imageSize, bits);} +void __stdcall _Lazy_glCompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);} +void __stdcall _Lazy_glCompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, imageSize, bits);} +void __stdcall _Lazy_glCompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * bits) {if (GLeeInit()) glCompressedMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, imageSize, bits);} +void __stdcall _Lazy_glGetCompressedMultiTexImageEXT(GLenum texunit, GLenum target, GLint lod, GLvoid * img) {if (GLeeInit()) glGetCompressedMultiTexImageEXT(texunit, target, lod, img);} +void __stdcall _Lazy_glNamedProgramStringEXT(GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid * string) {if (GLeeInit()) glNamedProgramStringEXT(program, target, format, len, string);} +void __stdcall _Lazy_glNamedProgramLocalParameter4dEXT(GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {if (GLeeInit()) glNamedProgramLocalParameter4dEXT(program, target, index, x, y, z, w);} +void __stdcall _Lazy_glNamedProgramLocalParameter4dvEXT(GLuint program, GLenum target, GLuint index, const GLdouble * params) {if (GLeeInit()) glNamedProgramLocalParameter4dvEXT(program, target, index, params);} +void __stdcall _Lazy_glNamedProgramLocalParameter4fEXT(GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {if (GLeeInit()) glNamedProgramLocalParameter4fEXT(program, target, index, x, y, z, w);} +void __stdcall _Lazy_glNamedProgramLocalParameter4fvEXT(GLuint program, GLenum target, GLuint index, const GLfloat * params) {if (GLeeInit()) glNamedProgramLocalParameter4fvEXT(program, target, index, params);} +void __stdcall _Lazy_glGetNamedProgramLocalParameterdvEXT(GLuint program, GLenum target, GLuint index, GLdouble * params) {if (GLeeInit()) glGetNamedProgramLocalParameterdvEXT(program, target, index, params);} +void __stdcall _Lazy_glGetNamedProgramLocalParameterfvEXT(GLuint program, GLenum target, GLuint index, GLfloat * params) {if (GLeeInit()) glGetNamedProgramLocalParameterfvEXT(program, target, index, params);} +void __stdcall _Lazy_glGetNamedProgramivEXT(GLuint program, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetNamedProgramivEXT(program, target, pname, params);} +void __stdcall _Lazy_glGetNamedProgramStringEXT(GLuint program, GLenum target, GLenum pname, GLvoid * string) {if (GLeeInit()) glGetNamedProgramStringEXT(program, target, pname, string);} +void __stdcall _Lazy_glNamedProgramLocalParameters4fvEXT(GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat * params) {if (GLeeInit()) glNamedProgramLocalParameters4fvEXT(program, target, index, count, params);} +void __stdcall _Lazy_glNamedProgramLocalParameterI4iEXT(GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) {if (GLeeInit()) glNamedProgramLocalParameterI4iEXT(program, target, index, x, y, z, w);} +void __stdcall _Lazy_glNamedProgramLocalParameterI4ivEXT(GLuint program, GLenum target, GLuint index, const GLint * params) {if (GLeeInit()) glNamedProgramLocalParameterI4ivEXT(program, target, index, params);} +void __stdcall _Lazy_glNamedProgramLocalParametersI4ivEXT(GLuint program, GLenum target, GLuint index, GLsizei count, const GLint * params) {if (GLeeInit()) glNamedProgramLocalParametersI4ivEXT(program, target, index, count, params);} +void __stdcall _Lazy_glNamedProgramLocalParameterI4uiEXT(GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {if (GLeeInit()) glNamedProgramLocalParameterI4uiEXT(program, target, index, x, y, z, w);} +void __stdcall _Lazy_glNamedProgramLocalParameterI4uivEXT(GLuint program, GLenum target, GLuint index, const GLuint * params) {if (GLeeInit()) glNamedProgramLocalParameterI4uivEXT(program, target, index, params);} +void __stdcall _Lazy_glNamedProgramLocalParametersI4uivEXT(GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint * params) {if (GLeeInit()) glNamedProgramLocalParametersI4uivEXT(program, target, index, count, params);} +void __stdcall _Lazy_glGetNamedProgramLocalParameterIivEXT(GLuint program, GLenum target, GLuint index, GLint * params) {if (GLeeInit()) glGetNamedProgramLocalParameterIivEXT(program, target, index, params);} +void __stdcall _Lazy_glGetNamedProgramLocalParameterIuivEXT(GLuint program, GLenum target, GLuint index, GLuint * params) {if (GLeeInit()) glGetNamedProgramLocalParameterIuivEXT(program, target, index, params);} +void __stdcall _Lazy_glTextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glTextureParameterIivEXT(texture, target, pname, params);} +void __stdcall _Lazy_glTextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, const GLuint * params) {if (GLeeInit()) glTextureParameterIuivEXT(texture, target, pname, params);} +void __stdcall _Lazy_glGetTextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetTextureParameterIivEXT(texture, target, pname, params);} +void __stdcall _Lazy_glGetTextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, GLuint * params) {if (GLeeInit()) glGetTextureParameterIuivEXT(texture, target, pname, params);} +void __stdcall _Lazy_glMultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint * params) {if (GLeeInit()) glMultiTexParameterIivEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glMultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, const GLuint * params) {if (GLeeInit()) glMultiTexParameterIuivEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glGetMultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, GLint * params) {if (GLeeInit()) glGetMultiTexParameterIivEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glGetMultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, GLuint * params) {if (GLeeInit()) glGetMultiTexParameterIuivEXT(texunit, target, pname, params);} +void __stdcall _Lazy_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat v0) {if (GLeeInit()) glProgramUniform1fEXT(program, location, v0);} +void __stdcall _Lazy_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1) {if (GLeeInit()) glProgramUniform2fEXT(program, location, v0, v1);} +void __stdcall _Lazy_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {if (GLeeInit()) glProgramUniform3fEXT(program, location, v0, v1, v2);} +void __stdcall _Lazy_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {if (GLeeInit()) glProgramUniform4fEXT(program, location, v0, v1, v2, v3);} +void __stdcall _Lazy_glProgramUniform1iEXT(GLuint program, GLint location, GLint v0) {if (GLeeInit()) glProgramUniform1iEXT(program, location, v0);} +void __stdcall _Lazy_glProgramUniform2iEXT(GLuint program, GLint location, GLint v0, GLint v1) {if (GLeeInit()) glProgramUniform2iEXT(program, location, v0, v1);} +void __stdcall _Lazy_glProgramUniform3iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2) {if (GLeeInit()) glProgramUniform3iEXT(program, location, v0, v1, v2);} +void __stdcall _Lazy_glProgramUniform4iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {if (GLeeInit()) glProgramUniform4iEXT(program, location, v0, v1, v2, v3);} +void __stdcall _Lazy_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glProgramUniform1fvEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glProgramUniform2fvEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glProgramUniform3fvEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {if (GLeeInit()) glProgramUniform4fvEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glProgramUniform1ivEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glProgramUniform2ivEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glProgramUniform3ivEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {if (GLeeInit()) glProgramUniform4ivEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix2fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix3fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix4fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniformMatrix2x3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix2x3fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniformMatrix3x2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix3x2fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniformMatrix2x4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix2x4fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniformMatrix4x2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix4x2fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniformMatrix3x4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix3x4fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniformMatrix4x3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {if (GLeeInit()) glProgramUniformMatrix4x3fvEXT(program, location, count, transpose, value);} +void __stdcall _Lazy_glProgramUniform1uiEXT(GLuint program, GLint location, GLuint v0) {if (GLeeInit()) glProgramUniform1uiEXT(program, location, v0);} +void __stdcall _Lazy_glProgramUniform2uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1) {if (GLeeInit()) glProgramUniform2uiEXT(program, location, v0, v1);} +void __stdcall _Lazy_glProgramUniform3uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) {if (GLeeInit()) glProgramUniform3uiEXT(program, location, v0, v1, v2);} +void __stdcall _Lazy_glProgramUniform4uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {if (GLeeInit()) glProgramUniform4uiEXT(program, location, v0, v1, v2, v3);} +void __stdcall _Lazy_glProgramUniform1uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glProgramUniform1uivEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform2uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glProgramUniform2uivEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform3uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glProgramUniform3uivEXT(program, location, count, value);} +void __stdcall _Lazy_glProgramUniform4uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {if (GLeeInit()) glProgramUniform4uivEXT(program, location, count, value);} +void __stdcall _Lazy_glNamedBufferDataEXT(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLenum usage) {if (GLeeInit()) glNamedBufferDataEXT(buffer, size, data, usage);} +void __stdcall _Lazy_glNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid * data) {if (GLeeInit()) glNamedBufferSubDataEXT(buffer, offset, size, data);} +GLvoid* __stdcall _Lazy_glMapNamedBufferEXT(GLuint buffer, GLenum access) {if (GLeeInit()) return glMapNamedBufferEXT(buffer, access); return (GLvoid*)0;} +GLboolean __stdcall _Lazy_glUnmapNamedBufferEXT(GLuint buffer) {if (GLeeInit()) return glUnmapNamedBufferEXT(buffer); return (GLboolean)0;} +void __stdcall _Lazy_glGetNamedBufferParameterivEXT(GLuint buffer, GLenum pname, GLint * params) {if (GLeeInit()) glGetNamedBufferParameterivEXT(buffer, pname, params);} +void __stdcall _Lazy_glGetNamedBufferPointervEXT(GLuint buffer, GLenum pname, GLvoid* * params) {if (GLeeInit()) glGetNamedBufferPointervEXT(buffer, pname, params);} +void __stdcall _Lazy_glGetNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data) {if (GLeeInit()) glGetNamedBufferSubDataEXT(buffer, offset, size, data);} +void __stdcall _Lazy_glTextureBufferEXT(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer) {if (GLeeInit()) glTextureBufferEXT(texture, target, internalformat, buffer);} +void __stdcall _Lazy_glMultiTexBufferEXT(GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer) {if (GLeeInit()) glMultiTexBufferEXT(texunit, target, internalformat, buffer);} +void __stdcall _Lazy_glNamedRenderbufferStorageEXT(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glNamedRenderbufferStorageEXT(renderbuffer, internalformat, width, height);} +void __stdcall _Lazy_glGetNamedRenderbufferParameterivEXT(GLuint renderbuffer, GLenum pname, GLint * params) {if (GLeeInit()) glGetNamedRenderbufferParameterivEXT(renderbuffer, pname, params);} +GLenum __stdcall _Lazy_glCheckNamedFramebufferStatusEXT(GLuint framebuffer, GLenum target) {if (GLeeInit()) return glCheckNamedFramebufferStatusEXT(framebuffer, target); return (GLenum)0;} +void __stdcall _Lazy_glNamedFramebufferTexture1DEXT(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glNamedFramebufferTexture1DEXT(framebuffer, attachment, textarget, texture, level);} +void __stdcall _Lazy_glNamedFramebufferTexture2DEXT(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {if (GLeeInit()) glNamedFramebufferTexture2DEXT(framebuffer, attachment, textarget, texture, level);} +void __stdcall _Lazy_glNamedFramebufferTexture3DEXT(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {if (GLeeInit()) glNamedFramebufferTexture3DEXT(framebuffer, attachment, textarget, texture, level, zoffset);} +void __stdcall _Lazy_glNamedFramebufferRenderbufferEXT(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {if (GLeeInit()) glNamedFramebufferRenderbufferEXT(framebuffer, attachment, renderbuffertarget, renderbuffer);} +void __stdcall _Lazy_glGetNamedFramebufferAttachmentParameterivEXT(GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params) {if (GLeeInit()) glGetNamedFramebufferAttachmentParameterivEXT(framebuffer, attachment, pname, params);} +void __stdcall _Lazy_glGenerateTextureMipmapEXT(GLuint texture, GLenum target) {if (GLeeInit()) glGenerateTextureMipmapEXT(texture, target);} +void __stdcall _Lazy_glGenerateMultiTexMipmapEXT(GLenum texunit, GLenum target) {if (GLeeInit()) glGenerateMultiTexMipmapEXT(texunit, target);} +void __stdcall _Lazy_glFramebufferDrawBufferEXT(GLuint framebuffer, GLenum mode) {if (GLeeInit()) glFramebufferDrawBufferEXT(framebuffer, mode);} +void __stdcall _Lazy_glFramebufferDrawBuffersEXT(GLuint framebuffer, GLsizei n, const GLenum * bufs) {if (GLeeInit()) glFramebufferDrawBuffersEXT(framebuffer, n, bufs);} +void __stdcall _Lazy_glFramebufferReadBufferEXT(GLuint framebuffer, GLenum mode) {if (GLeeInit()) glFramebufferReadBufferEXT(framebuffer, mode);} +void __stdcall _Lazy_glGetFramebufferParameterivEXT(GLuint framebuffer, GLenum pname, GLint * params) {if (GLeeInit()) glGetFramebufferParameterivEXT(framebuffer, pname, params);} +void __stdcall _Lazy_glNamedRenderbufferStorageMultisampleEXT(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glNamedRenderbufferStorageMultisampleEXT(renderbuffer, samples, internalformat, width, height);} +void __stdcall _Lazy_glNamedRenderbufferStorageMultisampleCoverageEXT(GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) {if (GLeeInit()) glNamedRenderbufferStorageMultisampleCoverageEXT(renderbuffer, coverageSamples, colorSamples, internalformat, width, height);} +void __stdcall _Lazy_glNamedFramebufferTextureEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) {if (GLeeInit()) glNamedFramebufferTextureEXT(framebuffer, attachment, texture, level);} +void __stdcall _Lazy_glNamedFramebufferTextureLayerEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer) {if (GLeeInit()) glNamedFramebufferTextureLayerEXT(framebuffer, attachment, texture, level, layer);} +void __stdcall _Lazy_glNamedFramebufferTextureFaceEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face) {if (GLeeInit()) glNamedFramebufferTextureFaceEXT(framebuffer, attachment, texture, level, face);} +void __stdcall _Lazy_glTextureRenderbufferEXT(GLuint texture, GLenum target, GLuint renderbuffer) {if (GLeeInit()) glTextureRenderbufferEXT(texture, target, renderbuffer);} +void __stdcall _Lazy_glMultiTexRenderbufferEXT(GLenum texunit, GLenum target, GLuint renderbuffer) {if (GLeeInit()) glMultiTexRenderbufferEXT(texunit, target, renderbuffer);} +PFNGLCLIENTATTRIBDEFAULTEXTPROC pglClientAttribDefaultEXT=_Lazy_glClientAttribDefaultEXT; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC pglPushClientAttribDefaultEXT=_Lazy_glPushClientAttribDefaultEXT; +PFNGLMATRIXLOADFEXTPROC pglMatrixLoadfEXT=_Lazy_glMatrixLoadfEXT; +PFNGLMATRIXLOADDEXTPROC pglMatrixLoaddEXT=_Lazy_glMatrixLoaddEXT; +PFNGLMATRIXMULTFEXTPROC pglMatrixMultfEXT=_Lazy_glMatrixMultfEXT; +PFNGLMATRIXMULTDEXTPROC pglMatrixMultdEXT=_Lazy_glMatrixMultdEXT; +PFNGLMATRIXLOADIDENTITYEXTPROC pglMatrixLoadIdentityEXT=_Lazy_glMatrixLoadIdentityEXT; +PFNGLMATRIXROTATEFEXTPROC pglMatrixRotatefEXT=_Lazy_glMatrixRotatefEXT; +PFNGLMATRIXROTATEDEXTPROC pglMatrixRotatedEXT=_Lazy_glMatrixRotatedEXT; +PFNGLMATRIXSCALEFEXTPROC pglMatrixScalefEXT=_Lazy_glMatrixScalefEXT; +PFNGLMATRIXSCALEDEXTPROC pglMatrixScaledEXT=_Lazy_glMatrixScaledEXT; +PFNGLMATRIXTRANSLATEFEXTPROC pglMatrixTranslatefEXT=_Lazy_glMatrixTranslatefEXT; +PFNGLMATRIXTRANSLATEDEXTPROC pglMatrixTranslatedEXT=_Lazy_glMatrixTranslatedEXT; +PFNGLMATRIXFRUSTUMEXTPROC pglMatrixFrustumEXT=_Lazy_glMatrixFrustumEXT; +PFNGLMATRIXORTHOEXTPROC pglMatrixOrthoEXT=_Lazy_glMatrixOrthoEXT; +PFNGLMATRIXPOPEXTPROC pglMatrixPopEXT=_Lazy_glMatrixPopEXT; +PFNGLMATRIXPUSHEXTPROC pglMatrixPushEXT=_Lazy_glMatrixPushEXT; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC pglMatrixLoadTransposefEXT=_Lazy_glMatrixLoadTransposefEXT; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC pglMatrixLoadTransposedEXT=_Lazy_glMatrixLoadTransposedEXT; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC pglMatrixMultTransposefEXT=_Lazy_glMatrixMultTransposefEXT; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC pglMatrixMultTransposedEXT=_Lazy_glMatrixMultTransposedEXT; +PFNGLTEXTUREPARAMETERFEXTPROC pglTextureParameterfEXT=_Lazy_glTextureParameterfEXT; +PFNGLTEXTUREPARAMETERFVEXTPROC pglTextureParameterfvEXT=_Lazy_glTextureParameterfvEXT; +PFNGLTEXTUREPARAMETERIEXTPROC pglTextureParameteriEXT=_Lazy_glTextureParameteriEXT; +PFNGLTEXTUREPARAMETERIVEXTPROC pglTextureParameterivEXT=_Lazy_glTextureParameterivEXT; +PFNGLTEXTUREIMAGE1DEXTPROC pglTextureImage1DEXT=_Lazy_glTextureImage1DEXT; +PFNGLTEXTUREIMAGE2DEXTPROC pglTextureImage2DEXT=_Lazy_glTextureImage2DEXT; +PFNGLTEXTURESUBIMAGE1DEXTPROC pglTextureSubImage1DEXT=_Lazy_glTextureSubImage1DEXT; +PFNGLTEXTURESUBIMAGE2DEXTPROC pglTextureSubImage2DEXT=_Lazy_glTextureSubImage2DEXT; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC pglCopyTextureImage1DEXT=_Lazy_glCopyTextureImage1DEXT; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC pglCopyTextureImage2DEXT=_Lazy_glCopyTextureImage2DEXT; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC pglCopyTextureSubImage1DEXT=_Lazy_glCopyTextureSubImage1DEXT; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC pglCopyTextureSubImage2DEXT=_Lazy_glCopyTextureSubImage2DEXT; +PFNGLGETTEXTUREIMAGEEXTPROC pglGetTextureImageEXT=_Lazy_glGetTextureImageEXT; +PFNGLGETTEXTUREPARAMETERFVEXTPROC pglGetTextureParameterfvEXT=_Lazy_glGetTextureParameterfvEXT; +PFNGLGETTEXTUREPARAMETERIVEXTPROC pglGetTextureParameterivEXT=_Lazy_glGetTextureParameterivEXT; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC pglGetTextureLevelParameterfvEXT=_Lazy_glGetTextureLevelParameterfvEXT; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC pglGetTextureLevelParameterivEXT=_Lazy_glGetTextureLevelParameterivEXT; +PFNGLTEXTUREIMAGE3DEXTPROC pglTextureImage3DEXT=_Lazy_glTextureImage3DEXT; +PFNGLTEXTURESUBIMAGE3DEXTPROC pglTextureSubImage3DEXT=_Lazy_glTextureSubImage3DEXT; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC pglCopyTextureSubImage3DEXT=_Lazy_glCopyTextureSubImage3DEXT; +PFNGLMULTITEXPARAMETERFEXTPROC pglMultiTexParameterfEXT=_Lazy_glMultiTexParameterfEXT; +PFNGLMULTITEXPARAMETERFVEXTPROC pglMultiTexParameterfvEXT=_Lazy_glMultiTexParameterfvEXT; +PFNGLMULTITEXPARAMETERIEXTPROC pglMultiTexParameteriEXT=_Lazy_glMultiTexParameteriEXT; +PFNGLMULTITEXPARAMETERIVEXTPROC pglMultiTexParameterivEXT=_Lazy_glMultiTexParameterivEXT; +PFNGLMULTITEXIMAGE1DEXTPROC pglMultiTexImage1DEXT=_Lazy_glMultiTexImage1DEXT; +PFNGLMULTITEXIMAGE2DEXTPROC pglMultiTexImage2DEXT=_Lazy_glMultiTexImage2DEXT; +PFNGLMULTITEXSUBIMAGE1DEXTPROC pglMultiTexSubImage1DEXT=_Lazy_glMultiTexSubImage1DEXT; +PFNGLMULTITEXSUBIMAGE2DEXTPROC pglMultiTexSubImage2DEXT=_Lazy_glMultiTexSubImage2DEXT; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC pglCopyMultiTexImage1DEXT=_Lazy_glCopyMultiTexImage1DEXT; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC pglCopyMultiTexImage2DEXT=_Lazy_glCopyMultiTexImage2DEXT; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC pglCopyMultiTexSubImage1DEXT=_Lazy_glCopyMultiTexSubImage1DEXT; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC pglCopyMultiTexSubImage2DEXT=_Lazy_glCopyMultiTexSubImage2DEXT; +PFNGLGETMULTITEXIMAGEEXTPROC pglGetMultiTexImageEXT=_Lazy_glGetMultiTexImageEXT; +PFNGLGETMULTITEXPARAMETERFVEXTPROC pglGetMultiTexParameterfvEXT=_Lazy_glGetMultiTexParameterfvEXT; +PFNGLGETMULTITEXPARAMETERIVEXTPROC pglGetMultiTexParameterivEXT=_Lazy_glGetMultiTexParameterivEXT; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC pglGetMultiTexLevelParameterfvEXT=_Lazy_glGetMultiTexLevelParameterfvEXT; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC pglGetMultiTexLevelParameterivEXT=_Lazy_glGetMultiTexLevelParameterivEXT; +PFNGLMULTITEXIMAGE3DEXTPROC pglMultiTexImage3DEXT=_Lazy_glMultiTexImage3DEXT; +PFNGLMULTITEXSUBIMAGE3DEXTPROC pglMultiTexSubImage3DEXT=_Lazy_glMultiTexSubImage3DEXT; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC pglCopyMultiTexSubImage3DEXT=_Lazy_glCopyMultiTexSubImage3DEXT; +PFNGLBINDMULTITEXTUREEXTPROC pglBindMultiTextureEXT=_Lazy_glBindMultiTextureEXT; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC pglEnableClientStateIndexedEXT=_Lazy_glEnableClientStateIndexedEXT; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC pglDisableClientStateIndexedEXT=_Lazy_glDisableClientStateIndexedEXT; +PFNGLMULTITEXCOORDPOINTEREXTPROC pglMultiTexCoordPointerEXT=_Lazy_glMultiTexCoordPointerEXT; +PFNGLMULTITEXENVFEXTPROC pglMultiTexEnvfEXT=_Lazy_glMultiTexEnvfEXT; +PFNGLMULTITEXENVFVEXTPROC pglMultiTexEnvfvEXT=_Lazy_glMultiTexEnvfvEXT; +PFNGLMULTITEXENVIEXTPROC pglMultiTexEnviEXT=_Lazy_glMultiTexEnviEXT; +PFNGLMULTITEXENVIVEXTPROC pglMultiTexEnvivEXT=_Lazy_glMultiTexEnvivEXT; +PFNGLMULTITEXGENDEXTPROC pglMultiTexGendEXT=_Lazy_glMultiTexGendEXT; +PFNGLMULTITEXGENDVEXTPROC pglMultiTexGendvEXT=_Lazy_glMultiTexGendvEXT; +PFNGLMULTITEXGENFEXTPROC pglMultiTexGenfEXT=_Lazy_glMultiTexGenfEXT; +PFNGLMULTITEXGENFVEXTPROC pglMultiTexGenfvEXT=_Lazy_glMultiTexGenfvEXT; +PFNGLMULTITEXGENIEXTPROC pglMultiTexGeniEXT=_Lazy_glMultiTexGeniEXT; +PFNGLMULTITEXGENIVEXTPROC pglMultiTexGenivEXT=_Lazy_glMultiTexGenivEXT; +PFNGLGETMULTITEXENVFVEXTPROC pglGetMultiTexEnvfvEXT=_Lazy_glGetMultiTexEnvfvEXT; +PFNGLGETMULTITEXENVIVEXTPROC pglGetMultiTexEnvivEXT=_Lazy_glGetMultiTexEnvivEXT; +PFNGLGETMULTITEXGENDVEXTPROC pglGetMultiTexGendvEXT=_Lazy_glGetMultiTexGendvEXT; +PFNGLGETMULTITEXGENFVEXTPROC pglGetMultiTexGenfvEXT=_Lazy_glGetMultiTexGenfvEXT; +PFNGLGETMULTITEXGENIVEXTPROC pglGetMultiTexGenivEXT=_Lazy_glGetMultiTexGenivEXT; +PFNGLGETFLOATINDEXEDVEXTPROC pglGetFloatIndexedvEXT=_Lazy_glGetFloatIndexedvEXT; +PFNGLGETDOUBLEINDEXEDVEXTPROC pglGetDoubleIndexedvEXT=_Lazy_glGetDoubleIndexedvEXT; +PFNGLGETPOINTERINDEXEDVEXTPROC pglGetPointerIndexedvEXT=_Lazy_glGetPointerIndexedvEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC pglCompressedTextureImage3DEXT=_Lazy_glCompressedTextureImage3DEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC pglCompressedTextureImage2DEXT=_Lazy_glCompressedTextureImage2DEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC pglCompressedTextureImage1DEXT=_Lazy_glCompressedTextureImage1DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC pglCompressedTextureSubImage3DEXT=_Lazy_glCompressedTextureSubImage3DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC pglCompressedTextureSubImage2DEXT=_Lazy_glCompressedTextureSubImage2DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC pglCompressedTextureSubImage1DEXT=_Lazy_glCompressedTextureSubImage1DEXT; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC pglGetCompressedTextureImageEXT=_Lazy_glGetCompressedTextureImageEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC pglCompressedMultiTexImage3DEXT=_Lazy_glCompressedMultiTexImage3DEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC pglCompressedMultiTexImage2DEXT=_Lazy_glCompressedMultiTexImage2DEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC pglCompressedMultiTexImage1DEXT=_Lazy_glCompressedMultiTexImage1DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC pglCompressedMultiTexSubImage3DEXT=_Lazy_glCompressedMultiTexSubImage3DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC pglCompressedMultiTexSubImage2DEXT=_Lazy_glCompressedMultiTexSubImage2DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC pglCompressedMultiTexSubImage1DEXT=_Lazy_glCompressedMultiTexSubImage1DEXT; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC pglGetCompressedMultiTexImageEXT=_Lazy_glGetCompressedMultiTexImageEXT; +PFNGLNAMEDPROGRAMSTRINGEXTPROC pglNamedProgramStringEXT=_Lazy_glNamedProgramStringEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC pglNamedProgramLocalParameter4dEXT=_Lazy_glNamedProgramLocalParameter4dEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC pglNamedProgramLocalParameter4dvEXT=_Lazy_glNamedProgramLocalParameter4dvEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC pglNamedProgramLocalParameter4fEXT=_Lazy_glNamedProgramLocalParameter4fEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC pglNamedProgramLocalParameter4fvEXT=_Lazy_glNamedProgramLocalParameter4fvEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC pglGetNamedProgramLocalParameterdvEXT=_Lazy_glGetNamedProgramLocalParameterdvEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC pglGetNamedProgramLocalParameterfvEXT=_Lazy_glGetNamedProgramLocalParameterfvEXT; +PFNGLGETNAMEDPROGRAMIVEXTPROC pglGetNamedProgramivEXT=_Lazy_glGetNamedProgramivEXT; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC pglGetNamedProgramStringEXT=_Lazy_glGetNamedProgramStringEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC pglNamedProgramLocalParameters4fvEXT=_Lazy_glNamedProgramLocalParameters4fvEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC pglNamedProgramLocalParameterI4iEXT=_Lazy_glNamedProgramLocalParameterI4iEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC pglNamedProgramLocalParameterI4ivEXT=_Lazy_glNamedProgramLocalParameterI4ivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC pglNamedProgramLocalParametersI4ivEXT=_Lazy_glNamedProgramLocalParametersI4ivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC pglNamedProgramLocalParameterI4uiEXT=_Lazy_glNamedProgramLocalParameterI4uiEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC pglNamedProgramLocalParameterI4uivEXT=_Lazy_glNamedProgramLocalParameterI4uivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC pglNamedProgramLocalParametersI4uivEXT=_Lazy_glNamedProgramLocalParametersI4uivEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC pglGetNamedProgramLocalParameterIivEXT=_Lazy_glGetNamedProgramLocalParameterIivEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC pglGetNamedProgramLocalParameterIuivEXT=_Lazy_glGetNamedProgramLocalParameterIuivEXT; +PFNGLTEXTUREPARAMETERIIVEXTPROC pglTextureParameterIivEXT=_Lazy_glTextureParameterIivEXT; +PFNGLTEXTUREPARAMETERIUIVEXTPROC pglTextureParameterIuivEXT=_Lazy_glTextureParameterIuivEXT; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC pglGetTextureParameterIivEXT=_Lazy_glGetTextureParameterIivEXT; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC pglGetTextureParameterIuivEXT=_Lazy_glGetTextureParameterIuivEXT; +PFNGLMULTITEXPARAMETERIIVEXTPROC pglMultiTexParameterIivEXT=_Lazy_glMultiTexParameterIivEXT; +PFNGLMULTITEXPARAMETERIUIVEXTPROC pglMultiTexParameterIuivEXT=_Lazy_glMultiTexParameterIuivEXT; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC pglGetMultiTexParameterIivEXT=_Lazy_glGetMultiTexParameterIivEXT; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC pglGetMultiTexParameterIuivEXT=_Lazy_glGetMultiTexParameterIuivEXT; +PFNGLPROGRAMUNIFORM1FEXTPROC pglProgramUniform1fEXT=_Lazy_glProgramUniform1fEXT; +PFNGLPROGRAMUNIFORM2FEXTPROC pglProgramUniform2fEXT=_Lazy_glProgramUniform2fEXT; +PFNGLPROGRAMUNIFORM3FEXTPROC pglProgramUniform3fEXT=_Lazy_glProgramUniform3fEXT; +PFNGLPROGRAMUNIFORM4FEXTPROC pglProgramUniform4fEXT=_Lazy_glProgramUniform4fEXT; +PFNGLPROGRAMUNIFORM1IEXTPROC pglProgramUniform1iEXT=_Lazy_glProgramUniform1iEXT; +PFNGLPROGRAMUNIFORM2IEXTPROC pglProgramUniform2iEXT=_Lazy_glProgramUniform2iEXT; +PFNGLPROGRAMUNIFORM3IEXTPROC pglProgramUniform3iEXT=_Lazy_glProgramUniform3iEXT; +PFNGLPROGRAMUNIFORM4IEXTPROC pglProgramUniform4iEXT=_Lazy_glProgramUniform4iEXT; +PFNGLPROGRAMUNIFORM1FVEXTPROC pglProgramUniform1fvEXT=_Lazy_glProgramUniform1fvEXT; +PFNGLPROGRAMUNIFORM2FVEXTPROC pglProgramUniform2fvEXT=_Lazy_glProgramUniform2fvEXT; +PFNGLPROGRAMUNIFORM3FVEXTPROC pglProgramUniform3fvEXT=_Lazy_glProgramUniform3fvEXT; +PFNGLPROGRAMUNIFORM4FVEXTPROC pglProgramUniform4fvEXT=_Lazy_glProgramUniform4fvEXT; +PFNGLPROGRAMUNIFORM1IVEXTPROC pglProgramUniform1ivEXT=_Lazy_glProgramUniform1ivEXT; +PFNGLPROGRAMUNIFORM2IVEXTPROC pglProgramUniform2ivEXT=_Lazy_glProgramUniform2ivEXT; +PFNGLPROGRAMUNIFORM3IVEXTPROC pglProgramUniform3ivEXT=_Lazy_glProgramUniform3ivEXT; +PFNGLPROGRAMUNIFORM4IVEXTPROC pglProgramUniform4ivEXT=_Lazy_glProgramUniform4ivEXT; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC pglProgramUniformMatrix2fvEXT=_Lazy_glProgramUniformMatrix2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC pglProgramUniformMatrix3fvEXT=_Lazy_glProgramUniformMatrix3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC pglProgramUniformMatrix4fvEXT=_Lazy_glProgramUniformMatrix4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC pglProgramUniformMatrix2x3fvEXT=_Lazy_glProgramUniformMatrix2x3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC pglProgramUniformMatrix3x2fvEXT=_Lazy_glProgramUniformMatrix3x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC pglProgramUniformMatrix2x4fvEXT=_Lazy_glProgramUniformMatrix2x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC pglProgramUniformMatrix4x2fvEXT=_Lazy_glProgramUniformMatrix4x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC pglProgramUniformMatrix3x4fvEXT=_Lazy_glProgramUniformMatrix3x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC pglProgramUniformMatrix4x3fvEXT=_Lazy_glProgramUniformMatrix4x3fvEXT; +PFNGLPROGRAMUNIFORM1UIEXTPROC pglProgramUniform1uiEXT=_Lazy_glProgramUniform1uiEXT; +PFNGLPROGRAMUNIFORM2UIEXTPROC pglProgramUniform2uiEXT=_Lazy_glProgramUniform2uiEXT; +PFNGLPROGRAMUNIFORM3UIEXTPROC pglProgramUniform3uiEXT=_Lazy_glProgramUniform3uiEXT; +PFNGLPROGRAMUNIFORM4UIEXTPROC pglProgramUniform4uiEXT=_Lazy_glProgramUniform4uiEXT; +PFNGLPROGRAMUNIFORM1UIVEXTPROC pglProgramUniform1uivEXT=_Lazy_glProgramUniform1uivEXT; +PFNGLPROGRAMUNIFORM2UIVEXTPROC pglProgramUniform2uivEXT=_Lazy_glProgramUniform2uivEXT; +PFNGLPROGRAMUNIFORM3UIVEXTPROC pglProgramUniform3uivEXT=_Lazy_glProgramUniform3uivEXT; +PFNGLPROGRAMUNIFORM4UIVEXTPROC pglProgramUniform4uivEXT=_Lazy_glProgramUniform4uivEXT; +PFNGLNAMEDBUFFERDATAEXTPROC pglNamedBufferDataEXT=_Lazy_glNamedBufferDataEXT; +PFNGLNAMEDBUFFERSUBDATAEXTPROC pglNamedBufferSubDataEXT=_Lazy_glNamedBufferSubDataEXT; +PFNGLMAPNAMEDBUFFEREXTPROC pglMapNamedBufferEXT=_Lazy_glMapNamedBufferEXT; +PFNGLUNMAPNAMEDBUFFEREXTPROC pglUnmapNamedBufferEXT=_Lazy_glUnmapNamedBufferEXT; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC pglGetNamedBufferParameterivEXT=_Lazy_glGetNamedBufferParameterivEXT; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC pglGetNamedBufferPointervEXT=_Lazy_glGetNamedBufferPointervEXT; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC pglGetNamedBufferSubDataEXT=_Lazy_glGetNamedBufferSubDataEXT; +PFNGLTEXTUREBUFFEREXTPROC pglTextureBufferEXT=_Lazy_glTextureBufferEXT; +PFNGLMULTITEXBUFFEREXTPROC pglMultiTexBufferEXT=_Lazy_glMultiTexBufferEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC pglNamedRenderbufferStorageEXT=_Lazy_glNamedRenderbufferStorageEXT; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC pglGetNamedRenderbufferParameterivEXT=_Lazy_glGetNamedRenderbufferParameterivEXT; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC pglCheckNamedFramebufferStatusEXT=_Lazy_glCheckNamedFramebufferStatusEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC pglNamedFramebufferTexture1DEXT=_Lazy_glNamedFramebufferTexture1DEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC pglNamedFramebufferTexture2DEXT=_Lazy_glNamedFramebufferTexture2DEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC pglNamedFramebufferTexture3DEXT=_Lazy_glNamedFramebufferTexture3DEXT; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC pglNamedFramebufferRenderbufferEXT=_Lazy_glNamedFramebufferRenderbufferEXT; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC pglGetNamedFramebufferAttachmentParameterivEXT=_Lazy_glGetNamedFramebufferAttachmentParameterivEXT; +PFNGLGENERATETEXTUREMIPMAPEXTPROC pglGenerateTextureMipmapEXT=_Lazy_glGenerateTextureMipmapEXT; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC pglGenerateMultiTexMipmapEXT=_Lazy_glGenerateMultiTexMipmapEXT; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC pglFramebufferDrawBufferEXT=_Lazy_glFramebufferDrawBufferEXT; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC pglFramebufferDrawBuffersEXT=_Lazy_glFramebufferDrawBuffersEXT; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC pglFramebufferReadBufferEXT=_Lazy_glFramebufferReadBufferEXT; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC pglGetFramebufferParameterivEXT=_Lazy_glGetFramebufferParameterivEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pglNamedRenderbufferStorageMultisampleEXT=_Lazy_glNamedRenderbufferStorageMultisampleEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC pglNamedRenderbufferStorageMultisampleCoverageEXT=_Lazy_glNamedRenderbufferStorageMultisampleCoverageEXT; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC pglNamedFramebufferTextureEXT=_Lazy_glNamedFramebufferTextureEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC pglNamedFramebufferTextureLayerEXT=_Lazy_glNamedFramebufferTextureLayerEXT; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC pglNamedFramebufferTextureFaceEXT=_Lazy_glNamedFramebufferTextureFaceEXT; +PFNGLTEXTURERENDERBUFFEREXTPROC pglTextureRenderbufferEXT=_Lazy_glTextureRenderbufferEXT; +PFNGLMULTITEXRENDERBUFFEREXTPROC pglMultiTexRenderbufferEXT=_Lazy_glMultiTexRenderbufferEXT; +#endif + +/* GL_EXT_vertex_array_bgra */ + +#ifdef __GLEE_GL_EXT_vertex_array_bgra +#endif + +/* GL_SGIX_texture_select */ + +#ifdef __GLEE_GL_SGIX_texture_select +#endif + +/* GL_INGR_blend_func_separate */ + +#ifdef __GLEE_GL_INGR_blend_func_separate +void __stdcall _Lazy_glBlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {if (GLeeInit()) glBlendFuncSeparateINGR(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);} +PFNGLBLENDFUNCSEPARATEINGRPROC pglBlendFuncSeparateINGR=_Lazy_glBlendFuncSeparateINGR; +#endif + +/* GL_SGIX_depth_pass_instrument */ + +#ifdef __GLEE_GL_SGIX_depth_pass_instrument +#endif + +/* GL_SGIX_igloo_interface */ + +#ifdef __GLEE_GL_SGIX_igloo_interface +void __stdcall _Lazy_glIglooInterfaceSGIX(GLenum pname, const GLvoid * params) {if (GLeeInit()) glIglooInterfaceSGIX(pname, params);} +PFNGLIGLOOINTERFACESGIXPROC pglIglooInterfaceSGIX=_Lazy_glIglooInterfaceSGIX; +#endif + +/* GL_EXT_fragment_lighting */ + +#ifdef __GLEE_GL_EXT_fragment_lighting +GLvoid __stdcall _Lazy_glFragmentLightModeliEXT(GLenum pname, GLint param) {if (GLeeInit()) glFragmentLightModeliEXT(pname, param);} +GLvoid __stdcall _Lazy_glFragmentLightModelfEXT(GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentLightModelfEXT(pname, param);} +GLvoid __stdcall _Lazy_glFragmentLightModelivEXT(GLenum pname, GLint * params) {if (GLeeInit()) glFragmentLightModelivEXT(pname, params);} +GLvoid __stdcall _Lazy_glFragmentLightModelfvEXT(GLenum pname, GLfloat * params) {if (GLeeInit()) glFragmentLightModelfvEXT(pname, params);} +GLvoid __stdcall _Lazy_glFragmentLightiEXT(GLenum light, GLenum pname, GLint param) {if (GLeeInit()) glFragmentLightiEXT(light, pname, param);} +GLvoid __stdcall _Lazy_glFragmentLightfEXT(GLenum light, GLenum pname, GLfloat param) {if (GLeeInit()) glFragmentLightfEXT(light, pname, param);} +GLvoid __stdcall _Lazy_glFragmentLightivEXT(GLenum light, GLenum pname, GLint * params) {if (GLeeInit()) glFragmentLightivEXT(light, pname, params);} +GLvoid __stdcall _Lazy_glFragmentLightfvEXT(GLenum light, GLenum pname, GLfloat * params) {if (GLeeInit()) glFragmentLightfvEXT(light, pname, params);} +GLvoid __stdcall _Lazy_glGetFragmentLightivEXT(GLenum light, GLenum pname, GLint * params) {if (GLeeInit()) glGetFragmentLightivEXT(light, pname, params);} +GLvoid __stdcall _Lazy_glGetFragmentLightfvEXT(GLenum light, GLenum pname, GLfloat * params) {if (GLeeInit()) glGetFragmentLightfvEXT(light, pname, params);} +GLvoid __stdcall _Lazy_glFragmentMaterialfEXT(GLenum face, GLenum pname, const GLfloat param) {if (GLeeInit()) glFragmentMaterialfEXT(face, pname, param);} +GLvoid __stdcall _Lazy_glFragmentMaterialiEXT(GLenum face, GLenum pname, const GLint param) {if (GLeeInit()) glFragmentMaterialiEXT(face, pname, param);} +GLvoid __stdcall _Lazy_glFragmentMaterialfvEXT(GLenum face, GLenum pname, const GLfloat * params) {if (GLeeInit()) glFragmentMaterialfvEXT(face, pname, params);} +GLvoid __stdcall _Lazy_glFragmentMaterialivEXT(GLenum face, GLenum pname, const GLint * params) {if (GLeeInit()) glFragmentMaterialivEXT(face, pname, params);} +GLvoid __stdcall _Lazy_glFragmentColorMaterialEXT(GLenum face, GLenum mode) {if (GLeeInit()) glFragmentColorMaterialEXT(face, mode);} +GLvoid __stdcall _Lazy_glGetFragmentMaterialfvEXT(GLenum face, GLenum pname, const GLfloat * params) {if (GLeeInit()) glGetFragmentMaterialfvEXT(face, pname, params);} +GLvoid __stdcall _Lazy_glGetFragmentMaterialivEXT(GLenum face, GLenum pname, const GLint * params) {if (GLeeInit()) glGetFragmentMaterialivEXT(face, pname, params);} +GLvoid __stdcall _Lazy_glLightEnviEXT(GLenum pname, GLint param) {if (GLeeInit()) glLightEnviEXT(pname, param);} +PFNGLFRAGMENTLIGHTMODELIEXTPROC pglFragmentLightModeliEXT=_Lazy_glFragmentLightModeliEXT; +PFNGLFRAGMENTLIGHTMODELFEXTPROC pglFragmentLightModelfEXT=_Lazy_glFragmentLightModelfEXT; +PFNGLFRAGMENTLIGHTMODELIVEXTPROC pglFragmentLightModelivEXT=_Lazy_glFragmentLightModelivEXT; +PFNGLFRAGMENTLIGHTMODELFVEXTPROC pglFragmentLightModelfvEXT=_Lazy_glFragmentLightModelfvEXT; +PFNGLFRAGMENTLIGHTIEXTPROC pglFragmentLightiEXT=_Lazy_glFragmentLightiEXT; +PFNGLFRAGMENTLIGHTFEXTPROC pglFragmentLightfEXT=_Lazy_glFragmentLightfEXT; +PFNGLFRAGMENTLIGHTIVEXTPROC pglFragmentLightivEXT=_Lazy_glFragmentLightivEXT; +PFNGLFRAGMENTLIGHTFVEXTPROC pglFragmentLightfvEXT=_Lazy_glFragmentLightfvEXT; +PFNGLGETFRAGMENTLIGHTIVEXTPROC pglGetFragmentLightivEXT=_Lazy_glGetFragmentLightivEXT; +PFNGLGETFRAGMENTLIGHTFVEXTPROC pglGetFragmentLightfvEXT=_Lazy_glGetFragmentLightfvEXT; +PFNGLFRAGMENTMATERIALFEXTPROC pglFragmentMaterialfEXT=_Lazy_glFragmentMaterialfEXT; +PFNGLFRAGMENTMATERIALIEXTPROC pglFragmentMaterialiEXT=_Lazy_glFragmentMaterialiEXT; +PFNGLFRAGMENTMATERIALFVEXTPROC pglFragmentMaterialfvEXT=_Lazy_glFragmentMaterialfvEXT; +PFNGLFRAGMENTMATERIALIVEXTPROC pglFragmentMaterialivEXT=_Lazy_glFragmentMaterialivEXT; +PFNGLFRAGMENTCOLORMATERIALEXTPROC pglFragmentColorMaterialEXT=_Lazy_glFragmentColorMaterialEXT; +PFNGLGETFRAGMENTMATERIALFVEXTPROC pglGetFragmentMaterialfvEXT=_Lazy_glGetFragmentMaterialfvEXT; +PFNGLGETFRAGMENTMATERIALIVEXTPROC pglGetFragmentMaterialivEXT=_Lazy_glGetFragmentMaterialivEXT; +PFNGLLIGHTENVIEXTPROC pglLightEnviEXT=_Lazy_glLightEnviEXT; +#endif + +/* GL_EXT_scene_marker */ + +#ifdef __GLEE_GL_EXT_scene_marker +GLvoid __stdcall _Lazy_glBeginSceneEXT(void) {if (GLeeInit()) glBeginSceneEXT();} +GLvoid __stdcall _Lazy_glEndSceneEXT(void) {if (GLeeInit()) glEndSceneEXT();} +PFNGLBEGINSCENEEXTPROC pglBeginSceneEXT=_Lazy_glBeginSceneEXT; +PFNGLENDSCENEEXTPROC pglEndSceneEXT=_Lazy_glEndSceneEXT; +#endif + +/* GL_EXT_texture_compression_dxt1 */ + +#ifdef __GLEE_GL_EXT_texture_compression_dxt1 +#endif + +/* GL_EXT_texture_env */ + +#ifdef __GLEE_GL_EXT_texture_env +#endif + +/* GL_IBM_static_data */ + +#ifdef __GLEE_GL_IBM_static_data +#endif + +/* GL_OES_byte_coordinates */ + +#ifdef __GLEE_GL_OES_byte_coordinates +#endif + +/* GL_OES_compressed_paletted_texture */ + +#ifdef __GLEE_GL_OES_compressed_paletted_texture +#endif + +/* GL_OES_single_precision */ + +#ifdef __GLEE_GL_OES_single_precision +GLvoid __stdcall _Lazy_glDepthRangefOES(GLclampf n, GLclampf f) {if (GLeeInit()) glDepthRangefOES(n, f);} +GLvoid __stdcall _Lazy_glFrustumfOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) {if (GLeeInit()) glFrustumfOES(l, r, b, t, n, f);} +GLvoid __stdcall _Lazy_glOrthofOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) {if (GLeeInit()) glOrthofOES(l, r, b, t, n, f);} +GLvoid __stdcall _Lazy_glClipPlanefOES(GLenum plane, const GLfloat* equation) {if (GLeeInit()) glClipPlanefOES(plane, equation);} +GLvoid __stdcall _Lazy_glGetClipPlanefOES(GLenum plane, GLfloat* equation) {if (GLeeInit()) glGetClipPlanefOES(plane, equation);} +GLvoid __stdcall _Lazy_glClearDepthfOES(GLclampd depth) {if (GLeeInit()) glClearDepthfOES(depth);} +PFNGLDEPTHRANGEFOESPROC pglDepthRangefOES=_Lazy_glDepthRangefOES; +PFNGLFRUSTUMFOESPROC pglFrustumfOES=_Lazy_glFrustumfOES; +PFNGLORTHOFOESPROC pglOrthofOES=_Lazy_glOrthofOES; +PFNGLCLIPPLANEFOESPROC pglClipPlanefOES=_Lazy_glClipPlanefOES; +PFNGLGETCLIPPLANEFOESPROC pglGetClipPlanefOES=_Lazy_glGetClipPlanefOES; +PFNGLCLEARDEPTHFOESPROC pglClearDepthfOES=_Lazy_glClearDepthfOES; +#endif + +/* GL_SGIX_pixel_texture_bits */ + +#ifdef __GLEE_GL_SGIX_pixel_texture_bits +#endif + +/* GL_SGIX_texture_range */ + +#ifdef __GLEE_GL_SGIX_texture_range +#endif + +/* WGL */ + +#ifdef WIN32 + +/* Extension querying variables */ + +GLboolean _GLEE_WGL_ARB_buffer_region = GL_FALSE; +GLboolean _GLEE_WGL_ARB_multisample = GL_FALSE; +GLboolean _GLEE_WGL_ARB_extensions_string = GL_FALSE; +GLboolean _GLEE_WGL_ARB_pixel_format = GL_FALSE; +GLboolean _GLEE_WGL_ARB_make_current_read = GL_FALSE; +GLboolean _GLEE_WGL_ARB_pbuffer = GL_FALSE; +GLboolean _GLEE_WGL_ARB_render_texture = GL_FALSE; +GLboolean _GLEE_WGL_ARB_pixel_format_float = GL_FALSE; +GLboolean _GLEE_WGL_ARB_create_context = GL_FALSE; +GLboolean _GLEE_WGL_EXT_make_current_read = GL_FALSE; +GLboolean _GLEE_WGL_EXT_pixel_format = GL_FALSE; +GLboolean _GLEE_WGL_EXT_pbuffer = GL_FALSE; +GLboolean _GLEE_WGL_EXT_depth_float = GL_FALSE; +GLboolean _GLEE_WGL_3DFX_multisample = GL_FALSE; +GLboolean _GLEE_WGL_EXT_multisample = GL_FALSE; +GLboolean _GLEE_WGL_I3D_digital_video_control = GL_FALSE; +GLboolean _GLEE_WGL_I3D_gamma = GL_FALSE; +GLboolean _GLEE_WGL_I3D_genlock = GL_FALSE; +GLboolean _GLEE_WGL_I3D_image_buffer = GL_FALSE; +GLboolean _GLEE_WGL_I3D_swap_frame_lock = GL_FALSE; +GLboolean _GLEE_WGL_NV_render_depth_texture = GL_FALSE; +GLboolean _GLEE_WGL_NV_render_texture_rectangle = GL_FALSE; +GLboolean _GLEE_WGL_ATI_pixel_format_float = GL_FALSE; +GLboolean _GLEE_WGL_NV_float_buffer = GL_FALSE; +GLboolean _GLEE_WGL_3DL_stereo_control = GL_FALSE; +GLboolean _GLEE_WGL_EXT_pixel_format_packed_float = GL_FALSE; +GLboolean _GLEE_WGL_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean _GLEE_WGL_NV_present_video = GL_FALSE; +GLboolean _GLEE_WGL_NV_video_out = GL_FALSE; +GLboolean _GLEE_WGL_NV_swap_group = GL_FALSE; +GLboolean _GLEE_WGL_EXT_display_color_table = GL_FALSE; +GLboolean _GLEE_WGL_EXT_extensions_string = GL_FALSE; +GLboolean _GLEE_WGL_EXT_swap_control = GL_FALSE; +GLboolean _GLEE_WGL_NV_vertex_array_range = GL_FALSE; +GLboolean _GLEE_WGL_OML_sync_control = GL_FALSE; +GLboolean _GLEE_WGL_I3D_swap_frame_usage = GL_FALSE; +GLboolean _GLEE_WGL_NV_video_output = GL_FALSE; + +/* WGL Extension names */ + +char __GLeeWGLExtensionNames[37][34]={ + "WGL_ARB_buffer_region", + "WGL_ARB_multisample", + "WGL_ARB_extensions_string", + "WGL_ARB_pixel_format", + "WGL_ARB_make_current_read", + "WGL_ARB_pbuffer", + "WGL_ARB_render_texture", + "WGL_ARB_pixel_format_float", + "WGL_ARB_create_context", + "WGL_EXT_make_current_read", + "WGL_EXT_pixel_format", + "WGL_EXT_pbuffer", + "WGL_EXT_depth_float", + "WGL_3DFX_multisample", + "WGL_EXT_multisample", + "WGL_I3D_digital_video_control", + "WGL_I3D_gamma", + "WGL_I3D_genlock", + "WGL_I3D_image_buffer", + "WGL_I3D_swap_frame_lock", + "WGL_NV_render_depth_texture", + "WGL_NV_render_texture_rectangle", + "WGL_ATI_pixel_format_float", + "WGL_NV_float_buffer", + "WGL_3DL_stereo_control", + "WGL_EXT_pixel_format_packed_float", + "WGL_EXT_framebuffer_sRGB", + "WGL_NV_present_video", + "WGL_NV_video_out", + "WGL_NV_swap_group", + "WGL_EXT_display_color_table", + "WGL_EXT_extensions_string", + "WGL_EXT_swap_control", + "WGL_NV_vertex_array_range", + "WGL_OML_sync_control", + "WGL_I3D_swap_frame_usage", + "WGL_NV_video_output" +}; +int __GLeeWGLNumExtensions=37; + +/* WGL_ARB_buffer_region */ + +#ifdef __GLEE_WGL_ARB_buffer_region +HANDLE __stdcall _Lazy_wglCreateBufferRegionARB(HDC hDC, int iLayerPlane, UINT uType) {if (GLeeInit()) return wglCreateBufferRegionARB(hDC, iLayerPlane, uType); return (HANDLE)0;} +VOID __stdcall _Lazy_wglDeleteBufferRegionARB(HANDLE hRegion) {if (GLeeInit()) wglDeleteBufferRegionARB(hRegion);} +BOOL __stdcall _Lazy_wglSaveBufferRegionARB(HANDLE hRegion, int x, int y, int width, int height) {if (GLeeInit()) return wglSaveBufferRegionARB(hRegion, x, y, width, height); return (BOOL)0;} +BOOL __stdcall _Lazy_wglRestoreBufferRegionARB(HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc) {if (GLeeInit()) return wglRestoreBufferRegionARB(hRegion, x, y, width, height, xSrc, ySrc); return (BOOL)0;} +PFNWGLCREATEBUFFERREGIONARBPROC pwglCreateBufferRegionARB=_Lazy_wglCreateBufferRegionARB; +PFNWGLDELETEBUFFERREGIONARBPROC pwglDeleteBufferRegionARB=_Lazy_wglDeleteBufferRegionARB; +PFNWGLSAVEBUFFERREGIONARBPROC pwglSaveBufferRegionARB=_Lazy_wglSaveBufferRegionARB; +PFNWGLRESTOREBUFFERREGIONARBPROC pwglRestoreBufferRegionARB=_Lazy_wglRestoreBufferRegionARB; +#endif + +/* WGL_ARB_multisample */ + +#ifdef __GLEE_WGL_ARB_multisample +#endif + +/* WGL_ARB_extensions_string */ + +#ifdef __GLEE_WGL_ARB_extensions_string +const char * __stdcall _Lazy_wglGetExtensionsStringARB(HDC hdc) {if (GLeeInit()) return wglGetExtensionsStringARB(hdc); return (const char *)0;} +PFNWGLGETEXTENSIONSSTRINGARBPROC pwglGetExtensionsStringARB=_Lazy_wglGetExtensionsStringARB; +#endif + +/* WGL_ARB_pixel_format */ + +#ifdef __GLEE_WGL_ARB_pixel_format +BOOL __stdcall _Lazy_wglGetPixelFormatAttribivARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, int * piValues) {if (GLeeInit()) return wglGetPixelFormatAttribivARB(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, FLOAT * pfValues) {if (GLeeInit()) return wglGetPixelFormatAttribfvARB(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); return (BOOL)0;} +BOOL __stdcall _Lazy_wglChoosePixelFormatARB(HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats) {if (GLeeInit()) return wglChoosePixelFormatARB(hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats); return (BOOL)0;} +PFNWGLGETPIXELFORMATATTRIBIVARBPROC pwglGetPixelFormatAttribivARB=_Lazy_wglGetPixelFormatAttribivARB; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC pwglGetPixelFormatAttribfvARB=_Lazy_wglGetPixelFormatAttribfvARB; +PFNWGLCHOOSEPIXELFORMATARBPROC pwglChoosePixelFormatARB=_Lazy_wglChoosePixelFormatARB; +#endif + +/* WGL_ARB_make_current_read */ + +#ifdef __GLEE_WGL_ARB_make_current_read +BOOL __stdcall _Lazy_wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglrc) {if (GLeeInit()) return wglMakeContextCurrentARB(hDrawDC, hReadDC, hglrc); return (BOOL)0;} +HDC __stdcall _Lazy_wglGetCurrentReadDCARB(void) {if (GLeeInit()) return wglGetCurrentReadDCARB(); return (HDC)0;} +PFNWGLMAKECONTEXTCURRENTARBPROC pwglMakeContextCurrentARB=_Lazy_wglMakeContextCurrentARB; +PFNWGLGETCURRENTREADDCARBPROC pwglGetCurrentReadDCARB=_Lazy_wglGetCurrentReadDCARB; +#endif + +/* WGL_ARB_pbuffer */ + +#ifdef __GLEE_WGL_ARB_pbuffer +HPBUFFERARB __stdcall _Lazy_wglCreatePbufferARB(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList) {if (GLeeInit()) return wglCreatePbufferARB(hDC, iPixelFormat, iWidth, iHeight, piAttribList); return (HPBUFFERARB)0;} +HDC __stdcall _Lazy_wglGetPbufferDCARB(HPBUFFERARB hPbuffer) {if (GLeeInit()) return wglGetPbufferDCARB(hPbuffer); return (HDC)0;} +int __stdcall _Lazy_wglReleasePbufferDCARB(HPBUFFERARB hPbuffer, HDC hDC) {if (GLeeInit()) return wglReleasePbufferDCARB(hPbuffer, hDC); return (int)0;} +BOOL __stdcall _Lazy_wglDestroyPbufferARB(HPBUFFERARB hPbuffer) {if (GLeeInit()) return wglDestroyPbufferARB(hPbuffer); return (BOOL)0;} +BOOL __stdcall _Lazy_wglQueryPbufferARB(HPBUFFERARB hPbuffer, int iAttribute, int * piValue) {if (GLeeInit()) return wglQueryPbufferARB(hPbuffer, iAttribute, piValue); return (BOOL)0;} +PFNWGLCREATEPBUFFERARBPROC pwglCreatePbufferARB=_Lazy_wglCreatePbufferARB; +PFNWGLGETPBUFFERDCARBPROC pwglGetPbufferDCARB=_Lazy_wglGetPbufferDCARB; +PFNWGLRELEASEPBUFFERDCARBPROC pwglReleasePbufferDCARB=_Lazy_wglReleasePbufferDCARB; +PFNWGLDESTROYPBUFFERARBPROC pwglDestroyPbufferARB=_Lazy_wglDestroyPbufferARB; +PFNWGLQUERYPBUFFERARBPROC pwglQueryPbufferARB=_Lazy_wglQueryPbufferARB; +#endif + +/* WGL_ARB_render_texture */ + +#ifdef __GLEE_WGL_ARB_render_texture +BOOL __stdcall _Lazy_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuffer) {if (GLeeInit()) return wglBindTexImageARB(hPbuffer, iBuffer); return (BOOL)0;} +BOOL __stdcall _Lazy_wglReleaseTexImageARB(HPBUFFERARB hPbuffer, int iBuffer) {if (GLeeInit()) return wglReleaseTexImageARB(hPbuffer, iBuffer); return (BOOL)0;} +BOOL __stdcall _Lazy_wglSetPbufferAttribARB(HPBUFFERARB hPbuffer, const int * piAttribList) {if (GLeeInit()) return wglSetPbufferAttribARB(hPbuffer, piAttribList); return (BOOL)0;} +PFNWGLBINDTEXIMAGEARBPROC pwglBindTexImageARB=_Lazy_wglBindTexImageARB; +PFNWGLRELEASETEXIMAGEARBPROC pwglReleaseTexImageARB=_Lazy_wglReleaseTexImageARB; +PFNWGLSETPBUFFERATTRIBARBPROC pwglSetPbufferAttribARB=_Lazy_wglSetPbufferAttribARB; +#endif + +/* WGL_ARB_pixel_format_float */ + +#ifdef __GLEE_WGL_ARB_pixel_format_float +#endif + +/* WGL_ARB_create_context */ + +#ifdef __GLEE_WGL_ARB_create_context +HGLRC __stdcall _Lazy_wglCreateContextAttribsARB(HDC hDC, HGLRC hShareContext, const int * attribList) {if (GLeeInit()) return wglCreateContextAttribsARB(hDC, hShareContext, attribList); return (HGLRC)0;} +PFNWGLCREATECONTEXTATTRIBSARBPROC pwglCreateContextAttribsARB=_Lazy_wglCreateContextAttribsARB; +#endif + +/* WGL_EXT_make_current_read */ + +#ifdef __GLEE_WGL_EXT_make_current_read +BOOL __stdcall _Lazy_wglMakeContextCurrentEXT(HDC hDrawDC, HDC hReadDC, HGLRC hglrc) {if (GLeeInit()) return wglMakeContextCurrentEXT(hDrawDC, hReadDC, hglrc); return (BOOL)0;} +HDC __stdcall _Lazy_wglGetCurrentReadDCEXT(void) {if (GLeeInit()) return wglGetCurrentReadDCEXT(); return (HDC)0;} +PFNWGLMAKECONTEXTCURRENTEXTPROC pwglMakeContextCurrentEXT=_Lazy_wglMakeContextCurrentEXT; +PFNWGLGETCURRENTREADDCEXTPROC pwglGetCurrentReadDCEXT=_Lazy_wglGetCurrentReadDCEXT; +#endif + +/* WGL_EXT_pixel_format */ + +#ifdef __GLEE_WGL_EXT_pixel_format +BOOL __stdcall _Lazy_wglGetPixelFormatAttribivEXT(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int * piAttributes, int * piValues) {if (GLeeInit()) return wglGetPixelFormatAttribivEXT(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetPixelFormatAttribfvEXT(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int * piAttributes, FLOAT * pfValues) {if (GLeeInit()) return wglGetPixelFormatAttribfvEXT(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); return (BOOL)0;} +BOOL __stdcall _Lazy_wglChoosePixelFormatEXT(HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats) {if (GLeeInit()) return wglChoosePixelFormatEXT(hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats); return (BOOL)0;} +PFNWGLGETPIXELFORMATATTRIBIVEXTPROC pwglGetPixelFormatAttribivEXT=_Lazy_wglGetPixelFormatAttribivEXT; +PFNWGLGETPIXELFORMATATTRIBFVEXTPROC pwglGetPixelFormatAttribfvEXT=_Lazy_wglGetPixelFormatAttribfvEXT; +PFNWGLCHOOSEPIXELFORMATEXTPROC pwglChoosePixelFormatEXT=_Lazy_wglChoosePixelFormatEXT; +#endif + +/* WGL_EXT_pbuffer */ + +#ifdef __GLEE_WGL_EXT_pbuffer +HPBUFFEREXT __stdcall _Lazy_wglCreatePbufferEXT(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList) {if (GLeeInit()) return wglCreatePbufferEXT(hDC, iPixelFormat, iWidth, iHeight, piAttribList); return (HPBUFFEREXT)0;} +HDC __stdcall _Lazy_wglGetPbufferDCEXT(HPBUFFEREXT hPbuffer) {if (GLeeInit()) return wglGetPbufferDCEXT(hPbuffer); return (HDC)0;} +int __stdcall _Lazy_wglReleasePbufferDCEXT(HPBUFFEREXT hPbuffer, HDC hDC) {if (GLeeInit()) return wglReleasePbufferDCEXT(hPbuffer, hDC); return (int)0;} +BOOL __stdcall _Lazy_wglDestroyPbufferEXT(HPBUFFEREXT hPbuffer) {if (GLeeInit()) return wglDestroyPbufferEXT(hPbuffer); return (BOOL)0;} +BOOL __stdcall _Lazy_wglQueryPbufferEXT(HPBUFFEREXT hPbuffer, int iAttribute, int * piValue) {if (GLeeInit()) return wglQueryPbufferEXT(hPbuffer, iAttribute, piValue); return (BOOL)0;} +PFNWGLCREATEPBUFFEREXTPROC pwglCreatePbufferEXT=_Lazy_wglCreatePbufferEXT; +PFNWGLGETPBUFFERDCEXTPROC pwglGetPbufferDCEXT=_Lazy_wglGetPbufferDCEXT; +PFNWGLRELEASEPBUFFERDCEXTPROC pwglReleasePbufferDCEXT=_Lazy_wglReleasePbufferDCEXT; +PFNWGLDESTROYPBUFFEREXTPROC pwglDestroyPbufferEXT=_Lazy_wglDestroyPbufferEXT; +PFNWGLQUERYPBUFFEREXTPROC pwglQueryPbufferEXT=_Lazy_wglQueryPbufferEXT; +#endif + +/* WGL_EXT_depth_float */ + +#ifdef __GLEE_WGL_EXT_depth_float +#endif + +/* WGL_3DFX_multisample */ + +#ifdef __GLEE_WGL_3DFX_multisample +#endif + +/* WGL_EXT_multisample */ + +#ifdef __GLEE_WGL_EXT_multisample +#endif + +/* WGL_I3D_digital_video_control */ + +#ifdef __GLEE_WGL_I3D_digital_video_control +BOOL __stdcall _Lazy_wglGetDigitalVideoParametersI3D(HDC hDC, int iAttribute, int * piValue) {if (GLeeInit()) return wglGetDigitalVideoParametersI3D(hDC, iAttribute, piValue); return (BOOL)0;} +BOOL __stdcall _Lazy_wglSetDigitalVideoParametersI3D(HDC hDC, int iAttribute, const int * piValue) {if (GLeeInit()) return wglSetDigitalVideoParametersI3D(hDC, iAttribute, piValue); return (BOOL)0;} +PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC pwglGetDigitalVideoParametersI3D=_Lazy_wglGetDigitalVideoParametersI3D; +PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC pwglSetDigitalVideoParametersI3D=_Lazy_wglSetDigitalVideoParametersI3D; +#endif + +/* WGL_I3D_gamma */ + +#ifdef __GLEE_WGL_I3D_gamma +BOOL __stdcall _Lazy_wglGetGammaTableParametersI3D(HDC hDC, int iAttribute, int * piValue) {if (GLeeInit()) return wglGetGammaTableParametersI3D(hDC, iAttribute, piValue); return (BOOL)0;} +BOOL __stdcall _Lazy_wglSetGammaTableParametersI3D(HDC hDC, int iAttribute, const int * piValue) {if (GLeeInit()) return wglSetGammaTableParametersI3D(hDC, iAttribute, piValue); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetGammaTableI3D(HDC hDC, int iEntries, USHORT * puRed, USHORT * puGreen, USHORT * puBlue) {if (GLeeInit()) return wglGetGammaTableI3D(hDC, iEntries, puRed, puGreen, puBlue); return (BOOL)0;} +BOOL __stdcall _Lazy_wglSetGammaTableI3D(HDC hDC, int iEntries, const USHORT * puRed, const USHORT * puGreen, const USHORT * puBlue) {if (GLeeInit()) return wglSetGammaTableI3D(hDC, iEntries, puRed, puGreen, puBlue); return (BOOL)0;} +PFNWGLGETGAMMATABLEPARAMETERSI3DPROC pwglGetGammaTableParametersI3D=_Lazy_wglGetGammaTableParametersI3D; +PFNWGLSETGAMMATABLEPARAMETERSI3DPROC pwglSetGammaTableParametersI3D=_Lazy_wglSetGammaTableParametersI3D; +PFNWGLGETGAMMATABLEI3DPROC pwglGetGammaTableI3D=_Lazy_wglGetGammaTableI3D; +PFNWGLSETGAMMATABLEI3DPROC pwglSetGammaTableI3D=_Lazy_wglSetGammaTableI3D; +#endif + +/* WGL_I3D_genlock */ + +#ifdef __GLEE_WGL_I3D_genlock +BOOL __stdcall _Lazy_wglEnableGenlockI3D(HDC hDC) {if (GLeeInit()) return wglEnableGenlockI3D(hDC); return (BOOL)0;} +BOOL __stdcall _Lazy_wglDisableGenlockI3D(HDC hDC) {if (GLeeInit()) return wglDisableGenlockI3D(hDC); return (BOOL)0;} +BOOL __stdcall _Lazy_wglIsEnabledGenlockI3D(HDC hDC, BOOL * pFlag) {if (GLeeInit()) return wglIsEnabledGenlockI3D(hDC, pFlag); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGenlockSourceI3D(HDC hDC, UINT uSource) {if (GLeeInit()) return wglGenlockSourceI3D(hDC, uSource); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetGenlockSourceI3D(HDC hDC, UINT * uSource) {if (GLeeInit()) return wglGetGenlockSourceI3D(hDC, uSource); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGenlockSourceEdgeI3D(HDC hDC, UINT uEdge) {if (GLeeInit()) return wglGenlockSourceEdgeI3D(hDC, uEdge); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetGenlockSourceEdgeI3D(HDC hDC, UINT * uEdge) {if (GLeeInit()) return wglGetGenlockSourceEdgeI3D(hDC, uEdge); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGenlockSampleRateI3D(HDC hDC, UINT uRate) {if (GLeeInit()) return wglGenlockSampleRateI3D(hDC, uRate); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetGenlockSampleRateI3D(HDC hDC, UINT * uRate) {if (GLeeInit()) return wglGetGenlockSampleRateI3D(hDC, uRate); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGenlockSourceDelayI3D(HDC hDC, UINT uDelay) {if (GLeeInit()) return wglGenlockSourceDelayI3D(hDC, uDelay); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetGenlockSourceDelayI3D(HDC hDC, UINT * uDelay) {if (GLeeInit()) return wglGetGenlockSourceDelayI3D(hDC, uDelay); return (BOOL)0;} +BOOL __stdcall _Lazy_wglQueryGenlockMaxSourceDelayI3D(HDC hDC, UINT * uMaxLineDelay, UINT * uMaxPixelDelay) {if (GLeeInit()) return wglQueryGenlockMaxSourceDelayI3D(hDC, uMaxLineDelay, uMaxPixelDelay); return (BOOL)0;} +PFNWGLENABLEGENLOCKI3DPROC pwglEnableGenlockI3D=_Lazy_wglEnableGenlockI3D; +PFNWGLDISABLEGENLOCKI3DPROC pwglDisableGenlockI3D=_Lazy_wglDisableGenlockI3D; +PFNWGLISENABLEDGENLOCKI3DPROC pwglIsEnabledGenlockI3D=_Lazy_wglIsEnabledGenlockI3D; +PFNWGLGENLOCKSOURCEI3DPROC pwglGenlockSourceI3D=_Lazy_wglGenlockSourceI3D; +PFNWGLGETGENLOCKSOURCEI3DPROC pwglGetGenlockSourceI3D=_Lazy_wglGetGenlockSourceI3D; +PFNWGLGENLOCKSOURCEEDGEI3DPROC pwglGenlockSourceEdgeI3D=_Lazy_wglGenlockSourceEdgeI3D; +PFNWGLGETGENLOCKSOURCEEDGEI3DPROC pwglGetGenlockSourceEdgeI3D=_Lazy_wglGetGenlockSourceEdgeI3D; +PFNWGLGENLOCKSAMPLERATEI3DPROC pwglGenlockSampleRateI3D=_Lazy_wglGenlockSampleRateI3D; +PFNWGLGETGENLOCKSAMPLERATEI3DPROC pwglGetGenlockSampleRateI3D=_Lazy_wglGetGenlockSampleRateI3D; +PFNWGLGENLOCKSOURCEDELAYI3DPROC pwglGenlockSourceDelayI3D=_Lazy_wglGenlockSourceDelayI3D; +PFNWGLGETGENLOCKSOURCEDELAYI3DPROC pwglGetGenlockSourceDelayI3D=_Lazy_wglGetGenlockSourceDelayI3D; +PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC pwglQueryGenlockMaxSourceDelayI3D=_Lazy_wglQueryGenlockMaxSourceDelayI3D; +#endif + +/* WGL_I3D_image_buffer */ + +#ifdef __GLEE_WGL_I3D_image_buffer +LPVOID __stdcall _Lazy_wglCreateImageBufferI3D(HDC hDC, DWORD dwSize, UINT uFlags) {if (GLeeInit()) return wglCreateImageBufferI3D(hDC, dwSize, uFlags); return (LPVOID)0;} +BOOL __stdcall _Lazy_wglDestroyImageBufferI3D(HDC hDC, LPVOID pAddress) {if (GLeeInit()) return wglDestroyImageBufferI3D(hDC, pAddress); return (BOOL)0;} +BOOL __stdcall _Lazy_wglAssociateImageBufferEventsI3D(HDC hDC, const HANDLE * pEvent, const LPVOID * pAddress, const DWORD * pSize, UINT count) {if (GLeeInit()) return wglAssociateImageBufferEventsI3D(hDC, pEvent, pAddress, pSize, count); return (BOOL)0;} +BOOL __stdcall _Lazy_wglReleaseImageBufferEventsI3D(HDC hDC, const LPVOID * pAddress, UINT count) {if (GLeeInit()) return wglReleaseImageBufferEventsI3D(hDC, pAddress, count); return (BOOL)0;} +PFNWGLCREATEIMAGEBUFFERI3DPROC pwglCreateImageBufferI3D=_Lazy_wglCreateImageBufferI3D; +PFNWGLDESTROYIMAGEBUFFERI3DPROC pwglDestroyImageBufferI3D=_Lazy_wglDestroyImageBufferI3D; +PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC pwglAssociateImageBufferEventsI3D=_Lazy_wglAssociateImageBufferEventsI3D; +PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC pwglReleaseImageBufferEventsI3D=_Lazy_wglReleaseImageBufferEventsI3D; +#endif + +/* WGL_I3D_swap_frame_lock */ + +#ifdef __GLEE_WGL_I3D_swap_frame_lock +BOOL __stdcall _Lazy_wglEnableFrameLockI3D(void) {if (GLeeInit()) return wglEnableFrameLockI3D(); return (BOOL)0;} +BOOL __stdcall _Lazy_wglDisableFrameLockI3D(void) {if (GLeeInit()) return wglDisableFrameLockI3D(); return (BOOL)0;} +BOOL __stdcall _Lazy_wglIsEnabledFrameLockI3D(BOOL * pFlag) {if (GLeeInit()) return wglIsEnabledFrameLockI3D(pFlag); return (BOOL)0;} +BOOL __stdcall _Lazy_wglQueryFrameLockMasterI3D(BOOL * pFlag) {if (GLeeInit()) return wglQueryFrameLockMasterI3D(pFlag); return (BOOL)0;} +PFNWGLENABLEFRAMELOCKI3DPROC pwglEnableFrameLockI3D=_Lazy_wglEnableFrameLockI3D; +PFNWGLDISABLEFRAMELOCKI3DPROC pwglDisableFrameLockI3D=_Lazy_wglDisableFrameLockI3D; +PFNWGLISENABLEDFRAMELOCKI3DPROC pwglIsEnabledFrameLockI3D=_Lazy_wglIsEnabledFrameLockI3D; +PFNWGLQUERYFRAMELOCKMASTERI3DPROC pwglQueryFrameLockMasterI3D=_Lazy_wglQueryFrameLockMasterI3D; +#endif + +/* WGL_NV_render_depth_texture */ + +#ifdef __GLEE_WGL_NV_render_depth_texture +#endif + +/* WGL_NV_render_texture_rectangle */ + +#ifdef __GLEE_WGL_NV_render_texture_rectangle +#endif + +/* WGL_ATI_pixel_format_float */ + +#ifdef __GLEE_WGL_ATI_pixel_format_float +#endif + +/* WGL_NV_float_buffer */ + +#ifdef __GLEE_WGL_NV_float_buffer +#endif + +/* WGL_3DL_stereo_control */ + +#ifdef __GLEE_WGL_3DL_stereo_control +#endif + +/* WGL_EXT_pixel_format_packed_float */ + +#ifdef __GLEE_WGL_EXT_pixel_format_packed_float +#endif + +/* WGL_EXT_framebuffer_sRGB */ + +#ifdef __GLEE_WGL_EXT_framebuffer_sRGB +#endif + +/* WGL_NV_present_video */ + +#ifdef __GLEE_WGL_NV_present_video +#endif + +/* WGL_NV_video_out */ + +#ifdef __GLEE_WGL_NV_video_out +#endif + +/* WGL_NV_swap_group */ + +#ifdef __GLEE_WGL_NV_swap_group +#endif + +/* WGL_EXT_display_color_table */ + +#ifdef __GLEE_WGL_EXT_display_color_table +GLboolean __stdcall _Lazy_wglCreateDisplayColorTableEXT(GLushort id) {if (GLeeInit()) return wglCreateDisplayColorTableEXT(id); return (GLboolean)0;} +GLboolean __stdcall _Lazy_wglLoadDisplayColorTableEXT(const GLushort * table, GLuint length) {if (GLeeInit()) return wglLoadDisplayColorTableEXT(table, length); return (GLboolean)0;} +GLboolean __stdcall _Lazy_wglBindDisplayColorTableEXT(GLushort id) {if (GLeeInit()) return wglBindDisplayColorTableEXT(id); return (GLboolean)0;} +VOID __stdcall _Lazy_wglDestroyDisplayColorTableEXT(GLushort id) {if (GLeeInit()) wglDestroyDisplayColorTableEXT(id);} +PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC pwglCreateDisplayColorTableEXT=_Lazy_wglCreateDisplayColorTableEXT; +PFNWGLLOADDISPLAYCOLORTABLEEXTPROC pwglLoadDisplayColorTableEXT=_Lazy_wglLoadDisplayColorTableEXT; +PFNWGLBINDDISPLAYCOLORTABLEEXTPROC pwglBindDisplayColorTableEXT=_Lazy_wglBindDisplayColorTableEXT; +PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC pwglDestroyDisplayColorTableEXT=_Lazy_wglDestroyDisplayColorTableEXT; +#endif + +/* WGL_EXT_extensions_string */ + +#ifdef __GLEE_WGL_EXT_extensions_string +const char * __stdcall _Lazy_wglGetExtensionsStringEXT(void) {if (GLeeInit()) return wglGetExtensionsStringEXT(); return (const char *)0;} +PFNWGLGETEXTENSIONSSTRINGEXTPROC pwglGetExtensionsStringEXT=_Lazy_wglGetExtensionsStringEXT; +#endif + +/* WGL_EXT_swap_control */ + +#ifdef __GLEE_WGL_EXT_swap_control +BOOL __stdcall _Lazy_wglSwapIntervalEXT(int interval) {if (GLeeInit()) return wglSwapIntervalEXT(interval); return (BOOL)0;} +int __stdcall _Lazy_wglGetSwapIntervalEXT(void) {if (GLeeInit()) return wglGetSwapIntervalEXT(); return (int)0;} +PFNWGLSWAPINTERVALEXTPROC pwglSwapIntervalEXT=_Lazy_wglSwapIntervalEXT; +PFNWGLGETSWAPINTERVALEXTPROC pwglGetSwapIntervalEXT=_Lazy_wglGetSwapIntervalEXT; +#endif + +/* WGL_NV_vertex_array_range */ + +#ifdef __GLEE_WGL_NV_vertex_array_range +void* __stdcall _Lazy_wglAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority) {if (GLeeInit()) return wglAllocateMemoryNV(size, readfreq, writefreq, priority); return (void*)0;} +void __stdcall _Lazy_wglFreeMemoryNV(void * pointer) {if (GLeeInit()) wglFreeMemoryNV(pointer);} +PFNWGLALLOCATEMEMORYNVPROC pwglAllocateMemoryNV=_Lazy_wglAllocateMemoryNV; +PFNWGLFREEMEMORYNVPROC pwglFreeMemoryNV=_Lazy_wglFreeMemoryNV; +#endif + +/* WGL_OML_sync_control */ + +#ifdef __GLEE_WGL_OML_sync_control +BOOL __stdcall _Lazy_wglGetSyncValuesOML(HDC hdc, INT64 * ust, INT64 * msc, INT64 * sbc) {if (GLeeInit()) return wglGetSyncValuesOML(hdc, ust, msc, sbc); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetMscRateOML(HDC hdc, INT32 * numerator, INT32 * denominator) {if (GLeeInit()) return wglGetMscRateOML(hdc, numerator, denominator); return (BOOL)0;} +INT64 __stdcall _Lazy_wglSwapBuffersMscOML(HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder) {if (GLeeInit()) return wglSwapBuffersMscOML(hdc, target_msc, divisor, remainder); return (INT64)0;} +INT64 __stdcall _Lazy_wglSwapLayerBuffersMscOML(HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder) {if (GLeeInit()) return wglSwapLayerBuffersMscOML(hdc, fuPlanes, target_msc, divisor, remainder); return (INT64)0;} +BOOL __stdcall _Lazy_wglWaitForMscOML(HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 * ust, INT64 * msc, INT64 * sbc) {if (GLeeInit()) return wglWaitForMscOML(hdc, target_msc, divisor, remainder, ust, msc, sbc); return (BOOL)0;} +BOOL __stdcall _Lazy_wglWaitForSbcOML(HDC hdc, INT64 target_sbc, INT64 * ust, INT64 * msc, INT64 * sbc) {if (GLeeInit()) return wglWaitForSbcOML(hdc, target_sbc, ust, msc, sbc); return (BOOL)0;} +PFNWGLGETSYNCVALUESOMLPROC pwglGetSyncValuesOML=_Lazy_wglGetSyncValuesOML; +PFNWGLGETMSCRATEOMLPROC pwglGetMscRateOML=_Lazy_wglGetMscRateOML; +PFNWGLSWAPBUFFERSMSCOMLPROC pwglSwapBuffersMscOML=_Lazy_wglSwapBuffersMscOML; +PFNWGLSWAPLAYERBUFFERSMSCOMLPROC pwglSwapLayerBuffersMscOML=_Lazy_wglSwapLayerBuffersMscOML; +PFNWGLWAITFORMSCOMLPROC pwglWaitForMscOML=_Lazy_wglWaitForMscOML; +PFNWGLWAITFORSBCOMLPROC pwglWaitForSbcOML=_Lazy_wglWaitForSbcOML; +#endif + +/* WGL_I3D_swap_frame_usage */ + +#ifdef __GLEE_WGL_I3D_swap_frame_usage +BOOL __stdcall _Lazy_wglGetFrameUsageI3D(float * pUsage) {if (GLeeInit()) return wglGetFrameUsageI3D(pUsage); return (BOOL)0;} +BOOL __stdcall _Lazy_wglBeginFrameTrackingI3D(void) {if (GLeeInit()) return wglBeginFrameTrackingI3D(); return (BOOL)0;} +BOOL __stdcall _Lazy_wglEndFrameTrackingI3D(void) {if (GLeeInit()) return wglEndFrameTrackingI3D(); return (BOOL)0;} +BOOL __stdcall _Lazy_wglQueryFrameTrackingI3D(DWORD * pFrameCount, DWORD * pMissedFrames, float * pLastMissedUsage) {if (GLeeInit()) return wglQueryFrameTrackingI3D(pFrameCount, pMissedFrames, pLastMissedUsage); return (BOOL)0;} +PFNWGLGETFRAMEUSAGEI3DPROC pwglGetFrameUsageI3D=_Lazy_wglGetFrameUsageI3D; +PFNWGLBEGINFRAMETRACKINGI3DPROC pwglBeginFrameTrackingI3D=_Lazy_wglBeginFrameTrackingI3D; +PFNWGLENDFRAMETRACKINGI3DPROC pwglEndFrameTrackingI3D=_Lazy_wglEndFrameTrackingI3D; +PFNWGLQUERYFRAMETRACKINGI3DPROC pwglQueryFrameTrackingI3D=_Lazy_wglQueryFrameTrackingI3D; +#endif + +/* WGL_NV_video_output */ + +#ifdef __GLEE_WGL_NV_video_output +BOOL __stdcall _Lazy_wglGetVideoDeviceNV(HDC hDC, int numDevices, HPVIDEODEV * hVideoDevice) {if (GLeeInit()) return wglGetVideoDeviceNV(hDC, numDevices, hVideoDevice); return (BOOL)0;} +BOOL __stdcall _Lazy_wglReleaseVideoDeviceNV(HPVIDEODEV hVideoDevice) {if (GLeeInit()) return wglReleaseVideoDeviceNV(hVideoDevice); return (BOOL)0;} +BOOL __stdcall _Lazy_wglBindVideoImageNV(HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer) {if (GLeeInit()) return wglBindVideoImageNV(hVideoDevice, hPbuffer, iVideoBuffer); return (BOOL)0;} +BOOL __stdcall _Lazy_wglReleaseVideoImageNV(HPBUFFERARB hPbuffer, int iVideoBuffer) {if (GLeeInit()) return wglReleaseVideoImageNV(hPbuffer, iVideoBuffer); return (BOOL)0;} +BOOL __stdcall _Lazy_wglSendPbufferToVideoNV(HPBUFFERARB hPbuffer, int iBufferType, unsigned long * pulCounterPbuffer, BOOL bBlock) {if (GLeeInit()) return wglSendPbufferToVideoNV(hPbuffer, iBufferType, pulCounterPbuffer, bBlock); return (BOOL)0;} +BOOL __stdcall _Lazy_wglGetVideoInfoNV(HPVIDEODEV hpVideoDevice, unsigned long * pulCounterOutputPbuffer, unsigned long * pulCounterOutputVideo) {if (GLeeInit()) return wglGetVideoInfoNV(hpVideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo); return (BOOL)0;} +PFNWGLGETVIDEODEVICENVPROC pwglGetVideoDeviceNV=_Lazy_wglGetVideoDeviceNV; +PFNWGLRELEASEVIDEODEVICENVPROC pwglReleaseVideoDeviceNV=_Lazy_wglReleaseVideoDeviceNV; +PFNWGLBINDVIDEOIMAGENVPROC pwglBindVideoImageNV=_Lazy_wglBindVideoImageNV; +PFNWGLRELEASEVIDEOIMAGENVPROC pwglReleaseVideoImageNV=_Lazy_wglReleaseVideoImageNV; +PFNWGLSENDPBUFFERTOVIDEONVPROC pwglSendPbufferToVideoNV=_Lazy_wglSendPbufferToVideoNV; +PFNWGLGETVIDEOINFONVPROC pwglGetVideoInfoNV=_Lazy_wglGetVideoInfoNV; +#endif +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else /* GLX */ + +/* Extension querying variables */ + +GLboolean _GLEE_GLX_VERSION_1_3 = GL_FALSE; +GLboolean _GLEE_GLX_VERSION_1_4 = GL_FALSE; +GLboolean _GLEE_GLX_ARB_multisample = GL_FALSE; +GLboolean _GLEE_GLX_ARB_fbconfig_float = GL_FALSE; +GLboolean _GLEE_GLX_SGIS_multisample = GL_FALSE; +GLboolean _GLEE_GLX_EXT_visual_info = GL_FALSE; +GLboolean _GLEE_GLX_SGI_swap_control = GL_FALSE; +GLboolean _GLEE_GLX_SGI_video_sync = GL_FALSE; +GLboolean _GLEE_GLX_SGI_make_current_read = GL_FALSE; +GLboolean _GLEE_GLX_EXT_visual_rating = GL_FALSE; +GLboolean _GLEE_GLX_EXT_import_context = GL_FALSE; +GLboolean _GLEE_GLX_SGIX_fbconfig = GL_FALSE; +GLboolean _GLEE_GLX_SGIX_pbuffer = GL_FALSE; +GLboolean _GLEE_GLX_SGI_cushion = GL_FALSE; +GLboolean _GLEE_GLX_SGIX_video_resize = GL_FALSE; +GLboolean _GLEE_GLX_SGIX_swap_group = GL_FALSE; +GLboolean _GLEE_GLX_SGIX_swap_barrier = GL_FALSE; +GLboolean _GLEE_GLX_SGIS_blended_overlay = GL_FALSE; +GLboolean _GLEE_GLX_SGIS_shared_multisample = GL_FALSE; +GLboolean _GLEE_GLX_SUN_get_transparent_index = GL_FALSE; +GLboolean _GLEE_GLX_3DFX_multisample = GL_FALSE; +GLboolean _GLEE_GLX_MESA_copy_sub_buffer = GL_FALSE; +GLboolean _GLEE_GLX_MESA_pixmap_colormap = GL_FALSE; +GLboolean _GLEE_GLX_MESA_release_buffers = GL_FALSE; +GLboolean _GLEE_GLX_MESA_set_3dfx_mode = GL_FALSE; +GLboolean _GLEE_GLX_SGIX_visual_select_group = GL_FALSE; +GLboolean _GLEE_GLX_OML_swap_method = GL_FALSE; +GLboolean _GLEE_GLX_OML_sync_control = GL_FALSE; +GLboolean _GLEE_GLX_NV_float_buffer = GL_FALSE; +GLboolean _GLEE_GLX_SGIX_hyperpipe = GL_FALSE; +GLboolean _GLEE_GLX_MESA_agp_offset = GL_FALSE; +GLboolean _GLEE_GLX_EXT_fbconfig_packed_float = GL_FALSE; +GLboolean _GLEE_GLX_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean _GLEE_GLX_EXT_texture_from_pixmap = GL_FALSE; +GLboolean _GLEE_GLX_NV_present_video = GL_FALSE; +GLboolean _GLEE_GLX_NV_video_out = GL_FALSE; +GLboolean _GLEE_GLX_NV_swap_group = GL_FALSE; +GLboolean _GLEE_GLX_EXT_scene_marker = GL_FALSE; +GLboolean _GLEE_GLX_NV_video_output = GL_FALSE; + +/* GLX Extension names */ + +char __GLeeGLXExtensionNames[39][30]={ + "GLX_VERSION_1_3", + "GLX_VERSION_1_4", + "GLX_ARB_multisample", + "GLX_ARB_fbconfig_float", + "GLX_SGIS_multisample", + "GLX_EXT_visual_info", + "GLX_SGI_swap_control", + "GLX_SGI_video_sync", + "GLX_SGI_make_current_read", + "GLX_EXT_visual_rating", + "GLX_EXT_import_context", + "GLX_SGIX_fbconfig", + "GLX_SGIX_pbuffer", + "GLX_SGI_cushion", + "GLX_SGIX_video_resize", + "GLX_SGIX_swap_group", + "GLX_SGIX_swap_barrier", + "GLX_SGIS_blended_overlay", + "GLX_SGIS_shared_multisample", + "GLX_SUN_get_transparent_index", + "GLX_3DFX_multisample", + "GLX_MESA_copy_sub_buffer", + "GLX_MESA_pixmap_colormap", + "GLX_MESA_release_buffers", + "GLX_MESA_set_3dfx_mode", + "GLX_SGIX_visual_select_group", + "GLX_OML_swap_method", + "GLX_OML_sync_control", + "GLX_NV_float_buffer", + "GLX_SGIX_hyperpipe", + "GLX_MESA_agp_offset", + "GLX_EXT_fbconfig_packed_float", + "GLX_EXT_framebuffer_sRGB", + "GLX_EXT_texture_from_pixmap", + "GLX_NV_present_video", + "GLX_NV_video_out", + "GLX_NV_swap_group", + "GLX_EXT_scene_marker", + "GLX_NV_video_output" +}; +int __GLeeGLXNumExtensions=39; + +/* GLX_VERSION_1_3 */ + +#ifdef __GLEE_GLX_VERSION_1_3 +GLXFBConfig * __stdcall _Lazy_glXGetFBConfigs(Display * dpy, int screen, int * nelements) {if (GLeeInit()) return glXGetFBConfigs(dpy, screen, nelements); return (GLXFBConfig *)0;} +GLXFBConfig * __stdcall _Lazy_glXChooseFBConfig(Display * dpy, int screen, const int * attrib_list, int * nelements) {if (GLeeInit()) return glXChooseFBConfig(dpy, screen, attrib_list, nelements); return (GLXFBConfig *)0;} +int __stdcall _Lazy_glXGetFBConfigAttrib(Display * dpy, GLXFBConfig config, int attribute, int * value) {if (GLeeInit()) return glXGetFBConfigAttrib(dpy, config, attribute, value); return (int)0;} +XVisualInfo * __stdcall _Lazy_glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig config) {if (GLeeInit()) return glXGetVisualFromFBConfig(dpy, config); return (XVisualInfo *)0;} +GLXWindow __stdcall _Lazy_glXCreateWindow(Display * dpy, GLXFBConfig config, Window win, const int * attrib_list) {if (GLeeInit()) return glXCreateWindow(dpy, config, win, attrib_list); return (GLXWindow)0;} +void __stdcall _Lazy_glXDestroyWindow(Display * dpy, GLXWindow win) {if (GLeeInit()) glXDestroyWindow(dpy, win);} +GLXPixmap __stdcall _Lazy_glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap, const int * attrib_list) {if (GLeeInit()) return glXCreatePixmap(dpy, config, pixmap, attrib_list); return (GLXPixmap)0;} +void __stdcall _Lazy_glXDestroyPixmap(Display * dpy, GLXPixmap pixmap) {if (GLeeInit()) glXDestroyPixmap(dpy, pixmap);} +GLXPbuffer __stdcall _Lazy_glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int * attrib_list) {if (GLeeInit()) return glXCreatePbuffer(dpy, config, attrib_list); return (GLXPbuffer)0;} +void __stdcall _Lazy_glXDestroyPbuffer(Display * dpy, GLXPbuffer pbuf) {if (GLeeInit()) glXDestroyPbuffer(dpy, pbuf);} +void __stdcall _Lazy_glXQueryDrawable(Display * dpy, GLXDrawable draw, int attribute, unsigned int * value) {if (GLeeInit()) glXQueryDrawable(dpy, draw, attribute, value);} +GLXContext __stdcall _Lazy_glXCreateNewContext(Display * dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct) {if (GLeeInit()) return glXCreateNewContext(dpy, config, render_type, share_list, direct); return (GLXContext)0;} +Bool __stdcall _Lazy_glXMakeContextCurrent(Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) {if (GLeeInit()) return glXMakeContextCurrent(dpy, draw, read, ctx); return (Bool)0;} +GLXDrawable __stdcall _Lazy_glXGetCurrentReadDrawable(void) {if (GLeeInit()) return glXGetCurrentReadDrawable(); return (GLXDrawable)0;} +Display * __stdcall _Lazy_glXGetCurrentDisplay(void) {if (GLeeInit()) return glXGetCurrentDisplay(); return (Display *)0;} +int __stdcall _Lazy_glXQueryContext(Display * dpy, GLXContext ctx, int attribute, int * value) {if (GLeeInit()) return glXQueryContext(dpy, ctx, attribute, value); return (int)0;} +void __stdcall _Lazy_glXSelectEvent(Display * dpy, GLXDrawable draw, unsigned long event_mask) {if (GLeeInit()) glXSelectEvent(dpy, draw, event_mask);} +void __stdcall _Lazy_glXGetSelectedEvent(Display * dpy, GLXDrawable draw, unsigned long * event_mask) {if (GLeeInit()) glXGetSelectedEvent(dpy, draw, event_mask);} +PFNGLXGETFBCONFIGSPROC pglXGetFBConfigs=_Lazy_glXGetFBConfigs; +PFNGLXCHOOSEFBCONFIGPROC pglXChooseFBConfig=_Lazy_glXChooseFBConfig; +PFNGLXGETFBCONFIGATTRIBPROC pglXGetFBConfigAttrib=_Lazy_glXGetFBConfigAttrib; +PFNGLXGETVISUALFROMFBCONFIGPROC pglXGetVisualFromFBConfig=_Lazy_glXGetVisualFromFBConfig; +PFNGLXCREATEWINDOWPROC pglXCreateWindow=_Lazy_glXCreateWindow; +PFNGLXDESTROYWINDOWPROC pglXDestroyWindow=_Lazy_glXDestroyWindow; +PFNGLXCREATEPIXMAPPROC pglXCreatePixmap=_Lazy_glXCreatePixmap; +PFNGLXDESTROYPIXMAPPROC pglXDestroyPixmap=_Lazy_glXDestroyPixmap; +PFNGLXCREATEPBUFFERPROC pglXCreatePbuffer=_Lazy_glXCreatePbuffer; +PFNGLXDESTROYPBUFFERPROC pglXDestroyPbuffer=_Lazy_glXDestroyPbuffer; +PFNGLXQUERYDRAWABLEPROC pglXQueryDrawable=_Lazy_glXQueryDrawable; +PFNGLXCREATENEWCONTEXTPROC pglXCreateNewContext=_Lazy_glXCreateNewContext; +PFNGLXMAKECONTEXTCURRENTPROC pglXMakeContextCurrent=_Lazy_glXMakeContextCurrent; +PFNGLXGETCURRENTREADDRAWABLEPROC pglXGetCurrentReadDrawable=_Lazy_glXGetCurrentReadDrawable; +PFNGLXGETCURRENTDISPLAYPROC pglXGetCurrentDisplay=_Lazy_glXGetCurrentDisplay; +PFNGLXQUERYCONTEXTPROC pglXQueryContext=_Lazy_glXQueryContext; +PFNGLXSELECTEVENTPROC pglXSelectEvent=_Lazy_glXSelectEvent; +PFNGLXGETSELECTEDEVENTPROC pglXGetSelectedEvent=_Lazy_glXGetSelectedEvent; +#endif + +/* GLX_VERSION_1_4 */ + +#ifdef __GLEE_GLX_VERSION_1_4 +__GLXextFuncPtr __stdcall _Lazy_glXGetProcAddress(const GLubyte * procName) {if (GLeeInit()) return glXGetProcAddress(procName); return (__GLXextFuncPtr)0;} +PFNGLXGETPROCADDRESSPROC pglXGetProcAddress=_Lazy_glXGetProcAddress; +#endif + +/* GLX_ARB_multisample */ + +#ifdef __GLEE_GLX_ARB_multisample +#endif + +/* GLX_ARB_fbconfig_float */ + +#ifdef __GLEE_GLX_ARB_fbconfig_float +#endif + +/* GLX_SGIS_multisample */ + +#ifdef __GLEE_GLX_SGIS_multisample +#endif + +/* GLX_EXT_visual_info */ + +#ifdef __GLEE_GLX_EXT_visual_info +#endif + +/* GLX_SGI_swap_control */ + +#ifdef __GLEE_GLX_SGI_swap_control +int __stdcall _Lazy_glXSwapIntervalSGI(int interval) {if (GLeeInit()) return glXSwapIntervalSGI(interval); return (int)0;} +PFNGLXSWAPINTERVALSGIPROC pglXSwapIntervalSGI=_Lazy_glXSwapIntervalSGI; +#endif + +/* GLX_SGI_video_sync */ + +#ifdef __GLEE_GLX_SGI_video_sync +int __stdcall _Lazy_glXGetVideoSyncSGI(unsigned int * count) {if (GLeeInit()) return glXGetVideoSyncSGI(count); return (int)0;} +int __stdcall _Lazy_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int * count) {if (GLeeInit()) return glXWaitVideoSyncSGI(divisor, remainder, count); return (int)0;} +PFNGLXGETVIDEOSYNCSGIPROC pglXGetVideoSyncSGI=_Lazy_glXGetVideoSyncSGI; +PFNGLXWAITVIDEOSYNCSGIPROC pglXWaitVideoSyncSGI=_Lazy_glXWaitVideoSyncSGI; +#endif + +/* GLX_SGI_make_current_read */ + +#ifdef __GLEE_GLX_SGI_make_current_read +Bool __stdcall _Lazy_glXMakeCurrentReadSGI(Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) {if (GLeeInit()) return glXMakeCurrentReadSGI(dpy, draw, read, ctx); return (Bool)0;} +GLXDrawable __stdcall _Lazy_glXGetCurrentReadDrawableSGI(void) {if (GLeeInit()) return glXGetCurrentReadDrawableSGI(); return (GLXDrawable)0;} +PFNGLXMAKECURRENTREADSGIPROC pglXMakeCurrentReadSGI=_Lazy_glXMakeCurrentReadSGI; +PFNGLXGETCURRENTREADDRAWABLESGIPROC pglXGetCurrentReadDrawableSGI=_Lazy_glXGetCurrentReadDrawableSGI; +#endif + +/* GLX_EXT_visual_rating */ + +#ifdef __GLEE_GLX_EXT_visual_rating +#endif + +/* GLX_EXT_import_context */ + +#ifdef __GLEE_GLX_EXT_import_context +Display * __stdcall _Lazy_glXGetCurrentDisplayEXT(void) {if (GLeeInit()) return glXGetCurrentDisplayEXT(); return (Display *)0;} +int __stdcall _Lazy_glXQueryContextInfoEXT(Display * dpy, GLXContext context, int attribute, int * value) {if (GLeeInit()) return glXQueryContextInfoEXT(dpy, context, attribute, value); return (int)0;} +GLXContextID __stdcall _Lazy_glXGetContextIDEXT(const GLXContext context) {if (GLeeInit()) return glXGetContextIDEXT(context); return (GLXContextID)0;} +GLXContext __stdcall _Lazy_glXImportContextEXT(Display * dpy, GLXContextID contextID) {if (GLeeInit()) return glXImportContextEXT(dpy, contextID); return (GLXContext)0;} +void __stdcall _Lazy_glXFreeContextEXT(Display * dpy, GLXContext context) {if (GLeeInit()) glXFreeContextEXT(dpy, context);} +PFNGLXGETCURRENTDISPLAYEXTPROC pglXGetCurrentDisplayEXT=_Lazy_glXGetCurrentDisplayEXT; +PFNGLXQUERYCONTEXTINFOEXTPROC pglXQueryContextInfoEXT=_Lazy_glXQueryContextInfoEXT; +PFNGLXGETCONTEXTIDEXTPROC pglXGetContextIDEXT=_Lazy_glXGetContextIDEXT; +PFNGLXIMPORTCONTEXTEXTPROC pglXImportContextEXT=_Lazy_glXImportContextEXT; +PFNGLXFREECONTEXTEXTPROC pglXFreeContextEXT=_Lazy_glXFreeContextEXT; +#endif + +/* GLX_SGIX_fbconfig */ + +#ifdef __GLEE_GLX_SGIX_fbconfig +int __stdcall _Lazy_glXGetFBConfigAttribSGIX(Display * dpy, GLXFBConfigSGIX config, int attribute, int * value) {if (GLeeInit()) return glXGetFBConfigAttribSGIX(dpy, config, attribute, value); return (int)0;} +GLXFBConfigSGIX * __stdcall _Lazy_glXChooseFBConfigSGIX(Display * dpy, int screen, int * attrib_list, int * nelements) {if (GLeeInit()) return glXChooseFBConfigSGIX(dpy, screen, attrib_list, nelements); return (GLXFBConfigSGIX *)0;} +GLXPixmap __stdcall _Lazy_glXCreateGLXPixmapWithConfigSGIX(Display * dpy, GLXFBConfigSGIX config, Pixmap pixmap) {if (GLeeInit()) return glXCreateGLXPixmapWithConfigSGIX(dpy, config, pixmap); return (GLXPixmap)0;} +GLXContext __stdcall _Lazy_glXCreateContextWithConfigSGIX(Display * dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct) {if (GLeeInit()) return glXCreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct); return (GLXContext)0;} +XVisualInfo * __stdcall _Lazy_glXGetVisualFromFBConfigSGIX(Display * dpy, GLXFBConfigSGIX config) {if (GLeeInit()) return glXGetVisualFromFBConfigSGIX(dpy, config); return (XVisualInfo *)0;} +GLXFBConfigSGIX __stdcall _Lazy_glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis) {if (GLeeInit()) return glXGetFBConfigFromVisualSGIX(dpy, vis); return (GLXFBConfigSGIX)0;} +PFNGLXGETFBCONFIGATTRIBSGIXPROC pglXGetFBConfigAttribSGIX=_Lazy_glXGetFBConfigAttribSGIX; +PFNGLXCHOOSEFBCONFIGSGIXPROC pglXChooseFBConfigSGIX=_Lazy_glXChooseFBConfigSGIX; +PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC pglXCreateGLXPixmapWithConfigSGIX=_Lazy_glXCreateGLXPixmapWithConfigSGIX; +PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC pglXCreateContextWithConfigSGIX=_Lazy_glXCreateContextWithConfigSGIX; +PFNGLXGETVISUALFROMFBCONFIGSGIXPROC pglXGetVisualFromFBConfigSGIX=_Lazy_glXGetVisualFromFBConfigSGIX; +PFNGLXGETFBCONFIGFROMVISUALSGIXPROC pglXGetFBConfigFromVisualSGIX=_Lazy_glXGetFBConfigFromVisualSGIX; +#endif + +/* GLX_SGIX_pbuffer */ + +#ifdef __GLEE_GLX_SGIX_pbuffer +GLXPbufferSGIX __stdcall _Lazy_glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int * attrib_list) {if (GLeeInit()) return glXCreateGLXPbufferSGIX(dpy, config, width, height, attrib_list); return (GLXPbufferSGIX)0;} +void __stdcall _Lazy_glXDestroyGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX pbuf) {if (GLeeInit()) glXDestroyGLXPbufferSGIX(dpy, pbuf);} +int __stdcall _Lazy_glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int * value) {if (GLeeInit()) return glXQueryGLXPbufferSGIX(dpy, pbuf, attribute, value); return (int)0;} +void __stdcall _Lazy_glXSelectEventSGIX(Display * dpy, GLXDrawable drawable, unsigned long mask) {if (GLeeInit()) glXSelectEventSGIX(dpy, drawable, mask);} +void __stdcall _Lazy_glXGetSelectedEventSGIX(Display * dpy, GLXDrawable drawable, unsigned long * mask) {if (GLeeInit()) glXGetSelectedEventSGIX(dpy, drawable, mask);} +PFNGLXCREATEGLXPBUFFERSGIXPROC pglXCreateGLXPbufferSGIX=_Lazy_glXCreateGLXPbufferSGIX; +PFNGLXDESTROYGLXPBUFFERSGIXPROC pglXDestroyGLXPbufferSGIX=_Lazy_glXDestroyGLXPbufferSGIX; +PFNGLXQUERYGLXPBUFFERSGIXPROC pglXQueryGLXPbufferSGIX=_Lazy_glXQueryGLXPbufferSGIX; +PFNGLXSELECTEVENTSGIXPROC pglXSelectEventSGIX=_Lazy_glXSelectEventSGIX; +PFNGLXGETSELECTEDEVENTSGIXPROC pglXGetSelectedEventSGIX=_Lazy_glXGetSelectedEventSGIX; +#endif + +/* GLX_SGI_cushion */ + +#ifdef __GLEE_GLX_SGI_cushion +void __stdcall _Lazy_glXCushionSGI(Display * dpy, Window window, float cushion) {if (GLeeInit()) glXCushionSGI(dpy, window, cushion);} +PFNGLXCUSHIONSGIPROC pglXCushionSGI=_Lazy_glXCushionSGI; +#endif + +/* GLX_SGIX_video_resize */ + +#ifdef __GLEE_GLX_SGIX_video_resize +int __stdcall _Lazy_glXBindChannelToWindowSGIX(Display * display, int screen, int channel, Window window) {if (GLeeInit()) return glXBindChannelToWindowSGIX(display, screen, channel, window); return (int)0;} +int __stdcall _Lazy_glXChannelRectSGIX(Display * display, int screen, int channel, int x, int y, int w, int h) {if (GLeeInit()) return glXChannelRectSGIX(display, screen, channel, x, y, w, h); return (int)0;} +int __stdcall _Lazy_glXQueryChannelRectSGIX(Display * display, int screen, int channel, int * dx, int * dy, int * dw, int * dh) {if (GLeeInit()) return glXQueryChannelRectSGIX(display, screen, channel, dx, dy, dw, dh); return (int)0;} +int __stdcall _Lazy_glXQueryChannelDeltasSGIX(Display * display, int screen, int channel, int * x, int * y, int * w, int * h) {if (GLeeInit()) return glXQueryChannelDeltasSGIX(display, screen, channel, x, y, w, h); return (int)0;} +int __stdcall _Lazy_glXChannelRectSyncSGIX(Display * display, int screen, int channel, GLenum synctype) {if (GLeeInit()) return glXChannelRectSyncSGIX(display, screen, channel, synctype); return (int)0;} +PFNGLXBINDCHANNELTOWINDOWSGIXPROC pglXBindChannelToWindowSGIX=_Lazy_glXBindChannelToWindowSGIX; +PFNGLXCHANNELRECTSGIXPROC pglXChannelRectSGIX=_Lazy_glXChannelRectSGIX; +PFNGLXQUERYCHANNELRECTSGIXPROC pglXQueryChannelRectSGIX=_Lazy_glXQueryChannelRectSGIX; +PFNGLXQUERYCHANNELDELTASSGIXPROC pglXQueryChannelDeltasSGIX=_Lazy_glXQueryChannelDeltasSGIX; +PFNGLXCHANNELRECTSYNCSGIXPROC pglXChannelRectSyncSGIX=_Lazy_glXChannelRectSyncSGIX; +#endif + +/* GLX_SGIX_swap_group */ + +#ifdef __GLEE_GLX_SGIX_swap_group +void __stdcall _Lazy_glXJoinSwapGroupSGIX(Display * dpy, GLXDrawable drawable, GLXDrawable member) {if (GLeeInit()) glXJoinSwapGroupSGIX(dpy, drawable, member);} +PFNGLXJOINSWAPGROUPSGIXPROC pglXJoinSwapGroupSGIX=_Lazy_glXJoinSwapGroupSGIX; +#endif + +/* GLX_SGIX_swap_barrier */ + +#ifdef __GLEE_GLX_SGIX_swap_barrier +void __stdcall _Lazy_glXBindSwapBarrierSGIX(Display * dpy, GLXDrawable drawable, int barrier) {if (GLeeInit()) glXBindSwapBarrierSGIX(dpy, drawable, barrier);} +Bool __stdcall _Lazy_glXQueryMaxSwapBarriersSGIX(Display * dpy, int screen, int * max) {if (GLeeInit()) return glXQueryMaxSwapBarriersSGIX(dpy, screen, max); return (Bool)0;} +PFNGLXBINDSWAPBARRIERSGIXPROC pglXBindSwapBarrierSGIX=_Lazy_glXBindSwapBarrierSGIX; +PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC pglXQueryMaxSwapBarriersSGIX=_Lazy_glXQueryMaxSwapBarriersSGIX; +#endif + +/* GLX_SGIS_blended_overlay */ + +#ifdef __GLEE_GLX_SGIS_blended_overlay +#endif + +/* GLX_SGIS_shared_multisample */ + +#ifdef __GLEE_GLX_SGIS_shared_multisample +#endif + +/* GLX_SUN_get_transparent_index */ + +#ifdef __GLEE_GLX_SUN_get_transparent_index +Status __stdcall _Lazy_glXGetTransparentIndexSUN(Display * dpy, Window overlay, Window underlay, long * pTransparentIndex) {if (GLeeInit()) return glXGetTransparentIndexSUN(dpy, overlay, underlay, pTransparentIndex); return (Status)0;} +PFNGLXGETTRANSPARENTINDEXSUNPROC pglXGetTransparentIndexSUN=_Lazy_glXGetTransparentIndexSUN; +#endif + +/* GLX_3DFX_multisample */ + +#ifdef __GLEE_GLX_3DFX_multisample +#endif + +/* GLX_MESA_copy_sub_buffer */ + +#ifdef __GLEE_GLX_MESA_copy_sub_buffer +void __stdcall _Lazy_glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable, int x, int y, int width, int height) {if (GLeeInit()) glXCopySubBufferMESA(dpy, drawable, x, y, width, height);} +PFNGLXCOPYSUBBUFFERMESAPROC pglXCopySubBufferMESA=_Lazy_glXCopySubBufferMESA; +#endif + +/* GLX_MESA_pixmap_colormap */ + +#ifdef __GLEE_GLX_MESA_pixmap_colormap +GLXPixmap __stdcall _Lazy_glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual, Pixmap pixmap, Colormap cmap) {if (GLeeInit()) return glXCreateGLXPixmapMESA(dpy, visual, pixmap, cmap); return (GLXPixmap)0;} +PFNGLXCREATEGLXPIXMAPMESAPROC pglXCreateGLXPixmapMESA=_Lazy_glXCreateGLXPixmapMESA; +#endif + +/* GLX_MESA_release_buffers */ + +#ifdef __GLEE_GLX_MESA_release_buffers +Bool __stdcall _Lazy_glXReleaseBuffersMESA(Display * dpy, GLXDrawable drawable) {if (GLeeInit()) return glXReleaseBuffersMESA(dpy, drawable); return (Bool)0;} +PFNGLXRELEASEBUFFERSMESAPROC pglXReleaseBuffersMESA=_Lazy_glXReleaseBuffersMESA; +#endif + +/* GLX_MESA_set_3dfx_mode */ + +#ifdef __GLEE_GLX_MESA_set_3dfx_mode +Bool __stdcall _Lazy_glXSet3DfxModeMESA(int mode) {if (GLeeInit()) return glXSet3DfxModeMESA(mode); return (Bool)0;} +PFNGLXSET3DFXMODEMESAPROC pglXSet3DfxModeMESA=_Lazy_glXSet3DfxModeMESA; +#endif + +/* GLX_SGIX_visual_select_group */ + +#ifdef __GLEE_GLX_SGIX_visual_select_group +#endif + +/* GLX_OML_swap_method */ + +#ifdef __GLEE_GLX_OML_swap_method +#endif + +/* GLX_OML_sync_control */ + +#ifdef __GLEE_GLX_OML_sync_control +Bool __stdcall _Lazy_glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable, int64_t * ust, int64_t * msc, int64_t * sbc) {if (GLeeInit()) return glXGetSyncValuesOML(dpy, drawable, ust, msc, sbc); return (Bool)0;} +Bool __stdcall _Lazy_glXGetMscRateOML(Display * dpy, GLXDrawable drawable, int32_t * numerator, int32_t * denominator) {if (GLeeInit()) return glXGetMscRateOML(dpy, drawable, numerator, denominator); return (Bool)0;} +int64_t __stdcall _Lazy_glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder) {if (GLeeInit()) return glXSwapBuffersMscOML(dpy, drawable, target_msc, divisor, remainder); return (int64_t)0;} +Bool __stdcall _Lazy_glXWaitForMscOML(Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * ust, int64_t * msc, int64_t * sbc) {if (GLeeInit()) return glXWaitForMscOML(dpy, drawable, target_msc, divisor, remainder, ust, msc, sbc); return (Bool)0;} +Bool __stdcall _Lazy_glXWaitForSbcOML(Display * dpy, GLXDrawable drawable, int64_t target_sbc, int64_t * ust, int64_t * msc, int64_t * sbc) {if (GLeeInit()) return glXWaitForSbcOML(dpy, drawable, target_sbc, ust, msc, sbc); return (Bool)0;} +PFNGLXGETSYNCVALUESOMLPROC pglXGetSyncValuesOML=_Lazy_glXGetSyncValuesOML; +PFNGLXGETMSCRATEOMLPROC pglXGetMscRateOML=_Lazy_glXGetMscRateOML; +PFNGLXSWAPBUFFERSMSCOMLPROC pglXSwapBuffersMscOML=_Lazy_glXSwapBuffersMscOML; +PFNGLXWAITFORMSCOMLPROC pglXWaitForMscOML=_Lazy_glXWaitForMscOML; +PFNGLXWAITFORSBCOMLPROC pglXWaitForSbcOML=_Lazy_glXWaitForSbcOML; +#endif + +/* GLX_NV_float_buffer */ + +#ifdef __GLEE_GLX_NV_float_buffer +#endif + +/* GLX_SGIX_hyperpipe */ + +#ifdef __GLEE_GLX_SGIX_hyperpipe +GLXHyperpipeNetworkSGIX * __stdcall _Lazy_glXQueryHyperpipeNetworkSGIX(Display * dpy, int * npipes) {if (GLeeInit()) return glXQueryHyperpipeNetworkSGIX(dpy, npipes); return (GLXHyperpipeNetworkSGIX *)0;} +int __stdcall _Lazy_glXHyperpipeConfigSGIX(Display * dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX * cfg, int * hpId) {if (GLeeInit()) return glXHyperpipeConfigSGIX(dpy, networkId, npipes, cfg, hpId); return (int)0;} +GLXHyperpipeConfigSGIX * __stdcall _Lazy_glXQueryHyperpipeConfigSGIX(Display * dpy, int hpId, int * npipes) {if (GLeeInit()) return glXQueryHyperpipeConfigSGIX(dpy, hpId, npipes); return (GLXHyperpipeConfigSGIX *)0;} +int __stdcall _Lazy_glXDestroyHyperpipeConfigSGIX(Display * dpy, int hpId) {if (GLeeInit()) return glXDestroyHyperpipeConfigSGIX(dpy, hpId); return (int)0;} +int __stdcall _Lazy_glXBindHyperpipeSGIX(Display * dpy, int hpId) {if (GLeeInit()) return glXBindHyperpipeSGIX(dpy, hpId); return (int)0;} +int __stdcall _Lazy_glXQueryHyperpipeBestAttribSGIX(Display * dpy, int timeSlice, int attrib, int size, void * attribList, void * returnAttribList) {if (GLeeInit()) return glXQueryHyperpipeBestAttribSGIX(dpy, timeSlice, attrib, size, attribList, returnAttribList); return (int)0;} +int __stdcall _Lazy_glXHyperpipeAttribSGIX(Display * dpy, int timeSlice, int attrib, int size, void * attribList) {if (GLeeInit()) return glXHyperpipeAttribSGIX(dpy, timeSlice, attrib, size, attribList); return (int)0;} +int __stdcall _Lazy_glXQueryHyperpipeAttribSGIX(Display * dpy, int timeSlice, int attrib, int size, void * returnAttribList) {if (GLeeInit()) return glXQueryHyperpipeAttribSGIX(dpy, timeSlice, attrib, size, returnAttribList); return (int)0;} +PFNGLXQUERYHYPERPIPENETWORKSGIXPROC pglXQueryHyperpipeNetworkSGIX=_Lazy_glXQueryHyperpipeNetworkSGIX; +PFNGLXHYPERPIPECONFIGSGIXPROC pglXHyperpipeConfigSGIX=_Lazy_glXHyperpipeConfigSGIX; +PFNGLXQUERYHYPERPIPECONFIGSGIXPROC pglXQueryHyperpipeConfigSGIX=_Lazy_glXQueryHyperpipeConfigSGIX; +PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC pglXDestroyHyperpipeConfigSGIX=_Lazy_glXDestroyHyperpipeConfigSGIX; +PFNGLXBINDHYPERPIPESGIXPROC pglXBindHyperpipeSGIX=_Lazy_glXBindHyperpipeSGIX; +PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC pglXQueryHyperpipeBestAttribSGIX=_Lazy_glXQueryHyperpipeBestAttribSGIX; +PFNGLXHYPERPIPEATTRIBSGIXPROC pglXHyperpipeAttribSGIX=_Lazy_glXHyperpipeAttribSGIX; +PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC pglXQueryHyperpipeAttribSGIX=_Lazy_glXQueryHyperpipeAttribSGIX; +#endif + +/* GLX_MESA_agp_offset */ + +#ifdef __GLEE_GLX_MESA_agp_offset +unsigned int __stdcall _Lazy_glXGetAGPOffsetMESA(const void * pointer) {if (GLeeInit()) return glXGetAGPOffsetMESA(pointer); return (unsigned int)0;} +PFNGLXGETAGPOFFSETMESAPROC pglXGetAGPOffsetMESA=_Lazy_glXGetAGPOffsetMESA; +#endif + +/* GLX_EXT_fbconfig_packed_float */ + +#ifdef __GLEE_GLX_EXT_fbconfig_packed_float +#endif + +/* GLX_EXT_framebuffer_sRGB */ + +#ifdef __GLEE_GLX_EXT_framebuffer_sRGB +#endif + +/* GLX_EXT_texture_from_pixmap */ + +#ifdef __GLEE_GLX_EXT_texture_from_pixmap +void __stdcall _Lazy_glXBindTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer, const int * attrib_list) {if (GLeeInit()) glXBindTexImageEXT(dpy, drawable, buffer, attrib_list);} +void __stdcall _Lazy_glXReleaseTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer) {if (GLeeInit()) glXReleaseTexImageEXT(dpy, drawable, buffer);} +PFNGLXBINDTEXIMAGEEXTPROC pglXBindTexImageEXT=_Lazy_glXBindTexImageEXT; +PFNGLXRELEASETEXIMAGEEXTPROC pglXReleaseTexImageEXT=_Lazy_glXReleaseTexImageEXT; +#endif + +/* GLX_NV_present_video */ + +#ifdef __GLEE_GLX_NV_present_video +#endif + +/* GLX_NV_video_out */ + +#ifdef __GLEE_GLX_NV_video_out +#endif + +/* GLX_NV_swap_group */ + +#ifdef __GLEE_GLX_NV_swap_group +#endif + +/* GLX_EXT_scene_marker */ + +#ifdef __GLEE_GLX_EXT_scene_marker +#endif + +/* GLX_NV_video_output */ + +#ifdef __GLEE_GLX_NV_video_output +int __stdcall _Lazy_glXGetVideoDeviceNV(Display * dpy, int screen, int numVideoDevices, GLXVideoDeviceNV * pVideoDevice) {if (GLeeInit()) return glXGetVideoDeviceNV(dpy, screen, numVideoDevices, pVideoDevice); return (int)0;} +int __stdcall _Lazy_glXReleaseVideoDeviceNV(Display * dpy, int screen, GLXVideoDeviceNV VideoDevice) {if (GLeeInit()) return glXReleaseVideoDeviceNV(dpy, screen, VideoDevice); return (int)0;} +int __stdcall _Lazy_glXBindVideoImageNV(Display * dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer) {if (GLeeInit()) return glXBindVideoImageNV(dpy, VideoDevice, pbuf, iVideoBuffer); return (int)0;} +int __stdcall _Lazy_glXReleaseVideoImageNV(Display * dpy, GLXPbuffer pbuf) {if (GLeeInit()) return glXReleaseVideoImageNV(dpy, pbuf); return (int)0;} +int __stdcall _Lazy_glXSendPbufferToVideoNV(Display * dpy, GLXPbuffer pbuf, int iBufferType, unsigned long * pulCounterPbuffer, GLboolean bBlock) {if (GLeeInit()) return glXSendPbufferToVideoNV(dpy, pbuf, iBufferType, pulCounterPbuffer, bBlock); return (int)0;} +int __stdcall _Lazy_glXGetVideoInfoNV(Display * dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long * pulCounterOutputPbuffer, unsigned long * pulCounterOutputVideo) {if (GLeeInit()) return glXGetVideoInfoNV(dpy, screen, VideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo); return (int)0;} +PFNGLXGETVIDEODEVICENVPROC pglXGetVideoDeviceNV=_Lazy_glXGetVideoDeviceNV; +PFNGLXRELEASEVIDEODEVICENVPROC pglXReleaseVideoDeviceNV=_Lazy_glXReleaseVideoDeviceNV; +PFNGLXBINDVIDEOIMAGENVPROC pglXBindVideoImageNV=_Lazy_glXBindVideoImageNV; +PFNGLXRELEASEVIDEOIMAGENVPROC pglXReleaseVideoImageNV=_Lazy_glXReleaseVideoImageNV; +PFNGLXSENDPBUFFERTOVIDEONVPROC pglXSendPbufferToVideoNV=_Lazy_glXSendPbufferToVideoNV; +PFNGLXGETVIDEOINFONVPROC pglXGetVideoInfoNV=_Lazy_glXGetVideoInfoNV; +#endif +#endif /* end GLX */ +/***************************************************************** +* Extension link functions +*****************************************************************/ + +GLuint __GLeeLink_GL_VERSION_1_2(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_VERSION_1_2 + if ((pglBlendColor = (PFNGLBLENDCOLORPROC) __GLeeGetProcAddress("glBlendColor"))!=0) nLinked++; + if ((pglBlendEquation = (PFNGLBLENDEQUATIONPROC) __GLeeGetProcAddress("glBlendEquation"))!=0) nLinked++; + if ((pglDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) __GLeeGetProcAddress("glDrawRangeElements"))!=0) nLinked++; + if ((pglColorTable = (PFNGLCOLORTABLEPROC) __GLeeGetProcAddress("glColorTable"))!=0) nLinked++; + if ((pglColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC) __GLeeGetProcAddress("glColorTableParameterfv"))!=0) nLinked++; + if ((pglColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC) __GLeeGetProcAddress("glColorTableParameteriv"))!=0) nLinked++; + if ((pglCopyColorTable = (PFNGLCOPYCOLORTABLEPROC) __GLeeGetProcAddress("glCopyColorTable"))!=0) nLinked++; + if ((pglGetColorTable = (PFNGLGETCOLORTABLEPROC) __GLeeGetProcAddress("glGetColorTable"))!=0) nLinked++; + if ((pglGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC) __GLeeGetProcAddress("glGetColorTableParameterfv"))!=0) nLinked++; + if ((pglGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC) __GLeeGetProcAddress("glGetColorTableParameteriv"))!=0) nLinked++; + if ((pglColorSubTable = (PFNGLCOLORSUBTABLEPROC) __GLeeGetProcAddress("glColorSubTable"))!=0) nLinked++; + if ((pglCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC) __GLeeGetProcAddress("glCopyColorSubTable"))!=0) nLinked++; + if ((pglConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC) __GLeeGetProcAddress("glConvolutionFilter1D"))!=0) nLinked++; + if ((pglConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC) __GLeeGetProcAddress("glConvolutionFilter2D"))!=0) nLinked++; + if ((pglConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC) __GLeeGetProcAddress("glConvolutionParameterf"))!=0) nLinked++; + if ((pglConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC) __GLeeGetProcAddress("glConvolutionParameterfv"))!=0) nLinked++; + if ((pglConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC) __GLeeGetProcAddress("glConvolutionParameteri"))!=0) nLinked++; + if ((pglConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC) __GLeeGetProcAddress("glConvolutionParameteriv"))!=0) nLinked++; + if ((pglCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC) __GLeeGetProcAddress("glCopyConvolutionFilter1D"))!=0) nLinked++; + if ((pglCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC) __GLeeGetProcAddress("glCopyConvolutionFilter2D"))!=0) nLinked++; + if ((pglGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC) __GLeeGetProcAddress("glGetConvolutionFilter"))!=0) nLinked++; + if ((pglGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC) __GLeeGetProcAddress("glGetConvolutionParameterfv"))!=0) nLinked++; + if ((pglGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC) __GLeeGetProcAddress("glGetConvolutionParameteriv"))!=0) nLinked++; + if ((pglGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC) __GLeeGetProcAddress("glGetSeparableFilter"))!=0) nLinked++; + if ((pglSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC) __GLeeGetProcAddress("glSeparableFilter2D"))!=0) nLinked++; + if ((pglGetHistogram = (PFNGLGETHISTOGRAMPROC) __GLeeGetProcAddress("glGetHistogram"))!=0) nLinked++; + if ((pglGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC) __GLeeGetProcAddress("glGetHistogramParameterfv"))!=0) nLinked++; + if ((pglGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC) __GLeeGetProcAddress("glGetHistogramParameteriv"))!=0) nLinked++; + if ((pglGetMinmax = (PFNGLGETMINMAXPROC) __GLeeGetProcAddress("glGetMinmax"))!=0) nLinked++; + if ((pglGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC) __GLeeGetProcAddress("glGetMinmaxParameterfv"))!=0) nLinked++; + if ((pglGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC) __GLeeGetProcAddress("glGetMinmaxParameteriv"))!=0) nLinked++; + if ((pglHistogram = (PFNGLHISTOGRAMPROC) __GLeeGetProcAddress("glHistogram"))!=0) nLinked++; + if ((pglMinmax = (PFNGLMINMAXPROC) __GLeeGetProcAddress("glMinmax"))!=0) nLinked++; + if ((pglResetHistogram = (PFNGLRESETHISTOGRAMPROC) __GLeeGetProcAddress("glResetHistogram"))!=0) nLinked++; + if ((pglResetMinmax = (PFNGLRESETMINMAXPROC) __GLeeGetProcAddress("glResetMinmax"))!=0) nLinked++; + if ((pglTexImage3D = (PFNGLTEXIMAGE3DPROC) __GLeeGetProcAddress("glTexImage3D"))!=0) nLinked++; + if ((pglTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) __GLeeGetProcAddress("glTexSubImage3D"))!=0) nLinked++; + if ((pglCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) __GLeeGetProcAddress("glCopyTexSubImage3D"))!=0) nLinked++; +#endif + if (nLinked==38) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_imaging(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_VERSION_1_3(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_VERSION_1_3 + if ((pglActiveTexture = (PFNGLACTIVETEXTUREPROC) __GLeeGetProcAddress("glActiveTexture"))!=0) nLinked++; + if ((pglClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC) __GLeeGetProcAddress("glClientActiveTexture"))!=0) nLinked++; + if ((pglMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC) __GLeeGetProcAddress("glMultiTexCoord1d"))!=0) nLinked++; + if ((pglMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC) __GLeeGetProcAddress("glMultiTexCoord1dv"))!=0) nLinked++; + if ((pglMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC) __GLeeGetProcAddress("glMultiTexCoord1f"))!=0) nLinked++; + if ((pglMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC) __GLeeGetProcAddress("glMultiTexCoord1fv"))!=0) nLinked++; + if ((pglMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC) __GLeeGetProcAddress("glMultiTexCoord1i"))!=0) nLinked++; + if ((pglMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC) __GLeeGetProcAddress("glMultiTexCoord1iv"))!=0) nLinked++; + if ((pglMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC) __GLeeGetProcAddress("glMultiTexCoord1s"))!=0) nLinked++; + if ((pglMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC) __GLeeGetProcAddress("glMultiTexCoord1sv"))!=0) nLinked++; + if ((pglMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC) __GLeeGetProcAddress("glMultiTexCoord2d"))!=0) nLinked++; + if ((pglMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC) __GLeeGetProcAddress("glMultiTexCoord2dv"))!=0) nLinked++; + if ((pglMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC) __GLeeGetProcAddress("glMultiTexCoord2f"))!=0) nLinked++; + if ((pglMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC) __GLeeGetProcAddress("glMultiTexCoord2fv"))!=0) nLinked++; + if ((pglMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC) __GLeeGetProcAddress("glMultiTexCoord2i"))!=0) nLinked++; + if ((pglMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC) __GLeeGetProcAddress("glMultiTexCoord2iv"))!=0) nLinked++; + if ((pglMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC) __GLeeGetProcAddress("glMultiTexCoord2s"))!=0) nLinked++; + if ((pglMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC) __GLeeGetProcAddress("glMultiTexCoord2sv"))!=0) nLinked++; + if ((pglMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC) __GLeeGetProcAddress("glMultiTexCoord3d"))!=0) nLinked++; + if ((pglMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC) __GLeeGetProcAddress("glMultiTexCoord3dv"))!=0) nLinked++; + if ((pglMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC) __GLeeGetProcAddress("glMultiTexCoord3f"))!=0) nLinked++; + if ((pglMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC) __GLeeGetProcAddress("glMultiTexCoord3fv"))!=0) nLinked++; + if ((pglMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC) __GLeeGetProcAddress("glMultiTexCoord3i"))!=0) nLinked++; + if ((pglMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC) __GLeeGetProcAddress("glMultiTexCoord3iv"))!=0) nLinked++; + if ((pglMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC) __GLeeGetProcAddress("glMultiTexCoord3s"))!=0) nLinked++; + if ((pglMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC) __GLeeGetProcAddress("glMultiTexCoord3sv"))!=0) nLinked++; + if ((pglMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC) __GLeeGetProcAddress("glMultiTexCoord4d"))!=0) nLinked++; + if ((pglMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC) __GLeeGetProcAddress("glMultiTexCoord4dv"))!=0) nLinked++; + if ((pglMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC) __GLeeGetProcAddress("glMultiTexCoord4f"))!=0) nLinked++; + if ((pglMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC) __GLeeGetProcAddress("glMultiTexCoord4fv"))!=0) nLinked++; + if ((pglMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC) __GLeeGetProcAddress("glMultiTexCoord4i"))!=0) nLinked++; + if ((pglMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC) __GLeeGetProcAddress("glMultiTexCoord4iv"))!=0) nLinked++; + if ((pglMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC) __GLeeGetProcAddress("glMultiTexCoord4s"))!=0) nLinked++; + if ((pglMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC) __GLeeGetProcAddress("glMultiTexCoord4sv"))!=0) nLinked++; + if ((pglLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC) __GLeeGetProcAddress("glLoadTransposeMatrixf"))!=0) nLinked++; + if ((pglLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC) __GLeeGetProcAddress("glLoadTransposeMatrixd"))!=0) nLinked++; + if ((pglMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC) __GLeeGetProcAddress("glMultTransposeMatrixf"))!=0) nLinked++; + if ((pglMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC) __GLeeGetProcAddress("glMultTransposeMatrixd"))!=0) nLinked++; + if ((pglSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) __GLeeGetProcAddress("glSampleCoverage"))!=0) nLinked++; + if ((pglCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) __GLeeGetProcAddress("glCompressedTexImage3D"))!=0) nLinked++; + if ((pglCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) __GLeeGetProcAddress("glCompressedTexImage2D"))!=0) nLinked++; + if ((pglCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC) __GLeeGetProcAddress("glCompressedTexImage1D"))!=0) nLinked++; + if ((pglCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) __GLeeGetProcAddress("glCompressedTexSubImage3D"))!=0) nLinked++; + if ((pglCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) __GLeeGetProcAddress("glCompressedTexSubImage2D"))!=0) nLinked++; + if ((pglCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) __GLeeGetProcAddress("glCompressedTexSubImage1D"))!=0) nLinked++; + if ((pglGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC) __GLeeGetProcAddress("glGetCompressedTexImage"))!=0) nLinked++; +#endif + if (nLinked==46) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_VERSION_1_4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_VERSION_1_4 + if ((pglBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) __GLeeGetProcAddress("glBlendFuncSeparate"))!=0) nLinked++; + if ((pglFogCoordf = (PFNGLFOGCOORDFPROC) __GLeeGetProcAddress("glFogCoordf"))!=0) nLinked++; + if ((pglFogCoordfv = (PFNGLFOGCOORDFVPROC) __GLeeGetProcAddress("glFogCoordfv"))!=0) nLinked++; + if ((pglFogCoordd = (PFNGLFOGCOORDDPROC) __GLeeGetProcAddress("glFogCoordd"))!=0) nLinked++; + if ((pglFogCoorddv = (PFNGLFOGCOORDDVPROC) __GLeeGetProcAddress("glFogCoorddv"))!=0) nLinked++; + if ((pglFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC) __GLeeGetProcAddress("glFogCoordPointer"))!=0) nLinked++; + if ((pglMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC) __GLeeGetProcAddress("glMultiDrawArrays"))!=0) nLinked++; + if ((pglMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC) __GLeeGetProcAddress("glMultiDrawElements"))!=0) nLinked++; + if ((pglPointParameterf = (PFNGLPOINTPARAMETERFPROC) __GLeeGetProcAddress("glPointParameterf"))!=0) nLinked++; + if ((pglPointParameterfv = (PFNGLPOINTPARAMETERFVPROC) __GLeeGetProcAddress("glPointParameterfv"))!=0) nLinked++; + if ((pglPointParameteri = (PFNGLPOINTPARAMETERIPROC) __GLeeGetProcAddress("glPointParameteri"))!=0) nLinked++; + if ((pglPointParameteriv = (PFNGLPOINTPARAMETERIVPROC) __GLeeGetProcAddress("glPointParameteriv"))!=0) nLinked++; + if ((pglSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC) __GLeeGetProcAddress("glSecondaryColor3b"))!=0) nLinked++; + if ((pglSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC) __GLeeGetProcAddress("glSecondaryColor3bv"))!=0) nLinked++; + if ((pglSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC) __GLeeGetProcAddress("glSecondaryColor3d"))!=0) nLinked++; + if ((pglSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC) __GLeeGetProcAddress("glSecondaryColor3dv"))!=0) nLinked++; + if ((pglSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC) __GLeeGetProcAddress("glSecondaryColor3f"))!=0) nLinked++; + if ((pglSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC) __GLeeGetProcAddress("glSecondaryColor3fv"))!=0) nLinked++; + if ((pglSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC) __GLeeGetProcAddress("glSecondaryColor3i"))!=0) nLinked++; + if ((pglSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC) __GLeeGetProcAddress("glSecondaryColor3iv"))!=0) nLinked++; + if ((pglSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC) __GLeeGetProcAddress("glSecondaryColor3s"))!=0) nLinked++; + if ((pglSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC) __GLeeGetProcAddress("glSecondaryColor3sv"))!=0) nLinked++; + if ((pglSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC) __GLeeGetProcAddress("glSecondaryColor3ub"))!=0) nLinked++; + if ((pglSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC) __GLeeGetProcAddress("glSecondaryColor3ubv"))!=0) nLinked++; + if ((pglSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC) __GLeeGetProcAddress("glSecondaryColor3ui"))!=0) nLinked++; + if ((pglSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC) __GLeeGetProcAddress("glSecondaryColor3uiv"))!=0) nLinked++; + if ((pglSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC) __GLeeGetProcAddress("glSecondaryColor3us"))!=0) nLinked++; + if ((pglSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC) __GLeeGetProcAddress("glSecondaryColor3usv"))!=0) nLinked++; + if ((pglSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC) __GLeeGetProcAddress("glSecondaryColorPointer"))!=0) nLinked++; + if ((pglWindowPos2d = (PFNGLWINDOWPOS2DPROC) __GLeeGetProcAddress("glWindowPos2d"))!=0) nLinked++; + if ((pglWindowPos2dv = (PFNGLWINDOWPOS2DVPROC) __GLeeGetProcAddress("glWindowPos2dv"))!=0) nLinked++; + if ((pglWindowPos2f = (PFNGLWINDOWPOS2FPROC) __GLeeGetProcAddress("glWindowPos2f"))!=0) nLinked++; + if ((pglWindowPos2fv = (PFNGLWINDOWPOS2FVPROC) __GLeeGetProcAddress("glWindowPos2fv"))!=0) nLinked++; + if ((pglWindowPos2i = (PFNGLWINDOWPOS2IPROC) __GLeeGetProcAddress("glWindowPos2i"))!=0) nLinked++; + if ((pglWindowPos2iv = (PFNGLWINDOWPOS2IVPROC) __GLeeGetProcAddress("glWindowPos2iv"))!=0) nLinked++; + if ((pglWindowPos2s = (PFNGLWINDOWPOS2SPROC) __GLeeGetProcAddress("glWindowPos2s"))!=0) nLinked++; + if ((pglWindowPos2sv = (PFNGLWINDOWPOS2SVPROC) __GLeeGetProcAddress("glWindowPos2sv"))!=0) nLinked++; + if ((pglWindowPos3d = (PFNGLWINDOWPOS3DPROC) __GLeeGetProcAddress("glWindowPos3d"))!=0) nLinked++; + if ((pglWindowPos3dv = (PFNGLWINDOWPOS3DVPROC) __GLeeGetProcAddress("glWindowPos3dv"))!=0) nLinked++; + if ((pglWindowPos3f = (PFNGLWINDOWPOS3FPROC) __GLeeGetProcAddress("glWindowPos3f"))!=0) nLinked++; + if ((pglWindowPos3fv = (PFNGLWINDOWPOS3FVPROC) __GLeeGetProcAddress("glWindowPos3fv"))!=0) nLinked++; + if ((pglWindowPos3i = (PFNGLWINDOWPOS3IPROC) __GLeeGetProcAddress("glWindowPos3i"))!=0) nLinked++; + if ((pglWindowPos3iv = (PFNGLWINDOWPOS3IVPROC) __GLeeGetProcAddress("glWindowPos3iv"))!=0) nLinked++; + if ((pglWindowPos3s = (PFNGLWINDOWPOS3SPROC) __GLeeGetProcAddress("glWindowPos3s"))!=0) nLinked++; + if ((pglWindowPos3sv = (PFNGLWINDOWPOS3SVPROC) __GLeeGetProcAddress("glWindowPos3sv"))!=0) nLinked++; +#endif + if (nLinked==45) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_VERSION_1_5(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_VERSION_1_5 + if ((pglGenQueries = (PFNGLGENQUERIESPROC) __GLeeGetProcAddress("glGenQueries"))!=0) nLinked++; + if ((pglDeleteQueries = (PFNGLDELETEQUERIESPROC) __GLeeGetProcAddress("glDeleteQueries"))!=0) nLinked++; + if ((pglIsQuery = (PFNGLISQUERYPROC) __GLeeGetProcAddress("glIsQuery"))!=0) nLinked++; + if ((pglBeginQuery = (PFNGLBEGINQUERYPROC) __GLeeGetProcAddress("glBeginQuery"))!=0) nLinked++; + if ((pglEndQuery = (PFNGLENDQUERYPROC) __GLeeGetProcAddress("glEndQuery"))!=0) nLinked++; + if ((pglGetQueryiv = (PFNGLGETQUERYIVPROC) __GLeeGetProcAddress("glGetQueryiv"))!=0) nLinked++; + if ((pglGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC) __GLeeGetProcAddress("glGetQueryObjectiv"))!=0) nLinked++; + if ((pglGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) __GLeeGetProcAddress("glGetQueryObjectuiv"))!=0) nLinked++; + if ((pglBindBuffer = (PFNGLBINDBUFFERPROC) __GLeeGetProcAddress("glBindBuffer"))!=0) nLinked++; + if ((pglDeleteBuffers = (PFNGLDELETEBUFFERSPROC) __GLeeGetProcAddress("glDeleteBuffers"))!=0) nLinked++; + if ((pglGenBuffers = (PFNGLGENBUFFERSPROC) __GLeeGetProcAddress("glGenBuffers"))!=0) nLinked++; + if ((pglIsBuffer = (PFNGLISBUFFERPROC) __GLeeGetProcAddress("glIsBuffer"))!=0) nLinked++; + if ((pglBufferData = (PFNGLBUFFERDATAPROC) __GLeeGetProcAddress("glBufferData"))!=0) nLinked++; + if ((pglBufferSubData = (PFNGLBUFFERSUBDATAPROC) __GLeeGetProcAddress("glBufferSubData"))!=0) nLinked++; + if ((pglGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) __GLeeGetProcAddress("glGetBufferSubData"))!=0) nLinked++; + if ((pglMapBuffer = (PFNGLMAPBUFFERPROC) __GLeeGetProcAddress("glMapBuffer"))!=0) nLinked++; + if ((pglUnmapBuffer = (PFNGLUNMAPBUFFERPROC) __GLeeGetProcAddress("glUnmapBuffer"))!=0) nLinked++; + if ((pglGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) __GLeeGetProcAddress("glGetBufferParameteriv"))!=0) nLinked++; + if ((pglGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) __GLeeGetProcAddress("glGetBufferPointerv"))!=0) nLinked++; +#endif + if (nLinked==19) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_VERSION_2_0(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_VERSION_2_0 + if ((pglBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) __GLeeGetProcAddress("glBlendEquationSeparate"))!=0) nLinked++; + if ((pglDrawBuffers = (PFNGLDRAWBUFFERSPROC) __GLeeGetProcAddress("glDrawBuffers"))!=0) nLinked++; + if ((pglStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) __GLeeGetProcAddress("glStencilOpSeparate"))!=0) nLinked++; + if ((pglStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) __GLeeGetProcAddress("glStencilFuncSeparate"))!=0) nLinked++; + if ((pglStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) __GLeeGetProcAddress("glStencilMaskSeparate"))!=0) nLinked++; + if ((pglAttachShader = (PFNGLATTACHSHADERPROC) __GLeeGetProcAddress("glAttachShader"))!=0) nLinked++; + if ((pglBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) __GLeeGetProcAddress("glBindAttribLocation"))!=0) nLinked++; + if ((pglCompileShader = (PFNGLCOMPILESHADERPROC) __GLeeGetProcAddress("glCompileShader"))!=0) nLinked++; + if ((pglCreateProgram = (PFNGLCREATEPROGRAMPROC) __GLeeGetProcAddress("glCreateProgram"))!=0) nLinked++; + if ((pglCreateShader = (PFNGLCREATESHADERPROC) __GLeeGetProcAddress("glCreateShader"))!=0) nLinked++; + if ((pglDeleteProgram = (PFNGLDELETEPROGRAMPROC) __GLeeGetProcAddress("glDeleteProgram"))!=0) nLinked++; + if ((pglDeleteShader = (PFNGLDELETESHADERPROC) __GLeeGetProcAddress("glDeleteShader"))!=0) nLinked++; + if ((pglDetachShader = (PFNGLDETACHSHADERPROC) __GLeeGetProcAddress("glDetachShader"))!=0) nLinked++; + if ((pglDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) __GLeeGetProcAddress("glDisableVertexAttribArray"))!=0) nLinked++; + if ((pglEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) __GLeeGetProcAddress("glEnableVertexAttribArray"))!=0) nLinked++; + if ((pglGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) __GLeeGetProcAddress("glGetActiveAttrib"))!=0) nLinked++; + if ((pglGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) __GLeeGetProcAddress("glGetActiveUniform"))!=0) nLinked++; + if ((pglGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) __GLeeGetProcAddress("glGetAttachedShaders"))!=0) nLinked++; + if ((pglGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) __GLeeGetProcAddress("glGetAttribLocation"))!=0) nLinked++; + if ((pglGetProgramiv = (PFNGLGETPROGRAMIVPROC) __GLeeGetProcAddress("glGetProgramiv"))!=0) nLinked++; + if ((pglGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) __GLeeGetProcAddress("glGetProgramInfoLog"))!=0) nLinked++; + if ((pglGetShaderiv = (PFNGLGETSHADERIVPROC) __GLeeGetProcAddress("glGetShaderiv"))!=0) nLinked++; + if ((pglGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) __GLeeGetProcAddress("glGetShaderInfoLog"))!=0) nLinked++; + if ((pglGetShaderSource = (PFNGLGETSHADERSOURCEPROC) __GLeeGetProcAddress("glGetShaderSource"))!=0) nLinked++; + if ((pglGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) __GLeeGetProcAddress("glGetUniformLocation"))!=0) nLinked++; + if ((pglGetUniformfv = (PFNGLGETUNIFORMFVPROC) __GLeeGetProcAddress("glGetUniformfv"))!=0) nLinked++; + if ((pglGetUniformiv = (PFNGLGETUNIFORMIVPROC) __GLeeGetProcAddress("glGetUniformiv"))!=0) nLinked++; + if ((pglGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC) __GLeeGetProcAddress("glGetVertexAttribdv"))!=0) nLinked++; + if ((pglGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) __GLeeGetProcAddress("glGetVertexAttribfv"))!=0) nLinked++; + if ((pglGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) __GLeeGetProcAddress("glGetVertexAttribiv"))!=0) nLinked++; + if ((pglGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) __GLeeGetProcAddress("glGetVertexAttribPointerv"))!=0) nLinked++; + if ((pglIsProgram = (PFNGLISPROGRAMPROC) __GLeeGetProcAddress("glIsProgram"))!=0) nLinked++; + if ((pglIsShader = (PFNGLISSHADERPROC) __GLeeGetProcAddress("glIsShader"))!=0) nLinked++; + if ((pglLinkProgram = (PFNGLLINKPROGRAMPROC) __GLeeGetProcAddress("glLinkProgram"))!=0) nLinked++; + if ((pglShaderSource = (PFNGLSHADERSOURCEPROC) __GLeeGetProcAddress("glShaderSource"))!=0) nLinked++; + if ((pglUseProgram = (PFNGLUSEPROGRAMPROC) __GLeeGetProcAddress("glUseProgram"))!=0) nLinked++; + if ((pglUniform1f = (PFNGLUNIFORM1FPROC) __GLeeGetProcAddress("glUniform1f"))!=0) nLinked++; + if ((pglUniform2f = (PFNGLUNIFORM2FPROC) __GLeeGetProcAddress("glUniform2f"))!=0) nLinked++; + if ((pglUniform3f = (PFNGLUNIFORM3FPROC) __GLeeGetProcAddress("glUniform3f"))!=0) nLinked++; + if ((pglUniform4f = (PFNGLUNIFORM4FPROC) __GLeeGetProcAddress("glUniform4f"))!=0) nLinked++; + if ((pglUniform1i = (PFNGLUNIFORM1IPROC) __GLeeGetProcAddress("glUniform1i"))!=0) nLinked++; + if ((pglUniform2i = (PFNGLUNIFORM2IPROC) __GLeeGetProcAddress("glUniform2i"))!=0) nLinked++; + if ((pglUniform3i = (PFNGLUNIFORM3IPROC) __GLeeGetProcAddress("glUniform3i"))!=0) nLinked++; + if ((pglUniform4i = (PFNGLUNIFORM4IPROC) __GLeeGetProcAddress("glUniform4i"))!=0) nLinked++; + if ((pglUniform1fv = (PFNGLUNIFORM1FVPROC) __GLeeGetProcAddress("glUniform1fv"))!=0) nLinked++; + if ((pglUniform2fv = (PFNGLUNIFORM2FVPROC) __GLeeGetProcAddress("glUniform2fv"))!=0) nLinked++; + if ((pglUniform3fv = (PFNGLUNIFORM3FVPROC) __GLeeGetProcAddress("glUniform3fv"))!=0) nLinked++; + if ((pglUniform4fv = (PFNGLUNIFORM4FVPROC) __GLeeGetProcAddress("glUniform4fv"))!=0) nLinked++; + if ((pglUniform1iv = (PFNGLUNIFORM1IVPROC) __GLeeGetProcAddress("glUniform1iv"))!=0) nLinked++; + if ((pglUniform2iv = (PFNGLUNIFORM2IVPROC) __GLeeGetProcAddress("glUniform2iv"))!=0) nLinked++; + if ((pglUniform3iv = (PFNGLUNIFORM3IVPROC) __GLeeGetProcAddress("glUniform3iv"))!=0) nLinked++; + if ((pglUniform4iv = (PFNGLUNIFORM4IVPROC) __GLeeGetProcAddress("glUniform4iv"))!=0) nLinked++; + if ((pglUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) __GLeeGetProcAddress("glUniformMatrix2fv"))!=0) nLinked++; + if ((pglUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) __GLeeGetProcAddress("glUniformMatrix3fv"))!=0) nLinked++; + if ((pglUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) __GLeeGetProcAddress("glUniformMatrix4fv"))!=0) nLinked++; + if ((pglValidateProgram = (PFNGLVALIDATEPROGRAMPROC) __GLeeGetProcAddress("glValidateProgram"))!=0) nLinked++; + if ((pglVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC) __GLeeGetProcAddress("glVertexAttrib1d"))!=0) nLinked++; + if ((pglVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC) __GLeeGetProcAddress("glVertexAttrib1dv"))!=0) nLinked++; + if ((pglVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) __GLeeGetProcAddress("glVertexAttrib1f"))!=0) nLinked++; + if ((pglVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) __GLeeGetProcAddress("glVertexAttrib1fv"))!=0) nLinked++; + if ((pglVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC) __GLeeGetProcAddress("glVertexAttrib1s"))!=0) nLinked++; + if ((pglVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC) __GLeeGetProcAddress("glVertexAttrib1sv"))!=0) nLinked++; + if ((pglVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC) __GLeeGetProcAddress("glVertexAttrib2d"))!=0) nLinked++; + if ((pglVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC) __GLeeGetProcAddress("glVertexAttrib2dv"))!=0) nLinked++; + if ((pglVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) __GLeeGetProcAddress("glVertexAttrib2f"))!=0) nLinked++; + if ((pglVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) __GLeeGetProcAddress("glVertexAttrib2fv"))!=0) nLinked++; + if ((pglVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC) __GLeeGetProcAddress("glVertexAttrib2s"))!=0) nLinked++; + if ((pglVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC) __GLeeGetProcAddress("glVertexAttrib2sv"))!=0) nLinked++; + if ((pglVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC) __GLeeGetProcAddress("glVertexAttrib3d"))!=0) nLinked++; + if ((pglVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC) __GLeeGetProcAddress("glVertexAttrib3dv"))!=0) nLinked++; + if ((pglVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) __GLeeGetProcAddress("glVertexAttrib3f"))!=0) nLinked++; + if ((pglVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) __GLeeGetProcAddress("glVertexAttrib3fv"))!=0) nLinked++; + if ((pglVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC) __GLeeGetProcAddress("glVertexAttrib3s"))!=0) nLinked++; + if ((pglVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC) __GLeeGetProcAddress("glVertexAttrib3sv"))!=0) nLinked++; + if ((pglVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC) __GLeeGetProcAddress("glVertexAttrib4Nbv"))!=0) nLinked++; + if ((pglVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC) __GLeeGetProcAddress("glVertexAttrib4Niv"))!=0) nLinked++; + if ((pglVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC) __GLeeGetProcAddress("glVertexAttrib4Nsv"))!=0) nLinked++; + if ((pglVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC) __GLeeGetProcAddress("glVertexAttrib4Nub"))!=0) nLinked++; + if ((pglVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC) __GLeeGetProcAddress("glVertexAttrib4Nubv"))!=0) nLinked++; + if ((pglVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC) __GLeeGetProcAddress("glVertexAttrib4Nuiv"))!=0) nLinked++; + if ((pglVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC) __GLeeGetProcAddress("glVertexAttrib4Nusv"))!=0) nLinked++; + if ((pglVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC) __GLeeGetProcAddress("glVertexAttrib4bv"))!=0) nLinked++; + if ((pglVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC) __GLeeGetProcAddress("glVertexAttrib4d"))!=0) nLinked++; + if ((pglVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC) __GLeeGetProcAddress("glVertexAttrib4dv"))!=0) nLinked++; + if ((pglVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) __GLeeGetProcAddress("glVertexAttrib4f"))!=0) nLinked++; + if ((pglVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) __GLeeGetProcAddress("glVertexAttrib4fv"))!=0) nLinked++; + if ((pglVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC) __GLeeGetProcAddress("glVertexAttrib4iv"))!=0) nLinked++; + if ((pglVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC) __GLeeGetProcAddress("glVertexAttrib4s"))!=0) nLinked++; + if ((pglVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC) __GLeeGetProcAddress("glVertexAttrib4sv"))!=0) nLinked++; + if ((pglVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC) __GLeeGetProcAddress("glVertexAttrib4ubv"))!=0) nLinked++; + if ((pglVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC) __GLeeGetProcAddress("glVertexAttrib4uiv"))!=0) nLinked++; + if ((pglVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC) __GLeeGetProcAddress("glVertexAttrib4usv"))!=0) nLinked++; + if ((pglVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) __GLeeGetProcAddress("glVertexAttribPointer"))!=0) nLinked++; +#endif + if (nLinked==93) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_VERSION_2_1(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_VERSION_2_1 + if ((pglUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) __GLeeGetProcAddress("glUniformMatrix2x3fv"))!=0) nLinked++; + if ((pglUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) __GLeeGetProcAddress("glUniformMatrix3x2fv"))!=0) nLinked++; + if ((pglUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) __GLeeGetProcAddress("glUniformMatrix2x4fv"))!=0) nLinked++; + if ((pglUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) __GLeeGetProcAddress("glUniformMatrix4x2fv"))!=0) nLinked++; + if ((pglUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) __GLeeGetProcAddress("glUniformMatrix3x4fv"))!=0) nLinked++; + if ((pglUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) __GLeeGetProcAddress("glUniformMatrix4x3fv"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_VERSION_3_0(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_VERSION_3_0 + if ((pglColorMaski = (PFNGLCOLORMASKIPROC) __GLeeGetProcAddress("glColorMaski"))!=0) nLinked++; + if ((pglGetBooleani_v = (PFNGLGETBOOLEANI_VPROC) __GLeeGetProcAddress("glGetBooleani_v"))!=0) nLinked++; + if ((pglGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) __GLeeGetProcAddress("glGetIntegeri_v"))!=0) nLinked++; + if ((pglEnablei = (PFNGLENABLEIPROC) __GLeeGetProcAddress("glEnablei"))!=0) nLinked++; + if ((pglDisablei = (PFNGLDISABLEIPROC) __GLeeGetProcAddress("glDisablei"))!=0) nLinked++; + if ((pglIsEnabledi = (PFNGLISENABLEDIPROC) __GLeeGetProcAddress("glIsEnabledi"))!=0) nLinked++; + if ((pglBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) __GLeeGetProcAddress("glBeginTransformFeedback"))!=0) nLinked++; + if ((pglEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) __GLeeGetProcAddress("glEndTransformFeedback"))!=0) nLinked++; + if ((pglBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) __GLeeGetProcAddress("glBindBufferRange"))!=0) nLinked++; + if ((pglBindBufferBase = (PFNGLBINDBUFFERBASEPROC) __GLeeGetProcAddress("glBindBufferBase"))!=0) nLinked++; + if ((pglTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) __GLeeGetProcAddress("glTransformFeedbackVaryings"))!=0) nLinked++; + if ((pglGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) __GLeeGetProcAddress("glGetTransformFeedbackVarying"))!=0) nLinked++; + if ((pglClampColor = (PFNGLCLAMPCOLORPROC) __GLeeGetProcAddress("glClampColor"))!=0) nLinked++; + if ((pglBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC) __GLeeGetProcAddress("glBeginConditionalRender"))!=0) nLinked++; + if ((pglEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC) __GLeeGetProcAddress("glEndConditionalRender"))!=0) nLinked++; + if ((pglVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC) __GLeeGetProcAddress("glVertexAttribI1i"))!=0) nLinked++; + if ((pglVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC) __GLeeGetProcAddress("glVertexAttribI2i"))!=0) nLinked++; + if ((pglVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC) __GLeeGetProcAddress("glVertexAttribI3i"))!=0) nLinked++; + if ((pglVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) __GLeeGetProcAddress("glVertexAttribI4i"))!=0) nLinked++; + if ((pglVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC) __GLeeGetProcAddress("glVertexAttribI1ui"))!=0) nLinked++; + if ((pglVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC) __GLeeGetProcAddress("glVertexAttribI2ui"))!=0) nLinked++; + if ((pglVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC) __GLeeGetProcAddress("glVertexAttribI3ui"))!=0) nLinked++; + if ((pglVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) __GLeeGetProcAddress("glVertexAttribI4ui"))!=0) nLinked++; + if ((pglVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC) __GLeeGetProcAddress("glVertexAttribI1iv"))!=0) nLinked++; + if ((pglVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC) __GLeeGetProcAddress("glVertexAttribI2iv"))!=0) nLinked++; + if ((pglVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC) __GLeeGetProcAddress("glVertexAttribI3iv"))!=0) nLinked++; + if ((pglVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) __GLeeGetProcAddress("glVertexAttribI4iv"))!=0) nLinked++; + if ((pglVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC) __GLeeGetProcAddress("glVertexAttribI1uiv"))!=0) nLinked++; + if ((pglVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC) __GLeeGetProcAddress("glVertexAttribI2uiv"))!=0) nLinked++; + if ((pglVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC) __GLeeGetProcAddress("glVertexAttribI3uiv"))!=0) nLinked++; + if ((pglVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) __GLeeGetProcAddress("glVertexAttribI4uiv"))!=0) nLinked++; + if ((pglVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC) __GLeeGetProcAddress("glVertexAttribI4bv"))!=0) nLinked++; + if ((pglVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC) __GLeeGetProcAddress("glVertexAttribI4sv"))!=0) nLinked++; + if ((pglVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC) __GLeeGetProcAddress("glVertexAttribI4ubv"))!=0) nLinked++; + if ((pglVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC) __GLeeGetProcAddress("glVertexAttribI4usv"))!=0) nLinked++; + if ((pglVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) __GLeeGetProcAddress("glVertexAttribIPointer"))!=0) nLinked++; + if ((pglGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) __GLeeGetProcAddress("glGetVertexAttribIiv"))!=0) nLinked++; + if ((pglGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) __GLeeGetProcAddress("glGetVertexAttribIuiv"))!=0) nLinked++; + if ((pglGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) __GLeeGetProcAddress("glGetUniformuiv"))!=0) nLinked++; + if ((pglBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC) __GLeeGetProcAddress("glBindFragDataLocation"))!=0) nLinked++; + if ((pglGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) __GLeeGetProcAddress("glGetFragDataLocation"))!=0) nLinked++; + if ((pglUniform1ui = (PFNGLUNIFORM1UIPROC) __GLeeGetProcAddress("glUniform1ui"))!=0) nLinked++; + if ((pglUniform2ui = (PFNGLUNIFORM2UIPROC) __GLeeGetProcAddress("glUniform2ui"))!=0) nLinked++; + if ((pglUniform3ui = (PFNGLUNIFORM3UIPROC) __GLeeGetProcAddress("glUniform3ui"))!=0) nLinked++; + if ((pglUniform4ui = (PFNGLUNIFORM4UIPROC) __GLeeGetProcAddress("glUniform4ui"))!=0) nLinked++; + if ((pglUniform1uiv = (PFNGLUNIFORM1UIVPROC) __GLeeGetProcAddress("glUniform1uiv"))!=0) nLinked++; + if ((pglUniform2uiv = (PFNGLUNIFORM2UIVPROC) __GLeeGetProcAddress("glUniform2uiv"))!=0) nLinked++; + if ((pglUniform3uiv = (PFNGLUNIFORM3UIVPROC) __GLeeGetProcAddress("glUniform3uiv"))!=0) nLinked++; + if ((pglUniform4uiv = (PFNGLUNIFORM4UIVPROC) __GLeeGetProcAddress("glUniform4uiv"))!=0) nLinked++; + if ((pglTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC) __GLeeGetProcAddress("glTexParameterIiv"))!=0) nLinked++; + if ((pglTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC) __GLeeGetProcAddress("glTexParameterIuiv"))!=0) nLinked++; + if ((pglGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC) __GLeeGetProcAddress("glGetTexParameterIiv"))!=0) nLinked++; + if ((pglGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC) __GLeeGetProcAddress("glGetTexParameterIuiv"))!=0) nLinked++; + if ((pglClearBufferiv = (PFNGLCLEARBUFFERIVPROC) __GLeeGetProcAddress("glClearBufferiv"))!=0) nLinked++; + if ((pglClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) __GLeeGetProcAddress("glClearBufferuiv"))!=0) nLinked++; + if ((pglClearBufferfv = (PFNGLCLEARBUFFERFVPROC) __GLeeGetProcAddress("glClearBufferfv"))!=0) nLinked++; + if ((pglClearBufferfi = (PFNGLCLEARBUFFERFIPROC) __GLeeGetProcAddress("glClearBufferfi"))!=0) nLinked++; + if ((pglGetStringi = (PFNGLGETSTRINGIPROC) __GLeeGetProcAddress("glGetStringi"))!=0) nLinked++; +#endif + if (nLinked==58) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_multitexture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_multitexture + if ((pglActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) __GLeeGetProcAddress("glActiveTextureARB"))!=0) nLinked++; + if ((pglClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) __GLeeGetProcAddress("glClientActiveTextureARB"))!=0) nLinked++; + if ((pglMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC) __GLeeGetProcAddress("glMultiTexCoord1dARB"))!=0) nLinked++; + if ((pglMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC) __GLeeGetProcAddress("glMultiTexCoord1dvARB"))!=0) nLinked++; + if ((pglMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC) __GLeeGetProcAddress("glMultiTexCoord1fARB"))!=0) nLinked++; + if ((pglMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC) __GLeeGetProcAddress("glMultiTexCoord1fvARB"))!=0) nLinked++; + if ((pglMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC) __GLeeGetProcAddress("glMultiTexCoord1iARB"))!=0) nLinked++; + if ((pglMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC) __GLeeGetProcAddress("glMultiTexCoord1ivARB"))!=0) nLinked++; + if ((pglMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC) __GLeeGetProcAddress("glMultiTexCoord1sARB"))!=0) nLinked++; + if ((pglMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC) __GLeeGetProcAddress("glMultiTexCoord1svARB"))!=0) nLinked++; + if ((pglMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC) __GLeeGetProcAddress("glMultiTexCoord2dARB"))!=0) nLinked++; + if ((pglMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC) __GLeeGetProcAddress("glMultiTexCoord2dvARB"))!=0) nLinked++; + if ((pglMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) __GLeeGetProcAddress("glMultiTexCoord2fARB"))!=0) nLinked++; + if ((pglMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC) __GLeeGetProcAddress("glMultiTexCoord2fvARB"))!=0) nLinked++; + if ((pglMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC) __GLeeGetProcAddress("glMultiTexCoord2iARB"))!=0) nLinked++; + if ((pglMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC) __GLeeGetProcAddress("glMultiTexCoord2ivARB"))!=0) nLinked++; + if ((pglMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC) __GLeeGetProcAddress("glMultiTexCoord2sARB"))!=0) nLinked++; + if ((pglMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC) __GLeeGetProcAddress("glMultiTexCoord2svARB"))!=0) nLinked++; + if ((pglMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC) __GLeeGetProcAddress("glMultiTexCoord3dARB"))!=0) nLinked++; + if ((pglMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC) __GLeeGetProcAddress("glMultiTexCoord3dvARB"))!=0) nLinked++; + if ((pglMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC) __GLeeGetProcAddress("glMultiTexCoord3fARB"))!=0) nLinked++; + if ((pglMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC) __GLeeGetProcAddress("glMultiTexCoord3fvARB"))!=0) nLinked++; + if ((pglMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC) __GLeeGetProcAddress("glMultiTexCoord3iARB"))!=0) nLinked++; + if ((pglMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC) __GLeeGetProcAddress("glMultiTexCoord3ivARB"))!=0) nLinked++; + if ((pglMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC) __GLeeGetProcAddress("glMultiTexCoord3sARB"))!=0) nLinked++; + if ((pglMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC) __GLeeGetProcAddress("glMultiTexCoord3svARB"))!=0) nLinked++; + if ((pglMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC) __GLeeGetProcAddress("glMultiTexCoord4dARB"))!=0) nLinked++; + if ((pglMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC) __GLeeGetProcAddress("glMultiTexCoord4dvARB"))!=0) nLinked++; + if ((pglMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC) __GLeeGetProcAddress("glMultiTexCoord4fARB"))!=0) nLinked++; + if ((pglMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC) __GLeeGetProcAddress("glMultiTexCoord4fvARB"))!=0) nLinked++; + if ((pglMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC) __GLeeGetProcAddress("glMultiTexCoord4iARB"))!=0) nLinked++; + if ((pglMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC) __GLeeGetProcAddress("glMultiTexCoord4ivARB"))!=0) nLinked++; + if ((pglMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC) __GLeeGetProcAddress("glMultiTexCoord4sARB"))!=0) nLinked++; + if ((pglMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC) __GLeeGetProcAddress("glMultiTexCoord4svARB"))!=0) nLinked++; +#endif + if (nLinked==34) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_transpose_matrix(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_transpose_matrix + if ((pglLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC) __GLeeGetProcAddress("glLoadTransposeMatrixfARB"))!=0) nLinked++; + if ((pglLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC) __GLeeGetProcAddress("glLoadTransposeMatrixdARB"))!=0) nLinked++; + if ((pglMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC) __GLeeGetProcAddress("glMultTransposeMatrixfARB"))!=0) nLinked++; + if ((pglMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC) __GLeeGetProcAddress("glMultTransposeMatrixdARB"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_multisample(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_multisample + if ((pglSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC) __GLeeGetProcAddress("glSampleCoverageARB"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_texture_env_add(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_texture_cube_map(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_texture_compression(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_texture_compression + if ((pglCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) __GLeeGetProcAddress("glCompressedTexImage3DARB"))!=0) nLinked++; + if ((pglCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) __GLeeGetProcAddress("glCompressedTexImage2DARB"))!=0) nLinked++; + if ((pglCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) __GLeeGetProcAddress("glCompressedTexImage1DARB"))!=0) nLinked++; + if ((pglCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) __GLeeGetProcAddress("glCompressedTexSubImage3DARB"))!=0) nLinked++; + if ((pglCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) __GLeeGetProcAddress("glCompressedTexSubImage2DARB"))!=0) nLinked++; + if ((pglCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) __GLeeGetProcAddress("glCompressedTexSubImage1DARB"))!=0) nLinked++; + if ((pglGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) __GLeeGetProcAddress("glGetCompressedTexImageARB"))!=0) nLinked++; +#endif + if (nLinked==7) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_texture_border_clamp(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_point_parameters(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_point_parameters + if ((pglPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC) __GLeeGetProcAddress("glPointParameterfARB"))!=0) nLinked++; + if ((pglPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC) __GLeeGetProcAddress("glPointParameterfvARB"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_vertex_blend(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_vertex_blend + if ((pglWeightbvARB = (PFNGLWEIGHTBVARBPROC) __GLeeGetProcAddress("glWeightbvARB"))!=0) nLinked++; + if ((pglWeightsvARB = (PFNGLWEIGHTSVARBPROC) __GLeeGetProcAddress("glWeightsvARB"))!=0) nLinked++; + if ((pglWeightivARB = (PFNGLWEIGHTIVARBPROC) __GLeeGetProcAddress("glWeightivARB"))!=0) nLinked++; + if ((pglWeightfvARB = (PFNGLWEIGHTFVARBPROC) __GLeeGetProcAddress("glWeightfvARB"))!=0) nLinked++; + if ((pglWeightdvARB = (PFNGLWEIGHTDVARBPROC) __GLeeGetProcAddress("glWeightdvARB"))!=0) nLinked++; + if ((pglWeightubvARB = (PFNGLWEIGHTUBVARBPROC) __GLeeGetProcAddress("glWeightubvARB"))!=0) nLinked++; + if ((pglWeightusvARB = (PFNGLWEIGHTUSVARBPROC) __GLeeGetProcAddress("glWeightusvARB"))!=0) nLinked++; + if ((pglWeightuivARB = (PFNGLWEIGHTUIVARBPROC) __GLeeGetProcAddress("glWeightuivARB"))!=0) nLinked++; + if ((pglWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC) __GLeeGetProcAddress("glWeightPointerARB"))!=0) nLinked++; + if ((pglVertexBlendARB = (PFNGLVERTEXBLENDARBPROC) __GLeeGetProcAddress("glVertexBlendARB"))!=0) nLinked++; +#endif + if (nLinked==10) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_matrix_palette(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_matrix_palette + if ((pglCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC) __GLeeGetProcAddress("glCurrentPaletteMatrixARB"))!=0) nLinked++; + if ((pglMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC) __GLeeGetProcAddress("glMatrixIndexubvARB"))!=0) nLinked++; + if ((pglMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC) __GLeeGetProcAddress("glMatrixIndexusvARB"))!=0) nLinked++; + if ((pglMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC) __GLeeGetProcAddress("glMatrixIndexuivARB"))!=0) nLinked++; + if ((pglMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC) __GLeeGetProcAddress("glMatrixIndexPointerARB"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_texture_env_combine(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_texture_env_crossbar(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_texture_env_dot3(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_texture_mirrored_repeat(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_depth_texture(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_shadow(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_shadow_ambient(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_window_pos(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_window_pos + if ((pglWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC) __GLeeGetProcAddress("glWindowPos2dARB"))!=0) nLinked++; + if ((pglWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC) __GLeeGetProcAddress("glWindowPos2dvARB"))!=0) nLinked++; + if ((pglWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC) __GLeeGetProcAddress("glWindowPos2fARB"))!=0) nLinked++; + if ((pglWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC) __GLeeGetProcAddress("glWindowPos2fvARB"))!=0) nLinked++; + if ((pglWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC) __GLeeGetProcAddress("glWindowPos2iARB"))!=0) nLinked++; + if ((pglWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC) __GLeeGetProcAddress("glWindowPos2ivARB"))!=0) nLinked++; + if ((pglWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC) __GLeeGetProcAddress("glWindowPos2sARB"))!=0) nLinked++; + if ((pglWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC) __GLeeGetProcAddress("glWindowPos2svARB"))!=0) nLinked++; + if ((pglWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC) __GLeeGetProcAddress("glWindowPos3dARB"))!=0) nLinked++; + if ((pglWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC) __GLeeGetProcAddress("glWindowPos3dvARB"))!=0) nLinked++; + if ((pglWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC) __GLeeGetProcAddress("glWindowPos3fARB"))!=0) nLinked++; + if ((pglWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC) __GLeeGetProcAddress("glWindowPos3fvARB"))!=0) nLinked++; + if ((pglWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC) __GLeeGetProcAddress("glWindowPos3iARB"))!=0) nLinked++; + if ((pglWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC) __GLeeGetProcAddress("glWindowPos3ivARB"))!=0) nLinked++; + if ((pglWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC) __GLeeGetProcAddress("glWindowPos3sARB"))!=0) nLinked++; + if ((pglWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC) __GLeeGetProcAddress("glWindowPos3svARB"))!=0) nLinked++; +#endif + if (nLinked==16) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_vertex_program(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_vertex_program + if ((pglVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC) __GLeeGetProcAddress("glVertexAttrib1dARB"))!=0) nLinked++; + if ((pglVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC) __GLeeGetProcAddress("glVertexAttrib1dvARB"))!=0) nLinked++; + if ((pglVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC) __GLeeGetProcAddress("glVertexAttrib1fARB"))!=0) nLinked++; + if ((pglVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC) __GLeeGetProcAddress("glVertexAttrib1fvARB"))!=0) nLinked++; + if ((pglVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC) __GLeeGetProcAddress("glVertexAttrib1sARB"))!=0) nLinked++; + if ((pglVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC) __GLeeGetProcAddress("glVertexAttrib1svARB"))!=0) nLinked++; + if ((pglVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC) __GLeeGetProcAddress("glVertexAttrib2dARB"))!=0) nLinked++; + if ((pglVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC) __GLeeGetProcAddress("glVertexAttrib2dvARB"))!=0) nLinked++; + if ((pglVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC) __GLeeGetProcAddress("glVertexAttrib2fARB"))!=0) nLinked++; + if ((pglVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC) __GLeeGetProcAddress("glVertexAttrib2fvARB"))!=0) nLinked++; + if ((pglVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC) __GLeeGetProcAddress("glVertexAttrib2sARB"))!=0) nLinked++; + if ((pglVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC) __GLeeGetProcAddress("glVertexAttrib2svARB"))!=0) nLinked++; + if ((pglVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC) __GLeeGetProcAddress("glVertexAttrib3dARB"))!=0) nLinked++; + if ((pglVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC) __GLeeGetProcAddress("glVertexAttrib3dvARB"))!=0) nLinked++; + if ((pglVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC) __GLeeGetProcAddress("glVertexAttrib3fARB"))!=0) nLinked++; + if ((pglVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC) __GLeeGetProcAddress("glVertexAttrib3fvARB"))!=0) nLinked++; + if ((pglVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC) __GLeeGetProcAddress("glVertexAttrib3sARB"))!=0) nLinked++; + if ((pglVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC) __GLeeGetProcAddress("glVertexAttrib3svARB"))!=0) nLinked++; + if ((pglVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NbvARB"))!=0) nLinked++; + if ((pglVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NivARB"))!=0) nLinked++; + if ((pglVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NsvARB"))!=0) nLinked++; + if ((pglVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC) __GLeeGetProcAddress("glVertexAttrib4NubARB"))!=0) nLinked++; + if ((pglVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NubvARB"))!=0) nLinked++; + if ((pglVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NuivARB"))!=0) nLinked++; + if ((pglVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC) __GLeeGetProcAddress("glVertexAttrib4NusvARB"))!=0) nLinked++; + if ((pglVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC) __GLeeGetProcAddress("glVertexAttrib4bvARB"))!=0) nLinked++; + if ((pglVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC) __GLeeGetProcAddress("glVertexAttrib4dARB"))!=0) nLinked++; + if ((pglVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC) __GLeeGetProcAddress("glVertexAttrib4dvARB"))!=0) nLinked++; + if ((pglVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC) __GLeeGetProcAddress("glVertexAttrib4fARB"))!=0) nLinked++; + if ((pglVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC) __GLeeGetProcAddress("glVertexAttrib4fvARB"))!=0) nLinked++; + if ((pglVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC) __GLeeGetProcAddress("glVertexAttrib4ivARB"))!=0) nLinked++; + if ((pglVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC) __GLeeGetProcAddress("glVertexAttrib4sARB"))!=0) nLinked++; + if ((pglVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC) __GLeeGetProcAddress("glVertexAttrib4svARB"))!=0) nLinked++; + if ((pglVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC) __GLeeGetProcAddress("glVertexAttrib4ubvARB"))!=0) nLinked++; + if ((pglVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC) __GLeeGetProcAddress("glVertexAttrib4uivARB"))!=0) nLinked++; + if ((pglVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC) __GLeeGetProcAddress("glVertexAttrib4usvARB"))!=0) nLinked++; + if ((pglVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC) __GLeeGetProcAddress("glVertexAttribPointerARB"))!=0) nLinked++; + if ((pglEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC) __GLeeGetProcAddress("glEnableVertexAttribArrayARB"))!=0) nLinked++; + if ((pglDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) __GLeeGetProcAddress("glDisableVertexAttribArrayARB"))!=0) nLinked++; + if ((pglProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) __GLeeGetProcAddress("glProgramStringARB"))!=0) nLinked++; + if ((pglBindProgramARB = (PFNGLBINDPROGRAMARBPROC) __GLeeGetProcAddress("glBindProgramARB"))!=0) nLinked++; + if ((pglDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC) __GLeeGetProcAddress("glDeleteProgramsARB"))!=0) nLinked++; + if ((pglGenProgramsARB = (PFNGLGENPROGRAMSARBPROC) __GLeeGetProcAddress("glGenProgramsARB"))!=0) nLinked++; + if ((pglProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC) __GLeeGetProcAddress("glProgramEnvParameter4dARB"))!=0) nLinked++; + if ((pglProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC) __GLeeGetProcAddress("glProgramEnvParameter4dvARB"))!=0) nLinked++; + if ((pglProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC) __GLeeGetProcAddress("glProgramEnvParameter4fARB"))!=0) nLinked++; + if ((pglProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC) __GLeeGetProcAddress("glProgramEnvParameter4fvARB"))!=0) nLinked++; + if ((pglProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC) __GLeeGetProcAddress("glProgramLocalParameter4dARB"))!=0) nLinked++; + if ((pglProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) __GLeeGetProcAddress("glProgramLocalParameter4dvARB"))!=0) nLinked++; + if ((pglProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC) __GLeeGetProcAddress("glProgramLocalParameter4fARB"))!=0) nLinked++; + if ((pglProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) __GLeeGetProcAddress("glProgramLocalParameter4fvARB"))!=0) nLinked++; + if ((pglGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC) __GLeeGetProcAddress("glGetProgramEnvParameterdvARB"))!=0) nLinked++; + if ((pglGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC) __GLeeGetProcAddress("glGetProgramEnvParameterfvARB"))!=0) nLinked++; + if ((pglGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) __GLeeGetProcAddress("glGetProgramLocalParameterdvARB"))!=0) nLinked++; + if ((pglGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) __GLeeGetProcAddress("glGetProgramLocalParameterfvARB"))!=0) nLinked++; + if ((pglGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC) __GLeeGetProcAddress("glGetProgramivARB"))!=0) nLinked++; + if ((pglGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC) __GLeeGetProcAddress("glGetProgramStringARB"))!=0) nLinked++; + if ((pglGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC) __GLeeGetProcAddress("glGetVertexAttribdvARB"))!=0) nLinked++; + if ((pglGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) __GLeeGetProcAddress("glGetVertexAttribfvARB"))!=0) nLinked++; + if ((pglGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC) __GLeeGetProcAddress("glGetVertexAttribivARB"))!=0) nLinked++; + if ((pglGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC) __GLeeGetProcAddress("glGetVertexAttribPointervARB"))!=0) nLinked++; + if ((pglIsProgramARB = (PFNGLISPROGRAMARBPROC) __GLeeGetProcAddress("glIsProgramARB"))!=0) nLinked++; +#endif + if (nLinked==62) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_fragment_program(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_vertex_buffer_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_vertex_buffer_object + if ((pglBindBufferARB = (PFNGLBINDBUFFERARBPROC) __GLeeGetProcAddress("glBindBufferARB"))!=0) nLinked++; + if ((pglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC) __GLeeGetProcAddress("glDeleteBuffersARB"))!=0) nLinked++; + if ((pglGenBuffersARB = (PFNGLGENBUFFERSARBPROC) __GLeeGetProcAddress("glGenBuffersARB"))!=0) nLinked++; + if ((pglIsBufferARB = (PFNGLISBUFFERARBPROC) __GLeeGetProcAddress("glIsBufferARB"))!=0) nLinked++; + if ((pglBufferDataARB = (PFNGLBUFFERDATAARBPROC) __GLeeGetProcAddress("glBufferDataARB"))!=0) nLinked++; + if ((pglBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC) __GLeeGetProcAddress("glBufferSubDataARB"))!=0) nLinked++; + if ((pglGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC) __GLeeGetProcAddress("glGetBufferSubDataARB"))!=0) nLinked++; + if ((pglMapBufferARB = (PFNGLMAPBUFFERARBPROC) __GLeeGetProcAddress("glMapBufferARB"))!=0) nLinked++; + if ((pglUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC) __GLeeGetProcAddress("glUnmapBufferARB"))!=0) nLinked++; + if ((pglGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC) __GLeeGetProcAddress("glGetBufferParameterivARB"))!=0) nLinked++; + if ((pglGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC) __GLeeGetProcAddress("glGetBufferPointervARB"))!=0) nLinked++; +#endif + if (nLinked==11) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_occlusion_query(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_occlusion_query + if ((pglGenQueriesARB = (PFNGLGENQUERIESARBPROC) __GLeeGetProcAddress("glGenQueriesARB"))!=0) nLinked++; + if ((pglDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC) __GLeeGetProcAddress("glDeleteQueriesARB"))!=0) nLinked++; + if ((pglIsQueryARB = (PFNGLISQUERYARBPROC) __GLeeGetProcAddress("glIsQueryARB"))!=0) nLinked++; + if ((pglBeginQueryARB = (PFNGLBEGINQUERYARBPROC) __GLeeGetProcAddress("glBeginQueryARB"))!=0) nLinked++; + if ((pglEndQueryARB = (PFNGLENDQUERYARBPROC) __GLeeGetProcAddress("glEndQueryARB"))!=0) nLinked++; + if ((pglGetQueryivARB = (PFNGLGETQUERYIVARBPROC) __GLeeGetProcAddress("glGetQueryivARB"))!=0) nLinked++; + if ((pglGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC) __GLeeGetProcAddress("glGetQueryObjectivARB"))!=0) nLinked++; + if ((pglGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC) __GLeeGetProcAddress("glGetQueryObjectuivARB"))!=0) nLinked++; +#endif + if (nLinked==8) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_shader_objects(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_shader_objects + if ((pglDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) __GLeeGetProcAddress("glDeleteObjectARB"))!=0) nLinked++; + if ((pglGetHandleARB = (PFNGLGETHANDLEARBPROC) __GLeeGetProcAddress("glGetHandleARB"))!=0) nLinked++; + if ((pglDetachObjectARB = (PFNGLDETACHOBJECTARBPROC) __GLeeGetProcAddress("glDetachObjectARB"))!=0) nLinked++; + if ((pglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) __GLeeGetProcAddress("glCreateShaderObjectARB"))!=0) nLinked++; + if ((pglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) __GLeeGetProcAddress("glShaderSourceARB"))!=0) nLinked++; + if ((pglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) __GLeeGetProcAddress("glCompileShaderARB"))!=0) nLinked++; + if ((pglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) __GLeeGetProcAddress("glCreateProgramObjectARB"))!=0) nLinked++; + if ((pglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) __GLeeGetProcAddress("glAttachObjectARB"))!=0) nLinked++; + if ((pglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) __GLeeGetProcAddress("glLinkProgramARB"))!=0) nLinked++; + if ((pglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) __GLeeGetProcAddress("glUseProgramObjectARB"))!=0) nLinked++; + if ((pglValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC) __GLeeGetProcAddress("glValidateProgramARB"))!=0) nLinked++; + if ((pglUniform1fARB = (PFNGLUNIFORM1FARBPROC) __GLeeGetProcAddress("glUniform1fARB"))!=0) nLinked++; + if ((pglUniform2fARB = (PFNGLUNIFORM2FARBPROC) __GLeeGetProcAddress("glUniform2fARB"))!=0) nLinked++; + if ((pglUniform3fARB = (PFNGLUNIFORM3FARBPROC) __GLeeGetProcAddress("glUniform3fARB"))!=0) nLinked++; + if ((pglUniform4fARB = (PFNGLUNIFORM4FARBPROC) __GLeeGetProcAddress("glUniform4fARB"))!=0) nLinked++; + if ((pglUniform1iARB = (PFNGLUNIFORM1IARBPROC) __GLeeGetProcAddress("glUniform1iARB"))!=0) nLinked++; + if ((pglUniform2iARB = (PFNGLUNIFORM2IARBPROC) __GLeeGetProcAddress("glUniform2iARB"))!=0) nLinked++; + if ((pglUniform3iARB = (PFNGLUNIFORM3IARBPROC) __GLeeGetProcAddress("glUniform3iARB"))!=0) nLinked++; + if ((pglUniform4iARB = (PFNGLUNIFORM4IARBPROC) __GLeeGetProcAddress("glUniform4iARB"))!=0) nLinked++; + if ((pglUniform1fvARB = (PFNGLUNIFORM1FVARBPROC) __GLeeGetProcAddress("glUniform1fvARB"))!=0) nLinked++; + if ((pglUniform2fvARB = (PFNGLUNIFORM2FVARBPROC) __GLeeGetProcAddress("glUniform2fvARB"))!=0) nLinked++; + if ((pglUniform3fvARB = (PFNGLUNIFORM3FVARBPROC) __GLeeGetProcAddress("glUniform3fvARB"))!=0) nLinked++; + if ((pglUniform4fvARB = (PFNGLUNIFORM4FVARBPROC) __GLeeGetProcAddress("glUniform4fvARB"))!=0) nLinked++; + if ((pglUniform1ivARB = (PFNGLUNIFORM1IVARBPROC) __GLeeGetProcAddress("glUniform1ivARB"))!=0) nLinked++; + if ((pglUniform2ivARB = (PFNGLUNIFORM2IVARBPROC) __GLeeGetProcAddress("glUniform2ivARB"))!=0) nLinked++; + if ((pglUniform3ivARB = (PFNGLUNIFORM3IVARBPROC) __GLeeGetProcAddress("glUniform3ivARB"))!=0) nLinked++; + if ((pglUniform4ivARB = (PFNGLUNIFORM4IVARBPROC) __GLeeGetProcAddress("glUniform4ivARB"))!=0) nLinked++; + if ((pglUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC) __GLeeGetProcAddress("glUniformMatrix2fvARB"))!=0) nLinked++; + if ((pglUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC) __GLeeGetProcAddress("glUniformMatrix3fvARB"))!=0) nLinked++; + if ((pglUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC) __GLeeGetProcAddress("glUniformMatrix4fvARB"))!=0) nLinked++; + if ((pglGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC) __GLeeGetProcAddress("glGetObjectParameterfvARB"))!=0) nLinked++; + if ((pglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) __GLeeGetProcAddress("glGetObjectParameterivARB"))!=0) nLinked++; + if ((pglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) __GLeeGetProcAddress("glGetInfoLogARB"))!=0) nLinked++; + if ((pglGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC) __GLeeGetProcAddress("glGetAttachedObjectsARB"))!=0) nLinked++; + if ((pglGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) __GLeeGetProcAddress("glGetUniformLocationARB"))!=0) nLinked++; + if ((pglGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC) __GLeeGetProcAddress("glGetActiveUniformARB"))!=0) nLinked++; + if ((pglGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC) __GLeeGetProcAddress("glGetUniformfvARB"))!=0) nLinked++; + if ((pglGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC) __GLeeGetProcAddress("glGetUniformivARB"))!=0) nLinked++; + if ((pglGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC) __GLeeGetProcAddress("glGetShaderSourceARB"))!=0) nLinked++; +#endif + if (nLinked==39) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_vertex_shader(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_vertex_shader + if ((pglBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC) __GLeeGetProcAddress("glBindAttribLocationARB"))!=0) nLinked++; + if ((pglGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC) __GLeeGetProcAddress("glGetActiveAttribARB"))!=0) nLinked++; + if ((pglGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC) __GLeeGetProcAddress("glGetAttribLocationARB"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_fragment_shader(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_shading_language_100(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_texture_non_power_of_two(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_point_sprite(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_fragment_program_shadow(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_draw_buffers(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_draw_buffers + if ((pglDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC) __GLeeGetProcAddress("glDrawBuffersARB"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_texture_rectangle(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_color_buffer_float(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_color_buffer_float + if ((pglClampColorARB = (PFNGLCLAMPCOLORARBPROC) __GLeeGetProcAddress("glClampColorARB"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_half_float_pixel(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_texture_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_pixel_buffer_object(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_depth_buffer_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_drawinstanced(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_drawinstanced + if ((pglDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC) __GLeeGetProcAddress("glDrawArraysInstancedARB"))!=0) nLinked++; + if ((pglDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC) __GLeeGetProcAddress("glDrawElementsInstancedARB"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_framebuffer_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_framebuffer_object + if ((pglIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) __GLeeGetProcAddress("glIsRenderbuffer"))!=0) nLinked++; + if ((pglBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) __GLeeGetProcAddress("glBindRenderbuffer"))!=0) nLinked++; + if ((pglDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) __GLeeGetProcAddress("glDeleteRenderbuffers"))!=0) nLinked++; + if ((pglGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) __GLeeGetProcAddress("glGenRenderbuffers"))!=0) nLinked++; + if ((pglRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) __GLeeGetProcAddress("glRenderbufferStorage"))!=0) nLinked++; + if ((pglGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) __GLeeGetProcAddress("glGetRenderbufferParameteriv"))!=0) nLinked++; + if ((pglIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) __GLeeGetProcAddress("glIsFramebuffer"))!=0) nLinked++; + if ((pglBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) __GLeeGetProcAddress("glBindFramebuffer"))!=0) nLinked++; + if ((pglDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) __GLeeGetProcAddress("glDeleteFramebuffers"))!=0) nLinked++; + if ((pglGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) __GLeeGetProcAddress("glGenFramebuffers"))!=0) nLinked++; + if ((pglCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) __GLeeGetProcAddress("glCheckFramebufferStatus"))!=0) nLinked++; + if ((pglFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) __GLeeGetProcAddress("glFramebufferTexture1D"))!=0) nLinked++; + if ((pglFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) __GLeeGetProcAddress("glFramebufferTexture2D"))!=0) nLinked++; + if ((pglFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) __GLeeGetProcAddress("glFramebufferTexture3D"))!=0) nLinked++; + if ((pglFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) __GLeeGetProcAddress("glFramebufferRenderbuffer"))!=0) nLinked++; + if ((pglGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) __GLeeGetProcAddress("glGetFramebufferAttachmentParameteriv"))!=0) nLinked++; + if ((pglGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) __GLeeGetProcAddress("glGenerateMipmap"))!=0) nLinked++; + if ((pglBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) __GLeeGetProcAddress("glBlitFramebuffer"))!=0) nLinked++; + if ((pglRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) __GLeeGetProcAddress("glRenderbufferStorageMultisample"))!=0) nLinked++; + if ((pglFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) __GLeeGetProcAddress("glFramebufferTextureLayer"))!=0) nLinked++; +#endif + if (nLinked==20) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_framebuffer_sRGB(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_geometry_shader4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_geometry_shader4 + if ((pglProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC) __GLeeGetProcAddress("glProgramParameteriARB"))!=0) nLinked++; + if ((pglFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC) __GLeeGetProcAddress("glFramebufferTextureARB"))!=0) nLinked++; + if ((pglFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) __GLeeGetProcAddress("glFramebufferTextureLayerARB"))!=0) nLinked++; + if ((pglFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) __GLeeGetProcAddress("glFramebufferTextureFaceARB"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_half_float_vertex(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARBinstanced_arrays(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARBinstanced_arrays + if ((pglVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) __GLeeGetProcAddress("glVertexAttribDivisor"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_map_buffer_range(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_map_buffer_range + if ((pglMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) __GLeeGetProcAddress("glMapBufferRange"))!=0) nLinked++; + if ((pglFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) __GLeeGetProcAddress("glFlushMappedBufferRange"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_texture_buffer_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_texture_buffer_object + if ((pglTexBufferARB = (PFNGLTEXBUFFERARBPROC) __GLeeGetProcAddress("glTexBufferARB"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ARB_texture_compression_rgtc(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_texture_rg(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ARB_vertex_array_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ARB_vertex_array_object + if ((pglBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) __GLeeGetProcAddress("glBindVertexArray"))!=0) nLinked++; + if ((pglDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) __GLeeGetProcAddress("glDeleteVertexArrays"))!=0) nLinked++; + if ((pglGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) __GLeeGetProcAddress("glGenVertexArrays"))!=0) nLinked++; + if ((pglIsVertexArray = (PFNGLISVERTEXARRAYPROC) __GLeeGetProcAddress("glIsVertexArray"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_abgr(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_blend_color(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_blend_color + if ((pglBlendColorEXT = (PFNGLBLENDCOLOREXTPROC) __GLeeGetProcAddress("glBlendColorEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_polygon_offset(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_polygon_offset + if ((pglPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC) __GLeeGetProcAddress("glPolygonOffsetEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture3D(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_texture3D + if ((pglTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC) __GLeeGetProcAddress("glTexImage3DEXT"))!=0) nLinked++; + if ((pglTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glTexSubImage3DEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIS_texture_filter4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_texture_filter4 + if ((pglGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC) __GLeeGetProcAddress("glGetTexFilterFuncSGIS"))!=0) nLinked++; + if ((pglTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC) __GLeeGetProcAddress("glTexFilterFuncSGIS"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_subtexture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_subtexture + if ((pglTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glTexSubImage1DEXT"))!=0) nLinked++; + if ((pglTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glTexSubImage2DEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_copy_texture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_copy_texture + if ((pglCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyTexImage1DEXT"))!=0) nLinked++; + if ((pglCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyTexImage2DEXT"))!=0) nLinked++; + if ((pglCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyTexSubImage1DEXT"))!=0) nLinked++; + if ((pglCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyTexSubImage2DEXT"))!=0) nLinked++; + if ((pglCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCopyTexSubImage3DEXT"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_histogram(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_histogram + if ((pglGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC) __GLeeGetProcAddress("glGetHistogramEXT"))!=0) nLinked++; + if ((pglGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetHistogramParameterfvEXT"))!=0) nLinked++; + if ((pglGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetHistogramParameterivEXT"))!=0) nLinked++; + if ((pglGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC) __GLeeGetProcAddress("glGetMinmaxEXT"))!=0) nLinked++; + if ((pglGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetMinmaxParameterfvEXT"))!=0) nLinked++; + if ((pglGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetMinmaxParameterivEXT"))!=0) nLinked++; + if ((pglHistogramEXT = (PFNGLHISTOGRAMEXTPROC) __GLeeGetProcAddress("glHistogramEXT"))!=0) nLinked++; + if ((pglMinmaxEXT = (PFNGLMINMAXEXTPROC) __GLeeGetProcAddress("glMinmaxEXT"))!=0) nLinked++; + if ((pglResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC) __GLeeGetProcAddress("glResetHistogramEXT"))!=0) nLinked++; + if ((pglResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC) __GLeeGetProcAddress("glResetMinmaxEXT"))!=0) nLinked++; +#endif + if (nLinked==10) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_convolution(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_convolution + if ((pglConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC) __GLeeGetProcAddress("glConvolutionFilter1DEXT"))!=0) nLinked++; + if ((pglConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC) __GLeeGetProcAddress("glConvolutionFilter2DEXT"))!=0) nLinked++; + if ((pglConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC) __GLeeGetProcAddress("glConvolutionParameterfEXT"))!=0) nLinked++; + if ((pglConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC) __GLeeGetProcAddress("glConvolutionParameterfvEXT"))!=0) nLinked++; + if ((pglConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC) __GLeeGetProcAddress("glConvolutionParameteriEXT"))!=0) nLinked++; + if ((pglConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC) __GLeeGetProcAddress("glConvolutionParameterivEXT"))!=0) nLinked++; + if ((pglCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) __GLeeGetProcAddress("glCopyConvolutionFilter1DEXT"))!=0) nLinked++; + if ((pglCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) __GLeeGetProcAddress("glCopyConvolutionFilter2DEXT"))!=0) nLinked++; + if ((pglGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC) __GLeeGetProcAddress("glGetConvolutionFilterEXT"))!=0) nLinked++; + if ((pglGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetConvolutionParameterfvEXT"))!=0) nLinked++; + if ((pglGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetConvolutionParameterivEXT"))!=0) nLinked++; + if ((pglGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC) __GLeeGetProcAddress("glGetSeparableFilterEXT"))!=0) nLinked++; + if ((pglSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC) __GLeeGetProcAddress("glSeparableFilter2DEXT"))!=0) nLinked++; +#endif + if (nLinked==13) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGI_color_matrix(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGI_color_table(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGI_color_table + if ((pglColorTableSGI = (PFNGLCOLORTABLESGIPROC) __GLeeGetProcAddress("glColorTableSGI"))!=0) nLinked++; + if ((pglColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC) __GLeeGetProcAddress("glColorTableParameterfvSGI"))!=0) nLinked++; + if ((pglColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC) __GLeeGetProcAddress("glColorTableParameterivSGI"))!=0) nLinked++; + if ((pglCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC) __GLeeGetProcAddress("glCopyColorTableSGI"))!=0) nLinked++; + if ((pglGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC) __GLeeGetProcAddress("glGetColorTableSGI"))!=0) nLinked++; + if ((pglGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) __GLeeGetProcAddress("glGetColorTableParameterfvSGI"))!=0) nLinked++; + if ((pglGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) __GLeeGetProcAddress("glGetColorTableParameterivSGI"))!=0) nLinked++; +#endif + if (nLinked==7) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIS_pixel_texture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_pixel_texture + if ((pglPixelTexGenParameteriSGIS = (PFNGLPIXELTEXGENPARAMETERISGISPROC) __GLeeGetProcAddress("glPixelTexGenParameteriSGIS"))!=0) nLinked++; + if ((pglPixelTexGenParameterivSGIS = (PFNGLPIXELTEXGENPARAMETERIVSGISPROC) __GLeeGetProcAddress("glPixelTexGenParameterivSGIS"))!=0) nLinked++; + if ((pglPixelTexGenParameterfSGIS = (PFNGLPIXELTEXGENPARAMETERFSGISPROC) __GLeeGetProcAddress("glPixelTexGenParameterfSGIS"))!=0) nLinked++; + if ((pglPixelTexGenParameterfvSGIS = (PFNGLPIXELTEXGENPARAMETERFVSGISPROC) __GLeeGetProcAddress("glPixelTexGenParameterfvSGIS"))!=0) nLinked++; + if ((pglGetPixelTexGenParameterivSGIS = (PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) __GLeeGetProcAddress("glGetPixelTexGenParameterivSGIS"))!=0) nLinked++; + if ((pglGetPixelTexGenParameterfvSGIS = (PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) __GLeeGetProcAddress("glGetPixelTexGenParameterfvSGIS"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_pixel_texture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_pixel_texture + if ((pglPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC) __GLeeGetProcAddress("glPixelTexGenSGIX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIS_texture4D(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_texture4D + if ((pglTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC) __GLeeGetProcAddress("glTexImage4DSGIS"))!=0) nLinked++; + if ((pglTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC) __GLeeGetProcAddress("glTexSubImage4DSGIS"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGI_texture_color_table(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_cmyka(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_texture_object + if ((pglAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC) __GLeeGetProcAddress("glAreTexturesResidentEXT"))!=0) nLinked++; + if ((pglBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC) __GLeeGetProcAddress("glBindTextureEXT"))!=0) nLinked++; + if ((pglDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC) __GLeeGetProcAddress("glDeleteTexturesEXT"))!=0) nLinked++; + if ((pglGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC) __GLeeGetProcAddress("glGenTexturesEXT"))!=0) nLinked++; + if ((pglIsTextureEXT = (PFNGLISTEXTUREEXTPROC) __GLeeGetProcAddress("glIsTextureEXT"))!=0) nLinked++; + if ((pglPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC) __GLeeGetProcAddress("glPrioritizeTexturesEXT"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIS_detail_texture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_detail_texture + if ((pglDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC) __GLeeGetProcAddress("glDetailTexFuncSGIS"))!=0) nLinked++; + if ((pglGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC) __GLeeGetProcAddress("glGetDetailTexFuncSGIS"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIS_sharpen_texture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_sharpen_texture + if ((pglSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC) __GLeeGetProcAddress("glSharpenTexFuncSGIS"))!=0) nLinked++; + if ((pglGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC) __GLeeGetProcAddress("glGetSharpenTexFuncSGIS"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_packed_pixels(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_texture_lod(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_multisample(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_multisample + if ((pglSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC) __GLeeGetProcAddress("glSampleMaskSGIS"))!=0) nLinked++; + if ((pglSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC) __GLeeGetProcAddress("glSamplePatternSGIS"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_rescale_normal(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_vertex_array(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_vertex_array + if ((pglArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC) __GLeeGetProcAddress("glArrayElementEXT"))!=0) nLinked++; + if ((pglColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC) __GLeeGetProcAddress("glColorPointerEXT"))!=0) nLinked++; + if ((pglDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC) __GLeeGetProcAddress("glDrawArraysEXT"))!=0) nLinked++; + if ((pglEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC) __GLeeGetProcAddress("glEdgeFlagPointerEXT"))!=0) nLinked++; + if ((pglGetPointervEXT = (PFNGLGETPOINTERVEXTPROC) __GLeeGetProcAddress("glGetPointervEXT"))!=0) nLinked++; + if ((pglIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC) __GLeeGetProcAddress("glIndexPointerEXT"))!=0) nLinked++; + if ((pglNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC) __GLeeGetProcAddress("glNormalPointerEXT"))!=0) nLinked++; + if ((pglTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC) __GLeeGetProcAddress("glTexCoordPointerEXT"))!=0) nLinked++; + if ((pglVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC) __GLeeGetProcAddress("glVertexPointerEXT"))!=0) nLinked++; +#endif + if (nLinked==9) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_misc_attribute(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_generate_mipmap(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_clipmap(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_shadow(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_texture_edge_clamp(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_texture_border_clamp(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_blend_minmax(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_blend_minmax + if ((pglBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC) __GLeeGetProcAddress("glBlendEquationEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_blend_subtract(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_blend_logic_op(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_interlace(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_pixel_tiles(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_texture_select(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_sprite(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_sprite + if ((pglSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC) __GLeeGetProcAddress("glSpriteParameterfSGIX"))!=0) nLinked++; + if ((pglSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC) __GLeeGetProcAddress("glSpriteParameterfvSGIX"))!=0) nLinked++; + if ((pglSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC) __GLeeGetProcAddress("glSpriteParameteriSGIX"))!=0) nLinked++; + if ((pglSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC) __GLeeGetProcAddress("glSpriteParameterivSGIX"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_texture_multi_buffer(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_point_parameters(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_point_parameters + if ((pglPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC) __GLeeGetProcAddress("glPointParameterfEXT"))!=0) nLinked++; + if ((pglPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC) __GLeeGetProcAddress("glPointParameterfvEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIS_point_parameters(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_point_parameters + if ((pglPointParameterfSGIS = (PFNGLPOINTPARAMETERFSGISPROC) __GLeeGetProcAddress("glPointParameterfSGIS"))!=0) nLinked++; + if ((pglPointParameterfvSGIS = (PFNGLPOINTPARAMETERFVSGISPROC) __GLeeGetProcAddress("glPointParameterfvSGIS"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_instruments(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_instruments + if ((pglGetInstrumentsSGIX = (PFNGLGETINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glGetInstrumentsSGIX"))!=0) nLinked++; + if ((pglInstrumentsBufferSGIX = (PFNGLINSTRUMENTSBUFFERSGIXPROC) __GLeeGetProcAddress("glInstrumentsBufferSGIX"))!=0) nLinked++; + if ((pglPollInstrumentsSGIX = (PFNGLPOLLINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glPollInstrumentsSGIX"))!=0) nLinked++; + if ((pglReadInstrumentsSGIX = (PFNGLREADINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glReadInstrumentsSGIX"))!=0) nLinked++; + if ((pglStartInstrumentsSGIX = (PFNGLSTARTINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glStartInstrumentsSGIX"))!=0) nLinked++; + if ((pglStopInstrumentsSGIX = (PFNGLSTOPINSTRUMENTSSGIXPROC) __GLeeGetProcAddress("glStopInstrumentsSGIX"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_texture_scale_bias(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_framezoom(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_framezoom + if ((pglFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC) __GLeeGetProcAddress("glFrameZoomSGIX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_tag_sample_buffer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_tag_sample_buffer + if ((pglTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC) __GLeeGetProcAddress("glTagSampleBufferSGIX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_FfdMaskSGIX(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_polynomial_ffd(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_polynomial_ffd + if ((pglDeformationMap3dSGIX = (PFNGLDEFORMATIONMAP3DSGIXPROC) __GLeeGetProcAddress("glDeformationMap3dSGIX"))!=0) nLinked++; + if ((pglDeformationMap3fSGIX = (PFNGLDEFORMATIONMAP3FSGIXPROC) __GLeeGetProcAddress("glDeformationMap3fSGIX"))!=0) nLinked++; + if ((pglDeformSGIX = (PFNGLDEFORMSGIXPROC) __GLeeGetProcAddress("glDeformSGIX"))!=0) nLinked++; + if ((pglLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) __GLeeGetProcAddress("glLoadIdentityDeformationMapSGIX"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_reference_plane(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_reference_plane + if ((pglReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC) __GLeeGetProcAddress("glReferencePlaneSGIX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_flush_raster(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_flush_raster + if ((pglFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC) __GLeeGetProcAddress("glFlushRasterSGIX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_depth_texture(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_fog_function(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_fog_function + if ((pglFogFuncSGIS = (PFNGLFOGFUNCSGISPROC) __GLeeGetProcAddress("glFogFuncSGIS"))!=0) nLinked++; + if ((pglGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC) __GLeeGetProcAddress("glGetFogFuncSGIS"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_fog_offset(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_HP_image_transform(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_HP_image_transform + if ((pglImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC) __GLeeGetProcAddress("glImageTransformParameteriHP"))!=0) nLinked++; + if ((pglImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC) __GLeeGetProcAddress("glImageTransformParameterfHP"))!=0) nLinked++; + if ((pglImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) __GLeeGetProcAddress("glImageTransformParameterivHP"))!=0) nLinked++; + if ((pglImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) __GLeeGetProcAddress("glImageTransformParameterfvHP"))!=0) nLinked++; + if ((pglGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) __GLeeGetProcAddress("glGetImageTransformParameterivHP"))!=0) nLinked++; + if ((pglGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) __GLeeGetProcAddress("glGetImageTransformParameterfvHP"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_HP_convolution_border_modes(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_INGR_palette_buffer(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_texture_add_env(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_color_subtable(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_color_subtable + if ((pglColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC) __GLeeGetProcAddress("glColorSubTableEXT"))!=0) nLinked++; + if ((pglCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC) __GLeeGetProcAddress("glCopyColorSubTableEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_PGI_vertex_hints(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_PGI_misc_hints(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_PGI_misc_hints + if ((pglHintPGI = (PFNGLHINTPGIPROC) __GLeeGetProcAddress("glHintPGI"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_paletted_texture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_paletted_texture + if ((pglColorTableEXT = (PFNGLCOLORTABLEEXTPROC) __GLeeGetProcAddress("glColorTableEXT"))!=0) nLinked++; + if ((pglGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC) __GLeeGetProcAddress("glGetColorTableEXT"))!=0) nLinked++; + if ((pglGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetColorTableParameterivEXT"))!=0) nLinked++; + if ((pglGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetColorTableParameterfvEXT"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_clip_volume_hint(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_list_priority(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_list_priority + if ((pglGetListParameterfvSGIX = (PFNGLGETLISTPARAMETERFVSGIXPROC) __GLeeGetProcAddress("glGetListParameterfvSGIX"))!=0) nLinked++; + if ((pglGetListParameterivSGIX = (PFNGLGETLISTPARAMETERIVSGIXPROC) __GLeeGetProcAddress("glGetListParameterivSGIX"))!=0) nLinked++; + if ((pglListParameterfSGIX = (PFNGLLISTPARAMETERFSGIXPROC) __GLeeGetProcAddress("glListParameterfSGIX"))!=0) nLinked++; + if ((pglListParameterfvSGIX = (PFNGLLISTPARAMETERFVSGIXPROC) __GLeeGetProcAddress("glListParameterfvSGIX"))!=0) nLinked++; + if ((pglListParameteriSGIX = (PFNGLLISTPARAMETERISGIXPROC) __GLeeGetProcAddress("glListParameteriSGIX"))!=0) nLinked++; + if ((pglListParameterivSGIX = (PFNGLLISTPARAMETERIVSGIXPROC) __GLeeGetProcAddress("glListParameterivSGIX"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_ir_instrument1(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_calligraphic_fragment(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_texture_lod_bias(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_shadow_ambient(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_index_texture(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_index_material(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_index_material + if ((pglIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC) __GLeeGetProcAddress("glIndexMaterialEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_index_func(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_index_func + if ((pglIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC) __GLeeGetProcAddress("glIndexFuncEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_index_array_formats(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_compiled_vertex_array(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_compiled_vertex_array + if ((pglLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC) __GLeeGetProcAddress("glLockArraysEXT"))!=0) nLinked++; + if ((pglUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC) __GLeeGetProcAddress("glUnlockArraysEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_cull_vertex(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_cull_vertex + if ((pglCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC) __GLeeGetProcAddress("glCullParameterdvEXT"))!=0) nLinked++; + if ((pglCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC) __GLeeGetProcAddress("glCullParameterfvEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_ycrcb(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_fragment_lighting(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_fragment_lighting + if ((pglFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC) __GLeeGetProcAddress("glFragmentColorMaterialSGIX"))!=0) nLinked++; + if ((pglFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC) __GLeeGetProcAddress("glFragmentLightfSGIX"))!=0) nLinked++; + if ((pglFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC) __GLeeGetProcAddress("glFragmentLightfvSGIX"))!=0) nLinked++; + if ((pglFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC) __GLeeGetProcAddress("glFragmentLightiSGIX"))!=0) nLinked++; + if ((pglFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC) __GLeeGetProcAddress("glFragmentLightivSGIX"))!=0) nLinked++; + if ((pglFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC) __GLeeGetProcAddress("glFragmentLightModelfSGIX"))!=0) nLinked++; + if ((pglFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) __GLeeGetProcAddress("glFragmentLightModelfvSGIX"))!=0) nLinked++; + if ((pglFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC) __GLeeGetProcAddress("glFragmentLightModeliSGIX"))!=0) nLinked++; + if ((pglFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) __GLeeGetProcAddress("glFragmentLightModelivSGIX"))!=0) nLinked++; + if ((pglFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC) __GLeeGetProcAddress("glFragmentMaterialfSGIX"))!=0) nLinked++; + if ((pglFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC) __GLeeGetProcAddress("glFragmentMaterialfvSGIX"))!=0) nLinked++; + if ((pglFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC) __GLeeGetProcAddress("glFragmentMaterialiSGIX"))!=0) nLinked++; + if ((pglFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC) __GLeeGetProcAddress("glFragmentMaterialivSGIX"))!=0) nLinked++; + if ((pglGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC) __GLeeGetProcAddress("glGetFragmentLightfvSGIX"))!=0) nLinked++; + if ((pglGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC) __GLeeGetProcAddress("glGetFragmentLightivSGIX"))!=0) nLinked++; + if ((pglGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC) __GLeeGetProcAddress("glGetFragmentMaterialfvSGIX"))!=0) nLinked++; + if ((pglGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC) __GLeeGetProcAddress("glGetFragmentMaterialivSGIX"))!=0) nLinked++; + if ((pglLightEnviSGIX = (PFNGLLIGHTENVISGIXPROC) __GLeeGetProcAddress("glLightEnviSGIX"))!=0) nLinked++; +#endif + if (nLinked==18) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_IBM_rasterpos_clip(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_HP_texture_lighting(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_draw_range_elements(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_draw_range_elements + if ((pglDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC) __GLeeGetProcAddress("glDrawRangeElementsEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_WIN_phong_shading(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_WIN_specular_fog(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_light_texture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_light_texture + if ((pglApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC) __GLeeGetProcAddress("glApplyTextureEXT"))!=0) nLinked++; + if ((pglTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC) __GLeeGetProcAddress("glTextureLightEXT"))!=0) nLinked++; + if ((pglTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC) __GLeeGetProcAddress("glTextureMaterialEXT"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_blend_alpha_minmax(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_impact_pixel_texture(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_bgra(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_async(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_async + if ((pglAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC) __GLeeGetProcAddress("glAsyncMarkerSGIX"))!=0) nLinked++; + if ((pglFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC) __GLeeGetProcAddress("glFinishAsyncSGIX"))!=0) nLinked++; + if ((pglPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC) __GLeeGetProcAddress("glPollAsyncSGIX"))!=0) nLinked++; + if ((pglGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC) __GLeeGetProcAddress("glGenAsyncMarkersSGIX"))!=0) nLinked++; + if ((pglDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC) __GLeeGetProcAddress("glDeleteAsyncMarkersSGIX"))!=0) nLinked++; + if ((pglIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC) __GLeeGetProcAddress("glIsAsyncMarkerSGIX"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_async_pixel(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_async_histogram(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_INTEL_texture_scissor(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_INTEL_parallel_arrays(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_INTEL_parallel_arrays + if ((pglVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC) __GLeeGetProcAddress("glVertexPointervINTEL"))!=0) nLinked++; + if ((pglNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC) __GLeeGetProcAddress("glNormalPointervINTEL"))!=0) nLinked++; + if ((pglColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC) __GLeeGetProcAddress("glColorPointervINTEL"))!=0) nLinked++; + if ((pglTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC) __GLeeGetProcAddress("glTexCoordPointervINTEL"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_HP_occlusion_test(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_pixel_transform(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_pixel_transform + if ((pglPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) __GLeeGetProcAddress("glPixelTransformParameteriEXT"))!=0) nLinked++; + if ((pglPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) __GLeeGetProcAddress("glPixelTransformParameterfEXT"))!=0) nLinked++; + if ((pglPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) __GLeeGetProcAddress("glPixelTransformParameterivEXT"))!=0) nLinked++; + if ((pglPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) __GLeeGetProcAddress("glPixelTransformParameterfvEXT"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_pixel_transform_color_table(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_shared_texture_palette(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_separate_specular_color(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_secondary_color(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_secondary_color + if ((pglSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC) __GLeeGetProcAddress("glSecondaryColor3bEXT"))!=0) nLinked++; + if ((pglSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3bvEXT"))!=0) nLinked++; + if ((pglSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC) __GLeeGetProcAddress("glSecondaryColor3dEXT"))!=0) nLinked++; + if ((pglSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3dvEXT"))!=0) nLinked++; + if ((pglSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC) __GLeeGetProcAddress("glSecondaryColor3fEXT"))!=0) nLinked++; + if ((pglSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3fvEXT"))!=0) nLinked++; + if ((pglSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC) __GLeeGetProcAddress("glSecondaryColor3iEXT"))!=0) nLinked++; + if ((pglSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3ivEXT"))!=0) nLinked++; + if ((pglSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC) __GLeeGetProcAddress("glSecondaryColor3sEXT"))!=0) nLinked++; + if ((pglSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3svEXT"))!=0) nLinked++; + if ((pglSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC) __GLeeGetProcAddress("glSecondaryColor3ubEXT"))!=0) nLinked++; + if ((pglSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3ubvEXT"))!=0) nLinked++; + if ((pglSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC) __GLeeGetProcAddress("glSecondaryColor3uiEXT"))!=0) nLinked++; + if ((pglSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3uivEXT"))!=0) nLinked++; + if ((pglSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC) __GLeeGetProcAddress("glSecondaryColor3usEXT"))!=0) nLinked++; + if ((pglSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC) __GLeeGetProcAddress("glSecondaryColor3usvEXT"))!=0) nLinked++; + if ((pglSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC) __GLeeGetProcAddress("glSecondaryColorPointerEXT"))!=0) nLinked++; +#endif + if (nLinked==17) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_perturb_normal(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_texture_perturb_normal + if ((pglTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC) __GLeeGetProcAddress("glTextureNormalEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_multi_draw_arrays(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_multi_draw_arrays + if ((pglMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC) __GLeeGetProcAddress("glMultiDrawArraysEXT"))!=0) nLinked++; + if ((pglMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC) __GLeeGetProcAddress("glMultiDrawElementsEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_fog_coord(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_fog_coord + if ((pglFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC) __GLeeGetProcAddress("glFogCoordfEXT"))!=0) nLinked++; + if ((pglFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC) __GLeeGetProcAddress("glFogCoordfvEXT"))!=0) nLinked++; + if ((pglFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC) __GLeeGetProcAddress("glFogCoorddEXT"))!=0) nLinked++; + if ((pglFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC) __GLeeGetProcAddress("glFogCoorddvEXT"))!=0) nLinked++; + if ((pglFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC) __GLeeGetProcAddress("glFogCoordPointerEXT"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_REND_screen_coordinates(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_coordinate_frame(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_coordinate_frame + if ((pglTangent3bEXT = (PFNGLTANGENT3BEXTPROC) __GLeeGetProcAddress("glTangent3bEXT"))!=0) nLinked++; + if ((pglTangent3bvEXT = (PFNGLTANGENT3BVEXTPROC) __GLeeGetProcAddress("glTangent3bvEXT"))!=0) nLinked++; + if ((pglTangent3dEXT = (PFNGLTANGENT3DEXTPROC) __GLeeGetProcAddress("glTangent3dEXT"))!=0) nLinked++; + if ((pglTangent3dvEXT = (PFNGLTANGENT3DVEXTPROC) __GLeeGetProcAddress("glTangent3dvEXT"))!=0) nLinked++; + if ((pglTangent3fEXT = (PFNGLTANGENT3FEXTPROC) __GLeeGetProcAddress("glTangent3fEXT"))!=0) nLinked++; + if ((pglTangent3fvEXT = (PFNGLTANGENT3FVEXTPROC) __GLeeGetProcAddress("glTangent3fvEXT"))!=0) nLinked++; + if ((pglTangent3iEXT = (PFNGLTANGENT3IEXTPROC) __GLeeGetProcAddress("glTangent3iEXT"))!=0) nLinked++; + if ((pglTangent3ivEXT = (PFNGLTANGENT3IVEXTPROC) __GLeeGetProcAddress("glTangent3ivEXT"))!=0) nLinked++; + if ((pglTangent3sEXT = (PFNGLTANGENT3SEXTPROC) __GLeeGetProcAddress("glTangent3sEXT"))!=0) nLinked++; + if ((pglTangent3svEXT = (PFNGLTANGENT3SVEXTPROC) __GLeeGetProcAddress("glTangent3svEXT"))!=0) nLinked++; + if ((pglBinormal3bEXT = (PFNGLBINORMAL3BEXTPROC) __GLeeGetProcAddress("glBinormal3bEXT"))!=0) nLinked++; + if ((pglBinormal3bvEXT = (PFNGLBINORMAL3BVEXTPROC) __GLeeGetProcAddress("glBinormal3bvEXT"))!=0) nLinked++; + if ((pglBinormal3dEXT = (PFNGLBINORMAL3DEXTPROC) __GLeeGetProcAddress("glBinormal3dEXT"))!=0) nLinked++; + if ((pglBinormal3dvEXT = (PFNGLBINORMAL3DVEXTPROC) __GLeeGetProcAddress("glBinormal3dvEXT"))!=0) nLinked++; + if ((pglBinormal3fEXT = (PFNGLBINORMAL3FEXTPROC) __GLeeGetProcAddress("glBinormal3fEXT"))!=0) nLinked++; + if ((pglBinormal3fvEXT = (PFNGLBINORMAL3FVEXTPROC) __GLeeGetProcAddress("glBinormal3fvEXT"))!=0) nLinked++; + if ((pglBinormal3iEXT = (PFNGLBINORMAL3IEXTPROC) __GLeeGetProcAddress("glBinormal3iEXT"))!=0) nLinked++; + if ((pglBinormal3ivEXT = (PFNGLBINORMAL3IVEXTPROC) __GLeeGetProcAddress("glBinormal3ivEXT"))!=0) nLinked++; + if ((pglBinormal3sEXT = (PFNGLBINORMAL3SEXTPROC) __GLeeGetProcAddress("glBinormal3sEXT"))!=0) nLinked++; + if ((pglBinormal3svEXT = (PFNGLBINORMAL3SVEXTPROC) __GLeeGetProcAddress("glBinormal3svEXT"))!=0) nLinked++; + if ((pglTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC) __GLeeGetProcAddress("glTangentPointerEXT"))!=0) nLinked++; + if ((pglBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC) __GLeeGetProcAddress("glBinormalPointerEXT"))!=0) nLinked++; +#endif + if (nLinked==22) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_env_combine(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_APPLE_specular_vector(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_APPLE_transform_hint(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_fog_scale(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SUNX_constant_data(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SUNX_constant_data + if ((pglFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC) __GLeeGetProcAddress("glFinishTextureSUNX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SUN_global_alpha(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SUN_global_alpha + if ((pglGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorbSUN"))!=0) nLinked++; + if ((pglGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorsSUN"))!=0) nLinked++; + if ((pglGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactoriSUN"))!=0) nLinked++; + if ((pglGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorfSUN"))!=0) nLinked++; + if ((pglGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactordSUN"))!=0) nLinked++; + if ((pglGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorubSUN"))!=0) nLinked++; + if ((pglGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactorusSUN"))!=0) nLinked++; + if ((pglGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC) __GLeeGetProcAddress("glGlobalAlphaFactoruiSUN"))!=0) nLinked++; +#endif + if (nLinked==8) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SUN_triangle_list(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SUN_triangle_list + if ((pglReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC) __GLeeGetProcAddress("glReplacementCodeuiSUN"))!=0) nLinked++; + if ((pglReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC) __GLeeGetProcAddress("glReplacementCodeusSUN"))!=0) nLinked++; + if ((pglReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC) __GLeeGetProcAddress("glReplacementCodeubSUN"))!=0) nLinked++; + if ((pglReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuivSUN"))!=0) nLinked++; + if ((pglReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC) __GLeeGetProcAddress("glReplacementCodeusvSUN"))!=0) nLinked++; + if ((pglReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC) __GLeeGetProcAddress("glReplacementCodeubvSUN"))!=0) nLinked++; + if ((pglReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC) __GLeeGetProcAddress("glReplacementCodePointerSUN"))!=0) nLinked++; +#endif + if (nLinked==7) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SUN_vertex(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SUN_vertex + if ((pglColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC) __GLeeGetProcAddress("glColor4ubVertex2fSUN"))!=0) nLinked++; + if ((pglColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC) __GLeeGetProcAddress("glColor4ubVertex2fvSUN"))!=0) nLinked++; + if ((pglColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC) __GLeeGetProcAddress("glColor4ubVertex3fSUN"))!=0) nLinked++; + if ((pglColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC) __GLeeGetProcAddress("glColor4ubVertex3fvSUN"))!=0) nLinked++; + if ((pglColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glColor3fVertex3fSUN"))!=0) nLinked++; + if ((pglColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glColor3fVertex3fvSUN"))!=0) nLinked++; + if ((pglNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glNormal3fVertex3fSUN"))!=0) nLinked++; + if ((pglNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glNormal3fVertex3fvSUN"))!=0) nLinked++; + if ((pglColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glColor4fNormal3fVertex3fSUN"))!=0) nLinked++; + if ((pglColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glColor4fNormal3fVertex3fvSUN"))!=0) nLinked++; + if ((pglTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fVertex3fSUN"))!=0) nLinked++; + if ((pglTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fVertex3fvSUN"))!=0) nLinked++; + if ((pglTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC) __GLeeGetProcAddress("glTexCoord4fVertex4fSUN"))!=0) nLinked++; + if ((pglTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC) __GLeeGetProcAddress("glTexCoord4fVertex4fvSUN"))!=0) nLinked++; + if ((pglTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor4ubVertex3fSUN"))!=0) nLinked++; + if ((pglTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor4ubVertex3fvSUN"))!=0) nLinked++; + if ((pglTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor3fVertex3fSUN"))!=0) nLinked++; + if ((pglTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor3fVertex3fvSUN"))!=0) nLinked++; + if ((pglTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fNormal3fVertex3fSUN"))!=0) nLinked++; + if ((pglTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fNormal3fVertex3fvSUN"))!=0) nLinked++; + if ((pglTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor4fNormal3fVertex3fSUN"))!=0) nLinked++; + if ((pglTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glTexCoord2fColor4fNormal3fVertex3fvSUN"))!=0) nLinked++; + if ((pglTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) __GLeeGetProcAddress("glTexCoord4fColor4fNormal3fVertex4fSUN"))!=0) nLinked++; + if ((pglTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) __GLeeGetProcAddress("glTexCoord4fColor4fNormal3fVertex4fvSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiVertex3fSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiVertex3fvSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor4ubVertex3fSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor4ubVertex3fvSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor3fVertex3fSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor3fVertex3fvSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiNormal3fVertex3fSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiNormal3fVertex3fvSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor4fNormal3fVertex3fSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiColor4fNormal3fVertex3fvSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fVertex3fSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fVertex3fvSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN"))!=0) nLinked++; + if ((pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) __GLeeGetProcAddress("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN"))!=0) nLinked++; +#endif + if (nLinked==40) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_blend_func_separate(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_blend_func_separate + if ((pglBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC) __GLeeGetProcAddress("glBlendFuncSeparateEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_INGR_color_clamp(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_INGR_interlace_read(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_stencil_wrap(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_422_pixels(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_texgen_reflection(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_cube_map(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SUN_convolution_border_modes(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_env_add(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_lod_bias(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_filter_anisotropic(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_vertex_weighting(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_vertex_weighting + if ((pglVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC) __GLeeGetProcAddress("glVertexWeightfEXT"))!=0) nLinked++; + if ((pglVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC) __GLeeGetProcAddress("glVertexWeightfvEXT"))!=0) nLinked++; + if ((pglVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC) __GLeeGetProcAddress("glVertexWeightPointerEXT"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_light_max_exponent(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_vertex_array_range(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_vertex_array_range + if ((pglFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC) __GLeeGetProcAddress("glFlushVertexArrayRangeNV"))!=0) nLinked++; + if ((pglVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC) __GLeeGetProcAddress("glVertexArrayRangeNV"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_register_combiners(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_register_combiners + if ((pglCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC) __GLeeGetProcAddress("glCombinerParameterfvNV"))!=0) nLinked++; + if ((pglCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC) __GLeeGetProcAddress("glCombinerParameterfNV"))!=0) nLinked++; + if ((pglCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC) __GLeeGetProcAddress("glCombinerParameterivNV"))!=0) nLinked++; + if ((pglCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC) __GLeeGetProcAddress("glCombinerParameteriNV"))!=0) nLinked++; + if ((pglCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC) __GLeeGetProcAddress("glCombinerInputNV"))!=0) nLinked++; + if ((pglCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC) __GLeeGetProcAddress("glCombinerOutputNV"))!=0) nLinked++; + if ((pglFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC) __GLeeGetProcAddress("glFinalCombinerInputNV"))!=0) nLinked++; + if ((pglGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetCombinerInputParameterfvNV"))!=0) nLinked++; + if ((pglGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetCombinerInputParameterivNV"))!=0) nLinked++; + if ((pglGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetCombinerOutputParameterfvNV"))!=0) nLinked++; + if ((pglGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetCombinerOutputParameterivNV"))!=0) nLinked++; + if ((pglGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetFinalCombinerInputParameterfvNV"))!=0) nLinked++; + if ((pglGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetFinalCombinerInputParameterivNV"))!=0) nLinked++; +#endif + if (nLinked==13) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_fog_distance(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_texgen_emboss(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_blend_square(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_texture_env_combine4(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_MESA_resize_buffers(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_MESA_resize_buffers + if ((pglResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC) __GLeeGetProcAddress("glResizeBuffersMESA"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_MESA_window_pos(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_MESA_window_pos + if ((pglWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC) __GLeeGetProcAddress("glWindowPos2dMESA"))!=0) nLinked++; + if ((pglWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC) __GLeeGetProcAddress("glWindowPos2dvMESA"))!=0) nLinked++; + if ((pglWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC) __GLeeGetProcAddress("glWindowPos2fMESA"))!=0) nLinked++; + if ((pglWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC) __GLeeGetProcAddress("glWindowPos2fvMESA"))!=0) nLinked++; + if ((pglWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC) __GLeeGetProcAddress("glWindowPos2iMESA"))!=0) nLinked++; + if ((pglWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC) __GLeeGetProcAddress("glWindowPos2ivMESA"))!=0) nLinked++; + if ((pglWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC) __GLeeGetProcAddress("glWindowPos2sMESA"))!=0) nLinked++; + if ((pglWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC) __GLeeGetProcAddress("glWindowPos2svMESA"))!=0) nLinked++; + if ((pglWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC) __GLeeGetProcAddress("glWindowPos3dMESA"))!=0) nLinked++; + if ((pglWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC) __GLeeGetProcAddress("glWindowPos3dvMESA"))!=0) nLinked++; + if ((pglWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC) __GLeeGetProcAddress("glWindowPos3fMESA"))!=0) nLinked++; + if ((pglWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC) __GLeeGetProcAddress("glWindowPos3fvMESA"))!=0) nLinked++; + if ((pglWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC) __GLeeGetProcAddress("glWindowPos3iMESA"))!=0) nLinked++; + if ((pglWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC) __GLeeGetProcAddress("glWindowPos3ivMESA"))!=0) nLinked++; + if ((pglWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC) __GLeeGetProcAddress("glWindowPos3sMESA"))!=0) nLinked++; + if ((pglWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC) __GLeeGetProcAddress("glWindowPos3svMESA"))!=0) nLinked++; + if ((pglWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC) __GLeeGetProcAddress("glWindowPos4dMESA"))!=0) nLinked++; + if ((pglWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC) __GLeeGetProcAddress("glWindowPos4dvMESA"))!=0) nLinked++; + if ((pglWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC) __GLeeGetProcAddress("glWindowPos4fMESA"))!=0) nLinked++; + if ((pglWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC) __GLeeGetProcAddress("glWindowPos4fvMESA"))!=0) nLinked++; + if ((pglWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC) __GLeeGetProcAddress("glWindowPos4iMESA"))!=0) nLinked++; + if ((pglWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC) __GLeeGetProcAddress("glWindowPos4ivMESA"))!=0) nLinked++; + if ((pglWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC) __GLeeGetProcAddress("glWindowPos4sMESA"))!=0) nLinked++; + if ((pglWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC) __GLeeGetProcAddress("glWindowPos4svMESA"))!=0) nLinked++; +#endif + if (nLinked==24) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_compression_s3tc(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_IBM_cull_vertex(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_IBM_multimode_draw_arrays(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_IBM_multimode_draw_arrays + if ((pglMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC) __GLeeGetProcAddress("glMultiModeDrawArraysIBM"))!=0) nLinked++; + if ((pglMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC) __GLeeGetProcAddress("glMultiModeDrawElementsIBM"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_IBM_vertex_array_lists(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_IBM_vertex_array_lists + if ((pglColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC) __GLeeGetProcAddress("glColorPointerListIBM"))!=0) nLinked++; + if ((pglSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) __GLeeGetProcAddress("glSecondaryColorPointerListIBM"))!=0) nLinked++; + if ((pglEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC) __GLeeGetProcAddress("glEdgeFlagPointerListIBM"))!=0) nLinked++; + if ((pglFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC) __GLeeGetProcAddress("glFogCoordPointerListIBM"))!=0) nLinked++; + if ((pglIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC) __GLeeGetProcAddress("glIndexPointerListIBM"))!=0) nLinked++; + if ((pglNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC) __GLeeGetProcAddress("glNormalPointerListIBM"))!=0) nLinked++; + if ((pglTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC) __GLeeGetProcAddress("glTexCoordPointerListIBM"))!=0) nLinked++; + if ((pglVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC) __GLeeGetProcAddress("glVertexPointerListIBM"))!=0) nLinked++; +#endif + if (nLinked==8) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_subsample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_ycrcb_subsample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_ycrcba(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGI_depth_pass_instrument(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_3DFX_texture_compression_FXT1(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_3DFX_multisample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_3DFX_tbuffer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_3DFX_tbuffer + if ((pglTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC) __GLeeGetProcAddress("glTbufferMask3DFX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_multisample(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_multisample + if ((pglSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC) __GLeeGetProcAddress("glSampleMaskEXT"))!=0) nLinked++; + if ((pglSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC) __GLeeGetProcAddress("glSamplePatternEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_vertex_preclip(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_convolution_accuracy(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_resample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_point_line_texgen(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIS_texture_color_mask(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIS_texture_color_mask + if ((pglTextureColorMaskSGIS = (PFNGLTEXTURECOLORMASKSGISPROC) __GLeeGetProcAddress("glTextureColorMaskSGIS"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_env_dot3(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ATI_texture_mirror_once(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_fence(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_fence + if ((pglDeleteFencesNV = (PFNGLDELETEFENCESNVPROC) __GLeeGetProcAddress("glDeleteFencesNV"))!=0) nLinked++; + if ((pglGenFencesNV = (PFNGLGENFENCESNVPROC) __GLeeGetProcAddress("glGenFencesNV"))!=0) nLinked++; + if ((pglIsFenceNV = (PFNGLISFENCENVPROC) __GLeeGetProcAddress("glIsFenceNV"))!=0) nLinked++; + if ((pglTestFenceNV = (PFNGLTESTFENCENVPROC) __GLeeGetProcAddress("glTestFenceNV"))!=0) nLinked++; + if ((pglGetFenceivNV = (PFNGLGETFENCEIVNVPROC) __GLeeGetProcAddress("glGetFenceivNV"))!=0) nLinked++; + if ((pglFinishFenceNV = (PFNGLFINISHFENCENVPROC) __GLeeGetProcAddress("glFinishFenceNV"))!=0) nLinked++; + if ((pglSetFenceNV = (PFNGLSETFENCENVPROC) __GLeeGetProcAddress("glSetFenceNV"))!=0) nLinked++; +#endif + if (nLinked==7) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_IBM_texture_mirrored_repeat(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_evaluators(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_evaluators + if ((pglMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC) __GLeeGetProcAddress("glMapControlPointsNV"))!=0) nLinked++; + if ((pglMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC) __GLeeGetProcAddress("glMapParameterivNV"))!=0) nLinked++; + if ((pglMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC) __GLeeGetProcAddress("glMapParameterfvNV"))!=0) nLinked++; + if ((pglGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC) __GLeeGetProcAddress("glGetMapControlPointsNV"))!=0) nLinked++; + if ((pglGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetMapParameterivNV"))!=0) nLinked++; + if ((pglGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetMapParameterfvNV"))!=0) nLinked++; + if ((pglGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC) __GLeeGetProcAddress("glGetMapAttribParameterivNV"))!=0) nLinked++; + if ((pglGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetMapAttribParameterfvNV"))!=0) nLinked++; + if ((pglEvalMapsNV = (PFNGLEVALMAPSNVPROC) __GLeeGetProcAddress("glEvalMapsNV"))!=0) nLinked++; +#endif + if (nLinked==9) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_packed_depth_stencil(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_register_combiners2(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_register_combiners2 + if ((pglCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) __GLeeGetProcAddress("glCombinerStageParameterfvNV"))!=0) nLinked++; + if ((pglGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetCombinerStageParameterfvNV"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_texture_compression_vtc(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_texture_rectangle(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_texture_shader(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_texture_shader2(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_vertex_array_range2(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_vertex_program(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_vertex_program + if ((pglAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC) __GLeeGetProcAddress("glAreProgramsResidentNV"))!=0) nLinked++; + if ((pglBindProgramNV = (PFNGLBINDPROGRAMNVPROC) __GLeeGetProcAddress("glBindProgramNV"))!=0) nLinked++; + if ((pglDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC) __GLeeGetProcAddress("glDeleteProgramsNV"))!=0) nLinked++; + if ((pglExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC) __GLeeGetProcAddress("glExecuteProgramNV"))!=0) nLinked++; + if ((pglGenProgramsNV = (PFNGLGENPROGRAMSNVPROC) __GLeeGetProcAddress("glGenProgramsNV"))!=0) nLinked++; + if ((pglGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC) __GLeeGetProcAddress("glGetProgramParameterdvNV"))!=0) nLinked++; + if ((pglGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetProgramParameterfvNV"))!=0) nLinked++; + if ((pglGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC) __GLeeGetProcAddress("glGetProgramivNV"))!=0) nLinked++; + if ((pglGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC) __GLeeGetProcAddress("glGetProgramStringNV"))!=0) nLinked++; + if ((pglGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC) __GLeeGetProcAddress("glGetTrackMatrixivNV"))!=0) nLinked++; + if ((pglGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC) __GLeeGetProcAddress("glGetVertexAttribdvNV"))!=0) nLinked++; + if ((pglGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) __GLeeGetProcAddress("glGetVertexAttribfvNV"))!=0) nLinked++; + if ((pglGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC) __GLeeGetProcAddress("glGetVertexAttribivNV"))!=0) nLinked++; + if ((pglGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC) __GLeeGetProcAddress("glGetVertexAttribPointervNV"))!=0) nLinked++; + if ((pglIsProgramNV = (PFNGLISPROGRAMNVPROC) __GLeeGetProcAddress("glIsProgramNV"))!=0) nLinked++; + if ((pglLoadProgramNV = (PFNGLLOADPROGRAMNVPROC) __GLeeGetProcAddress("glLoadProgramNV"))!=0) nLinked++; + if ((pglProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC) __GLeeGetProcAddress("glProgramParameter4dNV"))!=0) nLinked++; + if ((pglProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC) __GLeeGetProcAddress("glProgramParameter4dvNV"))!=0) nLinked++; + if ((pglProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC) __GLeeGetProcAddress("glProgramParameter4fNV"))!=0) nLinked++; + if ((pglProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC) __GLeeGetProcAddress("glProgramParameter4fvNV"))!=0) nLinked++; + if ((pglProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC) __GLeeGetProcAddress("glProgramParameters4dvNV"))!=0) nLinked++; + if ((pglProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC) __GLeeGetProcAddress("glProgramParameters4fvNV"))!=0) nLinked++; + if ((pglRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC) __GLeeGetProcAddress("glRequestResidentProgramsNV"))!=0) nLinked++; + if ((pglTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC) __GLeeGetProcAddress("glTrackMatrixNV"))!=0) nLinked++; + if ((pglVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC) __GLeeGetProcAddress("glVertexAttribPointerNV"))!=0) nLinked++; + if ((pglVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC) __GLeeGetProcAddress("glVertexAttrib1dNV"))!=0) nLinked++; + if ((pglVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC) __GLeeGetProcAddress("glVertexAttrib1dvNV"))!=0) nLinked++; + if ((pglVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC) __GLeeGetProcAddress("glVertexAttrib1fNV"))!=0) nLinked++; + if ((pglVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC) __GLeeGetProcAddress("glVertexAttrib1fvNV"))!=0) nLinked++; + if ((pglVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC) __GLeeGetProcAddress("glVertexAttrib1sNV"))!=0) nLinked++; + if ((pglVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC) __GLeeGetProcAddress("glVertexAttrib1svNV"))!=0) nLinked++; + if ((pglVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC) __GLeeGetProcAddress("glVertexAttrib2dNV"))!=0) nLinked++; + if ((pglVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC) __GLeeGetProcAddress("glVertexAttrib2dvNV"))!=0) nLinked++; + if ((pglVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC) __GLeeGetProcAddress("glVertexAttrib2fNV"))!=0) nLinked++; + if ((pglVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC) __GLeeGetProcAddress("glVertexAttrib2fvNV"))!=0) nLinked++; + if ((pglVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC) __GLeeGetProcAddress("glVertexAttrib2sNV"))!=0) nLinked++; + if ((pglVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC) __GLeeGetProcAddress("glVertexAttrib2svNV"))!=0) nLinked++; + if ((pglVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC) __GLeeGetProcAddress("glVertexAttrib3dNV"))!=0) nLinked++; + if ((pglVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC) __GLeeGetProcAddress("glVertexAttrib3dvNV"))!=0) nLinked++; + if ((pglVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC) __GLeeGetProcAddress("glVertexAttrib3fNV"))!=0) nLinked++; + if ((pglVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC) __GLeeGetProcAddress("glVertexAttrib3fvNV"))!=0) nLinked++; + if ((pglVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC) __GLeeGetProcAddress("glVertexAttrib3sNV"))!=0) nLinked++; + if ((pglVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC) __GLeeGetProcAddress("glVertexAttrib3svNV"))!=0) nLinked++; + if ((pglVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC) __GLeeGetProcAddress("glVertexAttrib4dNV"))!=0) nLinked++; + if ((pglVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC) __GLeeGetProcAddress("glVertexAttrib4dvNV"))!=0) nLinked++; + if ((pglVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC) __GLeeGetProcAddress("glVertexAttrib4fNV"))!=0) nLinked++; + if ((pglVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC) __GLeeGetProcAddress("glVertexAttrib4fvNV"))!=0) nLinked++; + if ((pglVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC) __GLeeGetProcAddress("glVertexAttrib4sNV"))!=0) nLinked++; + if ((pglVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC) __GLeeGetProcAddress("glVertexAttrib4svNV"))!=0) nLinked++; + if ((pglVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC) __GLeeGetProcAddress("glVertexAttrib4ubNV"))!=0) nLinked++; + if ((pglVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC) __GLeeGetProcAddress("glVertexAttrib4ubvNV"))!=0) nLinked++; + if ((pglVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC) __GLeeGetProcAddress("glVertexAttribs1dvNV"))!=0) nLinked++; + if ((pglVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC) __GLeeGetProcAddress("glVertexAttribs1fvNV"))!=0) nLinked++; + if ((pglVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC) __GLeeGetProcAddress("glVertexAttribs1svNV"))!=0) nLinked++; + if ((pglVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC) __GLeeGetProcAddress("glVertexAttribs2dvNV"))!=0) nLinked++; + if ((pglVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC) __GLeeGetProcAddress("glVertexAttribs2fvNV"))!=0) nLinked++; + if ((pglVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC) __GLeeGetProcAddress("glVertexAttribs2svNV"))!=0) nLinked++; + if ((pglVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC) __GLeeGetProcAddress("glVertexAttribs3dvNV"))!=0) nLinked++; + if ((pglVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC) __GLeeGetProcAddress("glVertexAttribs3fvNV"))!=0) nLinked++; + if ((pglVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC) __GLeeGetProcAddress("glVertexAttribs3svNV"))!=0) nLinked++; + if ((pglVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC) __GLeeGetProcAddress("glVertexAttribs4dvNV"))!=0) nLinked++; + if ((pglVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC) __GLeeGetProcAddress("glVertexAttribs4fvNV"))!=0) nLinked++; + if ((pglVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC) __GLeeGetProcAddress("glVertexAttribs4svNV"))!=0) nLinked++; + if ((pglVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC) __GLeeGetProcAddress("glVertexAttribs4ubvNV"))!=0) nLinked++; +#endif + if (nLinked==64) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_texture_coordinate_clamp(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_scalebias_hint(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_OML_interlace(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_OML_subsample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_OML_resample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_copy_depth_to_color(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ATI_envmap_bumpmap(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_envmap_bumpmap + if ((pglTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC) __GLeeGetProcAddress("glTexBumpParameterivATI"))!=0) nLinked++; + if ((pglTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC) __GLeeGetProcAddress("glTexBumpParameterfvATI"))!=0) nLinked++; + if ((pglGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC) __GLeeGetProcAddress("glGetTexBumpParameterivATI"))!=0) nLinked++; + if ((pglGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC) __GLeeGetProcAddress("glGetTexBumpParameterfvATI"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_fragment_shader(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_fragment_shader + if ((pglGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC) __GLeeGetProcAddress("glGenFragmentShadersATI"))!=0) nLinked++; + if ((pglBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC) __GLeeGetProcAddress("glBindFragmentShaderATI"))!=0) nLinked++; + if ((pglDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC) __GLeeGetProcAddress("glDeleteFragmentShaderATI"))!=0) nLinked++; + if ((pglBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC) __GLeeGetProcAddress("glBeginFragmentShaderATI"))!=0) nLinked++; + if ((pglEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC) __GLeeGetProcAddress("glEndFragmentShaderATI"))!=0) nLinked++; + if ((pglPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC) __GLeeGetProcAddress("glPassTexCoordATI"))!=0) nLinked++; + if ((pglSampleMapATI = (PFNGLSAMPLEMAPATIPROC) __GLeeGetProcAddress("glSampleMapATI"))!=0) nLinked++; + if ((pglColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC) __GLeeGetProcAddress("glColorFragmentOp1ATI"))!=0) nLinked++; + if ((pglColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC) __GLeeGetProcAddress("glColorFragmentOp2ATI"))!=0) nLinked++; + if ((pglColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC) __GLeeGetProcAddress("glColorFragmentOp3ATI"))!=0) nLinked++; + if ((pglAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC) __GLeeGetProcAddress("glAlphaFragmentOp1ATI"))!=0) nLinked++; + if ((pglAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC) __GLeeGetProcAddress("glAlphaFragmentOp2ATI"))!=0) nLinked++; + if ((pglAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC) __GLeeGetProcAddress("glAlphaFragmentOp3ATI"))!=0) nLinked++; + if ((pglSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) __GLeeGetProcAddress("glSetFragmentShaderConstantATI"))!=0) nLinked++; +#endif + if (nLinked==14) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_pn_triangles(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_pn_triangles + if ((pglPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC) __GLeeGetProcAddress("glPNTrianglesiATI"))!=0) nLinked++; + if ((pglPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC) __GLeeGetProcAddress("glPNTrianglesfATI"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_vertex_array_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_vertex_array_object + if ((pglNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glNewObjectBufferATI"))!=0) nLinked++; + if ((pglIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glIsObjectBufferATI"))!=0) nLinked++; + if ((pglUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glUpdateObjectBufferATI"))!=0) nLinked++; + if ((pglGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC) __GLeeGetProcAddress("glGetObjectBufferfvATI"))!=0) nLinked++; + if ((pglGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC) __GLeeGetProcAddress("glGetObjectBufferivATI"))!=0) nLinked++; + if ((pglFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glFreeObjectBufferATI"))!=0) nLinked++; + if ((pglArrayObjectATI = (PFNGLARRAYOBJECTATIPROC) __GLeeGetProcAddress("glArrayObjectATI"))!=0) nLinked++; + if ((pglGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC) __GLeeGetProcAddress("glGetArrayObjectfvATI"))!=0) nLinked++; + if ((pglGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC) __GLeeGetProcAddress("glGetArrayObjectivATI"))!=0) nLinked++; + if ((pglVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC) __GLeeGetProcAddress("glVariantArrayObjectATI"))!=0) nLinked++; + if ((pglGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC) __GLeeGetProcAddress("glGetVariantArrayObjectfvATI"))!=0) nLinked++; + if ((pglGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC) __GLeeGetProcAddress("glGetVariantArrayObjectivATI"))!=0) nLinked++; +#endif + if (nLinked==12) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_vertex_shader(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_vertex_shader + if ((pglBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC) __GLeeGetProcAddress("glBeginVertexShaderEXT"))!=0) nLinked++; + if ((pglEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC) __GLeeGetProcAddress("glEndVertexShaderEXT"))!=0) nLinked++; + if ((pglBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC) __GLeeGetProcAddress("glBindVertexShaderEXT"))!=0) nLinked++; + if ((pglGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC) __GLeeGetProcAddress("glGenVertexShadersEXT"))!=0) nLinked++; + if ((pglDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC) __GLeeGetProcAddress("glDeleteVertexShaderEXT"))!=0) nLinked++; + if ((pglShaderOp1EXT = (PFNGLSHADEROP1EXTPROC) __GLeeGetProcAddress("glShaderOp1EXT"))!=0) nLinked++; + if ((pglShaderOp2EXT = (PFNGLSHADEROP2EXTPROC) __GLeeGetProcAddress("glShaderOp2EXT"))!=0) nLinked++; + if ((pglShaderOp3EXT = (PFNGLSHADEROP3EXTPROC) __GLeeGetProcAddress("glShaderOp3EXT"))!=0) nLinked++; + if ((pglSwizzleEXT = (PFNGLSWIZZLEEXTPROC) __GLeeGetProcAddress("glSwizzleEXT"))!=0) nLinked++; + if ((pglWriteMaskEXT = (PFNGLWRITEMASKEXTPROC) __GLeeGetProcAddress("glWriteMaskEXT"))!=0) nLinked++; + if ((pglInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC) __GLeeGetProcAddress("glInsertComponentEXT"))!=0) nLinked++; + if ((pglExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC) __GLeeGetProcAddress("glExtractComponentEXT"))!=0) nLinked++; + if ((pglGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC) __GLeeGetProcAddress("glGenSymbolsEXT"))!=0) nLinked++; + if ((pglSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC) __GLeeGetProcAddress("glSetInvariantEXT"))!=0) nLinked++; + if ((pglSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC) __GLeeGetProcAddress("glSetLocalConstantEXT"))!=0) nLinked++; + if ((pglVariantbvEXT = (PFNGLVARIANTBVEXTPROC) __GLeeGetProcAddress("glVariantbvEXT"))!=0) nLinked++; + if ((pglVariantsvEXT = (PFNGLVARIANTSVEXTPROC) __GLeeGetProcAddress("glVariantsvEXT"))!=0) nLinked++; + if ((pglVariantivEXT = (PFNGLVARIANTIVEXTPROC) __GLeeGetProcAddress("glVariantivEXT"))!=0) nLinked++; + if ((pglVariantfvEXT = (PFNGLVARIANTFVEXTPROC) __GLeeGetProcAddress("glVariantfvEXT"))!=0) nLinked++; + if ((pglVariantdvEXT = (PFNGLVARIANTDVEXTPROC) __GLeeGetProcAddress("glVariantdvEXT"))!=0) nLinked++; + if ((pglVariantubvEXT = (PFNGLVARIANTUBVEXTPROC) __GLeeGetProcAddress("glVariantubvEXT"))!=0) nLinked++; + if ((pglVariantusvEXT = (PFNGLVARIANTUSVEXTPROC) __GLeeGetProcAddress("glVariantusvEXT"))!=0) nLinked++; + if ((pglVariantuivEXT = (PFNGLVARIANTUIVEXTPROC) __GLeeGetProcAddress("glVariantuivEXT"))!=0) nLinked++; + if ((pglVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC) __GLeeGetProcAddress("glVariantPointerEXT"))!=0) nLinked++; + if ((pglEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) __GLeeGetProcAddress("glEnableVariantClientStateEXT"))!=0) nLinked++; + if ((pglDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) __GLeeGetProcAddress("glDisableVariantClientStateEXT"))!=0) nLinked++; + if ((pglBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC) __GLeeGetProcAddress("glBindLightParameterEXT"))!=0) nLinked++; + if ((pglBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC) __GLeeGetProcAddress("glBindMaterialParameterEXT"))!=0) nLinked++; + if ((pglBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC) __GLeeGetProcAddress("glBindTexGenParameterEXT"))!=0) nLinked++; + if ((pglBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) __GLeeGetProcAddress("glBindTextureUnitParameterEXT"))!=0) nLinked++; + if ((pglBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC) __GLeeGetProcAddress("glBindParameterEXT"))!=0) nLinked++; + if ((pglIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC) __GLeeGetProcAddress("glIsVariantEnabledEXT"))!=0) nLinked++; + if ((pglGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC) __GLeeGetProcAddress("glGetVariantBooleanvEXT"))!=0) nLinked++; + if ((pglGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC) __GLeeGetProcAddress("glGetVariantIntegervEXT"))!=0) nLinked++; + if ((pglGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC) __GLeeGetProcAddress("glGetVariantFloatvEXT"))!=0) nLinked++; + if ((pglGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC) __GLeeGetProcAddress("glGetVariantPointervEXT"))!=0) nLinked++; + if ((pglGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC) __GLeeGetProcAddress("glGetInvariantBooleanvEXT"))!=0) nLinked++; + if ((pglGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC) __GLeeGetProcAddress("glGetInvariantIntegervEXT"))!=0) nLinked++; + if ((pglGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC) __GLeeGetProcAddress("glGetInvariantFloatvEXT"))!=0) nLinked++; + if ((pglGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) __GLeeGetProcAddress("glGetLocalConstantBooleanvEXT"))!=0) nLinked++; + if ((pglGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) __GLeeGetProcAddress("glGetLocalConstantIntegervEXT"))!=0) nLinked++; + if ((pglGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC) __GLeeGetProcAddress("glGetLocalConstantFloatvEXT"))!=0) nLinked++; +#endif + if (nLinked==42) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_vertex_streams(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_vertex_streams + if ((pglVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC) __GLeeGetProcAddress("glVertexStream1sATI"))!=0) nLinked++; + if ((pglVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC) __GLeeGetProcAddress("glVertexStream1svATI"))!=0) nLinked++; + if ((pglVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC) __GLeeGetProcAddress("glVertexStream1iATI"))!=0) nLinked++; + if ((pglVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC) __GLeeGetProcAddress("glVertexStream1ivATI"))!=0) nLinked++; + if ((pglVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC) __GLeeGetProcAddress("glVertexStream1fATI"))!=0) nLinked++; + if ((pglVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC) __GLeeGetProcAddress("glVertexStream1fvATI"))!=0) nLinked++; + if ((pglVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC) __GLeeGetProcAddress("glVertexStream1dATI"))!=0) nLinked++; + if ((pglVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC) __GLeeGetProcAddress("glVertexStream1dvATI"))!=0) nLinked++; + if ((pglVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC) __GLeeGetProcAddress("glVertexStream2sATI"))!=0) nLinked++; + if ((pglVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC) __GLeeGetProcAddress("glVertexStream2svATI"))!=0) nLinked++; + if ((pglVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC) __GLeeGetProcAddress("glVertexStream2iATI"))!=0) nLinked++; + if ((pglVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC) __GLeeGetProcAddress("glVertexStream2ivATI"))!=0) nLinked++; + if ((pglVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC) __GLeeGetProcAddress("glVertexStream2fATI"))!=0) nLinked++; + if ((pglVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC) __GLeeGetProcAddress("glVertexStream2fvATI"))!=0) nLinked++; + if ((pglVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC) __GLeeGetProcAddress("glVertexStream2dATI"))!=0) nLinked++; + if ((pglVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC) __GLeeGetProcAddress("glVertexStream2dvATI"))!=0) nLinked++; + if ((pglVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC) __GLeeGetProcAddress("glVertexStream3sATI"))!=0) nLinked++; + if ((pglVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC) __GLeeGetProcAddress("glVertexStream3svATI"))!=0) nLinked++; + if ((pglVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC) __GLeeGetProcAddress("glVertexStream3iATI"))!=0) nLinked++; + if ((pglVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC) __GLeeGetProcAddress("glVertexStream3ivATI"))!=0) nLinked++; + if ((pglVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC) __GLeeGetProcAddress("glVertexStream3fATI"))!=0) nLinked++; + if ((pglVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC) __GLeeGetProcAddress("glVertexStream3fvATI"))!=0) nLinked++; + if ((pglVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC) __GLeeGetProcAddress("glVertexStream3dATI"))!=0) nLinked++; + if ((pglVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC) __GLeeGetProcAddress("glVertexStream3dvATI"))!=0) nLinked++; + if ((pglVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC) __GLeeGetProcAddress("glVertexStream4sATI"))!=0) nLinked++; + if ((pglVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC) __GLeeGetProcAddress("glVertexStream4svATI"))!=0) nLinked++; + if ((pglVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC) __GLeeGetProcAddress("glVertexStream4iATI"))!=0) nLinked++; + if ((pglVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC) __GLeeGetProcAddress("glVertexStream4ivATI"))!=0) nLinked++; + if ((pglVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC) __GLeeGetProcAddress("glVertexStream4fATI"))!=0) nLinked++; + if ((pglVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC) __GLeeGetProcAddress("glVertexStream4fvATI"))!=0) nLinked++; + if ((pglVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC) __GLeeGetProcAddress("glVertexStream4dATI"))!=0) nLinked++; + if ((pglVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC) __GLeeGetProcAddress("glVertexStream4dvATI"))!=0) nLinked++; + if ((pglNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC) __GLeeGetProcAddress("glNormalStream3bATI"))!=0) nLinked++; + if ((pglNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC) __GLeeGetProcAddress("glNormalStream3bvATI"))!=0) nLinked++; + if ((pglNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC) __GLeeGetProcAddress("glNormalStream3sATI"))!=0) nLinked++; + if ((pglNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC) __GLeeGetProcAddress("glNormalStream3svATI"))!=0) nLinked++; + if ((pglNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC) __GLeeGetProcAddress("glNormalStream3iATI"))!=0) nLinked++; + if ((pglNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC) __GLeeGetProcAddress("glNormalStream3ivATI"))!=0) nLinked++; + if ((pglNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC) __GLeeGetProcAddress("glNormalStream3fATI"))!=0) nLinked++; + if ((pglNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC) __GLeeGetProcAddress("glNormalStream3fvATI"))!=0) nLinked++; + if ((pglNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC) __GLeeGetProcAddress("glNormalStream3dATI"))!=0) nLinked++; + if ((pglNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC) __GLeeGetProcAddress("glNormalStream3dvATI"))!=0) nLinked++; + if ((pglClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) __GLeeGetProcAddress("glClientActiveVertexStreamATI"))!=0) nLinked++; + if ((pglVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC) __GLeeGetProcAddress("glVertexBlendEnviATI"))!=0) nLinked++; + if ((pglVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC) __GLeeGetProcAddress("glVertexBlendEnvfATI"))!=0) nLinked++; +#endif + if (nLinked==45) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_element_array(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_element_array + if ((pglElementPointerATI = (PFNGLELEMENTPOINTERATIPROC) __GLeeGetProcAddress("glElementPointerATI"))!=0) nLinked++; + if ((pglDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC) __GLeeGetProcAddress("glDrawElementArrayATI"))!=0) nLinked++; + if ((pglDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC) __GLeeGetProcAddress("glDrawRangeElementArrayATI"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SUN_mesh_array(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SUN_mesh_array + if ((pglDrawMeshArraysSUN = (PFNGLDRAWMESHARRAYSSUNPROC) __GLeeGetProcAddress("glDrawMeshArraysSUN"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SUN_slice_accum(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_multisample_filter_hint(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_depth_clamp(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_occlusion_query(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_occlusion_query + if ((pglGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC) __GLeeGetProcAddress("glGenOcclusionQueriesNV"))!=0) nLinked++; + if ((pglDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC) __GLeeGetProcAddress("glDeleteOcclusionQueriesNV"))!=0) nLinked++; + if ((pglIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC) __GLeeGetProcAddress("glIsOcclusionQueryNV"))!=0) nLinked++; + if ((pglBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC) __GLeeGetProcAddress("glBeginOcclusionQueryNV"))!=0) nLinked++; + if ((pglEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC) __GLeeGetProcAddress("glEndOcclusionQueryNV"))!=0) nLinked++; + if ((pglGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC) __GLeeGetProcAddress("glGetOcclusionQueryivNV"))!=0) nLinked++; + if ((pglGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC) __GLeeGetProcAddress("glGetOcclusionQueryuivNV"))!=0) nLinked++; +#endif + if (nLinked==7) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_point_sprite(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_point_sprite + if ((pglPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC) __GLeeGetProcAddress("glPointParameteriNV"))!=0) nLinked++; + if ((pglPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC) __GLeeGetProcAddress("glPointParameterivNV"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_texture_shader3(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_vertex_program1_1(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_shadow_funcs(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_stencil_two_side(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_stencil_two_side + if ((pglActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC) __GLeeGetProcAddress("glActiveStencilFaceEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_text_fragment_shader(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_APPLE_client_storage(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_APPLE_element_array(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_APPLE_element_array + if ((pglElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC) __GLeeGetProcAddress("glElementPointerAPPLE"))!=0) nLinked++; + if ((pglDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC) __GLeeGetProcAddress("glDrawElementArrayAPPLE"))!=0) nLinked++; + if ((pglDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) __GLeeGetProcAddress("glDrawRangeElementArrayAPPLE"))!=0) nLinked++; + if ((pglMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) __GLeeGetProcAddress("glMultiDrawElementArrayAPPLE"))!=0) nLinked++; + if ((pglMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) __GLeeGetProcAddress("glMultiDrawRangeElementArrayAPPLE"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_APPLE_fence(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_APPLE_fence + if ((pglGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC) __GLeeGetProcAddress("glGenFencesAPPLE"))!=0) nLinked++; + if ((pglDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC) __GLeeGetProcAddress("glDeleteFencesAPPLE"))!=0) nLinked++; + if ((pglSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC) __GLeeGetProcAddress("glSetFenceAPPLE"))!=0) nLinked++; + if ((pglIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC) __GLeeGetProcAddress("glIsFenceAPPLE"))!=0) nLinked++; + if ((pglTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC) __GLeeGetProcAddress("glTestFenceAPPLE"))!=0) nLinked++; + if ((pglFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC) __GLeeGetProcAddress("glFinishFenceAPPLE"))!=0) nLinked++; + if ((pglTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC) __GLeeGetProcAddress("glTestObjectAPPLE"))!=0) nLinked++; + if ((pglFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC) __GLeeGetProcAddress("glFinishObjectAPPLE"))!=0) nLinked++; +#endif + if (nLinked==8) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_APPLE_vertex_array_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_APPLE_vertex_array_object + if ((pglBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC) __GLeeGetProcAddress("glBindVertexArrayAPPLE"))!=0) nLinked++; + if ((pglDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC) __GLeeGetProcAddress("glDeleteVertexArraysAPPLE"))!=0) nLinked++; + if ((pglGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC) __GLeeGetProcAddress("glGenVertexArraysAPPLE"))!=0) nLinked++; + if ((pglIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC) __GLeeGetProcAddress("glIsVertexArrayAPPLE"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_APPLE_vertex_array_range(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_APPLE_vertex_array_range + if ((pglVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC) __GLeeGetProcAddress("glVertexArrayRangeAPPLE"))!=0) nLinked++; + if ((pglFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) __GLeeGetProcAddress("glFlushVertexArrayRangeAPPLE"))!=0) nLinked++; + if ((pglVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) __GLeeGetProcAddress("glVertexArrayParameteriAPPLE"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_APPLE_ycbcr_422(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_S3_s3tc(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ATI_draw_buffers(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_draw_buffers + if ((pglDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC) __GLeeGetProcAddress("glDrawBuffersATI"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_pixel_format_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ATI_texture_env_combine3(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ATI_texture_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_float_buffer(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_fragment_program(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_fragment_program + if ((pglProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) __GLeeGetProcAddress("glProgramNamedParameter4fNV"))!=0) nLinked++; + if ((pglProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) __GLeeGetProcAddress("glProgramNamedParameter4dNV"))!=0) nLinked++; + if ((pglProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) __GLeeGetProcAddress("glProgramNamedParameter4fvNV"))!=0) nLinked++; + if ((pglProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) __GLeeGetProcAddress("glProgramNamedParameter4dvNV"))!=0) nLinked++; + if ((pglGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) __GLeeGetProcAddress("glGetProgramNamedParameterfvNV"))!=0) nLinked++; + if ((pglGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) __GLeeGetProcAddress("glGetProgramNamedParameterdvNV"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_half_float(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_half_float + if ((pglVertex2hNV = (PFNGLVERTEX2HNVPROC) __GLeeGetProcAddress("glVertex2hNV"))!=0) nLinked++; + if ((pglVertex2hvNV = (PFNGLVERTEX2HVNVPROC) __GLeeGetProcAddress("glVertex2hvNV"))!=0) nLinked++; + if ((pglVertex3hNV = (PFNGLVERTEX3HNVPROC) __GLeeGetProcAddress("glVertex3hNV"))!=0) nLinked++; + if ((pglVertex3hvNV = (PFNGLVERTEX3HVNVPROC) __GLeeGetProcAddress("glVertex3hvNV"))!=0) nLinked++; + if ((pglVertex4hNV = (PFNGLVERTEX4HNVPROC) __GLeeGetProcAddress("glVertex4hNV"))!=0) nLinked++; + if ((pglVertex4hvNV = (PFNGLVERTEX4HVNVPROC) __GLeeGetProcAddress("glVertex4hvNV"))!=0) nLinked++; + if ((pglNormal3hNV = (PFNGLNORMAL3HNVPROC) __GLeeGetProcAddress("glNormal3hNV"))!=0) nLinked++; + if ((pglNormal3hvNV = (PFNGLNORMAL3HVNVPROC) __GLeeGetProcAddress("glNormal3hvNV"))!=0) nLinked++; + if ((pglColor3hNV = (PFNGLCOLOR3HNVPROC) __GLeeGetProcAddress("glColor3hNV"))!=0) nLinked++; + if ((pglColor3hvNV = (PFNGLCOLOR3HVNVPROC) __GLeeGetProcAddress("glColor3hvNV"))!=0) nLinked++; + if ((pglColor4hNV = (PFNGLCOLOR4HNVPROC) __GLeeGetProcAddress("glColor4hNV"))!=0) nLinked++; + if ((pglColor4hvNV = (PFNGLCOLOR4HVNVPROC) __GLeeGetProcAddress("glColor4hvNV"))!=0) nLinked++; + if ((pglTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC) __GLeeGetProcAddress("glTexCoord1hNV"))!=0) nLinked++; + if ((pglTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC) __GLeeGetProcAddress("glTexCoord1hvNV"))!=0) nLinked++; + if ((pglTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC) __GLeeGetProcAddress("glTexCoord2hNV"))!=0) nLinked++; + if ((pglTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC) __GLeeGetProcAddress("glTexCoord2hvNV"))!=0) nLinked++; + if ((pglTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC) __GLeeGetProcAddress("glTexCoord3hNV"))!=0) nLinked++; + if ((pglTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC) __GLeeGetProcAddress("glTexCoord3hvNV"))!=0) nLinked++; + if ((pglTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC) __GLeeGetProcAddress("glTexCoord4hNV"))!=0) nLinked++; + if ((pglTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC) __GLeeGetProcAddress("glTexCoord4hvNV"))!=0) nLinked++; + if ((pglMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC) __GLeeGetProcAddress("glMultiTexCoord1hNV"))!=0) nLinked++; + if ((pglMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC) __GLeeGetProcAddress("glMultiTexCoord1hvNV"))!=0) nLinked++; + if ((pglMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC) __GLeeGetProcAddress("glMultiTexCoord2hNV"))!=0) nLinked++; + if ((pglMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC) __GLeeGetProcAddress("glMultiTexCoord2hvNV"))!=0) nLinked++; + if ((pglMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC) __GLeeGetProcAddress("glMultiTexCoord3hNV"))!=0) nLinked++; + if ((pglMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC) __GLeeGetProcAddress("glMultiTexCoord3hvNV"))!=0) nLinked++; + if ((pglMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC) __GLeeGetProcAddress("glMultiTexCoord4hNV"))!=0) nLinked++; + if ((pglMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC) __GLeeGetProcAddress("glMultiTexCoord4hvNV"))!=0) nLinked++; + if ((pglFogCoordhNV = (PFNGLFOGCOORDHNVPROC) __GLeeGetProcAddress("glFogCoordhNV"))!=0) nLinked++; + if ((pglFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC) __GLeeGetProcAddress("glFogCoordhvNV"))!=0) nLinked++; + if ((pglSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC) __GLeeGetProcAddress("glSecondaryColor3hNV"))!=0) nLinked++; + if ((pglSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC) __GLeeGetProcAddress("glSecondaryColor3hvNV"))!=0) nLinked++; + if ((pglVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC) __GLeeGetProcAddress("glVertexWeighthNV"))!=0) nLinked++; + if ((pglVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC) __GLeeGetProcAddress("glVertexWeighthvNV"))!=0) nLinked++; + if ((pglVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC) __GLeeGetProcAddress("glVertexAttrib1hNV"))!=0) nLinked++; + if ((pglVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC) __GLeeGetProcAddress("glVertexAttrib1hvNV"))!=0) nLinked++; + if ((pglVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC) __GLeeGetProcAddress("glVertexAttrib2hNV"))!=0) nLinked++; + if ((pglVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC) __GLeeGetProcAddress("glVertexAttrib2hvNV"))!=0) nLinked++; + if ((pglVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC) __GLeeGetProcAddress("glVertexAttrib3hNV"))!=0) nLinked++; + if ((pglVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC) __GLeeGetProcAddress("glVertexAttrib3hvNV"))!=0) nLinked++; + if ((pglVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC) __GLeeGetProcAddress("glVertexAttrib4hNV"))!=0) nLinked++; + if ((pglVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC) __GLeeGetProcAddress("glVertexAttrib4hvNV"))!=0) nLinked++; + if ((pglVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC) __GLeeGetProcAddress("glVertexAttribs1hvNV"))!=0) nLinked++; + if ((pglVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC) __GLeeGetProcAddress("glVertexAttribs2hvNV"))!=0) nLinked++; + if ((pglVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC) __GLeeGetProcAddress("glVertexAttribs3hvNV"))!=0) nLinked++; + if ((pglVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC) __GLeeGetProcAddress("glVertexAttribs4hvNV"))!=0) nLinked++; +#endif + if (nLinked==46) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_pixel_data_range(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_pixel_data_range + if ((pglPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC) __GLeeGetProcAddress("glPixelDataRangeNV"))!=0) nLinked++; + if ((pglFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC) __GLeeGetProcAddress("glFlushPixelDataRangeNV"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_primitive_restart(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_primitive_restart + if ((pglPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC) __GLeeGetProcAddress("glPrimitiveRestartNV"))!=0) nLinked++; + if ((pglPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC) __GLeeGetProcAddress("glPrimitiveRestartIndexNV"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_texture_expand_normal(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_vertex_program2(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_ATI_map_object_buffer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_map_object_buffer + if ((pglMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glMapObjectBufferATI"))!=0) nLinked++; + if ((pglUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC) __GLeeGetProcAddress("glUnmapObjectBufferATI"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_separate_stencil(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_separate_stencil + if ((pglStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC) __GLeeGetProcAddress("glStencilOpSeparateATI"))!=0) nLinked++; + if ((pglStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC) __GLeeGetProcAddress("glStencilFuncSeparateATI"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_ATI_vertex_attrib_array_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_ATI_vertex_attrib_array_object + if ((pglVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) __GLeeGetProcAddress("glVertexAttribArrayObjectATI"))!=0) nLinked++; + if ((pglGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) __GLeeGetProcAddress("glGetVertexAttribArrayObjectfvATI"))!=0) nLinked++; + if ((pglGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) __GLeeGetProcAddress("glGetVertexAttribArrayObjectivATI"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_OES_read_format(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_depth_bounds_test(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_depth_bounds_test + if ((pglDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC) __GLeeGetProcAddress("glDepthBoundsEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_mirror_clamp(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_blend_equation_separate(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_blend_equation_separate + if ((pglBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC) __GLeeGetProcAddress("glBlendEquationSeparateEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_MESA_pack_invert(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_MESA_ycbcr_texture(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_pixel_buffer_object(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_fragment_program_option(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_fragment_program2(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_vertex_program2_option(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_vertex_program3(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_framebuffer_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_framebuffer_object + if ((pglIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glIsRenderbufferEXT"))!=0) nLinked++; + if ((pglBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glBindRenderbufferEXT"))!=0) nLinked++; + if ((pglDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC) __GLeeGetProcAddress("glDeleteRenderbuffersEXT"))!=0) nLinked++; + if ((pglGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC) __GLeeGetProcAddress("glGenRenderbuffersEXT"))!=0) nLinked++; + if ((pglRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC) __GLeeGetProcAddress("glRenderbufferStorageEXT"))!=0) nLinked++; + if ((pglGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetRenderbufferParameterivEXT"))!=0) nLinked++; + if ((pglIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC) __GLeeGetProcAddress("glIsFramebufferEXT"))!=0) nLinked++; + if ((pglBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC) __GLeeGetProcAddress("glBindFramebufferEXT"))!=0) nLinked++; + if ((pglDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC) __GLeeGetProcAddress("glDeleteFramebuffersEXT"))!=0) nLinked++; + if ((pglGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) __GLeeGetProcAddress("glGenFramebuffersEXT"))!=0) nLinked++; + if ((pglCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) __GLeeGetProcAddress("glCheckFramebufferStatusEXT"))!=0) nLinked++; + if ((pglFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) __GLeeGetProcAddress("glFramebufferTexture1DEXT"))!=0) nLinked++; + if ((pglFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) __GLeeGetProcAddress("glFramebufferTexture2DEXT"))!=0) nLinked++; + if ((pglFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) __GLeeGetProcAddress("glFramebufferTexture3DEXT"))!=0) nLinked++; + if ((pglFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glFramebufferRenderbufferEXT"))!=0) nLinked++; + if ((pglGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetFramebufferAttachmentParameterivEXT"))!=0) nLinked++; + if ((pglGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC) __GLeeGetProcAddress("glGenerateMipmapEXT"))!=0) nLinked++; +#endif + if (nLinked==17) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_GREMEDY_string_marker(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_GREMEDY_string_marker + if ((pglStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC) __GLeeGetProcAddress("glStringMarkerGREMEDY"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_packed_depth_stencil(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_stencil_clear_tag(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_stencil_clear_tag + if ((pglStencilClearTagEXT = (PFNGLSTENCILCLEARTAGEXTPROC) __GLeeGetProcAddress("glStencilClearTagEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_sRGB(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_framebuffer_blit(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_framebuffer_blit + if ((pglBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC) __GLeeGetProcAddress("glBlitFramebufferEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_framebuffer_multisample(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_framebuffer_multisample + if ((pglRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) __GLeeGetProcAddress("glRenderbufferStorageMultisampleEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_MESAX_texture_stack(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_timer_query(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_timer_query + if ((pglGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC) __GLeeGetProcAddress("glGetQueryObjecti64vEXT"))!=0) nLinked++; + if ((pglGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC) __GLeeGetProcAddress("glGetQueryObjectui64vEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_gpu_program_parameters(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_gpu_program_parameters + if ((pglProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) __GLeeGetProcAddress("glProgramEnvParameters4fvEXT"))!=0) nLinked++; + if ((pglProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) __GLeeGetProcAddress("glProgramLocalParameters4fvEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_APPLE_flush_buffer_range(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_APPLE_flush_buffer_range + if ((pglBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC) __GLeeGetProcAddress("glBufferParameteriAPPLE"))!=0) nLinked++; + if ((pglFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) __GLeeGetProcAddress("glFlushMappedBufferRangeAPPLE"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_gpu_program4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_gpu_program4 + if ((pglProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC) __GLeeGetProcAddress("glProgramLocalParameterI4iNV"))!=0) nLinked++; + if ((pglProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) __GLeeGetProcAddress("glProgramLocalParameterI4ivNV"))!=0) nLinked++; + if ((pglProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) __GLeeGetProcAddress("glProgramLocalParametersI4ivNV"))!=0) nLinked++; + if ((pglProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) __GLeeGetProcAddress("glProgramLocalParameterI4uiNV"))!=0) nLinked++; + if ((pglProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) __GLeeGetProcAddress("glProgramLocalParameterI4uivNV"))!=0) nLinked++; + if ((pglProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) __GLeeGetProcAddress("glProgramLocalParametersI4uivNV"))!=0) nLinked++; + if ((pglProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC) __GLeeGetProcAddress("glProgramEnvParameterI4iNV"))!=0) nLinked++; + if ((pglProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC) __GLeeGetProcAddress("glProgramEnvParameterI4ivNV"))!=0) nLinked++; + if ((pglProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) __GLeeGetProcAddress("glProgramEnvParametersI4ivNV"))!=0) nLinked++; + if ((pglProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC) __GLeeGetProcAddress("glProgramEnvParameterI4uiNV"))!=0) nLinked++; + if ((pglProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) __GLeeGetProcAddress("glProgramEnvParameterI4uivNV"))!=0) nLinked++; + if ((pglProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) __GLeeGetProcAddress("glProgramEnvParametersI4uivNV"))!=0) nLinked++; + if ((pglGetProgramLocalParameterIivNV = (PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) __GLeeGetProcAddress("glGetProgramLocalParameterIivNV"))!=0) nLinked++; + if ((pglGetProgramLocalParameterIuivNV = (PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) __GLeeGetProcAddress("glGetProgramLocalParameterIuivNV"))!=0) nLinked++; + if ((pglGetProgramEnvParameterIivNV = (PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) __GLeeGetProcAddress("glGetProgramEnvParameterIivNV"))!=0) nLinked++; + if ((pglGetProgramEnvParameterIuivNV = (PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) __GLeeGetProcAddress("glGetProgramEnvParameterIuivNV"))!=0) nLinked++; +#endif + if (nLinked==16) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_geometry_program4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_geometry_program4 + if ((pglProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC) __GLeeGetProcAddress("glProgramVertexLimitNV"))!=0) nLinked++; + if ((pglFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC) __GLeeGetProcAddress("glFramebufferTextureEXT"))!=0) nLinked++; + if ((pglFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) __GLeeGetProcAddress("glFramebufferTextureLayerEXT"))!=0) nLinked++; + if ((pglFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) __GLeeGetProcAddress("glFramebufferTextureFaceEXT"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_geometry_shader4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_geometry_shader4 + if ((pglProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC) __GLeeGetProcAddress("glProgramParameteriEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_vertex_program4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_vertex_program4 + if ((pglVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC) __GLeeGetProcAddress("glVertexAttribI1iEXT"))!=0) nLinked++; + if ((pglVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC) __GLeeGetProcAddress("glVertexAttribI2iEXT"))!=0) nLinked++; + if ((pglVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC) __GLeeGetProcAddress("glVertexAttribI3iEXT"))!=0) nLinked++; + if ((pglVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC) __GLeeGetProcAddress("glVertexAttribI4iEXT"))!=0) nLinked++; + if ((pglVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC) __GLeeGetProcAddress("glVertexAttribI1uiEXT"))!=0) nLinked++; + if ((pglVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC) __GLeeGetProcAddress("glVertexAttribI2uiEXT"))!=0) nLinked++; + if ((pglVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC) __GLeeGetProcAddress("glVertexAttribI3uiEXT"))!=0) nLinked++; + if ((pglVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC) __GLeeGetProcAddress("glVertexAttribI4uiEXT"))!=0) nLinked++; + if ((pglVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC) __GLeeGetProcAddress("glVertexAttribI1ivEXT"))!=0) nLinked++; + if ((pglVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC) __GLeeGetProcAddress("glVertexAttribI2ivEXT"))!=0) nLinked++; + if ((pglVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC) __GLeeGetProcAddress("glVertexAttribI3ivEXT"))!=0) nLinked++; + if ((pglVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4ivEXT"))!=0) nLinked++; + if ((pglVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC) __GLeeGetProcAddress("glVertexAttribI1uivEXT"))!=0) nLinked++; + if ((pglVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC) __GLeeGetProcAddress("glVertexAttribI2uivEXT"))!=0) nLinked++; + if ((pglVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC) __GLeeGetProcAddress("glVertexAttribI3uivEXT"))!=0) nLinked++; + if ((pglVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4uivEXT"))!=0) nLinked++; + if ((pglVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4bvEXT"))!=0) nLinked++; + if ((pglVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4svEXT"))!=0) nLinked++; + if ((pglVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4ubvEXT"))!=0) nLinked++; + if ((pglVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC) __GLeeGetProcAddress("glVertexAttribI4usvEXT"))!=0) nLinked++; + if ((pglVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC) __GLeeGetProcAddress("glVertexAttribIPointerEXT"))!=0) nLinked++; + if ((pglGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC) __GLeeGetProcAddress("glGetVertexAttribIivEXT"))!=0) nLinked++; + if ((pglGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC) __GLeeGetProcAddress("glGetVertexAttribIuivEXT"))!=0) nLinked++; +#endif + if (nLinked==23) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_gpu_shader4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_gpu_shader4 + if ((pglGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC) __GLeeGetProcAddress("glGetUniformuivEXT"))!=0) nLinked++; + if ((pglBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC) __GLeeGetProcAddress("glBindFragDataLocationEXT"))!=0) nLinked++; + if ((pglGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC) __GLeeGetProcAddress("glGetFragDataLocationEXT"))!=0) nLinked++; + if ((pglUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC) __GLeeGetProcAddress("glUniform1uiEXT"))!=0) nLinked++; + if ((pglUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC) __GLeeGetProcAddress("glUniform2uiEXT"))!=0) nLinked++; + if ((pglUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC) __GLeeGetProcAddress("glUniform3uiEXT"))!=0) nLinked++; + if ((pglUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC) __GLeeGetProcAddress("glUniform4uiEXT"))!=0) nLinked++; + if ((pglUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC) __GLeeGetProcAddress("glUniform1uivEXT"))!=0) nLinked++; + if ((pglUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC) __GLeeGetProcAddress("glUniform2uivEXT"))!=0) nLinked++; + if ((pglUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC) __GLeeGetProcAddress("glUniform3uivEXT"))!=0) nLinked++; + if ((pglUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC) __GLeeGetProcAddress("glUniform4uivEXT"))!=0) nLinked++; +#endif + if (nLinked==11) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_drawinstanced(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_drawinstanced + if ((pglDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC) __GLeeGetProcAddress("glDrawArraysInstancedEXT"))!=0) nLinked++; + if ((pglDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC) __GLeeGetProcAddress("glDrawElementsInstancedEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_packed_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_array(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_buffer_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_texture_buffer_object + if ((pglTexBufferEXT = (PFNGLTEXBUFFEREXTPROC) __GLeeGetProcAddress("glTexBufferEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_compression_latc(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_compression_rgtc(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_shared_exponent(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_depth_buffer_float(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_depth_buffer_float + if ((pglDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC) __GLeeGetProcAddress("glDepthRangedNV"))!=0) nLinked++; + if ((pglClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC) __GLeeGetProcAddress("glClearDepthdNV"))!=0) nLinked++; + if ((pglDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC) __GLeeGetProcAddress("glDepthBoundsdNV"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_fragment_program4(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_framebuffer_multisample_coverage(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_framebuffer_multisample_coverage + if ((pglRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) __GLeeGetProcAddress("glRenderbufferStorageMultisampleCoverageNV"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_framebuffer_sRGB(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_geometry_shader4(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_NV_parameter_buffer_object(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_parameter_buffer_object + if ((pglProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) __GLeeGetProcAddress("glProgramBufferParametersfvNV"))!=0) nLinked++; + if ((pglProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) __GLeeGetProcAddress("glProgramBufferParametersIivNV"))!=0) nLinked++; + if ((pglProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) __GLeeGetProcAddress("glProgramBufferParametersIuivNV"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_draw_buffers2(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_draw_buffers2 + if ((pglColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC) __GLeeGetProcAddress("glColorMaskIndexedEXT"))!=0) nLinked++; + if ((pglGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetBooleanIndexedvEXT"))!=0) nLinked++; + if ((pglGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetIntegerIndexedvEXT"))!=0) nLinked++; + if ((pglEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC) __GLeeGetProcAddress("glEnableIndexedEXT"))!=0) nLinked++; + if ((pglDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC) __GLeeGetProcAddress("glDisableIndexedEXT"))!=0) nLinked++; + if ((pglIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC) __GLeeGetProcAddress("glIsEnabledIndexedEXT"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_transform_feedback(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_transform_feedback + if ((pglBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC) __GLeeGetProcAddress("glBeginTransformFeedbackNV"))!=0) nLinked++; + if ((pglEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC) __GLeeGetProcAddress("glEndTransformFeedbackNV"))!=0) nLinked++; + if ((pglTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) __GLeeGetProcAddress("glTransformFeedbackAttribsNV"))!=0) nLinked++; + if ((pglBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC) __GLeeGetProcAddress("glBindBufferRangeNV"))!=0) nLinked++; + if ((pglBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC) __GLeeGetProcAddress("glBindBufferOffsetNV"))!=0) nLinked++; + if ((pglBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC) __GLeeGetProcAddress("glBindBufferBaseNV"))!=0) nLinked++; + if ((pglTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) __GLeeGetProcAddress("glTransformFeedbackVaryingsNV"))!=0) nLinked++; + if ((pglActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC) __GLeeGetProcAddress("glActiveVaryingNV"))!=0) nLinked++; + if ((pglGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC) __GLeeGetProcAddress("glGetVaryingLocationNV"))!=0) nLinked++; + if ((pglGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC) __GLeeGetProcAddress("glGetActiveVaryingNV"))!=0) nLinked++; + if ((pglGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) __GLeeGetProcAddress("glGetTransformFeedbackVaryingNV"))!=0) nLinked++; +#endif + if (nLinked==11) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_bindable_uniform(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_bindable_uniform + if ((pglUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC) __GLeeGetProcAddress("glUniformBufferEXT"))!=0) nLinked++; + if ((pglGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC) __GLeeGetProcAddress("glGetUniformBufferSizeEXT"))!=0) nLinked++; + if ((pglGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC) __GLeeGetProcAddress("glGetUniformOffsetEXT"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_integer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_texture_integer + if ((pglTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glTexParameterIivEXT"))!=0) nLinked++; + if ((pglTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glTexParameterIuivEXT"))!=0) nLinked++; + if ((pglGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glGetTexParameterIivEXT"))!=0) nLinked++; + if ((pglGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glGetTexParameterIuivEXT"))!=0) nLinked++; + if ((pglClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC) __GLeeGetProcAddress("glClearColorIiEXT"))!=0) nLinked++; + if ((pglClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC) __GLeeGetProcAddress("glClearColorIuiEXT"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_GREMEDY_frame_terminator(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_GREMEDY_frame_terminator + if ((pglFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC) __GLeeGetProcAddress("glFrameTerminatorGREMEDY"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_conditional_render(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_NV_conditional_render + if ((pglBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC) __GLeeGetProcAddress("glBeginConditionalRenderNV"))!=0) nLinked++; + if ((pglEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC) __GLeeGetProcAddress("glEndConditionalRenderNV"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_NV_present_video(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_transform_feedback(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_transform_feedback + if ((pglBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) __GLeeGetProcAddress("glBeginTransformFeedbackEXT"))!=0) nLinked++; + if ((pglEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC) __GLeeGetProcAddress("glEndTransformFeedbackEXT"))!=0) nLinked++; + if ((pglBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC) __GLeeGetProcAddress("glBindBufferRangeEXT"))!=0) nLinked++; + if ((pglBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC) __GLeeGetProcAddress("glBindBufferOffsetEXT"))!=0) nLinked++; + if ((pglBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC) __GLeeGetProcAddress("glBindBufferBaseEXT"))!=0) nLinked++; + if ((pglTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) __GLeeGetProcAddress("glTransformFeedbackVaryingsEXT"))!=0) nLinked++; + if ((pglGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) __GLeeGetProcAddress("glGetTransformFeedbackVaryingEXT"))!=0) nLinked++; +#endif + if (nLinked==7) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_direct_state_access(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_direct_state_access + if ((pglClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC) __GLeeGetProcAddress("glClientAttribDefaultEXT"))!=0) nLinked++; + if ((pglPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) __GLeeGetProcAddress("glPushClientAttribDefaultEXT"))!=0) nLinked++; + if ((pglMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC) __GLeeGetProcAddress("glMatrixLoadfEXT"))!=0) nLinked++; + if ((pglMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC) __GLeeGetProcAddress("glMatrixLoaddEXT"))!=0) nLinked++; + if ((pglMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC) __GLeeGetProcAddress("glMatrixMultfEXT"))!=0) nLinked++; + if ((pglMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC) __GLeeGetProcAddress("glMatrixMultdEXT"))!=0) nLinked++; + if ((pglMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC) __GLeeGetProcAddress("glMatrixLoadIdentityEXT"))!=0) nLinked++; + if ((pglMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC) __GLeeGetProcAddress("glMatrixRotatefEXT"))!=0) nLinked++; + if ((pglMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC) __GLeeGetProcAddress("glMatrixRotatedEXT"))!=0) nLinked++; + if ((pglMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC) __GLeeGetProcAddress("glMatrixScalefEXT"))!=0) nLinked++; + if ((pglMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC) __GLeeGetProcAddress("glMatrixScaledEXT"))!=0) nLinked++; + if ((pglMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC) __GLeeGetProcAddress("glMatrixTranslatefEXT"))!=0) nLinked++; + if ((pglMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC) __GLeeGetProcAddress("glMatrixTranslatedEXT"))!=0) nLinked++; + if ((pglMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC) __GLeeGetProcAddress("glMatrixFrustumEXT"))!=0) nLinked++; + if ((pglMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC) __GLeeGetProcAddress("glMatrixOrthoEXT"))!=0) nLinked++; + if ((pglMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC) __GLeeGetProcAddress("glMatrixPopEXT"))!=0) nLinked++; + if ((pglMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC) __GLeeGetProcAddress("glMatrixPushEXT"))!=0) nLinked++; + if ((pglMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC) __GLeeGetProcAddress("glMatrixLoadTransposefEXT"))!=0) nLinked++; + if ((pglMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC) __GLeeGetProcAddress("glMatrixLoadTransposedEXT"))!=0) nLinked++; + if ((pglMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC) __GLeeGetProcAddress("glMatrixMultTransposefEXT"))!=0) nLinked++; + if ((pglMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC) __GLeeGetProcAddress("glMatrixMultTransposedEXT"))!=0) nLinked++; + if ((pglTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC) __GLeeGetProcAddress("glTextureParameterfEXT"))!=0) nLinked++; + if ((pglTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC) __GLeeGetProcAddress("glTextureParameterfvEXT"))!=0) nLinked++; + if ((pglTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC) __GLeeGetProcAddress("glTextureParameteriEXT"))!=0) nLinked++; + if ((pglTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC) __GLeeGetProcAddress("glTextureParameterivEXT"))!=0) nLinked++; + if ((pglTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC) __GLeeGetProcAddress("glTextureImage1DEXT"))!=0) nLinked++; + if ((pglTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC) __GLeeGetProcAddress("glTextureImage2DEXT"))!=0) nLinked++; + if ((pglTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glTextureSubImage1DEXT"))!=0) nLinked++; + if ((pglTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glTextureSubImage2DEXT"))!=0) nLinked++; + if ((pglCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyTextureImage1DEXT"))!=0) nLinked++; + if ((pglCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyTextureImage2DEXT"))!=0) nLinked++; + if ((pglCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyTextureSubImage1DEXT"))!=0) nLinked++; + if ((pglCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyTextureSubImage2DEXT"))!=0) nLinked++; + if ((pglGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC) __GLeeGetProcAddress("glGetTextureImageEXT"))!=0) nLinked++; + if ((pglGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetTextureParameterfvEXT"))!=0) nLinked++; + if ((pglGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetTextureParameterivEXT"))!=0) nLinked++; + if ((pglGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetTextureLevelParameterfvEXT"))!=0) nLinked++; + if ((pglGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetTextureLevelParameterivEXT"))!=0) nLinked++; + if ((pglTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC) __GLeeGetProcAddress("glTextureImage3DEXT"))!=0) nLinked++; + if ((pglTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glTextureSubImage3DEXT"))!=0) nLinked++; + if ((pglCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCopyTextureSubImage3DEXT"))!=0) nLinked++; + if ((pglMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC) __GLeeGetProcAddress("glMultiTexParameterfEXT"))!=0) nLinked++; + if ((pglMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC) __GLeeGetProcAddress("glMultiTexParameterfvEXT"))!=0) nLinked++; + if ((pglMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC) __GLeeGetProcAddress("glMultiTexParameteriEXT"))!=0) nLinked++; + if ((pglMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC) __GLeeGetProcAddress("glMultiTexParameterivEXT"))!=0) nLinked++; + if ((pglMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC) __GLeeGetProcAddress("glMultiTexImage1DEXT"))!=0) nLinked++; + if ((pglMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC) __GLeeGetProcAddress("glMultiTexImage2DEXT"))!=0) nLinked++; + if ((pglMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glMultiTexSubImage1DEXT"))!=0) nLinked++; + if ((pglMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glMultiTexSubImage2DEXT"))!=0) nLinked++; + if ((pglCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexImage1DEXT"))!=0) nLinked++; + if ((pglCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexImage2DEXT"))!=0) nLinked++; + if ((pglCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexSubImage1DEXT"))!=0) nLinked++; + if ((pglCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexSubImage2DEXT"))!=0) nLinked++; + if ((pglGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC) __GLeeGetProcAddress("glGetMultiTexImageEXT"))!=0) nLinked++; + if ((pglGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetMultiTexParameterfvEXT"))!=0) nLinked++; + if ((pglGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexParameterivEXT"))!=0) nLinked++; + if ((pglGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetMultiTexLevelParameterfvEXT"))!=0) nLinked++; + if ((pglGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexLevelParameterivEXT"))!=0) nLinked++; + if ((pglMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC) __GLeeGetProcAddress("glMultiTexImage3DEXT"))!=0) nLinked++; + if ((pglMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glMultiTexSubImage3DEXT"))!=0) nLinked++; + if ((pglCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCopyMultiTexSubImage3DEXT"))!=0) nLinked++; + if ((pglBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC) __GLeeGetProcAddress("glBindMultiTextureEXT"))!=0) nLinked++; + if ((pglEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) __GLeeGetProcAddress("glEnableClientStateIndexedEXT"))!=0) nLinked++; + if ((pglDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) __GLeeGetProcAddress("glDisableClientStateIndexedEXT"))!=0) nLinked++; + if ((pglMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC) __GLeeGetProcAddress("glMultiTexCoordPointerEXT"))!=0) nLinked++; + if ((pglMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC) __GLeeGetProcAddress("glMultiTexEnvfEXT"))!=0) nLinked++; + if ((pglMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC) __GLeeGetProcAddress("glMultiTexEnvfvEXT"))!=0) nLinked++; + if ((pglMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC) __GLeeGetProcAddress("glMultiTexEnviEXT"))!=0) nLinked++; + if ((pglMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC) __GLeeGetProcAddress("glMultiTexEnvivEXT"))!=0) nLinked++; + if ((pglMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC) __GLeeGetProcAddress("glMultiTexGendEXT"))!=0) nLinked++; + if ((pglMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC) __GLeeGetProcAddress("glMultiTexGendvEXT"))!=0) nLinked++; + if ((pglMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC) __GLeeGetProcAddress("glMultiTexGenfEXT"))!=0) nLinked++; + if ((pglMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC) __GLeeGetProcAddress("glMultiTexGenfvEXT"))!=0) nLinked++; + if ((pglMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC) __GLeeGetProcAddress("glMultiTexGeniEXT"))!=0) nLinked++; + if ((pglMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC) __GLeeGetProcAddress("glMultiTexGenivEXT"))!=0) nLinked++; + if ((pglGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC) __GLeeGetProcAddress("glGetMultiTexEnvfvEXT"))!=0) nLinked++; + if ((pglGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexEnvivEXT"))!=0) nLinked++; + if ((pglGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC) __GLeeGetProcAddress("glGetMultiTexGendvEXT"))!=0) nLinked++; + if ((pglGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC) __GLeeGetProcAddress("glGetMultiTexGenfvEXT"))!=0) nLinked++; + if ((pglGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexGenivEXT"))!=0) nLinked++; + if ((pglGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetFloatIndexedvEXT"))!=0) nLinked++; + if ((pglGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetDoubleIndexedvEXT"))!=0) nLinked++; + if ((pglGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC) __GLeeGetProcAddress("glGetPointerIndexedvEXT"))!=0) nLinked++; + if ((pglCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) __GLeeGetProcAddress("glCompressedTextureImage3DEXT"))!=0) nLinked++; + if ((pglCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) __GLeeGetProcAddress("glCompressedTextureImage2DEXT"))!=0) nLinked++; + if ((pglCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) __GLeeGetProcAddress("glCompressedTextureImage1DEXT"))!=0) nLinked++; + if ((pglCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCompressedTextureSubImage3DEXT"))!=0) nLinked++; + if ((pglCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCompressedTextureSubImage2DEXT"))!=0) nLinked++; + if ((pglCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCompressedTextureSubImage1DEXT"))!=0) nLinked++; + if ((pglGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) __GLeeGetProcAddress("glGetCompressedTextureImageEXT"))!=0) nLinked++; + if ((pglCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexImage3DEXT"))!=0) nLinked++; + if ((pglCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexImage2DEXT"))!=0) nLinked++; + if ((pglCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexImage1DEXT"))!=0) nLinked++; + if ((pglCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexSubImage3DEXT"))!=0) nLinked++; + if ((pglCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexSubImage2DEXT"))!=0) nLinked++; + if ((pglCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) __GLeeGetProcAddress("glCompressedMultiTexSubImage1DEXT"))!=0) nLinked++; + if ((pglGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) __GLeeGetProcAddress("glGetCompressedMultiTexImageEXT"))!=0) nLinked++; + if ((pglNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC) __GLeeGetProcAddress("glNamedProgramStringEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameter4dEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameter4dvEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameter4fEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameter4fvEXT"))!=0) nLinked++; + if ((pglGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramLocalParameterdvEXT"))!=0) nLinked++; + if ((pglGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramLocalParameterfvEXT"))!=0) nLinked++; + if ((pglGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramivEXT"))!=0) nLinked++; + if ((pglGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) __GLeeGetProcAddress("glGetNamedProgramStringEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameters4fvEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameterI4iEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameterI4ivEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParametersI4ivEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameterI4uiEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParameterI4uivEXT"))!=0) nLinked++; + if ((pglNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) __GLeeGetProcAddress("glNamedProgramLocalParametersI4uivEXT"))!=0) nLinked++; + if ((pglGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramLocalParameterIivEXT"))!=0) nLinked++; + if ((pglGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glGetNamedProgramLocalParameterIuivEXT"))!=0) nLinked++; + if ((pglTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glTextureParameterIivEXT"))!=0) nLinked++; + if ((pglTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glTextureParameterIuivEXT"))!=0) nLinked++; + if ((pglGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glGetTextureParameterIivEXT"))!=0) nLinked++; + if ((pglGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glGetTextureParameterIuivEXT"))!=0) nLinked++; + if ((pglMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glMultiTexParameterIivEXT"))!=0) nLinked++; + if ((pglMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glMultiTexParameterIuivEXT"))!=0) nLinked++; + if ((pglGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexParameterIivEXT"))!=0) nLinked++; + if ((pglGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) __GLeeGetProcAddress("glGetMultiTexParameterIuivEXT"))!=0) nLinked++; + if ((pglProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC) __GLeeGetProcAddress("glProgramUniform1fEXT"))!=0) nLinked++; + if ((pglProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC) __GLeeGetProcAddress("glProgramUniform2fEXT"))!=0) nLinked++; + if ((pglProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC) __GLeeGetProcAddress("glProgramUniform3fEXT"))!=0) nLinked++; + if ((pglProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC) __GLeeGetProcAddress("glProgramUniform4fEXT"))!=0) nLinked++; + if ((pglProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC) __GLeeGetProcAddress("glProgramUniform1iEXT"))!=0) nLinked++; + if ((pglProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC) __GLeeGetProcAddress("glProgramUniform2iEXT"))!=0) nLinked++; + if ((pglProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC) __GLeeGetProcAddress("glProgramUniform3iEXT"))!=0) nLinked++; + if ((pglProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC) __GLeeGetProcAddress("glProgramUniform4iEXT"))!=0) nLinked++; + if ((pglProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC) __GLeeGetProcAddress("glProgramUniform1fvEXT"))!=0) nLinked++; + if ((pglProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC) __GLeeGetProcAddress("glProgramUniform2fvEXT"))!=0) nLinked++; + if ((pglProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC) __GLeeGetProcAddress("glProgramUniform3fvEXT"))!=0) nLinked++; + if ((pglProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC) __GLeeGetProcAddress("glProgramUniform4fvEXT"))!=0) nLinked++; + if ((pglProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC) __GLeeGetProcAddress("glProgramUniform1ivEXT"))!=0) nLinked++; + if ((pglProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC) __GLeeGetProcAddress("glProgramUniform2ivEXT"))!=0) nLinked++; + if ((pglProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC) __GLeeGetProcAddress("glProgramUniform3ivEXT"))!=0) nLinked++; + if ((pglProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC) __GLeeGetProcAddress("glProgramUniform4ivEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix2fvEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix3fvEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix4fvEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix2x3fvEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix3x2fvEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix2x4fvEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix4x2fvEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix3x4fvEXT"))!=0) nLinked++; + if ((pglProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) __GLeeGetProcAddress("glProgramUniformMatrix4x3fvEXT"))!=0) nLinked++; + if ((pglProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC) __GLeeGetProcAddress("glProgramUniform1uiEXT"))!=0) nLinked++; + if ((pglProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC) __GLeeGetProcAddress("glProgramUniform2uiEXT"))!=0) nLinked++; + if ((pglProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC) __GLeeGetProcAddress("glProgramUniform3uiEXT"))!=0) nLinked++; + if ((pglProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC) __GLeeGetProcAddress("glProgramUniform4uiEXT"))!=0) nLinked++; + if ((pglProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC) __GLeeGetProcAddress("glProgramUniform1uivEXT"))!=0) nLinked++; + if ((pglProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC) __GLeeGetProcAddress("glProgramUniform2uivEXT"))!=0) nLinked++; + if ((pglProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC) __GLeeGetProcAddress("glProgramUniform3uivEXT"))!=0) nLinked++; + if ((pglProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC) __GLeeGetProcAddress("glProgramUniform4uivEXT"))!=0) nLinked++; + if ((pglNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC) __GLeeGetProcAddress("glNamedBufferDataEXT"))!=0) nLinked++; + if ((pglNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC) __GLeeGetProcAddress("glNamedBufferSubDataEXT"))!=0) nLinked++; + if ((pglMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC) __GLeeGetProcAddress("glMapNamedBufferEXT"))!=0) nLinked++; + if ((pglUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC) __GLeeGetProcAddress("glUnmapNamedBufferEXT"))!=0) nLinked++; + if ((pglGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetNamedBufferParameterivEXT"))!=0) nLinked++; + if ((pglGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) __GLeeGetProcAddress("glGetNamedBufferPointervEXT"))!=0) nLinked++; + if ((pglGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) __GLeeGetProcAddress("glGetNamedBufferSubDataEXT"))!=0) nLinked++; + if ((pglTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC) __GLeeGetProcAddress("glTextureBufferEXT"))!=0) nLinked++; + if ((pglMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC) __GLeeGetProcAddress("glMultiTexBufferEXT"))!=0) nLinked++; + if ((pglNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) __GLeeGetProcAddress("glNamedRenderbufferStorageEXT"))!=0) nLinked++; + if ((pglGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetNamedRenderbufferParameterivEXT"))!=0) nLinked++; + if ((pglCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) __GLeeGetProcAddress("glCheckNamedFramebufferStatusEXT"))!=0) nLinked++; + if ((pglNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTexture1DEXT"))!=0) nLinked++; + if ((pglNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTexture2DEXT"))!=0) nLinked++; + if ((pglNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTexture3DEXT"))!=0) nLinked++; + if ((pglNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glNamedFramebufferRenderbufferEXT"))!=0) nLinked++; + if ((pglGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetNamedFramebufferAttachmentParameterivEXT"))!=0) nLinked++; + if ((pglGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC) __GLeeGetProcAddress("glGenerateTextureMipmapEXT"))!=0) nLinked++; + if ((pglGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC) __GLeeGetProcAddress("glGenerateMultiTexMipmapEXT"))!=0) nLinked++; + if ((pglFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) __GLeeGetProcAddress("glFramebufferDrawBufferEXT"))!=0) nLinked++; + if ((pglFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) __GLeeGetProcAddress("glFramebufferDrawBuffersEXT"))!=0) nLinked++; + if ((pglFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC) __GLeeGetProcAddress("glFramebufferReadBufferEXT"))!=0) nLinked++; + if ((pglGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) __GLeeGetProcAddress("glGetFramebufferParameterivEXT"))!=0) nLinked++; + if ((pglNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) __GLeeGetProcAddress("glNamedRenderbufferStorageMultisampleEXT"))!=0) nLinked++; + if ((pglNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) __GLeeGetProcAddress("glNamedRenderbufferStorageMultisampleCoverageEXT"))!=0) nLinked++; + if ((pglNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTextureEXT"))!=0) nLinked++; + if ((pglNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) __GLeeGetProcAddress("glNamedFramebufferTextureLayerEXT"))!=0) nLinked++; + if ((pglNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) __GLeeGetProcAddress("glNamedFramebufferTextureFaceEXT"))!=0) nLinked++; + if ((pglTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC) __GLeeGetProcAddress("glTextureRenderbufferEXT"))!=0) nLinked++; + if ((pglMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC) __GLeeGetProcAddress("glMultiTexRenderbufferEXT"))!=0) nLinked++; +#endif + if (nLinked==186) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_vertex_array_bgra(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_texture_select(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_INGR_blend_func_separate(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_INGR_blend_func_separate + if ((pglBlendFuncSeparateINGR = (PFNGLBLENDFUNCSEPARATEINGRPROC) __GLeeGetProcAddress("glBlendFuncSeparateINGR"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_depth_pass_instrument(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_igloo_interface(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_SGIX_igloo_interface + if ((pglIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC) __GLeeGetProcAddress("glIglooInterfaceSGIX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_fragment_lighting(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_fragment_lighting + if ((pglFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC) __GLeeGetProcAddress("glFragmentLightModeliEXT"))!=0) nLinked++; + if ((pglFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC) __GLeeGetProcAddress("glFragmentLightModelfEXT"))!=0) nLinked++; + if ((pglFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC) __GLeeGetProcAddress("glFragmentLightModelivEXT"))!=0) nLinked++; + if ((pglFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC) __GLeeGetProcAddress("glFragmentLightModelfvEXT"))!=0) nLinked++; + if ((pglFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC) __GLeeGetProcAddress("glFragmentLightiEXT"))!=0) nLinked++; + if ((pglFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC) __GLeeGetProcAddress("glFragmentLightfEXT"))!=0) nLinked++; + if ((pglFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC) __GLeeGetProcAddress("glFragmentLightivEXT"))!=0) nLinked++; + if ((pglFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC) __GLeeGetProcAddress("glFragmentLightfvEXT"))!=0) nLinked++; + if ((pglGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC) __GLeeGetProcAddress("glGetFragmentLightivEXT"))!=0) nLinked++; + if ((pglGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC) __GLeeGetProcAddress("glGetFragmentLightfvEXT"))!=0) nLinked++; + if ((pglFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC) __GLeeGetProcAddress("glFragmentMaterialfEXT"))!=0) nLinked++; + if ((pglFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC) __GLeeGetProcAddress("glFragmentMaterialiEXT"))!=0) nLinked++; + if ((pglFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC) __GLeeGetProcAddress("glFragmentMaterialfvEXT"))!=0) nLinked++; + if ((pglFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC) __GLeeGetProcAddress("glFragmentMaterialivEXT"))!=0) nLinked++; + if ((pglFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC) __GLeeGetProcAddress("glFragmentColorMaterialEXT"))!=0) nLinked++; + if ((pglGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC) __GLeeGetProcAddress("glGetFragmentMaterialfvEXT"))!=0) nLinked++; + if ((pglGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC) __GLeeGetProcAddress("glGetFragmentMaterialivEXT"))!=0) nLinked++; + if ((pglLightEnviEXT = (PFNGLLIGHTENVIEXTPROC) __GLeeGetProcAddress("glLightEnviEXT"))!=0) nLinked++; +#endif + if (nLinked==18) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_scene_marker(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_EXT_scene_marker + if ((pglBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC) __GLeeGetProcAddress("glBeginSceneEXT"))!=0) nLinked++; + if ((pglEndSceneEXT = (PFNGLENDSCENEEXTPROC) __GLeeGetProcAddress("glEndSceneEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_EXT_texture_compression_dxt1(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_EXT_texture_env(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_IBM_static_data(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_OES_byte_coordinates(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_OES_compressed_paletted_texture(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_OES_single_precision(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GL_OES_single_precision + if ((pglDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC) __GLeeGetProcAddress("glDepthRangefOES"))!=0) nLinked++; + if ((pglFrustumfOES = (PFNGLFRUSTUMFOESPROC) __GLeeGetProcAddress("glFrustumfOES"))!=0) nLinked++; + if ((pglOrthofOES = (PFNGLORTHOFOESPROC) __GLeeGetProcAddress("glOrthofOES"))!=0) nLinked++; + if ((pglClipPlanefOES = (PFNGLCLIPPLANEFOESPROC) __GLeeGetProcAddress("glClipPlanefOES"))!=0) nLinked++; + if ((pglGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC) __GLeeGetProcAddress("glGetClipPlanefOES"))!=0) nLinked++; + if ((pglClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC) __GLeeGetProcAddress("glClearDepthfOES"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GL_SGIX_pixel_texture_bits(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GL_SGIX_texture_range(void) {return GLEE_LINK_COMPLETE;} + +GLEE_LINK_FUNCTION __GLeeGLLoadFunction[322]; + +void initGLLoadFunctions(void) +{ + __GLeeGLLoadFunction[0]=__GLeeLink_GL_VERSION_1_2; + __GLeeGLLoadFunction[1]=__GLeeLink_GL_ARB_imaging; + __GLeeGLLoadFunction[2]=__GLeeLink_GL_VERSION_1_3; + __GLeeGLLoadFunction[3]=__GLeeLink_GL_VERSION_1_4; + __GLeeGLLoadFunction[4]=__GLeeLink_GL_VERSION_1_5; + __GLeeGLLoadFunction[5]=__GLeeLink_GL_VERSION_2_0; + __GLeeGLLoadFunction[6]=__GLeeLink_GL_VERSION_2_1; + __GLeeGLLoadFunction[7]=__GLeeLink_GL_VERSION_3_0; + __GLeeGLLoadFunction[8]=__GLeeLink_GL_ARB_multitexture; + __GLeeGLLoadFunction[9]=__GLeeLink_GL_ARB_transpose_matrix; + __GLeeGLLoadFunction[10]=__GLeeLink_GL_ARB_multisample; + __GLeeGLLoadFunction[11]=__GLeeLink_GL_ARB_texture_env_add; + __GLeeGLLoadFunction[12]=__GLeeLink_GL_ARB_texture_cube_map; + __GLeeGLLoadFunction[13]=__GLeeLink_GL_ARB_texture_compression; + __GLeeGLLoadFunction[14]=__GLeeLink_GL_ARB_texture_border_clamp; + __GLeeGLLoadFunction[15]=__GLeeLink_GL_ARB_point_parameters; + __GLeeGLLoadFunction[16]=__GLeeLink_GL_ARB_vertex_blend; + __GLeeGLLoadFunction[17]=__GLeeLink_GL_ARB_matrix_palette; + __GLeeGLLoadFunction[18]=__GLeeLink_GL_ARB_texture_env_combine; + __GLeeGLLoadFunction[19]=__GLeeLink_GL_ARB_texture_env_crossbar; + __GLeeGLLoadFunction[20]=__GLeeLink_GL_ARB_texture_env_dot3; + __GLeeGLLoadFunction[21]=__GLeeLink_GL_ARB_texture_mirrored_repeat; + __GLeeGLLoadFunction[22]=__GLeeLink_GL_ARB_depth_texture; + __GLeeGLLoadFunction[23]=__GLeeLink_GL_ARB_shadow; + __GLeeGLLoadFunction[24]=__GLeeLink_GL_ARB_shadow_ambient; + __GLeeGLLoadFunction[25]=__GLeeLink_GL_ARB_window_pos; + __GLeeGLLoadFunction[26]=__GLeeLink_GL_ARB_vertex_program; + __GLeeGLLoadFunction[27]=__GLeeLink_GL_ARB_fragment_program; + __GLeeGLLoadFunction[28]=__GLeeLink_GL_ARB_vertex_buffer_object; + __GLeeGLLoadFunction[29]=__GLeeLink_GL_ARB_occlusion_query; + __GLeeGLLoadFunction[30]=__GLeeLink_GL_ARB_shader_objects; + __GLeeGLLoadFunction[31]=__GLeeLink_GL_ARB_vertex_shader; + __GLeeGLLoadFunction[32]=__GLeeLink_GL_ARB_fragment_shader; + __GLeeGLLoadFunction[33]=__GLeeLink_GL_ARB_shading_language_100; + __GLeeGLLoadFunction[34]=__GLeeLink_GL_ARB_texture_non_power_of_two; + __GLeeGLLoadFunction[35]=__GLeeLink_GL_ARB_point_sprite; + __GLeeGLLoadFunction[36]=__GLeeLink_GL_ARB_fragment_program_shadow; + __GLeeGLLoadFunction[37]=__GLeeLink_GL_ARB_draw_buffers; + __GLeeGLLoadFunction[38]=__GLeeLink_GL_ARB_texture_rectangle; + __GLeeGLLoadFunction[39]=__GLeeLink_GL_ARB_color_buffer_float; + __GLeeGLLoadFunction[40]=__GLeeLink_GL_ARB_half_float_pixel; + __GLeeGLLoadFunction[41]=__GLeeLink_GL_ARB_texture_float; + __GLeeGLLoadFunction[42]=__GLeeLink_GL_ARB_pixel_buffer_object; + __GLeeGLLoadFunction[43]=__GLeeLink_GL_ARB_depth_buffer_float; + __GLeeGLLoadFunction[44]=__GLeeLink_GL_ARB_drawinstanced; + __GLeeGLLoadFunction[45]=__GLeeLink_GL_ARB_framebuffer_object; + __GLeeGLLoadFunction[46]=__GLeeLink_GL_ARB_framebuffer_sRGB; + __GLeeGLLoadFunction[47]=__GLeeLink_GL_ARB_geometry_shader4; + __GLeeGLLoadFunction[48]=__GLeeLink_GL_ARB_half_float_vertex; + __GLeeGLLoadFunction[49]=__GLeeLink_GL_ARBinstanced_arrays; + __GLeeGLLoadFunction[50]=__GLeeLink_GL_ARB_map_buffer_range; + __GLeeGLLoadFunction[51]=__GLeeLink_GL_ARB_texture_buffer_object; + __GLeeGLLoadFunction[52]=__GLeeLink_GL_ARB_texture_compression_rgtc; + __GLeeGLLoadFunction[53]=__GLeeLink_GL_ARB_texture_rg; + __GLeeGLLoadFunction[54]=__GLeeLink_GL_ARB_vertex_array_object; + __GLeeGLLoadFunction[55]=__GLeeLink_GL_EXT_abgr; + __GLeeGLLoadFunction[56]=__GLeeLink_GL_EXT_blend_color; + __GLeeGLLoadFunction[57]=__GLeeLink_GL_EXT_polygon_offset; + __GLeeGLLoadFunction[58]=__GLeeLink_GL_EXT_texture; + __GLeeGLLoadFunction[59]=__GLeeLink_GL_EXT_texture3D; + __GLeeGLLoadFunction[60]=__GLeeLink_GL_SGIS_texture_filter4; + __GLeeGLLoadFunction[61]=__GLeeLink_GL_EXT_subtexture; + __GLeeGLLoadFunction[62]=__GLeeLink_GL_EXT_copy_texture; + __GLeeGLLoadFunction[63]=__GLeeLink_GL_EXT_histogram; + __GLeeGLLoadFunction[64]=__GLeeLink_GL_EXT_convolution; + __GLeeGLLoadFunction[65]=__GLeeLink_GL_SGI_color_matrix; + __GLeeGLLoadFunction[66]=__GLeeLink_GL_SGI_color_table; + __GLeeGLLoadFunction[67]=__GLeeLink_GL_SGIS_pixel_texture; + __GLeeGLLoadFunction[68]=__GLeeLink_GL_SGIX_pixel_texture; + __GLeeGLLoadFunction[69]=__GLeeLink_GL_SGIS_texture4D; + __GLeeGLLoadFunction[70]=__GLeeLink_GL_SGI_texture_color_table; + __GLeeGLLoadFunction[71]=__GLeeLink_GL_EXT_cmyka; + __GLeeGLLoadFunction[72]=__GLeeLink_GL_EXT_texture_object; + __GLeeGLLoadFunction[73]=__GLeeLink_GL_SGIS_detail_texture; + __GLeeGLLoadFunction[74]=__GLeeLink_GL_SGIS_sharpen_texture; + __GLeeGLLoadFunction[75]=__GLeeLink_GL_EXT_packed_pixels; + __GLeeGLLoadFunction[76]=__GLeeLink_GL_SGIS_texture_lod; + __GLeeGLLoadFunction[77]=__GLeeLink_GL_SGIS_multisample; + __GLeeGLLoadFunction[78]=__GLeeLink_GL_EXT_rescale_normal; + __GLeeGLLoadFunction[79]=__GLeeLink_GL_EXT_vertex_array; + __GLeeGLLoadFunction[80]=__GLeeLink_GL_EXT_misc_attribute; + __GLeeGLLoadFunction[81]=__GLeeLink_GL_SGIS_generate_mipmap; + __GLeeGLLoadFunction[82]=__GLeeLink_GL_SGIX_clipmap; + __GLeeGLLoadFunction[83]=__GLeeLink_GL_SGIX_shadow; + __GLeeGLLoadFunction[84]=__GLeeLink_GL_SGIS_texture_edge_clamp; + __GLeeGLLoadFunction[85]=__GLeeLink_GL_SGIS_texture_border_clamp; + __GLeeGLLoadFunction[86]=__GLeeLink_GL_EXT_blend_minmax; + __GLeeGLLoadFunction[87]=__GLeeLink_GL_EXT_blend_subtract; + __GLeeGLLoadFunction[88]=__GLeeLink_GL_EXT_blend_logic_op; + __GLeeGLLoadFunction[89]=__GLeeLink_GL_SGIX_interlace; + __GLeeGLLoadFunction[90]=__GLeeLink_GL_SGIX_pixel_tiles; + __GLeeGLLoadFunction[91]=__GLeeLink_GL_SGIS_texture_select; + __GLeeGLLoadFunction[92]=__GLeeLink_GL_SGIX_sprite; + __GLeeGLLoadFunction[93]=__GLeeLink_GL_SGIX_texture_multi_buffer; + __GLeeGLLoadFunction[94]=__GLeeLink_GL_EXT_point_parameters; + __GLeeGLLoadFunction[95]=__GLeeLink_GL_SGIS_point_parameters; + __GLeeGLLoadFunction[96]=__GLeeLink_GL_SGIX_instruments; + __GLeeGLLoadFunction[97]=__GLeeLink_GL_SGIX_texture_scale_bias; + __GLeeGLLoadFunction[98]=__GLeeLink_GL_SGIX_framezoom; + __GLeeGLLoadFunction[99]=__GLeeLink_GL_SGIX_tag_sample_buffer; + __GLeeGLLoadFunction[100]=__GLeeLink_GL_FfdMaskSGIX; + __GLeeGLLoadFunction[101]=__GLeeLink_GL_SGIX_polynomial_ffd; + __GLeeGLLoadFunction[102]=__GLeeLink_GL_SGIX_reference_plane; + __GLeeGLLoadFunction[103]=__GLeeLink_GL_SGIX_flush_raster; + __GLeeGLLoadFunction[104]=__GLeeLink_GL_SGIX_depth_texture; + __GLeeGLLoadFunction[105]=__GLeeLink_GL_SGIS_fog_function; + __GLeeGLLoadFunction[106]=__GLeeLink_GL_SGIX_fog_offset; + __GLeeGLLoadFunction[107]=__GLeeLink_GL_HP_image_transform; + __GLeeGLLoadFunction[108]=__GLeeLink_GL_HP_convolution_border_modes; + __GLeeGLLoadFunction[109]=__GLeeLink_GL_INGR_palette_buffer; + __GLeeGLLoadFunction[110]=__GLeeLink_GL_SGIX_texture_add_env; + __GLeeGLLoadFunction[111]=__GLeeLink_GL_EXT_color_subtable; + __GLeeGLLoadFunction[112]=__GLeeLink_GL_PGI_vertex_hints; + __GLeeGLLoadFunction[113]=__GLeeLink_GL_PGI_misc_hints; + __GLeeGLLoadFunction[114]=__GLeeLink_GL_EXT_paletted_texture; + __GLeeGLLoadFunction[115]=__GLeeLink_GL_EXT_clip_volume_hint; + __GLeeGLLoadFunction[116]=__GLeeLink_GL_SGIX_list_priority; + __GLeeGLLoadFunction[117]=__GLeeLink_GL_SGIX_ir_instrument1; + __GLeeGLLoadFunction[118]=__GLeeLink_GL_SGIX_calligraphic_fragment; + __GLeeGLLoadFunction[119]=__GLeeLink_GL_SGIX_texture_lod_bias; + __GLeeGLLoadFunction[120]=__GLeeLink_GL_SGIX_shadow_ambient; + __GLeeGLLoadFunction[121]=__GLeeLink_GL_EXT_index_texture; + __GLeeGLLoadFunction[122]=__GLeeLink_GL_EXT_index_material; + __GLeeGLLoadFunction[123]=__GLeeLink_GL_EXT_index_func; + __GLeeGLLoadFunction[124]=__GLeeLink_GL_EXT_index_array_formats; + __GLeeGLLoadFunction[125]=__GLeeLink_GL_EXT_compiled_vertex_array; + __GLeeGLLoadFunction[126]=__GLeeLink_GL_EXT_cull_vertex; + __GLeeGLLoadFunction[127]=__GLeeLink_GL_SGIX_ycrcb; + __GLeeGLLoadFunction[128]=__GLeeLink_GL_SGIX_fragment_lighting; + __GLeeGLLoadFunction[129]=__GLeeLink_GL_IBM_rasterpos_clip; + __GLeeGLLoadFunction[130]=__GLeeLink_GL_HP_texture_lighting; + __GLeeGLLoadFunction[131]=__GLeeLink_GL_EXT_draw_range_elements; + __GLeeGLLoadFunction[132]=__GLeeLink_GL_WIN_phong_shading; + __GLeeGLLoadFunction[133]=__GLeeLink_GL_WIN_specular_fog; + __GLeeGLLoadFunction[134]=__GLeeLink_GL_EXT_light_texture; + __GLeeGLLoadFunction[135]=__GLeeLink_GL_SGIX_blend_alpha_minmax; + __GLeeGLLoadFunction[136]=__GLeeLink_GL_SGIX_impact_pixel_texture; + __GLeeGLLoadFunction[137]=__GLeeLink_GL_EXT_bgra; + __GLeeGLLoadFunction[138]=__GLeeLink_GL_SGIX_async; + __GLeeGLLoadFunction[139]=__GLeeLink_GL_SGIX_async_pixel; + __GLeeGLLoadFunction[140]=__GLeeLink_GL_SGIX_async_histogram; + __GLeeGLLoadFunction[141]=__GLeeLink_GL_INTEL_texture_scissor; + __GLeeGLLoadFunction[142]=__GLeeLink_GL_INTEL_parallel_arrays; + __GLeeGLLoadFunction[143]=__GLeeLink_GL_HP_occlusion_test; + __GLeeGLLoadFunction[144]=__GLeeLink_GL_EXT_pixel_transform; + __GLeeGLLoadFunction[145]=__GLeeLink_GL_EXT_pixel_transform_color_table; + __GLeeGLLoadFunction[146]=__GLeeLink_GL_EXT_shared_texture_palette; + __GLeeGLLoadFunction[147]=__GLeeLink_GL_EXT_separate_specular_color; + __GLeeGLLoadFunction[148]=__GLeeLink_GL_EXT_secondary_color; + __GLeeGLLoadFunction[149]=__GLeeLink_GL_EXT_texture_perturb_normal; + __GLeeGLLoadFunction[150]=__GLeeLink_GL_EXT_multi_draw_arrays; + __GLeeGLLoadFunction[151]=__GLeeLink_GL_EXT_fog_coord; + __GLeeGLLoadFunction[152]=__GLeeLink_GL_REND_screen_coordinates; + __GLeeGLLoadFunction[153]=__GLeeLink_GL_EXT_coordinate_frame; + __GLeeGLLoadFunction[154]=__GLeeLink_GL_EXT_texture_env_combine; + __GLeeGLLoadFunction[155]=__GLeeLink_GL_APPLE_specular_vector; + __GLeeGLLoadFunction[156]=__GLeeLink_GL_APPLE_transform_hint; + __GLeeGLLoadFunction[157]=__GLeeLink_GL_SGIX_fog_scale; + __GLeeGLLoadFunction[158]=__GLeeLink_GL_SUNX_constant_data; + __GLeeGLLoadFunction[159]=__GLeeLink_GL_SUN_global_alpha; + __GLeeGLLoadFunction[160]=__GLeeLink_GL_SUN_triangle_list; + __GLeeGLLoadFunction[161]=__GLeeLink_GL_SUN_vertex; + __GLeeGLLoadFunction[162]=__GLeeLink_GL_EXT_blend_func_separate; + __GLeeGLLoadFunction[163]=__GLeeLink_GL_INGR_color_clamp; + __GLeeGLLoadFunction[164]=__GLeeLink_GL_INGR_interlace_read; + __GLeeGLLoadFunction[165]=__GLeeLink_GL_EXT_stencil_wrap; + __GLeeGLLoadFunction[166]=__GLeeLink_GL_EXT_422_pixels; + __GLeeGLLoadFunction[167]=__GLeeLink_GL_NV_texgen_reflection; + __GLeeGLLoadFunction[168]=__GLeeLink_GL_EXT_texture_cube_map; + __GLeeGLLoadFunction[169]=__GLeeLink_GL_SUN_convolution_border_modes; + __GLeeGLLoadFunction[170]=__GLeeLink_GL_EXT_texture_env_add; + __GLeeGLLoadFunction[171]=__GLeeLink_GL_EXT_texture_lod_bias; + __GLeeGLLoadFunction[172]=__GLeeLink_GL_EXT_texture_filter_anisotropic; + __GLeeGLLoadFunction[173]=__GLeeLink_GL_EXT_vertex_weighting; + __GLeeGLLoadFunction[174]=__GLeeLink_GL_NV_light_max_exponent; + __GLeeGLLoadFunction[175]=__GLeeLink_GL_NV_vertex_array_range; + __GLeeGLLoadFunction[176]=__GLeeLink_GL_NV_register_combiners; + __GLeeGLLoadFunction[177]=__GLeeLink_GL_NV_fog_distance; + __GLeeGLLoadFunction[178]=__GLeeLink_GL_NV_texgen_emboss; + __GLeeGLLoadFunction[179]=__GLeeLink_GL_NV_blend_square; + __GLeeGLLoadFunction[180]=__GLeeLink_GL_NV_texture_env_combine4; + __GLeeGLLoadFunction[181]=__GLeeLink_GL_MESA_resize_buffers; + __GLeeGLLoadFunction[182]=__GLeeLink_GL_MESA_window_pos; + __GLeeGLLoadFunction[183]=__GLeeLink_GL_EXT_texture_compression_s3tc; + __GLeeGLLoadFunction[184]=__GLeeLink_GL_IBM_cull_vertex; + __GLeeGLLoadFunction[185]=__GLeeLink_GL_IBM_multimode_draw_arrays; + __GLeeGLLoadFunction[186]=__GLeeLink_GL_IBM_vertex_array_lists; + __GLeeGLLoadFunction[187]=__GLeeLink_GL_SGIX_subsample; + __GLeeGLLoadFunction[188]=__GLeeLink_GL_SGIX_ycrcb_subsample; + __GLeeGLLoadFunction[189]=__GLeeLink_GL_SGIX_ycrcba; + __GLeeGLLoadFunction[190]=__GLeeLink_GL_SGI_depth_pass_instrument; + __GLeeGLLoadFunction[191]=__GLeeLink_GL_3DFX_texture_compression_FXT1; + __GLeeGLLoadFunction[192]=__GLeeLink_GL_3DFX_multisample; + __GLeeGLLoadFunction[193]=__GLeeLink_GL_3DFX_tbuffer; + __GLeeGLLoadFunction[194]=__GLeeLink_GL_EXT_multisample; + __GLeeGLLoadFunction[195]=__GLeeLink_GL_SGIX_vertex_preclip; + __GLeeGLLoadFunction[196]=__GLeeLink_GL_SGIX_convolution_accuracy; + __GLeeGLLoadFunction[197]=__GLeeLink_GL_SGIX_resample; + __GLeeGLLoadFunction[198]=__GLeeLink_GL_SGIS_point_line_texgen; + __GLeeGLLoadFunction[199]=__GLeeLink_GL_SGIS_texture_color_mask; + __GLeeGLLoadFunction[200]=__GLeeLink_GL_EXT_texture_env_dot3; + __GLeeGLLoadFunction[201]=__GLeeLink_GL_ATI_texture_mirror_once; + __GLeeGLLoadFunction[202]=__GLeeLink_GL_NV_fence; + __GLeeGLLoadFunction[203]=__GLeeLink_GL_IBM_texture_mirrored_repeat; + __GLeeGLLoadFunction[204]=__GLeeLink_GL_NV_evaluators; + __GLeeGLLoadFunction[205]=__GLeeLink_GL_NV_packed_depth_stencil; + __GLeeGLLoadFunction[206]=__GLeeLink_GL_NV_register_combiners2; + __GLeeGLLoadFunction[207]=__GLeeLink_GL_NV_texture_compression_vtc; + __GLeeGLLoadFunction[208]=__GLeeLink_GL_NV_texture_rectangle; + __GLeeGLLoadFunction[209]=__GLeeLink_GL_NV_texture_shader; + __GLeeGLLoadFunction[210]=__GLeeLink_GL_NV_texture_shader2; + __GLeeGLLoadFunction[211]=__GLeeLink_GL_NV_vertex_array_range2; + __GLeeGLLoadFunction[212]=__GLeeLink_GL_NV_vertex_program; + __GLeeGLLoadFunction[213]=__GLeeLink_GL_SGIX_texture_coordinate_clamp; + __GLeeGLLoadFunction[214]=__GLeeLink_GL_SGIX_scalebias_hint; + __GLeeGLLoadFunction[215]=__GLeeLink_GL_OML_interlace; + __GLeeGLLoadFunction[216]=__GLeeLink_GL_OML_subsample; + __GLeeGLLoadFunction[217]=__GLeeLink_GL_OML_resample; + __GLeeGLLoadFunction[218]=__GLeeLink_GL_NV_copy_depth_to_color; + __GLeeGLLoadFunction[219]=__GLeeLink_GL_ATI_envmap_bumpmap; + __GLeeGLLoadFunction[220]=__GLeeLink_GL_ATI_fragment_shader; + __GLeeGLLoadFunction[221]=__GLeeLink_GL_ATI_pn_triangles; + __GLeeGLLoadFunction[222]=__GLeeLink_GL_ATI_vertex_array_object; + __GLeeGLLoadFunction[223]=__GLeeLink_GL_EXT_vertex_shader; + __GLeeGLLoadFunction[224]=__GLeeLink_GL_ATI_vertex_streams; + __GLeeGLLoadFunction[225]=__GLeeLink_GL_ATI_element_array; + __GLeeGLLoadFunction[226]=__GLeeLink_GL_SUN_mesh_array; + __GLeeGLLoadFunction[227]=__GLeeLink_GL_SUN_slice_accum; + __GLeeGLLoadFunction[228]=__GLeeLink_GL_NV_multisample_filter_hint; + __GLeeGLLoadFunction[229]=__GLeeLink_GL_NV_depth_clamp; + __GLeeGLLoadFunction[230]=__GLeeLink_GL_NV_occlusion_query; + __GLeeGLLoadFunction[231]=__GLeeLink_GL_NV_point_sprite; + __GLeeGLLoadFunction[232]=__GLeeLink_GL_NV_texture_shader3; + __GLeeGLLoadFunction[233]=__GLeeLink_GL_NV_vertex_program1_1; + __GLeeGLLoadFunction[234]=__GLeeLink_GL_EXT_shadow_funcs; + __GLeeGLLoadFunction[235]=__GLeeLink_GL_EXT_stencil_two_side; + __GLeeGLLoadFunction[236]=__GLeeLink_GL_ATI_text_fragment_shader; + __GLeeGLLoadFunction[237]=__GLeeLink_GL_APPLE_client_storage; + __GLeeGLLoadFunction[238]=__GLeeLink_GL_APPLE_element_array; + __GLeeGLLoadFunction[239]=__GLeeLink_GL_APPLE_fence; + __GLeeGLLoadFunction[240]=__GLeeLink_GL_APPLE_vertex_array_object; + __GLeeGLLoadFunction[241]=__GLeeLink_GL_APPLE_vertex_array_range; + __GLeeGLLoadFunction[242]=__GLeeLink_GL_APPLE_ycbcr_422; + __GLeeGLLoadFunction[243]=__GLeeLink_GL_S3_s3tc; + __GLeeGLLoadFunction[244]=__GLeeLink_GL_ATI_draw_buffers; + __GLeeGLLoadFunction[245]=__GLeeLink_GL_ATI_pixel_format_float; + __GLeeGLLoadFunction[246]=__GLeeLink_GL_ATI_texture_env_combine3; + __GLeeGLLoadFunction[247]=__GLeeLink_GL_ATI_texture_float; + __GLeeGLLoadFunction[248]=__GLeeLink_GL_NV_float_buffer; + __GLeeGLLoadFunction[249]=__GLeeLink_GL_NV_fragment_program; + __GLeeGLLoadFunction[250]=__GLeeLink_GL_NV_half_float; + __GLeeGLLoadFunction[251]=__GLeeLink_GL_NV_pixel_data_range; + __GLeeGLLoadFunction[252]=__GLeeLink_GL_NV_primitive_restart; + __GLeeGLLoadFunction[253]=__GLeeLink_GL_NV_texture_expand_normal; + __GLeeGLLoadFunction[254]=__GLeeLink_GL_NV_vertex_program2; + __GLeeGLLoadFunction[255]=__GLeeLink_GL_ATI_map_object_buffer; + __GLeeGLLoadFunction[256]=__GLeeLink_GL_ATI_separate_stencil; + __GLeeGLLoadFunction[257]=__GLeeLink_GL_ATI_vertex_attrib_array_object; + __GLeeGLLoadFunction[258]=__GLeeLink_GL_OES_read_format; + __GLeeGLLoadFunction[259]=__GLeeLink_GL_EXT_depth_bounds_test; + __GLeeGLLoadFunction[260]=__GLeeLink_GL_EXT_texture_mirror_clamp; + __GLeeGLLoadFunction[261]=__GLeeLink_GL_EXT_blend_equation_separate; + __GLeeGLLoadFunction[262]=__GLeeLink_GL_MESA_pack_invert; + __GLeeGLLoadFunction[263]=__GLeeLink_GL_MESA_ycbcr_texture; + __GLeeGLLoadFunction[264]=__GLeeLink_GL_EXT_pixel_buffer_object; + __GLeeGLLoadFunction[265]=__GLeeLink_GL_NV_fragment_program_option; + __GLeeGLLoadFunction[266]=__GLeeLink_GL_NV_fragment_program2; + __GLeeGLLoadFunction[267]=__GLeeLink_GL_NV_vertex_program2_option; + __GLeeGLLoadFunction[268]=__GLeeLink_GL_NV_vertex_program3; + __GLeeGLLoadFunction[269]=__GLeeLink_GL_EXT_framebuffer_object; + __GLeeGLLoadFunction[270]=__GLeeLink_GL_GREMEDY_string_marker; + __GLeeGLLoadFunction[271]=__GLeeLink_GL_EXT_packed_depth_stencil; + __GLeeGLLoadFunction[272]=__GLeeLink_GL_EXT_stencil_clear_tag; + __GLeeGLLoadFunction[273]=__GLeeLink_GL_EXT_texture_sRGB; + __GLeeGLLoadFunction[274]=__GLeeLink_GL_EXT_framebuffer_blit; + __GLeeGLLoadFunction[275]=__GLeeLink_GL_EXT_framebuffer_multisample; + __GLeeGLLoadFunction[276]=__GLeeLink_GL_MESAX_texture_stack; + __GLeeGLLoadFunction[277]=__GLeeLink_GL_EXT_timer_query; + __GLeeGLLoadFunction[278]=__GLeeLink_GL_EXT_gpu_program_parameters; + __GLeeGLLoadFunction[279]=__GLeeLink_GL_APPLE_flush_buffer_range; + __GLeeGLLoadFunction[280]=__GLeeLink_GL_NV_gpu_program4; + __GLeeGLLoadFunction[281]=__GLeeLink_GL_NV_geometry_program4; + __GLeeGLLoadFunction[282]=__GLeeLink_GL_EXT_geometry_shader4; + __GLeeGLLoadFunction[283]=__GLeeLink_GL_NV_vertex_program4; + __GLeeGLLoadFunction[284]=__GLeeLink_GL_EXT_gpu_shader4; + __GLeeGLLoadFunction[285]=__GLeeLink_GL_EXT_drawinstanced; + __GLeeGLLoadFunction[286]=__GLeeLink_GL_EXT_packed_float; + __GLeeGLLoadFunction[287]=__GLeeLink_GL_EXT_texture_array; + __GLeeGLLoadFunction[288]=__GLeeLink_GL_EXT_texture_buffer_object; + __GLeeGLLoadFunction[289]=__GLeeLink_GL_EXT_texture_compression_latc; + __GLeeGLLoadFunction[290]=__GLeeLink_GL_EXT_texture_compression_rgtc; + __GLeeGLLoadFunction[291]=__GLeeLink_GL_EXT_texture_shared_exponent; + __GLeeGLLoadFunction[292]=__GLeeLink_GL_NV_depth_buffer_float; + __GLeeGLLoadFunction[293]=__GLeeLink_GL_NV_fragment_program4; + __GLeeGLLoadFunction[294]=__GLeeLink_GL_NV_framebuffer_multisample_coverage; + __GLeeGLLoadFunction[295]=__GLeeLink_GL_EXT_framebuffer_sRGB; + __GLeeGLLoadFunction[296]=__GLeeLink_GL_NV_geometry_shader4; + __GLeeGLLoadFunction[297]=__GLeeLink_GL_NV_parameter_buffer_object; + __GLeeGLLoadFunction[298]=__GLeeLink_GL_EXT_draw_buffers2; + __GLeeGLLoadFunction[299]=__GLeeLink_GL_NV_transform_feedback; + __GLeeGLLoadFunction[300]=__GLeeLink_GL_EXT_bindable_uniform; + __GLeeGLLoadFunction[301]=__GLeeLink_GL_EXT_texture_integer; + __GLeeGLLoadFunction[302]=__GLeeLink_GL_GREMEDY_frame_terminator; + __GLeeGLLoadFunction[303]=__GLeeLink_GL_NV_conditional_render; + __GLeeGLLoadFunction[304]=__GLeeLink_GL_NV_present_video; + __GLeeGLLoadFunction[305]=__GLeeLink_GL_EXT_transform_feedback; + __GLeeGLLoadFunction[306]=__GLeeLink_GL_EXT_direct_state_access; + __GLeeGLLoadFunction[307]=__GLeeLink_GL_EXT_vertex_array_bgra; + __GLeeGLLoadFunction[308]=__GLeeLink_GL_SGIX_texture_select; + __GLeeGLLoadFunction[309]=__GLeeLink_GL_INGR_blend_func_separate; + __GLeeGLLoadFunction[310]=__GLeeLink_GL_SGIX_depth_pass_instrument; + __GLeeGLLoadFunction[311]=__GLeeLink_GL_SGIX_igloo_interface; + __GLeeGLLoadFunction[312]=__GLeeLink_GL_EXT_fragment_lighting; + __GLeeGLLoadFunction[313]=__GLeeLink_GL_EXT_scene_marker; + __GLeeGLLoadFunction[314]=__GLeeLink_GL_EXT_texture_compression_dxt1; + __GLeeGLLoadFunction[315]=__GLeeLink_GL_EXT_texture_env; + __GLeeGLLoadFunction[316]=__GLeeLink_GL_IBM_static_data; + __GLeeGLLoadFunction[317]=__GLeeLink_GL_OES_byte_coordinates; + __GLeeGLLoadFunction[318]=__GLeeLink_GL_OES_compressed_paletted_texture; + __GLeeGLLoadFunction[319]=__GLeeLink_GL_OES_single_precision; + __GLeeGLLoadFunction[320]=__GLeeLink_GL_SGIX_pixel_texture_bits; + __GLeeGLLoadFunction[321]=__GLeeLink_GL_SGIX_texture_range; +} + +#ifdef WIN32 +GLuint __GLeeLink_WGL_ARB_buffer_region(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_ARB_buffer_region + if ((pwglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC) __GLeeGetProcAddress("wglCreateBufferRegionARB"))!=0) nLinked++; + if ((pwglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC) __GLeeGetProcAddress("wglDeleteBufferRegionARB"))!=0) nLinked++; + if ((pwglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC) __GLeeGetProcAddress("wglSaveBufferRegionARB"))!=0) nLinked++; + if ((pwglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC) __GLeeGetProcAddress("wglRestoreBufferRegionARB"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_ARB_multisample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_ARB_extensions_string(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_ARB_extensions_string + if ((pwglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) __GLeeGetProcAddress("wglGetExtensionsStringARB"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_ARB_pixel_format(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_ARB_pixel_format + if ((pwglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC) __GLeeGetProcAddress("wglGetPixelFormatAttribivARB"))!=0) nLinked++; + if ((pwglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC) __GLeeGetProcAddress("wglGetPixelFormatAttribfvARB"))!=0) nLinked++; + if ((pwglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC) __GLeeGetProcAddress("wglChoosePixelFormatARB"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_ARB_make_current_read(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_ARB_make_current_read + if ((pwglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC) __GLeeGetProcAddress("wglMakeContextCurrentARB"))!=0) nLinked++; + if ((pwglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC) __GLeeGetProcAddress("wglGetCurrentReadDCARB"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_ARB_pbuffer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_ARB_pbuffer + if ((pwglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC) __GLeeGetProcAddress("wglCreatePbufferARB"))!=0) nLinked++; + if ((pwglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC) __GLeeGetProcAddress("wglGetPbufferDCARB"))!=0) nLinked++; + if ((pwglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC) __GLeeGetProcAddress("wglReleasePbufferDCARB"))!=0) nLinked++; + if ((pwglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC) __GLeeGetProcAddress("wglDestroyPbufferARB"))!=0) nLinked++; + if ((pwglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC) __GLeeGetProcAddress("wglQueryPbufferARB"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_ARB_render_texture(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_ARB_render_texture + if ((pwglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC) __GLeeGetProcAddress("wglBindTexImageARB"))!=0) nLinked++; + if ((pwglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC) __GLeeGetProcAddress("wglReleaseTexImageARB"))!=0) nLinked++; + if ((pwglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC) __GLeeGetProcAddress("wglSetPbufferAttribARB"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_ARB_pixel_format_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_ARB_create_context(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_ARB_create_context + if ((pwglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) __GLeeGetProcAddress("wglCreateContextAttribsARB"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_EXT_make_current_read(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_EXT_make_current_read + if ((pwglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC) __GLeeGetProcAddress("wglMakeContextCurrentEXT"))!=0) nLinked++; + if ((pwglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC) __GLeeGetProcAddress("wglGetCurrentReadDCEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_EXT_pixel_format(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_EXT_pixel_format + if ((pwglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) __GLeeGetProcAddress("wglGetPixelFormatAttribivEXT"))!=0) nLinked++; + if ((pwglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) __GLeeGetProcAddress("wglGetPixelFormatAttribfvEXT"))!=0) nLinked++; + if ((pwglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC) __GLeeGetProcAddress("wglChoosePixelFormatEXT"))!=0) nLinked++; +#endif + if (nLinked==3) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_EXT_pbuffer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_EXT_pbuffer + if ((pwglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC) __GLeeGetProcAddress("wglCreatePbufferEXT"))!=0) nLinked++; + if ((pwglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC) __GLeeGetProcAddress("wglGetPbufferDCEXT"))!=0) nLinked++; + if ((pwglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC) __GLeeGetProcAddress("wglReleasePbufferDCEXT"))!=0) nLinked++; + if ((pwglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC) __GLeeGetProcAddress("wglDestroyPbufferEXT"))!=0) nLinked++; + if ((pwglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC) __GLeeGetProcAddress("wglQueryPbufferEXT"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_EXT_depth_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_3DFX_multisample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_EXT_multisample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_I3D_digital_video_control(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_I3D_digital_video_control + if ((pwglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) __GLeeGetProcAddress("wglGetDigitalVideoParametersI3D"))!=0) nLinked++; + if ((pwglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) __GLeeGetProcAddress("wglSetDigitalVideoParametersI3D"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_I3D_gamma(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_I3D_gamma + if ((pwglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) __GLeeGetProcAddress("wglGetGammaTableParametersI3D"))!=0) nLinked++; + if ((pwglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) __GLeeGetProcAddress("wglSetGammaTableParametersI3D"))!=0) nLinked++; + if ((pwglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC) __GLeeGetProcAddress("wglGetGammaTableI3D"))!=0) nLinked++; + if ((pwglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC) __GLeeGetProcAddress("wglSetGammaTableI3D"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_I3D_genlock(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_I3D_genlock + if ((pwglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC) __GLeeGetProcAddress("wglEnableGenlockI3D"))!=0) nLinked++; + if ((pwglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC) __GLeeGetProcAddress("wglDisableGenlockI3D"))!=0) nLinked++; + if ((pwglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC) __GLeeGetProcAddress("wglIsEnabledGenlockI3D"))!=0) nLinked++; + if ((pwglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC) __GLeeGetProcAddress("wglGenlockSourceI3D"))!=0) nLinked++; + if ((pwglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC) __GLeeGetProcAddress("wglGetGenlockSourceI3D"))!=0) nLinked++; + if ((pwglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC) __GLeeGetProcAddress("wglGenlockSourceEdgeI3D"))!=0) nLinked++; + if ((pwglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) __GLeeGetProcAddress("wglGetGenlockSourceEdgeI3D"))!=0) nLinked++; + if ((pwglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC) __GLeeGetProcAddress("wglGenlockSampleRateI3D"))!=0) nLinked++; + if ((pwglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC) __GLeeGetProcAddress("wglGetGenlockSampleRateI3D"))!=0) nLinked++; + if ((pwglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC) __GLeeGetProcAddress("wglGenlockSourceDelayI3D"))!=0) nLinked++; + if ((pwglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) __GLeeGetProcAddress("wglGetGenlockSourceDelayI3D"))!=0) nLinked++; + if ((pwglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) __GLeeGetProcAddress("wglQueryGenlockMaxSourceDelayI3D"))!=0) nLinked++; +#endif + if (nLinked==12) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_I3D_image_buffer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_I3D_image_buffer + if ((pwglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC) __GLeeGetProcAddress("wglCreateImageBufferI3D"))!=0) nLinked++; + if ((pwglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC) __GLeeGetProcAddress("wglDestroyImageBufferI3D"))!=0) nLinked++; + if ((pwglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) __GLeeGetProcAddress("wglAssociateImageBufferEventsI3D"))!=0) nLinked++; + if ((pwglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) __GLeeGetProcAddress("wglReleaseImageBufferEventsI3D"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_I3D_swap_frame_lock(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_I3D_swap_frame_lock + if ((pwglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC) __GLeeGetProcAddress("wglEnableFrameLockI3D"))!=0) nLinked++; + if ((pwglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC) __GLeeGetProcAddress("wglDisableFrameLockI3D"))!=0) nLinked++; + if ((pwglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC) __GLeeGetProcAddress("wglIsEnabledFrameLockI3D"))!=0) nLinked++; + if ((pwglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC) __GLeeGetProcAddress("wglQueryFrameLockMasterI3D"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_NV_render_depth_texture(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_NV_render_texture_rectangle(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_ATI_pixel_format_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_NV_float_buffer(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_3DL_stereo_control(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_EXT_pixel_format_packed_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_EXT_framebuffer_sRGB(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_NV_present_video(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_NV_video_out(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_NV_swap_group(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_WGL_EXT_display_color_table(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_EXT_display_color_table + if ((pwglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) __GLeeGetProcAddress("wglCreateDisplayColorTableEXT"))!=0) nLinked++; + if ((pwglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) __GLeeGetProcAddress("wglLoadDisplayColorTableEXT"))!=0) nLinked++; + if ((pwglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) __GLeeGetProcAddress("wglBindDisplayColorTableEXT"))!=0) nLinked++; + if ((pwglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) __GLeeGetProcAddress("wglDestroyDisplayColorTableEXT"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_EXT_extensions_string(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_EXT_extensions_string + if ((pwglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) __GLeeGetProcAddress("wglGetExtensionsStringEXT"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_EXT_swap_control(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_EXT_swap_control + if ((pwglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) __GLeeGetProcAddress("wglSwapIntervalEXT"))!=0) nLinked++; + if ((pwglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC) __GLeeGetProcAddress("wglGetSwapIntervalEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_NV_vertex_array_range(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_NV_vertex_array_range + if ((pwglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC) __GLeeGetProcAddress("wglAllocateMemoryNV"))!=0) nLinked++; + if ((pwglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC) __GLeeGetProcAddress("wglFreeMemoryNV"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_OML_sync_control(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_OML_sync_control + if ((pwglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC) __GLeeGetProcAddress("wglGetSyncValuesOML"))!=0) nLinked++; + if ((pwglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC) __GLeeGetProcAddress("wglGetMscRateOML"))!=0) nLinked++; + if ((pwglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC) __GLeeGetProcAddress("wglSwapBuffersMscOML"))!=0) nLinked++; + if ((pwglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) __GLeeGetProcAddress("wglSwapLayerBuffersMscOML"))!=0) nLinked++; + if ((pwglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC) __GLeeGetProcAddress("wglWaitForMscOML"))!=0) nLinked++; + if ((pwglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC) __GLeeGetProcAddress("wglWaitForSbcOML"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_I3D_swap_frame_usage(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_I3D_swap_frame_usage + if ((pwglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC) __GLeeGetProcAddress("wglGetFrameUsageI3D"))!=0) nLinked++; + if ((pwglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC) __GLeeGetProcAddress("wglBeginFrameTrackingI3D"))!=0) nLinked++; + if ((pwglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC) __GLeeGetProcAddress("wglEndFrameTrackingI3D"))!=0) nLinked++; + if ((pwglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC) __GLeeGetProcAddress("wglQueryFrameTrackingI3D"))!=0) nLinked++; +#endif + if (nLinked==4) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_WGL_NV_video_output(void) +{ + GLint nLinked=0; +#ifdef __GLEE_WGL_NV_video_output + if ((pwglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC) __GLeeGetProcAddress("wglGetVideoDeviceNV"))!=0) nLinked++; + if ((pwglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC) __GLeeGetProcAddress("wglReleaseVideoDeviceNV"))!=0) nLinked++; + if ((pwglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC) __GLeeGetProcAddress("wglBindVideoImageNV"))!=0) nLinked++; + if ((pwglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC) __GLeeGetProcAddress("wglReleaseVideoImageNV"))!=0) nLinked++; + if ((pwglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC) __GLeeGetProcAddress("wglSendPbufferToVideoNV"))!=0) nLinked++; + if ((pwglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC) __GLeeGetProcAddress("wglGetVideoInfoNV"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLEE_LINK_FUNCTION __GLeeWGLLoadFunction[37]; + +void initWGLLoadFunctions(void) +{ + __GLeeWGLLoadFunction[0]=__GLeeLink_WGL_ARB_buffer_region; + __GLeeWGLLoadFunction[1]=__GLeeLink_WGL_ARB_multisample; + __GLeeWGLLoadFunction[2]=__GLeeLink_WGL_ARB_extensions_string; + __GLeeWGLLoadFunction[3]=__GLeeLink_WGL_ARB_pixel_format; + __GLeeWGLLoadFunction[4]=__GLeeLink_WGL_ARB_make_current_read; + __GLeeWGLLoadFunction[5]=__GLeeLink_WGL_ARB_pbuffer; + __GLeeWGLLoadFunction[6]=__GLeeLink_WGL_ARB_render_texture; + __GLeeWGLLoadFunction[7]=__GLeeLink_WGL_ARB_pixel_format_float; + __GLeeWGLLoadFunction[8]=__GLeeLink_WGL_ARB_create_context; + __GLeeWGLLoadFunction[9]=__GLeeLink_WGL_EXT_make_current_read; + __GLeeWGLLoadFunction[10]=__GLeeLink_WGL_EXT_pixel_format; + __GLeeWGLLoadFunction[11]=__GLeeLink_WGL_EXT_pbuffer; + __GLeeWGLLoadFunction[12]=__GLeeLink_WGL_EXT_depth_float; + __GLeeWGLLoadFunction[13]=__GLeeLink_WGL_3DFX_multisample; + __GLeeWGLLoadFunction[14]=__GLeeLink_WGL_EXT_multisample; + __GLeeWGLLoadFunction[15]=__GLeeLink_WGL_I3D_digital_video_control; + __GLeeWGLLoadFunction[16]=__GLeeLink_WGL_I3D_gamma; + __GLeeWGLLoadFunction[17]=__GLeeLink_WGL_I3D_genlock; + __GLeeWGLLoadFunction[18]=__GLeeLink_WGL_I3D_image_buffer; + __GLeeWGLLoadFunction[19]=__GLeeLink_WGL_I3D_swap_frame_lock; + __GLeeWGLLoadFunction[20]=__GLeeLink_WGL_NV_render_depth_texture; + __GLeeWGLLoadFunction[21]=__GLeeLink_WGL_NV_render_texture_rectangle; + __GLeeWGLLoadFunction[22]=__GLeeLink_WGL_ATI_pixel_format_float; + __GLeeWGLLoadFunction[23]=__GLeeLink_WGL_NV_float_buffer; + __GLeeWGLLoadFunction[24]=__GLeeLink_WGL_3DL_stereo_control; + __GLeeWGLLoadFunction[25]=__GLeeLink_WGL_EXT_pixel_format_packed_float; + __GLeeWGLLoadFunction[26]=__GLeeLink_WGL_EXT_framebuffer_sRGB; + __GLeeWGLLoadFunction[27]=__GLeeLink_WGL_NV_present_video; + __GLeeWGLLoadFunction[28]=__GLeeLink_WGL_NV_video_out; + __GLeeWGLLoadFunction[29]=__GLeeLink_WGL_NV_swap_group; + __GLeeWGLLoadFunction[30]=__GLeeLink_WGL_EXT_display_color_table; + __GLeeWGLLoadFunction[31]=__GLeeLink_WGL_EXT_extensions_string; + __GLeeWGLLoadFunction[32]=__GLeeLink_WGL_EXT_swap_control; + __GLeeWGLLoadFunction[33]=__GLeeLink_WGL_NV_vertex_array_range; + __GLeeWGLLoadFunction[34]=__GLeeLink_WGL_OML_sync_control; + __GLeeWGLLoadFunction[35]=__GLeeLink_WGL_I3D_swap_frame_usage; + __GLeeWGLLoadFunction[36]=__GLeeLink_WGL_NV_video_output; +} + +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else /* Linux */ +GLuint __GLeeLink_GLX_VERSION_1_3(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_VERSION_1_3 + if ((pglXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC) __GLeeGetProcAddress("glXGetFBConfigs"))!=0) nLinked++; + if ((pglXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) __GLeeGetProcAddress("glXChooseFBConfig"))!=0) nLinked++; + if ((pglXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC) __GLeeGetProcAddress("glXGetFBConfigAttrib"))!=0) nLinked++; + if ((pglXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC) __GLeeGetProcAddress("glXGetVisualFromFBConfig"))!=0) nLinked++; + if ((pglXCreateWindow = (PFNGLXCREATEWINDOWPROC) __GLeeGetProcAddress("glXCreateWindow"))!=0) nLinked++; + if ((pglXDestroyWindow = (PFNGLXDESTROYWINDOWPROC) __GLeeGetProcAddress("glXDestroyWindow"))!=0) nLinked++; + if ((pglXCreatePixmap = (PFNGLXCREATEPIXMAPPROC) __GLeeGetProcAddress("glXCreatePixmap"))!=0) nLinked++; + if ((pglXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC) __GLeeGetProcAddress("glXDestroyPixmap"))!=0) nLinked++; + if ((pglXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC) __GLeeGetProcAddress("glXCreatePbuffer"))!=0) nLinked++; + if ((pglXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC) __GLeeGetProcAddress("glXDestroyPbuffer"))!=0) nLinked++; + if ((pglXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC) __GLeeGetProcAddress("glXQueryDrawable"))!=0) nLinked++; + if ((pglXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC) __GLeeGetProcAddress("glXCreateNewContext"))!=0) nLinked++; + if ((pglXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC) __GLeeGetProcAddress("glXMakeContextCurrent"))!=0) nLinked++; + if ((pglXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC) __GLeeGetProcAddress("glXGetCurrentReadDrawable"))!=0) nLinked++; + if ((pglXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC) __GLeeGetProcAddress("glXGetCurrentDisplay"))!=0) nLinked++; + if ((pglXQueryContext = (PFNGLXQUERYCONTEXTPROC) __GLeeGetProcAddress("glXQueryContext"))!=0) nLinked++; + if ((pglXSelectEvent = (PFNGLXSELECTEVENTPROC) __GLeeGetProcAddress("glXSelectEvent"))!=0) nLinked++; + if ((pglXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC) __GLeeGetProcAddress("glXGetSelectedEvent"))!=0) nLinked++; +#endif + if (nLinked==18) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_VERSION_1_4(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_VERSION_1_4 + if ((pglXGetProcAddress = (PFNGLXGETPROCADDRESSPROC) __GLeeGetProcAddress("glXGetProcAddress"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_ARB_multisample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_ARB_fbconfig_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_SGIS_multisample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_EXT_visual_info(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_SGI_swap_control(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGI_swap_control + if ((pglXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC) __GLeeGetProcAddress("glXSwapIntervalSGI"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGI_video_sync(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGI_video_sync + if ((pglXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC) __GLeeGetProcAddress("glXGetVideoSyncSGI"))!=0) nLinked++; + if ((pglXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC) __GLeeGetProcAddress("glXWaitVideoSyncSGI"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGI_make_current_read(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGI_make_current_read + if ((pglXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC) __GLeeGetProcAddress("glXMakeCurrentReadSGI"))!=0) nLinked++; + if ((pglXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC) __GLeeGetProcAddress("glXGetCurrentReadDrawableSGI"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_EXT_visual_rating(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_EXT_import_context(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_EXT_import_context + if ((pglXGetCurrentDisplayEXT = (PFNGLXGETCURRENTDISPLAYEXTPROC) __GLeeGetProcAddress("glXGetCurrentDisplayEXT"))!=0) nLinked++; + if ((pglXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC) __GLeeGetProcAddress("glXQueryContextInfoEXT"))!=0) nLinked++; + if ((pglXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC) __GLeeGetProcAddress("glXGetContextIDEXT"))!=0) nLinked++; + if ((pglXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC) __GLeeGetProcAddress("glXImportContextEXT"))!=0) nLinked++; + if ((pglXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC) __GLeeGetProcAddress("glXFreeContextEXT"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGIX_fbconfig(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGIX_fbconfig + if ((pglXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC) __GLeeGetProcAddress("glXGetFBConfigAttribSGIX"))!=0) nLinked++; + if ((pglXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC) __GLeeGetProcAddress("glXChooseFBConfigSGIX"))!=0) nLinked++; + if ((pglXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) __GLeeGetProcAddress("glXCreateGLXPixmapWithConfigSGIX"))!=0) nLinked++; + if ((pglXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) __GLeeGetProcAddress("glXCreateContextWithConfigSGIX"))!=0) nLinked++; + if ((pglXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) __GLeeGetProcAddress("glXGetVisualFromFBConfigSGIX"))!=0) nLinked++; + if ((pglXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) __GLeeGetProcAddress("glXGetFBConfigFromVisualSGIX"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGIX_pbuffer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGIX_pbuffer + if ((pglXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC) __GLeeGetProcAddress("glXCreateGLXPbufferSGIX"))!=0) nLinked++; + if ((pglXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC) __GLeeGetProcAddress("glXDestroyGLXPbufferSGIX"))!=0) nLinked++; + if ((pglXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC) __GLeeGetProcAddress("glXQueryGLXPbufferSGIX"))!=0) nLinked++; + if ((pglXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC) __GLeeGetProcAddress("glXSelectEventSGIX"))!=0) nLinked++; + if ((pglXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC) __GLeeGetProcAddress("glXGetSelectedEventSGIX"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGI_cushion(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGI_cushion + if ((pglXCushionSGI = (PFNGLXCUSHIONSGIPROC) __GLeeGetProcAddress("glXCushionSGI"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGIX_video_resize(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGIX_video_resize + if ((pglXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC) __GLeeGetProcAddress("glXBindChannelToWindowSGIX"))!=0) nLinked++; + if ((pglXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC) __GLeeGetProcAddress("glXChannelRectSGIX"))!=0) nLinked++; + if ((pglXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC) __GLeeGetProcAddress("glXQueryChannelRectSGIX"))!=0) nLinked++; + if ((pglXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC) __GLeeGetProcAddress("glXQueryChannelDeltasSGIX"))!=0) nLinked++; + if ((pglXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC) __GLeeGetProcAddress("glXChannelRectSyncSGIX"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGIX_swap_group(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGIX_swap_group + if ((pglXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC) __GLeeGetProcAddress("glXJoinSwapGroupSGIX"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGIX_swap_barrier(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGIX_swap_barrier + if ((pglXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC) __GLeeGetProcAddress("glXBindSwapBarrierSGIX"))!=0) nLinked++; + if ((pglXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) __GLeeGetProcAddress("glXQueryMaxSwapBarriersSGIX"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGIS_blended_overlay(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_SGIS_shared_multisample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_SUN_get_transparent_index(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SUN_get_transparent_index + if ((pglXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC) __GLeeGetProcAddress("glXGetTransparentIndexSUN"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_3DFX_multisample(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_MESA_copy_sub_buffer(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_MESA_copy_sub_buffer + if ((pglXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC) __GLeeGetProcAddress("glXCopySubBufferMESA"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_MESA_pixmap_colormap(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_MESA_pixmap_colormap + if ((pglXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC) __GLeeGetProcAddress("glXCreateGLXPixmapMESA"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_MESA_release_buffers(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_MESA_release_buffers + if ((pglXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC) __GLeeGetProcAddress("glXReleaseBuffersMESA"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_MESA_set_3dfx_mode(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_MESA_set_3dfx_mode + if ((pglXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC) __GLeeGetProcAddress("glXSet3DfxModeMESA"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_SGIX_visual_select_group(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_OML_swap_method(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_OML_sync_control(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_OML_sync_control + if ((pglXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC) __GLeeGetProcAddress("glXGetSyncValuesOML"))!=0) nLinked++; + if ((pglXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC) __GLeeGetProcAddress("glXGetMscRateOML"))!=0) nLinked++; + if ((pglXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC) __GLeeGetProcAddress("glXSwapBuffersMscOML"))!=0) nLinked++; + if ((pglXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC) __GLeeGetProcAddress("glXWaitForMscOML"))!=0) nLinked++; + if ((pglXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC) __GLeeGetProcAddress("glXWaitForSbcOML"))!=0) nLinked++; +#endif + if (nLinked==5) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_NV_float_buffer(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_SGIX_hyperpipe(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_SGIX_hyperpipe + if ((pglXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeNetworkSGIX"))!=0) nLinked++; + if ((pglXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXHyperpipeConfigSGIX"))!=0) nLinked++; + if ((pglXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeConfigSGIX"))!=0) nLinked++; + if ((pglXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXDestroyHyperpipeConfigSGIX"))!=0) nLinked++; + if ((pglXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC) __GLeeGetProcAddress("glXBindHyperpipeSGIX"))!=0) nLinked++; + if ((pglXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeBestAttribSGIX"))!=0) nLinked++; + if ((pglXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC) __GLeeGetProcAddress("glXHyperpipeAttribSGIX"))!=0) nLinked++; + if ((pglXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeAttribSGIX"))!=0) nLinked++; +#endif + if (nLinked==8) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_MESA_agp_offset(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_MESA_agp_offset + if ((pglXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC) __GLeeGetProcAddress("glXGetAGPOffsetMESA"))!=0) nLinked++; +#endif + if (nLinked==1) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_EXT_fbconfig_packed_float(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_EXT_framebuffer_sRGB(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_EXT_texture_from_pixmap(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_EXT_texture_from_pixmap + if ((pglXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC) __GLeeGetProcAddress("glXBindTexImageEXT"))!=0) nLinked++; + if ((pglXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC) __GLeeGetProcAddress("glXReleaseTexImageEXT"))!=0) nLinked++; +#endif + if (nLinked==2) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLuint __GLeeLink_GLX_NV_present_video(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_NV_video_out(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_NV_swap_group(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_EXT_scene_marker(void) {return GLEE_LINK_COMPLETE;} + +GLuint __GLeeLink_GLX_NV_video_output(void) +{ + GLint nLinked=0; +#ifdef __GLEE_GLX_NV_video_output + if ((pglXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC) __GLeeGetProcAddress("glXGetVideoDeviceNV"))!=0) nLinked++; + if ((pglXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC) __GLeeGetProcAddress("glXReleaseVideoDeviceNV"))!=0) nLinked++; + if ((pglXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC) __GLeeGetProcAddress("glXBindVideoImageNV"))!=0) nLinked++; + if ((pglXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC) __GLeeGetProcAddress("glXReleaseVideoImageNV"))!=0) nLinked++; + if ((pglXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC) __GLeeGetProcAddress("glXSendPbufferToVideoNV"))!=0) nLinked++; + if ((pglXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC) __GLeeGetProcAddress("glXGetVideoInfoNV"))!=0) nLinked++; +#endif + if (nLinked==6) return GLEE_LINK_COMPLETE; + if (nLinked==0) return GLEE_LINK_FAIL; + return GLEE_LINK_PARTIAL; +} + +GLEE_LINK_FUNCTION __GLeeGLXLoadFunction[39]; + +void initGLXLoadFunctions(void) +{ + __GLeeGLXLoadFunction[0]=__GLeeLink_GLX_VERSION_1_3; + __GLeeGLXLoadFunction[1]=__GLeeLink_GLX_VERSION_1_4; + __GLeeGLXLoadFunction[2]=__GLeeLink_GLX_ARB_multisample; + __GLeeGLXLoadFunction[3]=__GLeeLink_GLX_ARB_fbconfig_float; + __GLeeGLXLoadFunction[4]=__GLeeLink_GLX_SGIS_multisample; + __GLeeGLXLoadFunction[5]=__GLeeLink_GLX_EXT_visual_info; + __GLeeGLXLoadFunction[6]=__GLeeLink_GLX_SGI_swap_control; + __GLeeGLXLoadFunction[7]=__GLeeLink_GLX_SGI_video_sync; + __GLeeGLXLoadFunction[8]=__GLeeLink_GLX_SGI_make_current_read; + __GLeeGLXLoadFunction[9]=__GLeeLink_GLX_EXT_visual_rating; + __GLeeGLXLoadFunction[10]=__GLeeLink_GLX_EXT_import_context; + __GLeeGLXLoadFunction[11]=__GLeeLink_GLX_SGIX_fbconfig; + __GLeeGLXLoadFunction[12]=__GLeeLink_GLX_SGIX_pbuffer; + __GLeeGLXLoadFunction[13]=__GLeeLink_GLX_SGI_cushion; + __GLeeGLXLoadFunction[14]=__GLeeLink_GLX_SGIX_video_resize; + __GLeeGLXLoadFunction[15]=__GLeeLink_GLX_SGIX_swap_group; + __GLeeGLXLoadFunction[16]=__GLeeLink_GLX_SGIX_swap_barrier; + __GLeeGLXLoadFunction[17]=__GLeeLink_GLX_SGIS_blended_overlay; + __GLeeGLXLoadFunction[18]=__GLeeLink_GLX_SGIS_shared_multisample; + __GLeeGLXLoadFunction[19]=__GLeeLink_GLX_SUN_get_transparent_index; + __GLeeGLXLoadFunction[20]=__GLeeLink_GLX_3DFX_multisample; + __GLeeGLXLoadFunction[21]=__GLeeLink_GLX_MESA_copy_sub_buffer; + __GLeeGLXLoadFunction[22]=__GLeeLink_GLX_MESA_pixmap_colormap; + __GLeeGLXLoadFunction[23]=__GLeeLink_GLX_MESA_release_buffers; + __GLeeGLXLoadFunction[24]=__GLeeLink_GLX_MESA_set_3dfx_mode; + __GLeeGLXLoadFunction[25]=__GLeeLink_GLX_SGIX_visual_select_group; + __GLeeGLXLoadFunction[26]=__GLeeLink_GLX_OML_swap_method; + __GLeeGLXLoadFunction[27]=__GLeeLink_GLX_OML_sync_control; + __GLeeGLXLoadFunction[28]=__GLeeLink_GLX_NV_float_buffer; + __GLeeGLXLoadFunction[29]=__GLeeLink_GLX_SGIX_hyperpipe; + __GLeeGLXLoadFunction[30]=__GLeeLink_GLX_MESA_agp_offset; + __GLeeGLXLoadFunction[31]=__GLeeLink_GLX_EXT_fbconfig_packed_float; + __GLeeGLXLoadFunction[32]=__GLeeLink_GLX_EXT_framebuffer_sRGB; + __GLeeGLXLoadFunction[33]=__GLeeLink_GLX_EXT_texture_from_pixmap; + __GLeeGLXLoadFunction[34]=__GLeeLink_GLX_NV_present_video; + __GLeeGLXLoadFunction[35]=__GLeeLink_GLX_NV_video_out; + __GLeeGLXLoadFunction[36]=__GLeeLink_GLX_NV_swap_group; + __GLeeGLXLoadFunction[37]=__GLeeLink_GLX_EXT_scene_marker; + __GLeeGLXLoadFunction[38]=__GLeeLink_GLX_NV_video_output; +} + +#endif /* end Linux */ + + +/***************************************************************** + * GLee internal types + *****************************************************************/ +typedef struct +{ + char ** names; + int * lengths; + int numNames; +}ExtensionList; + + +/***************************************************************** + * GLee internal variables + *****************************************************************/ +char GLeeErrorString[256]=""; + + +/***************************************************************** + * GLee internal functions + *****************************************************************/ + +void __GLeeExtList_init(ExtensionList *extList) +{ + extList->names=0; + extList->lengths=0; + extList->numNames=0; +} + +void __GLeeExtList_clean(ExtensionList *extList) +{ + int a; + for (a=0;anumNames;a++) + { + if (extList->names[a]!=0) free((void *)extList->names[a]); + } + if (extList->names!=0) free((void *)extList->names); + if (extList->lengths!=0) free((void *)extList->lengths); + extList->names=0; + extList->lengths=0; + extList->numNames=0; +} + +void __GLeeExtList_add(ExtensionList *extList, const char * extName) +{ + int length=strlen(extName)+1; + int i=extList->numNames; + int n=i+1; + if (i==0) + { + extList->lengths=(int *)malloc(sizeof(int)); + extList->names=(char **)malloc(sizeof(char *)); + }else + { + extList->lengths=(int *)realloc((void *)extList->lengths, n*sizeof(int)); + extList->names=(char **)realloc((void *)extList->names, n*sizeof(char *)); + } + extList->names[i]=(char *)malloc(length*sizeof(char)); + strcpy(extList->names[i],extName); + extList->lengths[i]=length; + extList->numNames++; +} + +const char *__GLeeGetExtStrPlat( void ) +{ +#ifdef WIN32 + if (!_GLEE_WGL_ARB_extensions_string) + pwglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB"); + + if (pwglGetExtensionsStringARB) + return (const char *)pwglGetExtensionsStringARB(wglGetCurrentDC()); +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else + Display *dpy=glXGetCurrentDisplay(); + if(dpy) + { + int dpynr=DefaultScreen(dpy); + return (const char*)glXQueryExtensionsString(dpy,dpynr); + } +#endif + return 0; +} + +void __GLeeWriteError(const char * errorStr) +{ + int a=0; + for (a=0;a<256;a++) + { + GLeeErrorString[a]=errorStr[a]; + } + GLeeErrorString[255]='\0'; +} + +int __GLeeGetVersionNumber(char *versionStr) +{ + int major=(int)versionStr[0]-(int)'0'; + int minor=(int)versionStr[2]-(int)'0'; + return major<<8 | minor; +} + +GLboolean __GLeeGetExtensions(ExtensionList* extList) +{ + const char * platExtStr; + const char * glExtStr; + char * extStr; + char emptyString[1] = ""; + char extensionName[1024]; + int a,b; + int totalExtStrLen; + int platExtStrLen; + int addASpace; + + /* read the platform specific extension string */ + platExtStr=__GLeeGetExtStrPlat(); + if (!platExtStr) platExtStr=emptyString; + + glExtStr=(const char *)glGetString(GL_EXTENSIONS); + if (glExtStr==0) + { + __GLeeWriteError("glGetString(GL_EXTENSIONS) failed."); + return GL_FALSE; + } + + /* allocate the extension string */ + platExtStrLen = strlen(platExtStr); + totalExtStrLen = platExtStrLen + strlen(glExtStr); + extStr=(char *)malloc( (totalExtStrLen+2) * sizeof(char) ); /* we add 2 to allow for an extra space and a null terminator */ + + /* If the last character of platExtStr is not a space, we need to add one when we concatenate the extension strings*/ + addASpace = 0; + if ( platExtStrLen > 2 ) + { + if ( platExtStr[ platExtStrLen-1 ] != ' ') + { + addASpace = 1; + } + } + + /* concatenate the two extension strings */ + if ( addASpace ) + { + sprintf(extStr,"%s %s",platExtStr,glExtStr); + } + else + { + sprintf(extStr,"%s%s",platExtStr,glExtStr); + } + + /* extract the extensions */ + for ( a=0;anumNames; + int a; + for (a=0;anames[a],name)==0) + return GL_TRUE; + } + return GL_FALSE; +} + +GLEE_EXTERN GLint __GLeeGetExtensionNumber(const char *extensionName, int type) +{ + int a; + switch (type) + { + case 0: + for (a=0;a<__GLeeGLNumExtensions;a++) + if (strcmp(extensionName,__GLeeGLExtensionNames[a])==0) return a; + return -1; +#ifdef WIN32 + case 1: + for (a=0;a<__GLeeWGLNumExtensions;a++) + if (strcmp(extensionName,__GLeeWGLExtensionNames[a])==0) return a; + return -1; +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else + case 2: + for (a=0;a<__GLeeGLXNumExtensions;a++) + if (strcmp(extensionName,__GLeeGLXExtensionNames[a])==0) return a; + return -1; +#endif + } + return -1; +} + +/***************************************************************** + * GLee external functions + *****************************************************************/ + +#ifdef WIN32 +GLEE_EXTERN const char * GLeeGetExtStrWGL( void ) +{ + return __GLeeGetExtStrPlat(); +} +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else +GLEE_EXTERN const char * GLeeGetExtStrGLX( void ) +{ + return __GLeeGetExtStrPlat(); +} +#endif + +GLEE_EXTERN const char * GLeeGetExtStrGL( void ) +{ + return (const char *)glGetString(GL_EXTENSIONS); +} + +GLEE_EXTERN const char * GLeeGetErrorString( void ) +{ + return GLeeErrorString; +} + +GLboolean __GLeeInitedLoadFunctions=GL_FALSE; + +GLEE_EXTERN GLint GLeeForceLink(const char * extensionName) +{ + int type=0; + int extNum; + int len=strlen(extensionName); + if (len<5) return GLEE_LINK_FAIL; + if (!__GLeeInitedLoadFunctions) + { + if (!__GLeeInited) GLeeInit(); + initGLLoadFunctions(); +#ifdef WIN32 + initWGLLoadFunctions(); +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else + initGLXLoadFunctions(); +#endif + __GLeeInitedLoadFunctions=GL_TRUE; + } + if (extensionName[0]=='W') type=1; + else if (extensionName[2]=='X') type=2; + extNum=__GLeeGetExtensionNumber(extensionName,type); + if (extNum==-1) return GLEE_LINK_FAIL; + if (type==0) return __GLeeGLLoadFunction[extNum](); +#ifdef WIN32 + if (type==1) return __GLeeWGLLoadFunction[extNum](); +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else + if (type==2) return __GLeeGLXLoadFunction[extNum](); +#endif + return GLEE_LINK_FAIL; +} + +GLEE_EXTERN GLboolean GLeeEnabled(GLboolean * extensionQueryingVariable) +{ + if (!__GLeeInited) GLeeInit(); + return *extensionQueryingVariable; +} + +GLEE_EXTERN GLboolean GLeeInit( void ) +{ + int version; + ExtensionList extensionNames; + + if (__GLeeInited) + { + return GL_FALSE; + } + + __GLeeExtList_init(&extensionNames); + if (!__GLeeGetExtensions(&extensionNames)) + { + __GLeeWriteError("GL extension querying failed."); + __GLeeExtList_clean(&extensionNames); + return GL_FALSE; + } + + version=__GLeeGetVersionNumber((char *)glGetString(GL_VERSION)); + + __GLeeInited = GL_TRUE; + + +/***************************************************************** + * Autogenerated linking functions + *****************************************************************/ + if (version>=258) + { + _GLEE_VERSION_1_2 = GL_TRUE; + __GLeeLink_GL_VERSION_1_2(); + } + if (__GLeeCheckExtension("GL_ARB_imaging", &extensionNames) ) + { + _GLEE_ARB_imaging = GL_TRUE; + __GLeeLink_GL_ARB_imaging(); + } + if (version>=259) + { + _GLEE_VERSION_1_3 = GL_TRUE; + __GLeeLink_GL_VERSION_1_3(); + } + if (version>=260) + { + _GLEE_VERSION_1_4 = GL_TRUE; + __GLeeLink_GL_VERSION_1_4(); + } + if (version>=261) + { + _GLEE_VERSION_1_5 = GL_TRUE; + __GLeeLink_GL_VERSION_1_5(); + } + if (version>=512) + { + _GLEE_VERSION_2_0 = GL_TRUE; + __GLeeLink_GL_VERSION_2_0(); + } + if (version>=513) + { + _GLEE_VERSION_2_1 = GL_TRUE; + __GLeeLink_GL_VERSION_2_1(); + } + if (version>=768) + { + _GLEE_VERSION_3_0 = GL_TRUE; + __GLeeLink_GL_VERSION_3_0(); + } + if (__GLeeCheckExtension("GL_ARB_multitexture", &extensionNames) ) + { + _GLEE_ARB_multitexture = GL_TRUE; + __GLeeLink_GL_ARB_multitexture(); + } + if (__GLeeCheckExtension("GL_ARB_transpose_matrix", &extensionNames) ) + { + _GLEE_ARB_transpose_matrix = GL_TRUE; + __GLeeLink_GL_ARB_transpose_matrix(); + } + if (__GLeeCheckExtension("GL_ARB_multisample", &extensionNames) ) + { + _GLEE_ARB_multisample = GL_TRUE; + __GLeeLink_GL_ARB_multisample(); + } + if (__GLeeCheckExtension("GL_ARB_texture_env_add", &extensionNames) ) + { + _GLEE_ARB_texture_env_add = GL_TRUE; + __GLeeLink_GL_ARB_texture_env_add(); + } + if (__GLeeCheckExtension("GL_ARB_texture_cube_map", &extensionNames) ) + { + _GLEE_ARB_texture_cube_map = GL_TRUE; + __GLeeLink_GL_ARB_texture_cube_map(); + } + if (__GLeeCheckExtension("GL_ARB_texture_compression", &extensionNames) ) + { + _GLEE_ARB_texture_compression = GL_TRUE; + __GLeeLink_GL_ARB_texture_compression(); + } + if (__GLeeCheckExtension("GL_ARB_texture_border_clamp", &extensionNames) ) + { + _GLEE_ARB_texture_border_clamp = GL_TRUE; + __GLeeLink_GL_ARB_texture_border_clamp(); + } + if (__GLeeCheckExtension("GL_ARB_point_parameters", &extensionNames) ) + { + _GLEE_ARB_point_parameters = GL_TRUE; + __GLeeLink_GL_ARB_point_parameters(); + } + if (__GLeeCheckExtension("GL_ARB_vertex_blend", &extensionNames) ) + { + _GLEE_ARB_vertex_blend = GL_TRUE; + __GLeeLink_GL_ARB_vertex_blend(); + } + if (__GLeeCheckExtension("GL_ARB_matrix_palette", &extensionNames) ) + { + _GLEE_ARB_matrix_palette = GL_TRUE; + __GLeeLink_GL_ARB_matrix_palette(); + } + if (__GLeeCheckExtension("GL_ARB_texture_env_combine", &extensionNames) ) + { + _GLEE_ARB_texture_env_combine = GL_TRUE; + __GLeeLink_GL_ARB_texture_env_combine(); + } + if (__GLeeCheckExtension("GL_ARB_texture_env_crossbar", &extensionNames) ) + { + _GLEE_ARB_texture_env_crossbar = GL_TRUE; + __GLeeLink_GL_ARB_texture_env_crossbar(); + } + if (__GLeeCheckExtension("GL_ARB_texture_env_dot3", &extensionNames) ) + { + _GLEE_ARB_texture_env_dot3 = GL_TRUE; + __GLeeLink_GL_ARB_texture_env_dot3(); + } + if (__GLeeCheckExtension("GL_ARB_texture_mirrored_repeat", &extensionNames) ) + { + _GLEE_ARB_texture_mirrored_repeat = GL_TRUE; + __GLeeLink_GL_ARB_texture_mirrored_repeat(); + } + if (__GLeeCheckExtension("GL_ARB_depth_texture", &extensionNames) ) + { + _GLEE_ARB_depth_texture = GL_TRUE; + __GLeeLink_GL_ARB_depth_texture(); + } + if (__GLeeCheckExtension("GL_ARB_shadow", &extensionNames) ) + { + _GLEE_ARB_shadow = GL_TRUE; + __GLeeLink_GL_ARB_shadow(); + } + if (__GLeeCheckExtension("GL_ARB_shadow_ambient", &extensionNames) ) + { + _GLEE_ARB_shadow_ambient = GL_TRUE; + __GLeeLink_GL_ARB_shadow_ambient(); + } + if (__GLeeCheckExtension("GL_ARB_window_pos", &extensionNames) ) + { + _GLEE_ARB_window_pos = GL_TRUE; + __GLeeLink_GL_ARB_window_pos(); + } + if (__GLeeCheckExtension("GL_ARB_vertex_program", &extensionNames) ) + { + _GLEE_ARB_vertex_program = GL_TRUE; + __GLeeLink_GL_ARB_vertex_program(); + } + if (__GLeeCheckExtension("GL_ARB_fragment_program", &extensionNames) ) + { + _GLEE_ARB_fragment_program = GL_TRUE; + __GLeeLink_GL_ARB_fragment_program(); + } + if (__GLeeCheckExtension("GL_ARB_vertex_buffer_object", &extensionNames) ) + { + _GLEE_ARB_vertex_buffer_object = GL_TRUE; + __GLeeLink_GL_ARB_vertex_buffer_object(); + } + if (__GLeeCheckExtension("GL_ARB_occlusion_query", &extensionNames) ) + { + _GLEE_ARB_occlusion_query = GL_TRUE; + __GLeeLink_GL_ARB_occlusion_query(); + } + if (__GLeeCheckExtension("GL_ARB_shader_objects", &extensionNames) ) + { + _GLEE_ARB_shader_objects = GL_TRUE; + __GLeeLink_GL_ARB_shader_objects(); + } + if (__GLeeCheckExtension("GL_ARB_vertex_shader", &extensionNames) ) + { + _GLEE_ARB_vertex_shader = GL_TRUE; + __GLeeLink_GL_ARB_vertex_shader(); + } + if (__GLeeCheckExtension("GL_ARB_fragment_shader", &extensionNames) ) + { + _GLEE_ARB_fragment_shader = GL_TRUE; + __GLeeLink_GL_ARB_fragment_shader(); + } + if (__GLeeCheckExtension("GL_ARB_shading_language_100", &extensionNames) ) + { + _GLEE_ARB_shading_language_100 = GL_TRUE; + __GLeeLink_GL_ARB_shading_language_100(); + } + if (__GLeeCheckExtension("GL_ARB_texture_non_power_of_two", &extensionNames) ) + { + _GLEE_ARB_texture_non_power_of_two = GL_TRUE; + __GLeeLink_GL_ARB_texture_non_power_of_two(); + } + if (__GLeeCheckExtension("GL_ARB_point_sprite", &extensionNames) ) + { + _GLEE_ARB_point_sprite = GL_TRUE; + __GLeeLink_GL_ARB_point_sprite(); + } + if (__GLeeCheckExtension("GL_ARB_fragment_program_shadow", &extensionNames) ) + { + _GLEE_ARB_fragment_program_shadow = GL_TRUE; + __GLeeLink_GL_ARB_fragment_program_shadow(); + } + if (__GLeeCheckExtension("GL_ARB_draw_buffers", &extensionNames) ) + { + _GLEE_ARB_draw_buffers = GL_TRUE; + __GLeeLink_GL_ARB_draw_buffers(); + } + if (__GLeeCheckExtension("GL_ARB_texture_rectangle", &extensionNames) ) + { + _GLEE_ARB_texture_rectangle = GL_TRUE; + __GLeeLink_GL_ARB_texture_rectangle(); + } + if (__GLeeCheckExtension("GL_ARB_color_buffer_float", &extensionNames) ) + { + _GLEE_ARB_color_buffer_float = GL_TRUE; + __GLeeLink_GL_ARB_color_buffer_float(); + } + if (__GLeeCheckExtension("GL_ARB_half_float_pixel", &extensionNames) ) + { + _GLEE_ARB_half_float_pixel = GL_TRUE; + __GLeeLink_GL_ARB_half_float_pixel(); + } + if (__GLeeCheckExtension("GL_ARB_texture_float", &extensionNames) ) + { + _GLEE_ARB_texture_float = GL_TRUE; + __GLeeLink_GL_ARB_texture_float(); + } + if (__GLeeCheckExtension("GL_ARB_pixel_buffer_object", &extensionNames) ) + { + _GLEE_ARB_pixel_buffer_object = GL_TRUE; + __GLeeLink_GL_ARB_pixel_buffer_object(); + } + if (__GLeeCheckExtension("GL_ARB_depth_buffer_float", &extensionNames) ) + { + _GLEE_ARB_depth_buffer_float = GL_TRUE; + __GLeeLink_GL_ARB_depth_buffer_float(); + } + if (__GLeeCheckExtension("GL_ARB_drawinstanced", &extensionNames) ) + { + _GLEE_ARB_drawinstanced = GL_TRUE; + __GLeeLink_GL_ARB_drawinstanced(); + } + if (__GLeeCheckExtension("GL_ARB_framebuffer_object", &extensionNames) ) + { + _GLEE_ARB_framebuffer_object = GL_TRUE; + __GLeeLink_GL_ARB_framebuffer_object(); + } + if (__GLeeCheckExtension("GL_ARB_framebuffer_sRGB", &extensionNames) ) + { + _GLEE_ARB_framebuffer_sRGB = GL_TRUE; + __GLeeLink_GL_ARB_framebuffer_sRGB(); + } + if (__GLeeCheckExtension("GL_ARB_geometry_shader4", &extensionNames) ) + { + _GLEE_ARB_geometry_shader4 = GL_TRUE; + __GLeeLink_GL_ARB_geometry_shader4(); + } + if (__GLeeCheckExtension("GL_ARB_half_float_vertex", &extensionNames) ) + { + _GLEE_ARB_half_float_vertex = GL_TRUE; + __GLeeLink_GL_ARB_half_float_vertex(); + } + if (__GLeeCheckExtension("GL_ARBinstanced_arrays", &extensionNames) ) + { + _GLEE_ARBinstanced_arrays = GL_TRUE; + __GLeeLink_GL_ARBinstanced_arrays(); + } + if (__GLeeCheckExtension("GL_ARB_map_buffer_range", &extensionNames) ) + { + _GLEE_ARB_map_buffer_range = GL_TRUE; + __GLeeLink_GL_ARB_map_buffer_range(); + } + if (__GLeeCheckExtension("GL_ARB_texture_buffer_object", &extensionNames) ) + { + _GLEE_ARB_texture_buffer_object = GL_TRUE; + __GLeeLink_GL_ARB_texture_buffer_object(); + } + if (__GLeeCheckExtension("GL_ARB_texture_compression_rgtc", &extensionNames) ) + { + _GLEE_ARB_texture_compression_rgtc = GL_TRUE; + __GLeeLink_GL_ARB_texture_compression_rgtc(); + } + if (__GLeeCheckExtension("GL_ARB_texture_rg", &extensionNames) ) + { + _GLEE_ARB_texture_rg = GL_TRUE; + __GLeeLink_GL_ARB_texture_rg(); + } + if (__GLeeCheckExtension("GL_ARB_vertex_array_object", &extensionNames) ) + { + _GLEE_ARB_vertex_array_object = GL_TRUE; + __GLeeLink_GL_ARB_vertex_array_object(); + } + if (__GLeeCheckExtension("GL_EXT_abgr", &extensionNames) ) + { + _GLEE_EXT_abgr = GL_TRUE; + __GLeeLink_GL_EXT_abgr(); + } + if (__GLeeCheckExtension("GL_EXT_blend_color", &extensionNames) ) + { + _GLEE_EXT_blend_color = GL_TRUE; + __GLeeLink_GL_EXT_blend_color(); + } + if (__GLeeCheckExtension("GL_EXT_polygon_offset", &extensionNames) ) + { + _GLEE_EXT_polygon_offset = GL_TRUE; + __GLeeLink_GL_EXT_polygon_offset(); + } + if (__GLeeCheckExtension("GL_EXT_texture", &extensionNames) ) + { + _GLEE_EXT_texture = GL_TRUE; + __GLeeLink_GL_EXT_texture(); + } + if (__GLeeCheckExtension("GL_EXT_texture3D", &extensionNames) ) + { + _GLEE_EXT_texture3D = GL_TRUE; + __GLeeLink_GL_EXT_texture3D(); + } + if (__GLeeCheckExtension("GL_SGIS_texture_filter4", &extensionNames) ) + { + _GLEE_SGIS_texture_filter4 = GL_TRUE; + __GLeeLink_GL_SGIS_texture_filter4(); + } + if (__GLeeCheckExtension("GL_EXT_subtexture", &extensionNames) ) + { + _GLEE_EXT_subtexture = GL_TRUE; + __GLeeLink_GL_EXT_subtexture(); + } + if (__GLeeCheckExtension("GL_EXT_copy_texture", &extensionNames) ) + { + _GLEE_EXT_copy_texture = GL_TRUE; + __GLeeLink_GL_EXT_copy_texture(); + } + if (__GLeeCheckExtension("GL_EXT_histogram", &extensionNames) ) + { + _GLEE_EXT_histogram = GL_TRUE; + __GLeeLink_GL_EXT_histogram(); + } + if (__GLeeCheckExtension("GL_EXT_convolution", &extensionNames) ) + { + _GLEE_EXT_convolution = GL_TRUE; + __GLeeLink_GL_EXT_convolution(); + } + if (__GLeeCheckExtension("GL_SGI_color_matrix", &extensionNames) ) + { + _GLEE_SGI_color_matrix = GL_TRUE; + __GLeeLink_GL_SGI_color_matrix(); + } + if (__GLeeCheckExtension("GL_SGI_color_table", &extensionNames) ) + { + _GLEE_SGI_color_table = GL_TRUE; + __GLeeLink_GL_SGI_color_table(); + } + if (__GLeeCheckExtension("GL_SGIS_pixel_texture", &extensionNames) ) + { + _GLEE_SGIS_pixel_texture = GL_TRUE; + __GLeeLink_GL_SGIS_pixel_texture(); + } + if (__GLeeCheckExtension("GL_SGIX_pixel_texture", &extensionNames) ) + { + _GLEE_SGIX_pixel_texture = GL_TRUE; + __GLeeLink_GL_SGIX_pixel_texture(); + } + if (__GLeeCheckExtension("GL_SGIS_texture4D", &extensionNames) ) + { + _GLEE_SGIS_texture4D = GL_TRUE; + __GLeeLink_GL_SGIS_texture4D(); + } + if (__GLeeCheckExtension("GL_SGI_texture_color_table", &extensionNames) ) + { + _GLEE_SGI_texture_color_table = GL_TRUE; + __GLeeLink_GL_SGI_texture_color_table(); + } + if (__GLeeCheckExtension("GL_EXT_cmyka", &extensionNames) ) + { + _GLEE_EXT_cmyka = GL_TRUE; + __GLeeLink_GL_EXT_cmyka(); + } + if (__GLeeCheckExtension("GL_EXT_texture_object", &extensionNames) ) + { + _GLEE_EXT_texture_object = GL_TRUE; + __GLeeLink_GL_EXT_texture_object(); + } + if (__GLeeCheckExtension("GL_SGIS_detail_texture", &extensionNames) ) + { + _GLEE_SGIS_detail_texture = GL_TRUE; + __GLeeLink_GL_SGIS_detail_texture(); + } + if (__GLeeCheckExtension("GL_SGIS_sharpen_texture", &extensionNames) ) + { + _GLEE_SGIS_sharpen_texture = GL_TRUE; + __GLeeLink_GL_SGIS_sharpen_texture(); + } + if (__GLeeCheckExtension("GL_EXT_packed_pixels", &extensionNames) ) + { + _GLEE_EXT_packed_pixels = GL_TRUE; + __GLeeLink_GL_EXT_packed_pixels(); + } + if (__GLeeCheckExtension("GL_SGIS_texture_lod", &extensionNames) ) + { + _GLEE_SGIS_texture_lod = GL_TRUE; + __GLeeLink_GL_SGIS_texture_lod(); + } + if (__GLeeCheckExtension("GL_SGIS_multisample", &extensionNames) ) + { + _GLEE_SGIS_multisample = GL_TRUE; + __GLeeLink_GL_SGIS_multisample(); + } + if (__GLeeCheckExtension("GL_EXT_rescale_normal", &extensionNames) ) + { + _GLEE_EXT_rescale_normal = GL_TRUE; + __GLeeLink_GL_EXT_rescale_normal(); + } + if (__GLeeCheckExtension("GL_EXT_vertex_array", &extensionNames) ) + { + _GLEE_EXT_vertex_array = GL_TRUE; + __GLeeLink_GL_EXT_vertex_array(); + } + if (__GLeeCheckExtension("GL_EXT_misc_attribute", &extensionNames) ) + { + _GLEE_EXT_misc_attribute = GL_TRUE; + __GLeeLink_GL_EXT_misc_attribute(); + } + if (__GLeeCheckExtension("GL_SGIS_generate_mipmap", &extensionNames) ) + { + _GLEE_SGIS_generate_mipmap = GL_TRUE; + __GLeeLink_GL_SGIS_generate_mipmap(); + } + if (__GLeeCheckExtension("GL_SGIX_clipmap", &extensionNames) ) + { + _GLEE_SGIX_clipmap = GL_TRUE; + __GLeeLink_GL_SGIX_clipmap(); + } + if (__GLeeCheckExtension("GL_SGIX_shadow", &extensionNames) ) + { + _GLEE_SGIX_shadow = GL_TRUE; + __GLeeLink_GL_SGIX_shadow(); + } + if (__GLeeCheckExtension("GL_SGIS_texture_edge_clamp", &extensionNames) ) + { + _GLEE_SGIS_texture_edge_clamp = GL_TRUE; + __GLeeLink_GL_SGIS_texture_edge_clamp(); + } + if (__GLeeCheckExtension("GL_SGIS_texture_border_clamp", &extensionNames) ) + { + _GLEE_SGIS_texture_border_clamp = GL_TRUE; + __GLeeLink_GL_SGIS_texture_border_clamp(); + } + if (__GLeeCheckExtension("GL_EXT_blend_minmax", &extensionNames) ) + { + _GLEE_EXT_blend_minmax = GL_TRUE; + __GLeeLink_GL_EXT_blend_minmax(); + } + if (__GLeeCheckExtension("GL_EXT_blend_subtract", &extensionNames) ) + { + _GLEE_EXT_blend_subtract = GL_TRUE; + __GLeeLink_GL_EXT_blend_subtract(); + } + if (__GLeeCheckExtension("GL_EXT_blend_logic_op", &extensionNames) ) + { + _GLEE_EXT_blend_logic_op = GL_TRUE; + __GLeeLink_GL_EXT_blend_logic_op(); + } + if (__GLeeCheckExtension("GL_SGIX_interlace", &extensionNames) ) + { + _GLEE_SGIX_interlace = GL_TRUE; + __GLeeLink_GL_SGIX_interlace(); + } + if (__GLeeCheckExtension("GL_SGIX_pixel_tiles", &extensionNames) ) + { + _GLEE_SGIX_pixel_tiles = GL_TRUE; + __GLeeLink_GL_SGIX_pixel_tiles(); + } + if (__GLeeCheckExtension("GL_SGIS_texture_select", &extensionNames) ) + { + _GLEE_SGIS_texture_select = GL_TRUE; + __GLeeLink_GL_SGIS_texture_select(); + } + if (__GLeeCheckExtension("GL_SGIX_sprite", &extensionNames) ) + { + _GLEE_SGIX_sprite = GL_TRUE; + __GLeeLink_GL_SGIX_sprite(); + } + if (__GLeeCheckExtension("GL_SGIX_texture_multi_buffer", &extensionNames) ) + { + _GLEE_SGIX_texture_multi_buffer = GL_TRUE; + __GLeeLink_GL_SGIX_texture_multi_buffer(); + } + if (__GLeeCheckExtension("GL_EXT_point_parameters", &extensionNames) ) + { + _GLEE_EXT_point_parameters = GL_TRUE; + __GLeeLink_GL_EXT_point_parameters(); + } + if (__GLeeCheckExtension("GL_SGIS_point_parameters", &extensionNames) ) + { + _GLEE_SGIS_point_parameters = GL_TRUE; + __GLeeLink_GL_SGIS_point_parameters(); + } + if (__GLeeCheckExtension("GL_SGIX_instruments", &extensionNames) ) + { + _GLEE_SGIX_instruments = GL_TRUE; + __GLeeLink_GL_SGIX_instruments(); + } + if (__GLeeCheckExtension("GL_SGIX_texture_scale_bias", &extensionNames) ) + { + _GLEE_SGIX_texture_scale_bias = GL_TRUE; + __GLeeLink_GL_SGIX_texture_scale_bias(); + } + if (__GLeeCheckExtension("GL_SGIX_framezoom", &extensionNames) ) + { + _GLEE_SGIX_framezoom = GL_TRUE; + __GLeeLink_GL_SGIX_framezoom(); + } + if (__GLeeCheckExtension("GL_SGIX_tag_sample_buffer", &extensionNames) ) + { + _GLEE_SGIX_tag_sample_buffer = GL_TRUE; + __GLeeLink_GL_SGIX_tag_sample_buffer(); + } + if (__GLeeCheckExtension("GL_FfdMaskSGIX", &extensionNames) ) + { + _GLEE_FfdMaskSGIX = GL_TRUE; + __GLeeLink_GL_FfdMaskSGIX(); + } + if (__GLeeCheckExtension("GL_SGIX_polynomial_ffd", &extensionNames) ) + { + _GLEE_SGIX_polynomial_ffd = GL_TRUE; + __GLeeLink_GL_SGIX_polynomial_ffd(); + } + if (__GLeeCheckExtension("GL_SGIX_reference_plane", &extensionNames) ) + { + _GLEE_SGIX_reference_plane = GL_TRUE; + __GLeeLink_GL_SGIX_reference_plane(); + } + if (__GLeeCheckExtension("GL_SGIX_flush_raster", &extensionNames) ) + { + _GLEE_SGIX_flush_raster = GL_TRUE; + __GLeeLink_GL_SGIX_flush_raster(); + } + if (__GLeeCheckExtension("GL_SGIX_depth_texture", &extensionNames) ) + { + _GLEE_SGIX_depth_texture = GL_TRUE; + __GLeeLink_GL_SGIX_depth_texture(); + } + if (__GLeeCheckExtension("GL_SGIS_fog_function", &extensionNames) ) + { + _GLEE_SGIS_fog_function = GL_TRUE; + __GLeeLink_GL_SGIS_fog_function(); + } + if (__GLeeCheckExtension("GL_SGIX_fog_offset", &extensionNames) ) + { + _GLEE_SGIX_fog_offset = GL_TRUE; + __GLeeLink_GL_SGIX_fog_offset(); + } + if (__GLeeCheckExtension("GL_HP_image_transform", &extensionNames) ) + { + _GLEE_HP_image_transform = GL_TRUE; + __GLeeLink_GL_HP_image_transform(); + } + if (__GLeeCheckExtension("GL_HP_convolution_border_modes", &extensionNames) ) + { + _GLEE_HP_convolution_border_modes = GL_TRUE; + __GLeeLink_GL_HP_convolution_border_modes(); + } + if (__GLeeCheckExtension("GL_INGR_palette_buffer", &extensionNames) ) + { + _GLEE_INGR_palette_buffer = GL_TRUE; + __GLeeLink_GL_INGR_palette_buffer(); + } + if (__GLeeCheckExtension("GL_SGIX_texture_add_env", &extensionNames) ) + { + _GLEE_SGIX_texture_add_env = GL_TRUE; + __GLeeLink_GL_SGIX_texture_add_env(); + } + if (__GLeeCheckExtension("GL_EXT_color_subtable", &extensionNames) ) + { + _GLEE_EXT_color_subtable = GL_TRUE; + __GLeeLink_GL_EXT_color_subtable(); + } + if (__GLeeCheckExtension("GL_PGI_vertex_hints", &extensionNames) ) + { + _GLEE_PGI_vertex_hints = GL_TRUE; + __GLeeLink_GL_PGI_vertex_hints(); + } + if (__GLeeCheckExtension("GL_PGI_misc_hints", &extensionNames) ) + { + _GLEE_PGI_misc_hints = GL_TRUE; + __GLeeLink_GL_PGI_misc_hints(); + } + if (__GLeeCheckExtension("GL_EXT_paletted_texture", &extensionNames) ) + { + _GLEE_EXT_paletted_texture = GL_TRUE; + __GLeeLink_GL_EXT_paletted_texture(); + } + if (__GLeeCheckExtension("GL_EXT_clip_volume_hint", &extensionNames) ) + { + _GLEE_EXT_clip_volume_hint = GL_TRUE; + __GLeeLink_GL_EXT_clip_volume_hint(); + } + if (__GLeeCheckExtension("GL_SGIX_list_priority", &extensionNames) ) + { + _GLEE_SGIX_list_priority = GL_TRUE; + __GLeeLink_GL_SGIX_list_priority(); + } + if (__GLeeCheckExtension("GL_SGIX_ir_instrument1", &extensionNames) ) + { + _GLEE_SGIX_ir_instrument1 = GL_TRUE; + __GLeeLink_GL_SGIX_ir_instrument1(); + } + if (__GLeeCheckExtension("GL_SGIX_calligraphic_fragment", &extensionNames) ) + { + _GLEE_SGIX_calligraphic_fragment = GL_TRUE; + __GLeeLink_GL_SGIX_calligraphic_fragment(); + } + if (__GLeeCheckExtension("GL_SGIX_texture_lod_bias", &extensionNames) ) + { + _GLEE_SGIX_texture_lod_bias = GL_TRUE; + __GLeeLink_GL_SGIX_texture_lod_bias(); + } + if (__GLeeCheckExtension("GL_SGIX_shadow_ambient", &extensionNames) ) + { + _GLEE_SGIX_shadow_ambient = GL_TRUE; + __GLeeLink_GL_SGIX_shadow_ambient(); + } + if (__GLeeCheckExtension("GL_EXT_index_texture", &extensionNames) ) + { + _GLEE_EXT_index_texture = GL_TRUE; + __GLeeLink_GL_EXT_index_texture(); + } + if (__GLeeCheckExtension("GL_EXT_index_material", &extensionNames) ) + { + _GLEE_EXT_index_material = GL_TRUE; + __GLeeLink_GL_EXT_index_material(); + } + if (__GLeeCheckExtension("GL_EXT_index_func", &extensionNames) ) + { + _GLEE_EXT_index_func = GL_TRUE; + __GLeeLink_GL_EXT_index_func(); + } + if (__GLeeCheckExtension("GL_EXT_index_array_formats", &extensionNames) ) + { + _GLEE_EXT_index_array_formats = GL_TRUE; + __GLeeLink_GL_EXT_index_array_formats(); + } + if (__GLeeCheckExtension("GL_EXT_compiled_vertex_array", &extensionNames) ) + { + _GLEE_EXT_compiled_vertex_array = GL_TRUE; + __GLeeLink_GL_EXT_compiled_vertex_array(); + } + if (__GLeeCheckExtension("GL_EXT_cull_vertex", &extensionNames) ) + { + _GLEE_EXT_cull_vertex = GL_TRUE; + __GLeeLink_GL_EXT_cull_vertex(); + } + if (__GLeeCheckExtension("GL_SGIX_ycrcb", &extensionNames) ) + { + _GLEE_SGIX_ycrcb = GL_TRUE; + __GLeeLink_GL_SGIX_ycrcb(); + } + if (__GLeeCheckExtension("GL_SGIX_fragment_lighting", &extensionNames) ) + { + _GLEE_SGIX_fragment_lighting = GL_TRUE; + __GLeeLink_GL_SGIX_fragment_lighting(); + } + if (__GLeeCheckExtension("GL_IBM_rasterpos_clip", &extensionNames) ) + { + _GLEE_IBM_rasterpos_clip = GL_TRUE; + __GLeeLink_GL_IBM_rasterpos_clip(); + } + if (__GLeeCheckExtension("GL_HP_texture_lighting", &extensionNames) ) + { + _GLEE_HP_texture_lighting = GL_TRUE; + __GLeeLink_GL_HP_texture_lighting(); + } + if (__GLeeCheckExtension("GL_EXT_draw_range_elements", &extensionNames) ) + { + _GLEE_EXT_draw_range_elements = GL_TRUE; + __GLeeLink_GL_EXT_draw_range_elements(); + } + if (__GLeeCheckExtension("GL_WIN_phong_shading", &extensionNames) ) + { + _GLEE_WIN_phong_shading = GL_TRUE; + __GLeeLink_GL_WIN_phong_shading(); + } + if (__GLeeCheckExtension("GL_WIN_specular_fog", &extensionNames) ) + { + _GLEE_WIN_specular_fog = GL_TRUE; + __GLeeLink_GL_WIN_specular_fog(); + } + if (__GLeeCheckExtension("GL_EXT_light_texture", &extensionNames) ) + { + _GLEE_EXT_light_texture = GL_TRUE; + __GLeeLink_GL_EXT_light_texture(); + } + if (__GLeeCheckExtension("GL_SGIX_blend_alpha_minmax", &extensionNames) ) + { + _GLEE_SGIX_blend_alpha_minmax = GL_TRUE; + __GLeeLink_GL_SGIX_blend_alpha_minmax(); + } + if (__GLeeCheckExtension("GL_SGIX_impact_pixel_texture", &extensionNames) ) + { + _GLEE_SGIX_impact_pixel_texture = GL_TRUE; + __GLeeLink_GL_SGIX_impact_pixel_texture(); + } + if (__GLeeCheckExtension("GL_EXT_bgra", &extensionNames) ) + { + _GLEE_EXT_bgra = GL_TRUE; + __GLeeLink_GL_EXT_bgra(); + } + if (__GLeeCheckExtension("GL_SGIX_async", &extensionNames) ) + { + _GLEE_SGIX_async = GL_TRUE; + __GLeeLink_GL_SGIX_async(); + } + if (__GLeeCheckExtension("GL_SGIX_async_pixel", &extensionNames) ) + { + _GLEE_SGIX_async_pixel = GL_TRUE; + __GLeeLink_GL_SGIX_async_pixel(); + } + if (__GLeeCheckExtension("GL_SGIX_async_histogram", &extensionNames) ) + { + _GLEE_SGIX_async_histogram = GL_TRUE; + __GLeeLink_GL_SGIX_async_histogram(); + } + if (__GLeeCheckExtension("GL_INTEL_texture_scissor", &extensionNames) ) + { + _GLEE_INTEL_texture_scissor = GL_TRUE; + __GLeeLink_GL_INTEL_texture_scissor(); + } + if (__GLeeCheckExtension("GL_INTEL_parallel_arrays", &extensionNames) ) + { + _GLEE_INTEL_parallel_arrays = GL_TRUE; + __GLeeLink_GL_INTEL_parallel_arrays(); + } + if (__GLeeCheckExtension("GL_HP_occlusion_test", &extensionNames) ) + { + _GLEE_HP_occlusion_test = GL_TRUE; + __GLeeLink_GL_HP_occlusion_test(); + } + if (__GLeeCheckExtension("GL_EXT_pixel_transform", &extensionNames) ) + { + _GLEE_EXT_pixel_transform = GL_TRUE; + __GLeeLink_GL_EXT_pixel_transform(); + } + if (__GLeeCheckExtension("GL_EXT_pixel_transform_color_table", &extensionNames) ) + { + _GLEE_EXT_pixel_transform_color_table = GL_TRUE; + __GLeeLink_GL_EXT_pixel_transform_color_table(); + } + if (__GLeeCheckExtension("GL_EXT_shared_texture_palette", &extensionNames) ) + { + _GLEE_EXT_shared_texture_palette = GL_TRUE; + __GLeeLink_GL_EXT_shared_texture_palette(); + } + if (__GLeeCheckExtension("GL_EXT_separate_specular_color", &extensionNames) ) + { + _GLEE_EXT_separate_specular_color = GL_TRUE; + __GLeeLink_GL_EXT_separate_specular_color(); + } + if (__GLeeCheckExtension("GL_EXT_secondary_color", &extensionNames) ) + { + _GLEE_EXT_secondary_color = GL_TRUE; + __GLeeLink_GL_EXT_secondary_color(); + } + if (__GLeeCheckExtension("GL_EXT_texture_perturb_normal", &extensionNames) ) + { + _GLEE_EXT_texture_perturb_normal = GL_TRUE; + __GLeeLink_GL_EXT_texture_perturb_normal(); + } + if (__GLeeCheckExtension("GL_EXT_multi_draw_arrays", &extensionNames) ) + { + _GLEE_EXT_multi_draw_arrays = GL_TRUE; + __GLeeLink_GL_EXT_multi_draw_arrays(); + } + if (__GLeeCheckExtension("GL_EXT_fog_coord", &extensionNames) ) + { + _GLEE_EXT_fog_coord = GL_TRUE; + __GLeeLink_GL_EXT_fog_coord(); + } + if (__GLeeCheckExtension("GL_REND_screen_coordinates", &extensionNames) ) + { + _GLEE_REND_screen_coordinates = GL_TRUE; + __GLeeLink_GL_REND_screen_coordinates(); + } + if (__GLeeCheckExtension("GL_EXT_coordinate_frame", &extensionNames) ) + { + _GLEE_EXT_coordinate_frame = GL_TRUE; + __GLeeLink_GL_EXT_coordinate_frame(); + } + if (__GLeeCheckExtension("GL_EXT_texture_env_combine", &extensionNames) ) + { + _GLEE_EXT_texture_env_combine = GL_TRUE; + __GLeeLink_GL_EXT_texture_env_combine(); + } + if (__GLeeCheckExtension("GL_APPLE_specular_vector", &extensionNames) ) + { + _GLEE_APPLE_specular_vector = GL_TRUE; + __GLeeLink_GL_APPLE_specular_vector(); + } + if (__GLeeCheckExtension("GL_APPLE_transform_hint", &extensionNames) ) + { + _GLEE_APPLE_transform_hint = GL_TRUE; + __GLeeLink_GL_APPLE_transform_hint(); + } + if (__GLeeCheckExtension("GL_SGIX_fog_scale", &extensionNames) ) + { + _GLEE_SGIX_fog_scale = GL_TRUE; + __GLeeLink_GL_SGIX_fog_scale(); + } + if (__GLeeCheckExtension("GL_SUNX_constant_data", &extensionNames) ) + { + _GLEE_SUNX_constant_data = GL_TRUE; + __GLeeLink_GL_SUNX_constant_data(); + } + if (__GLeeCheckExtension("GL_SUN_global_alpha", &extensionNames) ) + { + _GLEE_SUN_global_alpha = GL_TRUE; + __GLeeLink_GL_SUN_global_alpha(); + } + if (__GLeeCheckExtension("GL_SUN_triangle_list", &extensionNames) ) + { + _GLEE_SUN_triangle_list = GL_TRUE; + __GLeeLink_GL_SUN_triangle_list(); + } + if (__GLeeCheckExtension("GL_SUN_vertex", &extensionNames) ) + { + _GLEE_SUN_vertex = GL_TRUE; + __GLeeLink_GL_SUN_vertex(); + } + if (__GLeeCheckExtension("GL_EXT_blend_func_separate", &extensionNames) ) + { + _GLEE_EXT_blend_func_separate = GL_TRUE; + __GLeeLink_GL_EXT_blend_func_separate(); + } + if (__GLeeCheckExtension("GL_INGR_color_clamp", &extensionNames) ) + { + _GLEE_INGR_color_clamp = GL_TRUE; + __GLeeLink_GL_INGR_color_clamp(); + } + if (__GLeeCheckExtension("GL_INGR_interlace_read", &extensionNames) ) + { + _GLEE_INGR_interlace_read = GL_TRUE; + __GLeeLink_GL_INGR_interlace_read(); + } + if (__GLeeCheckExtension("GL_EXT_stencil_wrap", &extensionNames) ) + { + _GLEE_EXT_stencil_wrap = GL_TRUE; + __GLeeLink_GL_EXT_stencil_wrap(); + } + if (__GLeeCheckExtension("GL_EXT_422_pixels", &extensionNames) ) + { + _GLEE_EXT_422_pixels = GL_TRUE; + __GLeeLink_GL_EXT_422_pixels(); + } + if (__GLeeCheckExtension("GL_NV_texgen_reflection", &extensionNames) ) + { + _GLEE_NV_texgen_reflection = GL_TRUE; + __GLeeLink_GL_NV_texgen_reflection(); + } + if (__GLeeCheckExtension("GL_EXT_texture_cube_map", &extensionNames) ) + { + _GLEE_EXT_texture_cube_map = GL_TRUE; + __GLeeLink_GL_EXT_texture_cube_map(); + } + if (__GLeeCheckExtension("GL_SUN_convolution_border_modes", &extensionNames) ) + { + _GLEE_SUN_convolution_border_modes = GL_TRUE; + __GLeeLink_GL_SUN_convolution_border_modes(); + } + if (__GLeeCheckExtension("GL_EXT_texture_env_add", &extensionNames) ) + { + _GLEE_EXT_texture_env_add = GL_TRUE; + __GLeeLink_GL_EXT_texture_env_add(); + } + if (__GLeeCheckExtension("GL_EXT_texture_lod_bias", &extensionNames) ) + { + _GLEE_EXT_texture_lod_bias = GL_TRUE; + __GLeeLink_GL_EXT_texture_lod_bias(); + } + if (__GLeeCheckExtension("GL_EXT_texture_filter_anisotropic", &extensionNames) ) + { + _GLEE_EXT_texture_filter_anisotropic = GL_TRUE; + __GLeeLink_GL_EXT_texture_filter_anisotropic(); + } + if (__GLeeCheckExtension("GL_EXT_vertex_weighting", &extensionNames) ) + { + _GLEE_EXT_vertex_weighting = GL_TRUE; + __GLeeLink_GL_EXT_vertex_weighting(); + } + if (__GLeeCheckExtension("GL_NV_light_max_exponent", &extensionNames) ) + { + _GLEE_NV_light_max_exponent = GL_TRUE; + __GLeeLink_GL_NV_light_max_exponent(); + } + if (__GLeeCheckExtension("GL_NV_vertex_array_range", &extensionNames) ) + { + _GLEE_NV_vertex_array_range = GL_TRUE; + __GLeeLink_GL_NV_vertex_array_range(); + } + if (__GLeeCheckExtension("GL_NV_register_combiners", &extensionNames) ) + { + _GLEE_NV_register_combiners = GL_TRUE; + __GLeeLink_GL_NV_register_combiners(); + } + if (__GLeeCheckExtension("GL_NV_fog_distance", &extensionNames) ) + { + _GLEE_NV_fog_distance = GL_TRUE; + __GLeeLink_GL_NV_fog_distance(); + } + if (__GLeeCheckExtension("GL_NV_texgen_emboss", &extensionNames) ) + { + _GLEE_NV_texgen_emboss = GL_TRUE; + __GLeeLink_GL_NV_texgen_emboss(); + } + if (__GLeeCheckExtension("GL_NV_blend_square", &extensionNames) ) + { + _GLEE_NV_blend_square = GL_TRUE; + __GLeeLink_GL_NV_blend_square(); + } + if (__GLeeCheckExtension("GL_NV_texture_env_combine4", &extensionNames) ) + { + _GLEE_NV_texture_env_combine4 = GL_TRUE; + __GLeeLink_GL_NV_texture_env_combine4(); + } + if (__GLeeCheckExtension("GL_MESA_resize_buffers", &extensionNames) ) + { + _GLEE_MESA_resize_buffers = GL_TRUE; + __GLeeLink_GL_MESA_resize_buffers(); + } + if (__GLeeCheckExtension("GL_MESA_window_pos", &extensionNames) ) + { + _GLEE_MESA_window_pos = GL_TRUE; + __GLeeLink_GL_MESA_window_pos(); + } + if (__GLeeCheckExtension("GL_EXT_texture_compression_s3tc", &extensionNames) ) + { + _GLEE_EXT_texture_compression_s3tc = GL_TRUE; + __GLeeLink_GL_EXT_texture_compression_s3tc(); + } + if (__GLeeCheckExtension("GL_IBM_cull_vertex", &extensionNames) ) + { + _GLEE_IBM_cull_vertex = GL_TRUE; + __GLeeLink_GL_IBM_cull_vertex(); + } + if (__GLeeCheckExtension("GL_IBM_multimode_draw_arrays", &extensionNames) ) + { + _GLEE_IBM_multimode_draw_arrays = GL_TRUE; + __GLeeLink_GL_IBM_multimode_draw_arrays(); + } + if (__GLeeCheckExtension("GL_IBM_vertex_array_lists", &extensionNames) ) + { + _GLEE_IBM_vertex_array_lists = GL_TRUE; + __GLeeLink_GL_IBM_vertex_array_lists(); + } + if (__GLeeCheckExtension("GL_SGIX_subsample", &extensionNames) ) + { + _GLEE_SGIX_subsample = GL_TRUE; + __GLeeLink_GL_SGIX_subsample(); + } + if (__GLeeCheckExtension("GL_SGIX_ycrcb_subsample", &extensionNames) ) + { + _GLEE_SGIX_ycrcb_subsample = GL_TRUE; + __GLeeLink_GL_SGIX_ycrcb_subsample(); + } + if (__GLeeCheckExtension("GL_SGIX_ycrcba", &extensionNames) ) + { + _GLEE_SGIX_ycrcba = GL_TRUE; + __GLeeLink_GL_SGIX_ycrcba(); + } + if (__GLeeCheckExtension("GL_SGI_depth_pass_instrument", &extensionNames) ) + { + _GLEE_SGI_depth_pass_instrument = GL_TRUE; + __GLeeLink_GL_SGI_depth_pass_instrument(); + } + if (__GLeeCheckExtension("GL_3DFX_texture_compression_FXT1", &extensionNames) ) + { + _GLEE_3DFX_texture_compression_FXT1 = GL_TRUE; + __GLeeLink_GL_3DFX_texture_compression_FXT1(); + } + if (__GLeeCheckExtension("GL_3DFX_multisample", &extensionNames) ) + { + _GLEE_3DFX_multisample = GL_TRUE; + __GLeeLink_GL_3DFX_multisample(); + } + if (__GLeeCheckExtension("GL_3DFX_tbuffer", &extensionNames) ) + { + _GLEE_3DFX_tbuffer = GL_TRUE; + __GLeeLink_GL_3DFX_tbuffer(); + } + if (__GLeeCheckExtension("GL_EXT_multisample", &extensionNames) ) + { + _GLEE_EXT_multisample = GL_TRUE; + __GLeeLink_GL_EXT_multisample(); + } + if (__GLeeCheckExtension("GL_SGIX_vertex_preclip", &extensionNames) ) + { + _GLEE_SGIX_vertex_preclip = GL_TRUE; + __GLeeLink_GL_SGIX_vertex_preclip(); + } + if (__GLeeCheckExtension("GL_SGIX_convolution_accuracy", &extensionNames) ) + { + _GLEE_SGIX_convolution_accuracy = GL_TRUE; + __GLeeLink_GL_SGIX_convolution_accuracy(); + } + if (__GLeeCheckExtension("GL_SGIX_resample", &extensionNames) ) + { + _GLEE_SGIX_resample = GL_TRUE; + __GLeeLink_GL_SGIX_resample(); + } + if (__GLeeCheckExtension("GL_SGIS_point_line_texgen", &extensionNames) ) + { + _GLEE_SGIS_point_line_texgen = GL_TRUE; + __GLeeLink_GL_SGIS_point_line_texgen(); + } + if (__GLeeCheckExtension("GL_SGIS_texture_color_mask", &extensionNames) ) + { + _GLEE_SGIS_texture_color_mask = GL_TRUE; + __GLeeLink_GL_SGIS_texture_color_mask(); + } + if (__GLeeCheckExtension("GL_EXT_texture_env_dot3", &extensionNames) ) + { + _GLEE_EXT_texture_env_dot3 = GL_TRUE; + __GLeeLink_GL_EXT_texture_env_dot3(); + } + if (__GLeeCheckExtension("GL_ATI_texture_mirror_once", &extensionNames) ) + { + _GLEE_ATI_texture_mirror_once = GL_TRUE; + __GLeeLink_GL_ATI_texture_mirror_once(); + } + if (__GLeeCheckExtension("GL_NV_fence", &extensionNames) ) + { + _GLEE_NV_fence = GL_TRUE; + __GLeeLink_GL_NV_fence(); + } + if (__GLeeCheckExtension("GL_IBM_texture_mirrored_repeat", &extensionNames) ) + { + _GLEE_IBM_texture_mirrored_repeat = GL_TRUE; + __GLeeLink_GL_IBM_texture_mirrored_repeat(); + } + if (__GLeeCheckExtension("GL_NV_evaluators", &extensionNames) ) + { + _GLEE_NV_evaluators = GL_TRUE; + __GLeeLink_GL_NV_evaluators(); + } + if (__GLeeCheckExtension("GL_NV_packed_depth_stencil", &extensionNames) ) + { + _GLEE_NV_packed_depth_stencil = GL_TRUE; + __GLeeLink_GL_NV_packed_depth_stencil(); + } + if (__GLeeCheckExtension("GL_NV_register_combiners2", &extensionNames) ) + { + _GLEE_NV_register_combiners2 = GL_TRUE; + __GLeeLink_GL_NV_register_combiners2(); + } + if (__GLeeCheckExtension("GL_NV_texture_compression_vtc", &extensionNames) ) + { + _GLEE_NV_texture_compression_vtc = GL_TRUE; + __GLeeLink_GL_NV_texture_compression_vtc(); + } + if (__GLeeCheckExtension("GL_NV_texture_rectangle", &extensionNames) ) + { + _GLEE_NV_texture_rectangle = GL_TRUE; + __GLeeLink_GL_NV_texture_rectangle(); + } + if (__GLeeCheckExtension("GL_NV_texture_shader", &extensionNames) ) + { + _GLEE_NV_texture_shader = GL_TRUE; + __GLeeLink_GL_NV_texture_shader(); + } + if (__GLeeCheckExtension("GL_NV_texture_shader2", &extensionNames) ) + { + _GLEE_NV_texture_shader2 = GL_TRUE; + __GLeeLink_GL_NV_texture_shader2(); + } + if (__GLeeCheckExtension("GL_NV_vertex_array_range2", &extensionNames) ) + { + _GLEE_NV_vertex_array_range2 = GL_TRUE; + __GLeeLink_GL_NV_vertex_array_range2(); + } + if (__GLeeCheckExtension("GL_NV_vertex_program", &extensionNames) ) + { + _GLEE_NV_vertex_program = GL_TRUE; + __GLeeLink_GL_NV_vertex_program(); + } + if (__GLeeCheckExtension("GL_SGIX_texture_coordinate_clamp", &extensionNames) ) + { + _GLEE_SGIX_texture_coordinate_clamp = GL_TRUE; + __GLeeLink_GL_SGIX_texture_coordinate_clamp(); + } + if (__GLeeCheckExtension("GL_SGIX_scalebias_hint", &extensionNames) ) + { + _GLEE_SGIX_scalebias_hint = GL_TRUE; + __GLeeLink_GL_SGIX_scalebias_hint(); + } + if (__GLeeCheckExtension("GL_OML_interlace", &extensionNames) ) + { + _GLEE_OML_interlace = GL_TRUE; + __GLeeLink_GL_OML_interlace(); + } + if (__GLeeCheckExtension("GL_OML_subsample", &extensionNames) ) + { + _GLEE_OML_subsample = GL_TRUE; + __GLeeLink_GL_OML_subsample(); + } + if (__GLeeCheckExtension("GL_OML_resample", &extensionNames) ) + { + _GLEE_OML_resample = GL_TRUE; + __GLeeLink_GL_OML_resample(); + } + if (__GLeeCheckExtension("GL_NV_copy_depth_to_color", &extensionNames) ) + { + _GLEE_NV_copy_depth_to_color = GL_TRUE; + __GLeeLink_GL_NV_copy_depth_to_color(); + } + if (__GLeeCheckExtension("GL_ATI_envmap_bumpmap", &extensionNames) ) + { + _GLEE_ATI_envmap_bumpmap = GL_TRUE; + __GLeeLink_GL_ATI_envmap_bumpmap(); + } + if (__GLeeCheckExtension("GL_ATI_fragment_shader", &extensionNames) ) + { + _GLEE_ATI_fragment_shader = GL_TRUE; + __GLeeLink_GL_ATI_fragment_shader(); + } + if (__GLeeCheckExtension("GL_ATI_pn_triangles", &extensionNames) ) + { + _GLEE_ATI_pn_triangles = GL_TRUE; + __GLeeLink_GL_ATI_pn_triangles(); + } + if (__GLeeCheckExtension("GL_ATI_vertex_array_object", &extensionNames) ) + { + _GLEE_ATI_vertex_array_object = GL_TRUE; + __GLeeLink_GL_ATI_vertex_array_object(); + } + if (__GLeeCheckExtension("GL_EXT_vertex_shader", &extensionNames) ) + { + _GLEE_EXT_vertex_shader = GL_TRUE; + __GLeeLink_GL_EXT_vertex_shader(); + } + if (__GLeeCheckExtension("GL_ATI_vertex_streams", &extensionNames) ) + { + _GLEE_ATI_vertex_streams = GL_TRUE; + __GLeeLink_GL_ATI_vertex_streams(); + } + if (__GLeeCheckExtension("GL_ATI_element_array", &extensionNames) ) + { + _GLEE_ATI_element_array = GL_TRUE; + __GLeeLink_GL_ATI_element_array(); + } + if (__GLeeCheckExtension("GL_SUN_mesh_array", &extensionNames) ) + { + _GLEE_SUN_mesh_array = GL_TRUE; + __GLeeLink_GL_SUN_mesh_array(); + } + if (__GLeeCheckExtension("GL_SUN_slice_accum", &extensionNames) ) + { + _GLEE_SUN_slice_accum = GL_TRUE; + __GLeeLink_GL_SUN_slice_accum(); + } + if (__GLeeCheckExtension("GL_NV_multisample_filter_hint", &extensionNames) ) + { + _GLEE_NV_multisample_filter_hint = GL_TRUE; + __GLeeLink_GL_NV_multisample_filter_hint(); + } + if (__GLeeCheckExtension("GL_NV_depth_clamp", &extensionNames) ) + { + _GLEE_NV_depth_clamp = GL_TRUE; + __GLeeLink_GL_NV_depth_clamp(); + } + if (__GLeeCheckExtension("GL_NV_occlusion_query", &extensionNames) ) + { + _GLEE_NV_occlusion_query = GL_TRUE; + __GLeeLink_GL_NV_occlusion_query(); + } + if (__GLeeCheckExtension("GL_NV_point_sprite", &extensionNames) ) + { + _GLEE_NV_point_sprite = GL_TRUE; + __GLeeLink_GL_NV_point_sprite(); + } + if (__GLeeCheckExtension("GL_NV_texture_shader3", &extensionNames) ) + { + _GLEE_NV_texture_shader3 = GL_TRUE; + __GLeeLink_GL_NV_texture_shader3(); + } + if (__GLeeCheckExtension("GL_NV_vertex_program1_1", &extensionNames) ) + { + _GLEE_NV_vertex_program1_1 = GL_TRUE; + __GLeeLink_GL_NV_vertex_program1_1(); + } + if (__GLeeCheckExtension("GL_EXT_shadow_funcs", &extensionNames) ) + { + _GLEE_EXT_shadow_funcs = GL_TRUE; + __GLeeLink_GL_EXT_shadow_funcs(); + } + if (__GLeeCheckExtension("GL_EXT_stencil_two_side", &extensionNames) ) + { + _GLEE_EXT_stencil_two_side = GL_TRUE; + __GLeeLink_GL_EXT_stencil_two_side(); + } + if (__GLeeCheckExtension("GL_ATI_text_fragment_shader", &extensionNames) ) + { + _GLEE_ATI_text_fragment_shader = GL_TRUE; + __GLeeLink_GL_ATI_text_fragment_shader(); + } + if (__GLeeCheckExtension("GL_APPLE_client_storage", &extensionNames) ) + { + _GLEE_APPLE_client_storage = GL_TRUE; + __GLeeLink_GL_APPLE_client_storage(); + } + if (__GLeeCheckExtension("GL_APPLE_element_array", &extensionNames) ) + { + _GLEE_APPLE_element_array = GL_TRUE; + __GLeeLink_GL_APPLE_element_array(); + } + if (__GLeeCheckExtension("GL_APPLE_fence", &extensionNames) ) + { + _GLEE_APPLE_fence = GL_TRUE; + __GLeeLink_GL_APPLE_fence(); + } + if (__GLeeCheckExtension("GL_APPLE_vertex_array_object", &extensionNames) ) + { + _GLEE_APPLE_vertex_array_object = GL_TRUE; + __GLeeLink_GL_APPLE_vertex_array_object(); + } + if (__GLeeCheckExtension("GL_APPLE_vertex_array_range", &extensionNames) ) + { + _GLEE_APPLE_vertex_array_range = GL_TRUE; + __GLeeLink_GL_APPLE_vertex_array_range(); + } + if (__GLeeCheckExtension("GL_APPLE_ycbcr_422", &extensionNames) ) + { + _GLEE_APPLE_ycbcr_422 = GL_TRUE; + __GLeeLink_GL_APPLE_ycbcr_422(); + } + if (__GLeeCheckExtension("GL_S3_s3tc", &extensionNames) ) + { + _GLEE_S3_s3tc = GL_TRUE; + __GLeeLink_GL_S3_s3tc(); + } + if (__GLeeCheckExtension("GL_ATI_draw_buffers", &extensionNames) ) + { + _GLEE_ATI_draw_buffers = GL_TRUE; + __GLeeLink_GL_ATI_draw_buffers(); + } + if (__GLeeCheckExtension("GL_ATI_pixel_format_float", &extensionNames) ) + { + _GLEE_ATI_pixel_format_float = GL_TRUE; + __GLeeLink_GL_ATI_pixel_format_float(); + } + if (__GLeeCheckExtension("GL_ATI_texture_env_combine3", &extensionNames) ) + { + _GLEE_ATI_texture_env_combine3 = GL_TRUE; + __GLeeLink_GL_ATI_texture_env_combine3(); + } + if (__GLeeCheckExtension("GL_ATI_texture_float", &extensionNames) ) + { + _GLEE_ATI_texture_float = GL_TRUE; + __GLeeLink_GL_ATI_texture_float(); + } + if (__GLeeCheckExtension("GL_NV_float_buffer", &extensionNames) ) + { + _GLEE_NV_float_buffer = GL_TRUE; + __GLeeLink_GL_NV_float_buffer(); + } + if (__GLeeCheckExtension("GL_NV_fragment_program", &extensionNames) ) + { + _GLEE_NV_fragment_program = GL_TRUE; + __GLeeLink_GL_NV_fragment_program(); + } + if (__GLeeCheckExtension("GL_NV_half_float", &extensionNames) ) + { + _GLEE_NV_half_float = GL_TRUE; + __GLeeLink_GL_NV_half_float(); + } + if (__GLeeCheckExtension("GL_NV_pixel_data_range", &extensionNames) ) + { + _GLEE_NV_pixel_data_range = GL_TRUE; + __GLeeLink_GL_NV_pixel_data_range(); + } + if (__GLeeCheckExtension("GL_NV_primitive_restart", &extensionNames) ) + { + _GLEE_NV_primitive_restart = GL_TRUE; + __GLeeLink_GL_NV_primitive_restart(); + } + if (__GLeeCheckExtension("GL_NV_texture_expand_normal", &extensionNames) ) + { + _GLEE_NV_texture_expand_normal = GL_TRUE; + __GLeeLink_GL_NV_texture_expand_normal(); + } + if (__GLeeCheckExtension("GL_NV_vertex_program2", &extensionNames) ) + { + _GLEE_NV_vertex_program2 = GL_TRUE; + __GLeeLink_GL_NV_vertex_program2(); + } + if (__GLeeCheckExtension("GL_ATI_map_object_buffer", &extensionNames) ) + { + _GLEE_ATI_map_object_buffer = GL_TRUE; + __GLeeLink_GL_ATI_map_object_buffer(); + } + if (__GLeeCheckExtension("GL_ATI_separate_stencil", &extensionNames) ) + { + _GLEE_ATI_separate_stencil = GL_TRUE; + __GLeeLink_GL_ATI_separate_stencil(); + } + if (__GLeeCheckExtension("GL_ATI_vertex_attrib_array_object", &extensionNames) ) + { + _GLEE_ATI_vertex_attrib_array_object = GL_TRUE; + __GLeeLink_GL_ATI_vertex_attrib_array_object(); + } + if (__GLeeCheckExtension("GL_OES_read_format", &extensionNames) ) + { + _GLEE_OES_read_format = GL_TRUE; + __GLeeLink_GL_OES_read_format(); + } + if (__GLeeCheckExtension("GL_EXT_depth_bounds_test", &extensionNames) ) + { + _GLEE_EXT_depth_bounds_test = GL_TRUE; + __GLeeLink_GL_EXT_depth_bounds_test(); + } + if (__GLeeCheckExtension("GL_EXT_texture_mirror_clamp", &extensionNames) ) + { + _GLEE_EXT_texture_mirror_clamp = GL_TRUE; + __GLeeLink_GL_EXT_texture_mirror_clamp(); + } + if (__GLeeCheckExtension("GL_EXT_blend_equation_separate", &extensionNames) ) + { + _GLEE_EXT_blend_equation_separate = GL_TRUE; + __GLeeLink_GL_EXT_blend_equation_separate(); + } + if (__GLeeCheckExtension("GL_MESA_pack_invert", &extensionNames) ) + { + _GLEE_MESA_pack_invert = GL_TRUE; + __GLeeLink_GL_MESA_pack_invert(); + } + if (__GLeeCheckExtension("GL_MESA_ycbcr_texture", &extensionNames) ) + { + _GLEE_MESA_ycbcr_texture = GL_TRUE; + __GLeeLink_GL_MESA_ycbcr_texture(); + } + if (__GLeeCheckExtension("GL_EXT_pixel_buffer_object", &extensionNames) ) + { + _GLEE_EXT_pixel_buffer_object = GL_TRUE; + __GLeeLink_GL_EXT_pixel_buffer_object(); + } + if (__GLeeCheckExtension("GL_NV_fragment_program_option", &extensionNames) ) + { + _GLEE_NV_fragment_program_option = GL_TRUE; + __GLeeLink_GL_NV_fragment_program_option(); + } + if (__GLeeCheckExtension("GL_NV_fragment_program2", &extensionNames) ) + { + _GLEE_NV_fragment_program2 = GL_TRUE; + __GLeeLink_GL_NV_fragment_program2(); + } + if (__GLeeCheckExtension("GL_NV_vertex_program2_option", &extensionNames) ) + { + _GLEE_NV_vertex_program2_option = GL_TRUE; + __GLeeLink_GL_NV_vertex_program2_option(); + } + if (__GLeeCheckExtension("GL_NV_vertex_program3", &extensionNames) ) + { + _GLEE_NV_vertex_program3 = GL_TRUE; + __GLeeLink_GL_NV_vertex_program3(); + } + if (__GLeeCheckExtension("GL_EXT_framebuffer_object", &extensionNames) ) + { + _GLEE_EXT_framebuffer_object = GL_TRUE; + __GLeeLink_GL_EXT_framebuffer_object(); + } + if (__GLeeCheckExtension("GL_GREMEDY_string_marker", &extensionNames) ) + { + _GLEE_GREMEDY_string_marker = GL_TRUE; + __GLeeLink_GL_GREMEDY_string_marker(); + } + if (__GLeeCheckExtension("GL_EXT_packed_depth_stencil", &extensionNames) ) + { + _GLEE_EXT_packed_depth_stencil = GL_TRUE; + __GLeeLink_GL_EXT_packed_depth_stencil(); + } + if (__GLeeCheckExtension("GL_EXT_stencil_clear_tag", &extensionNames) ) + { + _GLEE_EXT_stencil_clear_tag = GL_TRUE; + __GLeeLink_GL_EXT_stencil_clear_tag(); + } + if (__GLeeCheckExtension("GL_EXT_texture_sRGB", &extensionNames) ) + { + _GLEE_EXT_texture_sRGB = GL_TRUE; + __GLeeLink_GL_EXT_texture_sRGB(); + } + if (__GLeeCheckExtension("GL_EXT_framebuffer_blit", &extensionNames) ) + { + _GLEE_EXT_framebuffer_blit = GL_TRUE; + __GLeeLink_GL_EXT_framebuffer_blit(); + } + if (__GLeeCheckExtension("GL_EXT_framebuffer_multisample", &extensionNames) ) + { + _GLEE_EXT_framebuffer_multisample = GL_TRUE; + __GLeeLink_GL_EXT_framebuffer_multisample(); + } + if (__GLeeCheckExtension("GL_MESAX_texture_stack", &extensionNames) ) + { + _GLEE_MESAX_texture_stack = GL_TRUE; + __GLeeLink_GL_MESAX_texture_stack(); + } + if (__GLeeCheckExtension("GL_EXT_timer_query", &extensionNames) ) + { + _GLEE_EXT_timer_query = GL_TRUE; + __GLeeLink_GL_EXT_timer_query(); + } + if (__GLeeCheckExtension("GL_EXT_gpu_program_parameters", &extensionNames) ) + { + _GLEE_EXT_gpu_program_parameters = GL_TRUE; + __GLeeLink_GL_EXT_gpu_program_parameters(); + } + if (__GLeeCheckExtension("GL_APPLE_flush_buffer_range", &extensionNames) ) + { + _GLEE_APPLE_flush_buffer_range = GL_TRUE; + __GLeeLink_GL_APPLE_flush_buffer_range(); + } + if (__GLeeCheckExtension("GL_NV_gpu_program4", &extensionNames) ) + { + _GLEE_NV_gpu_program4 = GL_TRUE; + __GLeeLink_GL_NV_gpu_program4(); + } + if (__GLeeCheckExtension("GL_NV_geometry_program4", &extensionNames) ) + { + _GLEE_NV_geometry_program4 = GL_TRUE; + __GLeeLink_GL_NV_geometry_program4(); + } + if (__GLeeCheckExtension("GL_EXT_geometry_shader4", &extensionNames) ) + { + _GLEE_EXT_geometry_shader4 = GL_TRUE; + __GLeeLink_GL_EXT_geometry_shader4(); + } + if (__GLeeCheckExtension("GL_NV_vertex_program4", &extensionNames) ) + { + _GLEE_NV_vertex_program4 = GL_TRUE; + __GLeeLink_GL_NV_vertex_program4(); + } + if (__GLeeCheckExtension("GL_EXT_gpu_shader4", &extensionNames) ) + { + _GLEE_EXT_gpu_shader4 = GL_TRUE; + __GLeeLink_GL_EXT_gpu_shader4(); + } + if (__GLeeCheckExtension("GL_EXT_drawinstanced", &extensionNames) ) + { + _GLEE_EXT_drawinstanced = GL_TRUE; + __GLeeLink_GL_EXT_drawinstanced(); + } + if (__GLeeCheckExtension("GL_EXT_packed_float", &extensionNames) ) + { + _GLEE_EXT_packed_float = GL_TRUE; + __GLeeLink_GL_EXT_packed_float(); + } + if (__GLeeCheckExtension("GL_EXT_texture_array", &extensionNames) ) + { + _GLEE_EXT_texture_array = GL_TRUE; + __GLeeLink_GL_EXT_texture_array(); + } + if (__GLeeCheckExtension("GL_EXT_texture_buffer_object", &extensionNames) ) + { + _GLEE_EXT_texture_buffer_object = GL_TRUE; + __GLeeLink_GL_EXT_texture_buffer_object(); + } + if (__GLeeCheckExtension("GL_EXT_texture_compression_latc", &extensionNames) ) + { + _GLEE_EXT_texture_compression_latc = GL_TRUE; + __GLeeLink_GL_EXT_texture_compression_latc(); + } + if (__GLeeCheckExtension("GL_EXT_texture_compression_rgtc", &extensionNames) ) + { + _GLEE_EXT_texture_compression_rgtc = GL_TRUE; + __GLeeLink_GL_EXT_texture_compression_rgtc(); + } + if (__GLeeCheckExtension("GL_EXT_texture_shared_exponent", &extensionNames) ) + { + _GLEE_EXT_texture_shared_exponent = GL_TRUE; + __GLeeLink_GL_EXT_texture_shared_exponent(); + } + if (__GLeeCheckExtension("GL_NV_depth_buffer_float", &extensionNames) ) + { + _GLEE_NV_depth_buffer_float = GL_TRUE; + __GLeeLink_GL_NV_depth_buffer_float(); + } + if (__GLeeCheckExtension("GL_NV_fragment_program4", &extensionNames) ) + { + _GLEE_NV_fragment_program4 = GL_TRUE; + __GLeeLink_GL_NV_fragment_program4(); + } + if (__GLeeCheckExtension("GL_NV_framebuffer_multisample_coverage", &extensionNames) ) + { + _GLEE_NV_framebuffer_multisample_coverage = GL_TRUE; + __GLeeLink_GL_NV_framebuffer_multisample_coverage(); + } + if (__GLeeCheckExtension("GL_EXT_framebuffer_sRGB", &extensionNames) ) + { + _GLEE_EXT_framebuffer_sRGB = GL_TRUE; + __GLeeLink_GL_EXT_framebuffer_sRGB(); + } + if (__GLeeCheckExtension("GL_NV_geometry_shader4", &extensionNames) ) + { + _GLEE_NV_geometry_shader4 = GL_TRUE; + __GLeeLink_GL_NV_geometry_shader4(); + } + if (__GLeeCheckExtension("GL_NV_parameter_buffer_object", &extensionNames) ) + { + _GLEE_NV_parameter_buffer_object = GL_TRUE; + __GLeeLink_GL_NV_parameter_buffer_object(); + } + if (__GLeeCheckExtension("GL_EXT_draw_buffers2", &extensionNames) ) + { + _GLEE_EXT_draw_buffers2 = GL_TRUE; + __GLeeLink_GL_EXT_draw_buffers2(); + } + if (__GLeeCheckExtension("GL_NV_transform_feedback", &extensionNames) ) + { + _GLEE_NV_transform_feedback = GL_TRUE; + __GLeeLink_GL_NV_transform_feedback(); + } + if (__GLeeCheckExtension("GL_EXT_bindable_uniform", &extensionNames) ) + { + _GLEE_EXT_bindable_uniform = GL_TRUE; + __GLeeLink_GL_EXT_bindable_uniform(); + } + if (__GLeeCheckExtension("GL_EXT_texture_integer", &extensionNames) ) + { + _GLEE_EXT_texture_integer = GL_TRUE; + __GLeeLink_GL_EXT_texture_integer(); + } + if (__GLeeCheckExtension("GL_GREMEDY_frame_terminator", &extensionNames) ) + { + _GLEE_GREMEDY_frame_terminator = GL_TRUE; + __GLeeLink_GL_GREMEDY_frame_terminator(); + } + if (__GLeeCheckExtension("GL_NV_conditional_render", &extensionNames) ) + { + _GLEE_NV_conditional_render = GL_TRUE; + __GLeeLink_GL_NV_conditional_render(); + } + if (__GLeeCheckExtension("GL_NV_present_video", &extensionNames) ) + { + _GLEE_NV_present_video = GL_TRUE; + __GLeeLink_GL_NV_present_video(); + } + if (__GLeeCheckExtension("GL_EXT_transform_feedback", &extensionNames) ) + { + _GLEE_EXT_transform_feedback = GL_TRUE; + __GLeeLink_GL_EXT_transform_feedback(); + } + if (__GLeeCheckExtension("GL_EXT_direct_state_access", &extensionNames) ) + { + _GLEE_EXT_direct_state_access = GL_TRUE; + __GLeeLink_GL_EXT_direct_state_access(); + } + if (__GLeeCheckExtension("GL_EXT_vertex_array_bgra", &extensionNames) ) + { + _GLEE_EXT_vertex_array_bgra = GL_TRUE; + __GLeeLink_GL_EXT_vertex_array_bgra(); + } + if (__GLeeCheckExtension("GL_SGIX_texture_select", &extensionNames) ) + { + _GLEE_SGIX_texture_select = GL_TRUE; + __GLeeLink_GL_SGIX_texture_select(); + } + if (__GLeeCheckExtension("GL_INGR_blend_func_separate", &extensionNames) ) + { + _GLEE_INGR_blend_func_separate = GL_TRUE; + __GLeeLink_GL_INGR_blend_func_separate(); + } + if (__GLeeCheckExtension("GL_SGIX_depth_pass_instrument", &extensionNames) ) + { + _GLEE_SGIX_depth_pass_instrument = GL_TRUE; + __GLeeLink_GL_SGIX_depth_pass_instrument(); + } + if (__GLeeCheckExtension("GL_SGIX_igloo_interface", &extensionNames) ) + { + _GLEE_SGIX_igloo_interface = GL_TRUE; + __GLeeLink_GL_SGIX_igloo_interface(); + } + if (__GLeeCheckExtension("GL_EXT_fragment_lighting", &extensionNames) ) + { + _GLEE_EXT_fragment_lighting = GL_TRUE; + __GLeeLink_GL_EXT_fragment_lighting(); + } + if (__GLeeCheckExtension("GL_EXT_scene_marker", &extensionNames) ) + { + _GLEE_EXT_scene_marker = GL_TRUE; + __GLeeLink_GL_EXT_scene_marker(); + } + if (__GLeeCheckExtension("GL_EXT_texture_compression_dxt1", &extensionNames) ) + { + _GLEE_EXT_texture_compression_dxt1 = GL_TRUE; + __GLeeLink_GL_EXT_texture_compression_dxt1(); + } + if (__GLeeCheckExtension("GL_EXT_texture_env", &extensionNames) ) + { + _GLEE_EXT_texture_env = GL_TRUE; + __GLeeLink_GL_EXT_texture_env(); + } + if (__GLeeCheckExtension("GL_IBM_static_data", &extensionNames) ) + { + _GLEE_IBM_static_data = GL_TRUE; + __GLeeLink_GL_IBM_static_data(); + } + if (__GLeeCheckExtension("GL_OES_byte_coordinates", &extensionNames) ) + { + _GLEE_OES_byte_coordinates = GL_TRUE; + __GLeeLink_GL_OES_byte_coordinates(); + } + if (__GLeeCheckExtension("GL_OES_compressed_paletted_texture", &extensionNames) ) + { + _GLEE_OES_compressed_paletted_texture = GL_TRUE; + __GLeeLink_GL_OES_compressed_paletted_texture(); + } + if (__GLeeCheckExtension("GL_OES_single_precision", &extensionNames) ) + { + _GLEE_OES_single_precision = GL_TRUE; + __GLeeLink_GL_OES_single_precision(); + } + if (__GLeeCheckExtension("GL_SGIX_pixel_texture_bits", &extensionNames) ) + { + _GLEE_SGIX_pixel_texture_bits = GL_TRUE; + __GLeeLink_GL_SGIX_pixel_texture_bits(); + } + if (__GLeeCheckExtension("GL_SGIX_texture_range", &extensionNames) ) + { + _GLEE_SGIX_texture_range = GL_TRUE; + __GLeeLink_GL_SGIX_texture_range(); + } +#ifdef WIN32 + if (__GLeeCheckExtension("WGL_ARB_buffer_region", &extensionNames) ) + { + _GLEE_WGL_ARB_buffer_region = GL_TRUE; + __GLeeLink_WGL_ARB_buffer_region(); + } + if (__GLeeCheckExtension("WGL_ARB_multisample", &extensionNames) ) + { + _GLEE_WGL_ARB_multisample = GL_TRUE; + __GLeeLink_WGL_ARB_multisample(); + } + if (__GLeeCheckExtension("WGL_ARB_extensions_string", &extensionNames) ) + { + _GLEE_WGL_ARB_extensions_string = GL_TRUE; + __GLeeLink_WGL_ARB_extensions_string(); + } + if (__GLeeCheckExtension("WGL_ARB_pixel_format", &extensionNames) ) + { + _GLEE_WGL_ARB_pixel_format = GL_TRUE; + __GLeeLink_WGL_ARB_pixel_format(); + } + if (__GLeeCheckExtension("WGL_ARB_make_current_read", &extensionNames) ) + { + _GLEE_WGL_ARB_make_current_read = GL_TRUE; + __GLeeLink_WGL_ARB_make_current_read(); + } + if (__GLeeCheckExtension("WGL_ARB_pbuffer", &extensionNames) ) + { + _GLEE_WGL_ARB_pbuffer = GL_TRUE; + __GLeeLink_WGL_ARB_pbuffer(); + } + if (__GLeeCheckExtension("WGL_ARB_render_texture", &extensionNames) ) + { + _GLEE_WGL_ARB_render_texture = GL_TRUE; + __GLeeLink_WGL_ARB_render_texture(); + } + if (__GLeeCheckExtension("WGL_ARB_pixel_format_float", &extensionNames) ) + { + _GLEE_WGL_ARB_pixel_format_float = GL_TRUE; + __GLeeLink_WGL_ARB_pixel_format_float(); + } + if (__GLeeCheckExtension("WGL_ARB_create_context", &extensionNames) ) + { + _GLEE_WGL_ARB_create_context = GL_TRUE; + __GLeeLink_WGL_ARB_create_context(); + } + if (__GLeeCheckExtension("WGL_EXT_make_current_read", &extensionNames) ) + { + _GLEE_WGL_EXT_make_current_read = GL_TRUE; + __GLeeLink_WGL_EXT_make_current_read(); + } + if (__GLeeCheckExtension("WGL_EXT_pixel_format", &extensionNames) ) + { + _GLEE_WGL_EXT_pixel_format = GL_TRUE; + __GLeeLink_WGL_EXT_pixel_format(); + } + if (__GLeeCheckExtension("WGL_EXT_pbuffer", &extensionNames) ) + { + _GLEE_WGL_EXT_pbuffer = GL_TRUE; + __GLeeLink_WGL_EXT_pbuffer(); + } + if (__GLeeCheckExtension("WGL_EXT_depth_float", &extensionNames) ) + { + _GLEE_WGL_EXT_depth_float = GL_TRUE; + __GLeeLink_WGL_EXT_depth_float(); + } + if (__GLeeCheckExtension("WGL_3DFX_multisample", &extensionNames) ) + { + _GLEE_WGL_3DFX_multisample = GL_TRUE; + __GLeeLink_WGL_3DFX_multisample(); + } + if (__GLeeCheckExtension("WGL_EXT_multisample", &extensionNames) ) + { + _GLEE_WGL_EXT_multisample = GL_TRUE; + __GLeeLink_WGL_EXT_multisample(); + } + if (__GLeeCheckExtension("WGL_I3D_digital_video_control", &extensionNames) ) + { + _GLEE_WGL_I3D_digital_video_control = GL_TRUE; + __GLeeLink_WGL_I3D_digital_video_control(); + } + if (__GLeeCheckExtension("WGL_I3D_gamma", &extensionNames) ) + { + _GLEE_WGL_I3D_gamma = GL_TRUE; + __GLeeLink_WGL_I3D_gamma(); + } + if (__GLeeCheckExtension("WGL_I3D_genlock", &extensionNames) ) + { + _GLEE_WGL_I3D_genlock = GL_TRUE; + __GLeeLink_WGL_I3D_genlock(); + } + if (__GLeeCheckExtension("WGL_I3D_image_buffer", &extensionNames) ) + { + _GLEE_WGL_I3D_image_buffer = GL_TRUE; + __GLeeLink_WGL_I3D_image_buffer(); + } + if (__GLeeCheckExtension("WGL_I3D_swap_frame_lock", &extensionNames) ) + { + _GLEE_WGL_I3D_swap_frame_lock = GL_TRUE; + __GLeeLink_WGL_I3D_swap_frame_lock(); + } + if (__GLeeCheckExtension("WGL_NV_render_depth_texture", &extensionNames) ) + { + _GLEE_WGL_NV_render_depth_texture = GL_TRUE; + __GLeeLink_WGL_NV_render_depth_texture(); + } + if (__GLeeCheckExtension("WGL_NV_render_texture_rectangle", &extensionNames) ) + { + _GLEE_WGL_NV_render_texture_rectangle = GL_TRUE; + __GLeeLink_WGL_NV_render_texture_rectangle(); + } + if (__GLeeCheckExtension("WGL_ATI_pixel_format_float", &extensionNames) ) + { + _GLEE_WGL_ATI_pixel_format_float = GL_TRUE; + __GLeeLink_WGL_ATI_pixel_format_float(); + } + if (__GLeeCheckExtension("WGL_NV_float_buffer", &extensionNames) ) + { + _GLEE_WGL_NV_float_buffer = GL_TRUE; + __GLeeLink_WGL_NV_float_buffer(); + } + if (__GLeeCheckExtension("WGL_3DL_stereo_control", &extensionNames) ) + { + _GLEE_WGL_3DL_stereo_control = GL_TRUE; + __GLeeLink_WGL_3DL_stereo_control(); + } + if (__GLeeCheckExtension("WGL_EXT_pixel_format_packed_float", &extensionNames) ) + { + _GLEE_WGL_EXT_pixel_format_packed_float = GL_TRUE; + __GLeeLink_WGL_EXT_pixel_format_packed_float(); + } + if (__GLeeCheckExtension("WGL_EXT_framebuffer_sRGB", &extensionNames) ) + { + _GLEE_WGL_EXT_framebuffer_sRGB = GL_TRUE; + __GLeeLink_WGL_EXT_framebuffer_sRGB(); + } + if (__GLeeCheckExtension("WGL_NV_present_video", &extensionNames) ) + { + _GLEE_WGL_NV_present_video = GL_TRUE; + __GLeeLink_WGL_NV_present_video(); + } + if (__GLeeCheckExtension("WGL_NV_video_out", &extensionNames) ) + { + _GLEE_WGL_NV_video_out = GL_TRUE; + __GLeeLink_WGL_NV_video_out(); + } + if (__GLeeCheckExtension("WGL_NV_swap_group", &extensionNames) ) + { + _GLEE_WGL_NV_swap_group = GL_TRUE; + __GLeeLink_WGL_NV_swap_group(); + } + if (__GLeeCheckExtension("WGL_EXT_display_color_table", &extensionNames) ) + { + _GLEE_WGL_EXT_display_color_table = GL_TRUE; + __GLeeLink_WGL_EXT_display_color_table(); + } + if (__GLeeCheckExtension("WGL_EXT_extensions_string", &extensionNames) ) + { + _GLEE_WGL_EXT_extensions_string = GL_TRUE; + __GLeeLink_WGL_EXT_extensions_string(); + } + if (__GLeeCheckExtension("WGL_EXT_swap_control", &extensionNames) ) + { + _GLEE_WGL_EXT_swap_control = GL_TRUE; + __GLeeLink_WGL_EXT_swap_control(); + } + if (__GLeeCheckExtension("WGL_NV_vertex_array_range", &extensionNames) ) + { + _GLEE_WGL_NV_vertex_array_range = GL_TRUE; + __GLeeLink_WGL_NV_vertex_array_range(); + } + if (__GLeeCheckExtension("WGL_OML_sync_control", &extensionNames) ) + { + _GLEE_WGL_OML_sync_control = GL_TRUE; + __GLeeLink_WGL_OML_sync_control(); + } + if (__GLeeCheckExtension("WGL_I3D_swap_frame_usage", &extensionNames) ) + { + _GLEE_WGL_I3D_swap_frame_usage = GL_TRUE; + __GLeeLink_WGL_I3D_swap_frame_usage(); + } + if (__GLeeCheckExtension("WGL_NV_video_output", &extensionNames) ) + { + _GLEE_WGL_NV_video_output = GL_TRUE; + __GLeeLink_WGL_NV_video_output(); + } +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else /* GLX */ + if (__GLeeCheckExtension("GLX_VERSION_1_3", &extensionNames) ) + { + _GLEE_GLX_VERSION_1_3 = GL_TRUE; + __GLeeLink_GLX_VERSION_1_3(); + } + if (__GLeeCheckExtension("GLX_VERSION_1_4", &extensionNames) ) + { + _GLEE_GLX_VERSION_1_4 = GL_TRUE; + __GLeeLink_GLX_VERSION_1_4(); + } + if (__GLeeCheckExtension("GLX_ARB_multisample", &extensionNames) ) + { + _GLEE_GLX_ARB_multisample = GL_TRUE; + __GLeeLink_GLX_ARB_multisample(); + } + if (__GLeeCheckExtension("GLX_ARB_fbconfig_float", &extensionNames) ) + { + _GLEE_GLX_ARB_fbconfig_float = GL_TRUE; + __GLeeLink_GLX_ARB_fbconfig_float(); + } + if (__GLeeCheckExtension("GLX_SGIS_multisample", &extensionNames) ) + { + _GLEE_GLX_SGIS_multisample = GL_TRUE; + __GLeeLink_GLX_SGIS_multisample(); + } + if (__GLeeCheckExtension("GLX_EXT_visual_info", &extensionNames) ) + { + _GLEE_GLX_EXT_visual_info = GL_TRUE; + __GLeeLink_GLX_EXT_visual_info(); + } + if (__GLeeCheckExtension("GLX_SGI_swap_control", &extensionNames) ) + { + _GLEE_GLX_SGI_swap_control = GL_TRUE; + __GLeeLink_GLX_SGI_swap_control(); + } + if (__GLeeCheckExtension("GLX_SGI_video_sync", &extensionNames) ) + { + _GLEE_GLX_SGI_video_sync = GL_TRUE; + __GLeeLink_GLX_SGI_video_sync(); + } + if (__GLeeCheckExtension("GLX_SGI_make_current_read", &extensionNames) ) + { + _GLEE_GLX_SGI_make_current_read = GL_TRUE; + __GLeeLink_GLX_SGI_make_current_read(); + } + if (__GLeeCheckExtension("GLX_EXT_visual_rating", &extensionNames) ) + { + _GLEE_GLX_EXT_visual_rating = GL_TRUE; + __GLeeLink_GLX_EXT_visual_rating(); + } + if (__GLeeCheckExtension("GLX_EXT_import_context", &extensionNames) ) + { + _GLEE_GLX_EXT_import_context = GL_TRUE; + __GLeeLink_GLX_EXT_import_context(); + } + if (__GLeeCheckExtension("GLX_SGIX_fbconfig", &extensionNames) ) + { + _GLEE_GLX_SGIX_fbconfig = GL_TRUE; + __GLeeLink_GLX_SGIX_fbconfig(); + } + if (__GLeeCheckExtension("GLX_SGIX_pbuffer", &extensionNames) ) + { + _GLEE_GLX_SGIX_pbuffer = GL_TRUE; + __GLeeLink_GLX_SGIX_pbuffer(); + } + if (__GLeeCheckExtension("GLX_SGI_cushion", &extensionNames) ) + { + _GLEE_GLX_SGI_cushion = GL_TRUE; + __GLeeLink_GLX_SGI_cushion(); + } + if (__GLeeCheckExtension("GLX_SGIX_video_resize", &extensionNames) ) + { + _GLEE_GLX_SGIX_video_resize = GL_TRUE; + __GLeeLink_GLX_SGIX_video_resize(); + } + if (__GLeeCheckExtension("GLX_SGIX_swap_group", &extensionNames) ) + { + _GLEE_GLX_SGIX_swap_group = GL_TRUE; + __GLeeLink_GLX_SGIX_swap_group(); + } + if (__GLeeCheckExtension("GLX_SGIX_swap_barrier", &extensionNames) ) + { + _GLEE_GLX_SGIX_swap_barrier = GL_TRUE; + __GLeeLink_GLX_SGIX_swap_barrier(); + } + if (__GLeeCheckExtension("GLX_SGIS_blended_overlay", &extensionNames) ) + { + _GLEE_GLX_SGIS_blended_overlay = GL_TRUE; + __GLeeLink_GLX_SGIS_blended_overlay(); + } + if (__GLeeCheckExtension("GLX_SGIS_shared_multisample", &extensionNames) ) + { + _GLEE_GLX_SGIS_shared_multisample = GL_TRUE; + __GLeeLink_GLX_SGIS_shared_multisample(); + } + if (__GLeeCheckExtension("GLX_SUN_get_transparent_index", &extensionNames) ) + { + _GLEE_GLX_SUN_get_transparent_index = GL_TRUE; + __GLeeLink_GLX_SUN_get_transparent_index(); + } + if (__GLeeCheckExtension("GLX_3DFX_multisample", &extensionNames) ) + { + _GLEE_GLX_3DFX_multisample = GL_TRUE; + __GLeeLink_GLX_3DFX_multisample(); + } + if (__GLeeCheckExtension("GLX_MESA_copy_sub_buffer", &extensionNames) ) + { + _GLEE_GLX_MESA_copy_sub_buffer = GL_TRUE; + __GLeeLink_GLX_MESA_copy_sub_buffer(); + } + if (__GLeeCheckExtension("GLX_MESA_pixmap_colormap", &extensionNames) ) + { + _GLEE_GLX_MESA_pixmap_colormap = GL_TRUE; + __GLeeLink_GLX_MESA_pixmap_colormap(); + } + if (__GLeeCheckExtension("GLX_MESA_release_buffers", &extensionNames) ) + { + _GLEE_GLX_MESA_release_buffers = GL_TRUE; + __GLeeLink_GLX_MESA_release_buffers(); + } + if (__GLeeCheckExtension("GLX_MESA_set_3dfx_mode", &extensionNames) ) + { + _GLEE_GLX_MESA_set_3dfx_mode = GL_TRUE; + __GLeeLink_GLX_MESA_set_3dfx_mode(); + } + if (__GLeeCheckExtension("GLX_SGIX_visual_select_group", &extensionNames) ) + { + _GLEE_GLX_SGIX_visual_select_group = GL_TRUE; + __GLeeLink_GLX_SGIX_visual_select_group(); + } + if (__GLeeCheckExtension("GLX_OML_swap_method", &extensionNames) ) + { + _GLEE_GLX_OML_swap_method = GL_TRUE; + __GLeeLink_GLX_OML_swap_method(); + } + if (__GLeeCheckExtension("GLX_OML_sync_control", &extensionNames) ) + { + _GLEE_GLX_OML_sync_control = GL_TRUE; + __GLeeLink_GLX_OML_sync_control(); + } + if (__GLeeCheckExtension("GLX_NV_float_buffer", &extensionNames) ) + { + _GLEE_GLX_NV_float_buffer = GL_TRUE; + __GLeeLink_GLX_NV_float_buffer(); + } + if (__GLeeCheckExtension("GLX_SGIX_hyperpipe", &extensionNames) ) + { + _GLEE_GLX_SGIX_hyperpipe = GL_TRUE; + __GLeeLink_GLX_SGIX_hyperpipe(); + } + if (__GLeeCheckExtension("GLX_MESA_agp_offset", &extensionNames) ) + { + _GLEE_GLX_MESA_agp_offset = GL_TRUE; + __GLeeLink_GLX_MESA_agp_offset(); + } + if (__GLeeCheckExtension("GLX_EXT_fbconfig_packed_float", &extensionNames) ) + { + _GLEE_GLX_EXT_fbconfig_packed_float = GL_TRUE; + __GLeeLink_GLX_EXT_fbconfig_packed_float(); + } + if (__GLeeCheckExtension("GLX_EXT_framebuffer_sRGB", &extensionNames) ) + { + _GLEE_GLX_EXT_framebuffer_sRGB = GL_TRUE; + __GLeeLink_GLX_EXT_framebuffer_sRGB(); + } + if (__GLeeCheckExtension("GLX_EXT_texture_from_pixmap", &extensionNames) ) + { + _GLEE_GLX_EXT_texture_from_pixmap = GL_TRUE; + __GLeeLink_GLX_EXT_texture_from_pixmap(); + } + if (__GLeeCheckExtension("GLX_NV_present_video", &extensionNames) ) + { + _GLEE_GLX_NV_present_video = GL_TRUE; + __GLeeLink_GLX_NV_present_video(); + } + if (__GLeeCheckExtension("GLX_NV_video_out", &extensionNames) ) + { + _GLEE_GLX_NV_video_out = GL_TRUE; + __GLeeLink_GLX_NV_video_out(); + } + if (__GLeeCheckExtension("GLX_NV_swap_group", &extensionNames) ) + { + _GLEE_GLX_NV_swap_group = GL_TRUE; + __GLeeLink_GLX_NV_swap_group(); + } + if (__GLeeCheckExtension("GLX_EXT_scene_marker", &extensionNames) ) + { + _GLEE_GLX_EXT_scene_marker = GL_TRUE; + __GLeeLink_GLX_EXT_scene_marker(); + } + if (__GLeeCheckExtension("GLX_NV_video_output", &extensionNames) ) + { + _GLEE_GLX_NV_video_output = GL_TRUE; + __GLeeLink_GLX_NV_video_output(); + } +#endif /* end GLX */ + + __GLeeExtList_clean(&extensionNames); + return GL_TRUE; +} diff --git a/src/modules/graphics/opengl/GLee.h b/src/modules/graphics/opengl/GLee.h index 34ca16bc5..a0413dffc 100644 --- a/src/modules/graphics/opengl/GLee.h +++ b/src/modules/graphics/opengl/GLee.h @@ -1,12454 +1,12454 @@ -/*************************************************************************** -* -* GLee.h -* GLee (OpenGL Easy Extension library) -* Version : 5.33 -* -* Copyright (c)2008 Ben Woodhouse All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are -* met: -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer as -* the first lines of this file unmodified. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BEN WOODHOUSE ``AS IS'' AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -* IN NO EVENT SHALL BEN WOODHOUSE BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -* Web: http://elf-stone.com/glee.php -* -* [This file was automatically generated by GLeeGen 6.0 -* -***************************************************************************/ - -#ifndef __glee_h_ -#define __glee_h_ - -#ifdef __gl_h_ - #error gl.h included before glee.h -#endif - -#ifdef __glext_h_ - #error glext.h included before glee.h -#endif - -#ifdef __wglext_h_ - #error wglext.h included before glee.h -#endif - -#ifdef __glxext_h_ - #error glxext.h included before glee.h -#endif - +/*************************************************************************** +* +* GLee.h +* GLee (OpenGL Easy Extension library) +* Version : 5.33 +* +* Copyright (c)2008 Ben Woodhouse All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer as +* the first lines of this file unmodified. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BEN WOODHOUSE ``AS IS'' AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL BEN WOODHOUSE BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +* Web: http://elf-stone.com/glee.php +* +* [This file was automatically generated by GLeeGen 6.0 +* +***************************************************************************/ + +#ifndef __glee_h_ +#define __glee_h_ + +#ifdef __gl_h_ + #error gl.h included before glee.h +#endif + +#ifdef __glext_h_ + #error glext.h included before glee.h +#endif + +#ifdef __wglext_h_ + #error wglext.h included before glee.h +#endif + +#ifdef __glxext_h_ + #error glxext.h included before glee.h +#endif + #if defined(WIN32) || defined(_WIN32) #ifndef WIN32 -# define WIN32 -#endif - #include - #include -#elif defined(__APPLE__) || defined(__APPLE_CC__) - #define GL_GLEXT_LEGACY - #include -#else // GLX - #define __glext_h_ /* prevent glext.h from being included */ - #define __glxext_h_ /* prevent glxext.h from being included */ - #define GLX_GLXEXT_PROTOTYPES - #include - #include -#endif - -#ifndef APIENTRY - #define APIENTRY -#endif - -#ifndef APIENTRYP - #define APIENTRYP APIENTRY * -#endif - -#define GLEE_EXTERN extern - -#ifdef __cplusplus - extern "C" { /* begin C linkage */ -#endif - -#define GLEE_LINK_FAIL 0 -#define GLEE_LINK_PARTIAL 1 -#define GLEE_LINK_COMPLETE 2 - -/* Extension querying variables */ - -GLEE_EXTERN GLboolean _GLEE_VERSION_1_2; -GLEE_EXTERN GLboolean _GLEE_ARB_imaging; -GLEE_EXTERN GLboolean _GLEE_VERSION_1_3; -GLEE_EXTERN GLboolean _GLEE_VERSION_1_4; -GLEE_EXTERN GLboolean _GLEE_VERSION_1_5; -GLEE_EXTERN GLboolean _GLEE_VERSION_2_0; -GLEE_EXTERN GLboolean _GLEE_VERSION_2_1; -GLEE_EXTERN GLboolean _GLEE_VERSION_3_0; -GLEE_EXTERN GLboolean _GLEE_ARB_multitexture; -GLEE_EXTERN GLboolean _GLEE_ARB_transpose_matrix; -GLEE_EXTERN GLboolean _GLEE_ARB_multisample; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_env_add; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_cube_map; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_compression; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_border_clamp; -GLEE_EXTERN GLboolean _GLEE_ARB_point_parameters; -GLEE_EXTERN GLboolean _GLEE_ARB_vertex_blend; -GLEE_EXTERN GLboolean _GLEE_ARB_matrix_palette; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_env_combine; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_env_crossbar; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_env_dot3; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_mirrored_repeat; -GLEE_EXTERN GLboolean _GLEE_ARB_depth_texture; -GLEE_EXTERN GLboolean _GLEE_ARB_shadow; -GLEE_EXTERN GLboolean _GLEE_ARB_shadow_ambient; -GLEE_EXTERN GLboolean _GLEE_ARB_window_pos; -GLEE_EXTERN GLboolean _GLEE_ARB_vertex_program; -GLEE_EXTERN GLboolean _GLEE_ARB_fragment_program; -GLEE_EXTERN GLboolean _GLEE_ARB_vertex_buffer_object; -GLEE_EXTERN GLboolean _GLEE_ARB_occlusion_query; -GLEE_EXTERN GLboolean _GLEE_ARB_shader_objects; -GLEE_EXTERN GLboolean _GLEE_ARB_vertex_shader; -GLEE_EXTERN GLboolean _GLEE_ARB_fragment_shader; -GLEE_EXTERN GLboolean _GLEE_ARB_shading_language_100; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_non_power_of_two; -GLEE_EXTERN GLboolean _GLEE_ARB_point_sprite; -GLEE_EXTERN GLboolean _GLEE_ARB_fragment_program_shadow; -GLEE_EXTERN GLboolean _GLEE_ARB_draw_buffers; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_rectangle; -GLEE_EXTERN GLboolean _GLEE_ARB_color_buffer_float; -GLEE_EXTERN GLboolean _GLEE_ARB_half_float_pixel; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_float; -GLEE_EXTERN GLboolean _GLEE_ARB_pixel_buffer_object; -GLEE_EXTERN GLboolean _GLEE_ARB_depth_buffer_float; -GLEE_EXTERN GLboolean _GLEE_ARB_drawinstanced; -GLEE_EXTERN GLboolean _GLEE_ARB_framebuffer_object; -GLEE_EXTERN GLboolean _GLEE_ARB_framebuffer_sRGB; -GLEE_EXTERN GLboolean _GLEE_ARB_geometry_shader4; -GLEE_EXTERN GLboolean _GLEE_ARB_half_float_vertex; -GLEE_EXTERN GLboolean _GLEE_ARBinstanced_arrays; -GLEE_EXTERN GLboolean _GLEE_ARB_map_buffer_range; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_buffer_object; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_compression_rgtc; -GLEE_EXTERN GLboolean _GLEE_ARB_texture_rg; -GLEE_EXTERN GLboolean _GLEE_ARB_vertex_array_object; -GLEE_EXTERN GLboolean _GLEE_EXT_abgr; -GLEE_EXTERN GLboolean _GLEE_EXT_blend_color; -GLEE_EXTERN GLboolean _GLEE_EXT_polygon_offset; -GLEE_EXTERN GLboolean _GLEE_EXT_texture; -GLEE_EXTERN GLboolean _GLEE_EXT_texture3D; -GLEE_EXTERN GLboolean _GLEE_SGIS_texture_filter4; -GLEE_EXTERN GLboolean _GLEE_EXT_subtexture; -GLEE_EXTERN GLboolean _GLEE_EXT_copy_texture; -GLEE_EXTERN GLboolean _GLEE_EXT_histogram; -GLEE_EXTERN GLboolean _GLEE_EXT_convolution; -GLEE_EXTERN GLboolean _GLEE_SGI_color_matrix; -GLEE_EXTERN GLboolean _GLEE_SGI_color_table; -GLEE_EXTERN GLboolean _GLEE_SGIS_pixel_texture; -GLEE_EXTERN GLboolean _GLEE_SGIX_pixel_texture; -GLEE_EXTERN GLboolean _GLEE_SGIS_texture4D; -GLEE_EXTERN GLboolean _GLEE_SGI_texture_color_table; -GLEE_EXTERN GLboolean _GLEE_EXT_cmyka; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_object; -GLEE_EXTERN GLboolean _GLEE_SGIS_detail_texture; -GLEE_EXTERN GLboolean _GLEE_SGIS_sharpen_texture; -GLEE_EXTERN GLboolean _GLEE_EXT_packed_pixels; -GLEE_EXTERN GLboolean _GLEE_SGIS_texture_lod; -GLEE_EXTERN GLboolean _GLEE_SGIS_multisample; -GLEE_EXTERN GLboolean _GLEE_EXT_rescale_normal; -GLEE_EXTERN GLboolean _GLEE_EXT_vertex_array; -GLEE_EXTERN GLboolean _GLEE_EXT_misc_attribute; -GLEE_EXTERN GLboolean _GLEE_SGIS_generate_mipmap; -GLEE_EXTERN GLboolean _GLEE_SGIX_clipmap; -GLEE_EXTERN GLboolean _GLEE_SGIX_shadow; -GLEE_EXTERN GLboolean _GLEE_SGIS_texture_edge_clamp; -GLEE_EXTERN GLboolean _GLEE_SGIS_texture_border_clamp; -GLEE_EXTERN GLboolean _GLEE_EXT_blend_minmax; -GLEE_EXTERN GLboolean _GLEE_EXT_blend_subtract; -GLEE_EXTERN GLboolean _GLEE_EXT_blend_logic_op; -GLEE_EXTERN GLboolean _GLEE_SGIX_interlace; -GLEE_EXTERN GLboolean _GLEE_SGIX_pixel_tiles; -GLEE_EXTERN GLboolean _GLEE_SGIS_texture_select; -GLEE_EXTERN GLboolean _GLEE_SGIX_sprite; -GLEE_EXTERN GLboolean _GLEE_SGIX_texture_multi_buffer; -GLEE_EXTERN GLboolean _GLEE_EXT_point_parameters; -GLEE_EXTERN GLboolean _GLEE_SGIS_point_parameters; -GLEE_EXTERN GLboolean _GLEE_SGIX_instruments; -GLEE_EXTERN GLboolean _GLEE_SGIX_texture_scale_bias; -GLEE_EXTERN GLboolean _GLEE_SGIX_framezoom; -GLEE_EXTERN GLboolean _GLEE_SGIX_tag_sample_buffer; -GLEE_EXTERN GLboolean _GLEE_FfdMaskSGIX; -GLEE_EXTERN GLboolean _GLEE_SGIX_polynomial_ffd; -GLEE_EXTERN GLboolean _GLEE_SGIX_reference_plane; -GLEE_EXTERN GLboolean _GLEE_SGIX_flush_raster; -GLEE_EXTERN GLboolean _GLEE_SGIX_depth_texture; -GLEE_EXTERN GLboolean _GLEE_SGIS_fog_function; -GLEE_EXTERN GLboolean _GLEE_SGIX_fog_offset; -GLEE_EXTERN GLboolean _GLEE_HP_image_transform; -GLEE_EXTERN GLboolean _GLEE_HP_convolution_border_modes; -GLEE_EXTERN GLboolean _GLEE_INGR_palette_buffer; -GLEE_EXTERN GLboolean _GLEE_SGIX_texture_add_env; -GLEE_EXTERN GLboolean _GLEE_EXT_color_subtable; -GLEE_EXTERN GLboolean _GLEE_PGI_vertex_hints; -GLEE_EXTERN GLboolean _GLEE_PGI_misc_hints; -GLEE_EXTERN GLboolean _GLEE_EXT_paletted_texture; -GLEE_EXTERN GLboolean _GLEE_EXT_clip_volume_hint; -GLEE_EXTERN GLboolean _GLEE_SGIX_list_priority; -GLEE_EXTERN GLboolean _GLEE_SGIX_ir_instrument1; -GLEE_EXTERN GLboolean _GLEE_SGIX_calligraphic_fragment; -GLEE_EXTERN GLboolean _GLEE_SGIX_texture_lod_bias; -GLEE_EXTERN GLboolean _GLEE_SGIX_shadow_ambient; -GLEE_EXTERN GLboolean _GLEE_EXT_index_texture; -GLEE_EXTERN GLboolean _GLEE_EXT_index_material; -GLEE_EXTERN GLboolean _GLEE_EXT_index_func; -GLEE_EXTERN GLboolean _GLEE_EXT_index_array_formats; -GLEE_EXTERN GLboolean _GLEE_EXT_compiled_vertex_array; -GLEE_EXTERN GLboolean _GLEE_EXT_cull_vertex; -GLEE_EXTERN GLboolean _GLEE_SGIX_ycrcb; -GLEE_EXTERN GLboolean _GLEE_SGIX_fragment_lighting; -GLEE_EXTERN GLboolean _GLEE_IBM_rasterpos_clip; -GLEE_EXTERN GLboolean _GLEE_HP_texture_lighting; -GLEE_EXTERN GLboolean _GLEE_EXT_draw_range_elements; -GLEE_EXTERN GLboolean _GLEE_WIN_phong_shading; -GLEE_EXTERN GLboolean _GLEE_WIN_specular_fog; -GLEE_EXTERN GLboolean _GLEE_EXT_light_texture; -GLEE_EXTERN GLboolean _GLEE_SGIX_blend_alpha_minmax; -GLEE_EXTERN GLboolean _GLEE_SGIX_impact_pixel_texture; -GLEE_EXTERN GLboolean _GLEE_EXT_bgra; -GLEE_EXTERN GLboolean _GLEE_SGIX_async; -GLEE_EXTERN GLboolean _GLEE_SGIX_async_pixel; -GLEE_EXTERN GLboolean _GLEE_SGIX_async_histogram; -GLEE_EXTERN GLboolean _GLEE_INTEL_texture_scissor; -GLEE_EXTERN GLboolean _GLEE_INTEL_parallel_arrays; -GLEE_EXTERN GLboolean _GLEE_HP_occlusion_test; -GLEE_EXTERN GLboolean _GLEE_EXT_pixel_transform; -GLEE_EXTERN GLboolean _GLEE_EXT_pixel_transform_color_table; -GLEE_EXTERN GLboolean _GLEE_EXT_shared_texture_palette; -GLEE_EXTERN GLboolean _GLEE_EXT_separate_specular_color; -GLEE_EXTERN GLboolean _GLEE_EXT_secondary_color; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_perturb_normal; -GLEE_EXTERN GLboolean _GLEE_EXT_multi_draw_arrays; -GLEE_EXTERN GLboolean _GLEE_EXT_fog_coord; -GLEE_EXTERN GLboolean _GLEE_REND_screen_coordinates; -GLEE_EXTERN GLboolean _GLEE_EXT_coordinate_frame; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_env_combine; -GLEE_EXTERN GLboolean _GLEE_APPLE_specular_vector; -GLEE_EXTERN GLboolean _GLEE_APPLE_transform_hint; -GLEE_EXTERN GLboolean _GLEE_SGIX_fog_scale; -GLEE_EXTERN GLboolean _GLEE_SUNX_constant_data; -GLEE_EXTERN GLboolean _GLEE_SUN_global_alpha; -GLEE_EXTERN GLboolean _GLEE_SUN_triangle_list; -GLEE_EXTERN GLboolean _GLEE_SUN_vertex; -GLEE_EXTERN GLboolean _GLEE_EXT_blend_func_separate; -GLEE_EXTERN GLboolean _GLEE_INGR_color_clamp; -GLEE_EXTERN GLboolean _GLEE_INGR_interlace_read; -GLEE_EXTERN GLboolean _GLEE_EXT_stencil_wrap; -GLEE_EXTERN GLboolean _GLEE_EXT_422_pixels; -GLEE_EXTERN GLboolean _GLEE_NV_texgen_reflection; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_cube_map; -GLEE_EXTERN GLboolean _GLEE_SUN_convolution_border_modes; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_env_add; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_lod_bias; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_filter_anisotropic; -GLEE_EXTERN GLboolean _GLEE_EXT_vertex_weighting; -GLEE_EXTERN GLboolean _GLEE_NV_light_max_exponent; -GLEE_EXTERN GLboolean _GLEE_NV_vertex_array_range; -GLEE_EXTERN GLboolean _GLEE_NV_register_combiners; -GLEE_EXTERN GLboolean _GLEE_NV_fog_distance; -GLEE_EXTERN GLboolean _GLEE_NV_texgen_emboss; -GLEE_EXTERN GLboolean _GLEE_NV_blend_square; -GLEE_EXTERN GLboolean _GLEE_NV_texture_env_combine4; -GLEE_EXTERN GLboolean _GLEE_MESA_resize_buffers; -GLEE_EXTERN GLboolean _GLEE_MESA_window_pos; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_compression_s3tc; -GLEE_EXTERN GLboolean _GLEE_IBM_cull_vertex; -GLEE_EXTERN GLboolean _GLEE_IBM_multimode_draw_arrays; -GLEE_EXTERN GLboolean _GLEE_IBM_vertex_array_lists; -GLEE_EXTERN GLboolean _GLEE_SGIX_subsample; -GLEE_EXTERN GLboolean _GLEE_SGIX_ycrcb_subsample; -GLEE_EXTERN GLboolean _GLEE_SGIX_ycrcba; -GLEE_EXTERN GLboolean _GLEE_SGI_depth_pass_instrument; -GLEE_EXTERN GLboolean _GLEE_3DFX_texture_compression_FXT1; -GLEE_EXTERN GLboolean _GLEE_3DFX_multisample; -GLEE_EXTERN GLboolean _GLEE_3DFX_tbuffer; -GLEE_EXTERN GLboolean _GLEE_EXT_multisample; -GLEE_EXTERN GLboolean _GLEE_SGIX_vertex_preclip; -GLEE_EXTERN GLboolean _GLEE_SGIX_convolution_accuracy; -GLEE_EXTERN GLboolean _GLEE_SGIX_resample; -GLEE_EXTERN GLboolean _GLEE_SGIS_point_line_texgen; -GLEE_EXTERN GLboolean _GLEE_SGIS_texture_color_mask; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_env_dot3; -GLEE_EXTERN GLboolean _GLEE_ATI_texture_mirror_once; -GLEE_EXTERN GLboolean _GLEE_NV_fence; -GLEE_EXTERN GLboolean _GLEE_IBM_texture_mirrored_repeat; -GLEE_EXTERN GLboolean _GLEE_NV_evaluators; -GLEE_EXTERN GLboolean _GLEE_NV_packed_depth_stencil; -GLEE_EXTERN GLboolean _GLEE_NV_register_combiners2; -GLEE_EXTERN GLboolean _GLEE_NV_texture_compression_vtc; -GLEE_EXTERN GLboolean _GLEE_NV_texture_rectangle; -GLEE_EXTERN GLboolean _GLEE_NV_texture_shader; -GLEE_EXTERN GLboolean _GLEE_NV_texture_shader2; -GLEE_EXTERN GLboolean _GLEE_NV_vertex_array_range2; -GLEE_EXTERN GLboolean _GLEE_NV_vertex_program; -GLEE_EXTERN GLboolean _GLEE_SGIX_texture_coordinate_clamp; -GLEE_EXTERN GLboolean _GLEE_SGIX_scalebias_hint; -GLEE_EXTERN GLboolean _GLEE_OML_interlace; -GLEE_EXTERN GLboolean _GLEE_OML_subsample; -GLEE_EXTERN GLboolean _GLEE_OML_resample; -GLEE_EXTERN GLboolean _GLEE_NV_copy_depth_to_color; -GLEE_EXTERN GLboolean _GLEE_ATI_envmap_bumpmap; -GLEE_EXTERN GLboolean _GLEE_ATI_fragment_shader; -GLEE_EXTERN GLboolean _GLEE_ATI_pn_triangles; -GLEE_EXTERN GLboolean _GLEE_ATI_vertex_array_object; -GLEE_EXTERN GLboolean _GLEE_EXT_vertex_shader; -GLEE_EXTERN GLboolean _GLEE_ATI_vertex_streams; -GLEE_EXTERN GLboolean _GLEE_ATI_element_array; -GLEE_EXTERN GLboolean _GLEE_SUN_mesh_array; -GLEE_EXTERN GLboolean _GLEE_SUN_slice_accum; -GLEE_EXTERN GLboolean _GLEE_NV_multisample_filter_hint; -GLEE_EXTERN GLboolean _GLEE_NV_depth_clamp; -GLEE_EXTERN GLboolean _GLEE_NV_occlusion_query; -GLEE_EXTERN GLboolean _GLEE_NV_point_sprite; -GLEE_EXTERN GLboolean _GLEE_NV_texture_shader3; -GLEE_EXTERN GLboolean _GLEE_NV_vertex_program1_1; -GLEE_EXTERN GLboolean _GLEE_EXT_shadow_funcs; -GLEE_EXTERN GLboolean _GLEE_EXT_stencil_two_side; -GLEE_EXTERN GLboolean _GLEE_ATI_text_fragment_shader; -GLEE_EXTERN GLboolean _GLEE_APPLE_client_storage; -GLEE_EXTERN GLboolean _GLEE_APPLE_element_array; -GLEE_EXTERN GLboolean _GLEE_APPLE_fence; -GLEE_EXTERN GLboolean _GLEE_APPLE_vertex_array_object; -GLEE_EXTERN GLboolean _GLEE_APPLE_vertex_array_range; -GLEE_EXTERN GLboolean _GLEE_APPLE_ycbcr_422; -GLEE_EXTERN GLboolean _GLEE_S3_s3tc; -GLEE_EXTERN GLboolean _GLEE_ATI_draw_buffers; -GLEE_EXTERN GLboolean _GLEE_ATI_pixel_format_float; -GLEE_EXTERN GLboolean _GLEE_ATI_texture_env_combine3; -GLEE_EXTERN GLboolean _GLEE_ATI_texture_float; -GLEE_EXTERN GLboolean _GLEE_NV_float_buffer; -GLEE_EXTERN GLboolean _GLEE_NV_fragment_program; -GLEE_EXTERN GLboolean _GLEE_NV_half_float; -GLEE_EXTERN GLboolean _GLEE_NV_pixel_data_range; -GLEE_EXTERN GLboolean _GLEE_NV_primitive_restart; -GLEE_EXTERN GLboolean _GLEE_NV_texture_expand_normal; -GLEE_EXTERN GLboolean _GLEE_NV_vertex_program2; -GLEE_EXTERN GLboolean _GLEE_ATI_map_object_buffer; -GLEE_EXTERN GLboolean _GLEE_ATI_separate_stencil; -GLEE_EXTERN GLboolean _GLEE_ATI_vertex_attrib_array_object; -GLEE_EXTERN GLboolean _GLEE_OES_read_format; -GLEE_EXTERN GLboolean _GLEE_EXT_depth_bounds_test; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_mirror_clamp; -GLEE_EXTERN GLboolean _GLEE_EXT_blend_equation_separate; -GLEE_EXTERN GLboolean _GLEE_MESA_pack_invert; -GLEE_EXTERN GLboolean _GLEE_MESA_ycbcr_texture; -GLEE_EXTERN GLboolean _GLEE_EXT_pixel_buffer_object; -GLEE_EXTERN GLboolean _GLEE_NV_fragment_program_option; -GLEE_EXTERN GLboolean _GLEE_NV_fragment_program2; -GLEE_EXTERN GLboolean _GLEE_NV_vertex_program2_option; -GLEE_EXTERN GLboolean _GLEE_NV_vertex_program3; -GLEE_EXTERN GLboolean _GLEE_EXT_framebuffer_object; -GLEE_EXTERN GLboolean _GLEE_GREMEDY_string_marker; -GLEE_EXTERN GLboolean _GLEE_EXT_packed_depth_stencil; -GLEE_EXTERN GLboolean _GLEE_EXT_stencil_clear_tag; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_sRGB; -GLEE_EXTERN GLboolean _GLEE_EXT_framebuffer_blit; -GLEE_EXTERN GLboolean _GLEE_EXT_framebuffer_multisample; -GLEE_EXTERN GLboolean _GLEE_MESAX_texture_stack; -GLEE_EXTERN GLboolean _GLEE_EXT_timer_query; -GLEE_EXTERN GLboolean _GLEE_EXT_gpu_program_parameters; -GLEE_EXTERN GLboolean _GLEE_APPLE_flush_buffer_range; -GLEE_EXTERN GLboolean _GLEE_NV_gpu_program4; -GLEE_EXTERN GLboolean _GLEE_NV_geometry_program4; -GLEE_EXTERN GLboolean _GLEE_EXT_geometry_shader4; -GLEE_EXTERN GLboolean _GLEE_NV_vertex_program4; -GLEE_EXTERN GLboolean _GLEE_EXT_gpu_shader4; -GLEE_EXTERN GLboolean _GLEE_EXT_drawinstanced; -GLEE_EXTERN GLboolean _GLEE_EXT_packed_float; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_array; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_buffer_object; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_compression_latc; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_compression_rgtc; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_shared_exponent; -GLEE_EXTERN GLboolean _GLEE_NV_depth_buffer_float; -GLEE_EXTERN GLboolean _GLEE_NV_fragment_program4; -GLEE_EXTERN GLboolean _GLEE_NV_framebuffer_multisample_coverage; -GLEE_EXTERN GLboolean _GLEE_EXT_framebuffer_sRGB; -GLEE_EXTERN GLboolean _GLEE_NV_geometry_shader4; -GLEE_EXTERN GLboolean _GLEE_NV_parameter_buffer_object; -GLEE_EXTERN GLboolean _GLEE_EXT_draw_buffers2; -GLEE_EXTERN GLboolean _GLEE_NV_transform_feedback; -GLEE_EXTERN GLboolean _GLEE_EXT_bindable_uniform; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_integer; -GLEE_EXTERN GLboolean _GLEE_GREMEDY_frame_terminator; -GLEE_EXTERN GLboolean _GLEE_NV_conditional_render; -GLEE_EXTERN GLboolean _GLEE_NV_present_video; -GLEE_EXTERN GLboolean _GLEE_EXT_transform_feedback; -GLEE_EXTERN GLboolean _GLEE_EXT_direct_state_access; -GLEE_EXTERN GLboolean _GLEE_EXT_vertex_array_bgra; -GLEE_EXTERN GLboolean _GLEE_SGIX_texture_select; -GLEE_EXTERN GLboolean _GLEE_INGR_blend_func_separate; -GLEE_EXTERN GLboolean _GLEE_SGIX_depth_pass_instrument; -GLEE_EXTERN GLboolean _GLEE_SGIX_igloo_interface; -GLEE_EXTERN GLboolean _GLEE_EXT_fragment_lighting; -GLEE_EXTERN GLboolean _GLEE_EXT_scene_marker; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_compression_dxt1; -GLEE_EXTERN GLboolean _GLEE_EXT_texture_env; -GLEE_EXTERN GLboolean _GLEE_IBM_static_data; -GLEE_EXTERN GLboolean _GLEE_OES_byte_coordinates; -GLEE_EXTERN GLboolean _GLEE_OES_compressed_paletted_texture; -GLEE_EXTERN GLboolean _GLEE_OES_single_precision; -GLEE_EXTERN GLboolean _GLEE_SGIX_pixel_texture_bits; -GLEE_EXTERN GLboolean _GLEE_SGIX_texture_range; - -/* Aliases for extension querying variables */ - -#define GLEE_VERSION_1_2 GLeeEnabled(&_GLEE_VERSION_1_2) -#define GLEE_ARB_imaging GLeeEnabled(&_GLEE_ARB_imaging) -#define GLEE_VERSION_1_3 GLeeEnabled(&_GLEE_VERSION_1_3) -#define GLEE_VERSION_1_4 GLeeEnabled(&_GLEE_VERSION_1_4) -#define GLEE_VERSION_1_5 GLeeEnabled(&_GLEE_VERSION_1_5) -#define GLEE_VERSION_2_0 GLeeEnabled(&_GLEE_VERSION_2_0) -#define GLEE_VERSION_2_1 GLeeEnabled(&_GLEE_VERSION_2_1) -#define GLEE_VERSION_3_0 GLeeEnabled(&_GLEE_VERSION_3_0) -#define GLEE_ARB_multitexture GLeeEnabled(&_GLEE_ARB_multitexture) -#define GLEE_ARB_transpose_matrix GLeeEnabled(&_GLEE_ARB_transpose_matrix) -#define GLEE_ARB_multisample GLeeEnabled(&_GLEE_ARB_multisample) -#define GLEE_ARB_texture_env_add GLeeEnabled(&_GLEE_ARB_texture_env_add) -#define GLEE_ARB_texture_cube_map GLeeEnabled(&_GLEE_ARB_texture_cube_map) -#define GLEE_ARB_texture_compression GLeeEnabled(&_GLEE_ARB_texture_compression) -#define GLEE_ARB_texture_border_clamp GLeeEnabled(&_GLEE_ARB_texture_border_clamp) -#define GLEE_ARB_point_parameters GLeeEnabled(&_GLEE_ARB_point_parameters) -#define GLEE_ARB_vertex_blend GLeeEnabled(&_GLEE_ARB_vertex_blend) -#define GLEE_ARB_matrix_palette GLeeEnabled(&_GLEE_ARB_matrix_palette) -#define GLEE_ARB_texture_env_combine GLeeEnabled(&_GLEE_ARB_texture_env_combine) -#define GLEE_ARB_texture_env_crossbar GLeeEnabled(&_GLEE_ARB_texture_env_crossbar) -#define GLEE_ARB_texture_env_dot3 GLeeEnabled(&_GLEE_ARB_texture_env_dot3) -#define GLEE_ARB_texture_mirrored_repeat GLeeEnabled(&_GLEE_ARB_texture_mirrored_repeat) -#define GLEE_ARB_depth_texture GLeeEnabled(&_GLEE_ARB_depth_texture) -#define GLEE_ARB_shadow GLeeEnabled(&_GLEE_ARB_shadow) -#define GLEE_ARB_shadow_ambient GLeeEnabled(&_GLEE_ARB_shadow_ambient) -#define GLEE_ARB_window_pos GLeeEnabled(&_GLEE_ARB_window_pos) -#define GLEE_ARB_vertex_program GLeeEnabled(&_GLEE_ARB_vertex_program) -#define GLEE_ARB_fragment_program GLeeEnabled(&_GLEE_ARB_fragment_program) -#define GLEE_ARB_vertex_buffer_object GLeeEnabled(&_GLEE_ARB_vertex_buffer_object) -#define GLEE_ARB_occlusion_query GLeeEnabled(&_GLEE_ARB_occlusion_query) -#define GLEE_ARB_shader_objects GLeeEnabled(&_GLEE_ARB_shader_objects) -#define GLEE_ARB_vertex_shader GLeeEnabled(&_GLEE_ARB_vertex_shader) -#define GLEE_ARB_fragment_shader GLeeEnabled(&_GLEE_ARB_fragment_shader) -#define GLEE_ARB_shading_language_100 GLeeEnabled(&_GLEE_ARB_shading_language_100) -#define GLEE_ARB_texture_non_power_of_two GLeeEnabled(&_GLEE_ARB_texture_non_power_of_two) -#define GLEE_ARB_point_sprite GLeeEnabled(&_GLEE_ARB_point_sprite) -#define GLEE_ARB_fragment_program_shadow GLeeEnabled(&_GLEE_ARB_fragment_program_shadow) -#define GLEE_ARB_draw_buffers GLeeEnabled(&_GLEE_ARB_draw_buffers) -#define GLEE_ARB_texture_rectangle GLeeEnabled(&_GLEE_ARB_texture_rectangle) -#define GLEE_ARB_color_buffer_float GLeeEnabled(&_GLEE_ARB_color_buffer_float) -#define GLEE_ARB_half_float_pixel GLeeEnabled(&_GLEE_ARB_half_float_pixel) -#define GLEE_ARB_texture_float GLeeEnabled(&_GLEE_ARB_texture_float) -#define GLEE_ARB_pixel_buffer_object GLeeEnabled(&_GLEE_ARB_pixel_buffer_object) -#define GLEE_ARB_depth_buffer_float GLeeEnabled(&_GLEE_ARB_depth_buffer_float) -#define GLEE_ARB_drawinstanced GLeeEnabled(&_GLEE_ARB_drawinstanced) -#define GLEE_ARB_framebuffer_object GLeeEnabled(&_GLEE_ARB_framebuffer_object) -#define GLEE_ARB_framebuffer_sRGB GLeeEnabled(&_GLEE_ARB_framebuffer_sRGB) -#define GLEE_ARB_geometry_shader4 GLeeEnabled(&_GLEE_ARB_geometry_shader4) -#define GLEE_ARB_half_float_vertex GLeeEnabled(&_GLEE_ARB_half_float_vertex) -#define GLEE_ARBinstanced_arrays GLeeEnabled(&_GLEE_ARBinstanced_arrays) -#define GLEE_ARB_map_buffer_range GLeeEnabled(&_GLEE_ARB_map_buffer_range) -#define GLEE_ARB_texture_buffer_object GLeeEnabled(&_GLEE_ARB_texture_buffer_object) -#define GLEE_ARB_texture_compression_rgtc GLeeEnabled(&_GLEE_ARB_texture_compression_rgtc) -#define GLEE_ARB_texture_rg GLeeEnabled(&_GLEE_ARB_texture_rg) -#define GLEE_ARB_vertex_array_object GLeeEnabled(&_GLEE_ARB_vertex_array_object) -#define GLEE_EXT_abgr GLeeEnabled(&_GLEE_EXT_abgr) -#define GLEE_EXT_blend_color GLeeEnabled(&_GLEE_EXT_blend_color) -#define GLEE_EXT_polygon_offset GLeeEnabled(&_GLEE_EXT_polygon_offset) -#define GLEE_EXT_texture GLeeEnabled(&_GLEE_EXT_texture) -#define GLEE_EXT_texture3D GLeeEnabled(&_GLEE_EXT_texture3D) -#define GLEE_SGIS_texture_filter4 GLeeEnabled(&_GLEE_SGIS_texture_filter4) -#define GLEE_EXT_subtexture GLeeEnabled(&_GLEE_EXT_subtexture) -#define GLEE_EXT_copy_texture GLeeEnabled(&_GLEE_EXT_copy_texture) -#define GLEE_EXT_histogram GLeeEnabled(&_GLEE_EXT_histogram) -#define GLEE_EXT_convolution GLeeEnabled(&_GLEE_EXT_convolution) -#define GLEE_SGI_color_matrix GLeeEnabled(&_GLEE_SGI_color_matrix) -#define GLEE_SGI_color_table GLeeEnabled(&_GLEE_SGI_color_table) -#define GLEE_SGIS_pixel_texture GLeeEnabled(&_GLEE_SGIS_pixel_texture) -#define GLEE_SGIX_pixel_texture GLeeEnabled(&_GLEE_SGIX_pixel_texture) -#define GLEE_SGIS_texture4D GLeeEnabled(&_GLEE_SGIS_texture4D) -#define GLEE_SGI_texture_color_table GLeeEnabled(&_GLEE_SGI_texture_color_table) -#define GLEE_EXT_cmyka GLeeEnabled(&_GLEE_EXT_cmyka) -#define GLEE_EXT_texture_object GLeeEnabled(&_GLEE_EXT_texture_object) -#define GLEE_SGIS_detail_texture GLeeEnabled(&_GLEE_SGIS_detail_texture) -#define GLEE_SGIS_sharpen_texture GLeeEnabled(&_GLEE_SGIS_sharpen_texture) -#define GLEE_EXT_packed_pixels GLeeEnabled(&_GLEE_EXT_packed_pixels) -#define GLEE_SGIS_texture_lod GLeeEnabled(&_GLEE_SGIS_texture_lod) -#define GLEE_SGIS_multisample GLeeEnabled(&_GLEE_SGIS_multisample) -#define GLEE_EXT_rescale_normal GLeeEnabled(&_GLEE_EXT_rescale_normal) -#define GLEE_EXT_vertex_array GLeeEnabled(&_GLEE_EXT_vertex_array) -#define GLEE_EXT_misc_attribute GLeeEnabled(&_GLEE_EXT_misc_attribute) -#define GLEE_SGIS_generate_mipmap GLeeEnabled(&_GLEE_SGIS_generate_mipmap) -#define GLEE_SGIX_clipmap GLeeEnabled(&_GLEE_SGIX_clipmap) -#define GLEE_SGIX_shadow GLeeEnabled(&_GLEE_SGIX_shadow) -#define GLEE_SGIS_texture_edge_clamp GLeeEnabled(&_GLEE_SGIS_texture_edge_clamp) -#define GLEE_SGIS_texture_border_clamp GLeeEnabled(&_GLEE_SGIS_texture_border_clamp) -#define GLEE_EXT_blend_minmax GLeeEnabled(&_GLEE_EXT_blend_minmax) -#define GLEE_EXT_blend_subtract GLeeEnabled(&_GLEE_EXT_blend_subtract) -#define GLEE_EXT_blend_logic_op GLeeEnabled(&_GLEE_EXT_blend_logic_op) -#define GLEE_SGIX_interlace GLeeEnabled(&_GLEE_SGIX_interlace) -#define GLEE_SGIX_pixel_tiles GLeeEnabled(&_GLEE_SGIX_pixel_tiles) -#define GLEE_SGIS_texture_select GLeeEnabled(&_GLEE_SGIS_texture_select) -#define GLEE_SGIX_sprite GLeeEnabled(&_GLEE_SGIX_sprite) -#define GLEE_SGIX_texture_multi_buffer GLeeEnabled(&_GLEE_SGIX_texture_multi_buffer) -#define GLEE_EXT_point_parameters GLeeEnabled(&_GLEE_EXT_point_parameters) -#define GLEE_SGIS_point_parameters GLeeEnabled(&_GLEE_SGIS_point_parameters) -#define GLEE_SGIX_instruments GLeeEnabled(&_GLEE_SGIX_instruments) -#define GLEE_SGIX_texture_scale_bias GLeeEnabled(&_GLEE_SGIX_texture_scale_bias) -#define GLEE_SGIX_framezoom GLeeEnabled(&_GLEE_SGIX_framezoom) -#define GLEE_SGIX_tag_sample_buffer GLeeEnabled(&_GLEE_SGIX_tag_sample_buffer) -#define GLEE_FfdMaskSGIX GLeeEnabled(&_GLEE_FfdMaskSGIX) -#define GLEE_SGIX_polynomial_ffd GLeeEnabled(&_GLEE_SGIX_polynomial_ffd) -#define GLEE_SGIX_reference_plane GLeeEnabled(&_GLEE_SGIX_reference_plane) -#define GLEE_SGIX_flush_raster GLeeEnabled(&_GLEE_SGIX_flush_raster) -#define GLEE_SGIX_depth_texture GLeeEnabled(&_GLEE_SGIX_depth_texture) -#define GLEE_SGIS_fog_function GLeeEnabled(&_GLEE_SGIS_fog_function) -#define GLEE_SGIX_fog_offset GLeeEnabled(&_GLEE_SGIX_fog_offset) -#define GLEE_HP_image_transform GLeeEnabled(&_GLEE_HP_image_transform) -#define GLEE_HP_convolution_border_modes GLeeEnabled(&_GLEE_HP_convolution_border_modes) -#define GLEE_INGR_palette_buffer GLeeEnabled(&_GLEE_INGR_palette_buffer) -#define GLEE_SGIX_texture_add_env GLeeEnabled(&_GLEE_SGIX_texture_add_env) -#define GLEE_EXT_color_subtable GLeeEnabled(&_GLEE_EXT_color_subtable) -#define GLEE_PGI_vertex_hints GLeeEnabled(&_GLEE_PGI_vertex_hints) -#define GLEE_PGI_misc_hints GLeeEnabled(&_GLEE_PGI_misc_hints) -#define GLEE_EXT_paletted_texture GLeeEnabled(&_GLEE_EXT_paletted_texture) -#define GLEE_EXT_clip_volume_hint GLeeEnabled(&_GLEE_EXT_clip_volume_hint) -#define GLEE_SGIX_list_priority GLeeEnabled(&_GLEE_SGIX_list_priority) -#define GLEE_SGIX_ir_instrument1 GLeeEnabled(&_GLEE_SGIX_ir_instrument1) -#define GLEE_SGIX_calligraphic_fragment GLeeEnabled(&_GLEE_SGIX_calligraphic_fragment) -#define GLEE_SGIX_texture_lod_bias GLeeEnabled(&_GLEE_SGIX_texture_lod_bias) -#define GLEE_SGIX_shadow_ambient GLeeEnabled(&_GLEE_SGIX_shadow_ambient) -#define GLEE_EXT_index_texture GLeeEnabled(&_GLEE_EXT_index_texture) -#define GLEE_EXT_index_material GLeeEnabled(&_GLEE_EXT_index_material) -#define GLEE_EXT_index_func GLeeEnabled(&_GLEE_EXT_index_func) -#define GLEE_EXT_index_array_formats GLeeEnabled(&_GLEE_EXT_index_array_formats) -#define GLEE_EXT_compiled_vertex_array GLeeEnabled(&_GLEE_EXT_compiled_vertex_array) -#define GLEE_EXT_cull_vertex GLeeEnabled(&_GLEE_EXT_cull_vertex) -#define GLEE_SGIX_ycrcb GLeeEnabled(&_GLEE_SGIX_ycrcb) -#define GLEE_SGIX_fragment_lighting GLeeEnabled(&_GLEE_SGIX_fragment_lighting) -#define GLEE_IBM_rasterpos_clip GLeeEnabled(&_GLEE_IBM_rasterpos_clip) -#define GLEE_HP_texture_lighting GLeeEnabled(&_GLEE_HP_texture_lighting) -#define GLEE_EXT_draw_range_elements GLeeEnabled(&_GLEE_EXT_draw_range_elements) -#define GLEE_WIN_phong_shading GLeeEnabled(&_GLEE_WIN_phong_shading) -#define GLEE_WIN_specular_fog GLeeEnabled(&_GLEE_WIN_specular_fog) -#define GLEE_EXT_light_texture GLeeEnabled(&_GLEE_EXT_light_texture) -#define GLEE_SGIX_blend_alpha_minmax GLeeEnabled(&_GLEE_SGIX_blend_alpha_minmax) -#define GLEE_SGIX_impact_pixel_texture GLeeEnabled(&_GLEE_SGIX_impact_pixel_texture) -#define GLEE_EXT_bgra GLeeEnabled(&_GLEE_EXT_bgra) -#define GLEE_SGIX_async GLeeEnabled(&_GLEE_SGIX_async) -#define GLEE_SGIX_async_pixel GLeeEnabled(&_GLEE_SGIX_async_pixel) -#define GLEE_SGIX_async_histogram GLeeEnabled(&_GLEE_SGIX_async_histogram) -#define GLEE_INTEL_texture_scissor GLeeEnabled(&_GLEE_INTEL_texture_scissor) -#define GLEE_INTEL_parallel_arrays GLeeEnabled(&_GLEE_INTEL_parallel_arrays) -#define GLEE_HP_occlusion_test GLeeEnabled(&_GLEE_HP_occlusion_test) -#define GLEE_EXT_pixel_transform GLeeEnabled(&_GLEE_EXT_pixel_transform) -#define GLEE_EXT_pixel_transform_color_table GLeeEnabled(&_GLEE_EXT_pixel_transform_color_table) -#define GLEE_EXT_shared_texture_palette GLeeEnabled(&_GLEE_EXT_shared_texture_palette) -#define GLEE_EXT_separate_specular_color GLeeEnabled(&_GLEE_EXT_separate_specular_color) -#define GLEE_EXT_secondary_color GLeeEnabled(&_GLEE_EXT_secondary_color) -#define GLEE_EXT_texture_perturb_normal GLeeEnabled(&_GLEE_EXT_texture_perturb_normal) -#define GLEE_EXT_multi_draw_arrays GLeeEnabled(&_GLEE_EXT_multi_draw_arrays) -#define GLEE_EXT_fog_coord GLeeEnabled(&_GLEE_EXT_fog_coord) -#define GLEE_REND_screen_coordinates GLeeEnabled(&_GLEE_REND_screen_coordinates) -#define GLEE_EXT_coordinate_frame GLeeEnabled(&_GLEE_EXT_coordinate_frame) -#define GLEE_EXT_texture_env_combine GLeeEnabled(&_GLEE_EXT_texture_env_combine) -#define GLEE_APPLE_specular_vector GLeeEnabled(&_GLEE_APPLE_specular_vector) -#define GLEE_APPLE_transform_hint GLeeEnabled(&_GLEE_APPLE_transform_hint) -#define GLEE_SGIX_fog_scale GLeeEnabled(&_GLEE_SGIX_fog_scale) -#define GLEE_SUNX_constant_data GLeeEnabled(&_GLEE_SUNX_constant_data) -#define GLEE_SUN_global_alpha GLeeEnabled(&_GLEE_SUN_global_alpha) -#define GLEE_SUN_triangle_list GLeeEnabled(&_GLEE_SUN_triangle_list) -#define GLEE_SUN_vertex GLeeEnabled(&_GLEE_SUN_vertex) -#define GLEE_EXT_blend_func_separate GLeeEnabled(&_GLEE_EXT_blend_func_separate) -#define GLEE_INGR_color_clamp GLeeEnabled(&_GLEE_INGR_color_clamp) -#define GLEE_INGR_interlace_read GLeeEnabled(&_GLEE_INGR_interlace_read) -#define GLEE_EXT_stencil_wrap GLeeEnabled(&_GLEE_EXT_stencil_wrap) -#define GLEE_EXT_422_pixels GLeeEnabled(&_GLEE_EXT_422_pixels) -#define GLEE_NV_texgen_reflection GLeeEnabled(&_GLEE_NV_texgen_reflection) -#define GLEE_EXT_texture_cube_map GLeeEnabled(&_GLEE_EXT_texture_cube_map) -#define GLEE_SUN_convolution_border_modes GLeeEnabled(&_GLEE_SUN_convolution_border_modes) -#define GLEE_EXT_texture_env_add GLeeEnabled(&_GLEE_EXT_texture_env_add) -#define GLEE_EXT_texture_lod_bias GLeeEnabled(&_GLEE_EXT_texture_lod_bias) -#define GLEE_EXT_texture_filter_anisotropic GLeeEnabled(&_GLEE_EXT_texture_filter_anisotropic) -#define GLEE_EXT_vertex_weighting GLeeEnabled(&_GLEE_EXT_vertex_weighting) -#define GLEE_NV_light_max_exponent GLeeEnabled(&_GLEE_NV_light_max_exponent) -#define GLEE_NV_vertex_array_range GLeeEnabled(&_GLEE_NV_vertex_array_range) -#define GLEE_NV_register_combiners GLeeEnabled(&_GLEE_NV_register_combiners) -#define GLEE_NV_fog_distance GLeeEnabled(&_GLEE_NV_fog_distance) -#define GLEE_NV_texgen_emboss GLeeEnabled(&_GLEE_NV_texgen_emboss) -#define GLEE_NV_blend_square GLeeEnabled(&_GLEE_NV_blend_square) -#define GLEE_NV_texture_env_combine4 GLeeEnabled(&_GLEE_NV_texture_env_combine4) -#define GLEE_MESA_resize_buffers GLeeEnabled(&_GLEE_MESA_resize_buffers) -#define GLEE_MESA_window_pos GLeeEnabled(&_GLEE_MESA_window_pos) -#define GLEE_EXT_texture_compression_s3tc GLeeEnabled(&_GLEE_EXT_texture_compression_s3tc) -#define GLEE_IBM_cull_vertex GLeeEnabled(&_GLEE_IBM_cull_vertex) -#define GLEE_IBM_multimode_draw_arrays GLeeEnabled(&_GLEE_IBM_multimode_draw_arrays) -#define GLEE_IBM_vertex_array_lists GLeeEnabled(&_GLEE_IBM_vertex_array_lists) -#define GLEE_SGIX_subsample GLeeEnabled(&_GLEE_SGIX_subsample) -#define GLEE_SGIX_ycrcb_subsample GLeeEnabled(&_GLEE_SGIX_ycrcb_subsample) -#define GLEE_SGIX_ycrcba GLeeEnabled(&_GLEE_SGIX_ycrcba) -#define GLEE_SGI_depth_pass_instrument GLeeEnabled(&_GLEE_SGI_depth_pass_instrument) -#define GLEE_3DFX_texture_compression_FXT1 GLeeEnabled(&_GLEE_3DFX_texture_compression_FXT1) -#define GLEE_3DFX_multisample GLeeEnabled(&_GLEE_3DFX_multisample) -#define GLEE_3DFX_tbuffer GLeeEnabled(&_GLEE_3DFX_tbuffer) -#define GLEE_EXT_multisample GLeeEnabled(&_GLEE_EXT_multisample) -#define GLEE_SGIX_vertex_preclip GLeeEnabled(&_GLEE_SGIX_vertex_preclip) -#define GLEE_SGIX_convolution_accuracy GLeeEnabled(&_GLEE_SGIX_convolution_accuracy) -#define GLEE_SGIX_resample GLeeEnabled(&_GLEE_SGIX_resample) -#define GLEE_SGIS_point_line_texgen GLeeEnabled(&_GLEE_SGIS_point_line_texgen) -#define GLEE_SGIS_texture_color_mask GLeeEnabled(&_GLEE_SGIS_texture_color_mask) -#define GLEE_EXT_texture_env_dot3 GLeeEnabled(&_GLEE_EXT_texture_env_dot3) -#define GLEE_ATI_texture_mirror_once GLeeEnabled(&_GLEE_ATI_texture_mirror_once) -#define GLEE_NV_fence GLeeEnabled(&_GLEE_NV_fence) -#define GLEE_IBM_texture_mirrored_repeat GLeeEnabled(&_GLEE_IBM_texture_mirrored_repeat) -#define GLEE_NV_evaluators GLeeEnabled(&_GLEE_NV_evaluators) -#define GLEE_NV_packed_depth_stencil GLeeEnabled(&_GLEE_NV_packed_depth_stencil) -#define GLEE_NV_register_combiners2 GLeeEnabled(&_GLEE_NV_register_combiners2) -#define GLEE_NV_texture_compression_vtc GLeeEnabled(&_GLEE_NV_texture_compression_vtc) -#define GLEE_NV_texture_rectangle GLeeEnabled(&_GLEE_NV_texture_rectangle) -#define GLEE_NV_texture_shader GLeeEnabled(&_GLEE_NV_texture_shader) -#define GLEE_NV_texture_shader2 GLeeEnabled(&_GLEE_NV_texture_shader2) -#define GLEE_NV_vertex_array_range2 GLeeEnabled(&_GLEE_NV_vertex_array_range2) -#define GLEE_NV_vertex_program GLeeEnabled(&_GLEE_NV_vertex_program) -#define GLEE_SGIX_texture_coordinate_clamp GLeeEnabled(&_GLEE_SGIX_texture_coordinate_clamp) -#define GLEE_SGIX_scalebias_hint GLeeEnabled(&_GLEE_SGIX_scalebias_hint) -#define GLEE_OML_interlace GLeeEnabled(&_GLEE_OML_interlace) -#define GLEE_OML_subsample GLeeEnabled(&_GLEE_OML_subsample) -#define GLEE_OML_resample GLeeEnabled(&_GLEE_OML_resample) -#define GLEE_NV_copy_depth_to_color GLeeEnabled(&_GLEE_NV_copy_depth_to_color) -#define GLEE_ATI_envmap_bumpmap GLeeEnabled(&_GLEE_ATI_envmap_bumpmap) -#define GLEE_ATI_fragment_shader GLeeEnabled(&_GLEE_ATI_fragment_shader) -#define GLEE_ATI_pn_triangles GLeeEnabled(&_GLEE_ATI_pn_triangles) -#define GLEE_ATI_vertex_array_object GLeeEnabled(&_GLEE_ATI_vertex_array_object) -#define GLEE_EXT_vertex_shader GLeeEnabled(&_GLEE_EXT_vertex_shader) -#define GLEE_ATI_vertex_streams GLeeEnabled(&_GLEE_ATI_vertex_streams) -#define GLEE_ATI_element_array GLeeEnabled(&_GLEE_ATI_element_array) -#define GLEE_SUN_mesh_array GLeeEnabled(&_GLEE_SUN_mesh_array) -#define GLEE_SUN_slice_accum GLeeEnabled(&_GLEE_SUN_slice_accum) -#define GLEE_NV_multisample_filter_hint GLeeEnabled(&_GLEE_NV_multisample_filter_hint) -#define GLEE_NV_depth_clamp GLeeEnabled(&_GLEE_NV_depth_clamp) -#define GLEE_NV_occlusion_query GLeeEnabled(&_GLEE_NV_occlusion_query) -#define GLEE_NV_point_sprite GLeeEnabled(&_GLEE_NV_point_sprite) -#define GLEE_NV_texture_shader3 GLeeEnabled(&_GLEE_NV_texture_shader3) -#define GLEE_NV_vertex_program1_1 GLeeEnabled(&_GLEE_NV_vertex_program1_1) -#define GLEE_EXT_shadow_funcs GLeeEnabled(&_GLEE_EXT_shadow_funcs) -#define GLEE_EXT_stencil_two_side GLeeEnabled(&_GLEE_EXT_stencil_two_side) -#define GLEE_ATI_text_fragment_shader GLeeEnabled(&_GLEE_ATI_text_fragment_shader) -#define GLEE_APPLE_client_storage GLeeEnabled(&_GLEE_APPLE_client_storage) -#define GLEE_APPLE_element_array GLeeEnabled(&_GLEE_APPLE_element_array) -#define GLEE_APPLE_fence GLeeEnabled(&_GLEE_APPLE_fence) -#define GLEE_APPLE_vertex_array_object GLeeEnabled(&_GLEE_APPLE_vertex_array_object) -#define GLEE_APPLE_vertex_array_range GLeeEnabled(&_GLEE_APPLE_vertex_array_range) -#define GLEE_APPLE_ycbcr_422 GLeeEnabled(&_GLEE_APPLE_ycbcr_422) -#define GLEE_S3_s3tc GLeeEnabled(&_GLEE_S3_s3tc) -#define GLEE_ATI_draw_buffers GLeeEnabled(&_GLEE_ATI_draw_buffers) -#define GLEE_ATI_pixel_format_float GLeeEnabled(&_GLEE_ATI_pixel_format_float) -#define GLEE_ATI_texture_env_combine3 GLeeEnabled(&_GLEE_ATI_texture_env_combine3) -#define GLEE_ATI_texture_float GLeeEnabled(&_GLEE_ATI_texture_float) -#define GLEE_NV_float_buffer GLeeEnabled(&_GLEE_NV_float_buffer) -#define GLEE_NV_fragment_program GLeeEnabled(&_GLEE_NV_fragment_program) -#define GLEE_NV_half_float GLeeEnabled(&_GLEE_NV_half_float) -#define GLEE_NV_pixel_data_range GLeeEnabled(&_GLEE_NV_pixel_data_range) -#define GLEE_NV_primitive_restart GLeeEnabled(&_GLEE_NV_primitive_restart) -#define GLEE_NV_texture_expand_normal GLeeEnabled(&_GLEE_NV_texture_expand_normal) -#define GLEE_NV_vertex_program2 GLeeEnabled(&_GLEE_NV_vertex_program2) -#define GLEE_ATI_map_object_buffer GLeeEnabled(&_GLEE_ATI_map_object_buffer) -#define GLEE_ATI_separate_stencil GLeeEnabled(&_GLEE_ATI_separate_stencil) -#define GLEE_ATI_vertex_attrib_array_object GLeeEnabled(&_GLEE_ATI_vertex_attrib_array_object) -#define GLEE_OES_read_format GLeeEnabled(&_GLEE_OES_read_format) -#define GLEE_EXT_depth_bounds_test GLeeEnabled(&_GLEE_EXT_depth_bounds_test) -#define GLEE_EXT_texture_mirror_clamp GLeeEnabled(&_GLEE_EXT_texture_mirror_clamp) -#define GLEE_EXT_blend_equation_separate GLeeEnabled(&_GLEE_EXT_blend_equation_separate) -#define GLEE_MESA_pack_invert GLeeEnabled(&_GLEE_MESA_pack_invert) -#define GLEE_MESA_ycbcr_texture GLeeEnabled(&_GLEE_MESA_ycbcr_texture) -#define GLEE_EXT_pixel_buffer_object GLeeEnabled(&_GLEE_EXT_pixel_buffer_object) -#define GLEE_NV_fragment_program_option GLeeEnabled(&_GLEE_NV_fragment_program_option) -#define GLEE_NV_fragment_program2 GLeeEnabled(&_GLEE_NV_fragment_program2) -#define GLEE_NV_vertex_program2_option GLeeEnabled(&_GLEE_NV_vertex_program2_option) -#define GLEE_NV_vertex_program3 GLeeEnabled(&_GLEE_NV_vertex_program3) -#define GLEE_EXT_framebuffer_object GLeeEnabled(&_GLEE_EXT_framebuffer_object) -#define GLEE_GREMEDY_string_marker GLeeEnabled(&_GLEE_GREMEDY_string_marker) -#define GLEE_EXT_packed_depth_stencil GLeeEnabled(&_GLEE_EXT_packed_depth_stencil) -#define GLEE_EXT_stencil_clear_tag GLeeEnabled(&_GLEE_EXT_stencil_clear_tag) -#define GLEE_EXT_texture_sRGB GLeeEnabled(&_GLEE_EXT_texture_sRGB) -#define GLEE_EXT_framebuffer_blit GLeeEnabled(&_GLEE_EXT_framebuffer_blit) -#define GLEE_EXT_framebuffer_multisample GLeeEnabled(&_GLEE_EXT_framebuffer_multisample) -#define GLEE_MESAX_texture_stack GLeeEnabled(&_GLEE_MESAX_texture_stack) -#define GLEE_EXT_timer_query GLeeEnabled(&_GLEE_EXT_timer_query) -#define GLEE_EXT_gpu_program_parameters GLeeEnabled(&_GLEE_EXT_gpu_program_parameters) -#define GLEE_APPLE_flush_buffer_range GLeeEnabled(&_GLEE_APPLE_flush_buffer_range) -#define GLEE_NV_gpu_program4 GLeeEnabled(&_GLEE_NV_gpu_program4) -#define GLEE_NV_geometry_program4 GLeeEnabled(&_GLEE_NV_geometry_program4) -#define GLEE_EXT_geometry_shader4 GLeeEnabled(&_GLEE_EXT_geometry_shader4) -#define GLEE_NV_vertex_program4 GLeeEnabled(&_GLEE_NV_vertex_program4) -#define GLEE_EXT_gpu_shader4 GLeeEnabled(&_GLEE_EXT_gpu_shader4) -#define GLEE_EXT_drawinstanced GLeeEnabled(&_GLEE_EXT_drawinstanced) -#define GLEE_EXT_packed_float GLeeEnabled(&_GLEE_EXT_packed_float) -#define GLEE_EXT_texture_array GLeeEnabled(&_GLEE_EXT_texture_array) -#define GLEE_EXT_texture_buffer_object GLeeEnabled(&_GLEE_EXT_texture_buffer_object) -#define GLEE_EXT_texture_compression_latc GLeeEnabled(&_GLEE_EXT_texture_compression_latc) -#define GLEE_EXT_texture_compression_rgtc GLeeEnabled(&_GLEE_EXT_texture_compression_rgtc) -#define GLEE_EXT_texture_shared_exponent GLeeEnabled(&_GLEE_EXT_texture_shared_exponent) -#define GLEE_NV_depth_buffer_float GLeeEnabled(&_GLEE_NV_depth_buffer_float) -#define GLEE_NV_fragment_program4 GLeeEnabled(&_GLEE_NV_fragment_program4) -#define GLEE_NV_framebuffer_multisample_coverage GLeeEnabled(&_GLEE_NV_framebuffer_multisample_coverage) -#define GLEE_EXT_framebuffer_sRGB GLeeEnabled(&_GLEE_EXT_framebuffer_sRGB) -#define GLEE_NV_geometry_shader4 GLeeEnabled(&_GLEE_NV_geometry_shader4) -#define GLEE_NV_parameter_buffer_object GLeeEnabled(&_GLEE_NV_parameter_buffer_object) -#define GLEE_EXT_draw_buffers2 GLeeEnabled(&_GLEE_EXT_draw_buffers2) -#define GLEE_NV_transform_feedback GLeeEnabled(&_GLEE_NV_transform_feedback) -#define GLEE_EXT_bindable_uniform GLeeEnabled(&_GLEE_EXT_bindable_uniform) -#define GLEE_EXT_texture_integer GLeeEnabled(&_GLEE_EXT_texture_integer) -#define GLEE_GREMEDY_frame_terminator GLeeEnabled(&_GLEE_GREMEDY_frame_terminator) -#define GLEE_NV_conditional_render GLeeEnabled(&_GLEE_NV_conditional_render) -#define GLEE_NV_present_video GLeeEnabled(&_GLEE_NV_present_video) -#define GLEE_EXT_transform_feedback GLeeEnabled(&_GLEE_EXT_transform_feedback) -#define GLEE_EXT_direct_state_access GLeeEnabled(&_GLEE_EXT_direct_state_access) -#define GLEE_EXT_vertex_array_bgra GLeeEnabled(&_GLEE_EXT_vertex_array_bgra) -#define GLEE_SGIX_texture_select GLeeEnabled(&_GLEE_SGIX_texture_select) -#define GLEE_INGR_blend_func_separate GLeeEnabled(&_GLEE_INGR_blend_func_separate) -#define GLEE_SGIX_depth_pass_instrument GLeeEnabled(&_GLEE_SGIX_depth_pass_instrument) -#define GLEE_SGIX_igloo_interface GLeeEnabled(&_GLEE_SGIX_igloo_interface) -#define GLEE_EXT_fragment_lighting GLeeEnabled(&_GLEE_EXT_fragment_lighting) -#define GLEE_EXT_scene_marker GLeeEnabled(&_GLEE_EXT_scene_marker) -#define GLEE_EXT_texture_compression_dxt1 GLeeEnabled(&_GLEE_EXT_texture_compression_dxt1) -#define GLEE_EXT_texture_env GLeeEnabled(&_GLEE_EXT_texture_env) -#define GLEE_IBM_static_data GLeeEnabled(&_GLEE_IBM_static_data) -#define GLEE_OES_byte_coordinates GLeeEnabled(&_GLEE_OES_byte_coordinates) -#define GLEE_OES_compressed_paletted_texture GLeeEnabled(&_GLEE_OES_compressed_paletted_texture) -#define GLEE_OES_single_precision GLeeEnabled(&_GLEE_OES_single_precision) -#define GLEE_SGIX_pixel_texture_bits GLeeEnabled(&_GLEE_SGIX_pixel_texture_bits) -#define GLEE_SGIX_texture_range GLeeEnabled(&_GLEE_SGIX_texture_range) - - -/***************************************************************** - * Additional types needed for extensions - *****************************************************************/ - -/* Used for GLSL shader text */ -#ifndef GL_VERSION_2_0 - typedef char GLchar; -#endif - -#include - -#ifndef GL_VERSION_1_5 - typedef ptrdiff_t GLintptr; - typedef ptrdiff_t GLsizeiptr; -#endif - -#ifndef GL_NV_half_float - typedef unsigned short GLhalfNV; -#endif - -#ifndef GL_ARB_vertex_buffer_object - typedef ptrdiff_t GLintptrARB; - typedef ptrdiff_t GLsizeiptrARB; -#endif - -#ifndef GL_ARB_shader_objects - typedef int GLhandleARB; - typedef char GLcharARB; -#endif - -#ifndef GL_EXT_timer_query - typedef signed long long GLint64EXT; - typedef unsigned long long GLuint64EXT; -#endif - -/* Platform-specific */ - -#ifdef WIN32 - - /* WGL */ - - #ifndef WGL_ARB_pbuffer - DECLARE_HANDLE(HPBUFFERARB); - #endif - - #ifndef WGL_EXT_pbuffer - DECLARE_HANDLE(HPBUFFEREXT); - #endif - - #ifndef WGL_NV_video_output - DECLARE_HANDLE(HPVIDEODEV); - #endif - -#elif defined(__APPLE__) || defined(__APPLE_CC__) - - /* Mac OS X */ - -#else - - /* GLX */ - - typedef void (*__GLXextFuncPtr)(void); - - #ifndef GLX_ARB_get_proc_address - #define GLX_ARB_get_proc_address 1 - extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); - extern void ( * glXGetProcAddressARB (const GLubyte *procName))(void); - typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); - #endif - - #ifndef GLX_SGIX_fbconfig - typedef XID GLXFBConfigIDSGIX; - typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; - #endif - - #ifndef GLX_SGIX_pbuffer - typedef XID GLXPbufferSGIX; - typedef struct { - int type; - unsigned long serial; - Bool send_event; - Display *display; - GLXDrawable drawable; - int event_type; - int draw_type; - unsigned int mask; - int x, y; - int width, height; - int count; - } GLXBufferClobberEventSGIX; - #endif - - #ifndef GLX_SGIX_hyperpipe - #define _GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 - typedef struct - { - char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int networkId; - } GLXHyperpipeNetworkSGIX; - - typedef struct - { - char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int channel; - unsigned int participationType; - int timeSlice; - } GLXHyperpipeConfigSGIX; - - typedef struct - { - char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int srcXOrigin; - int srcYOrigin; - int srcWidth; - int srcHeight; - int destXOrigin; - int destYOrigin; - int destWidth; - int destHeight; - } GLXPipeRect; - - typedef struct - { - char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int XOrigin; - int YOrigin; - int maxHeight; - int maxWidth; - } GLXPipeRectLimits; - #endif - - #ifndef GLX_NV_video_output - typedef unsigned int GLXVideoDeviceNV; - #endif // GLX_NV_video_output - -#endif /* end platform specific */ - - - -/* GL_VERSION_1_2 */ - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#define __GLEE_GL_VERSION_1_2 1 -/* Constants */ -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid * table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid * image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLEE_EXTERN PFNGLBLENDCOLORPROC pglBlendColor; -GLEE_EXTERN PFNGLBLENDEQUATIONPROC pglBlendEquation; -GLEE_EXTERN PFNGLDRAWRANGEELEMENTSPROC pglDrawRangeElements; -GLEE_EXTERN PFNGLCOLORTABLEPROC pglColorTable; -GLEE_EXTERN PFNGLCOLORTABLEPARAMETERFVPROC pglColorTableParameterfv; -GLEE_EXTERN PFNGLCOLORTABLEPARAMETERIVPROC pglColorTableParameteriv; -GLEE_EXTERN PFNGLCOPYCOLORTABLEPROC pglCopyColorTable; -GLEE_EXTERN PFNGLGETCOLORTABLEPROC pglGetColorTable; -GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERFVPROC pglGetColorTableParameterfv; -GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERIVPROC pglGetColorTableParameteriv; -GLEE_EXTERN PFNGLCOLORSUBTABLEPROC pglColorSubTable; -GLEE_EXTERN PFNGLCOPYCOLORSUBTABLEPROC pglCopyColorSubTable; -GLEE_EXTERN PFNGLCONVOLUTIONFILTER1DPROC pglConvolutionFilter1D; -GLEE_EXTERN PFNGLCONVOLUTIONFILTER2DPROC pglConvolutionFilter2D; -GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERFPROC pglConvolutionParameterf; -GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERFVPROC pglConvolutionParameterfv; -GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERIPROC pglConvolutionParameteri; -GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERIVPROC pglConvolutionParameteriv; -GLEE_EXTERN PFNGLCOPYCONVOLUTIONFILTER1DPROC pglCopyConvolutionFilter1D; -GLEE_EXTERN PFNGLCOPYCONVOLUTIONFILTER2DPROC pglCopyConvolutionFilter2D; -GLEE_EXTERN PFNGLGETCONVOLUTIONFILTERPROC pglGetConvolutionFilter; -GLEE_EXTERN PFNGLGETCONVOLUTIONPARAMETERFVPROC pglGetConvolutionParameterfv; -GLEE_EXTERN PFNGLGETCONVOLUTIONPARAMETERIVPROC pglGetConvolutionParameteriv; -GLEE_EXTERN PFNGLGETSEPARABLEFILTERPROC pglGetSeparableFilter; -GLEE_EXTERN PFNGLSEPARABLEFILTER2DPROC pglSeparableFilter2D; -GLEE_EXTERN PFNGLGETHISTOGRAMPROC pglGetHistogram; -GLEE_EXTERN PFNGLGETHISTOGRAMPARAMETERFVPROC pglGetHistogramParameterfv; -GLEE_EXTERN PFNGLGETHISTOGRAMPARAMETERIVPROC pglGetHistogramParameteriv; -GLEE_EXTERN PFNGLGETMINMAXPROC pglGetMinmax; -GLEE_EXTERN PFNGLGETMINMAXPARAMETERFVPROC pglGetMinmaxParameterfv; -GLEE_EXTERN PFNGLGETMINMAXPARAMETERIVPROC pglGetMinmaxParameteriv; -GLEE_EXTERN PFNGLHISTOGRAMPROC pglHistogram; -GLEE_EXTERN PFNGLMINMAXPROC pglMinmax; -GLEE_EXTERN PFNGLRESETHISTOGRAMPROC pglResetHistogram; -GLEE_EXTERN PFNGLRESETMINMAXPROC pglResetMinmax; -GLEE_EXTERN PFNGLTEXIMAGE3DPROC pglTexImage3D; -GLEE_EXTERN PFNGLTEXSUBIMAGE3DPROC pglTexSubImage3D; -GLEE_EXTERN PFNGLCOPYTEXSUBIMAGE3DPROC pglCopyTexSubImage3D; -#define glBlendColor pglBlendColor -#define glBlendEquation pglBlendEquation -#define glDrawRangeElements pglDrawRangeElements -#define glColorTable pglColorTable -#define glColorTableParameterfv pglColorTableParameterfv -#define glColorTableParameteriv pglColorTableParameteriv -#define glCopyColorTable pglCopyColorTable -#define glGetColorTable pglGetColorTable -#define glGetColorTableParameterfv pglGetColorTableParameterfv -#define glGetColorTableParameteriv pglGetColorTableParameteriv -#define glColorSubTable pglColorSubTable -#define glCopyColorSubTable pglCopyColorSubTable -#define glConvolutionFilter1D pglConvolutionFilter1D -#define glConvolutionFilter2D pglConvolutionFilter2D -#define glConvolutionParameterf pglConvolutionParameterf -#define glConvolutionParameterfv pglConvolutionParameterfv -#define glConvolutionParameteri pglConvolutionParameteri -#define glConvolutionParameteriv pglConvolutionParameteriv -#define glCopyConvolutionFilter1D pglCopyConvolutionFilter1D -#define glCopyConvolutionFilter2D pglCopyConvolutionFilter2D -#define glGetConvolutionFilter pglGetConvolutionFilter -#define glGetConvolutionParameterfv pglGetConvolutionParameterfv -#define glGetConvolutionParameteriv pglGetConvolutionParameteriv -#define glGetSeparableFilter pglGetSeparableFilter -#define glSeparableFilter2D pglSeparableFilter2D -#define glGetHistogram pglGetHistogram -#define glGetHistogramParameterfv pglGetHistogramParameterfv -#define glGetHistogramParameteriv pglGetHistogramParameteriv -#define glGetMinmax pglGetMinmax -#define glGetMinmaxParameterfv pglGetMinmaxParameterfv -#define glGetMinmaxParameteriv pglGetMinmaxParameteriv -#define glHistogram pglHistogram -#define glMinmax pglMinmax -#define glResetHistogram pglResetHistogram -#define glResetMinmax pglResetMinmax -#define glTexImage3D pglTexImage3D -#define glTexSubImage3D pglTexSubImage3D -#define glCopyTexSubImage3D pglCopyTexSubImage3D -#endif - -/* GL_ARB_imaging */ - -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 -#define __GLEE_GL_ARB_imaging 1 -/* Constants */ -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#endif - -/* GL_VERSION_1_3 */ - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#define __GLEE_GL_VERSION_1_3 1 -/* Constants */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort * v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat * m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble * m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat * m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble * m); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid * img); -GLEE_EXTERN PFNGLACTIVETEXTUREPROC pglActiveTexture; -GLEE_EXTERN PFNGLCLIENTACTIVETEXTUREPROC pglClientActiveTexture; -GLEE_EXTERN PFNGLMULTITEXCOORD1DPROC pglMultiTexCoord1d; -GLEE_EXTERN PFNGLMULTITEXCOORD1DVPROC pglMultiTexCoord1dv; -GLEE_EXTERN PFNGLMULTITEXCOORD1FPROC pglMultiTexCoord1f; -GLEE_EXTERN PFNGLMULTITEXCOORD1FVPROC pglMultiTexCoord1fv; -GLEE_EXTERN PFNGLMULTITEXCOORD1IPROC pglMultiTexCoord1i; -GLEE_EXTERN PFNGLMULTITEXCOORD1IVPROC pglMultiTexCoord1iv; -GLEE_EXTERN PFNGLMULTITEXCOORD1SPROC pglMultiTexCoord1s; -GLEE_EXTERN PFNGLMULTITEXCOORD1SVPROC pglMultiTexCoord1sv; -GLEE_EXTERN PFNGLMULTITEXCOORD2DPROC pglMultiTexCoord2d; -GLEE_EXTERN PFNGLMULTITEXCOORD2DVPROC pglMultiTexCoord2dv; -GLEE_EXTERN PFNGLMULTITEXCOORD2FPROC pglMultiTexCoord2f; -GLEE_EXTERN PFNGLMULTITEXCOORD2FVPROC pglMultiTexCoord2fv; -GLEE_EXTERN PFNGLMULTITEXCOORD2IPROC pglMultiTexCoord2i; -GLEE_EXTERN PFNGLMULTITEXCOORD2IVPROC pglMultiTexCoord2iv; -GLEE_EXTERN PFNGLMULTITEXCOORD2SPROC pglMultiTexCoord2s; -GLEE_EXTERN PFNGLMULTITEXCOORD2SVPROC pglMultiTexCoord2sv; -GLEE_EXTERN PFNGLMULTITEXCOORD3DPROC pglMultiTexCoord3d; -GLEE_EXTERN PFNGLMULTITEXCOORD3DVPROC pglMultiTexCoord3dv; -GLEE_EXTERN PFNGLMULTITEXCOORD3FPROC pglMultiTexCoord3f; -GLEE_EXTERN PFNGLMULTITEXCOORD3FVPROC pglMultiTexCoord3fv; -GLEE_EXTERN PFNGLMULTITEXCOORD3IPROC pglMultiTexCoord3i; -GLEE_EXTERN PFNGLMULTITEXCOORD3IVPROC pglMultiTexCoord3iv; -GLEE_EXTERN PFNGLMULTITEXCOORD3SPROC pglMultiTexCoord3s; -GLEE_EXTERN PFNGLMULTITEXCOORD3SVPROC pglMultiTexCoord3sv; -GLEE_EXTERN PFNGLMULTITEXCOORD4DPROC pglMultiTexCoord4d; -GLEE_EXTERN PFNGLMULTITEXCOORD4DVPROC pglMultiTexCoord4dv; -GLEE_EXTERN PFNGLMULTITEXCOORD4FPROC pglMultiTexCoord4f; -GLEE_EXTERN PFNGLMULTITEXCOORD4FVPROC pglMultiTexCoord4fv; -GLEE_EXTERN PFNGLMULTITEXCOORD4IPROC pglMultiTexCoord4i; -GLEE_EXTERN PFNGLMULTITEXCOORD4IVPROC pglMultiTexCoord4iv; -GLEE_EXTERN PFNGLMULTITEXCOORD4SPROC pglMultiTexCoord4s; -GLEE_EXTERN PFNGLMULTITEXCOORD4SVPROC pglMultiTexCoord4sv; -GLEE_EXTERN PFNGLLOADTRANSPOSEMATRIXFPROC pglLoadTransposeMatrixf; -GLEE_EXTERN PFNGLLOADTRANSPOSEMATRIXDPROC pglLoadTransposeMatrixd; -GLEE_EXTERN PFNGLMULTTRANSPOSEMATRIXFPROC pglMultTransposeMatrixf; -GLEE_EXTERN PFNGLMULTTRANSPOSEMATRIXDPROC pglMultTransposeMatrixd; -GLEE_EXTERN PFNGLSAMPLECOVERAGEPROC pglSampleCoverage; -GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE3DPROC pglCompressedTexImage3D; -GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE2DPROC pglCompressedTexImage2D; -GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE1DPROC pglCompressedTexImage1D; -GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC pglCompressedTexSubImage3D; -GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC pglCompressedTexSubImage2D; -GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC pglCompressedTexSubImage1D; -GLEE_EXTERN PFNGLGETCOMPRESSEDTEXIMAGEPROC pglGetCompressedTexImage; -#define glActiveTexture pglActiveTexture -#define glClientActiveTexture pglClientActiveTexture -#define glMultiTexCoord1d pglMultiTexCoord1d -#define glMultiTexCoord1dv pglMultiTexCoord1dv -#define glMultiTexCoord1f pglMultiTexCoord1f -#define glMultiTexCoord1fv pglMultiTexCoord1fv -#define glMultiTexCoord1i pglMultiTexCoord1i -#define glMultiTexCoord1iv pglMultiTexCoord1iv -#define glMultiTexCoord1s pglMultiTexCoord1s -#define glMultiTexCoord1sv pglMultiTexCoord1sv -#define glMultiTexCoord2d pglMultiTexCoord2d -#define glMultiTexCoord2dv pglMultiTexCoord2dv -#define glMultiTexCoord2f pglMultiTexCoord2f -#define glMultiTexCoord2fv pglMultiTexCoord2fv -#define glMultiTexCoord2i pglMultiTexCoord2i -#define glMultiTexCoord2iv pglMultiTexCoord2iv -#define glMultiTexCoord2s pglMultiTexCoord2s -#define glMultiTexCoord2sv pglMultiTexCoord2sv -#define glMultiTexCoord3d pglMultiTexCoord3d -#define glMultiTexCoord3dv pglMultiTexCoord3dv -#define glMultiTexCoord3f pglMultiTexCoord3f -#define glMultiTexCoord3fv pglMultiTexCoord3fv -#define glMultiTexCoord3i pglMultiTexCoord3i -#define glMultiTexCoord3iv pglMultiTexCoord3iv -#define glMultiTexCoord3s pglMultiTexCoord3s -#define glMultiTexCoord3sv pglMultiTexCoord3sv -#define glMultiTexCoord4d pglMultiTexCoord4d -#define glMultiTexCoord4dv pglMultiTexCoord4dv -#define glMultiTexCoord4f pglMultiTexCoord4f -#define glMultiTexCoord4fv pglMultiTexCoord4fv -#define glMultiTexCoord4i pglMultiTexCoord4i -#define glMultiTexCoord4iv pglMultiTexCoord4iv -#define glMultiTexCoord4s pglMultiTexCoord4s -#define glMultiTexCoord4sv pglMultiTexCoord4sv -#define glLoadTransposeMatrixf pglLoadTransposeMatrixf -#define glLoadTransposeMatrixd pglLoadTransposeMatrixd -#define glMultTransposeMatrixf pglMultTransposeMatrixf -#define glMultTransposeMatrixd pglMultTransposeMatrixd -#define glSampleCoverage pglSampleCoverage -#define glCompressedTexImage3D pglCompressedTexImage3D -#define glCompressedTexImage2D pglCompressedTexImage2D -#define glCompressedTexImage1D pglCompressedTexImage1D -#define glCompressedTexSubImage3D pglCompressedTexSubImage3D -#define glCompressedTexSubImage2D pglCompressedTexSubImage2D -#define glCompressedTexSubImage1D pglCompressedTexSubImage1D -#define glGetCompressedTexImage pglGetCompressedTexImage -#endif - -/* GL_VERSION_1_4 */ - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#define __GLEE_GL_VERSION_1_4 1 -/* Constants */ -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat * coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble * coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei * count, GLenum type, const GLvoid* * indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort * v); -GLEE_EXTERN PFNGLBLENDFUNCSEPARATEPROC pglBlendFuncSeparate; -GLEE_EXTERN PFNGLFOGCOORDFPROC pglFogCoordf; -GLEE_EXTERN PFNGLFOGCOORDFVPROC pglFogCoordfv; -GLEE_EXTERN PFNGLFOGCOORDDPROC pglFogCoordd; -GLEE_EXTERN PFNGLFOGCOORDDVPROC pglFogCoorddv; -GLEE_EXTERN PFNGLFOGCOORDPOINTERPROC pglFogCoordPointer; -GLEE_EXTERN PFNGLMULTIDRAWARRAYSPROC pglMultiDrawArrays; -GLEE_EXTERN PFNGLMULTIDRAWELEMENTSPROC pglMultiDrawElements; -GLEE_EXTERN PFNGLPOINTPARAMETERFPROC pglPointParameterf; -GLEE_EXTERN PFNGLPOINTPARAMETERFVPROC pglPointParameterfv; -GLEE_EXTERN PFNGLPOINTPARAMETERIPROC pglPointParameteri; -GLEE_EXTERN PFNGLPOINTPARAMETERIVPROC pglPointParameteriv; -GLEE_EXTERN PFNGLSECONDARYCOLOR3BPROC pglSecondaryColor3b; -GLEE_EXTERN PFNGLSECONDARYCOLOR3BVPROC pglSecondaryColor3bv; -GLEE_EXTERN PFNGLSECONDARYCOLOR3DPROC pglSecondaryColor3d; -GLEE_EXTERN PFNGLSECONDARYCOLOR3DVPROC pglSecondaryColor3dv; -GLEE_EXTERN PFNGLSECONDARYCOLOR3FPROC pglSecondaryColor3f; -GLEE_EXTERN PFNGLSECONDARYCOLOR3FVPROC pglSecondaryColor3fv; -GLEE_EXTERN PFNGLSECONDARYCOLOR3IPROC pglSecondaryColor3i; -GLEE_EXTERN PFNGLSECONDARYCOLOR3IVPROC pglSecondaryColor3iv; -GLEE_EXTERN PFNGLSECONDARYCOLOR3SPROC pglSecondaryColor3s; -GLEE_EXTERN PFNGLSECONDARYCOLOR3SVPROC pglSecondaryColor3sv; -GLEE_EXTERN PFNGLSECONDARYCOLOR3UBPROC pglSecondaryColor3ub; -GLEE_EXTERN PFNGLSECONDARYCOLOR3UBVPROC pglSecondaryColor3ubv; -GLEE_EXTERN PFNGLSECONDARYCOLOR3UIPROC pglSecondaryColor3ui; -GLEE_EXTERN PFNGLSECONDARYCOLOR3UIVPROC pglSecondaryColor3uiv; -GLEE_EXTERN PFNGLSECONDARYCOLOR3USPROC pglSecondaryColor3us; -GLEE_EXTERN PFNGLSECONDARYCOLOR3USVPROC pglSecondaryColor3usv; -GLEE_EXTERN PFNGLSECONDARYCOLORPOINTERPROC pglSecondaryColorPointer; -GLEE_EXTERN PFNGLWINDOWPOS2DPROC pglWindowPos2d; -GLEE_EXTERN PFNGLWINDOWPOS2DVPROC pglWindowPos2dv; -GLEE_EXTERN PFNGLWINDOWPOS2FPROC pglWindowPos2f; -GLEE_EXTERN PFNGLWINDOWPOS2FVPROC pglWindowPos2fv; -GLEE_EXTERN PFNGLWINDOWPOS2IPROC pglWindowPos2i; -GLEE_EXTERN PFNGLWINDOWPOS2IVPROC pglWindowPos2iv; -GLEE_EXTERN PFNGLWINDOWPOS2SPROC pglWindowPos2s; -GLEE_EXTERN PFNGLWINDOWPOS2SVPROC pglWindowPos2sv; -GLEE_EXTERN PFNGLWINDOWPOS3DPROC pglWindowPos3d; -GLEE_EXTERN PFNGLWINDOWPOS3DVPROC pglWindowPos3dv; -GLEE_EXTERN PFNGLWINDOWPOS3FPROC pglWindowPos3f; -GLEE_EXTERN PFNGLWINDOWPOS3FVPROC pglWindowPos3fv; -GLEE_EXTERN PFNGLWINDOWPOS3IPROC pglWindowPos3i; -GLEE_EXTERN PFNGLWINDOWPOS3IVPROC pglWindowPos3iv; -GLEE_EXTERN PFNGLWINDOWPOS3SPROC pglWindowPos3s; -GLEE_EXTERN PFNGLWINDOWPOS3SVPROC pglWindowPos3sv; -#define glBlendFuncSeparate pglBlendFuncSeparate -#define glFogCoordf pglFogCoordf -#define glFogCoordfv pglFogCoordfv -#define glFogCoordd pglFogCoordd -#define glFogCoorddv pglFogCoorddv -#define glFogCoordPointer pglFogCoordPointer -#define glMultiDrawArrays pglMultiDrawArrays -#define glMultiDrawElements pglMultiDrawElements -#define glPointParameterf pglPointParameterf -#define glPointParameterfv pglPointParameterfv -#define glPointParameteri pglPointParameteri -#define glPointParameteriv pglPointParameteriv -#define glSecondaryColor3b pglSecondaryColor3b -#define glSecondaryColor3bv pglSecondaryColor3bv -#define glSecondaryColor3d pglSecondaryColor3d -#define glSecondaryColor3dv pglSecondaryColor3dv -#define glSecondaryColor3f pglSecondaryColor3f -#define glSecondaryColor3fv pglSecondaryColor3fv -#define glSecondaryColor3i pglSecondaryColor3i -#define glSecondaryColor3iv pglSecondaryColor3iv -#define glSecondaryColor3s pglSecondaryColor3s -#define glSecondaryColor3sv pglSecondaryColor3sv -#define glSecondaryColor3ub pglSecondaryColor3ub -#define glSecondaryColor3ubv pglSecondaryColor3ubv -#define glSecondaryColor3ui pglSecondaryColor3ui -#define glSecondaryColor3uiv pglSecondaryColor3uiv -#define glSecondaryColor3us pglSecondaryColor3us -#define glSecondaryColor3usv pglSecondaryColor3usv -#define glSecondaryColorPointer pglSecondaryColorPointer -#define glWindowPos2d pglWindowPos2d -#define glWindowPos2dv pglWindowPos2dv -#define glWindowPos2f pglWindowPos2f -#define glWindowPos2fv pglWindowPos2fv -#define glWindowPos2i pglWindowPos2i -#define glWindowPos2iv pglWindowPos2iv -#define glWindowPos2s pglWindowPos2s -#define glWindowPos2sv pglWindowPos2sv -#define glWindowPos3d pglWindowPos3d -#define glWindowPos3dv pglWindowPos3dv -#define glWindowPos3f pglWindowPos3f -#define glWindowPos3fv pglWindowPos3fv -#define glWindowPos3i pglWindowPos3i -#define glWindowPos3iv pglWindowPos3iv -#define glWindowPos3s pglWindowPos3s -#define glWindowPos3sv pglWindowPos3sv -#endif - -/* GL_VERSION_1_5 */ - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#define __GLEE_GL_VERSION_1_5 1 -/* Constants */ -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint * ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint * ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint * params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint * buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint * buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* * params); -GLEE_EXTERN PFNGLGENQUERIESPROC pglGenQueries; -GLEE_EXTERN PFNGLDELETEQUERIESPROC pglDeleteQueries; -GLEE_EXTERN PFNGLISQUERYPROC pglIsQuery; -GLEE_EXTERN PFNGLBEGINQUERYPROC pglBeginQuery; -GLEE_EXTERN PFNGLENDQUERYPROC pglEndQuery; -GLEE_EXTERN PFNGLGETQUERYIVPROC pglGetQueryiv; -GLEE_EXTERN PFNGLGETQUERYOBJECTIVPROC pglGetQueryObjectiv; -GLEE_EXTERN PFNGLGETQUERYOBJECTUIVPROC pglGetQueryObjectuiv; -GLEE_EXTERN PFNGLBINDBUFFERPROC pglBindBuffer; -GLEE_EXTERN PFNGLDELETEBUFFERSPROC pglDeleteBuffers; -GLEE_EXTERN PFNGLGENBUFFERSPROC pglGenBuffers; -GLEE_EXTERN PFNGLISBUFFERPROC pglIsBuffer; -GLEE_EXTERN PFNGLBUFFERDATAPROC pglBufferData; -GLEE_EXTERN PFNGLBUFFERSUBDATAPROC pglBufferSubData; -GLEE_EXTERN PFNGLGETBUFFERSUBDATAPROC pglGetBufferSubData; -GLEE_EXTERN PFNGLMAPBUFFERPROC pglMapBuffer; -GLEE_EXTERN PFNGLUNMAPBUFFERPROC pglUnmapBuffer; -GLEE_EXTERN PFNGLGETBUFFERPARAMETERIVPROC pglGetBufferParameteriv; -GLEE_EXTERN PFNGLGETBUFFERPOINTERVPROC pglGetBufferPointerv; -#define glGenQueries pglGenQueries -#define glDeleteQueries pglDeleteQueries -#define glIsQuery pglIsQuery -#define glBeginQuery pglBeginQuery -#define glEndQuery pglEndQuery -#define glGetQueryiv pglGetQueryiv -#define glGetQueryObjectiv pglGetQueryObjectiv -#define glGetQueryObjectuiv pglGetQueryObjectuiv -#define glBindBuffer pglBindBuffer -#define glDeleteBuffers pglDeleteBuffers -#define glGenBuffers pglGenBuffers -#define glIsBuffer pglIsBuffer -#define glBufferData pglBufferData -#define glBufferSubData pglBufferSubData -#define glGetBufferSubData pglGetBufferSubData -#define glMapBuffer pglMapBuffer -#define glUnmapBuffer pglUnmapBuffer -#define glGetBufferParameteriv pglGetBufferParameteriv -#define glGetBufferPointerv pglGetBufferPointerv -#endif - -/* GL_VERSION_2_0 */ - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -#define __GLEE_GL_VERSION_2_0 1 -/* Constants */ -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum * bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar * name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat * params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* * pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* * string, const GLint * length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); -GLEE_EXTERN PFNGLBLENDEQUATIONSEPARATEPROC pglBlendEquationSeparate; -GLEE_EXTERN PFNGLDRAWBUFFERSPROC pglDrawBuffers; -GLEE_EXTERN PFNGLSTENCILOPSEPARATEPROC pglStencilOpSeparate; -GLEE_EXTERN PFNGLSTENCILFUNCSEPARATEPROC pglStencilFuncSeparate; -GLEE_EXTERN PFNGLSTENCILMASKSEPARATEPROC pglStencilMaskSeparate; -GLEE_EXTERN PFNGLATTACHSHADERPROC pglAttachShader; -GLEE_EXTERN PFNGLBINDATTRIBLOCATIONPROC pglBindAttribLocation; -GLEE_EXTERN PFNGLCOMPILESHADERPROC pglCompileShader; -GLEE_EXTERN PFNGLCREATEPROGRAMPROC pglCreateProgram; -GLEE_EXTERN PFNGLCREATESHADERPROC pglCreateShader; -GLEE_EXTERN PFNGLDELETEPROGRAMPROC pglDeleteProgram; -GLEE_EXTERN PFNGLDELETESHADERPROC pglDeleteShader; -GLEE_EXTERN PFNGLDETACHSHADERPROC pglDetachShader; -GLEE_EXTERN PFNGLDISABLEVERTEXATTRIBARRAYPROC pglDisableVertexAttribArray; -GLEE_EXTERN PFNGLENABLEVERTEXATTRIBARRAYPROC pglEnableVertexAttribArray; -GLEE_EXTERN PFNGLGETACTIVEATTRIBPROC pglGetActiveAttrib; -GLEE_EXTERN PFNGLGETACTIVEUNIFORMPROC pglGetActiveUniform; -GLEE_EXTERN PFNGLGETATTACHEDSHADERSPROC pglGetAttachedShaders; -GLEE_EXTERN PFNGLGETATTRIBLOCATIONPROC pglGetAttribLocation; -GLEE_EXTERN PFNGLGETPROGRAMIVPROC pglGetProgramiv; -GLEE_EXTERN PFNGLGETPROGRAMINFOLOGPROC pglGetProgramInfoLog; -GLEE_EXTERN PFNGLGETSHADERIVPROC pglGetShaderiv; -GLEE_EXTERN PFNGLGETSHADERINFOLOGPROC pglGetShaderInfoLog; -GLEE_EXTERN PFNGLGETSHADERSOURCEPROC pglGetShaderSource; -GLEE_EXTERN PFNGLGETUNIFORMLOCATIONPROC pglGetUniformLocation; -GLEE_EXTERN PFNGLGETUNIFORMFVPROC pglGetUniformfv; -GLEE_EXTERN PFNGLGETUNIFORMIVPROC pglGetUniformiv; -GLEE_EXTERN PFNGLGETVERTEXATTRIBDVPROC pglGetVertexAttribdv; -GLEE_EXTERN PFNGLGETVERTEXATTRIBFVPROC pglGetVertexAttribfv; -GLEE_EXTERN PFNGLGETVERTEXATTRIBIVPROC pglGetVertexAttribiv; -GLEE_EXTERN PFNGLGETVERTEXATTRIBPOINTERVPROC pglGetVertexAttribPointerv; -GLEE_EXTERN PFNGLISPROGRAMPROC pglIsProgram; -GLEE_EXTERN PFNGLISSHADERPROC pglIsShader; -GLEE_EXTERN PFNGLLINKPROGRAMPROC pglLinkProgram; -GLEE_EXTERN PFNGLSHADERSOURCEPROC pglShaderSource; -GLEE_EXTERN PFNGLUSEPROGRAMPROC pglUseProgram; -GLEE_EXTERN PFNGLUNIFORM1FPROC pglUniform1f; -GLEE_EXTERN PFNGLUNIFORM2FPROC pglUniform2f; -GLEE_EXTERN PFNGLUNIFORM3FPROC pglUniform3f; -GLEE_EXTERN PFNGLUNIFORM4FPROC pglUniform4f; -GLEE_EXTERN PFNGLUNIFORM1IPROC pglUniform1i; -GLEE_EXTERN PFNGLUNIFORM2IPROC pglUniform2i; -GLEE_EXTERN PFNGLUNIFORM3IPROC pglUniform3i; -GLEE_EXTERN PFNGLUNIFORM4IPROC pglUniform4i; -GLEE_EXTERN PFNGLUNIFORM1FVPROC pglUniform1fv; -GLEE_EXTERN PFNGLUNIFORM2FVPROC pglUniform2fv; -GLEE_EXTERN PFNGLUNIFORM3FVPROC pglUniform3fv; -GLEE_EXTERN PFNGLUNIFORM4FVPROC pglUniform4fv; -GLEE_EXTERN PFNGLUNIFORM1IVPROC pglUniform1iv; -GLEE_EXTERN PFNGLUNIFORM2IVPROC pglUniform2iv; -GLEE_EXTERN PFNGLUNIFORM3IVPROC pglUniform3iv; -GLEE_EXTERN PFNGLUNIFORM4IVPROC pglUniform4iv; -GLEE_EXTERN PFNGLUNIFORMMATRIX2FVPROC pglUniformMatrix2fv; -GLEE_EXTERN PFNGLUNIFORMMATRIX3FVPROC pglUniformMatrix3fv; -GLEE_EXTERN PFNGLUNIFORMMATRIX4FVPROC pglUniformMatrix4fv; -GLEE_EXTERN PFNGLVALIDATEPROGRAMPROC pglValidateProgram; -GLEE_EXTERN PFNGLVERTEXATTRIB1DPROC pglVertexAttrib1d; -GLEE_EXTERN PFNGLVERTEXATTRIB1DVPROC pglVertexAttrib1dv; -GLEE_EXTERN PFNGLVERTEXATTRIB1FPROC pglVertexAttrib1f; -GLEE_EXTERN PFNGLVERTEXATTRIB1FVPROC pglVertexAttrib1fv; -GLEE_EXTERN PFNGLVERTEXATTRIB1SPROC pglVertexAttrib1s; -GLEE_EXTERN PFNGLVERTEXATTRIB1SVPROC pglVertexAttrib1sv; -GLEE_EXTERN PFNGLVERTEXATTRIB2DPROC pglVertexAttrib2d; -GLEE_EXTERN PFNGLVERTEXATTRIB2DVPROC pglVertexAttrib2dv; -GLEE_EXTERN PFNGLVERTEXATTRIB2FPROC pglVertexAttrib2f; -GLEE_EXTERN PFNGLVERTEXATTRIB2FVPROC pglVertexAttrib2fv; -GLEE_EXTERN PFNGLVERTEXATTRIB2SPROC pglVertexAttrib2s; -GLEE_EXTERN PFNGLVERTEXATTRIB2SVPROC pglVertexAttrib2sv; -GLEE_EXTERN PFNGLVERTEXATTRIB3DPROC pglVertexAttrib3d; -GLEE_EXTERN PFNGLVERTEXATTRIB3DVPROC pglVertexAttrib3dv; -GLEE_EXTERN PFNGLVERTEXATTRIB3FPROC pglVertexAttrib3f; -GLEE_EXTERN PFNGLVERTEXATTRIB3FVPROC pglVertexAttrib3fv; -GLEE_EXTERN PFNGLVERTEXATTRIB3SPROC pglVertexAttrib3s; -GLEE_EXTERN PFNGLVERTEXATTRIB3SVPROC pglVertexAttrib3sv; -GLEE_EXTERN PFNGLVERTEXATTRIB4NBVPROC pglVertexAttrib4Nbv; -GLEE_EXTERN PFNGLVERTEXATTRIB4NIVPROC pglVertexAttrib4Niv; -GLEE_EXTERN PFNGLVERTEXATTRIB4NSVPROC pglVertexAttrib4Nsv; -GLEE_EXTERN PFNGLVERTEXATTRIB4NUBPROC pglVertexAttrib4Nub; -GLEE_EXTERN PFNGLVERTEXATTRIB4NUBVPROC pglVertexAttrib4Nubv; -GLEE_EXTERN PFNGLVERTEXATTRIB4NUIVPROC pglVertexAttrib4Nuiv; -GLEE_EXTERN PFNGLVERTEXATTRIB4NUSVPROC pglVertexAttrib4Nusv; -GLEE_EXTERN PFNGLVERTEXATTRIB4BVPROC pglVertexAttrib4bv; -GLEE_EXTERN PFNGLVERTEXATTRIB4DPROC pglVertexAttrib4d; -GLEE_EXTERN PFNGLVERTEXATTRIB4DVPROC pglVertexAttrib4dv; -GLEE_EXTERN PFNGLVERTEXATTRIB4FPROC pglVertexAttrib4f; -GLEE_EXTERN PFNGLVERTEXATTRIB4FVPROC pglVertexAttrib4fv; -GLEE_EXTERN PFNGLVERTEXATTRIB4IVPROC pglVertexAttrib4iv; -GLEE_EXTERN PFNGLVERTEXATTRIB4SPROC pglVertexAttrib4s; -GLEE_EXTERN PFNGLVERTEXATTRIB4SVPROC pglVertexAttrib4sv; -GLEE_EXTERN PFNGLVERTEXATTRIB4UBVPROC pglVertexAttrib4ubv; -GLEE_EXTERN PFNGLVERTEXATTRIB4UIVPROC pglVertexAttrib4uiv; -GLEE_EXTERN PFNGLVERTEXATTRIB4USVPROC pglVertexAttrib4usv; -GLEE_EXTERN PFNGLVERTEXATTRIBPOINTERPROC pglVertexAttribPointer; -#define glBlendEquationSeparate pglBlendEquationSeparate -#define glDrawBuffers pglDrawBuffers -#define glStencilOpSeparate pglStencilOpSeparate -#define glStencilFuncSeparate pglStencilFuncSeparate -#define glStencilMaskSeparate pglStencilMaskSeparate -#define glAttachShader pglAttachShader -#define glBindAttribLocation pglBindAttribLocation -#define glCompileShader pglCompileShader -#define glCreateProgram pglCreateProgram -#define glCreateShader pglCreateShader -#define glDeleteProgram pglDeleteProgram -#define glDeleteShader pglDeleteShader -#define glDetachShader pglDetachShader -#define glDisableVertexAttribArray pglDisableVertexAttribArray -#define glEnableVertexAttribArray pglEnableVertexAttribArray -#define glGetActiveAttrib pglGetActiveAttrib -#define glGetActiveUniform pglGetActiveUniform -#define glGetAttachedShaders pglGetAttachedShaders -#define glGetAttribLocation pglGetAttribLocation -#define glGetProgramiv pglGetProgramiv -#define glGetProgramInfoLog pglGetProgramInfoLog -#define glGetShaderiv pglGetShaderiv -#define glGetShaderInfoLog pglGetShaderInfoLog -#define glGetShaderSource pglGetShaderSource -#define glGetUniformLocation pglGetUniformLocation -#define glGetUniformfv pglGetUniformfv -#define glGetUniformiv pglGetUniformiv -#define glGetVertexAttribdv pglGetVertexAttribdv -#define glGetVertexAttribfv pglGetVertexAttribfv -#define glGetVertexAttribiv pglGetVertexAttribiv -#define glGetVertexAttribPointerv pglGetVertexAttribPointerv -#define glIsProgram pglIsProgram -#define glIsShader pglIsShader -#define glLinkProgram pglLinkProgram -#define glShaderSource pglShaderSource -#define glUseProgram pglUseProgram -#define glUniform1f pglUniform1f -#define glUniform2f pglUniform2f -#define glUniform3f pglUniform3f -#define glUniform4f pglUniform4f -#define glUniform1i pglUniform1i -#define glUniform2i pglUniform2i -#define glUniform3i pglUniform3i -#define glUniform4i pglUniform4i -#define glUniform1fv pglUniform1fv -#define glUniform2fv pglUniform2fv -#define glUniform3fv pglUniform3fv -#define glUniform4fv pglUniform4fv -#define glUniform1iv pglUniform1iv -#define glUniform2iv pglUniform2iv -#define glUniform3iv pglUniform3iv -#define glUniform4iv pglUniform4iv -#define glUniformMatrix2fv pglUniformMatrix2fv -#define glUniformMatrix3fv pglUniformMatrix3fv -#define glUniformMatrix4fv pglUniformMatrix4fv -#define glValidateProgram pglValidateProgram -#define glVertexAttrib1d pglVertexAttrib1d -#define glVertexAttrib1dv pglVertexAttrib1dv -#define glVertexAttrib1f pglVertexAttrib1f -#define glVertexAttrib1fv pglVertexAttrib1fv -#define glVertexAttrib1s pglVertexAttrib1s -#define glVertexAttrib1sv pglVertexAttrib1sv -#define glVertexAttrib2d pglVertexAttrib2d -#define glVertexAttrib2dv pglVertexAttrib2dv -#define glVertexAttrib2f pglVertexAttrib2f -#define glVertexAttrib2fv pglVertexAttrib2fv -#define glVertexAttrib2s pglVertexAttrib2s -#define glVertexAttrib2sv pglVertexAttrib2sv -#define glVertexAttrib3d pglVertexAttrib3d -#define glVertexAttrib3dv pglVertexAttrib3dv -#define glVertexAttrib3f pglVertexAttrib3f -#define glVertexAttrib3fv pglVertexAttrib3fv -#define glVertexAttrib3s pglVertexAttrib3s -#define glVertexAttrib3sv pglVertexAttrib3sv -#define glVertexAttrib4Nbv pglVertexAttrib4Nbv -#define glVertexAttrib4Niv pglVertexAttrib4Niv -#define glVertexAttrib4Nsv pglVertexAttrib4Nsv -#define glVertexAttrib4Nub pglVertexAttrib4Nub -#define glVertexAttrib4Nubv pglVertexAttrib4Nubv -#define glVertexAttrib4Nuiv pglVertexAttrib4Nuiv -#define glVertexAttrib4Nusv pglVertexAttrib4Nusv -#define glVertexAttrib4bv pglVertexAttrib4bv -#define glVertexAttrib4d pglVertexAttrib4d -#define glVertexAttrib4dv pglVertexAttrib4dv -#define glVertexAttrib4f pglVertexAttrib4f -#define glVertexAttrib4fv pglVertexAttrib4fv -#define glVertexAttrib4iv pglVertexAttrib4iv -#define glVertexAttrib4s pglVertexAttrib4s -#define glVertexAttrib4sv pglVertexAttrib4sv -#define glVertexAttrib4ubv pglVertexAttrib4ubv -#define glVertexAttrib4uiv pglVertexAttrib4uiv -#define glVertexAttrib4usv pglVertexAttrib4usv -#define glVertexAttribPointer pglVertexAttribPointer -#endif - -/* GL_VERSION_2_1 */ - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -#define __GLEE_GL_VERSION_2_1 1 -/* Constants */ -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -GLEE_EXTERN PFNGLUNIFORMMATRIX2X3FVPROC pglUniformMatrix2x3fv; -GLEE_EXTERN PFNGLUNIFORMMATRIX3X2FVPROC pglUniformMatrix3x2fv; -GLEE_EXTERN PFNGLUNIFORMMATRIX2X4FVPROC pglUniformMatrix2x4fv; -GLEE_EXTERN PFNGLUNIFORMMATRIX4X2FVPROC pglUniformMatrix4x2fv; -GLEE_EXTERN PFNGLUNIFORMMATRIX3X4FVPROC pglUniformMatrix3x4fv; -GLEE_EXTERN PFNGLUNIFORMMATRIX4X3FVPROC pglUniformMatrix4x3fv; -#define glUniformMatrix2x3fv pglUniformMatrix2x3fv -#define glUniformMatrix3x2fv pglUniformMatrix3x2fv -#define glUniformMatrix2x4fv pglUniformMatrix2x4fv -#define glUniformMatrix4x2fv pglUniformMatrix4x2fv -#define glUniformMatrix3x4fv pglUniformMatrix3x4fv -#define glUniformMatrix4x3fv pglUniformMatrix4x3fv -#endif - -/* GL_VERSION_3_0 */ - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -#define __GLEE_GL_VERSION_3_0 1 -/* Constants */ -#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB -#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 -#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 -#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 -#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 -#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 -#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 -#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_DEPTH_BUFFER 0x8223 -#define GL_STENCIL_BUFFER 0x8224 -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_ALPHA_INTEGER 0x8D97 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean * data); -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint * data); -typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLint * location); -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint * params); -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint * params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar * name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint * params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint * params); -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, const GLint * value); -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, const GLuint * value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, const GLfloat * value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLfloat depth, GLint stencil); -typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -GLEE_EXTERN PFNGLCOLORMASKIPROC pglColorMaski; -GLEE_EXTERN PFNGLGETBOOLEANI_VPROC pglGetBooleani_v; -GLEE_EXTERN PFNGLGETINTEGERI_VPROC pglGetIntegeri_v; -GLEE_EXTERN PFNGLENABLEIPROC pglEnablei; -GLEE_EXTERN PFNGLDISABLEIPROC pglDisablei; -GLEE_EXTERN PFNGLISENABLEDIPROC pglIsEnabledi; -GLEE_EXTERN PFNGLBEGINTRANSFORMFEEDBACKPROC pglBeginTransformFeedback; -GLEE_EXTERN PFNGLENDTRANSFORMFEEDBACKPROC pglEndTransformFeedback; -GLEE_EXTERN PFNGLBINDBUFFERRANGEPROC pglBindBufferRange; -GLEE_EXTERN PFNGLBINDBUFFERBASEPROC pglBindBufferBase; -GLEE_EXTERN PFNGLTRANSFORMFEEDBACKVARYINGSPROC pglTransformFeedbackVaryings; -GLEE_EXTERN PFNGLGETTRANSFORMFEEDBACKVARYINGPROC pglGetTransformFeedbackVarying; -GLEE_EXTERN PFNGLCLAMPCOLORPROC pglClampColor; -GLEE_EXTERN PFNGLBEGINCONDITIONALRENDERPROC pglBeginConditionalRender; -GLEE_EXTERN PFNGLENDCONDITIONALRENDERPROC pglEndConditionalRender; -GLEE_EXTERN PFNGLVERTEXATTRIBI1IPROC pglVertexAttribI1i; -GLEE_EXTERN PFNGLVERTEXATTRIBI2IPROC pglVertexAttribI2i; -GLEE_EXTERN PFNGLVERTEXATTRIBI3IPROC pglVertexAttribI3i; -GLEE_EXTERN PFNGLVERTEXATTRIBI4IPROC pglVertexAttribI4i; -GLEE_EXTERN PFNGLVERTEXATTRIBI1UIPROC pglVertexAttribI1ui; -GLEE_EXTERN PFNGLVERTEXATTRIBI2UIPROC pglVertexAttribI2ui; -GLEE_EXTERN PFNGLVERTEXATTRIBI3UIPROC pglVertexAttribI3ui; -GLEE_EXTERN PFNGLVERTEXATTRIBI4UIPROC pglVertexAttribI4ui; -GLEE_EXTERN PFNGLVERTEXATTRIBI1IVPROC pglVertexAttribI1iv; -GLEE_EXTERN PFNGLVERTEXATTRIBI2IVPROC pglVertexAttribI2iv; -GLEE_EXTERN PFNGLVERTEXATTRIBI3IVPROC pglVertexAttribI3iv; -GLEE_EXTERN PFNGLVERTEXATTRIBI4IVPROC pglVertexAttribI4iv; -GLEE_EXTERN PFNGLVERTEXATTRIBI1UIVPROC pglVertexAttribI1uiv; -GLEE_EXTERN PFNGLVERTEXATTRIBI2UIVPROC pglVertexAttribI2uiv; -GLEE_EXTERN PFNGLVERTEXATTRIBI3UIVPROC pglVertexAttribI3uiv; -GLEE_EXTERN PFNGLVERTEXATTRIBI4UIVPROC pglVertexAttribI4uiv; -GLEE_EXTERN PFNGLVERTEXATTRIBI4BVPROC pglVertexAttribI4bv; -GLEE_EXTERN PFNGLVERTEXATTRIBI4SVPROC pglVertexAttribI4sv; -GLEE_EXTERN PFNGLVERTEXATTRIBI4UBVPROC pglVertexAttribI4ubv; -GLEE_EXTERN PFNGLVERTEXATTRIBI4USVPROC pglVertexAttribI4usv; -GLEE_EXTERN PFNGLVERTEXATTRIBIPOINTERPROC pglVertexAttribIPointer; -GLEE_EXTERN PFNGLGETVERTEXATTRIBIIVPROC pglGetVertexAttribIiv; -GLEE_EXTERN PFNGLGETVERTEXATTRIBIUIVPROC pglGetVertexAttribIuiv; -GLEE_EXTERN PFNGLGETUNIFORMUIVPROC pglGetUniformuiv; -GLEE_EXTERN PFNGLBINDFRAGDATALOCATIONPROC pglBindFragDataLocation; -GLEE_EXTERN PFNGLGETFRAGDATALOCATIONPROC pglGetFragDataLocation; -GLEE_EXTERN PFNGLUNIFORM1UIPROC pglUniform1ui; -GLEE_EXTERN PFNGLUNIFORM2UIPROC pglUniform2ui; -GLEE_EXTERN PFNGLUNIFORM3UIPROC pglUniform3ui; -GLEE_EXTERN PFNGLUNIFORM4UIPROC pglUniform4ui; -GLEE_EXTERN PFNGLUNIFORM1UIVPROC pglUniform1uiv; -GLEE_EXTERN PFNGLUNIFORM2UIVPROC pglUniform2uiv; -GLEE_EXTERN PFNGLUNIFORM3UIVPROC pglUniform3uiv; -GLEE_EXTERN PFNGLUNIFORM4UIVPROC pglUniform4uiv; -GLEE_EXTERN PFNGLTEXPARAMETERIIVPROC pglTexParameterIiv; -GLEE_EXTERN PFNGLTEXPARAMETERIUIVPROC pglTexParameterIuiv; -GLEE_EXTERN PFNGLGETTEXPARAMETERIIVPROC pglGetTexParameterIiv; -GLEE_EXTERN PFNGLGETTEXPARAMETERIUIVPROC pglGetTexParameterIuiv; -GLEE_EXTERN PFNGLCLEARBUFFERIVPROC pglClearBufferiv; -GLEE_EXTERN PFNGLCLEARBUFFERUIVPROC pglClearBufferuiv; -GLEE_EXTERN PFNGLCLEARBUFFERFVPROC pglClearBufferfv; -GLEE_EXTERN PFNGLCLEARBUFFERFIPROC pglClearBufferfi; -GLEE_EXTERN PFNGLGETSTRINGIPROC pglGetStringi; -#define glColorMaski pglColorMaski -#define glGetBooleani_v pglGetBooleani_v -#define glGetIntegeri_v pglGetIntegeri_v -#define glEnablei pglEnablei -#define glDisablei pglDisablei -#define glIsEnabledi pglIsEnabledi -#define glBeginTransformFeedback pglBeginTransformFeedback -#define glEndTransformFeedback pglEndTransformFeedback -#define glBindBufferRange pglBindBufferRange -#define glBindBufferBase pglBindBufferBase -#define glTransformFeedbackVaryings pglTransformFeedbackVaryings -#define glGetTransformFeedbackVarying pglGetTransformFeedbackVarying -#define glClampColor pglClampColor -#define glBeginConditionalRender pglBeginConditionalRender -#define glEndConditionalRender pglEndConditionalRender -#define glVertexAttribI1i pglVertexAttribI1i -#define glVertexAttribI2i pglVertexAttribI2i -#define glVertexAttribI3i pglVertexAttribI3i -#define glVertexAttribI4i pglVertexAttribI4i -#define glVertexAttribI1ui pglVertexAttribI1ui -#define glVertexAttribI2ui pglVertexAttribI2ui -#define glVertexAttribI3ui pglVertexAttribI3ui -#define glVertexAttribI4ui pglVertexAttribI4ui -#define glVertexAttribI1iv pglVertexAttribI1iv -#define glVertexAttribI2iv pglVertexAttribI2iv -#define glVertexAttribI3iv pglVertexAttribI3iv -#define glVertexAttribI4iv pglVertexAttribI4iv -#define glVertexAttribI1uiv pglVertexAttribI1uiv -#define glVertexAttribI2uiv pglVertexAttribI2uiv -#define glVertexAttribI3uiv pglVertexAttribI3uiv -#define glVertexAttribI4uiv pglVertexAttribI4uiv -#define glVertexAttribI4bv pglVertexAttribI4bv -#define glVertexAttribI4sv pglVertexAttribI4sv -#define glVertexAttribI4ubv pglVertexAttribI4ubv -#define glVertexAttribI4usv pglVertexAttribI4usv -#define glVertexAttribIPointer pglVertexAttribIPointer -#define glGetVertexAttribIiv pglGetVertexAttribIiv -#define glGetVertexAttribIuiv pglGetVertexAttribIuiv -#define glGetUniformuiv pglGetUniformuiv -#define glBindFragDataLocation pglBindFragDataLocation -#define glGetFragDataLocation pglGetFragDataLocation -#define glUniform1ui pglUniform1ui -#define glUniform2ui pglUniform2ui -#define glUniform3ui pglUniform3ui -#define glUniform4ui pglUniform4ui -#define glUniform1uiv pglUniform1uiv -#define glUniform2uiv pglUniform2uiv -#define glUniform3uiv pglUniform3uiv -#define glUniform4uiv pglUniform4uiv -#define glTexParameterIiv pglTexParameterIiv -#define glTexParameterIuiv pglTexParameterIuiv -#define glGetTexParameterIiv pglGetTexParameterIiv -#define glGetTexParameterIuiv pglGetTexParameterIuiv -#define glClearBufferiv pglClearBufferiv -#define glClearBufferuiv pglClearBufferuiv -#define glClearBufferfv pglClearBufferfv -#define glClearBufferfi pglClearBufferfi -#define glGetStringi pglGetStringi -#endif - -/* GL_ARB_multitexture */ - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#define __GLEE_GL_ARB_multitexture 1 -/* Constants */ -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort * v); -GLEE_EXTERN PFNGLACTIVETEXTUREARBPROC pglActiveTextureARB; -GLEE_EXTERN PFNGLCLIENTACTIVETEXTUREARBPROC pglClientActiveTextureARB; -GLEE_EXTERN PFNGLMULTITEXCOORD1DARBPROC pglMultiTexCoord1dARB; -GLEE_EXTERN PFNGLMULTITEXCOORD1DVARBPROC pglMultiTexCoord1dvARB; -GLEE_EXTERN PFNGLMULTITEXCOORD1FARBPROC pglMultiTexCoord1fARB; -GLEE_EXTERN PFNGLMULTITEXCOORD1FVARBPROC pglMultiTexCoord1fvARB; -GLEE_EXTERN PFNGLMULTITEXCOORD1IARBPROC pglMultiTexCoord1iARB; -GLEE_EXTERN PFNGLMULTITEXCOORD1IVARBPROC pglMultiTexCoord1ivARB; -GLEE_EXTERN PFNGLMULTITEXCOORD1SARBPROC pglMultiTexCoord1sARB; -GLEE_EXTERN PFNGLMULTITEXCOORD1SVARBPROC pglMultiTexCoord1svARB; -GLEE_EXTERN PFNGLMULTITEXCOORD2DARBPROC pglMultiTexCoord2dARB; -GLEE_EXTERN PFNGLMULTITEXCOORD2DVARBPROC pglMultiTexCoord2dvARB; -GLEE_EXTERN PFNGLMULTITEXCOORD2FARBPROC pglMultiTexCoord2fARB; -GLEE_EXTERN PFNGLMULTITEXCOORD2FVARBPROC pglMultiTexCoord2fvARB; -GLEE_EXTERN PFNGLMULTITEXCOORD2IARBPROC pglMultiTexCoord2iARB; -GLEE_EXTERN PFNGLMULTITEXCOORD2IVARBPROC pglMultiTexCoord2ivARB; -GLEE_EXTERN PFNGLMULTITEXCOORD2SARBPROC pglMultiTexCoord2sARB; -GLEE_EXTERN PFNGLMULTITEXCOORD2SVARBPROC pglMultiTexCoord2svARB; -GLEE_EXTERN PFNGLMULTITEXCOORD3DARBPROC pglMultiTexCoord3dARB; -GLEE_EXTERN PFNGLMULTITEXCOORD3DVARBPROC pglMultiTexCoord3dvARB; -GLEE_EXTERN PFNGLMULTITEXCOORD3FARBPROC pglMultiTexCoord3fARB; -GLEE_EXTERN PFNGLMULTITEXCOORD3FVARBPROC pglMultiTexCoord3fvARB; -GLEE_EXTERN PFNGLMULTITEXCOORD3IARBPROC pglMultiTexCoord3iARB; -GLEE_EXTERN PFNGLMULTITEXCOORD3IVARBPROC pglMultiTexCoord3ivARB; -GLEE_EXTERN PFNGLMULTITEXCOORD3SARBPROC pglMultiTexCoord3sARB; -GLEE_EXTERN PFNGLMULTITEXCOORD3SVARBPROC pglMultiTexCoord3svARB; -GLEE_EXTERN PFNGLMULTITEXCOORD4DARBPROC pglMultiTexCoord4dARB; -GLEE_EXTERN PFNGLMULTITEXCOORD4DVARBPROC pglMultiTexCoord4dvARB; -GLEE_EXTERN PFNGLMULTITEXCOORD4FARBPROC pglMultiTexCoord4fARB; -GLEE_EXTERN PFNGLMULTITEXCOORD4FVARBPROC pglMultiTexCoord4fvARB; -GLEE_EXTERN PFNGLMULTITEXCOORD4IARBPROC pglMultiTexCoord4iARB; -GLEE_EXTERN PFNGLMULTITEXCOORD4IVARBPROC pglMultiTexCoord4ivARB; -GLEE_EXTERN PFNGLMULTITEXCOORD4SARBPROC pglMultiTexCoord4sARB; -GLEE_EXTERN PFNGLMULTITEXCOORD4SVARBPROC pglMultiTexCoord4svARB; -#define glActiveTextureARB pglActiveTextureARB -#define glClientActiveTextureARB pglClientActiveTextureARB -#define glMultiTexCoord1dARB pglMultiTexCoord1dARB -#define glMultiTexCoord1dvARB pglMultiTexCoord1dvARB -#define glMultiTexCoord1fARB pglMultiTexCoord1fARB -#define glMultiTexCoord1fvARB pglMultiTexCoord1fvARB -#define glMultiTexCoord1iARB pglMultiTexCoord1iARB -#define glMultiTexCoord1ivARB pglMultiTexCoord1ivARB -#define glMultiTexCoord1sARB pglMultiTexCoord1sARB -#define glMultiTexCoord1svARB pglMultiTexCoord1svARB -#define glMultiTexCoord2dARB pglMultiTexCoord2dARB -#define glMultiTexCoord2dvARB pglMultiTexCoord2dvARB -#define glMultiTexCoord2fARB pglMultiTexCoord2fARB -#define glMultiTexCoord2fvARB pglMultiTexCoord2fvARB -#define glMultiTexCoord2iARB pglMultiTexCoord2iARB -#define glMultiTexCoord2ivARB pglMultiTexCoord2ivARB -#define glMultiTexCoord2sARB pglMultiTexCoord2sARB -#define glMultiTexCoord2svARB pglMultiTexCoord2svARB -#define glMultiTexCoord3dARB pglMultiTexCoord3dARB -#define glMultiTexCoord3dvARB pglMultiTexCoord3dvARB -#define glMultiTexCoord3fARB pglMultiTexCoord3fARB -#define glMultiTexCoord3fvARB pglMultiTexCoord3fvARB -#define glMultiTexCoord3iARB pglMultiTexCoord3iARB -#define glMultiTexCoord3ivARB pglMultiTexCoord3ivARB -#define glMultiTexCoord3sARB pglMultiTexCoord3sARB -#define glMultiTexCoord3svARB pglMultiTexCoord3svARB -#define glMultiTexCoord4dARB pglMultiTexCoord4dARB -#define glMultiTexCoord4dvARB pglMultiTexCoord4dvARB -#define glMultiTexCoord4fARB pglMultiTexCoord4fARB -#define glMultiTexCoord4fvARB pglMultiTexCoord4fvARB -#define glMultiTexCoord4iARB pglMultiTexCoord4iARB -#define glMultiTexCoord4ivARB pglMultiTexCoord4ivARB -#define glMultiTexCoord4sARB pglMultiTexCoord4sARB -#define glMultiTexCoord4svARB pglMultiTexCoord4svARB -#endif - -/* GL_ARB_transpose_matrix */ - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#define __GLEE_GL_ARB_transpose_matrix 1 -/* Constants */ -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat * m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble * m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat * m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble * m); -GLEE_EXTERN PFNGLLOADTRANSPOSEMATRIXFARBPROC pglLoadTransposeMatrixfARB; -GLEE_EXTERN PFNGLLOADTRANSPOSEMATRIXDARBPROC pglLoadTransposeMatrixdARB; -GLEE_EXTERN PFNGLMULTTRANSPOSEMATRIXFARBPROC pglMultTransposeMatrixfARB; -GLEE_EXTERN PFNGLMULTTRANSPOSEMATRIXDARBPROC pglMultTransposeMatrixdARB; -#define glLoadTransposeMatrixfARB pglLoadTransposeMatrixfARB -#define glLoadTransposeMatrixdARB pglLoadTransposeMatrixdARB -#define glMultTransposeMatrixfARB pglMultTransposeMatrixfARB -#define glMultTransposeMatrixdARB pglMultTransposeMatrixdARB -#endif - -/* GL_ARB_multisample */ - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#define __GLEE_GL_ARB_multisample 1 -/* Constants */ -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -GLEE_EXTERN PFNGLSAMPLECOVERAGEARBPROC pglSampleCoverageARB; -#define glSampleCoverageARB pglSampleCoverageARB -#endif - -/* GL_ARB_texture_env_add */ - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#define __GLEE_GL_ARB_texture_env_add 1 -/* Constants */ -#endif - -/* GL_ARB_texture_cube_map */ - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#define __GLEE_GL_ARB_texture_cube_map 1 -/* Constants */ -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -/* GL_ARB_texture_compression */ - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#define __GLEE_GL_ARB_texture_compression 1 -/* Constants */ -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid * img); -GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE3DARBPROC pglCompressedTexImage3DARB; -GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE2DARBPROC pglCompressedTexImage2DARB; -GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE1DARBPROC pglCompressedTexImage1DARB; -GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC pglCompressedTexSubImage3DARB; -GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC pglCompressedTexSubImage2DARB; -GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC pglCompressedTexSubImage1DARB; -GLEE_EXTERN PFNGLGETCOMPRESSEDTEXIMAGEARBPROC pglGetCompressedTexImageARB; -#define glCompressedTexImage3DARB pglCompressedTexImage3DARB -#define glCompressedTexImage2DARB pglCompressedTexImage2DARB -#define glCompressedTexImage1DARB pglCompressedTexImage1DARB -#define glCompressedTexSubImage3DARB pglCompressedTexSubImage3DARB -#define glCompressedTexSubImage2DARB pglCompressedTexSubImage2DARB -#define glCompressedTexSubImage1DARB pglCompressedTexSubImage1DARB -#define glGetCompressedTexImageARB pglGetCompressedTexImageARB -#endif - -/* GL_ARB_texture_border_clamp */ - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#define __GLEE_GL_ARB_texture_border_clamp 1 -/* Constants */ -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -/* GL_ARB_point_parameters */ - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#define __GLEE_GL_ARB_point_parameters 1 -/* Constants */ -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat * params); -GLEE_EXTERN PFNGLPOINTPARAMETERFARBPROC pglPointParameterfARB; -GLEE_EXTERN PFNGLPOINTPARAMETERFVARBPROC pglPointParameterfvARB; -#define glPointParameterfARB pglPointParameterfARB -#define glPointParameterfvARB pglPointParameterfvARB -#endif - -/* GL_ARB_vertex_blend */ - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#define __GLEE_GL_ARB_vertex_blend 1 -/* Constants */ -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte * weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort * weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint * weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat * weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble * weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte * weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort * weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint * weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -GLEE_EXTERN PFNGLWEIGHTBVARBPROC pglWeightbvARB; -GLEE_EXTERN PFNGLWEIGHTSVARBPROC pglWeightsvARB; -GLEE_EXTERN PFNGLWEIGHTIVARBPROC pglWeightivARB; -GLEE_EXTERN PFNGLWEIGHTFVARBPROC pglWeightfvARB; -GLEE_EXTERN PFNGLWEIGHTDVARBPROC pglWeightdvARB; -GLEE_EXTERN PFNGLWEIGHTUBVARBPROC pglWeightubvARB; -GLEE_EXTERN PFNGLWEIGHTUSVARBPROC pglWeightusvARB; -GLEE_EXTERN PFNGLWEIGHTUIVARBPROC pglWeightuivARB; -GLEE_EXTERN PFNGLWEIGHTPOINTERARBPROC pglWeightPointerARB; -GLEE_EXTERN PFNGLVERTEXBLENDARBPROC pglVertexBlendARB; -#define glWeightbvARB pglWeightbvARB -#define glWeightsvARB pglWeightsvARB -#define glWeightivARB pglWeightivARB -#define glWeightfvARB pglWeightfvARB -#define glWeightdvARB pglWeightdvARB -#define glWeightubvARB pglWeightubvARB -#define glWeightusvARB pglWeightusvARB -#define glWeightuivARB pglWeightuivARB -#define glWeightPointerARB pglWeightPointerARB -#define glVertexBlendARB pglVertexBlendARB -#endif - -/* GL_ARB_matrix_palette */ - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#define __GLEE_GL_ARB_matrix_palette 1 -/* Constants */ -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte * indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort * indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint * indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); -GLEE_EXTERN PFNGLCURRENTPALETTEMATRIXARBPROC pglCurrentPaletteMatrixARB; -GLEE_EXTERN PFNGLMATRIXINDEXUBVARBPROC pglMatrixIndexubvARB; -GLEE_EXTERN PFNGLMATRIXINDEXUSVARBPROC pglMatrixIndexusvARB; -GLEE_EXTERN PFNGLMATRIXINDEXUIVARBPROC pglMatrixIndexuivARB; -GLEE_EXTERN PFNGLMATRIXINDEXPOINTERARBPROC pglMatrixIndexPointerARB; -#define glCurrentPaletteMatrixARB pglCurrentPaletteMatrixARB -#define glMatrixIndexubvARB pglMatrixIndexubvARB -#define glMatrixIndexusvARB pglMatrixIndexusvARB -#define glMatrixIndexuivARB pglMatrixIndexuivARB -#define glMatrixIndexPointerARB pglMatrixIndexPointerARB -#endif - -/* GL_ARB_texture_env_combine */ - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#define __GLEE_GL_ARB_texture_env_combine 1 -/* Constants */ -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -/* GL_ARB_texture_env_crossbar */ - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#define __GLEE_GL_ARB_texture_env_crossbar 1 -/* Constants */ -#endif - -/* GL_ARB_texture_env_dot3 */ - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#define __GLEE_GL_ARB_texture_env_dot3 1 -/* Constants */ -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -/* GL_ARB_texture_mirrored_repeat */ - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#define __GLEE_GL_ARB_texture_mirrored_repeat 1 -/* Constants */ -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif - -/* GL_ARB_depth_texture */ - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#define __GLEE_GL_ARB_depth_texture 1 -/* Constants */ -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif - -/* GL_ARB_shadow */ - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#define __GLEE_GL_ARB_shadow 1 -/* Constants */ -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif - -/* GL_ARB_shadow_ambient */ - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#define __GLEE_GL_ARB_shadow_ambient 1 -/* Constants */ -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif - -/* GL_ARB_window_pos */ - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -#define __GLEE_GL_ARB_window_pos 1 -/* Constants */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort * v); -GLEE_EXTERN PFNGLWINDOWPOS2DARBPROC pglWindowPos2dARB; -GLEE_EXTERN PFNGLWINDOWPOS2DVARBPROC pglWindowPos2dvARB; -GLEE_EXTERN PFNGLWINDOWPOS2FARBPROC pglWindowPos2fARB; -GLEE_EXTERN PFNGLWINDOWPOS2FVARBPROC pglWindowPos2fvARB; -GLEE_EXTERN PFNGLWINDOWPOS2IARBPROC pglWindowPos2iARB; -GLEE_EXTERN PFNGLWINDOWPOS2IVARBPROC pglWindowPos2ivARB; -GLEE_EXTERN PFNGLWINDOWPOS2SARBPROC pglWindowPos2sARB; -GLEE_EXTERN PFNGLWINDOWPOS2SVARBPROC pglWindowPos2svARB; -GLEE_EXTERN PFNGLWINDOWPOS3DARBPROC pglWindowPos3dARB; -GLEE_EXTERN PFNGLWINDOWPOS3DVARBPROC pglWindowPos3dvARB; -GLEE_EXTERN PFNGLWINDOWPOS3FARBPROC pglWindowPos3fARB; -GLEE_EXTERN PFNGLWINDOWPOS3FVARBPROC pglWindowPos3fvARB; -GLEE_EXTERN PFNGLWINDOWPOS3IARBPROC pglWindowPos3iARB; -GLEE_EXTERN PFNGLWINDOWPOS3IVARBPROC pglWindowPos3ivARB; -GLEE_EXTERN PFNGLWINDOWPOS3SARBPROC pglWindowPos3sARB; -GLEE_EXTERN PFNGLWINDOWPOS3SVARBPROC pglWindowPos3svARB; -#define glWindowPos2dARB pglWindowPos2dARB -#define glWindowPos2dvARB pglWindowPos2dvARB -#define glWindowPos2fARB pglWindowPos2fARB -#define glWindowPos2fvARB pglWindowPos2fvARB -#define glWindowPos2iARB pglWindowPos2iARB -#define glWindowPos2ivARB pglWindowPos2ivARB -#define glWindowPos2sARB pglWindowPos2sARB -#define glWindowPos2svARB pglWindowPos2svARB -#define glWindowPos3dARB pglWindowPos3dARB -#define glWindowPos3dvARB pglWindowPos3dvARB -#define glWindowPos3fARB pglWindowPos3fARB -#define glWindowPos3fvARB pglWindowPos3fvARB -#define glWindowPos3iARB pglWindowPos3iARB -#define glWindowPos3ivARB pglWindowPos3ivARB -#define glWindowPos3sARB pglWindowPos3sARB -#define glWindowPos3svARB pglWindowPos3svARB -#endif - -/* GL_ARB_vertex_program */ - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#define __GLEE_GL_ARB_vertex_program 1 -/* Constants */ -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid * string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint * programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint * programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble * params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat * params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble * params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat * params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble * params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat * params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble * params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat * params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid * string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* * pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -GLEE_EXTERN PFNGLVERTEXATTRIB1DARBPROC pglVertexAttrib1dARB; -GLEE_EXTERN PFNGLVERTEXATTRIB1DVARBPROC pglVertexAttrib1dvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB1FARBPROC pglVertexAttrib1fARB; -GLEE_EXTERN PFNGLVERTEXATTRIB1FVARBPROC pglVertexAttrib1fvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB1SARBPROC pglVertexAttrib1sARB; -GLEE_EXTERN PFNGLVERTEXATTRIB1SVARBPROC pglVertexAttrib1svARB; -GLEE_EXTERN PFNGLVERTEXATTRIB2DARBPROC pglVertexAttrib2dARB; -GLEE_EXTERN PFNGLVERTEXATTRIB2DVARBPROC pglVertexAttrib2dvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB2FARBPROC pglVertexAttrib2fARB; -GLEE_EXTERN PFNGLVERTEXATTRIB2FVARBPROC pglVertexAttrib2fvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB2SARBPROC pglVertexAttrib2sARB; -GLEE_EXTERN PFNGLVERTEXATTRIB2SVARBPROC pglVertexAttrib2svARB; -GLEE_EXTERN PFNGLVERTEXATTRIB3DARBPROC pglVertexAttrib3dARB; -GLEE_EXTERN PFNGLVERTEXATTRIB3DVARBPROC pglVertexAttrib3dvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB3FARBPROC pglVertexAttrib3fARB; -GLEE_EXTERN PFNGLVERTEXATTRIB3FVARBPROC pglVertexAttrib3fvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB3SARBPROC pglVertexAttrib3sARB; -GLEE_EXTERN PFNGLVERTEXATTRIB3SVARBPROC pglVertexAttrib3svARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4NBVARBPROC pglVertexAttrib4NbvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4NIVARBPROC pglVertexAttrib4NivARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4NSVARBPROC pglVertexAttrib4NsvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4NUBARBPROC pglVertexAttrib4NubARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4NUBVARBPROC pglVertexAttrib4NubvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4NUIVARBPROC pglVertexAttrib4NuivARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4NUSVARBPROC pglVertexAttrib4NusvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4BVARBPROC pglVertexAttrib4bvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4DARBPROC pglVertexAttrib4dARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4DVARBPROC pglVertexAttrib4dvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4FARBPROC pglVertexAttrib4fARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4FVARBPROC pglVertexAttrib4fvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4IVARBPROC pglVertexAttrib4ivARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4SARBPROC pglVertexAttrib4sARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4SVARBPROC pglVertexAttrib4svARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4UBVARBPROC pglVertexAttrib4ubvARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4UIVARBPROC pglVertexAttrib4uivARB; -GLEE_EXTERN PFNGLVERTEXATTRIB4USVARBPROC pglVertexAttrib4usvARB; -GLEE_EXTERN PFNGLVERTEXATTRIBPOINTERARBPROC pglVertexAttribPointerARB; -GLEE_EXTERN PFNGLENABLEVERTEXATTRIBARRAYARBPROC pglEnableVertexAttribArrayARB; -GLEE_EXTERN PFNGLDISABLEVERTEXATTRIBARRAYARBPROC pglDisableVertexAttribArrayARB; -GLEE_EXTERN PFNGLPROGRAMSTRINGARBPROC pglProgramStringARB; -GLEE_EXTERN PFNGLBINDPROGRAMARBPROC pglBindProgramARB; -GLEE_EXTERN PFNGLDELETEPROGRAMSARBPROC pglDeleteProgramsARB; -GLEE_EXTERN PFNGLGENPROGRAMSARBPROC pglGenProgramsARB; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETER4DARBPROC pglProgramEnvParameter4dARB; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETER4DVARBPROC pglProgramEnvParameter4dvARB; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETER4FARBPROC pglProgramEnvParameter4fARB; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETER4FVARBPROC pglProgramEnvParameter4fvARB; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETER4DARBPROC pglProgramLocalParameter4dARB; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETER4DVARBPROC pglProgramLocalParameter4dvARB; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETER4FARBPROC pglProgramLocalParameter4fARB; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETER4FVARBPROC pglProgramLocalParameter4fvARB; -GLEE_EXTERN PFNGLGETPROGRAMENVPARAMETERDVARBPROC pglGetProgramEnvParameterdvARB; -GLEE_EXTERN PFNGLGETPROGRAMENVPARAMETERFVARBPROC pglGetProgramEnvParameterfvARB; -GLEE_EXTERN PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC pglGetProgramLocalParameterdvARB; -GLEE_EXTERN PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC pglGetProgramLocalParameterfvARB; -GLEE_EXTERN PFNGLGETPROGRAMIVARBPROC pglGetProgramivARB; -GLEE_EXTERN PFNGLGETPROGRAMSTRINGARBPROC pglGetProgramStringARB; -GLEE_EXTERN PFNGLGETVERTEXATTRIBDVARBPROC pglGetVertexAttribdvARB; -GLEE_EXTERN PFNGLGETVERTEXATTRIBFVARBPROC pglGetVertexAttribfvARB; -GLEE_EXTERN PFNGLGETVERTEXATTRIBIVARBPROC pglGetVertexAttribivARB; -GLEE_EXTERN PFNGLGETVERTEXATTRIBPOINTERVARBPROC pglGetVertexAttribPointervARB; -GLEE_EXTERN PFNGLISPROGRAMARBPROC pglIsProgramARB; -#define glVertexAttrib1dARB pglVertexAttrib1dARB -#define glVertexAttrib1dvARB pglVertexAttrib1dvARB -#define glVertexAttrib1fARB pglVertexAttrib1fARB -#define glVertexAttrib1fvARB pglVertexAttrib1fvARB -#define glVertexAttrib1sARB pglVertexAttrib1sARB -#define glVertexAttrib1svARB pglVertexAttrib1svARB -#define glVertexAttrib2dARB pglVertexAttrib2dARB -#define glVertexAttrib2dvARB pglVertexAttrib2dvARB -#define glVertexAttrib2fARB pglVertexAttrib2fARB -#define glVertexAttrib2fvARB pglVertexAttrib2fvARB -#define glVertexAttrib2sARB pglVertexAttrib2sARB -#define glVertexAttrib2svARB pglVertexAttrib2svARB -#define glVertexAttrib3dARB pglVertexAttrib3dARB -#define glVertexAttrib3dvARB pglVertexAttrib3dvARB -#define glVertexAttrib3fARB pglVertexAttrib3fARB -#define glVertexAttrib3fvARB pglVertexAttrib3fvARB -#define glVertexAttrib3sARB pglVertexAttrib3sARB -#define glVertexAttrib3svARB pglVertexAttrib3svARB -#define glVertexAttrib4NbvARB pglVertexAttrib4NbvARB -#define glVertexAttrib4NivARB pglVertexAttrib4NivARB -#define glVertexAttrib4NsvARB pglVertexAttrib4NsvARB -#define glVertexAttrib4NubARB pglVertexAttrib4NubARB -#define glVertexAttrib4NubvARB pglVertexAttrib4NubvARB -#define glVertexAttrib4NuivARB pglVertexAttrib4NuivARB -#define glVertexAttrib4NusvARB pglVertexAttrib4NusvARB -#define glVertexAttrib4bvARB pglVertexAttrib4bvARB -#define glVertexAttrib4dARB pglVertexAttrib4dARB -#define glVertexAttrib4dvARB pglVertexAttrib4dvARB -#define glVertexAttrib4fARB pglVertexAttrib4fARB -#define glVertexAttrib4fvARB pglVertexAttrib4fvARB -#define glVertexAttrib4ivARB pglVertexAttrib4ivARB -#define glVertexAttrib4sARB pglVertexAttrib4sARB -#define glVertexAttrib4svARB pglVertexAttrib4svARB -#define glVertexAttrib4ubvARB pglVertexAttrib4ubvARB -#define glVertexAttrib4uivARB pglVertexAttrib4uivARB -#define glVertexAttrib4usvARB pglVertexAttrib4usvARB -#define glVertexAttribPointerARB pglVertexAttribPointerARB -#define glEnableVertexAttribArrayARB pglEnableVertexAttribArrayARB -#define glDisableVertexAttribArrayARB pglDisableVertexAttribArrayARB -#define glProgramStringARB pglProgramStringARB -#define glBindProgramARB pglBindProgramARB -#define glDeleteProgramsARB pglDeleteProgramsARB -#define glGenProgramsARB pglGenProgramsARB -#define glProgramEnvParameter4dARB pglProgramEnvParameter4dARB -#define glProgramEnvParameter4dvARB pglProgramEnvParameter4dvARB -#define glProgramEnvParameter4fARB pglProgramEnvParameter4fARB -#define glProgramEnvParameter4fvARB pglProgramEnvParameter4fvARB -#define glProgramLocalParameter4dARB pglProgramLocalParameter4dARB -#define glProgramLocalParameter4dvARB pglProgramLocalParameter4dvARB -#define glProgramLocalParameter4fARB pglProgramLocalParameter4fARB -#define glProgramLocalParameter4fvARB pglProgramLocalParameter4fvARB -#define glGetProgramEnvParameterdvARB pglGetProgramEnvParameterdvARB -#define glGetProgramEnvParameterfvARB pglGetProgramEnvParameterfvARB -#define glGetProgramLocalParameterdvARB pglGetProgramLocalParameterdvARB -#define glGetProgramLocalParameterfvARB pglGetProgramLocalParameterfvARB -#define glGetProgramivARB pglGetProgramivARB -#define glGetProgramStringARB pglGetProgramStringARB -#define glGetVertexAttribdvARB pglGetVertexAttribdvARB -#define glGetVertexAttribfvARB pglGetVertexAttribfvARB -#define glGetVertexAttribivARB pglGetVertexAttribivARB -#define glGetVertexAttribPointervARB pglGetVertexAttribPointervARB -#define glIsProgramARB pglIsProgramARB -#endif - -/* GL_ARB_fragment_program */ - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -#define __GLEE_GL_ARB_fragment_program 1 -/* Constants */ -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#endif - -/* GL_ARB_vertex_buffer_object */ - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#define __GLEE_GL_ARB_vertex_buffer_object 1 -/* Constants */ -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint * buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint * buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* * params); -GLEE_EXTERN PFNGLBINDBUFFERARBPROC pglBindBufferARB; -GLEE_EXTERN PFNGLDELETEBUFFERSARBPROC pglDeleteBuffersARB; -GLEE_EXTERN PFNGLGENBUFFERSARBPROC pglGenBuffersARB; -GLEE_EXTERN PFNGLISBUFFERARBPROC pglIsBufferARB; -GLEE_EXTERN PFNGLBUFFERDATAARBPROC pglBufferDataARB; -GLEE_EXTERN PFNGLBUFFERSUBDATAARBPROC pglBufferSubDataARB; -GLEE_EXTERN PFNGLGETBUFFERSUBDATAARBPROC pglGetBufferSubDataARB; -GLEE_EXTERN PFNGLMAPBUFFERARBPROC pglMapBufferARB; -GLEE_EXTERN PFNGLUNMAPBUFFERARBPROC pglUnmapBufferARB; -GLEE_EXTERN PFNGLGETBUFFERPARAMETERIVARBPROC pglGetBufferParameterivARB; -GLEE_EXTERN PFNGLGETBUFFERPOINTERVARBPROC pglGetBufferPointervARB; -#define glBindBufferARB pglBindBufferARB -#define glDeleteBuffersARB pglDeleteBuffersARB -#define glGenBuffersARB pglGenBuffersARB -#define glIsBufferARB pglIsBufferARB -#define glBufferDataARB pglBufferDataARB -#define glBufferSubDataARB pglBufferSubDataARB -#define glGetBufferSubDataARB pglGetBufferSubDataARB -#define glMapBufferARB pglMapBufferARB -#define glUnmapBufferARB pglUnmapBufferARB -#define glGetBufferParameterivARB pglGetBufferParameterivARB -#define glGetBufferPointervARB pglGetBufferPointervARB -#endif - -/* GL_ARB_occlusion_query */ - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#define __GLEE_GL_ARB_occlusion_query 1 -/* Constants */ -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint * ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint * ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint * params); -GLEE_EXTERN PFNGLGENQUERIESARBPROC pglGenQueriesARB; -GLEE_EXTERN PFNGLDELETEQUERIESARBPROC pglDeleteQueriesARB; -GLEE_EXTERN PFNGLISQUERYARBPROC pglIsQueryARB; -GLEE_EXTERN PFNGLBEGINQUERYARBPROC pglBeginQueryARB; -GLEE_EXTERN PFNGLENDQUERYARBPROC pglEndQueryARB; -GLEE_EXTERN PFNGLGETQUERYIVARBPROC pglGetQueryivARB; -GLEE_EXTERN PFNGLGETQUERYOBJECTIVARBPROC pglGetQueryObjectivARB; -GLEE_EXTERN PFNGLGETQUERYOBJECTUIVARBPROC pglGetQueryObjectuivARB; -#define glGenQueriesARB pglGenQueriesARB -#define glDeleteQueriesARB pglDeleteQueriesARB -#define glIsQueryARB pglIsQueryARB -#define glBeginQueryARB pglBeginQueryARB -#define glEndQueryARB pglEndQueryARB -#define glGetQueryivARB pglGetQueryivARB -#define glGetQueryObjectivARB pglGetQueryObjectivARB -#define glGetQueryObjectuivARB pglGetQueryObjectuivARB -#endif - -/* GL_ARB_shader_objects */ - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#define __GLEE_GL_ARB_shader_objects 1 -/* Constants */ -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* * string, const GLint * length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB * name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat * params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint * params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); -GLEE_EXTERN PFNGLDELETEOBJECTARBPROC pglDeleteObjectARB; -GLEE_EXTERN PFNGLGETHANDLEARBPROC pglGetHandleARB; -GLEE_EXTERN PFNGLDETACHOBJECTARBPROC pglDetachObjectARB; -GLEE_EXTERN PFNGLCREATESHADEROBJECTARBPROC pglCreateShaderObjectARB; -GLEE_EXTERN PFNGLSHADERSOURCEARBPROC pglShaderSourceARB; -GLEE_EXTERN PFNGLCOMPILESHADERARBPROC pglCompileShaderARB; -GLEE_EXTERN PFNGLCREATEPROGRAMOBJECTARBPROC pglCreateProgramObjectARB; -GLEE_EXTERN PFNGLATTACHOBJECTARBPROC pglAttachObjectARB; -GLEE_EXTERN PFNGLLINKPROGRAMARBPROC pglLinkProgramARB; -GLEE_EXTERN PFNGLUSEPROGRAMOBJECTARBPROC pglUseProgramObjectARB; -GLEE_EXTERN PFNGLVALIDATEPROGRAMARBPROC pglValidateProgramARB; -GLEE_EXTERN PFNGLUNIFORM1FARBPROC pglUniform1fARB; -GLEE_EXTERN PFNGLUNIFORM2FARBPROC pglUniform2fARB; -GLEE_EXTERN PFNGLUNIFORM3FARBPROC pglUniform3fARB; -GLEE_EXTERN PFNGLUNIFORM4FARBPROC pglUniform4fARB; -GLEE_EXTERN PFNGLUNIFORM1IARBPROC pglUniform1iARB; -GLEE_EXTERN PFNGLUNIFORM2IARBPROC pglUniform2iARB; -GLEE_EXTERN PFNGLUNIFORM3IARBPROC pglUniform3iARB; -GLEE_EXTERN PFNGLUNIFORM4IARBPROC pglUniform4iARB; -GLEE_EXTERN PFNGLUNIFORM1FVARBPROC pglUniform1fvARB; -GLEE_EXTERN PFNGLUNIFORM2FVARBPROC pglUniform2fvARB; -GLEE_EXTERN PFNGLUNIFORM3FVARBPROC pglUniform3fvARB; -GLEE_EXTERN PFNGLUNIFORM4FVARBPROC pglUniform4fvARB; -GLEE_EXTERN PFNGLUNIFORM1IVARBPROC pglUniform1ivARB; -GLEE_EXTERN PFNGLUNIFORM2IVARBPROC pglUniform2ivARB; -GLEE_EXTERN PFNGLUNIFORM3IVARBPROC pglUniform3ivARB; -GLEE_EXTERN PFNGLUNIFORM4IVARBPROC pglUniform4ivARB; -GLEE_EXTERN PFNGLUNIFORMMATRIX2FVARBPROC pglUniformMatrix2fvARB; -GLEE_EXTERN PFNGLUNIFORMMATRIX3FVARBPROC pglUniformMatrix3fvARB; -GLEE_EXTERN PFNGLUNIFORMMATRIX4FVARBPROC pglUniformMatrix4fvARB; -GLEE_EXTERN PFNGLGETOBJECTPARAMETERFVARBPROC pglGetObjectParameterfvARB; -GLEE_EXTERN PFNGLGETOBJECTPARAMETERIVARBPROC pglGetObjectParameterivARB; -GLEE_EXTERN PFNGLGETINFOLOGARBPROC pglGetInfoLogARB; -GLEE_EXTERN PFNGLGETATTACHEDOBJECTSARBPROC pglGetAttachedObjectsARB; -GLEE_EXTERN PFNGLGETUNIFORMLOCATIONARBPROC pglGetUniformLocationARB; -GLEE_EXTERN PFNGLGETACTIVEUNIFORMARBPROC pglGetActiveUniformARB; -GLEE_EXTERN PFNGLGETUNIFORMFVARBPROC pglGetUniformfvARB; -GLEE_EXTERN PFNGLGETUNIFORMIVARBPROC pglGetUniformivARB; -GLEE_EXTERN PFNGLGETSHADERSOURCEARBPROC pglGetShaderSourceARB; -#define glDeleteObjectARB pglDeleteObjectARB -#define glGetHandleARB pglGetHandleARB -#define glDetachObjectARB pglDetachObjectARB -#define glCreateShaderObjectARB pglCreateShaderObjectARB -#define glShaderSourceARB pglShaderSourceARB -#define glCompileShaderARB pglCompileShaderARB -#define glCreateProgramObjectARB pglCreateProgramObjectARB -#define glAttachObjectARB pglAttachObjectARB -#define glLinkProgramARB pglLinkProgramARB -#define glUseProgramObjectARB pglUseProgramObjectARB -#define glValidateProgramARB pglValidateProgramARB -#define glUniform1fARB pglUniform1fARB -#define glUniform2fARB pglUniform2fARB -#define glUniform3fARB pglUniform3fARB -#define glUniform4fARB pglUniform4fARB -#define glUniform1iARB pglUniform1iARB -#define glUniform2iARB pglUniform2iARB -#define glUniform3iARB pglUniform3iARB -#define glUniform4iARB pglUniform4iARB -#define glUniform1fvARB pglUniform1fvARB -#define glUniform2fvARB pglUniform2fvARB -#define glUniform3fvARB pglUniform3fvARB -#define glUniform4fvARB pglUniform4fvARB -#define glUniform1ivARB pglUniform1ivARB -#define glUniform2ivARB pglUniform2ivARB -#define glUniform3ivARB pglUniform3ivARB -#define glUniform4ivARB pglUniform4ivARB -#define glUniformMatrix2fvARB pglUniformMatrix2fvARB -#define glUniformMatrix3fvARB pglUniformMatrix3fvARB -#define glUniformMatrix4fvARB pglUniformMatrix4fvARB -#define glGetObjectParameterfvARB pglGetObjectParameterfvARB -#define glGetObjectParameterivARB pglGetObjectParameterivARB -#define glGetInfoLogARB pglGetInfoLogARB -#define glGetAttachedObjectsARB pglGetAttachedObjectsARB -#define glGetUniformLocationARB pglGetUniformLocationARB -#define glGetActiveUniformARB pglGetActiveUniformARB -#define glGetUniformfvARB pglGetUniformfvARB -#define glGetUniformivARB pglGetUniformivARB -#define glGetShaderSourceARB pglGetShaderSourceARB -#endif - -/* GL_ARB_vertex_shader */ - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#define __GLEE_GL_ARB_vertex_shader 1 -/* Constants */ -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB * name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB * name); -GLEE_EXTERN PFNGLBINDATTRIBLOCATIONARBPROC pglBindAttribLocationARB; -GLEE_EXTERN PFNGLGETACTIVEATTRIBARBPROC pglGetActiveAttribARB; -GLEE_EXTERN PFNGLGETATTRIBLOCATIONARBPROC pglGetAttribLocationARB; -#define glBindAttribLocationARB pglBindAttribLocationARB -#define glGetActiveAttribARB pglGetActiveAttribARB -#define glGetAttribLocationARB pglGetAttribLocationARB -#endif - -/* GL_ARB_fragment_shader */ - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#define __GLEE_GL_ARB_fragment_shader 1 -/* Constants */ -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif - -/* GL_ARB_shading_language_100 */ - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#define __GLEE_GL_ARB_shading_language_100 1 -/* Constants */ -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif - -/* GL_ARB_texture_non_power_of_two */ - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#define __GLEE_GL_ARB_texture_non_power_of_two 1 -/* Constants */ -#endif - -/* GL_ARB_point_sprite */ - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#define __GLEE_GL_ARB_point_sprite 1 -/* Constants */ -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif - -/* GL_ARB_fragment_program_shadow */ - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#define __GLEE_GL_ARB_fragment_program_shadow 1 -/* Constants */ -#endif - -/* GL_ARB_draw_buffers */ - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#define __GLEE_GL_ARB_draw_buffers 1 -/* Constants */ -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum * bufs); -GLEE_EXTERN PFNGLDRAWBUFFERSARBPROC pglDrawBuffersARB; -#define glDrawBuffersARB pglDrawBuffersARB -#endif - -/* GL_ARB_texture_rectangle */ - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#define __GLEE_GL_ARB_texture_rectangle 1 -/* Constants */ -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif - -/* GL_ARB_color_buffer_float */ - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#define __GLEE_GL_ARB_color_buffer_float 1 -/* Constants */ -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -GLEE_EXTERN PFNGLCLAMPCOLORARBPROC pglClampColorARB; -#define glClampColorARB pglClampColorARB -#endif - -/* GL_ARB_half_float_pixel */ - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -#define __GLEE_GL_ARB_half_float_pixel 1 -/* Constants */ -#define GL_HALF_FLOAT_ARB 0x140B -#endif - -/* GL_ARB_texture_float */ - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#define __GLEE_GL_ARB_texture_float 1 -/* Constants */ -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif - -/* GL_ARB_pixel_buffer_object */ - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#define __GLEE_GL_ARB_pixel_buffer_object 1 -/* Constants */ -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif - -/* GL_ARB_depth_buffer_float */ - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -#define __GLEE_GL_ARB_depth_buffer_float 1 -/* Constants */ -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#endif - -/* GL_ARB_drawinstanced */ - -#ifndef GL_ARB_drawinstanced -#define GL_ARB_drawinstanced 1 -#define __GLEE_GL_ARB_drawinstanced 1 -/* Constants */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount); -GLEE_EXTERN PFNGLDRAWARRAYSINSTANCEDARBPROC pglDrawArraysInstancedARB; -GLEE_EXTERN PFNGLDRAWELEMENTSINSTANCEDARBPROC pglDrawElementsInstancedARB; -#define glDrawArraysInstancedARB pglDrawArraysInstancedARB -#define glDrawElementsInstancedARB pglDrawElementsInstancedARB -#endif - -/* GL_ARB_framebuffer_object */ - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -#define __GLEE_GL_ARB_framebuffer_object 1 -/* Constants */ -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_INDEX 0x8222 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint * renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint * renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint * framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint * framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLEE_EXTERN PFNGLISRENDERBUFFERPROC pglIsRenderbuffer; -GLEE_EXTERN PFNGLBINDRENDERBUFFERPROC pglBindRenderbuffer; -GLEE_EXTERN PFNGLDELETERENDERBUFFERSPROC pglDeleteRenderbuffers; -GLEE_EXTERN PFNGLGENRENDERBUFFERSPROC pglGenRenderbuffers; -GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEPROC pglRenderbufferStorage; -GLEE_EXTERN PFNGLGETRENDERBUFFERPARAMETERIVPROC pglGetRenderbufferParameteriv; -GLEE_EXTERN PFNGLISFRAMEBUFFERPROC pglIsFramebuffer; -GLEE_EXTERN PFNGLBINDFRAMEBUFFERPROC pglBindFramebuffer; -GLEE_EXTERN PFNGLDELETEFRAMEBUFFERSPROC pglDeleteFramebuffers; -GLEE_EXTERN PFNGLGENFRAMEBUFFERSPROC pglGenFramebuffers; -GLEE_EXTERN PFNGLCHECKFRAMEBUFFERSTATUSPROC pglCheckFramebufferStatus; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE1DPROC pglFramebufferTexture1D; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE2DPROC pglFramebufferTexture2D; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE3DPROC pglFramebufferTexture3D; -GLEE_EXTERN PFNGLFRAMEBUFFERRENDERBUFFERPROC pglFramebufferRenderbuffer; -GLEE_EXTERN PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC pglGetFramebufferAttachmentParameteriv; -GLEE_EXTERN PFNGLGENERATEMIPMAPPROC pglGenerateMipmap; -GLEE_EXTERN PFNGLBLITFRAMEBUFFERPROC pglBlitFramebuffer; -GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC pglRenderbufferStorageMultisample; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURELAYERPROC pglFramebufferTextureLayer; -#define glIsRenderbuffer pglIsRenderbuffer -#define glBindRenderbuffer pglBindRenderbuffer -#define glDeleteRenderbuffers pglDeleteRenderbuffers -#define glGenRenderbuffers pglGenRenderbuffers -#define glRenderbufferStorage pglRenderbufferStorage -#define glGetRenderbufferParameteriv pglGetRenderbufferParameteriv -#define glIsFramebuffer pglIsFramebuffer -#define glBindFramebuffer pglBindFramebuffer -#define glDeleteFramebuffers pglDeleteFramebuffers -#define glGenFramebuffers pglGenFramebuffers -#define glCheckFramebufferStatus pglCheckFramebufferStatus -#define glFramebufferTexture1D pglFramebufferTexture1D -#define glFramebufferTexture2D pglFramebufferTexture2D -#define glFramebufferTexture3D pglFramebufferTexture3D -#define glFramebufferRenderbuffer pglFramebufferRenderbuffer -#define glGetFramebufferAttachmentParameteriv pglGetFramebufferAttachmentParameteriv -#define glGenerateMipmap pglGenerateMipmap -#define glBlitFramebuffer pglBlitFramebuffer -#define glRenderbufferStorageMultisample pglRenderbufferStorageMultisample -#define glFramebufferTextureLayer pglFramebufferTextureLayer -#endif - -/* GL_ARB_framebuffer_sRGB */ - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -#define __GLEE_GL_ARB_framebuffer_sRGB 1 -/* Constants */ -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#endif - -/* GL_ARB_geometry_shader4 */ - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -#define __GLEE_GL_ARB_geometry_shader4 1 -/* Constants */ -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLEE_EXTERN PFNGLPROGRAMPARAMETERIARBPROC pglProgramParameteriARB; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTUREARBPROC pglFramebufferTextureARB; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURELAYERARBPROC pglFramebufferTextureLayerARB; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTUREFACEARBPROC pglFramebufferTextureFaceARB; -#define glProgramParameteriARB pglProgramParameteriARB -#define glFramebufferTextureARB pglFramebufferTextureARB -#define glFramebufferTextureLayerARB pglFramebufferTextureLayerARB -#define glFramebufferTextureFaceARB pglFramebufferTextureFaceARB -#endif - -/* GL_ARB_half_float_vertex */ - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -#define __GLEE_GL_ARB_half_float_vertex 1 -/* Constants */ -#define GL_HALF_FLOAT 0x140B -#endif - -/* GL_ARBinstanced_arrays */ - -#ifndef GL_ARBinstanced_arrays -#define GL_ARBinstanced_arrays 1 -#define __GLEE_GL_ARBinstanced_arrays 1 -/* Constants */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); -GLEE_EXTERN PFNGLVERTEXATTRIBDIVISORPROC pglVertexAttribDivisor; -#define glVertexAttribDivisor pglVertexAttribDivisor -#endif - -/* GL_ARB_map_buffer_range */ - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -#define __GLEE_GL_ARB_map_buffer_range 1 -/* Constants */ -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -typedef void (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -GLEE_EXTERN PFNGLMAPBUFFERRANGEPROC pglMapBufferRange; -GLEE_EXTERN PFNGLFLUSHMAPPEDBUFFERRANGEPROC pglFlushMappedBufferRange; -#define glMapBufferRange pglMapBufferRange -#define glFlushMappedBufferRange pglFlushMappedBufferRange -#endif - -/* GL_ARB_texture_buffer_object */ - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -#define __GLEE_GL_ARB_texture_buffer_object 1 -/* Constants */ -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); -GLEE_EXTERN PFNGLTEXBUFFERARBPROC pglTexBufferARB; -#define glTexBufferARB pglTexBufferARB -#endif - -/* GL_ARB_texture_compression_rgtc */ - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -#define __GLEE_GL_ARB_texture_compression_rgtc 1 -/* Constants */ -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#endif - -/* GL_ARB_texture_rg */ - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -#define __GLEE_GL_ARB_texture_rg 1 -/* Constants */ -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#endif - -/* GL_ARB_vertex_array_object */ - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -#define __GLEE_GL_ARB_vertex_array_object 1 -/* Constants */ -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint * arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint * arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); -GLEE_EXTERN PFNGLBINDVERTEXARRAYPROC pglBindVertexArray; -GLEE_EXTERN PFNGLDELETEVERTEXARRAYSPROC pglDeleteVertexArrays; -GLEE_EXTERN PFNGLGENVERTEXARRAYSPROC pglGenVertexArrays; -GLEE_EXTERN PFNGLISVERTEXARRAYPROC pglIsVertexArray; -#define glBindVertexArray pglBindVertexArray -#define glDeleteVertexArrays pglDeleteVertexArrays -#define glGenVertexArrays pglGenVertexArrays -#define glIsVertexArray pglIsVertexArray -#endif - -/* GL_EXT_abgr */ - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#define __GLEE_GL_EXT_abgr 1 -/* Constants */ -#define GL_ABGR_EXT 0x8000 -#endif - -/* GL_EXT_blend_color */ - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#define __GLEE_GL_EXT_blend_color 1 -/* Constants */ -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GLEE_EXTERN PFNGLBLENDCOLOREXTPROC pglBlendColorEXT; -#define glBlendColorEXT pglBlendColorEXT -#endif - -/* GL_EXT_polygon_offset */ - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#define __GLEE_GL_EXT_polygon_offset 1 -/* Constants */ -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -GLEE_EXTERN PFNGLPOLYGONOFFSETEXTPROC pglPolygonOffsetEXT; -#define glPolygonOffsetEXT pglPolygonOffsetEXT -#endif - -/* GL_EXT_texture */ - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#define __GLEE_GL_EXT_texture 1 -/* Constants */ -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -/* GL_EXT_texture3D */ - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#define __GLEE_GL_EXT_texture3D 1 -/* Constants */ -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); -GLEE_EXTERN PFNGLTEXIMAGE3DEXTPROC pglTexImage3DEXT; -GLEE_EXTERN PFNGLTEXSUBIMAGE3DEXTPROC pglTexSubImage3DEXT; -#define glTexImage3DEXT pglTexImage3DEXT -#define glTexSubImage3DEXT pglTexSubImage3DEXT -#endif - -/* GL_SGIS_texture_filter4 */ - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#define __GLEE_GL_SGIS_texture_filter4 1 -/* Constants */ -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat * weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat * weights); -GLEE_EXTERN PFNGLGETTEXFILTERFUNCSGISPROC pglGetTexFilterFuncSGIS; -GLEE_EXTERN PFNGLTEXFILTERFUNCSGISPROC pglTexFilterFuncSGIS; -#define glGetTexFilterFuncSGIS pglGetTexFilterFuncSGIS -#define glTexFilterFuncSGIS pglTexFilterFuncSGIS -#endif - -/* GL_EXT_subtexture */ - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#define __GLEE_GL_EXT_subtexture 1 -/* Constants */ -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); -GLEE_EXTERN PFNGLTEXSUBIMAGE1DEXTPROC pglTexSubImage1DEXT; -GLEE_EXTERN PFNGLTEXSUBIMAGE2DEXTPROC pglTexSubImage2DEXT; -#define glTexSubImage1DEXT pglTexSubImage1DEXT -#define glTexSubImage2DEXT pglTexSubImage2DEXT -#endif - -/* GL_EXT_copy_texture */ - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#define __GLEE_GL_EXT_copy_texture 1 -/* Constants */ -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLEE_EXTERN PFNGLCOPYTEXIMAGE1DEXTPROC pglCopyTexImage1DEXT; -GLEE_EXTERN PFNGLCOPYTEXIMAGE2DEXTPROC pglCopyTexImage2DEXT; -GLEE_EXTERN PFNGLCOPYTEXSUBIMAGE1DEXTPROC pglCopyTexSubImage1DEXT; -GLEE_EXTERN PFNGLCOPYTEXSUBIMAGE2DEXTPROC pglCopyTexSubImage2DEXT; -GLEE_EXTERN PFNGLCOPYTEXSUBIMAGE3DEXTPROC pglCopyTexSubImage3DEXT; -#define glCopyTexImage1DEXT pglCopyTexImage1DEXT -#define glCopyTexImage2DEXT pglCopyTexImage2DEXT -#define glCopyTexSubImage1DEXT pglCopyTexSubImage1DEXT -#define glCopyTexSubImage2DEXT pglCopyTexSubImage2DEXT -#define glCopyTexSubImage3DEXT pglCopyTexSubImage3DEXT -#endif - -/* GL_EXT_histogram */ - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#define __GLEE_GL_EXT_histogram 1 -/* Constants */ -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -GLEE_EXTERN PFNGLGETHISTOGRAMEXTPROC pglGetHistogramEXT; -GLEE_EXTERN PFNGLGETHISTOGRAMPARAMETERFVEXTPROC pglGetHistogramParameterfvEXT; -GLEE_EXTERN PFNGLGETHISTOGRAMPARAMETERIVEXTPROC pglGetHistogramParameterivEXT; -GLEE_EXTERN PFNGLGETMINMAXEXTPROC pglGetMinmaxEXT; -GLEE_EXTERN PFNGLGETMINMAXPARAMETERFVEXTPROC pglGetMinmaxParameterfvEXT; -GLEE_EXTERN PFNGLGETMINMAXPARAMETERIVEXTPROC pglGetMinmaxParameterivEXT; -GLEE_EXTERN PFNGLHISTOGRAMEXTPROC pglHistogramEXT; -GLEE_EXTERN PFNGLMINMAXEXTPROC pglMinmaxEXT; -GLEE_EXTERN PFNGLRESETHISTOGRAMEXTPROC pglResetHistogramEXT; -GLEE_EXTERN PFNGLRESETMINMAXEXTPROC pglResetMinmaxEXT; -#define glGetHistogramEXT pglGetHistogramEXT -#define glGetHistogramParameterfvEXT pglGetHistogramParameterfvEXT -#define glGetHistogramParameterivEXT pglGetHistogramParameterivEXT -#define glGetMinmaxEXT pglGetMinmaxEXT -#define glGetMinmaxParameterfvEXT pglGetMinmaxParameterfvEXT -#define glGetMinmaxParameterivEXT pglGetMinmaxParameterivEXT -#define glHistogramEXT pglHistogramEXT -#define glMinmaxEXT pglMinmaxEXT -#define glResetHistogramEXT pglResetHistogramEXT -#define glResetMinmaxEXT pglResetMinmaxEXT -#endif - -/* GL_EXT_convolution */ - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#define __GLEE_GL_EXT_convolution 1 -/* Constants */ -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid * image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); -GLEE_EXTERN PFNGLCONVOLUTIONFILTER1DEXTPROC pglConvolutionFilter1DEXT; -GLEE_EXTERN PFNGLCONVOLUTIONFILTER2DEXTPROC pglConvolutionFilter2DEXT; -GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERFEXTPROC pglConvolutionParameterfEXT; -GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERFVEXTPROC pglConvolutionParameterfvEXT; -GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERIEXTPROC pglConvolutionParameteriEXT; -GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERIVEXTPROC pglConvolutionParameterivEXT; -GLEE_EXTERN PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC pglCopyConvolutionFilter1DEXT; -GLEE_EXTERN PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC pglCopyConvolutionFilter2DEXT; -GLEE_EXTERN PFNGLGETCONVOLUTIONFILTEREXTPROC pglGetConvolutionFilterEXT; -GLEE_EXTERN PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC pglGetConvolutionParameterfvEXT; -GLEE_EXTERN PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC pglGetConvolutionParameterivEXT; -GLEE_EXTERN PFNGLGETSEPARABLEFILTEREXTPROC pglGetSeparableFilterEXT; -GLEE_EXTERN PFNGLSEPARABLEFILTER2DEXTPROC pglSeparableFilter2DEXT; -#define glConvolutionFilter1DEXT pglConvolutionFilter1DEXT -#define glConvolutionFilter2DEXT pglConvolutionFilter2DEXT -#define glConvolutionParameterfEXT pglConvolutionParameterfEXT -#define glConvolutionParameterfvEXT pglConvolutionParameterfvEXT -#define glConvolutionParameteriEXT pglConvolutionParameteriEXT -#define glConvolutionParameterivEXT pglConvolutionParameterivEXT -#define glCopyConvolutionFilter1DEXT pglCopyConvolutionFilter1DEXT -#define glCopyConvolutionFilter2DEXT pglCopyConvolutionFilter2DEXT -#define glGetConvolutionFilterEXT pglGetConvolutionFilterEXT -#define glGetConvolutionParameterfvEXT pglGetConvolutionParameterfvEXT -#define glGetConvolutionParameterivEXT pglGetConvolutionParameterivEXT -#define glGetSeparableFilterEXT pglGetSeparableFilterEXT -#define glSeparableFilter2DEXT pglSeparableFilter2DEXT -#endif - -/* GL_SGI_color_matrix */ - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -#define __GLEE_GL_SGI_color_matrix 1 -/* Constants */ -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -/* GL_SGI_color_table */ - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#define __GLEE_GL_SGI_color_table 1 -/* Constants */ -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid * table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint * params); -GLEE_EXTERN PFNGLCOLORTABLESGIPROC pglColorTableSGI; -GLEE_EXTERN PFNGLCOLORTABLEPARAMETERFVSGIPROC pglColorTableParameterfvSGI; -GLEE_EXTERN PFNGLCOLORTABLEPARAMETERIVSGIPROC pglColorTableParameterivSGI; -GLEE_EXTERN PFNGLCOPYCOLORTABLESGIPROC pglCopyColorTableSGI; -GLEE_EXTERN PFNGLGETCOLORTABLESGIPROC pglGetColorTableSGI; -GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERFVSGIPROC pglGetColorTableParameterfvSGI; -GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERIVSGIPROC pglGetColorTableParameterivSGI; -#define glColorTableSGI pglColorTableSGI -#define glColorTableParameterfvSGI pglColorTableParameterfvSGI -#define glColorTableParameterivSGI pglColorTableParameterivSGI -#define glCopyColorTableSGI pglCopyColorTableSGI -#define glGetColorTableSGI pglGetColorTableSGI -#define glGetColorTableParameterfvSGI pglGetColorTableParameterfvSGI -#define glGetColorTableParameterivSGI pglGetColorTableParameterivSGI -#endif - -/* GL_SGIS_pixel_texture */ - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#define __GLEE_GL_SGIS_pixel_texture 1 -/* Constants */ -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat * params); -GLEE_EXTERN PFNGLPIXELTEXGENPARAMETERISGISPROC pglPixelTexGenParameteriSGIS; -GLEE_EXTERN PFNGLPIXELTEXGENPARAMETERIVSGISPROC pglPixelTexGenParameterivSGIS; -GLEE_EXTERN PFNGLPIXELTEXGENPARAMETERFSGISPROC pglPixelTexGenParameterfSGIS; -GLEE_EXTERN PFNGLPIXELTEXGENPARAMETERFVSGISPROC pglPixelTexGenParameterfvSGIS; -GLEE_EXTERN PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC pglGetPixelTexGenParameterivSGIS; -GLEE_EXTERN PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC pglGetPixelTexGenParameterfvSGIS; -#define glPixelTexGenParameteriSGIS pglPixelTexGenParameteriSGIS -#define glPixelTexGenParameterivSGIS pglPixelTexGenParameterivSGIS -#define glPixelTexGenParameterfSGIS pglPixelTexGenParameterfSGIS -#define glPixelTexGenParameterfvSGIS pglPixelTexGenParameterfvSGIS -#define glGetPixelTexGenParameterivSGIS pglGetPixelTexGenParameterivSGIS -#define glGetPixelTexGenParameterfvSGIS pglGetPixelTexGenParameterfvSGIS -#endif - -/* GL_SGIX_pixel_texture */ - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#define __GLEE_GL_SGIX_pixel_texture 1 -/* Constants */ -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -GLEE_EXTERN PFNGLPIXELTEXGENSGIXPROC pglPixelTexGenSGIX; -#define glPixelTexGenSGIX pglPixelTexGenSGIX -#endif - -/* GL_SGIS_texture4D */ - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#define __GLEE_GL_SGIS_texture4D 1 -/* Constants */ -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid * pixels); -GLEE_EXTERN PFNGLTEXIMAGE4DSGISPROC pglTexImage4DSGIS; -GLEE_EXTERN PFNGLTEXSUBIMAGE4DSGISPROC pglTexSubImage4DSGIS; -#define glTexImage4DSGIS pglTexImage4DSGIS -#define glTexSubImage4DSGIS pglTexSubImage4DSGIS -#endif - -/* GL_SGI_texture_color_table */ - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#define __GLEE_GL_SGI_texture_color_table 1 -/* Constants */ -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -/* GL_EXT_cmyka */ - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#define __GLEE_GL_EXT_cmyka 1 -/* Constants */ -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -/* GL_EXT_texture_object */ - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#define __GLEE_GL_EXT_texture_object 1 -/* Constants */ -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint * textures, GLboolean * residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint * textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint * textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint * textures, const GLclampf * priorities); -GLEE_EXTERN PFNGLARETEXTURESRESIDENTEXTPROC pglAreTexturesResidentEXT; -GLEE_EXTERN PFNGLBINDTEXTUREEXTPROC pglBindTextureEXT; -GLEE_EXTERN PFNGLDELETETEXTURESEXTPROC pglDeleteTexturesEXT; -GLEE_EXTERN PFNGLGENTEXTURESEXTPROC pglGenTexturesEXT; -GLEE_EXTERN PFNGLISTEXTUREEXTPROC pglIsTextureEXT; -GLEE_EXTERN PFNGLPRIORITIZETEXTURESEXTPROC pglPrioritizeTexturesEXT; -#define glAreTexturesResidentEXT pglAreTexturesResidentEXT -#define glBindTextureEXT pglBindTextureEXT -#define glDeleteTexturesEXT pglDeleteTexturesEXT -#define glGenTexturesEXT pglGenTexturesEXT -#define glIsTextureEXT pglIsTextureEXT -#define glPrioritizeTexturesEXT pglPrioritizeTexturesEXT -#endif - -/* GL_SGIS_detail_texture */ - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#define __GLEE_GL_SGIS_detail_texture 1 -/* Constants */ -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat * points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat * points); -GLEE_EXTERN PFNGLDETAILTEXFUNCSGISPROC pglDetailTexFuncSGIS; -GLEE_EXTERN PFNGLGETDETAILTEXFUNCSGISPROC pglGetDetailTexFuncSGIS; -#define glDetailTexFuncSGIS pglDetailTexFuncSGIS -#define glGetDetailTexFuncSGIS pglGetDetailTexFuncSGIS -#endif - -/* GL_SGIS_sharpen_texture */ - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#define __GLEE_GL_SGIS_sharpen_texture 1 -/* Constants */ -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat * points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat * points); -GLEE_EXTERN PFNGLSHARPENTEXFUNCSGISPROC pglSharpenTexFuncSGIS; -GLEE_EXTERN PFNGLGETSHARPENTEXFUNCSGISPROC pglGetSharpenTexFuncSGIS; -#define glSharpenTexFuncSGIS pglSharpenTexFuncSGIS -#define glGetSharpenTexFuncSGIS pglGetSharpenTexFuncSGIS -#endif - -/* GL_EXT_packed_pixels */ - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#define __GLEE_GL_EXT_packed_pixels 1 -/* Constants */ -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -/* GL_SGIS_texture_lod */ - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#define __GLEE_GL_SGIS_texture_lod 1 -/* Constants */ -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -/* GL_SGIS_multisample */ - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#define __GLEE_GL_SGIS_multisample 1 -/* Constants */ -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -GLEE_EXTERN PFNGLSAMPLEMASKSGISPROC pglSampleMaskSGIS; -GLEE_EXTERN PFNGLSAMPLEPATTERNSGISPROC pglSamplePatternSGIS; -#define glSampleMaskSGIS pglSampleMaskSGIS -#define glSamplePatternSGIS pglSamplePatternSGIS -#endif - -/* GL_EXT_rescale_normal */ - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#define __GLEE_GL_EXT_rescale_normal 1 -/* Constants */ -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -/* GL_EXT_vertex_array */ - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#define __GLEE_GL_EXT_vertex_array 1 -/* Constants */ -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean * pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* * params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); -GLEE_EXTERN PFNGLARRAYELEMENTEXTPROC pglArrayElementEXT; -GLEE_EXTERN PFNGLCOLORPOINTEREXTPROC pglColorPointerEXT; -GLEE_EXTERN PFNGLDRAWARRAYSEXTPROC pglDrawArraysEXT; -GLEE_EXTERN PFNGLEDGEFLAGPOINTEREXTPROC pglEdgeFlagPointerEXT; -GLEE_EXTERN PFNGLGETPOINTERVEXTPROC pglGetPointervEXT; -GLEE_EXTERN PFNGLINDEXPOINTEREXTPROC pglIndexPointerEXT; -GLEE_EXTERN PFNGLNORMALPOINTEREXTPROC pglNormalPointerEXT; -GLEE_EXTERN PFNGLTEXCOORDPOINTEREXTPROC pglTexCoordPointerEXT; -GLEE_EXTERN PFNGLVERTEXPOINTEREXTPROC pglVertexPointerEXT; -#define glArrayElementEXT pglArrayElementEXT -#define glColorPointerEXT pglColorPointerEXT -#define glDrawArraysEXT pglDrawArraysEXT -#define glEdgeFlagPointerEXT pglEdgeFlagPointerEXT -#define glGetPointervEXT pglGetPointervEXT -#define glIndexPointerEXT pglIndexPointerEXT -#define glNormalPointerEXT pglNormalPointerEXT -#define glTexCoordPointerEXT pglTexCoordPointerEXT -#define glVertexPointerEXT pglVertexPointerEXT -#endif - -/* GL_EXT_misc_attribute */ - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#define __GLEE_GL_EXT_misc_attribute 1 -/* Constants */ -#endif - -/* GL_SGIS_generate_mipmap */ - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#define __GLEE_GL_SGIS_generate_mipmap 1 -/* Constants */ -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -/* GL_SGIX_clipmap */ - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#define __GLEE_GL_SGIX_clipmap 1 -/* Constants */ -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -/* GL_SGIX_shadow */ - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#define __GLEE_GL_SGIX_shadow 1 -/* Constants */ -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -/* GL_SGIS_texture_edge_clamp */ - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#define __GLEE_GL_SGIS_texture_edge_clamp 1 -/* Constants */ -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -/* GL_SGIS_texture_border_clamp */ - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#define __GLEE_GL_SGIS_texture_border_clamp 1 -/* Constants */ -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -/* GL_EXT_blend_minmax */ - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#define __GLEE_GL_EXT_blend_minmax 1 -/* Constants */ -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -GLEE_EXTERN PFNGLBLENDEQUATIONEXTPROC pglBlendEquationEXT; -#define glBlendEquationEXT pglBlendEquationEXT -#endif - -/* GL_EXT_blend_subtract */ - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#define __GLEE_GL_EXT_blend_subtract 1 -/* Constants */ -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -/* GL_EXT_blend_logic_op */ - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#define __GLEE_GL_EXT_blend_logic_op 1 -/* Constants */ -#endif - -/* GL_SGIX_interlace */ - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#define __GLEE_GL_SGIX_interlace 1 -/* Constants */ -#define GL_INTERLACE_SGIX 0x8094 -#endif - -/* GL_SGIX_pixel_tiles */ - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#define __GLEE_GL_SGIX_pixel_tiles 1 -/* Constants */ -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -/* GL_SGIS_texture_select */ - -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 -#define __GLEE_GL_SGIS_texture_select 1 -/* Constants */ -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -/* GL_SGIX_sprite */ - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#define __GLEE_GL_SGIX_sprite 1 -/* Constants */ -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint * params); -GLEE_EXTERN PFNGLSPRITEPARAMETERFSGIXPROC pglSpriteParameterfSGIX; -GLEE_EXTERN PFNGLSPRITEPARAMETERFVSGIXPROC pglSpriteParameterfvSGIX; -GLEE_EXTERN PFNGLSPRITEPARAMETERISGIXPROC pglSpriteParameteriSGIX; -GLEE_EXTERN PFNGLSPRITEPARAMETERIVSGIXPROC pglSpriteParameterivSGIX; -#define glSpriteParameterfSGIX pglSpriteParameterfSGIX -#define glSpriteParameterfvSGIX pglSpriteParameterfvSGIX -#define glSpriteParameteriSGIX pglSpriteParameteriSGIX -#define glSpriteParameterivSGIX pglSpriteParameterivSGIX -#endif - -/* GL_SGIX_texture_multi_buffer */ - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#define __GLEE_GL_SGIX_texture_multi_buffer 1 -/* Constants */ -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -/* GL_EXT_point_parameters */ - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#define __GLEE_GL_EXT_point_parameters 1 -/* Constants */ -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat * params); -GLEE_EXTERN PFNGLPOINTPARAMETERFEXTPROC pglPointParameterfEXT; -GLEE_EXTERN PFNGLPOINTPARAMETERFVEXTPROC pglPointParameterfvEXT; -#define glPointParameterfEXT pglPointParameterfEXT -#define glPointParameterfvEXT pglPointParameterfvEXT -#endif - -/* GL_SGIS_point_parameters */ - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#define __GLEE_GL_SGIS_point_parameters 1 -/* Constants */ -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat * params); -GLEE_EXTERN PFNGLPOINTPARAMETERFSGISPROC pglPointParameterfSGIS; -GLEE_EXTERN PFNGLPOINTPARAMETERFVSGISPROC pglPointParameterfvSGIS; -#define glPointParameterfSGIS pglPointParameterfSGIS -#define glPointParameterfvSGIS pglPointParameterfvSGIS -#endif - -/* GL_SGIX_instruments */ - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#define __GLEE_GL_SGIX_instruments 1 -/* Constants */ -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint * buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint * marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -GLEE_EXTERN PFNGLGETINSTRUMENTSSGIXPROC pglGetInstrumentsSGIX; -GLEE_EXTERN PFNGLINSTRUMENTSBUFFERSGIXPROC pglInstrumentsBufferSGIX; -GLEE_EXTERN PFNGLPOLLINSTRUMENTSSGIXPROC pglPollInstrumentsSGIX; -GLEE_EXTERN PFNGLREADINSTRUMENTSSGIXPROC pglReadInstrumentsSGIX; -GLEE_EXTERN PFNGLSTARTINSTRUMENTSSGIXPROC pglStartInstrumentsSGIX; -GLEE_EXTERN PFNGLSTOPINSTRUMENTSSGIXPROC pglStopInstrumentsSGIX; -#define glGetInstrumentsSGIX pglGetInstrumentsSGIX -#define glInstrumentsBufferSGIX pglInstrumentsBufferSGIX -#define glPollInstrumentsSGIX pglPollInstrumentsSGIX -#define glReadInstrumentsSGIX pglReadInstrumentsSGIX -#define glStartInstrumentsSGIX pglStartInstrumentsSGIX -#define glStopInstrumentsSGIX pglStopInstrumentsSGIX -#endif - -/* GL_SGIX_texture_scale_bias */ - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#define __GLEE_GL_SGIX_texture_scale_bias 1 -/* Constants */ -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -/* GL_SGIX_framezoom */ - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#define __GLEE_GL_SGIX_framezoom 1 -/* Constants */ -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -GLEE_EXTERN PFNGLFRAMEZOOMSGIXPROC pglFrameZoomSGIX; -#define glFrameZoomSGIX pglFrameZoomSGIX -#endif - -/* GL_SGIX_tag_sample_buffer */ - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -#define __GLEE_GL_SGIX_tag_sample_buffer 1 -/* Constants */ -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (); -GLEE_EXTERN PFNGLTAGSAMPLEBUFFERSGIXPROC pglTagSampleBufferSGIX; -#define glTagSampleBufferSGIX pglTagSampleBufferSGIX -#endif - -/* GL_FfdMaskSGIX */ - -#ifndef GL_FfdMaskSGIX -#define GL_FfdMaskSGIX 1 -#define __GLEE_GL_FfdMaskSGIX 1 -/* Constants */ -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -/* GL_SGIX_polynomial_ffd */ - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#define __GLEE_GL_SGIX_polynomial_ffd 1 -/* Constants */ -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble * points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat * points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -GLEE_EXTERN PFNGLDEFORMATIONMAP3DSGIXPROC pglDeformationMap3dSGIX; -GLEE_EXTERN PFNGLDEFORMATIONMAP3FSGIXPROC pglDeformationMap3fSGIX; -GLEE_EXTERN PFNGLDEFORMSGIXPROC pglDeformSGIX; -GLEE_EXTERN PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC pglLoadIdentityDeformationMapSGIX; -#define glDeformationMap3dSGIX pglDeformationMap3dSGIX -#define glDeformationMap3fSGIX pglDeformationMap3fSGIX -#define glDeformSGIX pglDeformSGIX -#define glLoadIdentityDeformationMapSGIX pglLoadIdentityDeformationMapSGIX -#endif - -/* GL_SGIX_reference_plane */ - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#define __GLEE_GL_SGIX_reference_plane 1 -/* Constants */ -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble * equation); -GLEE_EXTERN PFNGLREFERENCEPLANESGIXPROC pglReferencePlaneSGIX; -#define glReferencePlaneSGIX pglReferencePlaneSGIX -#endif - -/* GL_SGIX_flush_raster */ - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#define __GLEE_GL_SGIX_flush_raster 1 -/* Constants */ -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (); -GLEE_EXTERN PFNGLFLUSHRASTERSGIXPROC pglFlushRasterSGIX; -#define glFlushRasterSGIX pglFlushRasterSGIX -#endif - -/* GL_SGIX_depth_texture */ - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#define __GLEE_GL_SGIX_depth_texture 1 -/* Constants */ -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -/* GL_SGIS_fog_function */ - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#define __GLEE_GL_SGIS_fog_function 1 -/* Constants */ -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat * points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat * points); -GLEE_EXTERN PFNGLFOGFUNCSGISPROC pglFogFuncSGIS; -GLEE_EXTERN PFNGLGETFOGFUNCSGISPROC pglGetFogFuncSGIS; -#define glFogFuncSGIS pglFogFuncSGIS -#define glGetFogFuncSGIS pglGetFogFuncSGIS -#endif - -/* GL_SGIX_fog_offset */ - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#define __GLEE_GL_SGIX_fog_offset 1 -/* Constants */ -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -/* GL_HP_image_transform */ - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#define __GLEE_GL_HP_image_transform 1 -/* Constants */ -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat * params); -GLEE_EXTERN PFNGLIMAGETRANSFORMPARAMETERIHPPROC pglImageTransformParameteriHP; -GLEE_EXTERN PFNGLIMAGETRANSFORMPARAMETERFHPPROC pglImageTransformParameterfHP; -GLEE_EXTERN PFNGLIMAGETRANSFORMPARAMETERIVHPPROC pglImageTransformParameterivHP; -GLEE_EXTERN PFNGLIMAGETRANSFORMPARAMETERFVHPPROC pglImageTransformParameterfvHP; -GLEE_EXTERN PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC pglGetImageTransformParameterivHP; -GLEE_EXTERN PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC pglGetImageTransformParameterfvHP; -#define glImageTransformParameteriHP pglImageTransformParameteriHP -#define glImageTransformParameterfHP pglImageTransformParameterfHP -#define glImageTransformParameterivHP pglImageTransformParameterivHP -#define glImageTransformParameterfvHP pglImageTransformParameterfvHP -#define glGetImageTransformParameterivHP pglGetImageTransformParameterivHP -#define glGetImageTransformParameterfvHP pglGetImageTransformParameterfvHP -#endif - -/* GL_HP_convolution_border_modes */ - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#define __GLEE_GL_HP_convolution_border_modes 1 -/* Constants */ -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -/* GL_INGR_palette_buffer */ - -#ifndef GL_INGR_palette_buffer -#define GL_INGR_palette_buffer 1 -#define __GLEE_GL_INGR_palette_buffer 1 -/* Constants */ -#endif - -/* GL_SGIX_texture_add_env */ - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#define __GLEE_GL_SGIX_texture_add_env 1 -/* Constants */ -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -/* GL_EXT_color_subtable */ - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#define __GLEE_GL_EXT_color_subtable 1 -/* Constants */ -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLEE_EXTERN PFNGLCOLORSUBTABLEEXTPROC pglColorSubTableEXT; -GLEE_EXTERN PFNGLCOPYCOLORSUBTABLEEXTPROC pglCopyColorSubTableEXT; -#define glColorSubTableEXT pglColorSubTableEXT -#define glCopyColorSubTableEXT pglCopyColorSubTableEXT -#endif - -/* GL_PGI_vertex_hints */ - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#define __GLEE_GL_PGI_vertex_hints 1 -/* Constants */ -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -/* GL_PGI_misc_hints */ - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#define __GLEE_GL_PGI_misc_hints 1 -/* Constants */ -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -GLEE_EXTERN PFNGLHINTPGIPROC pglHintPGI; -#define glHintPGI pglHintPGI -#endif - -/* GL_EXT_paletted_texture */ - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#define __GLEE_GL_EXT_paletted_texture 1 -/* Constants */ -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid * data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat * params); -GLEE_EXTERN PFNGLCOLORTABLEEXTPROC pglColorTableEXT; -GLEE_EXTERN PFNGLGETCOLORTABLEEXTPROC pglGetColorTableEXT; -GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERIVEXTPROC pglGetColorTableParameterivEXT; -GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERFVEXTPROC pglGetColorTableParameterfvEXT; -#define glColorTableEXT pglColorTableEXT -#define glGetColorTableEXT pglGetColorTableEXT -#define glGetColorTableParameterivEXT pglGetColorTableParameterivEXT -#define glGetColorTableParameterfvEXT pglGetColorTableParameterfvEXT -#endif - -/* GL_EXT_clip_volume_hint */ - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#define __GLEE_GL_EXT_clip_volume_hint 1 -/* Constants */ -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -/* GL_SGIX_list_priority */ - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#define __GLEE_GL_SGIX_list_priority 1 -/* Constants */ -#define GL_LIST_PRIORITY_SGIX 0x8182 -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint * params); -GLEE_EXTERN PFNGLGETLISTPARAMETERFVSGIXPROC pglGetListParameterfvSGIX; -GLEE_EXTERN PFNGLGETLISTPARAMETERIVSGIXPROC pglGetListParameterivSGIX; -GLEE_EXTERN PFNGLLISTPARAMETERFSGIXPROC pglListParameterfSGIX; -GLEE_EXTERN PFNGLLISTPARAMETERFVSGIXPROC pglListParameterfvSGIX; -GLEE_EXTERN PFNGLLISTPARAMETERISGIXPROC pglListParameteriSGIX; -GLEE_EXTERN PFNGLLISTPARAMETERIVSGIXPROC pglListParameterivSGIX; -#define glGetListParameterfvSGIX pglGetListParameterfvSGIX -#define glGetListParameterivSGIX pglGetListParameterivSGIX -#define glListParameterfSGIX pglListParameterfSGIX -#define glListParameterfvSGIX pglListParameterfvSGIX -#define glListParameteriSGIX pglListParameteriSGIX -#define glListParameterivSGIX pglListParameterivSGIX -#endif - -/* GL_SGIX_ir_instrument1 */ - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#define __GLEE_GL_SGIX_ir_instrument1 1 -/* Constants */ -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -/* GL_SGIX_calligraphic_fragment */ - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#define __GLEE_GL_SGIX_calligraphic_fragment 1 -/* Constants */ -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -/* GL_SGIX_texture_lod_bias */ - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#define __GLEE_GL_SGIX_texture_lod_bias 1 -/* Constants */ -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -/* GL_SGIX_shadow_ambient */ - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#define __GLEE_GL_SGIX_shadow_ambient 1 -/* Constants */ -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -/* GL_EXT_index_texture */ - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#define __GLEE_GL_EXT_index_texture 1 -/* Constants */ -#endif - -/* GL_EXT_index_material */ - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#define __GLEE_GL_EXT_index_material 1 -/* Constants */ -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -GLEE_EXTERN PFNGLINDEXMATERIALEXTPROC pglIndexMaterialEXT; -#define glIndexMaterialEXT pglIndexMaterialEXT -#endif - -/* GL_EXT_index_func */ - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#define __GLEE_GL_EXT_index_func 1 -/* Constants */ -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -GLEE_EXTERN PFNGLINDEXFUNCEXTPROC pglIndexFuncEXT; -#define glIndexFuncEXT pglIndexFuncEXT -#endif - -/* GL_EXT_index_array_formats */ - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#define __GLEE_GL_EXT_index_array_formats 1 -/* Constants */ -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -/* GL_EXT_compiled_vertex_array */ - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#define __GLEE_GL_EXT_compiled_vertex_array 1 -/* Constants */ -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (); -GLEE_EXTERN PFNGLLOCKARRAYSEXTPROC pglLockArraysEXT; -GLEE_EXTERN PFNGLUNLOCKARRAYSEXTPROC pglUnlockArraysEXT; -#define glLockArraysEXT pglLockArraysEXT -#define glUnlockArraysEXT pglUnlockArraysEXT -#endif - -/* GL_EXT_cull_vertex */ - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#define __GLEE_GL_EXT_cull_vertex 1 -/* Constants */ -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble * params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat * params); -GLEE_EXTERN PFNGLCULLPARAMETERDVEXTPROC pglCullParameterdvEXT; -GLEE_EXTERN PFNGLCULLPARAMETERFVEXTPROC pglCullParameterfvEXT; -#define glCullParameterdvEXT pglCullParameterdvEXT -#define glCullParameterfvEXT pglCullParameterfvEXT -#endif - -/* GL_SGIX_ycrcb */ - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#define __GLEE_GL_SGIX_ycrcb 1 -/* Constants */ -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -/* GL_SGIX_fragment_lighting */ - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#define __GLEE_GL_SGIX_fragment_lighting 1 -/* Constants */ -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -GLEE_EXTERN PFNGLFRAGMENTCOLORMATERIALSGIXPROC pglFragmentColorMaterialSGIX; -GLEE_EXTERN PFNGLFRAGMENTLIGHTFSGIXPROC pglFragmentLightfSGIX; -GLEE_EXTERN PFNGLFRAGMENTLIGHTFVSGIXPROC pglFragmentLightfvSGIX; -GLEE_EXTERN PFNGLFRAGMENTLIGHTISGIXPROC pglFragmentLightiSGIX; -GLEE_EXTERN PFNGLFRAGMENTLIGHTIVSGIXPROC pglFragmentLightivSGIX; -GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELFSGIXPROC pglFragmentLightModelfSGIX; -GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELFVSGIXPROC pglFragmentLightModelfvSGIX; -GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELISGIXPROC pglFragmentLightModeliSGIX; -GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELIVSGIXPROC pglFragmentLightModelivSGIX; -GLEE_EXTERN PFNGLFRAGMENTMATERIALFSGIXPROC pglFragmentMaterialfSGIX; -GLEE_EXTERN PFNGLFRAGMENTMATERIALFVSGIXPROC pglFragmentMaterialfvSGIX; -GLEE_EXTERN PFNGLFRAGMENTMATERIALISGIXPROC pglFragmentMaterialiSGIX; -GLEE_EXTERN PFNGLFRAGMENTMATERIALIVSGIXPROC pglFragmentMaterialivSGIX; -GLEE_EXTERN PFNGLGETFRAGMENTLIGHTFVSGIXPROC pglGetFragmentLightfvSGIX; -GLEE_EXTERN PFNGLGETFRAGMENTLIGHTIVSGIXPROC pglGetFragmentLightivSGIX; -GLEE_EXTERN PFNGLGETFRAGMENTMATERIALFVSGIXPROC pglGetFragmentMaterialfvSGIX; -GLEE_EXTERN PFNGLGETFRAGMENTMATERIALIVSGIXPROC pglGetFragmentMaterialivSGIX; -GLEE_EXTERN PFNGLLIGHTENVISGIXPROC pglLightEnviSGIX; -#define glFragmentColorMaterialSGIX pglFragmentColorMaterialSGIX -#define glFragmentLightfSGIX pglFragmentLightfSGIX -#define glFragmentLightfvSGIX pglFragmentLightfvSGIX -#define glFragmentLightiSGIX pglFragmentLightiSGIX -#define glFragmentLightivSGIX pglFragmentLightivSGIX -#define glFragmentLightModelfSGIX pglFragmentLightModelfSGIX -#define glFragmentLightModelfvSGIX pglFragmentLightModelfvSGIX -#define glFragmentLightModeliSGIX pglFragmentLightModeliSGIX -#define glFragmentLightModelivSGIX pglFragmentLightModelivSGIX -#define glFragmentMaterialfSGIX pglFragmentMaterialfSGIX -#define glFragmentMaterialfvSGIX pglFragmentMaterialfvSGIX -#define glFragmentMaterialiSGIX pglFragmentMaterialiSGIX -#define glFragmentMaterialivSGIX pglFragmentMaterialivSGIX -#define glGetFragmentLightfvSGIX pglGetFragmentLightfvSGIX -#define glGetFragmentLightivSGIX pglGetFragmentLightivSGIX -#define glGetFragmentMaterialfvSGIX pglGetFragmentMaterialfvSGIX -#define glGetFragmentMaterialivSGIX pglGetFragmentMaterialivSGIX -#define glLightEnviSGIX pglLightEnviSGIX -#endif - -/* GL_IBM_rasterpos_clip */ - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#define __GLEE_GL_IBM_rasterpos_clip 1 -/* Constants */ -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -/* GL_HP_texture_lighting */ - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#define __GLEE_GL_HP_texture_lighting 1 -/* Constants */ -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -/* GL_EXT_draw_range_elements */ - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#define __GLEE_GL_EXT_draw_range_elements 1 -/* Constants */ -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); -GLEE_EXTERN PFNGLDRAWRANGEELEMENTSEXTPROC pglDrawRangeElementsEXT; -#define glDrawRangeElementsEXT pglDrawRangeElementsEXT -#endif - -/* GL_WIN_phong_shading */ - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#define __GLEE_GL_WIN_phong_shading 1 -/* Constants */ -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -/* GL_WIN_specular_fog */ - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#define __GLEE_GL_WIN_specular_fog 1 -/* Constants */ -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -/* GL_EXT_light_texture */ - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#define __GLEE_GL_EXT_light_texture 1 -/* Constants */ -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -GLEE_EXTERN PFNGLAPPLYTEXTUREEXTPROC pglApplyTextureEXT; -GLEE_EXTERN PFNGLTEXTURELIGHTEXTPROC pglTextureLightEXT; -GLEE_EXTERN PFNGLTEXTUREMATERIALEXTPROC pglTextureMaterialEXT; -#define glApplyTextureEXT pglApplyTextureEXT -#define glTextureLightEXT pglTextureLightEXT -#define glTextureMaterialEXT pglTextureMaterialEXT -#endif - -/* GL_SGIX_blend_alpha_minmax */ - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#define __GLEE_GL_SGIX_blend_alpha_minmax 1 -/* Constants */ -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -/* GL_SGIX_impact_pixel_texture */ - -#ifndef GL_SGIX_impact_pixel_texture -#define GL_SGIX_impact_pixel_texture 1 -#define __GLEE_GL_SGIX_impact_pixel_texture 1 -/* Constants */ -#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 -#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 -#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 -#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 -#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 -#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 -#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A -#endif - -/* GL_EXT_bgra */ - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#define __GLEE_GL_EXT_bgra 1 -/* Constants */ -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -/* GL_SGIX_async */ - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#define __GLEE_GL_SGIX_async 1 -/* Constants */ -#define GL_ASYNC_MARKER_SGIX 0x8329 -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint * markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint * markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -GLEE_EXTERN PFNGLASYNCMARKERSGIXPROC pglAsyncMarkerSGIX; -GLEE_EXTERN PFNGLFINISHASYNCSGIXPROC pglFinishAsyncSGIX; -GLEE_EXTERN PFNGLPOLLASYNCSGIXPROC pglPollAsyncSGIX; -GLEE_EXTERN PFNGLGENASYNCMARKERSSGIXPROC pglGenAsyncMarkersSGIX; -GLEE_EXTERN PFNGLDELETEASYNCMARKERSSGIXPROC pglDeleteAsyncMarkersSGIX; -GLEE_EXTERN PFNGLISASYNCMARKERSGIXPROC pglIsAsyncMarkerSGIX; -#define glAsyncMarkerSGIX pglAsyncMarkerSGIX -#define glFinishAsyncSGIX pglFinishAsyncSGIX -#define glPollAsyncSGIX pglPollAsyncSGIX -#define glGenAsyncMarkersSGIX pglGenAsyncMarkersSGIX -#define glDeleteAsyncMarkersSGIX pglDeleteAsyncMarkersSGIX -#define glIsAsyncMarkerSGIX pglIsAsyncMarkerSGIX -#endif - -/* GL_SGIX_async_pixel */ - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#define __GLEE_GL_SGIX_async_pixel 1 -/* Constants */ -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -/* GL_SGIX_async_histogram */ - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#define __GLEE_GL_SGIX_async_histogram 1 -/* Constants */ -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -/* GL_INTEL_texture_scissor */ - -#ifndef GL_INTEL_texture_scissor -#define GL_INTEL_texture_scissor 1 -#define __GLEE_GL_INTEL_texture_scissor 1 -/* Constants */ -#endif - -/* GL_INTEL_parallel_arrays */ - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#define __GLEE_GL_INTEL_parallel_arrays 1 -/* Constants */ -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* * pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* * pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* * pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* * pointer); -GLEE_EXTERN PFNGLVERTEXPOINTERVINTELPROC pglVertexPointervINTEL; -GLEE_EXTERN PFNGLNORMALPOINTERVINTELPROC pglNormalPointervINTEL; -GLEE_EXTERN PFNGLCOLORPOINTERVINTELPROC pglColorPointervINTEL; -GLEE_EXTERN PFNGLTEXCOORDPOINTERVINTELPROC pglTexCoordPointervINTEL; -#define glVertexPointervINTEL pglVertexPointervINTEL -#define glNormalPointervINTEL pglNormalPointervINTEL -#define glColorPointervINTEL pglColorPointervINTEL -#define glTexCoordPointervINTEL pglTexCoordPointervINTEL -#endif - -/* GL_HP_occlusion_test */ - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#define __GLEE_GL_HP_occlusion_test 1 -/* Constants */ -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -/* GL_EXT_pixel_transform */ - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#define __GLEE_GL_EXT_pixel_transform 1 -/* Constants */ -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat * params); -GLEE_EXTERN PFNGLPIXELTRANSFORMPARAMETERIEXTPROC pglPixelTransformParameteriEXT; -GLEE_EXTERN PFNGLPIXELTRANSFORMPARAMETERFEXTPROC pglPixelTransformParameterfEXT; -GLEE_EXTERN PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC pglPixelTransformParameterivEXT; -GLEE_EXTERN PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC pglPixelTransformParameterfvEXT; -#define glPixelTransformParameteriEXT pglPixelTransformParameteriEXT -#define glPixelTransformParameterfEXT pglPixelTransformParameterfEXT -#define glPixelTransformParameterivEXT pglPixelTransformParameterivEXT -#define glPixelTransformParameterfvEXT pglPixelTransformParameterfvEXT -#endif - -/* GL_EXT_pixel_transform_color_table */ - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#define __GLEE_GL_EXT_pixel_transform_color_table 1 -/* Constants */ -#endif - -/* GL_EXT_shared_texture_palette */ - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#define __GLEE_GL_EXT_shared_texture_palette 1 -/* Constants */ -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -/* GL_EXT_separate_specular_color */ - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#define __GLEE_GL_EXT_separate_specular_color 1 -/* Constants */ -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -/* GL_EXT_secondary_color */ - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#define __GLEE_GL_EXT_secondary_color 1 -/* Constants */ -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort * v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); -GLEE_EXTERN PFNGLSECONDARYCOLOR3BEXTPROC pglSecondaryColor3bEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3BVEXTPROC pglSecondaryColor3bvEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3DEXTPROC pglSecondaryColor3dEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3DVEXTPROC pglSecondaryColor3dvEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3FEXTPROC pglSecondaryColor3fEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3FVEXTPROC pglSecondaryColor3fvEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3IEXTPROC pglSecondaryColor3iEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3IVEXTPROC pglSecondaryColor3ivEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3SEXTPROC pglSecondaryColor3sEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3SVEXTPROC pglSecondaryColor3svEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3UBEXTPROC pglSecondaryColor3ubEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3UBVEXTPROC pglSecondaryColor3ubvEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3UIEXTPROC pglSecondaryColor3uiEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3UIVEXTPROC pglSecondaryColor3uivEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3USEXTPROC pglSecondaryColor3usEXT; -GLEE_EXTERN PFNGLSECONDARYCOLOR3USVEXTPROC pglSecondaryColor3usvEXT; -GLEE_EXTERN PFNGLSECONDARYCOLORPOINTEREXTPROC pglSecondaryColorPointerEXT; -#define glSecondaryColor3bEXT pglSecondaryColor3bEXT -#define glSecondaryColor3bvEXT pglSecondaryColor3bvEXT -#define glSecondaryColor3dEXT pglSecondaryColor3dEXT -#define glSecondaryColor3dvEXT pglSecondaryColor3dvEXT -#define glSecondaryColor3fEXT pglSecondaryColor3fEXT -#define glSecondaryColor3fvEXT pglSecondaryColor3fvEXT -#define glSecondaryColor3iEXT pglSecondaryColor3iEXT -#define glSecondaryColor3ivEXT pglSecondaryColor3ivEXT -#define glSecondaryColor3sEXT pglSecondaryColor3sEXT -#define glSecondaryColor3svEXT pglSecondaryColor3svEXT -#define glSecondaryColor3ubEXT pglSecondaryColor3ubEXT -#define glSecondaryColor3ubvEXT pglSecondaryColor3ubvEXT -#define glSecondaryColor3uiEXT pglSecondaryColor3uiEXT -#define glSecondaryColor3uivEXT pglSecondaryColor3uivEXT -#define glSecondaryColor3usEXT pglSecondaryColor3usEXT -#define glSecondaryColor3usvEXT pglSecondaryColor3usvEXT -#define glSecondaryColorPointerEXT pglSecondaryColorPointerEXT -#endif - -/* GL_EXT_texture_perturb_normal */ - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#define __GLEE_GL_EXT_texture_perturb_normal 1 -/* Constants */ -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -GLEE_EXTERN PFNGLTEXTURENORMALEXTPROC pglTextureNormalEXT; -#define glTextureNormalEXT pglTextureNormalEXT -#endif - -/* GL_EXT_multi_draw_arrays */ - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#define __GLEE_GL_EXT_multi_draw_arrays 1 -/* Constants */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei * count, GLenum type, const GLvoid* * indices, GLsizei primcount); -GLEE_EXTERN PFNGLMULTIDRAWARRAYSEXTPROC pglMultiDrawArraysEXT; -GLEE_EXTERN PFNGLMULTIDRAWELEMENTSEXTPROC pglMultiDrawElementsEXT; -#define glMultiDrawArraysEXT pglMultiDrawArraysEXT -#define glMultiDrawElementsEXT pglMultiDrawElementsEXT -#endif - -/* GL_EXT_fog_coord */ - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#define __GLEE_GL_EXT_fog_coord 1 -/* Constants */ -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat * coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble * coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); -GLEE_EXTERN PFNGLFOGCOORDFEXTPROC pglFogCoordfEXT; -GLEE_EXTERN PFNGLFOGCOORDFVEXTPROC pglFogCoordfvEXT; -GLEE_EXTERN PFNGLFOGCOORDDEXTPROC pglFogCoorddEXT; -GLEE_EXTERN PFNGLFOGCOORDDVEXTPROC pglFogCoorddvEXT; -GLEE_EXTERN PFNGLFOGCOORDPOINTEREXTPROC pglFogCoordPointerEXT; -#define glFogCoordfEXT pglFogCoordfEXT -#define glFogCoordfvEXT pglFogCoordfvEXT -#define glFogCoorddEXT pglFogCoorddEXT -#define glFogCoorddvEXT pglFogCoorddvEXT -#define glFogCoordPointerEXT pglFogCoordPointerEXT -#endif - -/* GL_REND_screen_coordinates */ - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#define __GLEE_GL_REND_screen_coordinates 1 -/* Constants */ -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -/* GL_EXT_coordinate_frame */ - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#define __GLEE_GL_EXT_coordinate_frame 1 -/* Constants */ -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte * v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort * v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte * v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort * v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); -GLEE_EXTERN PFNGLTANGENT3BEXTPROC pglTangent3bEXT; -GLEE_EXTERN PFNGLTANGENT3BVEXTPROC pglTangent3bvEXT; -GLEE_EXTERN PFNGLTANGENT3DEXTPROC pglTangent3dEXT; -GLEE_EXTERN PFNGLTANGENT3DVEXTPROC pglTangent3dvEXT; -GLEE_EXTERN PFNGLTANGENT3FEXTPROC pglTangent3fEXT; -GLEE_EXTERN PFNGLTANGENT3FVEXTPROC pglTangent3fvEXT; -GLEE_EXTERN PFNGLTANGENT3IEXTPROC pglTangent3iEXT; -GLEE_EXTERN PFNGLTANGENT3IVEXTPROC pglTangent3ivEXT; -GLEE_EXTERN PFNGLTANGENT3SEXTPROC pglTangent3sEXT; -GLEE_EXTERN PFNGLTANGENT3SVEXTPROC pglTangent3svEXT; -GLEE_EXTERN PFNGLBINORMAL3BEXTPROC pglBinormal3bEXT; -GLEE_EXTERN PFNGLBINORMAL3BVEXTPROC pglBinormal3bvEXT; -GLEE_EXTERN PFNGLBINORMAL3DEXTPROC pglBinormal3dEXT; -GLEE_EXTERN PFNGLBINORMAL3DVEXTPROC pglBinormal3dvEXT; -GLEE_EXTERN PFNGLBINORMAL3FEXTPROC pglBinormal3fEXT; -GLEE_EXTERN PFNGLBINORMAL3FVEXTPROC pglBinormal3fvEXT; -GLEE_EXTERN PFNGLBINORMAL3IEXTPROC pglBinormal3iEXT; -GLEE_EXTERN PFNGLBINORMAL3IVEXTPROC pglBinormal3ivEXT; -GLEE_EXTERN PFNGLBINORMAL3SEXTPROC pglBinormal3sEXT; -GLEE_EXTERN PFNGLBINORMAL3SVEXTPROC pglBinormal3svEXT; -GLEE_EXTERN PFNGLTANGENTPOINTEREXTPROC pglTangentPointerEXT; -GLEE_EXTERN PFNGLBINORMALPOINTEREXTPROC pglBinormalPointerEXT; -#define glTangent3bEXT pglTangent3bEXT -#define glTangent3bvEXT pglTangent3bvEXT -#define glTangent3dEXT pglTangent3dEXT -#define glTangent3dvEXT pglTangent3dvEXT -#define glTangent3fEXT pglTangent3fEXT -#define glTangent3fvEXT pglTangent3fvEXT -#define glTangent3iEXT pglTangent3iEXT -#define glTangent3ivEXT pglTangent3ivEXT -#define glTangent3sEXT pglTangent3sEXT -#define glTangent3svEXT pglTangent3svEXT -#define glBinormal3bEXT pglBinormal3bEXT -#define glBinormal3bvEXT pglBinormal3bvEXT -#define glBinormal3dEXT pglBinormal3dEXT -#define glBinormal3dvEXT pglBinormal3dvEXT -#define glBinormal3fEXT pglBinormal3fEXT -#define glBinormal3fvEXT pglBinormal3fvEXT -#define glBinormal3iEXT pglBinormal3iEXT -#define glBinormal3ivEXT pglBinormal3ivEXT -#define glBinormal3sEXT pglBinormal3sEXT -#define glBinormal3svEXT pglBinormal3svEXT -#define glTangentPointerEXT pglTangentPointerEXT -#define glBinormalPointerEXT pglBinormalPointerEXT -#endif - -/* GL_EXT_texture_env_combine */ - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#define __GLEE_GL_EXT_texture_env_combine 1 -/* Constants */ -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif - -/* GL_APPLE_specular_vector */ - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#define __GLEE_GL_APPLE_specular_vector 1 -/* Constants */ -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -/* GL_APPLE_transform_hint */ - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#define __GLEE_GL_APPLE_transform_hint 1 -/* Constants */ -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -/* GL_SGIX_fog_scale */ - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#define __GLEE_GL_SGIX_fog_scale 1 -/* Constants */ -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -/* GL_SUNX_constant_data */ - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#define __GLEE_GL_SUNX_constant_data 1 -/* Constants */ -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (); -GLEE_EXTERN PFNGLFINISHTEXTURESUNXPROC pglFinishTextureSUNX; -#define glFinishTextureSUNX pglFinishTextureSUNX -#endif - -/* GL_SUN_global_alpha */ - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#define __GLEE_GL_SUN_global_alpha 1 -/* Constants */ -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -GLEE_EXTERN PFNGLGLOBALALPHAFACTORBSUNPROC pglGlobalAlphaFactorbSUN; -GLEE_EXTERN PFNGLGLOBALALPHAFACTORSSUNPROC pglGlobalAlphaFactorsSUN; -GLEE_EXTERN PFNGLGLOBALALPHAFACTORISUNPROC pglGlobalAlphaFactoriSUN; -GLEE_EXTERN PFNGLGLOBALALPHAFACTORFSUNPROC pglGlobalAlphaFactorfSUN; -GLEE_EXTERN PFNGLGLOBALALPHAFACTORDSUNPROC pglGlobalAlphaFactordSUN; -GLEE_EXTERN PFNGLGLOBALALPHAFACTORUBSUNPROC pglGlobalAlphaFactorubSUN; -GLEE_EXTERN PFNGLGLOBALALPHAFACTORUSSUNPROC pglGlobalAlphaFactorusSUN; -GLEE_EXTERN PFNGLGLOBALALPHAFACTORUISUNPROC pglGlobalAlphaFactoruiSUN; -#define glGlobalAlphaFactorbSUN pglGlobalAlphaFactorbSUN -#define glGlobalAlphaFactorsSUN pglGlobalAlphaFactorsSUN -#define glGlobalAlphaFactoriSUN pglGlobalAlphaFactoriSUN -#define glGlobalAlphaFactorfSUN pglGlobalAlphaFactorfSUN -#define glGlobalAlphaFactordSUN pglGlobalAlphaFactordSUN -#define glGlobalAlphaFactorubSUN pglGlobalAlphaFactorubSUN -#define glGlobalAlphaFactorusSUN pglGlobalAlphaFactorusSUN -#define glGlobalAlphaFactoruiSUN pglGlobalAlphaFactoruiSUN -#endif - -/* GL_SUN_triangle_list */ - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#define __GLEE_GL_SUN_triangle_list 1 -/* Constants */ -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint * code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort * code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte * code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* * pointer); -GLEE_EXTERN PFNGLREPLACEMENTCODEUISUNPROC pglReplacementCodeuiSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUSSUNPROC pglReplacementCodeusSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUBSUNPROC pglReplacementCodeubSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUIVSUNPROC pglReplacementCodeuivSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUSVSUNPROC pglReplacementCodeusvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUBVSUNPROC pglReplacementCodeubvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEPOINTERSUNPROC pglReplacementCodePointerSUN; -#define glReplacementCodeuiSUN pglReplacementCodeuiSUN -#define glReplacementCodeusSUN pglReplacementCodeusSUN -#define glReplacementCodeubSUN pglReplacementCodeubSUN -#define glReplacementCodeuivSUN pglReplacementCodeuivSUN -#define glReplacementCodeusvSUN pglReplacementCodeusvSUN -#define glReplacementCodeubvSUN pglReplacementCodeubvSUN -#define glReplacementCodePointerSUN pglReplacementCodePointerSUN -#endif - -/* GL_SUN_vertex */ - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -#define __GLEE_GL_SUN_vertex 1 -/* Constants */ -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte * c, const GLfloat * v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte * c, const GLfloat * v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat * c, const GLfloat * v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat * n, const GLfloat * v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat * c, const GLfloat * n, const GLfloat * v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat * tc, const GLfloat * v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat * tc, const GLfloat * v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat * tc, const GLubyte * c, const GLfloat * v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat * tc, const GLfloat * c, const GLfloat * v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat * tc, const GLfloat * n, const GLfloat * v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint * rc, const GLubyte * c, const GLfloat * v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * c, const GLfloat * v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * n, const GLfloat * v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * c, const GLfloat * n, const GLfloat * v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * tc, const GLfloat * v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * tc, const GLfloat * n, const GLfloat * v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v); -GLEE_EXTERN PFNGLCOLOR4UBVERTEX2FSUNPROC pglColor4ubVertex2fSUN; -GLEE_EXTERN PFNGLCOLOR4UBVERTEX2FVSUNPROC pglColor4ubVertex2fvSUN; -GLEE_EXTERN PFNGLCOLOR4UBVERTEX3FSUNPROC pglColor4ubVertex3fSUN; -GLEE_EXTERN PFNGLCOLOR4UBVERTEX3FVSUNPROC pglColor4ubVertex3fvSUN; -GLEE_EXTERN PFNGLCOLOR3FVERTEX3FSUNPROC pglColor3fVertex3fSUN; -GLEE_EXTERN PFNGLCOLOR3FVERTEX3FVSUNPROC pglColor3fVertex3fvSUN; -GLEE_EXTERN PFNGLNORMAL3FVERTEX3FSUNPROC pglNormal3fVertex3fSUN; -GLEE_EXTERN PFNGLNORMAL3FVERTEX3FVSUNPROC pglNormal3fVertex3fvSUN; -GLEE_EXTERN PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC pglColor4fNormal3fVertex3fSUN; -GLEE_EXTERN PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglColor4fNormal3fVertex3fvSUN; -GLEE_EXTERN PFNGLTEXCOORD2FVERTEX3FSUNPROC pglTexCoord2fVertex3fSUN; -GLEE_EXTERN PFNGLTEXCOORD2FVERTEX3FVSUNPROC pglTexCoord2fVertex3fvSUN; -GLEE_EXTERN PFNGLTEXCOORD4FVERTEX4FSUNPROC pglTexCoord4fVertex4fSUN; -GLEE_EXTERN PFNGLTEXCOORD4FVERTEX4FVSUNPROC pglTexCoord4fVertex4fvSUN; -GLEE_EXTERN PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC pglTexCoord2fColor4ubVertex3fSUN; -GLEE_EXTERN PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC pglTexCoord2fColor4ubVertex3fvSUN; -GLEE_EXTERN PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC pglTexCoord2fColor3fVertex3fSUN; -GLEE_EXTERN PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC pglTexCoord2fColor3fVertex3fvSUN; -GLEE_EXTERN PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC pglTexCoord2fNormal3fVertex3fSUN; -GLEE_EXTERN PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC pglTexCoord2fNormal3fVertex3fvSUN; -GLEE_EXTERN PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC pglTexCoord2fColor4fNormal3fVertex3fSUN; -GLEE_EXTERN PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglTexCoord2fColor4fNormal3fVertex3fvSUN; -GLEE_EXTERN PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC pglTexCoord4fColor4fNormal3fVertex4fSUN; -GLEE_EXTERN PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC pglTexCoord4fColor4fNormal3fVertex4fvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC pglReplacementCodeuiVertex3fSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC pglReplacementCodeuiVertex3fvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC pglReplacementCodeuiColor4ubVertex3fSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC pglReplacementCodeuiColor4ubVertex3fvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC pglReplacementCodeuiColor3fVertex3fSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC pglReplacementCodeuiColor3fVertex3fvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiNormal3fVertex3fSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiNormal3fVertex3fvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiColor4fNormal3fVertex3fSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiColor4fNormal3fVertex3fvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fVertex3fSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fVertex3fvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -#define glColor4ubVertex2fSUN pglColor4ubVertex2fSUN -#define glColor4ubVertex2fvSUN pglColor4ubVertex2fvSUN -#define glColor4ubVertex3fSUN pglColor4ubVertex3fSUN -#define glColor4ubVertex3fvSUN pglColor4ubVertex3fvSUN -#define glColor3fVertex3fSUN pglColor3fVertex3fSUN -#define glColor3fVertex3fvSUN pglColor3fVertex3fvSUN -#define glNormal3fVertex3fSUN pglNormal3fVertex3fSUN -#define glNormal3fVertex3fvSUN pglNormal3fVertex3fvSUN -#define glColor4fNormal3fVertex3fSUN pglColor4fNormal3fVertex3fSUN -#define glColor4fNormal3fVertex3fvSUN pglColor4fNormal3fVertex3fvSUN -#define glTexCoord2fVertex3fSUN pglTexCoord2fVertex3fSUN -#define glTexCoord2fVertex3fvSUN pglTexCoord2fVertex3fvSUN -#define glTexCoord4fVertex4fSUN pglTexCoord4fVertex4fSUN -#define glTexCoord4fVertex4fvSUN pglTexCoord4fVertex4fvSUN -#define glTexCoord2fColor4ubVertex3fSUN pglTexCoord2fColor4ubVertex3fSUN -#define glTexCoord2fColor4ubVertex3fvSUN pglTexCoord2fColor4ubVertex3fvSUN -#define glTexCoord2fColor3fVertex3fSUN pglTexCoord2fColor3fVertex3fSUN -#define glTexCoord2fColor3fVertex3fvSUN pglTexCoord2fColor3fVertex3fvSUN -#define glTexCoord2fNormal3fVertex3fSUN pglTexCoord2fNormal3fVertex3fSUN -#define glTexCoord2fNormal3fVertex3fvSUN pglTexCoord2fNormal3fVertex3fvSUN -#define glTexCoord2fColor4fNormal3fVertex3fSUN pglTexCoord2fColor4fNormal3fVertex3fSUN -#define glTexCoord2fColor4fNormal3fVertex3fvSUN pglTexCoord2fColor4fNormal3fVertex3fvSUN -#define glTexCoord4fColor4fNormal3fVertex4fSUN pglTexCoord4fColor4fNormal3fVertex4fSUN -#define glTexCoord4fColor4fNormal3fVertex4fvSUN pglTexCoord4fColor4fNormal3fVertex4fvSUN -#define glReplacementCodeuiVertex3fSUN pglReplacementCodeuiVertex3fSUN -#define glReplacementCodeuiVertex3fvSUN pglReplacementCodeuiVertex3fvSUN -#define glReplacementCodeuiColor4ubVertex3fSUN pglReplacementCodeuiColor4ubVertex3fSUN -#define glReplacementCodeuiColor4ubVertex3fvSUN pglReplacementCodeuiColor4ubVertex3fvSUN -#define glReplacementCodeuiColor3fVertex3fSUN pglReplacementCodeuiColor3fVertex3fSUN -#define glReplacementCodeuiColor3fVertex3fvSUN pglReplacementCodeuiColor3fVertex3fvSUN -#define glReplacementCodeuiNormal3fVertex3fSUN pglReplacementCodeuiNormal3fVertex3fSUN -#define glReplacementCodeuiNormal3fVertex3fvSUN pglReplacementCodeuiNormal3fVertex3fvSUN -#define glReplacementCodeuiColor4fNormal3fVertex3fSUN pglReplacementCodeuiColor4fNormal3fVertex3fSUN -#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN pglReplacementCodeuiColor4fNormal3fVertex3fvSUN -#define glReplacementCodeuiTexCoord2fVertex3fSUN pglReplacementCodeuiTexCoord2fVertex3fSUN -#define glReplacementCodeuiTexCoord2fVertex3fvSUN pglReplacementCodeuiTexCoord2fVertex3fvSUN -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN pglReplacementCodeuiTexCoord2fNormal3fVertex3fSUN -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN pglReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN -#endif - -/* GL_EXT_blend_func_separate */ - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#define __GLEE_GL_EXT_blend_func_separate 1 -/* Constants */ -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLEE_EXTERN PFNGLBLENDFUNCSEPARATEEXTPROC pglBlendFuncSeparateEXT; -#define glBlendFuncSeparateEXT pglBlendFuncSeparateEXT -#endif - -/* GL_INGR_color_clamp */ - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#define __GLEE_GL_INGR_color_clamp 1 -/* Constants */ -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -/* GL_INGR_interlace_read */ - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#define __GLEE_GL_INGR_interlace_read 1 -/* Constants */ -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -/* GL_EXT_stencil_wrap */ - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#define __GLEE_GL_EXT_stencil_wrap 1 -/* Constants */ -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -/* GL_EXT_422_pixels */ - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#define __GLEE_GL_EXT_422_pixels 1 -/* Constants */ -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -/* GL_NV_texgen_reflection */ - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#define __GLEE_GL_NV_texgen_reflection 1 -/* Constants */ -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -/* GL_EXT_texture_cube_map */ - -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 -#define __GLEE_GL_EXT_texture_cube_map 1 -/* Constants */ -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -/* GL_SUN_convolution_border_modes */ - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#define __GLEE_GL_SUN_convolution_border_modes 1 -/* Constants */ -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -/* GL_EXT_texture_env_add */ - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#define __GLEE_GL_EXT_texture_env_add 1 -/* Constants */ -#endif - -/* GL_EXT_texture_lod_bias */ - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#define __GLEE_GL_EXT_texture_lod_bias 1 -/* Constants */ -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -/* GL_EXT_texture_filter_anisotropic */ - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#define __GLEE_GL_EXT_texture_filter_anisotropic 1 -/* Constants */ -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -/* GL_EXT_vertex_weighting */ - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#define __GLEE_GL_EXT_vertex_weighting 1 -/* Constants */ -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat * weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer); -GLEE_EXTERN PFNGLVERTEXWEIGHTFEXTPROC pglVertexWeightfEXT; -GLEE_EXTERN PFNGLVERTEXWEIGHTFVEXTPROC pglVertexWeightfvEXT; -GLEE_EXTERN PFNGLVERTEXWEIGHTPOINTEREXTPROC pglVertexWeightPointerEXT; -#define glVertexWeightfEXT pglVertexWeightfEXT -#define glVertexWeightfvEXT pglVertexWeightfvEXT -#define glVertexWeightPointerEXT pglVertexWeightPointerEXT -#endif - -/* GL_NV_light_max_exponent */ - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#define __GLEE_GL_NV_light_max_exponent 1 -/* Constants */ -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -/* GL_NV_vertex_array_range */ - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#define __GLEE_GL_NV_vertex_array_range 1 -/* Constants */ -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid * pointer); -GLEE_EXTERN PFNGLFLUSHVERTEXARRAYRANGENVPROC pglFlushVertexArrayRangeNV; -GLEE_EXTERN PFNGLVERTEXARRAYRANGENVPROC pglVertexArrayRangeNV; -#define glFlushVertexArrayRangeNV pglFlushVertexArrayRangeNV -#define glVertexArrayRangeNV pglVertexArrayRangeNV -#endif - -/* GL_NV_register_combiners */ - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#define __GLEE_GL_NV_register_combiners 1 -/* Constants */ -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint * params); -GLEE_EXTERN PFNGLCOMBINERPARAMETERFVNVPROC pglCombinerParameterfvNV; -GLEE_EXTERN PFNGLCOMBINERPARAMETERFNVPROC pglCombinerParameterfNV; -GLEE_EXTERN PFNGLCOMBINERPARAMETERIVNVPROC pglCombinerParameterivNV; -GLEE_EXTERN PFNGLCOMBINERPARAMETERINVPROC pglCombinerParameteriNV; -GLEE_EXTERN PFNGLCOMBINERINPUTNVPROC pglCombinerInputNV; -GLEE_EXTERN PFNGLCOMBINEROUTPUTNVPROC pglCombinerOutputNV; -GLEE_EXTERN PFNGLFINALCOMBINERINPUTNVPROC pglFinalCombinerInputNV; -GLEE_EXTERN PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC pglGetCombinerInputParameterfvNV; -GLEE_EXTERN PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC pglGetCombinerInputParameterivNV; -GLEE_EXTERN PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC pglGetCombinerOutputParameterfvNV; -GLEE_EXTERN PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC pglGetCombinerOutputParameterivNV; -GLEE_EXTERN PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC pglGetFinalCombinerInputParameterfvNV; -GLEE_EXTERN PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC pglGetFinalCombinerInputParameterivNV; -#define glCombinerParameterfvNV pglCombinerParameterfvNV -#define glCombinerParameterfNV pglCombinerParameterfNV -#define glCombinerParameterivNV pglCombinerParameterivNV -#define glCombinerParameteriNV pglCombinerParameteriNV -#define glCombinerInputNV pglCombinerInputNV -#define glCombinerOutputNV pglCombinerOutputNV -#define glFinalCombinerInputNV pglFinalCombinerInputNV -#define glGetCombinerInputParameterfvNV pglGetCombinerInputParameterfvNV -#define glGetCombinerInputParameterivNV pglGetCombinerInputParameterivNV -#define glGetCombinerOutputParameterfvNV pglGetCombinerOutputParameterfvNV -#define glGetCombinerOutputParameterivNV pglGetCombinerOutputParameterivNV -#define glGetFinalCombinerInputParameterfvNV pglGetFinalCombinerInputParameterfvNV -#define glGetFinalCombinerInputParameterivNV pglGetFinalCombinerInputParameterivNV -#endif - -/* GL_NV_fog_distance */ - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#define __GLEE_GL_NV_fog_distance 1 -/* Constants */ -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -#endif - -/* GL_NV_texgen_emboss */ - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#define __GLEE_GL_NV_texgen_emboss 1 -/* Constants */ -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -/* GL_NV_blend_square */ - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#define __GLEE_GL_NV_blend_square 1 -/* Constants */ -#endif - -/* GL_NV_texture_env_combine4 */ - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#define __GLEE_GL_NV_texture_env_combine4 1 -/* Constants */ -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -/* GL_MESA_resize_buffers */ - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#define __GLEE_GL_MESA_resize_buffers 1 -/* Constants */ -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (); -GLEE_EXTERN PFNGLRESIZEBUFFERSMESAPROC pglResizeBuffersMESA; -#define glResizeBuffersMESA pglResizeBuffersMESA -#endif - -/* GL_MESA_window_pos */ - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#define __GLEE_GL_MESA_window_pos 1 -/* Constants */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort * v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble * v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat * v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint * v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort * v); -GLEE_EXTERN PFNGLWINDOWPOS2DMESAPROC pglWindowPos2dMESA; -GLEE_EXTERN PFNGLWINDOWPOS2DVMESAPROC pglWindowPos2dvMESA; -GLEE_EXTERN PFNGLWINDOWPOS2FMESAPROC pglWindowPos2fMESA; -GLEE_EXTERN PFNGLWINDOWPOS2FVMESAPROC pglWindowPos2fvMESA; -GLEE_EXTERN PFNGLWINDOWPOS2IMESAPROC pglWindowPos2iMESA; -GLEE_EXTERN PFNGLWINDOWPOS2IVMESAPROC pglWindowPos2ivMESA; -GLEE_EXTERN PFNGLWINDOWPOS2SMESAPROC pglWindowPos2sMESA; -GLEE_EXTERN PFNGLWINDOWPOS2SVMESAPROC pglWindowPos2svMESA; -GLEE_EXTERN PFNGLWINDOWPOS3DMESAPROC pglWindowPos3dMESA; -GLEE_EXTERN PFNGLWINDOWPOS3DVMESAPROC pglWindowPos3dvMESA; -GLEE_EXTERN PFNGLWINDOWPOS3FMESAPROC pglWindowPos3fMESA; -GLEE_EXTERN PFNGLWINDOWPOS3FVMESAPROC pglWindowPos3fvMESA; -GLEE_EXTERN PFNGLWINDOWPOS3IMESAPROC pglWindowPos3iMESA; -GLEE_EXTERN PFNGLWINDOWPOS3IVMESAPROC pglWindowPos3ivMESA; -GLEE_EXTERN PFNGLWINDOWPOS3SMESAPROC pglWindowPos3sMESA; -GLEE_EXTERN PFNGLWINDOWPOS3SVMESAPROC pglWindowPos3svMESA; -GLEE_EXTERN PFNGLWINDOWPOS4DMESAPROC pglWindowPos4dMESA; -GLEE_EXTERN PFNGLWINDOWPOS4DVMESAPROC pglWindowPos4dvMESA; -GLEE_EXTERN PFNGLWINDOWPOS4FMESAPROC pglWindowPos4fMESA; -GLEE_EXTERN PFNGLWINDOWPOS4FVMESAPROC pglWindowPos4fvMESA; -GLEE_EXTERN PFNGLWINDOWPOS4IMESAPROC pglWindowPos4iMESA; -GLEE_EXTERN PFNGLWINDOWPOS4IVMESAPROC pglWindowPos4ivMESA; -GLEE_EXTERN PFNGLWINDOWPOS4SMESAPROC pglWindowPos4sMESA; -GLEE_EXTERN PFNGLWINDOWPOS4SVMESAPROC pglWindowPos4svMESA; -#define glWindowPos2dMESA pglWindowPos2dMESA -#define glWindowPos2dvMESA pglWindowPos2dvMESA -#define glWindowPos2fMESA pglWindowPos2fMESA -#define glWindowPos2fvMESA pglWindowPos2fvMESA -#define glWindowPos2iMESA pglWindowPos2iMESA -#define glWindowPos2ivMESA pglWindowPos2ivMESA -#define glWindowPos2sMESA pglWindowPos2sMESA -#define glWindowPos2svMESA pglWindowPos2svMESA -#define glWindowPos3dMESA pglWindowPos3dMESA -#define glWindowPos3dvMESA pglWindowPos3dvMESA -#define glWindowPos3fMESA pglWindowPos3fMESA -#define glWindowPos3fvMESA pglWindowPos3fvMESA -#define glWindowPos3iMESA pglWindowPos3iMESA -#define glWindowPos3ivMESA pglWindowPos3ivMESA -#define glWindowPos3sMESA pglWindowPos3sMESA -#define glWindowPos3svMESA pglWindowPos3svMESA -#define glWindowPos4dMESA pglWindowPos4dMESA -#define glWindowPos4dvMESA pglWindowPos4dvMESA -#define glWindowPos4fMESA pglWindowPos4fMESA -#define glWindowPos4fvMESA pglWindowPos4fvMESA -#define glWindowPos4iMESA pglWindowPos4iMESA -#define glWindowPos4ivMESA pglWindowPos4ivMESA -#define glWindowPos4sMESA pglWindowPos4sMESA -#define glWindowPos4svMESA pglWindowPos4svMESA -#endif - -/* GL_EXT_texture_compression_s3tc */ - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -#define __GLEE_GL_EXT_texture_compression_s3tc 1 -/* Constants */ -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -/* GL_IBM_cull_vertex */ - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#define __GLEE_GL_IBM_cull_vertex 1 -/* Constants */ -#define GL_CULL_VERTEX_IBM 103050 -#endif - -/* GL_IBM_multimode_draw_arrays */ - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#define __GLEE_GL_IBM_multimode_draw_arrays 1 -/* Constants */ -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid* const * indices, GLsizei primcount, GLint modestride); -GLEE_EXTERN PFNGLMULTIMODEDRAWARRAYSIBMPROC pglMultiModeDrawArraysIBM; -GLEE_EXTERN PFNGLMULTIMODEDRAWELEMENTSIBMPROC pglMultiModeDrawElementsIBM; -#define glMultiModeDrawArraysIBM pglMultiModeDrawArraysIBM -#define glMultiModeDrawElementsIBM pglMultiModeDrawElementsIBM -#endif - -/* GL_IBM_vertex_array_lists */ - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#define __GLEE_GL_IBM_vertex_array_lists 1 -/* Constants */ -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* * pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); -GLEE_EXTERN PFNGLCOLORPOINTERLISTIBMPROC pglColorPointerListIBM; -GLEE_EXTERN PFNGLSECONDARYCOLORPOINTERLISTIBMPROC pglSecondaryColorPointerListIBM; -GLEE_EXTERN PFNGLEDGEFLAGPOINTERLISTIBMPROC pglEdgeFlagPointerListIBM; -GLEE_EXTERN PFNGLFOGCOORDPOINTERLISTIBMPROC pglFogCoordPointerListIBM; -GLEE_EXTERN PFNGLINDEXPOINTERLISTIBMPROC pglIndexPointerListIBM; -GLEE_EXTERN PFNGLNORMALPOINTERLISTIBMPROC pglNormalPointerListIBM; -GLEE_EXTERN PFNGLTEXCOORDPOINTERLISTIBMPROC pglTexCoordPointerListIBM; -GLEE_EXTERN PFNGLVERTEXPOINTERLISTIBMPROC pglVertexPointerListIBM; -#define glColorPointerListIBM pglColorPointerListIBM -#define glSecondaryColorPointerListIBM pglSecondaryColorPointerListIBM -#define glEdgeFlagPointerListIBM pglEdgeFlagPointerListIBM -#define glFogCoordPointerListIBM pglFogCoordPointerListIBM -#define glIndexPointerListIBM pglIndexPointerListIBM -#define glNormalPointerListIBM pglNormalPointerListIBM -#define glTexCoordPointerListIBM pglTexCoordPointerListIBM -#define glVertexPointerListIBM pglVertexPointerListIBM -#endif - -/* GL_SGIX_subsample */ - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#define __GLEE_GL_SGIX_subsample 1 -/* Constants */ -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -/* GL_SGIX_ycrcb_subsample */ - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#define __GLEE_GL_SGIX_ycrcb_subsample 1 -/* Constants */ -#endif - -/* GL_SGIX_ycrcba */ - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#define __GLEE_GL_SGIX_ycrcba 1 -/* Constants */ -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -/* GL_SGI_depth_pass_instrument */ - -#ifndef GL_SGI_depth_pass_instrument -#define GL_SGI_depth_pass_instrument 1 -#define __GLEE_GL_SGI_depth_pass_instrument 1 -/* Constants */ -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -/* GL_3DFX_texture_compression_FXT1 */ - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#define __GLEE_GL_3DFX_texture_compression_FXT1 1 -/* Constants */ -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif - -/* GL_3DFX_multisample */ - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#define __GLEE_GL_3DFX_multisample 1 -/* Constants */ -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif - -/* GL_3DFX_tbuffer */ - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#define __GLEE_GL_3DFX_tbuffer 1 -/* Constants */ -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -GLEE_EXTERN PFNGLTBUFFERMASK3DFXPROC pglTbufferMask3DFX; -#define glTbufferMask3DFX pglTbufferMask3DFX -#endif - -/* GL_EXT_multisample */ - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#define __GLEE_GL_EXT_multisample 1 -/* Constants */ -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -GLEE_EXTERN PFNGLSAMPLEMASKEXTPROC pglSampleMaskEXT; -GLEE_EXTERN PFNGLSAMPLEPATTERNEXTPROC pglSamplePatternEXT; -#define glSampleMaskEXT pglSampleMaskEXT -#define glSamplePatternEXT pglSamplePatternEXT -#endif - -/* GL_SGIX_vertex_preclip */ - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#define __GLEE_GL_SGIX_vertex_preclip 1 -/* Constants */ -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif - -/* GL_SGIX_convolution_accuracy */ - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#define __GLEE_GL_SGIX_convolution_accuracy 1 -/* Constants */ -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif - -/* GL_SGIX_resample */ - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#define __GLEE_GL_SGIX_resample 1 -/* Constants */ -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif - -/* GL_SGIS_point_line_texgen */ - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#define __GLEE_GL_SGIS_point_line_texgen 1 -/* Constants */ -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif - -/* GL_SGIS_texture_color_mask */ - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#define __GLEE_GL_SGIS_texture_color_mask 1 -/* Constants */ -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GLEE_EXTERN PFNGLTEXTURECOLORMASKSGISPROC pglTextureColorMaskSGIS; -#define glTextureColorMaskSGIS pglTextureColorMaskSGIS -#endif - -/* GL_EXT_texture_env_dot3 */ - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#define __GLEE_GL_EXT_texture_env_dot3 1 -/* Constants */ -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif - -/* GL_ATI_texture_mirror_once */ - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#define __GLEE_GL_ATI_texture_mirror_once 1 -/* Constants */ -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif - -/* GL_NV_fence */ - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#define __GLEE_GL_NV_fence 1 -/* Constants */ -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint * fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint * fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -GLEE_EXTERN PFNGLDELETEFENCESNVPROC pglDeleteFencesNV; -GLEE_EXTERN PFNGLGENFENCESNVPROC pglGenFencesNV; -GLEE_EXTERN PFNGLISFENCENVPROC pglIsFenceNV; -GLEE_EXTERN PFNGLTESTFENCENVPROC pglTestFenceNV; -GLEE_EXTERN PFNGLGETFENCEIVNVPROC pglGetFenceivNV; -GLEE_EXTERN PFNGLFINISHFENCENVPROC pglFinishFenceNV; -GLEE_EXTERN PFNGLSETFENCENVPROC pglSetFenceNV; -#define glDeleteFencesNV pglDeleteFencesNV -#define glGenFencesNV pglGenFencesNV -#define glIsFenceNV pglIsFenceNV -#define glTestFenceNV pglTestFenceNV -#define glGetFenceivNV pglGetFenceivNV -#define glFinishFenceNV pglFinishFenceNV -#define glSetFenceNV pglSetFenceNV -#endif - -/* GL_IBM_texture_mirrored_repeat */ - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 -#define __GLEE_GL_IBM_texture_mirrored_repeat 1 -/* Constants */ -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif - -/* GL_NV_evaluators */ - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#define __GLEE_GL_NV_evaluators 1 -/* Constants */ -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid * points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid * points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -GLEE_EXTERN PFNGLMAPCONTROLPOINTSNVPROC pglMapControlPointsNV; -GLEE_EXTERN PFNGLMAPPARAMETERIVNVPROC pglMapParameterivNV; -GLEE_EXTERN PFNGLMAPPARAMETERFVNVPROC pglMapParameterfvNV; -GLEE_EXTERN PFNGLGETMAPCONTROLPOINTSNVPROC pglGetMapControlPointsNV; -GLEE_EXTERN PFNGLGETMAPPARAMETERIVNVPROC pglGetMapParameterivNV; -GLEE_EXTERN PFNGLGETMAPPARAMETERFVNVPROC pglGetMapParameterfvNV; -GLEE_EXTERN PFNGLGETMAPATTRIBPARAMETERIVNVPROC pglGetMapAttribParameterivNV; -GLEE_EXTERN PFNGLGETMAPATTRIBPARAMETERFVNVPROC pglGetMapAttribParameterfvNV; -GLEE_EXTERN PFNGLEVALMAPSNVPROC pglEvalMapsNV; -#define glMapControlPointsNV pglMapControlPointsNV -#define glMapParameterivNV pglMapParameterivNV -#define glMapParameterfvNV pglMapParameterfvNV -#define glGetMapControlPointsNV pglGetMapControlPointsNV -#define glGetMapParameterivNV pglGetMapParameterivNV -#define glGetMapParameterfvNV pglGetMapParameterfvNV -#define glGetMapAttribParameterivNV pglGetMapAttribParameterivNV -#define glGetMapAttribParameterfvNV pglGetMapAttribParameterfvNV -#define glEvalMapsNV pglEvalMapsNV -#endif - -/* GL_NV_packed_depth_stencil */ - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#define __GLEE_GL_NV_packed_depth_stencil 1 -/* Constants */ -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif - -/* GL_NV_register_combiners2 */ - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#define __GLEE_GL_NV_register_combiners2 1 -/* Constants */ -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat * params); -GLEE_EXTERN PFNGLCOMBINERSTAGEPARAMETERFVNVPROC pglCombinerStageParameterfvNV; -GLEE_EXTERN PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC pglGetCombinerStageParameterfvNV; -#define glCombinerStageParameterfvNV pglCombinerStageParameterfvNV -#define glGetCombinerStageParameterfvNV pglGetCombinerStageParameterfvNV -#endif - -/* GL_NV_texture_compression_vtc */ - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#define __GLEE_GL_NV_texture_compression_vtc 1 -/* Constants */ -#endif - -/* GL_NV_texture_rectangle */ - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#define __GLEE_GL_NV_texture_rectangle 1 -/* Constants */ -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif - -/* GL_NV_texture_shader */ - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#define __GLEE_GL_NV_texture_shader 1 -/* Constants */ -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV -#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV -#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif - -/* GL_NV_texture_shader2 */ - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#define __GLEE_GL_NV_texture_shader2 1 -/* Constants */ -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif - -/* GL_NV_vertex_array_range2 */ - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#define __GLEE_GL_NV_vertex_array_range2 1 -/* Constants */ -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif - -/* GL_NV_vertex_program */ - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#define __GLEE_GL_NV_vertex_program 1 -/* Constants */ -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint * programs, GLboolean * residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint * programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat * params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint * programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble * params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte * program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* * pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte * program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble * v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat * v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint * programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte * v); -GLEE_EXTERN PFNGLAREPROGRAMSRESIDENTNVPROC pglAreProgramsResidentNV; -GLEE_EXTERN PFNGLBINDPROGRAMNVPROC pglBindProgramNV; -GLEE_EXTERN PFNGLDELETEPROGRAMSNVPROC pglDeleteProgramsNV; -GLEE_EXTERN PFNGLEXECUTEPROGRAMNVPROC pglExecuteProgramNV; -GLEE_EXTERN PFNGLGENPROGRAMSNVPROC pglGenProgramsNV; -GLEE_EXTERN PFNGLGETPROGRAMPARAMETERDVNVPROC pglGetProgramParameterdvNV; -GLEE_EXTERN PFNGLGETPROGRAMPARAMETERFVNVPROC pglGetProgramParameterfvNV; -GLEE_EXTERN PFNGLGETPROGRAMIVNVPROC pglGetProgramivNV; -GLEE_EXTERN PFNGLGETPROGRAMSTRINGNVPROC pglGetProgramStringNV; -GLEE_EXTERN PFNGLGETTRACKMATRIXIVNVPROC pglGetTrackMatrixivNV; -GLEE_EXTERN PFNGLGETVERTEXATTRIBDVNVPROC pglGetVertexAttribdvNV; -GLEE_EXTERN PFNGLGETVERTEXATTRIBFVNVPROC pglGetVertexAttribfvNV; -GLEE_EXTERN PFNGLGETVERTEXATTRIBIVNVPROC pglGetVertexAttribivNV; -GLEE_EXTERN PFNGLGETVERTEXATTRIBPOINTERVNVPROC pglGetVertexAttribPointervNV; -GLEE_EXTERN PFNGLISPROGRAMNVPROC pglIsProgramNV; -GLEE_EXTERN PFNGLLOADPROGRAMNVPROC pglLoadProgramNV; -GLEE_EXTERN PFNGLPROGRAMPARAMETER4DNVPROC pglProgramParameter4dNV; -GLEE_EXTERN PFNGLPROGRAMPARAMETER4DVNVPROC pglProgramParameter4dvNV; -GLEE_EXTERN PFNGLPROGRAMPARAMETER4FNVPROC pglProgramParameter4fNV; -GLEE_EXTERN PFNGLPROGRAMPARAMETER4FVNVPROC pglProgramParameter4fvNV; -GLEE_EXTERN PFNGLPROGRAMPARAMETERS4DVNVPROC pglProgramParameters4dvNV; -GLEE_EXTERN PFNGLPROGRAMPARAMETERS4FVNVPROC pglProgramParameters4fvNV; -GLEE_EXTERN PFNGLREQUESTRESIDENTPROGRAMSNVPROC pglRequestResidentProgramsNV; -GLEE_EXTERN PFNGLTRACKMATRIXNVPROC pglTrackMatrixNV; -GLEE_EXTERN PFNGLVERTEXATTRIBPOINTERNVPROC pglVertexAttribPointerNV; -GLEE_EXTERN PFNGLVERTEXATTRIB1DNVPROC pglVertexAttrib1dNV; -GLEE_EXTERN PFNGLVERTEXATTRIB1DVNVPROC pglVertexAttrib1dvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB1FNVPROC pglVertexAttrib1fNV; -GLEE_EXTERN PFNGLVERTEXATTRIB1FVNVPROC pglVertexAttrib1fvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB1SNVPROC pglVertexAttrib1sNV; -GLEE_EXTERN PFNGLVERTEXATTRIB1SVNVPROC pglVertexAttrib1svNV; -GLEE_EXTERN PFNGLVERTEXATTRIB2DNVPROC pglVertexAttrib2dNV; -GLEE_EXTERN PFNGLVERTEXATTRIB2DVNVPROC pglVertexAttrib2dvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB2FNVPROC pglVertexAttrib2fNV; -GLEE_EXTERN PFNGLVERTEXATTRIB2FVNVPROC pglVertexAttrib2fvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB2SNVPROC pglVertexAttrib2sNV; -GLEE_EXTERN PFNGLVERTEXATTRIB2SVNVPROC pglVertexAttrib2svNV; -GLEE_EXTERN PFNGLVERTEXATTRIB3DNVPROC pglVertexAttrib3dNV; -GLEE_EXTERN PFNGLVERTEXATTRIB3DVNVPROC pglVertexAttrib3dvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB3FNVPROC pglVertexAttrib3fNV; -GLEE_EXTERN PFNGLVERTEXATTRIB3FVNVPROC pglVertexAttrib3fvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB3SNVPROC pglVertexAttrib3sNV; -GLEE_EXTERN PFNGLVERTEXATTRIB3SVNVPROC pglVertexAttrib3svNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4DNVPROC pglVertexAttrib4dNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4DVNVPROC pglVertexAttrib4dvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4FNVPROC pglVertexAttrib4fNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4FVNVPROC pglVertexAttrib4fvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4SNVPROC pglVertexAttrib4sNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4SVNVPROC pglVertexAttrib4svNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4UBNVPROC pglVertexAttrib4ubNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4UBVNVPROC pglVertexAttrib4ubvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS1DVNVPROC pglVertexAttribs1dvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS1FVNVPROC pglVertexAttribs1fvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS1SVNVPROC pglVertexAttribs1svNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS2DVNVPROC pglVertexAttribs2dvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS2FVNVPROC pglVertexAttribs2fvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS2SVNVPROC pglVertexAttribs2svNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS3DVNVPROC pglVertexAttribs3dvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS3FVNVPROC pglVertexAttribs3fvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS3SVNVPROC pglVertexAttribs3svNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS4DVNVPROC pglVertexAttribs4dvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS4FVNVPROC pglVertexAttribs4fvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS4SVNVPROC pglVertexAttribs4svNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS4UBVNVPROC pglVertexAttribs4ubvNV; -#define glAreProgramsResidentNV pglAreProgramsResidentNV -#define glBindProgramNV pglBindProgramNV -#define glDeleteProgramsNV pglDeleteProgramsNV -#define glExecuteProgramNV pglExecuteProgramNV -#define glGenProgramsNV pglGenProgramsNV -#define glGetProgramParameterdvNV pglGetProgramParameterdvNV -#define glGetProgramParameterfvNV pglGetProgramParameterfvNV -#define glGetProgramivNV pglGetProgramivNV -#define glGetProgramStringNV pglGetProgramStringNV -#define glGetTrackMatrixivNV pglGetTrackMatrixivNV -#define glGetVertexAttribdvNV pglGetVertexAttribdvNV -#define glGetVertexAttribfvNV pglGetVertexAttribfvNV -#define glGetVertexAttribivNV pglGetVertexAttribivNV -#define glGetVertexAttribPointervNV pglGetVertexAttribPointervNV -#define glIsProgramNV pglIsProgramNV -#define glLoadProgramNV pglLoadProgramNV -#define glProgramParameter4dNV pglProgramParameter4dNV -#define glProgramParameter4dvNV pglProgramParameter4dvNV -#define glProgramParameter4fNV pglProgramParameter4fNV -#define glProgramParameter4fvNV pglProgramParameter4fvNV -#define glProgramParameters4dvNV pglProgramParameters4dvNV -#define glProgramParameters4fvNV pglProgramParameters4fvNV -#define glRequestResidentProgramsNV pglRequestResidentProgramsNV -#define glTrackMatrixNV pglTrackMatrixNV -#define glVertexAttribPointerNV pglVertexAttribPointerNV -#define glVertexAttrib1dNV pglVertexAttrib1dNV -#define glVertexAttrib1dvNV pglVertexAttrib1dvNV -#define glVertexAttrib1fNV pglVertexAttrib1fNV -#define glVertexAttrib1fvNV pglVertexAttrib1fvNV -#define glVertexAttrib1sNV pglVertexAttrib1sNV -#define glVertexAttrib1svNV pglVertexAttrib1svNV -#define glVertexAttrib2dNV pglVertexAttrib2dNV -#define glVertexAttrib2dvNV pglVertexAttrib2dvNV -#define glVertexAttrib2fNV pglVertexAttrib2fNV -#define glVertexAttrib2fvNV pglVertexAttrib2fvNV -#define glVertexAttrib2sNV pglVertexAttrib2sNV -#define glVertexAttrib2svNV pglVertexAttrib2svNV -#define glVertexAttrib3dNV pglVertexAttrib3dNV -#define glVertexAttrib3dvNV pglVertexAttrib3dvNV -#define glVertexAttrib3fNV pglVertexAttrib3fNV -#define glVertexAttrib3fvNV pglVertexAttrib3fvNV -#define glVertexAttrib3sNV pglVertexAttrib3sNV -#define glVertexAttrib3svNV pglVertexAttrib3svNV -#define glVertexAttrib4dNV pglVertexAttrib4dNV -#define glVertexAttrib4dvNV pglVertexAttrib4dvNV -#define glVertexAttrib4fNV pglVertexAttrib4fNV -#define glVertexAttrib4fvNV pglVertexAttrib4fvNV -#define glVertexAttrib4sNV pglVertexAttrib4sNV -#define glVertexAttrib4svNV pglVertexAttrib4svNV -#define glVertexAttrib4ubNV pglVertexAttrib4ubNV -#define glVertexAttrib4ubvNV pglVertexAttrib4ubvNV -#define glVertexAttribs1dvNV pglVertexAttribs1dvNV -#define glVertexAttribs1fvNV pglVertexAttribs1fvNV -#define glVertexAttribs1svNV pglVertexAttribs1svNV -#define glVertexAttribs2dvNV pglVertexAttribs2dvNV -#define glVertexAttribs2fvNV pglVertexAttribs2fvNV -#define glVertexAttribs2svNV pglVertexAttribs2svNV -#define glVertexAttribs3dvNV pglVertexAttribs3dvNV -#define glVertexAttribs3fvNV pglVertexAttribs3fvNV -#define glVertexAttribs3svNV pglVertexAttribs3svNV -#define glVertexAttribs4dvNV pglVertexAttribs4dvNV -#define glVertexAttribs4fvNV pglVertexAttribs4fvNV -#define glVertexAttribs4svNV pglVertexAttribs4svNV -#define glVertexAttribs4ubvNV pglVertexAttribs4ubvNV -#endif - -/* GL_SGIX_texture_coordinate_clamp */ - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#define __GLEE_GL_SGIX_texture_coordinate_clamp 1 -/* Constants */ -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif - -/* GL_SGIX_scalebias_hint */ - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#define __GLEE_GL_SGIX_scalebias_hint 1 -/* Constants */ -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif - -/* GL_OML_interlace */ - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#define __GLEE_GL_OML_interlace 1 -/* Constants */ -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif - -/* GL_OML_subsample */ - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#define __GLEE_GL_OML_subsample 1 -/* Constants */ -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif - -/* GL_OML_resample */ - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#define __GLEE_GL_OML_resample 1 -/* Constants */ -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif - -/* GL_NV_copy_depth_to_color */ - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#define __GLEE_GL_NV_copy_depth_to_color 1 -/* Constants */ -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif - -/* GL_ATI_envmap_bumpmap */ - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#define __GLEE_GL_ATI_envmap_bumpmap 1 -/* Constants */ -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint * param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat * param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint * param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat * param); -GLEE_EXTERN PFNGLTEXBUMPPARAMETERIVATIPROC pglTexBumpParameterivATI; -GLEE_EXTERN PFNGLTEXBUMPPARAMETERFVATIPROC pglTexBumpParameterfvATI; -GLEE_EXTERN PFNGLGETTEXBUMPPARAMETERIVATIPROC pglGetTexBumpParameterivATI; -GLEE_EXTERN PFNGLGETTEXBUMPPARAMETERFVATIPROC pglGetTexBumpParameterfvATI; -#define glTexBumpParameterivATI pglTexBumpParameterivATI -#define glTexBumpParameterfvATI pglTexBumpParameterfvATI -#define glGetTexBumpParameterivATI pglGetTexBumpParameterivATI -#define glGetTexBumpParameterfvATI pglGetTexBumpParameterfvATI -#endif - -/* GL_ATI_fragment_shader */ - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#define __GLEE_GL_ATI_fragment_shader 1 -/* Constants */ -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat * value); -GLEE_EXTERN PFNGLGENFRAGMENTSHADERSATIPROC pglGenFragmentShadersATI; -GLEE_EXTERN PFNGLBINDFRAGMENTSHADERATIPROC pglBindFragmentShaderATI; -GLEE_EXTERN PFNGLDELETEFRAGMENTSHADERATIPROC pglDeleteFragmentShaderATI; -GLEE_EXTERN PFNGLBEGINFRAGMENTSHADERATIPROC pglBeginFragmentShaderATI; -GLEE_EXTERN PFNGLENDFRAGMENTSHADERATIPROC pglEndFragmentShaderATI; -GLEE_EXTERN PFNGLPASSTEXCOORDATIPROC pglPassTexCoordATI; -GLEE_EXTERN PFNGLSAMPLEMAPATIPROC pglSampleMapATI; -GLEE_EXTERN PFNGLCOLORFRAGMENTOP1ATIPROC pglColorFragmentOp1ATI; -GLEE_EXTERN PFNGLCOLORFRAGMENTOP2ATIPROC pglColorFragmentOp2ATI; -GLEE_EXTERN PFNGLCOLORFRAGMENTOP3ATIPROC pglColorFragmentOp3ATI; -GLEE_EXTERN PFNGLALPHAFRAGMENTOP1ATIPROC pglAlphaFragmentOp1ATI; -GLEE_EXTERN PFNGLALPHAFRAGMENTOP2ATIPROC pglAlphaFragmentOp2ATI; -GLEE_EXTERN PFNGLALPHAFRAGMENTOP3ATIPROC pglAlphaFragmentOp3ATI; -GLEE_EXTERN PFNGLSETFRAGMENTSHADERCONSTANTATIPROC pglSetFragmentShaderConstantATI; -#define glGenFragmentShadersATI pglGenFragmentShadersATI -#define glBindFragmentShaderATI pglBindFragmentShaderATI -#define glDeleteFragmentShaderATI pglDeleteFragmentShaderATI -#define glBeginFragmentShaderATI pglBeginFragmentShaderATI -#define glEndFragmentShaderATI pglEndFragmentShaderATI -#define glPassTexCoordATI pglPassTexCoordATI -#define glSampleMapATI pglSampleMapATI -#define glColorFragmentOp1ATI pglColorFragmentOp1ATI -#define glColorFragmentOp2ATI pglColorFragmentOp2ATI -#define glColorFragmentOp3ATI pglColorFragmentOp3ATI -#define glAlphaFragmentOp1ATI pglAlphaFragmentOp1ATI -#define glAlphaFragmentOp2ATI pglAlphaFragmentOp2ATI -#define glAlphaFragmentOp3ATI pglAlphaFragmentOp3ATI -#define glSetFragmentShaderConstantATI pglSetFragmentShaderConstantATI -#endif - -/* GL_ATI_pn_triangles */ - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#define __GLEE_GL_ATI_pn_triangles 1 -/* Constants */ -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -GLEE_EXTERN PFNGLPNTRIANGLESIATIPROC pglPNTrianglesiATI; -GLEE_EXTERN PFNGLPNTRIANGLESFATIPROC pglPNTrianglesfATI; -#define glPNTrianglesiATI pglPNTrianglesiATI -#define glPNTrianglesfATI pglPNTrianglesfATI -#endif - -/* GL_ATI_vertex_array_object */ - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#define __GLEE_GL_ATI_vertex_array_object 1 -/* Constants */ -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid * pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid * pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint * params); -GLEE_EXTERN PFNGLNEWOBJECTBUFFERATIPROC pglNewObjectBufferATI; -GLEE_EXTERN PFNGLISOBJECTBUFFERATIPROC pglIsObjectBufferATI; -GLEE_EXTERN PFNGLUPDATEOBJECTBUFFERATIPROC pglUpdateObjectBufferATI; -GLEE_EXTERN PFNGLGETOBJECTBUFFERFVATIPROC pglGetObjectBufferfvATI; -GLEE_EXTERN PFNGLGETOBJECTBUFFERIVATIPROC pglGetObjectBufferivATI; -GLEE_EXTERN PFNGLFREEOBJECTBUFFERATIPROC pglFreeObjectBufferATI; -GLEE_EXTERN PFNGLARRAYOBJECTATIPROC pglArrayObjectATI; -GLEE_EXTERN PFNGLGETARRAYOBJECTFVATIPROC pglGetArrayObjectfvATI; -GLEE_EXTERN PFNGLGETARRAYOBJECTIVATIPROC pglGetArrayObjectivATI; -GLEE_EXTERN PFNGLVARIANTARRAYOBJECTATIPROC pglVariantArrayObjectATI; -GLEE_EXTERN PFNGLGETVARIANTARRAYOBJECTFVATIPROC pglGetVariantArrayObjectfvATI; -GLEE_EXTERN PFNGLGETVARIANTARRAYOBJECTIVATIPROC pglGetVariantArrayObjectivATI; -#define glNewObjectBufferATI pglNewObjectBufferATI -#define glIsObjectBufferATI pglIsObjectBufferATI -#define glUpdateObjectBufferATI pglUpdateObjectBufferATI -#define glGetObjectBufferfvATI pglGetObjectBufferfvATI -#define glGetObjectBufferivATI pglGetObjectBufferivATI -#define glFreeObjectBufferATI pglFreeObjectBufferATI -#define glArrayObjectATI pglArrayObjectATI -#define glGetArrayObjectfvATI pglGetArrayObjectfvATI -#define glGetArrayObjectivATI pglGetArrayObjectivATI -#define glVariantArrayObjectATI pglVariantArrayObjectATI -#define glGetVariantArrayObjectfvATI pglGetVariantArrayObjectfvATI -#define glGetVariantArrayObjectivATI pglGetVariantArrayObjectivATI -#endif - -/* GL_EXT_vertex_shader */ - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#define __GLEE_GL_EXT_vertex_shader 1 -/* Constants */ -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid * addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid * addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte * addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort * addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint * addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat * addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble * addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte * addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort * addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint * addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid * addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean * data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint * data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat * data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* * data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean * data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint * data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat * data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean * data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint * data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat * data); -GLEE_EXTERN PFNGLBEGINVERTEXSHADEREXTPROC pglBeginVertexShaderEXT; -GLEE_EXTERN PFNGLENDVERTEXSHADEREXTPROC pglEndVertexShaderEXT; -GLEE_EXTERN PFNGLBINDVERTEXSHADEREXTPROC pglBindVertexShaderEXT; -GLEE_EXTERN PFNGLGENVERTEXSHADERSEXTPROC pglGenVertexShadersEXT; -GLEE_EXTERN PFNGLDELETEVERTEXSHADEREXTPROC pglDeleteVertexShaderEXT; -GLEE_EXTERN PFNGLSHADEROP1EXTPROC pglShaderOp1EXT; -GLEE_EXTERN PFNGLSHADEROP2EXTPROC pglShaderOp2EXT; -GLEE_EXTERN PFNGLSHADEROP3EXTPROC pglShaderOp3EXT; -GLEE_EXTERN PFNGLSWIZZLEEXTPROC pglSwizzleEXT; -GLEE_EXTERN PFNGLWRITEMASKEXTPROC pglWriteMaskEXT; -GLEE_EXTERN PFNGLINSERTCOMPONENTEXTPROC pglInsertComponentEXT; -GLEE_EXTERN PFNGLEXTRACTCOMPONENTEXTPROC pglExtractComponentEXT; -GLEE_EXTERN PFNGLGENSYMBOLSEXTPROC pglGenSymbolsEXT; -GLEE_EXTERN PFNGLSETINVARIANTEXTPROC pglSetInvariantEXT; -GLEE_EXTERN PFNGLSETLOCALCONSTANTEXTPROC pglSetLocalConstantEXT; -GLEE_EXTERN PFNGLVARIANTBVEXTPROC pglVariantbvEXT; -GLEE_EXTERN PFNGLVARIANTSVEXTPROC pglVariantsvEXT; -GLEE_EXTERN PFNGLVARIANTIVEXTPROC pglVariantivEXT; -GLEE_EXTERN PFNGLVARIANTFVEXTPROC pglVariantfvEXT; -GLEE_EXTERN PFNGLVARIANTDVEXTPROC pglVariantdvEXT; -GLEE_EXTERN PFNGLVARIANTUBVEXTPROC pglVariantubvEXT; -GLEE_EXTERN PFNGLVARIANTUSVEXTPROC pglVariantusvEXT; -GLEE_EXTERN PFNGLVARIANTUIVEXTPROC pglVariantuivEXT; -GLEE_EXTERN PFNGLVARIANTPOINTEREXTPROC pglVariantPointerEXT; -GLEE_EXTERN PFNGLENABLEVARIANTCLIENTSTATEEXTPROC pglEnableVariantClientStateEXT; -GLEE_EXTERN PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC pglDisableVariantClientStateEXT; -GLEE_EXTERN PFNGLBINDLIGHTPARAMETEREXTPROC pglBindLightParameterEXT; -GLEE_EXTERN PFNGLBINDMATERIALPARAMETEREXTPROC pglBindMaterialParameterEXT; -GLEE_EXTERN PFNGLBINDTEXGENPARAMETEREXTPROC pglBindTexGenParameterEXT; -GLEE_EXTERN PFNGLBINDTEXTUREUNITPARAMETEREXTPROC pglBindTextureUnitParameterEXT; -GLEE_EXTERN PFNGLBINDPARAMETEREXTPROC pglBindParameterEXT; -GLEE_EXTERN PFNGLISVARIANTENABLEDEXTPROC pglIsVariantEnabledEXT; -GLEE_EXTERN PFNGLGETVARIANTBOOLEANVEXTPROC pglGetVariantBooleanvEXT; -GLEE_EXTERN PFNGLGETVARIANTINTEGERVEXTPROC pglGetVariantIntegervEXT; -GLEE_EXTERN PFNGLGETVARIANTFLOATVEXTPROC pglGetVariantFloatvEXT; -GLEE_EXTERN PFNGLGETVARIANTPOINTERVEXTPROC pglGetVariantPointervEXT; -GLEE_EXTERN PFNGLGETINVARIANTBOOLEANVEXTPROC pglGetInvariantBooleanvEXT; -GLEE_EXTERN PFNGLGETINVARIANTINTEGERVEXTPROC pglGetInvariantIntegervEXT; -GLEE_EXTERN PFNGLGETINVARIANTFLOATVEXTPROC pglGetInvariantFloatvEXT; -GLEE_EXTERN PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC pglGetLocalConstantBooleanvEXT; -GLEE_EXTERN PFNGLGETLOCALCONSTANTINTEGERVEXTPROC pglGetLocalConstantIntegervEXT; -GLEE_EXTERN PFNGLGETLOCALCONSTANTFLOATVEXTPROC pglGetLocalConstantFloatvEXT; -#define glBeginVertexShaderEXT pglBeginVertexShaderEXT -#define glEndVertexShaderEXT pglEndVertexShaderEXT -#define glBindVertexShaderEXT pglBindVertexShaderEXT -#define glGenVertexShadersEXT pglGenVertexShadersEXT -#define glDeleteVertexShaderEXT pglDeleteVertexShaderEXT -#define glShaderOp1EXT pglShaderOp1EXT -#define glShaderOp2EXT pglShaderOp2EXT -#define glShaderOp3EXT pglShaderOp3EXT -#define glSwizzleEXT pglSwizzleEXT -#define glWriteMaskEXT pglWriteMaskEXT -#define glInsertComponentEXT pglInsertComponentEXT -#define glExtractComponentEXT pglExtractComponentEXT -#define glGenSymbolsEXT pglGenSymbolsEXT -#define glSetInvariantEXT pglSetInvariantEXT -#define glSetLocalConstantEXT pglSetLocalConstantEXT -#define glVariantbvEXT pglVariantbvEXT -#define glVariantsvEXT pglVariantsvEXT -#define glVariantivEXT pglVariantivEXT -#define glVariantfvEXT pglVariantfvEXT -#define glVariantdvEXT pglVariantdvEXT -#define glVariantubvEXT pglVariantubvEXT -#define glVariantusvEXT pglVariantusvEXT -#define glVariantuivEXT pglVariantuivEXT -#define glVariantPointerEXT pglVariantPointerEXT -#define glEnableVariantClientStateEXT pglEnableVariantClientStateEXT -#define glDisableVariantClientStateEXT pglDisableVariantClientStateEXT -#define glBindLightParameterEXT pglBindLightParameterEXT -#define glBindMaterialParameterEXT pglBindMaterialParameterEXT -#define glBindTexGenParameterEXT pglBindTexGenParameterEXT -#define glBindTextureUnitParameterEXT pglBindTextureUnitParameterEXT -#define glBindParameterEXT pglBindParameterEXT -#define glIsVariantEnabledEXT pglIsVariantEnabledEXT -#define glGetVariantBooleanvEXT pglGetVariantBooleanvEXT -#define glGetVariantIntegervEXT pglGetVariantIntegervEXT -#define glGetVariantFloatvEXT pglGetVariantFloatvEXT -#define glGetVariantPointervEXT pglGetVariantPointervEXT -#define glGetInvariantBooleanvEXT pglGetInvariantBooleanvEXT -#define glGetInvariantIntegervEXT pglGetInvariantIntegervEXT -#define glGetInvariantFloatvEXT pglGetInvariantFloatvEXT -#define glGetLocalConstantBooleanvEXT pglGetLocalConstantBooleanvEXT -#define glGetLocalConstantIntegervEXT pglGetLocalConstantIntegervEXT -#define glGetLocalConstantFloatvEXT pglGetLocalConstantFloatvEXT -#endif - -/* GL_ATI_vertex_streams */ - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#define __GLEE_GL_ATI_vertex_streams 1 -/* Constants */ -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat * coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble * coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte * coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort * coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint * coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat * coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble * coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -GLEE_EXTERN PFNGLVERTEXSTREAM1SATIPROC pglVertexStream1sATI; -GLEE_EXTERN PFNGLVERTEXSTREAM1SVATIPROC pglVertexStream1svATI; -GLEE_EXTERN PFNGLVERTEXSTREAM1IATIPROC pglVertexStream1iATI; -GLEE_EXTERN PFNGLVERTEXSTREAM1IVATIPROC pglVertexStream1ivATI; -GLEE_EXTERN PFNGLVERTEXSTREAM1FATIPROC pglVertexStream1fATI; -GLEE_EXTERN PFNGLVERTEXSTREAM1FVATIPROC pglVertexStream1fvATI; -GLEE_EXTERN PFNGLVERTEXSTREAM1DATIPROC pglVertexStream1dATI; -GLEE_EXTERN PFNGLVERTEXSTREAM1DVATIPROC pglVertexStream1dvATI; -GLEE_EXTERN PFNGLVERTEXSTREAM2SATIPROC pglVertexStream2sATI; -GLEE_EXTERN PFNGLVERTEXSTREAM2SVATIPROC pglVertexStream2svATI; -GLEE_EXTERN PFNGLVERTEXSTREAM2IATIPROC pglVertexStream2iATI; -GLEE_EXTERN PFNGLVERTEXSTREAM2IVATIPROC pglVertexStream2ivATI; -GLEE_EXTERN PFNGLVERTEXSTREAM2FATIPROC pglVertexStream2fATI; -GLEE_EXTERN PFNGLVERTEXSTREAM2FVATIPROC pglVertexStream2fvATI; -GLEE_EXTERN PFNGLVERTEXSTREAM2DATIPROC pglVertexStream2dATI; -GLEE_EXTERN PFNGLVERTEXSTREAM2DVATIPROC pglVertexStream2dvATI; -GLEE_EXTERN PFNGLVERTEXSTREAM3SATIPROC pglVertexStream3sATI; -GLEE_EXTERN PFNGLVERTEXSTREAM3SVATIPROC pglVertexStream3svATI; -GLEE_EXTERN PFNGLVERTEXSTREAM3IATIPROC pglVertexStream3iATI; -GLEE_EXTERN PFNGLVERTEXSTREAM3IVATIPROC pglVertexStream3ivATI; -GLEE_EXTERN PFNGLVERTEXSTREAM3FATIPROC pglVertexStream3fATI; -GLEE_EXTERN PFNGLVERTEXSTREAM3FVATIPROC pglVertexStream3fvATI; -GLEE_EXTERN PFNGLVERTEXSTREAM3DATIPROC pglVertexStream3dATI; -GLEE_EXTERN PFNGLVERTEXSTREAM3DVATIPROC pglVertexStream3dvATI; -GLEE_EXTERN PFNGLVERTEXSTREAM4SATIPROC pglVertexStream4sATI; -GLEE_EXTERN PFNGLVERTEXSTREAM4SVATIPROC pglVertexStream4svATI; -GLEE_EXTERN PFNGLVERTEXSTREAM4IATIPROC pglVertexStream4iATI; -GLEE_EXTERN PFNGLVERTEXSTREAM4IVATIPROC pglVertexStream4ivATI; -GLEE_EXTERN PFNGLVERTEXSTREAM4FATIPROC pglVertexStream4fATI; -GLEE_EXTERN PFNGLVERTEXSTREAM4FVATIPROC pglVertexStream4fvATI; -GLEE_EXTERN PFNGLVERTEXSTREAM4DATIPROC pglVertexStream4dATI; -GLEE_EXTERN PFNGLVERTEXSTREAM4DVATIPROC pglVertexStream4dvATI; -GLEE_EXTERN PFNGLNORMALSTREAM3BATIPROC pglNormalStream3bATI; -GLEE_EXTERN PFNGLNORMALSTREAM3BVATIPROC pglNormalStream3bvATI; -GLEE_EXTERN PFNGLNORMALSTREAM3SATIPROC pglNormalStream3sATI; -GLEE_EXTERN PFNGLNORMALSTREAM3SVATIPROC pglNormalStream3svATI; -GLEE_EXTERN PFNGLNORMALSTREAM3IATIPROC pglNormalStream3iATI; -GLEE_EXTERN PFNGLNORMALSTREAM3IVATIPROC pglNormalStream3ivATI; -GLEE_EXTERN PFNGLNORMALSTREAM3FATIPROC pglNormalStream3fATI; -GLEE_EXTERN PFNGLNORMALSTREAM3FVATIPROC pglNormalStream3fvATI; -GLEE_EXTERN PFNGLNORMALSTREAM3DATIPROC pglNormalStream3dATI; -GLEE_EXTERN PFNGLNORMALSTREAM3DVATIPROC pglNormalStream3dvATI; -GLEE_EXTERN PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC pglClientActiveVertexStreamATI; -GLEE_EXTERN PFNGLVERTEXBLENDENVIATIPROC pglVertexBlendEnviATI; -GLEE_EXTERN PFNGLVERTEXBLENDENVFATIPROC pglVertexBlendEnvfATI; -#define glVertexStream1sATI pglVertexStream1sATI -#define glVertexStream1svATI pglVertexStream1svATI -#define glVertexStream1iATI pglVertexStream1iATI -#define glVertexStream1ivATI pglVertexStream1ivATI -#define glVertexStream1fATI pglVertexStream1fATI -#define glVertexStream1fvATI pglVertexStream1fvATI -#define glVertexStream1dATI pglVertexStream1dATI -#define glVertexStream1dvATI pglVertexStream1dvATI -#define glVertexStream2sATI pglVertexStream2sATI -#define glVertexStream2svATI pglVertexStream2svATI -#define glVertexStream2iATI pglVertexStream2iATI -#define glVertexStream2ivATI pglVertexStream2ivATI -#define glVertexStream2fATI pglVertexStream2fATI -#define glVertexStream2fvATI pglVertexStream2fvATI -#define glVertexStream2dATI pglVertexStream2dATI -#define glVertexStream2dvATI pglVertexStream2dvATI -#define glVertexStream3sATI pglVertexStream3sATI -#define glVertexStream3svATI pglVertexStream3svATI -#define glVertexStream3iATI pglVertexStream3iATI -#define glVertexStream3ivATI pglVertexStream3ivATI -#define glVertexStream3fATI pglVertexStream3fATI -#define glVertexStream3fvATI pglVertexStream3fvATI -#define glVertexStream3dATI pglVertexStream3dATI -#define glVertexStream3dvATI pglVertexStream3dvATI -#define glVertexStream4sATI pglVertexStream4sATI -#define glVertexStream4svATI pglVertexStream4svATI -#define glVertexStream4iATI pglVertexStream4iATI -#define glVertexStream4ivATI pglVertexStream4ivATI -#define glVertexStream4fATI pglVertexStream4fATI -#define glVertexStream4fvATI pglVertexStream4fvATI -#define glVertexStream4dATI pglVertexStream4dATI -#define glVertexStream4dvATI pglVertexStream4dvATI -#define glNormalStream3bATI pglNormalStream3bATI -#define glNormalStream3bvATI pglNormalStream3bvATI -#define glNormalStream3sATI pglNormalStream3sATI -#define glNormalStream3svATI pglNormalStream3svATI -#define glNormalStream3iATI pglNormalStream3iATI -#define glNormalStream3ivATI pglNormalStream3ivATI -#define glNormalStream3fATI pglNormalStream3fATI -#define glNormalStream3fvATI pglNormalStream3fvATI -#define glNormalStream3dATI pglNormalStream3dATI -#define glNormalStream3dvATI pglNormalStream3dvATI -#define glClientActiveVertexStreamATI pglClientActiveVertexStreamATI -#define glVertexBlendEnviATI pglVertexBlendEnviATI -#define glVertexBlendEnvfATI pglVertexBlendEnvfATI -#endif - -/* GL_ATI_element_array */ - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#define __GLEE_GL_ATI_element_array 1 -/* Constants */ -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -GLEE_EXTERN PFNGLELEMENTPOINTERATIPROC pglElementPointerATI; -GLEE_EXTERN PFNGLDRAWELEMENTARRAYATIPROC pglDrawElementArrayATI; -GLEE_EXTERN PFNGLDRAWRANGEELEMENTARRAYATIPROC pglDrawRangeElementArrayATI; -#define glElementPointerATI pglElementPointerATI -#define glDrawElementArrayATI pglDrawElementArrayATI -#define glDrawRangeElementArrayATI pglDrawRangeElementArrayATI -#endif - -/* GL_SUN_mesh_array */ - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#define __GLEE_GL_SUN_mesh_array 1 -/* Constants */ -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -GLEE_EXTERN PFNGLDRAWMESHARRAYSSUNPROC pglDrawMeshArraysSUN; -#define glDrawMeshArraysSUN pglDrawMeshArraysSUN -#endif - -/* GL_SUN_slice_accum */ - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#define __GLEE_GL_SUN_slice_accum 1 -/* Constants */ -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif - -/* GL_NV_multisample_filter_hint */ - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#define __GLEE_GL_NV_multisample_filter_hint 1 -/* Constants */ -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif - -/* GL_NV_depth_clamp */ - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#define __GLEE_GL_NV_depth_clamp 1 -/* Constants */ -#define GL_DEPTH_CLAMP_NV 0x864F -#endif - -/* GL_NV_occlusion_query */ - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#define __GLEE_GL_NV_occlusion_query 1 -/* Constants */ -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint * ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint * ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint * params); -GLEE_EXTERN PFNGLGENOCCLUSIONQUERIESNVPROC pglGenOcclusionQueriesNV; -GLEE_EXTERN PFNGLDELETEOCCLUSIONQUERIESNVPROC pglDeleteOcclusionQueriesNV; -GLEE_EXTERN PFNGLISOCCLUSIONQUERYNVPROC pglIsOcclusionQueryNV; -GLEE_EXTERN PFNGLBEGINOCCLUSIONQUERYNVPROC pglBeginOcclusionQueryNV; -GLEE_EXTERN PFNGLENDOCCLUSIONQUERYNVPROC pglEndOcclusionQueryNV; -GLEE_EXTERN PFNGLGETOCCLUSIONQUERYIVNVPROC pglGetOcclusionQueryivNV; -GLEE_EXTERN PFNGLGETOCCLUSIONQUERYUIVNVPROC pglGetOcclusionQueryuivNV; -#define glGenOcclusionQueriesNV pglGenOcclusionQueriesNV -#define glDeleteOcclusionQueriesNV pglDeleteOcclusionQueriesNV -#define glIsOcclusionQueryNV pglIsOcclusionQueryNV -#define glBeginOcclusionQueryNV pglBeginOcclusionQueryNV -#define glEndOcclusionQueryNV pglEndOcclusionQueryNV -#define glGetOcclusionQueryivNV pglGetOcclusionQueryivNV -#define glGetOcclusionQueryuivNV pglGetOcclusionQueryuivNV -#endif - -/* GL_NV_point_sprite */ - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#define __GLEE_GL_NV_point_sprite 1 -/* Constants */ -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint * params); -GLEE_EXTERN PFNGLPOINTPARAMETERINVPROC pglPointParameteriNV; -GLEE_EXTERN PFNGLPOINTPARAMETERIVNVPROC pglPointParameterivNV; -#define glPointParameteriNV pglPointParameteriNV -#define glPointParameterivNV pglPointParameterivNV -#endif - -/* GL_NV_texture_shader3 */ - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#define __GLEE_GL_NV_texture_shader3 1 -/* Constants */ -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif - -/* GL_NV_vertex_program1_1 */ - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#define __GLEE_GL_NV_vertex_program1_1 1 -/* Constants */ -#endif - -/* GL_EXT_shadow_funcs */ - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#define __GLEE_GL_EXT_shadow_funcs 1 -/* Constants */ -#endif - -/* GL_EXT_stencil_two_side */ - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#define __GLEE_GL_EXT_stencil_two_side 1 -/* Constants */ -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -GLEE_EXTERN PFNGLACTIVESTENCILFACEEXTPROC pglActiveStencilFaceEXT; -#define glActiveStencilFaceEXT pglActiveStencilFaceEXT -#endif - -/* GL_ATI_text_fragment_shader */ - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#define __GLEE_GL_ATI_text_fragment_shader 1 -/* Constants */ -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif - -/* GL_APPLE_client_storage */ - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#define __GLEE_GL_APPLE_client_storage 1 -/* Constants */ -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif - -/* GL_APPLE_element_array */ - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#define __GLEE_GL_APPLE_element_array 1 -/* Constants */ -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint * first, const GLsizei * count, GLsizei primcount); -GLEE_EXTERN PFNGLELEMENTPOINTERAPPLEPROC pglElementPointerAPPLE; -GLEE_EXTERN PFNGLDRAWELEMENTARRAYAPPLEPROC pglDrawElementArrayAPPLE; -GLEE_EXTERN PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC pglDrawRangeElementArrayAPPLE; -GLEE_EXTERN PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC pglMultiDrawElementArrayAPPLE; -GLEE_EXTERN PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC pglMultiDrawRangeElementArrayAPPLE; -#define glElementPointerAPPLE pglElementPointerAPPLE -#define glDrawElementArrayAPPLE pglDrawElementArrayAPPLE -#define glDrawRangeElementArrayAPPLE pglDrawRangeElementArrayAPPLE -#define glMultiDrawElementArrayAPPLE pglMultiDrawElementArrayAPPLE -#define glMultiDrawRangeElementArrayAPPLE pglMultiDrawRangeElementArrayAPPLE -#endif - -/* GL_APPLE_fence */ - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#define __GLEE_GL_APPLE_fence 1 -/* Constants */ -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint * fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint * fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -GLEE_EXTERN PFNGLGENFENCESAPPLEPROC pglGenFencesAPPLE; -GLEE_EXTERN PFNGLDELETEFENCESAPPLEPROC pglDeleteFencesAPPLE; -GLEE_EXTERN PFNGLSETFENCEAPPLEPROC pglSetFenceAPPLE; -GLEE_EXTERN PFNGLISFENCEAPPLEPROC pglIsFenceAPPLE; -GLEE_EXTERN PFNGLTESTFENCEAPPLEPROC pglTestFenceAPPLE; -GLEE_EXTERN PFNGLFINISHFENCEAPPLEPROC pglFinishFenceAPPLE; -GLEE_EXTERN PFNGLTESTOBJECTAPPLEPROC pglTestObjectAPPLE; -GLEE_EXTERN PFNGLFINISHOBJECTAPPLEPROC pglFinishObjectAPPLE; -#define glGenFencesAPPLE pglGenFencesAPPLE -#define glDeleteFencesAPPLE pglDeleteFencesAPPLE -#define glSetFenceAPPLE pglSetFenceAPPLE -#define glIsFenceAPPLE pglIsFenceAPPLE -#define glTestFenceAPPLE pglTestFenceAPPLE -#define glFinishFenceAPPLE pglFinishFenceAPPLE -#define glTestObjectAPPLE pglTestObjectAPPLE -#define glFinishObjectAPPLE pglFinishObjectAPPLE -#endif - -/* GL_APPLE_vertex_array_object */ - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#define __GLEE_GL_APPLE_vertex_array_object 1 -/* Constants */ -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint * arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint * arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -GLEE_EXTERN PFNGLBINDVERTEXARRAYAPPLEPROC pglBindVertexArrayAPPLE; -GLEE_EXTERN PFNGLDELETEVERTEXARRAYSAPPLEPROC pglDeleteVertexArraysAPPLE; -GLEE_EXTERN PFNGLGENVERTEXARRAYSAPPLEPROC pglGenVertexArraysAPPLE; -GLEE_EXTERN PFNGLISVERTEXARRAYAPPLEPROC pglIsVertexArrayAPPLE; -#define glBindVertexArrayAPPLE pglBindVertexArrayAPPLE -#define glDeleteVertexArraysAPPLE pglDeleteVertexArraysAPPLE -#define glGenVertexArraysAPPLE pglGenVertexArraysAPPLE -#define glIsVertexArrayAPPLE pglIsVertexArrayAPPLE -#endif - -/* GL_APPLE_vertex_array_range */ - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#define __GLEE_GL_APPLE_vertex_array_range 1 -/* Constants */ -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid * pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid * pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -GLEE_EXTERN PFNGLVERTEXARRAYRANGEAPPLEPROC pglVertexArrayRangeAPPLE; -GLEE_EXTERN PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC pglFlushVertexArrayRangeAPPLE; -GLEE_EXTERN PFNGLVERTEXARRAYPARAMETERIAPPLEPROC pglVertexArrayParameteriAPPLE; -#define glVertexArrayRangeAPPLE pglVertexArrayRangeAPPLE -#define glFlushVertexArrayRangeAPPLE pglFlushVertexArrayRangeAPPLE -#define glVertexArrayParameteriAPPLE pglVertexArrayParameteriAPPLE -#endif - -/* GL_APPLE_ycbcr_422 */ - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#define __GLEE_GL_APPLE_ycbcr_422 1 -/* Constants */ -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -/* GL_S3_s3tc */ - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#define __GLEE_GL_S3_s3tc 1 -/* Constants */ -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#endif - -/* GL_ATI_draw_buffers */ - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#define __GLEE_GL_ATI_draw_buffers 1 -/* Constants */ -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum * bufs); -GLEE_EXTERN PFNGLDRAWBUFFERSATIPROC pglDrawBuffersATI; -#define glDrawBuffersATI pglDrawBuffersATI -#endif - -/* GL_ATI_pixel_format_float */ - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -#define __GLEE_GL_ATI_pixel_format_float 1 -/* Constants */ -#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif - -/* GL_ATI_texture_env_combine3 */ - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#define __GLEE_GL_ATI_texture_env_combine3 1 -/* Constants */ -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif - -/* GL_ATI_texture_float */ - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#define __GLEE_GL_ATI_texture_float 1 -/* Constants */ -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif - -/* GL_NV_float_buffer */ - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#define __GLEE_GL_NV_float_buffer 1 -/* Constants */ -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif - -/* GL_NV_fragment_program */ - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -#define __GLEE_GL_NV_fragment_program 1 -/* Constants */ -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); -GLEE_EXTERN PFNGLPROGRAMNAMEDPARAMETER4FNVPROC pglProgramNamedParameter4fNV; -GLEE_EXTERN PFNGLPROGRAMNAMEDPARAMETER4DNVPROC pglProgramNamedParameter4dNV; -GLEE_EXTERN PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC pglProgramNamedParameter4fvNV; -GLEE_EXTERN PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC pglProgramNamedParameter4dvNV; -GLEE_EXTERN PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC pglGetProgramNamedParameterfvNV; -GLEE_EXTERN PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC pglGetProgramNamedParameterdvNV; -#define glProgramNamedParameter4fNV pglProgramNamedParameter4fNV -#define glProgramNamedParameter4dNV pglProgramNamedParameter4dNV -#define glProgramNamedParameter4fvNV pglProgramNamedParameter4fvNV -#define glProgramNamedParameter4dvNV pglProgramNamedParameter4dvNV -#define glGetProgramNamedParameterfvNV pglGetProgramNamedParameterfvNV -#define glGetProgramNamedParameterdvNV pglGetProgramNamedParameterdvNV -#endif - -/* GL_NV_half_float */ - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -#define __GLEE_GL_NV_half_float 1 -/* Constants */ -#define GL_HALF_FLOAT_NV 0x140B -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV * fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV * weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV * v); -GLEE_EXTERN PFNGLVERTEX2HNVPROC pglVertex2hNV; -GLEE_EXTERN PFNGLVERTEX2HVNVPROC pglVertex2hvNV; -GLEE_EXTERN PFNGLVERTEX3HNVPROC pglVertex3hNV; -GLEE_EXTERN PFNGLVERTEX3HVNVPROC pglVertex3hvNV; -GLEE_EXTERN PFNGLVERTEX4HNVPROC pglVertex4hNV; -GLEE_EXTERN PFNGLVERTEX4HVNVPROC pglVertex4hvNV; -GLEE_EXTERN PFNGLNORMAL3HNVPROC pglNormal3hNV; -GLEE_EXTERN PFNGLNORMAL3HVNVPROC pglNormal3hvNV; -GLEE_EXTERN PFNGLCOLOR3HNVPROC pglColor3hNV; -GLEE_EXTERN PFNGLCOLOR3HVNVPROC pglColor3hvNV; -GLEE_EXTERN PFNGLCOLOR4HNVPROC pglColor4hNV; -GLEE_EXTERN PFNGLCOLOR4HVNVPROC pglColor4hvNV; -GLEE_EXTERN PFNGLTEXCOORD1HNVPROC pglTexCoord1hNV; -GLEE_EXTERN PFNGLTEXCOORD1HVNVPROC pglTexCoord1hvNV; -GLEE_EXTERN PFNGLTEXCOORD2HNVPROC pglTexCoord2hNV; -GLEE_EXTERN PFNGLTEXCOORD2HVNVPROC pglTexCoord2hvNV; -GLEE_EXTERN PFNGLTEXCOORD3HNVPROC pglTexCoord3hNV; -GLEE_EXTERN PFNGLTEXCOORD3HVNVPROC pglTexCoord3hvNV; -GLEE_EXTERN PFNGLTEXCOORD4HNVPROC pglTexCoord4hNV; -GLEE_EXTERN PFNGLTEXCOORD4HVNVPROC pglTexCoord4hvNV; -GLEE_EXTERN PFNGLMULTITEXCOORD1HNVPROC pglMultiTexCoord1hNV; -GLEE_EXTERN PFNGLMULTITEXCOORD1HVNVPROC pglMultiTexCoord1hvNV; -GLEE_EXTERN PFNGLMULTITEXCOORD2HNVPROC pglMultiTexCoord2hNV; -GLEE_EXTERN PFNGLMULTITEXCOORD2HVNVPROC pglMultiTexCoord2hvNV; -GLEE_EXTERN PFNGLMULTITEXCOORD3HNVPROC pglMultiTexCoord3hNV; -GLEE_EXTERN PFNGLMULTITEXCOORD3HVNVPROC pglMultiTexCoord3hvNV; -GLEE_EXTERN PFNGLMULTITEXCOORD4HNVPROC pglMultiTexCoord4hNV; -GLEE_EXTERN PFNGLMULTITEXCOORD4HVNVPROC pglMultiTexCoord4hvNV; -GLEE_EXTERN PFNGLFOGCOORDHNVPROC pglFogCoordhNV; -GLEE_EXTERN PFNGLFOGCOORDHVNVPROC pglFogCoordhvNV; -GLEE_EXTERN PFNGLSECONDARYCOLOR3HNVPROC pglSecondaryColor3hNV; -GLEE_EXTERN PFNGLSECONDARYCOLOR3HVNVPROC pglSecondaryColor3hvNV; -GLEE_EXTERN PFNGLVERTEXWEIGHTHNVPROC pglVertexWeighthNV; -GLEE_EXTERN PFNGLVERTEXWEIGHTHVNVPROC pglVertexWeighthvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB1HNVPROC pglVertexAttrib1hNV; -GLEE_EXTERN PFNGLVERTEXATTRIB1HVNVPROC pglVertexAttrib1hvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB2HNVPROC pglVertexAttrib2hNV; -GLEE_EXTERN PFNGLVERTEXATTRIB2HVNVPROC pglVertexAttrib2hvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB3HNVPROC pglVertexAttrib3hNV; -GLEE_EXTERN PFNGLVERTEXATTRIB3HVNVPROC pglVertexAttrib3hvNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4HNVPROC pglVertexAttrib4hNV; -GLEE_EXTERN PFNGLVERTEXATTRIB4HVNVPROC pglVertexAttrib4hvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS1HVNVPROC pglVertexAttribs1hvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS2HVNVPROC pglVertexAttribs2hvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS3HVNVPROC pglVertexAttribs3hvNV; -GLEE_EXTERN PFNGLVERTEXATTRIBS4HVNVPROC pglVertexAttribs4hvNV; -#define glVertex2hNV pglVertex2hNV -#define glVertex2hvNV pglVertex2hvNV -#define glVertex3hNV pglVertex3hNV -#define glVertex3hvNV pglVertex3hvNV -#define glVertex4hNV pglVertex4hNV -#define glVertex4hvNV pglVertex4hvNV -#define glNormal3hNV pglNormal3hNV -#define glNormal3hvNV pglNormal3hvNV -#define glColor3hNV pglColor3hNV -#define glColor3hvNV pglColor3hvNV -#define glColor4hNV pglColor4hNV -#define glColor4hvNV pglColor4hvNV -#define glTexCoord1hNV pglTexCoord1hNV -#define glTexCoord1hvNV pglTexCoord1hvNV -#define glTexCoord2hNV pglTexCoord2hNV -#define glTexCoord2hvNV pglTexCoord2hvNV -#define glTexCoord3hNV pglTexCoord3hNV -#define glTexCoord3hvNV pglTexCoord3hvNV -#define glTexCoord4hNV pglTexCoord4hNV -#define glTexCoord4hvNV pglTexCoord4hvNV -#define glMultiTexCoord1hNV pglMultiTexCoord1hNV -#define glMultiTexCoord1hvNV pglMultiTexCoord1hvNV -#define glMultiTexCoord2hNV pglMultiTexCoord2hNV -#define glMultiTexCoord2hvNV pglMultiTexCoord2hvNV -#define glMultiTexCoord3hNV pglMultiTexCoord3hNV -#define glMultiTexCoord3hvNV pglMultiTexCoord3hvNV -#define glMultiTexCoord4hNV pglMultiTexCoord4hNV -#define glMultiTexCoord4hvNV pglMultiTexCoord4hvNV -#define glFogCoordhNV pglFogCoordhNV -#define glFogCoordhvNV pglFogCoordhvNV -#define glSecondaryColor3hNV pglSecondaryColor3hNV -#define glSecondaryColor3hvNV pglSecondaryColor3hvNV -#define glVertexWeighthNV pglVertexWeighthNV -#define glVertexWeighthvNV pglVertexWeighthvNV -#define glVertexAttrib1hNV pglVertexAttrib1hNV -#define glVertexAttrib1hvNV pglVertexAttrib1hvNV -#define glVertexAttrib2hNV pglVertexAttrib2hNV -#define glVertexAttrib2hvNV pglVertexAttrib2hvNV -#define glVertexAttrib3hNV pglVertexAttrib3hNV -#define glVertexAttrib3hvNV pglVertexAttrib3hvNV -#define glVertexAttrib4hNV pglVertexAttrib4hNV -#define glVertexAttrib4hvNV pglVertexAttrib4hvNV -#define glVertexAttribs1hvNV pglVertexAttribs1hvNV -#define glVertexAttribs2hvNV pglVertexAttribs2hvNV -#define glVertexAttribs3hvNV pglVertexAttribs3hvNV -#define glVertexAttribs4hvNV pglVertexAttribs4hvNV -#endif - -/* GL_NV_pixel_data_range */ - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#define __GLEE_GL_NV_pixel_data_range 1 -/* Constants */ -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid * pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -GLEE_EXTERN PFNGLPIXELDATARANGENVPROC pglPixelDataRangeNV; -GLEE_EXTERN PFNGLFLUSHPIXELDATARANGENVPROC pglFlushPixelDataRangeNV; -#define glPixelDataRangeNV pglPixelDataRangeNV -#define glFlushPixelDataRangeNV pglFlushPixelDataRangeNV -#endif - -/* GL_NV_primitive_restart */ - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#define __GLEE_GL_NV_primitive_restart 1 -/* Constants */ -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -GLEE_EXTERN PFNGLPRIMITIVERESTARTNVPROC pglPrimitiveRestartNV; -GLEE_EXTERN PFNGLPRIMITIVERESTARTINDEXNVPROC pglPrimitiveRestartIndexNV; -#define glPrimitiveRestartNV pglPrimitiveRestartNV -#define glPrimitiveRestartIndexNV pglPrimitiveRestartIndexNV -#endif - -/* GL_NV_texture_expand_normal */ - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#define __GLEE_GL_NV_texture_expand_normal 1 -/* Constants */ -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif - -/* GL_NV_vertex_program2 */ - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#define __GLEE_GL_NV_vertex_program2 1 -/* Constants */ -#endif - -/* GL_ATI_map_object_buffer */ - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -#define __GLEE_GL_ATI_map_object_buffer 1 -/* Constants */ -typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -GLEE_EXTERN PFNGLMAPOBJECTBUFFERATIPROC pglMapObjectBufferATI; -GLEE_EXTERN PFNGLUNMAPOBJECTBUFFERATIPROC pglUnmapObjectBufferATI; -#define glMapObjectBufferATI pglMapObjectBufferATI -#define glUnmapObjectBufferATI pglUnmapObjectBufferATI -#endif - -/* GL_ATI_separate_stencil */ - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#define __GLEE_GL_ATI_separate_stencil 1 -/* Constants */ -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -GLEE_EXTERN PFNGLSTENCILOPSEPARATEATIPROC pglStencilOpSeparateATI; -GLEE_EXTERN PFNGLSTENCILFUNCSEPARATEATIPROC pglStencilFuncSeparateATI; -#define glStencilOpSeparateATI pglStencilOpSeparateATI -#define glStencilFuncSeparateATI pglStencilFuncSeparateATI -#endif - -/* GL_ATI_vertex_attrib_array_object */ - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -#define __GLEE_GL_ATI_vertex_attrib_array_object 1 -/* Constants */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint * params); -GLEE_EXTERN PFNGLVERTEXATTRIBARRAYOBJECTATIPROC pglVertexAttribArrayObjectATI; -GLEE_EXTERN PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC pglGetVertexAttribArrayObjectfvATI; -GLEE_EXTERN PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC pglGetVertexAttribArrayObjectivATI; -#define glVertexAttribArrayObjectATI pglVertexAttribArrayObjectATI -#define glGetVertexAttribArrayObjectfvATI pglGetVertexAttribArrayObjectfvATI -#define glGetVertexAttribArrayObjectivATI pglGetVertexAttribArrayObjectivATI -#endif - -/* GL_OES_read_format */ - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#define __GLEE_GL_OES_read_format 1 -/* Constants */ -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif - -/* GL_EXT_depth_bounds_test */ - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#define __GLEE_GL_EXT_depth_bounds_test 1 -/* Constants */ -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -GLEE_EXTERN PFNGLDEPTHBOUNDSEXTPROC pglDepthBoundsEXT; -#define glDepthBoundsEXT pglDepthBoundsEXT -#endif - -/* GL_EXT_texture_mirror_clamp */ - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#define __GLEE_GL_EXT_texture_mirror_clamp 1 -/* Constants */ -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif - -/* GL_EXT_blend_equation_separate */ - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#define __GLEE_GL_EXT_blend_equation_separate 1 -/* Constants */ -#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -GLEE_EXTERN PFNGLBLENDEQUATIONSEPARATEEXTPROC pglBlendEquationSeparateEXT; -#define glBlendEquationSeparateEXT pglBlendEquationSeparateEXT -#endif - -/* GL_MESA_pack_invert */ - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#define __GLEE_GL_MESA_pack_invert 1 -/* Constants */ -#define GL_PACK_INVERT_MESA 0x8758 -#endif - -/* GL_MESA_ycbcr_texture */ - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#define __GLEE_GL_MESA_ycbcr_texture 1 -/* Constants */ -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif - -/* GL_EXT_pixel_buffer_object */ - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#define __GLEE_GL_EXT_pixel_buffer_object 1 -/* Constants */ -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif - -/* GL_NV_fragment_program_option */ - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#define __GLEE_GL_NV_fragment_program_option 1 -/* Constants */ -#endif - -/* GL_NV_fragment_program2 */ - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#define __GLEE_GL_NV_fragment_program2 1 -/* Constants */ -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif - -/* GL_NV_vertex_program2_option */ - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#define __GLEE_GL_NV_vertex_program2_option 1 -/* Constants */ -#endif - -/* GL_NV_vertex_program3 */ - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#define __GLEE_GL_NV_vertex_program3 1 -/* Constants */ -#endif - -/* GL_EXT_framebuffer_object */ - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#define __GLEE_GL_EXT_framebuffer_object 1 -/* Constants */ -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint * renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint * renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint * framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint * framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -GLEE_EXTERN PFNGLISRENDERBUFFEREXTPROC pglIsRenderbufferEXT; -GLEE_EXTERN PFNGLBINDRENDERBUFFEREXTPROC pglBindRenderbufferEXT; -GLEE_EXTERN PFNGLDELETERENDERBUFFERSEXTPROC pglDeleteRenderbuffersEXT; -GLEE_EXTERN PFNGLGENRENDERBUFFERSEXTPROC pglGenRenderbuffersEXT; -GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEEXTPROC pglRenderbufferStorageEXT; -GLEE_EXTERN PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC pglGetRenderbufferParameterivEXT; -GLEE_EXTERN PFNGLISFRAMEBUFFEREXTPROC pglIsFramebufferEXT; -GLEE_EXTERN PFNGLBINDFRAMEBUFFEREXTPROC pglBindFramebufferEXT; -GLEE_EXTERN PFNGLDELETEFRAMEBUFFERSEXTPROC pglDeleteFramebuffersEXT; -GLEE_EXTERN PFNGLGENFRAMEBUFFERSEXTPROC pglGenFramebuffersEXT; -GLEE_EXTERN PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC pglCheckFramebufferStatusEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE1DEXTPROC pglFramebufferTexture1DEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE2DEXTPROC pglFramebufferTexture2DEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE3DEXTPROC pglFramebufferTexture3DEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC pglFramebufferRenderbufferEXT; -GLEE_EXTERN PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC pglGetFramebufferAttachmentParameterivEXT; -GLEE_EXTERN PFNGLGENERATEMIPMAPEXTPROC pglGenerateMipmapEXT; -#define glIsRenderbufferEXT pglIsRenderbufferEXT -#define glBindRenderbufferEXT pglBindRenderbufferEXT -#define glDeleteRenderbuffersEXT pglDeleteRenderbuffersEXT -#define glGenRenderbuffersEXT pglGenRenderbuffersEXT -#define glRenderbufferStorageEXT pglRenderbufferStorageEXT -#define glGetRenderbufferParameterivEXT pglGetRenderbufferParameterivEXT -#define glIsFramebufferEXT pglIsFramebufferEXT -#define glBindFramebufferEXT pglBindFramebufferEXT -#define glDeleteFramebuffersEXT pglDeleteFramebuffersEXT -#define glGenFramebuffersEXT pglGenFramebuffersEXT -#define glCheckFramebufferStatusEXT pglCheckFramebufferStatusEXT -#define glFramebufferTexture1DEXT pglFramebufferTexture1DEXT -#define glFramebufferTexture2DEXT pglFramebufferTexture2DEXT -#define glFramebufferTexture3DEXT pglFramebufferTexture3DEXT -#define glFramebufferRenderbufferEXT pglFramebufferRenderbufferEXT -#define glGetFramebufferAttachmentParameterivEXT pglGetFramebufferAttachmentParameterivEXT -#define glGenerateMipmapEXT pglGenerateMipmapEXT -#endif - -/* GL_GREMEDY_string_marker */ - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -#define __GLEE_GL_GREMEDY_string_marker 1 -/* Constants */ -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid * string); -GLEE_EXTERN PFNGLSTRINGMARKERGREMEDYPROC pglStringMarkerGREMEDY; -#define glStringMarkerGREMEDY pglStringMarkerGREMEDY -#endif - -/* GL_EXT_packed_depth_stencil */ - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -#define __GLEE_GL_EXT_packed_depth_stencil 1 -/* Constants */ -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 -#endif - -/* GL_EXT_stencil_clear_tag */ - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -#define __GLEE_GL_EXT_stencil_clear_tag 1 -/* Constants */ -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); -GLEE_EXTERN PFNGLSTENCILCLEARTAGEXTPROC pglStencilClearTagEXT; -#define glStencilClearTagEXT pglStencilClearTagEXT -#endif - -/* GL_EXT_texture_sRGB */ - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -#define __GLEE_GL_EXT_texture_sRGB 1 -/* Constants */ -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif - -/* GL_EXT_framebuffer_blit */ - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -#define __GLEE_GL_EXT_framebuffer_blit 1 -/* Constants */ -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLEE_EXTERN PFNGLBLITFRAMEBUFFEREXTPROC pglBlitFramebufferEXT; -#define glBlitFramebufferEXT pglBlitFramebufferEXT -#endif - -/* GL_EXT_framebuffer_multisample */ - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -#define __GLEE_GL_EXT_framebuffer_multisample 1 -/* Constants */ -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pglRenderbufferStorageMultisampleEXT; -#define glRenderbufferStorageMultisampleEXT pglRenderbufferStorageMultisampleEXT -#endif - -/* GL_MESAX_texture_stack */ - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -#define __GLEE_GL_MESAX_texture_stack 1 -/* Constants */ -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#endif - -/* GL_EXT_timer_query */ - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -#define __GLEE_GL_EXT_timer_query 1 -/* Constants */ -#define GL_TIME_ELAPSED_EXT 0x88BF -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT * params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT * params); -GLEE_EXTERN PFNGLGETQUERYOBJECTI64VEXTPROC pglGetQueryObjecti64vEXT; -GLEE_EXTERN PFNGLGETQUERYOBJECTUI64VEXTPROC pglGetQueryObjectui64vEXT; -#define glGetQueryObjecti64vEXT pglGetQueryObjecti64vEXT -#define glGetQueryObjectui64vEXT pglGetQueryObjectui64vEXT -#endif - -/* GL_EXT_gpu_program_parameters */ - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -#define __GLEE_GL_EXT_gpu_program_parameters 1 -/* Constants */ -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat * params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat * params); -GLEE_EXTERN PFNGLPROGRAMENVPARAMETERS4FVEXTPROC pglProgramEnvParameters4fvEXT; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC pglProgramLocalParameters4fvEXT; -#define glProgramEnvParameters4fvEXT pglProgramEnvParameters4fvEXT -#define glProgramLocalParameters4fvEXT pglProgramLocalParameters4fvEXT -#endif - -/* GL_APPLE_flush_buffer_range */ - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -#define __GLEE_GL_APPLE_flush_buffer_range 1 -/* Constants */ -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); -GLEE_EXTERN PFNGLBUFFERPARAMETERIAPPLEPROC pglBufferParameteriAPPLE; -GLEE_EXTERN PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC pglFlushMappedBufferRangeAPPLE; -#define glBufferParameteriAPPLE pglBufferParameteriAPPLE -#define glFlushMappedBufferRangeAPPLE pglFlushMappedBufferRangeAPPLE -#endif - -/* GL_NV_gpu_program4 */ - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -#define __GLEE_GL_NV_gpu_program4 1 -/* Constants */ -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint * params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint * params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint * params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint * params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint * params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint * params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint * params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint * params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint * params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint * params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint * params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint * params); -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERI4INVPROC pglProgramLocalParameterI4iNV; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC pglProgramLocalParameterI4ivNV; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC pglProgramLocalParametersI4ivNV; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERI4UINVPROC pglProgramLocalParameterI4uiNV; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC pglProgramLocalParameterI4uivNV; -GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC pglProgramLocalParametersI4uivNV; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETERI4INVPROC pglProgramEnvParameterI4iNV; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETERI4IVNVPROC pglProgramEnvParameterI4ivNV; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETERSI4IVNVPROC pglProgramEnvParametersI4ivNV; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETERI4UINVPROC pglProgramEnvParameterI4uiNV; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETERI4UIVNVPROC pglProgramEnvParameterI4uivNV; -GLEE_EXTERN PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC pglProgramEnvParametersI4uivNV; -GLEE_EXTERN PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC pglGetProgramLocalParameterIivNV; -GLEE_EXTERN PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC pglGetProgramLocalParameterIuivNV; -GLEE_EXTERN PFNGLGETPROGRAMENVPARAMETERIIVNVPROC pglGetProgramEnvParameterIivNV; -GLEE_EXTERN PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC pglGetProgramEnvParameterIuivNV; -#define glProgramLocalParameterI4iNV pglProgramLocalParameterI4iNV -#define glProgramLocalParameterI4ivNV pglProgramLocalParameterI4ivNV -#define glProgramLocalParametersI4ivNV pglProgramLocalParametersI4ivNV -#define glProgramLocalParameterI4uiNV pglProgramLocalParameterI4uiNV -#define glProgramLocalParameterI4uivNV pglProgramLocalParameterI4uivNV -#define glProgramLocalParametersI4uivNV pglProgramLocalParametersI4uivNV -#define glProgramEnvParameterI4iNV pglProgramEnvParameterI4iNV -#define glProgramEnvParameterI4ivNV pglProgramEnvParameterI4ivNV -#define glProgramEnvParametersI4ivNV pglProgramEnvParametersI4ivNV -#define glProgramEnvParameterI4uiNV pglProgramEnvParameterI4uiNV -#define glProgramEnvParameterI4uivNV pglProgramEnvParameterI4uivNV -#define glProgramEnvParametersI4uivNV pglProgramEnvParametersI4uivNV -#define glGetProgramLocalParameterIivNV pglGetProgramLocalParameterIivNV -#define glGetProgramLocalParameterIuivNV pglGetProgramLocalParameterIuivNV -#define glGetProgramEnvParameterIivNV pglGetProgramEnvParameterIivNV -#define glGetProgramEnvParameterIuivNV pglGetProgramEnvParameterIuivNV -#endif - -/* GL_NV_geometry_program4 */ - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -#define __GLEE_GL_NV_geometry_program4 1 -/* Constants */ -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLEE_EXTERN PFNGLPROGRAMVERTEXLIMITNVPROC pglProgramVertexLimitNV; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTUREEXTPROC pglFramebufferTextureEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC pglFramebufferTextureLayerEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC pglFramebufferTextureFaceEXT; -#define glProgramVertexLimitNV pglProgramVertexLimitNV -#define glFramebufferTextureEXT pglFramebufferTextureEXT -#define glFramebufferTextureLayerEXT pglFramebufferTextureLayerEXT -#define glFramebufferTextureFaceEXT pglFramebufferTextureFaceEXT -#endif - -/* GL_EXT_geometry_shader4 */ - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -#define __GLEE_GL_EXT_geometry_shader4 1 -/* Constants */ -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -GLEE_EXTERN PFNGLPROGRAMPARAMETERIEXTPROC pglProgramParameteriEXT; -#define glProgramParameteriEXT pglProgramParameteriEXT -#endif - -/* GL_NV_vertex_program4 */ - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -#define __GLEE_GL_NV_vertex_program4 1 -/* Constants */ -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort * v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint * params); -GLEE_EXTERN PFNGLVERTEXATTRIBI1IEXTPROC pglVertexAttribI1iEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI2IEXTPROC pglVertexAttribI2iEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI3IEXTPROC pglVertexAttribI3iEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI4IEXTPROC pglVertexAttribI4iEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI1UIEXTPROC pglVertexAttribI1uiEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI2UIEXTPROC pglVertexAttribI2uiEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI3UIEXTPROC pglVertexAttribI3uiEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI4UIEXTPROC pglVertexAttribI4uiEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI1IVEXTPROC pglVertexAttribI1ivEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI2IVEXTPROC pglVertexAttribI2ivEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI3IVEXTPROC pglVertexAttribI3ivEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI4IVEXTPROC pglVertexAttribI4ivEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI1UIVEXTPROC pglVertexAttribI1uivEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI2UIVEXTPROC pglVertexAttribI2uivEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI3UIVEXTPROC pglVertexAttribI3uivEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI4UIVEXTPROC pglVertexAttribI4uivEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI4BVEXTPROC pglVertexAttribI4bvEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI4SVEXTPROC pglVertexAttribI4svEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI4UBVEXTPROC pglVertexAttribI4ubvEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBI4USVEXTPROC pglVertexAttribI4usvEXT; -GLEE_EXTERN PFNGLVERTEXATTRIBIPOINTEREXTPROC pglVertexAttribIPointerEXT; -GLEE_EXTERN PFNGLGETVERTEXATTRIBIIVEXTPROC pglGetVertexAttribIivEXT; -GLEE_EXTERN PFNGLGETVERTEXATTRIBIUIVEXTPROC pglGetVertexAttribIuivEXT; -#define glVertexAttribI1iEXT pglVertexAttribI1iEXT -#define glVertexAttribI2iEXT pglVertexAttribI2iEXT -#define glVertexAttribI3iEXT pglVertexAttribI3iEXT -#define glVertexAttribI4iEXT pglVertexAttribI4iEXT -#define glVertexAttribI1uiEXT pglVertexAttribI1uiEXT -#define glVertexAttribI2uiEXT pglVertexAttribI2uiEXT -#define glVertexAttribI3uiEXT pglVertexAttribI3uiEXT -#define glVertexAttribI4uiEXT pglVertexAttribI4uiEXT -#define glVertexAttribI1ivEXT pglVertexAttribI1ivEXT -#define glVertexAttribI2ivEXT pglVertexAttribI2ivEXT -#define glVertexAttribI3ivEXT pglVertexAttribI3ivEXT -#define glVertexAttribI4ivEXT pglVertexAttribI4ivEXT -#define glVertexAttribI1uivEXT pglVertexAttribI1uivEXT -#define glVertexAttribI2uivEXT pglVertexAttribI2uivEXT -#define glVertexAttribI3uivEXT pglVertexAttribI3uivEXT -#define glVertexAttribI4uivEXT pglVertexAttribI4uivEXT -#define glVertexAttribI4bvEXT pglVertexAttribI4bvEXT -#define glVertexAttribI4svEXT pglVertexAttribI4svEXT -#define glVertexAttribI4ubvEXT pglVertexAttribI4ubvEXT -#define glVertexAttribI4usvEXT pglVertexAttribI4usvEXT -#define glVertexAttribIPointerEXT pglVertexAttribIPointerEXT -#define glGetVertexAttribIivEXT pglGetVertexAttribIivEXT -#define glGetVertexAttribIuivEXT pglGetVertexAttribIuivEXT -#endif - -/* GL_EXT_gpu_shader4 */ - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -#define __GLEE_GL_EXT_gpu_shader4 1 -/* Constants */ -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint * params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar * name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint * value); -GLEE_EXTERN PFNGLGETUNIFORMUIVEXTPROC pglGetUniformuivEXT; -GLEE_EXTERN PFNGLBINDFRAGDATALOCATIONEXTPROC pglBindFragDataLocationEXT; -GLEE_EXTERN PFNGLGETFRAGDATALOCATIONEXTPROC pglGetFragDataLocationEXT; -GLEE_EXTERN PFNGLUNIFORM1UIEXTPROC pglUniform1uiEXT; -GLEE_EXTERN PFNGLUNIFORM2UIEXTPROC pglUniform2uiEXT; -GLEE_EXTERN PFNGLUNIFORM3UIEXTPROC pglUniform3uiEXT; -GLEE_EXTERN PFNGLUNIFORM4UIEXTPROC pglUniform4uiEXT; -GLEE_EXTERN PFNGLUNIFORM1UIVEXTPROC pglUniform1uivEXT; -GLEE_EXTERN PFNGLUNIFORM2UIVEXTPROC pglUniform2uivEXT; -GLEE_EXTERN PFNGLUNIFORM3UIVEXTPROC pglUniform3uivEXT; -GLEE_EXTERN PFNGLUNIFORM4UIVEXTPROC pglUniform4uivEXT; -#define glGetUniformuivEXT pglGetUniformuivEXT -#define glBindFragDataLocationEXT pglBindFragDataLocationEXT -#define glGetFragDataLocationEXT pglGetFragDataLocationEXT -#define glUniform1uiEXT pglUniform1uiEXT -#define glUniform2uiEXT pglUniform2uiEXT -#define glUniform3uiEXT pglUniform3uiEXT -#define glUniform4uiEXT pglUniform4uiEXT -#define glUniform1uivEXT pglUniform1uivEXT -#define glUniform2uivEXT pglUniform2uivEXT -#define glUniform3uivEXT pglUniform3uivEXT -#define glUniform4uivEXT pglUniform4uivEXT -#endif - -/* GL_EXT_drawinstanced */ - -#ifndef GL_EXT_drawinstanced -#define GL_EXT_drawinstanced 1 -#define __GLEE_GL_EXT_drawinstanced 1 -/* Constants */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount); -GLEE_EXTERN PFNGLDRAWARRAYSINSTANCEDEXTPROC pglDrawArraysInstancedEXT; -GLEE_EXTERN PFNGLDRAWELEMENTSINSTANCEDEXTPROC pglDrawElementsInstancedEXT; -#define glDrawArraysInstancedEXT pglDrawArraysInstancedEXT -#define glDrawElementsInstancedEXT pglDrawElementsInstancedEXT -#endif - -/* GL_EXT_packed_float */ - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -#define __GLEE_GL_EXT_packed_float 1 -/* Constants */ -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#endif - -/* GL_EXT_texture_array */ - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -#define __GLEE_GL_EXT_texture_array 1 -/* Constants */ -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -#endif - -/* GL_EXT_texture_buffer_object */ - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -#define __GLEE_GL_EXT_texture_buffer_object 1 -/* Constants */ -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -GLEE_EXTERN PFNGLTEXBUFFEREXTPROC pglTexBufferEXT; -#define glTexBufferEXT pglTexBufferEXT -#endif - -/* GL_EXT_texture_compression_latc */ - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -#define __GLEE_GL_EXT_texture_compression_latc 1 -/* Constants */ -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#endif - -/* GL_EXT_texture_compression_rgtc */ - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#define __GLEE_GL_EXT_texture_compression_rgtc 1 -/* Constants */ -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif - -/* GL_EXT_texture_shared_exponent */ - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -#define __GLEE_GL_EXT_texture_shared_exponent 1 -/* Constants */ -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#endif - -/* GL_NV_depth_buffer_float */ - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -#define __GLEE_GL_NV_depth_buffer_float 1 -/* Constants */ -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -GLEE_EXTERN PFNGLDEPTHRANGEDNVPROC pglDepthRangedNV; -GLEE_EXTERN PFNGLCLEARDEPTHDNVPROC pglClearDepthdNV; -GLEE_EXTERN PFNGLDEPTHBOUNDSDNVPROC pglDepthBoundsdNV; -#define glDepthRangedNV pglDepthRangedNV -#define glClearDepthdNV pglClearDepthdNV -#define glDepthBoundsdNV pglDepthBoundsdNV -#endif - -/* GL_NV_fragment_program4 */ - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -#define __GLEE_GL_NV_fragment_program4 1 -/* Constants */ -#endif - -/* GL_NV_framebuffer_multisample_coverage */ - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -#define __GLEE_GL_NV_framebuffer_multisample_coverage 1 -/* Constants */ -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC pglRenderbufferStorageMultisampleCoverageNV; -#define glRenderbufferStorageMultisampleCoverageNV pglRenderbufferStorageMultisampleCoverageNV -#endif - -/* GL_EXT_framebuffer_sRGB */ - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -#define __GLEE_GL_EXT_framebuffer_sRGB 1 -/* Constants */ -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#endif - -/* GL_NV_geometry_shader4 */ - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -#define __GLEE_GL_NV_geometry_shader4 1 -/* Constants */ -#endif - -/* GL_NV_parameter_buffer_object */ - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -#define __GLEE_GL_NV_parameter_buffer_object 1 -/* Constants */ -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat * params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint * params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint * params); -GLEE_EXTERN PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC pglProgramBufferParametersfvNV; -GLEE_EXTERN PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC pglProgramBufferParametersIivNV; -GLEE_EXTERN PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC pglProgramBufferParametersIuivNV; -#define glProgramBufferParametersfvNV pglProgramBufferParametersfvNV -#define glProgramBufferParametersIivNV pglProgramBufferParametersIivNV -#define glProgramBufferParametersIuivNV pglProgramBufferParametersIuivNV -#endif - -/* GL_EXT_draw_buffers2 */ - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -#define __GLEE_GL_EXT_draw_buffers2 1 -/* Constants */ -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean * data); -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint * data); -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); -GLEE_EXTERN PFNGLCOLORMASKINDEXEDEXTPROC pglColorMaskIndexedEXT; -GLEE_EXTERN PFNGLGETBOOLEANINDEXEDVEXTPROC pglGetBooleanIndexedvEXT; -GLEE_EXTERN PFNGLGETINTEGERINDEXEDVEXTPROC pglGetIntegerIndexedvEXT; -GLEE_EXTERN PFNGLENABLEINDEXEDEXTPROC pglEnableIndexedEXT; -GLEE_EXTERN PFNGLDISABLEINDEXEDEXTPROC pglDisableIndexedEXT; -GLEE_EXTERN PFNGLISENABLEDINDEXEDEXTPROC pglIsEnabledIndexedEXT; -#define glColorMaskIndexedEXT pglColorMaskIndexedEXT -#define glGetBooleanIndexedvEXT pglGetBooleanIndexedvEXT -#define glGetIntegerIndexedvEXT pglGetIntegerIndexedvEXT -#define glEnableIndexedEXT pglEnableIndexedEXT -#define glDisableIndexedEXT pglDisableIndexedEXT -#define glIsEnabledIndexedEXT pglIsEnabledIndexedEXT -#endif - -/* GL_NV_transform_feedback */ - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -#define __GLEE_GL_NV_transform_feedback 1 -/* Constants */ -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint * attribs, GLenum bufferMode); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar * name); -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint * location); -GLEE_EXTERN PFNGLBEGINTRANSFORMFEEDBACKNVPROC pglBeginTransformFeedbackNV; -GLEE_EXTERN PFNGLENDTRANSFORMFEEDBACKNVPROC pglEndTransformFeedbackNV; -GLEE_EXTERN PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC pglTransformFeedbackAttribsNV; -GLEE_EXTERN PFNGLBINDBUFFERRANGENVPROC pglBindBufferRangeNV; -GLEE_EXTERN PFNGLBINDBUFFEROFFSETNVPROC pglBindBufferOffsetNV; -GLEE_EXTERN PFNGLBINDBUFFERBASENVPROC pglBindBufferBaseNV; -GLEE_EXTERN PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC pglTransformFeedbackVaryingsNV; -GLEE_EXTERN PFNGLACTIVEVARYINGNVPROC pglActiveVaryingNV; -GLEE_EXTERN PFNGLGETVARYINGLOCATIONNVPROC pglGetVaryingLocationNV; -GLEE_EXTERN PFNGLGETACTIVEVARYINGNVPROC pglGetActiveVaryingNV; -GLEE_EXTERN PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC pglGetTransformFeedbackVaryingNV; -#define glBeginTransformFeedbackNV pglBeginTransformFeedbackNV -#define glEndTransformFeedbackNV pglEndTransformFeedbackNV -#define glTransformFeedbackAttribsNV pglTransformFeedbackAttribsNV -#define glBindBufferRangeNV pglBindBufferRangeNV -#define glBindBufferOffsetNV pglBindBufferOffsetNV -#define glBindBufferBaseNV pglBindBufferBaseNV -#define glTransformFeedbackVaryingsNV pglTransformFeedbackVaryingsNV -#define glActiveVaryingNV pglActiveVaryingNV -#define glGetVaryingLocationNV pglGetVaryingLocationNV -#define glGetActiveVaryingNV pglGetActiveVaryingNV -#define glGetTransformFeedbackVaryingNV pglGetTransformFeedbackVaryingNV -#endif - -/* GL_EXT_bindable_uniform */ - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -#define __GLEE_GL_EXT_bindable_uniform 1 -/* Constants */ -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -GLEE_EXTERN PFNGLUNIFORMBUFFEREXTPROC pglUniformBufferEXT; -GLEE_EXTERN PFNGLGETUNIFORMBUFFERSIZEEXTPROC pglGetUniformBufferSizeEXT; -GLEE_EXTERN PFNGLGETUNIFORMOFFSETEXTPROC pglGetUniformOffsetEXT; -#define glUniformBufferEXT pglUniformBufferEXT -#define glGetUniformBufferSizeEXT pglGetUniformBufferSizeEXT -#define glGetUniformOffsetEXT pglGetUniformOffsetEXT -#endif - -/* GL_EXT_texture_integer */ - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -#define __GLEE_GL_EXT_texture_integer 1 -/* Constants */ -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint * params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint * params); -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -GLEE_EXTERN PFNGLTEXPARAMETERIIVEXTPROC pglTexParameterIivEXT; -GLEE_EXTERN PFNGLTEXPARAMETERIUIVEXTPROC pglTexParameterIuivEXT; -GLEE_EXTERN PFNGLGETTEXPARAMETERIIVEXTPROC pglGetTexParameterIivEXT; -GLEE_EXTERN PFNGLGETTEXPARAMETERIUIVEXTPROC pglGetTexParameterIuivEXT; -GLEE_EXTERN PFNGLCLEARCOLORIIEXTPROC pglClearColorIiEXT; -GLEE_EXTERN PFNGLCLEARCOLORIUIEXTPROC pglClearColorIuiEXT; -#define glTexParameterIivEXT pglTexParameterIivEXT -#define glTexParameterIuivEXT pglTexParameterIuivEXT -#define glGetTexParameterIivEXT pglGetTexParameterIivEXT -#define glGetTexParameterIuivEXT pglGetTexParameterIuivEXT -#define glClearColorIiEXT pglClearColorIiEXT -#define glClearColorIuiEXT pglClearColorIuiEXT -#endif - -/* GL_GREMEDY_frame_terminator */ - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -#define __GLEE_GL_GREMEDY_frame_terminator 1 -/* Constants */ -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (); -GLEE_EXTERN PFNGLFRAMETERMINATORGREMEDYPROC pglFrameTerminatorGREMEDY; -#define glFrameTerminatorGREMEDY pglFrameTerminatorGREMEDY -#endif - -/* GL_NV_conditional_render */ - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#define __GLEE_GL_NV_conditional_render 1 -/* Constants */ -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (); -GLEE_EXTERN PFNGLBEGINCONDITIONALRENDERNVPROC pglBeginConditionalRenderNV; -GLEE_EXTERN PFNGLENDCONDITIONALRENDERNVPROC pglEndConditionalRenderNV; -#define glBeginConditionalRenderNV pglBeginConditionalRenderNV -#define glEndConditionalRenderNV pglEndConditionalRenderNV -#endif - -/* GL_NV_present_video */ - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -#define __GLEE_GL_NV_present_video 1 -/* Constants */ -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -#endif - -/* GL_EXT_transform_feedback */ - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -#define __GLEE_GL_EXT_transform_feedback 1 -/* Constants */ -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLint * location); -GLEE_EXTERN PFNGLBEGINTRANSFORMFEEDBACKEXTPROC pglBeginTransformFeedbackEXT; -GLEE_EXTERN PFNGLENDTRANSFORMFEEDBACKEXTPROC pglEndTransformFeedbackEXT; -GLEE_EXTERN PFNGLBINDBUFFERRANGEEXTPROC pglBindBufferRangeEXT; -GLEE_EXTERN PFNGLBINDBUFFEROFFSETEXTPROC pglBindBufferOffsetEXT; -GLEE_EXTERN PFNGLBINDBUFFERBASEEXTPROC pglBindBufferBaseEXT; -GLEE_EXTERN PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC pglTransformFeedbackVaryingsEXT; -GLEE_EXTERN PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC pglGetTransformFeedbackVaryingEXT; -#define glBeginTransformFeedbackEXT pglBeginTransformFeedbackEXT -#define glEndTransformFeedbackEXT pglEndTransformFeedbackEXT -#define glBindBufferRangeEXT pglBindBufferRangeEXT -#define glBindBufferOffsetEXT pglBindBufferOffsetEXT -#define glBindBufferBaseEXT pglBindBufferBaseEXT -#define glTransformFeedbackVaryingsEXT pglTransformFeedbackVaryingsEXT -#define glGetTransformFeedbackVaryingEXT pglGetTransformFeedbackVaryingEXT -#endif - -/* GL_EXT_direct_state_access */ - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -#define __GLEE_GL_EXT_direct_state_access 1 -/* Constants */ -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat * m); -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble * m); -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat * m); -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble * m); -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat * m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble * m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat * m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble * m); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble * params); -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat * params); -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble * params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat * params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat * data); -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble * data); -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* * data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid * img); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid * img); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid * string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble * params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat * params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble * params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat * params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid * string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat * params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint * params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint * params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint * params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint * params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint * params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint * params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint * params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint * params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint * params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint * params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint * params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint * value); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid * data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid * data); -typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* * params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data); -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint * params); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum * bufs); -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint * params); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -GLEE_EXTERN PFNGLCLIENTATTRIBDEFAULTEXTPROC pglClientAttribDefaultEXT; -GLEE_EXTERN PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC pglPushClientAttribDefaultEXT; -GLEE_EXTERN PFNGLMATRIXLOADFEXTPROC pglMatrixLoadfEXT; -GLEE_EXTERN PFNGLMATRIXLOADDEXTPROC pglMatrixLoaddEXT; -GLEE_EXTERN PFNGLMATRIXMULTFEXTPROC pglMatrixMultfEXT; -GLEE_EXTERN PFNGLMATRIXMULTDEXTPROC pglMatrixMultdEXT; -GLEE_EXTERN PFNGLMATRIXLOADIDENTITYEXTPROC pglMatrixLoadIdentityEXT; -GLEE_EXTERN PFNGLMATRIXROTATEFEXTPROC pglMatrixRotatefEXT; -GLEE_EXTERN PFNGLMATRIXROTATEDEXTPROC pglMatrixRotatedEXT; -GLEE_EXTERN PFNGLMATRIXSCALEFEXTPROC pglMatrixScalefEXT; -GLEE_EXTERN PFNGLMATRIXSCALEDEXTPROC pglMatrixScaledEXT; -GLEE_EXTERN PFNGLMATRIXTRANSLATEFEXTPROC pglMatrixTranslatefEXT; -GLEE_EXTERN PFNGLMATRIXTRANSLATEDEXTPROC pglMatrixTranslatedEXT; -GLEE_EXTERN PFNGLMATRIXFRUSTUMEXTPROC pglMatrixFrustumEXT; -GLEE_EXTERN PFNGLMATRIXORTHOEXTPROC pglMatrixOrthoEXT; -GLEE_EXTERN PFNGLMATRIXPOPEXTPROC pglMatrixPopEXT; -GLEE_EXTERN PFNGLMATRIXPUSHEXTPROC pglMatrixPushEXT; -GLEE_EXTERN PFNGLMATRIXLOADTRANSPOSEFEXTPROC pglMatrixLoadTransposefEXT; -GLEE_EXTERN PFNGLMATRIXLOADTRANSPOSEDEXTPROC pglMatrixLoadTransposedEXT; -GLEE_EXTERN PFNGLMATRIXMULTTRANSPOSEFEXTPROC pglMatrixMultTransposefEXT; -GLEE_EXTERN PFNGLMATRIXMULTTRANSPOSEDEXTPROC pglMatrixMultTransposedEXT; -GLEE_EXTERN PFNGLTEXTUREPARAMETERFEXTPROC pglTextureParameterfEXT; -GLEE_EXTERN PFNGLTEXTUREPARAMETERFVEXTPROC pglTextureParameterfvEXT; -GLEE_EXTERN PFNGLTEXTUREPARAMETERIEXTPROC pglTextureParameteriEXT; -GLEE_EXTERN PFNGLTEXTUREPARAMETERIVEXTPROC pglTextureParameterivEXT; -GLEE_EXTERN PFNGLTEXTUREIMAGE1DEXTPROC pglTextureImage1DEXT; -GLEE_EXTERN PFNGLTEXTUREIMAGE2DEXTPROC pglTextureImage2DEXT; -GLEE_EXTERN PFNGLTEXTURESUBIMAGE1DEXTPROC pglTextureSubImage1DEXT; -GLEE_EXTERN PFNGLTEXTURESUBIMAGE2DEXTPROC pglTextureSubImage2DEXT; -GLEE_EXTERN PFNGLCOPYTEXTUREIMAGE1DEXTPROC pglCopyTextureImage1DEXT; -GLEE_EXTERN PFNGLCOPYTEXTUREIMAGE2DEXTPROC pglCopyTextureImage2DEXT; -GLEE_EXTERN PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC pglCopyTextureSubImage1DEXT; -GLEE_EXTERN PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC pglCopyTextureSubImage2DEXT; -GLEE_EXTERN PFNGLGETTEXTUREIMAGEEXTPROC pglGetTextureImageEXT; -GLEE_EXTERN PFNGLGETTEXTUREPARAMETERFVEXTPROC pglGetTextureParameterfvEXT; -GLEE_EXTERN PFNGLGETTEXTUREPARAMETERIVEXTPROC pglGetTextureParameterivEXT; -GLEE_EXTERN PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC pglGetTextureLevelParameterfvEXT; -GLEE_EXTERN PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC pglGetTextureLevelParameterivEXT; -GLEE_EXTERN PFNGLTEXTUREIMAGE3DEXTPROC pglTextureImage3DEXT; -GLEE_EXTERN PFNGLTEXTURESUBIMAGE3DEXTPROC pglTextureSubImage3DEXT; -GLEE_EXTERN PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC pglCopyTextureSubImage3DEXT; -GLEE_EXTERN PFNGLMULTITEXPARAMETERFEXTPROC pglMultiTexParameterfEXT; -GLEE_EXTERN PFNGLMULTITEXPARAMETERFVEXTPROC pglMultiTexParameterfvEXT; -GLEE_EXTERN PFNGLMULTITEXPARAMETERIEXTPROC pglMultiTexParameteriEXT; -GLEE_EXTERN PFNGLMULTITEXPARAMETERIVEXTPROC pglMultiTexParameterivEXT; -GLEE_EXTERN PFNGLMULTITEXIMAGE1DEXTPROC pglMultiTexImage1DEXT; -GLEE_EXTERN PFNGLMULTITEXIMAGE2DEXTPROC pglMultiTexImage2DEXT; -GLEE_EXTERN PFNGLMULTITEXSUBIMAGE1DEXTPROC pglMultiTexSubImage1DEXT; -GLEE_EXTERN PFNGLMULTITEXSUBIMAGE2DEXTPROC pglMultiTexSubImage2DEXT; -GLEE_EXTERN PFNGLCOPYMULTITEXIMAGE1DEXTPROC pglCopyMultiTexImage1DEXT; -GLEE_EXTERN PFNGLCOPYMULTITEXIMAGE2DEXTPROC pglCopyMultiTexImage2DEXT; -GLEE_EXTERN PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC pglCopyMultiTexSubImage1DEXT; -GLEE_EXTERN PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC pglCopyMultiTexSubImage2DEXT; -GLEE_EXTERN PFNGLGETMULTITEXIMAGEEXTPROC pglGetMultiTexImageEXT; -GLEE_EXTERN PFNGLGETMULTITEXPARAMETERFVEXTPROC pglGetMultiTexParameterfvEXT; -GLEE_EXTERN PFNGLGETMULTITEXPARAMETERIVEXTPROC pglGetMultiTexParameterivEXT; -GLEE_EXTERN PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC pglGetMultiTexLevelParameterfvEXT; -GLEE_EXTERN PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC pglGetMultiTexLevelParameterivEXT; -GLEE_EXTERN PFNGLMULTITEXIMAGE3DEXTPROC pglMultiTexImage3DEXT; -GLEE_EXTERN PFNGLMULTITEXSUBIMAGE3DEXTPROC pglMultiTexSubImage3DEXT; -GLEE_EXTERN PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC pglCopyMultiTexSubImage3DEXT; -GLEE_EXTERN PFNGLBINDMULTITEXTUREEXTPROC pglBindMultiTextureEXT; -GLEE_EXTERN PFNGLENABLECLIENTSTATEINDEXEDEXTPROC pglEnableClientStateIndexedEXT; -GLEE_EXTERN PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC pglDisableClientStateIndexedEXT; -GLEE_EXTERN PFNGLMULTITEXCOORDPOINTEREXTPROC pglMultiTexCoordPointerEXT; -GLEE_EXTERN PFNGLMULTITEXENVFEXTPROC pglMultiTexEnvfEXT; -GLEE_EXTERN PFNGLMULTITEXENVFVEXTPROC pglMultiTexEnvfvEXT; -GLEE_EXTERN PFNGLMULTITEXENVIEXTPROC pglMultiTexEnviEXT; -GLEE_EXTERN PFNGLMULTITEXENVIVEXTPROC pglMultiTexEnvivEXT; -GLEE_EXTERN PFNGLMULTITEXGENDEXTPROC pglMultiTexGendEXT; -GLEE_EXTERN PFNGLMULTITEXGENDVEXTPROC pglMultiTexGendvEXT; -GLEE_EXTERN PFNGLMULTITEXGENFEXTPROC pglMultiTexGenfEXT; -GLEE_EXTERN PFNGLMULTITEXGENFVEXTPROC pglMultiTexGenfvEXT; -GLEE_EXTERN PFNGLMULTITEXGENIEXTPROC pglMultiTexGeniEXT; -GLEE_EXTERN PFNGLMULTITEXGENIVEXTPROC pglMultiTexGenivEXT; -GLEE_EXTERN PFNGLGETMULTITEXENVFVEXTPROC pglGetMultiTexEnvfvEXT; -GLEE_EXTERN PFNGLGETMULTITEXENVIVEXTPROC pglGetMultiTexEnvivEXT; -GLEE_EXTERN PFNGLGETMULTITEXGENDVEXTPROC pglGetMultiTexGendvEXT; -GLEE_EXTERN PFNGLGETMULTITEXGENFVEXTPROC pglGetMultiTexGenfvEXT; -GLEE_EXTERN PFNGLGETMULTITEXGENIVEXTPROC pglGetMultiTexGenivEXT; -GLEE_EXTERN PFNGLGETFLOATINDEXEDVEXTPROC pglGetFloatIndexedvEXT; -GLEE_EXTERN PFNGLGETDOUBLEINDEXEDVEXTPROC pglGetDoubleIndexedvEXT; -GLEE_EXTERN PFNGLGETPOINTERINDEXEDVEXTPROC pglGetPointerIndexedvEXT; -GLEE_EXTERN PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC pglCompressedTextureImage3DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC pglCompressedTextureImage2DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC pglCompressedTextureImage1DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC pglCompressedTextureSubImage3DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC pglCompressedTextureSubImage2DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC pglCompressedTextureSubImage1DEXT; -GLEE_EXTERN PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC pglGetCompressedTextureImageEXT; -GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC pglCompressedMultiTexImage3DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC pglCompressedMultiTexImage2DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC pglCompressedMultiTexImage1DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC pglCompressedMultiTexSubImage3DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC pglCompressedMultiTexSubImage2DEXT; -GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC pglCompressedMultiTexSubImage1DEXT; -GLEE_EXTERN PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC pglGetCompressedMultiTexImageEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMSTRINGEXTPROC pglNamedProgramStringEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC pglNamedProgramLocalParameter4dEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC pglNamedProgramLocalParameter4dvEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC pglNamedProgramLocalParameter4fEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC pglNamedProgramLocalParameter4fvEXT; -GLEE_EXTERN PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC pglGetNamedProgramLocalParameterdvEXT; -GLEE_EXTERN PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC pglGetNamedProgramLocalParameterfvEXT; -GLEE_EXTERN PFNGLGETNAMEDPROGRAMIVEXTPROC pglGetNamedProgramivEXT; -GLEE_EXTERN PFNGLGETNAMEDPROGRAMSTRINGEXTPROC pglGetNamedProgramStringEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC pglNamedProgramLocalParameters4fvEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC pglNamedProgramLocalParameterI4iEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC pglNamedProgramLocalParameterI4ivEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC pglNamedProgramLocalParametersI4ivEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC pglNamedProgramLocalParameterI4uiEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC pglNamedProgramLocalParameterI4uivEXT; -GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC pglNamedProgramLocalParametersI4uivEXT; -GLEE_EXTERN PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC pglGetNamedProgramLocalParameterIivEXT; -GLEE_EXTERN PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC pglGetNamedProgramLocalParameterIuivEXT; -GLEE_EXTERN PFNGLTEXTUREPARAMETERIIVEXTPROC pglTextureParameterIivEXT; -GLEE_EXTERN PFNGLTEXTUREPARAMETERIUIVEXTPROC pglTextureParameterIuivEXT; -GLEE_EXTERN PFNGLGETTEXTUREPARAMETERIIVEXTPROC pglGetTextureParameterIivEXT; -GLEE_EXTERN PFNGLGETTEXTUREPARAMETERIUIVEXTPROC pglGetTextureParameterIuivEXT; -GLEE_EXTERN PFNGLMULTITEXPARAMETERIIVEXTPROC pglMultiTexParameterIivEXT; -GLEE_EXTERN PFNGLMULTITEXPARAMETERIUIVEXTPROC pglMultiTexParameterIuivEXT; -GLEE_EXTERN PFNGLGETMULTITEXPARAMETERIIVEXTPROC pglGetMultiTexParameterIivEXT; -GLEE_EXTERN PFNGLGETMULTITEXPARAMETERIUIVEXTPROC pglGetMultiTexParameterIuivEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM1FEXTPROC pglProgramUniform1fEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM2FEXTPROC pglProgramUniform2fEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM3FEXTPROC pglProgramUniform3fEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM4FEXTPROC pglProgramUniform4fEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM1IEXTPROC pglProgramUniform1iEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM2IEXTPROC pglProgramUniform2iEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM3IEXTPROC pglProgramUniform3iEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM4IEXTPROC pglProgramUniform4iEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM1FVEXTPROC pglProgramUniform1fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM2FVEXTPROC pglProgramUniform2fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM3FVEXTPROC pglProgramUniform3fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM4FVEXTPROC pglProgramUniform4fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM1IVEXTPROC pglProgramUniform1ivEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM2IVEXTPROC pglProgramUniform2ivEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM3IVEXTPROC pglProgramUniform3ivEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM4IVEXTPROC pglProgramUniform4ivEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC pglProgramUniformMatrix2fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC pglProgramUniformMatrix3fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC pglProgramUniformMatrix4fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC pglProgramUniformMatrix2x3fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC pglProgramUniformMatrix3x2fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC pglProgramUniformMatrix2x4fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC pglProgramUniformMatrix4x2fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC pglProgramUniformMatrix3x4fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC pglProgramUniformMatrix4x3fvEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM1UIEXTPROC pglProgramUniform1uiEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM2UIEXTPROC pglProgramUniform2uiEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM3UIEXTPROC pglProgramUniform3uiEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM4UIEXTPROC pglProgramUniform4uiEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM1UIVEXTPROC pglProgramUniform1uivEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM2UIVEXTPROC pglProgramUniform2uivEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM3UIVEXTPROC pglProgramUniform3uivEXT; -GLEE_EXTERN PFNGLPROGRAMUNIFORM4UIVEXTPROC pglProgramUniform4uivEXT; -GLEE_EXTERN PFNGLNAMEDBUFFERDATAEXTPROC pglNamedBufferDataEXT; -GLEE_EXTERN PFNGLNAMEDBUFFERSUBDATAEXTPROC pglNamedBufferSubDataEXT; -GLEE_EXTERN PFNGLMAPNAMEDBUFFEREXTPROC pglMapNamedBufferEXT; -GLEE_EXTERN PFNGLUNMAPNAMEDBUFFEREXTPROC pglUnmapNamedBufferEXT; -GLEE_EXTERN PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC pglGetNamedBufferParameterivEXT; -GLEE_EXTERN PFNGLGETNAMEDBUFFERPOINTERVEXTPROC pglGetNamedBufferPointervEXT; -GLEE_EXTERN PFNGLGETNAMEDBUFFERSUBDATAEXTPROC pglGetNamedBufferSubDataEXT; -GLEE_EXTERN PFNGLTEXTUREBUFFEREXTPROC pglTextureBufferEXT; -GLEE_EXTERN PFNGLMULTITEXBUFFEREXTPROC pglMultiTexBufferEXT; -GLEE_EXTERN PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC pglNamedRenderbufferStorageEXT; -GLEE_EXTERN PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC pglGetNamedRenderbufferParameterivEXT; -GLEE_EXTERN PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC pglCheckNamedFramebufferStatusEXT; -GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC pglNamedFramebufferTexture1DEXT; -GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC pglNamedFramebufferTexture2DEXT; -GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC pglNamedFramebufferTexture3DEXT; -GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC pglNamedFramebufferRenderbufferEXT; -GLEE_EXTERN PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC pglGetNamedFramebufferAttachmentParameterivEXT; -GLEE_EXTERN PFNGLGENERATETEXTUREMIPMAPEXTPROC pglGenerateTextureMipmapEXT; -GLEE_EXTERN PFNGLGENERATEMULTITEXMIPMAPEXTPROC pglGenerateMultiTexMipmapEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC pglFramebufferDrawBufferEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC pglFramebufferDrawBuffersEXT; -GLEE_EXTERN PFNGLFRAMEBUFFERREADBUFFEREXTPROC pglFramebufferReadBufferEXT; -GLEE_EXTERN PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC pglGetFramebufferParameterivEXT; -GLEE_EXTERN PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pglNamedRenderbufferStorageMultisampleEXT; -GLEE_EXTERN PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC pglNamedRenderbufferStorageMultisampleCoverageEXT; -GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC pglNamedFramebufferTextureEXT; -GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC pglNamedFramebufferTextureLayerEXT; -GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC pglNamedFramebufferTextureFaceEXT; -GLEE_EXTERN PFNGLTEXTURERENDERBUFFEREXTPROC pglTextureRenderbufferEXT; -GLEE_EXTERN PFNGLMULTITEXRENDERBUFFEREXTPROC pglMultiTexRenderbufferEXT; -#define glClientAttribDefaultEXT pglClientAttribDefaultEXT -#define glPushClientAttribDefaultEXT pglPushClientAttribDefaultEXT -#define glMatrixLoadfEXT pglMatrixLoadfEXT -#define glMatrixLoaddEXT pglMatrixLoaddEXT -#define glMatrixMultfEXT pglMatrixMultfEXT -#define glMatrixMultdEXT pglMatrixMultdEXT -#define glMatrixLoadIdentityEXT pglMatrixLoadIdentityEXT -#define glMatrixRotatefEXT pglMatrixRotatefEXT -#define glMatrixRotatedEXT pglMatrixRotatedEXT -#define glMatrixScalefEXT pglMatrixScalefEXT -#define glMatrixScaledEXT pglMatrixScaledEXT -#define glMatrixTranslatefEXT pglMatrixTranslatefEXT -#define glMatrixTranslatedEXT pglMatrixTranslatedEXT -#define glMatrixFrustumEXT pglMatrixFrustumEXT -#define glMatrixOrthoEXT pglMatrixOrthoEXT -#define glMatrixPopEXT pglMatrixPopEXT -#define glMatrixPushEXT pglMatrixPushEXT -#define glMatrixLoadTransposefEXT pglMatrixLoadTransposefEXT -#define glMatrixLoadTransposedEXT pglMatrixLoadTransposedEXT -#define glMatrixMultTransposefEXT pglMatrixMultTransposefEXT -#define glMatrixMultTransposedEXT pglMatrixMultTransposedEXT -#define glTextureParameterfEXT pglTextureParameterfEXT -#define glTextureParameterfvEXT pglTextureParameterfvEXT -#define glTextureParameteriEXT pglTextureParameteriEXT -#define glTextureParameterivEXT pglTextureParameterivEXT -#define glTextureImage1DEXT pglTextureImage1DEXT -#define glTextureImage2DEXT pglTextureImage2DEXT -#define glTextureSubImage1DEXT pglTextureSubImage1DEXT -#define glTextureSubImage2DEXT pglTextureSubImage2DEXT -#define glCopyTextureImage1DEXT pglCopyTextureImage1DEXT -#define glCopyTextureImage2DEXT pglCopyTextureImage2DEXT -#define glCopyTextureSubImage1DEXT pglCopyTextureSubImage1DEXT -#define glCopyTextureSubImage2DEXT pglCopyTextureSubImage2DEXT -#define glGetTextureImageEXT pglGetTextureImageEXT -#define glGetTextureParameterfvEXT pglGetTextureParameterfvEXT -#define glGetTextureParameterivEXT pglGetTextureParameterivEXT -#define glGetTextureLevelParameterfvEXT pglGetTextureLevelParameterfvEXT -#define glGetTextureLevelParameterivEXT pglGetTextureLevelParameterivEXT -#define glTextureImage3DEXT pglTextureImage3DEXT -#define glTextureSubImage3DEXT pglTextureSubImage3DEXT -#define glCopyTextureSubImage3DEXT pglCopyTextureSubImage3DEXT -#define glMultiTexParameterfEXT pglMultiTexParameterfEXT -#define glMultiTexParameterfvEXT pglMultiTexParameterfvEXT -#define glMultiTexParameteriEXT pglMultiTexParameteriEXT -#define glMultiTexParameterivEXT pglMultiTexParameterivEXT -#define glMultiTexImage1DEXT pglMultiTexImage1DEXT -#define glMultiTexImage2DEXT pglMultiTexImage2DEXT -#define glMultiTexSubImage1DEXT pglMultiTexSubImage1DEXT -#define glMultiTexSubImage2DEXT pglMultiTexSubImage2DEXT -#define glCopyMultiTexImage1DEXT pglCopyMultiTexImage1DEXT -#define glCopyMultiTexImage2DEXT pglCopyMultiTexImage2DEXT -#define glCopyMultiTexSubImage1DEXT pglCopyMultiTexSubImage1DEXT -#define glCopyMultiTexSubImage2DEXT pglCopyMultiTexSubImage2DEXT -#define glGetMultiTexImageEXT pglGetMultiTexImageEXT -#define glGetMultiTexParameterfvEXT pglGetMultiTexParameterfvEXT -#define glGetMultiTexParameterivEXT pglGetMultiTexParameterivEXT -#define glGetMultiTexLevelParameterfvEXT pglGetMultiTexLevelParameterfvEXT -#define glGetMultiTexLevelParameterivEXT pglGetMultiTexLevelParameterivEXT -#define glMultiTexImage3DEXT pglMultiTexImage3DEXT -#define glMultiTexSubImage3DEXT pglMultiTexSubImage3DEXT -#define glCopyMultiTexSubImage3DEXT pglCopyMultiTexSubImage3DEXT -#define glBindMultiTextureEXT pglBindMultiTextureEXT -#define glEnableClientStateIndexedEXT pglEnableClientStateIndexedEXT -#define glDisableClientStateIndexedEXT pglDisableClientStateIndexedEXT -#define glMultiTexCoordPointerEXT pglMultiTexCoordPointerEXT -#define glMultiTexEnvfEXT pglMultiTexEnvfEXT -#define glMultiTexEnvfvEXT pglMultiTexEnvfvEXT -#define glMultiTexEnviEXT pglMultiTexEnviEXT -#define glMultiTexEnvivEXT pglMultiTexEnvivEXT -#define glMultiTexGendEXT pglMultiTexGendEXT -#define glMultiTexGendvEXT pglMultiTexGendvEXT -#define glMultiTexGenfEXT pglMultiTexGenfEXT -#define glMultiTexGenfvEXT pglMultiTexGenfvEXT -#define glMultiTexGeniEXT pglMultiTexGeniEXT -#define glMultiTexGenivEXT pglMultiTexGenivEXT -#define glGetMultiTexEnvfvEXT pglGetMultiTexEnvfvEXT -#define glGetMultiTexEnvivEXT pglGetMultiTexEnvivEXT -#define glGetMultiTexGendvEXT pglGetMultiTexGendvEXT -#define glGetMultiTexGenfvEXT pglGetMultiTexGenfvEXT -#define glGetMultiTexGenivEXT pglGetMultiTexGenivEXT -#define glGetFloatIndexedvEXT pglGetFloatIndexedvEXT -#define glGetDoubleIndexedvEXT pglGetDoubleIndexedvEXT -#define glGetPointerIndexedvEXT pglGetPointerIndexedvEXT -#define glCompressedTextureImage3DEXT pglCompressedTextureImage3DEXT -#define glCompressedTextureImage2DEXT pglCompressedTextureImage2DEXT -#define glCompressedTextureImage1DEXT pglCompressedTextureImage1DEXT -#define glCompressedTextureSubImage3DEXT pglCompressedTextureSubImage3DEXT -#define glCompressedTextureSubImage2DEXT pglCompressedTextureSubImage2DEXT -#define glCompressedTextureSubImage1DEXT pglCompressedTextureSubImage1DEXT -#define glGetCompressedTextureImageEXT pglGetCompressedTextureImageEXT -#define glCompressedMultiTexImage3DEXT pglCompressedMultiTexImage3DEXT -#define glCompressedMultiTexImage2DEXT pglCompressedMultiTexImage2DEXT -#define glCompressedMultiTexImage1DEXT pglCompressedMultiTexImage1DEXT -#define glCompressedMultiTexSubImage3DEXT pglCompressedMultiTexSubImage3DEXT -#define glCompressedMultiTexSubImage2DEXT pglCompressedMultiTexSubImage2DEXT -#define glCompressedMultiTexSubImage1DEXT pglCompressedMultiTexSubImage1DEXT -#define glGetCompressedMultiTexImageEXT pglGetCompressedMultiTexImageEXT -#define glNamedProgramStringEXT pglNamedProgramStringEXT -#define glNamedProgramLocalParameter4dEXT pglNamedProgramLocalParameter4dEXT -#define glNamedProgramLocalParameter4dvEXT pglNamedProgramLocalParameter4dvEXT -#define glNamedProgramLocalParameter4fEXT pglNamedProgramLocalParameter4fEXT -#define glNamedProgramLocalParameter4fvEXT pglNamedProgramLocalParameter4fvEXT -#define glGetNamedProgramLocalParameterdvEXT pglGetNamedProgramLocalParameterdvEXT -#define glGetNamedProgramLocalParameterfvEXT pglGetNamedProgramLocalParameterfvEXT -#define glGetNamedProgramivEXT pglGetNamedProgramivEXT -#define glGetNamedProgramStringEXT pglGetNamedProgramStringEXT -#define glNamedProgramLocalParameters4fvEXT pglNamedProgramLocalParameters4fvEXT -#define glNamedProgramLocalParameterI4iEXT pglNamedProgramLocalParameterI4iEXT -#define glNamedProgramLocalParameterI4ivEXT pglNamedProgramLocalParameterI4ivEXT -#define glNamedProgramLocalParametersI4ivEXT pglNamedProgramLocalParametersI4ivEXT -#define glNamedProgramLocalParameterI4uiEXT pglNamedProgramLocalParameterI4uiEXT -#define glNamedProgramLocalParameterI4uivEXT pglNamedProgramLocalParameterI4uivEXT -#define glNamedProgramLocalParametersI4uivEXT pglNamedProgramLocalParametersI4uivEXT -#define glGetNamedProgramLocalParameterIivEXT pglGetNamedProgramLocalParameterIivEXT -#define glGetNamedProgramLocalParameterIuivEXT pglGetNamedProgramLocalParameterIuivEXT -#define glTextureParameterIivEXT pglTextureParameterIivEXT -#define glTextureParameterIuivEXT pglTextureParameterIuivEXT -#define glGetTextureParameterIivEXT pglGetTextureParameterIivEXT -#define glGetTextureParameterIuivEXT pglGetTextureParameterIuivEXT -#define glMultiTexParameterIivEXT pglMultiTexParameterIivEXT -#define glMultiTexParameterIuivEXT pglMultiTexParameterIuivEXT -#define glGetMultiTexParameterIivEXT pglGetMultiTexParameterIivEXT -#define glGetMultiTexParameterIuivEXT pglGetMultiTexParameterIuivEXT -#define glProgramUniform1fEXT pglProgramUniform1fEXT -#define glProgramUniform2fEXT pglProgramUniform2fEXT -#define glProgramUniform3fEXT pglProgramUniform3fEXT -#define glProgramUniform4fEXT pglProgramUniform4fEXT -#define glProgramUniform1iEXT pglProgramUniform1iEXT -#define glProgramUniform2iEXT pglProgramUniform2iEXT -#define glProgramUniform3iEXT pglProgramUniform3iEXT -#define glProgramUniform4iEXT pglProgramUniform4iEXT -#define glProgramUniform1fvEXT pglProgramUniform1fvEXT -#define glProgramUniform2fvEXT pglProgramUniform2fvEXT -#define glProgramUniform3fvEXT pglProgramUniform3fvEXT -#define glProgramUniform4fvEXT pglProgramUniform4fvEXT -#define glProgramUniform1ivEXT pglProgramUniform1ivEXT -#define glProgramUniform2ivEXT pglProgramUniform2ivEXT -#define glProgramUniform3ivEXT pglProgramUniform3ivEXT -#define glProgramUniform4ivEXT pglProgramUniform4ivEXT -#define glProgramUniformMatrix2fvEXT pglProgramUniformMatrix2fvEXT -#define glProgramUniformMatrix3fvEXT pglProgramUniformMatrix3fvEXT -#define glProgramUniformMatrix4fvEXT pglProgramUniformMatrix4fvEXT -#define glProgramUniformMatrix2x3fvEXT pglProgramUniformMatrix2x3fvEXT -#define glProgramUniformMatrix3x2fvEXT pglProgramUniformMatrix3x2fvEXT -#define glProgramUniformMatrix2x4fvEXT pglProgramUniformMatrix2x4fvEXT -#define glProgramUniformMatrix4x2fvEXT pglProgramUniformMatrix4x2fvEXT -#define glProgramUniformMatrix3x4fvEXT pglProgramUniformMatrix3x4fvEXT -#define glProgramUniformMatrix4x3fvEXT pglProgramUniformMatrix4x3fvEXT -#define glProgramUniform1uiEXT pglProgramUniform1uiEXT -#define glProgramUniform2uiEXT pglProgramUniform2uiEXT -#define glProgramUniform3uiEXT pglProgramUniform3uiEXT -#define glProgramUniform4uiEXT pglProgramUniform4uiEXT -#define glProgramUniform1uivEXT pglProgramUniform1uivEXT -#define glProgramUniform2uivEXT pglProgramUniform2uivEXT -#define glProgramUniform3uivEXT pglProgramUniform3uivEXT -#define glProgramUniform4uivEXT pglProgramUniform4uivEXT -#define glNamedBufferDataEXT pglNamedBufferDataEXT -#define glNamedBufferSubDataEXT pglNamedBufferSubDataEXT -#define glMapNamedBufferEXT pglMapNamedBufferEXT -#define glUnmapNamedBufferEXT pglUnmapNamedBufferEXT -#define glGetNamedBufferParameterivEXT pglGetNamedBufferParameterivEXT -#define glGetNamedBufferPointervEXT pglGetNamedBufferPointervEXT -#define glGetNamedBufferSubDataEXT pglGetNamedBufferSubDataEXT -#define glTextureBufferEXT pglTextureBufferEXT -#define glMultiTexBufferEXT pglMultiTexBufferEXT -#define glNamedRenderbufferStorageEXT pglNamedRenderbufferStorageEXT -#define glGetNamedRenderbufferParameterivEXT pglGetNamedRenderbufferParameterivEXT -#define glCheckNamedFramebufferStatusEXT pglCheckNamedFramebufferStatusEXT -#define glNamedFramebufferTexture1DEXT pglNamedFramebufferTexture1DEXT -#define glNamedFramebufferTexture2DEXT pglNamedFramebufferTexture2DEXT -#define glNamedFramebufferTexture3DEXT pglNamedFramebufferTexture3DEXT -#define glNamedFramebufferRenderbufferEXT pglNamedFramebufferRenderbufferEXT -#define glGetNamedFramebufferAttachmentParameterivEXT pglGetNamedFramebufferAttachmentParameterivEXT -#define glGenerateTextureMipmapEXT pglGenerateTextureMipmapEXT -#define glGenerateMultiTexMipmapEXT pglGenerateMultiTexMipmapEXT -#define glFramebufferDrawBufferEXT pglFramebufferDrawBufferEXT -#define glFramebufferDrawBuffersEXT pglFramebufferDrawBuffersEXT -#define glFramebufferReadBufferEXT pglFramebufferReadBufferEXT -#define glGetFramebufferParameterivEXT pglGetFramebufferParameterivEXT -#define glNamedRenderbufferStorageMultisampleEXT pglNamedRenderbufferStorageMultisampleEXT -#define glNamedRenderbufferStorageMultisampleCoverageEXT pglNamedRenderbufferStorageMultisampleCoverageEXT -#define glNamedFramebufferTextureEXT pglNamedFramebufferTextureEXT -#define glNamedFramebufferTextureLayerEXT pglNamedFramebufferTextureLayerEXT -#define glNamedFramebufferTextureFaceEXT pglNamedFramebufferTextureFaceEXT -#define glTextureRenderbufferEXT pglTextureRenderbufferEXT -#define glMultiTexRenderbufferEXT pglMultiTexRenderbufferEXT -#endif - -/* GL_EXT_vertex_array_bgra */ - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -#define __GLEE_GL_EXT_vertex_array_bgra 1 -/* Constants */ -#endif - -/* GL_SGIX_texture_select */ - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#define __GLEE_GL_SGIX_texture_select 1 -/* Constants */ -#endif - -/* GL_INGR_blend_func_separate */ - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -#define __GLEE_GL_INGR_blend_func_separate 1 -/* Constants */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLEE_EXTERN PFNGLBLENDFUNCSEPARATEINGRPROC pglBlendFuncSeparateINGR; -#define glBlendFuncSeparateINGR pglBlendFuncSeparateINGR -#endif - -/* GL_SGIX_depth_pass_instrument */ - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#define __GLEE_GL_SGIX_depth_pass_instrument 1 -/* Constants */ -#endif - -/* GL_SGIX_igloo_interface */ - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#define __GLEE_GL_SGIX_igloo_interface 1 -/* Constants */ -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid * params); -GLEE_EXTERN PFNGLIGLOOINTERFACESGIXPROC pglIglooInterfaceSGIX; -#define glIglooInterfaceSGIX pglIglooInterfaceSGIX -#endif - -/* GL_EXT_fragment_lighting */ - -#ifndef GL_EXT_fragment_lighting -#define GL_EXT_fragment_lighting 1 -#define __GLEE_GL_EXT_fragment_lighting 1 -/* Constants */ -#define GL_FRAGMENT_LIGHTING_EXT 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 -#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 -#define GL_LIGHT_ENV_MODE_EXT 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B -#define GL_FRAGMENT_LIGHT0_EXT 0x840C -#define GL_FRAGMENT_LIGHT7_EXT 0x8413 -typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint * params); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat * params); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint * params); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat * params); -typedef GLvoid (APIENTRYP PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint * params); -typedef GLvoid (APIENTRYP PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat * params); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat * params); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint * params); -typedef GLvoid (APIENTRYP PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); -typedef GLvoid (APIENTRYP PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat * params); -typedef GLvoid (APIENTRYP PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint * params); -typedef GLvoid (APIENTRYP PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); -GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELIEXTPROC pglFragmentLightModeliEXT; -GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELFEXTPROC pglFragmentLightModelfEXT; -GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELIVEXTPROC pglFragmentLightModelivEXT; -GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELFVEXTPROC pglFragmentLightModelfvEXT; -GLEE_EXTERN PFNGLFRAGMENTLIGHTIEXTPROC pglFragmentLightiEXT; -GLEE_EXTERN PFNGLFRAGMENTLIGHTFEXTPROC pglFragmentLightfEXT; -GLEE_EXTERN PFNGLFRAGMENTLIGHTIVEXTPROC pglFragmentLightivEXT; -GLEE_EXTERN PFNGLFRAGMENTLIGHTFVEXTPROC pglFragmentLightfvEXT; -GLEE_EXTERN PFNGLGETFRAGMENTLIGHTIVEXTPROC pglGetFragmentLightivEXT; -GLEE_EXTERN PFNGLGETFRAGMENTLIGHTFVEXTPROC pglGetFragmentLightfvEXT; -GLEE_EXTERN PFNGLFRAGMENTMATERIALFEXTPROC pglFragmentMaterialfEXT; -GLEE_EXTERN PFNGLFRAGMENTMATERIALIEXTPROC pglFragmentMaterialiEXT; -GLEE_EXTERN PFNGLFRAGMENTMATERIALFVEXTPROC pglFragmentMaterialfvEXT; -GLEE_EXTERN PFNGLFRAGMENTMATERIALIVEXTPROC pglFragmentMaterialivEXT; -GLEE_EXTERN PFNGLFRAGMENTCOLORMATERIALEXTPROC pglFragmentColorMaterialEXT; -GLEE_EXTERN PFNGLGETFRAGMENTMATERIALFVEXTPROC pglGetFragmentMaterialfvEXT; -GLEE_EXTERN PFNGLGETFRAGMENTMATERIALIVEXTPROC pglGetFragmentMaterialivEXT; -GLEE_EXTERN PFNGLLIGHTENVIEXTPROC pglLightEnviEXT; -#define glFragmentLightModeliEXT pglFragmentLightModeliEXT -#define glFragmentLightModelfEXT pglFragmentLightModelfEXT -#define glFragmentLightModelivEXT pglFragmentLightModelivEXT -#define glFragmentLightModelfvEXT pglFragmentLightModelfvEXT -#define glFragmentLightiEXT pglFragmentLightiEXT -#define glFragmentLightfEXT pglFragmentLightfEXT -#define glFragmentLightivEXT pglFragmentLightivEXT -#define glFragmentLightfvEXT pglFragmentLightfvEXT -#define glGetFragmentLightivEXT pglGetFragmentLightivEXT -#define glGetFragmentLightfvEXT pglGetFragmentLightfvEXT -#define glFragmentMaterialfEXT pglFragmentMaterialfEXT -#define glFragmentMaterialiEXT pglFragmentMaterialiEXT -#define glFragmentMaterialfvEXT pglFragmentMaterialfvEXT -#define glFragmentMaterialivEXT pglFragmentMaterialivEXT -#define glFragmentColorMaterialEXT pglFragmentColorMaterialEXT -#define glGetFragmentMaterialfvEXT pglGetFragmentMaterialfvEXT -#define glGetFragmentMaterialivEXT pglGetFragmentMaterialivEXT -#define glLightEnviEXT pglLightEnviEXT -#endif - -/* GL_EXT_scene_marker */ - -#ifndef GL_EXT_scene_marker -#define GL_EXT_scene_marker 1 -#define __GLEE_GL_EXT_scene_marker 1 -/* Constants */ -typedef GLvoid (APIENTRYP PFNGLBEGINSCENEEXTPROC) (); -typedef GLvoid (APIENTRYP PFNGLENDSCENEEXTPROC) (); -GLEE_EXTERN PFNGLBEGINSCENEEXTPROC pglBeginSceneEXT; -GLEE_EXTERN PFNGLENDSCENEEXTPROC pglEndSceneEXT; -#define glBeginSceneEXT pglBeginSceneEXT -#define glEndSceneEXT pglEndSceneEXT -#endif - -/* GL_EXT_texture_compression_dxt1 */ - -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_EXT_texture_compression_dxt1 1 -#define __GLEE_GL_EXT_texture_compression_dxt1 1 -/* Constants */ -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#endif - -/* GL_EXT_texture_env */ - -#ifndef GL_EXT_texture_env -#define GL_EXT_texture_env 1 -#define __GLEE_GL_EXT_texture_env 1 -/* Constants */ -#define GL_TEXTURE_ENV0_EXT 0 -#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 -#define GL_ENV_COPY_EXT 0 -#define GL_ENV_REPLACE_EXT 0 -#define GL_ENV_MODULATE_EXT 0 -#define GL_ENV_ADD_EXT 0 -#define GL_ENV_SUBTRACT_EXT 0 -#define GL_ENV_REVERSE_SUBTRACT_EXT 0 -#define GL_ENV_BLEND_EXT 0 -#define GL_ENV_REVERSE_BLEND_EXT 0 -#define GL_TEXTURE_ENV_SHIFT_EXT 0 -#endif - -/* GL_IBM_static_data */ - -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 -#define __GLEE_GL_IBM_static_data 1 -/* Constants */ -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 -#endif - -/* GL_OES_byte_coordinates */ - -#ifndef GL_OES_byte_coordinates -#define GL_OES_byte_coordinates 1 -#define __GLEE_GL_OES_byte_coordinates 1 -/* Constants */ -#define GL_BYTE 0x1400 -#endif - -/* GL_OES_compressed_paletted_texture */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -#define __GLEE_GL_OES_compressed_paletted_texture 1 -/* Constants */ -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif - -/* GL_OES_single_precision */ - -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 -#define __GLEE_GL_OES_single_precision 1 -/* Constants */ -typedef GLvoid (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); -typedef GLvoid (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef GLvoid (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef GLvoid (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); -typedef GLvoid (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); -typedef GLvoid (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); -GLEE_EXTERN PFNGLDEPTHRANGEFOESPROC pglDepthRangefOES; -GLEE_EXTERN PFNGLFRUSTUMFOESPROC pglFrustumfOES; -GLEE_EXTERN PFNGLORTHOFOESPROC pglOrthofOES; -GLEE_EXTERN PFNGLCLIPPLANEFOESPROC pglClipPlanefOES; -GLEE_EXTERN PFNGLGETCLIPPLANEFOESPROC pglGetClipPlanefOES; -GLEE_EXTERN PFNGLCLEARDEPTHFOESPROC pglClearDepthfOES; -#define glDepthRangefOES pglDepthRangefOES -#define glFrustumfOES pglFrustumfOES -#define glOrthofOES pglOrthofOES -#define glClipPlanefOES pglClipPlanefOES -#define glGetClipPlanefOES pglGetClipPlanefOES -#define glClearDepthfOES pglClearDepthfOES -#endif - -/* GL_SGIX_pixel_texture_bits */ - -#ifndef GL_SGIX_pixel_texture_bits -#define GL_SGIX_pixel_texture_bits 1 -#define __GLEE_GL_SGIX_pixel_texture_bits 1 -/* Constants */ -#endif - -/* GL_SGIX_texture_range */ - -#ifndef GL_SGIX_texture_range -#define GL_SGIX_texture_range 1 -#define __GLEE_GL_SGIX_texture_range 1 -/* Constants */ -#define GL_RGB_SIGNED_SGIX 0x85E0 -#define GL_RGBA_SIGNED_SGIX 0x85E1 -#define GL_ALPHA_SIGNED_SGIX 0x85E2 -#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 -#define GL_INTENSITY_SIGNED_SGIX 0x85E4 -#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 -#define GL_RGB16_SIGNED_SGIX 0x85E6 -#define GL_RGBA16_SIGNED_SGIX 0x85E7 -#define GL_ALPHA16_SIGNED_SGIX 0x85E8 -#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 -#define GL_INTENSITY16_SIGNED_SGIX 0x85EA -#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB -#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC -#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED -#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE -#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF -#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 -#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 -#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 -#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 -#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 -#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 -#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 -#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 -#define GL_MIN_LUMINANCE_SGIS 0x85F8 -#define GL_MAX_LUMINANCE_SGIS 0x85F9 -#define GL_MIN_INTENSITY_SGIS 0x85FA -#define GL_MAX_INTENSITY_SGIS 0x85FB -#endif - -/* WGL */ - -#ifdef WIN32 - -/* Extension querying variables */ - -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_buffer_region; -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_multisample; -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_extensions_string; -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_pixel_format; -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_make_current_read; -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_pbuffer; -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_render_texture; -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_pixel_format_float; -GLEE_EXTERN GLboolean _GLEE_WGL_ARB_create_context; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_make_current_read; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_pixel_format; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_pbuffer; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_depth_float; -GLEE_EXTERN GLboolean _GLEE_WGL_3DFX_multisample; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_multisample; -GLEE_EXTERN GLboolean _GLEE_WGL_I3D_digital_video_control; -GLEE_EXTERN GLboolean _GLEE_WGL_I3D_gamma; -GLEE_EXTERN GLboolean _GLEE_WGL_I3D_genlock; -GLEE_EXTERN GLboolean _GLEE_WGL_I3D_image_buffer; -GLEE_EXTERN GLboolean _GLEE_WGL_I3D_swap_frame_lock; -GLEE_EXTERN GLboolean _GLEE_WGL_NV_render_depth_texture; -GLEE_EXTERN GLboolean _GLEE_WGL_NV_render_texture_rectangle; -GLEE_EXTERN GLboolean _GLEE_WGL_ATI_pixel_format_float; -GLEE_EXTERN GLboolean _GLEE_WGL_NV_float_buffer; -GLEE_EXTERN GLboolean _GLEE_WGL_3DL_stereo_control; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_pixel_format_packed_float; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_framebuffer_sRGB; -GLEE_EXTERN GLboolean _GLEE_WGL_NV_present_video; -GLEE_EXTERN GLboolean _GLEE_WGL_NV_video_out; -GLEE_EXTERN GLboolean _GLEE_WGL_NV_swap_group; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_display_color_table; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_extensions_string; -GLEE_EXTERN GLboolean _GLEE_WGL_EXT_swap_control; -GLEE_EXTERN GLboolean _GLEE_WGL_NV_vertex_array_range; -GLEE_EXTERN GLboolean _GLEE_WGL_OML_sync_control; -GLEE_EXTERN GLboolean _GLEE_WGL_I3D_swap_frame_usage; -GLEE_EXTERN GLboolean _GLEE_WGL_NV_video_output; - -/* Aliases for extension querying variables */ - -#define GLEE_WGL_ARB_buffer_region GLeeEnabled(&_GLEE_WGL_ARB_buffer_region) -#define GLEE_WGL_ARB_multisample GLeeEnabled(&_GLEE_WGL_ARB_multisample) -#define GLEE_WGL_ARB_extensions_string GLeeEnabled(&_GLEE_WGL_ARB_extensions_string) -#define GLEE_WGL_ARB_pixel_format GLeeEnabled(&_GLEE_WGL_ARB_pixel_format) -#define GLEE_WGL_ARB_make_current_read GLeeEnabled(&_GLEE_WGL_ARB_make_current_read) -#define GLEE_WGL_ARB_pbuffer GLeeEnabled(&_GLEE_WGL_ARB_pbuffer) -#define GLEE_WGL_ARB_render_texture GLeeEnabled(&_GLEE_WGL_ARB_render_texture) -#define GLEE_WGL_ARB_pixel_format_float GLeeEnabled(&_GLEE_WGL_ARB_pixel_format_float) -#define GLEE_WGL_ARB_create_context GLeeEnabled(&_GLEE_WGL_ARB_create_context) -#define GLEE_WGL_EXT_make_current_read GLeeEnabled(&_GLEE_WGL_EXT_make_current_read) -#define GLEE_WGL_EXT_pixel_format GLeeEnabled(&_GLEE_WGL_EXT_pixel_format) -#define GLEE_WGL_EXT_pbuffer GLeeEnabled(&_GLEE_WGL_EXT_pbuffer) -#define GLEE_WGL_EXT_depth_float GLeeEnabled(&_GLEE_WGL_EXT_depth_float) -#define GLEE_WGL_3DFX_multisample GLeeEnabled(&_GLEE_WGL_3DFX_multisample) -#define GLEE_WGL_EXT_multisample GLeeEnabled(&_GLEE_WGL_EXT_multisample) -#define GLEE_WGL_I3D_digital_video_control GLeeEnabled(&_GLEE_WGL_I3D_digital_video_control) -#define GLEE_WGL_I3D_gamma GLeeEnabled(&_GLEE_WGL_I3D_gamma) -#define GLEE_WGL_I3D_genlock GLeeEnabled(&_GLEE_WGL_I3D_genlock) -#define GLEE_WGL_I3D_image_buffer GLeeEnabled(&_GLEE_WGL_I3D_image_buffer) -#define GLEE_WGL_I3D_swap_frame_lock GLeeEnabled(&_GLEE_WGL_I3D_swap_frame_lock) -#define GLEE_WGL_NV_render_depth_texture GLeeEnabled(&_GLEE_WGL_NV_render_depth_texture) -#define GLEE_WGL_NV_render_texture_rectangle GLeeEnabled(&_GLEE_WGL_NV_render_texture_rectangle) -#define GLEE_WGL_ATI_pixel_format_float GLeeEnabled(&_GLEE_WGL_ATI_pixel_format_float) -#define GLEE_WGL_NV_float_buffer GLeeEnabled(&_GLEE_WGL_NV_float_buffer) -#define GLEE_WGL_3DL_stereo_control GLeeEnabled(&_GLEE_WGL_3DL_stereo_control) -#define GLEE_WGL_EXT_pixel_format_packed_float GLeeEnabled(&_GLEE_WGL_EXT_pixel_format_packed_float) -#define GLEE_WGL_EXT_framebuffer_sRGB GLeeEnabled(&_GLEE_WGL_EXT_framebuffer_sRGB) -#define GLEE_WGL_NV_present_video GLeeEnabled(&_GLEE_WGL_NV_present_video) -#define GLEE_WGL_NV_video_out GLeeEnabled(&_GLEE_WGL_NV_video_out) -#define GLEE_WGL_NV_swap_group GLeeEnabled(&_GLEE_WGL_NV_swap_group) -#define GLEE_WGL_EXT_display_color_table GLeeEnabled(&_GLEE_WGL_EXT_display_color_table) -#define GLEE_WGL_EXT_extensions_string GLeeEnabled(&_GLEE_WGL_EXT_extensions_string) -#define GLEE_WGL_EXT_swap_control GLeeEnabled(&_GLEE_WGL_EXT_swap_control) -#define GLEE_WGL_NV_vertex_array_range GLeeEnabled(&_GLEE_WGL_NV_vertex_array_range) -#define GLEE_WGL_OML_sync_control GLeeEnabled(&_GLEE_WGL_OML_sync_control) -#define GLEE_WGL_I3D_swap_frame_usage GLeeEnabled(&_GLEE_WGL_I3D_swap_frame_usage) -#define GLEE_WGL_NV_video_output GLeeEnabled(&_GLEE_WGL_NV_video_output) - -/* WGL_ARB_buffer_region */ - -#ifndef WGL_ARB_buffer_region -#define WGL_ARB_buffer_region 1 -#define __GLEE_WGL_ARB_buffer_region 1 -/* Constants */ -#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 -#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 -#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 -#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 -typedef HANDLE (APIENTRYP PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); -typedef VOID (APIENTRYP PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); -typedef BOOL (APIENTRYP PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); -typedef BOOL (APIENTRYP PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); -GLEE_EXTERN PFNWGLCREATEBUFFERREGIONARBPROC pwglCreateBufferRegionARB; -GLEE_EXTERN PFNWGLDELETEBUFFERREGIONARBPROC pwglDeleteBufferRegionARB; -GLEE_EXTERN PFNWGLSAVEBUFFERREGIONARBPROC pwglSaveBufferRegionARB; -GLEE_EXTERN PFNWGLRESTOREBUFFERREGIONARBPROC pwglRestoreBufferRegionARB; -#define wglCreateBufferRegionARB pwglCreateBufferRegionARB -#define wglDeleteBufferRegionARB pwglDeleteBufferRegionARB -#define wglSaveBufferRegionARB pwglSaveBufferRegionARB -#define wglRestoreBufferRegionARB pwglRestoreBufferRegionARB -#endif - -/* WGL_ARB_multisample */ - -#ifndef WGL_ARB_multisample -#define WGL_ARB_multisample 1 -#define __GLEE_WGL_ARB_multisample 1 -/* Constants */ -#define WGL_SAMPLE_BUFFERS_ARB 0x2041 -#define WGL_SAMPLES_ARB 0x2042 -#endif - -/* WGL_ARB_extensions_string */ - -#ifndef WGL_ARB_extensions_string -#define WGL_ARB_extensions_string 1 -#define __GLEE_WGL_ARB_extensions_string 1 -/* Constants */ -typedef const char * (APIENTRYP PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); -GLEE_EXTERN PFNWGLGETEXTENSIONSSTRINGARBPROC pwglGetExtensionsStringARB; -#define wglGetExtensionsStringARB pwglGetExtensionsStringARB -#endif - -/* WGL_ARB_pixel_format */ - -#ifndef WGL_ARB_pixel_format -#define WGL_ARB_pixel_format 1 -#define __GLEE_WGL_ARB_pixel_format 1 -/* Constants */ -#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 -#define WGL_DRAW_TO_WINDOW_ARB 0x2001 -#define WGL_DRAW_TO_BITMAP_ARB 0x2002 -#define WGL_ACCELERATION_ARB 0x2003 -#define WGL_NEED_PALETTE_ARB 0x2004 -#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 -#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 -#define WGL_SWAP_METHOD_ARB 0x2007 -#define WGL_NUMBER_OVERLAYS_ARB 0x2008 -#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 -#define WGL_TRANSPARENT_ARB 0x200A -#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 -#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 -#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 -#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A -#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B -#define WGL_SHARE_DEPTH_ARB 0x200C -#define WGL_SHARE_STENCIL_ARB 0x200D -#define WGL_SHARE_ACCUM_ARB 0x200E -#define WGL_SUPPORT_GDI_ARB 0x200F -#define WGL_SUPPORT_OPENGL_ARB 0x2010 -#define WGL_DOUBLE_BUFFER_ARB 0x2011 -#define WGL_STEREO_ARB 0x2012 -#define WGL_PIXEL_TYPE_ARB 0x2013 -#define WGL_COLOR_BITS_ARB 0x2014 -#define WGL_RED_BITS_ARB 0x2015 -#define WGL_RED_SHIFT_ARB 0x2016 -#define WGL_GREEN_BITS_ARB 0x2017 -#define WGL_GREEN_SHIFT_ARB 0x2018 -#define WGL_BLUE_BITS_ARB 0x2019 -#define WGL_BLUE_SHIFT_ARB 0x201A -#define WGL_ALPHA_BITS_ARB 0x201B -#define WGL_ALPHA_SHIFT_ARB 0x201C -#define WGL_ACCUM_BITS_ARB 0x201D -#define WGL_ACCUM_RED_BITS_ARB 0x201E -#define WGL_ACCUM_GREEN_BITS_ARB 0x201F -#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 -#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 -#define WGL_DEPTH_BITS_ARB 0x2022 -#define WGL_STENCIL_BITS_ARB 0x2023 -#define WGL_AUX_BUFFERS_ARB 0x2024 -#define WGL_NO_ACCELERATION_ARB 0x2025 -#define WGL_GENERIC_ACCELERATION_ARB 0x2026 -#define WGL_FULL_ACCELERATION_ARB 0x2027 -#define WGL_SWAP_EXCHANGE_ARB 0x2028 -#define WGL_SWAP_COPY_ARB 0x2029 -#define WGL_SWAP_UNDEFINED_ARB 0x202A -#define WGL_TYPE_RGBA_ARB 0x202B -#define WGL_TYPE_COLORINDEX_ARB 0x202C -typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, int * piValues); -typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, FLOAT * pfValues); -typedef BOOL (APIENTRYP PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats); -GLEE_EXTERN PFNWGLGETPIXELFORMATATTRIBIVARBPROC pwglGetPixelFormatAttribivARB; -GLEE_EXTERN PFNWGLGETPIXELFORMATATTRIBFVARBPROC pwglGetPixelFormatAttribfvARB; -GLEE_EXTERN PFNWGLCHOOSEPIXELFORMATARBPROC pwglChoosePixelFormatARB; -#define wglGetPixelFormatAttribivARB pwglGetPixelFormatAttribivARB -#define wglGetPixelFormatAttribfvARB pwglGetPixelFormatAttribfvARB -#define wglChoosePixelFormatARB pwglChoosePixelFormatARB -#endif - -/* WGL_ARB_make_current_read */ - -#ifndef WGL_ARB_make_current_read -#define WGL_ARB_make_current_read 1 -#define __GLEE_WGL_ARB_make_current_read 1 -/* Constants */ -#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 -#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 -typedef BOOL (APIENTRYP PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); -typedef HDC (APIENTRYP PFNWGLGETCURRENTREADDCARBPROC) (); -GLEE_EXTERN PFNWGLMAKECONTEXTCURRENTARBPROC pwglMakeContextCurrentARB; -GLEE_EXTERN PFNWGLGETCURRENTREADDCARBPROC pwglGetCurrentReadDCARB; -#define wglMakeContextCurrentARB pwglMakeContextCurrentARB -#define wglGetCurrentReadDCARB pwglGetCurrentReadDCARB -#endif - -/* WGL_ARB_pbuffer */ - -#ifndef WGL_ARB_pbuffer -#define WGL_ARB_pbuffer 1 -#define __GLEE_WGL_ARB_pbuffer 1 -/* Constants */ -#define WGL_DRAW_TO_PBUFFER_ARB 0x202D -#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E -#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F -#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 -#define WGL_PBUFFER_LARGEST_ARB 0x2033 -#define WGL_PBUFFER_WIDTH_ARB 0x2034 -#define WGL_PBUFFER_HEIGHT_ARB 0x2035 -#define WGL_PBUFFER_LOST_ARB 0x2036 -typedef HPBUFFERARB (APIENTRYP PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList); -typedef HDC (APIENTRYP PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); -typedef int (APIENTRYP PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); -typedef BOOL (APIENTRYP PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); -typedef BOOL (APIENTRYP PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int * piValue); -GLEE_EXTERN PFNWGLCREATEPBUFFERARBPROC pwglCreatePbufferARB; -GLEE_EXTERN PFNWGLGETPBUFFERDCARBPROC pwglGetPbufferDCARB; -GLEE_EXTERN PFNWGLRELEASEPBUFFERDCARBPROC pwglReleasePbufferDCARB; -GLEE_EXTERN PFNWGLDESTROYPBUFFERARBPROC pwglDestroyPbufferARB; -GLEE_EXTERN PFNWGLQUERYPBUFFERARBPROC pwglQueryPbufferARB; -#define wglCreatePbufferARB pwglCreatePbufferARB -#define wglGetPbufferDCARB pwglGetPbufferDCARB -#define wglReleasePbufferDCARB pwglReleasePbufferDCARB -#define wglDestroyPbufferARB pwglDestroyPbufferARB -#define wglQueryPbufferARB pwglQueryPbufferARB -#endif - -/* WGL_ARB_render_texture */ - -#ifndef WGL_ARB_render_texture -#define WGL_ARB_render_texture 1 -#define __GLEE_WGL_ARB_render_texture 1 -/* Constants */ -#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 -#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 -#define WGL_TEXTURE_FORMAT_ARB 0x2072 -#define WGL_TEXTURE_TARGET_ARB 0x2073 -#define WGL_MIPMAP_TEXTURE_ARB 0x2074 -#define WGL_TEXTURE_RGB_ARB 0x2075 -#define WGL_TEXTURE_RGBA_ARB 0x2076 -#define WGL_NO_TEXTURE_ARB 0x2077 -#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 -#define WGL_TEXTURE_1D_ARB 0x2079 -#define WGL_TEXTURE_2D_ARB 0x207A -#define WGL_MIPMAP_LEVEL_ARB 0x207B -#define WGL_CUBE_MAP_FACE_ARB 0x207C -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 -#define WGL_FRONT_LEFT_ARB 0x2083 -#define WGL_FRONT_RIGHT_ARB 0x2084 -#define WGL_BACK_LEFT_ARB 0x2085 -#define WGL_BACK_RIGHT_ARB 0x2086 -#define WGL_AUX0_ARB 0x2087 -#define WGL_AUX1_ARB 0x2088 -#define WGL_AUX2_ARB 0x2089 -#define WGL_AUX3_ARB 0x208A -#define WGL_AUX4_ARB 0x208B -#define WGL_AUX5_ARB 0x208C -#define WGL_AUX6_ARB 0x208D -#define WGL_AUX7_ARB 0x208E -#define WGL_AUX8_ARB 0x208F -#define WGL_AUX9_ARB 0x2090 -typedef BOOL (APIENTRYP PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); -typedef BOOL (APIENTRYP PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); -typedef BOOL (APIENTRYP PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int * piAttribList); -GLEE_EXTERN PFNWGLBINDTEXIMAGEARBPROC pwglBindTexImageARB; -GLEE_EXTERN PFNWGLRELEASETEXIMAGEARBPROC pwglReleaseTexImageARB; -GLEE_EXTERN PFNWGLSETPBUFFERATTRIBARBPROC pwglSetPbufferAttribARB; -#define wglBindTexImageARB pwglBindTexImageARB -#define wglReleaseTexImageARB pwglReleaseTexImageARB -#define wglSetPbufferAttribARB pwglSetPbufferAttribARB -#endif - -/* WGL_ARB_pixel_format_float */ - -#ifndef WGL_ARB_pixel_format_float -#define WGL_ARB_pixel_format_float 1 -#define __GLEE_WGL_ARB_pixel_format_float 1 -/* Constants */ -#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 -#endif - -/* WGL_ARB_create_context */ - -#ifndef WGL_ARB_create_context -#define WGL_ARB_create_context 1 -#define __GLEE_WGL_ARB_create_context 1 -/* Constants */ -#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 -#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 -#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 -#define WGL_CONTEXT_FLAGS_ARB 0x2094 -#define ERROR_INVALID_VERSION_ARB 0x2095 -typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int * attribList); -GLEE_EXTERN PFNWGLCREATECONTEXTATTRIBSARBPROC pwglCreateContextAttribsARB; -#define wglCreateContextAttribsARB pwglCreateContextAttribsARB -#endif - -/* WGL_EXT_make_current_read */ - -#ifndef WGL_EXT_make_current_read -#define WGL_EXT_make_current_read 1 -#define __GLEE_WGL_EXT_make_current_read 1 -/* Constants */ -#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 -typedef BOOL (APIENTRYP PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); -typedef HDC (APIENTRYP PFNWGLGETCURRENTREADDCEXTPROC) (); -GLEE_EXTERN PFNWGLMAKECONTEXTCURRENTEXTPROC pwglMakeContextCurrentEXT; -GLEE_EXTERN PFNWGLGETCURRENTREADDCEXTPROC pwglGetCurrentReadDCEXT; -#define wglMakeContextCurrentEXT pwglMakeContextCurrentEXT -#define wglGetCurrentReadDCEXT pwglGetCurrentReadDCEXT -#endif - -/* WGL_EXT_pixel_format */ - -#ifndef WGL_EXT_pixel_format -#define WGL_EXT_pixel_format 1 -#define __GLEE_WGL_EXT_pixel_format 1 -/* Constants */ -#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 -#define WGL_DRAW_TO_WINDOW_EXT 0x2001 -#define WGL_DRAW_TO_BITMAP_EXT 0x2002 -#define WGL_ACCELERATION_EXT 0x2003 -#define WGL_NEED_PALETTE_EXT 0x2004 -#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 -#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 -#define WGL_SWAP_METHOD_EXT 0x2007 -#define WGL_NUMBER_OVERLAYS_EXT 0x2008 -#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 -#define WGL_TRANSPARENT_EXT 0x200A -#define WGL_TRANSPARENT_VALUE_EXT 0x200B -#define WGL_SHARE_DEPTH_EXT 0x200C -#define WGL_SHARE_STENCIL_EXT 0x200D -#define WGL_SHARE_ACCUM_EXT 0x200E -#define WGL_SUPPORT_GDI_EXT 0x200F -#define WGL_SUPPORT_OPENGL_EXT 0x2010 -#define WGL_DOUBLE_BUFFER_EXT 0x2011 -#define WGL_STEREO_EXT 0x2012 -#define WGL_PIXEL_TYPE_EXT 0x2013 -#define WGL_COLOR_BITS_EXT 0x2014 -#define WGL_RED_BITS_EXT 0x2015 -#define WGL_RED_SHIFT_EXT 0x2016 -#define WGL_GREEN_BITS_EXT 0x2017 -#define WGL_GREEN_SHIFT_EXT 0x2018 -#define WGL_BLUE_BITS_EXT 0x2019 -#define WGL_BLUE_SHIFT_EXT 0x201A -#define WGL_ALPHA_BITS_EXT 0x201B -#define WGL_ALPHA_SHIFT_EXT 0x201C -#define WGL_ACCUM_BITS_EXT 0x201D -#define WGL_ACCUM_RED_BITS_EXT 0x201E -#define WGL_ACCUM_GREEN_BITS_EXT 0x201F -#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 -#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 -#define WGL_DEPTH_BITS_EXT 0x2022 -#define WGL_STENCIL_BITS_EXT 0x2023 -#define WGL_AUX_BUFFERS_EXT 0x2024 -#define WGL_NO_ACCELERATION_EXT 0x2025 -#define WGL_GENERIC_ACCELERATION_EXT 0x2026 -#define WGL_FULL_ACCELERATION_EXT 0x2027 -#define WGL_SWAP_EXCHANGE_EXT 0x2028 -#define WGL_SWAP_COPY_EXT 0x2029 -#define WGL_SWAP_UNDEFINED_EXT 0x202A -#define WGL_TYPE_RGBA_EXT 0x202B -#define WGL_TYPE_COLORINDEX_EXT 0x202C -typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int * piAttributes, int * piValues); -typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int * piAttributes, FLOAT * pfValues); -typedef BOOL (APIENTRYP PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats); -GLEE_EXTERN PFNWGLGETPIXELFORMATATTRIBIVEXTPROC pwglGetPixelFormatAttribivEXT; -GLEE_EXTERN PFNWGLGETPIXELFORMATATTRIBFVEXTPROC pwglGetPixelFormatAttribfvEXT; -GLEE_EXTERN PFNWGLCHOOSEPIXELFORMATEXTPROC pwglChoosePixelFormatEXT; -#define wglGetPixelFormatAttribivEXT pwglGetPixelFormatAttribivEXT -#define wglGetPixelFormatAttribfvEXT pwglGetPixelFormatAttribfvEXT -#define wglChoosePixelFormatEXT pwglChoosePixelFormatEXT -#endif - -/* WGL_EXT_pbuffer */ - -#ifndef WGL_EXT_pbuffer -#define WGL_EXT_pbuffer 1 -#define __GLEE_WGL_EXT_pbuffer 1 -/* Constants */ -#define WGL_DRAW_TO_PBUFFER_EXT 0x202D -#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E -#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F -#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 -#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 -#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 -#define WGL_PBUFFER_LARGEST_EXT 0x2033 -#define WGL_PBUFFER_WIDTH_EXT 0x2034 -#define WGL_PBUFFER_HEIGHT_EXT 0x2035 -typedef HPBUFFEREXT (APIENTRYP PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList); -typedef HDC (APIENTRYP PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); -typedef int (APIENTRYP PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); -typedef BOOL (APIENTRYP PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); -typedef BOOL (APIENTRYP PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int * piValue); -GLEE_EXTERN PFNWGLCREATEPBUFFEREXTPROC pwglCreatePbufferEXT; -GLEE_EXTERN PFNWGLGETPBUFFERDCEXTPROC pwglGetPbufferDCEXT; -GLEE_EXTERN PFNWGLRELEASEPBUFFERDCEXTPROC pwglReleasePbufferDCEXT; -GLEE_EXTERN PFNWGLDESTROYPBUFFEREXTPROC pwglDestroyPbufferEXT; -GLEE_EXTERN PFNWGLQUERYPBUFFEREXTPROC pwglQueryPbufferEXT; -#define wglCreatePbufferEXT pwglCreatePbufferEXT -#define wglGetPbufferDCEXT pwglGetPbufferDCEXT -#define wglReleasePbufferDCEXT pwglReleasePbufferDCEXT -#define wglDestroyPbufferEXT pwglDestroyPbufferEXT -#define wglQueryPbufferEXT pwglQueryPbufferEXT -#endif - -/* WGL_EXT_depth_float */ - -#ifndef WGL_EXT_depth_float -#define WGL_EXT_depth_float 1 -#define __GLEE_WGL_EXT_depth_float 1 -/* Constants */ -#define WGL_DEPTH_FLOAT_EXT 0x2040 -#endif - -/* WGL_3DFX_multisample */ - -#ifndef WGL_3DFX_multisample -#define WGL_3DFX_multisample 1 -#define __GLEE_WGL_3DFX_multisample 1 -/* Constants */ -#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 -#define WGL_SAMPLES_3DFX 0x2061 -#endif - -/* WGL_EXT_multisample */ - -#ifndef WGL_EXT_multisample -#define WGL_EXT_multisample 1 -#define __GLEE_WGL_EXT_multisample 1 -/* Constants */ -#define WGL_SAMPLE_BUFFERS_EXT 0x2041 -#define WGL_SAMPLES_EXT 0x2042 -#endif - -/* WGL_I3D_digital_video_control */ - -#ifndef WGL_I3D_digital_video_control -#define WGL_I3D_digital_video_control 1 -#define __GLEE_WGL_I3D_digital_video_control 1 -/* Constants */ -#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 -#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 -#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 -#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 -typedef BOOL (APIENTRYP PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int * piValue); -typedef BOOL (APIENTRYP PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int * piValue); -GLEE_EXTERN PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC pwglGetDigitalVideoParametersI3D; -GLEE_EXTERN PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC pwglSetDigitalVideoParametersI3D; -#define wglGetDigitalVideoParametersI3D pwglGetDigitalVideoParametersI3D -#define wglSetDigitalVideoParametersI3D pwglSetDigitalVideoParametersI3D -#endif - -/* WGL_I3D_gamma */ - -#ifndef WGL_I3D_gamma -#define WGL_I3D_gamma 1 -#define __GLEE_WGL_I3D_gamma 1 -/* Constants */ -#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E -#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F -typedef BOOL (APIENTRYP PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int * piValue); -typedef BOOL (APIENTRYP PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int * piValue); -typedef BOOL (APIENTRYP PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT * puRed, USHORT * puGreen, USHORT * puBlue); -typedef BOOL (APIENTRYP PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT * puRed, const USHORT * puGreen, const USHORT * puBlue); -GLEE_EXTERN PFNWGLGETGAMMATABLEPARAMETERSI3DPROC pwglGetGammaTableParametersI3D; -GLEE_EXTERN PFNWGLSETGAMMATABLEPARAMETERSI3DPROC pwglSetGammaTableParametersI3D; -GLEE_EXTERN PFNWGLGETGAMMATABLEI3DPROC pwglGetGammaTableI3D; -GLEE_EXTERN PFNWGLSETGAMMATABLEI3DPROC pwglSetGammaTableI3D; -#define wglGetGammaTableParametersI3D pwglGetGammaTableParametersI3D -#define wglSetGammaTableParametersI3D pwglSetGammaTableParametersI3D -#define wglGetGammaTableI3D pwglGetGammaTableI3D -#define wglSetGammaTableI3D pwglSetGammaTableI3D -#endif - -/* WGL_I3D_genlock */ - -#ifndef WGL_I3D_genlock -#define WGL_I3D_genlock 1 -#define __GLEE_WGL_I3D_genlock 1 -/* Constants */ -#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 -#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045 -#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046 -#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047 -#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 -#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 -#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A -#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B -#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C -typedef BOOL (APIENTRYP PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); -typedef BOOL (APIENTRYP PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); -typedef BOOL (APIENTRYP PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL * pFlag); -typedef BOOL (APIENTRYP PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); -typedef BOOL (APIENTRYP PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT * uSource); -typedef BOOL (APIENTRYP PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); -typedef BOOL (APIENTRYP PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT * uEdge); -typedef BOOL (APIENTRYP PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); -typedef BOOL (APIENTRYP PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT * uRate); -typedef BOOL (APIENTRYP PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); -typedef BOOL (APIENTRYP PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT * uDelay); -typedef BOOL (APIENTRYP PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT * uMaxLineDelay, UINT * uMaxPixelDelay); -GLEE_EXTERN PFNWGLENABLEGENLOCKI3DPROC pwglEnableGenlockI3D; -GLEE_EXTERN PFNWGLDISABLEGENLOCKI3DPROC pwglDisableGenlockI3D; -GLEE_EXTERN PFNWGLISENABLEDGENLOCKI3DPROC pwglIsEnabledGenlockI3D; -GLEE_EXTERN PFNWGLGENLOCKSOURCEI3DPROC pwglGenlockSourceI3D; -GLEE_EXTERN PFNWGLGETGENLOCKSOURCEI3DPROC pwglGetGenlockSourceI3D; -GLEE_EXTERN PFNWGLGENLOCKSOURCEEDGEI3DPROC pwglGenlockSourceEdgeI3D; -GLEE_EXTERN PFNWGLGETGENLOCKSOURCEEDGEI3DPROC pwglGetGenlockSourceEdgeI3D; -GLEE_EXTERN PFNWGLGENLOCKSAMPLERATEI3DPROC pwglGenlockSampleRateI3D; -GLEE_EXTERN PFNWGLGETGENLOCKSAMPLERATEI3DPROC pwglGetGenlockSampleRateI3D; -GLEE_EXTERN PFNWGLGENLOCKSOURCEDELAYI3DPROC pwglGenlockSourceDelayI3D; -GLEE_EXTERN PFNWGLGETGENLOCKSOURCEDELAYI3DPROC pwglGetGenlockSourceDelayI3D; -GLEE_EXTERN PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC pwglQueryGenlockMaxSourceDelayI3D; -#define wglEnableGenlockI3D pwglEnableGenlockI3D -#define wglDisableGenlockI3D pwglDisableGenlockI3D -#define wglIsEnabledGenlockI3D pwglIsEnabledGenlockI3D -#define wglGenlockSourceI3D pwglGenlockSourceI3D -#define wglGetGenlockSourceI3D pwglGetGenlockSourceI3D -#define wglGenlockSourceEdgeI3D pwglGenlockSourceEdgeI3D -#define wglGetGenlockSourceEdgeI3D pwglGetGenlockSourceEdgeI3D -#define wglGenlockSampleRateI3D pwglGenlockSampleRateI3D -#define wglGetGenlockSampleRateI3D pwglGetGenlockSampleRateI3D -#define wglGenlockSourceDelayI3D pwglGenlockSourceDelayI3D -#define wglGetGenlockSourceDelayI3D pwglGetGenlockSourceDelayI3D -#define wglQueryGenlockMaxSourceDelayI3D pwglQueryGenlockMaxSourceDelayI3D -#endif - -/* WGL_I3D_image_buffer */ - -#ifndef WGL_I3D_image_buffer -#define WGL_I3D_image_buffer 1 -#define __GLEE_WGL_I3D_image_buffer 1 -/* Constants */ -#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 -#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 -typedef LPVOID (APIENTRYP PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); -typedef BOOL (APIENTRYP PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); -typedef BOOL (APIENTRYP PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE * pEvent, const LPVOID * pAddress, const DWORD * pSize, UINT count); -typedef BOOL (APIENTRYP PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID * pAddress, UINT count); -GLEE_EXTERN PFNWGLCREATEIMAGEBUFFERI3DPROC pwglCreateImageBufferI3D; -GLEE_EXTERN PFNWGLDESTROYIMAGEBUFFERI3DPROC pwglDestroyImageBufferI3D; -GLEE_EXTERN PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC pwglAssociateImageBufferEventsI3D; -GLEE_EXTERN PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC pwglReleaseImageBufferEventsI3D; -#define wglCreateImageBufferI3D pwglCreateImageBufferI3D -#define wglDestroyImageBufferI3D pwglDestroyImageBufferI3D -#define wglAssociateImageBufferEventsI3D pwglAssociateImageBufferEventsI3D -#define wglReleaseImageBufferEventsI3D pwglReleaseImageBufferEventsI3D -#endif - -/* WGL_I3D_swap_frame_lock */ - -#ifndef WGL_I3D_swap_frame_lock -#define WGL_I3D_swap_frame_lock 1 -#define __GLEE_WGL_I3D_swap_frame_lock 1 -/* Constants */ -typedef BOOL (APIENTRYP PFNWGLENABLEFRAMELOCKI3DPROC) (); -typedef BOOL (APIENTRYP PFNWGLDISABLEFRAMELOCKI3DPROC) (); -typedef BOOL (APIENTRYP PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL * pFlag); -typedef BOOL (APIENTRYP PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL * pFlag); -GLEE_EXTERN PFNWGLENABLEFRAMELOCKI3DPROC pwglEnableFrameLockI3D; -GLEE_EXTERN PFNWGLDISABLEFRAMELOCKI3DPROC pwglDisableFrameLockI3D; -GLEE_EXTERN PFNWGLISENABLEDFRAMELOCKI3DPROC pwglIsEnabledFrameLockI3D; -GLEE_EXTERN PFNWGLQUERYFRAMELOCKMASTERI3DPROC pwglQueryFrameLockMasterI3D; -#define wglEnableFrameLockI3D pwglEnableFrameLockI3D -#define wglDisableFrameLockI3D pwglDisableFrameLockI3D -#define wglIsEnabledFrameLockI3D pwglIsEnabledFrameLockI3D -#define wglQueryFrameLockMasterI3D pwglQueryFrameLockMasterI3D -#endif - -/* WGL_NV_render_depth_texture */ - -#ifndef WGL_NV_render_depth_texture -#define WGL_NV_render_depth_texture 1 -#define __GLEE_WGL_NV_render_depth_texture 1 -/* Constants */ -#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 -#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 -#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 -#define WGL_DEPTH_COMPONENT_NV 0x20A7 -#endif - -/* WGL_NV_render_texture_rectangle */ - -#ifndef WGL_NV_render_texture_rectangle -#define WGL_NV_render_texture_rectangle 1 -#define __GLEE_WGL_NV_render_texture_rectangle 1 -/* Constants */ -#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 -#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 -#endif - -/* WGL_ATI_pixel_format_float */ - -#ifndef WGL_ATI_pixel_format_float -#define WGL_ATI_pixel_format_float 1 -#define __GLEE_WGL_ATI_pixel_format_float 1 -/* Constants */ -#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 -#endif - -/* WGL_NV_float_buffer */ - -#ifndef WGL_NV_float_buffer -#define WGL_NV_float_buffer 1 -#define __GLEE_WGL_NV_float_buffer 1 -/* Constants */ -#define WGL_FLOAT_COMPONENTS_NV 0x20B0 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 -#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 -#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 -#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 -#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 -#endif - -/* WGL_3DL_stereo_control */ - -#ifndef WGL_3DL_stereo_control -#define WGL_3DL_stereo_control 1 -#define __GLEE_WGL_3DL_stereo_control 1 -/* Constants */ -#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 -#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 -#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 -#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 -#endif - -/* WGL_EXT_pixel_format_packed_float */ - -#ifndef WGL_EXT_pixel_format_packed_float -#define WGL_EXT_pixel_format_packed_float 1 -#define __GLEE_WGL_EXT_pixel_format_packed_float 1 -/* Constants */ -#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 -#endif - -/* WGL_EXT_framebuffer_sRGB */ - -#ifndef WGL_EXT_framebuffer_sRGB -#define WGL_EXT_framebuffer_sRGB 1 -#define __GLEE_WGL_EXT_framebuffer_sRGB 1 -/* Constants */ -#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 -#endif - -/* WGL_NV_present_video */ - -#ifndef WGL_NV_present_video -#define WGL_NV_present_video 1 -#define __GLEE_WGL_NV_present_video 1 -/* Constants */ -#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 -#endif - -/* WGL_NV_video_out */ - -#ifndef WGL_NV_video_out -#define WGL_NV_video_out 1 -#define __GLEE_WGL_NV_video_out 1 -/* Constants */ -#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 -#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 -#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 -#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 -#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 -#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 -#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 -#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 -#define WGL_VIDEO_OUT_FRAME 0x20C8 -#define WGL_VIDEO_OUT_FIELD_1 0x20C9 -#define WGL_VIDEO_OUT_FIELD_2 0x20CA -#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB -#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC -#endif - -/* WGL_NV_swap_group */ - -#ifndef WGL_NV_swap_group -#define WGL_NV_swap_group 1 -#define __GLEE_WGL_NV_swap_group 1 -/* Constants */ -#endif - -/* WGL_EXT_display_color_table */ - -#ifndef WGL_EXT_display_color_table -#define WGL_EXT_display_color_table 1 -#define __GLEE_WGL_EXT_display_color_table 1 -/* Constants */ -typedef GLboolean (APIENTRYP PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); -typedef GLboolean (APIENTRYP PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort * table, GLuint length); -typedef GLboolean (APIENTRYP PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); -typedef VOID (APIENTRYP PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); -GLEE_EXTERN PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC pwglCreateDisplayColorTableEXT; -GLEE_EXTERN PFNWGLLOADDISPLAYCOLORTABLEEXTPROC pwglLoadDisplayColorTableEXT; -GLEE_EXTERN PFNWGLBINDDISPLAYCOLORTABLEEXTPROC pwglBindDisplayColorTableEXT; -GLEE_EXTERN PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC pwglDestroyDisplayColorTableEXT; -#define wglCreateDisplayColorTableEXT pwglCreateDisplayColorTableEXT -#define wglLoadDisplayColorTableEXT pwglLoadDisplayColorTableEXT -#define wglBindDisplayColorTableEXT pwglBindDisplayColorTableEXT -#define wglDestroyDisplayColorTableEXT pwglDestroyDisplayColorTableEXT -#endif - -/* WGL_EXT_extensions_string */ - -#ifndef WGL_EXT_extensions_string -#define WGL_EXT_extensions_string 1 -#define __GLEE_WGL_EXT_extensions_string 1 -/* Constants */ -typedef const char * (APIENTRYP PFNWGLGETEXTENSIONSSTRINGEXTPROC) (); -GLEE_EXTERN PFNWGLGETEXTENSIONSSTRINGEXTPROC pwglGetExtensionsStringEXT; -#define wglGetExtensionsStringEXT pwglGetExtensionsStringEXT -#endif - -/* WGL_EXT_swap_control */ - -#ifndef WGL_EXT_swap_control -#define WGL_EXT_swap_control 1 -#define __GLEE_WGL_EXT_swap_control 1 -/* Constants */ -typedef BOOL (APIENTRYP PFNWGLSWAPINTERVALEXTPROC) (int interval); -typedef int (APIENTRYP PFNWGLGETSWAPINTERVALEXTPROC) (); -GLEE_EXTERN PFNWGLSWAPINTERVALEXTPROC pwglSwapIntervalEXT; -GLEE_EXTERN PFNWGLGETSWAPINTERVALEXTPROC pwglGetSwapIntervalEXT; -#define wglSwapIntervalEXT pwglSwapIntervalEXT -#define wglGetSwapIntervalEXT pwglGetSwapIntervalEXT -#endif - -/* WGL_NV_vertex_array_range */ - -#ifndef WGL_NV_vertex_array_range -#define WGL_NV_vertex_array_range 1 -#define __GLEE_WGL_NV_vertex_array_range 1 -/* Constants */ -typedef void* (APIENTRYP PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); -typedef void (APIENTRYP PFNWGLFREEMEMORYNVPROC) (void * pointer); -GLEE_EXTERN PFNWGLALLOCATEMEMORYNVPROC pwglAllocateMemoryNV; -GLEE_EXTERN PFNWGLFREEMEMORYNVPROC pwglFreeMemoryNV; -#define wglAllocateMemoryNV pwglAllocateMemoryNV -#define wglFreeMemoryNV pwglFreeMemoryNV -#endif - -/* WGL_OML_sync_control */ - -#ifndef WGL_OML_sync_control -#define WGL_OML_sync_control 1 -#define __GLEE_WGL_OML_sync_control 1 -/* Constants */ -typedef BOOL (APIENTRYP PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 * ust, INT64 * msc, INT64 * sbc); -typedef BOOL (APIENTRYP PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 * numerator, INT32 * denominator); -typedef INT64 (APIENTRYP PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); -typedef INT64 (APIENTRYP PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); -typedef BOOL (APIENTRYP PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 * ust, INT64 * msc, INT64 * sbc); -typedef BOOL (APIENTRYP PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 * ust, INT64 * msc, INT64 * sbc); -GLEE_EXTERN PFNWGLGETSYNCVALUESOMLPROC pwglGetSyncValuesOML; -GLEE_EXTERN PFNWGLGETMSCRATEOMLPROC pwglGetMscRateOML; -GLEE_EXTERN PFNWGLSWAPBUFFERSMSCOMLPROC pwglSwapBuffersMscOML; -GLEE_EXTERN PFNWGLSWAPLAYERBUFFERSMSCOMLPROC pwglSwapLayerBuffersMscOML; -GLEE_EXTERN PFNWGLWAITFORMSCOMLPROC pwglWaitForMscOML; -GLEE_EXTERN PFNWGLWAITFORSBCOMLPROC pwglWaitForSbcOML; -#define wglGetSyncValuesOML pwglGetSyncValuesOML -#define wglGetMscRateOML pwglGetMscRateOML -#define wglSwapBuffersMscOML pwglSwapBuffersMscOML -#define wglSwapLayerBuffersMscOML pwglSwapLayerBuffersMscOML -#define wglWaitForMscOML pwglWaitForMscOML -#define wglWaitForSbcOML pwglWaitForSbcOML -#endif - -/* WGL_I3D_swap_frame_usage */ - -#ifndef WGL_I3D_swap_frame_usage -#define WGL_I3D_swap_frame_usage 1 -#define __GLEE_WGL_I3D_swap_frame_usage 1 -/* Constants */ -typedef BOOL (APIENTRYP PFNWGLGETFRAMEUSAGEI3DPROC) (float * pUsage); -typedef BOOL (APIENTRYP PFNWGLBEGINFRAMETRACKINGI3DPROC) (); -typedef BOOL (APIENTRYP PFNWGLENDFRAMETRACKINGI3DPROC) (); -typedef BOOL (APIENTRYP PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD * pFrameCount, DWORD * pMissedFrames, float * pLastMissedUsage); -GLEE_EXTERN PFNWGLGETFRAMEUSAGEI3DPROC pwglGetFrameUsageI3D; -GLEE_EXTERN PFNWGLBEGINFRAMETRACKINGI3DPROC pwglBeginFrameTrackingI3D; -GLEE_EXTERN PFNWGLENDFRAMETRACKINGI3DPROC pwglEndFrameTrackingI3D; -GLEE_EXTERN PFNWGLQUERYFRAMETRACKINGI3DPROC pwglQueryFrameTrackingI3D; -#define wglGetFrameUsageI3D pwglGetFrameUsageI3D -#define wglBeginFrameTrackingI3D pwglBeginFrameTrackingI3D -#define wglEndFrameTrackingI3D pwglEndFrameTrackingI3D -#define wglQueryFrameTrackingI3D pwglQueryFrameTrackingI3D -#endif - -/* WGL_NV_video_output */ - -#ifndef WGL_NV_video_output -#define WGL_NV_video_output 1 -#define __GLEE_WGL_NV_video_output 1 -/* Constants */ -#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 -#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 -#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 -#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 -#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 -#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 -#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 -#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 -#define WGL_VIDEO_OUT_FRAME 0x20C8 -#define WGL_VIDEO_OUT_FIELD_1 0x20C9 -#define WGL_VIDEO_OUT_FIELD_2 0x20CA -#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB -#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC -typedef BOOL (APIENTRYP PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV * hVideoDevice); -typedef BOOL (APIENTRYP PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); -typedef BOOL (APIENTRYP PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); -typedef BOOL (APIENTRYP PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); -typedef BOOL (APIENTRYP PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long * pulCounterPbuffer, BOOL bBlock); -typedef BOOL (APIENTRYP PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long * pulCounterOutputPbuffer, unsigned long * pulCounterOutputVideo); -GLEE_EXTERN PFNWGLGETVIDEODEVICENVPROC pwglGetVideoDeviceNV; -GLEE_EXTERN PFNWGLRELEASEVIDEODEVICENVPROC pwglReleaseVideoDeviceNV; -GLEE_EXTERN PFNWGLBINDVIDEOIMAGENVPROC pwglBindVideoImageNV; -GLEE_EXTERN PFNWGLRELEASEVIDEOIMAGENVPROC pwglReleaseVideoImageNV; -GLEE_EXTERN PFNWGLSENDPBUFFERTOVIDEONVPROC pwglSendPbufferToVideoNV; -GLEE_EXTERN PFNWGLGETVIDEOINFONVPROC pwglGetVideoInfoNV; -#define wglGetVideoDeviceNV pwglGetVideoDeviceNV -#define wglReleaseVideoDeviceNV pwglReleaseVideoDeviceNV -#define wglBindVideoImageNV pwglBindVideoImageNV -#define wglReleaseVideoImageNV pwglReleaseVideoImageNV -#define wglSendPbufferToVideoNV pwglSendPbufferToVideoNV -#define wglGetVideoInfoNV pwglGetVideoInfoNV -#endif -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else /* GLX */ - -/* Extension querying variables */ - -GLEE_EXTERN GLboolean _GLEE_GLX_VERSION_1_3; -GLEE_EXTERN GLboolean _GLEE_GLX_VERSION_1_4; -GLEE_EXTERN GLboolean _GLEE_GLX_ARB_multisample; -GLEE_EXTERN GLboolean _GLEE_GLX_ARB_fbconfig_float; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIS_multisample; -GLEE_EXTERN GLboolean _GLEE_GLX_EXT_visual_info; -GLEE_EXTERN GLboolean _GLEE_GLX_SGI_swap_control; -GLEE_EXTERN GLboolean _GLEE_GLX_SGI_video_sync; -GLEE_EXTERN GLboolean _GLEE_GLX_SGI_make_current_read; -GLEE_EXTERN GLboolean _GLEE_GLX_EXT_visual_rating; -GLEE_EXTERN GLboolean _GLEE_GLX_EXT_import_context; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_fbconfig; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_pbuffer; -GLEE_EXTERN GLboolean _GLEE_GLX_SGI_cushion; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_video_resize; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_swap_group; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_swap_barrier; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIS_blended_overlay; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIS_shared_multisample; -GLEE_EXTERN GLboolean _GLEE_GLX_SUN_get_transparent_index; -GLEE_EXTERN GLboolean _GLEE_GLX_3DFX_multisample; -GLEE_EXTERN GLboolean _GLEE_GLX_MESA_copy_sub_buffer; -GLEE_EXTERN GLboolean _GLEE_GLX_MESA_pixmap_colormap; -GLEE_EXTERN GLboolean _GLEE_GLX_MESA_release_buffers; -GLEE_EXTERN GLboolean _GLEE_GLX_MESA_set_3dfx_mode; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_visual_select_group; -GLEE_EXTERN GLboolean _GLEE_GLX_OML_swap_method; -GLEE_EXTERN GLboolean _GLEE_GLX_OML_sync_control; -GLEE_EXTERN GLboolean _GLEE_GLX_NV_float_buffer; -GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_hyperpipe; -GLEE_EXTERN GLboolean _GLEE_GLX_MESA_agp_offset; -GLEE_EXTERN GLboolean _GLEE_GLX_EXT_fbconfig_packed_float; -GLEE_EXTERN GLboolean _GLEE_GLX_EXT_framebuffer_sRGB; -GLEE_EXTERN GLboolean _GLEE_GLX_EXT_texture_from_pixmap; -GLEE_EXTERN GLboolean _GLEE_GLX_NV_present_video; -GLEE_EXTERN GLboolean _GLEE_GLX_NV_video_out; -GLEE_EXTERN GLboolean _GLEE_GLX_NV_swap_group; -GLEE_EXTERN GLboolean _GLEE_GLX_EXT_scene_marker; -GLEE_EXTERN GLboolean _GLEE_GLX_NV_video_output; - -/* Aliases for extension querying variables */ - -#define GLEE_GLX_VERSION_1_3 GLeeEnabled(&_GLEE_GLX_VERSION_1_3) -#define GLEE_GLX_VERSION_1_4 GLeeEnabled(&_GLEE_GLX_VERSION_1_4) -#define GLEE_GLX_ARB_multisample GLeeEnabled(&_GLEE_GLX_ARB_multisample) -#define GLEE_GLX_ARB_fbconfig_float GLeeEnabled(&_GLEE_GLX_ARB_fbconfig_float) -#define GLEE_GLX_SGIS_multisample GLeeEnabled(&_GLEE_GLX_SGIS_multisample) -#define GLEE_GLX_EXT_visual_info GLeeEnabled(&_GLEE_GLX_EXT_visual_info) -#define GLEE_GLX_SGI_swap_control GLeeEnabled(&_GLEE_GLX_SGI_swap_control) -#define GLEE_GLX_SGI_video_sync GLeeEnabled(&_GLEE_GLX_SGI_video_sync) -#define GLEE_GLX_SGI_make_current_read GLeeEnabled(&_GLEE_GLX_SGI_make_current_read) -#define GLEE_GLX_EXT_visual_rating GLeeEnabled(&_GLEE_GLX_EXT_visual_rating) -#define GLEE_GLX_EXT_import_context GLeeEnabled(&_GLEE_GLX_EXT_import_context) -#define GLEE_GLX_SGIX_fbconfig GLeeEnabled(&_GLEE_GLX_SGIX_fbconfig) -#define GLEE_GLX_SGIX_pbuffer GLeeEnabled(&_GLEE_GLX_SGIX_pbuffer) -#define GLEE_GLX_SGI_cushion GLeeEnabled(&_GLEE_GLX_SGI_cushion) -#define GLEE_GLX_SGIX_video_resize GLeeEnabled(&_GLEE_GLX_SGIX_video_resize) -#define GLEE_GLX_SGIX_swap_group GLeeEnabled(&_GLEE_GLX_SGIX_swap_group) -#define GLEE_GLX_SGIX_swap_barrier GLeeEnabled(&_GLEE_GLX_SGIX_swap_barrier) -#define GLEE_GLX_SGIS_blended_overlay GLeeEnabled(&_GLEE_GLX_SGIS_blended_overlay) -#define GLEE_GLX_SGIS_shared_multisample GLeeEnabled(&_GLEE_GLX_SGIS_shared_multisample) -#define GLEE_GLX_SUN_get_transparent_index GLeeEnabled(&_GLEE_GLX_SUN_get_transparent_index) -#define GLEE_GLX_3DFX_multisample GLeeEnabled(&_GLEE_GLX_3DFX_multisample) -#define GLEE_GLX_MESA_copy_sub_buffer GLeeEnabled(&_GLEE_GLX_MESA_copy_sub_buffer) -#define GLEE_GLX_MESA_pixmap_colormap GLeeEnabled(&_GLEE_GLX_MESA_pixmap_colormap) -#define GLEE_GLX_MESA_release_buffers GLeeEnabled(&_GLEE_GLX_MESA_release_buffers) -#define GLEE_GLX_MESA_set_3dfx_mode GLeeEnabled(&_GLEE_GLX_MESA_set_3dfx_mode) -#define GLEE_GLX_SGIX_visual_select_group GLeeEnabled(&_GLEE_GLX_SGIX_visual_select_group) -#define GLEE_GLX_OML_swap_method GLeeEnabled(&_GLEE_GLX_OML_swap_method) -#define GLEE_GLX_OML_sync_control GLeeEnabled(&_GLEE_GLX_OML_sync_control) -#define GLEE_GLX_NV_float_buffer GLeeEnabled(&_GLEE_GLX_NV_float_buffer) -#define GLEE_GLX_SGIX_hyperpipe GLeeEnabled(&_GLEE_GLX_SGIX_hyperpipe) -#define GLEE_GLX_MESA_agp_offset GLeeEnabled(&_GLEE_GLX_MESA_agp_offset) -#define GLEE_GLX_EXT_fbconfig_packed_float GLeeEnabled(&_GLEE_GLX_EXT_fbconfig_packed_float) -#define GLEE_GLX_EXT_framebuffer_sRGB GLeeEnabled(&_GLEE_GLX_EXT_framebuffer_sRGB) -#define GLEE_GLX_EXT_texture_from_pixmap GLeeEnabled(&_GLEE_GLX_EXT_texture_from_pixmap) -#define GLEE_GLX_NV_present_video GLeeEnabled(&_GLEE_GLX_NV_present_video) -#define GLEE_GLX_NV_video_out GLeeEnabled(&_GLEE_GLX_NV_video_out) -#define GLEE_GLX_NV_swap_group GLeeEnabled(&_GLEE_GLX_NV_swap_group) -#define GLEE_GLX_EXT_scene_marker GLeeEnabled(&_GLEE_GLX_EXT_scene_marker) -#define GLEE_GLX_NV_video_output GLeeEnabled(&_GLEE_GLX_NV_video_output) - -/* GLX_VERSION_1_3 */ - -#ifndef GLX_VERSION_1_3 -#define GLX_VERSION_1_3 1 -#define __GLEE_GLX_VERSION_1_3 1 -/* Constants */ -#define GLX_WINDOW_BIT 0x00000001 -#define GLX_PIXMAP_BIT 0x00000002 -#define GLX_PBUFFER_BIT 0x00000004 -#define GLX_RGBA_BIT 0x00000001 -#define GLX_COLOR_INDEX_BIT 0x00000002 -#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 -#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 -#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 -#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 -#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 -#define GLX_AUX_BUFFERS_BIT 0x00000010 -#define GLX_DEPTH_BUFFER_BIT 0x00000020 -#define GLX_STENCIL_BUFFER_BIT 0x00000040 -#define GLX_ACCUM_BUFFER_BIT 0x00000080 -#define GLX_CONFIG_CAVEAT 0x20 -#define GLX_X_VISUAL_TYPE 0x22 -#define GLX_TRANSPARENT_TYPE 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE 0x24 -#define GLX_TRANSPARENT_RED_VALUE 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 -#define GLX_DONT_CARE 0xFFFFFFFF -#define GLX_NONE 0x8000 -#define GLX_SLOW_CONFIG 0x8001 -#define GLX_TRUE_COLOR 0x8002 -#define GLX_DIRECT_COLOR 0x8003 -#define GLX_PSEUDO_COLOR 0x8004 -#define GLX_STATIC_COLOR 0x8005 -#define GLX_GRAY_SCALE 0x8006 -#define GLX_STATIC_GRAY 0x8007 -#define GLX_TRANSPARENT_RGB 0x8008 -#define GLX_TRANSPARENT_INDEX 0x8009 -#define GLX_VISUAL_ID 0x800B -#define GLX_SCREEN 0x800C -#define GLX_NON_CONFORMANT_CONFIG 0x800D -#define GLX_DRAWABLE_TYPE 0x8010 -#define GLX_RENDER_TYPE 0x8011 -#define GLX_X_RENDERABLE 0x8012 -#define GLX_FBCONFIG_ID 0x8013 -#define GLX_RGBA_TYPE 0x8014 -#define GLX_COLOR_INDEX_TYPE 0x8015 -#define GLX_MAX_PBUFFER_WIDTH 0x8016 -#define GLX_MAX_PBUFFER_HEIGHT 0x8017 -#define GLX_MAX_PBUFFER_PIXELS 0x8018 -#define GLX_PRESERVED_CONTENTS 0x801B -#define GLX_LARGEST_PBUFFER 0x801C -#define GLX_WIDTH 0x801D -#define GLX_HEIGHT 0x801E -#define GLX_EVENT_MASK 0x801F -#define GLX_DAMAGED 0x8020 -#define GLX_SAVED 0x8021 -#define GLX_WINDOW 0x8022 -#define GLX_PBUFFER 0x8023 -#define GLX_PBUFFER_HEIGHT 0x8040 -#define GLX_PBUFFER_WIDTH 0x8041 -typedef GLXFBConfig * (APIENTRYP PFNGLXGETFBCONFIGSPROC) (Display * dpy, int screen, int * nelements); -typedef GLXFBConfig * (APIENTRYP PFNGLXCHOOSEFBCONFIGPROC) (Display * dpy, int screen, const int * attrib_list, int * nelements); -typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBPROC) (Display * dpy, GLXFBConfig config, int attribute, int * value); -typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGPROC) (Display * dpy, GLXFBConfig config); -typedef GLXWindow (APIENTRYP PFNGLXCREATEWINDOWPROC) (Display * dpy, GLXFBConfig config, Window win, const int * attrib_list); -typedef void (APIENTRYP PFNGLXDESTROYWINDOWPROC) (Display * dpy, GLXWindow win); -typedef GLXPixmap (APIENTRYP PFNGLXCREATEPIXMAPPROC) (Display * dpy, GLXFBConfig config, Pixmap pixmap, const int * attrib_list); -typedef void (APIENTRYP PFNGLXDESTROYPIXMAPPROC) (Display * dpy, GLXPixmap pixmap); -typedef GLXPbuffer (APIENTRYP PFNGLXCREATEPBUFFERPROC) (Display * dpy, GLXFBConfig config, const int * attrib_list); -typedef void (APIENTRYP PFNGLXDESTROYPBUFFERPROC) (Display * dpy, GLXPbuffer pbuf); -typedef void (APIENTRYP PFNGLXQUERYDRAWABLEPROC) (Display * dpy, GLXDrawable draw, int attribute, unsigned int * value); -typedef GLXContext (APIENTRYP PFNGLXCREATENEWCONTEXTPROC) (Display * dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); -typedef Bool (APIENTRYP PFNGLXMAKECONTEXTCURRENTPROC) (Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); -typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLEPROC) (); -typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYPROC) (); -typedef int (APIENTRYP PFNGLXQUERYCONTEXTPROC) (Display * dpy, GLXContext ctx, int attribute, int * value); -typedef void (APIENTRYP PFNGLXSELECTEVENTPROC) (Display * dpy, GLXDrawable draw, unsigned long event_mask); -typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTPROC) (Display * dpy, GLXDrawable draw, unsigned long * event_mask); -GLEE_EXTERN PFNGLXGETFBCONFIGSPROC pglXGetFBConfigs; -GLEE_EXTERN PFNGLXCHOOSEFBCONFIGPROC pglXChooseFBConfig; -GLEE_EXTERN PFNGLXGETFBCONFIGATTRIBPROC pglXGetFBConfigAttrib; -GLEE_EXTERN PFNGLXGETVISUALFROMFBCONFIGPROC pglXGetVisualFromFBConfig; -GLEE_EXTERN PFNGLXCREATEWINDOWPROC pglXCreateWindow; -GLEE_EXTERN PFNGLXDESTROYWINDOWPROC pglXDestroyWindow; -GLEE_EXTERN PFNGLXCREATEPIXMAPPROC pglXCreatePixmap; -GLEE_EXTERN PFNGLXDESTROYPIXMAPPROC pglXDestroyPixmap; -GLEE_EXTERN PFNGLXCREATEPBUFFERPROC pglXCreatePbuffer; -GLEE_EXTERN PFNGLXDESTROYPBUFFERPROC pglXDestroyPbuffer; -GLEE_EXTERN PFNGLXQUERYDRAWABLEPROC pglXQueryDrawable; -GLEE_EXTERN PFNGLXCREATENEWCONTEXTPROC pglXCreateNewContext; -GLEE_EXTERN PFNGLXMAKECONTEXTCURRENTPROC pglXMakeContextCurrent; -GLEE_EXTERN PFNGLXGETCURRENTREADDRAWABLEPROC pglXGetCurrentReadDrawable; -GLEE_EXTERN PFNGLXGETCURRENTDISPLAYPROC pglXGetCurrentDisplay; -GLEE_EXTERN PFNGLXQUERYCONTEXTPROC pglXQueryContext; -GLEE_EXTERN PFNGLXSELECTEVENTPROC pglXSelectEvent; -GLEE_EXTERN PFNGLXGETSELECTEDEVENTPROC pglXGetSelectedEvent; -#define glXGetFBConfigs pglXGetFBConfigs -#define glXChooseFBConfig pglXChooseFBConfig -#define glXGetFBConfigAttrib pglXGetFBConfigAttrib -#define glXGetVisualFromFBConfig pglXGetVisualFromFBConfig -#define glXCreateWindow pglXCreateWindow -#define glXDestroyWindow pglXDestroyWindow -#define glXCreatePixmap pglXCreatePixmap -#define glXDestroyPixmap pglXDestroyPixmap -#define glXCreatePbuffer pglXCreatePbuffer -#define glXDestroyPbuffer pglXDestroyPbuffer -#define glXQueryDrawable pglXQueryDrawable -#define glXCreateNewContext pglXCreateNewContext -#define glXMakeContextCurrent pglXMakeContextCurrent -#define glXGetCurrentReadDrawable pglXGetCurrentReadDrawable -#define glXGetCurrentDisplay pglXGetCurrentDisplay -#define glXQueryContext pglXQueryContext -#define glXSelectEvent pglXSelectEvent -#define glXGetSelectedEvent pglXGetSelectedEvent -#endif - -/* GLX_VERSION_1_4 */ - -#ifndef GLX_VERSION_1_4 -#define GLX_VERSION_1_4 1 -#define __GLEE_GLX_VERSION_1_4 1 -/* Constants */ -#define GLX_SAMPLE_BUFFERS 100000 -#define GLX_SAMPLES 100001 -typedef __GLXextFuncPtr (APIENTRYP PFNGLXGETPROCADDRESSPROC) (const GLubyte * procName); -GLEE_EXTERN PFNGLXGETPROCADDRESSPROC pglXGetProcAddress; -#define glXGetProcAddress pglXGetProcAddress -#endif - -/* GLX_ARB_multisample */ - -#ifndef GLX_ARB_multisample -#define GLX_ARB_multisample 1 -#define __GLEE_GLX_ARB_multisample 1 -/* Constants */ -#define GLX_SAMPLE_BUFFERS_ARB 100000 -#define GLX_SAMPLES_ARB 100001 -#endif - -/* GLX_ARB_fbconfig_float */ - -#ifndef GLX_ARB_fbconfig_float -#define GLX_ARB_fbconfig_float 1 -#define __GLEE_GLX_ARB_fbconfig_float 1 -/* Constants */ -#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 -#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 -#endif - -/* GLX_SGIS_multisample */ - -#ifndef GLX_SGIS_multisample -#define GLX_SGIS_multisample 1 -#define __GLEE_GLX_SGIS_multisample 1 -/* Constants */ -#define GLX_SAMPLE_BUFFERS_SGIS 100000 -#define GLX_SAMPLES_SGIS 100001 -#endif - -/* GLX_EXT_visual_info */ - -#ifndef GLX_EXT_visual_info -#define GLX_EXT_visual_info 1 -#define __GLEE_GLX_EXT_visual_info 1 -/* Constants */ -#define GLX_X_VISUAL_TYPE_EXT 0x22 -#define GLX_TRANSPARENT_TYPE_EXT 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 -#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 -#define GLX_NONE_EXT 0x8000 -#define GLX_TRUE_COLOR_EXT 0x8002 -#define GLX_DIRECT_COLOR_EXT 0x8003 -#define GLX_PSEUDO_COLOR_EXT 0x8004 -#define GLX_STATIC_COLOR_EXT 0x8005 -#define GLX_GRAY_SCALE_EXT 0x8006 -#define GLX_STATIC_GRAY_EXT 0x8007 -#define GLX_TRANSPARENT_RGB_EXT 0x8008 -#define GLX_TRANSPARENT_INDEX_EXT 0x8009 -#endif - -/* GLX_SGI_swap_control */ - -#ifndef GLX_SGI_swap_control -#define GLX_SGI_swap_control 1 -#define __GLEE_GLX_SGI_swap_control 1 -/* Constants */ -typedef int (APIENTRYP PFNGLXSWAPINTERVALSGIPROC) (int interval); -GLEE_EXTERN PFNGLXSWAPINTERVALSGIPROC pglXSwapIntervalSGI; -#define glXSwapIntervalSGI pglXSwapIntervalSGI -#endif - -/* GLX_SGI_video_sync */ - -#ifndef GLX_SGI_video_sync -#define GLX_SGI_video_sync 1 -#define __GLEE_GLX_SGI_video_sync 1 -/* Constants */ -typedef int (APIENTRYP PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int * count); -typedef int (APIENTRYP PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int * count); -GLEE_EXTERN PFNGLXGETVIDEOSYNCSGIPROC pglXGetVideoSyncSGI; -GLEE_EXTERN PFNGLXWAITVIDEOSYNCSGIPROC pglXWaitVideoSyncSGI; -#define glXGetVideoSyncSGI pglXGetVideoSyncSGI -#define glXWaitVideoSyncSGI pglXWaitVideoSyncSGI -#endif - -/* GLX_SGI_make_current_read */ - -#ifndef GLX_SGI_make_current_read -#define GLX_SGI_make_current_read 1 -#define __GLEE_GLX_SGI_make_current_read 1 -/* Constants */ -typedef Bool (APIENTRYP PFNGLXMAKECURRENTREADSGIPROC) (Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); -typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLESGIPROC) (); -GLEE_EXTERN PFNGLXMAKECURRENTREADSGIPROC pglXMakeCurrentReadSGI; -GLEE_EXTERN PFNGLXGETCURRENTREADDRAWABLESGIPROC pglXGetCurrentReadDrawableSGI; -#define glXMakeCurrentReadSGI pglXMakeCurrentReadSGI -#define glXGetCurrentReadDrawableSGI pglXGetCurrentReadDrawableSGI -#endif - -/* GLX_EXT_visual_rating */ - -#ifndef GLX_EXT_visual_rating -#define GLX_EXT_visual_rating 1 -#define __GLEE_GLX_EXT_visual_rating 1 -/* Constants */ -#define GLX_VISUAL_CAVEAT_EXT 0x20 -#define GLX_SLOW_VISUAL_EXT 0x8001 -#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D -#endif - -/* GLX_EXT_import_context */ - -#ifndef GLX_EXT_import_context -#define GLX_EXT_import_context 1 -#define __GLEE_GLX_EXT_import_context 1 -/* Constants */ -#define GLX_SHARE_CONTEXT_EXT 0x800A -#define GLX_VISUAL_ID_EXT 0x800B -#define GLX_SCREEN_EXT 0x800C -typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYEXTPROC) (); -typedef int (APIENTRYP PFNGLXQUERYCONTEXTINFOEXTPROC) (Display * dpy, GLXContext context, int attribute, int * value); -typedef GLXContextID (APIENTRYP PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); -typedef GLXContext (APIENTRYP PFNGLXIMPORTCONTEXTEXTPROC) (Display * dpy, GLXContextID contextID); -typedef void (APIENTRYP PFNGLXFREECONTEXTEXTPROC) (Display * dpy, GLXContext context); -GLEE_EXTERN PFNGLXGETCURRENTDISPLAYEXTPROC pglXGetCurrentDisplayEXT; -GLEE_EXTERN PFNGLXQUERYCONTEXTINFOEXTPROC pglXQueryContextInfoEXT; -GLEE_EXTERN PFNGLXGETCONTEXTIDEXTPROC pglXGetContextIDEXT; -GLEE_EXTERN PFNGLXIMPORTCONTEXTEXTPROC pglXImportContextEXT; -GLEE_EXTERN PFNGLXFREECONTEXTEXTPROC pglXFreeContextEXT; -#define glXGetCurrentDisplayEXT pglXGetCurrentDisplayEXT -#define glXQueryContextInfoEXT pglXQueryContextInfoEXT -#define glXGetContextIDEXT pglXGetContextIDEXT -#define glXImportContextEXT pglXImportContextEXT -#define glXFreeContextEXT pglXFreeContextEXT -#endif - -/* GLX_SGIX_fbconfig */ - -#ifndef GLX_SGIX_fbconfig -#define GLX_SGIX_fbconfig 1 -#define __GLEE_GLX_SGIX_fbconfig 1 -/* Constants */ -#define GLX_WINDOW_BIT_SGIX 0x00000001 -#define GLX_PIXMAP_BIT_SGIX 0x00000002 -#define GLX_RGBA_BIT_SGIX 0x00000001 -#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 -#define GLX_DRAWABLE_TYPE_SGIX 0x8010 -#define GLX_RENDER_TYPE_SGIX 0x8011 -#define GLX_X_RENDERABLE_SGIX 0x8012 -#define GLX_FBCONFIG_ID_SGIX 0x8013 -#define GLX_RGBA_TYPE_SGIX 0x8014 -#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 -typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display * dpy, GLXFBConfigSGIX config, int attribute, int * value); -typedef GLXFBConfigSGIX * (APIENTRYP PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display * dpy, int screen, int * attrib_list, int * nelements); -typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display * dpy, GLXFBConfigSGIX config, Pixmap pixmap); -typedef GLXContext (APIENTRYP PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display * dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); -typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display * dpy, GLXFBConfigSGIX config); -typedef GLXFBConfigSGIX (APIENTRYP PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display * dpy, XVisualInfo * vis); -GLEE_EXTERN PFNGLXGETFBCONFIGATTRIBSGIXPROC pglXGetFBConfigAttribSGIX; -GLEE_EXTERN PFNGLXCHOOSEFBCONFIGSGIXPROC pglXChooseFBConfigSGIX; -GLEE_EXTERN PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC pglXCreateGLXPixmapWithConfigSGIX; -GLEE_EXTERN PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC pglXCreateContextWithConfigSGIX; -GLEE_EXTERN PFNGLXGETVISUALFROMFBCONFIGSGIXPROC pglXGetVisualFromFBConfigSGIX; -GLEE_EXTERN PFNGLXGETFBCONFIGFROMVISUALSGIXPROC pglXGetFBConfigFromVisualSGIX; -#define glXGetFBConfigAttribSGIX pglXGetFBConfigAttribSGIX -#define glXChooseFBConfigSGIX pglXChooseFBConfigSGIX -#define glXCreateGLXPixmapWithConfigSGIX pglXCreateGLXPixmapWithConfigSGIX -#define glXCreateContextWithConfigSGIX pglXCreateContextWithConfigSGIX -#define glXGetVisualFromFBConfigSGIX pglXGetVisualFromFBConfigSGIX -#define glXGetFBConfigFromVisualSGIX pglXGetFBConfigFromVisualSGIX -#endif - -/* GLX_SGIX_pbuffer */ - -#ifndef GLX_SGIX_pbuffer -#define GLX_SGIX_pbuffer 1 -#define __GLEE_GLX_SGIX_pbuffer 1 -/* Constants */ -#define GLX_PBUFFER_BIT_SGIX 0x00000004 -#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 -#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 -#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 -#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 -#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 -#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 -#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 -#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 -#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 -#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 -#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 -#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 -#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 -#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 -#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A -#define GLX_PRESERVED_CONTENTS_SGIX 0x801B -#define GLX_LARGEST_PBUFFER_SGIX 0x801C -#define GLX_WIDTH_SGIX 0x801D -#define GLX_HEIGHT_SGIX 0x801E -#define GLX_EVENT_MASK_SGIX 0x801F -#define GLX_DAMAGED_SGIX 0x8020 -#define GLX_SAVED_SGIX 0x8021 -#define GLX_WINDOW_SGIX 0x8022 -#define GLX_PBUFFER_SGIX 0x8023 -typedef GLXPbufferSGIX (APIENTRYP PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display * dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int * attrib_list); -typedef void (APIENTRYP PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display * dpy, GLXPbufferSGIX pbuf); -typedef int (APIENTRYP PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display * dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int * value); -typedef void (APIENTRYP PFNGLXSELECTEVENTSGIXPROC) (Display * dpy, GLXDrawable drawable, unsigned long mask); -typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTSGIXPROC) (Display * dpy, GLXDrawable drawable, unsigned long * mask); -GLEE_EXTERN PFNGLXCREATEGLXPBUFFERSGIXPROC pglXCreateGLXPbufferSGIX; -GLEE_EXTERN PFNGLXDESTROYGLXPBUFFERSGIXPROC pglXDestroyGLXPbufferSGIX; -GLEE_EXTERN PFNGLXQUERYGLXPBUFFERSGIXPROC pglXQueryGLXPbufferSGIX; -GLEE_EXTERN PFNGLXSELECTEVENTSGIXPROC pglXSelectEventSGIX; -GLEE_EXTERN PFNGLXGETSELECTEDEVENTSGIXPROC pglXGetSelectedEventSGIX; -#define glXCreateGLXPbufferSGIX pglXCreateGLXPbufferSGIX -#define glXDestroyGLXPbufferSGIX pglXDestroyGLXPbufferSGIX -#define glXQueryGLXPbufferSGIX pglXQueryGLXPbufferSGIX -#define glXSelectEventSGIX pglXSelectEventSGIX -#define glXGetSelectedEventSGIX pglXGetSelectedEventSGIX -#endif - -/* GLX_SGI_cushion */ - -#ifndef GLX_SGI_cushion -#define GLX_SGI_cushion 1 -#define __GLEE_GLX_SGI_cushion 1 -/* Constants */ -typedef void (APIENTRYP PFNGLXCUSHIONSGIPROC) (Display * dpy, Window window, float cushion); -GLEE_EXTERN PFNGLXCUSHIONSGIPROC pglXCushionSGI; -#define glXCushionSGI pglXCushionSGI -#endif - -/* GLX_SGIX_video_resize */ - -#ifndef GLX_SGIX_video_resize -#define GLX_SGIX_video_resize 1 -#define __GLEE_GLX_SGIX_video_resize 1 -/* Constants */ -#define GLX_SYNC_FRAME_SGIX 0x00000000 -#define GLX_SYNC_SWAP_SGIX 0x00000001 -typedef int (APIENTRYP PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display * display, int screen, int channel, Window window); -typedef int (APIENTRYP PFNGLXCHANNELRECTSGIXPROC) (Display * display, int screen, int channel, int x, int y, int w, int h); -typedef int (APIENTRYP PFNGLXQUERYCHANNELRECTSGIXPROC) (Display * display, int screen, int channel, int * dx, int * dy, int * dw, int * dh); -typedef int (APIENTRYP PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display * display, int screen, int channel, int * x, int * y, int * w, int * h); -typedef int (APIENTRYP PFNGLXCHANNELRECTSYNCSGIXPROC) (Display * display, int screen, int channel, GLenum synctype); -GLEE_EXTERN PFNGLXBINDCHANNELTOWINDOWSGIXPROC pglXBindChannelToWindowSGIX; -GLEE_EXTERN PFNGLXCHANNELRECTSGIXPROC pglXChannelRectSGIX; -GLEE_EXTERN PFNGLXQUERYCHANNELRECTSGIXPROC pglXQueryChannelRectSGIX; -GLEE_EXTERN PFNGLXQUERYCHANNELDELTASSGIXPROC pglXQueryChannelDeltasSGIX; -GLEE_EXTERN PFNGLXCHANNELRECTSYNCSGIXPROC pglXChannelRectSyncSGIX; -#define glXBindChannelToWindowSGIX pglXBindChannelToWindowSGIX -#define glXChannelRectSGIX pglXChannelRectSGIX -#define glXQueryChannelRectSGIX pglXQueryChannelRectSGIX -#define glXQueryChannelDeltasSGIX pglXQueryChannelDeltasSGIX -#define glXChannelRectSyncSGIX pglXChannelRectSyncSGIX -#endif - -/* GLX_SGIX_swap_group */ - -#ifndef GLX_SGIX_swap_group -#define GLX_SGIX_swap_group 1 -#define __GLEE_GLX_SGIX_swap_group 1 -/* Constants */ -typedef void (APIENTRYP PFNGLXJOINSWAPGROUPSGIXPROC) (Display * dpy, GLXDrawable drawable, GLXDrawable member); -GLEE_EXTERN PFNGLXJOINSWAPGROUPSGIXPROC pglXJoinSwapGroupSGIX; -#define glXJoinSwapGroupSGIX pglXJoinSwapGroupSGIX -#endif - -/* GLX_SGIX_swap_barrier */ - -#ifndef GLX_SGIX_swap_barrier -#define GLX_SGIX_swap_barrier 1 -#define __GLEE_GLX_SGIX_swap_barrier 1 -/* Constants */ -typedef void (APIENTRYP PFNGLXBINDSWAPBARRIERSGIXPROC) (Display * dpy, GLXDrawable drawable, int barrier); -typedef Bool (APIENTRYP PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display * dpy, int screen, int * max); -GLEE_EXTERN PFNGLXBINDSWAPBARRIERSGIXPROC pglXBindSwapBarrierSGIX; -GLEE_EXTERN PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC pglXQueryMaxSwapBarriersSGIX; -#define glXBindSwapBarrierSGIX pglXBindSwapBarrierSGIX -#define glXQueryMaxSwapBarriersSGIX pglXQueryMaxSwapBarriersSGIX -#endif - -/* GLX_SGIS_blended_overlay */ - -#ifndef GLX_SGIS_blended_overlay -#define GLX_SGIS_blended_overlay 1 -#define __GLEE_GLX_SGIS_blended_overlay 1 -/* Constants */ -#define GLX_BLENDED_RGBA_SGIS 0x8025 -#endif - -/* GLX_SGIS_shared_multisample */ - -#ifndef GLX_SGIS_shared_multisample -#define GLX_SGIS_shared_multisample 1 -#define __GLEE_GLX_SGIS_shared_multisample 1 -/* Constants */ -#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 -#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 -#endif - -/* GLX_SUN_get_transparent_index */ - -#ifndef GLX_SUN_get_transparent_index -#define GLX_SUN_get_transparent_index 1 -#define __GLEE_GLX_SUN_get_transparent_index 1 -/* Constants */ -typedef Status (APIENTRYP PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display * dpy, Window overlay, Window underlay, long * pTransparentIndex); -GLEE_EXTERN PFNGLXGETTRANSPARENTINDEXSUNPROC pglXGetTransparentIndexSUN; -#define glXGetTransparentIndexSUN pglXGetTransparentIndexSUN -#endif - -/* GLX_3DFX_multisample */ - -#ifndef GLX_3DFX_multisample -#define GLX_3DFX_multisample 1 -#define __GLEE_GLX_3DFX_multisample 1 -/* Constants */ -#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 -#define GLX_SAMPLES_3DFX 0x8051 -#endif - -/* GLX_MESA_copy_sub_buffer */ - -#ifndef GLX_MESA_copy_sub_buffer -#define GLX_MESA_copy_sub_buffer 1 -#define __GLEE_GLX_MESA_copy_sub_buffer 1 -/* Constants */ -typedef void (APIENTRYP PFNGLXCOPYSUBBUFFERMESAPROC) (Display * dpy, GLXDrawable drawable, int x, int y, int width, int height); -GLEE_EXTERN PFNGLXCOPYSUBBUFFERMESAPROC pglXCopySubBufferMESA; -#define glXCopySubBufferMESA pglXCopySubBufferMESA -#endif - -/* GLX_MESA_pixmap_colormap */ - -#ifndef GLX_MESA_pixmap_colormap -#define GLX_MESA_pixmap_colormap 1 -#define __GLEE_GLX_MESA_pixmap_colormap 1 -/* Constants */ -typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPMESAPROC) (Display * dpy, XVisualInfo * visual, Pixmap pixmap, Colormap cmap); -GLEE_EXTERN PFNGLXCREATEGLXPIXMAPMESAPROC pglXCreateGLXPixmapMESA; -#define glXCreateGLXPixmapMESA pglXCreateGLXPixmapMESA -#endif - -/* GLX_MESA_release_buffers */ - -#ifndef GLX_MESA_release_buffers -#define GLX_MESA_release_buffers 1 -#define __GLEE_GLX_MESA_release_buffers 1 -/* Constants */ -typedef Bool (APIENTRYP PFNGLXRELEASEBUFFERSMESAPROC) (Display * dpy, GLXDrawable drawable); -GLEE_EXTERN PFNGLXRELEASEBUFFERSMESAPROC pglXReleaseBuffersMESA; -#define glXReleaseBuffersMESA pglXReleaseBuffersMESA -#endif - -/* GLX_MESA_set_3dfx_mode */ - -#ifndef GLX_MESA_set_3dfx_mode -#define GLX_MESA_set_3dfx_mode 1 -#define __GLEE_GLX_MESA_set_3dfx_mode 1 -/* Constants */ -#define GLX_3DFX_WINDOW_MODE_MESA 0x1 -#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 -typedef Bool (APIENTRYP PFNGLXSET3DFXMODEMESAPROC) (int mode); -GLEE_EXTERN PFNGLXSET3DFXMODEMESAPROC pglXSet3DfxModeMESA; -#define glXSet3DfxModeMESA pglXSet3DfxModeMESA -#endif - -/* GLX_SGIX_visual_select_group */ - -#ifndef GLX_SGIX_visual_select_group -#define GLX_SGIX_visual_select_group 1 -#define __GLEE_GLX_SGIX_visual_select_group 1 -/* Constants */ -#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 -#endif - -/* GLX_OML_swap_method */ - -#ifndef GLX_OML_swap_method -#define GLX_OML_swap_method 1 -#define __GLEE_GLX_OML_swap_method 1 -/* Constants */ -#define GLX_SWAP_METHOD_OML 0x8060 -#define GLX_SWAP_EXCHANGE_OML 0x8061 -#define GLX_SWAP_COPY_OML 0x8062 -#define GLX_SWAP_UNDEFINED_OML 0x8063 -#endif - -/* GLX_OML_sync_control */ - -#ifndef GLX_OML_sync_control -#define GLX_OML_sync_control 1 -#define __GLEE_GLX_OML_sync_control 1 -/* Constants */ -typedef Bool (APIENTRYP PFNGLXGETSYNCVALUESOMLPROC) (Display * dpy, GLXDrawable drawable, int64_t * ust, int64_t * msc, int64_t * sbc); -typedef Bool (APIENTRYP PFNGLXGETMSCRATEOMLPROC) (Display * dpy, GLXDrawable drawable, int32_t * numerator, int32_t * denominator); -typedef int64_t (APIENTRYP PFNGLXSWAPBUFFERSMSCOMLPROC) (Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); -typedef Bool (APIENTRYP PFNGLXWAITFORMSCOMLPROC) (Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * ust, int64_t * msc, int64_t * sbc); -typedef Bool (APIENTRYP PFNGLXWAITFORSBCOMLPROC) (Display * dpy, GLXDrawable drawable, int64_t target_sbc, int64_t * ust, int64_t * msc, int64_t * sbc); -GLEE_EXTERN PFNGLXGETSYNCVALUESOMLPROC pglXGetSyncValuesOML; -GLEE_EXTERN PFNGLXGETMSCRATEOMLPROC pglXGetMscRateOML; -GLEE_EXTERN PFNGLXSWAPBUFFERSMSCOMLPROC pglXSwapBuffersMscOML; -GLEE_EXTERN PFNGLXWAITFORMSCOMLPROC pglXWaitForMscOML; -GLEE_EXTERN PFNGLXWAITFORSBCOMLPROC pglXWaitForSbcOML; -#define glXGetSyncValuesOML pglXGetSyncValuesOML -#define glXGetMscRateOML pglXGetMscRateOML -#define glXSwapBuffersMscOML pglXSwapBuffersMscOML -#define glXWaitForMscOML pglXWaitForMscOML -#define glXWaitForSbcOML pglXWaitForSbcOML -#endif - -/* GLX_NV_float_buffer */ - -#ifndef GLX_NV_float_buffer -#define GLX_NV_float_buffer 1 -#define __GLEE_GLX_NV_float_buffer 1 -/* Constants */ -#define GLX_FLOAT_COMPONENTS_NV 0x20B0 -#endif - -/* GLX_SGIX_hyperpipe */ - -#ifndef GLX_SGIX_hyperpipe -#define GLX_SGIX_hyperpipe 1 -#define __GLEE_GLX_SGIX_hyperpipe 1 -/* Constants */ -#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 -#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 -#define GLX_BAD_HYPERPIPE_SGIX 92 -#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 -#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 -#define GLX_PIPE_RECT_SGIX 0x00000001 -#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 -#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 -#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 -#define GLX_HYPERPIPE_ID_SGIX 0x8030 -typedef GLXHyperpipeNetworkSGIX * (APIENTRYP PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display * dpy, int * npipes); -typedef int (APIENTRYP PFNGLXHYPERPIPECONFIGSGIXPROC) (Display * dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX * cfg, int * hpId); -typedef GLXHyperpipeConfigSGIX * (APIENTRYP PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display * dpy, int hpId, int * npipes); -typedef int (APIENTRYP PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display * dpy, int hpId); -typedef int (APIENTRYP PFNGLXBINDHYPERPIPESGIXPROC) (Display * dpy, int hpId); -typedef int (APIENTRYP PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display * dpy, int timeSlice, int attrib, int size, void * attribList, void * returnAttribList); -typedef int (APIENTRYP PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display * dpy, int timeSlice, int attrib, int size, void * attribList); -typedef int (APIENTRYP PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display * dpy, int timeSlice, int attrib, int size, void * returnAttribList); -GLEE_EXTERN PFNGLXQUERYHYPERPIPENETWORKSGIXPROC pglXQueryHyperpipeNetworkSGIX; -GLEE_EXTERN PFNGLXHYPERPIPECONFIGSGIXPROC pglXHyperpipeConfigSGIX; -GLEE_EXTERN PFNGLXQUERYHYPERPIPECONFIGSGIXPROC pglXQueryHyperpipeConfigSGIX; -GLEE_EXTERN PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC pglXDestroyHyperpipeConfigSGIX; -GLEE_EXTERN PFNGLXBINDHYPERPIPESGIXPROC pglXBindHyperpipeSGIX; -GLEE_EXTERN PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC pglXQueryHyperpipeBestAttribSGIX; -GLEE_EXTERN PFNGLXHYPERPIPEATTRIBSGIXPROC pglXHyperpipeAttribSGIX; -GLEE_EXTERN PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC pglXQueryHyperpipeAttribSGIX; -#define glXQueryHyperpipeNetworkSGIX pglXQueryHyperpipeNetworkSGIX -#define glXHyperpipeConfigSGIX pglXHyperpipeConfigSGIX -#define glXQueryHyperpipeConfigSGIX pglXQueryHyperpipeConfigSGIX -#define glXDestroyHyperpipeConfigSGIX pglXDestroyHyperpipeConfigSGIX -#define glXBindHyperpipeSGIX pglXBindHyperpipeSGIX -#define glXQueryHyperpipeBestAttribSGIX pglXQueryHyperpipeBestAttribSGIX -#define glXHyperpipeAttribSGIX pglXHyperpipeAttribSGIX -#define glXQueryHyperpipeAttribSGIX pglXQueryHyperpipeAttribSGIX -#endif - -/* GLX_MESA_agp_offset */ - -#ifndef GLX_MESA_agp_offset -#define GLX_MESA_agp_offset 1 -#define __GLEE_GLX_MESA_agp_offset 1 -/* Constants */ -typedef unsigned int (APIENTRYP PFNGLXGETAGPOFFSETMESAPROC) (const void * pointer); -GLEE_EXTERN PFNGLXGETAGPOFFSETMESAPROC pglXGetAGPOffsetMESA; -#define glXGetAGPOffsetMESA pglXGetAGPOffsetMESA -#endif - -/* GLX_EXT_fbconfig_packed_float */ - -#ifndef GLX_EXT_fbconfig_packed_float -#define GLX_EXT_fbconfig_packed_float 1 -#define __GLEE_GLX_EXT_fbconfig_packed_float 1 -/* Constants */ -#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 -#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 -#endif - -/* GLX_EXT_framebuffer_sRGB */ - -#ifndef GLX_EXT_framebuffer_sRGB -#define GLX_EXT_framebuffer_sRGB 1 -#define __GLEE_GLX_EXT_framebuffer_sRGB 1 -/* Constants */ -#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 -#endif - -/* GLX_EXT_texture_from_pixmap */ - -#ifndef GLX_EXT_texture_from_pixmap -#define GLX_EXT_texture_from_pixmap 1 -#define __GLEE_GLX_EXT_texture_from_pixmap 1 -/* Constants */ -#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 -#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 -#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 -#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 -#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 -#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 -#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 -#define GLX_Y_INVERTED_EXT 0x20D4 -#define GLX_TEXTURE_FORMAT_EXT 0x20D5 -#define GLX_TEXTURE_TARGET_EXT 0x20D6 -#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 -#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 -#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 -#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA -#define GLX_TEXTURE_1D_EXT 0x20DB -#define GLX_TEXTURE_2D_EXT 0x20DC -#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD -#define GLX_FRONT_LEFT_EXT 0x20DE -#define GLX_FRONT_RIGHT_EXT 0x20DF -#define GLX_BACK_LEFT_EXT 0x20E0 -#define GLX_BACK_RIGHT_EXT 0x20E1 -#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT -#define GLX_BACK_EXT GLX_BACK_LEFT_EXT -#define GLX_AUX0_EXT 0x20E2 -#define GLX_AUX1_EXT 0x20E3 -#define GLX_AUX2_EXT 0x20E4 -#define GLX_AUX3_EXT 0x20E5 -#define GLX_AUX4_EXT 0x20E6 -#define GLX_AUX5_EXT 0x20E7 -#define GLX_AUX6_EXT 0x20E8 -#define GLX_AUX7_EXT 0x20E9 -#define GLX_AUX8_EXT 0x20EA -#define GLX_AUX9_EXT 0x20EB -typedef void (APIENTRYP PFNGLXBINDTEXIMAGEEXTPROC) (Display * dpy, GLXDrawable drawable, int buffer, const int * attrib_list); -typedef void (APIENTRYP PFNGLXRELEASETEXIMAGEEXTPROC) (Display * dpy, GLXDrawable drawable, int buffer); -GLEE_EXTERN PFNGLXBINDTEXIMAGEEXTPROC pglXBindTexImageEXT; -GLEE_EXTERN PFNGLXRELEASETEXIMAGEEXTPROC pglXReleaseTexImageEXT; -#define glXBindTexImageEXT pglXBindTexImageEXT -#define glXReleaseTexImageEXT pglXReleaseTexImageEXT -#endif - -/* GLX_NV_present_video */ - -#ifndef GLX_NV_present_video -#define GLX_NV_present_video 1 -#define __GLEE_GLX_NV_present_video 1 -/* Constants */ -#define GLX_GLX_NUM_VIDEO_SLOTS_NV 0x20F0 -#endif - -/* GLX_NV_video_out */ - -#ifndef GLX_NV_video_out -#define GLX_NV_video_out 1 -#define __GLEE_GLX_NV_video_out 1 -/* Constants */ -#define GLX_GLX_VIDEO_OUT_COLOR_NV 0x20C3 -#define GLX_GLX_VIDEO_OUT_ALPHA_NV 0x20C4 -#define GLX_GLX_VIDEO_OUT_DEPTH_NV 0x20C5 -#define GLX_GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 -#define GLX_GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 -#define GLX_GLX_VIDEO_OUT_FRAME_NV 0x20C8 -#define GLX_GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 -#define GLX_GLX_VIDEO_OUT_FIELD_2_NV 0x20CA -#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB -#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC -#endif - -/* GLX_NV_swap_group */ - -#ifndef GLX_NV_swap_group -#define GLX_NV_swap_group 1 -#define __GLEE_GLX_NV_swap_group 1 -/* Constants */ -#endif - -/* GLX_EXT_scene_marker */ - -#ifndef GLX_EXT_scene_marker -#define GLX_EXT_scene_marker 1 -#define __GLEE_GLX_EXT_scene_marker 1 -/* Constants */ -#endif - -/* GLX_NV_video_output */ - -#ifndef GLX_NV_video_output -#define GLX_NV_video_output 1 -#define __GLEE_GLX_NV_video_output 1 -/* Constants */ -#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 -#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 -#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 -#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 -#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 -#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 -#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 -#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA -#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB -#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC -typedef int (APIENTRYP PFNGLXGETVIDEODEVICENVPROC) (Display * dpy, int screen, int numVideoDevices, GLXVideoDeviceNV * pVideoDevice); -typedef int (APIENTRYP PFNGLXRELEASEVIDEODEVICENVPROC) (Display * dpy, int screen, GLXVideoDeviceNV VideoDevice); -typedef int (APIENTRYP PFNGLXBINDVIDEOIMAGENVPROC) (Display * dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); -typedef int (APIENTRYP PFNGLXRELEASEVIDEOIMAGENVPROC) (Display * dpy, GLXPbuffer pbuf); -typedef int (APIENTRYP PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display * dpy, GLXPbuffer pbuf, int iBufferType, unsigned long * pulCounterPbuffer, GLboolean bBlock); -typedef int (APIENTRYP PFNGLXGETVIDEOINFONVPROC) (Display * dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long * pulCounterOutputPbuffer, unsigned long * pulCounterOutputVideo); -GLEE_EXTERN PFNGLXGETVIDEODEVICENVPROC pglXGetVideoDeviceNV; -GLEE_EXTERN PFNGLXRELEASEVIDEODEVICENVPROC pglXReleaseVideoDeviceNV; -GLEE_EXTERN PFNGLXBINDVIDEOIMAGENVPROC pglXBindVideoImageNV; -GLEE_EXTERN PFNGLXRELEASEVIDEOIMAGENVPROC pglXReleaseVideoImageNV; -GLEE_EXTERN PFNGLXSENDPBUFFERTOVIDEONVPROC pglXSendPbufferToVideoNV; -GLEE_EXTERN PFNGLXGETVIDEOINFONVPROC pglXGetVideoInfoNV; -#define glXGetVideoDeviceNV pglXGetVideoDeviceNV -#define glXReleaseVideoDeviceNV pglXReleaseVideoDeviceNV -#define glXBindVideoImageNV pglXBindVideoImageNV -#define glXReleaseVideoImageNV pglXReleaseVideoImageNV -#define glXSendPbufferToVideoNV pglXSendPbufferToVideoNV -#define glXGetVideoInfoNV pglXGetVideoInfoNV -#endif -#endif /*end GLX */ - -/***************************************************************** - * GLee functions - *****************************************************************/ - -GLEE_EXTERN GLboolean GLeeInit( void ); -GLEE_EXTERN GLint GLeeForceLink(const char * extensionName); -GLEE_EXTERN const char * GLeeGetErrorString( void ); -GLEE_EXTERN const char * GLeeGetExtStrGL( void ); -GLEE_EXTERN GLboolean GLeeEnabled(GLboolean * extensionQueryingVariable); - -#ifdef WIN32 -GLEE_EXTERN const char * GLeeGetExtStrWGL( void ); -#elif defined(__APPLE__) || defined(__APPLE_CC__) -#else -GLEE_EXTERN const char * GLeeGetExtStrGLX( void ); -#endif - -#ifdef __cplusplus -} /* end C linkage */ -#endif - -#endif /* __glee_h_ defined */ +# define WIN32 +#endif + #include + #include +#elif defined(__APPLE__) || defined(__APPLE_CC__) + #define GL_GLEXT_LEGACY + #include +#else // GLX + #define __glext_h_ /* prevent glext.h from being included */ + #define __glxext_h_ /* prevent glxext.h from being included */ + #define GLX_GLXEXT_PROTOTYPES + #include + #include +#endif + +#ifndef APIENTRY + #define APIENTRY +#endif + +#ifndef APIENTRYP + #define APIENTRYP APIENTRY * +#endif + +#define GLEE_EXTERN extern + +#ifdef __cplusplus + extern "C" { /* begin C linkage */ +#endif + +#define GLEE_LINK_FAIL 0 +#define GLEE_LINK_PARTIAL 1 +#define GLEE_LINK_COMPLETE 2 + +/* Extension querying variables */ + +GLEE_EXTERN GLboolean _GLEE_VERSION_1_2; +GLEE_EXTERN GLboolean _GLEE_ARB_imaging; +GLEE_EXTERN GLboolean _GLEE_VERSION_1_3; +GLEE_EXTERN GLboolean _GLEE_VERSION_1_4; +GLEE_EXTERN GLboolean _GLEE_VERSION_1_5; +GLEE_EXTERN GLboolean _GLEE_VERSION_2_0; +GLEE_EXTERN GLboolean _GLEE_VERSION_2_1; +GLEE_EXTERN GLboolean _GLEE_VERSION_3_0; +GLEE_EXTERN GLboolean _GLEE_ARB_multitexture; +GLEE_EXTERN GLboolean _GLEE_ARB_transpose_matrix; +GLEE_EXTERN GLboolean _GLEE_ARB_multisample; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_env_add; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_cube_map; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_compression; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_border_clamp; +GLEE_EXTERN GLboolean _GLEE_ARB_point_parameters; +GLEE_EXTERN GLboolean _GLEE_ARB_vertex_blend; +GLEE_EXTERN GLboolean _GLEE_ARB_matrix_palette; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_env_combine; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_env_crossbar; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_env_dot3; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_mirrored_repeat; +GLEE_EXTERN GLboolean _GLEE_ARB_depth_texture; +GLEE_EXTERN GLboolean _GLEE_ARB_shadow; +GLEE_EXTERN GLboolean _GLEE_ARB_shadow_ambient; +GLEE_EXTERN GLboolean _GLEE_ARB_window_pos; +GLEE_EXTERN GLboolean _GLEE_ARB_vertex_program; +GLEE_EXTERN GLboolean _GLEE_ARB_fragment_program; +GLEE_EXTERN GLboolean _GLEE_ARB_vertex_buffer_object; +GLEE_EXTERN GLboolean _GLEE_ARB_occlusion_query; +GLEE_EXTERN GLboolean _GLEE_ARB_shader_objects; +GLEE_EXTERN GLboolean _GLEE_ARB_vertex_shader; +GLEE_EXTERN GLboolean _GLEE_ARB_fragment_shader; +GLEE_EXTERN GLboolean _GLEE_ARB_shading_language_100; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_non_power_of_two; +GLEE_EXTERN GLboolean _GLEE_ARB_point_sprite; +GLEE_EXTERN GLboolean _GLEE_ARB_fragment_program_shadow; +GLEE_EXTERN GLboolean _GLEE_ARB_draw_buffers; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_rectangle; +GLEE_EXTERN GLboolean _GLEE_ARB_color_buffer_float; +GLEE_EXTERN GLboolean _GLEE_ARB_half_float_pixel; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_float; +GLEE_EXTERN GLboolean _GLEE_ARB_pixel_buffer_object; +GLEE_EXTERN GLboolean _GLEE_ARB_depth_buffer_float; +GLEE_EXTERN GLboolean _GLEE_ARB_drawinstanced; +GLEE_EXTERN GLboolean _GLEE_ARB_framebuffer_object; +GLEE_EXTERN GLboolean _GLEE_ARB_framebuffer_sRGB; +GLEE_EXTERN GLboolean _GLEE_ARB_geometry_shader4; +GLEE_EXTERN GLboolean _GLEE_ARB_half_float_vertex; +GLEE_EXTERN GLboolean _GLEE_ARBinstanced_arrays; +GLEE_EXTERN GLboolean _GLEE_ARB_map_buffer_range; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_buffer_object; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_compression_rgtc; +GLEE_EXTERN GLboolean _GLEE_ARB_texture_rg; +GLEE_EXTERN GLboolean _GLEE_ARB_vertex_array_object; +GLEE_EXTERN GLboolean _GLEE_EXT_abgr; +GLEE_EXTERN GLboolean _GLEE_EXT_blend_color; +GLEE_EXTERN GLboolean _GLEE_EXT_polygon_offset; +GLEE_EXTERN GLboolean _GLEE_EXT_texture; +GLEE_EXTERN GLboolean _GLEE_EXT_texture3D; +GLEE_EXTERN GLboolean _GLEE_SGIS_texture_filter4; +GLEE_EXTERN GLboolean _GLEE_EXT_subtexture; +GLEE_EXTERN GLboolean _GLEE_EXT_copy_texture; +GLEE_EXTERN GLboolean _GLEE_EXT_histogram; +GLEE_EXTERN GLboolean _GLEE_EXT_convolution; +GLEE_EXTERN GLboolean _GLEE_SGI_color_matrix; +GLEE_EXTERN GLboolean _GLEE_SGI_color_table; +GLEE_EXTERN GLboolean _GLEE_SGIS_pixel_texture; +GLEE_EXTERN GLboolean _GLEE_SGIX_pixel_texture; +GLEE_EXTERN GLboolean _GLEE_SGIS_texture4D; +GLEE_EXTERN GLboolean _GLEE_SGI_texture_color_table; +GLEE_EXTERN GLboolean _GLEE_EXT_cmyka; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_object; +GLEE_EXTERN GLboolean _GLEE_SGIS_detail_texture; +GLEE_EXTERN GLboolean _GLEE_SGIS_sharpen_texture; +GLEE_EXTERN GLboolean _GLEE_EXT_packed_pixels; +GLEE_EXTERN GLboolean _GLEE_SGIS_texture_lod; +GLEE_EXTERN GLboolean _GLEE_SGIS_multisample; +GLEE_EXTERN GLboolean _GLEE_EXT_rescale_normal; +GLEE_EXTERN GLboolean _GLEE_EXT_vertex_array; +GLEE_EXTERN GLboolean _GLEE_EXT_misc_attribute; +GLEE_EXTERN GLboolean _GLEE_SGIS_generate_mipmap; +GLEE_EXTERN GLboolean _GLEE_SGIX_clipmap; +GLEE_EXTERN GLboolean _GLEE_SGIX_shadow; +GLEE_EXTERN GLboolean _GLEE_SGIS_texture_edge_clamp; +GLEE_EXTERN GLboolean _GLEE_SGIS_texture_border_clamp; +GLEE_EXTERN GLboolean _GLEE_EXT_blend_minmax; +GLEE_EXTERN GLboolean _GLEE_EXT_blend_subtract; +GLEE_EXTERN GLboolean _GLEE_EXT_blend_logic_op; +GLEE_EXTERN GLboolean _GLEE_SGIX_interlace; +GLEE_EXTERN GLboolean _GLEE_SGIX_pixel_tiles; +GLEE_EXTERN GLboolean _GLEE_SGIS_texture_select; +GLEE_EXTERN GLboolean _GLEE_SGIX_sprite; +GLEE_EXTERN GLboolean _GLEE_SGIX_texture_multi_buffer; +GLEE_EXTERN GLboolean _GLEE_EXT_point_parameters; +GLEE_EXTERN GLboolean _GLEE_SGIS_point_parameters; +GLEE_EXTERN GLboolean _GLEE_SGIX_instruments; +GLEE_EXTERN GLboolean _GLEE_SGIX_texture_scale_bias; +GLEE_EXTERN GLboolean _GLEE_SGIX_framezoom; +GLEE_EXTERN GLboolean _GLEE_SGIX_tag_sample_buffer; +GLEE_EXTERN GLboolean _GLEE_FfdMaskSGIX; +GLEE_EXTERN GLboolean _GLEE_SGIX_polynomial_ffd; +GLEE_EXTERN GLboolean _GLEE_SGIX_reference_plane; +GLEE_EXTERN GLboolean _GLEE_SGIX_flush_raster; +GLEE_EXTERN GLboolean _GLEE_SGIX_depth_texture; +GLEE_EXTERN GLboolean _GLEE_SGIS_fog_function; +GLEE_EXTERN GLboolean _GLEE_SGIX_fog_offset; +GLEE_EXTERN GLboolean _GLEE_HP_image_transform; +GLEE_EXTERN GLboolean _GLEE_HP_convolution_border_modes; +GLEE_EXTERN GLboolean _GLEE_INGR_palette_buffer; +GLEE_EXTERN GLboolean _GLEE_SGIX_texture_add_env; +GLEE_EXTERN GLboolean _GLEE_EXT_color_subtable; +GLEE_EXTERN GLboolean _GLEE_PGI_vertex_hints; +GLEE_EXTERN GLboolean _GLEE_PGI_misc_hints; +GLEE_EXTERN GLboolean _GLEE_EXT_paletted_texture; +GLEE_EXTERN GLboolean _GLEE_EXT_clip_volume_hint; +GLEE_EXTERN GLboolean _GLEE_SGIX_list_priority; +GLEE_EXTERN GLboolean _GLEE_SGIX_ir_instrument1; +GLEE_EXTERN GLboolean _GLEE_SGIX_calligraphic_fragment; +GLEE_EXTERN GLboolean _GLEE_SGIX_texture_lod_bias; +GLEE_EXTERN GLboolean _GLEE_SGIX_shadow_ambient; +GLEE_EXTERN GLboolean _GLEE_EXT_index_texture; +GLEE_EXTERN GLboolean _GLEE_EXT_index_material; +GLEE_EXTERN GLboolean _GLEE_EXT_index_func; +GLEE_EXTERN GLboolean _GLEE_EXT_index_array_formats; +GLEE_EXTERN GLboolean _GLEE_EXT_compiled_vertex_array; +GLEE_EXTERN GLboolean _GLEE_EXT_cull_vertex; +GLEE_EXTERN GLboolean _GLEE_SGIX_ycrcb; +GLEE_EXTERN GLboolean _GLEE_SGIX_fragment_lighting; +GLEE_EXTERN GLboolean _GLEE_IBM_rasterpos_clip; +GLEE_EXTERN GLboolean _GLEE_HP_texture_lighting; +GLEE_EXTERN GLboolean _GLEE_EXT_draw_range_elements; +GLEE_EXTERN GLboolean _GLEE_WIN_phong_shading; +GLEE_EXTERN GLboolean _GLEE_WIN_specular_fog; +GLEE_EXTERN GLboolean _GLEE_EXT_light_texture; +GLEE_EXTERN GLboolean _GLEE_SGIX_blend_alpha_minmax; +GLEE_EXTERN GLboolean _GLEE_SGIX_impact_pixel_texture; +GLEE_EXTERN GLboolean _GLEE_EXT_bgra; +GLEE_EXTERN GLboolean _GLEE_SGIX_async; +GLEE_EXTERN GLboolean _GLEE_SGIX_async_pixel; +GLEE_EXTERN GLboolean _GLEE_SGIX_async_histogram; +GLEE_EXTERN GLboolean _GLEE_INTEL_texture_scissor; +GLEE_EXTERN GLboolean _GLEE_INTEL_parallel_arrays; +GLEE_EXTERN GLboolean _GLEE_HP_occlusion_test; +GLEE_EXTERN GLboolean _GLEE_EXT_pixel_transform; +GLEE_EXTERN GLboolean _GLEE_EXT_pixel_transform_color_table; +GLEE_EXTERN GLboolean _GLEE_EXT_shared_texture_palette; +GLEE_EXTERN GLboolean _GLEE_EXT_separate_specular_color; +GLEE_EXTERN GLboolean _GLEE_EXT_secondary_color; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_perturb_normal; +GLEE_EXTERN GLboolean _GLEE_EXT_multi_draw_arrays; +GLEE_EXTERN GLboolean _GLEE_EXT_fog_coord; +GLEE_EXTERN GLboolean _GLEE_REND_screen_coordinates; +GLEE_EXTERN GLboolean _GLEE_EXT_coordinate_frame; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_env_combine; +GLEE_EXTERN GLboolean _GLEE_APPLE_specular_vector; +GLEE_EXTERN GLboolean _GLEE_APPLE_transform_hint; +GLEE_EXTERN GLboolean _GLEE_SGIX_fog_scale; +GLEE_EXTERN GLboolean _GLEE_SUNX_constant_data; +GLEE_EXTERN GLboolean _GLEE_SUN_global_alpha; +GLEE_EXTERN GLboolean _GLEE_SUN_triangle_list; +GLEE_EXTERN GLboolean _GLEE_SUN_vertex; +GLEE_EXTERN GLboolean _GLEE_EXT_blend_func_separate; +GLEE_EXTERN GLboolean _GLEE_INGR_color_clamp; +GLEE_EXTERN GLboolean _GLEE_INGR_interlace_read; +GLEE_EXTERN GLboolean _GLEE_EXT_stencil_wrap; +GLEE_EXTERN GLboolean _GLEE_EXT_422_pixels; +GLEE_EXTERN GLboolean _GLEE_NV_texgen_reflection; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_cube_map; +GLEE_EXTERN GLboolean _GLEE_SUN_convolution_border_modes; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_env_add; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_lod_bias; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_filter_anisotropic; +GLEE_EXTERN GLboolean _GLEE_EXT_vertex_weighting; +GLEE_EXTERN GLboolean _GLEE_NV_light_max_exponent; +GLEE_EXTERN GLboolean _GLEE_NV_vertex_array_range; +GLEE_EXTERN GLboolean _GLEE_NV_register_combiners; +GLEE_EXTERN GLboolean _GLEE_NV_fog_distance; +GLEE_EXTERN GLboolean _GLEE_NV_texgen_emboss; +GLEE_EXTERN GLboolean _GLEE_NV_blend_square; +GLEE_EXTERN GLboolean _GLEE_NV_texture_env_combine4; +GLEE_EXTERN GLboolean _GLEE_MESA_resize_buffers; +GLEE_EXTERN GLboolean _GLEE_MESA_window_pos; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_compression_s3tc; +GLEE_EXTERN GLboolean _GLEE_IBM_cull_vertex; +GLEE_EXTERN GLboolean _GLEE_IBM_multimode_draw_arrays; +GLEE_EXTERN GLboolean _GLEE_IBM_vertex_array_lists; +GLEE_EXTERN GLboolean _GLEE_SGIX_subsample; +GLEE_EXTERN GLboolean _GLEE_SGIX_ycrcb_subsample; +GLEE_EXTERN GLboolean _GLEE_SGIX_ycrcba; +GLEE_EXTERN GLboolean _GLEE_SGI_depth_pass_instrument; +GLEE_EXTERN GLboolean _GLEE_3DFX_texture_compression_FXT1; +GLEE_EXTERN GLboolean _GLEE_3DFX_multisample; +GLEE_EXTERN GLboolean _GLEE_3DFX_tbuffer; +GLEE_EXTERN GLboolean _GLEE_EXT_multisample; +GLEE_EXTERN GLboolean _GLEE_SGIX_vertex_preclip; +GLEE_EXTERN GLboolean _GLEE_SGIX_convolution_accuracy; +GLEE_EXTERN GLboolean _GLEE_SGIX_resample; +GLEE_EXTERN GLboolean _GLEE_SGIS_point_line_texgen; +GLEE_EXTERN GLboolean _GLEE_SGIS_texture_color_mask; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_env_dot3; +GLEE_EXTERN GLboolean _GLEE_ATI_texture_mirror_once; +GLEE_EXTERN GLboolean _GLEE_NV_fence; +GLEE_EXTERN GLboolean _GLEE_IBM_texture_mirrored_repeat; +GLEE_EXTERN GLboolean _GLEE_NV_evaluators; +GLEE_EXTERN GLboolean _GLEE_NV_packed_depth_stencil; +GLEE_EXTERN GLboolean _GLEE_NV_register_combiners2; +GLEE_EXTERN GLboolean _GLEE_NV_texture_compression_vtc; +GLEE_EXTERN GLboolean _GLEE_NV_texture_rectangle; +GLEE_EXTERN GLboolean _GLEE_NV_texture_shader; +GLEE_EXTERN GLboolean _GLEE_NV_texture_shader2; +GLEE_EXTERN GLboolean _GLEE_NV_vertex_array_range2; +GLEE_EXTERN GLboolean _GLEE_NV_vertex_program; +GLEE_EXTERN GLboolean _GLEE_SGIX_texture_coordinate_clamp; +GLEE_EXTERN GLboolean _GLEE_SGIX_scalebias_hint; +GLEE_EXTERN GLboolean _GLEE_OML_interlace; +GLEE_EXTERN GLboolean _GLEE_OML_subsample; +GLEE_EXTERN GLboolean _GLEE_OML_resample; +GLEE_EXTERN GLboolean _GLEE_NV_copy_depth_to_color; +GLEE_EXTERN GLboolean _GLEE_ATI_envmap_bumpmap; +GLEE_EXTERN GLboolean _GLEE_ATI_fragment_shader; +GLEE_EXTERN GLboolean _GLEE_ATI_pn_triangles; +GLEE_EXTERN GLboolean _GLEE_ATI_vertex_array_object; +GLEE_EXTERN GLboolean _GLEE_EXT_vertex_shader; +GLEE_EXTERN GLboolean _GLEE_ATI_vertex_streams; +GLEE_EXTERN GLboolean _GLEE_ATI_element_array; +GLEE_EXTERN GLboolean _GLEE_SUN_mesh_array; +GLEE_EXTERN GLboolean _GLEE_SUN_slice_accum; +GLEE_EXTERN GLboolean _GLEE_NV_multisample_filter_hint; +GLEE_EXTERN GLboolean _GLEE_NV_depth_clamp; +GLEE_EXTERN GLboolean _GLEE_NV_occlusion_query; +GLEE_EXTERN GLboolean _GLEE_NV_point_sprite; +GLEE_EXTERN GLboolean _GLEE_NV_texture_shader3; +GLEE_EXTERN GLboolean _GLEE_NV_vertex_program1_1; +GLEE_EXTERN GLboolean _GLEE_EXT_shadow_funcs; +GLEE_EXTERN GLboolean _GLEE_EXT_stencil_two_side; +GLEE_EXTERN GLboolean _GLEE_ATI_text_fragment_shader; +GLEE_EXTERN GLboolean _GLEE_APPLE_client_storage; +GLEE_EXTERN GLboolean _GLEE_APPLE_element_array; +GLEE_EXTERN GLboolean _GLEE_APPLE_fence; +GLEE_EXTERN GLboolean _GLEE_APPLE_vertex_array_object; +GLEE_EXTERN GLboolean _GLEE_APPLE_vertex_array_range; +GLEE_EXTERN GLboolean _GLEE_APPLE_ycbcr_422; +GLEE_EXTERN GLboolean _GLEE_S3_s3tc; +GLEE_EXTERN GLboolean _GLEE_ATI_draw_buffers; +GLEE_EXTERN GLboolean _GLEE_ATI_pixel_format_float; +GLEE_EXTERN GLboolean _GLEE_ATI_texture_env_combine3; +GLEE_EXTERN GLboolean _GLEE_ATI_texture_float; +GLEE_EXTERN GLboolean _GLEE_NV_float_buffer; +GLEE_EXTERN GLboolean _GLEE_NV_fragment_program; +GLEE_EXTERN GLboolean _GLEE_NV_half_float; +GLEE_EXTERN GLboolean _GLEE_NV_pixel_data_range; +GLEE_EXTERN GLboolean _GLEE_NV_primitive_restart; +GLEE_EXTERN GLboolean _GLEE_NV_texture_expand_normal; +GLEE_EXTERN GLboolean _GLEE_NV_vertex_program2; +GLEE_EXTERN GLboolean _GLEE_ATI_map_object_buffer; +GLEE_EXTERN GLboolean _GLEE_ATI_separate_stencil; +GLEE_EXTERN GLboolean _GLEE_ATI_vertex_attrib_array_object; +GLEE_EXTERN GLboolean _GLEE_OES_read_format; +GLEE_EXTERN GLboolean _GLEE_EXT_depth_bounds_test; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_mirror_clamp; +GLEE_EXTERN GLboolean _GLEE_EXT_blend_equation_separate; +GLEE_EXTERN GLboolean _GLEE_MESA_pack_invert; +GLEE_EXTERN GLboolean _GLEE_MESA_ycbcr_texture; +GLEE_EXTERN GLboolean _GLEE_EXT_pixel_buffer_object; +GLEE_EXTERN GLboolean _GLEE_NV_fragment_program_option; +GLEE_EXTERN GLboolean _GLEE_NV_fragment_program2; +GLEE_EXTERN GLboolean _GLEE_NV_vertex_program2_option; +GLEE_EXTERN GLboolean _GLEE_NV_vertex_program3; +GLEE_EXTERN GLboolean _GLEE_EXT_framebuffer_object; +GLEE_EXTERN GLboolean _GLEE_GREMEDY_string_marker; +GLEE_EXTERN GLboolean _GLEE_EXT_packed_depth_stencil; +GLEE_EXTERN GLboolean _GLEE_EXT_stencil_clear_tag; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_sRGB; +GLEE_EXTERN GLboolean _GLEE_EXT_framebuffer_blit; +GLEE_EXTERN GLboolean _GLEE_EXT_framebuffer_multisample; +GLEE_EXTERN GLboolean _GLEE_MESAX_texture_stack; +GLEE_EXTERN GLboolean _GLEE_EXT_timer_query; +GLEE_EXTERN GLboolean _GLEE_EXT_gpu_program_parameters; +GLEE_EXTERN GLboolean _GLEE_APPLE_flush_buffer_range; +GLEE_EXTERN GLboolean _GLEE_NV_gpu_program4; +GLEE_EXTERN GLboolean _GLEE_NV_geometry_program4; +GLEE_EXTERN GLboolean _GLEE_EXT_geometry_shader4; +GLEE_EXTERN GLboolean _GLEE_NV_vertex_program4; +GLEE_EXTERN GLboolean _GLEE_EXT_gpu_shader4; +GLEE_EXTERN GLboolean _GLEE_EXT_drawinstanced; +GLEE_EXTERN GLboolean _GLEE_EXT_packed_float; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_array; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_buffer_object; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_compression_latc; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_compression_rgtc; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_shared_exponent; +GLEE_EXTERN GLboolean _GLEE_NV_depth_buffer_float; +GLEE_EXTERN GLboolean _GLEE_NV_fragment_program4; +GLEE_EXTERN GLboolean _GLEE_NV_framebuffer_multisample_coverage; +GLEE_EXTERN GLboolean _GLEE_EXT_framebuffer_sRGB; +GLEE_EXTERN GLboolean _GLEE_NV_geometry_shader4; +GLEE_EXTERN GLboolean _GLEE_NV_parameter_buffer_object; +GLEE_EXTERN GLboolean _GLEE_EXT_draw_buffers2; +GLEE_EXTERN GLboolean _GLEE_NV_transform_feedback; +GLEE_EXTERN GLboolean _GLEE_EXT_bindable_uniform; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_integer; +GLEE_EXTERN GLboolean _GLEE_GREMEDY_frame_terminator; +GLEE_EXTERN GLboolean _GLEE_NV_conditional_render; +GLEE_EXTERN GLboolean _GLEE_NV_present_video; +GLEE_EXTERN GLboolean _GLEE_EXT_transform_feedback; +GLEE_EXTERN GLboolean _GLEE_EXT_direct_state_access; +GLEE_EXTERN GLboolean _GLEE_EXT_vertex_array_bgra; +GLEE_EXTERN GLboolean _GLEE_SGIX_texture_select; +GLEE_EXTERN GLboolean _GLEE_INGR_blend_func_separate; +GLEE_EXTERN GLboolean _GLEE_SGIX_depth_pass_instrument; +GLEE_EXTERN GLboolean _GLEE_SGIX_igloo_interface; +GLEE_EXTERN GLboolean _GLEE_EXT_fragment_lighting; +GLEE_EXTERN GLboolean _GLEE_EXT_scene_marker; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_compression_dxt1; +GLEE_EXTERN GLboolean _GLEE_EXT_texture_env; +GLEE_EXTERN GLboolean _GLEE_IBM_static_data; +GLEE_EXTERN GLboolean _GLEE_OES_byte_coordinates; +GLEE_EXTERN GLboolean _GLEE_OES_compressed_paletted_texture; +GLEE_EXTERN GLboolean _GLEE_OES_single_precision; +GLEE_EXTERN GLboolean _GLEE_SGIX_pixel_texture_bits; +GLEE_EXTERN GLboolean _GLEE_SGIX_texture_range; + +/* Aliases for extension querying variables */ + +#define GLEE_VERSION_1_2 GLeeEnabled(&_GLEE_VERSION_1_2) +#define GLEE_ARB_imaging GLeeEnabled(&_GLEE_ARB_imaging) +#define GLEE_VERSION_1_3 GLeeEnabled(&_GLEE_VERSION_1_3) +#define GLEE_VERSION_1_4 GLeeEnabled(&_GLEE_VERSION_1_4) +#define GLEE_VERSION_1_5 GLeeEnabled(&_GLEE_VERSION_1_5) +#define GLEE_VERSION_2_0 GLeeEnabled(&_GLEE_VERSION_2_0) +#define GLEE_VERSION_2_1 GLeeEnabled(&_GLEE_VERSION_2_1) +#define GLEE_VERSION_3_0 GLeeEnabled(&_GLEE_VERSION_3_0) +#define GLEE_ARB_multitexture GLeeEnabled(&_GLEE_ARB_multitexture) +#define GLEE_ARB_transpose_matrix GLeeEnabled(&_GLEE_ARB_transpose_matrix) +#define GLEE_ARB_multisample GLeeEnabled(&_GLEE_ARB_multisample) +#define GLEE_ARB_texture_env_add GLeeEnabled(&_GLEE_ARB_texture_env_add) +#define GLEE_ARB_texture_cube_map GLeeEnabled(&_GLEE_ARB_texture_cube_map) +#define GLEE_ARB_texture_compression GLeeEnabled(&_GLEE_ARB_texture_compression) +#define GLEE_ARB_texture_border_clamp GLeeEnabled(&_GLEE_ARB_texture_border_clamp) +#define GLEE_ARB_point_parameters GLeeEnabled(&_GLEE_ARB_point_parameters) +#define GLEE_ARB_vertex_blend GLeeEnabled(&_GLEE_ARB_vertex_blend) +#define GLEE_ARB_matrix_palette GLeeEnabled(&_GLEE_ARB_matrix_palette) +#define GLEE_ARB_texture_env_combine GLeeEnabled(&_GLEE_ARB_texture_env_combine) +#define GLEE_ARB_texture_env_crossbar GLeeEnabled(&_GLEE_ARB_texture_env_crossbar) +#define GLEE_ARB_texture_env_dot3 GLeeEnabled(&_GLEE_ARB_texture_env_dot3) +#define GLEE_ARB_texture_mirrored_repeat GLeeEnabled(&_GLEE_ARB_texture_mirrored_repeat) +#define GLEE_ARB_depth_texture GLeeEnabled(&_GLEE_ARB_depth_texture) +#define GLEE_ARB_shadow GLeeEnabled(&_GLEE_ARB_shadow) +#define GLEE_ARB_shadow_ambient GLeeEnabled(&_GLEE_ARB_shadow_ambient) +#define GLEE_ARB_window_pos GLeeEnabled(&_GLEE_ARB_window_pos) +#define GLEE_ARB_vertex_program GLeeEnabled(&_GLEE_ARB_vertex_program) +#define GLEE_ARB_fragment_program GLeeEnabled(&_GLEE_ARB_fragment_program) +#define GLEE_ARB_vertex_buffer_object GLeeEnabled(&_GLEE_ARB_vertex_buffer_object) +#define GLEE_ARB_occlusion_query GLeeEnabled(&_GLEE_ARB_occlusion_query) +#define GLEE_ARB_shader_objects GLeeEnabled(&_GLEE_ARB_shader_objects) +#define GLEE_ARB_vertex_shader GLeeEnabled(&_GLEE_ARB_vertex_shader) +#define GLEE_ARB_fragment_shader GLeeEnabled(&_GLEE_ARB_fragment_shader) +#define GLEE_ARB_shading_language_100 GLeeEnabled(&_GLEE_ARB_shading_language_100) +#define GLEE_ARB_texture_non_power_of_two GLeeEnabled(&_GLEE_ARB_texture_non_power_of_two) +#define GLEE_ARB_point_sprite GLeeEnabled(&_GLEE_ARB_point_sprite) +#define GLEE_ARB_fragment_program_shadow GLeeEnabled(&_GLEE_ARB_fragment_program_shadow) +#define GLEE_ARB_draw_buffers GLeeEnabled(&_GLEE_ARB_draw_buffers) +#define GLEE_ARB_texture_rectangle GLeeEnabled(&_GLEE_ARB_texture_rectangle) +#define GLEE_ARB_color_buffer_float GLeeEnabled(&_GLEE_ARB_color_buffer_float) +#define GLEE_ARB_half_float_pixel GLeeEnabled(&_GLEE_ARB_half_float_pixel) +#define GLEE_ARB_texture_float GLeeEnabled(&_GLEE_ARB_texture_float) +#define GLEE_ARB_pixel_buffer_object GLeeEnabled(&_GLEE_ARB_pixel_buffer_object) +#define GLEE_ARB_depth_buffer_float GLeeEnabled(&_GLEE_ARB_depth_buffer_float) +#define GLEE_ARB_drawinstanced GLeeEnabled(&_GLEE_ARB_drawinstanced) +#define GLEE_ARB_framebuffer_object GLeeEnabled(&_GLEE_ARB_framebuffer_object) +#define GLEE_ARB_framebuffer_sRGB GLeeEnabled(&_GLEE_ARB_framebuffer_sRGB) +#define GLEE_ARB_geometry_shader4 GLeeEnabled(&_GLEE_ARB_geometry_shader4) +#define GLEE_ARB_half_float_vertex GLeeEnabled(&_GLEE_ARB_half_float_vertex) +#define GLEE_ARBinstanced_arrays GLeeEnabled(&_GLEE_ARBinstanced_arrays) +#define GLEE_ARB_map_buffer_range GLeeEnabled(&_GLEE_ARB_map_buffer_range) +#define GLEE_ARB_texture_buffer_object GLeeEnabled(&_GLEE_ARB_texture_buffer_object) +#define GLEE_ARB_texture_compression_rgtc GLeeEnabled(&_GLEE_ARB_texture_compression_rgtc) +#define GLEE_ARB_texture_rg GLeeEnabled(&_GLEE_ARB_texture_rg) +#define GLEE_ARB_vertex_array_object GLeeEnabled(&_GLEE_ARB_vertex_array_object) +#define GLEE_EXT_abgr GLeeEnabled(&_GLEE_EXT_abgr) +#define GLEE_EXT_blend_color GLeeEnabled(&_GLEE_EXT_blend_color) +#define GLEE_EXT_polygon_offset GLeeEnabled(&_GLEE_EXT_polygon_offset) +#define GLEE_EXT_texture GLeeEnabled(&_GLEE_EXT_texture) +#define GLEE_EXT_texture3D GLeeEnabled(&_GLEE_EXT_texture3D) +#define GLEE_SGIS_texture_filter4 GLeeEnabled(&_GLEE_SGIS_texture_filter4) +#define GLEE_EXT_subtexture GLeeEnabled(&_GLEE_EXT_subtexture) +#define GLEE_EXT_copy_texture GLeeEnabled(&_GLEE_EXT_copy_texture) +#define GLEE_EXT_histogram GLeeEnabled(&_GLEE_EXT_histogram) +#define GLEE_EXT_convolution GLeeEnabled(&_GLEE_EXT_convolution) +#define GLEE_SGI_color_matrix GLeeEnabled(&_GLEE_SGI_color_matrix) +#define GLEE_SGI_color_table GLeeEnabled(&_GLEE_SGI_color_table) +#define GLEE_SGIS_pixel_texture GLeeEnabled(&_GLEE_SGIS_pixel_texture) +#define GLEE_SGIX_pixel_texture GLeeEnabled(&_GLEE_SGIX_pixel_texture) +#define GLEE_SGIS_texture4D GLeeEnabled(&_GLEE_SGIS_texture4D) +#define GLEE_SGI_texture_color_table GLeeEnabled(&_GLEE_SGI_texture_color_table) +#define GLEE_EXT_cmyka GLeeEnabled(&_GLEE_EXT_cmyka) +#define GLEE_EXT_texture_object GLeeEnabled(&_GLEE_EXT_texture_object) +#define GLEE_SGIS_detail_texture GLeeEnabled(&_GLEE_SGIS_detail_texture) +#define GLEE_SGIS_sharpen_texture GLeeEnabled(&_GLEE_SGIS_sharpen_texture) +#define GLEE_EXT_packed_pixels GLeeEnabled(&_GLEE_EXT_packed_pixels) +#define GLEE_SGIS_texture_lod GLeeEnabled(&_GLEE_SGIS_texture_lod) +#define GLEE_SGIS_multisample GLeeEnabled(&_GLEE_SGIS_multisample) +#define GLEE_EXT_rescale_normal GLeeEnabled(&_GLEE_EXT_rescale_normal) +#define GLEE_EXT_vertex_array GLeeEnabled(&_GLEE_EXT_vertex_array) +#define GLEE_EXT_misc_attribute GLeeEnabled(&_GLEE_EXT_misc_attribute) +#define GLEE_SGIS_generate_mipmap GLeeEnabled(&_GLEE_SGIS_generate_mipmap) +#define GLEE_SGIX_clipmap GLeeEnabled(&_GLEE_SGIX_clipmap) +#define GLEE_SGIX_shadow GLeeEnabled(&_GLEE_SGIX_shadow) +#define GLEE_SGIS_texture_edge_clamp GLeeEnabled(&_GLEE_SGIS_texture_edge_clamp) +#define GLEE_SGIS_texture_border_clamp GLeeEnabled(&_GLEE_SGIS_texture_border_clamp) +#define GLEE_EXT_blend_minmax GLeeEnabled(&_GLEE_EXT_blend_minmax) +#define GLEE_EXT_blend_subtract GLeeEnabled(&_GLEE_EXT_blend_subtract) +#define GLEE_EXT_blend_logic_op GLeeEnabled(&_GLEE_EXT_blend_logic_op) +#define GLEE_SGIX_interlace GLeeEnabled(&_GLEE_SGIX_interlace) +#define GLEE_SGIX_pixel_tiles GLeeEnabled(&_GLEE_SGIX_pixel_tiles) +#define GLEE_SGIS_texture_select GLeeEnabled(&_GLEE_SGIS_texture_select) +#define GLEE_SGIX_sprite GLeeEnabled(&_GLEE_SGIX_sprite) +#define GLEE_SGIX_texture_multi_buffer GLeeEnabled(&_GLEE_SGIX_texture_multi_buffer) +#define GLEE_EXT_point_parameters GLeeEnabled(&_GLEE_EXT_point_parameters) +#define GLEE_SGIS_point_parameters GLeeEnabled(&_GLEE_SGIS_point_parameters) +#define GLEE_SGIX_instruments GLeeEnabled(&_GLEE_SGIX_instruments) +#define GLEE_SGIX_texture_scale_bias GLeeEnabled(&_GLEE_SGIX_texture_scale_bias) +#define GLEE_SGIX_framezoom GLeeEnabled(&_GLEE_SGIX_framezoom) +#define GLEE_SGIX_tag_sample_buffer GLeeEnabled(&_GLEE_SGIX_tag_sample_buffer) +#define GLEE_FfdMaskSGIX GLeeEnabled(&_GLEE_FfdMaskSGIX) +#define GLEE_SGIX_polynomial_ffd GLeeEnabled(&_GLEE_SGIX_polynomial_ffd) +#define GLEE_SGIX_reference_plane GLeeEnabled(&_GLEE_SGIX_reference_plane) +#define GLEE_SGIX_flush_raster GLeeEnabled(&_GLEE_SGIX_flush_raster) +#define GLEE_SGIX_depth_texture GLeeEnabled(&_GLEE_SGIX_depth_texture) +#define GLEE_SGIS_fog_function GLeeEnabled(&_GLEE_SGIS_fog_function) +#define GLEE_SGIX_fog_offset GLeeEnabled(&_GLEE_SGIX_fog_offset) +#define GLEE_HP_image_transform GLeeEnabled(&_GLEE_HP_image_transform) +#define GLEE_HP_convolution_border_modes GLeeEnabled(&_GLEE_HP_convolution_border_modes) +#define GLEE_INGR_palette_buffer GLeeEnabled(&_GLEE_INGR_palette_buffer) +#define GLEE_SGIX_texture_add_env GLeeEnabled(&_GLEE_SGIX_texture_add_env) +#define GLEE_EXT_color_subtable GLeeEnabled(&_GLEE_EXT_color_subtable) +#define GLEE_PGI_vertex_hints GLeeEnabled(&_GLEE_PGI_vertex_hints) +#define GLEE_PGI_misc_hints GLeeEnabled(&_GLEE_PGI_misc_hints) +#define GLEE_EXT_paletted_texture GLeeEnabled(&_GLEE_EXT_paletted_texture) +#define GLEE_EXT_clip_volume_hint GLeeEnabled(&_GLEE_EXT_clip_volume_hint) +#define GLEE_SGIX_list_priority GLeeEnabled(&_GLEE_SGIX_list_priority) +#define GLEE_SGIX_ir_instrument1 GLeeEnabled(&_GLEE_SGIX_ir_instrument1) +#define GLEE_SGIX_calligraphic_fragment GLeeEnabled(&_GLEE_SGIX_calligraphic_fragment) +#define GLEE_SGIX_texture_lod_bias GLeeEnabled(&_GLEE_SGIX_texture_lod_bias) +#define GLEE_SGIX_shadow_ambient GLeeEnabled(&_GLEE_SGIX_shadow_ambient) +#define GLEE_EXT_index_texture GLeeEnabled(&_GLEE_EXT_index_texture) +#define GLEE_EXT_index_material GLeeEnabled(&_GLEE_EXT_index_material) +#define GLEE_EXT_index_func GLeeEnabled(&_GLEE_EXT_index_func) +#define GLEE_EXT_index_array_formats GLeeEnabled(&_GLEE_EXT_index_array_formats) +#define GLEE_EXT_compiled_vertex_array GLeeEnabled(&_GLEE_EXT_compiled_vertex_array) +#define GLEE_EXT_cull_vertex GLeeEnabled(&_GLEE_EXT_cull_vertex) +#define GLEE_SGIX_ycrcb GLeeEnabled(&_GLEE_SGIX_ycrcb) +#define GLEE_SGIX_fragment_lighting GLeeEnabled(&_GLEE_SGIX_fragment_lighting) +#define GLEE_IBM_rasterpos_clip GLeeEnabled(&_GLEE_IBM_rasterpos_clip) +#define GLEE_HP_texture_lighting GLeeEnabled(&_GLEE_HP_texture_lighting) +#define GLEE_EXT_draw_range_elements GLeeEnabled(&_GLEE_EXT_draw_range_elements) +#define GLEE_WIN_phong_shading GLeeEnabled(&_GLEE_WIN_phong_shading) +#define GLEE_WIN_specular_fog GLeeEnabled(&_GLEE_WIN_specular_fog) +#define GLEE_EXT_light_texture GLeeEnabled(&_GLEE_EXT_light_texture) +#define GLEE_SGIX_blend_alpha_minmax GLeeEnabled(&_GLEE_SGIX_blend_alpha_minmax) +#define GLEE_SGIX_impact_pixel_texture GLeeEnabled(&_GLEE_SGIX_impact_pixel_texture) +#define GLEE_EXT_bgra GLeeEnabled(&_GLEE_EXT_bgra) +#define GLEE_SGIX_async GLeeEnabled(&_GLEE_SGIX_async) +#define GLEE_SGIX_async_pixel GLeeEnabled(&_GLEE_SGIX_async_pixel) +#define GLEE_SGIX_async_histogram GLeeEnabled(&_GLEE_SGIX_async_histogram) +#define GLEE_INTEL_texture_scissor GLeeEnabled(&_GLEE_INTEL_texture_scissor) +#define GLEE_INTEL_parallel_arrays GLeeEnabled(&_GLEE_INTEL_parallel_arrays) +#define GLEE_HP_occlusion_test GLeeEnabled(&_GLEE_HP_occlusion_test) +#define GLEE_EXT_pixel_transform GLeeEnabled(&_GLEE_EXT_pixel_transform) +#define GLEE_EXT_pixel_transform_color_table GLeeEnabled(&_GLEE_EXT_pixel_transform_color_table) +#define GLEE_EXT_shared_texture_palette GLeeEnabled(&_GLEE_EXT_shared_texture_palette) +#define GLEE_EXT_separate_specular_color GLeeEnabled(&_GLEE_EXT_separate_specular_color) +#define GLEE_EXT_secondary_color GLeeEnabled(&_GLEE_EXT_secondary_color) +#define GLEE_EXT_texture_perturb_normal GLeeEnabled(&_GLEE_EXT_texture_perturb_normal) +#define GLEE_EXT_multi_draw_arrays GLeeEnabled(&_GLEE_EXT_multi_draw_arrays) +#define GLEE_EXT_fog_coord GLeeEnabled(&_GLEE_EXT_fog_coord) +#define GLEE_REND_screen_coordinates GLeeEnabled(&_GLEE_REND_screen_coordinates) +#define GLEE_EXT_coordinate_frame GLeeEnabled(&_GLEE_EXT_coordinate_frame) +#define GLEE_EXT_texture_env_combine GLeeEnabled(&_GLEE_EXT_texture_env_combine) +#define GLEE_APPLE_specular_vector GLeeEnabled(&_GLEE_APPLE_specular_vector) +#define GLEE_APPLE_transform_hint GLeeEnabled(&_GLEE_APPLE_transform_hint) +#define GLEE_SGIX_fog_scale GLeeEnabled(&_GLEE_SGIX_fog_scale) +#define GLEE_SUNX_constant_data GLeeEnabled(&_GLEE_SUNX_constant_data) +#define GLEE_SUN_global_alpha GLeeEnabled(&_GLEE_SUN_global_alpha) +#define GLEE_SUN_triangle_list GLeeEnabled(&_GLEE_SUN_triangle_list) +#define GLEE_SUN_vertex GLeeEnabled(&_GLEE_SUN_vertex) +#define GLEE_EXT_blend_func_separate GLeeEnabled(&_GLEE_EXT_blend_func_separate) +#define GLEE_INGR_color_clamp GLeeEnabled(&_GLEE_INGR_color_clamp) +#define GLEE_INGR_interlace_read GLeeEnabled(&_GLEE_INGR_interlace_read) +#define GLEE_EXT_stencil_wrap GLeeEnabled(&_GLEE_EXT_stencil_wrap) +#define GLEE_EXT_422_pixels GLeeEnabled(&_GLEE_EXT_422_pixels) +#define GLEE_NV_texgen_reflection GLeeEnabled(&_GLEE_NV_texgen_reflection) +#define GLEE_EXT_texture_cube_map GLeeEnabled(&_GLEE_EXT_texture_cube_map) +#define GLEE_SUN_convolution_border_modes GLeeEnabled(&_GLEE_SUN_convolution_border_modes) +#define GLEE_EXT_texture_env_add GLeeEnabled(&_GLEE_EXT_texture_env_add) +#define GLEE_EXT_texture_lod_bias GLeeEnabled(&_GLEE_EXT_texture_lod_bias) +#define GLEE_EXT_texture_filter_anisotropic GLeeEnabled(&_GLEE_EXT_texture_filter_anisotropic) +#define GLEE_EXT_vertex_weighting GLeeEnabled(&_GLEE_EXT_vertex_weighting) +#define GLEE_NV_light_max_exponent GLeeEnabled(&_GLEE_NV_light_max_exponent) +#define GLEE_NV_vertex_array_range GLeeEnabled(&_GLEE_NV_vertex_array_range) +#define GLEE_NV_register_combiners GLeeEnabled(&_GLEE_NV_register_combiners) +#define GLEE_NV_fog_distance GLeeEnabled(&_GLEE_NV_fog_distance) +#define GLEE_NV_texgen_emboss GLeeEnabled(&_GLEE_NV_texgen_emboss) +#define GLEE_NV_blend_square GLeeEnabled(&_GLEE_NV_blend_square) +#define GLEE_NV_texture_env_combine4 GLeeEnabled(&_GLEE_NV_texture_env_combine4) +#define GLEE_MESA_resize_buffers GLeeEnabled(&_GLEE_MESA_resize_buffers) +#define GLEE_MESA_window_pos GLeeEnabled(&_GLEE_MESA_window_pos) +#define GLEE_EXT_texture_compression_s3tc GLeeEnabled(&_GLEE_EXT_texture_compression_s3tc) +#define GLEE_IBM_cull_vertex GLeeEnabled(&_GLEE_IBM_cull_vertex) +#define GLEE_IBM_multimode_draw_arrays GLeeEnabled(&_GLEE_IBM_multimode_draw_arrays) +#define GLEE_IBM_vertex_array_lists GLeeEnabled(&_GLEE_IBM_vertex_array_lists) +#define GLEE_SGIX_subsample GLeeEnabled(&_GLEE_SGIX_subsample) +#define GLEE_SGIX_ycrcb_subsample GLeeEnabled(&_GLEE_SGIX_ycrcb_subsample) +#define GLEE_SGIX_ycrcba GLeeEnabled(&_GLEE_SGIX_ycrcba) +#define GLEE_SGI_depth_pass_instrument GLeeEnabled(&_GLEE_SGI_depth_pass_instrument) +#define GLEE_3DFX_texture_compression_FXT1 GLeeEnabled(&_GLEE_3DFX_texture_compression_FXT1) +#define GLEE_3DFX_multisample GLeeEnabled(&_GLEE_3DFX_multisample) +#define GLEE_3DFX_tbuffer GLeeEnabled(&_GLEE_3DFX_tbuffer) +#define GLEE_EXT_multisample GLeeEnabled(&_GLEE_EXT_multisample) +#define GLEE_SGIX_vertex_preclip GLeeEnabled(&_GLEE_SGIX_vertex_preclip) +#define GLEE_SGIX_convolution_accuracy GLeeEnabled(&_GLEE_SGIX_convolution_accuracy) +#define GLEE_SGIX_resample GLeeEnabled(&_GLEE_SGIX_resample) +#define GLEE_SGIS_point_line_texgen GLeeEnabled(&_GLEE_SGIS_point_line_texgen) +#define GLEE_SGIS_texture_color_mask GLeeEnabled(&_GLEE_SGIS_texture_color_mask) +#define GLEE_EXT_texture_env_dot3 GLeeEnabled(&_GLEE_EXT_texture_env_dot3) +#define GLEE_ATI_texture_mirror_once GLeeEnabled(&_GLEE_ATI_texture_mirror_once) +#define GLEE_NV_fence GLeeEnabled(&_GLEE_NV_fence) +#define GLEE_IBM_texture_mirrored_repeat GLeeEnabled(&_GLEE_IBM_texture_mirrored_repeat) +#define GLEE_NV_evaluators GLeeEnabled(&_GLEE_NV_evaluators) +#define GLEE_NV_packed_depth_stencil GLeeEnabled(&_GLEE_NV_packed_depth_stencil) +#define GLEE_NV_register_combiners2 GLeeEnabled(&_GLEE_NV_register_combiners2) +#define GLEE_NV_texture_compression_vtc GLeeEnabled(&_GLEE_NV_texture_compression_vtc) +#define GLEE_NV_texture_rectangle GLeeEnabled(&_GLEE_NV_texture_rectangle) +#define GLEE_NV_texture_shader GLeeEnabled(&_GLEE_NV_texture_shader) +#define GLEE_NV_texture_shader2 GLeeEnabled(&_GLEE_NV_texture_shader2) +#define GLEE_NV_vertex_array_range2 GLeeEnabled(&_GLEE_NV_vertex_array_range2) +#define GLEE_NV_vertex_program GLeeEnabled(&_GLEE_NV_vertex_program) +#define GLEE_SGIX_texture_coordinate_clamp GLeeEnabled(&_GLEE_SGIX_texture_coordinate_clamp) +#define GLEE_SGIX_scalebias_hint GLeeEnabled(&_GLEE_SGIX_scalebias_hint) +#define GLEE_OML_interlace GLeeEnabled(&_GLEE_OML_interlace) +#define GLEE_OML_subsample GLeeEnabled(&_GLEE_OML_subsample) +#define GLEE_OML_resample GLeeEnabled(&_GLEE_OML_resample) +#define GLEE_NV_copy_depth_to_color GLeeEnabled(&_GLEE_NV_copy_depth_to_color) +#define GLEE_ATI_envmap_bumpmap GLeeEnabled(&_GLEE_ATI_envmap_bumpmap) +#define GLEE_ATI_fragment_shader GLeeEnabled(&_GLEE_ATI_fragment_shader) +#define GLEE_ATI_pn_triangles GLeeEnabled(&_GLEE_ATI_pn_triangles) +#define GLEE_ATI_vertex_array_object GLeeEnabled(&_GLEE_ATI_vertex_array_object) +#define GLEE_EXT_vertex_shader GLeeEnabled(&_GLEE_EXT_vertex_shader) +#define GLEE_ATI_vertex_streams GLeeEnabled(&_GLEE_ATI_vertex_streams) +#define GLEE_ATI_element_array GLeeEnabled(&_GLEE_ATI_element_array) +#define GLEE_SUN_mesh_array GLeeEnabled(&_GLEE_SUN_mesh_array) +#define GLEE_SUN_slice_accum GLeeEnabled(&_GLEE_SUN_slice_accum) +#define GLEE_NV_multisample_filter_hint GLeeEnabled(&_GLEE_NV_multisample_filter_hint) +#define GLEE_NV_depth_clamp GLeeEnabled(&_GLEE_NV_depth_clamp) +#define GLEE_NV_occlusion_query GLeeEnabled(&_GLEE_NV_occlusion_query) +#define GLEE_NV_point_sprite GLeeEnabled(&_GLEE_NV_point_sprite) +#define GLEE_NV_texture_shader3 GLeeEnabled(&_GLEE_NV_texture_shader3) +#define GLEE_NV_vertex_program1_1 GLeeEnabled(&_GLEE_NV_vertex_program1_1) +#define GLEE_EXT_shadow_funcs GLeeEnabled(&_GLEE_EXT_shadow_funcs) +#define GLEE_EXT_stencil_two_side GLeeEnabled(&_GLEE_EXT_stencil_two_side) +#define GLEE_ATI_text_fragment_shader GLeeEnabled(&_GLEE_ATI_text_fragment_shader) +#define GLEE_APPLE_client_storage GLeeEnabled(&_GLEE_APPLE_client_storage) +#define GLEE_APPLE_element_array GLeeEnabled(&_GLEE_APPLE_element_array) +#define GLEE_APPLE_fence GLeeEnabled(&_GLEE_APPLE_fence) +#define GLEE_APPLE_vertex_array_object GLeeEnabled(&_GLEE_APPLE_vertex_array_object) +#define GLEE_APPLE_vertex_array_range GLeeEnabled(&_GLEE_APPLE_vertex_array_range) +#define GLEE_APPLE_ycbcr_422 GLeeEnabled(&_GLEE_APPLE_ycbcr_422) +#define GLEE_S3_s3tc GLeeEnabled(&_GLEE_S3_s3tc) +#define GLEE_ATI_draw_buffers GLeeEnabled(&_GLEE_ATI_draw_buffers) +#define GLEE_ATI_pixel_format_float GLeeEnabled(&_GLEE_ATI_pixel_format_float) +#define GLEE_ATI_texture_env_combine3 GLeeEnabled(&_GLEE_ATI_texture_env_combine3) +#define GLEE_ATI_texture_float GLeeEnabled(&_GLEE_ATI_texture_float) +#define GLEE_NV_float_buffer GLeeEnabled(&_GLEE_NV_float_buffer) +#define GLEE_NV_fragment_program GLeeEnabled(&_GLEE_NV_fragment_program) +#define GLEE_NV_half_float GLeeEnabled(&_GLEE_NV_half_float) +#define GLEE_NV_pixel_data_range GLeeEnabled(&_GLEE_NV_pixel_data_range) +#define GLEE_NV_primitive_restart GLeeEnabled(&_GLEE_NV_primitive_restart) +#define GLEE_NV_texture_expand_normal GLeeEnabled(&_GLEE_NV_texture_expand_normal) +#define GLEE_NV_vertex_program2 GLeeEnabled(&_GLEE_NV_vertex_program2) +#define GLEE_ATI_map_object_buffer GLeeEnabled(&_GLEE_ATI_map_object_buffer) +#define GLEE_ATI_separate_stencil GLeeEnabled(&_GLEE_ATI_separate_stencil) +#define GLEE_ATI_vertex_attrib_array_object GLeeEnabled(&_GLEE_ATI_vertex_attrib_array_object) +#define GLEE_OES_read_format GLeeEnabled(&_GLEE_OES_read_format) +#define GLEE_EXT_depth_bounds_test GLeeEnabled(&_GLEE_EXT_depth_bounds_test) +#define GLEE_EXT_texture_mirror_clamp GLeeEnabled(&_GLEE_EXT_texture_mirror_clamp) +#define GLEE_EXT_blend_equation_separate GLeeEnabled(&_GLEE_EXT_blend_equation_separate) +#define GLEE_MESA_pack_invert GLeeEnabled(&_GLEE_MESA_pack_invert) +#define GLEE_MESA_ycbcr_texture GLeeEnabled(&_GLEE_MESA_ycbcr_texture) +#define GLEE_EXT_pixel_buffer_object GLeeEnabled(&_GLEE_EXT_pixel_buffer_object) +#define GLEE_NV_fragment_program_option GLeeEnabled(&_GLEE_NV_fragment_program_option) +#define GLEE_NV_fragment_program2 GLeeEnabled(&_GLEE_NV_fragment_program2) +#define GLEE_NV_vertex_program2_option GLeeEnabled(&_GLEE_NV_vertex_program2_option) +#define GLEE_NV_vertex_program3 GLeeEnabled(&_GLEE_NV_vertex_program3) +#define GLEE_EXT_framebuffer_object GLeeEnabled(&_GLEE_EXT_framebuffer_object) +#define GLEE_GREMEDY_string_marker GLeeEnabled(&_GLEE_GREMEDY_string_marker) +#define GLEE_EXT_packed_depth_stencil GLeeEnabled(&_GLEE_EXT_packed_depth_stencil) +#define GLEE_EXT_stencil_clear_tag GLeeEnabled(&_GLEE_EXT_stencil_clear_tag) +#define GLEE_EXT_texture_sRGB GLeeEnabled(&_GLEE_EXT_texture_sRGB) +#define GLEE_EXT_framebuffer_blit GLeeEnabled(&_GLEE_EXT_framebuffer_blit) +#define GLEE_EXT_framebuffer_multisample GLeeEnabled(&_GLEE_EXT_framebuffer_multisample) +#define GLEE_MESAX_texture_stack GLeeEnabled(&_GLEE_MESAX_texture_stack) +#define GLEE_EXT_timer_query GLeeEnabled(&_GLEE_EXT_timer_query) +#define GLEE_EXT_gpu_program_parameters GLeeEnabled(&_GLEE_EXT_gpu_program_parameters) +#define GLEE_APPLE_flush_buffer_range GLeeEnabled(&_GLEE_APPLE_flush_buffer_range) +#define GLEE_NV_gpu_program4 GLeeEnabled(&_GLEE_NV_gpu_program4) +#define GLEE_NV_geometry_program4 GLeeEnabled(&_GLEE_NV_geometry_program4) +#define GLEE_EXT_geometry_shader4 GLeeEnabled(&_GLEE_EXT_geometry_shader4) +#define GLEE_NV_vertex_program4 GLeeEnabled(&_GLEE_NV_vertex_program4) +#define GLEE_EXT_gpu_shader4 GLeeEnabled(&_GLEE_EXT_gpu_shader4) +#define GLEE_EXT_drawinstanced GLeeEnabled(&_GLEE_EXT_drawinstanced) +#define GLEE_EXT_packed_float GLeeEnabled(&_GLEE_EXT_packed_float) +#define GLEE_EXT_texture_array GLeeEnabled(&_GLEE_EXT_texture_array) +#define GLEE_EXT_texture_buffer_object GLeeEnabled(&_GLEE_EXT_texture_buffer_object) +#define GLEE_EXT_texture_compression_latc GLeeEnabled(&_GLEE_EXT_texture_compression_latc) +#define GLEE_EXT_texture_compression_rgtc GLeeEnabled(&_GLEE_EXT_texture_compression_rgtc) +#define GLEE_EXT_texture_shared_exponent GLeeEnabled(&_GLEE_EXT_texture_shared_exponent) +#define GLEE_NV_depth_buffer_float GLeeEnabled(&_GLEE_NV_depth_buffer_float) +#define GLEE_NV_fragment_program4 GLeeEnabled(&_GLEE_NV_fragment_program4) +#define GLEE_NV_framebuffer_multisample_coverage GLeeEnabled(&_GLEE_NV_framebuffer_multisample_coverage) +#define GLEE_EXT_framebuffer_sRGB GLeeEnabled(&_GLEE_EXT_framebuffer_sRGB) +#define GLEE_NV_geometry_shader4 GLeeEnabled(&_GLEE_NV_geometry_shader4) +#define GLEE_NV_parameter_buffer_object GLeeEnabled(&_GLEE_NV_parameter_buffer_object) +#define GLEE_EXT_draw_buffers2 GLeeEnabled(&_GLEE_EXT_draw_buffers2) +#define GLEE_NV_transform_feedback GLeeEnabled(&_GLEE_NV_transform_feedback) +#define GLEE_EXT_bindable_uniform GLeeEnabled(&_GLEE_EXT_bindable_uniform) +#define GLEE_EXT_texture_integer GLeeEnabled(&_GLEE_EXT_texture_integer) +#define GLEE_GREMEDY_frame_terminator GLeeEnabled(&_GLEE_GREMEDY_frame_terminator) +#define GLEE_NV_conditional_render GLeeEnabled(&_GLEE_NV_conditional_render) +#define GLEE_NV_present_video GLeeEnabled(&_GLEE_NV_present_video) +#define GLEE_EXT_transform_feedback GLeeEnabled(&_GLEE_EXT_transform_feedback) +#define GLEE_EXT_direct_state_access GLeeEnabled(&_GLEE_EXT_direct_state_access) +#define GLEE_EXT_vertex_array_bgra GLeeEnabled(&_GLEE_EXT_vertex_array_bgra) +#define GLEE_SGIX_texture_select GLeeEnabled(&_GLEE_SGIX_texture_select) +#define GLEE_INGR_blend_func_separate GLeeEnabled(&_GLEE_INGR_blend_func_separate) +#define GLEE_SGIX_depth_pass_instrument GLeeEnabled(&_GLEE_SGIX_depth_pass_instrument) +#define GLEE_SGIX_igloo_interface GLeeEnabled(&_GLEE_SGIX_igloo_interface) +#define GLEE_EXT_fragment_lighting GLeeEnabled(&_GLEE_EXT_fragment_lighting) +#define GLEE_EXT_scene_marker GLeeEnabled(&_GLEE_EXT_scene_marker) +#define GLEE_EXT_texture_compression_dxt1 GLeeEnabled(&_GLEE_EXT_texture_compression_dxt1) +#define GLEE_EXT_texture_env GLeeEnabled(&_GLEE_EXT_texture_env) +#define GLEE_IBM_static_data GLeeEnabled(&_GLEE_IBM_static_data) +#define GLEE_OES_byte_coordinates GLeeEnabled(&_GLEE_OES_byte_coordinates) +#define GLEE_OES_compressed_paletted_texture GLeeEnabled(&_GLEE_OES_compressed_paletted_texture) +#define GLEE_OES_single_precision GLeeEnabled(&_GLEE_OES_single_precision) +#define GLEE_SGIX_pixel_texture_bits GLeeEnabled(&_GLEE_SGIX_pixel_texture_bits) +#define GLEE_SGIX_texture_range GLeeEnabled(&_GLEE_SGIX_texture_range) + + +/***************************************************************** + * Additional types needed for extensions + *****************************************************************/ + +/* Used for GLSL shader text */ +#ifndef GL_VERSION_2_0 + typedef char GLchar; +#endif + +#include + +#ifndef GL_VERSION_1_5 + typedef ptrdiff_t GLintptr; + typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_NV_half_float + typedef unsigned short GLhalfNV; +#endif + +#ifndef GL_ARB_vertex_buffer_object + typedef ptrdiff_t GLintptrARB; + typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects + typedef int GLhandleARB; + typedef char GLcharARB; +#endif + +#ifndef GL_EXT_timer_query + typedef signed long long GLint64EXT; + typedef unsigned long long GLuint64EXT; +#endif + +/* Platform-specific */ + +#ifdef WIN32 + + /* WGL */ + + #ifndef WGL_ARB_pbuffer + DECLARE_HANDLE(HPBUFFERARB); + #endif + + #ifndef WGL_EXT_pbuffer + DECLARE_HANDLE(HPBUFFEREXT); + #endif + + #ifndef WGL_NV_video_output + DECLARE_HANDLE(HPVIDEODEV); + #endif + +#elif defined(__APPLE__) || defined(__APPLE_CC__) + + /* Mac OS X */ + +#else + + /* GLX */ + + typedef void (*__GLXextFuncPtr)(void); + + #ifndef GLX_ARB_get_proc_address + #define GLX_ARB_get_proc_address 1 + extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); + extern void ( * glXGetProcAddressARB (const GLubyte *procName))(void); + typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); + #endif + + #ifndef GLX_SGIX_fbconfig + typedef XID GLXFBConfigIDSGIX; + typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + #endif + + #ifndef GLX_SGIX_pbuffer + typedef XID GLXPbufferSGIX; + typedef struct { + int type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + int event_type; + int draw_type; + unsigned int mask; + int x, y; + int width, height; + int count; + } GLXBufferClobberEventSGIX; + #endif + + #ifndef GLX_SGIX_hyperpipe + #define _GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 + typedef struct + { + char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; + } GLXHyperpipeNetworkSGIX; + + typedef struct + { + char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; + } GLXHyperpipeConfigSGIX; + + typedef struct + { + char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; + } GLXPipeRect; + + typedef struct + { + char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; + } GLXPipeRectLimits; + #endif + + #ifndef GLX_NV_video_output + typedef unsigned int GLXVideoDeviceNV; + #endif // GLX_NV_video_output + +#endif /* end platform specific */ + + + +/* GL_VERSION_1_2 */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#define __GLEE_GL_VERSION_1_2 1 +/* Constants */ +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid * table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid * image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLEE_EXTERN PFNGLBLENDCOLORPROC pglBlendColor; +GLEE_EXTERN PFNGLBLENDEQUATIONPROC pglBlendEquation; +GLEE_EXTERN PFNGLDRAWRANGEELEMENTSPROC pglDrawRangeElements; +GLEE_EXTERN PFNGLCOLORTABLEPROC pglColorTable; +GLEE_EXTERN PFNGLCOLORTABLEPARAMETERFVPROC pglColorTableParameterfv; +GLEE_EXTERN PFNGLCOLORTABLEPARAMETERIVPROC pglColorTableParameteriv; +GLEE_EXTERN PFNGLCOPYCOLORTABLEPROC pglCopyColorTable; +GLEE_EXTERN PFNGLGETCOLORTABLEPROC pglGetColorTable; +GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERFVPROC pglGetColorTableParameterfv; +GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERIVPROC pglGetColorTableParameteriv; +GLEE_EXTERN PFNGLCOLORSUBTABLEPROC pglColorSubTable; +GLEE_EXTERN PFNGLCOPYCOLORSUBTABLEPROC pglCopyColorSubTable; +GLEE_EXTERN PFNGLCONVOLUTIONFILTER1DPROC pglConvolutionFilter1D; +GLEE_EXTERN PFNGLCONVOLUTIONFILTER2DPROC pglConvolutionFilter2D; +GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERFPROC pglConvolutionParameterf; +GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERFVPROC pglConvolutionParameterfv; +GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERIPROC pglConvolutionParameteri; +GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERIVPROC pglConvolutionParameteriv; +GLEE_EXTERN PFNGLCOPYCONVOLUTIONFILTER1DPROC pglCopyConvolutionFilter1D; +GLEE_EXTERN PFNGLCOPYCONVOLUTIONFILTER2DPROC pglCopyConvolutionFilter2D; +GLEE_EXTERN PFNGLGETCONVOLUTIONFILTERPROC pglGetConvolutionFilter; +GLEE_EXTERN PFNGLGETCONVOLUTIONPARAMETERFVPROC pglGetConvolutionParameterfv; +GLEE_EXTERN PFNGLGETCONVOLUTIONPARAMETERIVPROC pglGetConvolutionParameteriv; +GLEE_EXTERN PFNGLGETSEPARABLEFILTERPROC pglGetSeparableFilter; +GLEE_EXTERN PFNGLSEPARABLEFILTER2DPROC pglSeparableFilter2D; +GLEE_EXTERN PFNGLGETHISTOGRAMPROC pglGetHistogram; +GLEE_EXTERN PFNGLGETHISTOGRAMPARAMETERFVPROC pglGetHistogramParameterfv; +GLEE_EXTERN PFNGLGETHISTOGRAMPARAMETERIVPROC pglGetHistogramParameteriv; +GLEE_EXTERN PFNGLGETMINMAXPROC pglGetMinmax; +GLEE_EXTERN PFNGLGETMINMAXPARAMETERFVPROC pglGetMinmaxParameterfv; +GLEE_EXTERN PFNGLGETMINMAXPARAMETERIVPROC pglGetMinmaxParameteriv; +GLEE_EXTERN PFNGLHISTOGRAMPROC pglHistogram; +GLEE_EXTERN PFNGLMINMAXPROC pglMinmax; +GLEE_EXTERN PFNGLRESETHISTOGRAMPROC pglResetHistogram; +GLEE_EXTERN PFNGLRESETMINMAXPROC pglResetMinmax; +GLEE_EXTERN PFNGLTEXIMAGE3DPROC pglTexImage3D; +GLEE_EXTERN PFNGLTEXSUBIMAGE3DPROC pglTexSubImage3D; +GLEE_EXTERN PFNGLCOPYTEXSUBIMAGE3DPROC pglCopyTexSubImage3D; +#define glBlendColor pglBlendColor +#define glBlendEquation pglBlendEquation +#define glDrawRangeElements pglDrawRangeElements +#define glColorTable pglColorTable +#define glColorTableParameterfv pglColorTableParameterfv +#define glColorTableParameteriv pglColorTableParameteriv +#define glCopyColorTable pglCopyColorTable +#define glGetColorTable pglGetColorTable +#define glGetColorTableParameterfv pglGetColorTableParameterfv +#define glGetColorTableParameteriv pglGetColorTableParameteriv +#define glColorSubTable pglColorSubTable +#define glCopyColorSubTable pglCopyColorSubTable +#define glConvolutionFilter1D pglConvolutionFilter1D +#define glConvolutionFilter2D pglConvolutionFilter2D +#define glConvolutionParameterf pglConvolutionParameterf +#define glConvolutionParameterfv pglConvolutionParameterfv +#define glConvolutionParameteri pglConvolutionParameteri +#define glConvolutionParameteriv pglConvolutionParameteriv +#define glCopyConvolutionFilter1D pglCopyConvolutionFilter1D +#define glCopyConvolutionFilter2D pglCopyConvolutionFilter2D +#define glGetConvolutionFilter pglGetConvolutionFilter +#define glGetConvolutionParameterfv pglGetConvolutionParameterfv +#define glGetConvolutionParameteriv pglGetConvolutionParameteriv +#define glGetSeparableFilter pglGetSeparableFilter +#define glSeparableFilter2D pglSeparableFilter2D +#define glGetHistogram pglGetHistogram +#define glGetHistogramParameterfv pglGetHistogramParameterfv +#define glGetHistogramParameteriv pglGetHistogramParameteriv +#define glGetMinmax pglGetMinmax +#define glGetMinmaxParameterfv pglGetMinmaxParameterfv +#define glGetMinmaxParameteriv pglGetMinmaxParameteriv +#define glHistogram pglHistogram +#define glMinmax pglMinmax +#define glResetHistogram pglResetHistogram +#define glResetMinmax pglResetMinmax +#define glTexImage3D pglTexImage3D +#define glTexSubImage3D pglTexSubImage3D +#define glCopyTexSubImage3D pglCopyTexSubImage3D +#endif + +/* GL_ARB_imaging */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 +#define __GLEE_GL_ARB_imaging 1 +/* Constants */ +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +/* GL_VERSION_1_3 */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#define __GLEE_GL_VERSION_1_3 1 +/* Constants */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort * v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat * m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble * m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat * m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble * m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid * img); +GLEE_EXTERN PFNGLACTIVETEXTUREPROC pglActiveTexture; +GLEE_EXTERN PFNGLCLIENTACTIVETEXTUREPROC pglClientActiveTexture; +GLEE_EXTERN PFNGLMULTITEXCOORD1DPROC pglMultiTexCoord1d; +GLEE_EXTERN PFNGLMULTITEXCOORD1DVPROC pglMultiTexCoord1dv; +GLEE_EXTERN PFNGLMULTITEXCOORD1FPROC pglMultiTexCoord1f; +GLEE_EXTERN PFNGLMULTITEXCOORD1FVPROC pglMultiTexCoord1fv; +GLEE_EXTERN PFNGLMULTITEXCOORD1IPROC pglMultiTexCoord1i; +GLEE_EXTERN PFNGLMULTITEXCOORD1IVPROC pglMultiTexCoord1iv; +GLEE_EXTERN PFNGLMULTITEXCOORD1SPROC pglMultiTexCoord1s; +GLEE_EXTERN PFNGLMULTITEXCOORD1SVPROC pglMultiTexCoord1sv; +GLEE_EXTERN PFNGLMULTITEXCOORD2DPROC pglMultiTexCoord2d; +GLEE_EXTERN PFNGLMULTITEXCOORD2DVPROC pglMultiTexCoord2dv; +GLEE_EXTERN PFNGLMULTITEXCOORD2FPROC pglMultiTexCoord2f; +GLEE_EXTERN PFNGLMULTITEXCOORD2FVPROC pglMultiTexCoord2fv; +GLEE_EXTERN PFNGLMULTITEXCOORD2IPROC pglMultiTexCoord2i; +GLEE_EXTERN PFNGLMULTITEXCOORD2IVPROC pglMultiTexCoord2iv; +GLEE_EXTERN PFNGLMULTITEXCOORD2SPROC pglMultiTexCoord2s; +GLEE_EXTERN PFNGLMULTITEXCOORD2SVPROC pglMultiTexCoord2sv; +GLEE_EXTERN PFNGLMULTITEXCOORD3DPROC pglMultiTexCoord3d; +GLEE_EXTERN PFNGLMULTITEXCOORD3DVPROC pglMultiTexCoord3dv; +GLEE_EXTERN PFNGLMULTITEXCOORD3FPROC pglMultiTexCoord3f; +GLEE_EXTERN PFNGLMULTITEXCOORD3FVPROC pglMultiTexCoord3fv; +GLEE_EXTERN PFNGLMULTITEXCOORD3IPROC pglMultiTexCoord3i; +GLEE_EXTERN PFNGLMULTITEXCOORD3IVPROC pglMultiTexCoord3iv; +GLEE_EXTERN PFNGLMULTITEXCOORD3SPROC pglMultiTexCoord3s; +GLEE_EXTERN PFNGLMULTITEXCOORD3SVPROC pglMultiTexCoord3sv; +GLEE_EXTERN PFNGLMULTITEXCOORD4DPROC pglMultiTexCoord4d; +GLEE_EXTERN PFNGLMULTITEXCOORD4DVPROC pglMultiTexCoord4dv; +GLEE_EXTERN PFNGLMULTITEXCOORD4FPROC pglMultiTexCoord4f; +GLEE_EXTERN PFNGLMULTITEXCOORD4FVPROC pglMultiTexCoord4fv; +GLEE_EXTERN PFNGLMULTITEXCOORD4IPROC pglMultiTexCoord4i; +GLEE_EXTERN PFNGLMULTITEXCOORD4IVPROC pglMultiTexCoord4iv; +GLEE_EXTERN PFNGLMULTITEXCOORD4SPROC pglMultiTexCoord4s; +GLEE_EXTERN PFNGLMULTITEXCOORD4SVPROC pglMultiTexCoord4sv; +GLEE_EXTERN PFNGLLOADTRANSPOSEMATRIXFPROC pglLoadTransposeMatrixf; +GLEE_EXTERN PFNGLLOADTRANSPOSEMATRIXDPROC pglLoadTransposeMatrixd; +GLEE_EXTERN PFNGLMULTTRANSPOSEMATRIXFPROC pglMultTransposeMatrixf; +GLEE_EXTERN PFNGLMULTTRANSPOSEMATRIXDPROC pglMultTransposeMatrixd; +GLEE_EXTERN PFNGLSAMPLECOVERAGEPROC pglSampleCoverage; +GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE3DPROC pglCompressedTexImage3D; +GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE2DPROC pglCompressedTexImage2D; +GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE1DPROC pglCompressedTexImage1D; +GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC pglCompressedTexSubImage3D; +GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC pglCompressedTexSubImage2D; +GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC pglCompressedTexSubImage1D; +GLEE_EXTERN PFNGLGETCOMPRESSEDTEXIMAGEPROC pglGetCompressedTexImage; +#define glActiveTexture pglActiveTexture +#define glClientActiveTexture pglClientActiveTexture +#define glMultiTexCoord1d pglMultiTexCoord1d +#define glMultiTexCoord1dv pglMultiTexCoord1dv +#define glMultiTexCoord1f pglMultiTexCoord1f +#define glMultiTexCoord1fv pglMultiTexCoord1fv +#define glMultiTexCoord1i pglMultiTexCoord1i +#define glMultiTexCoord1iv pglMultiTexCoord1iv +#define glMultiTexCoord1s pglMultiTexCoord1s +#define glMultiTexCoord1sv pglMultiTexCoord1sv +#define glMultiTexCoord2d pglMultiTexCoord2d +#define glMultiTexCoord2dv pglMultiTexCoord2dv +#define glMultiTexCoord2f pglMultiTexCoord2f +#define glMultiTexCoord2fv pglMultiTexCoord2fv +#define glMultiTexCoord2i pglMultiTexCoord2i +#define glMultiTexCoord2iv pglMultiTexCoord2iv +#define glMultiTexCoord2s pglMultiTexCoord2s +#define glMultiTexCoord2sv pglMultiTexCoord2sv +#define glMultiTexCoord3d pglMultiTexCoord3d +#define glMultiTexCoord3dv pglMultiTexCoord3dv +#define glMultiTexCoord3f pglMultiTexCoord3f +#define glMultiTexCoord3fv pglMultiTexCoord3fv +#define glMultiTexCoord3i pglMultiTexCoord3i +#define glMultiTexCoord3iv pglMultiTexCoord3iv +#define glMultiTexCoord3s pglMultiTexCoord3s +#define glMultiTexCoord3sv pglMultiTexCoord3sv +#define glMultiTexCoord4d pglMultiTexCoord4d +#define glMultiTexCoord4dv pglMultiTexCoord4dv +#define glMultiTexCoord4f pglMultiTexCoord4f +#define glMultiTexCoord4fv pglMultiTexCoord4fv +#define glMultiTexCoord4i pglMultiTexCoord4i +#define glMultiTexCoord4iv pglMultiTexCoord4iv +#define glMultiTexCoord4s pglMultiTexCoord4s +#define glMultiTexCoord4sv pglMultiTexCoord4sv +#define glLoadTransposeMatrixf pglLoadTransposeMatrixf +#define glLoadTransposeMatrixd pglLoadTransposeMatrixd +#define glMultTransposeMatrixf pglMultTransposeMatrixf +#define glMultTransposeMatrixd pglMultTransposeMatrixd +#define glSampleCoverage pglSampleCoverage +#define glCompressedTexImage3D pglCompressedTexImage3D +#define glCompressedTexImage2D pglCompressedTexImage2D +#define glCompressedTexImage1D pglCompressedTexImage1D +#define glCompressedTexSubImage3D pglCompressedTexSubImage3D +#define glCompressedTexSubImage2D pglCompressedTexSubImage2D +#define glCompressedTexSubImage1D pglCompressedTexSubImage1D +#define glGetCompressedTexImage pglGetCompressedTexImage +#endif + +/* GL_VERSION_1_4 */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#define __GLEE_GL_VERSION_1_4 1 +/* Constants */ +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat * coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble * coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei * count, GLenum type, const GLvoid* * indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort * v); +GLEE_EXTERN PFNGLBLENDFUNCSEPARATEPROC pglBlendFuncSeparate; +GLEE_EXTERN PFNGLFOGCOORDFPROC pglFogCoordf; +GLEE_EXTERN PFNGLFOGCOORDFVPROC pglFogCoordfv; +GLEE_EXTERN PFNGLFOGCOORDDPROC pglFogCoordd; +GLEE_EXTERN PFNGLFOGCOORDDVPROC pglFogCoorddv; +GLEE_EXTERN PFNGLFOGCOORDPOINTERPROC pglFogCoordPointer; +GLEE_EXTERN PFNGLMULTIDRAWARRAYSPROC pglMultiDrawArrays; +GLEE_EXTERN PFNGLMULTIDRAWELEMENTSPROC pglMultiDrawElements; +GLEE_EXTERN PFNGLPOINTPARAMETERFPROC pglPointParameterf; +GLEE_EXTERN PFNGLPOINTPARAMETERFVPROC pglPointParameterfv; +GLEE_EXTERN PFNGLPOINTPARAMETERIPROC pglPointParameteri; +GLEE_EXTERN PFNGLPOINTPARAMETERIVPROC pglPointParameteriv; +GLEE_EXTERN PFNGLSECONDARYCOLOR3BPROC pglSecondaryColor3b; +GLEE_EXTERN PFNGLSECONDARYCOLOR3BVPROC pglSecondaryColor3bv; +GLEE_EXTERN PFNGLSECONDARYCOLOR3DPROC pglSecondaryColor3d; +GLEE_EXTERN PFNGLSECONDARYCOLOR3DVPROC pglSecondaryColor3dv; +GLEE_EXTERN PFNGLSECONDARYCOLOR3FPROC pglSecondaryColor3f; +GLEE_EXTERN PFNGLSECONDARYCOLOR3FVPROC pglSecondaryColor3fv; +GLEE_EXTERN PFNGLSECONDARYCOLOR3IPROC pglSecondaryColor3i; +GLEE_EXTERN PFNGLSECONDARYCOLOR3IVPROC pglSecondaryColor3iv; +GLEE_EXTERN PFNGLSECONDARYCOLOR3SPROC pglSecondaryColor3s; +GLEE_EXTERN PFNGLSECONDARYCOLOR3SVPROC pglSecondaryColor3sv; +GLEE_EXTERN PFNGLSECONDARYCOLOR3UBPROC pglSecondaryColor3ub; +GLEE_EXTERN PFNGLSECONDARYCOLOR3UBVPROC pglSecondaryColor3ubv; +GLEE_EXTERN PFNGLSECONDARYCOLOR3UIPROC pglSecondaryColor3ui; +GLEE_EXTERN PFNGLSECONDARYCOLOR3UIVPROC pglSecondaryColor3uiv; +GLEE_EXTERN PFNGLSECONDARYCOLOR3USPROC pglSecondaryColor3us; +GLEE_EXTERN PFNGLSECONDARYCOLOR3USVPROC pglSecondaryColor3usv; +GLEE_EXTERN PFNGLSECONDARYCOLORPOINTERPROC pglSecondaryColorPointer; +GLEE_EXTERN PFNGLWINDOWPOS2DPROC pglWindowPos2d; +GLEE_EXTERN PFNGLWINDOWPOS2DVPROC pglWindowPos2dv; +GLEE_EXTERN PFNGLWINDOWPOS2FPROC pglWindowPos2f; +GLEE_EXTERN PFNGLWINDOWPOS2FVPROC pglWindowPos2fv; +GLEE_EXTERN PFNGLWINDOWPOS2IPROC pglWindowPos2i; +GLEE_EXTERN PFNGLWINDOWPOS2IVPROC pglWindowPos2iv; +GLEE_EXTERN PFNGLWINDOWPOS2SPROC pglWindowPos2s; +GLEE_EXTERN PFNGLWINDOWPOS2SVPROC pglWindowPos2sv; +GLEE_EXTERN PFNGLWINDOWPOS3DPROC pglWindowPos3d; +GLEE_EXTERN PFNGLWINDOWPOS3DVPROC pglWindowPos3dv; +GLEE_EXTERN PFNGLWINDOWPOS3FPROC pglWindowPos3f; +GLEE_EXTERN PFNGLWINDOWPOS3FVPROC pglWindowPos3fv; +GLEE_EXTERN PFNGLWINDOWPOS3IPROC pglWindowPos3i; +GLEE_EXTERN PFNGLWINDOWPOS3IVPROC pglWindowPos3iv; +GLEE_EXTERN PFNGLWINDOWPOS3SPROC pglWindowPos3s; +GLEE_EXTERN PFNGLWINDOWPOS3SVPROC pglWindowPos3sv; +#define glBlendFuncSeparate pglBlendFuncSeparate +#define glFogCoordf pglFogCoordf +#define glFogCoordfv pglFogCoordfv +#define glFogCoordd pglFogCoordd +#define glFogCoorddv pglFogCoorddv +#define glFogCoordPointer pglFogCoordPointer +#define glMultiDrawArrays pglMultiDrawArrays +#define glMultiDrawElements pglMultiDrawElements +#define glPointParameterf pglPointParameterf +#define glPointParameterfv pglPointParameterfv +#define glPointParameteri pglPointParameteri +#define glPointParameteriv pglPointParameteriv +#define glSecondaryColor3b pglSecondaryColor3b +#define glSecondaryColor3bv pglSecondaryColor3bv +#define glSecondaryColor3d pglSecondaryColor3d +#define glSecondaryColor3dv pglSecondaryColor3dv +#define glSecondaryColor3f pglSecondaryColor3f +#define glSecondaryColor3fv pglSecondaryColor3fv +#define glSecondaryColor3i pglSecondaryColor3i +#define glSecondaryColor3iv pglSecondaryColor3iv +#define glSecondaryColor3s pglSecondaryColor3s +#define glSecondaryColor3sv pglSecondaryColor3sv +#define glSecondaryColor3ub pglSecondaryColor3ub +#define glSecondaryColor3ubv pglSecondaryColor3ubv +#define glSecondaryColor3ui pglSecondaryColor3ui +#define glSecondaryColor3uiv pglSecondaryColor3uiv +#define glSecondaryColor3us pglSecondaryColor3us +#define glSecondaryColor3usv pglSecondaryColor3usv +#define glSecondaryColorPointer pglSecondaryColorPointer +#define glWindowPos2d pglWindowPos2d +#define glWindowPos2dv pglWindowPos2dv +#define glWindowPos2f pglWindowPos2f +#define glWindowPos2fv pglWindowPos2fv +#define glWindowPos2i pglWindowPos2i +#define glWindowPos2iv pglWindowPos2iv +#define glWindowPos2s pglWindowPos2s +#define glWindowPos2sv pglWindowPos2sv +#define glWindowPos3d pglWindowPos3d +#define glWindowPos3dv pglWindowPos3dv +#define glWindowPos3f pglWindowPos3f +#define glWindowPos3fv pglWindowPos3fv +#define glWindowPos3i pglWindowPos3i +#define glWindowPos3iv pglWindowPos3iv +#define glWindowPos3s pglWindowPos3s +#define glWindowPos3sv pglWindowPos3sv +#endif + +/* GL_VERSION_1_5 */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#define __GLEE_GL_VERSION_1_5 1 +/* Constants */ +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint * ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint * ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint * params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint * buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint * buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* * params); +GLEE_EXTERN PFNGLGENQUERIESPROC pglGenQueries; +GLEE_EXTERN PFNGLDELETEQUERIESPROC pglDeleteQueries; +GLEE_EXTERN PFNGLISQUERYPROC pglIsQuery; +GLEE_EXTERN PFNGLBEGINQUERYPROC pglBeginQuery; +GLEE_EXTERN PFNGLENDQUERYPROC pglEndQuery; +GLEE_EXTERN PFNGLGETQUERYIVPROC pglGetQueryiv; +GLEE_EXTERN PFNGLGETQUERYOBJECTIVPROC pglGetQueryObjectiv; +GLEE_EXTERN PFNGLGETQUERYOBJECTUIVPROC pglGetQueryObjectuiv; +GLEE_EXTERN PFNGLBINDBUFFERPROC pglBindBuffer; +GLEE_EXTERN PFNGLDELETEBUFFERSPROC pglDeleteBuffers; +GLEE_EXTERN PFNGLGENBUFFERSPROC pglGenBuffers; +GLEE_EXTERN PFNGLISBUFFERPROC pglIsBuffer; +GLEE_EXTERN PFNGLBUFFERDATAPROC pglBufferData; +GLEE_EXTERN PFNGLBUFFERSUBDATAPROC pglBufferSubData; +GLEE_EXTERN PFNGLGETBUFFERSUBDATAPROC pglGetBufferSubData; +GLEE_EXTERN PFNGLMAPBUFFERPROC pglMapBuffer; +GLEE_EXTERN PFNGLUNMAPBUFFERPROC pglUnmapBuffer; +GLEE_EXTERN PFNGLGETBUFFERPARAMETERIVPROC pglGetBufferParameteriv; +GLEE_EXTERN PFNGLGETBUFFERPOINTERVPROC pglGetBufferPointerv; +#define glGenQueries pglGenQueries +#define glDeleteQueries pglDeleteQueries +#define glIsQuery pglIsQuery +#define glBeginQuery pglBeginQuery +#define glEndQuery pglEndQuery +#define glGetQueryiv pglGetQueryiv +#define glGetQueryObjectiv pglGetQueryObjectiv +#define glGetQueryObjectuiv pglGetQueryObjectuiv +#define glBindBuffer pglBindBuffer +#define glDeleteBuffers pglDeleteBuffers +#define glGenBuffers pglGenBuffers +#define glIsBuffer pglIsBuffer +#define glBufferData pglBufferData +#define glBufferSubData pglBufferSubData +#define glGetBufferSubData pglGetBufferSubData +#define glMapBuffer pglMapBuffer +#define glUnmapBuffer pglUnmapBuffer +#define glGetBufferParameteriv pglGetBufferParameteriv +#define glGetBufferPointerv pglGetBufferPointerv +#endif + +/* GL_VERSION_2_0 */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#define __GLEE_GL_VERSION_2_0 1 +/* Constants */ +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum * bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar * name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat * params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* * pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* * string, const GLint * length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); +GLEE_EXTERN PFNGLBLENDEQUATIONSEPARATEPROC pglBlendEquationSeparate; +GLEE_EXTERN PFNGLDRAWBUFFERSPROC pglDrawBuffers; +GLEE_EXTERN PFNGLSTENCILOPSEPARATEPROC pglStencilOpSeparate; +GLEE_EXTERN PFNGLSTENCILFUNCSEPARATEPROC pglStencilFuncSeparate; +GLEE_EXTERN PFNGLSTENCILMASKSEPARATEPROC pglStencilMaskSeparate; +GLEE_EXTERN PFNGLATTACHSHADERPROC pglAttachShader; +GLEE_EXTERN PFNGLBINDATTRIBLOCATIONPROC pglBindAttribLocation; +GLEE_EXTERN PFNGLCOMPILESHADERPROC pglCompileShader; +GLEE_EXTERN PFNGLCREATEPROGRAMPROC pglCreateProgram; +GLEE_EXTERN PFNGLCREATESHADERPROC pglCreateShader; +GLEE_EXTERN PFNGLDELETEPROGRAMPROC pglDeleteProgram; +GLEE_EXTERN PFNGLDELETESHADERPROC pglDeleteShader; +GLEE_EXTERN PFNGLDETACHSHADERPROC pglDetachShader; +GLEE_EXTERN PFNGLDISABLEVERTEXATTRIBARRAYPROC pglDisableVertexAttribArray; +GLEE_EXTERN PFNGLENABLEVERTEXATTRIBARRAYPROC pglEnableVertexAttribArray; +GLEE_EXTERN PFNGLGETACTIVEATTRIBPROC pglGetActiveAttrib; +GLEE_EXTERN PFNGLGETACTIVEUNIFORMPROC pglGetActiveUniform; +GLEE_EXTERN PFNGLGETATTACHEDSHADERSPROC pglGetAttachedShaders; +GLEE_EXTERN PFNGLGETATTRIBLOCATIONPROC pglGetAttribLocation; +GLEE_EXTERN PFNGLGETPROGRAMIVPROC pglGetProgramiv; +GLEE_EXTERN PFNGLGETPROGRAMINFOLOGPROC pglGetProgramInfoLog; +GLEE_EXTERN PFNGLGETSHADERIVPROC pglGetShaderiv; +GLEE_EXTERN PFNGLGETSHADERINFOLOGPROC pglGetShaderInfoLog; +GLEE_EXTERN PFNGLGETSHADERSOURCEPROC pglGetShaderSource; +GLEE_EXTERN PFNGLGETUNIFORMLOCATIONPROC pglGetUniformLocation; +GLEE_EXTERN PFNGLGETUNIFORMFVPROC pglGetUniformfv; +GLEE_EXTERN PFNGLGETUNIFORMIVPROC pglGetUniformiv; +GLEE_EXTERN PFNGLGETVERTEXATTRIBDVPROC pglGetVertexAttribdv; +GLEE_EXTERN PFNGLGETVERTEXATTRIBFVPROC pglGetVertexAttribfv; +GLEE_EXTERN PFNGLGETVERTEXATTRIBIVPROC pglGetVertexAttribiv; +GLEE_EXTERN PFNGLGETVERTEXATTRIBPOINTERVPROC pglGetVertexAttribPointerv; +GLEE_EXTERN PFNGLISPROGRAMPROC pglIsProgram; +GLEE_EXTERN PFNGLISSHADERPROC pglIsShader; +GLEE_EXTERN PFNGLLINKPROGRAMPROC pglLinkProgram; +GLEE_EXTERN PFNGLSHADERSOURCEPROC pglShaderSource; +GLEE_EXTERN PFNGLUSEPROGRAMPROC pglUseProgram; +GLEE_EXTERN PFNGLUNIFORM1FPROC pglUniform1f; +GLEE_EXTERN PFNGLUNIFORM2FPROC pglUniform2f; +GLEE_EXTERN PFNGLUNIFORM3FPROC pglUniform3f; +GLEE_EXTERN PFNGLUNIFORM4FPROC pglUniform4f; +GLEE_EXTERN PFNGLUNIFORM1IPROC pglUniform1i; +GLEE_EXTERN PFNGLUNIFORM2IPROC pglUniform2i; +GLEE_EXTERN PFNGLUNIFORM3IPROC pglUniform3i; +GLEE_EXTERN PFNGLUNIFORM4IPROC pglUniform4i; +GLEE_EXTERN PFNGLUNIFORM1FVPROC pglUniform1fv; +GLEE_EXTERN PFNGLUNIFORM2FVPROC pglUniform2fv; +GLEE_EXTERN PFNGLUNIFORM3FVPROC pglUniform3fv; +GLEE_EXTERN PFNGLUNIFORM4FVPROC pglUniform4fv; +GLEE_EXTERN PFNGLUNIFORM1IVPROC pglUniform1iv; +GLEE_EXTERN PFNGLUNIFORM2IVPROC pglUniform2iv; +GLEE_EXTERN PFNGLUNIFORM3IVPROC pglUniform3iv; +GLEE_EXTERN PFNGLUNIFORM4IVPROC pglUniform4iv; +GLEE_EXTERN PFNGLUNIFORMMATRIX2FVPROC pglUniformMatrix2fv; +GLEE_EXTERN PFNGLUNIFORMMATRIX3FVPROC pglUniformMatrix3fv; +GLEE_EXTERN PFNGLUNIFORMMATRIX4FVPROC pglUniformMatrix4fv; +GLEE_EXTERN PFNGLVALIDATEPROGRAMPROC pglValidateProgram; +GLEE_EXTERN PFNGLVERTEXATTRIB1DPROC pglVertexAttrib1d; +GLEE_EXTERN PFNGLVERTEXATTRIB1DVPROC pglVertexAttrib1dv; +GLEE_EXTERN PFNGLVERTEXATTRIB1FPROC pglVertexAttrib1f; +GLEE_EXTERN PFNGLVERTEXATTRIB1FVPROC pglVertexAttrib1fv; +GLEE_EXTERN PFNGLVERTEXATTRIB1SPROC pglVertexAttrib1s; +GLEE_EXTERN PFNGLVERTEXATTRIB1SVPROC pglVertexAttrib1sv; +GLEE_EXTERN PFNGLVERTEXATTRIB2DPROC pglVertexAttrib2d; +GLEE_EXTERN PFNGLVERTEXATTRIB2DVPROC pglVertexAttrib2dv; +GLEE_EXTERN PFNGLVERTEXATTRIB2FPROC pglVertexAttrib2f; +GLEE_EXTERN PFNGLVERTEXATTRIB2FVPROC pglVertexAttrib2fv; +GLEE_EXTERN PFNGLVERTEXATTRIB2SPROC pglVertexAttrib2s; +GLEE_EXTERN PFNGLVERTEXATTRIB2SVPROC pglVertexAttrib2sv; +GLEE_EXTERN PFNGLVERTEXATTRIB3DPROC pglVertexAttrib3d; +GLEE_EXTERN PFNGLVERTEXATTRIB3DVPROC pglVertexAttrib3dv; +GLEE_EXTERN PFNGLVERTEXATTRIB3FPROC pglVertexAttrib3f; +GLEE_EXTERN PFNGLVERTEXATTRIB3FVPROC pglVertexAttrib3fv; +GLEE_EXTERN PFNGLVERTEXATTRIB3SPROC pglVertexAttrib3s; +GLEE_EXTERN PFNGLVERTEXATTRIB3SVPROC pglVertexAttrib3sv; +GLEE_EXTERN PFNGLVERTEXATTRIB4NBVPROC pglVertexAttrib4Nbv; +GLEE_EXTERN PFNGLVERTEXATTRIB4NIVPROC pglVertexAttrib4Niv; +GLEE_EXTERN PFNGLVERTEXATTRIB4NSVPROC pglVertexAttrib4Nsv; +GLEE_EXTERN PFNGLVERTEXATTRIB4NUBPROC pglVertexAttrib4Nub; +GLEE_EXTERN PFNGLVERTEXATTRIB4NUBVPROC pglVertexAttrib4Nubv; +GLEE_EXTERN PFNGLVERTEXATTRIB4NUIVPROC pglVertexAttrib4Nuiv; +GLEE_EXTERN PFNGLVERTEXATTRIB4NUSVPROC pglVertexAttrib4Nusv; +GLEE_EXTERN PFNGLVERTEXATTRIB4BVPROC pglVertexAttrib4bv; +GLEE_EXTERN PFNGLVERTEXATTRIB4DPROC pglVertexAttrib4d; +GLEE_EXTERN PFNGLVERTEXATTRIB4DVPROC pglVertexAttrib4dv; +GLEE_EXTERN PFNGLVERTEXATTRIB4FPROC pglVertexAttrib4f; +GLEE_EXTERN PFNGLVERTEXATTRIB4FVPROC pglVertexAttrib4fv; +GLEE_EXTERN PFNGLVERTEXATTRIB4IVPROC pglVertexAttrib4iv; +GLEE_EXTERN PFNGLVERTEXATTRIB4SPROC pglVertexAttrib4s; +GLEE_EXTERN PFNGLVERTEXATTRIB4SVPROC pglVertexAttrib4sv; +GLEE_EXTERN PFNGLVERTEXATTRIB4UBVPROC pglVertexAttrib4ubv; +GLEE_EXTERN PFNGLVERTEXATTRIB4UIVPROC pglVertexAttrib4uiv; +GLEE_EXTERN PFNGLVERTEXATTRIB4USVPROC pglVertexAttrib4usv; +GLEE_EXTERN PFNGLVERTEXATTRIBPOINTERPROC pglVertexAttribPointer; +#define glBlendEquationSeparate pglBlendEquationSeparate +#define glDrawBuffers pglDrawBuffers +#define glStencilOpSeparate pglStencilOpSeparate +#define glStencilFuncSeparate pglStencilFuncSeparate +#define glStencilMaskSeparate pglStencilMaskSeparate +#define glAttachShader pglAttachShader +#define glBindAttribLocation pglBindAttribLocation +#define glCompileShader pglCompileShader +#define glCreateProgram pglCreateProgram +#define glCreateShader pglCreateShader +#define glDeleteProgram pglDeleteProgram +#define glDeleteShader pglDeleteShader +#define glDetachShader pglDetachShader +#define glDisableVertexAttribArray pglDisableVertexAttribArray +#define glEnableVertexAttribArray pglEnableVertexAttribArray +#define glGetActiveAttrib pglGetActiveAttrib +#define glGetActiveUniform pglGetActiveUniform +#define glGetAttachedShaders pglGetAttachedShaders +#define glGetAttribLocation pglGetAttribLocation +#define glGetProgramiv pglGetProgramiv +#define glGetProgramInfoLog pglGetProgramInfoLog +#define glGetShaderiv pglGetShaderiv +#define glGetShaderInfoLog pglGetShaderInfoLog +#define glGetShaderSource pglGetShaderSource +#define glGetUniformLocation pglGetUniformLocation +#define glGetUniformfv pglGetUniformfv +#define glGetUniformiv pglGetUniformiv +#define glGetVertexAttribdv pglGetVertexAttribdv +#define glGetVertexAttribfv pglGetVertexAttribfv +#define glGetVertexAttribiv pglGetVertexAttribiv +#define glGetVertexAttribPointerv pglGetVertexAttribPointerv +#define glIsProgram pglIsProgram +#define glIsShader pglIsShader +#define glLinkProgram pglLinkProgram +#define glShaderSource pglShaderSource +#define glUseProgram pglUseProgram +#define glUniform1f pglUniform1f +#define glUniform2f pglUniform2f +#define glUniform3f pglUniform3f +#define glUniform4f pglUniform4f +#define glUniform1i pglUniform1i +#define glUniform2i pglUniform2i +#define glUniform3i pglUniform3i +#define glUniform4i pglUniform4i +#define glUniform1fv pglUniform1fv +#define glUniform2fv pglUniform2fv +#define glUniform3fv pglUniform3fv +#define glUniform4fv pglUniform4fv +#define glUniform1iv pglUniform1iv +#define glUniform2iv pglUniform2iv +#define glUniform3iv pglUniform3iv +#define glUniform4iv pglUniform4iv +#define glUniformMatrix2fv pglUniformMatrix2fv +#define glUniformMatrix3fv pglUniformMatrix3fv +#define glUniformMatrix4fv pglUniformMatrix4fv +#define glValidateProgram pglValidateProgram +#define glVertexAttrib1d pglVertexAttrib1d +#define glVertexAttrib1dv pglVertexAttrib1dv +#define glVertexAttrib1f pglVertexAttrib1f +#define glVertexAttrib1fv pglVertexAttrib1fv +#define glVertexAttrib1s pglVertexAttrib1s +#define glVertexAttrib1sv pglVertexAttrib1sv +#define glVertexAttrib2d pglVertexAttrib2d +#define glVertexAttrib2dv pglVertexAttrib2dv +#define glVertexAttrib2f pglVertexAttrib2f +#define glVertexAttrib2fv pglVertexAttrib2fv +#define glVertexAttrib2s pglVertexAttrib2s +#define glVertexAttrib2sv pglVertexAttrib2sv +#define glVertexAttrib3d pglVertexAttrib3d +#define glVertexAttrib3dv pglVertexAttrib3dv +#define glVertexAttrib3f pglVertexAttrib3f +#define glVertexAttrib3fv pglVertexAttrib3fv +#define glVertexAttrib3s pglVertexAttrib3s +#define glVertexAttrib3sv pglVertexAttrib3sv +#define glVertexAttrib4Nbv pglVertexAttrib4Nbv +#define glVertexAttrib4Niv pglVertexAttrib4Niv +#define glVertexAttrib4Nsv pglVertexAttrib4Nsv +#define glVertexAttrib4Nub pglVertexAttrib4Nub +#define glVertexAttrib4Nubv pglVertexAttrib4Nubv +#define glVertexAttrib4Nuiv pglVertexAttrib4Nuiv +#define glVertexAttrib4Nusv pglVertexAttrib4Nusv +#define glVertexAttrib4bv pglVertexAttrib4bv +#define glVertexAttrib4d pglVertexAttrib4d +#define glVertexAttrib4dv pglVertexAttrib4dv +#define glVertexAttrib4f pglVertexAttrib4f +#define glVertexAttrib4fv pglVertexAttrib4fv +#define glVertexAttrib4iv pglVertexAttrib4iv +#define glVertexAttrib4s pglVertexAttrib4s +#define glVertexAttrib4sv pglVertexAttrib4sv +#define glVertexAttrib4ubv pglVertexAttrib4ubv +#define glVertexAttrib4uiv pglVertexAttrib4uiv +#define glVertexAttrib4usv pglVertexAttrib4usv +#define glVertexAttribPointer pglVertexAttribPointer +#endif + +/* GL_VERSION_2_1 */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#define __GLEE_GL_VERSION_2_1 1 +/* Constants */ +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +GLEE_EXTERN PFNGLUNIFORMMATRIX2X3FVPROC pglUniformMatrix2x3fv; +GLEE_EXTERN PFNGLUNIFORMMATRIX3X2FVPROC pglUniformMatrix3x2fv; +GLEE_EXTERN PFNGLUNIFORMMATRIX2X4FVPROC pglUniformMatrix2x4fv; +GLEE_EXTERN PFNGLUNIFORMMATRIX4X2FVPROC pglUniformMatrix4x2fv; +GLEE_EXTERN PFNGLUNIFORMMATRIX3X4FVPROC pglUniformMatrix3x4fv; +GLEE_EXTERN PFNGLUNIFORMMATRIX4X3FVPROC pglUniformMatrix4x3fv; +#define glUniformMatrix2x3fv pglUniformMatrix2x3fv +#define glUniformMatrix3x2fv pglUniformMatrix3x2fv +#define glUniformMatrix2x4fv pglUniformMatrix2x4fv +#define glUniformMatrix4x2fv pglUniformMatrix4x2fv +#define glUniformMatrix3x4fv pglUniformMatrix3x4fv +#define glUniformMatrix4x3fv pglUniformMatrix4x3fv +#endif + +/* GL_VERSION_3_0 */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +#define __GLEE_GL_VERSION_3_0 1 +/* Constants */ +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean * data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint * data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLint * location); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint * params); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint * params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar * name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint * params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint * params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, const GLint * value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, const GLuint * value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, const GLfloat * value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLfloat depth, GLint stencil); +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +GLEE_EXTERN PFNGLCOLORMASKIPROC pglColorMaski; +GLEE_EXTERN PFNGLGETBOOLEANI_VPROC pglGetBooleani_v; +GLEE_EXTERN PFNGLGETINTEGERI_VPROC pglGetIntegeri_v; +GLEE_EXTERN PFNGLENABLEIPROC pglEnablei; +GLEE_EXTERN PFNGLDISABLEIPROC pglDisablei; +GLEE_EXTERN PFNGLISENABLEDIPROC pglIsEnabledi; +GLEE_EXTERN PFNGLBEGINTRANSFORMFEEDBACKPROC pglBeginTransformFeedback; +GLEE_EXTERN PFNGLENDTRANSFORMFEEDBACKPROC pglEndTransformFeedback; +GLEE_EXTERN PFNGLBINDBUFFERRANGEPROC pglBindBufferRange; +GLEE_EXTERN PFNGLBINDBUFFERBASEPROC pglBindBufferBase; +GLEE_EXTERN PFNGLTRANSFORMFEEDBACKVARYINGSPROC pglTransformFeedbackVaryings; +GLEE_EXTERN PFNGLGETTRANSFORMFEEDBACKVARYINGPROC pglGetTransformFeedbackVarying; +GLEE_EXTERN PFNGLCLAMPCOLORPROC pglClampColor; +GLEE_EXTERN PFNGLBEGINCONDITIONALRENDERPROC pglBeginConditionalRender; +GLEE_EXTERN PFNGLENDCONDITIONALRENDERPROC pglEndConditionalRender; +GLEE_EXTERN PFNGLVERTEXATTRIBI1IPROC pglVertexAttribI1i; +GLEE_EXTERN PFNGLVERTEXATTRIBI2IPROC pglVertexAttribI2i; +GLEE_EXTERN PFNGLVERTEXATTRIBI3IPROC pglVertexAttribI3i; +GLEE_EXTERN PFNGLVERTEXATTRIBI4IPROC pglVertexAttribI4i; +GLEE_EXTERN PFNGLVERTEXATTRIBI1UIPROC pglVertexAttribI1ui; +GLEE_EXTERN PFNGLVERTEXATTRIBI2UIPROC pglVertexAttribI2ui; +GLEE_EXTERN PFNGLVERTEXATTRIBI3UIPROC pglVertexAttribI3ui; +GLEE_EXTERN PFNGLVERTEXATTRIBI4UIPROC pglVertexAttribI4ui; +GLEE_EXTERN PFNGLVERTEXATTRIBI1IVPROC pglVertexAttribI1iv; +GLEE_EXTERN PFNGLVERTEXATTRIBI2IVPROC pglVertexAttribI2iv; +GLEE_EXTERN PFNGLVERTEXATTRIBI3IVPROC pglVertexAttribI3iv; +GLEE_EXTERN PFNGLVERTEXATTRIBI4IVPROC pglVertexAttribI4iv; +GLEE_EXTERN PFNGLVERTEXATTRIBI1UIVPROC pglVertexAttribI1uiv; +GLEE_EXTERN PFNGLVERTEXATTRIBI2UIVPROC pglVertexAttribI2uiv; +GLEE_EXTERN PFNGLVERTEXATTRIBI3UIVPROC pglVertexAttribI3uiv; +GLEE_EXTERN PFNGLVERTEXATTRIBI4UIVPROC pglVertexAttribI4uiv; +GLEE_EXTERN PFNGLVERTEXATTRIBI4BVPROC pglVertexAttribI4bv; +GLEE_EXTERN PFNGLVERTEXATTRIBI4SVPROC pglVertexAttribI4sv; +GLEE_EXTERN PFNGLVERTEXATTRIBI4UBVPROC pglVertexAttribI4ubv; +GLEE_EXTERN PFNGLVERTEXATTRIBI4USVPROC pglVertexAttribI4usv; +GLEE_EXTERN PFNGLVERTEXATTRIBIPOINTERPROC pglVertexAttribIPointer; +GLEE_EXTERN PFNGLGETVERTEXATTRIBIIVPROC pglGetVertexAttribIiv; +GLEE_EXTERN PFNGLGETVERTEXATTRIBIUIVPROC pglGetVertexAttribIuiv; +GLEE_EXTERN PFNGLGETUNIFORMUIVPROC pglGetUniformuiv; +GLEE_EXTERN PFNGLBINDFRAGDATALOCATIONPROC pglBindFragDataLocation; +GLEE_EXTERN PFNGLGETFRAGDATALOCATIONPROC pglGetFragDataLocation; +GLEE_EXTERN PFNGLUNIFORM1UIPROC pglUniform1ui; +GLEE_EXTERN PFNGLUNIFORM2UIPROC pglUniform2ui; +GLEE_EXTERN PFNGLUNIFORM3UIPROC pglUniform3ui; +GLEE_EXTERN PFNGLUNIFORM4UIPROC pglUniform4ui; +GLEE_EXTERN PFNGLUNIFORM1UIVPROC pglUniform1uiv; +GLEE_EXTERN PFNGLUNIFORM2UIVPROC pglUniform2uiv; +GLEE_EXTERN PFNGLUNIFORM3UIVPROC pglUniform3uiv; +GLEE_EXTERN PFNGLUNIFORM4UIVPROC pglUniform4uiv; +GLEE_EXTERN PFNGLTEXPARAMETERIIVPROC pglTexParameterIiv; +GLEE_EXTERN PFNGLTEXPARAMETERIUIVPROC pglTexParameterIuiv; +GLEE_EXTERN PFNGLGETTEXPARAMETERIIVPROC pglGetTexParameterIiv; +GLEE_EXTERN PFNGLGETTEXPARAMETERIUIVPROC pglGetTexParameterIuiv; +GLEE_EXTERN PFNGLCLEARBUFFERIVPROC pglClearBufferiv; +GLEE_EXTERN PFNGLCLEARBUFFERUIVPROC pglClearBufferuiv; +GLEE_EXTERN PFNGLCLEARBUFFERFVPROC pglClearBufferfv; +GLEE_EXTERN PFNGLCLEARBUFFERFIPROC pglClearBufferfi; +GLEE_EXTERN PFNGLGETSTRINGIPROC pglGetStringi; +#define glColorMaski pglColorMaski +#define glGetBooleani_v pglGetBooleani_v +#define glGetIntegeri_v pglGetIntegeri_v +#define glEnablei pglEnablei +#define glDisablei pglDisablei +#define glIsEnabledi pglIsEnabledi +#define glBeginTransformFeedback pglBeginTransformFeedback +#define glEndTransformFeedback pglEndTransformFeedback +#define glBindBufferRange pglBindBufferRange +#define glBindBufferBase pglBindBufferBase +#define glTransformFeedbackVaryings pglTransformFeedbackVaryings +#define glGetTransformFeedbackVarying pglGetTransformFeedbackVarying +#define glClampColor pglClampColor +#define glBeginConditionalRender pglBeginConditionalRender +#define glEndConditionalRender pglEndConditionalRender +#define glVertexAttribI1i pglVertexAttribI1i +#define glVertexAttribI2i pglVertexAttribI2i +#define glVertexAttribI3i pglVertexAttribI3i +#define glVertexAttribI4i pglVertexAttribI4i +#define glVertexAttribI1ui pglVertexAttribI1ui +#define glVertexAttribI2ui pglVertexAttribI2ui +#define glVertexAttribI3ui pglVertexAttribI3ui +#define glVertexAttribI4ui pglVertexAttribI4ui +#define glVertexAttribI1iv pglVertexAttribI1iv +#define glVertexAttribI2iv pglVertexAttribI2iv +#define glVertexAttribI3iv pglVertexAttribI3iv +#define glVertexAttribI4iv pglVertexAttribI4iv +#define glVertexAttribI1uiv pglVertexAttribI1uiv +#define glVertexAttribI2uiv pglVertexAttribI2uiv +#define glVertexAttribI3uiv pglVertexAttribI3uiv +#define glVertexAttribI4uiv pglVertexAttribI4uiv +#define glVertexAttribI4bv pglVertexAttribI4bv +#define glVertexAttribI4sv pglVertexAttribI4sv +#define glVertexAttribI4ubv pglVertexAttribI4ubv +#define glVertexAttribI4usv pglVertexAttribI4usv +#define glVertexAttribIPointer pglVertexAttribIPointer +#define glGetVertexAttribIiv pglGetVertexAttribIiv +#define glGetVertexAttribIuiv pglGetVertexAttribIuiv +#define glGetUniformuiv pglGetUniformuiv +#define glBindFragDataLocation pglBindFragDataLocation +#define glGetFragDataLocation pglGetFragDataLocation +#define glUniform1ui pglUniform1ui +#define glUniform2ui pglUniform2ui +#define glUniform3ui pglUniform3ui +#define glUniform4ui pglUniform4ui +#define glUniform1uiv pglUniform1uiv +#define glUniform2uiv pglUniform2uiv +#define glUniform3uiv pglUniform3uiv +#define glUniform4uiv pglUniform4uiv +#define glTexParameterIiv pglTexParameterIiv +#define glTexParameterIuiv pglTexParameterIuiv +#define glGetTexParameterIiv pglGetTexParameterIiv +#define glGetTexParameterIuiv pglGetTexParameterIuiv +#define glClearBufferiv pglClearBufferiv +#define glClearBufferuiv pglClearBufferuiv +#define glClearBufferfv pglClearBufferfv +#define glClearBufferfi pglClearBufferfi +#define glGetStringi pglGetStringi +#endif + +/* GL_ARB_multitexture */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#define __GLEE_GL_ARB_multitexture 1 +/* Constants */ +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort * v); +GLEE_EXTERN PFNGLACTIVETEXTUREARBPROC pglActiveTextureARB; +GLEE_EXTERN PFNGLCLIENTACTIVETEXTUREARBPROC pglClientActiveTextureARB; +GLEE_EXTERN PFNGLMULTITEXCOORD1DARBPROC pglMultiTexCoord1dARB; +GLEE_EXTERN PFNGLMULTITEXCOORD1DVARBPROC pglMultiTexCoord1dvARB; +GLEE_EXTERN PFNGLMULTITEXCOORD1FARBPROC pglMultiTexCoord1fARB; +GLEE_EXTERN PFNGLMULTITEXCOORD1FVARBPROC pglMultiTexCoord1fvARB; +GLEE_EXTERN PFNGLMULTITEXCOORD1IARBPROC pglMultiTexCoord1iARB; +GLEE_EXTERN PFNGLMULTITEXCOORD1IVARBPROC pglMultiTexCoord1ivARB; +GLEE_EXTERN PFNGLMULTITEXCOORD1SARBPROC pglMultiTexCoord1sARB; +GLEE_EXTERN PFNGLMULTITEXCOORD1SVARBPROC pglMultiTexCoord1svARB; +GLEE_EXTERN PFNGLMULTITEXCOORD2DARBPROC pglMultiTexCoord2dARB; +GLEE_EXTERN PFNGLMULTITEXCOORD2DVARBPROC pglMultiTexCoord2dvARB; +GLEE_EXTERN PFNGLMULTITEXCOORD2FARBPROC pglMultiTexCoord2fARB; +GLEE_EXTERN PFNGLMULTITEXCOORD2FVARBPROC pglMultiTexCoord2fvARB; +GLEE_EXTERN PFNGLMULTITEXCOORD2IARBPROC pglMultiTexCoord2iARB; +GLEE_EXTERN PFNGLMULTITEXCOORD2IVARBPROC pglMultiTexCoord2ivARB; +GLEE_EXTERN PFNGLMULTITEXCOORD2SARBPROC pglMultiTexCoord2sARB; +GLEE_EXTERN PFNGLMULTITEXCOORD2SVARBPROC pglMultiTexCoord2svARB; +GLEE_EXTERN PFNGLMULTITEXCOORD3DARBPROC pglMultiTexCoord3dARB; +GLEE_EXTERN PFNGLMULTITEXCOORD3DVARBPROC pglMultiTexCoord3dvARB; +GLEE_EXTERN PFNGLMULTITEXCOORD3FARBPROC pglMultiTexCoord3fARB; +GLEE_EXTERN PFNGLMULTITEXCOORD3FVARBPROC pglMultiTexCoord3fvARB; +GLEE_EXTERN PFNGLMULTITEXCOORD3IARBPROC pglMultiTexCoord3iARB; +GLEE_EXTERN PFNGLMULTITEXCOORD3IVARBPROC pglMultiTexCoord3ivARB; +GLEE_EXTERN PFNGLMULTITEXCOORD3SARBPROC pglMultiTexCoord3sARB; +GLEE_EXTERN PFNGLMULTITEXCOORD3SVARBPROC pglMultiTexCoord3svARB; +GLEE_EXTERN PFNGLMULTITEXCOORD4DARBPROC pglMultiTexCoord4dARB; +GLEE_EXTERN PFNGLMULTITEXCOORD4DVARBPROC pglMultiTexCoord4dvARB; +GLEE_EXTERN PFNGLMULTITEXCOORD4FARBPROC pglMultiTexCoord4fARB; +GLEE_EXTERN PFNGLMULTITEXCOORD4FVARBPROC pglMultiTexCoord4fvARB; +GLEE_EXTERN PFNGLMULTITEXCOORD4IARBPROC pglMultiTexCoord4iARB; +GLEE_EXTERN PFNGLMULTITEXCOORD4IVARBPROC pglMultiTexCoord4ivARB; +GLEE_EXTERN PFNGLMULTITEXCOORD4SARBPROC pglMultiTexCoord4sARB; +GLEE_EXTERN PFNGLMULTITEXCOORD4SVARBPROC pglMultiTexCoord4svARB; +#define glActiveTextureARB pglActiveTextureARB +#define glClientActiveTextureARB pglClientActiveTextureARB +#define glMultiTexCoord1dARB pglMultiTexCoord1dARB +#define glMultiTexCoord1dvARB pglMultiTexCoord1dvARB +#define glMultiTexCoord1fARB pglMultiTexCoord1fARB +#define glMultiTexCoord1fvARB pglMultiTexCoord1fvARB +#define glMultiTexCoord1iARB pglMultiTexCoord1iARB +#define glMultiTexCoord1ivARB pglMultiTexCoord1ivARB +#define glMultiTexCoord1sARB pglMultiTexCoord1sARB +#define glMultiTexCoord1svARB pglMultiTexCoord1svARB +#define glMultiTexCoord2dARB pglMultiTexCoord2dARB +#define glMultiTexCoord2dvARB pglMultiTexCoord2dvARB +#define glMultiTexCoord2fARB pglMultiTexCoord2fARB +#define glMultiTexCoord2fvARB pglMultiTexCoord2fvARB +#define glMultiTexCoord2iARB pglMultiTexCoord2iARB +#define glMultiTexCoord2ivARB pglMultiTexCoord2ivARB +#define glMultiTexCoord2sARB pglMultiTexCoord2sARB +#define glMultiTexCoord2svARB pglMultiTexCoord2svARB +#define glMultiTexCoord3dARB pglMultiTexCoord3dARB +#define glMultiTexCoord3dvARB pglMultiTexCoord3dvARB +#define glMultiTexCoord3fARB pglMultiTexCoord3fARB +#define glMultiTexCoord3fvARB pglMultiTexCoord3fvARB +#define glMultiTexCoord3iARB pglMultiTexCoord3iARB +#define glMultiTexCoord3ivARB pglMultiTexCoord3ivARB +#define glMultiTexCoord3sARB pglMultiTexCoord3sARB +#define glMultiTexCoord3svARB pglMultiTexCoord3svARB +#define glMultiTexCoord4dARB pglMultiTexCoord4dARB +#define glMultiTexCoord4dvARB pglMultiTexCoord4dvARB +#define glMultiTexCoord4fARB pglMultiTexCoord4fARB +#define glMultiTexCoord4fvARB pglMultiTexCoord4fvARB +#define glMultiTexCoord4iARB pglMultiTexCoord4iARB +#define glMultiTexCoord4ivARB pglMultiTexCoord4ivARB +#define glMultiTexCoord4sARB pglMultiTexCoord4sARB +#define glMultiTexCoord4svARB pglMultiTexCoord4svARB +#endif + +/* GL_ARB_transpose_matrix */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#define __GLEE_GL_ARB_transpose_matrix 1 +/* Constants */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat * m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble * m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat * m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble * m); +GLEE_EXTERN PFNGLLOADTRANSPOSEMATRIXFARBPROC pglLoadTransposeMatrixfARB; +GLEE_EXTERN PFNGLLOADTRANSPOSEMATRIXDARBPROC pglLoadTransposeMatrixdARB; +GLEE_EXTERN PFNGLMULTTRANSPOSEMATRIXFARBPROC pglMultTransposeMatrixfARB; +GLEE_EXTERN PFNGLMULTTRANSPOSEMATRIXDARBPROC pglMultTransposeMatrixdARB; +#define glLoadTransposeMatrixfARB pglLoadTransposeMatrixfARB +#define glLoadTransposeMatrixdARB pglLoadTransposeMatrixdARB +#define glMultTransposeMatrixfARB pglMultTransposeMatrixfARB +#define glMultTransposeMatrixdARB pglMultTransposeMatrixdARB +#endif + +/* GL_ARB_multisample */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#define __GLEE_GL_ARB_multisample 1 +/* Constants */ +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +GLEE_EXTERN PFNGLSAMPLECOVERAGEARBPROC pglSampleCoverageARB; +#define glSampleCoverageARB pglSampleCoverageARB +#endif + +/* GL_ARB_texture_env_add */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#define __GLEE_GL_ARB_texture_env_add 1 +/* Constants */ +#endif + +/* GL_ARB_texture_cube_map */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#define __GLEE_GL_ARB_texture_cube_map 1 +/* Constants */ +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +/* GL_ARB_texture_compression */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#define __GLEE_GL_ARB_texture_compression 1 +/* Constants */ +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid * img); +GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE3DARBPROC pglCompressedTexImage3DARB; +GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE2DARBPROC pglCompressedTexImage2DARB; +GLEE_EXTERN PFNGLCOMPRESSEDTEXIMAGE1DARBPROC pglCompressedTexImage1DARB; +GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC pglCompressedTexSubImage3DARB; +GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC pglCompressedTexSubImage2DARB; +GLEE_EXTERN PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC pglCompressedTexSubImage1DARB; +GLEE_EXTERN PFNGLGETCOMPRESSEDTEXIMAGEARBPROC pglGetCompressedTexImageARB; +#define glCompressedTexImage3DARB pglCompressedTexImage3DARB +#define glCompressedTexImage2DARB pglCompressedTexImage2DARB +#define glCompressedTexImage1DARB pglCompressedTexImage1DARB +#define glCompressedTexSubImage3DARB pglCompressedTexSubImage3DARB +#define glCompressedTexSubImage2DARB pglCompressedTexSubImage2DARB +#define glCompressedTexSubImage1DARB pglCompressedTexSubImage1DARB +#define glGetCompressedTexImageARB pglGetCompressedTexImageARB +#endif + +/* GL_ARB_texture_border_clamp */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#define __GLEE_GL_ARB_texture_border_clamp 1 +/* Constants */ +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +/* GL_ARB_point_parameters */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#define __GLEE_GL_ARB_point_parameters 1 +/* Constants */ +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat * params); +GLEE_EXTERN PFNGLPOINTPARAMETERFARBPROC pglPointParameterfARB; +GLEE_EXTERN PFNGLPOINTPARAMETERFVARBPROC pglPointParameterfvARB; +#define glPointParameterfARB pglPointParameterfARB +#define glPointParameterfvARB pglPointParameterfvARB +#endif + +/* GL_ARB_vertex_blend */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#define __GLEE_GL_ARB_vertex_blend 1 +/* Constants */ +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte * weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort * weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint * weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat * weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble * weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte * weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort * weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint * weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +GLEE_EXTERN PFNGLWEIGHTBVARBPROC pglWeightbvARB; +GLEE_EXTERN PFNGLWEIGHTSVARBPROC pglWeightsvARB; +GLEE_EXTERN PFNGLWEIGHTIVARBPROC pglWeightivARB; +GLEE_EXTERN PFNGLWEIGHTFVARBPROC pglWeightfvARB; +GLEE_EXTERN PFNGLWEIGHTDVARBPROC pglWeightdvARB; +GLEE_EXTERN PFNGLWEIGHTUBVARBPROC pglWeightubvARB; +GLEE_EXTERN PFNGLWEIGHTUSVARBPROC pglWeightusvARB; +GLEE_EXTERN PFNGLWEIGHTUIVARBPROC pglWeightuivARB; +GLEE_EXTERN PFNGLWEIGHTPOINTERARBPROC pglWeightPointerARB; +GLEE_EXTERN PFNGLVERTEXBLENDARBPROC pglVertexBlendARB; +#define glWeightbvARB pglWeightbvARB +#define glWeightsvARB pglWeightsvARB +#define glWeightivARB pglWeightivARB +#define glWeightfvARB pglWeightfvARB +#define glWeightdvARB pglWeightdvARB +#define glWeightubvARB pglWeightubvARB +#define glWeightusvARB pglWeightusvARB +#define glWeightuivARB pglWeightuivARB +#define glWeightPointerARB pglWeightPointerARB +#define glVertexBlendARB pglVertexBlendARB +#endif + +/* GL_ARB_matrix_palette */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#define __GLEE_GL_ARB_matrix_palette 1 +/* Constants */ +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte * indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort * indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint * indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +GLEE_EXTERN PFNGLCURRENTPALETTEMATRIXARBPROC pglCurrentPaletteMatrixARB; +GLEE_EXTERN PFNGLMATRIXINDEXUBVARBPROC pglMatrixIndexubvARB; +GLEE_EXTERN PFNGLMATRIXINDEXUSVARBPROC pglMatrixIndexusvARB; +GLEE_EXTERN PFNGLMATRIXINDEXUIVARBPROC pglMatrixIndexuivARB; +GLEE_EXTERN PFNGLMATRIXINDEXPOINTERARBPROC pglMatrixIndexPointerARB; +#define glCurrentPaletteMatrixARB pglCurrentPaletteMatrixARB +#define glMatrixIndexubvARB pglMatrixIndexubvARB +#define glMatrixIndexusvARB pglMatrixIndexusvARB +#define glMatrixIndexuivARB pglMatrixIndexuivARB +#define glMatrixIndexPointerARB pglMatrixIndexPointerARB +#endif + +/* GL_ARB_texture_env_combine */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#define __GLEE_GL_ARB_texture_env_combine 1 +/* Constants */ +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +/* GL_ARB_texture_env_crossbar */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#define __GLEE_GL_ARB_texture_env_crossbar 1 +/* Constants */ +#endif + +/* GL_ARB_texture_env_dot3 */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#define __GLEE_GL_ARB_texture_env_dot3 1 +/* Constants */ +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +/* GL_ARB_texture_mirrored_repeat */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#define __GLEE_GL_ARB_texture_mirrored_repeat 1 +/* Constants */ +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +/* GL_ARB_depth_texture */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#define __GLEE_GL_ARB_depth_texture 1 +/* Constants */ +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +/* GL_ARB_shadow */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#define __GLEE_GL_ARB_shadow 1 +/* Constants */ +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +/* GL_ARB_shadow_ambient */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#define __GLEE_GL_ARB_shadow_ambient 1 +/* Constants */ +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +/* GL_ARB_window_pos */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#define __GLEE_GL_ARB_window_pos 1 +/* Constants */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort * v); +GLEE_EXTERN PFNGLWINDOWPOS2DARBPROC pglWindowPos2dARB; +GLEE_EXTERN PFNGLWINDOWPOS2DVARBPROC pglWindowPos2dvARB; +GLEE_EXTERN PFNGLWINDOWPOS2FARBPROC pglWindowPos2fARB; +GLEE_EXTERN PFNGLWINDOWPOS2FVARBPROC pglWindowPos2fvARB; +GLEE_EXTERN PFNGLWINDOWPOS2IARBPROC pglWindowPos2iARB; +GLEE_EXTERN PFNGLWINDOWPOS2IVARBPROC pglWindowPos2ivARB; +GLEE_EXTERN PFNGLWINDOWPOS2SARBPROC pglWindowPos2sARB; +GLEE_EXTERN PFNGLWINDOWPOS2SVARBPROC pglWindowPos2svARB; +GLEE_EXTERN PFNGLWINDOWPOS3DARBPROC pglWindowPos3dARB; +GLEE_EXTERN PFNGLWINDOWPOS3DVARBPROC pglWindowPos3dvARB; +GLEE_EXTERN PFNGLWINDOWPOS3FARBPROC pglWindowPos3fARB; +GLEE_EXTERN PFNGLWINDOWPOS3FVARBPROC pglWindowPos3fvARB; +GLEE_EXTERN PFNGLWINDOWPOS3IARBPROC pglWindowPos3iARB; +GLEE_EXTERN PFNGLWINDOWPOS3IVARBPROC pglWindowPos3ivARB; +GLEE_EXTERN PFNGLWINDOWPOS3SARBPROC pglWindowPos3sARB; +GLEE_EXTERN PFNGLWINDOWPOS3SVARBPROC pglWindowPos3svARB; +#define glWindowPos2dARB pglWindowPos2dARB +#define glWindowPos2dvARB pglWindowPos2dvARB +#define glWindowPos2fARB pglWindowPos2fARB +#define glWindowPos2fvARB pglWindowPos2fvARB +#define glWindowPos2iARB pglWindowPos2iARB +#define glWindowPos2ivARB pglWindowPos2ivARB +#define glWindowPos2sARB pglWindowPos2sARB +#define glWindowPos2svARB pglWindowPos2svARB +#define glWindowPos3dARB pglWindowPos3dARB +#define glWindowPos3dvARB pglWindowPos3dvARB +#define glWindowPos3fARB pglWindowPos3fARB +#define glWindowPos3fvARB pglWindowPos3fvARB +#define glWindowPos3iARB pglWindowPos3iARB +#define glWindowPos3ivARB pglWindowPos3ivARB +#define glWindowPos3sARB pglWindowPos3sARB +#define glWindowPos3svARB pglWindowPos3svARB +#endif + +/* GL_ARB_vertex_program */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#define __GLEE_GL_ARB_vertex_program 1 +/* Constants */ +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid * string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint * programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint * programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble * params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat * params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble * params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat * params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble * params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat * params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble * params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat * params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid * string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* * pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +GLEE_EXTERN PFNGLVERTEXATTRIB1DARBPROC pglVertexAttrib1dARB; +GLEE_EXTERN PFNGLVERTEXATTRIB1DVARBPROC pglVertexAttrib1dvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB1FARBPROC pglVertexAttrib1fARB; +GLEE_EXTERN PFNGLVERTEXATTRIB1FVARBPROC pglVertexAttrib1fvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB1SARBPROC pglVertexAttrib1sARB; +GLEE_EXTERN PFNGLVERTEXATTRIB1SVARBPROC pglVertexAttrib1svARB; +GLEE_EXTERN PFNGLVERTEXATTRIB2DARBPROC pglVertexAttrib2dARB; +GLEE_EXTERN PFNGLVERTEXATTRIB2DVARBPROC pglVertexAttrib2dvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB2FARBPROC pglVertexAttrib2fARB; +GLEE_EXTERN PFNGLVERTEXATTRIB2FVARBPROC pglVertexAttrib2fvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB2SARBPROC pglVertexAttrib2sARB; +GLEE_EXTERN PFNGLVERTEXATTRIB2SVARBPROC pglVertexAttrib2svARB; +GLEE_EXTERN PFNGLVERTEXATTRIB3DARBPROC pglVertexAttrib3dARB; +GLEE_EXTERN PFNGLVERTEXATTRIB3DVARBPROC pglVertexAttrib3dvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB3FARBPROC pglVertexAttrib3fARB; +GLEE_EXTERN PFNGLVERTEXATTRIB3FVARBPROC pglVertexAttrib3fvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB3SARBPROC pglVertexAttrib3sARB; +GLEE_EXTERN PFNGLVERTEXATTRIB3SVARBPROC pglVertexAttrib3svARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4NBVARBPROC pglVertexAttrib4NbvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4NIVARBPROC pglVertexAttrib4NivARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4NSVARBPROC pglVertexAttrib4NsvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4NUBARBPROC pglVertexAttrib4NubARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4NUBVARBPROC pglVertexAttrib4NubvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4NUIVARBPROC pglVertexAttrib4NuivARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4NUSVARBPROC pglVertexAttrib4NusvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4BVARBPROC pglVertexAttrib4bvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4DARBPROC pglVertexAttrib4dARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4DVARBPROC pglVertexAttrib4dvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4FARBPROC pglVertexAttrib4fARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4FVARBPROC pglVertexAttrib4fvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4IVARBPROC pglVertexAttrib4ivARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4SARBPROC pglVertexAttrib4sARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4SVARBPROC pglVertexAttrib4svARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4UBVARBPROC pglVertexAttrib4ubvARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4UIVARBPROC pglVertexAttrib4uivARB; +GLEE_EXTERN PFNGLVERTEXATTRIB4USVARBPROC pglVertexAttrib4usvARB; +GLEE_EXTERN PFNGLVERTEXATTRIBPOINTERARBPROC pglVertexAttribPointerARB; +GLEE_EXTERN PFNGLENABLEVERTEXATTRIBARRAYARBPROC pglEnableVertexAttribArrayARB; +GLEE_EXTERN PFNGLDISABLEVERTEXATTRIBARRAYARBPROC pglDisableVertexAttribArrayARB; +GLEE_EXTERN PFNGLPROGRAMSTRINGARBPROC pglProgramStringARB; +GLEE_EXTERN PFNGLBINDPROGRAMARBPROC pglBindProgramARB; +GLEE_EXTERN PFNGLDELETEPROGRAMSARBPROC pglDeleteProgramsARB; +GLEE_EXTERN PFNGLGENPROGRAMSARBPROC pglGenProgramsARB; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETER4DARBPROC pglProgramEnvParameter4dARB; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETER4DVARBPROC pglProgramEnvParameter4dvARB; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETER4FARBPROC pglProgramEnvParameter4fARB; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETER4FVARBPROC pglProgramEnvParameter4fvARB; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETER4DARBPROC pglProgramLocalParameter4dARB; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETER4DVARBPROC pglProgramLocalParameter4dvARB; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETER4FARBPROC pglProgramLocalParameter4fARB; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETER4FVARBPROC pglProgramLocalParameter4fvARB; +GLEE_EXTERN PFNGLGETPROGRAMENVPARAMETERDVARBPROC pglGetProgramEnvParameterdvARB; +GLEE_EXTERN PFNGLGETPROGRAMENVPARAMETERFVARBPROC pglGetProgramEnvParameterfvARB; +GLEE_EXTERN PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC pglGetProgramLocalParameterdvARB; +GLEE_EXTERN PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC pglGetProgramLocalParameterfvARB; +GLEE_EXTERN PFNGLGETPROGRAMIVARBPROC pglGetProgramivARB; +GLEE_EXTERN PFNGLGETPROGRAMSTRINGARBPROC pglGetProgramStringARB; +GLEE_EXTERN PFNGLGETVERTEXATTRIBDVARBPROC pglGetVertexAttribdvARB; +GLEE_EXTERN PFNGLGETVERTEXATTRIBFVARBPROC pglGetVertexAttribfvARB; +GLEE_EXTERN PFNGLGETVERTEXATTRIBIVARBPROC pglGetVertexAttribivARB; +GLEE_EXTERN PFNGLGETVERTEXATTRIBPOINTERVARBPROC pglGetVertexAttribPointervARB; +GLEE_EXTERN PFNGLISPROGRAMARBPROC pglIsProgramARB; +#define glVertexAttrib1dARB pglVertexAttrib1dARB +#define glVertexAttrib1dvARB pglVertexAttrib1dvARB +#define glVertexAttrib1fARB pglVertexAttrib1fARB +#define glVertexAttrib1fvARB pglVertexAttrib1fvARB +#define glVertexAttrib1sARB pglVertexAttrib1sARB +#define glVertexAttrib1svARB pglVertexAttrib1svARB +#define glVertexAttrib2dARB pglVertexAttrib2dARB +#define glVertexAttrib2dvARB pglVertexAttrib2dvARB +#define glVertexAttrib2fARB pglVertexAttrib2fARB +#define glVertexAttrib2fvARB pglVertexAttrib2fvARB +#define glVertexAttrib2sARB pglVertexAttrib2sARB +#define glVertexAttrib2svARB pglVertexAttrib2svARB +#define glVertexAttrib3dARB pglVertexAttrib3dARB +#define glVertexAttrib3dvARB pglVertexAttrib3dvARB +#define glVertexAttrib3fARB pglVertexAttrib3fARB +#define glVertexAttrib3fvARB pglVertexAttrib3fvARB +#define glVertexAttrib3sARB pglVertexAttrib3sARB +#define glVertexAttrib3svARB pglVertexAttrib3svARB +#define glVertexAttrib4NbvARB pglVertexAttrib4NbvARB +#define glVertexAttrib4NivARB pglVertexAttrib4NivARB +#define glVertexAttrib4NsvARB pglVertexAttrib4NsvARB +#define glVertexAttrib4NubARB pglVertexAttrib4NubARB +#define glVertexAttrib4NubvARB pglVertexAttrib4NubvARB +#define glVertexAttrib4NuivARB pglVertexAttrib4NuivARB +#define glVertexAttrib4NusvARB pglVertexAttrib4NusvARB +#define glVertexAttrib4bvARB pglVertexAttrib4bvARB +#define glVertexAttrib4dARB pglVertexAttrib4dARB +#define glVertexAttrib4dvARB pglVertexAttrib4dvARB +#define glVertexAttrib4fARB pglVertexAttrib4fARB +#define glVertexAttrib4fvARB pglVertexAttrib4fvARB +#define glVertexAttrib4ivARB pglVertexAttrib4ivARB +#define glVertexAttrib4sARB pglVertexAttrib4sARB +#define glVertexAttrib4svARB pglVertexAttrib4svARB +#define glVertexAttrib4ubvARB pglVertexAttrib4ubvARB +#define glVertexAttrib4uivARB pglVertexAttrib4uivARB +#define glVertexAttrib4usvARB pglVertexAttrib4usvARB +#define glVertexAttribPointerARB pglVertexAttribPointerARB +#define glEnableVertexAttribArrayARB pglEnableVertexAttribArrayARB +#define glDisableVertexAttribArrayARB pglDisableVertexAttribArrayARB +#define glProgramStringARB pglProgramStringARB +#define glBindProgramARB pglBindProgramARB +#define glDeleteProgramsARB pglDeleteProgramsARB +#define glGenProgramsARB pglGenProgramsARB +#define glProgramEnvParameter4dARB pglProgramEnvParameter4dARB +#define glProgramEnvParameter4dvARB pglProgramEnvParameter4dvARB +#define glProgramEnvParameter4fARB pglProgramEnvParameter4fARB +#define glProgramEnvParameter4fvARB pglProgramEnvParameter4fvARB +#define glProgramLocalParameter4dARB pglProgramLocalParameter4dARB +#define glProgramLocalParameter4dvARB pglProgramLocalParameter4dvARB +#define glProgramLocalParameter4fARB pglProgramLocalParameter4fARB +#define glProgramLocalParameter4fvARB pglProgramLocalParameter4fvARB +#define glGetProgramEnvParameterdvARB pglGetProgramEnvParameterdvARB +#define glGetProgramEnvParameterfvARB pglGetProgramEnvParameterfvARB +#define glGetProgramLocalParameterdvARB pglGetProgramLocalParameterdvARB +#define glGetProgramLocalParameterfvARB pglGetProgramLocalParameterfvARB +#define glGetProgramivARB pglGetProgramivARB +#define glGetProgramStringARB pglGetProgramStringARB +#define glGetVertexAttribdvARB pglGetVertexAttribdvARB +#define glGetVertexAttribfvARB pglGetVertexAttribfvARB +#define glGetVertexAttribivARB pglGetVertexAttribivARB +#define glGetVertexAttribPointervARB pglGetVertexAttribPointervARB +#define glIsProgramARB pglIsProgramARB +#endif + +/* GL_ARB_fragment_program */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +#define __GLEE_GL_ARB_fragment_program 1 +/* Constants */ +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +/* GL_ARB_vertex_buffer_object */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#define __GLEE_GL_ARB_vertex_buffer_object 1 +/* Constants */ +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint * buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint * buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* * params); +GLEE_EXTERN PFNGLBINDBUFFERARBPROC pglBindBufferARB; +GLEE_EXTERN PFNGLDELETEBUFFERSARBPROC pglDeleteBuffersARB; +GLEE_EXTERN PFNGLGENBUFFERSARBPROC pglGenBuffersARB; +GLEE_EXTERN PFNGLISBUFFERARBPROC pglIsBufferARB; +GLEE_EXTERN PFNGLBUFFERDATAARBPROC pglBufferDataARB; +GLEE_EXTERN PFNGLBUFFERSUBDATAARBPROC pglBufferSubDataARB; +GLEE_EXTERN PFNGLGETBUFFERSUBDATAARBPROC pglGetBufferSubDataARB; +GLEE_EXTERN PFNGLMAPBUFFERARBPROC pglMapBufferARB; +GLEE_EXTERN PFNGLUNMAPBUFFERARBPROC pglUnmapBufferARB; +GLEE_EXTERN PFNGLGETBUFFERPARAMETERIVARBPROC pglGetBufferParameterivARB; +GLEE_EXTERN PFNGLGETBUFFERPOINTERVARBPROC pglGetBufferPointervARB; +#define glBindBufferARB pglBindBufferARB +#define glDeleteBuffersARB pglDeleteBuffersARB +#define glGenBuffersARB pglGenBuffersARB +#define glIsBufferARB pglIsBufferARB +#define glBufferDataARB pglBufferDataARB +#define glBufferSubDataARB pglBufferSubDataARB +#define glGetBufferSubDataARB pglGetBufferSubDataARB +#define glMapBufferARB pglMapBufferARB +#define glUnmapBufferARB pglUnmapBufferARB +#define glGetBufferParameterivARB pglGetBufferParameterivARB +#define glGetBufferPointervARB pglGetBufferPointervARB +#endif + +/* GL_ARB_occlusion_query */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#define __GLEE_GL_ARB_occlusion_query 1 +/* Constants */ +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint * ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint * ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint * params); +GLEE_EXTERN PFNGLGENQUERIESARBPROC pglGenQueriesARB; +GLEE_EXTERN PFNGLDELETEQUERIESARBPROC pglDeleteQueriesARB; +GLEE_EXTERN PFNGLISQUERYARBPROC pglIsQueryARB; +GLEE_EXTERN PFNGLBEGINQUERYARBPROC pglBeginQueryARB; +GLEE_EXTERN PFNGLENDQUERYARBPROC pglEndQueryARB; +GLEE_EXTERN PFNGLGETQUERYIVARBPROC pglGetQueryivARB; +GLEE_EXTERN PFNGLGETQUERYOBJECTIVARBPROC pglGetQueryObjectivARB; +GLEE_EXTERN PFNGLGETQUERYOBJECTUIVARBPROC pglGetQueryObjectuivARB; +#define glGenQueriesARB pglGenQueriesARB +#define glDeleteQueriesARB pglDeleteQueriesARB +#define glIsQueryARB pglIsQueryARB +#define glBeginQueryARB pglBeginQueryARB +#define glEndQueryARB pglEndQueryARB +#define glGetQueryivARB pglGetQueryivARB +#define glGetQueryObjectivARB pglGetQueryObjectivARB +#define glGetQueryObjectuivARB pglGetQueryObjectuivARB +#endif + +/* GL_ARB_shader_objects */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#define __GLEE_GL_ARB_shader_objects 1 +/* Constants */ +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* * string, const GLint * length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB * name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat * params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint * params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); +GLEE_EXTERN PFNGLDELETEOBJECTARBPROC pglDeleteObjectARB; +GLEE_EXTERN PFNGLGETHANDLEARBPROC pglGetHandleARB; +GLEE_EXTERN PFNGLDETACHOBJECTARBPROC pglDetachObjectARB; +GLEE_EXTERN PFNGLCREATESHADEROBJECTARBPROC pglCreateShaderObjectARB; +GLEE_EXTERN PFNGLSHADERSOURCEARBPROC pglShaderSourceARB; +GLEE_EXTERN PFNGLCOMPILESHADERARBPROC pglCompileShaderARB; +GLEE_EXTERN PFNGLCREATEPROGRAMOBJECTARBPROC pglCreateProgramObjectARB; +GLEE_EXTERN PFNGLATTACHOBJECTARBPROC pglAttachObjectARB; +GLEE_EXTERN PFNGLLINKPROGRAMARBPROC pglLinkProgramARB; +GLEE_EXTERN PFNGLUSEPROGRAMOBJECTARBPROC pglUseProgramObjectARB; +GLEE_EXTERN PFNGLVALIDATEPROGRAMARBPROC pglValidateProgramARB; +GLEE_EXTERN PFNGLUNIFORM1FARBPROC pglUniform1fARB; +GLEE_EXTERN PFNGLUNIFORM2FARBPROC pglUniform2fARB; +GLEE_EXTERN PFNGLUNIFORM3FARBPROC pglUniform3fARB; +GLEE_EXTERN PFNGLUNIFORM4FARBPROC pglUniform4fARB; +GLEE_EXTERN PFNGLUNIFORM1IARBPROC pglUniform1iARB; +GLEE_EXTERN PFNGLUNIFORM2IARBPROC pglUniform2iARB; +GLEE_EXTERN PFNGLUNIFORM3IARBPROC pglUniform3iARB; +GLEE_EXTERN PFNGLUNIFORM4IARBPROC pglUniform4iARB; +GLEE_EXTERN PFNGLUNIFORM1FVARBPROC pglUniform1fvARB; +GLEE_EXTERN PFNGLUNIFORM2FVARBPROC pglUniform2fvARB; +GLEE_EXTERN PFNGLUNIFORM3FVARBPROC pglUniform3fvARB; +GLEE_EXTERN PFNGLUNIFORM4FVARBPROC pglUniform4fvARB; +GLEE_EXTERN PFNGLUNIFORM1IVARBPROC pglUniform1ivARB; +GLEE_EXTERN PFNGLUNIFORM2IVARBPROC pglUniform2ivARB; +GLEE_EXTERN PFNGLUNIFORM3IVARBPROC pglUniform3ivARB; +GLEE_EXTERN PFNGLUNIFORM4IVARBPROC pglUniform4ivARB; +GLEE_EXTERN PFNGLUNIFORMMATRIX2FVARBPROC pglUniformMatrix2fvARB; +GLEE_EXTERN PFNGLUNIFORMMATRIX3FVARBPROC pglUniformMatrix3fvARB; +GLEE_EXTERN PFNGLUNIFORMMATRIX4FVARBPROC pglUniformMatrix4fvARB; +GLEE_EXTERN PFNGLGETOBJECTPARAMETERFVARBPROC pglGetObjectParameterfvARB; +GLEE_EXTERN PFNGLGETOBJECTPARAMETERIVARBPROC pglGetObjectParameterivARB; +GLEE_EXTERN PFNGLGETINFOLOGARBPROC pglGetInfoLogARB; +GLEE_EXTERN PFNGLGETATTACHEDOBJECTSARBPROC pglGetAttachedObjectsARB; +GLEE_EXTERN PFNGLGETUNIFORMLOCATIONARBPROC pglGetUniformLocationARB; +GLEE_EXTERN PFNGLGETACTIVEUNIFORMARBPROC pglGetActiveUniformARB; +GLEE_EXTERN PFNGLGETUNIFORMFVARBPROC pglGetUniformfvARB; +GLEE_EXTERN PFNGLGETUNIFORMIVARBPROC pglGetUniformivARB; +GLEE_EXTERN PFNGLGETSHADERSOURCEARBPROC pglGetShaderSourceARB; +#define glDeleteObjectARB pglDeleteObjectARB +#define glGetHandleARB pglGetHandleARB +#define glDetachObjectARB pglDetachObjectARB +#define glCreateShaderObjectARB pglCreateShaderObjectARB +#define glShaderSourceARB pglShaderSourceARB +#define glCompileShaderARB pglCompileShaderARB +#define glCreateProgramObjectARB pglCreateProgramObjectARB +#define glAttachObjectARB pglAttachObjectARB +#define glLinkProgramARB pglLinkProgramARB +#define glUseProgramObjectARB pglUseProgramObjectARB +#define glValidateProgramARB pglValidateProgramARB +#define glUniform1fARB pglUniform1fARB +#define glUniform2fARB pglUniform2fARB +#define glUniform3fARB pglUniform3fARB +#define glUniform4fARB pglUniform4fARB +#define glUniform1iARB pglUniform1iARB +#define glUniform2iARB pglUniform2iARB +#define glUniform3iARB pglUniform3iARB +#define glUniform4iARB pglUniform4iARB +#define glUniform1fvARB pglUniform1fvARB +#define glUniform2fvARB pglUniform2fvARB +#define glUniform3fvARB pglUniform3fvARB +#define glUniform4fvARB pglUniform4fvARB +#define glUniform1ivARB pglUniform1ivARB +#define glUniform2ivARB pglUniform2ivARB +#define glUniform3ivARB pglUniform3ivARB +#define glUniform4ivARB pglUniform4ivARB +#define glUniformMatrix2fvARB pglUniformMatrix2fvARB +#define glUniformMatrix3fvARB pglUniformMatrix3fvARB +#define glUniformMatrix4fvARB pglUniformMatrix4fvARB +#define glGetObjectParameterfvARB pglGetObjectParameterfvARB +#define glGetObjectParameterivARB pglGetObjectParameterivARB +#define glGetInfoLogARB pglGetInfoLogARB +#define glGetAttachedObjectsARB pglGetAttachedObjectsARB +#define glGetUniformLocationARB pglGetUniformLocationARB +#define glGetActiveUniformARB pglGetActiveUniformARB +#define glGetUniformfvARB pglGetUniformfvARB +#define glGetUniformivARB pglGetUniformivARB +#define glGetShaderSourceARB pglGetShaderSourceARB +#endif + +/* GL_ARB_vertex_shader */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#define __GLEE_GL_ARB_vertex_shader 1 +/* Constants */ +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB * name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB * name); +GLEE_EXTERN PFNGLBINDATTRIBLOCATIONARBPROC pglBindAttribLocationARB; +GLEE_EXTERN PFNGLGETACTIVEATTRIBARBPROC pglGetActiveAttribARB; +GLEE_EXTERN PFNGLGETATTRIBLOCATIONARBPROC pglGetAttribLocationARB; +#define glBindAttribLocationARB pglBindAttribLocationARB +#define glGetActiveAttribARB pglGetActiveAttribARB +#define glGetAttribLocationARB pglGetAttribLocationARB +#endif + +/* GL_ARB_fragment_shader */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#define __GLEE_GL_ARB_fragment_shader 1 +/* Constants */ +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +/* GL_ARB_shading_language_100 */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#define __GLEE_GL_ARB_shading_language_100 1 +/* Constants */ +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +/* GL_ARB_texture_non_power_of_two */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#define __GLEE_GL_ARB_texture_non_power_of_two 1 +/* Constants */ +#endif + +/* GL_ARB_point_sprite */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#define __GLEE_GL_ARB_point_sprite 1 +/* Constants */ +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +/* GL_ARB_fragment_program_shadow */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#define __GLEE_GL_ARB_fragment_program_shadow 1 +/* Constants */ +#endif + +/* GL_ARB_draw_buffers */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#define __GLEE_GL_ARB_draw_buffers 1 +/* Constants */ +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum * bufs); +GLEE_EXTERN PFNGLDRAWBUFFERSARBPROC pglDrawBuffersARB; +#define glDrawBuffersARB pglDrawBuffersARB +#endif + +/* GL_ARB_texture_rectangle */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#define __GLEE_GL_ARB_texture_rectangle 1 +/* Constants */ +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +/* GL_ARB_color_buffer_float */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#define __GLEE_GL_ARB_color_buffer_float 1 +/* Constants */ +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +GLEE_EXTERN PFNGLCLAMPCOLORARBPROC pglClampColorARB; +#define glClampColorARB pglClampColorARB +#endif + +/* GL_ARB_half_float_pixel */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#define __GLEE_GL_ARB_half_float_pixel 1 +/* Constants */ +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +/* GL_ARB_texture_float */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#define __GLEE_GL_ARB_texture_float 1 +/* Constants */ +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +/* GL_ARB_pixel_buffer_object */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#define __GLEE_GL_ARB_pixel_buffer_object 1 +/* Constants */ +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +/* GL_ARB_depth_buffer_float */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#define __GLEE_GL_ARB_depth_buffer_float 1 +/* Constants */ +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#endif + +/* GL_ARB_drawinstanced */ + +#ifndef GL_ARB_drawinstanced +#define GL_ARB_drawinstanced 1 +#define __GLEE_GL_ARB_drawinstanced 1 +/* Constants */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount); +GLEE_EXTERN PFNGLDRAWARRAYSINSTANCEDARBPROC pglDrawArraysInstancedARB; +GLEE_EXTERN PFNGLDRAWELEMENTSINSTANCEDARBPROC pglDrawElementsInstancedARB; +#define glDrawArraysInstancedARB pglDrawArraysInstancedARB +#define glDrawElementsInstancedARB pglDrawElementsInstancedARB +#endif + +/* GL_ARB_framebuffer_object */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#define __GLEE_GL_ARB_framebuffer_object 1 +/* Constants */ +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint * renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint * renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint * params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint * framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint * framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLEE_EXTERN PFNGLISRENDERBUFFERPROC pglIsRenderbuffer; +GLEE_EXTERN PFNGLBINDRENDERBUFFERPROC pglBindRenderbuffer; +GLEE_EXTERN PFNGLDELETERENDERBUFFERSPROC pglDeleteRenderbuffers; +GLEE_EXTERN PFNGLGENRENDERBUFFERSPROC pglGenRenderbuffers; +GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEPROC pglRenderbufferStorage; +GLEE_EXTERN PFNGLGETRENDERBUFFERPARAMETERIVPROC pglGetRenderbufferParameteriv; +GLEE_EXTERN PFNGLISFRAMEBUFFERPROC pglIsFramebuffer; +GLEE_EXTERN PFNGLBINDFRAMEBUFFERPROC pglBindFramebuffer; +GLEE_EXTERN PFNGLDELETEFRAMEBUFFERSPROC pglDeleteFramebuffers; +GLEE_EXTERN PFNGLGENFRAMEBUFFERSPROC pglGenFramebuffers; +GLEE_EXTERN PFNGLCHECKFRAMEBUFFERSTATUSPROC pglCheckFramebufferStatus; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE1DPROC pglFramebufferTexture1D; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE2DPROC pglFramebufferTexture2D; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE3DPROC pglFramebufferTexture3D; +GLEE_EXTERN PFNGLFRAMEBUFFERRENDERBUFFERPROC pglFramebufferRenderbuffer; +GLEE_EXTERN PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC pglGetFramebufferAttachmentParameteriv; +GLEE_EXTERN PFNGLGENERATEMIPMAPPROC pglGenerateMipmap; +GLEE_EXTERN PFNGLBLITFRAMEBUFFERPROC pglBlitFramebuffer; +GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC pglRenderbufferStorageMultisample; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURELAYERPROC pglFramebufferTextureLayer; +#define glIsRenderbuffer pglIsRenderbuffer +#define glBindRenderbuffer pglBindRenderbuffer +#define glDeleteRenderbuffers pglDeleteRenderbuffers +#define glGenRenderbuffers pglGenRenderbuffers +#define glRenderbufferStorage pglRenderbufferStorage +#define glGetRenderbufferParameteriv pglGetRenderbufferParameteriv +#define glIsFramebuffer pglIsFramebuffer +#define glBindFramebuffer pglBindFramebuffer +#define glDeleteFramebuffers pglDeleteFramebuffers +#define glGenFramebuffers pglGenFramebuffers +#define glCheckFramebufferStatus pglCheckFramebufferStatus +#define glFramebufferTexture1D pglFramebufferTexture1D +#define glFramebufferTexture2D pglFramebufferTexture2D +#define glFramebufferTexture3D pglFramebufferTexture3D +#define glFramebufferRenderbuffer pglFramebufferRenderbuffer +#define glGetFramebufferAttachmentParameteriv pglGetFramebufferAttachmentParameteriv +#define glGenerateMipmap pglGenerateMipmap +#define glBlitFramebuffer pglBlitFramebuffer +#define glRenderbufferStorageMultisample pglRenderbufferStorageMultisample +#define glFramebufferTextureLayer pglFramebufferTextureLayer +#endif + +/* GL_ARB_framebuffer_sRGB */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#define __GLEE_GL_ARB_framebuffer_sRGB 1 +/* Constants */ +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#endif + +/* GL_ARB_geometry_shader4 */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#define __GLEE_GL_ARB_geometry_shader4 1 +/* Constants */ +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLEE_EXTERN PFNGLPROGRAMPARAMETERIARBPROC pglProgramParameteriARB; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTUREARBPROC pglFramebufferTextureARB; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURELAYERARBPROC pglFramebufferTextureLayerARB; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTUREFACEARBPROC pglFramebufferTextureFaceARB; +#define glProgramParameteriARB pglProgramParameteriARB +#define glFramebufferTextureARB pglFramebufferTextureARB +#define glFramebufferTextureLayerARB pglFramebufferTextureLayerARB +#define glFramebufferTextureFaceARB pglFramebufferTextureFaceARB +#endif + +/* GL_ARB_half_float_vertex */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#define __GLEE_GL_ARB_half_float_vertex 1 +/* Constants */ +#define GL_HALF_FLOAT 0x140B +#endif + +/* GL_ARBinstanced_arrays */ + +#ifndef GL_ARBinstanced_arrays +#define GL_ARBinstanced_arrays 1 +#define __GLEE_GL_ARBinstanced_arrays 1 +/* Constants */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +GLEE_EXTERN PFNGLVERTEXATTRIBDIVISORPROC pglVertexAttribDivisor; +#define glVertexAttribDivisor pglVertexAttribDivisor +#endif + +/* GL_ARB_map_buffer_range */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#define __GLEE_GL_ARB_map_buffer_range 1 +/* Constants */ +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +typedef void (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +GLEE_EXTERN PFNGLMAPBUFFERRANGEPROC pglMapBufferRange; +GLEE_EXTERN PFNGLFLUSHMAPPEDBUFFERRANGEPROC pglFlushMappedBufferRange; +#define glMapBufferRange pglMapBufferRange +#define glFlushMappedBufferRange pglFlushMappedBufferRange +#endif + +/* GL_ARB_texture_buffer_object */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#define __GLEE_GL_ARB_texture_buffer_object 1 +/* Constants */ +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); +GLEE_EXTERN PFNGLTEXBUFFERARBPROC pglTexBufferARB; +#define glTexBufferARB pglTexBufferARB +#endif + +/* GL_ARB_texture_compression_rgtc */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#define __GLEE_GL_ARB_texture_compression_rgtc 1 +/* Constants */ +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#endif + +/* GL_ARB_texture_rg */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#define __GLEE_GL_ARB_texture_rg 1 +/* Constants */ +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#endif + +/* GL_ARB_vertex_array_object */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#define __GLEE_GL_ARB_vertex_array_object 1 +/* Constants */ +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint * arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint * arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +GLEE_EXTERN PFNGLBINDVERTEXARRAYPROC pglBindVertexArray; +GLEE_EXTERN PFNGLDELETEVERTEXARRAYSPROC pglDeleteVertexArrays; +GLEE_EXTERN PFNGLGENVERTEXARRAYSPROC pglGenVertexArrays; +GLEE_EXTERN PFNGLISVERTEXARRAYPROC pglIsVertexArray; +#define glBindVertexArray pglBindVertexArray +#define glDeleteVertexArrays pglDeleteVertexArrays +#define glGenVertexArrays pglGenVertexArrays +#define glIsVertexArray pglIsVertexArray +#endif + +/* GL_EXT_abgr */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#define __GLEE_GL_EXT_abgr 1 +/* Constants */ +#define GL_ABGR_EXT 0x8000 +#endif + +/* GL_EXT_blend_color */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#define __GLEE_GL_EXT_blend_color 1 +/* Constants */ +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLEE_EXTERN PFNGLBLENDCOLOREXTPROC pglBlendColorEXT; +#define glBlendColorEXT pglBlendColorEXT +#endif + +/* GL_EXT_polygon_offset */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#define __GLEE_GL_EXT_polygon_offset 1 +/* Constants */ +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +GLEE_EXTERN PFNGLPOLYGONOFFSETEXTPROC pglPolygonOffsetEXT; +#define glPolygonOffsetEXT pglPolygonOffsetEXT +#endif + +/* GL_EXT_texture */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#define __GLEE_GL_EXT_texture 1 +/* Constants */ +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +/* GL_EXT_texture3D */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#define __GLEE_GL_EXT_texture3D 1 +/* Constants */ +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); +GLEE_EXTERN PFNGLTEXIMAGE3DEXTPROC pglTexImage3DEXT; +GLEE_EXTERN PFNGLTEXSUBIMAGE3DEXTPROC pglTexSubImage3DEXT; +#define glTexImage3DEXT pglTexImage3DEXT +#define glTexSubImage3DEXT pglTexSubImage3DEXT +#endif + +/* GL_SGIS_texture_filter4 */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#define __GLEE_GL_SGIS_texture_filter4 1 +/* Constants */ +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat * weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat * weights); +GLEE_EXTERN PFNGLGETTEXFILTERFUNCSGISPROC pglGetTexFilterFuncSGIS; +GLEE_EXTERN PFNGLTEXFILTERFUNCSGISPROC pglTexFilterFuncSGIS; +#define glGetTexFilterFuncSGIS pglGetTexFilterFuncSGIS +#define glTexFilterFuncSGIS pglTexFilterFuncSGIS +#endif + +/* GL_EXT_subtexture */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#define __GLEE_GL_EXT_subtexture 1 +/* Constants */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); +GLEE_EXTERN PFNGLTEXSUBIMAGE1DEXTPROC pglTexSubImage1DEXT; +GLEE_EXTERN PFNGLTEXSUBIMAGE2DEXTPROC pglTexSubImage2DEXT; +#define glTexSubImage1DEXT pglTexSubImage1DEXT +#define glTexSubImage2DEXT pglTexSubImage2DEXT +#endif + +/* GL_EXT_copy_texture */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#define __GLEE_GL_EXT_copy_texture 1 +/* Constants */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLEE_EXTERN PFNGLCOPYTEXIMAGE1DEXTPROC pglCopyTexImage1DEXT; +GLEE_EXTERN PFNGLCOPYTEXIMAGE2DEXTPROC pglCopyTexImage2DEXT; +GLEE_EXTERN PFNGLCOPYTEXSUBIMAGE1DEXTPROC pglCopyTexSubImage1DEXT; +GLEE_EXTERN PFNGLCOPYTEXSUBIMAGE2DEXTPROC pglCopyTexSubImage2DEXT; +GLEE_EXTERN PFNGLCOPYTEXSUBIMAGE3DEXTPROC pglCopyTexSubImage3DEXT; +#define glCopyTexImage1DEXT pglCopyTexImage1DEXT +#define glCopyTexImage2DEXT pglCopyTexImage2DEXT +#define glCopyTexSubImage1DEXT pglCopyTexSubImage1DEXT +#define glCopyTexSubImage2DEXT pglCopyTexSubImage2DEXT +#define glCopyTexSubImage3DEXT pglCopyTexSubImage3DEXT +#endif + +/* GL_EXT_histogram */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#define __GLEE_GL_EXT_histogram 1 +/* Constants */ +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +GLEE_EXTERN PFNGLGETHISTOGRAMEXTPROC pglGetHistogramEXT; +GLEE_EXTERN PFNGLGETHISTOGRAMPARAMETERFVEXTPROC pglGetHistogramParameterfvEXT; +GLEE_EXTERN PFNGLGETHISTOGRAMPARAMETERIVEXTPROC pglGetHistogramParameterivEXT; +GLEE_EXTERN PFNGLGETMINMAXEXTPROC pglGetMinmaxEXT; +GLEE_EXTERN PFNGLGETMINMAXPARAMETERFVEXTPROC pglGetMinmaxParameterfvEXT; +GLEE_EXTERN PFNGLGETMINMAXPARAMETERIVEXTPROC pglGetMinmaxParameterivEXT; +GLEE_EXTERN PFNGLHISTOGRAMEXTPROC pglHistogramEXT; +GLEE_EXTERN PFNGLMINMAXEXTPROC pglMinmaxEXT; +GLEE_EXTERN PFNGLRESETHISTOGRAMEXTPROC pglResetHistogramEXT; +GLEE_EXTERN PFNGLRESETMINMAXEXTPROC pglResetMinmaxEXT; +#define glGetHistogramEXT pglGetHistogramEXT +#define glGetHistogramParameterfvEXT pglGetHistogramParameterfvEXT +#define glGetHistogramParameterivEXT pglGetHistogramParameterivEXT +#define glGetMinmaxEXT pglGetMinmaxEXT +#define glGetMinmaxParameterfvEXT pglGetMinmaxParameterfvEXT +#define glGetMinmaxParameterivEXT pglGetMinmaxParameterivEXT +#define glHistogramEXT pglHistogramEXT +#define glMinmaxEXT pglMinmaxEXT +#define glResetHistogramEXT pglResetHistogramEXT +#define glResetMinmaxEXT pglResetMinmaxEXT +#endif + +/* GL_EXT_convolution */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#define __GLEE_GL_EXT_convolution 1 +/* Constants */ +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid * image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); +GLEE_EXTERN PFNGLCONVOLUTIONFILTER1DEXTPROC pglConvolutionFilter1DEXT; +GLEE_EXTERN PFNGLCONVOLUTIONFILTER2DEXTPROC pglConvolutionFilter2DEXT; +GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERFEXTPROC pglConvolutionParameterfEXT; +GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERFVEXTPROC pglConvolutionParameterfvEXT; +GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERIEXTPROC pglConvolutionParameteriEXT; +GLEE_EXTERN PFNGLCONVOLUTIONPARAMETERIVEXTPROC pglConvolutionParameterivEXT; +GLEE_EXTERN PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC pglCopyConvolutionFilter1DEXT; +GLEE_EXTERN PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC pglCopyConvolutionFilter2DEXT; +GLEE_EXTERN PFNGLGETCONVOLUTIONFILTEREXTPROC pglGetConvolutionFilterEXT; +GLEE_EXTERN PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC pglGetConvolutionParameterfvEXT; +GLEE_EXTERN PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC pglGetConvolutionParameterivEXT; +GLEE_EXTERN PFNGLGETSEPARABLEFILTEREXTPROC pglGetSeparableFilterEXT; +GLEE_EXTERN PFNGLSEPARABLEFILTER2DEXTPROC pglSeparableFilter2DEXT; +#define glConvolutionFilter1DEXT pglConvolutionFilter1DEXT +#define glConvolutionFilter2DEXT pglConvolutionFilter2DEXT +#define glConvolutionParameterfEXT pglConvolutionParameterfEXT +#define glConvolutionParameterfvEXT pglConvolutionParameterfvEXT +#define glConvolutionParameteriEXT pglConvolutionParameteriEXT +#define glConvolutionParameterivEXT pglConvolutionParameterivEXT +#define glCopyConvolutionFilter1DEXT pglCopyConvolutionFilter1DEXT +#define glCopyConvolutionFilter2DEXT pglCopyConvolutionFilter2DEXT +#define glGetConvolutionFilterEXT pglGetConvolutionFilterEXT +#define glGetConvolutionParameterfvEXT pglGetConvolutionParameterfvEXT +#define glGetConvolutionParameterivEXT pglGetConvolutionParameterivEXT +#define glGetSeparableFilterEXT pglGetSeparableFilterEXT +#define glSeparableFilter2DEXT pglSeparableFilter2DEXT +#endif + +/* GL_SGI_color_matrix */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +#define __GLEE_GL_SGI_color_matrix 1 +/* Constants */ +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +/* GL_SGI_color_table */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#define __GLEE_GL_SGI_color_table 1 +/* Constants */ +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid * table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint * params); +GLEE_EXTERN PFNGLCOLORTABLESGIPROC pglColorTableSGI; +GLEE_EXTERN PFNGLCOLORTABLEPARAMETERFVSGIPROC pglColorTableParameterfvSGI; +GLEE_EXTERN PFNGLCOLORTABLEPARAMETERIVSGIPROC pglColorTableParameterivSGI; +GLEE_EXTERN PFNGLCOPYCOLORTABLESGIPROC pglCopyColorTableSGI; +GLEE_EXTERN PFNGLGETCOLORTABLESGIPROC pglGetColorTableSGI; +GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERFVSGIPROC pglGetColorTableParameterfvSGI; +GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERIVSGIPROC pglGetColorTableParameterivSGI; +#define glColorTableSGI pglColorTableSGI +#define glColorTableParameterfvSGI pglColorTableParameterfvSGI +#define glColorTableParameterivSGI pglColorTableParameterivSGI +#define glCopyColorTableSGI pglCopyColorTableSGI +#define glGetColorTableSGI pglGetColorTableSGI +#define glGetColorTableParameterfvSGI pglGetColorTableParameterfvSGI +#define glGetColorTableParameterivSGI pglGetColorTableParameterivSGI +#endif + +/* GL_SGIS_pixel_texture */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#define __GLEE_GL_SGIS_pixel_texture 1 +/* Constants */ +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat * params); +GLEE_EXTERN PFNGLPIXELTEXGENPARAMETERISGISPROC pglPixelTexGenParameteriSGIS; +GLEE_EXTERN PFNGLPIXELTEXGENPARAMETERIVSGISPROC pglPixelTexGenParameterivSGIS; +GLEE_EXTERN PFNGLPIXELTEXGENPARAMETERFSGISPROC pglPixelTexGenParameterfSGIS; +GLEE_EXTERN PFNGLPIXELTEXGENPARAMETERFVSGISPROC pglPixelTexGenParameterfvSGIS; +GLEE_EXTERN PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC pglGetPixelTexGenParameterivSGIS; +GLEE_EXTERN PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC pglGetPixelTexGenParameterfvSGIS; +#define glPixelTexGenParameteriSGIS pglPixelTexGenParameteriSGIS +#define glPixelTexGenParameterivSGIS pglPixelTexGenParameterivSGIS +#define glPixelTexGenParameterfSGIS pglPixelTexGenParameterfSGIS +#define glPixelTexGenParameterfvSGIS pglPixelTexGenParameterfvSGIS +#define glGetPixelTexGenParameterivSGIS pglGetPixelTexGenParameterivSGIS +#define glGetPixelTexGenParameterfvSGIS pglGetPixelTexGenParameterfvSGIS +#endif + +/* GL_SGIX_pixel_texture */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#define __GLEE_GL_SGIX_pixel_texture 1 +/* Constants */ +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +GLEE_EXTERN PFNGLPIXELTEXGENSGIXPROC pglPixelTexGenSGIX; +#define glPixelTexGenSGIX pglPixelTexGenSGIX +#endif + +/* GL_SGIS_texture4D */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#define __GLEE_GL_SGIS_texture4D 1 +/* Constants */ +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid * pixels); +GLEE_EXTERN PFNGLTEXIMAGE4DSGISPROC pglTexImage4DSGIS; +GLEE_EXTERN PFNGLTEXSUBIMAGE4DSGISPROC pglTexSubImage4DSGIS; +#define glTexImage4DSGIS pglTexImage4DSGIS +#define glTexSubImage4DSGIS pglTexSubImage4DSGIS +#endif + +/* GL_SGI_texture_color_table */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#define __GLEE_GL_SGI_texture_color_table 1 +/* Constants */ +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +/* GL_EXT_cmyka */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#define __GLEE_GL_EXT_cmyka 1 +/* Constants */ +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +/* GL_EXT_texture_object */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#define __GLEE_GL_EXT_texture_object 1 +/* Constants */ +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint * textures, GLboolean * residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint * textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint * textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint * textures, const GLclampf * priorities); +GLEE_EXTERN PFNGLARETEXTURESRESIDENTEXTPROC pglAreTexturesResidentEXT; +GLEE_EXTERN PFNGLBINDTEXTUREEXTPROC pglBindTextureEXT; +GLEE_EXTERN PFNGLDELETETEXTURESEXTPROC pglDeleteTexturesEXT; +GLEE_EXTERN PFNGLGENTEXTURESEXTPROC pglGenTexturesEXT; +GLEE_EXTERN PFNGLISTEXTUREEXTPROC pglIsTextureEXT; +GLEE_EXTERN PFNGLPRIORITIZETEXTURESEXTPROC pglPrioritizeTexturesEXT; +#define glAreTexturesResidentEXT pglAreTexturesResidentEXT +#define glBindTextureEXT pglBindTextureEXT +#define glDeleteTexturesEXT pglDeleteTexturesEXT +#define glGenTexturesEXT pglGenTexturesEXT +#define glIsTextureEXT pglIsTextureEXT +#define glPrioritizeTexturesEXT pglPrioritizeTexturesEXT +#endif + +/* GL_SGIS_detail_texture */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#define __GLEE_GL_SGIS_detail_texture 1 +/* Constants */ +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat * points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat * points); +GLEE_EXTERN PFNGLDETAILTEXFUNCSGISPROC pglDetailTexFuncSGIS; +GLEE_EXTERN PFNGLGETDETAILTEXFUNCSGISPROC pglGetDetailTexFuncSGIS; +#define glDetailTexFuncSGIS pglDetailTexFuncSGIS +#define glGetDetailTexFuncSGIS pglGetDetailTexFuncSGIS +#endif + +/* GL_SGIS_sharpen_texture */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#define __GLEE_GL_SGIS_sharpen_texture 1 +/* Constants */ +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat * points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat * points); +GLEE_EXTERN PFNGLSHARPENTEXFUNCSGISPROC pglSharpenTexFuncSGIS; +GLEE_EXTERN PFNGLGETSHARPENTEXFUNCSGISPROC pglGetSharpenTexFuncSGIS; +#define glSharpenTexFuncSGIS pglSharpenTexFuncSGIS +#define glGetSharpenTexFuncSGIS pglGetSharpenTexFuncSGIS +#endif + +/* GL_EXT_packed_pixels */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#define __GLEE_GL_EXT_packed_pixels 1 +/* Constants */ +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +/* GL_SGIS_texture_lod */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#define __GLEE_GL_SGIS_texture_lod 1 +/* Constants */ +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +/* GL_SGIS_multisample */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#define __GLEE_GL_SGIS_multisample 1 +/* Constants */ +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +GLEE_EXTERN PFNGLSAMPLEMASKSGISPROC pglSampleMaskSGIS; +GLEE_EXTERN PFNGLSAMPLEPATTERNSGISPROC pglSamplePatternSGIS; +#define glSampleMaskSGIS pglSampleMaskSGIS +#define glSamplePatternSGIS pglSamplePatternSGIS +#endif + +/* GL_EXT_rescale_normal */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#define __GLEE_GL_EXT_rescale_normal 1 +/* Constants */ +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +/* GL_EXT_vertex_array */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#define __GLEE_GL_EXT_vertex_array 1 +/* Constants */ +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean * pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* * params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); +GLEE_EXTERN PFNGLARRAYELEMENTEXTPROC pglArrayElementEXT; +GLEE_EXTERN PFNGLCOLORPOINTEREXTPROC pglColorPointerEXT; +GLEE_EXTERN PFNGLDRAWARRAYSEXTPROC pglDrawArraysEXT; +GLEE_EXTERN PFNGLEDGEFLAGPOINTEREXTPROC pglEdgeFlagPointerEXT; +GLEE_EXTERN PFNGLGETPOINTERVEXTPROC pglGetPointervEXT; +GLEE_EXTERN PFNGLINDEXPOINTEREXTPROC pglIndexPointerEXT; +GLEE_EXTERN PFNGLNORMALPOINTEREXTPROC pglNormalPointerEXT; +GLEE_EXTERN PFNGLTEXCOORDPOINTEREXTPROC pglTexCoordPointerEXT; +GLEE_EXTERN PFNGLVERTEXPOINTEREXTPROC pglVertexPointerEXT; +#define glArrayElementEXT pglArrayElementEXT +#define glColorPointerEXT pglColorPointerEXT +#define glDrawArraysEXT pglDrawArraysEXT +#define glEdgeFlagPointerEXT pglEdgeFlagPointerEXT +#define glGetPointervEXT pglGetPointervEXT +#define glIndexPointerEXT pglIndexPointerEXT +#define glNormalPointerEXT pglNormalPointerEXT +#define glTexCoordPointerEXT pglTexCoordPointerEXT +#define glVertexPointerEXT pglVertexPointerEXT +#endif + +/* GL_EXT_misc_attribute */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#define __GLEE_GL_EXT_misc_attribute 1 +/* Constants */ +#endif + +/* GL_SGIS_generate_mipmap */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#define __GLEE_GL_SGIS_generate_mipmap 1 +/* Constants */ +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +/* GL_SGIX_clipmap */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#define __GLEE_GL_SGIX_clipmap 1 +/* Constants */ +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +/* GL_SGIX_shadow */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#define __GLEE_GL_SGIX_shadow 1 +/* Constants */ +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +/* GL_SGIS_texture_edge_clamp */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#define __GLEE_GL_SGIS_texture_edge_clamp 1 +/* Constants */ +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +/* GL_SGIS_texture_border_clamp */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#define __GLEE_GL_SGIS_texture_border_clamp 1 +/* Constants */ +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +/* GL_EXT_blend_minmax */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#define __GLEE_GL_EXT_blend_minmax 1 +/* Constants */ +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +GLEE_EXTERN PFNGLBLENDEQUATIONEXTPROC pglBlendEquationEXT; +#define glBlendEquationEXT pglBlendEquationEXT +#endif + +/* GL_EXT_blend_subtract */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#define __GLEE_GL_EXT_blend_subtract 1 +/* Constants */ +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +/* GL_EXT_blend_logic_op */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#define __GLEE_GL_EXT_blend_logic_op 1 +/* Constants */ +#endif + +/* GL_SGIX_interlace */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#define __GLEE_GL_SGIX_interlace 1 +/* Constants */ +#define GL_INTERLACE_SGIX 0x8094 +#endif + +/* GL_SGIX_pixel_tiles */ + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#define __GLEE_GL_SGIX_pixel_tiles 1 +/* Constants */ +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +/* GL_SGIS_texture_select */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 +#define __GLEE_GL_SGIS_texture_select 1 +/* Constants */ +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +/* GL_SGIX_sprite */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#define __GLEE_GL_SGIX_sprite 1 +/* Constants */ +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint * params); +GLEE_EXTERN PFNGLSPRITEPARAMETERFSGIXPROC pglSpriteParameterfSGIX; +GLEE_EXTERN PFNGLSPRITEPARAMETERFVSGIXPROC pglSpriteParameterfvSGIX; +GLEE_EXTERN PFNGLSPRITEPARAMETERISGIXPROC pglSpriteParameteriSGIX; +GLEE_EXTERN PFNGLSPRITEPARAMETERIVSGIXPROC pglSpriteParameterivSGIX; +#define glSpriteParameterfSGIX pglSpriteParameterfSGIX +#define glSpriteParameterfvSGIX pglSpriteParameterfvSGIX +#define glSpriteParameteriSGIX pglSpriteParameteriSGIX +#define glSpriteParameterivSGIX pglSpriteParameterivSGIX +#endif + +/* GL_SGIX_texture_multi_buffer */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#define __GLEE_GL_SGIX_texture_multi_buffer 1 +/* Constants */ +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +/* GL_EXT_point_parameters */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#define __GLEE_GL_EXT_point_parameters 1 +/* Constants */ +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat * params); +GLEE_EXTERN PFNGLPOINTPARAMETERFEXTPROC pglPointParameterfEXT; +GLEE_EXTERN PFNGLPOINTPARAMETERFVEXTPROC pglPointParameterfvEXT; +#define glPointParameterfEXT pglPointParameterfEXT +#define glPointParameterfvEXT pglPointParameterfvEXT +#endif + +/* GL_SGIS_point_parameters */ + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#define __GLEE_GL_SGIS_point_parameters 1 +/* Constants */ +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat * params); +GLEE_EXTERN PFNGLPOINTPARAMETERFSGISPROC pglPointParameterfSGIS; +GLEE_EXTERN PFNGLPOINTPARAMETERFVSGISPROC pglPointParameterfvSGIS; +#define glPointParameterfSGIS pglPointParameterfSGIS +#define glPointParameterfvSGIS pglPointParameterfvSGIS +#endif + +/* GL_SGIX_instruments */ + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#define __GLEE_GL_SGIX_instruments 1 +/* Constants */ +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint * buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint * marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +GLEE_EXTERN PFNGLGETINSTRUMENTSSGIXPROC pglGetInstrumentsSGIX; +GLEE_EXTERN PFNGLINSTRUMENTSBUFFERSGIXPROC pglInstrumentsBufferSGIX; +GLEE_EXTERN PFNGLPOLLINSTRUMENTSSGIXPROC pglPollInstrumentsSGIX; +GLEE_EXTERN PFNGLREADINSTRUMENTSSGIXPROC pglReadInstrumentsSGIX; +GLEE_EXTERN PFNGLSTARTINSTRUMENTSSGIXPROC pglStartInstrumentsSGIX; +GLEE_EXTERN PFNGLSTOPINSTRUMENTSSGIXPROC pglStopInstrumentsSGIX; +#define glGetInstrumentsSGIX pglGetInstrumentsSGIX +#define glInstrumentsBufferSGIX pglInstrumentsBufferSGIX +#define glPollInstrumentsSGIX pglPollInstrumentsSGIX +#define glReadInstrumentsSGIX pglReadInstrumentsSGIX +#define glStartInstrumentsSGIX pglStartInstrumentsSGIX +#define glStopInstrumentsSGIX pglStopInstrumentsSGIX +#endif + +/* GL_SGIX_texture_scale_bias */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#define __GLEE_GL_SGIX_texture_scale_bias 1 +/* Constants */ +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +/* GL_SGIX_framezoom */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#define __GLEE_GL_SGIX_framezoom 1 +/* Constants */ +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +GLEE_EXTERN PFNGLFRAMEZOOMSGIXPROC pglFrameZoomSGIX; +#define glFrameZoomSGIX pglFrameZoomSGIX +#endif + +/* GL_SGIX_tag_sample_buffer */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#define __GLEE_GL_SGIX_tag_sample_buffer 1 +/* Constants */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (); +GLEE_EXTERN PFNGLTAGSAMPLEBUFFERSGIXPROC pglTagSampleBufferSGIX; +#define glTagSampleBufferSGIX pglTagSampleBufferSGIX +#endif + +/* GL_FfdMaskSGIX */ + +#ifndef GL_FfdMaskSGIX +#define GL_FfdMaskSGIX 1 +#define __GLEE_GL_FfdMaskSGIX 1 +/* Constants */ +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +/* GL_SGIX_polynomial_ffd */ + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#define __GLEE_GL_SGIX_polynomial_ffd 1 +/* Constants */ +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble * points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat * points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +GLEE_EXTERN PFNGLDEFORMATIONMAP3DSGIXPROC pglDeformationMap3dSGIX; +GLEE_EXTERN PFNGLDEFORMATIONMAP3FSGIXPROC pglDeformationMap3fSGIX; +GLEE_EXTERN PFNGLDEFORMSGIXPROC pglDeformSGIX; +GLEE_EXTERN PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC pglLoadIdentityDeformationMapSGIX; +#define glDeformationMap3dSGIX pglDeformationMap3dSGIX +#define glDeformationMap3fSGIX pglDeformationMap3fSGIX +#define glDeformSGIX pglDeformSGIX +#define glLoadIdentityDeformationMapSGIX pglLoadIdentityDeformationMapSGIX +#endif + +/* GL_SGIX_reference_plane */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#define __GLEE_GL_SGIX_reference_plane 1 +/* Constants */ +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble * equation); +GLEE_EXTERN PFNGLREFERENCEPLANESGIXPROC pglReferencePlaneSGIX; +#define glReferencePlaneSGIX pglReferencePlaneSGIX +#endif + +/* GL_SGIX_flush_raster */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#define __GLEE_GL_SGIX_flush_raster 1 +/* Constants */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (); +GLEE_EXTERN PFNGLFLUSHRASTERSGIXPROC pglFlushRasterSGIX; +#define glFlushRasterSGIX pglFlushRasterSGIX +#endif + +/* GL_SGIX_depth_texture */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#define __GLEE_GL_SGIX_depth_texture 1 +/* Constants */ +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +/* GL_SGIS_fog_function */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#define __GLEE_GL_SGIS_fog_function 1 +/* Constants */ +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat * points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat * points); +GLEE_EXTERN PFNGLFOGFUNCSGISPROC pglFogFuncSGIS; +GLEE_EXTERN PFNGLGETFOGFUNCSGISPROC pglGetFogFuncSGIS; +#define glFogFuncSGIS pglFogFuncSGIS +#define glGetFogFuncSGIS pglGetFogFuncSGIS +#endif + +/* GL_SGIX_fog_offset */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#define __GLEE_GL_SGIX_fog_offset 1 +/* Constants */ +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +/* GL_HP_image_transform */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#define __GLEE_GL_HP_image_transform 1 +/* Constants */ +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat * params); +GLEE_EXTERN PFNGLIMAGETRANSFORMPARAMETERIHPPROC pglImageTransformParameteriHP; +GLEE_EXTERN PFNGLIMAGETRANSFORMPARAMETERFHPPROC pglImageTransformParameterfHP; +GLEE_EXTERN PFNGLIMAGETRANSFORMPARAMETERIVHPPROC pglImageTransformParameterivHP; +GLEE_EXTERN PFNGLIMAGETRANSFORMPARAMETERFVHPPROC pglImageTransformParameterfvHP; +GLEE_EXTERN PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC pglGetImageTransformParameterivHP; +GLEE_EXTERN PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC pglGetImageTransformParameterfvHP; +#define glImageTransformParameteriHP pglImageTransformParameteriHP +#define glImageTransformParameterfHP pglImageTransformParameterfHP +#define glImageTransformParameterivHP pglImageTransformParameterivHP +#define glImageTransformParameterfvHP pglImageTransformParameterfvHP +#define glGetImageTransformParameterivHP pglGetImageTransformParameterivHP +#define glGetImageTransformParameterfvHP pglGetImageTransformParameterfvHP +#endif + +/* GL_HP_convolution_border_modes */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#define __GLEE_GL_HP_convolution_border_modes 1 +/* Constants */ +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +/* GL_INGR_palette_buffer */ + +#ifndef GL_INGR_palette_buffer +#define GL_INGR_palette_buffer 1 +#define __GLEE_GL_INGR_palette_buffer 1 +/* Constants */ +#endif + +/* GL_SGIX_texture_add_env */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#define __GLEE_GL_SGIX_texture_add_env 1 +/* Constants */ +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +/* GL_EXT_color_subtable */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#define __GLEE_GL_EXT_color_subtable 1 +/* Constants */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLEE_EXTERN PFNGLCOLORSUBTABLEEXTPROC pglColorSubTableEXT; +GLEE_EXTERN PFNGLCOPYCOLORSUBTABLEEXTPROC pglCopyColorSubTableEXT; +#define glColorSubTableEXT pglColorSubTableEXT +#define glCopyColorSubTableEXT pglCopyColorSubTableEXT +#endif + +/* GL_PGI_vertex_hints */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#define __GLEE_GL_PGI_vertex_hints 1 +/* Constants */ +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +/* GL_PGI_misc_hints */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#define __GLEE_GL_PGI_misc_hints 1 +/* Constants */ +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +GLEE_EXTERN PFNGLHINTPGIPROC pglHintPGI; +#define glHintPGI pglHintPGI +#endif + +/* GL_EXT_paletted_texture */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#define __GLEE_GL_EXT_paletted_texture 1 +/* Constants */ +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid * data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat * params); +GLEE_EXTERN PFNGLCOLORTABLEEXTPROC pglColorTableEXT; +GLEE_EXTERN PFNGLGETCOLORTABLEEXTPROC pglGetColorTableEXT; +GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERIVEXTPROC pglGetColorTableParameterivEXT; +GLEE_EXTERN PFNGLGETCOLORTABLEPARAMETERFVEXTPROC pglGetColorTableParameterfvEXT; +#define glColorTableEXT pglColorTableEXT +#define glGetColorTableEXT pglGetColorTableEXT +#define glGetColorTableParameterivEXT pglGetColorTableParameterivEXT +#define glGetColorTableParameterfvEXT pglGetColorTableParameterfvEXT +#endif + +/* GL_EXT_clip_volume_hint */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#define __GLEE_GL_EXT_clip_volume_hint 1 +/* Constants */ +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +/* GL_SGIX_list_priority */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#define __GLEE_GL_SGIX_list_priority 1 +/* Constants */ +#define GL_LIST_PRIORITY_SGIX 0x8182 +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint * params); +GLEE_EXTERN PFNGLGETLISTPARAMETERFVSGIXPROC pglGetListParameterfvSGIX; +GLEE_EXTERN PFNGLGETLISTPARAMETERIVSGIXPROC pglGetListParameterivSGIX; +GLEE_EXTERN PFNGLLISTPARAMETERFSGIXPROC pglListParameterfSGIX; +GLEE_EXTERN PFNGLLISTPARAMETERFVSGIXPROC pglListParameterfvSGIX; +GLEE_EXTERN PFNGLLISTPARAMETERISGIXPROC pglListParameteriSGIX; +GLEE_EXTERN PFNGLLISTPARAMETERIVSGIXPROC pglListParameterivSGIX; +#define glGetListParameterfvSGIX pglGetListParameterfvSGIX +#define glGetListParameterivSGIX pglGetListParameterivSGIX +#define glListParameterfSGIX pglListParameterfSGIX +#define glListParameterfvSGIX pglListParameterfvSGIX +#define glListParameteriSGIX pglListParameteriSGIX +#define glListParameterivSGIX pglListParameterivSGIX +#endif + +/* GL_SGIX_ir_instrument1 */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#define __GLEE_GL_SGIX_ir_instrument1 1 +/* Constants */ +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +/* GL_SGIX_calligraphic_fragment */ + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#define __GLEE_GL_SGIX_calligraphic_fragment 1 +/* Constants */ +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +/* GL_SGIX_texture_lod_bias */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#define __GLEE_GL_SGIX_texture_lod_bias 1 +/* Constants */ +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +/* GL_SGIX_shadow_ambient */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#define __GLEE_GL_SGIX_shadow_ambient 1 +/* Constants */ +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +/* GL_EXT_index_texture */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#define __GLEE_GL_EXT_index_texture 1 +/* Constants */ +#endif + +/* GL_EXT_index_material */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#define __GLEE_GL_EXT_index_material 1 +/* Constants */ +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +GLEE_EXTERN PFNGLINDEXMATERIALEXTPROC pglIndexMaterialEXT; +#define glIndexMaterialEXT pglIndexMaterialEXT +#endif + +/* GL_EXT_index_func */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#define __GLEE_GL_EXT_index_func 1 +/* Constants */ +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +GLEE_EXTERN PFNGLINDEXFUNCEXTPROC pglIndexFuncEXT; +#define glIndexFuncEXT pglIndexFuncEXT +#endif + +/* GL_EXT_index_array_formats */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#define __GLEE_GL_EXT_index_array_formats 1 +/* Constants */ +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +/* GL_EXT_compiled_vertex_array */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#define __GLEE_GL_EXT_compiled_vertex_array 1 +/* Constants */ +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (); +GLEE_EXTERN PFNGLLOCKARRAYSEXTPROC pglLockArraysEXT; +GLEE_EXTERN PFNGLUNLOCKARRAYSEXTPROC pglUnlockArraysEXT; +#define glLockArraysEXT pglLockArraysEXT +#define glUnlockArraysEXT pglUnlockArraysEXT +#endif + +/* GL_EXT_cull_vertex */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#define __GLEE_GL_EXT_cull_vertex 1 +/* Constants */ +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble * params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat * params); +GLEE_EXTERN PFNGLCULLPARAMETERDVEXTPROC pglCullParameterdvEXT; +GLEE_EXTERN PFNGLCULLPARAMETERFVEXTPROC pglCullParameterfvEXT; +#define glCullParameterdvEXT pglCullParameterdvEXT +#define glCullParameterfvEXT pglCullParameterfvEXT +#endif + +/* GL_SGIX_ycrcb */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#define __GLEE_GL_SGIX_ycrcb 1 +/* Constants */ +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +/* GL_SGIX_fragment_lighting */ + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#define __GLEE_GL_SGIX_fragment_lighting 1 +/* Constants */ +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +GLEE_EXTERN PFNGLFRAGMENTCOLORMATERIALSGIXPROC pglFragmentColorMaterialSGIX; +GLEE_EXTERN PFNGLFRAGMENTLIGHTFSGIXPROC pglFragmentLightfSGIX; +GLEE_EXTERN PFNGLFRAGMENTLIGHTFVSGIXPROC pglFragmentLightfvSGIX; +GLEE_EXTERN PFNGLFRAGMENTLIGHTISGIXPROC pglFragmentLightiSGIX; +GLEE_EXTERN PFNGLFRAGMENTLIGHTIVSGIXPROC pglFragmentLightivSGIX; +GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELFSGIXPROC pglFragmentLightModelfSGIX; +GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELFVSGIXPROC pglFragmentLightModelfvSGIX; +GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELISGIXPROC pglFragmentLightModeliSGIX; +GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELIVSGIXPROC pglFragmentLightModelivSGIX; +GLEE_EXTERN PFNGLFRAGMENTMATERIALFSGIXPROC pglFragmentMaterialfSGIX; +GLEE_EXTERN PFNGLFRAGMENTMATERIALFVSGIXPROC pglFragmentMaterialfvSGIX; +GLEE_EXTERN PFNGLFRAGMENTMATERIALISGIXPROC pglFragmentMaterialiSGIX; +GLEE_EXTERN PFNGLFRAGMENTMATERIALIVSGIXPROC pglFragmentMaterialivSGIX; +GLEE_EXTERN PFNGLGETFRAGMENTLIGHTFVSGIXPROC pglGetFragmentLightfvSGIX; +GLEE_EXTERN PFNGLGETFRAGMENTLIGHTIVSGIXPROC pglGetFragmentLightivSGIX; +GLEE_EXTERN PFNGLGETFRAGMENTMATERIALFVSGIXPROC pglGetFragmentMaterialfvSGIX; +GLEE_EXTERN PFNGLGETFRAGMENTMATERIALIVSGIXPROC pglGetFragmentMaterialivSGIX; +GLEE_EXTERN PFNGLLIGHTENVISGIXPROC pglLightEnviSGIX; +#define glFragmentColorMaterialSGIX pglFragmentColorMaterialSGIX +#define glFragmentLightfSGIX pglFragmentLightfSGIX +#define glFragmentLightfvSGIX pglFragmentLightfvSGIX +#define glFragmentLightiSGIX pglFragmentLightiSGIX +#define glFragmentLightivSGIX pglFragmentLightivSGIX +#define glFragmentLightModelfSGIX pglFragmentLightModelfSGIX +#define glFragmentLightModelfvSGIX pglFragmentLightModelfvSGIX +#define glFragmentLightModeliSGIX pglFragmentLightModeliSGIX +#define glFragmentLightModelivSGIX pglFragmentLightModelivSGIX +#define glFragmentMaterialfSGIX pglFragmentMaterialfSGIX +#define glFragmentMaterialfvSGIX pglFragmentMaterialfvSGIX +#define glFragmentMaterialiSGIX pglFragmentMaterialiSGIX +#define glFragmentMaterialivSGIX pglFragmentMaterialivSGIX +#define glGetFragmentLightfvSGIX pglGetFragmentLightfvSGIX +#define glGetFragmentLightivSGIX pglGetFragmentLightivSGIX +#define glGetFragmentMaterialfvSGIX pglGetFragmentMaterialfvSGIX +#define glGetFragmentMaterialivSGIX pglGetFragmentMaterialivSGIX +#define glLightEnviSGIX pglLightEnviSGIX +#endif + +/* GL_IBM_rasterpos_clip */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#define __GLEE_GL_IBM_rasterpos_clip 1 +/* Constants */ +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +/* GL_HP_texture_lighting */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#define __GLEE_GL_HP_texture_lighting 1 +/* Constants */ +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +/* GL_EXT_draw_range_elements */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#define __GLEE_GL_EXT_draw_range_elements 1 +/* Constants */ +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); +GLEE_EXTERN PFNGLDRAWRANGEELEMENTSEXTPROC pglDrawRangeElementsEXT; +#define glDrawRangeElementsEXT pglDrawRangeElementsEXT +#endif + +/* GL_WIN_phong_shading */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#define __GLEE_GL_WIN_phong_shading 1 +/* Constants */ +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +/* GL_WIN_specular_fog */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#define __GLEE_GL_WIN_specular_fog 1 +/* Constants */ +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +/* GL_EXT_light_texture */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#define __GLEE_GL_EXT_light_texture 1 +/* Constants */ +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +GLEE_EXTERN PFNGLAPPLYTEXTUREEXTPROC pglApplyTextureEXT; +GLEE_EXTERN PFNGLTEXTURELIGHTEXTPROC pglTextureLightEXT; +GLEE_EXTERN PFNGLTEXTUREMATERIALEXTPROC pglTextureMaterialEXT; +#define glApplyTextureEXT pglApplyTextureEXT +#define glTextureLightEXT pglTextureLightEXT +#define glTextureMaterialEXT pglTextureMaterialEXT +#endif + +/* GL_SGIX_blend_alpha_minmax */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#define __GLEE_GL_SGIX_blend_alpha_minmax 1 +/* Constants */ +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +/* GL_SGIX_impact_pixel_texture */ + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_SGIX_impact_pixel_texture 1 +#define __GLEE_GL_SGIX_impact_pixel_texture 1 +/* Constants */ +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +/* GL_EXT_bgra */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#define __GLEE_GL_EXT_bgra 1 +/* Constants */ +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +/* GL_SGIX_async */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#define __GLEE_GL_SGIX_async 1 +/* Constants */ +#define GL_ASYNC_MARKER_SGIX 0x8329 +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint * markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint * markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +GLEE_EXTERN PFNGLASYNCMARKERSGIXPROC pglAsyncMarkerSGIX; +GLEE_EXTERN PFNGLFINISHASYNCSGIXPROC pglFinishAsyncSGIX; +GLEE_EXTERN PFNGLPOLLASYNCSGIXPROC pglPollAsyncSGIX; +GLEE_EXTERN PFNGLGENASYNCMARKERSSGIXPROC pglGenAsyncMarkersSGIX; +GLEE_EXTERN PFNGLDELETEASYNCMARKERSSGIXPROC pglDeleteAsyncMarkersSGIX; +GLEE_EXTERN PFNGLISASYNCMARKERSGIXPROC pglIsAsyncMarkerSGIX; +#define glAsyncMarkerSGIX pglAsyncMarkerSGIX +#define glFinishAsyncSGIX pglFinishAsyncSGIX +#define glPollAsyncSGIX pglPollAsyncSGIX +#define glGenAsyncMarkersSGIX pglGenAsyncMarkersSGIX +#define glDeleteAsyncMarkersSGIX pglDeleteAsyncMarkersSGIX +#define glIsAsyncMarkerSGIX pglIsAsyncMarkerSGIX +#endif + +/* GL_SGIX_async_pixel */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#define __GLEE_GL_SGIX_async_pixel 1 +/* Constants */ +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +/* GL_SGIX_async_histogram */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#define __GLEE_GL_SGIX_async_histogram 1 +/* Constants */ +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +/* GL_INTEL_texture_scissor */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 +#define __GLEE_GL_INTEL_texture_scissor 1 +/* Constants */ +#endif + +/* GL_INTEL_parallel_arrays */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#define __GLEE_GL_INTEL_parallel_arrays 1 +/* Constants */ +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* * pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* * pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* * pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* * pointer); +GLEE_EXTERN PFNGLVERTEXPOINTERVINTELPROC pglVertexPointervINTEL; +GLEE_EXTERN PFNGLNORMALPOINTERVINTELPROC pglNormalPointervINTEL; +GLEE_EXTERN PFNGLCOLORPOINTERVINTELPROC pglColorPointervINTEL; +GLEE_EXTERN PFNGLTEXCOORDPOINTERVINTELPROC pglTexCoordPointervINTEL; +#define glVertexPointervINTEL pglVertexPointervINTEL +#define glNormalPointervINTEL pglNormalPointervINTEL +#define glColorPointervINTEL pglColorPointervINTEL +#define glTexCoordPointervINTEL pglTexCoordPointervINTEL +#endif + +/* GL_HP_occlusion_test */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#define __GLEE_GL_HP_occlusion_test 1 +/* Constants */ +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +/* GL_EXT_pixel_transform */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#define __GLEE_GL_EXT_pixel_transform 1 +/* Constants */ +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat * params); +GLEE_EXTERN PFNGLPIXELTRANSFORMPARAMETERIEXTPROC pglPixelTransformParameteriEXT; +GLEE_EXTERN PFNGLPIXELTRANSFORMPARAMETERFEXTPROC pglPixelTransformParameterfEXT; +GLEE_EXTERN PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC pglPixelTransformParameterivEXT; +GLEE_EXTERN PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC pglPixelTransformParameterfvEXT; +#define glPixelTransformParameteriEXT pglPixelTransformParameteriEXT +#define glPixelTransformParameterfEXT pglPixelTransformParameterfEXT +#define glPixelTransformParameterivEXT pglPixelTransformParameterivEXT +#define glPixelTransformParameterfvEXT pglPixelTransformParameterfvEXT +#endif + +/* GL_EXT_pixel_transform_color_table */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#define __GLEE_GL_EXT_pixel_transform_color_table 1 +/* Constants */ +#endif + +/* GL_EXT_shared_texture_palette */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#define __GLEE_GL_EXT_shared_texture_palette 1 +/* Constants */ +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +/* GL_EXT_separate_specular_color */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#define __GLEE_GL_EXT_separate_specular_color 1 +/* Constants */ +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +/* GL_EXT_secondary_color */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#define __GLEE_GL_EXT_secondary_color 1 +/* Constants */ +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort * v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +GLEE_EXTERN PFNGLSECONDARYCOLOR3BEXTPROC pglSecondaryColor3bEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3BVEXTPROC pglSecondaryColor3bvEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3DEXTPROC pglSecondaryColor3dEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3DVEXTPROC pglSecondaryColor3dvEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3FEXTPROC pglSecondaryColor3fEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3FVEXTPROC pglSecondaryColor3fvEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3IEXTPROC pglSecondaryColor3iEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3IVEXTPROC pglSecondaryColor3ivEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3SEXTPROC pglSecondaryColor3sEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3SVEXTPROC pglSecondaryColor3svEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3UBEXTPROC pglSecondaryColor3ubEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3UBVEXTPROC pglSecondaryColor3ubvEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3UIEXTPROC pglSecondaryColor3uiEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3UIVEXTPROC pglSecondaryColor3uivEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3USEXTPROC pglSecondaryColor3usEXT; +GLEE_EXTERN PFNGLSECONDARYCOLOR3USVEXTPROC pglSecondaryColor3usvEXT; +GLEE_EXTERN PFNGLSECONDARYCOLORPOINTEREXTPROC pglSecondaryColorPointerEXT; +#define glSecondaryColor3bEXT pglSecondaryColor3bEXT +#define glSecondaryColor3bvEXT pglSecondaryColor3bvEXT +#define glSecondaryColor3dEXT pglSecondaryColor3dEXT +#define glSecondaryColor3dvEXT pglSecondaryColor3dvEXT +#define glSecondaryColor3fEXT pglSecondaryColor3fEXT +#define glSecondaryColor3fvEXT pglSecondaryColor3fvEXT +#define glSecondaryColor3iEXT pglSecondaryColor3iEXT +#define glSecondaryColor3ivEXT pglSecondaryColor3ivEXT +#define glSecondaryColor3sEXT pglSecondaryColor3sEXT +#define glSecondaryColor3svEXT pglSecondaryColor3svEXT +#define glSecondaryColor3ubEXT pglSecondaryColor3ubEXT +#define glSecondaryColor3ubvEXT pglSecondaryColor3ubvEXT +#define glSecondaryColor3uiEXT pglSecondaryColor3uiEXT +#define glSecondaryColor3uivEXT pglSecondaryColor3uivEXT +#define glSecondaryColor3usEXT pglSecondaryColor3usEXT +#define glSecondaryColor3usvEXT pglSecondaryColor3usvEXT +#define glSecondaryColorPointerEXT pglSecondaryColorPointerEXT +#endif + +/* GL_EXT_texture_perturb_normal */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#define __GLEE_GL_EXT_texture_perturb_normal 1 +/* Constants */ +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +GLEE_EXTERN PFNGLTEXTURENORMALEXTPROC pglTextureNormalEXT; +#define glTextureNormalEXT pglTextureNormalEXT +#endif + +/* GL_EXT_multi_draw_arrays */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#define __GLEE_GL_EXT_multi_draw_arrays 1 +/* Constants */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei * count, GLenum type, const GLvoid* * indices, GLsizei primcount); +GLEE_EXTERN PFNGLMULTIDRAWARRAYSEXTPROC pglMultiDrawArraysEXT; +GLEE_EXTERN PFNGLMULTIDRAWELEMENTSEXTPROC pglMultiDrawElementsEXT; +#define glMultiDrawArraysEXT pglMultiDrawArraysEXT +#define glMultiDrawElementsEXT pglMultiDrawElementsEXT +#endif + +/* GL_EXT_fog_coord */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#define __GLEE_GL_EXT_fog_coord 1 +/* Constants */ +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat * coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble * coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); +GLEE_EXTERN PFNGLFOGCOORDFEXTPROC pglFogCoordfEXT; +GLEE_EXTERN PFNGLFOGCOORDFVEXTPROC pglFogCoordfvEXT; +GLEE_EXTERN PFNGLFOGCOORDDEXTPROC pglFogCoorddEXT; +GLEE_EXTERN PFNGLFOGCOORDDVEXTPROC pglFogCoorddvEXT; +GLEE_EXTERN PFNGLFOGCOORDPOINTEREXTPROC pglFogCoordPointerEXT; +#define glFogCoordfEXT pglFogCoordfEXT +#define glFogCoordfvEXT pglFogCoordfvEXT +#define glFogCoorddEXT pglFogCoorddEXT +#define glFogCoorddvEXT pglFogCoorddvEXT +#define glFogCoordPointerEXT pglFogCoordPointerEXT +#endif + +/* GL_REND_screen_coordinates */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#define __GLEE_GL_REND_screen_coordinates 1 +/* Constants */ +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +/* GL_EXT_coordinate_frame */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#define __GLEE_GL_EXT_coordinate_frame 1 +/* Constants */ +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte * v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort * v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte * v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort * v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); +GLEE_EXTERN PFNGLTANGENT3BEXTPROC pglTangent3bEXT; +GLEE_EXTERN PFNGLTANGENT3BVEXTPROC pglTangent3bvEXT; +GLEE_EXTERN PFNGLTANGENT3DEXTPROC pglTangent3dEXT; +GLEE_EXTERN PFNGLTANGENT3DVEXTPROC pglTangent3dvEXT; +GLEE_EXTERN PFNGLTANGENT3FEXTPROC pglTangent3fEXT; +GLEE_EXTERN PFNGLTANGENT3FVEXTPROC pglTangent3fvEXT; +GLEE_EXTERN PFNGLTANGENT3IEXTPROC pglTangent3iEXT; +GLEE_EXTERN PFNGLTANGENT3IVEXTPROC pglTangent3ivEXT; +GLEE_EXTERN PFNGLTANGENT3SEXTPROC pglTangent3sEXT; +GLEE_EXTERN PFNGLTANGENT3SVEXTPROC pglTangent3svEXT; +GLEE_EXTERN PFNGLBINORMAL3BEXTPROC pglBinormal3bEXT; +GLEE_EXTERN PFNGLBINORMAL3BVEXTPROC pglBinormal3bvEXT; +GLEE_EXTERN PFNGLBINORMAL3DEXTPROC pglBinormal3dEXT; +GLEE_EXTERN PFNGLBINORMAL3DVEXTPROC pglBinormal3dvEXT; +GLEE_EXTERN PFNGLBINORMAL3FEXTPROC pglBinormal3fEXT; +GLEE_EXTERN PFNGLBINORMAL3FVEXTPROC pglBinormal3fvEXT; +GLEE_EXTERN PFNGLBINORMAL3IEXTPROC pglBinormal3iEXT; +GLEE_EXTERN PFNGLBINORMAL3IVEXTPROC pglBinormal3ivEXT; +GLEE_EXTERN PFNGLBINORMAL3SEXTPROC pglBinormal3sEXT; +GLEE_EXTERN PFNGLBINORMAL3SVEXTPROC pglBinormal3svEXT; +GLEE_EXTERN PFNGLTANGENTPOINTEREXTPROC pglTangentPointerEXT; +GLEE_EXTERN PFNGLBINORMALPOINTEREXTPROC pglBinormalPointerEXT; +#define glTangent3bEXT pglTangent3bEXT +#define glTangent3bvEXT pglTangent3bvEXT +#define glTangent3dEXT pglTangent3dEXT +#define glTangent3dvEXT pglTangent3dvEXT +#define glTangent3fEXT pglTangent3fEXT +#define glTangent3fvEXT pglTangent3fvEXT +#define glTangent3iEXT pglTangent3iEXT +#define glTangent3ivEXT pglTangent3ivEXT +#define glTangent3sEXT pglTangent3sEXT +#define glTangent3svEXT pglTangent3svEXT +#define glBinormal3bEXT pglBinormal3bEXT +#define glBinormal3bvEXT pglBinormal3bvEXT +#define glBinormal3dEXT pglBinormal3dEXT +#define glBinormal3dvEXT pglBinormal3dvEXT +#define glBinormal3fEXT pglBinormal3fEXT +#define glBinormal3fvEXT pglBinormal3fvEXT +#define glBinormal3iEXT pglBinormal3iEXT +#define glBinormal3ivEXT pglBinormal3ivEXT +#define glBinormal3sEXT pglBinormal3sEXT +#define glBinormal3svEXT pglBinormal3svEXT +#define glTangentPointerEXT pglTangentPointerEXT +#define glBinormalPointerEXT pglBinormalPointerEXT +#endif + +/* GL_EXT_texture_env_combine */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#define __GLEE_GL_EXT_texture_env_combine 1 +/* Constants */ +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +/* GL_APPLE_specular_vector */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#define __GLEE_GL_APPLE_specular_vector 1 +/* Constants */ +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +/* GL_APPLE_transform_hint */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#define __GLEE_GL_APPLE_transform_hint 1 +/* Constants */ +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +/* GL_SGIX_fog_scale */ + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#define __GLEE_GL_SGIX_fog_scale 1 +/* Constants */ +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +/* GL_SUNX_constant_data */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#define __GLEE_GL_SUNX_constant_data 1 +/* Constants */ +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (); +GLEE_EXTERN PFNGLFINISHTEXTURESUNXPROC pglFinishTextureSUNX; +#define glFinishTextureSUNX pglFinishTextureSUNX +#endif + +/* GL_SUN_global_alpha */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#define __GLEE_GL_SUN_global_alpha 1 +/* Constants */ +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +GLEE_EXTERN PFNGLGLOBALALPHAFACTORBSUNPROC pglGlobalAlphaFactorbSUN; +GLEE_EXTERN PFNGLGLOBALALPHAFACTORSSUNPROC pglGlobalAlphaFactorsSUN; +GLEE_EXTERN PFNGLGLOBALALPHAFACTORISUNPROC pglGlobalAlphaFactoriSUN; +GLEE_EXTERN PFNGLGLOBALALPHAFACTORFSUNPROC pglGlobalAlphaFactorfSUN; +GLEE_EXTERN PFNGLGLOBALALPHAFACTORDSUNPROC pglGlobalAlphaFactordSUN; +GLEE_EXTERN PFNGLGLOBALALPHAFACTORUBSUNPROC pglGlobalAlphaFactorubSUN; +GLEE_EXTERN PFNGLGLOBALALPHAFACTORUSSUNPROC pglGlobalAlphaFactorusSUN; +GLEE_EXTERN PFNGLGLOBALALPHAFACTORUISUNPROC pglGlobalAlphaFactoruiSUN; +#define glGlobalAlphaFactorbSUN pglGlobalAlphaFactorbSUN +#define glGlobalAlphaFactorsSUN pglGlobalAlphaFactorsSUN +#define glGlobalAlphaFactoriSUN pglGlobalAlphaFactoriSUN +#define glGlobalAlphaFactorfSUN pglGlobalAlphaFactorfSUN +#define glGlobalAlphaFactordSUN pglGlobalAlphaFactordSUN +#define glGlobalAlphaFactorubSUN pglGlobalAlphaFactorubSUN +#define glGlobalAlphaFactorusSUN pglGlobalAlphaFactorusSUN +#define glGlobalAlphaFactoruiSUN pglGlobalAlphaFactoruiSUN +#endif + +/* GL_SUN_triangle_list */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#define __GLEE_GL_SUN_triangle_list 1 +/* Constants */ +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint * code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort * code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte * code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* * pointer); +GLEE_EXTERN PFNGLREPLACEMENTCODEUISUNPROC pglReplacementCodeuiSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUSSUNPROC pglReplacementCodeusSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUBSUNPROC pglReplacementCodeubSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUIVSUNPROC pglReplacementCodeuivSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUSVSUNPROC pglReplacementCodeusvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUBVSUNPROC pglReplacementCodeubvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEPOINTERSUNPROC pglReplacementCodePointerSUN; +#define glReplacementCodeuiSUN pglReplacementCodeuiSUN +#define glReplacementCodeusSUN pglReplacementCodeusSUN +#define glReplacementCodeubSUN pglReplacementCodeubSUN +#define glReplacementCodeuivSUN pglReplacementCodeuivSUN +#define glReplacementCodeusvSUN pglReplacementCodeusvSUN +#define glReplacementCodeubvSUN pglReplacementCodeubvSUN +#define glReplacementCodePointerSUN pglReplacementCodePointerSUN +#endif + +/* GL_SUN_vertex */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#define __GLEE_GL_SUN_vertex 1 +/* Constants */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte * c, const GLfloat * v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte * c, const GLfloat * v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat * c, const GLfloat * v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat * n, const GLfloat * v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat * c, const GLfloat * n, const GLfloat * v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat * tc, const GLfloat * v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat * tc, const GLfloat * v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat * tc, const GLubyte * c, const GLfloat * v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat * tc, const GLfloat * c, const GLfloat * v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat * tc, const GLfloat * n, const GLfloat * v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint * rc, const GLubyte * c, const GLfloat * v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * c, const GLfloat * v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * n, const GLfloat * v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * c, const GLfloat * n, const GLfloat * v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * tc, const GLfloat * v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * tc, const GLfloat * n, const GLfloat * v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint * rc, const GLfloat * tc, const GLfloat * c, const GLfloat * n, const GLfloat * v); +GLEE_EXTERN PFNGLCOLOR4UBVERTEX2FSUNPROC pglColor4ubVertex2fSUN; +GLEE_EXTERN PFNGLCOLOR4UBVERTEX2FVSUNPROC pglColor4ubVertex2fvSUN; +GLEE_EXTERN PFNGLCOLOR4UBVERTEX3FSUNPROC pglColor4ubVertex3fSUN; +GLEE_EXTERN PFNGLCOLOR4UBVERTEX3FVSUNPROC pglColor4ubVertex3fvSUN; +GLEE_EXTERN PFNGLCOLOR3FVERTEX3FSUNPROC pglColor3fVertex3fSUN; +GLEE_EXTERN PFNGLCOLOR3FVERTEX3FVSUNPROC pglColor3fVertex3fvSUN; +GLEE_EXTERN PFNGLNORMAL3FVERTEX3FSUNPROC pglNormal3fVertex3fSUN; +GLEE_EXTERN PFNGLNORMAL3FVERTEX3FVSUNPROC pglNormal3fVertex3fvSUN; +GLEE_EXTERN PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC pglColor4fNormal3fVertex3fSUN; +GLEE_EXTERN PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglColor4fNormal3fVertex3fvSUN; +GLEE_EXTERN PFNGLTEXCOORD2FVERTEX3FSUNPROC pglTexCoord2fVertex3fSUN; +GLEE_EXTERN PFNGLTEXCOORD2FVERTEX3FVSUNPROC pglTexCoord2fVertex3fvSUN; +GLEE_EXTERN PFNGLTEXCOORD4FVERTEX4FSUNPROC pglTexCoord4fVertex4fSUN; +GLEE_EXTERN PFNGLTEXCOORD4FVERTEX4FVSUNPROC pglTexCoord4fVertex4fvSUN; +GLEE_EXTERN PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC pglTexCoord2fColor4ubVertex3fSUN; +GLEE_EXTERN PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC pglTexCoord2fColor4ubVertex3fvSUN; +GLEE_EXTERN PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC pglTexCoord2fColor3fVertex3fSUN; +GLEE_EXTERN PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC pglTexCoord2fColor3fVertex3fvSUN; +GLEE_EXTERN PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC pglTexCoord2fNormal3fVertex3fSUN; +GLEE_EXTERN PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC pglTexCoord2fNormal3fVertex3fvSUN; +GLEE_EXTERN PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC pglTexCoord2fColor4fNormal3fVertex3fSUN; +GLEE_EXTERN PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEE_EXTERN PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC pglTexCoord4fColor4fNormal3fVertex4fSUN; +GLEE_EXTERN PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC pglTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC pglReplacementCodeuiVertex3fSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC pglReplacementCodeuiVertex3fvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC pglReplacementCodeuiColor4ubVertex3fSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC pglReplacementCodeuiColor4ubVertex3fvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC pglReplacementCodeuiColor3fVertex3fSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC pglReplacementCodeuiColor3fVertex3fvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiNormal3fVertex3fSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiNormal3fVertex3fvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fVertex3fSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEE_EXTERN PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +#define glColor4ubVertex2fSUN pglColor4ubVertex2fSUN +#define glColor4ubVertex2fvSUN pglColor4ubVertex2fvSUN +#define glColor4ubVertex3fSUN pglColor4ubVertex3fSUN +#define glColor4ubVertex3fvSUN pglColor4ubVertex3fvSUN +#define glColor3fVertex3fSUN pglColor3fVertex3fSUN +#define glColor3fVertex3fvSUN pglColor3fVertex3fvSUN +#define glNormal3fVertex3fSUN pglNormal3fVertex3fSUN +#define glNormal3fVertex3fvSUN pglNormal3fVertex3fvSUN +#define glColor4fNormal3fVertex3fSUN pglColor4fNormal3fVertex3fSUN +#define glColor4fNormal3fVertex3fvSUN pglColor4fNormal3fVertex3fvSUN +#define glTexCoord2fVertex3fSUN pglTexCoord2fVertex3fSUN +#define glTexCoord2fVertex3fvSUN pglTexCoord2fVertex3fvSUN +#define glTexCoord4fVertex4fSUN pglTexCoord4fVertex4fSUN +#define glTexCoord4fVertex4fvSUN pglTexCoord4fVertex4fvSUN +#define glTexCoord2fColor4ubVertex3fSUN pglTexCoord2fColor4ubVertex3fSUN +#define glTexCoord2fColor4ubVertex3fvSUN pglTexCoord2fColor4ubVertex3fvSUN +#define glTexCoord2fColor3fVertex3fSUN pglTexCoord2fColor3fVertex3fSUN +#define glTexCoord2fColor3fVertex3fvSUN pglTexCoord2fColor3fVertex3fvSUN +#define glTexCoord2fNormal3fVertex3fSUN pglTexCoord2fNormal3fVertex3fSUN +#define glTexCoord2fNormal3fVertex3fvSUN pglTexCoord2fNormal3fVertex3fvSUN +#define glTexCoord2fColor4fNormal3fVertex3fSUN pglTexCoord2fColor4fNormal3fVertex3fSUN +#define glTexCoord2fColor4fNormal3fVertex3fvSUN pglTexCoord2fColor4fNormal3fVertex3fvSUN +#define glTexCoord4fColor4fNormal3fVertex4fSUN pglTexCoord4fColor4fNormal3fVertex4fSUN +#define glTexCoord4fColor4fNormal3fVertex4fvSUN pglTexCoord4fColor4fNormal3fVertex4fvSUN +#define glReplacementCodeuiVertex3fSUN pglReplacementCodeuiVertex3fSUN +#define glReplacementCodeuiVertex3fvSUN pglReplacementCodeuiVertex3fvSUN +#define glReplacementCodeuiColor4ubVertex3fSUN pglReplacementCodeuiColor4ubVertex3fSUN +#define glReplacementCodeuiColor4ubVertex3fvSUN pglReplacementCodeuiColor4ubVertex3fvSUN +#define glReplacementCodeuiColor3fVertex3fSUN pglReplacementCodeuiColor3fVertex3fSUN +#define glReplacementCodeuiColor3fVertex3fvSUN pglReplacementCodeuiColor3fVertex3fvSUN +#define glReplacementCodeuiNormal3fVertex3fSUN pglReplacementCodeuiNormal3fVertex3fSUN +#define glReplacementCodeuiNormal3fVertex3fvSUN pglReplacementCodeuiNormal3fVertex3fvSUN +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN pglReplacementCodeuiColor4fNormal3fVertex3fSUN +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN pglReplacementCodeuiColor4fNormal3fVertex3fvSUN +#define glReplacementCodeuiTexCoord2fVertex3fSUN pglReplacementCodeuiTexCoord2fVertex3fSUN +#define glReplacementCodeuiTexCoord2fVertex3fvSUN pglReplacementCodeuiTexCoord2fVertex3fvSUN +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN pglReplacementCodeuiTexCoord2fNormal3fVertex3fSUN +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN pglReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN pglReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN +#endif + +/* GL_EXT_blend_func_separate */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#define __GLEE_GL_EXT_blend_func_separate 1 +/* Constants */ +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLEE_EXTERN PFNGLBLENDFUNCSEPARATEEXTPROC pglBlendFuncSeparateEXT; +#define glBlendFuncSeparateEXT pglBlendFuncSeparateEXT +#endif + +/* GL_INGR_color_clamp */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#define __GLEE_GL_INGR_color_clamp 1 +/* Constants */ +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +/* GL_INGR_interlace_read */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#define __GLEE_GL_INGR_interlace_read 1 +/* Constants */ +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +/* GL_EXT_stencil_wrap */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#define __GLEE_GL_EXT_stencil_wrap 1 +/* Constants */ +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +/* GL_EXT_422_pixels */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#define __GLEE_GL_EXT_422_pixels 1 +/* Constants */ +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +/* GL_NV_texgen_reflection */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#define __GLEE_GL_NV_texgen_reflection 1 +/* Constants */ +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +/* GL_EXT_texture_cube_map */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 +#define __GLEE_GL_EXT_texture_cube_map 1 +/* Constants */ +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +/* GL_SUN_convolution_border_modes */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#define __GLEE_GL_SUN_convolution_border_modes 1 +/* Constants */ +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +/* GL_EXT_texture_env_add */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#define __GLEE_GL_EXT_texture_env_add 1 +/* Constants */ +#endif + +/* GL_EXT_texture_lod_bias */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#define __GLEE_GL_EXT_texture_lod_bias 1 +/* Constants */ +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +/* GL_EXT_texture_filter_anisotropic */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#define __GLEE_GL_EXT_texture_filter_anisotropic 1 +/* Constants */ +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +/* GL_EXT_vertex_weighting */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#define __GLEE_GL_EXT_vertex_weighting 1 +/* Constants */ +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat * weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer); +GLEE_EXTERN PFNGLVERTEXWEIGHTFEXTPROC pglVertexWeightfEXT; +GLEE_EXTERN PFNGLVERTEXWEIGHTFVEXTPROC pglVertexWeightfvEXT; +GLEE_EXTERN PFNGLVERTEXWEIGHTPOINTEREXTPROC pglVertexWeightPointerEXT; +#define glVertexWeightfEXT pglVertexWeightfEXT +#define glVertexWeightfvEXT pglVertexWeightfvEXT +#define glVertexWeightPointerEXT pglVertexWeightPointerEXT +#endif + +/* GL_NV_light_max_exponent */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#define __GLEE_GL_NV_light_max_exponent 1 +/* Constants */ +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +/* GL_NV_vertex_array_range */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#define __GLEE_GL_NV_vertex_array_range 1 +/* Constants */ +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid * pointer); +GLEE_EXTERN PFNGLFLUSHVERTEXARRAYRANGENVPROC pglFlushVertexArrayRangeNV; +GLEE_EXTERN PFNGLVERTEXARRAYRANGENVPROC pglVertexArrayRangeNV; +#define glFlushVertexArrayRangeNV pglFlushVertexArrayRangeNV +#define glVertexArrayRangeNV pglVertexArrayRangeNV +#endif + +/* GL_NV_register_combiners */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#define __GLEE_GL_NV_register_combiners 1 +/* Constants */ +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint * params); +GLEE_EXTERN PFNGLCOMBINERPARAMETERFVNVPROC pglCombinerParameterfvNV; +GLEE_EXTERN PFNGLCOMBINERPARAMETERFNVPROC pglCombinerParameterfNV; +GLEE_EXTERN PFNGLCOMBINERPARAMETERIVNVPROC pglCombinerParameterivNV; +GLEE_EXTERN PFNGLCOMBINERPARAMETERINVPROC pglCombinerParameteriNV; +GLEE_EXTERN PFNGLCOMBINERINPUTNVPROC pglCombinerInputNV; +GLEE_EXTERN PFNGLCOMBINEROUTPUTNVPROC pglCombinerOutputNV; +GLEE_EXTERN PFNGLFINALCOMBINERINPUTNVPROC pglFinalCombinerInputNV; +GLEE_EXTERN PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC pglGetCombinerInputParameterfvNV; +GLEE_EXTERN PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC pglGetCombinerInputParameterivNV; +GLEE_EXTERN PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC pglGetCombinerOutputParameterfvNV; +GLEE_EXTERN PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC pglGetCombinerOutputParameterivNV; +GLEE_EXTERN PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC pglGetFinalCombinerInputParameterfvNV; +GLEE_EXTERN PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC pglGetFinalCombinerInputParameterivNV; +#define glCombinerParameterfvNV pglCombinerParameterfvNV +#define glCombinerParameterfNV pglCombinerParameterfNV +#define glCombinerParameterivNV pglCombinerParameterivNV +#define glCombinerParameteriNV pglCombinerParameteriNV +#define glCombinerInputNV pglCombinerInputNV +#define glCombinerOutputNV pglCombinerOutputNV +#define glFinalCombinerInputNV pglFinalCombinerInputNV +#define glGetCombinerInputParameterfvNV pglGetCombinerInputParameterfvNV +#define glGetCombinerInputParameterivNV pglGetCombinerInputParameterivNV +#define glGetCombinerOutputParameterfvNV pglGetCombinerOutputParameterfvNV +#define glGetCombinerOutputParameterivNV pglGetCombinerOutputParameterivNV +#define glGetFinalCombinerInputParameterfvNV pglGetFinalCombinerInputParameterfvNV +#define glGetFinalCombinerInputParameterivNV pglGetFinalCombinerInputParameterivNV +#endif + +/* GL_NV_fog_distance */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#define __GLEE_GL_NV_fog_distance 1 +/* Constants */ +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +#endif + +/* GL_NV_texgen_emboss */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#define __GLEE_GL_NV_texgen_emboss 1 +/* Constants */ +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +/* GL_NV_blend_square */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#define __GLEE_GL_NV_blend_square 1 +/* Constants */ +#endif + +/* GL_NV_texture_env_combine4 */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#define __GLEE_GL_NV_texture_env_combine4 1 +/* Constants */ +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +/* GL_MESA_resize_buffers */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#define __GLEE_GL_MESA_resize_buffers 1 +/* Constants */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (); +GLEE_EXTERN PFNGLRESIZEBUFFERSMESAPROC pglResizeBuffersMESA; +#define glResizeBuffersMESA pglResizeBuffersMESA +#endif + +/* GL_MESA_window_pos */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#define __GLEE_GL_MESA_window_pos 1 +/* Constants */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort * v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble * v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat * v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint * v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort * v); +GLEE_EXTERN PFNGLWINDOWPOS2DMESAPROC pglWindowPos2dMESA; +GLEE_EXTERN PFNGLWINDOWPOS2DVMESAPROC pglWindowPos2dvMESA; +GLEE_EXTERN PFNGLWINDOWPOS2FMESAPROC pglWindowPos2fMESA; +GLEE_EXTERN PFNGLWINDOWPOS2FVMESAPROC pglWindowPos2fvMESA; +GLEE_EXTERN PFNGLWINDOWPOS2IMESAPROC pglWindowPos2iMESA; +GLEE_EXTERN PFNGLWINDOWPOS2IVMESAPROC pglWindowPos2ivMESA; +GLEE_EXTERN PFNGLWINDOWPOS2SMESAPROC pglWindowPos2sMESA; +GLEE_EXTERN PFNGLWINDOWPOS2SVMESAPROC pglWindowPos2svMESA; +GLEE_EXTERN PFNGLWINDOWPOS3DMESAPROC pglWindowPos3dMESA; +GLEE_EXTERN PFNGLWINDOWPOS3DVMESAPROC pglWindowPos3dvMESA; +GLEE_EXTERN PFNGLWINDOWPOS3FMESAPROC pglWindowPos3fMESA; +GLEE_EXTERN PFNGLWINDOWPOS3FVMESAPROC pglWindowPos3fvMESA; +GLEE_EXTERN PFNGLWINDOWPOS3IMESAPROC pglWindowPos3iMESA; +GLEE_EXTERN PFNGLWINDOWPOS3IVMESAPROC pglWindowPos3ivMESA; +GLEE_EXTERN PFNGLWINDOWPOS3SMESAPROC pglWindowPos3sMESA; +GLEE_EXTERN PFNGLWINDOWPOS3SVMESAPROC pglWindowPos3svMESA; +GLEE_EXTERN PFNGLWINDOWPOS4DMESAPROC pglWindowPos4dMESA; +GLEE_EXTERN PFNGLWINDOWPOS4DVMESAPROC pglWindowPos4dvMESA; +GLEE_EXTERN PFNGLWINDOWPOS4FMESAPROC pglWindowPos4fMESA; +GLEE_EXTERN PFNGLWINDOWPOS4FVMESAPROC pglWindowPos4fvMESA; +GLEE_EXTERN PFNGLWINDOWPOS4IMESAPROC pglWindowPos4iMESA; +GLEE_EXTERN PFNGLWINDOWPOS4IVMESAPROC pglWindowPos4ivMESA; +GLEE_EXTERN PFNGLWINDOWPOS4SMESAPROC pglWindowPos4sMESA; +GLEE_EXTERN PFNGLWINDOWPOS4SVMESAPROC pglWindowPos4svMESA; +#define glWindowPos2dMESA pglWindowPos2dMESA +#define glWindowPos2dvMESA pglWindowPos2dvMESA +#define glWindowPos2fMESA pglWindowPos2fMESA +#define glWindowPos2fvMESA pglWindowPos2fvMESA +#define glWindowPos2iMESA pglWindowPos2iMESA +#define glWindowPos2ivMESA pglWindowPos2ivMESA +#define glWindowPos2sMESA pglWindowPos2sMESA +#define glWindowPos2svMESA pglWindowPos2svMESA +#define glWindowPos3dMESA pglWindowPos3dMESA +#define glWindowPos3dvMESA pglWindowPos3dvMESA +#define glWindowPos3fMESA pglWindowPos3fMESA +#define glWindowPos3fvMESA pglWindowPos3fvMESA +#define glWindowPos3iMESA pglWindowPos3iMESA +#define glWindowPos3ivMESA pglWindowPos3ivMESA +#define glWindowPos3sMESA pglWindowPos3sMESA +#define glWindowPos3svMESA pglWindowPos3svMESA +#define glWindowPos4dMESA pglWindowPos4dMESA +#define glWindowPos4dvMESA pglWindowPos4dvMESA +#define glWindowPos4fMESA pglWindowPos4fMESA +#define glWindowPos4fvMESA pglWindowPos4fvMESA +#define glWindowPos4iMESA pglWindowPos4iMESA +#define glWindowPos4ivMESA pglWindowPos4ivMESA +#define glWindowPos4sMESA pglWindowPos4sMESA +#define glWindowPos4svMESA pglWindowPos4svMESA +#endif + +/* GL_EXT_texture_compression_s3tc */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#define __GLEE_GL_EXT_texture_compression_s3tc 1 +/* Constants */ +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +/* GL_IBM_cull_vertex */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#define __GLEE_GL_IBM_cull_vertex 1 +/* Constants */ +#define GL_CULL_VERTEX_IBM 103050 +#endif + +/* GL_IBM_multimode_draw_arrays */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#define __GLEE_GL_IBM_multimode_draw_arrays 1 +/* Constants */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid* const * indices, GLsizei primcount, GLint modestride); +GLEE_EXTERN PFNGLMULTIMODEDRAWARRAYSIBMPROC pglMultiModeDrawArraysIBM; +GLEE_EXTERN PFNGLMULTIMODEDRAWELEMENTSIBMPROC pglMultiModeDrawElementsIBM; +#define glMultiModeDrawArraysIBM pglMultiModeDrawArraysIBM +#define glMultiModeDrawElementsIBM pglMultiModeDrawElementsIBM +#endif + +/* GL_IBM_vertex_array_lists */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#define __GLEE_GL_IBM_vertex_array_lists 1 +/* Constants */ +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* * pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* * pointer, GLint ptrstride); +GLEE_EXTERN PFNGLCOLORPOINTERLISTIBMPROC pglColorPointerListIBM; +GLEE_EXTERN PFNGLSECONDARYCOLORPOINTERLISTIBMPROC pglSecondaryColorPointerListIBM; +GLEE_EXTERN PFNGLEDGEFLAGPOINTERLISTIBMPROC pglEdgeFlagPointerListIBM; +GLEE_EXTERN PFNGLFOGCOORDPOINTERLISTIBMPROC pglFogCoordPointerListIBM; +GLEE_EXTERN PFNGLINDEXPOINTERLISTIBMPROC pglIndexPointerListIBM; +GLEE_EXTERN PFNGLNORMALPOINTERLISTIBMPROC pglNormalPointerListIBM; +GLEE_EXTERN PFNGLTEXCOORDPOINTERLISTIBMPROC pglTexCoordPointerListIBM; +GLEE_EXTERN PFNGLVERTEXPOINTERLISTIBMPROC pglVertexPointerListIBM; +#define glColorPointerListIBM pglColorPointerListIBM +#define glSecondaryColorPointerListIBM pglSecondaryColorPointerListIBM +#define glEdgeFlagPointerListIBM pglEdgeFlagPointerListIBM +#define glFogCoordPointerListIBM pglFogCoordPointerListIBM +#define glIndexPointerListIBM pglIndexPointerListIBM +#define glNormalPointerListIBM pglNormalPointerListIBM +#define glTexCoordPointerListIBM pglTexCoordPointerListIBM +#define glVertexPointerListIBM pglVertexPointerListIBM +#endif + +/* GL_SGIX_subsample */ + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#define __GLEE_GL_SGIX_subsample 1 +/* Constants */ +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +/* GL_SGIX_ycrcb_subsample */ + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#define __GLEE_GL_SGIX_ycrcb_subsample 1 +/* Constants */ +#endif + +/* GL_SGIX_ycrcba */ + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#define __GLEE_GL_SGIX_ycrcba 1 +/* Constants */ +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +/* GL_SGI_depth_pass_instrument */ + +#ifndef GL_SGI_depth_pass_instrument +#define GL_SGI_depth_pass_instrument 1 +#define __GLEE_GL_SGI_depth_pass_instrument 1 +/* Constants */ +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +/* GL_3DFX_texture_compression_FXT1 */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#define __GLEE_GL_3DFX_texture_compression_FXT1 1 +/* Constants */ +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +/* GL_3DFX_multisample */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#define __GLEE_GL_3DFX_multisample 1 +/* Constants */ +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +/* GL_3DFX_tbuffer */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#define __GLEE_GL_3DFX_tbuffer 1 +/* Constants */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +GLEE_EXTERN PFNGLTBUFFERMASK3DFXPROC pglTbufferMask3DFX; +#define glTbufferMask3DFX pglTbufferMask3DFX +#endif + +/* GL_EXT_multisample */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#define __GLEE_GL_EXT_multisample 1 +/* Constants */ +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +GLEE_EXTERN PFNGLSAMPLEMASKEXTPROC pglSampleMaskEXT; +GLEE_EXTERN PFNGLSAMPLEPATTERNEXTPROC pglSamplePatternEXT; +#define glSampleMaskEXT pglSampleMaskEXT +#define glSamplePatternEXT pglSamplePatternEXT +#endif + +/* GL_SGIX_vertex_preclip */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#define __GLEE_GL_SGIX_vertex_preclip 1 +/* Constants */ +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +/* GL_SGIX_convolution_accuracy */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#define __GLEE_GL_SGIX_convolution_accuracy 1 +/* Constants */ +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +/* GL_SGIX_resample */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#define __GLEE_GL_SGIX_resample 1 +/* Constants */ +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +/* GL_SGIS_point_line_texgen */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#define __GLEE_GL_SGIS_point_line_texgen 1 +/* Constants */ +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +/* GL_SGIS_texture_color_mask */ + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#define __GLEE_GL_SGIS_texture_color_mask 1 +/* Constants */ +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLEE_EXTERN PFNGLTEXTURECOLORMASKSGISPROC pglTextureColorMaskSGIS; +#define glTextureColorMaskSGIS pglTextureColorMaskSGIS +#endif + +/* GL_EXT_texture_env_dot3 */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#define __GLEE_GL_EXT_texture_env_dot3 1 +/* Constants */ +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +/* GL_ATI_texture_mirror_once */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#define __GLEE_GL_ATI_texture_mirror_once 1 +/* Constants */ +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +/* GL_NV_fence */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#define __GLEE_GL_NV_fence 1 +/* Constants */ +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint * fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint * fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +GLEE_EXTERN PFNGLDELETEFENCESNVPROC pglDeleteFencesNV; +GLEE_EXTERN PFNGLGENFENCESNVPROC pglGenFencesNV; +GLEE_EXTERN PFNGLISFENCENVPROC pglIsFenceNV; +GLEE_EXTERN PFNGLTESTFENCENVPROC pglTestFenceNV; +GLEE_EXTERN PFNGLGETFENCEIVNVPROC pglGetFenceivNV; +GLEE_EXTERN PFNGLFINISHFENCENVPROC pglFinishFenceNV; +GLEE_EXTERN PFNGLSETFENCENVPROC pglSetFenceNV; +#define glDeleteFencesNV pglDeleteFencesNV +#define glGenFencesNV pglGenFencesNV +#define glIsFenceNV pglIsFenceNV +#define glTestFenceNV pglTestFenceNV +#define glGetFenceivNV pglGetFenceivNV +#define glFinishFenceNV pglFinishFenceNV +#define glSetFenceNV pglSetFenceNV +#endif + +/* GL_IBM_texture_mirrored_repeat */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 +#define __GLEE_GL_IBM_texture_mirrored_repeat 1 +/* Constants */ +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +/* GL_NV_evaluators */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#define __GLEE_GL_NV_evaluators 1 +/* Constants */ +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid * points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid * points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +GLEE_EXTERN PFNGLMAPCONTROLPOINTSNVPROC pglMapControlPointsNV; +GLEE_EXTERN PFNGLMAPPARAMETERIVNVPROC pglMapParameterivNV; +GLEE_EXTERN PFNGLMAPPARAMETERFVNVPROC pglMapParameterfvNV; +GLEE_EXTERN PFNGLGETMAPCONTROLPOINTSNVPROC pglGetMapControlPointsNV; +GLEE_EXTERN PFNGLGETMAPPARAMETERIVNVPROC pglGetMapParameterivNV; +GLEE_EXTERN PFNGLGETMAPPARAMETERFVNVPROC pglGetMapParameterfvNV; +GLEE_EXTERN PFNGLGETMAPATTRIBPARAMETERIVNVPROC pglGetMapAttribParameterivNV; +GLEE_EXTERN PFNGLGETMAPATTRIBPARAMETERFVNVPROC pglGetMapAttribParameterfvNV; +GLEE_EXTERN PFNGLEVALMAPSNVPROC pglEvalMapsNV; +#define glMapControlPointsNV pglMapControlPointsNV +#define glMapParameterivNV pglMapParameterivNV +#define glMapParameterfvNV pglMapParameterfvNV +#define glGetMapControlPointsNV pglGetMapControlPointsNV +#define glGetMapParameterivNV pglGetMapParameterivNV +#define glGetMapParameterfvNV pglGetMapParameterfvNV +#define glGetMapAttribParameterivNV pglGetMapAttribParameterivNV +#define glGetMapAttribParameterfvNV pglGetMapAttribParameterfvNV +#define glEvalMapsNV pglEvalMapsNV +#endif + +/* GL_NV_packed_depth_stencil */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#define __GLEE_GL_NV_packed_depth_stencil 1 +/* Constants */ +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +/* GL_NV_register_combiners2 */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#define __GLEE_GL_NV_register_combiners2 1 +/* Constants */ +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat * params); +GLEE_EXTERN PFNGLCOMBINERSTAGEPARAMETERFVNVPROC pglCombinerStageParameterfvNV; +GLEE_EXTERN PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC pglGetCombinerStageParameterfvNV; +#define glCombinerStageParameterfvNV pglCombinerStageParameterfvNV +#define glGetCombinerStageParameterfvNV pglGetCombinerStageParameterfvNV +#endif + +/* GL_NV_texture_compression_vtc */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#define __GLEE_GL_NV_texture_compression_vtc 1 +/* Constants */ +#endif + +/* GL_NV_texture_rectangle */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#define __GLEE_GL_NV_texture_rectangle 1 +/* Constants */ +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +/* GL_NV_texture_shader */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#define __GLEE_GL_NV_texture_shader 1 +/* Constants */ +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +/* GL_NV_texture_shader2 */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#define __GLEE_GL_NV_texture_shader2 1 +/* Constants */ +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +/* GL_NV_vertex_array_range2 */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#define __GLEE_GL_NV_vertex_array_range2 1 +/* Constants */ +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +/* GL_NV_vertex_program */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#define __GLEE_GL_NV_vertex_program 1 +/* Constants */ +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint * programs, GLboolean * residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint * programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat * params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint * programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble * params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte * program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* * pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte * program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble * v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat * v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint * programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte * v); +GLEE_EXTERN PFNGLAREPROGRAMSRESIDENTNVPROC pglAreProgramsResidentNV; +GLEE_EXTERN PFNGLBINDPROGRAMNVPROC pglBindProgramNV; +GLEE_EXTERN PFNGLDELETEPROGRAMSNVPROC pglDeleteProgramsNV; +GLEE_EXTERN PFNGLEXECUTEPROGRAMNVPROC pglExecuteProgramNV; +GLEE_EXTERN PFNGLGENPROGRAMSNVPROC pglGenProgramsNV; +GLEE_EXTERN PFNGLGETPROGRAMPARAMETERDVNVPROC pglGetProgramParameterdvNV; +GLEE_EXTERN PFNGLGETPROGRAMPARAMETERFVNVPROC pglGetProgramParameterfvNV; +GLEE_EXTERN PFNGLGETPROGRAMIVNVPROC pglGetProgramivNV; +GLEE_EXTERN PFNGLGETPROGRAMSTRINGNVPROC pglGetProgramStringNV; +GLEE_EXTERN PFNGLGETTRACKMATRIXIVNVPROC pglGetTrackMatrixivNV; +GLEE_EXTERN PFNGLGETVERTEXATTRIBDVNVPROC pglGetVertexAttribdvNV; +GLEE_EXTERN PFNGLGETVERTEXATTRIBFVNVPROC pglGetVertexAttribfvNV; +GLEE_EXTERN PFNGLGETVERTEXATTRIBIVNVPROC pglGetVertexAttribivNV; +GLEE_EXTERN PFNGLGETVERTEXATTRIBPOINTERVNVPROC pglGetVertexAttribPointervNV; +GLEE_EXTERN PFNGLISPROGRAMNVPROC pglIsProgramNV; +GLEE_EXTERN PFNGLLOADPROGRAMNVPROC pglLoadProgramNV; +GLEE_EXTERN PFNGLPROGRAMPARAMETER4DNVPROC pglProgramParameter4dNV; +GLEE_EXTERN PFNGLPROGRAMPARAMETER4DVNVPROC pglProgramParameter4dvNV; +GLEE_EXTERN PFNGLPROGRAMPARAMETER4FNVPROC pglProgramParameter4fNV; +GLEE_EXTERN PFNGLPROGRAMPARAMETER4FVNVPROC pglProgramParameter4fvNV; +GLEE_EXTERN PFNGLPROGRAMPARAMETERS4DVNVPROC pglProgramParameters4dvNV; +GLEE_EXTERN PFNGLPROGRAMPARAMETERS4FVNVPROC pglProgramParameters4fvNV; +GLEE_EXTERN PFNGLREQUESTRESIDENTPROGRAMSNVPROC pglRequestResidentProgramsNV; +GLEE_EXTERN PFNGLTRACKMATRIXNVPROC pglTrackMatrixNV; +GLEE_EXTERN PFNGLVERTEXATTRIBPOINTERNVPROC pglVertexAttribPointerNV; +GLEE_EXTERN PFNGLVERTEXATTRIB1DNVPROC pglVertexAttrib1dNV; +GLEE_EXTERN PFNGLVERTEXATTRIB1DVNVPROC pglVertexAttrib1dvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB1FNVPROC pglVertexAttrib1fNV; +GLEE_EXTERN PFNGLVERTEXATTRIB1FVNVPROC pglVertexAttrib1fvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB1SNVPROC pglVertexAttrib1sNV; +GLEE_EXTERN PFNGLVERTEXATTRIB1SVNVPROC pglVertexAttrib1svNV; +GLEE_EXTERN PFNGLVERTEXATTRIB2DNVPROC pglVertexAttrib2dNV; +GLEE_EXTERN PFNGLVERTEXATTRIB2DVNVPROC pglVertexAttrib2dvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB2FNVPROC pglVertexAttrib2fNV; +GLEE_EXTERN PFNGLVERTEXATTRIB2FVNVPROC pglVertexAttrib2fvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB2SNVPROC pglVertexAttrib2sNV; +GLEE_EXTERN PFNGLVERTEXATTRIB2SVNVPROC pglVertexAttrib2svNV; +GLEE_EXTERN PFNGLVERTEXATTRIB3DNVPROC pglVertexAttrib3dNV; +GLEE_EXTERN PFNGLVERTEXATTRIB3DVNVPROC pglVertexAttrib3dvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB3FNVPROC pglVertexAttrib3fNV; +GLEE_EXTERN PFNGLVERTEXATTRIB3FVNVPROC pglVertexAttrib3fvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB3SNVPROC pglVertexAttrib3sNV; +GLEE_EXTERN PFNGLVERTEXATTRIB3SVNVPROC pglVertexAttrib3svNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4DNVPROC pglVertexAttrib4dNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4DVNVPROC pglVertexAttrib4dvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4FNVPROC pglVertexAttrib4fNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4FVNVPROC pglVertexAttrib4fvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4SNVPROC pglVertexAttrib4sNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4SVNVPROC pglVertexAttrib4svNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4UBNVPROC pglVertexAttrib4ubNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4UBVNVPROC pglVertexAttrib4ubvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS1DVNVPROC pglVertexAttribs1dvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS1FVNVPROC pglVertexAttribs1fvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS1SVNVPROC pglVertexAttribs1svNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS2DVNVPROC pglVertexAttribs2dvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS2FVNVPROC pglVertexAttribs2fvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS2SVNVPROC pglVertexAttribs2svNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS3DVNVPROC pglVertexAttribs3dvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS3FVNVPROC pglVertexAttribs3fvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS3SVNVPROC pglVertexAttribs3svNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS4DVNVPROC pglVertexAttribs4dvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS4FVNVPROC pglVertexAttribs4fvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS4SVNVPROC pglVertexAttribs4svNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS4UBVNVPROC pglVertexAttribs4ubvNV; +#define glAreProgramsResidentNV pglAreProgramsResidentNV +#define glBindProgramNV pglBindProgramNV +#define glDeleteProgramsNV pglDeleteProgramsNV +#define glExecuteProgramNV pglExecuteProgramNV +#define glGenProgramsNV pglGenProgramsNV +#define glGetProgramParameterdvNV pglGetProgramParameterdvNV +#define glGetProgramParameterfvNV pglGetProgramParameterfvNV +#define glGetProgramivNV pglGetProgramivNV +#define glGetProgramStringNV pglGetProgramStringNV +#define glGetTrackMatrixivNV pglGetTrackMatrixivNV +#define glGetVertexAttribdvNV pglGetVertexAttribdvNV +#define glGetVertexAttribfvNV pglGetVertexAttribfvNV +#define glGetVertexAttribivNV pglGetVertexAttribivNV +#define glGetVertexAttribPointervNV pglGetVertexAttribPointervNV +#define glIsProgramNV pglIsProgramNV +#define glLoadProgramNV pglLoadProgramNV +#define glProgramParameter4dNV pglProgramParameter4dNV +#define glProgramParameter4dvNV pglProgramParameter4dvNV +#define glProgramParameter4fNV pglProgramParameter4fNV +#define glProgramParameter4fvNV pglProgramParameter4fvNV +#define glProgramParameters4dvNV pglProgramParameters4dvNV +#define glProgramParameters4fvNV pglProgramParameters4fvNV +#define glRequestResidentProgramsNV pglRequestResidentProgramsNV +#define glTrackMatrixNV pglTrackMatrixNV +#define glVertexAttribPointerNV pglVertexAttribPointerNV +#define glVertexAttrib1dNV pglVertexAttrib1dNV +#define glVertexAttrib1dvNV pglVertexAttrib1dvNV +#define glVertexAttrib1fNV pglVertexAttrib1fNV +#define glVertexAttrib1fvNV pglVertexAttrib1fvNV +#define glVertexAttrib1sNV pglVertexAttrib1sNV +#define glVertexAttrib1svNV pglVertexAttrib1svNV +#define glVertexAttrib2dNV pglVertexAttrib2dNV +#define glVertexAttrib2dvNV pglVertexAttrib2dvNV +#define glVertexAttrib2fNV pglVertexAttrib2fNV +#define glVertexAttrib2fvNV pglVertexAttrib2fvNV +#define glVertexAttrib2sNV pglVertexAttrib2sNV +#define glVertexAttrib2svNV pglVertexAttrib2svNV +#define glVertexAttrib3dNV pglVertexAttrib3dNV +#define glVertexAttrib3dvNV pglVertexAttrib3dvNV +#define glVertexAttrib3fNV pglVertexAttrib3fNV +#define glVertexAttrib3fvNV pglVertexAttrib3fvNV +#define glVertexAttrib3sNV pglVertexAttrib3sNV +#define glVertexAttrib3svNV pglVertexAttrib3svNV +#define glVertexAttrib4dNV pglVertexAttrib4dNV +#define glVertexAttrib4dvNV pglVertexAttrib4dvNV +#define glVertexAttrib4fNV pglVertexAttrib4fNV +#define glVertexAttrib4fvNV pglVertexAttrib4fvNV +#define glVertexAttrib4sNV pglVertexAttrib4sNV +#define glVertexAttrib4svNV pglVertexAttrib4svNV +#define glVertexAttrib4ubNV pglVertexAttrib4ubNV +#define glVertexAttrib4ubvNV pglVertexAttrib4ubvNV +#define glVertexAttribs1dvNV pglVertexAttribs1dvNV +#define glVertexAttribs1fvNV pglVertexAttribs1fvNV +#define glVertexAttribs1svNV pglVertexAttribs1svNV +#define glVertexAttribs2dvNV pglVertexAttribs2dvNV +#define glVertexAttribs2fvNV pglVertexAttribs2fvNV +#define glVertexAttribs2svNV pglVertexAttribs2svNV +#define glVertexAttribs3dvNV pglVertexAttribs3dvNV +#define glVertexAttribs3fvNV pglVertexAttribs3fvNV +#define glVertexAttribs3svNV pglVertexAttribs3svNV +#define glVertexAttribs4dvNV pglVertexAttribs4dvNV +#define glVertexAttribs4fvNV pglVertexAttribs4fvNV +#define glVertexAttribs4svNV pglVertexAttribs4svNV +#define glVertexAttribs4ubvNV pglVertexAttribs4ubvNV +#endif + +/* GL_SGIX_texture_coordinate_clamp */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#define __GLEE_GL_SGIX_texture_coordinate_clamp 1 +/* Constants */ +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +/* GL_SGIX_scalebias_hint */ + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#define __GLEE_GL_SGIX_scalebias_hint 1 +/* Constants */ +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +/* GL_OML_interlace */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#define __GLEE_GL_OML_interlace 1 +/* Constants */ +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +/* GL_OML_subsample */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#define __GLEE_GL_OML_subsample 1 +/* Constants */ +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +/* GL_OML_resample */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#define __GLEE_GL_OML_resample 1 +/* Constants */ +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +/* GL_NV_copy_depth_to_color */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#define __GLEE_GL_NV_copy_depth_to_color 1 +/* Constants */ +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +/* GL_ATI_envmap_bumpmap */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#define __GLEE_GL_ATI_envmap_bumpmap 1 +/* Constants */ +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint * param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat * param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint * param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat * param); +GLEE_EXTERN PFNGLTEXBUMPPARAMETERIVATIPROC pglTexBumpParameterivATI; +GLEE_EXTERN PFNGLTEXBUMPPARAMETERFVATIPROC pglTexBumpParameterfvATI; +GLEE_EXTERN PFNGLGETTEXBUMPPARAMETERIVATIPROC pglGetTexBumpParameterivATI; +GLEE_EXTERN PFNGLGETTEXBUMPPARAMETERFVATIPROC pglGetTexBumpParameterfvATI; +#define glTexBumpParameterivATI pglTexBumpParameterivATI +#define glTexBumpParameterfvATI pglTexBumpParameterfvATI +#define glGetTexBumpParameterivATI pglGetTexBumpParameterivATI +#define glGetTexBumpParameterfvATI pglGetTexBumpParameterfvATI +#endif + +/* GL_ATI_fragment_shader */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#define __GLEE_GL_ATI_fragment_shader 1 +/* Constants */ +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat * value); +GLEE_EXTERN PFNGLGENFRAGMENTSHADERSATIPROC pglGenFragmentShadersATI; +GLEE_EXTERN PFNGLBINDFRAGMENTSHADERATIPROC pglBindFragmentShaderATI; +GLEE_EXTERN PFNGLDELETEFRAGMENTSHADERATIPROC pglDeleteFragmentShaderATI; +GLEE_EXTERN PFNGLBEGINFRAGMENTSHADERATIPROC pglBeginFragmentShaderATI; +GLEE_EXTERN PFNGLENDFRAGMENTSHADERATIPROC pglEndFragmentShaderATI; +GLEE_EXTERN PFNGLPASSTEXCOORDATIPROC pglPassTexCoordATI; +GLEE_EXTERN PFNGLSAMPLEMAPATIPROC pglSampleMapATI; +GLEE_EXTERN PFNGLCOLORFRAGMENTOP1ATIPROC pglColorFragmentOp1ATI; +GLEE_EXTERN PFNGLCOLORFRAGMENTOP2ATIPROC pglColorFragmentOp2ATI; +GLEE_EXTERN PFNGLCOLORFRAGMENTOP3ATIPROC pglColorFragmentOp3ATI; +GLEE_EXTERN PFNGLALPHAFRAGMENTOP1ATIPROC pglAlphaFragmentOp1ATI; +GLEE_EXTERN PFNGLALPHAFRAGMENTOP2ATIPROC pglAlphaFragmentOp2ATI; +GLEE_EXTERN PFNGLALPHAFRAGMENTOP3ATIPROC pglAlphaFragmentOp3ATI; +GLEE_EXTERN PFNGLSETFRAGMENTSHADERCONSTANTATIPROC pglSetFragmentShaderConstantATI; +#define glGenFragmentShadersATI pglGenFragmentShadersATI +#define glBindFragmentShaderATI pglBindFragmentShaderATI +#define glDeleteFragmentShaderATI pglDeleteFragmentShaderATI +#define glBeginFragmentShaderATI pglBeginFragmentShaderATI +#define glEndFragmentShaderATI pglEndFragmentShaderATI +#define glPassTexCoordATI pglPassTexCoordATI +#define glSampleMapATI pglSampleMapATI +#define glColorFragmentOp1ATI pglColorFragmentOp1ATI +#define glColorFragmentOp2ATI pglColorFragmentOp2ATI +#define glColorFragmentOp3ATI pglColorFragmentOp3ATI +#define glAlphaFragmentOp1ATI pglAlphaFragmentOp1ATI +#define glAlphaFragmentOp2ATI pglAlphaFragmentOp2ATI +#define glAlphaFragmentOp3ATI pglAlphaFragmentOp3ATI +#define glSetFragmentShaderConstantATI pglSetFragmentShaderConstantATI +#endif + +/* GL_ATI_pn_triangles */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#define __GLEE_GL_ATI_pn_triangles 1 +/* Constants */ +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +GLEE_EXTERN PFNGLPNTRIANGLESIATIPROC pglPNTrianglesiATI; +GLEE_EXTERN PFNGLPNTRIANGLESFATIPROC pglPNTrianglesfATI; +#define glPNTrianglesiATI pglPNTrianglesiATI +#define glPNTrianglesfATI pglPNTrianglesfATI +#endif + +/* GL_ATI_vertex_array_object */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#define __GLEE_GL_ATI_vertex_array_object 1 +/* Constants */ +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid * pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid * pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint * params); +GLEE_EXTERN PFNGLNEWOBJECTBUFFERATIPROC pglNewObjectBufferATI; +GLEE_EXTERN PFNGLISOBJECTBUFFERATIPROC pglIsObjectBufferATI; +GLEE_EXTERN PFNGLUPDATEOBJECTBUFFERATIPROC pglUpdateObjectBufferATI; +GLEE_EXTERN PFNGLGETOBJECTBUFFERFVATIPROC pglGetObjectBufferfvATI; +GLEE_EXTERN PFNGLGETOBJECTBUFFERIVATIPROC pglGetObjectBufferivATI; +GLEE_EXTERN PFNGLFREEOBJECTBUFFERATIPROC pglFreeObjectBufferATI; +GLEE_EXTERN PFNGLARRAYOBJECTATIPROC pglArrayObjectATI; +GLEE_EXTERN PFNGLGETARRAYOBJECTFVATIPROC pglGetArrayObjectfvATI; +GLEE_EXTERN PFNGLGETARRAYOBJECTIVATIPROC pglGetArrayObjectivATI; +GLEE_EXTERN PFNGLVARIANTARRAYOBJECTATIPROC pglVariantArrayObjectATI; +GLEE_EXTERN PFNGLGETVARIANTARRAYOBJECTFVATIPROC pglGetVariantArrayObjectfvATI; +GLEE_EXTERN PFNGLGETVARIANTARRAYOBJECTIVATIPROC pglGetVariantArrayObjectivATI; +#define glNewObjectBufferATI pglNewObjectBufferATI +#define glIsObjectBufferATI pglIsObjectBufferATI +#define glUpdateObjectBufferATI pglUpdateObjectBufferATI +#define glGetObjectBufferfvATI pglGetObjectBufferfvATI +#define glGetObjectBufferivATI pglGetObjectBufferivATI +#define glFreeObjectBufferATI pglFreeObjectBufferATI +#define glArrayObjectATI pglArrayObjectATI +#define glGetArrayObjectfvATI pglGetArrayObjectfvATI +#define glGetArrayObjectivATI pglGetArrayObjectivATI +#define glVariantArrayObjectATI pglVariantArrayObjectATI +#define glGetVariantArrayObjectfvATI pglGetVariantArrayObjectfvATI +#define glGetVariantArrayObjectivATI pglGetVariantArrayObjectivATI +#endif + +/* GL_EXT_vertex_shader */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#define __GLEE_GL_EXT_vertex_shader 1 +/* Constants */ +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid * addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid * addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte * addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort * addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint * addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat * addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble * addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte * addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort * addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint * addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid * addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean * data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint * data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat * data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* * data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean * data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint * data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat * data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean * data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint * data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat * data); +GLEE_EXTERN PFNGLBEGINVERTEXSHADEREXTPROC pglBeginVertexShaderEXT; +GLEE_EXTERN PFNGLENDVERTEXSHADEREXTPROC pglEndVertexShaderEXT; +GLEE_EXTERN PFNGLBINDVERTEXSHADEREXTPROC pglBindVertexShaderEXT; +GLEE_EXTERN PFNGLGENVERTEXSHADERSEXTPROC pglGenVertexShadersEXT; +GLEE_EXTERN PFNGLDELETEVERTEXSHADEREXTPROC pglDeleteVertexShaderEXT; +GLEE_EXTERN PFNGLSHADEROP1EXTPROC pglShaderOp1EXT; +GLEE_EXTERN PFNGLSHADEROP2EXTPROC pglShaderOp2EXT; +GLEE_EXTERN PFNGLSHADEROP3EXTPROC pglShaderOp3EXT; +GLEE_EXTERN PFNGLSWIZZLEEXTPROC pglSwizzleEXT; +GLEE_EXTERN PFNGLWRITEMASKEXTPROC pglWriteMaskEXT; +GLEE_EXTERN PFNGLINSERTCOMPONENTEXTPROC pglInsertComponentEXT; +GLEE_EXTERN PFNGLEXTRACTCOMPONENTEXTPROC pglExtractComponentEXT; +GLEE_EXTERN PFNGLGENSYMBOLSEXTPROC pglGenSymbolsEXT; +GLEE_EXTERN PFNGLSETINVARIANTEXTPROC pglSetInvariantEXT; +GLEE_EXTERN PFNGLSETLOCALCONSTANTEXTPROC pglSetLocalConstantEXT; +GLEE_EXTERN PFNGLVARIANTBVEXTPROC pglVariantbvEXT; +GLEE_EXTERN PFNGLVARIANTSVEXTPROC pglVariantsvEXT; +GLEE_EXTERN PFNGLVARIANTIVEXTPROC pglVariantivEXT; +GLEE_EXTERN PFNGLVARIANTFVEXTPROC pglVariantfvEXT; +GLEE_EXTERN PFNGLVARIANTDVEXTPROC pglVariantdvEXT; +GLEE_EXTERN PFNGLVARIANTUBVEXTPROC pglVariantubvEXT; +GLEE_EXTERN PFNGLVARIANTUSVEXTPROC pglVariantusvEXT; +GLEE_EXTERN PFNGLVARIANTUIVEXTPROC pglVariantuivEXT; +GLEE_EXTERN PFNGLVARIANTPOINTEREXTPROC pglVariantPointerEXT; +GLEE_EXTERN PFNGLENABLEVARIANTCLIENTSTATEEXTPROC pglEnableVariantClientStateEXT; +GLEE_EXTERN PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC pglDisableVariantClientStateEXT; +GLEE_EXTERN PFNGLBINDLIGHTPARAMETEREXTPROC pglBindLightParameterEXT; +GLEE_EXTERN PFNGLBINDMATERIALPARAMETEREXTPROC pglBindMaterialParameterEXT; +GLEE_EXTERN PFNGLBINDTEXGENPARAMETEREXTPROC pglBindTexGenParameterEXT; +GLEE_EXTERN PFNGLBINDTEXTUREUNITPARAMETEREXTPROC pglBindTextureUnitParameterEXT; +GLEE_EXTERN PFNGLBINDPARAMETEREXTPROC pglBindParameterEXT; +GLEE_EXTERN PFNGLISVARIANTENABLEDEXTPROC pglIsVariantEnabledEXT; +GLEE_EXTERN PFNGLGETVARIANTBOOLEANVEXTPROC pglGetVariantBooleanvEXT; +GLEE_EXTERN PFNGLGETVARIANTINTEGERVEXTPROC pglGetVariantIntegervEXT; +GLEE_EXTERN PFNGLGETVARIANTFLOATVEXTPROC pglGetVariantFloatvEXT; +GLEE_EXTERN PFNGLGETVARIANTPOINTERVEXTPROC pglGetVariantPointervEXT; +GLEE_EXTERN PFNGLGETINVARIANTBOOLEANVEXTPROC pglGetInvariantBooleanvEXT; +GLEE_EXTERN PFNGLGETINVARIANTINTEGERVEXTPROC pglGetInvariantIntegervEXT; +GLEE_EXTERN PFNGLGETINVARIANTFLOATVEXTPROC pglGetInvariantFloatvEXT; +GLEE_EXTERN PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC pglGetLocalConstantBooleanvEXT; +GLEE_EXTERN PFNGLGETLOCALCONSTANTINTEGERVEXTPROC pglGetLocalConstantIntegervEXT; +GLEE_EXTERN PFNGLGETLOCALCONSTANTFLOATVEXTPROC pglGetLocalConstantFloatvEXT; +#define glBeginVertexShaderEXT pglBeginVertexShaderEXT +#define glEndVertexShaderEXT pglEndVertexShaderEXT +#define glBindVertexShaderEXT pglBindVertexShaderEXT +#define glGenVertexShadersEXT pglGenVertexShadersEXT +#define glDeleteVertexShaderEXT pglDeleteVertexShaderEXT +#define glShaderOp1EXT pglShaderOp1EXT +#define glShaderOp2EXT pglShaderOp2EXT +#define glShaderOp3EXT pglShaderOp3EXT +#define glSwizzleEXT pglSwizzleEXT +#define glWriteMaskEXT pglWriteMaskEXT +#define glInsertComponentEXT pglInsertComponentEXT +#define glExtractComponentEXT pglExtractComponentEXT +#define glGenSymbolsEXT pglGenSymbolsEXT +#define glSetInvariantEXT pglSetInvariantEXT +#define glSetLocalConstantEXT pglSetLocalConstantEXT +#define glVariantbvEXT pglVariantbvEXT +#define glVariantsvEXT pglVariantsvEXT +#define glVariantivEXT pglVariantivEXT +#define glVariantfvEXT pglVariantfvEXT +#define glVariantdvEXT pglVariantdvEXT +#define glVariantubvEXT pglVariantubvEXT +#define glVariantusvEXT pglVariantusvEXT +#define glVariantuivEXT pglVariantuivEXT +#define glVariantPointerEXT pglVariantPointerEXT +#define glEnableVariantClientStateEXT pglEnableVariantClientStateEXT +#define glDisableVariantClientStateEXT pglDisableVariantClientStateEXT +#define glBindLightParameterEXT pglBindLightParameterEXT +#define glBindMaterialParameterEXT pglBindMaterialParameterEXT +#define glBindTexGenParameterEXT pglBindTexGenParameterEXT +#define glBindTextureUnitParameterEXT pglBindTextureUnitParameterEXT +#define glBindParameterEXT pglBindParameterEXT +#define glIsVariantEnabledEXT pglIsVariantEnabledEXT +#define glGetVariantBooleanvEXT pglGetVariantBooleanvEXT +#define glGetVariantIntegervEXT pglGetVariantIntegervEXT +#define glGetVariantFloatvEXT pglGetVariantFloatvEXT +#define glGetVariantPointervEXT pglGetVariantPointervEXT +#define glGetInvariantBooleanvEXT pglGetInvariantBooleanvEXT +#define glGetInvariantIntegervEXT pglGetInvariantIntegervEXT +#define glGetInvariantFloatvEXT pglGetInvariantFloatvEXT +#define glGetLocalConstantBooleanvEXT pglGetLocalConstantBooleanvEXT +#define glGetLocalConstantIntegervEXT pglGetLocalConstantIntegervEXT +#define glGetLocalConstantFloatvEXT pglGetLocalConstantFloatvEXT +#endif + +/* GL_ATI_vertex_streams */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#define __GLEE_GL_ATI_vertex_streams 1 +/* Constants */ +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat * coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble * coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte * coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort * coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint * coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat * coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble * coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +GLEE_EXTERN PFNGLVERTEXSTREAM1SATIPROC pglVertexStream1sATI; +GLEE_EXTERN PFNGLVERTEXSTREAM1SVATIPROC pglVertexStream1svATI; +GLEE_EXTERN PFNGLVERTEXSTREAM1IATIPROC pglVertexStream1iATI; +GLEE_EXTERN PFNGLVERTEXSTREAM1IVATIPROC pglVertexStream1ivATI; +GLEE_EXTERN PFNGLVERTEXSTREAM1FATIPROC pglVertexStream1fATI; +GLEE_EXTERN PFNGLVERTEXSTREAM1FVATIPROC pglVertexStream1fvATI; +GLEE_EXTERN PFNGLVERTEXSTREAM1DATIPROC pglVertexStream1dATI; +GLEE_EXTERN PFNGLVERTEXSTREAM1DVATIPROC pglVertexStream1dvATI; +GLEE_EXTERN PFNGLVERTEXSTREAM2SATIPROC pglVertexStream2sATI; +GLEE_EXTERN PFNGLVERTEXSTREAM2SVATIPROC pglVertexStream2svATI; +GLEE_EXTERN PFNGLVERTEXSTREAM2IATIPROC pglVertexStream2iATI; +GLEE_EXTERN PFNGLVERTEXSTREAM2IVATIPROC pglVertexStream2ivATI; +GLEE_EXTERN PFNGLVERTEXSTREAM2FATIPROC pglVertexStream2fATI; +GLEE_EXTERN PFNGLVERTEXSTREAM2FVATIPROC pglVertexStream2fvATI; +GLEE_EXTERN PFNGLVERTEXSTREAM2DATIPROC pglVertexStream2dATI; +GLEE_EXTERN PFNGLVERTEXSTREAM2DVATIPROC pglVertexStream2dvATI; +GLEE_EXTERN PFNGLVERTEXSTREAM3SATIPROC pglVertexStream3sATI; +GLEE_EXTERN PFNGLVERTEXSTREAM3SVATIPROC pglVertexStream3svATI; +GLEE_EXTERN PFNGLVERTEXSTREAM3IATIPROC pglVertexStream3iATI; +GLEE_EXTERN PFNGLVERTEXSTREAM3IVATIPROC pglVertexStream3ivATI; +GLEE_EXTERN PFNGLVERTEXSTREAM3FATIPROC pglVertexStream3fATI; +GLEE_EXTERN PFNGLVERTEXSTREAM3FVATIPROC pglVertexStream3fvATI; +GLEE_EXTERN PFNGLVERTEXSTREAM3DATIPROC pglVertexStream3dATI; +GLEE_EXTERN PFNGLVERTEXSTREAM3DVATIPROC pglVertexStream3dvATI; +GLEE_EXTERN PFNGLVERTEXSTREAM4SATIPROC pglVertexStream4sATI; +GLEE_EXTERN PFNGLVERTEXSTREAM4SVATIPROC pglVertexStream4svATI; +GLEE_EXTERN PFNGLVERTEXSTREAM4IATIPROC pglVertexStream4iATI; +GLEE_EXTERN PFNGLVERTEXSTREAM4IVATIPROC pglVertexStream4ivATI; +GLEE_EXTERN PFNGLVERTEXSTREAM4FATIPROC pglVertexStream4fATI; +GLEE_EXTERN PFNGLVERTEXSTREAM4FVATIPROC pglVertexStream4fvATI; +GLEE_EXTERN PFNGLVERTEXSTREAM4DATIPROC pglVertexStream4dATI; +GLEE_EXTERN PFNGLVERTEXSTREAM4DVATIPROC pglVertexStream4dvATI; +GLEE_EXTERN PFNGLNORMALSTREAM3BATIPROC pglNormalStream3bATI; +GLEE_EXTERN PFNGLNORMALSTREAM3BVATIPROC pglNormalStream3bvATI; +GLEE_EXTERN PFNGLNORMALSTREAM3SATIPROC pglNormalStream3sATI; +GLEE_EXTERN PFNGLNORMALSTREAM3SVATIPROC pglNormalStream3svATI; +GLEE_EXTERN PFNGLNORMALSTREAM3IATIPROC pglNormalStream3iATI; +GLEE_EXTERN PFNGLNORMALSTREAM3IVATIPROC pglNormalStream3ivATI; +GLEE_EXTERN PFNGLNORMALSTREAM3FATIPROC pglNormalStream3fATI; +GLEE_EXTERN PFNGLNORMALSTREAM3FVATIPROC pglNormalStream3fvATI; +GLEE_EXTERN PFNGLNORMALSTREAM3DATIPROC pglNormalStream3dATI; +GLEE_EXTERN PFNGLNORMALSTREAM3DVATIPROC pglNormalStream3dvATI; +GLEE_EXTERN PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC pglClientActiveVertexStreamATI; +GLEE_EXTERN PFNGLVERTEXBLENDENVIATIPROC pglVertexBlendEnviATI; +GLEE_EXTERN PFNGLVERTEXBLENDENVFATIPROC pglVertexBlendEnvfATI; +#define glVertexStream1sATI pglVertexStream1sATI +#define glVertexStream1svATI pglVertexStream1svATI +#define glVertexStream1iATI pglVertexStream1iATI +#define glVertexStream1ivATI pglVertexStream1ivATI +#define glVertexStream1fATI pglVertexStream1fATI +#define glVertexStream1fvATI pglVertexStream1fvATI +#define glVertexStream1dATI pglVertexStream1dATI +#define glVertexStream1dvATI pglVertexStream1dvATI +#define glVertexStream2sATI pglVertexStream2sATI +#define glVertexStream2svATI pglVertexStream2svATI +#define glVertexStream2iATI pglVertexStream2iATI +#define glVertexStream2ivATI pglVertexStream2ivATI +#define glVertexStream2fATI pglVertexStream2fATI +#define glVertexStream2fvATI pglVertexStream2fvATI +#define glVertexStream2dATI pglVertexStream2dATI +#define glVertexStream2dvATI pglVertexStream2dvATI +#define glVertexStream3sATI pglVertexStream3sATI +#define glVertexStream3svATI pglVertexStream3svATI +#define glVertexStream3iATI pglVertexStream3iATI +#define glVertexStream3ivATI pglVertexStream3ivATI +#define glVertexStream3fATI pglVertexStream3fATI +#define glVertexStream3fvATI pglVertexStream3fvATI +#define glVertexStream3dATI pglVertexStream3dATI +#define glVertexStream3dvATI pglVertexStream3dvATI +#define glVertexStream4sATI pglVertexStream4sATI +#define glVertexStream4svATI pglVertexStream4svATI +#define glVertexStream4iATI pglVertexStream4iATI +#define glVertexStream4ivATI pglVertexStream4ivATI +#define glVertexStream4fATI pglVertexStream4fATI +#define glVertexStream4fvATI pglVertexStream4fvATI +#define glVertexStream4dATI pglVertexStream4dATI +#define glVertexStream4dvATI pglVertexStream4dvATI +#define glNormalStream3bATI pglNormalStream3bATI +#define glNormalStream3bvATI pglNormalStream3bvATI +#define glNormalStream3sATI pglNormalStream3sATI +#define glNormalStream3svATI pglNormalStream3svATI +#define glNormalStream3iATI pglNormalStream3iATI +#define glNormalStream3ivATI pglNormalStream3ivATI +#define glNormalStream3fATI pglNormalStream3fATI +#define glNormalStream3fvATI pglNormalStream3fvATI +#define glNormalStream3dATI pglNormalStream3dATI +#define glNormalStream3dvATI pglNormalStream3dvATI +#define glClientActiveVertexStreamATI pglClientActiveVertexStreamATI +#define glVertexBlendEnviATI pglVertexBlendEnviATI +#define glVertexBlendEnvfATI pglVertexBlendEnvfATI +#endif + +/* GL_ATI_element_array */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#define __GLEE_GL_ATI_element_array 1 +/* Constants */ +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +GLEE_EXTERN PFNGLELEMENTPOINTERATIPROC pglElementPointerATI; +GLEE_EXTERN PFNGLDRAWELEMENTARRAYATIPROC pglDrawElementArrayATI; +GLEE_EXTERN PFNGLDRAWRANGEELEMENTARRAYATIPROC pglDrawRangeElementArrayATI; +#define glElementPointerATI pglElementPointerATI +#define glDrawElementArrayATI pglDrawElementArrayATI +#define glDrawRangeElementArrayATI pglDrawRangeElementArrayATI +#endif + +/* GL_SUN_mesh_array */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#define __GLEE_GL_SUN_mesh_array 1 +/* Constants */ +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +GLEE_EXTERN PFNGLDRAWMESHARRAYSSUNPROC pglDrawMeshArraysSUN; +#define glDrawMeshArraysSUN pglDrawMeshArraysSUN +#endif + +/* GL_SUN_slice_accum */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#define __GLEE_GL_SUN_slice_accum 1 +/* Constants */ +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +/* GL_NV_multisample_filter_hint */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#define __GLEE_GL_NV_multisample_filter_hint 1 +/* Constants */ +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +/* GL_NV_depth_clamp */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#define __GLEE_GL_NV_depth_clamp 1 +/* Constants */ +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +/* GL_NV_occlusion_query */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#define __GLEE_GL_NV_occlusion_query 1 +/* Constants */ +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint * ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint * ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint * params); +GLEE_EXTERN PFNGLGENOCCLUSIONQUERIESNVPROC pglGenOcclusionQueriesNV; +GLEE_EXTERN PFNGLDELETEOCCLUSIONQUERIESNVPROC pglDeleteOcclusionQueriesNV; +GLEE_EXTERN PFNGLISOCCLUSIONQUERYNVPROC pglIsOcclusionQueryNV; +GLEE_EXTERN PFNGLBEGINOCCLUSIONQUERYNVPROC pglBeginOcclusionQueryNV; +GLEE_EXTERN PFNGLENDOCCLUSIONQUERYNVPROC pglEndOcclusionQueryNV; +GLEE_EXTERN PFNGLGETOCCLUSIONQUERYIVNVPROC pglGetOcclusionQueryivNV; +GLEE_EXTERN PFNGLGETOCCLUSIONQUERYUIVNVPROC pglGetOcclusionQueryuivNV; +#define glGenOcclusionQueriesNV pglGenOcclusionQueriesNV +#define glDeleteOcclusionQueriesNV pglDeleteOcclusionQueriesNV +#define glIsOcclusionQueryNV pglIsOcclusionQueryNV +#define glBeginOcclusionQueryNV pglBeginOcclusionQueryNV +#define glEndOcclusionQueryNV pglEndOcclusionQueryNV +#define glGetOcclusionQueryivNV pglGetOcclusionQueryivNV +#define glGetOcclusionQueryuivNV pglGetOcclusionQueryuivNV +#endif + +/* GL_NV_point_sprite */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#define __GLEE_GL_NV_point_sprite 1 +/* Constants */ +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint * params); +GLEE_EXTERN PFNGLPOINTPARAMETERINVPROC pglPointParameteriNV; +GLEE_EXTERN PFNGLPOINTPARAMETERIVNVPROC pglPointParameterivNV; +#define glPointParameteriNV pglPointParameteriNV +#define glPointParameterivNV pglPointParameterivNV +#endif + +/* GL_NV_texture_shader3 */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#define __GLEE_GL_NV_texture_shader3 1 +/* Constants */ +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +/* GL_NV_vertex_program1_1 */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#define __GLEE_GL_NV_vertex_program1_1 1 +/* Constants */ +#endif + +/* GL_EXT_shadow_funcs */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#define __GLEE_GL_EXT_shadow_funcs 1 +/* Constants */ +#endif + +/* GL_EXT_stencil_two_side */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#define __GLEE_GL_EXT_stencil_two_side 1 +/* Constants */ +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +GLEE_EXTERN PFNGLACTIVESTENCILFACEEXTPROC pglActiveStencilFaceEXT; +#define glActiveStencilFaceEXT pglActiveStencilFaceEXT +#endif + +/* GL_ATI_text_fragment_shader */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#define __GLEE_GL_ATI_text_fragment_shader 1 +/* Constants */ +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +/* GL_APPLE_client_storage */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#define __GLEE_GL_APPLE_client_storage 1 +/* Constants */ +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +/* GL_APPLE_element_array */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#define __GLEE_GL_APPLE_element_array 1 +/* Constants */ +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint * first, const GLsizei * count, GLsizei primcount); +GLEE_EXTERN PFNGLELEMENTPOINTERAPPLEPROC pglElementPointerAPPLE; +GLEE_EXTERN PFNGLDRAWELEMENTARRAYAPPLEPROC pglDrawElementArrayAPPLE; +GLEE_EXTERN PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC pglDrawRangeElementArrayAPPLE; +GLEE_EXTERN PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC pglMultiDrawElementArrayAPPLE; +GLEE_EXTERN PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC pglMultiDrawRangeElementArrayAPPLE; +#define glElementPointerAPPLE pglElementPointerAPPLE +#define glDrawElementArrayAPPLE pglDrawElementArrayAPPLE +#define glDrawRangeElementArrayAPPLE pglDrawRangeElementArrayAPPLE +#define glMultiDrawElementArrayAPPLE pglMultiDrawElementArrayAPPLE +#define glMultiDrawRangeElementArrayAPPLE pglMultiDrawRangeElementArrayAPPLE +#endif + +/* GL_APPLE_fence */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#define __GLEE_GL_APPLE_fence 1 +/* Constants */ +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint * fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint * fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +GLEE_EXTERN PFNGLGENFENCESAPPLEPROC pglGenFencesAPPLE; +GLEE_EXTERN PFNGLDELETEFENCESAPPLEPROC pglDeleteFencesAPPLE; +GLEE_EXTERN PFNGLSETFENCEAPPLEPROC pglSetFenceAPPLE; +GLEE_EXTERN PFNGLISFENCEAPPLEPROC pglIsFenceAPPLE; +GLEE_EXTERN PFNGLTESTFENCEAPPLEPROC pglTestFenceAPPLE; +GLEE_EXTERN PFNGLFINISHFENCEAPPLEPROC pglFinishFenceAPPLE; +GLEE_EXTERN PFNGLTESTOBJECTAPPLEPROC pglTestObjectAPPLE; +GLEE_EXTERN PFNGLFINISHOBJECTAPPLEPROC pglFinishObjectAPPLE; +#define glGenFencesAPPLE pglGenFencesAPPLE +#define glDeleteFencesAPPLE pglDeleteFencesAPPLE +#define glSetFenceAPPLE pglSetFenceAPPLE +#define glIsFenceAPPLE pglIsFenceAPPLE +#define glTestFenceAPPLE pglTestFenceAPPLE +#define glFinishFenceAPPLE pglFinishFenceAPPLE +#define glTestObjectAPPLE pglTestObjectAPPLE +#define glFinishObjectAPPLE pglFinishObjectAPPLE +#endif + +/* GL_APPLE_vertex_array_object */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#define __GLEE_GL_APPLE_vertex_array_object 1 +/* Constants */ +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint * arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint * arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +GLEE_EXTERN PFNGLBINDVERTEXARRAYAPPLEPROC pglBindVertexArrayAPPLE; +GLEE_EXTERN PFNGLDELETEVERTEXARRAYSAPPLEPROC pglDeleteVertexArraysAPPLE; +GLEE_EXTERN PFNGLGENVERTEXARRAYSAPPLEPROC pglGenVertexArraysAPPLE; +GLEE_EXTERN PFNGLISVERTEXARRAYAPPLEPROC pglIsVertexArrayAPPLE; +#define glBindVertexArrayAPPLE pglBindVertexArrayAPPLE +#define glDeleteVertexArraysAPPLE pglDeleteVertexArraysAPPLE +#define glGenVertexArraysAPPLE pglGenVertexArraysAPPLE +#define glIsVertexArrayAPPLE pglIsVertexArrayAPPLE +#endif + +/* GL_APPLE_vertex_array_range */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#define __GLEE_GL_APPLE_vertex_array_range 1 +/* Constants */ +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid * pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid * pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +GLEE_EXTERN PFNGLVERTEXARRAYRANGEAPPLEPROC pglVertexArrayRangeAPPLE; +GLEE_EXTERN PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC pglFlushVertexArrayRangeAPPLE; +GLEE_EXTERN PFNGLVERTEXARRAYPARAMETERIAPPLEPROC pglVertexArrayParameteriAPPLE; +#define glVertexArrayRangeAPPLE pglVertexArrayRangeAPPLE +#define glFlushVertexArrayRangeAPPLE pglFlushVertexArrayRangeAPPLE +#define glVertexArrayParameteriAPPLE pglVertexArrayParameteriAPPLE +#endif + +/* GL_APPLE_ycbcr_422 */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#define __GLEE_GL_APPLE_ycbcr_422 1 +/* Constants */ +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +/* GL_S3_s3tc */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#define __GLEE_GL_S3_s3tc 1 +/* Constants */ +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +/* GL_ATI_draw_buffers */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#define __GLEE_GL_ATI_draw_buffers 1 +/* Constants */ +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum * bufs); +GLEE_EXTERN PFNGLDRAWBUFFERSATIPROC pglDrawBuffersATI; +#define glDrawBuffersATI pglDrawBuffersATI +#endif + +/* GL_ATI_pixel_format_float */ + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +#define __GLEE_GL_ATI_pixel_format_float 1 +/* Constants */ +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +/* GL_ATI_texture_env_combine3 */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#define __GLEE_GL_ATI_texture_env_combine3 1 +/* Constants */ +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +/* GL_ATI_texture_float */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#define __GLEE_GL_ATI_texture_float 1 +/* Constants */ +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +/* GL_NV_float_buffer */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#define __GLEE_GL_NV_float_buffer 1 +/* Constants */ +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +/* GL_NV_fragment_program */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +#define __GLEE_GL_NV_fragment_program 1 +/* Constants */ +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); +GLEE_EXTERN PFNGLPROGRAMNAMEDPARAMETER4FNVPROC pglProgramNamedParameter4fNV; +GLEE_EXTERN PFNGLPROGRAMNAMEDPARAMETER4DNVPROC pglProgramNamedParameter4dNV; +GLEE_EXTERN PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC pglProgramNamedParameter4fvNV; +GLEE_EXTERN PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC pglProgramNamedParameter4dvNV; +GLEE_EXTERN PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC pglGetProgramNamedParameterfvNV; +GLEE_EXTERN PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC pglGetProgramNamedParameterdvNV; +#define glProgramNamedParameter4fNV pglProgramNamedParameter4fNV +#define glProgramNamedParameter4dNV pglProgramNamedParameter4dNV +#define glProgramNamedParameter4fvNV pglProgramNamedParameter4fvNV +#define glProgramNamedParameter4dvNV pglProgramNamedParameter4dvNV +#define glGetProgramNamedParameterfvNV pglGetProgramNamedParameterfvNV +#define glGetProgramNamedParameterdvNV pglGetProgramNamedParameterdvNV +#endif + +/* GL_NV_half_float */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#define __GLEE_GL_NV_half_float 1 +/* Constants */ +#define GL_HALF_FLOAT_NV 0x140B +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV * fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV * weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV * v); +GLEE_EXTERN PFNGLVERTEX2HNVPROC pglVertex2hNV; +GLEE_EXTERN PFNGLVERTEX2HVNVPROC pglVertex2hvNV; +GLEE_EXTERN PFNGLVERTEX3HNVPROC pglVertex3hNV; +GLEE_EXTERN PFNGLVERTEX3HVNVPROC pglVertex3hvNV; +GLEE_EXTERN PFNGLVERTEX4HNVPROC pglVertex4hNV; +GLEE_EXTERN PFNGLVERTEX4HVNVPROC pglVertex4hvNV; +GLEE_EXTERN PFNGLNORMAL3HNVPROC pglNormal3hNV; +GLEE_EXTERN PFNGLNORMAL3HVNVPROC pglNormal3hvNV; +GLEE_EXTERN PFNGLCOLOR3HNVPROC pglColor3hNV; +GLEE_EXTERN PFNGLCOLOR3HVNVPROC pglColor3hvNV; +GLEE_EXTERN PFNGLCOLOR4HNVPROC pglColor4hNV; +GLEE_EXTERN PFNGLCOLOR4HVNVPROC pglColor4hvNV; +GLEE_EXTERN PFNGLTEXCOORD1HNVPROC pglTexCoord1hNV; +GLEE_EXTERN PFNGLTEXCOORD1HVNVPROC pglTexCoord1hvNV; +GLEE_EXTERN PFNGLTEXCOORD2HNVPROC pglTexCoord2hNV; +GLEE_EXTERN PFNGLTEXCOORD2HVNVPROC pglTexCoord2hvNV; +GLEE_EXTERN PFNGLTEXCOORD3HNVPROC pglTexCoord3hNV; +GLEE_EXTERN PFNGLTEXCOORD3HVNVPROC pglTexCoord3hvNV; +GLEE_EXTERN PFNGLTEXCOORD4HNVPROC pglTexCoord4hNV; +GLEE_EXTERN PFNGLTEXCOORD4HVNVPROC pglTexCoord4hvNV; +GLEE_EXTERN PFNGLMULTITEXCOORD1HNVPROC pglMultiTexCoord1hNV; +GLEE_EXTERN PFNGLMULTITEXCOORD1HVNVPROC pglMultiTexCoord1hvNV; +GLEE_EXTERN PFNGLMULTITEXCOORD2HNVPROC pglMultiTexCoord2hNV; +GLEE_EXTERN PFNGLMULTITEXCOORD2HVNVPROC pglMultiTexCoord2hvNV; +GLEE_EXTERN PFNGLMULTITEXCOORD3HNVPROC pglMultiTexCoord3hNV; +GLEE_EXTERN PFNGLMULTITEXCOORD3HVNVPROC pglMultiTexCoord3hvNV; +GLEE_EXTERN PFNGLMULTITEXCOORD4HNVPROC pglMultiTexCoord4hNV; +GLEE_EXTERN PFNGLMULTITEXCOORD4HVNVPROC pglMultiTexCoord4hvNV; +GLEE_EXTERN PFNGLFOGCOORDHNVPROC pglFogCoordhNV; +GLEE_EXTERN PFNGLFOGCOORDHVNVPROC pglFogCoordhvNV; +GLEE_EXTERN PFNGLSECONDARYCOLOR3HNVPROC pglSecondaryColor3hNV; +GLEE_EXTERN PFNGLSECONDARYCOLOR3HVNVPROC pglSecondaryColor3hvNV; +GLEE_EXTERN PFNGLVERTEXWEIGHTHNVPROC pglVertexWeighthNV; +GLEE_EXTERN PFNGLVERTEXWEIGHTHVNVPROC pglVertexWeighthvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB1HNVPROC pglVertexAttrib1hNV; +GLEE_EXTERN PFNGLVERTEXATTRIB1HVNVPROC pglVertexAttrib1hvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB2HNVPROC pglVertexAttrib2hNV; +GLEE_EXTERN PFNGLVERTEXATTRIB2HVNVPROC pglVertexAttrib2hvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB3HNVPROC pglVertexAttrib3hNV; +GLEE_EXTERN PFNGLVERTEXATTRIB3HVNVPROC pglVertexAttrib3hvNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4HNVPROC pglVertexAttrib4hNV; +GLEE_EXTERN PFNGLVERTEXATTRIB4HVNVPROC pglVertexAttrib4hvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS1HVNVPROC pglVertexAttribs1hvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS2HVNVPROC pglVertexAttribs2hvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS3HVNVPROC pglVertexAttribs3hvNV; +GLEE_EXTERN PFNGLVERTEXATTRIBS4HVNVPROC pglVertexAttribs4hvNV; +#define glVertex2hNV pglVertex2hNV +#define glVertex2hvNV pglVertex2hvNV +#define glVertex3hNV pglVertex3hNV +#define glVertex3hvNV pglVertex3hvNV +#define glVertex4hNV pglVertex4hNV +#define glVertex4hvNV pglVertex4hvNV +#define glNormal3hNV pglNormal3hNV +#define glNormal3hvNV pglNormal3hvNV +#define glColor3hNV pglColor3hNV +#define glColor3hvNV pglColor3hvNV +#define glColor4hNV pglColor4hNV +#define glColor4hvNV pglColor4hvNV +#define glTexCoord1hNV pglTexCoord1hNV +#define glTexCoord1hvNV pglTexCoord1hvNV +#define glTexCoord2hNV pglTexCoord2hNV +#define glTexCoord2hvNV pglTexCoord2hvNV +#define glTexCoord3hNV pglTexCoord3hNV +#define glTexCoord3hvNV pglTexCoord3hvNV +#define glTexCoord4hNV pglTexCoord4hNV +#define glTexCoord4hvNV pglTexCoord4hvNV +#define glMultiTexCoord1hNV pglMultiTexCoord1hNV +#define glMultiTexCoord1hvNV pglMultiTexCoord1hvNV +#define glMultiTexCoord2hNV pglMultiTexCoord2hNV +#define glMultiTexCoord2hvNV pglMultiTexCoord2hvNV +#define glMultiTexCoord3hNV pglMultiTexCoord3hNV +#define glMultiTexCoord3hvNV pglMultiTexCoord3hvNV +#define glMultiTexCoord4hNV pglMultiTexCoord4hNV +#define glMultiTexCoord4hvNV pglMultiTexCoord4hvNV +#define glFogCoordhNV pglFogCoordhNV +#define glFogCoordhvNV pglFogCoordhvNV +#define glSecondaryColor3hNV pglSecondaryColor3hNV +#define glSecondaryColor3hvNV pglSecondaryColor3hvNV +#define glVertexWeighthNV pglVertexWeighthNV +#define glVertexWeighthvNV pglVertexWeighthvNV +#define glVertexAttrib1hNV pglVertexAttrib1hNV +#define glVertexAttrib1hvNV pglVertexAttrib1hvNV +#define glVertexAttrib2hNV pglVertexAttrib2hNV +#define glVertexAttrib2hvNV pglVertexAttrib2hvNV +#define glVertexAttrib3hNV pglVertexAttrib3hNV +#define glVertexAttrib3hvNV pglVertexAttrib3hvNV +#define glVertexAttrib4hNV pglVertexAttrib4hNV +#define glVertexAttrib4hvNV pglVertexAttrib4hvNV +#define glVertexAttribs1hvNV pglVertexAttribs1hvNV +#define glVertexAttribs2hvNV pglVertexAttribs2hvNV +#define glVertexAttribs3hvNV pglVertexAttribs3hvNV +#define glVertexAttribs4hvNV pglVertexAttribs4hvNV +#endif + +/* GL_NV_pixel_data_range */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#define __GLEE_GL_NV_pixel_data_range 1 +/* Constants */ +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid * pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +GLEE_EXTERN PFNGLPIXELDATARANGENVPROC pglPixelDataRangeNV; +GLEE_EXTERN PFNGLFLUSHPIXELDATARANGENVPROC pglFlushPixelDataRangeNV; +#define glPixelDataRangeNV pglPixelDataRangeNV +#define glFlushPixelDataRangeNV pglFlushPixelDataRangeNV +#endif + +/* GL_NV_primitive_restart */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#define __GLEE_GL_NV_primitive_restart 1 +/* Constants */ +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +GLEE_EXTERN PFNGLPRIMITIVERESTARTNVPROC pglPrimitiveRestartNV; +GLEE_EXTERN PFNGLPRIMITIVERESTARTINDEXNVPROC pglPrimitiveRestartIndexNV; +#define glPrimitiveRestartNV pglPrimitiveRestartNV +#define glPrimitiveRestartIndexNV pglPrimitiveRestartIndexNV +#endif + +/* GL_NV_texture_expand_normal */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#define __GLEE_GL_NV_texture_expand_normal 1 +/* Constants */ +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +/* GL_NV_vertex_program2 */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#define __GLEE_GL_NV_vertex_program2 1 +/* Constants */ +#endif + +/* GL_ATI_map_object_buffer */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#define __GLEE_GL_ATI_map_object_buffer 1 +/* Constants */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +GLEE_EXTERN PFNGLMAPOBJECTBUFFERATIPROC pglMapObjectBufferATI; +GLEE_EXTERN PFNGLUNMAPOBJECTBUFFERATIPROC pglUnmapObjectBufferATI; +#define glMapObjectBufferATI pglMapObjectBufferATI +#define glUnmapObjectBufferATI pglUnmapObjectBufferATI +#endif + +/* GL_ATI_separate_stencil */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#define __GLEE_GL_ATI_separate_stencil 1 +/* Constants */ +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +GLEE_EXTERN PFNGLSTENCILOPSEPARATEATIPROC pglStencilOpSeparateATI; +GLEE_EXTERN PFNGLSTENCILFUNCSEPARATEATIPROC pglStencilFuncSeparateATI; +#define glStencilOpSeparateATI pglStencilOpSeparateATI +#define glStencilFuncSeparateATI pglStencilFuncSeparateATI +#endif + +/* GL_ATI_vertex_attrib_array_object */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#define __GLEE_GL_ATI_vertex_attrib_array_object 1 +/* Constants */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint * params); +GLEE_EXTERN PFNGLVERTEXATTRIBARRAYOBJECTATIPROC pglVertexAttribArrayObjectATI; +GLEE_EXTERN PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC pglGetVertexAttribArrayObjectfvATI; +GLEE_EXTERN PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC pglGetVertexAttribArrayObjectivATI; +#define glVertexAttribArrayObjectATI pglVertexAttribArrayObjectATI +#define glGetVertexAttribArrayObjectfvATI pglGetVertexAttribArrayObjectfvATI +#define glGetVertexAttribArrayObjectivATI pglGetVertexAttribArrayObjectivATI +#endif + +/* GL_OES_read_format */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#define __GLEE_GL_OES_read_format 1 +/* Constants */ +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +/* GL_EXT_depth_bounds_test */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#define __GLEE_GL_EXT_depth_bounds_test 1 +/* Constants */ +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +GLEE_EXTERN PFNGLDEPTHBOUNDSEXTPROC pglDepthBoundsEXT; +#define glDepthBoundsEXT pglDepthBoundsEXT +#endif + +/* GL_EXT_texture_mirror_clamp */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#define __GLEE_GL_EXT_texture_mirror_clamp 1 +/* Constants */ +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +/* GL_EXT_blend_equation_separate */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#define __GLEE_GL_EXT_blend_equation_separate 1 +/* Constants */ +#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +GLEE_EXTERN PFNGLBLENDEQUATIONSEPARATEEXTPROC pglBlendEquationSeparateEXT; +#define glBlendEquationSeparateEXT pglBlendEquationSeparateEXT +#endif + +/* GL_MESA_pack_invert */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#define __GLEE_GL_MESA_pack_invert 1 +/* Constants */ +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +/* GL_MESA_ycbcr_texture */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#define __GLEE_GL_MESA_ycbcr_texture 1 +/* Constants */ +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +/* GL_EXT_pixel_buffer_object */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#define __GLEE_GL_EXT_pixel_buffer_object 1 +/* Constants */ +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +/* GL_NV_fragment_program_option */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#define __GLEE_GL_NV_fragment_program_option 1 +/* Constants */ +#endif + +/* GL_NV_fragment_program2 */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#define __GLEE_GL_NV_fragment_program2 1 +/* Constants */ +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +/* GL_NV_vertex_program2_option */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#define __GLEE_GL_NV_vertex_program2_option 1 +/* Constants */ +#endif + +/* GL_NV_vertex_program3 */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#define __GLEE_GL_NV_vertex_program3 1 +/* Constants */ +#endif + +/* GL_EXT_framebuffer_object */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#define __GLEE_GL_EXT_framebuffer_object 1 +/* Constants */ +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint * renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint * renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint * params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint * framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint * framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +GLEE_EXTERN PFNGLISRENDERBUFFEREXTPROC pglIsRenderbufferEXT; +GLEE_EXTERN PFNGLBINDRENDERBUFFEREXTPROC pglBindRenderbufferEXT; +GLEE_EXTERN PFNGLDELETERENDERBUFFERSEXTPROC pglDeleteRenderbuffersEXT; +GLEE_EXTERN PFNGLGENRENDERBUFFERSEXTPROC pglGenRenderbuffersEXT; +GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEEXTPROC pglRenderbufferStorageEXT; +GLEE_EXTERN PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC pglGetRenderbufferParameterivEXT; +GLEE_EXTERN PFNGLISFRAMEBUFFEREXTPROC pglIsFramebufferEXT; +GLEE_EXTERN PFNGLBINDFRAMEBUFFEREXTPROC pglBindFramebufferEXT; +GLEE_EXTERN PFNGLDELETEFRAMEBUFFERSEXTPROC pglDeleteFramebuffersEXT; +GLEE_EXTERN PFNGLGENFRAMEBUFFERSEXTPROC pglGenFramebuffersEXT; +GLEE_EXTERN PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC pglCheckFramebufferStatusEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE1DEXTPROC pglFramebufferTexture1DEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE2DEXTPROC pglFramebufferTexture2DEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURE3DEXTPROC pglFramebufferTexture3DEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC pglFramebufferRenderbufferEXT; +GLEE_EXTERN PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC pglGetFramebufferAttachmentParameterivEXT; +GLEE_EXTERN PFNGLGENERATEMIPMAPEXTPROC pglGenerateMipmapEXT; +#define glIsRenderbufferEXT pglIsRenderbufferEXT +#define glBindRenderbufferEXT pglBindRenderbufferEXT +#define glDeleteRenderbuffersEXT pglDeleteRenderbuffersEXT +#define glGenRenderbuffersEXT pglGenRenderbuffersEXT +#define glRenderbufferStorageEXT pglRenderbufferStorageEXT +#define glGetRenderbufferParameterivEXT pglGetRenderbufferParameterivEXT +#define glIsFramebufferEXT pglIsFramebufferEXT +#define glBindFramebufferEXT pglBindFramebufferEXT +#define glDeleteFramebuffersEXT pglDeleteFramebuffersEXT +#define glGenFramebuffersEXT pglGenFramebuffersEXT +#define glCheckFramebufferStatusEXT pglCheckFramebufferStatusEXT +#define glFramebufferTexture1DEXT pglFramebufferTexture1DEXT +#define glFramebufferTexture2DEXT pglFramebufferTexture2DEXT +#define glFramebufferTexture3DEXT pglFramebufferTexture3DEXT +#define glFramebufferRenderbufferEXT pglFramebufferRenderbufferEXT +#define glGetFramebufferAttachmentParameterivEXT pglGetFramebufferAttachmentParameterivEXT +#define glGenerateMipmapEXT pglGenerateMipmapEXT +#endif + +/* GL_GREMEDY_string_marker */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#define __GLEE_GL_GREMEDY_string_marker 1 +/* Constants */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid * string); +GLEE_EXTERN PFNGLSTRINGMARKERGREMEDYPROC pglStringMarkerGREMEDY; +#define glStringMarkerGREMEDY pglStringMarkerGREMEDY +#endif + +/* GL_EXT_packed_depth_stencil */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#define __GLEE_GL_EXT_packed_depth_stencil 1 +/* Constants */ +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif + +/* GL_EXT_stencil_clear_tag */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#define __GLEE_GL_EXT_stencil_clear_tag 1 +/* Constants */ +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +GLEE_EXTERN PFNGLSTENCILCLEARTAGEXTPROC pglStencilClearTagEXT; +#define glStencilClearTagEXT pglStencilClearTagEXT +#endif + +/* GL_EXT_texture_sRGB */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#define __GLEE_GL_EXT_texture_sRGB 1 +/* Constants */ +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif + +/* GL_EXT_framebuffer_blit */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#define __GLEE_GL_EXT_framebuffer_blit 1 +/* Constants */ +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLEE_EXTERN PFNGLBLITFRAMEBUFFEREXTPROC pglBlitFramebufferEXT; +#define glBlitFramebufferEXT pglBlitFramebufferEXT +#endif + +/* GL_EXT_framebuffer_multisample */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#define __GLEE_GL_EXT_framebuffer_multisample 1 +/* Constants */ +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pglRenderbufferStorageMultisampleEXT; +#define glRenderbufferStorageMultisampleEXT pglRenderbufferStorageMultisampleEXT +#endif + +/* GL_MESAX_texture_stack */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#define __GLEE_GL_MESAX_texture_stack 1 +/* Constants */ +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +/* GL_EXT_timer_query */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#define __GLEE_GL_EXT_timer_query 1 +/* Constants */ +#define GL_TIME_ELAPSED_EXT 0x88BF +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT * params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT * params); +GLEE_EXTERN PFNGLGETQUERYOBJECTI64VEXTPROC pglGetQueryObjecti64vEXT; +GLEE_EXTERN PFNGLGETQUERYOBJECTUI64VEXTPROC pglGetQueryObjectui64vEXT; +#define glGetQueryObjecti64vEXT pglGetQueryObjecti64vEXT +#define glGetQueryObjectui64vEXT pglGetQueryObjectui64vEXT +#endif + +/* GL_EXT_gpu_program_parameters */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +#define __GLEE_GL_EXT_gpu_program_parameters 1 +/* Constants */ +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat * params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat * params); +GLEE_EXTERN PFNGLPROGRAMENVPARAMETERS4FVEXTPROC pglProgramEnvParameters4fvEXT; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC pglProgramLocalParameters4fvEXT; +#define glProgramEnvParameters4fvEXT pglProgramEnvParameters4fvEXT +#define glProgramLocalParameters4fvEXT pglProgramLocalParameters4fvEXT +#endif + +/* GL_APPLE_flush_buffer_range */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#define __GLEE_GL_APPLE_flush_buffer_range 1 +/* Constants */ +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +GLEE_EXTERN PFNGLBUFFERPARAMETERIAPPLEPROC pglBufferParameteriAPPLE; +GLEE_EXTERN PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC pglFlushMappedBufferRangeAPPLE; +#define glBufferParameteriAPPLE pglBufferParameteriAPPLE +#define glFlushMappedBufferRangeAPPLE pglFlushMappedBufferRangeAPPLE +#endif + +/* GL_NV_gpu_program4 */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#define __GLEE_GL_NV_gpu_program4 1 +/* Constants */ +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint * params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint * params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint * params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint * params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint * params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint * params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint * params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint * params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint * params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint * params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint * params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint * params); +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERI4INVPROC pglProgramLocalParameterI4iNV; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC pglProgramLocalParameterI4ivNV; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC pglProgramLocalParametersI4ivNV; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERI4UINVPROC pglProgramLocalParameterI4uiNV; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC pglProgramLocalParameterI4uivNV; +GLEE_EXTERN PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC pglProgramLocalParametersI4uivNV; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETERI4INVPROC pglProgramEnvParameterI4iNV; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETERI4IVNVPROC pglProgramEnvParameterI4ivNV; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETERSI4IVNVPROC pglProgramEnvParametersI4ivNV; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETERI4UINVPROC pglProgramEnvParameterI4uiNV; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETERI4UIVNVPROC pglProgramEnvParameterI4uivNV; +GLEE_EXTERN PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC pglProgramEnvParametersI4uivNV; +GLEE_EXTERN PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC pglGetProgramLocalParameterIivNV; +GLEE_EXTERN PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC pglGetProgramLocalParameterIuivNV; +GLEE_EXTERN PFNGLGETPROGRAMENVPARAMETERIIVNVPROC pglGetProgramEnvParameterIivNV; +GLEE_EXTERN PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC pglGetProgramEnvParameterIuivNV; +#define glProgramLocalParameterI4iNV pglProgramLocalParameterI4iNV +#define glProgramLocalParameterI4ivNV pglProgramLocalParameterI4ivNV +#define glProgramLocalParametersI4ivNV pglProgramLocalParametersI4ivNV +#define glProgramLocalParameterI4uiNV pglProgramLocalParameterI4uiNV +#define glProgramLocalParameterI4uivNV pglProgramLocalParameterI4uivNV +#define glProgramLocalParametersI4uivNV pglProgramLocalParametersI4uivNV +#define glProgramEnvParameterI4iNV pglProgramEnvParameterI4iNV +#define glProgramEnvParameterI4ivNV pglProgramEnvParameterI4ivNV +#define glProgramEnvParametersI4ivNV pglProgramEnvParametersI4ivNV +#define glProgramEnvParameterI4uiNV pglProgramEnvParameterI4uiNV +#define glProgramEnvParameterI4uivNV pglProgramEnvParameterI4uivNV +#define glProgramEnvParametersI4uivNV pglProgramEnvParametersI4uivNV +#define glGetProgramLocalParameterIivNV pglGetProgramLocalParameterIivNV +#define glGetProgramLocalParameterIuivNV pglGetProgramLocalParameterIuivNV +#define glGetProgramEnvParameterIivNV pglGetProgramEnvParameterIivNV +#define glGetProgramEnvParameterIuivNV pglGetProgramEnvParameterIuivNV +#endif + +/* GL_NV_geometry_program4 */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#define __GLEE_GL_NV_geometry_program4 1 +/* Constants */ +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLEE_EXTERN PFNGLPROGRAMVERTEXLIMITNVPROC pglProgramVertexLimitNV; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTUREEXTPROC pglFramebufferTextureEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC pglFramebufferTextureLayerEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC pglFramebufferTextureFaceEXT; +#define glProgramVertexLimitNV pglProgramVertexLimitNV +#define glFramebufferTextureEXT pglFramebufferTextureEXT +#define glFramebufferTextureLayerEXT pglFramebufferTextureLayerEXT +#define glFramebufferTextureFaceEXT pglFramebufferTextureFaceEXT +#endif + +/* GL_EXT_geometry_shader4 */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#define __GLEE_GL_EXT_geometry_shader4 1 +/* Constants */ +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +GLEE_EXTERN PFNGLPROGRAMPARAMETERIEXTPROC pglProgramParameteriEXT; +#define glProgramParameteriEXT pglProgramParameteriEXT +#endif + +/* GL_NV_vertex_program4 */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#define __GLEE_GL_NV_vertex_program4 1 +/* Constants */ +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort * v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint * params); +GLEE_EXTERN PFNGLVERTEXATTRIBI1IEXTPROC pglVertexAttribI1iEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI2IEXTPROC pglVertexAttribI2iEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI3IEXTPROC pglVertexAttribI3iEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI4IEXTPROC pglVertexAttribI4iEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI1UIEXTPROC pglVertexAttribI1uiEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI2UIEXTPROC pglVertexAttribI2uiEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI3UIEXTPROC pglVertexAttribI3uiEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI4UIEXTPROC pglVertexAttribI4uiEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI1IVEXTPROC pglVertexAttribI1ivEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI2IVEXTPROC pglVertexAttribI2ivEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI3IVEXTPROC pglVertexAttribI3ivEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI4IVEXTPROC pglVertexAttribI4ivEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI1UIVEXTPROC pglVertexAttribI1uivEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI2UIVEXTPROC pglVertexAttribI2uivEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI3UIVEXTPROC pglVertexAttribI3uivEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI4UIVEXTPROC pglVertexAttribI4uivEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI4BVEXTPROC pglVertexAttribI4bvEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI4SVEXTPROC pglVertexAttribI4svEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI4UBVEXTPROC pglVertexAttribI4ubvEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBI4USVEXTPROC pglVertexAttribI4usvEXT; +GLEE_EXTERN PFNGLVERTEXATTRIBIPOINTEREXTPROC pglVertexAttribIPointerEXT; +GLEE_EXTERN PFNGLGETVERTEXATTRIBIIVEXTPROC pglGetVertexAttribIivEXT; +GLEE_EXTERN PFNGLGETVERTEXATTRIBIUIVEXTPROC pglGetVertexAttribIuivEXT; +#define glVertexAttribI1iEXT pglVertexAttribI1iEXT +#define glVertexAttribI2iEXT pglVertexAttribI2iEXT +#define glVertexAttribI3iEXT pglVertexAttribI3iEXT +#define glVertexAttribI4iEXT pglVertexAttribI4iEXT +#define glVertexAttribI1uiEXT pglVertexAttribI1uiEXT +#define glVertexAttribI2uiEXT pglVertexAttribI2uiEXT +#define glVertexAttribI3uiEXT pglVertexAttribI3uiEXT +#define glVertexAttribI4uiEXT pglVertexAttribI4uiEXT +#define glVertexAttribI1ivEXT pglVertexAttribI1ivEXT +#define glVertexAttribI2ivEXT pglVertexAttribI2ivEXT +#define glVertexAttribI3ivEXT pglVertexAttribI3ivEXT +#define glVertexAttribI4ivEXT pglVertexAttribI4ivEXT +#define glVertexAttribI1uivEXT pglVertexAttribI1uivEXT +#define glVertexAttribI2uivEXT pglVertexAttribI2uivEXT +#define glVertexAttribI3uivEXT pglVertexAttribI3uivEXT +#define glVertexAttribI4uivEXT pglVertexAttribI4uivEXT +#define glVertexAttribI4bvEXT pglVertexAttribI4bvEXT +#define glVertexAttribI4svEXT pglVertexAttribI4svEXT +#define glVertexAttribI4ubvEXT pglVertexAttribI4ubvEXT +#define glVertexAttribI4usvEXT pglVertexAttribI4usvEXT +#define glVertexAttribIPointerEXT pglVertexAttribIPointerEXT +#define glGetVertexAttribIivEXT pglGetVertexAttribIivEXT +#define glGetVertexAttribIuivEXT pglGetVertexAttribIuivEXT +#endif + +/* GL_EXT_gpu_shader4 */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#define __GLEE_GL_EXT_gpu_shader4 1 +/* Constants */ +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint * params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar * name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint * value); +GLEE_EXTERN PFNGLGETUNIFORMUIVEXTPROC pglGetUniformuivEXT; +GLEE_EXTERN PFNGLBINDFRAGDATALOCATIONEXTPROC pglBindFragDataLocationEXT; +GLEE_EXTERN PFNGLGETFRAGDATALOCATIONEXTPROC pglGetFragDataLocationEXT; +GLEE_EXTERN PFNGLUNIFORM1UIEXTPROC pglUniform1uiEXT; +GLEE_EXTERN PFNGLUNIFORM2UIEXTPROC pglUniform2uiEXT; +GLEE_EXTERN PFNGLUNIFORM3UIEXTPROC pglUniform3uiEXT; +GLEE_EXTERN PFNGLUNIFORM4UIEXTPROC pglUniform4uiEXT; +GLEE_EXTERN PFNGLUNIFORM1UIVEXTPROC pglUniform1uivEXT; +GLEE_EXTERN PFNGLUNIFORM2UIVEXTPROC pglUniform2uivEXT; +GLEE_EXTERN PFNGLUNIFORM3UIVEXTPROC pglUniform3uivEXT; +GLEE_EXTERN PFNGLUNIFORM4UIVEXTPROC pglUniform4uivEXT; +#define glGetUniformuivEXT pglGetUniformuivEXT +#define glBindFragDataLocationEXT pglBindFragDataLocationEXT +#define glGetFragDataLocationEXT pglGetFragDataLocationEXT +#define glUniform1uiEXT pglUniform1uiEXT +#define glUniform2uiEXT pglUniform2uiEXT +#define glUniform3uiEXT pglUniform3uiEXT +#define glUniform4uiEXT pglUniform4uiEXT +#define glUniform1uivEXT pglUniform1uivEXT +#define glUniform2uivEXT pglUniform2uivEXT +#define glUniform3uivEXT pglUniform3uivEXT +#define glUniform4uivEXT pglUniform4uivEXT +#endif + +/* GL_EXT_drawinstanced */ + +#ifndef GL_EXT_drawinstanced +#define GL_EXT_drawinstanced 1 +#define __GLEE_GL_EXT_drawinstanced 1 +/* Constants */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount); +GLEE_EXTERN PFNGLDRAWARRAYSINSTANCEDEXTPROC pglDrawArraysInstancedEXT; +GLEE_EXTERN PFNGLDRAWELEMENTSINSTANCEDEXTPROC pglDrawElementsInstancedEXT; +#define glDrawArraysInstancedEXT pglDrawArraysInstancedEXT +#define glDrawElementsInstancedEXT pglDrawElementsInstancedEXT +#endif + +/* GL_EXT_packed_float */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#define __GLEE_GL_EXT_packed_float 1 +/* Constants */ +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +/* GL_EXT_texture_array */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#define __GLEE_GL_EXT_texture_array 1 +/* Constants */ +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#endif + +/* GL_EXT_texture_buffer_object */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#define __GLEE_GL_EXT_texture_buffer_object 1 +/* Constants */ +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +GLEE_EXTERN PFNGLTEXBUFFEREXTPROC pglTexBufferEXT; +#define glTexBufferEXT pglTexBufferEXT +#endif + +/* GL_EXT_texture_compression_latc */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#define __GLEE_GL_EXT_texture_compression_latc 1 +/* Constants */ +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +/* GL_EXT_texture_compression_rgtc */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#define __GLEE_GL_EXT_texture_compression_rgtc 1 +/* Constants */ +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +/* GL_EXT_texture_shared_exponent */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#define __GLEE_GL_EXT_texture_shared_exponent 1 +/* Constants */ +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +/* GL_NV_depth_buffer_float */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#define __GLEE_GL_NV_depth_buffer_float 1 +/* Constants */ +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +GLEE_EXTERN PFNGLDEPTHRANGEDNVPROC pglDepthRangedNV; +GLEE_EXTERN PFNGLCLEARDEPTHDNVPROC pglClearDepthdNV; +GLEE_EXTERN PFNGLDEPTHBOUNDSDNVPROC pglDepthBoundsdNV; +#define glDepthRangedNV pglDepthRangedNV +#define glClearDepthdNV pglClearDepthdNV +#define glDepthBoundsdNV pglDepthBoundsdNV +#endif + +/* GL_NV_fragment_program4 */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#define __GLEE_GL_NV_fragment_program4 1 +/* Constants */ +#endif + +/* GL_NV_framebuffer_multisample_coverage */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#define __GLEE_GL_NV_framebuffer_multisample_coverage 1 +/* Constants */ +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLEE_EXTERN PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC pglRenderbufferStorageMultisampleCoverageNV; +#define glRenderbufferStorageMultisampleCoverageNV pglRenderbufferStorageMultisampleCoverageNV +#endif + +/* GL_EXT_framebuffer_sRGB */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#define __GLEE_GL_EXT_framebuffer_sRGB 1 +/* Constants */ +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +/* GL_NV_geometry_shader4 */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#define __GLEE_GL_NV_geometry_shader4 1 +/* Constants */ +#endif + +/* GL_NV_parameter_buffer_object */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#define __GLEE_GL_NV_parameter_buffer_object 1 +/* Constants */ +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat * params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint * params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint * params); +GLEE_EXTERN PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC pglProgramBufferParametersfvNV; +GLEE_EXTERN PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC pglProgramBufferParametersIivNV; +GLEE_EXTERN PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC pglProgramBufferParametersIuivNV; +#define glProgramBufferParametersfvNV pglProgramBufferParametersfvNV +#define glProgramBufferParametersIivNV pglProgramBufferParametersIivNV +#define glProgramBufferParametersIuivNV pglProgramBufferParametersIuivNV +#endif + +/* GL_EXT_draw_buffers2 */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +#define __GLEE_GL_EXT_draw_buffers2 1 +/* Constants */ +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean * data); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint * data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +GLEE_EXTERN PFNGLCOLORMASKINDEXEDEXTPROC pglColorMaskIndexedEXT; +GLEE_EXTERN PFNGLGETBOOLEANINDEXEDVEXTPROC pglGetBooleanIndexedvEXT; +GLEE_EXTERN PFNGLGETINTEGERINDEXEDVEXTPROC pglGetIntegerIndexedvEXT; +GLEE_EXTERN PFNGLENABLEINDEXEDEXTPROC pglEnableIndexedEXT; +GLEE_EXTERN PFNGLDISABLEINDEXEDEXTPROC pglDisableIndexedEXT; +GLEE_EXTERN PFNGLISENABLEDINDEXEDEXTPROC pglIsEnabledIndexedEXT; +#define glColorMaskIndexedEXT pglColorMaskIndexedEXT +#define glGetBooleanIndexedvEXT pglGetBooleanIndexedvEXT +#define glGetIntegerIndexedvEXT pglGetIntegerIndexedvEXT +#define glEnableIndexedEXT pglEnableIndexedEXT +#define glDisableIndexedEXT pglDisableIndexedEXT +#define glIsEnabledIndexedEXT pglIsEnabledIndexedEXT +#endif + +/* GL_NV_transform_feedback */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#define __GLEE_GL_NV_transform_feedback 1 +/* Constants */ +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint * attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar * name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint * location); +GLEE_EXTERN PFNGLBEGINTRANSFORMFEEDBACKNVPROC pglBeginTransformFeedbackNV; +GLEE_EXTERN PFNGLENDTRANSFORMFEEDBACKNVPROC pglEndTransformFeedbackNV; +GLEE_EXTERN PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC pglTransformFeedbackAttribsNV; +GLEE_EXTERN PFNGLBINDBUFFERRANGENVPROC pglBindBufferRangeNV; +GLEE_EXTERN PFNGLBINDBUFFEROFFSETNVPROC pglBindBufferOffsetNV; +GLEE_EXTERN PFNGLBINDBUFFERBASENVPROC pglBindBufferBaseNV; +GLEE_EXTERN PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC pglTransformFeedbackVaryingsNV; +GLEE_EXTERN PFNGLACTIVEVARYINGNVPROC pglActiveVaryingNV; +GLEE_EXTERN PFNGLGETVARYINGLOCATIONNVPROC pglGetVaryingLocationNV; +GLEE_EXTERN PFNGLGETACTIVEVARYINGNVPROC pglGetActiveVaryingNV; +GLEE_EXTERN PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC pglGetTransformFeedbackVaryingNV; +#define glBeginTransformFeedbackNV pglBeginTransformFeedbackNV +#define glEndTransformFeedbackNV pglEndTransformFeedbackNV +#define glTransformFeedbackAttribsNV pglTransformFeedbackAttribsNV +#define glBindBufferRangeNV pglBindBufferRangeNV +#define glBindBufferOffsetNV pglBindBufferOffsetNV +#define glBindBufferBaseNV pglBindBufferBaseNV +#define glTransformFeedbackVaryingsNV pglTransformFeedbackVaryingsNV +#define glActiveVaryingNV pglActiveVaryingNV +#define glGetVaryingLocationNV pglGetVaryingLocationNV +#define glGetActiveVaryingNV pglGetActiveVaryingNV +#define glGetTransformFeedbackVaryingNV pglGetTransformFeedbackVaryingNV +#endif + +/* GL_EXT_bindable_uniform */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#define __GLEE_GL_EXT_bindable_uniform 1 +/* Constants */ +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +GLEE_EXTERN PFNGLUNIFORMBUFFEREXTPROC pglUniformBufferEXT; +GLEE_EXTERN PFNGLGETUNIFORMBUFFERSIZEEXTPROC pglGetUniformBufferSizeEXT; +GLEE_EXTERN PFNGLGETUNIFORMOFFSETEXTPROC pglGetUniformOffsetEXT; +#define glUniformBufferEXT pglUniformBufferEXT +#define glGetUniformBufferSizeEXT pglGetUniformBufferSizeEXT +#define glGetUniformOffsetEXT pglGetUniformOffsetEXT +#endif + +/* GL_EXT_texture_integer */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#define __GLEE_GL_EXT_texture_integer 1 +/* Constants */ +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint * params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint * params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLEE_EXTERN PFNGLTEXPARAMETERIIVEXTPROC pglTexParameterIivEXT; +GLEE_EXTERN PFNGLTEXPARAMETERIUIVEXTPROC pglTexParameterIuivEXT; +GLEE_EXTERN PFNGLGETTEXPARAMETERIIVEXTPROC pglGetTexParameterIivEXT; +GLEE_EXTERN PFNGLGETTEXPARAMETERIUIVEXTPROC pglGetTexParameterIuivEXT; +GLEE_EXTERN PFNGLCLEARCOLORIIEXTPROC pglClearColorIiEXT; +GLEE_EXTERN PFNGLCLEARCOLORIUIEXTPROC pglClearColorIuiEXT; +#define glTexParameterIivEXT pglTexParameterIivEXT +#define glTexParameterIuivEXT pglTexParameterIuivEXT +#define glGetTexParameterIivEXT pglGetTexParameterIivEXT +#define glGetTexParameterIuivEXT pglGetTexParameterIuivEXT +#define glClearColorIiEXT pglClearColorIiEXT +#define glClearColorIuiEXT pglClearColorIuiEXT +#endif + +/* GL_GREMEDY_frame_terminator */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#define __GLEE_GL_GREMEDY_frame_terminator 1 +/* Constants */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (); +GLEE_EXTERN PFNGLFRAMETERMINATORGREMEDYPROC pglFrameTerminatorGREMEDY; +#define glFrameTerminatorGREMEDY pglFrameTerminatorGREMEDY +#endif + +/* GL_NV_conditional_render */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#define __GLEE_GL_NV_conditional_render 1 +/* Constants */ +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (); +GLEE_EXTERN PFNGLBEGINCONDITIONALRENDERNVPROC pglBeginConditionalRenderNV; +GLEE_EXTERN PFNGLENDCONDITIONALRENDERNVPROC pglEndConditionalRenderNV; +#define glBeginConditionalRenderNV pglBeginConditionalRenderNV +#define glEndConditionalRenderNV pglEndConditionalRenderNV +#endif + +/* GL_NV_present_video */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#define __GLEE_GL_NV_present_video 1 +/* Constants */ +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +#endif + +/* GL_EXT_transform_feedback */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#define __GLEE_GL_EXT_transform_feedback 1 +/* Constants */ +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLint * location); +GLEE_EXTERN PFNGLBEGINTRANSFORMFEEDBACKEXTPROC pglBeginTransformFeedbackEXT; +GLEE_EXTERN PFNGLENDTRANSFORMFEEDBACKEXTPROC pglEndTransformFeedbackEXT; +GLEE_EXTERN PFNGLBINDBUFFERRANGEEXTPROC pglBindBufferRangeEXT; +GLEE_EXTERN PFNGLBINDBUFFEROFFSETEXTPROC pglBindBufferOffsetEXT; +GLEE_EXTERN PFNGLBINDBUFFERBASEEXTPROC pglBindBufferBaseEXT; +GLEE_EXTERN PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC pglTransformFeedbackVaryingsEXT; +GLEE_EXTERN PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC pglGetTransformFeedbackVaryingEXT; +#define glBeginTransformFeedbackEXT pglBeginTransformFeedbackEXT +#define glEndTransformFeedbackEXT pglEndTransformFeedbackEXT +#define glBindBufferRangeEXT pglBindBufferRangeEXT +#define glBindBufferOffsetEXT pglBindBufferOffsetEXT +#define glBindBufferBaseEXT pglBindBufferBaseEXT +#define glTransformFeedbackVaryingsEXT pglTransformFeedbackVaryingsEXT +#define glGetTransformFeedbackVaryingEXT pglGetTransformFeedbackVaryingEXT +#endif + +/* GL_EXT_direct_state_access */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#define __GLEE_GL_EXT_direct_state_access 1 +/* Constants */ +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat * m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble * m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat * m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble * m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat * m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble * m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat * m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble * m); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble * params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat * params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble * params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat * params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat * data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble * data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* * data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid * img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid * img); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid * string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble * params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat * params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble * params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat * params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid * string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat * params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint * params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint * params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint * params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint * params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint * params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint * params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint * params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint * params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint * params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint * params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint * params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint * value); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid * data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid * data); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* * params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint * params); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum * bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint * params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +GLEE_EXTERN PFNGLCLIENTATTRIBDEFAULTEXTPROC pglClientAttribDefaultEXT; +GLEE_EXTERN PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC pglPushClientAttribDefaultEXT; +GLEE_EXTERN PFNGLMATRIXLOADFEXTPROC pglMatrixLoadfEXT; +GLEE_EXTERN PFNGLMATRIXLOADDEXTPROC pglMatrixLoaddEXT; +GLEE_EXTERN PFNGLMATRIXMULTFEXTPROC pglMatrixMultfEXT; +GLEE_EXTERN PFNGLMATRIXMULTDEXTPROC pglMatrixMultdEXT; +GLEE_EXTERN PFNGLMATRIXLOADIDENTITYEXTPROC pglMatrixLoadIdentityEXT; +GLEE_EXTERN PFNGLMATRIXROTATEFEXTPROC pglMatrixRotatefEXT; +GLEE_EXTERN PFNGLMATRIXROTATEDEXTPROC pglMatrixRotatedEXT; +GLEE_EXTERN PFNGLMATRIXSCALEFEXTPROC pglMatrixScalefEXT; +GLEE_EXTERN PFNGLMATRIXSCALEDEXTPROC pglMatrixScaledEXT; +GLEE_EXTERN PFNGLMATRIXTRANSLATEFEXTPROC pglMatrixTranslatefEXT; +GLEE_EXTERN PFNGLMATRIXTRANSLATEDEXTPROC pglMatrixTranslatedEXT; +GLEE_EXTERN PFNGLMATRIXFRUSTUMEXTPROC pglMatrixFrustumEXT; +GLEE_EXTERN PFNGLMATRIXORTHOEXTPROC pglMatrixOrthoEXT; +GLEE_EXTERN PFNGLMATRIXPOPEXTPROC pglMatrixPopEXT; +GLEE_EXTERN PFNGLMATRIXPUSHEXTPROC pglMatrixPushEXT; +GLEE_EXTERN PFNGLMATRIXLOADTRANSPOSEFEXTPROC pglMatrixLoadTransposefEXT; +GLEE_EXTERN PFNGLMATRIXLOADTRANSPOSEDEXTPROC pglMatrixLoadTransposedEXT; +GLEE_EXTERN PFNGLMATRIXMULTTRANSPOSEFEXTPROC pglMatrixMultTransposefEXT; +GLEE_EXTERN PFNGLMATRIXMULTTRANSPOSEDEXTPROC pglMatrixMultTransposedEXT; +GLEE_EXTERN PFNGLTEXTUREPARAMETERFEXTPROC pglTextureParameterfEXT; +GLEE_EXTERN PFNGLTEXTUREPARAMETERFVEXTPROC pglTextureParameterfvEXT; +GLEE_EXTERN PFNGLTEXTUREPARAMETERIEXTPROC pglTextureParameteriEXT; +GLEE_EXTERN PFNGLTEXTUREPARAMETERIVEXTPROC pglTextureParameterivEXT; +GLEE_EXTERN PFNGLTEXTUREIMAGE1DEXTPROC pglTextureImage1DEXT; +GLEE_EXTERN PFNGLTEXTUREIMAGE2DEXTPROC pglTextureImage2DEXT; +GLEE_EXTERN PFNGLTEXTURESUBIMAGE1DEXTPROC pglTextureSubImage1DEXT; +GLEE_EXTERN PFNGLTEXTURESUBIMAGE2DEXTPROC pglTextureSubImage2DEXT; +GLEE_EXTERN PFNGLCOPYTEXTUREIMAGE1DEXTPROC pglCopyTextureImage1DEXT; +GLEE_EXTERN PFNGLCOPYTEXTUREIMAGE2DEXTPROC pglCopyTextureImage2DEXT; +GLEE_EXTERN PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC pglCopyTextureSubImage1DEXT; +GLEE_EXTERN PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC pglCopyTextureSubImage2DEXT; +GLEE_EXTERN PFNGLGETTEXTUREIMAGEEXTPROC pglGetTextureImageEXT; +GLEE_EXTERN PFNGLGETTEXTUREPARAMETERFVEXTPROC pglGetTextureParameterfvEXT; +GLEE_EXTERN PFNGLGETTEXTUREPARAMETERIVEXTPROC pglGetTextureParameterivEXT; +GLEE_EXTERN PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC pglGetTextureLevelParameterfvEXT; +GLEE_EXTERN PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC pglGetTextureLevelParameterivEXT; +GLEE_EXTERN PFNGLTEXTUREIMAGE3DEXTPROC pglTextureImage3DEXT; +GLEE_EXTERN PFNGLTEXTURESUBIMAGE3DEXTPROC pglTextureSubImage3DEXT; +GLEE_EXTERN PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC pglCopyTextureSubImage3DEXT; +GLEE_EXTERN PFNGLMULTITEXPARAMETERFEXTPROC pglMultiTexParameterfEXT; +GLEE_EXTERN PFNGLMULTITEXPARAMETERFVEXTPROC pglMultiTexParameterfvEXT; +GLEE_EXTERN PFNGLMULTITEXPARAMETERIEXTPROC pglMultiTexParameteriEXT; +GLEE_EXTERN PFNGLMULTITEXPARAMETERIVEXTPROC pglMultiTexParameterivEXT; +GLEE_EXTERN PFNGLMULTITEXIMAGE1DEXTPROC pglMultiTexImage1DEXT; +GLEE_EXTERN PFNGLMULTITEXIMAGE2DEXTPROC pglMultiTexImage2DEXT; +GLEE_EXTERN PFNGLMULTITEXSUBIMAGE1DEXTPROC pglMultiTexSubImage1DEXT; +GLEE_EXTERN PFNGLMULTITEXSUBIMAGE2DEXTPROC pglMultiTexSubImage2DEXT; +GLEE_EXTERN PFNGLCOPYMULTITEXIMAGE1DEXTPROC pglCopyMultiTexImage1DEXT; +GLEE_EXTERN PFNGLCOPYMULTITEXIMAGE2DEXTPROC pglCopyMultiTexImage2DEXT; +GLEE_EXTERN PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC pglCopyMultiTexSubImage1DEXT; +GLEE_EXTERN PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC pglCopyMultiTexSubImage2DEXT; +GLEE_EXTERN PFNGLGETMULTITEXIMAGEEXTPROC pglGetMultiTexImageEXT; +GLEE_EXTERN PFNGLGETMULTITEXPARAMETERFVEXTPROC pglGetMultiTexParameterfvEXT; +GLEE_EXTERN PFNGLGETMULTITEXPARAMETERIVEXTPROC pglGetMultiTexParameterivEXT; +GLEE_EXTERN PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC pglGetMultiTexLevelParameterfvEXT; +GLEE_EXTERN PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC pglGetMultiTexLevelParameterivEXT; +GLEE_EXTERN PFNGLMULTITEXIMAGE3DEXTPROC pglMultiTexImage3DEXT; +GLEE_EXTERN PFNGLMULTITEXSUBIMAGE3DEXTPROC pglMultiTexSubImage3DEXT; +GLEE_EXTERN PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC pglCopyMultiTexSubImage3DEXT; +GLEE_EXTERN PFNGLBINDMULTITEXTUREEXTPROC pglBindMultiTextureEXT; +GLEE_EXTERN PFNGLENABLECLIENTSTATEINDEXEDEXTPROC pglEnableClientStateIndexedEXT; +GLEE_EXTERN PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC pglDisableClientStateIndexedEXT; +GLEE_EXTERN PFNGLMULTITEXCOORDPOINTEREXTPROC pglMultiTexCoordPointerEXT; +GLEE_EXTERN PFNGLMULTITEXENVFEXTPROC pglMultiTexEnvfEXT; +GLEE_EXTERN PFNGLMULTITEXENVFVEXTPROC pglMultiTexEnvfvEXT; +GLEE_EXTERN PFNGLMULTITEXENVIEXTPROC pglMultiTexEnviEXT; +GLEE_EXTERN PFNGLMULTITEXENVIVEXTPROC pglMultiTexEnvivEXT; +GLEE_EXTERN PFNGLMULTITEXGENDEXTPROC pglMultiTexGendEXT; +GLEE_EXTERN PFNGLMULTITEXGENDVEXTPROC pglMultiTexGendvEXT; +GLEE_EXTERN PFNGLMULTITEXGENFEXTPROC pglMultiTexGenfEXT; +GLEE_EXTERN PFNGLMULTITEXGENFVEXTPROC pglMultiTexGenfvEXT; +GLEE_EXTERN PFNGLMULTITEXGENIEXTPROC pglMultiTexGeniEXT; +GLEE_EXTERN PFNGLMULTITEXGENIVEXTPROC pglMultiTexGenivEXT; +GLEE_EXTERN PFNGLGETMULTITEXENVFVEXTPROC pglGetMultiTexEnvfvEXT; +GLEE_EXTERN PFNGLGETMULTITEXENVIVEXTPROC pglGetMultiTexEnvivEXT; +GLEE_EXTERN PFNGLGETMULTITEXGENDVEXTPROC pglGetMultiTexGendvEXT; +GLEE_EXTERN PFNGLGETMULTITEXGENFVEXTPROC pglGetMultiTexGenfvEXT; +GLEE_EXTERN PFNGLGETMULTITEXGENIVEXTPROC pglGetMultiTexGenivEXT; +GLEE_EXTERN PFNGLGETFLOATINDEXEDVEXTPROC pglGetFloatIndexedvEXT; +GLEE_EXTERN PFNGLGETDOUBLEINDEXEDVEXTPROC pglGetDoubleIndexedvEXT; +GLEE_EXTERN PFNGLGETPOINTERINDEXEDVEXTPROC pglGetPointerIndexedvEXT; +GLEE_EXTERN PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC pglCompressedTextureImage3DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC pglCompressedTextureImage2DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC pglCompressedTextureImage1DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC pglCompressedTextureSubImage3DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC pglCompressedTextureSubImage2DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC pglCompressedTextureSubImage1DEXT; +GLEE_EXTERN PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC pglGetCompressedTextureImageEXT; +GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC pglCompressedMultiTexImage3DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC pglCompressedMultiTexImage2DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC pglCompressedMultiTexImage1DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC pglCompressedMultiTexSubImage3DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC pglCompressedMultiTexSubImage2DEXT; +GLEE_EXTERN PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC pglCompressedMultiTexSubImage1DEXT; +GLEE_EXTERN PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC pglGetCompressedMultiTexImageEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMSTRINGEXTPROC pglNamedProgramStringEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC pglNamedProgramLocalParameter4dEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC pglNamedProgramLocalParameter4dvEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC pglNamedProgramLocalParameter4fEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC pglNamedProgramLocalParameter4fvEXT; +GLEE_EXTERN PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC pglGetNamedProgramLocalParameterdvEXT; +GLEE_EXTERN PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC pglGetNamedProgramLocalParameterfvEXT; +GLEE_EXTERN PFNGLGETNAMEDPROGRAMIVEXTPROC pglGetNamedProgramivEXT; +GLEE_EXTERN PFNGLGETNAMEDPROGRAMSTRINGEXTPROC pglGetNamedProgramStringEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC pglNamedProgramLocalParameters4fvEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC pglNamedProgramLocalParameterI4iEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC pglNamedProgramLocalParameterI4ivEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC pglNamedProgramLocalParametersI4ivEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC pglNamedProgramLocalParameterI4uiEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC pglNamedProgramLocalParameterI4uivEXT; +GLEE_EXTERN PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC pglNamedProgramLocalParametersI4uivEXT; +GLEE_EXTERN PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC pglGetNamedProgramLocalParameterIivEXT; +GLEE_EXTERN PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC pglGetNamedProgramLocalParameterIuivEXT; +GLEE_EXTERN PFNGLTEXTUREPARAMETERIIVEXTPROC pglTextureParameterIivEXT; +GLEE_EXTERN PFNGLTEXTUREPARAMETERIUIVEXTPROC pglTextureParameterIuivEXT; +GLEE_EXTERN PFNGLGETTEXTUREPARAMETERIIVEXTPROC pglGetTextureParameterIivEXT; +GLEE_EXTERN PFNGLGETTEXTUREPARAMETERIUIVEXTPROC pglGetTextureParameterIuivEXT; +GLEE_EXTERN PFNGLMULTITEXPARAMETERIIVEXTPROC pglMultiTexParameterIivEXT; +GLEE_EXTERN PFNGLMULTITEXPARAMETERIUIVEXTPROC pglMultiTexParameterIuivEXT; +GLEE_EXTERN PFNGLGETMULTITEXPARAMETERIIVEXTPROC pglGetMultiTexParameterIivEXT; +GLEE_EXTERN PFNGLGETMULTITEXPARAMETERIUIVEXTPROC pglGetMultiTexParameterIuivEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM1FEXTPROC pglProgramUniform1fEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM2FEXTPROC pglProgramUniform2fEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM3FEXTPROC pglProgramUniform3fEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM4FEXTPROC pglProgramUniform4fEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM1IEXTPROC pglProgramUniform1iEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM2IEXTPROC pglProgramUniform2iEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM3IEXTPROC pglProgramUniform3iEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM4IEXTPROC pglProgramUniform4iEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM1FVEXTPROC pglProgramUniform1fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM2FVEXTPROC pglProgramUniform2fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM3FVEXTPROC pglProgramUniform3fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM4FVEXTPROC pglProgramUniform4fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM1IVEXTPROC pglProgramUniform1ivEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM2IVEXTPROC pglProgramUniform2ivEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM3IVEXTPROC pglProgramUniform3ivEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM4IVEXTPROC pglProgramUniform4ivEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC pglProgramUniformMatrix2fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC pglProgramUniformMatrix3fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC pglProgramUniformMatrix4fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC pglProgramUniformMatrix2x3fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC pglProgramUniformMatrix3x2fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC pglProgramUniformMatrix2x4fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC pglProgramUniformMatrix4x2fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC pglProgramUniformMatrix3x4fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC pglProgramUniformMatrix4x3fvEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM1UIEXTPROC pglProgramUniform1uiEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM2UIEXTPROC pglProgramUniform2uiEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM3UIEXTPROC pglProgramUniform3uiEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM4UIEXTPROC pglProgramUniform4uiEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM1UIVEXTPROC pglProgramUniform1uivEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM2UIVEXTPROC pglProgramUniform2uivEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM3UIVEXTPROC pglProgramUniform3uivEXT; +GLEE_EXTERN PFNGLPROGRAMUNIFORM4UIVEXTPROC pglProgramUniform4uivEXT; +GLEE_EXTERN PFNGLNAMEDBUFFERDATAEXTPROC pglNamedBufferDataEXT; +GLEE_EXTERN PFNGLNAMEDBUFFERSUBDATAEXTPROC pglNamedBufferSubDataEXT; +GLEE_EXTERN PFNGLMAPNAMEDBUFFEREXTPROC pglMapNamedBufferEXT; +GLEE_EXTERN PFNGLUNMAPNAMEDBUFFEREXTPROC pglUnmapNamedBufferEXT; +GLEE_EXTERN PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC pglGetNamedBufferParameterivEXT; +GLEE_EXTERN PFNGLGETNAMEDBUFFERPOINTERVEXTPROC pglGetNamedBufferPointervEXT; +GLEE_EXTERN PFNGLGETNAMEDBUFFERSUBDATAEXTPROC pglGetNamedBufferSubDataEXT; +GLEE_EXTERN PFNGLTEXTUREBUFFEREXTPROC pglTextureBufferEXT; +GLEE_EXTERN PFNGLMULTITEXBUFFEREXTPROC pglMultiTexBufferEXT; +GLEE_EXTERN PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC pglNamedRenderbufferStorageEXT; +GLEE_EXTERN PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC pglGetNamedRenderbufferParameterivEXT; +GLEE_EXTERN PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC pglCheckNamedFramebufferStatusEXT; +GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC pglNamedFramebufferTexture1DEXT; +GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC pglNamedFramebufferTexture2DEXT; +GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC pglNamedFramebufferTexture3DEXT; +GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC pglNamedFramebufferRenderbufferEXT; +GLEE_EXTERN PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC pglGetNamedFramebufferAttachmentParameterivEXT; +GLEE_EXTERN PFNGLGENERATETEXTUREMIPMAPEXTPROC pglGenerateTextureMipmapEXT; +GLEE_EXTERN PFNGLGENERATEMULTITEXMIPMAPEXTPROC pglGenerateMultiTexMipmapEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC pglFramebufferDrawBufferEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC pglFramebufferDrawBuffersEXT; +GLEE_EXTERN PFNGLFRAMEBUFFERREADBUFFEREXTPROC pglFramebufferReadBufferEXT; +GLEE_EXTERN PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC pglGetFramebufferParameterivEXT; +GLEE_EXTERN PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pglNamedRenderbufferStorageMultisampleEXT; +GLEE_EXTERN PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC pglNamedRenderbufferStorageMultisampleCoverageEXT; +GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC pglNamedFramebufferTextureEXT; +GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC pglNamedFramebufferTextureLayerEXT; +GLEE_EXTERN PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC pglNamedFramebufferTextureFaceEXT; +GLEE_EXTERN PFNGLTEXTURERENDERBUFFEREXTPROC pglTextureRenderbufferEXT; +GLEE_EXTERN PFNGLMULTITEXRENDERBUFFEREXTPROC pglMultiTexRenderbufferEXT; +#define glClientAttribDefaultEXT pglClientAttribDefaultEXT +#define glPushClientAttribDefaultEXT pglPushClientAttribDefaultEXT +#define glMatrixLoadfEXT pglMatrixLoadfEXT +#define glMatrixLoaddEXT pglMatrixLoaddEXT +#define glMatrixMultfEXT pglMatrixMultfEXT +#define glMatrixMultdEXT pglMatrixMultdEXT +#define glMatrixLoadIdentityEXT pglMatrixLoadIdentityEXT +#define glMatrixRotatefEXT pglMatrixRotatefEXT +#define glMatrixRotatedEXT pglMatrixRotatedEXT +#define glMatrixScalefEXT pglMatrixScalefEXT +#define glMatrixScaledEXT pglMatrixScaledEXT +#define glMatrixTranslatefEXT pglMatrixTranslatefEXT +#define glMatrixTranslatedEXT pglMatrixTranslatedEXT +#define glMatrixFrustumEXT pglMatrixFrustumEXT +#define glMatrixOrthoEXT pglMatrixOrthoEXT +#define glMatrixPopEXT pglMatrixPopEXT +#define glMatrixPushEXT pglMatrixPushEXT +#define glMatrixLoadTransposefEXT pglMatrixLoadTransposefEXT +#define glMatrixLoadTransposedEXT pglMatrixLoadTransposedEXT +#define glMatrixMultTransposefEXT pglMatrixMultTransposefEXT +#define glMatrixMultTransposedEXT pglMatrixMultTransposedEXT +#define glTextureParameterfEXT pglTextureParameterfEXT +#define glTextureParameterfvEXT pglTextureParameterfvEXT +#define glTextureParameteriEXT pglTextureParameteriEXT +#define glTextureParameterivEXT pglTextureParameterivEXT +#define glTextureImage1DEXT pglTextureImage1DEXT +#define glTextureImage2DEXT pglTextureImage2DEXT +#define glTextureSubImage1DEXT pglTextureSubImage1DEXT +#define glTextureSubImage2DEXT pglTextureSubImage2DEXT +#define glCopyTextureImage1DEXT pglCopyTextureImage1DEXT +#define glCopyTextureImage2DEXT pglCopyTextureImage2DEXT +#define glCopyTextureSubImage1DEXT pglCopyTextureSubImage1DEXT +#define glCopyTextureSubImage2DEXT pglCopyTextureSubImage2DEXT +#define glGetTextureImageEXT pglGetTextureImageEXT +#define glGetTextureParameterfvEXT pglGetTextureParameterfvEXT +#define glGetTextureParameterivEXT pglGetTextureParameterivEXT +#define glGetTextureLevelParameterfvEXT pglGetTextureLevelParameterfvEXT +#define glGetTextureLevelParameterivEXT pglGetTextureLevelParameterivEXT +#define glTextureImage3DEXT pglTextureImage3DEXT +#define glTextureSubImage3DEXT pglTextureSubImage3DEXT +#define glCopyTextureSubImage3DEXT pglCopyTextureSubImage3DEXT +#define glMultiTexParameterfEXT pglMultiTexParameterfEXT +#define glMultiTexParameterfvEXT pglMultiTexParameterfvEXT +#define glMultiTexParameteriEXT pglMultiTexParameteriEXT +#define glMultiTexParameterivEXT pglMultiTexParameterivEXT +#define glMultiTexImage1DEXT pglMultiTexImage1DEXT +#define glMultiTexImage2DEXT pglMultiTexImage2DEXT +#define glMultiTexSubImage1DEXT pglMultiTexSubImage1DEXT +#define glMultiTexSubImage2DEXT pglMultiTexSubImage2DEXT +#define glCopyMultiTexImage1DEXT pglCopyMultiTexImage1DEXT +#define glCopyMultiTexImage2DEXT pglCopyMultiTexImage2DEXT +#define glCopyMultiTexSubImage1DEXT pglCopyMultiTexSubImage1DEXT +#define glCopyMultiTexSubImage2DEXT pglCopyMultiTexSubImage2DEXT +#define glGetMultiTexImageEXT pglGetMultiTexImageEXT +#define glGetMultiTexParameterfvEXT pglGetMultiTexParameterfvEXT +#define glGetMultiTexParameterivEXT pglGetMultiTexParameterivEXT +#define glGetMultiTexLevelParameterfvEXT pglGetMultiTexLevelParameterfvEXT +#define glGetMultiTexLevelParameterivEXT pglGetMultiTexLevelParameterivEXT +#define glMultiTexImage3DEXT pglMultiTexImage3DEXT +#define glMultiTexSubImage3DEXT pglMultiTexSubImage3DEXT +#define glCopyMultiTexSubImage3DEXT pglCopyMultiTexSubImage3DEXT +#define glBindMultiTextureEXT pglBindMultiTextureEXT +#define glEnableClientStateIndexedEXT pglEnableClientStateIndexedEXT +#define glDisableClientStateIndexedEXT pglDisableClientStateIndexedEXT +#define glMultiTexCoordPointerEXT pglMultiTexCoordPointerEXT +#define glMultiTexEnvfEXT pglMultiTexEnvfEXT +#define glMultiTexEnvfvEXT pglMultiTexEnvfvEXT +#define glMultiTexEnviEXT pglMultiTexEnviEXT +#define glMultiTexEnvivEXT pglMultiTexEnvivEXT +#define glMultiTexGendEXT pglMultiTexGendEXT +#define glMultiTexGendvEXT pglMultiTexGendvEXT +#define glMultiTexGenfEXT pglMultiTexGenfEXT +#define glMultiTexGenfvEXT pglMultiTexGenfvEXT +#define glMultiTexGeniEXT pglMultiTexGeniEXT +#define glMultiTexGenivEXT pglMultiTexGenivEXT +#define glGetMultiTexEnvfvEXT pglGetMultiTexEnvfvEXT +#define glGetMultiTexEnvivEXT pglGetMultiTexEnvivEXT +#define glGetMultiTexGendvEXT pglGetMultiTexGendvEXT +#define glGetMultiTexGenfvEXT pglGetMultiTexGenfvEXT +#define glGetMultiTexGenivEXT pglGetMultiTexGenivEXT +#define glGetFloatIndexedvEXT pglGetFloatIndexedvEXT +#define glGetDoubleIndexedvEXT pglGetDoubleIndexedvEXT +#define glGetPointerIndexedvEXT pglGetPointerIndexedvEXT +#define glCompressedTextureImage3DEXT pglCompressedTextureImage3DEXT +#define glCompressedTextureImage2DEXT pglCompressedTextureImage2DEXT +#define glCompressedTextureImage1DEXT pglCompressedTextureImage1DEXT +#define glCompressedTextureSubImage3DEXT pglCompressedTextureSubImage3DEXT +#define glCompressedTextureSubImage2DEXT pglCompressedTextureSubImage2DEXT +#define glCompressedTextureSubImage1DEXT pglCompressedTextureSubImage1DEXT +#define glGetCompressedTextureImageEXT pglGetCompressedTextureImageEXT +#define glCompressedMultiTexImage3DEXT pglCompressedMultiTexImage3DEXT +#define glCompressedMultiTexImage2DEXT pglCompressedMultiTexImage2DEXT +#define glCompressedMultiTexImage1DEXT pglCompressedMultiTexImage1DEXT +#define glCompressedMultiTexSubImage3DEXT pglCompressedMultiTexSubImage3DEXT +#define glCompressedMultiTexSubImage2DEXT pglCompressedMultiTexSubImage2DEXT +#define glCompressedMultiTexSubImage1DEXT pglCompressedMultiTexSubImage1DEXT +#define glGetCompressedMultiTexImageEXT pglGetCompressedMultiTexImageEXT +#define glNamedProgramStringEXT pglNamedProgramStringEXT +#define glNamedProgramLocalParameter4dEXT pglNamedProgramLocalParameter4dEXT +#define glNamedProgramLocalParameter4dvEXT pglNamedProgramLocalParameter4dvEXT +#define glNamedProgramLocalParameter4fEXT pglNamedProgramLocalParameter4fEXT +#define glNamedProgramLocalParameter4fvEXT pglNamedProgramLocalParameter4fvEXT +#define glGetNamedProgramLocalParameterdvEXT pglGetNamedProgramLocalParameterdvEXT +#define glGetNamedProgramLocalParameterfvEXT pglGetNamedProgramLocalParameterfvEXT +#define glGetNamedProgramivEXT pglGetNamedProgramivEXT +#define glGetNamedProgramStringEXT pglGetNamedProgramStringEXT +#define glNamedProgramLocalParameters4fvEXT pglNamedProgramLocalParameters4fvEXT +#define glNamedProgramLocalParameterI4iEXT pglNamedProgramLocalParameterI4iEXT +#define glNamedProgramLocalParameterI4ivEXT pglNamedProgramLocalParameterI4ivEXT +#define glNamedProgramLocalParametersI4ivEXT pglNamedProgramLocalParametersI4ivEXT +#define glNamedProgramLocalParameterI4uiEXT pglNamedProgramLocalParameterI4uiEXT +#define glNamedProgramLocalParameterI4uivEXT pglNamedProgramLocalParameterI4uivEXT +#define glNamedProgramLocalParametersI4uivEXT pglNamedProgramLocalParametersI4uivEXT +#define glGetNamedProgramLocalParameterIivEXT pglGetNamedProgramLocalParameterIivEXT +#define glGetNamedProgramLocalParameterIuivEXT pglGetNamedProgramLocalParameterIuivEXT +#define glTextureParameterIivEXT pglTextureParameterIivEXT +#define glTextureParameterIuivEXT pglTextureParameterIuivEXT +#define glGetTextureParameterIivEXT pglGetTextureParameterIivEXT +#define glGetTextureParameterIuivEXT pglGetTextureParameterIuivEXT +#define glMultiTexParameterIivEXT pglMultiTexParameterIivEXT +#define glMultiTexParameterIuivEXT pglMultiTexParameterIuivEXT +#define glGetMultiTexParameterIivEXT pglGetMultiTexParameterIivEXT +#define glGetMultiTexParameterIuivEXT pglGetMultiTexParameterIuivEXT +#define glProgramUniform1fEXT pglProgramUniform1fEXT +#define glProgramUniform2fEXT pglProgramUniform2fEXT +#define glProgramUniform3fEXT pglProgramUniform3fEXT +#define glProgramUniform4fEXT pglProgramUniform4fEXT +#define glProgramUniform1iEXT pglProgramUniform1iEXT +#define glProgramUniform2iEXT pglProgramUniform2iEXT +#define glProgramUniform3iEXT pglProgramUniform3iEXT +#define glProgramUniform4iEXT pglProgramUniform4iEXT +#define glProgramUniform1fvEXT pglProgramUniform1fvEXT +#define glProgramUniform2fvEXT pglProgramUniform2fvEXT +#define glProgramUniform3fvEXT pglProgramUniform3fvEXT +#define glProgramUniform4fvEXT pglProgramUniform4fvEXT +#define glProgramUniform1ivEXT pglProgramUniform1ivEXT +#define glProgramUniform2ivEXT pglProgramUniform2ivEXT +#define glProgramUniform3ivEXT pglProgramUniform3ivEXT +#define glProgramUniform4ivEXT pglProgramUniform4ivEXT +#define glProgramUniformMatrix2fvEXT pglProgramUniformMatrix2fvEXT +#define glProgramUniformMatrix3fvEXT pglProgramUniformMatrix3fvEXT +#define glProgramUniformMatrix4fvEXT pglProgramUniformMatrix4fvEXT +#define glProgramUniformMatrix2x3fvEXT pglProgramUniformMatrix2x3fvEXT +#define glProgramUniformMatrix3x2fvEXT pglProgramUniformMatrix3x2fvEXT +#define glProgramUniformMatrix2x4fvEXT pglProgramUniformMatrix2x4fvEXT +#define glProgramUniformMatrix4x2fvEXT pglProgramUniformMatrix4x2fvEXT +#define glProgramUniformMatrix3x4fvEXT pglProgramUniformMatrix3x4fvEXT +#define glProgramUniformMatrix4x3fvEXT pglProgramUniformMatrix4x3fvEXT +#define glProgramUniform1uiEXT pglProgramUniform1uiEXT +#define glProgramUniform2uiEXT pglProgramUniform2uiEXT +#define glProgramUniform3uiEXT pglProgramUniform3uiEXT +#define glProgramUniform4uiEXT pglProgramUniform4uiEXT +#define glProgramUniform1uivEXT pglProgramUniform1uivEXT +#define glProgramUniform2uivEXT pglProgramUniform2uivEXT +#define glProgramUniform3uivEXT pglProgramUniform3uivEXT +#define glProgramUniform4uivEXT pglProgramUniform4uivEXT +#define glNamedBufferDataEXT pglNamedBufferDataEXT +#define glNamedBufferSubDataEXT pglNamedBufferSubDataEXT +#define glMapNamedBufferEXT pglMapNamedBufferEXT +#define glUnmapNamedBufferEXT pglUnmapNamedBufferEXT +#define glGetNamedBufferParameterivEXT pglGetNamedBufferParameterivEXT +#define glGetNamedBufferPointervEXT pglGetNamedBufferPointervEXT +#define glGetNamedBufferSubDataEXT pglGetNamedBufferSubDataEXT +#define glTextureBufferEXT pglTextureBufferEXT +#define glMultiTexBufferEXT pglMultiTexBufferEXT +#define glNamedRenderbufferStorageEXT pglNamedRenderbufferStorageEXT +#define glGetNamedRenderbufferParameterivEXT pglGetNamedRenderbufferParameterivEXT +#define glCheckNamedFramebufferStatusEXT pglCheckNamedFramebufferStatusEXT +#define glNamedFramebufferTexture1DEXT pglNamedFramebufferTexture1DEXT +#define glNamedFramebufferTexture2DEXT pglNamedFramebufferTexture2DEXT +#define glNamedFramebufferTexture3DEXT pglNamedFramebufferTexture3DEXT +#define glNamedFramebufferRenderbufferEXT pglNamedFramebufferRenderbufferEXT +#define glGetNamedFramebufferAttachmentParameterivEXT pglGetNamedFramebufferAttachmentParameterivEXT +#define glGenerateTextureMipmapEXT pglGenerateTextureMipmapEXT +#define glGenerateMultiTexMipmapEXT pglGenerateMultiTexMipmapEXT +#define glFramebufferDrawBufferEXT pglFramebufferDrawBufferEXT +#define glFramebufferDrawBuffersEXT pglFramebufferDrawBuffersEXT +#define glFramebufferReadBufferEXT pglFramebufferReadBufferEXT +#define glGetFramebufferParameterivEXT pglGetFramebufferParameterivEXT +#define glNamedRenderbufferStorageMultisampleEXT pglNamedRenderbufferStorageMultisampleEXT +#define glNamedRenderbufferStorageMultisampleCoverageEXT pglNamedRenderbufferStorageMultisampleCoverageEXT +#define glNamedFramebufferTextureEXT pglNamedFramebufferTextureEXT +#define glNamedFramebufferTextureLayerEXT pglNamedFramebufferTextureLayerEXT +#define glNamedFramebufferTextureFaceEXT pglNamedFramebufferTextureFaceEXT +#define glTextureRenderbufferEXT pglTextureRenderbufferEXT +#define glMultiTexRenderbufferEXT pglMultiTexRenderbufferEXT +#endif + +/* GL_EXT_vertex_array_bgra */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#define __GLEE_GL_EXT_vertex_array_bgra 1 +/* Constants */ +#endif + +/* GL_SGIX_texture_select */ + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#define __GLEE_GL_SGIX_texture_select 1 +/* Constants */ +#endif + +/* GL_INGR_blend_func_separate */ + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#define __GLEE_GL_INGR_blend_func_separate 1 +/* Constants */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLEE_EXTERN PFNGLBLENDFUNCSEPARATEINGRPROC pglBlendFuncSeparateINGR; +#define glBlendFuncSeparateINGR pglBlendFuncSeparateINGR +#endif + +/* GL_SGIX_depth_pass_instrument */ + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#define __GLEE_GL_SGIX_depth_pass_instrument 1 +/* Constants */ +#endif + +/* GL_SGIX_igloo_interface */ + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#define __GLEE_GL_SGIX_igloo_interface 1 +/* Constants */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid * params); +GLEE_EXTERN PFNGLIGLOOINTERFACESGIXPROC pglIglooInterfaceSGIX; +#define glIglooInterfaceSGIX pglIglooInterfaceSGIX +#endif + +/* GL_EXT_fragment_lighting */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 +#define __GLEE_GL_EXT_fragment_lighting 1 +/* Constants */ +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 +typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint * params); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat * params); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint * params); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat * params); +typedef GLvoid (APIENTRYP PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint * params); +typedef GLvoid (APIENTRYP PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat * params); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat * params); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint * params); +typedef GLvoid (APIENTRYP PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef GLvoid (APIENTRYP PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat * params); +typedef GLvoid (APIENTRYP PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint * params); +typedef GLvoid (APIENTRYP PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); +GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELIEXTPROC pglFragmentLightModeliEXT; +GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELFEXTPROC pglFragmentLightModelfEXT; +GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELIVEXTPROC pglFragmentLightModelivEXT; +GLEE_EXTERN PFNGLFRAGMENTLIGHTMODELFVEXTPROC pglFragmentLightModelfvEXT; +GLEE_EXTERN PFNGLFRAGMENTLIGHTIEXTPROC pglFragmentLightiEXT; +GLEE_EXTERN PFNGLFRAGMENTLIGHTFEXTPROC pglFragmentLightfEXT; +GLEE_EXTERN PFNGLFRAGMENTLIGHTIVEXTPROC pglFragmentLightivEXT; +GLEE_EXTERN PFNGLFRAGMENTLIGHTFVEXTPROC pglFragmentLightfvEXT; +GLEE_EXTERN PFNGLGETFRAGMENTLIGHTIVEXTPROC pglGetFragmentLightivEXT; +GLEE_EXTERN PFNGLGETFRAGMENTLIGHTFVEXTPROC pglGetFragmentLightfvEXT; +GLEE_EXTERN PFNGLFRAGMENTMATERIALFEXTPROC pglFragmentMaterialfEXT; +GLEE_EXTERN PFNGLFRAGMENTMATERIALIEXTPROC pglFragmentMaterialiEXT; +GLEE_EXTERN PFNGLFRAGMENTMATERIALFVEXTPROC pglFragmentMaterialfvEXT; +GLEE_EXTERN PFNGLFRAGMENTMATERIALIVEXTPROC pglFragmentMaterialivEXT; +GLEE_EXTERN PFNGLFRAGMENTCOLORMATERIALEXTPROC pglFragmentColorMaterialEXT; +GLEE_EXTERN PFNGLGETFRAGMENTMATERIALFVEXTPROC pglGetFragmentMaterialfvEXT; +GLEE_EXTERN PFNGLGETFRAGMENTMATERIALIVEXTPROC pglGetFragmentMaterialivEXT; +GLEE_EXTERN PFNGLLIGHTENVIEXTPROC pglLightEnviEXT; +#define glFragmentLightModeliEXT pglFragmentLightModeliEXT +#define glFragmentLightModelfEXT pglFragmentLightModelfEXT +#define glFragmentLightModelivEXT pglFragmentLightModelivEXT +#define glFragmentLightModelfvEXT pglFragmentLightModelfvEXT +#define glFragmentLightiEXT pglFragmentLightiEXT +#define glFragmentLightfEXT pglFragmentLightfEXT +#define glFragmentLightivEXT pglFragmentLightivEXT +#define glFragmentLightfvEXT pglFragmentLightfvEXT +#define glGetFragmentLightivEXT pglGetFragmentLightivEXT +#define glGetFragmentLightfvEXT pglGetFragmentLightfvEXT +#define glFragmentMaterialfEXT pglFragmentMaterialfEXT +#define glFragmentMaterialiEXT pglFragmentMaterialiEXT +#define glFragmentMaterialfvEXT pglFragmentMaterialfvEXT +#define glFragmentMaterialivEXT pglFragmentMaterialivEXT +#define glFragmentColorMaterialEXT pglFragmentColorMaterialEXT +#define glGetFragmentMaterialfvEXT pglGetFragmentMaterialfvEXT +#define glGetFragmentMaterialivEXT pglGetFragmentMaterialivEXT +#define glLightEnviEXT pglLightEnviEXT +#endif + +/* GL_EXT_scene_marker */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 +#define __GLEE_GL_EXT_scene_marker 1 +/* Constants */ +typedef GLvoid (APIENTRYP PFNGLBEGINSCENEEXTPROC) (); +typedef GLvoid (APIENTRYP PFNGLENDSCENEEXTPROC) (); +GLEE_EXTERN PFNGLBEGINSCENEEXTPROC pglBeginSceneEXT; +GLEE_EXTERN PFNGLENDSCENEEXTPROC pglEndSceneEXT; +#define glBeginSceneEXT pglBeginSceneEXT +#define glEndSceneEXT pglEndSceneEXT +#endif + +/* GL_EXT_texture_compression_dxt1 */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 +#define __GLEE_GL_EXT_texture_compression_dxt1 1 +/* Constants */ +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#endif + +/* GL_EXT_texture_env */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 +#define __GLEE_GL_EXT_texture_env 1 +/* Constants */ +#define GL_TEXTURE_ENV0_EXT 0 +#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 +#define GL_ENV_COPY_EXT 0 +#define GL_ENV_REPLACE_EXT 0 +#define GL_ENV_MODULATE_EXT 0 +#define GL_ENV_ADD_EXT 0 +#define GL_ENV_SUBTRACT_EXT 0 +#define GL_ENV_REVERSE_SUBTRACT_EXT 0 +#define GL_ENV_BLEND_EXT 0 +#define GL_ENV_REVERSE_BLEND_EXT 0 +#define GL_TEXTURE_ENV_SHIFT_EXT 0 +#endif + +/* GL_IBM_static_data */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 +#define __GLEE_GL_IBM_static_data 1 +/* Constants */ +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 +#endif + +/* GL_OES_byte_coordinates */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 +#define __GLEE_GL_OES_byte_coordinates 1 +/* Constants */ +#define GL_BYTE 0x1400 +#endif + +/* GL_OES_compressed_paletted_texture */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#define __GLEE_GL_OES_compressed_paletted_texture 1 +/* Constants */ +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif + +/* GL_OES_single_precision */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 +#define __GLEE_GL_OES_single_precision 1 +/* Constants */ +typedef GLvoid (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef GLvoid (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef GLvoid (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef GLvoid (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); +typedef GLvoid (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); +typedef GLvoid (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); +GLEE_EXTERN PFNGLDEPTHRANGEFOESPROC pglDepthRangefOES; +GLEE_EXTERN PFNGLFRUSTUMFOESPROC pglFrustumfOES; +GLEE_EXTERN PFNGLORTHOFOESPROC pglOrthofOES; +GLEE_EXTERN PFNGLCLIPPLANEFOESPROC pglClipPlanefOES; +GLEE_EXTERN PFNGLGETCLIPPLANEFOESPROC pglGetClipPlanefOES; +GLEE_EXTERN PFNGLCLEARDEPTHFOESPROC pglClearDepthfOES; +#define glDepthRangefOES pglDepthRangefOES +#define glFrustumfOES pglFrustumfOES +#define glOrthofOES pglOrthofOES +#define glClipPlanefOES pglClipPlanefOES +#define glGetClipPlanefOES pglGetClipPlanefOES +#define glClearDepthfOES pglClearDepthfOES +#endif + +/* GL_SGIX_pixel_texture_bits */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 +#define __GLEE_GL_SGIX_pixel_texture_bits 1 +/* Constants */ +#endif + +/* GL_SGIX_texture_range */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 +#define __GLEE_GL_SGIX_texture_range 1 +/* Constants */ +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB +#endif + +/* WGL */ + +#ifdef WIN32 + +/* Extension querying variables */ + +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_buffer_region; +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_multisample; +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_extensions_string; +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_pixel_format; +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_make_current_read; +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_pbuffer; +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_render_texture; +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_pixel_format_float; +GLEE_EXTERN GLboolean _GLEE_WGL_ARB_create_context; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_make_current_read; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_pixel_format; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_pbuffer; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_depth_float; +GLEE_EXTERN GLboolean _GLEE_WGL_3DFX_multisample; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_multisample; +GLEE_EXTERN GLboolean _GLEE_WGL_I3D_digital_video_control; +GLEE_EXTERN GLboolean _GLEE_WGL_I3D_gamma; +GLEE_EXTERN GLboolean _GLEE_WGL_I3D_genlock; +GLEE_EXTERN GLboolean _GLEE_WGL_I3D_image_buffer; +GLEE_EXTERN GLboolean _GLEE_WGL_I3D_swap_frame_lock; +GLEE_EXTERN GLboolean _GLEE_WGL_NV_render_depth_texture; +GLEE_EXTERN GLboolean _GLEE_WGL_NV_render_texture_rectangle; +GLEE_EXTERN GLboolean _GLEE_WGL_ATI_pixel_format_float; +GLEE_EXTERN GLboolean _GLEE_WGL_NV_float_buffer; +GLEE_EXTERN GLboolean _GLEE_WGL_3DL_stereo_control; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_pixel_format_packed_float; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_framebuffer_sRGB; +GLEE_EXTERN GLboolean _GLEE_WGL_NV_present_video; +GLEE_EXTERN GLboolean _GLEE_WGL_NV_video_out; +GLEE_EXTERN GLboolean _GLEE_WGL_NV_swap_group; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_display_color_table; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_extensions_string; +GLEE_EXTERN GLboolean _GLEE_WGL_EXT_swap_control; +GLEE_EXTERN GLboolean _GLEE_WGL_NV_vertex_array_range; +GLEE_EXTERN GLboolean _GLEE_WGL_OML_sync_control; +GLEE_EXTERN GLboolean _GLEE_WGL_I3D_swap_frame_usage; +GLEE_EXTERN GLboolean _GLEE_WGL_NV_video_output; + +/* Aliases for extension querying variables */ + +#define GLEE_WGL_ARB_buffer_region GLeeEnabled(&_GLEE_WGL_ARB_buffer_region) +#define GLEE_WGL_ARB_multisample GLeeEnabled(&_GLEE_WGL_ARB_multisample) +#define GLEE_WGL_ARB_extensions_string GLeeEnabled(&_GLEE_WGL_ARB_extensions_string) +#define GLEE_WGL_ARB_pixel_format GLeeEnabled(&_GLEE_WGL_ARB_pixel_format) +#define GLEE_WGL_ARB_make_current_read GLeeEnabled(&_GLEE_WGL_ARB_make_current_read) +#define GLEE_WGL_ARB_pbuffer GLeeEnabled(&_GLEE_WGL_ARB_pbuffer) +#define GLEE_WGL_ARB_render_texture GLeeEnabled(&_GLEE_WGL_ARB_render_texture) +#define GLEE_WGL_ARB_pixel_format_float GLeeEnabled(&_GLEE_WGL_ARB_pixel_format_float) +#define GLEE_WGL_ARB_create_context GLeeEnabled(&_GLEE_WGL_ARB_create_context) +#define GLEE_WGL_EXT_make_current_read GLeeEnabled(&_GLEE_WGL_EXT_make_current_read) +#define GLEE_WGL_EXT_pixel_format GLeeEnabled(&_GLEE_WGL_EXT_pixel_format) +#define GLEE_WGL_EXT_pbuffer GLeeEnabled(&_GLEE_WGL_EXT_pbuffer) +#define GLEE_WGL_EXT_depth_float GLeeEnabled(&_GLEE_WGL_EXT_depth_float) +#define GLEE_WGL_3DFX_multisample GLeeEnabled(&_GLEE_WGL_3DFX_multisample) +#define GLEE_WGL_EXT_multisample GLeeEnabled(&_GLEE_WGL_EXT_multisample) +#define GLEE_WGL_I3D_digital_video_control GLeeEnabled(&_GLEE_WGL_I3D_digital_video_control) +#define GLEE_WGL_I3D_gamma GLeeEnabled(&_GLEE_WGL_I3D_gamma) +#define GLEE_WGL_I3D_genlock GLeeEnabled(&_GLEE_WGL_I3D_genlock) +#define GLEE_WGL_I3D_image_buffer GLeeEnabled(&_GLEE_WGL_I3D_image_buffer) +#define GLEE_WGL_I3D_swap_frame_lock GLeeEnabled(&_GLEE_WGL_I3D_swap_frame_lock) +#define GLEE_WGL_NV_render_depth_texture GLeeEnabled(&_GLEE_WGL_NV_render_depth_texture) +#define GLEE_WGL_NV_render_texture_rectangle GLeeEnabled(&_GLEE_WGL_NV_render_texture_rectangle) +#define GLEE_WGL_ATI_pixel_format_float GLeeEnabled(&_GLEE_WGL_ATI_pixel_format_float) +#define GLEE_WGL_NV_float_buffer GLeeEnabled(&_GLEE_WGL_NV_float_buffer) +#define GLEE_WGL_3DL_stereo_control GLeeEnabled(&_GLEE_WGL_3DL_stereo_control) +#define GLEE_WGL_EXT_pixel_format_packed_float GLeeEnabled(&_GLEE_WGL_EXT_pixel_format_packed_float) +#define GLEE_WGL_EXT_framebuffer_sRGB GLeeEnabled(&_GLEE_WGL_EXT_framebuffer_sRGB) +#define GLEE_WGL_NV_present_video GLeeEnabled(&_GLEE_WGL_NV_present_video) +#define GLEE_WGL_NV_video_out GLeeEnabled(&_GLEE_WGL_NV_video_out) +#define GLEE_WGL_NV_swap_group GLeeEnabled(&_GLEE_WGL_NV_swap_group) +#define GLEE_WGL_EXT_display_color_table GLeeEnabled(&_GLEE_WGL_EXT_display_color_table) +#define GLEE_WGL_EXT_extensions_string GLeeEnabled(&_GLEE_WGL_EXT_extensions_string) +#define GLEE_WGL_EXT_swap_control GLeeEnabled(&_GLEE_WGL_EXT_swap_control) +#define GLEE_WGL_NV_vertex_array_range GLeeEnabled(&_GLEE_WGL_NV_vertex_array_range) +#define GLEE_WGL_OML_sync_control GLeeEnabled(&_GLEE_WGL_OML_sync_control) +#define GLEE_WGL_I3D_swap_frame_usage GLeeEnabled(&_GLEE_WGL_I3D_swap_frame_usage) +#define GLEE_WGL_NV_video_output GLeeEnabled(&_GLEE_WGL_NV_video_output) + +/* WGL_ARB_buffer_region */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 +#define __GLEE_WGL_ARB_buffer_region 1 +/* Constants */ +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 +typedef HANDLE (APIENTRYP PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (APIENTRYP PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (APIENTRYP PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); +typedef BOOL (APIENTRYP PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +GLEE_EXTERN PFNWGLCREATEBUFFERREGIONARBPROC pwglCreateBufferRegionARB; +GLEE_EXTERN PFNWGLDELETEBUFFERREGIONARBPROC pwglDeleteBufferRegionARB; +GLEE_EXTERN PFNWGLSAVEBUFFERREGIONARBPROC pwglSaveBufferRegionARB; +GLEE_EXTERN PFNWGLRESTOREBUFFERREGIONARBPROC pwglRestoreBufferRegionARB; +#define wglCreateBufferRegionARB pwglCreateBufferRegionARB +#define wglDeleteBufferRegionARB pwglDeleteBufferRegionARB +#define wglSaveBufferRegionARB pwglSaveBufferRegionARB +#define wglRestoreBufferRegionARB pwglRestoreBufferRegionARB +#endif + +/* WGL_ARB_multisample */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 +#define __GLEE_WGL_ARB_multisample 1 +/* Constants */ +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 +#endif + +/* WGL_ARB_extensions_string */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 +#define __GLEE_WGL_ARB_extensions_string 1 +/* Constants */ +typedef const char * (APIENTRYP PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); +GLEE_EXTERN PFNWGLGETEXTENSIONSSTRINGARBPROC pwglGetExtensionsStringARB; +#define wglGetExtensionsStringARB pwglGetExtensionsStringARB +#endif + +/* WGL_ARB_pixel_format */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 +#define __GLEE_WGL_ARB_pixel_format 1 +/* Constants */ +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, int * piValues); +typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, FLOAT * pfValues); +typedef BOOL (APIENTRYP PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats); +GLEE_EXTERN PFNWGLGETPIXELFORMATATTRIBIVARBPROC pwglGetPixelFormatAttribivARB; +GLEE_EXTERN PFNWGLGETPIXELFORMATATTRIBFVARBPROC pwglGetPixelFormatAttribfvARB; +GLEE_EXTERN PFNWGLCHOOSEPIXELFORMATARBPROC pwglChoosePixelFormatARB; +#define wglGetPixelFormatAttribivARB pwglGetPixelFormatAttribivARB +#define wglGetPixelFormatAttribfvARB pwglGetPixelFormatAttribfvARB +#define wglChoosePixelFormatARB pwglChoosePixelFormatARB +#endif + +/* WGL_ARB_make_current_read */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 +#define __GLEE_WGL_ARB_make_current_read 1 +/* Constants */ +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 +typedef BOOL (APIENTRYP PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (APIENTRYP PFNWGLGETCURRENTREADDCARBPROC) (); +GLEE_EXTERN PFNWGLMAKECONTEXTCURRENTARBPROC pwglMakeContextCurrentARB; +GLEE_EXTERN PFNWGLGETCURRENTREADDCARBPROC pwglGetCurrentReadDCARB; +#define wglMakeContextCurrentARB pwglMakeContextCurrentARB +#define wglGetCurrentReadDCARB pwglGetCurrentReadDCARB +#endif + +/* WGL_ARB_pbuffer */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 +#define __GLEE_WGL_ARB_pbuffer 1 +/* Constants */ +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 +typedef HPBUFFERARB (APIENTRYP PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList); +typedef HDC (APIENTRYP PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef int (APIENTRYP PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); +typedef BOOL (APIENTRYP PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (APIENTRYP PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int * piValue); +GLEE_EXTERN PFNWGLCREATEPBUFFERARBPROC pwglCreatePbufferARB; +GLEE_EXTERN PFNWGLGETPBUFFERDCARBPROC pwglGetPbufferDCARB; +GLEE_EXTERN PFNWGLRELEASEPBUFFERDCARBPROC pwglReleasePbufferDCARB; +GLEE_EXTERN PFNWGLDESTROYPBUFFERARBPROC pwglDestroyPbufferARB; +GLEE_EXTERN PFNWGLQUERYPBUFFERARBPROC pwglQueryPbufferARB; +#define wglCreatePbufferARB pwglCreatePbufferARB +#define wglGetPbufferDCARB pwglGetPbufferDCARB +#define wglReleasePbufferDCARB pwglReleasePbufferDCARB +#define wglDestroyPbufferARB pwglDestroyPbufferARB +#define wglQueryPbufferARB pwglQueryPbufferARB +#endif + +/* WGL_ARB_render_texture */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 +#define __GLEE_WGL_ARB_render_texture 1 +/* Constants */ +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 +typedef BOOL (APIENTRYP PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (APIENTRYP PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (APIENTRYP PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int * piAttribList); +GLEE_EXTERN PFNWGLBINDTEXIMAGEARBPROC pwglBindTexImageARB; +GLEE_EXTERN PFNWGLRELEASETEXIMAGEARBPROC pwglReleaseTexImageARB; +GLEE_EXTERN PFNWGLSETPBUFFERATTRIBARBPROC pwglSetPbufferAttribARB; +#define wglBindTexImageARB pwglBindTexImageARB +#define wglReleaseTexImageARB pwglReleaseTexImageARB +#define wglSetPbufferAttribARB pwglSetPbufferAttribARB +#endif + +/* WGL_ARB_pixel_format_float */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 +#define __GLEE_WGL_ARB_pixel_format_float 1 +/* Constants */ +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 +#endif + +/* WGL_ARB_create_context */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 +#define __GLEE_WGL_ARB_create_context 1 +/* Constants */ +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int * attribList); +GLEE_EXTERN PFNWGLCREATECONTEXTATTRIBSARBPROC pwglCreateContextAttribsARB; +#define wglCreateContextAttribsARB pwglCreateContextAttribsARB +#endif + +/* WGL_EXT_make_current_read */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 +#define __GLEE_WGL_EXT_make_current_read 1 +/* Constants */ +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 +typedef BOOL (APIENTRYP PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (APIENTRYP PFNWGLGETCURRENTREADDCEXTPROC) (); +GLEE_EXTERN PFNWGLMAKECONTEXTCURRENTEXTPROC pwglMakeContextCurrentEXT; +GLEE_EXTERN PFNWGLGETCURRENTREADDCEXTPROC pwglGetCurrentReadDCEXT; +#define wglMakeContextCurrentEXT pwglMakeContextCurrentEXT +#define wglGetCurrentReadDCEXT pwglGetCurrentReadDCEXT +#endif + +/* WGL_EXT_pixel_format */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 +#define __GLEE_WGL_EXT_pixel_format 1 +/* Constants */ +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C +typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int * piAttributes, int * piValues); +typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int * piAttributes, FLOAT * pfValues); +typedef BOOL (APIENTRYP PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats); +GLEE_EXTERN PFNWGLGETPIXELFORMATATTRIBIVEXTPROC pwglGetPixelFormatAttribivEXT; +GLEE_EXTERN PFNWGLGETPIXELFORMATATTRIBFVEXTPROC pwglGetPixelFormatAttribfvEXT; +GLEE_EXTERN PFNWGLCHOOSEPIXELFORMATEXTPROC pwglChoosePixelFormatEXT; +#define wglGetPixelFormatAttribivEXT pwglGetPixelFormatAttribivEXT +#define wglGetPixelFormatAttribfvEXT pwglGetPixelFormatAttribfvEXT +#define wglChoosePixelFormatEXT pwglChoosePixelFormatEXT +#endif + +/* WGL_EXT_pbuffer */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 +#define __GLEE_WGL_EXT_pbuffer 1 +/* Constants */ +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 +typedef HPBUFFEREXT (APIENTRYP PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList); +typedef HDC (APIENTRYP PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef int (APIENTRYP PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); +typedef BOOL (APIENTRYP PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (APIENTRYP PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int * piValue); +GLEE_EXTERN PFNWGLCREATEPBUFFEREXTPROC pwglCreatePbufferEXT; +GLEE_EXTERN PFNWGLGETPBUFFERDCEXTPROC pwglGetPbufferDCEXT; +GLEE_EXTERN PFNWGLRELEASEPBUFFERDCEXTPROC pwglReleasePbufferDCEXT; +GLEE_EXTERN PFNWGLDESTROYPBUFFEREXTPROC pwglDestroyPbufferEXT; +GLEE_EXTERN PFNWGLQUERYPBUFFEREXTPROC pwglQueryPbufferEXT; +#define wglCreatePbufferEXT pwglCreatePbufferEXT +#define wglGetPbufferDCEXT pwglGetPbufferDCEXT +#define wglReleasePbufferDCEXT pwglReleasePbufferDCEXT +#define wglDestroyPbufferEXT pwglDestroyPbufferEXT +#define wglQueryPbufferEXT pwglQueryPbufferEXT +#endif + +/* WGL_EXT_depth_float */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 +#define __GLEE_WGL_EXT_depth_float 1 +/* Constants */ +#define WGL_DEPTH_FLOAT_EXT 0x2040 +#endif + +/* WGL_3DFX_multisample */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 +#define __GLEE_WGL_3DFX_multisample 1 +/* Constants */ +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 +#endif + +/* WGL_EXT_multisample */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 +#define __GLEE_WGL_EXT_multisample 1 +/* Constants */ +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 +#endif + +/* WGL_I3D_digital_video_control */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 +#define __GLEE_WGL_I3D_digital_video_control 1 +/* Constants */ +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 +typedef BOOL (APIENTRYP PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int * piValue); +typedef BOOL (APIENTRYP PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int * piValue); +GLEE_EXTERN PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC pwglGetDigitalVideoParametersI3D; +GLEE_EXTERN PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC pwglSetDigitalVideoParametersI3D; +#define wglGetDigitalVideoParametersI3D pwglGetDigitalVideoParametersI3D +#define wglSetDigitalVideoParametersI3D pwglSetDigitalVideoParametersI3D +#endif + +/* WGL_I3D_gamma */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 +#define __GLEE_WGL_I3D_gamma 1 +/* Constants */ +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F +typedef BOOL (APIENTRYP PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int * piValue); +typedef BOOL (APIENTRYP PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int * piValue); +typedef BOOL (APIENTRYP PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT * puRed, USHORT * puGreen, USHORT * puBlue); +typedef BOOL (APIENTRYP PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT * puRed, const USHORT * puGreen, const USHORT * puBlue); +GLEE_EXTERN PFNWGLGETGAMMATABLEPARAMETERSI3DPROC pwglGetGammaTableParametersI3D; +GLEE_EXTERN PFNWGLSETGAMMATABLEPARAMETERSI3DPROC pwglSetGammaTableParametersI3D; +GLEE_EXTERN PFNWGLGETGAMMATABLEI3DPROC pwglGetGammaTableI3D; +GLEE_EXTERN PFNWGLSETGAMMATABLEI3DPROC pwglSetGammaTableI3D; +#define wglGetGammaTableParametersI3D pwglGetGammaTableParametersI3D +#define wglSetGammaTableParametersI3D pwglSetGammaTableParametersI3D +#define wglGetGammaTableI3D pwglGetGammaTableI3D +#define wglSetGammaTableI3D pwglSetGammaTableI3D +#endif + +/* WGL_I3D_genlock */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 +#define __GLEE_WGL_I3D_genlock 1 +/* Constants */ +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C +typedef BOOL (APIENTRYP PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (APIENTRYP PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (APIENTRYP PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL * pFlag); +typedef BOOL (APIENTRYP PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (APIENTRYP PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT * uSource); +typedef BOOL (APIENTRYP PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (APIENTRYP PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT * uEdge); +typedef BOOL (APIENTRYP PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (APIENTRYP PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT * uRate); +typedef BOOL (APIENTRYP PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (APIENTRYP PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT * uDelay); +typedef BOOL (APIENTRYP PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT * uMaxLineDelay, UINT * uMaxPixelDelay); +GLEE_EXTERN PFNWGLENABLEGENLOCKI3DPROC pwglEnableGenlockI3D; +GLEE_EXTERN PFNWGLDISABLEGENLOCKI3DPROC pwglDisableGenlockI3D; +GLEE_EXTERN PFNWGLISENABLEDGENLOCKI3DPROC pwglIsEnabledGenlockI3D; +GLEE_EXTERN PFNWGLGENLOCKSOURCEI3DPROC pwglGenlockSourceI3D; +GLEE_EXTERN PFNWGLGETGENLOCKSOURCEI3DPROC pwglGetGenlockSourceI3D; +GLEE_EXTERN PFNWGLGENLOCKSOURCEEDGEI3DPROC pwglGenlockSourceEdgeI3D; +GLEE_EXTERN PFNWGLGETGENLOCKSOURCEEDGEI3DPROC pwglGetGenlockSourceEdgeI3D; +GLEE_EXTERN PFNWGLGENLOCKSAMPLERATEI3DPROC pwglGenlockSampleRateI3D; +GLEE_EXTERN PFNWGLGETGENLOCKSAMPLERATEI3DPROC pwglGetGenlockSampleRateI3D; +GLEE_EXTERN PFNWGLGENLOCKSOURCEDELAYI3DPROC pwglGenlockSourceDelayI3D; +GLEE_EXTERN PFNWGLGETGENLOCKSOURCEDELAYI3DPROC pwglGetGenlockSourceDelayI3D; +GLEE_EXTERN PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC pwglQueryGenlockMaxSourceDelayI3D; +#define wglEnableGenlockI3D pwglEnableGenlockI3D +#define wglDisableGenlockI3D pwglDisableGenlockI3D +#define wglIsEnabledGenlockI3D pwglIsEnabledGenlockI3D +#define wglGenlockSourceI3D pwglGenlockSourceI3D +#define wglGetGenlockSourceI3D pwglGetGenlockSourceI3D +#define wglGenlockSourceEdgeI3D pwglGenlockSourceEdgeI3D +#define wglGetGenlockSourceEdgeI3D pwglGetGenlockSourceEdgeI3D +#define wglGenlockSampleRateI3D pwglGenlockSampleRateI3D +#define wglGetGenlockSampleRateI3D pwglGetGenlockSampleRateI3D +#define wglGenlockSourceDelayI3D pwglGenlockSourceDelayI3D +#define wglGetGenlockSourceDelayI3D pwglGetGenlockSourceDelayI3D +#define wglQueryGenlockMaxSourceDelayI3D pwglQueryGenlockMaxSourceDelayI3D +#endif + +/* WGL_I3D_image_buffer */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 +#define __GLEE_WGL_I3D_image_buffer 1 +/* Constants */ +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 +typedef LPVOID (APIENTRYP PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (APIENTRYP PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (APIENTRYP PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE * pEvent, const LPVOID * pAddress, const DWORD * pSize, UINT count); +typedef BOOL (APIENTRYP PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID * pAddress, UINT count); +GLEE_EXTERN PFNWGLCREATEIMAGEBUFFERI3DPROC pwglCreateImageBufferI3D; +GLEE_EXTERN PFNWGLDESTROYIMAGEBUFFERI3DPROC pwglDestroyImageBufferI3D; +GLEE_EXTERN PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC pwglAssociateImageBufferEventsI3D; +GLEE_EXTERN PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC pwglReleaseImageBufferEventsI3D; +#define wglCreateImageBufferI3D pwglCreateImageBufferI3D +#define wglDestroyImageBufferI3D pwglDestroyImageBufferI3D +#define wglAssociateImageBufferEventsI3D pwglAssociateImageBufferEventsI3D +#define wglReleaseImageBufferEventsI3D pwglReleaseImageBufferEventsI3D +#endif + +/* WGL_I3D_swap_frame_lock */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 +#define __GLEE_WGL_I3D_swap_frame_lock 1 +/* Constants */ +typedef BOOL (APIENTRYP PFNWGLENABLEFRAMELOCKI3DPROC) (); +typedef BOOL (APIENTRYP PFNWGLDISABLEFRAMELOCKI3DPROC) (); +typedef BOOL (APIENTRYP PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL * pFlag); +typedef BOOL (APIENTRYP PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL * pFlag); +GLEE_EXTERN PFNWGLENABLEFRAMELOCKI3DPROC pwglEnableFrameLockI3D; +GLEE_EXTERN PFNWGLDISABLEFRAMELOCKI3DPROC pwglDisableFrameLockI3D; +GLEE_EXTERN PFNWGLISENABLEDFRAMELOCKI3DPROC pwglIsEnabledFrameLockI3D; +GLEE_EXTERN PFNWGLQUERYFRAMELOCKMASTERI3DPROC pwglQueryFrameLockMasterI3D; +#define wglEnableFrameLockI3D pwglEnableFrameLockI3D +#define wglDisableFrameLockI3D pwglDisableFrameLockI3D +#define wglIsEnabledFrameLockI3D pwglIsEnabledFrameLockI3D +#define wglQueryFrameLockMasterI3D pwglQueryFrameLockMasterI3D +#endif + +/* WGL_NV_render_depth_texture */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 +#define __GLEE_WGL_NV_render_depth_texture 1 +/* Constants */ +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 +#endif + +/* WGL_NV_render_texture_rectangle */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 +#define __GLEE_WGL_NV_render_texture_rectangle 1 +/* Constants */ +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 +#endif + +/* WGL_ATI_pixel_format_float */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 +#define __GLEE_WGL_ATI_pixel_format_float 1 +/* Constants */ +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#endif + +/* WGL_NV_float_buffer */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 +#define __GLEE_WGL_NV_float_buffer 1 +/* Constants */ +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 +#endif + +/* WGL_3DL_stereo_control */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 +#define __GLEE_WGL_3DL_stereo_control 1 +/* Constants */ +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 +#endif + +/* WGL_EXT_pixel_format_packed_float */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 +#define __GLEE_WGL_EXT_pixel_format_packed_float 1 +/* Constants */ +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 +#endif + +/* WGL_EXT_framebuffer_sRGB */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 +#define __GLEE_WGL_EXT_framebuffer_sRGB 1 +/* Constants */ +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 +#endif + +/* WGL_NV_present_video */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 +#define __GLEE_WGL_NV_present_video 1 +/* Constants */ +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 +#endif + +/* WGL_NV_video_out */ + +#ifndef WGL_NV_video_out +#define WGL_NV_video_out 1 +#define __GLEE_WGL_NV_video_out 1 +/* Constants */ +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC +#endif + +/* WGL_NV_swap_group */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 +#define __GLEE_WGL_NV_swap_group 1 +/* Constants */ +#endif + +/* WGL_EXT_display_color_table */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 +#define __GLEE_WGL_EXT_display_color_table 1 +/* Constants */ +typedef GLboolean (APIENTRYP PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (APIENTRYP PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort * table, GLuint length); +typedef GLboolean (APIENTRYP PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef VOID (APIENTRYP PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +GLEE_EXTERN PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC pwglCreateDisplayColorTableEXT; +GLEE_EXTERN PFNWGLLOADDISPLAYCOLORTABLEEXTPROC pwglLoadDisplayColorTableEXT; +GLEE_EXTERN PFNWGLBINDDISPLAYCOLORTABLEEXTPROC pwglBindDisplayColorTableEXT; +GLEE_EXTERN PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC pwglDestroyDisplayColorTableEXT; +#define wglCreateDisplayColorTableEXT pwglCreateDisplayColorTableEXT +#define wglLoadDisplayColorTableEXT pwglLoadDisplayColorTableEXT +#define wglBindDisplayColorTableEXT pwglBindDisplayColorTableEXT +#define wglDestroyDisplayColorTableEXT pwglDestroyDisplayColorTableEXT +#endif + +/* WGL_EXT_extensions_string */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 +#define __GLEE_WGL_EXT_extensions_string 1 +/* Constants */ +typedef const char * (APIENTRYP PFNWGLGETEXTENSIONSSTRINGEXTPROC) (); +GLEE_EXTERN PFNWGLGETEXTENSIONSSTRINGEXTPROC pwglGetExtensionsStringEXT; +#define wglGetExtensionsStringEXT pwglGetExtensionsStringEXT +#endif + +/* WGL_EXT_swap_control */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 +#define __GLEE_WGL_EXT_swap_control 1 +/* Constants */ +typedef BOOL (APIENTRYP PFNWGLSWAPINTERVALEXTPROC) (int interval); +typedef int (APIENTRYP PFNWGLGETSWAPINTERVALEXTPROC) (); +GLEE_EXTERN PFNWGLSWAPINTERVALEXTPROC pwglSwapIntervalEXT; +GLEE_EXTERN PFNWGLGETSWAPINTERVALEXTPROC pwglGetSwapIntervalEXT; +#define wglSwapIntervalEXT pwglSwapIntervalEXT +#define wglGetSwapIntervalEXT pwglGetSwapIntervalEXT +#endif + +/* WGL_NV_vertex_array_range */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 +#define __GLEE_WGL_NV_vertex_array_range 1 +/* Constants */ +typedef void* (APIENTRYP PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void (APIENTRYP PFNWGLFREEMEMORYNVPROC) (void * pointer); +GLEE_EXTERN PFNWGLALLOCATEMEMORYNVPROC pwglAllocateMemoryNV; +GLEE_EXTERN PFNWGLFREEMEMORYNVPROC pwglFreeMemoryNV; +#define wglAllocateMemoryNV pwglAllocateMemoryNV +#define wglFreeMemoryNV pwglFreeMemoryNV +#endif + +/* WGL_OML_sync_control */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 +#define __GLEE_WGL_OML_sync_control 1 +/* Constants */ +typedef BOOL (APIENTRYP PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 * ust, INT64 * msc, INT64 * sbc); +typedef BOOL (APIENTRYP PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 * numerator, INT32 * denominator); +typedef INT64 (APIENTRYP PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (APIENTRYP PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (APIENTRYP PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 * ust, INT64 * msc, INT64 * sbc); +typedef BOOL (APIENTRYP PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 * ust, INT64 * msc, INT64 * sbc); +GLEE_EXTERN PFNWGLGETSYNCVALUESOMLPROC pwglGetSyncValuesOML; +GLEE_EXTERN PFNWGLGETMSCRATEOMLPROC pwglGetMscRateOML; +GLEE_EXTERN PFNWGLSWAPBUFFERSMSCOMLPROC pwglSwapBuffersMscOML; +GLEE_EXTERN PFNWGLSWAPLAYERBUFFERSMSCOMLPROC pwglSwapLayerBuffersMscOML; +GLEE_EXTERN PFNWGLWAITFORMSCOMLPROC pwglWaitForMscOML; +GLEE_EXTERN PFNWGLWAITFORSBCOMLPROC pwglWaitForSbcOML; +#define wglGetSyncValuesOML pwglGetSyncValuesOML +#define wglGetMscRateOML pwglGetMscRateOML +#define wglSwapBuffersMscOML pwglSwapBuffersMscOML +#define wglSwapLayerBuffersMscOML pwglSwapLayerBuffersMscOML +#define wglWaitForMscOML pwglWaitForMscOML +#define wglWaitForSbcOML pwglWaitForSbcOML +#endif + +/* WGL_I3D_swap_frame_usage */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 +#define __GLEE_WGL_I3D_swap_frame_usage 1 +/* Constants */ +typedef BOOL (APIENTRYP PFNWGLGETFRAMEUSAGEI3DPROC) (float * pUsage); +typedef BOOL (APIENTRYP PFNWGLBEGINFRAMETRACKINGI3DPROC) (); +typedef BOOL (APIENTRYP PFNWGLENDFRAMETRACKINGI3DPROC) (); +typedef BOOL (APIENTRYP PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD * pFrameCount, DWORD * pMissedFrames, float * pLastMissedUsage); +GLEE_EXTERN PFNWGLGETFRAMEUSAGEI3DPROC pwglGetFrameUsageI3D; +GLEE_EXTERN PFNWGLBEGINFRAMETRACKINGI3DPROC pwglBeginFrameTrackingI3D; +GLEE_EXTERN PFNWGLENDFRAMETRACKINGI3DPROC pwglEndFrameTrackingI3D; +GLEE_EXTERN PFNWGLQUERYFRAMETRACKINGI3DPROC pwglQueryFrameTrackingI3D; +#define wglGetFrameUsageI3D pwglGetFrameUsageI3D +#define wglBeginFrameTrackingI3D pwglBeginFrameTrackingI3D +#define wglEndFrameTrackingI3D pwglEndFrameTrackingI3D +#define wglQueryFrameTrackingI3D pwglQueryFrameTrackingI3D +#endif + +/* WGL_NV_video_output */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 +#define __GLEE_WGL_NV_video_output 1 +/* Constants */ +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC +typedef BOOL (APIENTRYP PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV * hVideoDevice); +typedef BOOL (APIENTRYP PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (APIENTRYP PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (APIENTRYP PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (APIENTRYP PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long * pulCounterPbuffer, BOOL bBlock); +typedef BOOL (APIENTRYP PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long * pulCounterOutputPbuffer, unsigned long * pulCounterOutputVideo); +GLEE_EXTERN PFNWGLGETVIDEODEVICENVPROC pwglGetVideoDeviceNV; +GLEE_EXTERN PFNWGLRELEASEVIDEODEVICENVPROC pwglReleaseVideoDeviceNV; +GLEE_EXTERN PFNWGLBINDVIDEOIMAGENVPROC pwglBindVideoImageNV; +GLEE_EXTERN PFNWGLRELEASEVIDEOIMAGENVPROC pwglReleaseVideoImageNV; +GLEE_EXTERN PFNWGLSENDPBUFFERTOVIDEONVPROC pwglSendPbufferToVideoNV; +GLEE_EXTERN PFNWGLGETVIDEOINFONVPROC pwglGetVideoInfoNV; +#define wglGetVideoDeviceNV pwglGetVideoDeviceNV +#define wglReleaseVideoDeviceNV pwglReleaseVideoDeviceNV +#define wglBindVideoImageNV pwglBindVideoImageNV +#define wglReleaseVideoImageNV pwglReleaseVideoImageNV +#define wglSendPbufferToVideoNV pwglSendPbufferToVideoNV +#define wglGetVideoInfoNV pwglGetVideoInfoNV +#endif +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else /* GLX */ + +/* Extension querying variables */ + +GLEE_EXTERN GLboolean _GLEE_GLX_VERSION_1_3; +GLEE_EXTERN GLboolean _GLEE_GLX_VERSION_1_4; +GLEE_EXTERN GLboolean _GLEE_GLX_ARB_multisample; +GLEE_EXTERN GLboolean _GLEE_GLX_ARB_fbconfig_float; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIS_multisample; +GLEE_EXTERN GLboolean _GLEE_GLX_EXT_visual_info; +GLEE_EXTERN GLboolean _GLEE_GLX_SGI_swap_control; +GLEE_EXTERN GLboolean _GLEE_GLX_SGI_video_sync; +GLEE_EXTERN GLboolean _GLEE_GLX_SGI_make_current_read; +GLEE_EXTERN GLboolean _GLEE_GLX_EXT_visual_rating; +GLEE_EXTERN GLboolean _GLEE_GLX_EXT_import_context; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_fbconfig; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_pbuffer; +GLEE_EXTERN GLboolean _GLEE_GLX_SGI_cushion; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_video_resize; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_swap_group; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_swap_barrier; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIS_blended_overlay; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIS_shared_multisample; +GLEE_EXTERN GLboolean _GLEE_GLX_SUN_get_transparent_index; +GLEE_EXTERN GLboolean _GLEE_GLX_3DFX_multisample; +GLEE_EXTERN GLboolean _GLEE_GLX_MESA_copy_sub_buffer; +GLEE_EXTERN GLboolean _GLEE_GLX_MESA_pixmap_colormap; +GLEE_EXTERN GLboolean _GLEE_GLX_MESA_release_buffers; +GLEE_EXTERN GLboolean _GLEE_GLX_MESA_set_3dfx_mode; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_visual_select_group; +GLEE_EXTERN GLboolean _GLEE_GLX_OML_swap_method; +GLEE_EXTERN GLboolean _GLEE_GLX_OML_sync_control; +GLEE_EXTERN GLboolean _GLEE_GLX_NV_float_buffer; +GLEE_EXTERN GLboolean _GLEE_GLX_SGIX_hyperpipe; +GLEE_EXTERN GLboolean _GLEE_GLX_MESA_agp_offset; +GLEE_EXTERN GLboolean _GLEE_GLX_EXT_fbconfig_packed_float; +GLEE_EXTERN GLboolean _GLEE_GLX_EXT_framebuffer_sRGB; +GLEE_EXTERN GLboolean _GLEE_GLX_EXT_texture_from_pixmap; +GLEE_EXTERN GLboolean _GLEE_GLX_NV_present_video; +GLEE_EXTERN GLboolean _GLEE_GLX_NV_video_out; +GLEE_EXTERN GLboolean _GLEE_GLX_NV_swap_group; +GLEE_EXTERN GLboolean _GLEE_GLX_EXT_scene_marker; +GLEE_EXTERN GLboolean _GLEE_GLX_NV_video_output; + +/* Aliases for extension querying variables */ + +#define GLEE_GLX_VERSION_1_3 GLeeEnabled(&_GLEE_GLX_VERSION_1_3) +#define GLEE_GLX_VERSION_1_4 GLeeEnabled(&_GLEE_GLX_VERSION_1_4) +#define GLEE_GLX_ARB_multisample GLeeEnabled(&_GLEE_GLX_ARB_multisample) +#define GLEE_GLX_ARB_fbconfig_float GLeeEnabled(&_GLEE_GLX_ARB_fbconfig_float) +#define GLEE_GLX_SGIS_multisample GLeeEnabled(&_GLEE_GLX_SGIS_multisample) +#define GLEE_GLX_EXT_visual_info GLeeEnabled(&_GLEE_GLX_EXT_visual_info) +#define GLEE_GLX_SGI_swap_control GLeeEnabled(&_GLEE_GLX_SGI_swap_control) +#define GLEE_GLX_SGI_video_sync GLeeEnabled(&_GLEE_GLX_SGI_video_sync) +#define GLEE_GLX_SGI_make_current_read GLeeEnabled(&_GLEE_GLX_SGI_make_current_read) +#define GLEE_GLX_EXT_visual_rating GLeeEnabled(&_GLEE_GLX_EXT_visual_rating) +#define GLEE_GLX_EXT_import_context GLeeEnabled(&_GLEE_GLX_EXT_import_context) +#define GLEE_GLX_SGIX_fbconfig GLeeEnabled(&_GLEE_GLX_SGIX_fbconfig) +#define GLEE_GLX_SGIX_pbuffer GLeeEnabled(&_GLEE_GLX_SGIX_pbuffer) +#define GLEE_GLX_SGI_cushion GLeeEnabled(&_GLEE_GLX_SGI_cushion) +#define GLEE_GLX_SGIX_video_resize GLeeEnabled(&_GLEE_GLX_SGIX_video_resize) +#define GLEE_GLX_SGIX_swap_group GLeeEnabled(&_GLEE_GLX_SGIX_swap_group) +#define GLEE_GLX_SGIX_swap_barrier GLeeEnabled(&_GLEE_GLX_SGIX_swap_barrier) +#define GLEE_GLX_SGIS_blended_overlay GLeeEnabled(&_GLEE_GLX_SGIS_blended_overlay) +#define GLEE_GLX_SGIS_shared_multisample GLeeEnabled(&_GLEE_GLX_SGIS_shared_multisample) +#define GLEE_GLX_SUN_get_transparent_index GLeeEnabled(&_GLEE_GLX_SUN_get_transparent_index) +#define GLEE_GLX_3DFX_multisample GLeeEnabled(&_GLEE_GLX_3DFX_multisample) +#define GLEE_GLX_MESA_copy_sub_buffer GLeeEnabled(&_GLEE_GLX_MESA_copy_sub_buffer) +#define GLEE_GLX_MESA_pixmap_colormap GLeeEnabled(&_GLEE_GLX_MESA_pixmap_colormap) +#define GLEE_GLX_MESA_release_buffers GLeeEnabled(&_GLEE_GLX_MESA_release_buffers) +#define GLEE_GLX_MESA_set_3dfx_mode GLeeEnabled(&_GLEE_GLX_MESA_set_3dfx_mode) +#define GLEE_GLX_SGIX_visual_select_group GLeeEnabled(&_GLEE_GLX_SGIX_visual_select_group) +#define GLEE_GLX_OML_swap_method GLeeEnabled(&_GLEE_GLX_OML_swap_method) +#define GLEE_GLX_OML_sync_control GLeeEnabled(&_GLEE_GLX_OML_sync_control) +#define GLEE_GLX_NV_float_buffer GLeeEnabled(&_GLEE_GLX_NV_float_buffer) +#define GLEE_GLX_SGIX_hyperpipe GLeeEnabled(&_GLEE_GLX_SGIX_hyperpipe) +#define GLEE_GLX_MESA_agp_offset GLeeEnabled(&_GLEE_GLX_MESA_agp_offset) +#define GLEE_GLX_EXT_fbconfig_packed_float GLeeEnabled(&_GLEE_GLX_EXT_fbconfig_packed_float) +#define GLEE_GLX_EXT_framebuffer_sRGB GLeeEnabled(&_GLEE_GLX_EXT_framebuffer_sRGB) +#define GLEE_GLX_EXT_texture_from_pixmap GLeeEnabled(&_GLEE_GLX_EXT_texture_from_pixmap) +#define GLEE_GLX_NV_present_video GLeeEnabled(&_GLEE_GLX_NV_present_video) +#define GLEE_GLX_NV_video_out GLeeEnabled(&_GLEE_GLX_NV_video_out) +#define GLEE_GLX_NV_swap_group GLeeEnabled(&_GLEE_GLX_NV_swap_group) +#define GLEE_GLX_EXT_scene_marker GLeeEnabled(&_GLEE_GLX_EXT_scene_marker) +#define GLEE_GLX_NV_video_output GLeeEnabled(&_GLEE_GLX_NV_video_output) + +/* GLX_VERSION_1_3 */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 +#define __GLEE_GLX_VERSION_1_3 1 +/* Constants */ +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +typedef GLXFBConfig * (APIENTRYP PFNGLXGETFBCONFIGSPROC) (Display * dpy, int screen, int * nelements); +typedef GLXFBConfig * (APIENTRYP PFNGLXCHOOSEFBCONFIGPROC) (Display * dpy, int screen, const int * attrib_list, int * nelements); +typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBPROC) (Display * dpy, GLXFBConfig config, int attribute, int * value); +typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGPROC) (Display * dpy, GLXFBConfig config); +typedef GLXWindow (APIENTRYP PFNGLXCREATEWINDOWPROC) (Display * dpy, GLXFBConfig config, Window win, const int * attrib_list); +typedef void (APIENTRYP PFNGLXDESTROYWINDOWPROC) (Display * dpy, GLXWindow win); +typedef GLXPixmap (APIENTRYP PFNGLXCREATEPIXMAPPROC) (Display * dpy, GLXFBConfig config, Pixmap pixmap, const int * attrib_list); +typedef void (APIENTRYP PFNGLXDESTROYPIXMAPPROC) (Display * dpy, GLXPixmap pixmap); +typedef GLXPbuffer (APIENTRYP PFNGLXCREATEPBUFFERPROC) (Display * dpy, GLXFBConfig config, const int * attrib_list); +typedef void (APIENTRYP PFNGLXDESTROYPBUFFERPROC) (Display * dpy, GLXPbuffer pbuf); +typedef void (APIENTRYP PFNGLXQUERYDRAWABLEPROC) (Display * dpy, GLXDrawable draw, int attribute, unsigned int * value); +typedef GLXContext (APIENTRYP PFNGLXCREATENEWCONTEXTPROC) (Display * dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef Bool (APIENTRYP PFNGLXMAKECONTEXTCURRENTPROC) (Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLEPROC) (); +typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYPROC) (); +typedef int (APIENTRYP PFNGLXQUERYCONTEXTPROC) (Display * dpy, GLXContext ctx, int attribute, int * value); +typedef void (APIENTRYP PFNGLXSELECTEVENTPROC) (Display * dpy, GLXDrawable draw, unsigned long event_mask); +typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTPROC) (Display * dpy, GLXDrawable draw, unsigned long * event_mask); +GLEE_EXTERN PFNGLXGETFBCONFIGSPROC pglXGetFBConfigs; +GLEE_EXTERN PFNGLXCHOOSEFBCONFIGPROC pglXChooseFBConfig; +GLEE_EXTERN PFNGLXGETFBCONFIGATTRIBPROC pglXGetFBConfigAttrib; +GLEE_EXTERN PFNGLXGETVISUALFROMFBCONFIGPROC pglXGetVisualFromFBConfig; +GLEE_EXTERN PFNGLXCREATEWINDOWPROC pglXCreateWindow; +GLEE_EXTERN PFNGLXDESTROYWINDOWPROC pglXDestroyWindow; +GLEE_EXTERN PFNGLXCREATEPIXMAPPROC pglXCreatePixmap; +GLEE_EXTERN PFNGLXDESTROYPIXMAPPROC pglXDestroyPixmap; +GLEE_EXTERN PFNGLXCREATEPBUFFERPROC pglXCreatePbuffer; +GLEE_EXTERN PFNGLXDESTROYPBUFFERPROC pglXDestroyPbuffer; +GLEE_EXTERN PFNGLXQUERYDRAWABLEPROC pglXQueryDrawable; +GLEE_EXTERN PFNGLXCREATENEWCONTEXTPROC pglXCreateNewContext; +GLEE_EXTERN PFNGLXMAKECONTEXTCURRENTPROC pglXMakeContextCurrent; +GLEE_EXTERN PFNGLXGETCURRENTREADDRAWABLEPROC pglXGetCurrentReadDrawable; +GLEE_EXTERN PFNGLXGETCURRENTDISPLAYPROC pglXGetCurrentDisplay; +GLEE_EXTERN PFNGLXQUERYCONTEXTPROC pglXQueryContext; +GLEE_EXTERN PFNGLXSELECTEVENTPROC pglXSelectEvent; +GLEE_EXTERN PFNGLXGETSELECTEDEVENTPROC pglXGetSelectedEvent; +#define glXGetFBConfigs pglXGetFBConfigs +#define glXChooseFBConfig pglXChooseFBConfig +#define glXGetFBConfigAttrib pglXGetFBConfigAttrib +#define glXGetVisualFromFBConfig pglXGetVisualFromFBConfig +#define glXCreateWindow pglXCreateWindow +#define glXDestroyWindow pglXDestroyWindow +#define glXCreatePixmap pglXCreatePixmap +#define glXDestroyPixmap pglXDestroyPixmap +#define glXCreatePbuffer pglXCreatePbuffer +#define glXDestroyPbuffer pglXDestroyPbuffer +#define glXQueryDrawable pglXQueryDrawable +#define glXCreateNewContext pglXCreateNewContext +#define glXMakeContextCurrent pglXMakeContextCurrent +#define glXGetCurrentReadDrawable pglXGetCurrentReadDrawable +#define glXGetCurrentDisplay pglXGetCurrentDisplay +#define glXQueryContext pglXQueryContext +#define glXSelectEvent pglXSelectEvent +#define glXGetSelectedEvent pglXGetSelectedEvent +#endif + +/* GLX_VERSION_1_4 */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 +#define __GLEE_GLX_VERSION_1_4 1 +/* Constants */ +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 +typedef __GLXextFuncPtr (APIENTRYP PFNGLXGETPROCADDRESSPROC) (const GLubyte * procName); +GLEE_EXTERN PFNGLXGETPROCADDRESSPROC pglXGetProcAddress; +#define glXGetProcAddress pglXGetProcAddress +#endif + +/* GLX_ARB_multisample */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 +#define __GLEE_GLX_ARB_multisample 1 +/* Constants */ +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 +#endif + +/* GLX_ARB_fbconfig_float */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 +#define __GLEE_GLX_ARB_fbconfig_float 1 +/* Constants */ +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#endif + +/* GLX_SGIS_multisample */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 +#define __GLEE_GLX_SGIS_multisample 1 +/* Constants */ +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 +#endif + +/* GLX_EXT_visual_info */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 +#define __GLEE_GLX_EXT_visual_info 1 +/* Constants */ +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 +#endif + +/* GLX_SGI_swap_control */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 +#define __GLEE_GLX_SGI_swap_control 1 +/* Constants */ +typedef int (APIENTRYP PFNGLXSWAPINTERVALSGIPROC) (int interval); +GLEE_EXTERN PFNGLXSWAPINTERVALSGIPROC pglXSwapIntervalSGI; +#define glXSwapIntervalSGI pglXSwapIntervalSGI +#endif + +/* GLX_SGI_video_sync */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 +#define __GLEE_GLX_SGI_video_sync 1 +/* Constants */ +typedef int (APIENTRYP PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int * count); +typedef int (APIENTRYP PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int * count); +GLEE_EXTERN PFNGLXGETVIDEOSYNCSGIPROC pglXGetVideoSyncSGI; +GLEE_EXTERN PFNGLXWAITVIDEOSYNCSGIPROC pglXWaitVideoSyncSGI; +#define glXGetVideoSyncSGI pglXGetVideoSyncSGI +#define glXWaitVideoSyncSGI pglXWaitVideoSyncSGI +#endif + +/* GLX_SGI_make_current_read */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 +#define __GLEE_GLX_SGI_make_current_read 1 +/* Constants */ +typedef Bool (APIENTRYP PFNGLXMAKECURRENTREADSGIPROC) (Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLESGIPROC) (); +GLEE_EXTERN PFNGLXMAKECURRENTREADSGIPROC pglXMakeCurrentReadSGI; +GLEE_EXTERN PFNGLXGETCURRENTREADDRAWABLESGIPROC pglXGetCurrentReadDrawableSGI; +#define glXMakeCurrentReadSGI pglXMakeCurrentReadSGI +#define glXGetCurrentReadDrawableSGI pglXGetCurrentReadDrawableSGI +#endif + +/* GLX_EXT_visual_rating */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 +#define __GLEE_GLX_EXT_visual_rating 1 +/* Constants */ +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +#endif + +/* GLX_EXT_import_context */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 +#define __GLEE_GLX_EXT_import_context 1 +/* Constants */ +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C +typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYEXTPROC) (); +typedef int (APIENTRYP PFNGLXQUERYCONTEXTINFOEXTPROC) (Display * dpy, GLXContext context, int attribute, int * value); +typedef GLXContextID (APIENTRYP PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext (APIENTRYP PFNGLXIMPORTCONTEXTEXTPROC) (Display * dpy, GLXContextID contextID); +typedef void (APIENTRYP PFNGLXFREECONTEXTEXTPROC) (Display * dpy, GLXContext context); +GLEE_EXTERN PFNGLXGETCURRENTDISPLAYEXTPROC pglXGetCurrentDisplayEXT; +GLEE_EXTERN PFNGLXQUERYCONTEXTINFOEXTPROC pglXQueryContextInfoEXT; +GLEE_EXTERN PFNGLXGETCONTEXTIDEXTPROC pglXGetContextIDEXT; +GLEE_EXTERN PFNGLXIMPORTCONTEXTEXTPROC pglXImportContextEXT; +GLEE_EXTERN PFNGLXFREECONTEXTEXTPROC pglXFreeContextEXT; +#define glXGetCurrentDisplayEXT pglXGetCurrentDisplayEXT +#define glXQueryContextInfoEXT pglXQueryContextInfoEXT +#define glXGetContextIDEXT pglXGetContextIDEXT +#define glXImportContextEXT pglXImportContextEXT +#define glXFreeContextEXT pglXFreeContextEXT +#endif + +/* GLX_SGIX_fbconfig */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 +#define __GLEE_GLX_SGIX_fbconfig 1 +/* Constants */ +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 +typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display * dpy, GLXFBConfigSGIX config, int attribute, int * value); +typedef GLXFBConfigSGIX * (APIENTRYP PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display * dpy, int screen, int * attrib_list, int * nelements); +typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display * dpy, GLXFBConfigSGIX config, Pixmap pixmap); +typedef GLXContext (APIENTRYP PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display * dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); +typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display * dpy, GLXFBConfigSGIX config); +typedef GLXFBConfigSGIX (APIENTRYP PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display * dpy, XVisualInfo * vis); +GLEE_EXTERN PFNGLXGETFBCONFIGATTRIBSGIXPROC pglXGetFBConfigAttribSGIX; +GLEE_EXTERN PFNGLXCHOOSEFBCONFIGSGIXPROC pglXChooseFBConfigSGIX; +GLEE_EXTERN PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC pglXCreateGLXPixmapWithConfigSGIX; +GLEE_EXTERN PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC pglXCreateContextWithConfigSGIX; +GLEE_EXTERN PFNGLXGETVISUALFROMFBCONFIGSGIXPROC pglXGetVisualFromFBConfigSGIX; +GLEE_EXTERN PFNGLXGETFBCONFIGFROMVISUALSGIXPROC pglXGetFBConfigFromVisualSGIX; +#define glXGetFBConfigAttribSGIX pglXGetFBConfigAttribSGIX +#define glXChooseFBConfigSGIX pglXChooseFBConfigSGIX +#define glXCreateGLXPixmapWithConfigSGIX pglXCreateGLXPixmapWithConfigSGIX +#define glXCreateContextWithConfigSGIX pglXCreateContextWithConfigSGIX +#define glXGetVisualFromFBConfigSGIX pglXGetVisualFromFBConfigSGIX +#define glXGetFBConfigFromVisualSGIX pglXGetFBConfigFromVisualSGIX +#endif + +/* GLX_SGIX_pbuffer */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 +#define __GLEE_GLX_SGIX_pbuffer 1 +/* Constants */ +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +typedef GLXPbufferSGIX (APIENTRYP PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display * dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int * attrib_list); +typedef void (APIENTRYP PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display * dpy, GLXPbufferSGIX pbuf); +typedef int (APIENTRYP PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display * dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int * value); +typedef void (APIENTRYP PFNGLXSELECTEVENTSGIXPROC) (Display * dpy, GLXDrawable drawable, unsigned long mask); +typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTSGIXPROC) (Display * dpy, GLXDrawable drawable, unsigned long * mask); +GLEE_EXTERN PFNGLXCREATEGLXPBUFFERSGIXPROC pglXCreateGLXPbufferSGIX; +GLEE_EXTERN PFNGLXDESTROYGLXPBUFFERSGIXPROC pglXDestroyGLXPbufferSGIX; +GLEE_EXTERN PFNGLXQUERYGLXPBUFFERSGIXPROC pglXQueryGLXPbufferSGIX; +GLEE_EXTERN PFNGLXSELECTEVENTSGIXPROC pglXSelectEventSGIX; +GLEE_EXTERN PFNGLXGETSELECTEDEVENTSGIXPROC pglXGetSelectedEventSGIX; +#define glXCreateGLXPbufferSGIX pglXCreateGLXPbufferSGIX +#define glXDestroyGLXPbufferSGIX pglXDestroyGLXPbufferSGIX +#define glXQueryGLXPbufferSGIX pglXQueryGLXPbufferSGIX +#define glXSelectEventSGIX pglXSelectEventSGIX +#define glXGetSelectedEventSGIX pglXGetSelectedEventSGIX +#endif + +/* GLX_SGI_cushion */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 +#define __GLEE_GLX_SGI_cushion 1 +/* Constants */ +typedef void (APIENTRYP PFNGLXCUSHIONSGIPROC) (Display * dpy, Window window, float cushion); +GLEE_EXTERN PFNGLXCUSHIONSGIPROC pglXCushionSGI; +#define glXCushionSGI pglXCushionSGI +#endif + +/* GLX_SGIX_video_resize */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 +#define __GLEE_GLX_SGIX_video_resize 1 +/* Constants */ +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 +typedef int (APIENTRYP PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display * display, int screen, int channel, Window window); +typedef int (APIENTRYP PFNGLXCHANNELRECTSGIXPROC) (Display * display, int screen, int channel, int x, int y, int w, int h); +typedef int (APIENTRYP PFNGLXQUERYCHANNELRECTSGIXPROC) (Display * display, int screen, int channel, int * dx, int * dy, int * dw, int * dh); +typedef int (APIENTRYP PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display * display, int screen, int channel, int * x, int * y, int * w, int * h); +typedef int (APIENTRYP PFNGLXCHANNELRECTSYNCSGIXPROC) (Display * display, int screen, int channel, GLenum synctype); +GLEE_EXTERN PFNGLXBINDCHANNELTOWINDOWSGIXPROC pglXBindChannelToWindowSGIX; +GLEE_EXTERN PFNGLXCHANNELRECTSGIXPROC pglXChannelRectSGIX; +GLEE_EXTERN PFNGLXQUERYCHANNELRECTSGIXPROC pglXQueryChannelRectSGIX; +GLEE_EXTERN PFNGLXQUERYCHANNELDELTASSGIXPROC pglXQueryChannelDeltasSGIX; +GLEE_EXTERN PFNGLXCHANNELRECTSYNCSGIXPROC pglXChannelRectSyncSGIX; +#define glXBindChannelToWindowSGIX pglXBindChannelToWindowSGIX +#define glXChannelRectSGIX pglXChannelRectSGIX +#define glXQueryChannelRectSGIX pglXQueryChannelRectSGIX +#define glXQueryChannelDeltasSGIX pglXQueryChannelDeltasSGIX +#define glXChannelRectSyncSGIX pglXChannelRectSyncSGIX +#endif + +/* GLX_SGIX_swap_group */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 +#define __GLEE_GLX_SGIX_swap_group 1 +/* Constants */ +typedef void (APIENTRYP PFNGLXJOINSWAPGROUPSGIXPROC) (Display * dpy, GLXDrawable drawable, GLXDrawable member); +GLEE_EXTERN PFNGLXJOINSWAPGROUPSGIXPROC pglXJoinSwapGroupSGIX; +#define glXJoinSwapGroupSGIX pglXJoinSwapGroupSGIX +#endif + +/* GLX_SGIX_swap_barrier */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 +#define __GLEE_GLX_SGIX_swap_barrier 1 +/* Constants */ +typedef void (APIENTRYP PFNGLXBINDSWAPBARRIERSGIXPROC) (Display * dpy, GLXDrawable drawable, int barrier); +typedef Bool (APIENTRYP PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display * dpy, int screen, int * max); +GLEE_EXTERN PFNGLXBINDSWAPBARRIERSGIXPROC pglXBindSwapBarrierSGIX; +GLEE_EXTERN PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC pglXQueryMaxSwapBarriersSGIX; +#define glXBindSwapBarrierSGIX pglXBindSwapBarrierSGIX +#define glXQueryMaxSwapBarriersSGIX pglXQueryMaxSwapBarriersSGIX +#endif + +/* GLX_SGIS_blended_overlay */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 +#define __GLEE_GLX_SGIS_blended_overlay 1 +/* Constants */ +#define GLX_BLENDED_RGBA_SGIS 0x8025 +#endif + +/* GLX_SGIS_shared_multisample */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 +#define __GLEE_GLX_SGIS_shared_multisample 1 +/* Constants */ +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 +#endif + +/* GLX_SUN_get_transparent_index */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 +#define __GLEE_GLX_SUN_get_transparent_index 1 +/* Constants */ +typedef Status (APIENTRYP PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display * dpy, Window overlay, Window underlay, long * pTransparentIndex); +GLEE_EXTERN PFNGLXGETTRANSPARENTINDEXSUNPROC pglXGetTransparentIndexSUN; +#define glXGetTransparentIndexSUN pglXGetTransparentIndexSUN +#endif + +/* GLX_3DFX_multisample */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 +#define __GLEE_GLX_3DFX_multisample 1 +/* Constants */ +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 +#endif + +/* GLX_MESA_copy_sub_buffer */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 +#define __GLEE_GLX_MESA_copy_sub_buffer 1 +/* Constants */ +typedef void (APIENTRYP PFNGLXCOPYSUBBUFFERMESAPROC) (Display * dpy, GLXDrawable drawable, int x, int y, int width, int height); +GLEE_EXTERN PFNGLXCOPYSUBBUFFERMESAPROC pglXCopySubBufferMESA; +#define glXCopySubBufferMESA pglXCopySubBufferMESA +#endif + +/* GLX_MESA_pixmap_colormap */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 +#define __GLEE_GLX_MESA_pixmap_colormap 1 +/* Constants */ +typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPMESAPROC) (Display * dpy, XVisualInfo * visual, Pixmap pixmap, Colormap cmap); +GLEE_EXTERN PFNGLXCREATEGLXPIXMAPMESAPROC pglXCreateGLXPixmapMESA; +#define glXCreateGLXPixmapMESA pglXCreateGLXPixmapMESA +#endif + +/* GLX_MESA_release_buffers */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 +#define __GLEE_GLX_MESA_release_buffers 1 +/* Constants */ +typedef Bool (APIENTRYP PFNGLXRELEASEBUFFERSMESAPROC) (Display * dpy, GLXDrawable drawable); +GLEE_EXTERN PFNGLXRELEASEBUFFERSMESAPROC pglXReleaseBuffersMESA; +#define glXReleaseBuffersMESA pglXReleaseBuffersMESA +#endif + +/* GLX_MESA_set_3dfx_mode */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 +#define __GLEE_GLX_MESA_set_3dfx_mode 1 +/* Constants */ +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 +typedef Bool (APIENTRYP PFNGLXSET3DFXMODEMESAPROC) (int mode); +GLEE_EXTERN PFNGLXSET3DFXMODEMESAPROC pglXSet3DfxModeMESA; +#define glXSet3DfxModeMESA pglXSet3DfxModeMESA +#endif + +/* GLX_SGIX_visual_select_group */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 +#define __GLEE_GLX_SGIX_visual_select_group 1 +/* Constants */ +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 +#endif + +/* GLX_OML_swap_method */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 +#define __GLEE_GLX_OML_swap_method 1 +/* Constants */ +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 +#endif + +/* GLX_OML_sync_control */ + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 +#define __GLEE_GLX_OML_sync_control 1 +/* Constants */ +typedef Bool (APIENTRYP PFNGLXGETSYNCVALUESOMLPROC) (Display * dpy, GLXDrawable drawable, int64_t * ust, int64_t * msc, int64_t * sbc); +typedef Bool (APIENTRYP PFNGLXGETMSCRATEOMLPROC) (Display * dpy, GLXDrawable drawable, int32_t * numerator, int32_t * denominator); +typedef int64_t (APIENTRYP PFNGLXSWAPBUFFERSMSCOMLPROC) (Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool (APIENTRYP PFNGLXWAITFORMSCOMLPROC) (Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * ust, int64_t * msc, int64_t * sbc); +typedef Bool (APIENTRYP PFNGLXWAITFORSBCOMLPROC) (Display * dpy, GLXDrawable drawable, int64_t target_sbc, int64_t * ust, int64_t * msc, int64_t * sbc); +GLEE_EXTERN PFNGLXGETSYNCVALUESOMLPROC pglXGetSyncValuesOML; +GLEE_EXTERN PFNGLXGETMSCRATEOMLPROC pglXGetMscRateOML; +GLEE_EXTERN PFNGLXSWAPBUFFERSMSCOMLPROC pglXSwapBuffersMscOML; +GLEE_EXTERN PFNGLXWAITFORMSCOMLPROC pglXWaitForMscOML; +GLEE_EXTERN PFNGLXWAITFORSBCOMLPROC pglXWaitForSbcOML; +#define glXGetSyncValuesOML pglXGetSyncValuesOML +#define glXGetMscRateOML pglXGetMscRateOML +#define glXSwapBuffersMscOML pglXSwapBuffersMscOML +#define glXWaitForMscOML pglXWaitForMscOML +#define glXWaitForSbcOML pglXWaitForSbcOML +#endif + +/* GLX_NV_float_buffer */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 +#define __GLEE_GLX_NV_float_buffer 1 +/* Constants */ +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 +#endif + +/* GLX_SGIX_hyperpipe */ + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 +#define __GLEE_GLX_SGIX_hyperpipe 1 +/* Constants */ +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 +typedef GLXHyperpipeNetworkSGIX * (APIENTRYP PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display * dpy, int * npipes); +typedef int (APIENTRYP PFNGLXHYPERPIPECONFIGSGIXPROC) (Display * dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX * cfg, int * hpId); +typedef GLXHyperpipeConfigSGIX * (APIENTRYP PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display * dpy, int hpId, int * npipes); +typedef int (APIENTRYP PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display * dpy, int hpId); +typedef int (APIENTRYP PFNGLXBINDHYPERPIPESGIXPROC) (Display * dpy, int hpId); +typedef int (APIENTRYP PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display * dpy, int timeSlice, int attrib, int size, void * attribList, void * returnAttribList); +typedef int (APIENTRYP PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display * dpy, int timeSlice, int attrib, int size, void * attribList); +typedef int (APIENTRYP PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display * dpy, int timeSlice, int attrib, int size, void * returnAttribList); +GLEE_EXTERN PFNGLXQUERYHYPERPIPENETWORKSGIXPROC pglXQueryHyperpipeNetworkSGIX; +GLEE_EXTERN PFNGLXHYPERPIPECONFIGSGIXPROC pglXHyperpipeConfigSGIX; +GLEE_EXTERN PFNGLXQUERYHYPERPIPECONFIGSGIXPROC pglXQueryHyperpipeConfigSGIX; +GLEE_EXTERN PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC pglXDestroyHyperpipeConfigSGIX; +GLEE_EXTERN PFNGLXBINDHYPERPIPESGIXPROC pglXBindHyperpipeSGIX; +GLEE_EXTERN PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC pglXQueryHyperpipeBestAttribSGIX; +GLEE_EXTERN PFNGLXHYPERPIPEATTRIBSGIXPROC pglXHyperpipeAttribSGIX; +GLEE_EXTERN PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC pglXQueryHyperpipeAttribSGIX; +#define glXQueryHyperpipeNetworkSGIX pglXQueryHyperpipeNetworkSGIX +#define glXHyperpipeConfigSGIX pglXHyperpipeConfigSGIX +#define glXQueryHyperpipeConfigSGIX pglXQueryHyperpipeConfigSGIX +#define glXDestroyHyperpipeConfigSGIX pglXDestroyHyperpipeConfigSGIX +#define glXBindHyperpipeSGIX pglXBindHyperpipeSGIX +#define glXQueryHyperpipeBestAttribSGIX pglXQueryHyperpipeBestAttribSGIX +#define glXHyperpipeAttribSGIX pglXHyperpipeAttribSGIX +#define glXQueryHyperpipeAttribSGIX pglXQueryHyperpipeAttribSGIX +#endif + +/* GLX_MESA_agp_offset */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 +#define __GLEE_GLX_MESA_agp_offset 1 +/* Constants */ +typedef unsigned int (APIENTRYP PFNGLXGETAGPOFFSETMESAPROC) (const void * pointer); +GLEE_EXTERN PFNGLXGETAGPOFFSETMESAPROC pglXGetAGPOffsetMESA; +#define glXGetAGPOffsetMESA pglXGetAGPOffsetMESA +#endif + +/* GLX_EXT_fbconfig_packed_float */ + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 +#define __GLEE_GLX_EXT_fbconfig_packed_float 1 +/* Constants */ +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#endif + +/* GLX_EXT_framebuffer_sRGB */ + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 +#define __GLEE_GLX_EXT_framebuffer_sRGB 1 +/* Constants */ +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 +#endif + +/* GLX_EXT_texture_from_pixmap */ + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 +#define __GLEE_GLX_EXT_texture_from_pixmap 1 +/* Constants */ +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB +typedef void (APIENTRYP PFNGLXBINDTEXIMAGEEXTPROC) (Display * dpy, GLXDrawable drawable, int buffer, const int * attrib_list); +typedef void (APIENTRYP PFNGLXRELEASETEXIMAGEEXTPROC) (Display * dpy, GLXDrawable drawable, int buffer); +GLEE_EXTERN PFNGLXBINDTEXIMAGEEXTPROC pglXBindTexImageEXT; +GLEE_EXTERN PFNGLXRELEASETEXIMAGEEXTPROC pglXReleaseTexImageEXT; +#define glXBindTexImageEXT pglXBindTexImageEXT +#define glXReleaseTexImageEXT pglXReleaseTexImageEXT +#endif + +/* GLX_NV_present_video */ + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 +#define __GLEE_GLX_NV_present_video 1 +/* Constants */ +#define GLX_GLX_NUM_VIDEO_SLOTS_NV 0x20F0 +#endif + +/* GLX_NV_video_out */ + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 +#define __GLEE_GLX_NV_video_out 1 +/* Constants */ +#define GLX_GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC +#endif + +/* GLX_NV_swap_group */ + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 +#define __GLEE_GLX_NV_swap_group 1 +/* Constants */ +#endif + +/* GLX_EXT_scene_marker */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 +#define __GLEE_GLX_EXT_scene_marker 1 +/* Constants */ +#endif + +/* GLX_NV_video_output */ + +#ifndef GLX_NV_video_output +#define GLX_NV_video_output 1 +#define __GLEE_GLX_NV_video_output 1 +/* Constants */ +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC +typedef int (APIENTRYP PFNGLXGETVIDEODEVICENVPROC) (Display * dpy, int screen, int numVideoDevices, GLXVideoDeviceNV * pVideoDevice); +typedef int (APIENTRYP PFNGLXRELEASEVIDEODEVICENVPROC) (Display * dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int (APIENTRYP PFNGLXBINDVIDEOIMAGENVPROC) (Display * dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int (APIENTRYP PFNGLXRELEASEVIDEOIMAGENVPROC) (Display * dpy, GLXPbuffer pbuf); +typedef int (APIENTRYP PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display * dpy, GLXPbuffer pbuf, int iBufferType, unsigned long * pulCounterPbuffer, GLboolean bBlock); +typedef int (APIENTRYP PFNGLXGETVIDEOINFONVPROC) (Display * dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long * pulCounterOutputPbuffer, unsigned long * pulCounterOutputVideo); +GLEE_EXTERN PFNGLXGETVIDEODEVICENVPROC pglXGetVideoDeviceNV; +GLEE_EXTERN PFNGLXRELEASEVIDEODEVICENVPROC pglXReleaseVideoDeviceNV; +GLEE_EXTERN PFNGLXBINDVIDEOIMAGENVPROC pglXBindVideoImageNV; +GLEE_EXTERN PFNGLXRELEASEVIDEOIMAGENVPROC pglXReleaseVideoImageNV; +GLEE_EXTERN PFNGLXSENDPBUFFERTOVIDEONVPROC pglXSendPbufferToVideoNV; +GLEE_EXTERN PFNGLXGETVIDEOINFONVPROC pglXGetVideoInfoNV; +#define glXGetVideoDeviceNV pglXGetVideoDeviceNV +#define glXReleaseVideoDeviceNV pglXReleaseVideoDeviceNV +#define glXBindVideoImageNV pglXBindVideoImageNV +#define glXReleaseVideoImageNV pglXReleaseVideoImageNV +#define glXSendPbufferToVideoNV pglXSendPbufferToVideoNV +#define glXGetVideoInfoNV pglXGetVideoInfoNV +#endif +#endif /*end GLX */ + +/***************************************************************** + * GLee functions + *****************************************************************/ + +GLEE_EXTERN GLboolean GLeeInit( void ); +GLEE_EXTERN GLint GLeeForceLink(const char * extensionName); +GLEE_EXTERN const char * GLeeGetErrorString( void ); +GLEE_EXTERN const char * GLeeGetExtStrGL( void ); +GLEE_EXTERN GLboolean GLeeEnabled(GLboolean * extensionQueryingVariable); + +#ifdef WIN32 +GLEE_EXTERN const char * GLeeGetExtStrWGL( void ); +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#else +GLEE_EXTERN const char * GLeeGetExtStrGLX( void ); +#endif + +#ifdef __cplusplus +} /* end C linkage */ +#endif + +#endif /* __glee_h_ defined */ diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 3a89d2de9..1233c9986 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -1,1156 +1,1156 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" -#include "common/math.h" -#include "common/Vector.h" - -#include "Graphics.h" -#include "window/sdl/Window.h" - -#include -#include -#include -#include - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Graphics::Graphics() - : currentFont(0) - , lineStyle(LINE_SMOOTH) - , lineWidth(1) - , matrixLimit(0) - , userMatrices(0) -{ - currentWindow = love::window::sdl::Window::getSingleton(); - - resetBoundTexture(); -} - -Graphics::~Graphics() -{ - if (currentFont != 0) - currentFont->release(); - - currentWindow->release(); -} - -const char *Graphics::getName() const -{ - return "love.graphics.opengl"; -} - -bool Graphics::checkMode(int width, int height, bool fullscreen) -{ - return currentWindow->checkWindowSize(width, height, fullscreen); -} - -DisplayState Graphics::saveState() -{ - DisplayState s; - - s.color = getColor(); - s.backgroundColor = getBackgroundColor(); - - s.blendMode = getBlendMode(); - s.colorMode = getColorMode(); - //get line style - s.lineStyle = lineStyle; - //get the point size - glGetFloatv(GL_POINT_SIZE, &s.pointSize); - //get point style - s.pointStyle = (glIsEnabled(GL_POINT_SMOOTH) == GL_TRUE) ? Graphics::POINT_SMOOTH : Graphics::POINT_ROUGH; - //get scissor status - s.scissor = (glIsEnabled(GL_SCISSOR_TEST) == GL_TRUE); - //do we have scissor, if so, store the box - if (s.scissor) - glGetIntegerv(GL_SCISSOR_BOX, s.scissorBox); - - return s; -} - -void Graphics::restoreState(const DisplayState &s) -{ - setColor(s.color); - setBackgroundColor(s.backgroundColor); - setBlendMode(s.blendMode); - setColorMode(s.colorMode); - setLine(lineWidth, s.lineStyle); - setPoint(s.pointSize, s.pointStyle); - if (s.scissor) - setScissor(s.scissorBox[0], s.scissorBox[1], s.scissorBox[2], s.scissorBox[3]); - else - setScissor(); -} - -bool Graphics::setMode(int width, int height, bool fullscreen, bool vsync, int fsaa) -{ - // This operation destroys the OpenGL context, so - // we must save the state. - DisplayState tempState; - if (isCreated()) - tempState = saveState(); - - // Unlad all volatile objects. These must be reloaded after - // the display mode change. - Volatile::unloadAll(); - - bool success = currentWindow->setWindow(width, height, fullscreen, vsync, fsaa); - // Regardless of failure, we'll have to set up OpenGL once again. - - width = currentWindow->getWidth(); - height = currentWindow->getHeight(); - - // Okay, setup OpenGL. - - // Enable blending - glEnable(GL_BLEND); - - // "Normal" blending - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - // Enable line/point smoothing. - setLineStyle(LINE_SMOOTH); - glEnable(GL_POINT_SMOOTH); - glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); - - // Enable textures - glEnable(GL_TEXTURE_2D); - - // Set the viewport to top-left corner - glViewport(0, 0, width, height); - - // Reset the projection matrix - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - // Set up orthographic view (no depth) - glOrtho(0.0, width, height, 0.0, -1.0, 1.0); - - // Reset modelview matrix - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - // Set pixel row alignment - glPixelStorei(GL_UNPACK_ALIGNMENT, 2); - - // Reload all volatile objects. - if (!Volatile::loadAll()) - std::cerr << "Could not reload all volatile objects." << std::endl; - - // Restore the display state. - restoreState(tempState); - - // Get the maximum number of matrices - // subtract a few to give the engine some room. - glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &matrixLimit); - matrixLimit -= 5; - - return success; -} - -void Graphics::getMode(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa) -{ - currentWindow->getWindow(width, height, fullscreen, vsync, fsaa); -} - -bool Graphics::toggleFullscreen() -{ - int width, height, fsaa; - bool fullscreen, vsync; - currentWindow->getWindow(width, height, fullscreen, vsync, fsaa); - return setMode(width, height, !fullscreen, vsync, fsaa); -} - - -void Graphics::reset() -{ - DisplayState s; - discardStencil(); - Canvas::bindDefaultCanvas(); - PixelEffect::detach(); - restoreState(s); -} - -void Graphics::clear() -{ - glClear(GL_COLOR_BUFFER_BIT); - glLoadIdentity(); -} - -void Graphics::present() -{ - currentWindow->swapBuffers(); -} - -void Graphics::setIcon(Image *image) -{ - currentWindow->setIcon(image->getData()); -} - -void Graphics::setCaption(const char *caption) -{ - std::string title(caption); - currentWindow->setWindowTitle(title); -} - -int Graphics::getCaption(lua_State *L) -{ - std::string title = currentWindow->getWindowTitle(); - lua_pushstring(L, title.c_str()); - return 1; -} - -int Graphics::getWidth() -{ - return currentWindow->getWidth(); -} - -int Graphics::getHeight() -{ - return currentWindow->getHeight(); -} - -int Graphics::getRenderHeight() -{ - if (Canvas::current) - return Canvas::current->getHeight(); - return getHeight(); -} - -bool Graphics::isCreated() -{ - return currentWindow->isCreated(); -} - -int Graphics::getModes(lua_State *L) -{ - int n; - love::window::Window::WindowSize **modes = currentWindow->getFullscreenSizes(n); - - if (modes == 0) - return 0; - - lua_newtable(L); - - for (int i = 0; i < n ; i++) - { - lua_pushinteger(L, i+1); - lua_newtable(L); - - // Inner table attribs. - - lua_pushstring(L, "width"); - lua_pushinteger(L, modes[i]->width); - lua_settable(L, -3); - - lua_pushstring(L, "height"); - lua_pushinteger(L, modes[i]->height); - lua_settable(L, -3); - - // Inner table attribs end. - - lua_settable(L, -3); - - delete modes[i]; - } - - delete[] modes; - return 1; -} - -void Graphics::setScissor(int x, int y, int width, int height) -{ - glEnable(GL_SCISSOR_TEST); - glScissor(x, getRenderHeight() - (y + height), width, height); // Compensates for the fact that our y-coordinate is reverse of OpenGLs. -} - -void Graphics::setScissor() -{ - glDisable(GL_SCISSOR_TEST); -} - -int Graphics::getScissor(lua_State *L) -{ - if (glIsEnabled(GL_SCISSOR_TEST) == GL_FALSE) - return 0; - - GLint scissor[4]; - glGetIntegerv(GL_SCISSOR_BOX, scissor); - - lua_pushnumber(L, scissor[0]); - lua_pushnumber(L, getRenderHeight() - (scissor[1] + scissor[3])); // Compensates for the fact that our y-coordinate is reverse of OpenGLs. - lua_pushnumber(L, scissor[2]); - lua_pushnumber(L, scissor[3]); - - return 4; -} - -void Graphics::defineStencil() -{ - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - glEnable(GL_STENCIL_TEST); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilFunc(GL_ALWAYS, 1, 1); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); -} - -void Graphics::useStencil(bool invert) -{ - glStencilFunc(GL_EQUAL, (int)(!invert), 1); // invert ? 0 : 1 - glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); -} - -void Graphics::discardStencil() -{ - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glDisable(GL_STENCIL_TEST); -} - -Image *Graphics::newImage(love::image::ImageData *data) -{ - // Create the image. - Image *image = new Image(data); - bool success; - try - { - success = image->load(); - } - catch(love::Exception &e) - { - image->release(); - throw love::Exception(e.what()); - } - if (!success) - { - image->release(); - return 0; - } - - return image; -} - -Quad *Graphics::newQuad(float x, float y, float w, float h, float sw, float sh) -{ - Quad::Viewport v; - v.x = x; - v.y = y; - v.w = w; - v.h = h; - return new Quad(v, sw, sh); -} - -Font *Graphics::newFont(love::font::Rasterizer *r, const Image::Filter &filter) -{ - Font *font = new Font(r, filter); - - // Load it and check for errors. - if (!font) - { - delete font; - return 0; - } - - return font; -} - -SpriteBatch *Graphics::newSpriteBatch(Image *image, int size, int usage) -{ - SpriteBatch *t = NULL; - try - { - t = new SpriteBatch(image, size, usage); - } - catch(love::Exception &e) - { - if (t) delete t; - throw e; - } - return t; -} - -ParticleSystem *Graphics::newParticleSystem(Image *image, int size) -{ - return new ParticleSystem(image, size); -} - -Canvas *Graphics::newCanvas(int width, int height) -{ - Canvas *canvas = new Canvas(width, height); - GLenum err = canvas->getStatus(); - - // everything ok, reaturn canvas (early out) - if (err == GL_FRAMEBUFFER_COMPLETE) - return canvas; - - // create error message - std::stringstream error_string; - error_string << "Cannot create canvas: "; - switch (err) - { - - case GL_FRAMEBUFFER_UNSUPPORTED: - error_string << "Not supported by your OpenGL implementation."; - break; - - // remaining error codes are highly unlikely: - case GL_FRAMEBUFFER_UNDEFINED: - case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: - case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: - case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: - case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: - case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: - error_string << "Error in implementation. Possible fix: Make canvas width and height powers of two."; - break; - - default: - // my intel hda card wrongly returns 0 to glCheckFramebufferStatus() but sets - // no error flag. I think it meant to return GL_FRAMEBUFFER_UNSUPPORTED, but who - // knows. - if (glGetError() == GL_NO_ERROR) - error_string << "May not be supported by your OpenGL implementation."; - // the remaining error is an indication of a serious fuckup since it should - // only be returned if glCheckFramebufferStatus() was called with the wrong - // arguments. - else - error_string << "Cannot create canvas: Aliens did it (OpenGL error code: " << glGetError() << ")"; - } - - canvas->release(); - throw Exception(error_string.str().c_str()); - return NULL; // never reached -} - -PixelEffect *Graphics::newPixelEffect(const std::string &code) -{ - PixelEffect *effect = NULL; - try - { - effect = new PixelEffect(code); - } - catch(love::Exception &e) - { - if (effect) - delete effect; - throw(e); - } - return effect; -} - -void Graphics::setColor(const Color &c) -{ - glColor4ubv(&c.r); -} - -Color Graphics::getColor() -{ - float c[4]; - glGetFloatv(GL_CURRENT_COLOR, c); - - Color t; - t.r = (unsigned char)(255.0f*c[0]); - t.g = (unsigned char)(255.0f*c[1]); - t.b = (unsigned char)(255.0f*c[2]); - t.a = (unsigned char)(255.0f*c[3]); - - return t; -} - -void Graphics::setBackgroundColor(const Color &c) -{ - glClearColor((float)c.r/255.0f, (float)c.g/255.0f, (float)c.b/255.0f, (float)c.a/255.0f); -} - -Color Graphics::getBackgroundColor() -{ - float c[4]; - glGetFloatv(GL_COLOR_CLEAR_VALUE, c); - - Color t; - t.r = (unsigned char)(255.0f*c[0]); - t.g = (unsigned char)(255.0f*c[1]); - t.b = (unsigned char)(255.0f*c[2]); - t.a = (unsigned char)(255.0f*c[3]); - - return t; -} - -void Graphics::setFont(Font *font) -{ - if (currentFont != 0) - currentFont->release(); - - currentFont = font; - - if (font != 0) - currentFont->retain(); -} - -Font *Graphics::getFont() -{ - return currentFont; -} - -void Graphics::setBlendMode(Graphics::BlendMode mode) -{ - glAlphaFunc(GL_GEQUAL, 0); - - if (GLEE_VERSION_1_4 || GLEE_ARB_imaging) - { - if (mode == BLEND_SUBTRACTIVE) - glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); - else - glBlendEquation(GL_FUNC_ADD); - } - else if (GLEE_EXT_blend_minmax && GLEE_EXT_blend_subtract) - { - if (mode == BLEND_SUBTRACTIVE) - glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); - else - glBlendEquationEXT(GL_FUNC_ADD_EXT); - } - else - { - if (mode == BLEND_SUBTRACTIVE) - throw Exception("This graphics card does not support the subtract blend mode!"); - // GL_FUNC_ADD is the default even without access to glBlendEquation, so that'll still work. - } - - if (mode == BLEND_ALPHA) - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - else if (mode == BLEND_MULTIPLICATIVE) - glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); - else if (mode == BLEND_PREMULTIPLIED) - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - else // mode == BLEND_ADDITIVE || mode == BLEND_SUBTRACTIVE - glBlendFunc(GL_SRC_ALPHA, GL_ONE); -} - -void Graphics::setColorMode(Graphics::ColorMode mode) -{ - if (mode == COLOR_MODULATE) - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - else if (mode == COLOR_COMBINE) - { - glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_ADD_SIGNED); - glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE); - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); - } - else // mode = COLOR_REPLACE - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); -} - -void Graphics::setDefaultImageFilter(const Image::Filter &f) -{ - Image::setDefaultFilter(f); -} - -Graphics::BlendMode Graphics::getBlendMode() -{ - GLint dst, src, equation; - glGetIntegerv(GL_BLEND_DST, &dst); - glGetIntegerv(GL_BLEND_SRC, &src); - glGetIntegerv(GL_BLEND_EQUATION, &equation); - - if (equation == GL_FUNC_REVERSE_SUBTRACT) // && src == GL_SRC_ALPHA && dst == GL_ONE - return BLEND_SUBTRACTIVE; - else if (src == GL_SRC_ALPHA && dst == GL_ONE) // && equation == GL_FUNC_ADD - return BLEND_ADDITIVE; - else if (src == GL_SRC_ALPHA && dst == GL_ONE_MINUS_SRC_ALPHA) // && equation == GL_FUNC_ADD - return BLEND_ALPHA; - else if (src == GL_DST_COLOR && dst == GL_ONE_MINUS_SRC_ALPHA) // && equation == GL_FUNC_ADD - return BLEND_MULTIPLICATIVE; - else if (src == GL_ONE && dst == GL_ONE_MINUS_SRC_ALPHA) // && equation == GL_FUNC_ADD - return BLEND_PREMULTIPLIED; - - return BLEND_MAX_ENUM; // Should never be reached. -} - -Graphics::ColorMode Graphics::getColorMode() -{ - GLint mode; - glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &mode); - - if (mode == GL_MODULATE) - return COLOR_MODULATE; - else if (mode == GL_COMBINE) - return COLOR_COMBINE; - else // mode == GL_REPLACE - return COLOR_REPLACE; -} - -const Image::Filter &Graphics::getDefaultImageFilter() const -{ - return Image::getDefaultFilter(); -} - -void Graphics::setLineWidth(float width) -{ - lineWidth = width; -} - -void Graphics::setLineStyle(Graphics::LineStyle style) -{ - lineStyle = style; -} - -void Graphics::setLine(float width, Graphics::LineStyle style) -{ - setLineWidth(width); - - if (style == 0) - return; - setLineStyle(style); -} - -float Graphics::getLineWidth() -{ - return lineWidth; -} - -Graphics::LineStyle Graphics::getLineStyle() -{ - return lineStyle; -} - -void Graphics::setPointSize(float size) -{ - glPointSize((GLfloat)size); -} - -void Graphics::setPointStyle(Graphics::PointStyle style) -{ - if (style == POINT_SMOOTH) - glEnable(GL_POINT_SMOOTH); - else // love::POINT_ROUGH - glDisable(GL_POINT_SMOOTH); -} - -void Graphics::setPoint(float size, Graphics::PointStyle style) -{ - if (style == POINT_SMOOTH) - glEnable(GL_POINT_SMOOTH); - else // POINT_ROUGH - glDisable(GL_POINT_SMOOTH); - - glPointSize((GLfloat)size); -} - -float Graphics::getPointSize() -{ - GLfloat size; - glGetFloatv(GL_POINT_SIZE, &size); - return (float)size; -} - -Graphics::PointStyle Graphics::getPointStyle() -{ - if (glIsEnabled(GL_POINT_SMOOTH) == GL_TRUE) - return POINT_SMOOTH; - else - return POINT_ROUGH; -} - -int Graphics::getMaxPointSize() -{ - GLint max; - glGetIntegerv(GL_POINT_SIZE_MAX, &max); - return (int)max; -} - -void Graphics::print(const char *str, float x, float y , float angle, float sx, float sy, float ox, float oy, float kx, float ky) -{ - if (currentFont != 0) - { - std::string text(str); - currentFont->print(text, x, y, angle, sx, sy, ox, oy, kx, ky); - } -} - -void Graphics::printf(const char *str, float x, float y, float wrap, AlignMode align) -{ - if (currentFont == 0) - return; - - using namespace std; - string text(str); - vector lines_to_draw = currentFont->getWrap(text, wrap); - - // now for the actual printing - vector::const_iterator line_iter, line_end = lines_to_draw.end(); - for (line_iter = lines_to_draw.begin(); line_iter != line_end; ++line_iter) - { - float width = static_cast(currentFont->getWidth(*line_iter)); - switch (align) - { - case ALIGN_RIGHT: - currentFont->print(*line_iter, ceil(x + wrap - width), ceil(y)); - break; - case ALIGN_CENTER: - currentFont->print(*line_iter, ceil(x + (wrap - width) / 2), ceil(y)); - break; - case ALIGN_LEFT: - default: - currentFont->print(*line_iter, ceil(x), ceil(y)); - break; - } - y += currentFont->getHeight() * currentFont->getLineHeight(); - } -} - -/** - * Primitives - **/ - -void Graphics::point(float x, float y) -{ - glDisable(GL_TEXTURE_2D); - glBegin(GL_POINTS); - glVertex2f(x, y); - glEnd(); - glEnable(GL_TEXTURE_2D); -} - -// Calculate line boundary points u1 and u2. Sketch: -// u1 -// -------------+---...___ -// | ```'''-- --- -// p- - - - - - q- - . _ _ | w/2 -// | ` ' ' r + -// -------------+---...___ | w/2 -// u2 ```'''-- --- -// -// u1 and u2 depend on four things: -// - the half line width w/2 -// - the previous line vertex p -// - the current line vertex q -// - the next line vertex r -// -// u1/u2 are the intersection points of the parallel lines to p-q and q-r, -// i.e. the point where -// -// (p + w/2 * n1) + mu * (q - p) = (q + w/2 * n2) + lambda * (r - q) (u1) -// (p - w/2 * n1) + mu * (q - p) = (q - w/2 * n2) + lambda * (r - q) (u2) -// -// with n1,n2 being the normals on the segments p-q and q-r: -// -// n1 = perp(q - p) / |q - p| -// n2 = perp(r - q) / |r - q| -// -// The intersection points can be calculated using cramers rule. -static void pushIntersectionPoints(Vector *vertices, Vector *overdraw, - int pos, int count, float hw, float overdraw_factor, - const Vector &p, const Vector &q, const Vector &r) -{ - // calculate line directions - Vector s = (q - p); - Vector t = (r - q); - - // calculate vertex displacement vectors - Vector n1 = s.getNormal(); - Vector n2 = t.getNormal(); - n1.normalize(); - n2.normalize(); - float det_norm = n1 ^ n2; // will be close to zero if the angle between the normals is sharp - n1 *= hw; - n2 *= hw; - - // lines parallel -> assume intersection at displacement points - if (fabs(det_norm) <= .03) - { - vertices[pos] = q - n2; - vertices[pos+1] = q + n2; - } - // real intersection -> calculate boundary intersection points with cramers rule - else - { - float det = s ^ t; - Vector d = n1 - n2; - Vector b = s - d; // s = q - p - Vector c = s + d; - float lambda = (b ^ t) / det; - float mu = (c ^ t) / det; - - // ordering for GL_TRIANGLE_STRIP - vertices[pos] = p + s*mu - n1; // u1 - vertices[pos+1] = p + s*lambda + n1; // u2 - } - - if (overdraw) - { - // displacement of the overdraw vertices - Vector x = (vertices[pos] - q) * overdraw_factor; - - overdraw[pos] = vertices[pos]; - overdraw[pos+1] = vertices[pos] + x; - - overdraw[2*count-pos-2] = vertices[pos+1]; - overdraw[2*count-pos-1] = vertices[pos+1] - x; - } -} - -// precondition: -// glEnableClientState(GL_VERTEX_ARRAY); -static void draw_overdraw(Vector *overdraw, size_t count, float pixel_size, bool looping) -{ - // if not looping, the outer overdraw vertices need to be displaced - // to cover the line endings, i.e.: - // +- - - - //- - + +- - - - - //- - - + - // +-------//-----+ : +-------//-----+ : - // | core // line | --> : | core // line | : - // +-----//-------+ : +-----//-------+ : - // +- - //- - - - + +- - - //- - - - - + - if (!looping) - { - Vector s = overdraw[1] - overdraw[3]; - s.normalize(); - s *= pixel_size; - overdraw[1] += s; - overdraw[2*count-1] += s; - - Vector t = overdraw[count-1] - overdraw[count-3]; - t.normalize(); - t *= pixel_size; - overdraw[count-1] += t; - overdraw[count+1] += t; - - // we need to draw two more triangles to close the - // overdraw at the line start. - overdraw[2*count] = overdraw[0]; - overdraw[2*count+1] = overdraw[1]; - } - - // prepare colors: - // even indices in overdraw* point to inner vertices => alpha = current-alpha, - // odd indices point to outer vertices => alpha = 0. - GLfloat c[4]; - glGetFloatv(GL_CURRENT_COLOR, c); - - Color *colors = new Color[2*count+2]; - for (size_t i = 0; i < 2*count+2; ++i) - { - colors[i] = Color(GLubyte(c[0] * 255.f), - GLubyte(c[1] * 255.f), - GLubyte(c[2] * 255.f), - // avoids branching. equiv to if (i%2 == 1) colors[i].a = 0; - GLubyte(c[3] * 255.f) * GLubyte(i%2 == 0)); - } - - // draw faded out line halos - glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors); - glVertexPointer(2, GL_FLOAT, 0, (const GLvoid *)overdraw); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 2*count + 2 * int(!looping)); - glDisableClientState(GL_COLOR_ARRAY); - // "if GL_COLOR_ARRAY is enabled, the value of the current color is - // undefined after glDrawArrays executes" - glColor4fv(c); - - delete[] colors; -} - -void Graphics::polyline(const float *coords, size_t count) -{ - Vector *vertices = new Vector[count]; // two vertices for every line end-point - Vector *overdraw = NULL; - - Vector p,q,r; - bool looping = (coords[0] == coords[count-2]) && (coords[1] == coords[count-1]); - - float halfwidth = lineWidth/2.f; - float pixel_size = 1.f; - float overdraw_factor = .0f; - - if (lineStyle == LINE_SMOOTH) - { - overdraw = new Vector[2*count+2]; - // TODO: is there a better way to get the pixel size at the current scale? - GLfloat m[16]; - glGetFloatv(GL_MODELVIEW_MATRIX, m); - float det = m[0]*m[5]*m[10] + m[4]*m[9]*m[2] + m[8]*m[1]*m[6]; - det -= m[2]*m[5]*m[8] + m[6]*m[9]*m[0] + m[10]*m[1]*m[4]; - pixel_size = 1.f / sqrt(det); - - overdraw_factor = pixel_size / halfwidth; - halfwidth = std::max(.0f, halfwidth - .25f*pixel_size); - } - - // get line vertex boundaries - // if not looping, extend the line at the beginning, else use last point as `p' - r = Vector(coords[0], coords[1]); - if (!looping) - q = r * 2 - Vector(coords[2], coords[3]); - else - q = Vector(coords[count-4], coords[count-3]); - - for (size_t i = 0; i+3 < count; i += 2) - { - p = q; - q = r; - r = Vector(coords[i+2], coords[i+3]); - pushIntersectionPoints(vertices, overdraw, i, count, halfwidth, overdraw_factor, p,q,r); - } - - // if not looping, extend the line at the end, else use first point as `r' - p = q; - q = r; - if (!looping) - r += q - p; - else - r = Vector(coords[2], coords[3]); - pushIntersectionPoints(vertices, overdraw, count-2, count, halfwidth, overdraw_factor, p,q,r); - // end get line vertex boundaries - - // draw the core line - glDisable(GL_TEXTURE_2D); - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, GL_FLOAT, 0, (const GLvoid *)vertices); - glDrawArrays(GL_TRIANGLE_STRIP, 0, count); - - // draw the line halo (antialiasing) - if (lineStyle == LINE_SMOOTH) - draw_overdraw(overdraw, count, pixel_size, looping); - - glDisableClientState(GL_VERTEX_ARRAY); - glEnable(GL_TEXTURE_2D); - - // cleanup - delete[] vertices; - if (lineStyle == LINE_SMOOTH) - delete[] overdraw; -} - -void Graphics::triangle(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3) -{ - float coords[] = { x1,y1, x2,y2, x3,y3, x1,y1 }; - polygon(mode, coords, 4 * 2); -} - -void Graphics::rectangle(DrawMode mode, float x, float y, float w, float h) -{ - quad(mode, x,y, x,y+h, x+w,y+h, x+w,y); -} - -void Graphics::quad(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) -{ - float coords[] = { x1,y1, x2,y2, x3,y3, x4,y4, x1,y1 }; - polygon(mode, coords, 5 * 2); -} - -void Graphics::circle(DrawMode mode, float x, float y, float radius, int points) -{ - float two_pi = static_cast(LOVE_M_PI * 2); - if (points <= 0) points = 1; - float angle_shift = (two_pi / points); - float phi = .0f; - - float *coords = new float[2 * (points + 1)]; - for (int i = 0; i < points; ++i, phi += angle_shift) - { - coords[2*i] = x + radius * cos(phi); - coords[2*i+1] = y + radius * sin(phi); - } - - coords[2*points] = coords[0]; - coords[2*points+1] = coords[1]; - - polygon(mode, coords, (points + 1) * 2); - - delete[] coords; -} - -void Graphics::arc(DrawMode mode, float x, float y, float radius, float angle1, float angle2, int points) -{ - // Nothing to display with no points or equal angles. (Or is there with line mode?) - if (points <= 0 || angle1 == angle2) - return; - - // Oh, you want to draw a circle? - if (fabs(angle1 - angle2) >= 2.0f * (float) LOVE_M_PI) - { - circle(mode, x, y, radius, points); - return; - } - - float angle_shift = (angle2 - angle1) / points; - // Bail on precision issues. - if (angle_shift == 0.0) - return; - - float phi = angle1; - int num_coords = (points + 3) * 2; - float *coords = new float[num_coords]; - coords[0] = coords[num_coords - 2] = x; - coords[1] = coords[num_coords - 1] = y; - - for (int i = 0; i <= points; ++i, phi += angle_shift) - { - coords[2 * (i+1)] = x + radius * cos(phi); - coords[2 * (i+1) + 1] = y + radius * sin(phi); - } - - // GL_POLYGON can only fill-draw convex polygons, so we need to do stuff manually here - if (mode == DRAW_LINE) - { - polyline(coords, num_coords); // Artifacts at sharp angles if set to looping. - } - else - { - glDisable(GL_TEXTURE_2D); - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, GL_FLOAT, 0, (const GLvoid *) coords); - glDrawArrays(GL_TRIANGLE_FAN, 0, points + 2); - glDisableClientState(GL_VERTEX_ARRAY); - glEnable(GL_TEXTURE_2D); - } - - delete[] coords; -} - -/// @param mode the draw mode -/// @param coords the coordinate array -/// @param count the number of coordinates/size of the array -void Graphics::polygon(DrawMode mode, const float *coords, size_t count) -{ - // coords is an array of a closed loop of vertices, i.e. - // coords[count-2] = coords[0], coords[count-1] = coords[1] - if (mode == DRAW_LINE) - { - polyline(coords, count); - } - else - { - glDisable(GL_TEXTURE_2D); - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, GL_FLOAT, 0, (const GLvoid *)coords); - glDrawArrays(GL_POLYGON, 0, count/2-1); // opengl will close the polygon for us - glDisableClientState(GL_VERTEX_ARRAY); - glEnable(GL_TEXTURE_2D); - } -} - -love::image::ImageData *Graphics::newScreenshot(love::image::Image *image) -{ - int w = getWidth(); - int h = getHeight(); - - int row = 4*w; - - int size = row*h; - - GLubyte *pixels = new GLubyte[size]; - GLubyte *screenshot = new GLubyte[size]; - - glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels); - - // OpenGL sucks and reads pixels from the lower-left. Let's fix that. - - GLubyte *src = pixels - row, *dst = screenshot + size; - - for (int i = 0; i < h; ++i) - { - memcpy(dst-=row, src+=row, row); - } - - love::image::ImageData *img = image->newImageData(w, h, (void *)screenshot); - - delete [] pixels; - delete [] screenshot; - - return img; -} - -void Graphics::push() -{ - if (userMatrices == matrixLimit) - throw Exception("Maximum stack depth reached."); - glPushMatrix(); - ++userMatrices; -} - -void Graphics::pop() -{ - if (userMatrices < 1) - throw Exception("Minimum stack depth reached. (More pops than pushes?)"); - glPopMatrix(); - --userMatrices; -} - -void Graphics::rotate(float r) -{ - glRotatef(LOVE_TODEG(r), 0, 0, 1); -} - -void Graphics::scale(float x, float y) -{ - glScalef(x, y, 1); -} - -void Graphics::translate(float x, float y) -{ - glTranslatef(x, y, 0); -} - -void Graphics::shear(float kx, float ky) -{ - Matrix t; - t.setShear(kx, ky); - glMultMatrixf((const GLfloat *)t.getElements()); -} - -void Graphics::drawTest(Image *image, float x, float y, float a, float sx, float sy, float ox, float oy) -{ - image->bind(); - - // Buffer for transforming the image. - vertex buf[4]; - - Matrix t; - t.translate(x, y); - t.rotate(a); - t.scale(sx, sy); - t.translate(ox, oy); - t.transform(buf, image->getVertices(), 4); - - const vertex *vertices = image->getVertices(); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&buf[0].x); - glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&vertices[0].s); - glDrawArrays(GL_QUADS, 0, 4); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_VERTEX_ARRAY); -} - -bool Graphics::hasFocus() -{ - return currentWindow->hasFocus(); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" +#include "common/math.h" +#include "common/Vector.h" + +#include "Graphics.h" +#include "window/sdl/Window.h" + +#include +#include +#include +#include + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Graphics::Graphics() + : currentFont(0) + , lineStyle(LINE_SMOOTH) + , lineWidth(1) + , matrixLimit(0) + , userMatrices(0) +{ + currentWindow = love::window::sdl::Window::getSingleton(); + + resetBoundTexture(); +} + +Graphics::~Graphics() +{ + if (currentFont != 0) + currentFont->release(); + + currentWindow->release(); +} + +const char *Graphics::getName() const +{ + return "love.graphics.opengl"; +} + +bool Graphics::checkMode(int width, int height, bool fullscreen) +{ + return currentWindow->checkWindowSize(width, height, fullscreen); +} + +DisplayState Graphics::saveState() +{ + DisplayState s; + + s.color = getColor(); + s.backgroundColor = getBackgroundColor(); + + s.blendMode = getBlendMode(); + s.colorMode = getColorMode(); + //get line style + s.lineStyle = lineStyle; + //get the point size + glGetFloatv(GL_POINT_SIZE, &s.pointSize); + //get point style + s.pointStyle = (glIsEnabled(GL_POINT_SMOOTH) == GL_TRUE) ? Graphics::POINT_SMOOTH : Graphics::POINT_ROUGH; + //get scissor status + s.scissor = (glIsEnabled(GL_SCISSOR_TEST) == GL_TRUE); + //do we have scissor, if so, store the box + if (s.scissor) + glGetIntegerv(GL_SCISSOR_BOX, s.scissorBox); + + return s; +} + +void Graphics::restoreState(const DisplayState &s) +{ + setColor(s.color); + setBackgroundColor(s.backgroundColor); + setBlendMode(s.blendMode); + setColorMode(s.colorMode); + setLine(lineWidth, s.lineStyle); + setPoint(s.pointSize, s.pointStyle); + if (s.scissor) + setScissor(s.scissorBox[0], s.scissorBox[1], s.scissorBox[2], s.scissorBox[3]); + else + setScissor(); +} + +bool Graphics::setMode(int width, int height, bool fullscreen, bool vsync, int fsaa) +{ + // This operation destroys the OpenGL context, so + // we must save the state. + DisplayState tempState; + if (isCreated()) + tempState = saveState(); + + // Unlad all volatile objects. These must be reloaded after + // the display mode change. + Volatile::unloadAll(); + + bool success = currentWindow->setWindow(width, height, fullscreen, vsync, fsaa); + // Regardless of failure, we'll have to set up OpenGL once again. + + width = currentWindow->getWidth(); + height = currentWindow->getHeight(); + + // Okay, setup OpenGL. + + // Enable blending + glEnable(GL_BLEND); + + // "Normal" blending + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + // Enable line/point smoothing. + setLineStyle(LINE_SMOOTH); + glEnable(GL_POINT_SMOOTH); + glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); + + // Enable textures + glEnable(GL_TEXTURE_2D); + + // Set the viewport to top-left corner + glViewport(0, 0, width, height); + + // Reset the projection matrix + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + // Set up orthographic view (no depth) + glOrtho(0.0, width, height, 0.0, -1.0, 1.0); + + // Reset modelview matrix + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + // Set pixel row alignment + glPixelStorei(GL_UNPACK_ALIGNMENT, 2); + + // Reload all volatile objects. + if (!Volatile::loadAll()) + std::cerr << "Could not reload all volatile objects." << std::endl; + + // Restore the display state. + restoreState(tempState); + + // Get the maximum number of matrices + // subtract a few to give the engine some room. + glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &matrixLimit); + matrixLimit -= 5; + + return success; +} + +void Graphics::getMode(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa) +{ + currentWindow->getWindow(width, height, fullscreen, vsync, fsaa); +} + +bool Graphics::toggleFullscreen() +{ + int width, height, fsaa; + bool fullscreen, vsync; + currentWindow->getWindow(width, height, fullscreen, vsync, fsaa); + return setMode(width, height, !fullscreen, vsync, fsaa); +} + + +void Graphics::reset() +{ + DisplayState s; + discardStencil(); + Canvas::bindDefaultCanvas(); + PixelEffect::detach(); + restoreState(s); +} + +void Graphics::clear() +{ + glClear(GL_COLOR_BUFFER_BIT); + glLoadIdentity(); +} + +void Graphics::present() +{ + currentWindow->swapBuffers(); +} + +void Graphics::setIcon(Image *image) +{ + currentWindow->setIcon(image->getData()); +} + +void Graphics::setCaption(const char *caption) +{ + std::string title(caption); + currentWindow->setWindowTitle(title); +} + +int Graphics::getCaption(lua_State *L) +{ + std::string title = currentWindow->getWindowTitle(); + lua_pushstring(L, title.c_str()); + return 1; +} + +int Graphics::getWidth() +{ + return currentWindow->getWidth(); +} + +int Graphics::getHeight() +{ + return currentWindow->getHeight(); +} + +int Graphics::getRenderHeight() +{ + if (Canvas::current) + return Canvas::current->getHeight(); + return getHeight(); +} + +bool Graphics::isCreated() +{ + return currentWindow->isCreated(); +} + +int Graphics::getModes(lua_State *L) +{ + int n; + love::window::Window::WindowSize **modes = currentWindow->getFullscreenSizes(n); + + if (modes == 0) + return 0; + + lua_newtable(L); + + for (int i = 0; i < n ; i++) + { + lua_pushinteger(L, i+1); + lua_newtable(L); + + // Inner table attribs. + + lua_pushstring(L, "width"); + lua_pushinteger(L, modes[i]->width); + lua_settable(L, -3); + + lua_pushstring(L, "height"); + lua_pushinteger(L, modes[i]->height); + lua_settable(L, -3); + + // Inner table attribs end. + + lua_settable(L, -3); + + delete modes[i]; + } + + delete[] modes; + return 1; +} + +void Graphics::setScissor(int x, int y, int width, int height) +{ + glEnable(GL_SCISSOR_TEST); + glScissor(x, getRenderHeight() - (y + height), width, height); // Compensates for the fact that our y-coordinate is reverse of OpenGLs. +} + +void Graphics::setScissor() +{ + glDisable(GL_SCISSOR_TEST); +} + +int Graphics::getScissor(lua_State *L) +{ + if (glIsEnabled(GL_SCISSOR_TEST) == GL_FALSE) + return 0; + + GLint scissor[4]; + glGetIntegerv(GL_SCISSOR_BOX, scissor); + + lua_pushnumber(L, scissor[0]); + lua_pushnumber(L, getRenderHeight() - (scissor[1] + scissor[3])); // Compensates for the fact that our y-coordinate is reverse of OpenGLs. + lua_pushnumber(L, scissor[2]); + lua_pushnumber(L, scissor[3]); + + return 4; +} + +void Graphics::defineStencil() +{ + glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); + glEnable(GL_STENCIL_TEST); + glClear(GL_STENCIL_BUFFER_BIT); + glStencilFunc(GL_ALWAYS, 1, 1); + glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); +} + +void Graphics::useStencil(bool invert) +{ + glStencilFunc(GL_EQUAL, (int)(!invert), 1); // invert ? 0 : 1 + glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); +} + +void Graphics::discardStencil() +{ + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + glDisable(GL_STENCIL_TEST); +} + +Image *Graphics::newImage(love::image::ImageData *data) +{ + // Create the image. + Image *image = new Image(data); + bool success; + try + { + success = image->load(); + } + catch(love::Exception &e) + { + image->release(); + throw love::Exception(e.what()); + } + if (!success) + { + image->release(); + return 0; + } + + return image; +} + +Quad *Graphics::newQuad(float x, float y, float w, float h, float sw, float sh) +{ + Quad::Viewport v; + v.x = x; + v.y = y; + v.w = w; + v.h = h; + return new Quad(v, sw, sh); +} + +Font *Graphics::newFont(love::font::Rasterizer *r, const Image::Filter &filter) +{ + Font *font = new Font(r, filter); + + // Load it and check for errors. + if (!font) + { + delete font; + return 0; + } + + return font; +} + +SpriteBatch *Graphics::newSpriteBatch(Image *image, int size, int usage) +{ + SpriteBatch *t = NULL; + try + { + t = new SpriteBatch(image, size, usage); + } + catch(love::Exception &e) + { + if (t) delete t; + throw e; + } + return t; +} + +ParticleSystem *Graphics::newParticleSystem(Image *image, int size) +{ + return new ParticleSystem(image, size); +} + +Canvas *Graphics::newCanvas(int width, int height) +{ + Canvas *canvas = new Canvas(width, height); + GLenum err = canvas->getStatus(); + + // everything ok, reaturn canvas (early out) + if (err == GL_FRAMEBUFFER_COMPLETE) + return canvas; + + // create error message + std::stringstream error_string; + error_string << "Cannot create canvas: "; + switch (err) + { + + case GL_FRAMEBUFFER_UNSUPPORTED: + error_string << "Not supported by your OpenGL implementation."; + break; + + // remaining error codes are highly unlikely: + case GL_FRAMEBUFFER_UNDEFINED: + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: + case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: + case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: + error_string << "Error in implementation. Possible fix: Make canvas width and height powers of two."; + break; + + default: + // my intel hda card wrongly returns 0 to glCheckFramebufferStatus() but sets + // no error flag. I think it meant to return GL_FRAMEBUFFER_UNSUPPORTED, but who + // knows. + if (glGetError() == GL_NO_ERROR) + error_string << "May not be supported by your OpenGL implementation."; + // the remaining error is an indication of a serious fuckup since it should + // only be returned if glCheckFramebufferStatus() was called with the wrong + // arguments. + else + error_string << "Cannot create canvas: Aliens did it (OpenGL error code: " << glGetError() << ")"; + } + + canvas->release(); + throw Exception(error_string.str().c_str()); + return NULL; // never reached +} + +PixelEffect *Graphics::newPixelEffect(const std::string &code) +{ + PixelEffect *effect = NULL; + try + { + effect = new PixelEffect(code); + } + catch(love::Exception &e) + { + if (effect) + delete effect; + throw(e); + } + return effect; +} + +void Graphics::setColor(const Color &c) +{ + glColor4ubv(&c.r); +} + +Color Graphics::getColor() +{ + float c[4]; + glGetFloatv(GL_CURRENT_COLOR, c); + + Color t; + t.r = (unsigned char)(255.0f*c[0]); + t.g = (unsigned char)(255.0f*c[1]); + t.b = (unsigned char)(255.0f*c[2]); + t.a = (unsigned char)(255.0f*c[3]); + + return t; +} + +void Graphics::setBackgroundColor(const Color &c) +{ + glClearColor((float)c.r/255.0f, (float)c.g/255.0f, (float)c.b/255.0f, (float)c.a/255.0f); +} + +Color Graphics::getBackgroundColor() +{ + float c[4]; + glGetFloatv(GL_COLOR_CLEAR_VALUE, c); + + Color t; + t.r = (unsigned char)(255.0f*c[0]); + t.g = (unsigned char)(255.0f*c[1]); + t.b = (unsigned char)(255.0f*c[2]); + t.a = (unsigned char)(255.0f*c[3]); + + return t; +} + +void Graphics::setFont(Font *font) +{ + if (currentFont != 0) + currentFont->release(); + + currentFont = font; + + if (font != 0) + currentFont->retain(); +} + +Font *Graphics::getFont() +{ + return currentFont; +} + +void Graphics::setBlendMode(Graphics::BlendMode mode) +{ + glAlphaFunc(GL_GEQUAL, 0); + + if (GLEE_VERSION_1_4 || GLEE_ARB_imaging) + { + if (mode == BLEND_SUBTRACTIVE) + glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + else + glBlendEquation(GL_FUNC_ADD); + } + else if (GLEE_EXT_blend_minmax && GLEE_EXT_blend_subtract) + { + if (mode == BLEND_SUBTRACTIVE) + glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); + else + glBlendEquationEXT(GL_FUNC_ADD_EXT); + } + else + { + if (mode == BLEND_SUBTRACTIVE) + throw Exception("This graphics card does not support the subtract blend mode!"); + // GL_FUNC_ADD is the default even without access to glBlendEquation, so that'll still work. + } + + if (mode == BLEND_ALPHA) + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + else if (mode == BLEND_MULTIPLICATIVE) + glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); + else if (mode == BLEND_PREMULTIPLIED) + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + else // mode == BLEND_ADDITIVE || mode == BLEND_SUBTRACTIVE + glBlendFunc(GL_SRC_ALPHA, GL_ONE); +} + +void Graphics::setColorMode(Graphics::ColorMode mode) +{ + if (mode == COLOR_MODULATE) + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + else if (mode == COLOR_COMBINE) + { + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_ADD_SIGNED); + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + } + else // mode = COLOR_REPLACE + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); +} + +void Graphics::setDefaultImageFilter(const Image::Filter &f) +{ + Image::setDefaultFilter(f); +} + +Graphics::BlendMode Graphics::getBlendMode() +{ + GLint dst, src, equation; + glGetIntegerv(GL_BLEND_DST, &dst); + glGetIntegerv(GL_BLEND_SRC, &src); + glGetIntegerv(GL_BLEND_EQUATION, &equation); + + if (equation == GL_FUNC_REVERSE_SUBTRACT) // && src == GL_SRC_ALPHA && dst == GL_ONE + return BLEND_SUBTRACTIVE; + else if (src == GL_SRC_ALPHA && dst == GL_ONE) // && equation == GL_FUNC_ADD + return BLEND_ADDITIVE; + else if (src == GL_SRC_ALPHA && dst == GL_ONE_MINUS_SRC_ALPHA) // && equation == GL_FUNC_ADD + return BLEND_ALPHA; + else if (src == GL_DST_COLOR && dst == GL_ONE_MINUS_SRC_ALPHA) // && equation == GL_FUNC_ADD + return BLEND_MULTIPLICATIVE; + else if (src == GL_ONE && dst == GL_ONE_MINUS_SRC_ALPHA) // && equation == GL_FUNC_ADD + return BLEND_PREMULTIPLIED; + + return BLEND_MAX_ENUM; // Should never be reached. +} + +Graphics::ColorMode Graphics::getColorMode() +{ + GLint mode; + glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &mode); + + if (mode == GL_MODULATE) + return COLOR_MODULATE; + else if (mode == GL_COMBINE) + return COLOR_COMBINE; + else // mode == GL_REPLACE + return COLOR_REPLACE; +} + +const Image::Filter &Graphics::getDefaultImageFilter() const +{ + return Image::getDefaultFilter(); +} + +void Graphics::setLineWidth(float width) +{ + lineWidth = width; +} + +void Graphics::setLineStyle(Graphics::LineStyle style) +{ + lineStyle = style; +} + +void Graphics::setLine(float width, Graphics::LineStyle style) +{ + setLineWidth(width); + + if (style == 0) + return; + setLineStyle(style); +} + +float Graphics::getLineWidth() +{ + return lineWidth; +} + +Graphics::LineStyle Graphics::getLineStyle() +{ + return lineStyle; +} + +void Graphics::setPointSize(float size) +{ + glPointSize((GLfloat)size); +} + +void Graphics::setPointStyle(Graphics::PointStyle style) +{ + if (style == POINT_SMOOTH) + glEnable(GL_POINT_SMOOTH); + else // love::POINT_ROUGH + glDisable(GL_POINT_SMOOTH); +} + +void Graphics::setPoint(float size, Graphics::PointStyle style) +{ + if (style == POINT_SMOOTH) + glEnable(GL_POINT_SMOOTH); + else // POINT_ROUGH + glDisable(GL_POINT_SMOOTH); + + glPointSize((GLfloat)size); +} + +float Graphics::getPointSize() +{ + GLfloat size; + glGetFloatv(GL_POINT_SIZE, &size); + return (float)size; +} + +Graphics::PointStyle Graphics::getPointStyle() +{ + if (glIsEnabled(GL_POINT_SMOOTH) == GL_TRUE) + return POINT_SMOOTH; + else + return POINT_ROUGH; +} + +int Graphics::getMaxPointSize() +{ + GLint max; + glGetIntegerv(GL_POINT_SIZE_MAX, &max); + return (int)max; +} + +void Graphics::print(const char *str, float x, float y , float angle, float sx, float sy, float ox, float oy, float kx, float ky) +{ + if (currentFont != 0) + { + std::string text(str); + currentFont->print(text, x, y, angle, sx, sy, ox, oy, kx, ky); + } +} + +void Graphics::printf(const char *str, float x, float y, float wrap, AlignMode align) +{ + if (currentFont == 0) + return; + + using namespace std; + string text(str); + vector lines_to_draw = currentFont->getWrap(text, wrap); + + // now for the actual printing + vector::const_iterator line_iter, line_end = lines_to_draw.end(); + for (line_iter = lines_to_draw.begin(); line_iter != line_end; ++line_iter) + { + float width = static_cast(currentFont->getWidth(*line_iter)); + switch (align) + { + case ALIGN_RIGHT: + currentFont->print(*line_iter, ceil(x + wrap - width), ceil(y)); + break; + case ALIGN_CENTER: + currentFont->print(*line_iter, ceil(x + (wrap - width) / 2), ceil(y)); + break; + case ALIGN_LEFT: + default: + currentFont->print(*line_iter, ceil(x), ceil(y)); + break; + } + y += currentFont->getHeight() * currentFont->getLineHeight(); + } +} + +/** + * Primitives + **/ + +void Graphics::point(float x, float y) +{ + glDisable(GL_TEXTURE_2D); + glBegin(GL_POINTS); + glVertex2f(x, y); + glEnd(); + glEnable(GL_TEXTURE_2D); +} + +// Calculate line boundary points u1 and u2. Sketch: +// u1 +// -------------+---...___ +// | ```'''-- --- +// p- - - - - - q- - . _ _ | w/2 +// | ` ' ' r + +// -------------+---...___ | w/2 +// u2 ```'''-- --- +// +// u1 and u2 depend on four things: +// - the half line width w/2 +// - the previous line vertex p +// - the current line vertex q +// - the next line vertex r +// +// u1/u2 are the intersection points of the parallel lines to p-q and q-r, +// i.e. the point where +// +// (p + w/2 * n1) + mu * (q - p) = (q + w/2 * n2) + lambda * (r - q) (u1) +// (p - w/2 * n1) + mu * (q - p) = (q - w/2 * n2) + lambda * (r - q) (u2) +// +// with n1,n2 being the normals on the segments p-q and q-r: +// +// n1 = perp(q - p) / |q - p| +// n2 = perp(r - q) / |r - q| +// +// The intersection points can be calculated using cramers rule. +static void pushIntersectionPoints(Vector *vertices, Vector *overdraw, + int pos, int count, float hw, float overdraw_factor, + const Vector &p, const Vector &q, const Vector &r) +{ + // calculate line directions + Vector s = (q - p); + Vector t = (r - q); + + // calculate vertex displacement vectors + Vector n1 = s.getNormal(); + Vector n2 = t.getNormal(); + n1.normalize(); + n2.normalize(); + float det_norm = n1 ^ n2; // will be close to zero if the angle between the normals is sharp + n1 *= hw; + n2 *= hw; + + // lines parallel -> assume intersection at displacement points + if (fabs(det_norm) <= .03) + { + vertices[pos] = q - n2; + vertices[pos+1] = q + n2; + } + // real intersection -> calculate boundary intersection points with cramers rule + else + { + float det = s ^ t; + Vector d = n1 - n2; + Vector b = s - d; // s = q - p + Vector c = s + d; + float lambda = (b ^ t) / det; + float mu = (c ^ t) / det; + + // ordering for GL_TRIANGLE_STRIP + vertices[pos] = p + s*mu - n1; // u1 + vertices[pos+1] = p + s*lambda + n1; // u2 + } + + if (overdraw) + { + // displacement of the overdraw vertices + Vector x = (vertices[pos] - q) * overdraw_factor; + + overdraw[pos] = vertices[pos]; + overdraw[pos+1] = vertices[pos] + x; + + overdraw[2*count-pos-2] = vertices[pos+1]; + overdraw[2*count-pos-1] = vertices[pos+1] - x; + } +} + +// precondition: +// glEnableClientState(GL_VERTEX_ARRAY); +static void draw_overdraw(Vector *overdraw, size_t count, float pixel_size, bool looping) +{ + // if not looping, the outer overdraw vertices need to be displaced + // to cover the line endings, i.e.: + // +- - - - //- - + +- - - - - //- - - + + // +-------//-----+ : +-------//-----+ : + // | core // line | --> : | core // line | : + // +-----//-------+ : +-----//-------+ : + // +- - //- - - - + +- - - //- - - - - + + if (!looping) + { + Vector s = overdraw[1] - overdraw[3]; + s.normalize(); + s *= pixel_size; + overdraw[1] += s; + overdraw[2*count-1] += s; + + Vector t = overdraw[count-1] - overdraw[count-3]; + t.normalize(); + t *= pixel_size; + overdraw[count-1] += t; + overdraw[count+1] += t; + + // we need to draw two more triangles to close the + // overdraw at the line start. + overdraw[2*count] = overdraw[0]; + overdraw[2*count+1] = overdraw[1]; + } + + // prepare colors: + // even indices in overdraw* point to inner vertices => alpha = current-alpha, + // odd indices point to outer vertices => alpha = 0. + GLfloat c[4]; + glGetFloatv(GL_CURRENT_COLOR, c); + + Color *colors = new Color[2*count+2]; + for (size_t i = 0; i < 2*count+2; ++i) + { + colors[i] = Color(GLubyte(c[0] * 255.f), + GLubyte(c[1] * 255.f), + GLubyte(c[2] * 255.f), + // avoids branching. equiv to if (i%2 == 1) colors[i].a = 0; + GLubyte(c[3] * 255.f) * GLubyte(i%2 == 0)); + } + + // draw faded out line halos + glEnableClientState(GL_COLOR_ARRAY); + glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors); + glVertexPointer(2, GL_FLOAT, 0, (const GLvoid *)overdraw); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 2*count + 2 * int(!looping)); + glDisableClientState(GL_COLOR_ARRAY); + // "if GL_COLOR_ARRAY is enabled, the value of the current color is + // undefined after glDrawArrays executes" + glColor4fv(c); + + delete[] colors; +} + +void Graphics::polyline(const float *coords, size_t count) +{ + Vector *vertices = new Vector[count]; // two vertices for every line end-point + Vector *overdraw = NULL; + + Vector p,q,r; + bool looping = (coords[0] == coords[count-2]) && (coords[1] == coords[count-1]); + + float halfwidth = lineWidth/2.f; + float pixel_size = 1.f; + float overdraw_factor = .0f; + + if (lineStyle == LINE_SMOOTH) + { + overdraw = new Vector[2*count+2]; + // TODO: is there a better way to get the pixel size at the current scale? + GLfloat m[16]; + glGetFloatv(GL_MODELVIEW_MATRIX, m); + float det = m[0]*m[5]*m[10] + m[4]*m[9]*m[2] + m[8]*m[1]*m[6]; + det -= m[2]*m[5]*m[8] + m[6]*m[9]*m[0] + m[10]*m[1]*m[4]; + pixel_size = 1.f / sqrt(det); + + overdraw_factor = pixel_size / halfwidth; + halfwidth = std::max(.0f, halfwidth - .25f*pixel_size); + } + + // get line vertex boundaries + // if not looping, extend the line at the beginning, else use last point as `p' + r = Vector(coords[0], coords[1]); + if (!looping) + q = r * 2 - Vector(coords[2], coords[3]); + else + q = Vector(coords[count-4], coords[count-3]); + + for (size_t i = 0; i+3 < count; i += 2) + { + p = q; + q = r; + r = Vector(coords[i+2], coords[i+3]); + pushIntersectionPoints(vertices, overdraw, i, count, halfwidth, overdraw_factor, p,q,r); + } + + // if not looping, extend the line at the end, else use first point as `r' + p = q; + q = r; + if (!looping) + r += q - p; + else + r = Vector(coords[2], coords[3]); + pushIntersectionPoints(vertices, overdraw, count-2, count, halfwidth, overdraw_factor, p,q,r); + // end get line vertex boundaries + + // draw the core line + glDisable(GL_TEXTURE_2D); + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(2, GL_FLOAT, 0, (const GLvoid *)vertices); + glDrawArrays(GL_TRIANGLE_STRIP, 0, count); + + // draw the line halo (antialiasing) + if (lineStyle == LINE_SMOOTH) + draw_overdraw(overdraw, count, pixel_size, looping); + + glDisableClientState(GL_VERTEX_ARRAY); + glEnable(GL_TEXTURE_2D); + + // cleanup + delete[] vertices; + if (lineStyle == LINE_SMOOTH) + delete[] overdraw; +} + +void Graphics::triangle(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3) +{ + float coords[] = { x1,y1, x2,y2, x3,y3, x1,y1 }; + polygon(mode, coords, 4 * 2); +} + +void Graphics::rectangle(DrawMode mode, float x, float y, float w, float h) +{ + quad(mode, x,y, x,y+h, x+w,y+h, x+w,y); +} + +void Graphics::quad(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) +{ + float coords[] = { x1,y1, x2,y2, x3,y3, x4,y4, x1,y1 }; + polygon(mode, coords, 5 * 2); +} + +void Graphics::circle(DrawMode mode, float x, float y, float radius, int points) +{ + float two_pi = static_cast(LOVE_M_PI * 2); + if (points <= 0) points = 1; + float angle_shift = (two_pi / points); + float phi = .0f; + + float *coords = new float[2 * (points + 1)]; + for (int i = 0; i < points; ++i, phi += angle_shift) + { + coords[2*i] = x + radius * cos(phi); + coords[2*i+1] = y + radius * sin(phi); + } + + coords[2*points] = coords[0]; + coords[2*points+1] = coords[1]; + + polygon(mode, coords, (points + 1) * 2); + + delete[] coords; +} + +void Graphics::arc(DrawMode mode, float x, float y, float radius, float angle1, float angle2, int points) +{ + // Nothing to display with no points or equal angles. (Or is there with line mode?) + if (points <= 0 || angle1 == angle2) + return; + + // Oh, you want to draw a circle? + if (fabs(angle1 - angle2) >= 2.0f * (float) LOVE_M_PI) + { + circle(mode, x, y, radius, points); + return; + } + + float angle_shift = (angle2 - angle1) / points; + // Bail on precision issues. + if (angle_shift == 0.0) + return; + + float phi = angle1; + int num_coords = (points + 3) * 2; + float *coords = new float[num_coords]; + coords[0] = coords[num_coords - 2] = x; + coords[1] = coords[num_coords - 1] = y; + + for (int i = 0; i <= points; ++i, phi += angle_shift) + { + coords[2 * (i+1)] = x + radius * cos(phi); + coords[2 * (i+1) + 1] = y + radius * sin(phi); + } + + // GL_POLYGON can only fill-draw convex polygons, so we need to do stuff manually here + if (mode == DRAW_LINE) + { + polyline(coords, num_coords); // Artifacts at sharp angles if set to looping. + } + else + { + glDisable(GL_TEXTURE_2D); + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(2, GL_FLOAT, 0, (const GLvoid *) coords); + glDrawArrays(GL_TRIANGLE_FAN, 0, points + 2); + glDisableClientState(GL_VERTEX_ARRAY); + glEnable(GL_TEXTURE_2D); + } + + delete[] coords; +} + +/// @param mode the draw mode +/// @param coords the coordinate array +/// @param count the number of coordinates/size of the array +void Graphics::polygon(DrawMode mode, const float *coords, size_t count) +{ + // coords is an array of a closed loop of vertices, i.e. + // coords[count-2] = coords[0], coords[count-1] = coords[1] + if (mode == DRAW_LINE) + { + polyline(coords, count); + } + else + { + glDisable(GL_TEXTURE_2D); + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(2, GL_FLOAT, 0, (const GLvoid *)coords); + glDrawArrays(GL_POLYGON, 0, count/2-1); // opengl will close the polygon for us + glDisableClientState(GL_VERTEX_ARRAY); + glEnable(GL_TEXTURE_2D); + } +} + +love::image::ImageData *Graphics::newScreenshot(love::image::Image *image) +{ + int w = getWidth(); + int h = getHeight(); + + int row = 4*w; + + int size = row*h; + + GLubyte *pixels = new GLubyte[size]; + GLubyte *screenshot = new GLubyte[size]; + + glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels); + + // OpenGL sucks and reads pixels from the lower-left. Let's fix that. + + GLubyte *src = pixels - row, *dst = screenshot + size; + + for (int i = 0; i < h; ++i) + { + memcpy(dst-=row, src+=row, row); + } + + love::image::ImageData *img = image->newImageData(w, h, (void *)screenshot); + + delete [] pixels; + delete [] screenshot; + + return img; +} + +void Graphics::push() +{ + if (userMatrices == matrixLimit) + throw Exception("Maximum stack depth reached."); + glPushMatrix(); + ++userMatrices; +} + +void Graphics::pop() +{ + if (userMatrices < 1) + throw Exception("Minimum stack depth reached. (More pops than pushes?)"); + glPopMatrix(); + --userMatrices; +} + +void Graphics::rotate(float r) +{ + glRotatef(LOVE_TODEG(r), 0, 0, 1); +} + +void Graphics::scale(float x, float y) +{ + glScalef(x, y, 1); +} + +void Graphics::translate(float x, float y) +{ + glTranslatef(x, y, 0); +} + +void Graphics::shear(float kx, float ky) +{ + Matrix t; + t.setShear(kx, ky); + glMultMatrixf((const GLfloat *)t.getElements()); +} + +void Graphics::drawTest(Image *image, float x, float y, float a, float sx, float sy, float ox, float oy) +{ + image->bind(); + + // Buffer for transforming the image. + vertex buf[4]; + + Matrix t; + t.translate(x, y); + t.rotate(a); + t.scale(sx, sy); + t.translate(ox, oy); + t.transform(buf, image->getVertices(), 4); + + const vertex *vertices = image->getVertices(); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&buf[0].x); + glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&vertices[0].s); + glDrawArrays(GL_QUADS, 0, 4); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); +} + +bool Graphics::hasFocus() +{ + return currentWindow->hasFocus(); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/Graphics.h b/src/modules/graphics/opengl/Graphics.h index 9013508c7..7e3ca454d 100644 --- a/src/modules/graphics/opengl/Graphics.h +++ b/src/modules/graphics/opengl/Graphics.h @@ -1,535 +1,535 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_GRAPHICS_H -#define LOVE_GRAPHICS_OPENGL_GRAPHICS_H - -// STD -#include -#include - -// OpenGL -#include "GLee.h" - -// LOVE -#include "graphics/Graphics.h" -#include "graphics/Color.h" - -#include "image/Image.h" -#include "image/ImageData.h" - -#include "window/Window.h" - -#include "OpenGL.h" -#include "Font.h" -#include "Image.h" -#include "Quad.h" -#include "SpriteBatch.h" -#include "ParticleSystem.h" -#include "Canvas.h" -#include "PixelEffect.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -// During display mode changing, certain -// variables about the OpenGL context are -// lost. -struct DisplayState -{ - // Colors. - Color color; - Color backgroundColor; - - // Blend and color modes. - Graphics::BlendMode blendMode; - Graphics::ColorMode colorMode; - - // Line. - Graphics::LineStyle lineStyle; - - // Point. - float pointSize; - Graphics::PointStyle pointStyle; - - // Scissor. - bool scissor; - GLint scissorBox[4]; - - // Window info. - std::string caption; - bool mouseVisible; - - // Default values. - DisplayState() - { - color.set(255,255,255,255); - backgroundColor.r = 0; - backgroundColor.g = 0; - backgroundColor.b = 0; - backgroundColor.a = 255; - blendMode = Graphics::BLEND_ALPHA; - colorMode = Graphics::COLOR_MODULATE; - lineStyle = Graphics::LINE_SMOOTH; - pointSize = 1.0f; - pointStyle = Graphics::POINT_SMOOTH; - scissor = false; - caption = ""; - mouseVisible = true; - } - -}; - -class Graphics : public love::graphics::Graphics -{ -public: - - Graphics(); - virtual ~Graphics(); - - // Implements Module. - const char *getName() const; - - /** - * Checks whether a display mode is supported or not. Note - * that fullscreen is assumed, because windowed modes are - * generally supported regardless of size. - * @param width The window width. - * @param height The window height. - **/ - bool checkMode(int width, int height, bool fullscreen); - - DisplayState saveState(); - - void restoreState(const DisplayState &s); - - /** - * Sets the current display mode. - * @param width The window width. - * @param height The window height. - * @param fullscreen True if fullscreen, false otherwise. - * @param vsync True if we should wait for vsync, false otherwise. - * @param fsaa Number of full scene anti-aliasing buffer, or 0 for disabled. - **/ - bool setMode(int width, int height, bool fullscreen, bool vsync, int fsaa); - - /** - * Gets the current display mode. - * @param width Pointer to an integer for the window width. - * @param height Pointer to an integer for the window height. - * @param fullscreen Pointer to a boolean for the fullscreen status. - * @param vsync Pointer to a boolean for the vsync status. - * @param fsaa Pointer to an integer for the current number of full scene anti-aliasing buffers. - **/ - void getMode(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa); - - /** - * Toggles fullscreen. Note that this also needs to reload the - * entire OpenGL context. - **/ - bool toggleFullscreen(); - - /** - * Resets the current color, background color, - * line style, and so forth. (This will be called - * when the game reloads. - **/ - void reset(); - - /** - * Clears the screen. - **/ - void clear(); - - /** - * Flips buffers. (Rendered geometry is - * presented on screen). - **/ - void present(); - - /** - * Sets the window's icon. - **/ - void setIcon(Image *image); - - /** - * Sets the window's caption. - **/ - void setCaption(const char *caption); - - int getCaption(lua_State *L); - - /** - * Gets the width of the current display mode. - **/ - int getWidth(); - - /** - * Gets the height of the current display mode. - **/ - int getHeight(); - - /** - * True if some display mode is set. - **/ - bool isCreated(); - - /** - * This native Lua function gets available modes - * from SDL and returns them as a table on the following format: - * - * { - * { width = 800, height = 600 }, - * { width = 1024, height = 768 }, - * ... - * } - * - * Only fullscreen modes are returned here, as all - * window sizes are supported (normally). - **/ - int getModes(lua_State *L); - - /** - * Scissor defines a box such that everything outside that box is discared and not drawn. - * Scissoring is automatically enabled. - * @param x The x-coordinate of the top-left corner. - * @param y The y-coordinate of the top-left corner. - * @param width The width of the box. - * @param height The height of the box. - **/ - void setScissor(int x, int y, int width, int height); - - /** - * Clears any scissor that has been created. - **/ - void setScissor(); - - /** - * This native Lua function gets the current scissor box in the order of: - * x, y, width, height - **/ - int getScissor(lua_State *L); - - /** - * Enables the stencil buffer and set stencil function to fill it - */ - void defineStencil(); - - /** - * Set stencil function to mask the following drawing calls using - * the current stencil buffer - * @param invert Invert the mask, i.e. draw everywhere expect where - * the mask is defined. - */ - void useStencil(bool invert = false); - - /** - * Disables the stencil buffer - */ - void discardStencil(); - - /** - * Creates an Image object with padding and/or optimization. - **/ - Image *newImage(love::filesystem::File *file); - Image *newImage(love::image::ImageData *data); - - /** - * Creates a Quad object. - **/ - Quad *newQuad(float x, float y, float w, float h, float sw, float sh); - - /** - * Creates a Font object. - **/ - Font *newFont(love::font::Rasterizer *data, const Image::Filter &filter = Image::Filter()); - - SpriteBatch *newSpriteBatch(Image *image, int size, int usage); - - ParticleSystem *newParticleSystem(Image *image, int size); - - Canvas *newCanvas(int width, int height); - - PixelEffect *newPixelEffect(const std::string &code); - - /** - * Sets the foreground color. - * @param c The new foreground color. - **/ - void setColor(const Color &c); - - /** - * Gets current color. - **/ - Color getColor(); - - /** - * Sets the background Color. - **/ - void setBackgroundColor(const Color &c); - - /** - * Gets the current background color. - **/ - Color getBackgroundColor(); - - /** - * Sets the current font. - * @param font A Font object. - **/ - void setFont(Font *font); - /** - * Gets the current Font, or nil if none. - **/ - Font *getFont(); - - /** - * Sets the current blend mode. - **/ - void setBlendMode(BlendMode mode); - - /** - * Sets the current color mode. - **/ - void setColorMode(ColorMode mode); - - /** - * Sets the current image filter. - **/ - void setDefaultImageFilter(const Image::Filter &f); - - /** - * Gets the current blend mode. - **/ - BlendMode getBlendMode(); - - /** - * Gets the current color mode. - **/ - ColorMode getColorMode(); - - /** - * Gets the current image filter. - **/ - const Image::Filter &getDefaultImageFilter() const; - - /** - * Sets the line width. - * @param width The new width of the line. - **/ - void setLineWidth(float width); - - /** - * Sets the line style. - * @param style LINE_ROUGH or LINE_SMOOTH. - **/ - void setLineStyle(LineStyle style); - - /** - * Sets the type of line used to draw primitives. - * A shorthand for setLineWidth and setLineStyle. - **/ - void setLine(float width, LineStyle style); - - /** - * Gets the line width. - **/ - float getLineWidth(); - - /** - * Gets the line style. - **/ - LineStyle getLineStyle(); - - /** - * Sets the size of points. - **/ - void setPointSize(float size); - - /** - * Sets the style of points. - * @param style POINT_SMOOTH or POINT_ROUGH. - **/ - void setPointStyle(PointStyle style); - - /** - * Shorthand for setPointSize and setPointStyle. - **/ - void setPoint(float size, PointStyle style); - - /** - * Gets the point size. - **/ - float getPointSize(); - - /** - * Gets the point style. - **/ - PointStyle getPointStyle(); - - /** - * Gets the maximum point size supported. - * This may vary from computer to computer. - **/ - int getMaxPointSize(); - - /** - * Draws text at the specified coordinates, with rotation and - * scaling along both axes. - * @param x The x-coordinate. - * @param y The y-coordinate. - * @param angle The amount of rotation. - * @param sx The scale factor along the x-axis. (1 = normal). - * @param sy The scale factor along the y-axis. (1 = normal). - * @param ox The origin offset along the x-axis. - * @param oy The origin offset along the y-axis. - * @param kx Shear along the x-axis. - * @param ky Shear along the y-axis. - **/ - void print(const char *str, float x, float y , float angle, float sx, float sy, float ox, float oy, float kx, float ky); - - /** - * Draw formatted text on screen at the specified coordinates. - * - * @param str A string of text. - * @param x The x-coordinate. - * @param y The y-coordinate. - * @param wrap The maximum width of the text area. - * @param align Where to align the text. - **/ - void printf(const char *str, float x, float y, float wrap, AlignMode align); - - /** - * Draws a point at (x,y). - * @param x Point along x-axis. - * @param y Point along y-axis. - **/ - void point(float x, float y); - - /** - * Draws a series of lines connecting the given vertices. - * @param coords Vertex components (x1, y1, ..., xn, yn). If x1,y1 == xn,yn the line will be drawn closed. - * @param count Number of items in the array, i.e. count = 2 * n - **/ - void polyline(const float *coords, size_t count); - - /** - * Draws a triangle using the three coordinates passed. - * @param mode The mode of drawing (line/filled). - * @param x1 First x-coordinate. - * @param y1 First y-coordinate. - * @param x2 Second x-coordinate. - * @param y2 Second y-coordinate. - * @param x3 Third x-coordinate. - * @param y3 Third y-coordinate. - **/ - void triangle(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3); - - /** - * Draws a rectangle. - * @param x Position along x-axis for top-left corner. - * @param y Position along y-axis for top-left corner. - * @param w The width of the rectangle. - * @param h The height of the rectangle. - **/ - void rectangle(DrawMode mode, float x, float y, float w, float h); - - /** - * Draws a quadrilateral using the four coordinates passed. - * @param mode The mode of drawing (line/filled). - * @param x1 First x-coordinate. - * @param y1 First y-coordinate. - * @param x2 Second x-coordinate. - * @param y2 Second y-coordinate. - * @param x3 Third x-coordinate. - * @param y3 Third y-coordinate. - * @param x4 Fourth x-coordinate. - * @param y4 Fourth y-coordinate. - **/ - void quad(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); - - /** - * Draws a circle using the specified arguments. - * @param mode The mode of drawing (line/filled). - * @param x X-coordinate. - * @param y Y-coordinate. - * @param radius Radius of the circle. - * @param points Number of points to use to draw the circle. - **/ - void circle(DrawMode mode, float x, float y, float radius, int points = 10); - - /** - * Draws an arc using the specified arguments. - * @param mode The mode of drawing (line/filled). - * @param x X-coordinate. - * @param y Y-coordinate. - * @param radius Radius of the arc. - * @param angle1 The angle at which the arc begins. - * @param angle2 The angle at which the arc terminates. - * @param points Number of points to use to draw the arc. - **/ - void arc(DrawMode mode, float x, float y, float radius, float angle1, float angle2, int points = 10); - - /** - * Draws a polygon with an arbitrary number of vertices. - * @param type The type of drawing (line/filled). - * @param coords Vertex components (x1, y1, x2, y2, etc.) - * @param count Coord array size - **/ - void polygon(DrawMode mode, const float *coords, size_t count); - - /** - * Creates a screenshot of the view and saves it to the default folder. - * @param image The love.image module. - **/ - love::image::ImageData *newScreenshot(love::image::Image *image); - - void push(); - void pop(); - void rotate(float r); - void scale(float x, float y = 1.0f); - void translate(float x, float y); - void shear(float kx, float ky); - - void drawTest(Image *image, float x, float y, float a, float sx, float sy, float ox, float oy); - - bool hasFocus(); -private: - - Font *currentFont; - love::window::Window *currentWindow; - - LineStyle lineStyle; - float lineWidth; - GLint matrixLimit; - GLint userMatrices; - - int getRenderHeight(); -}; // Graphics - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_GRAPHICS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_GRAPHICS_H +#define LOVE_GRAPHICS_OPENGL_GRAPHICS_H + +// STD +#include +#include + +// OpenGL +#include "GLee.h" + +// LOVE +#include "graphics/Graphics.h" +#include "graphics/Color.h" + +#include "image/Image.h" +#include "image/ImageData.h" + +#include "window/Window.h" + +#include "OpenGL.h" +#include "Font.h" +#include "Image.h" +#include "Quad.h" +#include "SpriteBatch.h" +#include "ParticleSystem.h" +#include "Canvas.h" +#include "PixelEffect.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +// During display mode changing, certain +// variables about the OpenGL context are +// lost. +struct DisplayState +{ + // Colors. + Color color; + Color backgroundColor; + + // Blend and color modes. + Graphics::BlendMode blendMode; + Graphics::ColorMode colorMode; + + // Line. + Graphics::LineStyle lineStyle; + + // Point. + float pointSize; + Graphics::PointStyle pointStyle; + + // Scissor. + bool scissor; + GLint scissorBox[4]; + + // Window info. + std::string caption; + bool mouseVisible; + + // Default values. + DisplayState() + { + color.set(255,255,255,255); + backgroundColor.r = 0; + backgroundColor.g = 0; + backgroundColor.b = 0; + backgroundColor.a = 255; + blendMode = Graphics::BLEND_ALPHA; + colorMode = Graphics::COLOR_MODULATE; + lineStyle = Graphics::LINE_SMOOTH; + pointSize = 1.0f; + pointStyle = Graphics::POINT_SMOOTH; + scissor = false; + caption = ""; + mouseVisible = true; + } + +}; + +class Graphics : public love::graphics::Graphics +{ +public: + + Graphics(); + virtual ~Graphics(); + + // Implements Module. + const char *getName() const; + + /** + * Checks whether a display mode is supported or not. Note + * that fullscreen is assumed, because windowed modes are + * generally supported regardless of size. + * @param width The window width. + * @param height The window height. + **/ + bool checkMode(int width, int height, bool fullscreen); + + DisplayState saveState(); + + void restoreState(const DisplayState &s); + + /** + * Sets the current display mode. + * @param width The window width. + * @param height The window height. + * @param fullscreen True if fullscreen, false otherwise. + * @param vsync True if we should wait for vsync, false otherwise. + * @param fsaa Number of full scene anti-aliasing buffer, or 0 for disabled. + **/ + bool setMode(int width, int height, bool fullscreen, bool vsync, int fsaa); + + /** + * Gets the current display mode. + * @param width Pointer to an integer for the window width. + * @param height Pointer to an integer for the window height. + * @param fullscreen Pointer to a boolean for the fullscreen status. + * @param vsync Pointer to a boolean for the vsync status. + * @param fsaa Pointer to an integer for the current number of full scene anti-aliasing buffers. + **/ + void getMode(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa); + + /** + * Toggles fullscreen. Note that this also needs to reload the + * entire OpenGL context. + **/ + bool toggleFullscreen(); + + /** + * Resets the current color, background color, + * line style, and so forth. (This will be called + * when the game reloads. + **/ + void reset(); + + /** + * Clears the screen. + **/ + void clear(); + + /** + * Flips buffers. (Rendered geometry is + * presented on screen). + **/ + void present(); + + /** + * Sets the window's icon. + **/ + void setIcon(Image *image); + + /** + * Sets the window's caption. + **/ + void setCaption(const char *caption); + + int getCaption(lua_State *L); + + /** + * Gets the width of the current display mode. + **/ + int getWidth(); + + /** + * Gets the height of the current display mode. + **/ + int getHeight(); + + /** + * True if some display mode is set. + **/ + bool isCreated(); + + /** + * This native Lua function gets available modes + * from SDL and returns them as a table on the following format: + * + * { + * { width = 800, height = 600 }, + * { width = 1024, height = 768 }, + * ... + * } + * + * Only fullscreen modes are returned here, as all + * window sizes are supported (normally). + **/ + int getModes(lua_State *L); + + /** + * Scissor defines a box such that everything outside that box is discared and not drawn. + * Scissoring is automatically enabled. + * @param x The x-coordinate of the top-left corner. + * @param y The y-coordinate of the top-left corner. + * @param width The width of the box. + * @param height The height of the box. + **/ + void setScissor(int x, int y, int width, int height); + + /** + * Clears any scissor that has been created. + **/ + void setScissor(); + + /** + * This native Lua function gets the current scissor box in the order of: + * x, y, width, height + **/ + int getScissor(lua_State *L); + + /** + * Enables the stencil buffer and set stencil function to fill it + */ + void defineStencil(); + + /** + * Set stencil function to mask the following drawing calls using + * the current stencil buffer + * @param invert Invert the mask, i.e. draw everywhere expect where + * the mask is defined. + */ + void useStencil(bool invert = false); + + /** + * Disables the stencil buffer + */ + void discardStencil(); + + /** + * Creates an Image object with padding and/or optimization. + **/ + Image *newImage(love::filesystem::File *file); + Image *newImage(love::image::ImageData *data); + + /** + * Creates a Quad object. + **/ + Quad *newQuad(float x, float y, float w, float h, float sw, float sh); + + /** + * Creates a Font object. + **/ + Font *newFont(love::font::Rasterizer *data, const Image::Filter &filter = Image::Filter()); + + SpriteBatch *newSpriteBatch(Image *image, int size, int usage); + + ParticleSystem *newParticleSystem(Image *image, int size); + + Canvas *newCanvas(int width, int height); + + PixelEffect *newPixelEffect(const std::string &code); + + /** + * Sets the foreground color. + * @param c The new foreground color. + **/ + void setColor(const Color &c); + + /** + * Gets current color. + **/ + Color getColor(); + + /** + * Sets the background Color. + **/ + void setBackgroundColor(const Color &c); + + /** + * Gets the current background color. + **/ + Color getBackgroundColor(); + + /** + * Sets the current font. + * @param font A Font object. + **/ + void setFont(Font *font); + /** + * Gets the current Font, or nil if none. + **/ + Font *getFont(); + + /** + * Sets the current blend mode. + **/ + void setBlendMode(BlendMode mode); + + /** + * Sets the current color mode. + **/ + void setColorMode(ColorMode mode); + + /** + * Sets the current image filter. + **/ + void setDefaultImageFilter(const Image::Filter &f); + + /** + * Gets the current blend mode. + **/ + BlendMode getBlendMode(); + + /** + * Gets the current color mode. + **/ + ColorMode getColorMode(); + + /** + * Gets the current image filter. + **/ + const Image::Filter &getDefaultImageFilter() const; + + /** + * Sets the line width. + * @param width The new width of the line. + **/ + void setLineWidth(float width); + + /** + * Sets the line style. + * @param style LINE_ROUGH or LINE_SMOOTH. + **/ + void setLineStyle(LineStyle style); + + /** + * Sets the type of line used to draw primitives. + * A shorthand for setLineWidth and setLineStyle. + **/ + void setLine(float width, LineStyle style); + + /** + * Gets the line width. + **/ + float getLineWidth(); + + /** + * Gets the line style. + **/ + LineStyle getLineStyle(); + + /** + * Sets the size of points. + **/ + void setPointSize(float size); + + /** + * Sets the style of points. + * @param style POINT_SMOOTH or POINT_ROUGH. + **/ + void setPointStyle(PointStyle style); + + /** + * Shorthand for setPointSize and setPointStyle. + **/ + void setPoint(float size, PointStyle style); + + /** + * Gets the point size. + **/ + float getPointSize(); + + /** + * Gets the point style. + **/ + PointStyle getPointStyle(); + + /** + * Gets the maximum point size supported. + * This may vary from computer to computer. + **/ + int getMaxPointSize(); + + /** + * Draws text at the specified coordinates, with rotation and + * scaling along both axes. + * @param x The x-coordinate. + * @param y The y-coordinate. + * @param angle The amount of rotation. + * @param sx The scale factor along the x-axis. (1 = normal). + * @param sy The scale factor along the y-axis. (1 = normal). + * @param ox The origin offset along the x-axis. + * @param oy The origin offset along the y-axis. + * @param kx Shear along the x-axis. + * @param ky Shear along the y-axis. + **/ + void print(const char *str, float x, float y , float angle, float sx, float sy, float ox, float oy, float kx, float ky); + + /** + * Draw formatted text on screen at the specified coordinates. + * + * @param str A string of text. + * @param x The x-coordinate. + * @param y The y-coordinate. + * @param wrap The maximum width of the text area. + * @param align Where to align the text. + **/ + void printf(const char *str, float x, float y, float wrap, AlignMode align); + + /** + * Draws a point at (x,y). + * @param x Point along x-axis. + * @param y Point along y-axis. + **/ + void point(float x, float y); + + /** + * Draws a series of lines connecting the given vertices. + * @param coords Vertex components (x1, y1, ..., xn, yn). If x1,y1 == xn,yn the line will be drawn closed. + * @param count Number of items in the array, i.e. count = 2 * n + **/ + void polyline(const float *coords, size_t count); + + /** + * Draws a triangle using the three coordinates passed. + * @param mode The mode of drawing (line/filled). + * @param x1 First x-coordinate. + * @param y1 First y-coordinate. + * @param x2 Second x-coordinate. + * @param y2 Second y-coordinate. + * @param x3 Third x-coordinate. + * @param y3 Third y-coordinate. + **/ + void triangle(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3); + + /** + * Draws a rectangle. + * @param x Position along x-axis for top-left corner. + * @param y Position along y-axis for top-left corner. + * @param w The width of the rectangle. + * @param h The height of the rectangle. + **/ + void rectangle(DrawMode mode, float x, float y, float w, float h); + + /** + * Draws a quadrilateral using the four coordinates passed. + * @param mode The mode of drawing (line/filled). + * @param x1 First x-coordinate. + * @param y1 First y-coordinate. + * @param x2 Second x-coordinate. + * @param y2 Second y-coordinate. + * @param x3 Third x-coordinate. + * @param y3 Third y-coordinate. + * @param x4 Fourth x-coordinate. + * @param y4 Fourth y-coordinate. + **/ + void quad(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); + + /** + * Draws a circle using the specified arguments. + * @param mode The mode of drawing (line/filled). + * @param x X-coordinate. + * @param y Y-coordinate. + * @param radius Radius of the circle. + * @param points Number of points to use to draw the circle. + **/ + void circle(DrawMode mode, float x, float y, float radius, int points = 10); + + /** + * Draws an arc using the specified arguments. + * @param mode The mode of drawing (line/filled). + * @param x X-coordinate. + * @param y Y-coordinate. + * @param radius Radius of the arc. + * @param angle1 The angle at which the arc begins. + * @param angle2 The angle at which the arc terminates. + * @param points Number of points to use to draw the arc. + **/ + void arc(DrawMode mode, float x, float y, float radius, float angle1, float angle2, int points = 10); + + /** + * Draws a polygon with an arbitrary number of vertices. + * @param type The type of drawing (line/filled). + * @param coords Vertex components (x1, y1, x2, y2, etc.) + * @param count Coord array size + **/ + void polygon(DrawMode mode, const float *coords, size_t count); + + /** + * Creates a screenshot of the view and saves it to the default folder. + * @param image The love.image module. + **/ + love::image::ImageData *newScreenshot(love::image::Image *image); + + void push(); + void pop(); + void rotate(float r); + void scale(float x, float y = 1.0f); + void translate(float x, float y); + void shear(float kx, float ky); + + void drawTest(Image *image, float x, float y, float a, float sx, float sy, float ox, float oy); + + bool hasFocus(); +private: + + Font *currentFont; + love::window::Window *currentWindow; + + LineStyle lineStyle; + float lineWidth; + GLint matrixLimit; + GLint userMatrices; + + int getRenderHeight(); +}; // Graphics + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_GRAPHICS_H diff --git a/src/modules/graphics/opengl/Image.cpp b/src/modules/graphics/opengl/Image.cpp index b9696f52d..79646b785 100644 --- a/src/modules/graphics/opengl/Image.cpp +++ b/src/modules/graphics/opengl/Image.cpp @@ -1,432 +1,432 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Image.h" - -// STD -#include // For memcpy - -#include -using namespace std; - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Image::Filter Image::defaultFilter; - -Image::Image(love::image::ImageData *data) - : width((float)(data->getWidth())) - , height((float)(data->getHeight())) - , texture(0) -{ - data->retain(); - this->data = data; - - memset(vertices, 255, sizeof(vertex)*4); - - vertices[0].x = 0; - vertices[0].y = 0; - vertices[1].x = 0; - vertices[1].y = height; - vertices[2].x = width; - vertices[2].y = height; - vertices[3].x = width; - vertices[3].y = 0; - - vertices[0].s = 0; - vertices[0].t = 0; - vertices[1].s = 0; - vertices[1].t = 1; - vertices[2].s = 1; - vertices[2].t = 1; - vertices[3].s = 1; - vertices[3].t = 0; - - settings.filter = defaultFilter; -} - -Image::~Image() -{ - if (data != 0) - data->release(); - unload(); -} - -float Image::getWidth() const -{ - return width; -} - -float Image::getHeight() const -{ - return height; -} - -const vertex *Image::getVertices() const -{ - return vertices; -} - -love::image::ImageData *Image::getData() const -{ - return data; -} - -void Image::getRectangleVertices(int x, int y, int w, int h, vertex *vertices) const -{ - // Check upper. - x = (x+w > (int)width) ? (int)width-w : x; - y = (y+h > (int)height) ? (int)height-h : y; - - // Check lower. - x = (x < 0) ? 0 : x; - y = (y < 0) ? 0 : y; - - vertices[0].x = 0; - vertices[0].y = 0; - vertices[1].x = 0; - vertices[1].y = (float)h; - vertices[2].x = (float)w; - vertices[2].y = (float)h; - vertices[3].x = (float)w; - vertices[3].y = 0; - - float tx = (float)x/width; - float ty = (float)y/height; - float tw = (float)w/width; - float th = (float)h/height; - - vertices[0].s = tx; - vertices[0].t = ty; - vertices[1].s = tx; - vertices[1].t = ty+th; - vertices[2].s = tx+tw; - vertices[2].t = ty+th; - vertices[3].s = tx+tw; - vertices[3].t = ty; -} - -void Image::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const -{ - static Matrix t; - - t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); - drawv(t, vertices); -} - -void Image::drawq(love::graphics::Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const -{ - static Matrix t; - const vertex *v = quad->getVertices(); - - t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); - drawv(t, v); -} - -void Image::setFilter(const Image::Filter &f) -{ - GLint gmin, gmag; - gmin = gmag = 0; // so that they're not used uninitialized - - switch (f.min) - { - case FILTER_LINEAR: - gmin = GL_LINEAR; - break; - case FILTER_NEAREST: - gmin = GL_NEAREST; - break; - default: - break; - } - - switch (f.mag) - { - case FILTER_LINEAR: - gmag = GL_LINEAR; - break; - case FILTER_NEAREST: - gmag = GL_NEAREST; - break; - default: - break; - } - - bind(); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gmin); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gmag); -} - -Image::Filter Image::getFilter() const -{ - bind(); - - GLint gmin, gmag; - - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &gmin); - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &gmag); - - Image::Filter f; - - switch (gmin) - { - case GL_NEAREST: - f.min = FILTER_NEAREST; - break; - case GL_LINEAR: - default: - f.min = FILTER_LINEAR; - break; - } - - switch (gmin) - { - case GL_NEAREST: - f.mag = FILTER_NEAREST; - break; - case GL_LINEAR: - default: - f.mag = FILTER_LINEAR; - break; - } - - return f; -} - -void Image::setWrap(Image::Wrap w) -{ - GLint gs, gt; - - switch (w.s) - { - case WRAP_CLAMP: - gs = GL_CLAMP_TO_EDGE; - break; - case WRAP_REPEAT: - default: - gs = GL_REPEAT; - break; - } - - switch (w.t) - { - case WRAP_CLAMP: - gt = GL_CLAMP_TO_EDGE; - break; - case WRAP_REPEAT: - default: - gt = GL_REPEAT; - break; - } - - bind(); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gs); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gt); -} - -Image::Wrap Image::getWrap() const -{ - bind(); - - GLint gs, gt; - - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &gs); - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, >); - - Wrap w; - - switch (gs) - { - case GL_CLAMP_TO_EDGE: - w.s = WRAP_CLAMP; - break; - case GL_REPEAT: - default: - w.s = WRAP_REPEAT; - break; - } - - switch (gt) - { - case GL_CLAMP_TO_EDGE: - w.t = WRAP_CLAMP; - break; - case GL_REPEAT: - default: - w.t = WRAP_REPEAT; - break; - } - - return w; -} - -void Image::bind() const -{ - if (texture == 0) - return; - - bindTexture(texture); -} - -bool Image::load() -{ - return loadVolatile(); -} - -void Image::unload() -{ - return unloadVolatile(); -} - -bool Image::loadVolatile() -{ - if (hasNpot()) - return loadVolatileNPOT(); - else - return loadVolatilePOT(); -} - -bool Image::loadVolatilePOT() -{ - glGenTextures(1,(GLuint *)&texture); - bindTexture(texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - float p2width = next_p2(width); - float p2height = next_p2(height); - float s = width/p2width; - float t = height/p2height; - - vertices[1].t = t; - vertices[2].t = t; - vertices[2].s = s; - vertices[3].s = s; - - glTexImage2D(GL_TEXTURE_2D, - 0, - GL_RGBA8, - (GLsizei)p2width, - (GLsizei)p2height, - 0, - GL_RGBA, - GL_UNSIGNED_BYTE, - 0); - - glTexSubImage2D(GL_TEXTURE_2D, - 0, - 0, - 0, - (GLsizei)width, - (GLsizei)height, - GL_RGBA, - GL_UNSIGNED_BYTE, - data->getData()); - - setFilter(settings.filter); - setWrap(settings.wrap); - - return true; -} - -bool Image::loadVolatileNPOT() -{ - glGenTextures(1,(GLuint *)&texture); - bindTexture(texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - glTexImage2D(GL_TEXTURE_2D, - 0, - GL_RGBA8, - (GLsizei)width, - (GLsizei)height, - 0, - GL_RGBA, - GL_UNSIGNED_BYTE, - data->getData()); - - setFilter(settings.filter); - setWrap(settings.wrap); - - return true; -} - -void Image::unloadVolatile() -{ - settings.filter = getFilter(); - settings.wrap = getWrap(); - // Delete the hardware texture. - if (texture != 0) - { - deleteTexture(texture); - texture = 0; - } -} - -void Image::drawv(const Matrix &t, const vertex *v) const -{ - bind(); - - glPushMatrix(); - - glMultMatrixf((const GLfloat *)t.getElements()); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&v[0].x); - glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&v[0].s); - glDrawArrays(GL_QUADS, 0, 4); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_VERTEX_ARRAY); - - glPopMatrix(); -} - -bool Image::hasNpot() -{ - return GLEE_ARB_texture_non_power_of_two != 0; -} - -void Image::setDefaultFilter(const Image::Filter &f) -{ - defaultFilter = f; -} - -const Image::Filter &Image::getDefaultFilter() -{ - return defaultFilter; -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Image.h" + +// STD +#include // For memcpy + +#include +using namespace std; + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Image::Filter Image::defaultFilter; + +Image::Image(love::image::ImageData *data) + : width((float)(data->getWidth())) + , height((float)(data->getHeight())) + , texture(0) +{ + data->retain(); + this->data = data; + + memset(vertices, 255, sizeof(vertex)*4); + + vertices[0].x = 0; + vertices[0].y = 0; + vertices[1].x = 0; + vertices[1].y = height; + vertices[2].x = width; + vertices[2].y = height; + vertices[3].x = width; + vertices[3].y = 0; + + vertices[0].s = 0; + vertices[0].t = 0; + vertices[1].s = 0; + vertices[1].t = 1; + vertices[2].s = 1; + vertices[2].t = 1; + vertices[3].s = 1; + vertices[3].t = 0; + + settings.filter = defaultFilter; +} + +Image::~Image() +{ + if (data != 0) + data->release(); + unload(); +} + +float Image::getWidth() const +{ + return width; +} + +float Image::getHeight() const +{ + return height; +} + +const vertex *Image::getVertices() const +{ + return vertices; +} + +love::image::ImageData *Image::getData() const +{ + return data; +} + +void Image::getRectangleVertices(int x, int y, int w, int h, vertex *vertices) const +{ + // Check upper. + x = (x+w > (int)width) ? (int)width-w : x; + y = (y+h > (int)height) ? (int)height-h : y; + + // Check lower. + x = (x < 0) ? 0 : x; + y = (y < 0) ? 0 : y; + + vertices[0].x = 0; + vertices[0].y = 0; + vertices[1].x = 0; + vertices[1].y = (float)h; + vertices[2].x = (float)w; + vertices[2].y = (float)h; + vertices[3].x = (float)w; + vertices[3].y = 0; + + float tx = (float)x/width; + float ty = (float)y/height; + float tw = (float)w/width; + float th = (float)h/height; + + vertices[0].s = tx; + vertices[0].t = ty; + vertices[1].s = tx; + vertices[1].t = ty+th; + vertices[2].s = tx+tw; + vertices[2].t = ty+th; + vertices[3].s = tx+tw; + vertices[3].t = ty; +} + +void Image::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const +{ + static Matrix t; + + t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); + drawv(t, vertices); +} + +void Image::drawq(love::graphics::Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const +{ + static Matrix t; + const vertex *v = quad->getVertices(); + + t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); + drawv(t, v); +} + +void Image::setFilter(const Image::Filter &f) +{ + GLint gmin, gmag; + gmin = gmag = 0; // so that they're not used uninitialized + + switch (f.min) + { + case FILTER_LINEAR: + gmin = GL_LINEAR; + break; + case FILTER_NEAREST: + gmin = GL_NEAREST; + break; + default: + break; + } + + switch (f.mag) + { + case FILTER_LINEAR: + gmag = GL_LINEAR; + break; + case FILTER_NEAREST: + gmag = GL_NEAREST; + break; + default: + break; + } + + bind(); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gmin); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gmag); +} + +Image::Filter Image::getFilter() const +{ + bind(); + + GLint gmin, gmag; + + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &gmin); + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &gmag); + + Image::Filter f; + + switch (gmin) + { + case GL_NEAREST: + f.min = FILTER_NEAREST; + break; + case GL_LINEAR: + default: + f.min = FILTER_LINEAR; + break; + } + + switch (gmin) + { + case GL_NEAREST: + f.mag = FILTER_NEAREST; + break; + case GL_LINEAR: + default: + f.mag = FILTER_LINEAR; + break; + } + + return f; +} + +void Image::setWrap(Image::Wrap w) +{ + GLint gs, gt; + + switch (w.s) + { + case WRAP_CLAMP: + gs = GL_CLAMP_TO_EDGE; + break; + case WRAP_REPEAT: + default: + gs = GL_REPEAT; + break; + } + + switch (w.t) + { + case WRAP_CLAMP: + gt = GL_CLAMP_TO_EDGE; + break; + case WRAP_REPEAT: + default: + gt = GL_REPEAT; + break; + } + + bind(); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gs); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gt); +} + +Image::Wrap Image::getWrap() const +{ + bind(); + + GLint gs, gt; + + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &gs); + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, >); + + Wrap w; + + switch (gs) + { + case GL_CLAMP_TO_EDGE: + w.s = WRAP_CLAMP; + break; + case GL_REPEAT: + default: + w.s = WRAP_REPEAT; + break; + } + + switch (gt) + { + case GL_CLAMP_TO_EDGE: + w.t = WRAP_CLAMP; + break; + case GL_REPEAT: + default: + w.t = WRAP_REPEAT; + break; + } + + return w; +} + +void Image::bind() const +{ + if (texture == 0) + return; + + bindTexture(texture); +} + +bool Image::load() +{ + return loadVolatile(); +} + +void Image::unload() +{ + return unloadVolatile(); +} + +bool Image::loadVolatile() +{ + if (hasNpot()) + return loadVolatileNPOT(); + else + return loadVolatilePOT(); +} + +bool Image::loadVolatilePOT() +{ + glGenTextures(1,(GLuint *)&texture); + bindTexture(texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + float p2width = next_p2(width); + float p2height = next_p2(height); + float s = width/p2width; + float t = height/p2height; + + vertices[1].t = t; + vertices[2].t = t; + vertices[2].s = s; + vertices[3].s = s; + + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGBA8, + (GLsizei)p2width, + (GLsizei)p2height, + 0, + GL_RGBA, + GL_UNSIGNED_BYTE, + 0); + + glTexSubImage2D(GL_TEXTURE_2D, + 0, + 0, + 0, + (GLsizei)width, + (GLsizei)height, + GL_RGBA, + GL_UNSIGNED_BYTE, + data->getData()); + + setFilter(settings.filter); + setWrap(settings.wrap); + + return true; +} + +bool Image::loadVolatileNPOT() +{ + glGenTextures(1,(GLuint *)&texture); + bindTexture(texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGBA8, + (GLsizei)width, + (GLsizei)height, + 0, + GL_RGBA, + GL_UNSIGNED_BYTE, + data->getData()); + + setFilter(settings.filter); + setWrap(settings.wrap); + + return true; +} + +void Image::unloadVolatile() +{ + settings.filter = getFilter(); + settings.wrap = getWrap(); + // Delete the hardware texture. + if (texture != 0) + { + deleteTexture(texture); + texture = 0; + } +} + +void Image::drawv(const Matrix &t, const vertex *v) const +{ + bind(); + + glPushMatrix(); + + glMultMatrixf((const GLfloat *)t.getElements()); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&v[0].x); + glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&v[0].s); + glDrawArrays(GL_QUADS, 0, 4); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); + + glPopMatrix(); +} + +bool Image::hasNpot() +{ + return GLEE_ARB_texture_non_power_of_two != 0; +} + +void Image::setDefaultFilter(const Image::Filter &f) +{ + defaultFilter = f; +} + +const Image::Filter &Image::getDefaultFilter() +{ + return defaultFilter; +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/Image.h b/src/modules/graphics/opengl/Image.h index d1c99d228..463bef6ea 100644 --- a/src/modules/graphics/opengl/Image.h +++ b/src/modules/graphics/opengl/Image.h @@ -1,165 +1,165 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_IMAGE_H -#define LOVE_GRAPHICS_OPENGL_IMAGE_H - -// LOVE -#include "common/Matrix.h" -#include "common/math.h" -#include "common/config.h" -#include "image/ImageData.h" -#include "graphics/Image.h" - -#include "OpenGL.h" - -// OpenGL -#include "GLee.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -/** - * A drawable image based on OpenGL-textures. This class takes ImageData - * objects and create textures on the GPU for fast drawing. - * - * @author Anders Ruud - **/ -class Image : public love::graphics::Image -{ -public: - - /** - * Creates a new Image. Not that anything is ready to use - * before load is called. - * - * @param file The file from which to load the image. - **/ - Image(love::image::ImageData *data); - - /** - * Destructor. Deletes the hardware texture and other resources. - **/ - virtual ~Image(); - - float getWidth() const; - float getHeight() const; - - const vertex *getVertices() const; - - love::image::ImageData *getData() const; - - /** - * Generate vertices according to a subimage. - * - * Note: out-of-range values will be clamped. - * Note: the vertex colors will not be changed. - * - * @param x The top-left corner of the subimage along the x-axis. - * @param y The top-left corner of the subimage along the y-axis. - * @param w The width of the subimage. - * @param h The height of the subimage. - * @param vertices A vertex array of size four. - **/ - void getRectangleVertices(int x, int y, int w, int h, vertex *vertices) const; - - /** - * @copydoc Drawable::draw() - **/ - void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; - - /** - * @copydoc DrawQable::drawq() - **/ - void drawq(love::graphics::Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; - - /** - * Sets the filter mode. - * - * @param mode The filter mode. - **/ - void setFilter(const Image::Filter &f); - - Image::Filter getFilter() const; - - void setWrap(Image::Wrap r); - - Image::Wrap getWrap() const; - - void bind() const; - - bool load(); - void unload(); - - // Implements Volatile. - bool loadVolatile(); - void unloadVolatile(); - - static bool hasNpot(); - - // The default filter. - static void setDefaultFilter(const Image::Filter &f); - static const Image::Filter &getDefaultFilter(); - -private: - - void drawv(const Matrix &t, const vertex *v) const; - - friend class PixelEffect; - GLuint getTextureName() const - { - return texture; - } - // The ImageData from which the texture is created. - love::image::ImageData *data; - - // Width and height of the hardware texture. - float width, height; - - // OpenGL texture identifier. - GLuint texture; - - // The source vertices of the image. - vertex vertices[4]; - - // The settings we need to save when reloading. - struct - { - Image::Filter filter; - Image::Wrap wrap; - } settings; - - bool loadVolatilePOT(); - bool loadVolatileNPOT(); - - // The default image filter - static Image::Filter defaultFilter; - -}; // Image - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_IMAGE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_IMAGE_H +#define LOVE_GRAPHICS_OPENGL_IMAGE_H + +// LOVE +#include "common/Matrix.h" +#include "common/math.h" +#include "common/config.h" +#include "image/ImageData.h" +#include "graphics/Image.h" + +#include "OpenGL.h" + +// OpenGL +#include "GLee.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +/** + * A drawable image based on OpenGL-textures. This class takes ImageData + * objects and create textures on the GPU for fast drawing. + * + * @author Anders Ruud + **/ +class Image : public love::graphics::Image +{ +public: + + /** + * Creates a new Image. Not that anything is ready to use + * before load is called. + * + * @param file The file from which to load the image. + **/ + Image(love::image::ImageData *data); + + /** + * Destructor. Deletes the hardware texture and other resources. + **/ + virtual ~Image(); + + float getWidth() const; + float getHeight() const; + + const vertex *getVertices() const; + + love::image::ImageData *getData() const; + + /** + * Generate vertices according to a subimage. + * + * Note: out-of-range values will be clamped. + * Note: the vertex colors will not be changed. + * + * @param x The top-left corner of the subimage along the x-axis. + * @param y The top-left corner of the subimage along the y-axis. + * @param w The width of the subimage. + * @param h The height of the subimage. + * @param vertices A vertex array of size four. + **/ + void getRectangleVertices(int x, int y, int w, int h, vertex *vertices) const; + + /** + * @copydoc Drawable::draw() + **/ + void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; + + /** + * @copydoc DrawQable::drawq() + **/ + void drawq(love::graphics::Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; + + /** + * Sets the filter mode. + * + * @param mode The filter mode. + **/ + void setFilter(const Image::Filter &f); + + Image::Filter getFilter() const; + + void setWrap(Image::Wrap r); + + Image::Wrap getWrap() const; + + void bind() const; + + bool load(); + void unload(); + + // Implements Volatile. + bool loadVolatile(); + void unloadVolatile(); + + static bool hasNpot(); + + // The default filter. + static void setDefaultFilter(const Image::Filter &f); + static const Image::Filter &getDefaultFilter(); + +private: + + void drawv(const Matrix &t, const vertex *v) const; + + friend class PixelEffect; + GLuint getTextureName() const + { + return texture; + } + // The ImageData from which the texture is created. + love::image::ImageData *data; + + // Width and height of the hardware texture. + float width, height; + + // OpenGL texture identifier. + GLuint texture; + + // The source vertices of the image. + vertex vertices[4]; + + // The settings we need to save when reloading. + struct + { + Image::Filter filter; + Image::Wrap wrap; + } settings; + + bool loadVolatilePOT(); + bool loadVolatileNPOT(); + + // The default image filter + static Image::Filter defaultFilter; + +}; // Image + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_IMAGE_H diff --git a/src/modules/graphics/opengl/OpenGL.cpp b/src/modules/graphics/opengl/OpenGL.cpp index f307b261d..edcdf59fa 100644 --- a/src/modules/graphics/opengl/OpenGL.cpp +++ b/src/modules/graphics/opengl/OpenGL.cpp @@ -1,57 +1,57 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "OpenGL.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -static GLuint boundTexture = 0; - -void resetBoundTexture() -{ - // OpenGL might not be initialized yet, so we can't do a real reset - boundTexture = 0; -} - -void bindTexture(GLuint texture, bool override) -{ - if (texture != boundTexture || texture == 0 || override) - { - boundTexture = texture; - glBindTexture(GL_TEXTURE_2D, texture); - } -} - -void deleteTexture(GLuint texture) -{ - if (texture == boundTexture) - boundTexture = 0; - - glDeleteTextures(1, &texture); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "OpenGL.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +static GLuint boundTexture = 0; + +void resetBoundTexture() +{ + // OpenGL might not be initialized yet, so we can't do a real reset + boundTexture = 0; +} + +void bindTexture(GLuint texture, bool override) +{ + if (texture != boundTexture || texture == 0 || override) + { + boundTexture = texture; + glBindTexture(GL_TEXTURE_2D, texture); + } +} + +void deleteTexture(GLuint texture) +{ + if (texture == boundTexture) + boundTexture = 0; + + glDeleteTextures(1, &texture); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/OpenGL.h b/src/modules/graphics/opengl/OpenGL.h index 60024c1b4..93d32d47d 100644 --- a/src/modules/graphics/opengl/OpenGL.h +++ b/src/modules/graphics/opengl/OpenGL.h @@ -1,55 +1,55 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_COMMON_OPENGL_H -#define LOVE_COMMON_OPENGL_H - -#include "GLee.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -// resets the stored bound texture id -void resetBoundTexture(); - -/** - * Helper for binding an OpenGL texture. - * Makes sure we aren't redundantly binding textures. - * @param texture The texture to bind. - * @param override Overrides the checks to guarantee texture bind - **/ -void bindTexture(GLuint texture, bool override = false); - -/** - * Helper for deleting an OpenGL texture. - * Cleans up if the texture is currently bound. - * @param texture The texture to delete. - **/ -void deleteTexture(GLuint texture); - -} // opengl -} // graphics -} // love - -#endif +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_COMMON_OPENGL_H +#define LOVE_COMMON_OPENGL_H + +#include "GLee.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +// resets the stored bound texture id +void resetBoundTexture(); + +/** + * Helper for binding an OpenGL texture. + * Makes sure we aren't redundantly binding textures. + * @param texture The texture to bind. + * @param override Overrides the checks to guarantee texture bind + **/ +void bindTexture(GLuint texture, bool override = false); + +/** + * Helper for deleting an OpenGL texture. + * Cleans up if the texture is currently bound. + * @param texture The texture to delete. + **/ +void deleteTexture(GLuint texture); + +} // opengl +} // graphics +} // love + +#endif diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index 5fed87f33..2b6604dd2 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -1,548 +1,548 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "ParticleSystem.h" - -#include "common/math.h" - -#include "GLee.h" -#include -#include - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -namespace -{ -Colorf colorToFloat(const Color &c) -{ - return Colorf((GLfloat)c.r/255.0f, (GLfloat)c.g/255.0f, (GLfloat)c.b/255.0f, (GLfloat)c.a/255.0f); -} -} - -float calculate_variation(float inner, float outer, float var) -{ - float low = inner - (outer/2.0f)*var; - float high = inner + (outer/2.0f)*var; - float r = (rand() / (float(RAND_MAX)+1)); - return low*(1-r)+high*r; -} - - -ParticleSystem::ParticleSystem(Image *sprite, unsigned int buffer) - : pStart(0) - , pLast(0) - , pEnd(0) - , active(true) - , emissionRate(0) - , emitCounter(0) - , lifetime(-1) - , life(0) - , particleLifeMin(0) - , particleLifeMax(0) - , direction(0) - , spread(0) - , relative(false) - , speedMin(0) - , speedMax(0) - , gravityMin(0) - , gravityMax(0) - , radialAccelerationMin(0) - , radialAccelerationMax(0) - , tangentialAccelerationMin(0) - , tangentialAccelerationMax(0) - , sizeVariation(0) - , rotationMin(0) - , rotationMax(0) - , spinStart(0) - , spinEnd(0) - , spinVariation(0) - , offsetX(sprite->getWidth()*0.5f) - , offsetY(sprite->getHeight()*0.5f) -{ - this->sprite = sprite; - sprite->retain(); - sizes.push_back(1.0f); - colors.push_back(Colorf(1.0f, 1.0f, 1.0f, 1.0f)); - setBufferSize(buffer); -} - -ParticleSystem::~ParticleSystem() -{ - if (this->sprite != 0) - this->sprite->release(); - - if (pStart != 0) - delete [] pStart; -} - -void ParticleSystem::add() -{ - if (isFull()) return; - - float min,max; - - min = particleLifeMin; - max = particleLifeMax; - if (min == max) - pLast->life = min; - else - pLast->life = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; - pLast->lifetime = pLast->life; - - pLast->position[0] = position.getX(); - pLast->position[1] = position.getY(); - - min = direction - spread/2.0f; - max = direction + spread/2.0f; - pLast->direction = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; - - pLast->origin = position; - - min = speedMin; - max = speedMax; - float speed = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; - pLast->speed = love::Vector(cos(pLast->direction), sin(pLast->direction)); - pLast->speed *= speed; - - min = gravityMin; - max = gravityMax; - pLast->gravity = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; - - min = radialAccelerationMin; - max = radialAccelerationMax; - pLast->radialAcceleration = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; - - min = tangentialAccelerationMin; - max = tangentialAccelerationMax; - pLast->tangentialAcceleration = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; - - pLast->sizeOffset = (rand() / (float(RAND_MAX)+1)) * sizeVariation; // time offset for size change - pLast->sizeIntervalSize = (1.0f - (rand() / (float(RAND_MAX)+1)) * sizeVariation) - pLast->sizeOffset; - pLast->size = sizes[(size_t)(pLast->sizeOffset - .5f) * (sizes.size() - 1)]; - - min = rotationMin; - max = rotationMax; - pLast->spinStart = calculate_variation(spinStart, spinEnd, spinVariation); - pLast->spinEnd = calculate_variation(spinEnd, spinStart, spinVariation); - pLast->rotation = (rand() / (float(RAND_MAX)+1)) * (max - min) + min;; - - pLast->color = colors[0]; - - pLast++; -} - -void ParticleSystem::remove(particle *p) -{ - if (!isEmpty()) - { - *p = *(--pLast); - } -} - -void ParticleSystem::setSprite(Image *image) -{ - if (sprite != 0) - sprite->release(); - - sprite = image; - sprite->retain(); -} - -void ParticleSystem::setBufferSize(unsigned int size) -{ - // delete previous data - delete [] pStart; - - pLast = pStart = new particle[size]; - - pEnd = pStart + size; -} - -void ParticleSystem::setEmissionRate(int rate) -{ - emissionRate = rate; -} - -void ParticleSystem::setLifetime(float life) -{ - this->life = lifetime = life; -} - -void ParticleSystem::setParticleLife(float min, float max) -{ - particleLifeMin = min; - if (max == 0) - particleLifeMax = min; - else - particleLifeMax = max; -} - -void ParticleSystem::setPosition(float x, float y) -{ - position = love::Vector(x, y); -} - -void ParticleSystem::setDirection(float direction) -{ - this->direction = direction; -} - -void ParticleSystem::setSpread(float spread) -{ - this->spread = spread; -} - -void ParticleSystem::setRelativeDirection(bool relative) -{ - this->relative = relative; -} - -void ParticleSystem::setSpeed(float speed) -{ - speedMin = speedMax = speed; -} - -void ParticleSystem::setSpeed(float min, float max) -{ - speedMin = min; - speedMax = max; -} - -void ParticleSystem::setGravity(float gravity) -{ - gravityMin = gravityMax = gravity; -} - -void ParticleSystem::setGravity(float min, float max) -{ - gravityMin = min; - gravityMax = max; -} - -void ParticleSystem::setRadialAcceleration(float acceleration) -{ - radialAccelerationMin = radialAccelerationMax = acceleration; -} - -void ParticleSystem::setRadialAcceleration(float min, float max) -{ - radialAccelerationMin = min; - radialAccelerationMax = max; -} - -void ParticleSystem::setTangentialAcceleration(float acceleration) -{ - tangentialAccelerationMin = tangentialAccelerationMax = acceleration; -} - -void ParticleSystem::setTangentialAcceleration(float min, float max) -{ - tangentialAccelerationMin = min; - tangentialAccelerationMax = max; -} - -void ParticleSystem::setSize(float size) -{ - sizes.resize(1); - sizes[0] = size; -} - -void ParticleSystem::setSize(const std::vector &newSizes, float variation) -{ - sizes = newSizes; - sizeVariation = variation; -} - -void ParticleSystem::setSizeVariation(float variation) -{ - sizeVariation = variation; -} - -void ParticleSystem::setRotation(float rotation) -{ - rotationMin = rotationMax = rotation; -} - -void ParticleSystem::setRotation(float min, float max) -{ - rotationMin = min; - rotationMax = max; -} - -void ParticleSystem::setSpin(float spin) -{ - spinStart = spin; - spinEnd = spin; -} - -void ParticleSystem::setSpin(float start, float end) -{ - spinStart = start; - spinEnd = end; -} - -void ParticleSystem::setSpin(float start, float end, float variation) -{ - spinStart = start; - spinEnd = end; - spinVariation = variation; -} - -void ParticleSystem::setSpinVariation(float variation) -{ - spinVariation = variation; -} - -void ParticleSystem::setColor(const Color &color) -{ - colors.resize(1); - colors[0] = colorToFloat(color); -} - -void ParticleSystem::setColor(const std::vector &newColors) -{ - colors.resize(newColors.size()); - for (size_t i = 0; i < newColors.size(); ++i) - colors[i] = colorToFloat(newColors[i]); -} - -void ParticleSystem::setOffset(float x, float y) -{ - offsetX = x; - offsetY = y; -} - -float ParticleSystem::getX() const -{ - return position.getX(); -} - -float ParticleSystem::getY() const -{ - return position.getY(); -} - -const love::Vector &ParticleSystem::getPosition() const -{ - return position; -} - -float ParticleSystem::getDirection() const -{ - return direction; -} - -float ParticleSystem::getSpread() const -{ - return spread; -} - -float ParticleSystem::getOffsetX() const -{ - return offsetX; -} - -float ParticleSystem::getOffsetY() const -{ - return offsetY; -} - -int ParticleSystem::count() const -{ - return (int)(pLast - pStart); -} - -void ParticleSystem::start() -{ - active = true; -} - -void ParticleSystem::stop() -{ - active = false; - life = lifetime; - emitCounter = 0; -} - -void ParticleSystem::pause() -{ - active = false; -} - -void ParticleSystem::reset() -{ - pLast = pStart; - life = lifetime; - emitCounter = 0; -} - -bool ParticleSystem::isActive() const -{ - return active; -} - -bool ParticleSystem::isEmpty() const -{ - return pStart == pLast; -} - -bool ParticleSystem::isFull() const -{ - return pLast == pEnd; -} - -void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const -{ - if (sprite == 0) return; // just in case of failure - - glPushMatrix(); - glPushAttrib(GL_CURRENT_BIT); - - Matrix t; - t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); - glMultMatrixf((const GLfloat *)t.getElements()); - - particle *p = pStart; - while (p != pLast) - { - glPushMatrix(); - - glColor4f(p->color.r, p->color.g, p->color.b, p->color.a); - sprite->draw(p->position[0], p->position[1], p->rotation, p->size, p->size, offsetX, offsetY, 0.0f, 0.0f); - - glPopMatrix(); - p++; - } - - glPopAttrib(); - glPopMatrix(); -} - -void ParticleSystem::update(float dt) -{ - // Traverse all particles and update. - particle *p = pStart; - - // Make some more particles. - if (active) - { - float rate = 1.0f / emissionRate; // the amount of time between each particle emit - emitCounter += dt; - while (emitCounter > rate) - { - add(); - emitCounter -= rate; - } - /*int particles = (int)(emissionRate * dt); - for (int i = 0; i != particles; i++) - add();*/ - - life -= dt; - if (lifetime != -1 && life < 0) - stop(); - } - - while (p != pLast) - { - // Decrease lifespan. - p->life -= dt; - - if (p->life > 0) - { - - // Temp variables. - love::Vector radial, tangential, gravity(0, p->gravity); - love::Vector ppos(p->position[0], p->position[1]); - - // Get vector from particle center to particle. - radial = ppos - p->origin; - radial.normalize(); - tangential = radial; - - // Resize radial acceleration. - radial *= p->radialAcceleration; - - // Calculate tangential acceleration. - { - float a = tangential.getX(); - tangential.setX(-tangential.getY()); - tangential.setY(a); - } - - // Resize tangential. - tangential *= p->tangentialAcceleration; - - // Update position. - p->speed += (radial+tangential+gravity)*dt; - - // Modify position. - ppos += p->speed * dt; - - p->position[0] = ppos.getX(); - p->position[1] = ppos.getY(); - - const float t = 1.0f - p->life / p->lifetime; - - // Rotate. - p->rotation += (p->spinStart * (1.0f - t) + p->spinEnd * t)*dt; - - // Change size according to given intervals: - // i = 0 1 2 3 n-1 - // |-------|-------|------|--- ... ---| - // t = 0 1/(n-1) 3/(n-1) 1 - // - // `s' is the interpolation variable scaled to the current - // interval width, e.g. if n = 5 and t = 0.3, then the current - // indices are 1,2 and s = 0.3 - 0.25 = 0.05 - float s = p->sizeOffset + t * p->sizeIntervalSize; // size variation - s *= (float)(sizes.size() - 1); // 0 <= s < sizes.size() - size_t i = (size_t)s; - size_t k = (i == sizes.size() - 1) ? i : i + 1; // boundary check (prevents failing on t = 1.0f) - s -= (float)i; // transpose s to be in interval [0:1]: i <= s < i + 1 ~> 0 <= s < 1 - p->size = sizes[i] * (1.0f - s) + sizes[k] * s; - - // Update color according to given intervals (as above) - s = t * (float)(colors.size() - 1); - i = (size_t)s; - k = (i == colors.size() - 1) ? i : i + 1; - s -= (float)i; // 0 <= s <= 1 - p->color = colors[i] * (1.0f - s) + colors[k] * s; - - // Next particle. - p++; - } - else - { - remove(p); - - if (p >= pLast) - return; - } // else - } // while -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "ParticleSystem.h" + +#include "common/math.h" + +#include "GLee.h" +#include +#include + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +namespace +{ +Colorf colorToFloat(const Color &c) +{ + return Colorf((GLfloat)c.r/255.0f, (GLfloat)c.g/255.0f, (GLfloat)c.b/255.0f, (GLfloat)c.a/255.0f); +} +} + +float calculate_variation(float inner, float outer, float var) +{ + float low = inner - (outer/2.0f)*var; + float high = inner + (outer/2.0f)*var; + float r = (rand() / (float(RAND_MAX)+1)); + return low*(1-r)+high*r; +} + + +ParticleSystem::ParticleSystem(Image *sprite, unsigned int buffer) + : pStart(0) + , pLast(0) + , pEnd(0) + , active(true) + , emissionRate(0) + , emitCounter(0) + , lifetime(-1) + , life(0) + , particleLifeMin(0) + , particleLifeMax(0) + , direction(0) + , spread(0) + , relative(false) + , speedMin(0) + , speedMax(0) + , gravityMin(0) + , gravityMax(0) + , radialAccelerationMin(0) + , radialAccelerationMax(0) + , tangentialAccelerationMin(0) + , tangentialAccelerationMax(0) + , sizeVariation(0) + , rotationMin(0) + , rotationMax(0) + , spinStart(0) + , spinEnd(0) + , spinVariation(0) + , offsetX(sprite->getWidth()*0.5f) + , offsetY(sprite->getHeight()*0.5f) +{ + this->sprite = sprite; + sprite->retain(); + sizes.push_back(1.0f); + colors.push_back(Colorf(1.0f, 1.0f, 1.0f, 1.0f)); + setBufferSize(buffer); +} + +ParticleSystem::~ParticleSystem() +{ + if (this->sprite != 0) + this->sprite->release(); + + if (pStart != 0) + delete [] pStart; +} + +void ParticleSystem::add() +{ + if (isFull()) return; + + float min,max; + + min = particleLifeMin; + max = particleLifeMax; + if (min == max) + pLast->life = min; + else + pLast->life = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; + pLast->lifetime = pLast->life; + + pLast->position[0] = position.getX(); + pLast->position[1] = position.getY(); + + min = direction - spread/2.0f; + max = direction + spread/2.0f; + pLast->direction = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; + + pLast->origin = position; + + min = speedMin; + max = speedMax; + float speed = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; + pLast->speed = love::Vector(cos(pLast->direction), sin(pLast->direction)); + pLast->speed *= speed; + + min = gravityMin; + max = gravityMax; + pLast->gravity = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; + + min = radialAccelerationMin; + max = radialAccelerationMax; + pLast->radialAcceleration = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; + + min = tangentialAccelerationMin; + max = tangentialAccelerationMax; + pLast->tangentialAcceleration = (rand() / (float(RAND_MAX)+1)) * (max - min) + min; + + pLast->sizeOffset = (rand() / (float(RAND_MAX)+1)) * sizeVariation; // time offset for size change + pLast->sizeIntervalSize = (1.0f - (rand() / (float(RAND_MAX)+1)) * sizeVariation) - pLast->sizeOffset; + pLast->size = sizes[(size_t)(pLast->sizeOffset - .5f) * (sizes.size() - 1)]; + + min = rotationMin; + max = rotationMax; + pLast->spinStart = calculate_variation(spinStart, spinEnd, spinVariation); + pLast->spinEnd = calculate_variation(spinEnd, spinStart, spinVariation); + pLast->rotation = (rand() / (float(RAND_MAX)+1)) * (max - min) + min;; + + pLast->color = colors[0]; + + pLast++; +} + +void ParticleSystem::remove(particle *p) +{ + if (!isEmpty()) + { + *p = *(--pLast); + } +} + +void ParticleSystem::setSprite(Image *image) +{ + if (sprite != 0) + sprite->release(); + + sprite = image; + sprite->retain(); +} + +void ParticleSystem::setBufferSize(unsigned int size) +{ + // delete previous data + delete [] pStart; + + pLast = pStart = new particle[size]; + + pEnd = pStart + size; +} + +void ParticleSystem::setEmissionRate(int rate) +{ + emissionRate = rate; +} + +void ParticleSystem::setLifetime(float life) +{ + this->life = lifetime = life; +} + +void ParticleSystem::setParticleLife(float min, float max) +{ + particleLifeMin = min; + if (max == 0) + particleLifeMax = min; + else + particleLifeMax = max; +} + +void ParticleSystem::setPosition(float x, float y) +{ + position = love::Vector(x, y); +} + +void ParticleSystem::setDirection(float direction) +{ + this->direction = direction; +} + +void ParticleSystem::setSpread(float spread) +{ + this->spread = spread; +} + +void ParticleSystem::setRelativeDirection(bool relative) +{ + this->relative = relative; +} + +void ParticleSystem::setSpeed(float speed) +{ + speedMin = speedMax = speed; +} + +void ParticleSystem::setSpeed(float min, float max) +{ + speedMin = min; + speedMax = max; +} + +void ParticleSystem::setGravity(float gravity) +{ + gravityMin = gravityMax = gravity; +} + +void ParticleSystem::setGravity(float min, float max) +{ + gravityMin = min; + gravityMax = max; +} + +void ParticleSystem::setRadialAcceleration(float acceleration) +{ + radialAccelerationMin = radialAccelerationMax = acceleration; +} + +void ParticleSystem::setRadialAcceleration(float min, float max) +{ + radialAccelerationMin = min; + radialAccelerationMax = max; +} + +void ParticleSystem::setTangentialAcceleration(float acceleration) +{ + tangentialAccelerationMin = tangentialAccelerationMax = acceleration; +} + +void ParticleSystem::setTangentialAcceleration(float min, float max) +{ + tangentialAccelerationMin = min; + tangentialAccelerationMax = max; +} + +void ParticleSystem::setSize(float size) +{ + sizes.resize(1); + sizes[0] = size; +} + +void ParticleSystem::setSize(const std::vector &newSizes, float variation) +{ + sizes = newSizes; + sizeVariation = variation; +} + +void ParticleSystem::setSizeVariation(float variation) +{ + sizeVariation = variation; +} + +void ParticleSystem::setRotation(float rotation) +{ + rotationMin = rotationMax = rotation; +} + +void ParticleSystem::setRotation(float min, float max) +{ + rotationMin = min; + rotationMax = max; +} + +void ParticleSystem::setSpin(float spin) +{ + spinStart = spin; + spinEnd = spin; +} + +void ParticleSystem::setSpin(float start, float end) +{ + spinStart = start; + spinEnd = end; +} + +void ParticleSystem::setSpin(float start, float end, float variation) +{ + spinStart = start; + spinEnd = end; + spinVariation = variation; +} + +void ParticleSystem::setSpinVariation(float variation) +{ + spinVariation = variation; +} + +void ParticleSystem::setColor(const Color &color) +{ + colors.resize(1); + colors[0] = colorToFloat(color); +} + +void ParticleSystem::setColor(const std::vector &newColors) +{ + colors.resize(newColors.size()); + for (size_t i = 0; i < newColors.size(); ++i) + colors[i] = colorToFloat(newColors[i]); +} + +void ParticleSystem::setOffset(float x, float y) +{ + offsetX = x; + offsetY = y; +} + +float ParticleSystem::getX() const +{ + return position.getX(); +} + +float ParticleSystem::getY() const +{ + return position.getY(); +} + +const love::Vector &ParticleSystem::getPosition() const +{ + return position; +} + +float ParticleSystem::getDirection() const +{ + return direction; +} + +float ParticleSystem::getSpread() const +{ + return spread; +} + +float ParticleSystem::getOffsetX() const +{ + return offsetX; +} + +float ParticleSystem::getOffsetY() const +{ + return offsetY; +} + +int ParticleSystem::count() const +{ + return (int)(pLast - pStart); +} + +void ParticleSystem::start() +{ + active = true; +} + +void ParticleSystem::stop() +{ + active = false; + life = lifetime; + emitCounter = 0; +} + +void ParticleSystem::pause() +{ + active = false; +} + +void ParticleSystem::reset() +{ + pLast = pStart; + life = lifetime; + emitCounter = 0; +} + +bool ParticleSystem::isActive() const +{ + return active; +} + +bool ParticleSystem::isEmpty() const +{ + return pStart == pLast; +} + +bool ParticleSystem::isFull() const +{ + return pLast == pEnd; +} + +void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const +{ + if (sprite == 0) return; // just in case of failure + + glPushMatrix(); + glPushAttrib(GL_CURRENT_BIT); + + Matrix t; + t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); + glMultMatrixf((const GLfloat *)t.getElements()); + + particle *p = pStart; + while (p != pLast) + { + glPushMatrix(); + + glColor4f(p->color.r, p->color.g, p->color.b, p->color.a); + sprite->draw(p->position[0], p->position[1], p->rotation, p->size, p->size, offsetX, offsetY, 0.0f, 0.0f); + + glPopMatrix(); + p++; + } + + glPopAttrib(); + glPopMatrix(); +} + +void ParticleSystem::update(float dt) +{ + // Traverse all particles and update. + particle *p = pStart; + + // Make some more particles. + if (active) + { + float rate = 1.0f / emissionRate; // the amount of time between each particle emit + emitCounter += dt; + while (emitCounter > rate) + { + add(); + emitCounter -= rate; + } + /*int particles = (int)(emissionRate * dt); + for (int i = 0; i != particles; i++) + add();*/ + + life -= dt; + if (lifetime != -1 && life < 0) + stop(); + } + + while (p != pLast) + { + // Decrease lifespan. + p->life -= dt; + + if (p->life > 0) + { + + // Temp variables. + love::Vector radial, tangential, gravity(0, p->gravity); + love::Vector ppos(p->position[0], p->position[1]); + + // Get vector from particle center to particle. + radial = ppos - p->origin; + radial.normalize(); + tangential = radial; + + // Resize radial acceleration. + radial *= p->radialAcceleration; + + // Calculate tangential acceleration. + { + float a = tangential.getX(); + tangential.setX(-tangential.getY()); + tangential.setY(a); + } + + // Resize tangential. + tangential *= p->tangentialAcceleration; + + // Update position. + p->speed += (radial+tangential+gravity)*dt; + + // Modify position. + ppos += p->speed * dt; + + p->position[0] = ppos.getX(); + p->position[1] = ppos.getY(); + + const float t = 1.0f - p->life / p->lifetime; + + // Rotate. + p->rotation += (p->spinStart * (1.0f - t) + p->spinEnd * t)*dt; + + // Change size according to given intervals: + // i = 0 1 2 3 n-1 + // |-------|-------|------|--- ... ---| + // t = 0 1/(n-1) 3/(n-1) 1 + // + // `s' is the interpolation variable scaled to the current + // interval width, e.g. if n = 5 and t = 0.3, then the current + // indices are 1,2 and s = 0.3 - 0.25 = 0.05 + float s = p->sizeOffset + t * p->sizeIntervalSize; // size variation + s *= (float)(sizes.size() - 1); // 0 <= s < sizes.size() + size_t i = (size_t)s; + size_t k = (i == sizes.size() - 1) ? i : i + 1; // boundary check (prevents failing on t = 1.0f) + s -= (float)i; // transpose s to be in interval [0:1]: i <= s < i + 1 ~> 0 <= s < 1 + p->size = sizes[i] * (1.0f - s) + sizes[k] * s; + + // Update color according to given intervals (as above) + s = t * (float)(colors.size() - 1); + i = (size_t)s; + k = (i == colors.size() - 1) ? i : i + 1; + s -= (float)i; // 0 <= s <= 1 + p->color = colors[i] * (1.0f - s) + colors[k] * s; + + // Next particle. + p++; + } + else + { + remove(p); + + if (p >= pLast) + return; + } // else + } // while +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/ParticleSystem.h b/src/modules/graphics/opengl/ParticleSystem.h index 6673b887d..186437ad4 100644 --- a/src/modules/graphics/opengl/ParticleSystem.h +++ b/src/modules/graphics/opengl/ParticleSystem.h @@ -1,448 +1,448 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_PARTICLE_SYSTEM_H -#define LOVE_GRAPHICS_OPENGL_PARTICLE_SYSTEM_H - -// LOVE - -#include "common/math.h" -#include "common/Vector.h" -#include "graphics/Drawable.h" -#include "graphics/Color.h" -#include "Image.h" -#include - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -// Represents a single particle. -struct particle -{ - float lifetime; - float life; - - float position[2]; - float direction; - - // Particles gravitate towards this point. - love::Vector origin; - - love::Vector speed; - float gravity; - float radialAcceleration; - float tangentialAcceleration; - - float size; - float sizeOffset; - float sizeIntervalSize; - - float rotation; - float spinStart; - float spinEnd; - - Colorf color; -}; - -/** - * A class for creating, moving and drawing particles. - * A big thanks to bobthebloke.org - **/ -class ParticleSystem : public Drawable -{ -public: - - /** - * Creates a particle system with the specified buffersize and sprite. - **/ - ParticleSystem(Image *sprite, unsigned int buffer); - - /** - * Deletes any allocated memory. - **/ - virtual ~ParticleSystem(); - - /** - * Sets the sprite used in the particle system. - * @param sprite The new sprite. - **/ - void setSprite(Image *image); - - /** - * Clears the current buffer and allocates the appropriate amount of space for the buffer. - * @param size The new buffer size. - **/ - void setBufferSize(unsigned int size); - - /** - * Sets the emission rate. - * @param rate The amount of particles per second. - **/ - void setEmissionRate(int rate); - - /** - * Sets the lifetime of the particle emitter (-1 means eternal) - * @param life The lifetime (in seconds). - **/ - void setLifetime(float life); - - /** - * Sets the life range of the particles. - * @param lifeMin The minimum life. - * @param lifeMax The maximum life (if 0, then becomes the same as minimum life). - **/ - void setParticleLife(float min, float max = 0); - - /** - * Sets the position of the center of the emitter and the direction (if set to relative). - * Used to move the emitter without changing the position of already existing particles. - * @param x The x-coordinate. - * @param y The y-coordinate. - **/ - void setPosition(float x, float y); - - /** - * Sets the direction and the spread of the particle emitter. - * @param direction The direction (in degrees). - **/ - void setDirection(float direction); - - /** - * Sets the spread of the particle emitter. - * @param spread The spread (in degrees). - **/ - void setSpread(float spread); - - /** - * Sets whether the direction should be relative to the particle emitters movement. Used in conjunction with setPosition. - * @param relative Whether to have relative direction. - **/ - void setRelativeDirection(bool relative); - - /** - * Sets the speed of the particles. - * @param speed The speed. - **/ - void setSpeed(float speed); - - /** - * Sets the speed of the particles. - * @param min The minimum speed. - * @param max The maximum speed. - **/ - void setSpeed(float min, float max); - - /** - * Sets the gravity of the particles (the acceleration along the y-axis). - * @param gravity The amount of gravity. - **/ - void setGravity(float gravity); - - /** - * Sets the gravity of the particles (the acceleration along the y-axis). - * @param min The minimum gravity. - * @param max The maximum gravity. - **/ - void setGravity(float min, float max); - - /** - * Sets the radial acceleration (the acceleration towards the particle emitter). - * @param acceleration The amount of acceleration. - **/ - void setRadialAcceleration(float acceleration); - - /** - * Sets the radial acceleration (the acceleration towards the particle emitter). - * @param min The minimum acceleration. - * @param max The maximum acceleration. - **/ - void setRadialAcceleration(float min, float max); - - /** - * Sets the tangential acceleration (the acceleration perpendicular to the particle's direction). - * @param acceleration The amount of acceleration. - **/ - void setTangentialAcceleration(float acceleration); - - /** - * Sets the tangential acceleration (the acceleration perpendicular to the particle's direction). - * @param min The minimum acceleration. - * @param max The maximum acceleration. - **/ - void setTangentialAcceleration(float min, float max); - - /** - * Sets the size of the sprite (1.0 being the default size). - * @param size The size of the sprite. - **/ - void setSize(float size); - - /** - * Sets the size of the sprite upon creation and upon death (1.0 being the default size) and any variation. - * @param newSizes Array of sizes - * @param variation The amount of variation on the starting size (0 being no variation and 1.0 a random size between start and end). - **/ - void setSize(const std::vector &newSizes, float variation = 0.0f); - - /** - * Sets the amount of variation to the sprite's beginning size (0 being no variation and 1.0 a random size between start and end). - * @param variation The amount of variation. - **/ - void setSizeVariation(float variation); - - /** - * Sets the amount of rotation a sprite starts out with. - * @param rotation The amount of rotation. - **/ - void setRotation(float rotation); - - /** - * Sets the amount of rotation a sprite starts out with (a random value between min and max). - * @param min The minimum amount of rotation. - * @param max The maximum amount of rotation. - **/ - void setRotation(float min, float max); - - /** - * Sets the spin of the sprite. - * @param spin The spin of the sprite (in degrees). - **/ - void setSpin(float spin); - - /** - * Sets the spin of the sprite upon particle creation and death. - * @param start The spin of the sprite upon creation (in degrees). - * @param end The spin of the sprite upon death (in degrees). - **/ - void setSpin(float start, float end); - - /** - * Sets the spin of the sprite upon particle creation and death and the variation. - * @param start The spin of the sprite upon creation (in degrees). - * @param end The spin of the sprite upon death (in degrees). - * @param variation The variation of the start spin (0 being no variation and 1 beign a random spin between start and end). - **/ - void setSpin(float start, float end, float variation); - - /** - * Sets the variation of the start spin (0 being no variation and 1 beign a random spin between start and end). - * @param variation The variation in degrees. - **/ - void setSpinVariation(float variation); - - /** - * Sets the color of the particles. - * @param color The color. - **/ - void setColor(const Color &color); - - /** - * Sets the particles' offsets for rotation. - * @param x The x offset. - * @param y The y offset. - **/ - void setOffset(float x, float y); - - /** - * Sets the color of the particles. - * @param newColors Array of colors - **/ - void setColor(const std::vector &newColors); - - /** - * Returns the x-coordinate of the emitter's position. - **/ - float getX() const; - - /** - * Returns the y-coordinate of the emitter's position. - **/ - float getY() const; - - /** - * Returns the position of the emitter. - **/ - const love::Vector &getPosition() const; - - /** - * Returns the direction of the emitter (in degrees). - **/ - float getDirection() const; - - /** - * Returns the directional spread of the emitter (in degrees). - **/ - float getSpread() const; - - /** - * Returns the X offset of the particles. - **/ - float getOffsetX() const; - - /** - * Returns the Y offset of the particles. - **/ - float getOffsetY() const; - - /** - * Returns the amount of particles that are currently active in the system. - **/ - int count() const; - - /** - * Starts/resumes the particle emitter. - **/ - void start(); - - /** - * Stops the particle emitter and resets. - **/ - void stop(); - - /** - * Pauses the particle emitter. - **/ - void pause(); - - /** - * Resets the particle emitter. - **/ - void reset(); - - /** - * Returns whether the particle emitter is active. - **/ - bool isActive() const; - - /** - * Returns whether the particle system is empty of particles or not. - **/ - bool isEmpty() const; - - /** - * Returns whether the amount of particles has reached the buffer limit or not. - **/ - bool isFull() const; - - /** - * Draws the particle emitter at the specified position. - * @param x The x-coordinate. - * @param y The y-coordinate. - **/ - virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; - - /** - * Updates the particle system. - * @param dt Time since last update. - **/ - void update(float dt); -protected: - - // The max amount of particles. - unsigned int bufferSize; - - // Pointer to the first particle. - particle *pStart; - - // Pointer to the next available free space. - particle *pLast; - - // Pointer to the end of the memory allocation. - particle *pEnd; - - // The sprite to be drawn. - Image *sprite; - - // Whether the particle emitter is active. - bool active; - - // The emission rate (particles/sec). - int emissionRate; - - // Used to determine when a particle should be emitted. - float emitCounter; - - // The relative position of the particle emitter. - love::Vector position; - - // The lifetime of the particle emitter (-1 means infinite) and the life it has left. - float lifetime; - float life; - - // The particle life. - float particleLifeMin; - float particleLifeMax; - - // The direction (and spread) the particles will be emitted in. Measured in radians. - float direction; - float spread; - - // Whether the direction should be relative to the emitter's movement. - bool relative; - - // The speed. - float speedMin; - float speedMax; - - // Acceleration towards the bottom of the screen - float gravityMin; - float gravityMax; - - // Acceleration towards the emitter's center - float radialAccelerationMin; - float radialAccelerationMax; - - // Acceleration perpendicular to the particle's direction. - float tangentialAccelerationMin; - float tangentialAccelerationMax; - - // Size. - std::vector sizes; - float sizeVariation; - - // Rotation - float rotationMin; - float rotationMax; - - // Spin. - float spinStart; - float spinEnd; - float spinVariation; - - // Offsets - float offsetX; - float offsetY; - - // Color. - std::vector colors; - - void add(); - void remove(particle *p); -}; - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_PARTICLE_SYSTEM_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_PARTICLE_SYSTEM_H +#define LOVE_GRAPHICS_OPENGL_PARTICLE_SYSTEM_H + +// LOVE + +#include "common/math.h" +#include "common/Vector.h" +#include "graphics/Drawable.h" +#include "graphics/Color.h" +#include "Image.h" +#include + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +// Represents a single particle. +struct particle +{ + float lifetime; + float life; + + float position[2]; + float direction; + + // Particles gravitate towards this point. + love::Vector origin; + + love::Vector speed; + float gravity; + float radialAcceleration; + float tangentialAcceleration; + + float size; + float sizeOffset; + float sizeIntervalSize; + + float rotation; + float spinStart; + float spinEnd; + + Colorf color; +}; + +/** + * A class for creating, moving and drawing particles. + * A big thanks to bobthebloke.org + **/ +class ParticleSystem : public Drawable +{ +public: + + /** + * Creates a particle system with the specified buffersize and sprite. + **/ + ParticleSystem(Image *sprite, unsigned int buffer); + + /** + * Deletes any allocated memory. + **/ + virtual ~ParticleSystem(); + + /** + * Sets the sprite used in the particle system. + * @param sprite The new sprite. + **/ + void setSprite(Image *image); + + /** + * Clears the current buffer and allocates the appropriate amount of space for the buffer. + * @param size The new buffer size. + **/ + void setBufferSize(unsigned int size); + + /** + * Sets the emission rate. + * @param rate The amount of particles per second. + **/ + void setEmissionRate(int rate); + + /** + * Sets the lifetime of the particle emitter (-1 means eternal) + * @param life The lifetime (in seconds). + **/ + void setLifetime(float life); + + /** + * Sets the life range of the particles. + * @param lifeMin The minimum life. + * @param lifeMax The maximum life (if 0, then becomes the same as minimum life). + **/ + void setParticleLife(float min, float max = 0); + + /** + * Sets the position of the center of the emitter and the direction (if set to relative). + * Used to move the emitter without changing the position of already existing particles. + * @param x The x-coordinate. + * @param y The y-coordinate. + **/ + void setPosition(float x, float y); + + /** + * Sets the direction and the spread of the particle emitter. + * @param direction The direction (in degrees). + **/ + void setDirection(float direction); + + /** + * Sets the spread of the particle emitter. + * @param spread The spread (in degrees). + **/ + void setSpread(float spread); + + /** + * Sets whether the direction should be relative to the particle emitters movement. Used in conjunction with setPosition. + * @param relative Whether to have relative direction. + **/ + void setRelativeDirection(bool relative); + + /** + * Sets the speed of the particles. + * @param speed The speed. + **/ + void setSpeed(float speed); + + /** + * Sets the speed of the particles. + * @param min The minimum speed. + * @param max The maximum speed. + **/ + void setSpeed(float min, float max); + + /** + * Sets the gravity of the particles (the acceleration along the y-axis). + * @param gravity The amount of gravity. + **/ + void setGravity(float gravity); + + /** + * Sets the gravity of the particles (the acceleration along the y-axis). + * @param min The minimum gravity. + * @param max The maximum gravity. + **/ + void setGravity(float min, float max); + + /** + * Sets the radial acceleration (the acceleration towards the particle emitter). + * @param acceleration The amount of acceleration. + **/ + void setRadialAcceleration(float acceleration); + + /** + * Sets the radial acceleration (the acceleration towards the particle emitter). + * @param min The minimum acceleration. + * @param max The maximum acceleration. + **/ + void setRadialAcceleration(float min, float max); + + /** + * Sets the tangential acceleration (the acceleration perpendicular to the particle's direction). + * @param acceleration The amount of acceleration. + **/ + void setTangentialAcceleration(float acceleration); + + /** + * Sets the tangential acceleration (the acceleration perpendicular to the particle's direction). + * @param min The minimum acceleration. + * @param max The maximum acceleration. + **/ + void setTangentialAcceleration(float min, float max); + + /** + * Sets the size of the sprite (1.0 being the default size). + * @param size The size of the sprite. + **/ + void setSize(float size); + + /** + * Sets the size of the sprite upon creation and upon death (1.0 being the default size) and any variation. + * @param newSizes Array of sizes + * @param variation The amount of variation on the starting size (0 being no variation and 1.0 a random size between start and end). + **/ + void setSize(const std::vector &newSizes, float variation = 0.0f); + + /** + * Sets the amount of variation to the sprite's beginning size (0 being no variation and 1.0 a random size between start and end). + * @param variation The amount of variation. + **/ + void setSizeVariation(float variation); + + /** + * Sets the amount of rotation a sprite starts out with. + * @param rotation The amount of rotation. + **/ + void setRotation(float rotation); + + /** + * Sets the amount of rotation a sprite starts out with (a random value between min and max). + * @param min The minimum amount of rotation. + * @param max The maximum amount of rotation. + **/ + void setRotation(float min, float max); + + /** + * Sets the spin of the sprite. + * @param spin The spin of the sprite (in degrees). + **/ + void setSpin(float spin); + + /** + * Sets the spin of the sprite upon particle creation and death. + * @param start The spin of the sprite upon creation (in degrees). + * @param end The spin of the sprite upon death (in degrees). + **/ + void setSpin(float start, float end); + + /** + * Sets the spin of the sprite upon particle creation and death and the variation. + * @param start The spin of the sprite upon creation (in degrees). + * @param end The spin of the sprite upon death (in degrees). + * @param variation The variation of the start spin (0 being no variation and 1 beign a random spin between start and end). + **/ + void setSpin(float start, float end, float variation); + + /** + * Sets the variation of the start spin (0 being no variation and 1 beign a random spin between start and end). + * @param variation The variation in degrees. + **/ + void setSpinVariation(float variation); + + /** + * Sets the color of the particles. + * @param color The color. + **/ + void setColor(const Color &color); + + /** + * Sets the particles' offsets for rotation. + * @param x The x offset. + * @param y The y offset. + **/ + void setOffset(float x, float y); + + /** + * Sets the color of the particles. + * @param newColors Array of colors + **/ + void setColor(const std::vector &newColors); + + /** + * Returns the x-coordinate of the emitter's position. + **/ + float getX() const; + + /** + * Returns the y-coordinate of the emitter's position. + **/ + float getY() const; + + /** + * Returns the position of the emitter. + **/ + const love::Vector &getPosition() const; + + /** + * Returns the direction of the emitter (in degrees). + **/ + float getDirection() const; + + /** + * Returns the directional spread of the emitter (in degrees). + **/ + float getSpread() const; + + /** + * Returns the X offset of the particles. + **/ + float getOffsetX() const; + + /** + * Returns the Y offset of the particles. + **/ + float getOffsetY() const; + + /** + * Returns the amount of particles that are currently active in the system. + **/ + int count() const; + + /** + * Starts/resumes the particle emitter. + **/ + void start(); + + /** + * Stops the particle emitter and resets. + **/ + void stop(); + + /** + * Pauses the particle emitter. + **/ + void pause(); + + /** + * Resets the particle emitter. + **/ + void reset(); + + /** + * Returns whether the particle emitter is active. + **/ + bool isActive() const; + + /** + * Returns whether the particle system is empty of particles or not. + **/ + bool isEmpty() const; + + /** + * Returns whether the amount of particles has reached the buffer limit or not. + **/ + bool isFull() const; + + /** + * Draws the particle emitter at the specified position. + * @param x The x-coordinate. + * @param y The y-coordinate. + **/ + virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; + + /** + * Updates the particle system. + * @param dt Time since last update. + **/ + void update(float dt); +protected: + + // The max amount of particles. + unsigned int bufferSize; + + // Pointer to the first particle. + particle *pStart; + + // Pointer to the next available free space. + particle *pLast; + + // Pointer to the end of the memory allocation. + particle *pEnd; + + // The sprite to be drawn. + Image *sprite; + + // Whether the particle emitter is active. + bool active; + + // The emission rate (particles/sec). + int emissionRate; + + // Used to determine when a particle should be emitted. + float emitCounter; + + // The relative position of the particle emitter. + love::Vector position; + + // The lifetime of the particle emitter (-1 means infinite) and the life it has left. + float lifetime; + float life; + + // The particle life. + float particleLifeMin; + float particleLifeMax; + + // The direction (and spread) the particles will be emitted in. Measured in radians. + float direction; + float spread; + + // Whether the direction should be relative to the emitter's movement. + bool relative; + + // The speed. + float speedMin; + float speedMax; + + // Acceleration towards the bottom of the screen + float gravityMin; + float gravityMax; + + // Acceleration towards the emitter's center + float radialAccelerationMin; + float radialAccelerationMax; + + // Acceleration perpendicular to the particle's direction. + float tangentialAccelerationMin; + float tangentialAccelerationMax; + + // Size. + std::vector sizes; + float sizeVariation; + + // Rotation + float rotationMin; + float rotationMax; + + // Spin. + float spinStart; + float spinEnd; + float spinVariation; + + // Offsets + float offsetX; + float offsetY; + + // Color. + std::vector colors; + + void add(); + void remove(particle *p); +}; + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_PARTICLE_SYSTEM_H diff --git a/src/modules/graphics/opengl/PixelEffect.cpp b/src/modules/graphics/opengl/PixelEffect.cpp index ecdbd9876..619fceab8 100644 --- a/src/modules/graphics/opengl/PixelEffect.cpp +++ b/src/modules/graphics/opengl/PixelEffect.cpp @@ -1,328 +1,328 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "PixelEffect.h" -#include "GLee.h" - -namespace -{ -// temporarily attaches a shader program (for setting uniforms, etc) -// reattaches the originally active program when destroyed -struct TemporaryAttacher -{ - TemporaryAttacher(love::graphics::opengl::PixelEffect *sp) : s(sp) - { - glGetIntegerv(GL_CURRENT_PROGRAM, &activeProgram); - s->attach(); - } - ~TemporaryAttacher() - { - glUseProgram(activeProgram); - } - love::graphics::opengl::PixelEffect *s; - GLint activeProgram; -}; -} // anonymous namespace - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -PixelEffect *PixelEffect::current = NULL; - -std::map PixelEffect::_texture_unit_pool; -GLint PixelEffect::_current_texture_unit = 0; -GLint PixelEffect::_max_texture_units = 0; - -GLint PixelEffect::getTextureUnit(const std::string &name) -{ - std::map::const_iterator it = _texture_unit_pool.find(name); - - if (it != _texture_unit_pool.end()) - return it->second; - - if (++_current_texture_unit >= _max_texture_units) - throw love::Exception("No more texture units available"); - - _texture_unit_pool[name] = _current_texture_unit; - return _current_texture_unit; -} - -PixelEffect::PixelEffect(const std::string &code) - : _program(0) - , _code(code) -{ - glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &_max_texture_units); - loadVolatile(); -} - -bool PixelEffect::loadVolatile() -{ - _program = glCreateProgram(); - // should only fail if this is called between a glBegin()/glEnd() pair - if (_program == 0) - throw love::Exception("Cannot create shader program object."); - - GLuint shader = glCreateShader(GL_FRAGMENT_SHADER); - // should only fail if this is called between a glBegin()/glEnd() pair - if (shader == 0) - { - glDeleteProgram(_program); - throw love::Exception("Cannot create shader object."); - } - - // compile fragment shader code - const char *src = _code.c_str(); - GLint strlen = _code.length(); - glShaderSource(shader, 1, (const GLchar **)&src, &strlen); - glCompileShader(shader); - - GLint compile_ok; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_ok); - if (GL_FALSE == compile_ok) - { - // get compiler error - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &strlen); - char *error_str = new char[strlen]; - glGetShaderInfoLog(shader, strlen, NULL, error_str); - std::string tmp(error_str); - - // cleanup before throw - delete[] error_str; - glDeleteShader(shader); - glDeleteProgram(_program); - - // XXX: errorlog may contain escape sequences. - throw love::Exception("Cannot compile shader:\n%s", tmp.c_str()); - } - - // link fragment shader - GLint link_ok; - glAttachShader(_program, shader); - glLinkProgram(_program); - glGetProgramiv(_program, GL_LINK_STATUS, &link_ok); - if (GL_FALSE == link_ok) - { - // this should not happen if compiling is ok, but one can never be too careful - // get linker error - std::string tmp(getWarnings()); - - // cleanup before throw - glDeleteShader(shader); - glDeleteProgram(_program); - throw love::Exception("Cannot compile shader:\n%s", tmp.c_str()); - } - - glDeleteShader(shader); - return true; -} - -PixelEffect::~PixelEffect() -{ - unloadVolatile(); -} - -void PixelEffect::unloadVolatile() -{ - glDeleteProgram(_program); -} - -std::string PixelEffect::getGLSLVersion() -{ - // GL_SHADING_LANGUAGE_VERSION is not available in OpenGL < 2.1. - // Be very pessimistic about the GLSL version in that case. - if (!GLEE_VERSION_2_1) - return "0.0"; - - // the version string always begins with a version number of the format - // major_number.minor_number - // or - // major_number.minor_number.release_number - std::string versionString((const char *)glGetString(GL_SHADING_LANGUAGE_VERSION)); - size_t minorEndPos = versionString.find(" "); - return versionString.substr(0, minorEndPos); -} - - -bool PixelEffect::isSupported() -{ - return GLEE_VERSION_2_0 && GLEE_ARB_shader_objects && GLEE_ARB_fragment_shader && getGLSLVersion() >= "1.2"; -} - -std::string PixelEffect::getWarnings() const -{ - GLint strlen, nullpos; - glGetProgramiv(_program, GL_INFO_LOG_LENGTH, &strlen); - char *temp_str = new char[strlen+1]; - // be extra sure that the error string will be 0-terminated - memset(temp_str, '\0', strlen+1); - glGetProgramInfoLog(_program, strlen, &nullpos, temp_str); - temp_str[nullpos] = '\0'; - - std::string warnings(temp_str); - delete[] temp_str; - return warnings; -} - -void PixelEffect::attach() -{ - glUseProgram(_program); - current = this; -} - -void PixelEffect::detach() -{ - glUseProgram(0); - current = NULL; -} - -void PixelEffect::sendFloat(const std::string &name, int size, const GLfloat *vec, int count) -{ - TemporaryAttacher attacher(this); - GLint location = getUniformLocation(name); - - if (size < 1 || size > 4) - { - throw love::Exception("Invalid variable size: %d (expected 1-4).", size); - } - - switch (size) - { - case 4: - glUniform4fv(location, count, vec); - break; - case 3: - glUniform3fv(location, count, vec); - break; - case 2: - glUniform2fv(location, count, vec); - break; - case 1: - default: - glUniform1fv(location, count, vec); - break; - } - - // throw error if needed - checkSetUniformError(); -} - -void PixelEffect::sendMatrix(const std::string &name, int size, const GLfloat *m, int count) -{ - TemporaryAttacher attacher(this); - GLint location = getUniformLocation(name); - - if (size < 2 || size > 4) - { - throw love::Exception("Invalid matrix size: %dx%d " - "(can only set 2x2, 3x3 or 4x4 matrices).", size,size); - } - - switch (size) - { - case 4: - glUniformMatrix4fv(location, count, GL_FALSE, m); - break; - case 3: - glUniformMatrix3fv(location, count, GL_FALSE, m); - break; - case 2: - default: - glUniformMatrix2fv(location, count, GL_FALSE, m); - break; - } - - // throw error if needed - checkSetUniformError(); -} - -void PixelEffect::sendImage(const std::string &name, const Image &image) -{ - GLint texture_unit = getTextureUnit(name); - - TemporaryAttacher attacher(this); - GLint location = getUniformLocation(name); - - glActiveTexture(GL_TEXTURE0 + texture_unit); - bindTexture(image.getTextureName(), true); // guarantee it gets bound - glUniform1i(location, texture_unit); - - // reset texture unit - glActiveTexture(GL_TEXTURE0); - - // throw error if needed - checkSetUniformError(); -} - -void PixelEffect::sendCanvas(const std::string &name, const Canvas &canvas) -{ - GLint texture_unit = getTextureUnit(name); - - TemporaryAttacher attacher(this); - GLint location = getUniformLocation(name); - - glActiveTexture(GL_TEXTURE0 + texture_unit); - bindTexture(canvas.getTextureName(), true); // guarantee it gets bound - glUniform1i(location, texture_unit); - - // reset texture unit - glActiveTexture(GL_TEXTURE0); - - // throw error if needed - checkSetUniformError(); -} - -GLint PixelEffect::getUniformLocation(const std::string &name) -{ - std::map::const_iterator it = _uniforms.find(name); - if (it != _uniforms.end()) - return it->second; - - GLint location = glGetUniformLocation(_program, name.c_str()); - if (location == -1) - { - throw love::Exception( - "Cannot get location of shader variable `%s'.\n" - "A common error is to define but not use the variable.", name.c_str()); - } - - _uniforms[name] = location; - return location; -} - -void PixelEffect::checkSetUniformError() -{ - GLenum error_code = glGetError(); - if (GL_INVALID_OPERATION == error_code) - { - throw love::Exception( - "Invalid operation:\n" - "- Trying to send the wrong value type to shader variable, or\n" - "- Trying to send array values with wrong dimension, or\n" - "- Invalid variable name."); - } -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "PixelEffect.h" +#include "GLee.h" + +namespace +{ +// temporarily attaches a shader program (for setting uniforms, etc) +// reattaches the originally active program when destroyed +struct TemporaryAttacher +{ + TemporaryAttacher(love::graphics::opengl::PixelEffect *sp) : s(sp) + { + glGetIntegerv(GL_CURRENT_PROGRAM, &activeProgram); + s->attach(); + } + ~TemporaryAttacher() + { + glUseProgram(activeProgram); + } + love::graphics::opengl::PixelEffect *s; + GLint activeProgram; +}; +} // anonymous namespace + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +PixelEffect *PixelEffect::current = NULL; + +std::map PixelEffect::_texture_unit_pool; +GLint PixelEffect::_current_texture_unit = 0; +GLint PixelEffect::_max_texture_units = 0; + +GLint PixelEffect::getTextureUnit(const std::string &name) +{ + std::map::const_iterator it = _texture_unit_pool.find(name); + + if (it != _texture_unit_pool.end()) + return it->second; + + if (++_current_texture_unit >= _max_texture_units) + throw love::Exception("No more texture units available"); + + _texture_unit_pool[name] = _current_texture_unit; + return _current_texture_unit; +} + +PixelEffect::PixelEffect(const std::string &code) + : _program(0) + , _code(code) +{ + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &_max_texture_units); + loadVolatile(); +} + +bool PixelEffect::loadVolatile() +{ + _program = glCreateProgram(); + // should only fail if this is called between a glBegin()/glEnd() pair + if (_program == 0) + throw love::Exception("Cannot create shader program object."); + + GLuint shader = glCreateShader(GL_FRAGMENT_SHADER); + // should only fail if this is called between a glBegin()/glEnd() pair + if (shader == 0) + { + glDeleteProgram(_program); + throw love::Exception("Cannot create shader object."); + } + + // compile fragment shader code + const char *src = _code.c_str(); + GLint strlen = _code.length(); + glShaderSource(shader, 1, (const GLchar **)&src, &strlen); + glCompileShader(shader); + + GLint compile_ok; + glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_ok); + if (GL_FALSE == compile_ok) + { + // get compiler error + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &strlen); + char *error_str = new char[strlen]; + glGetShaderInfoLog(shader, strlen, NULL, error_str); + std::string tmp(error_str); + + // cleanup before throw + delete[] error_str; + glDeleteShader(shader); + glDeleteProgram(_program); + + // XXX: errorlog may contain escape sequences. + throw love::Exception("Cannot compile shader:\n%s", tmp.c_str()); + } + + // link fragment shader + GLint link_ok; + glAttachShader(_program, shader); + glLinkProgram(_program); + glGetProgramiv(_program, GL_LINK_STATUS, &link_ok); + if (GL_FALSE == link_ok) + { + // this should not happen if compiling is ok, but one can never be too careful + // get linker error + std::string tmp(getWarnings()); + + // cleanup before throw + glDeleteShader(shader); + glDeleteProgram(_program); + throw love::Exception("Cannot compile shader:\n%s", tmp.c_str()); + } + + glDeleteShader(shader); + return true; +} + +PixelEffect::~PixelEffect() +{ + unloadVolatile(); +} + +void PixelEffect::unloadVolatile() +{ + glDeleteProgram(_program); +} + +std::string PixelEffect::getGLSLVersion() +{ + // GL_SHADING_LANGUAGE_VERSION is not available in OpenGL < 2.1. + // Be very pessimistic about the GLSL version in that case. + if (!GLEE_VERSION_2_1) + return "0.0"; + + // the version string always begins with a version number of the format + // major_number.minor_number + // or + // major_number.minor_number.release_number + std::string versionString((const char *)glGetString(GL_SHADING_LANGUAGE_VERSION)); + size_t minorEndPos = versionString.find(" "); + return versionString.substr(0, minorEndPos); +} + + +bool PixelEffect::isSupported() +{ + return GLEE_VERSION_2_0 && GLEE_ARB_shader_objects && GLEE_ARB_fragment_shader && getGLSLVersion() >= "1.2"; +} + +std::string PixelEffect::getWarnings() const +{ + GLint strlen, nullpos; + glGetProgramiv(_program, GL_INFO_LOG_LENGTH, &strlen); + char *temp_str = new char[strlen+1]; + // be extra sure that the error string will be 0-terminated + memset(temp_str, '\0', strlen+1); + glGetProgramInfoLog(_program, strlen, &nullpos, temp_str); + temp_str[nullpos] = '\0'; + + std::string warnings(temp_str); + delete[] temp_str; + return warnings; +} + +void PixelEffect::attach() +{ + glUseProgram(_program); + current = this; +} + +void PixelEffect::detach() +{ + glUseProgram(0); + current = NULL; +} + +void PixelEffect::sendFloat(const std::string &name, int size, const GLfloat *vec, int count) +{ + TemporaryAttacher attacher(this); + GLint location = getUniformLocation(name); + + if (size < 1 || size > 4) + { + throw love::Exception("Invalid variable size: %d (expected 1-4).", size); + } + + switch (size) + { + case 4: + glUniform4fv(location, count, vec); + break; + case 3: + glUniform3fv(location, count, vec); + break; + case 2: + glUniform2fv(location, count, vec); + break; + case 1: + default: + glUniform1fv(location, count, vec); + break; + } + + // throw error if needed + checkSetUniformError(); +} + +void PixelEffect::sendMatrix(const std::string &name, int size, const GLfloat *m, int count) +{ + TemporaryAttacher attacher(this); + GLint location = getUniformLocation(name); + + if (size < 2 || size > 4) + { + throw love::Exception("Invalid matrix size: %dx%d " + "(can only set 2x2, 3x3 or 4x4 matrices).", size,size); + } + + switch (size) + { + case 4: + glUniformMatrix4fv(location, count, GL_FALSE, m); + break; + case 3: + glUniformMatrix3fv(location, count, GL_FALSE, m); + break; + case 2: + default: + glUniformMatrix2fv(location, count, GL_FALSE, m); + break; + } + + // throw error if needed + checkSetUniformError(); +} + +void PixelEffect::sendImage(const std::string &name, const Image &image) +{ + GLint texture_unit = getTextureUnit(name); + + TemporaryAttacher attacher(this); + GLint location = getUniformLocation(name); + + glActiveTexture(GL_TEXTURE0 + texture_unit); + bindTexture(image.getTextureName(), true); // guarantee it gets bound + glUniform1i(location, texture_unit); + + // reset texture unit + glActiveTexture(GL_TEXTURE0); + + // throw error if needed + checkSetUniformError(); +} + +void PixelEffect::sendCanvas(const std::string &name, const Canvas &canvas) +{ + GLint texture_unit = getTextureUnit(name); + + TemporaryAttacher attacher(this); + GLint location = getUniformLocation(name); + + glActiveTexture(GL_TEXTURE0 + texture_unit); + bindTexture(canvas.getTextureName(), true); // guarantee it gets bound + glUniform1i(location, texture_unit); + + // reset texture unit + glActiveTexture(GL_TEXTURE0); + + // throw error if needed + checkSetUniformError(); +} + +GLint PixelEffect::getUniformLocation(const std::string &name) +{ + std::map::const_iterator it = _uniforms.find(name); + if (it != _uniforms.end()) + return it->second; + + GLint location = glGetUniformLocation(_program, name.c_str()); + if (location == -1) + { + throw love::Exception( + "Cannot get location of shader variable `%s'.\n" + "A common error is to define but not use the variable.", name.c_str()); + } + + _uniforms[name] = location; + return location; +} + +void PixelEffect::checkSetUniformError() +{ + GLenum error_code = glGetError(); + if (GL_INVALID_OPERATION == error_code) + { + throw love::Exception( + "Invalid operation:\n" + "- Trying to send the wrong value type to shader variable, or\n" + "- Trying to send array values with wrong dimension, or\n" + "- Invalid variable name."); + } +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/PixelEffect.h b/src/modules/graphics/opengl/PixelEffect.h index 2750ff8dd..e1818e735 100644 --- a/src/modules/graphics/opengl/PixelEffect.h +++ b/src/modules/graphics/opengl/PixelEffect.h @@ -1,80 +1,80 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_EFFECT_H -#define LOVE_GRAPHICS_EFFECT_H - -#include "common/Object.h" -#include -#include -#include "OpenGL.h" -#include "Image.h" -#include "Canvas.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ -// A fragment shader -class PixelEffect : public Object, public Volatile -{ -public: - PixelEffect(const std::string &code); - virtual ~PixelEffect(); - std::string getWarnings() const; - - virtual bool loadVolatile(); - virtual void unloadVolatile(); - - void attach(); - static void detach(); - static std::string getGLSLVersion(); - static bool isSupported(); - - static PixelEffect *current; - - void sendFloat(const std::string &name, int size, const GLfloat *vec, int count); - void sendMatrix(const std::string &name, int size, const GLfloat *m, int count); - void sendImage(const std::string &name, const Image &image); - void sendCanvas(const std::string &name, const Canvas &canvas); - -private: - GLint getUniformLocation(const std::string &name); - void checkSetUniformError(); - GLuint _program; - std::string _code; // volatile and stuff - - // uniform location buffer - std::map _uniforms; - - // texture unit pool for setting images - static std::map _texture_unit_pool; - static GLint _current_texture_unit; - static GLint _max_texture_units; - static GLint getTextureUnit(const std::string &name); -}; - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_EFFECT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_EFFECT_H +#define LOVE_GRAPHICS_EFFECT_H + +#include "common/Object.h" +#include +#include +#include "OpenGL.h" +#include "Image.h" +#include "Canvas.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ +// A fragment shader +class PixelEffect : public Object, public Volatile +{ +public: + PixelEffect(const std::string &code); + virtual ~PixelEffect(); + std::string getWarnings() const; + + virtual bool loadVolatile(); + virtual void unloadVolatile(); + + void attach(); + static void detach(); + static std::string getGLSLVersion(); + static bool isSupported(); + + static PixelEffect *current; + + void sendFloat(const std::string &name, int size, const GLfloat *vec, int count); + void sendMatrix(const std::string &name, int size, const GLfloat *m, int count); + void sendImage(const std::string &name, const Image &image); + void sendCanvas(const std::string &name, const Canvas &canvas); + +private: + GLint getUniformLocation(const std::string &name); + void checkSetUniformError(); + GLuint _program; + std::string _code; // volatile and stuff + + // uniform location buffer + std::map _uniforms; + + // texture unit pool for setting images + static std::map _texture_unit_pool; + static GLint _current_texture_unit; + static GLint _max_texture_units; + static GLint getTextureUnit(const std::string &name); +}; + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_EFFECT_H diff --git a/src/modules/graphics/opengl/Quad.cpp b/src/modules/graphics/opengl/Quad.cpp index cfd9d8bf9..242cd2053 100644 --- a/src/modules/graphics/opengl/Quad.cpp +++ b/src/modules/graphics/opengl/Quad.cpp @@ -1,134 +1,134 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Quad.h" -#include "common/Matrix.h" - -// GLee -#include "GLee.h" - -// STD -#include // For memcpy - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Quad::Quad(const Viewport &v, float sw, float sh) - : sw(sw) - , sh(sh) -{ - memset(vertices, 255, sizeof(vertex)*NUM_VERTICES); - refresh(v, sw, sh); -} - -Quad::~Quad() -{ -} - -void Quad::refresh(const Viewport &v, float sw, float sh) -{ - if (!GLEE_ARB_texture_non_power_of_two) - { - sw = next_p2(sw); - sh = next_p2(sh); - } - viewport = v; - - vertices[0].x = 0; - vertices[0].y = 0; - vertices[1].x = 0; - vertices[1].y = v.h; - vertices[2].x = v.w; - vertices[2].y = v.h; - vertices[3].x = v.w; - vertices[3].y = 0; - - vertices[0].s = v.x/sw; - vertices[0].t = v.y/sh; - vertices[1].s = v.x/sw; - vertices[1].t = (v.y+v.h)/sh; - vertices[2].s = (v.x+v.w)/sw; - vertices[2].t = (v.y+v.h)/sh; - vertices[3].s = (v.x+v.w)/sw; - vertices[3].t = v.y/sh; -} - -void Quad::setViewport(const Quad::Viewport &v) -{ - refresh(v, sw, sh); -} - -Quad::Viewport Quad::getViewport() const -{ - return viewport; -} - -void Quad::flip(bool x, bool y) -{ - vertex temp[4]; - if (x) - { - memcpy(temp, vertices, sizeof(vertex)*NUM_VERTICES); - vertices[0].s = temp[3].s; - vertices[0].t = temp[3].t; - vertices[1].s = temp[2].s; - vertices[1].t = temp[2].t; - vertices[2].s = temp[1].s; - vertices[2].t = temp[1].t; - vertices[3].s = temp[0].s; - vertices[3].t = temp[0].t; - } - if (y) - { - memcpy(temp, vertices, sizeof(vertex)*NUM_VERTICES); - vertices[0].s = temp[1].s; - vertices[0].t = temp[1].t; - vertices[1].s = temp[0].s; - vertices[1].t = temp[0].t; - vertices[2].s = temp[3].s; - vertices[2].t = temp[3].t; - vertices[3].s = temp[2].s; - vertices[3].t = temp[2].t; - } -} - -void Quad::mirror(bool x, bool y) -{ - for (size_t i = 0; i < NUM_VERTICES; ++i) - { - if (x) - vertices[i].s = 1.0f - vertices[i].s; - if (y) - vertices[i].t = 1.0f - vertices[i].t; - } -} - -const vertex *Quad::getVertices() const -{ - return vertices; -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Quad.h" +#include "common/Matrix.h" + +// GLee +#include "GLee.h" + +// STD +#include // For memcpy + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Quad::Quad(const Viewport &v, float sw, float sh) + : sw(sw) + , sh(sh) +{ + memset(vertices, 255, sizeof(vertex)*NUM_VERTICES); + refresh(v, sw, sh); +} + +Quad::~Quad() +{ +} + +void Quad::refresh(const Viewport &v, float sw, float sh) +{ + if (!GLEE_ARB_texture_non_power_of_two) + { + sw = next_p2(sw); + sh = next_p2(sh); + } + viewport = v; + + vertices[0].x = 0; + vertices[0].y = 0; + vertices[1].x = 0; + vertices[1].y = v.h; + vertices[2].x = v.w; + vertices[2].y = v.h; + vertices[3].x = v.w; + vertices[3].y = 0; + + vertices[0].s = v.x/sw; + vertices[0].t = v.y/sh; + vertices[1].s = v.x/sw; + vertices[1].t = (v.y+v.h)/sh; + vertices[2].s = (v.x+v.w)/sw; + vertices[2].t = (v.y+v.h)/sh; + vertices[3].s = (v.x+v.w)/sw; + vertices[3].t = v.y/sh; +} + +void Quad::setViewport(const Quad::Viewport &v) +{ + refresh(v, sw, sh); +} + +Quad::Viewport Quad::getViewport() const +{ + return viewport; +} + +void Quad::flip(bool x, bool y) +{ + vertex temp[4]; + if (x) + { + memcpy(temp, vertices, sizeof(vertex)*NUM_VERTICES); + vertices[0].s = temp[3].s; + vertices[0].t = temp[3].t; + vertices[1].s = temp[2].s; + vertices[1].t = temp[2].t; + vertices[2].s = temp[1].s; + vertices[2].t = temp[1].t; + vertices[3].s = temp[0].s; + vertices[3].t = temp[0].t; + } + if (y) + { + memcpy(temp, vertices, sizeof(vertex)*NUM_VERTICES); + vertices[0].s = temp[1].s; + vertices[0].t = temp[1].t; + vertices[1].s = temp[0].s; + vertices[1].t = temp[0].t; + vertices[2].s = temp[3].s; + vertices[2].t = temp[3].t; + vertices[3].s = temp[2].s; + vertices[3].t = temp[2].t; + } +} + +void Quad::mirror(bool x, bool y) +{ + for (size_t i = 0; i < NUM_VERTICES; ++i) + { + if (x) + vertices[i].s = 1.0f - vertices[i].s; + if (y) + vertices[i].t = 1.0f - vertices[i].t; + } +} + +const vertex *Quad::getVertices() const +{ + return vertices; +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/Quad.h b/src/modules/graphics/opengl/Quad.h index 4b4f95c8e..fd400005b 100644 --- a/src/modules/graphics/opengl/Quad.h +++ b/src/modules/graphics/opengl/Quad.h @@ -1,77 +1,77 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_QUAD_H -#define LOVE_GRAPHICS_OPENGL_QUAD_H - -// LOVE -#include "common/math.h" -#include - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -class Quad : public love::graphics::Quad -{ -public: - - /** - * Creates a new Quad of size (w,h), using (x,y) as the top-left - * anchor point in the source image. The size of the source image is - * is specified by (sw,sh). - * - * @param sw Width of the source image. - * @param sh Height of the source image. - **/ - Quad(const Viewport &v, float sw, float sh); - - virtual ~Quad(); - - void refresh(const Viewport &v, float sw, float sh); - - void setViewport(const Viewport &v); - Viewport getViewport() const; - - void flip(bool x, bool y); - void mirror(bool x, bool y); - - /** - * Gets a pointer to the vertices. - **/ - const vertex *getVertices() const; - -protected: - - static const unsigned int NUM_VERTICES = 4; - vertex vertices[NUM_VERTICES]; - - Viewport viewport; - float sw, sh; -}; - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_QUAD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_QUAD_H +#define LOVE_GRAPHICS_OPENGL_QUAD_H + +// LOVE +#include "common/math.h" +#include + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +class Quad : public love::graphics::Quad +{ +public: + + /** + * Creates a new Quad of size (w,h), using (x,y) as the top-left + * anchor point in the source image. The size of the source image is + * is specified by (sw,sh). + * + * @param sw Width of the source image. + * @param sh Height of the source image. + **/ + Quad(const Viewport &v, float sw, float sh); + + virtual ~Quad(); + + void refresh(const Viewport &v, float sw, float sh); + + void setViewport(const Viewport &v); + Viewport getViewport() const; + + void flip(bool x, bool y); + void mirror(bool x, bool y); + + /** + * Gets a pointer to the vertices. + **/ + const vertex *getVertices() const; + +protected: + + static const unsigned int NUM_VERTICES = 4; + vertex vertices[NUM_VERTICES]; + + Viewport viewport; + float sw, sh; +}; + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_QUAD_H diff --git a/src/modules/graphics/opengl/SpriteBatch.cpp b/src/modules/graphics/opengl/SpriteBatch.cpp index b40180e74..5b8c9b6bc 100644 --- a/src/modules/graphics/opengl/SpriteBatch.cpp +++ b/src/modules/graphics/opengl/SpriteBatch.cpp @@ -1,288 +1,288 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "SpriteBatch.h" - -// STD -#include - -// LOVE -#include "Image.h" -#include "Quad.h" -#include "VertexBuffer.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -SpriteBatch::SpriteBatch(Image *image, int size, int usage) - : image(image) - , size(size) - , next(0) - , color(0) - , array_buf(0) - , element_buf(0) -{ - image->retain(); - - GLenum gl_usage; - - switch (usage) - { - default: - case USAGE_DYNAMIC: - gl_usage = GL_DYNAMIC_DRAW; - break; - case USAGE_STATIC: - gl_usage = GL_STATIC_DRAW; - break; - case USAGE_STREAM: - gl_usage = GL_STREAM_DRAW; - break; - } - - int vertex_size = sizeof(vertex) * 4 * size; - int element_size = sizeof(GLushort) * 6 * size; - - array_buf = VertexBuffer::Create(vertex_size, GL_ARRAY_BUFFER, gl_usage); - element_buf = VertexBuffer::Create(element_size, GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW); - - // Fill element buffer. - { - VertexBuffer::Bind bind(*element_buf); - VertexBuffer::Mapper mapper(*element_buf); - - GLushort *indices = static_cast(mapper.get()); - - if (indices) - { - for (int i = 0; i < size; ++i) - { - indices[i*6+0] = 0+(i*4); - indices[i*6+1] = 1+(i*4); - indices[i*6+2] = 2+(i*4); - - indices[i*6+3] = 0+(i*4); - indices[i*6+4] = 2+(i*4); - indices[i*6+5] = 3+(i*4); - } - } - } -} - -SpriteBatch::~SpriteBatch() -{ - image->release(); - - delete color; - delete array_buf; - delete element_buf; -} - -int SpriteBatch::add(float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index /*= -1*/) -{ - // Only do this if there's a free slot. - if ((index == -1 && next >= size) || index < -1 || index >= size) - return -1; - - // Needed for colors. - memcpy(sprite, image->getVertices(), sizeof(vertex)*4); - - // Transform. - Matrix t; - t.setTransformation(x, y, a, sx, sy, ox, oy, kx, ky); - t.transform(sprite, sprite, 4); - - if (color) - setColorv(sprite, *color); - - addv(sprite, (index == -1 ? next : index)); - - // Increment counter. - if (index == -1) - return next++; - return index; -} - -int SpriteBatch::addq(Quad *quad, float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index /*= -1*/) -{ - // Only do this if there's a free slot. - if ((index == -1 && next >= size) || index < -1 || index >= next) - return -1; - - // Needed for colors. - memcpy(sprite, quad->getVertices(), sizeof(vertex)*4); - - // Transform. - Matrix t; - t.setTransformation(x, y, a, sx, sy, ox, oy, kx, ky); - t.transform(sprite, sprite, 4); - - if (color) - setColorv(sprite, *color); - - addv(sprite, (index == -1 ? next : index)); - - // Increment counter. - if (index == -1) - return next++; - return index; -} - -void SpriteBatch::clear() -{ - // Reset the position of the next index. - next = 0; -} - -void *SpriteBatch::lock() -{ - VertexBuffer::Bind bind(*array_buf); - - return array_buf->map(); -} - -void SpriteBatch::unlock() -{ - VertexBuffer::Bind bind(*array_buf); - - array_buf->unmap(); -} - -void SpriteBatch::setImage(Image *newimage) -{ - image->release(); - image = newimage; - image->retain(); -} - -Image *SpriteBatch::getImage() -{ - return image; -} - -void SpriteBatch::setColor(const Color &color) -{ - if (!this->color) - this->color = new Color(color); - else - *(this->color) = color; -} - -void SpriteBatch::setColor() -{ - delete color; - color = 0; -} - -void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const -{ - const int color_offset = 0; - const int vertex_offset = sizeof(unsigned char) * 4; - const int texel_offset = sizeof(unsigned char) * 4 + sizeof(float) * 2; - - static Matrix t; - - glPushMatrix(); - - t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); - glMultMatrixf((const GLfloat *)t.getElements()); - - image->bind(); - - VertexBuffer::Bind array_bind(*array_buf); - VertexBuffer::Bind element_bind(*element_buf); - - // Apply per-sprite color, if a color is set. - if (color) - { - glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(vertex), array_buf->getPointer(color_offset)); - } - - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, GL_FLOAT, sizeof(vertex), array_buf->getPointer(vertex_offset)); - - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), array_buf->getPointer(texel_offset)); - - glDrawElements(GL_TRIANGLES, next*6, GL_UNSIGNED_SHORT, element_buf->getPointer(0)); - - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - - glPopMatrix(); -} - -void SpriteBatch::addv(const vertex *v, int index) -{ - int sprite_size = sizeof(vertex) * 4; - - VertexBuffer::Bind bind(*array_buf); - - array_buf->fill(index * sprite_size, sprite_size, v); -} - -void SpriteBatch::setColorv(vertex *v, const Color &color) -{ - v[0].r = color.r; - v[0].g = color.g; - v[0].b = color.b; - v[0].a = color.a; - v[1].r = color.r; - v[1].g = color.g; - v[1].b = color.b; - v[1].a = color.a; - v[2].r = color.r; - v[2].g = color.g; - v[2].b = color.b; - v[2].a = color.a; - v[3].r = color.r; - v[3].g = color.g; - v[3].b = color.b; - v[3].a = color.a; -} - -bool SpriteBatch::getConstant(const char *in, UsageHint &out) -{ - return usageHints.find(in, out); -} - -bool SpriteBatch::getConstant(UsageHint in, const char *&out) -{ - return usageHints.find(in, out); -} - -StringMap::Entry SpriteBatch::usageHintEntries[] = -{ - {"dynamic", SpriteBatch::USAGE_DYNAMIC}, - {"static", SpriteBatch::USAGE_STATIC}, - {"stream", SpriteBatch::USAGE_STREAM}, -}; - -StringMap SpriteBatch::usageHints(usageHintEntries, sizeof(usageHintEntries)); - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "SpriteBatch.h" + +// STD +#include + +// LOVE +#include "Image.h" +#include "Quad.h" +#include "VertexBuffer.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +SpriteBatch::SpriteBatch(Image *image, int size, int usage) + : image(image) + , size(size) + , next(0) + , color(0) + , array_buf(0) + , element_buf(0) +{ + image->retain(); + + GLenum gl_usage; + + switch (usage) + { + default: + case USAGE_DYNAMIC: + gl_usage = GL_DYNAMIC_DRAW; + break; + case USAGE_STATIC: + gl_usage = GL_STATIC_DRAW; + break; + case USAGE_STREAM: + gl_usage = GL_STREAM_DRAW; + break; + } + + int vertex_size = sizeof(vertex) * 4 * size; + int element_size = sizeof(GLushort) * 6 * size; + + array_buf = VertexBuffer::Create(vertex_size, GL_ARRAY_BUFFER, gl_usage); + element_buf = VertexBuffer::Create(element_size, GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW); + + // Fill element buffer. + { + VertexBuffer::Bind bind(*element_buf); + VertexBuffer::Mapper mapper(*element_buf); + + GLushort *indices = static_cast(mapper.get()); + + if (indices) + { + for (int i = 0; i < size; ++i) + { + indices[i*6+0] = 0+(i*4); + indices[i*6+1] = 1+(i*4); + indices[i*6+2] = 2+(i*4); + + indices[i*6+3] = 0+(i*4); + indices[i*6+4] = 2+(i*4); + indices[i*6+5] = 3+(i*4); + } + } + } +} + +SpriteBatch::~SpriteBatch() +{ + image->release(); + + delete color; + delete array_buf; + delete element_buf; +} + +int SpriteBatch::add(float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index /*= -1*/) +{ + // Only do this if there's a free slot. + if ((index == -1 && next >= size) || index < -1 || index >= size) + return -1; + + // Needed for colors. + memcpy(sprite, image->getVertices(), sizeof(vertex)*4); + + // Transform. + Matrix t; + t.setTransformation(x, y, a, sx, sy, ox, oy, kx, ky); + t.transform(sprite, sprite, 4); + + if (color) + setColorv(sprite, *color); + + addv(sprite, (index == -1 ? next : index)); + + // Increment counter. + if (index == -1) + return next++; + return index; +} + +int SpriteBatch::addq(Quad *quad, float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index /*= -1*/) +{ + // Only do this if there's a free slot. + if ((index == -1 && next >= size) || index < -1 || index >= next) + return -1; + + // Needed for colors. + memcpy(sprite, quad->getVertices(), sizeof(vertex)*4); + + // Transform. + Matrix t; + t.setTransformation(x, y, a, sx, sy, ox, oy, kx, ky); + t.transform(sprite, sprite, 4); + + if (color) + setColorv(sprite, *color); + + addv(sprite, (index == -1 ? next : index)); + + // Increment counter. + if (index == -1) + return next++; + return index; +} + +void SpriteBatch::clear() +{ + // Reset the position of the next index. + next = 0; +} + +void *SpriteBatch::lock() +{ + VertexBuffer::Bind bind(*array_buf); + + return array_buf->map(); +} + +void SpriteBatch::unlock() +{ + VertexBuffer::Bind bind(*array_buf); + + array_buf->unmap(); +} + +void SpriteBatch::setImage(Image *newimage) +{ + image->release(); + image = newimage; + image->retain(); +} + +Image *SpriteBatch::getImage() +{ + return image; +} + +void SpriteBatch::setColor(const Color &color) +{ + if (!this->color) + this->color = new Color(color); + else + *(this->color) = color; +} + +void SpriteBatch::setColor() +{ + delete color; + color = 0; +} + +void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const +{ + const int color_offset = 0; + const int vertex_offset = sizeof(unsigned char) * 4; + const int texel_offset = sizeof(unsigned char) * 4 + sizeof(float) * 2; + + static Matrix t; + + glPushMatrix(); + + t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky); + glMultMatrixf((const GLfloat *)t.getElements()); + + image->bind(); + + VertexBuffer::Bind array_bind(*array_buf); + VertexBuffer::Bind element_bind(*element_buf); + + // Apply per-sprite color, if a color is set. + if (color) + { + glEnableClientState(GL_COLOR_ARRAY); + glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(vertex), array_buf->getPointer(color_offset)); + } + + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(2, GL_FLOAT, sizeof(vertex), array_buf->getPointer(vertex_offset)); + + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), array_buf->getPointer(texel_offset)); + + glDrawElements(GL_TRIANGLES, next*6, GL_UNSIGNED_SHORT, element_buf->getPointer(0)); + + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + + glPopMatrix(); +} + +void SpriteBatch::addv(const vertex *v, int index) +{ + int sprite_size = sizeof(vertex) * 4; + + VertexBuffer::Bind bind(*array_buf); + + array_buf->fill(index * sprite_size, sprite_size, v); +} + +void SpriteBatch::setColorv(vertex *v, const Color &color) +{ + v[0].r = color.r; + v[0].g = color.g; + v[0].b = color.b; + v[0].a = color.a; + v[1].r = color.r; + v[1].g = color.g; + v[1].b = color.b; + v[1].a = color.a; + v[2].r = color.r; + v[2].g = color.g; + v[2].b = color.b; + v[2].a = color.a; + v[3].r = color.r; + v[3].g = color.g; + v[3].b = color.b; + v[3].a = color.a; +} + +bool SpriteBatch::getConstant(const char *in, UsageHint &out) +{ + return usageHints.find(in, out); +} + +bool SpriteBatch::getConstant(UsageHint in, const char *&out) +{ + return usageHints.find(in, out); +} + +StringMap::Entry SpriteBatch::usageHintEntries[] = +{ + {"dynamic", SpriteBatch::USAGE_DYNAMIC}, + {"static", SpriteBatch::USAGE_STATIC}, + {"stream", SpriteBatch::USAGE_STREAM}, +}; + +StringMap SpriteBatch::usageHints(usageHintEntries, sizeof(usageHintEntries)); + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/SpriteBatch.h b/src/modules/graphics/opengl/SpriteBatch.h index a69dbb486..497a21100 100644 --- a/src/modules/graphics/opengl/SpriteBatch.h +++ b/src/modules/graphics/opengl/SpriteBatch.h @@ -1,136 +1,136 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_SPRITE_BATCH_H -#define LOVE_GRAPHICS_OPENGL_SPRITE_BATCH_H - -// C -#include - -// LOVE -#include "common/math.h" -#include "common/Object.h" -#include "common/Vector.h" -#include "common/Matrix.h" -#include "common/StringMap.h" -#include "graphics/Drawable.h" -#include "graphics/Volatile.h" -#include "graphics/Color.h" - -// OpenGL -#include "GLee.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -// Forward declarations. -class Image; -class Quad; -class VertexBuffer; - -class SpriteBatch : public Drawable -{ -public: - - enum UsageHint - { - USAGE_DYNAMIC = 1, - USAGE_STATIC, - USAGE_STREAM, - USAGE_MAX_ENUM - }; - - SpriteBatch(Image *image, int size, int usage); - virtual ~SpriteBatch(); - - int add(float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index = -1); - int addq(Quad *quad, float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index = -1); - void clear(); - - void *lock(); - void unlock(); - - void setImage(Image *newimage); - Image *getImage(); - - /** - * Set the current color for this SpriteBatch. The geometry added - * after this call will use this color. Note that global color - * will not longer apply to the SpriteBatch if this is used. - * - * @param color The color to use for the following geometry. - */ - void setColor(const Color &color); - - /** - * Disable per-quad colors for this SpriteBatch. The next call to - * draw will use the global color for all sprites. - */ - void setColor(); - - // Implements Drawable. - void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; - - static bool getConstant(const char *in, UsageHint &out); - static bool getConstant(UsageHint in, const char *&out); - -private: - - void addv(const vertex *v, int index); - - /** - * Set the color for vertices. - * - * @param v The vertices to set the color for. Must be an array of - * of size 4. - * @param color The color to assign to each vertex. - */ - void setColorv(vertex *v, const Color &color); - - static StringMap::Entry usageHintEntries[]; - static StringMap usageHints; - - Image *image; - - // Max number of sprites in the batch. - int size; - - // The next free element. - int next; - - vertex sprite[4]; - - // Current color. This color, if present, will be applied to the next - // added quad. - Color *color; - - VertexBuffer *array_buf; - VertexBuffer *element_buf; -}; // SpriteBatch - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_SPRITE_BATCH_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_SPRITE_BATCH_H +#define LOVE_GRAPHICS_OPENGL_SPRITE_BATCH_H + +// C +#include + +// LOVE +#include "common/math.h" +#include "common/Object.h" +#include "common/Vector.h" +#include "common/Matrix.h" +#include "common/StringMap.h" +#include "graphics/Drawable.h" +#include "graphics/Volatile.h" +#include "graphics/Color.h" + +// OpenGL +#include "GLee.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +// Forward declarations. +class Image; +class Quad; +class VertexBuffer; + +class SpriteBatch : public Drawable +{ +public: + + enum UsageHint + { + USAGE_DYNAMIC = 1, + USAGE_STATIC, + USAGE_STREAM, + USAGE_MAX_ENUM + }; + + SpriteBatch(Image *image, int size, int usage); + virtual ~SpriteBatch(); + + int add(float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index = -1); + int addq(Quad *quad, float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index = -1); + void clear(); + + void *lock(); + void unlock(); + + void setImage(Image *newimage); + Image *getImage(); + + /** + * Set the current color for this SpriteBatch. The geometry added + * after this call will use this color. Note that global color + * will not longer apply to the SpriteBatch if this is used. + * + * @param color The color to use for the following geometry. + */ + void setColor(const Color &color); + + /** + * Disable per-quad colors for this SpriteBatch. The next call to + * draw will use the global color for all sprites. + */ + void setColor(); + + // Implements Drawable. + void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const; + + static bool getConstant(const char *in, UsageHint &out); + static bool getConstant(UsageHint in, const char *&out); + +private: + + void addv(const vertex *v, int index); + + /** + * Set the color for vertices. + * + * @param v The vertices to set the color for. Must be an array of + * of size 4. + * @param color The color to assign to each vertex. + */ + void setColorv(vertex *v, const Color &color); + + static StringMap::Entry usageHintEntries[]; + static StringMap usageHints; + + Image *image; + + // Max number of sprites in the batch. + int size; + + // The next free element. + int next; + + vertex sprite[4]; + + // Current color. This color, if present, will be applied to the next + // added quad. + Color *color; + + VertexBuffer *array_buf; + VertexBuffer *element_buf; +}; // SpriteBatch + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_SPRITE_BATCH_H diff --git a/src/modules/graphics/opengl/VertexBuffer.cpp b/src/modules/graphics/opengl/VertexBuffer.cpp index 6b6faf7d2..720603bb0 100644 --- a/src/modules/graphics/opengl/VertexBuffer.cpp +++ b/src/modules/graphics/opengl/VertexBuffer.cpp @@ -1,233 +1,233 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "VertexBuffer.h" - -#include "common/Exception.h" -#include "common/config.h" - -#include -#include - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -// VertexBuffer - -VertexBuffer *VertexBuffer::Create(size_t size, GLenum target, GLenum usage) -{ - try - { - // Try to create a VBO. - return new VBO(size, target, usage); - } - catch(const love::Exception &) - { - // VBO not supported ... create regular array. - return new VertexArray(size, target, usage); - } -} - -VertexBuffer::VertexBuffer(size_t size, GLenum target, GLenum usage) - : size(size) - , target(target) - , usage(usage) -{ -} - -VertexBuffer::~VertexBuffer() -{ -} - -// VertexArray - -VertexArray::VertexArray(size_t size, GLenum target, GLenum usage) - : VertexBuffer(size, target, usage) - , buf(new char[size]) -{ -} - -VertexArray::~VertexArray() -{ - delete [] buf; -} - -void *VertexArray::map() -{ - return buf; -} - -void VertexArray::unmap() -{ -} - -void VertexArray::bind() -{ -} - -void VertexArray::unbind() -{ -} - -void VertexArray::fill(size_t offset, size_t size, const void *data) -{ - memcpy(buf + offset, data, size); -} - -const void *VertexArray::getPointer(size_t offset) const -{ - return buf + offset; -} - -// VBO - -VBO::VBO(size_t size, GLenum target, GLenum usage) - : VertexBuffer(size, target, usage) - , vbo(0) - , buffer_copy(0) - , mapped(0) -{ - if (!(GLEE_ARB_vertex_buffer_object || GLEE_VERSION_1_5)) - throw love::Exception("Not supported"); - - bool ok = load(false); - - if (!ok) - throw love::Exception("Could not load VBO."); -} - -VBO::~VBO() -{ - if (vbo != 0) - unload(false); -} - -void *VBO::map() -{ - // mapping twice could result in memory leaks - if (mapped) - throw love::Exception("VBO is already mapped!"); - - mapped = malloc(getSize()); - if (!mapped) - throw love::Exception("Out of memory (oh the humanity!)"); - glGetBufferSubDataARB(getTarget(), 0, getSize(), mapped); - - return mapped; -} - -void VBO::unmap() -{ - glBufferSubDataARB(getTarget(), 0, getSize(), mapped); - free(mapped); - mapped = 0; -} - -void VBO::bind() -{ - glBindBufferARB(getTarget(), vbo); -} - -void VBO::unbind() -{ - glBindBufferARB(getTarget(), 0); -} - -void VBO::fill(size_t offset, size_t size, const void *data) -{ - if (mapped) - memcpy(static_cast(mapped) + offset, data, size); - else - glBufferSubDataARB(getTarget(), offset, size, data); -} - -const void *VBO::getPointer(size_t offset) const -{ - return reinterpret_cast(offset); -} - -bool VBO::loadVolatile() -{ - return load(true); -} - -void VBO::unloadVolatile() -{ - unload(true); -} - -bool VBO::load(bool restore) -{ - glGenBuffersARB(1, &vbo); - - VertexBuffer::Bind bind(*this); - - // Copy the old buffer only if 'restore' was requested. - const GLvoid *src = restore ? buffer_copy : 0; - - while (GL_NO_ERROR != glGetError()) - /* clear error messages */; - - // Note that if 'src' is '0', no data will be copied. - glBufferDataARB(getTarget(), getSize(), src, getUsage()); - GLenum err = glGetError(); - - // Clean up buffer_copy, if it exists. - delete[] buffer_copy; - buffer_copy = 0; - - return (GL_NO_ERROR == err); -} - -void VBO::unload(bool save) -{ - // Clean up buffer_copy, if it exists. - delete[] buffer_copy; - buffer_copy = 0; - - // Save data before unloading. - if (save) - { - VertexBuffer::Bind bind(*this); - - GLint size; - glGetBufferParameterivARB(getTarget(), GL_BUFFER_SIZE, &size); - - const char *src = static_cast(map()); - - if (src) - { - buffer_copy = new char[size]; - memcpy(buffer_copy, src, size); - unmap(); - } - } - - glDeleteBuffers(1, &vbo); - vbo = 0; -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "VertexBuffer.h" + +#include "common/Exception.h" +#include "common/config.h" + +#include +#include + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +// VertexBuffer + +VertexBuffer *VertexBuffer::Create(size_t size, GLenum target, GLenum usage) +{ + try + { + // Try to create a VBO. + return new VBO(size, target, usage); + } + catch(const love::Exception &) + { + // VBO not supported ... create regular array. + return new VertexArray(size, target, usage); + } +} + +VertexBuffer::VertexBuffer(size_t size, GLenum target, GLenum usage) + : size(size) + , target(target) + , usage(usage) +{ +} + +VertexBuffer::~VertexBuffer() +{ +} + +// VertexArray + +VertexArray::VertexArray(size_t size, GLenum target, GLenum usage) + : VertexBuffer(size, target, usage) + , buf(new char[size]) +{ +} + +VertexArray::~VertexArray() +{ + delete [] buf; +} + +void *VertexArray::map() +{ + return buf; +} + +void VertexArray::unmap() +{ +} + +void VertexArray::bind() +{ +} + +void VertexArray::unbind() +{ +} + +void VertexArray::fill(size_t offset, size_t size, const void *data) +{ + memcpy(buf + offset, data, size); +} + +const void *VertexArray::getPointer(size_t offset) const +{ + return buf + offset; +} + +// VBO + +VBO::VBO(size_t size, GLenum target, GLenum usage) + : VertexBuffer(size, target, usage) + , vbo(0) + , buffer_copy(0) + , mapped(0) +{ + if (!(GLEE_ARB_vertex_buffer_object || GLEE_VERSION_1_5)) + throw love::Exception("Not supported"); + + bool ok = load(false); + + if (!ok) + throw love::Exception("Could not load VBO."); +} + +VBO::~VBO() +{ + if (vbo != 0) + unload(false); +} + +void *VBO::map() +{ + // mapping twice could result in memory leaks + if (mapped) + throw love::Exception("VBO is already mapped!"); + + mapped = malloc(getSize()); + if (!mapped) + throw love::Exception("Out of memory (oh the humanity!)"); + glGetBufferSubDataARB(getTarget(), 0, getSize(), mapped); + + return mapped; +} + +void VBO::unmap() +{ + glBufferSubDataARB(getTarget(), 0, getSize(), mapped); + free(mapped); + mapped = 0; +} + +void VBO::bind() +{ + glBindBufferARB(getTarget(), vbo); +} + +void VBO::unbind() +{ + glBindBufferARB(getTarget(), 0); +} + +void VBO::fill(size_t offset, size_t size, const void *data) +{ + if (mapped) + memcpy(static_cast(mapped) + offset, data, size); + else + glBufferSubDataARB(getTarget(), offset, size, data); +} + +const void *VBO::getPointer(size_t offset) const +{ + return reinterpret_cast(offset); +} + +bool VBO::loadVolatile() +{ + return load(true); +} + +void VBO::unloadVolatile() +{ + unload(true); +} + +bool VBO::load(bool restore) +{ + glGenBuffersARB(1, &vbo); + + VertexBuffer::Bind bind(*this); + + // Copy the old buffer only if 'restore' was requested. + const GLvoid *src = restore ? buffer_copy : 0; + + while (GL_NO_ERROR != glGetError()) + /* clear error messages */; + + // Note that if 'src' is '0', no data will be copied. + glBufferDataARB(getTarget(), getSize(), src, getUsage()); + GLenum err = glGetError(); + + // Clean up buffer_copy, if it exists. + delete[] buffer_copy; + buffer_copy = 0; + + return (GL_NO_ERROR == err); +} + +void VBO::unload(bool save) +{ + // Clean up buffer_copy, if it exists. + delete[] buffer_copy; + buffer_copy = 0; + + // Save data before unloading. + if (save) + { + VertexBuffer::Bind bind(*this); + + GLint size; + glGetBufferParameterivARB(getTarget(), GL_BUFFER_SIZE, &size); + + const char *src = static_cast(map()); + + if (src) + { + buffer_copy = new char[size]; + memcpy(buffer_copy, src, size); + unmap(); + } + } + + glDeleteBuffers(1, &vbo); + vbo = 0; +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/VertexBuffer.h b/src/modules/graphics/opengl/VertexBuffer.h index 3f2a64d10..1c379f843 100644 --- a/src/modules/graphics/opengl/VertexBuffer.h +++ b/src/modules/graphics/opengl/VertexBuffer.h @@ -1,339 +1,339 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - - -#ifndef LOVE_GRAPHICS_OPENGL_VERTEX_BUFFER_H -#define LOVE_GRAPHICS_OPENGL_VERTEX_BUFFER_H - -// LOVE -#include "graphics/Volatile.h" - -// OpenGL -#include "GLee.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -/** - * VertexBuffer is an abstraction over VBOs (Vertex Buffer Objecys), which - * falls back to regular vertex arrays if VBOs are not supported. - * - * This allows code to take advantage of VBOs where available, but still - * work on older systems where it's *not* available. Everyone's happy. - * - * The class is (for now) meant for internal use. - */ -class VertexBuffer -{ -public: - - /** - * Create a new VertexBuffer (either a plain vertex array, or a VBO), - * based on what's supported on the system. - * - * If VBOs are not supported, a plain vertex array will automatically - * be created and returned instead. - * - * @param size The size of the VertexBuffer (in bytes). - * @param target GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER. - * @param usage GL_DYNAMIC_DRAW, etc. - * @return A new VertexBuffer. - */ - static VertexBuffer *Create(size_t size, GLenum target, GLenum usage); - - /** - * Constructor. - * - * @param size The size of the VertexBuffer in bytes. - * @param target The target VertexBuffer object, e.g. GL_ARRAY_BUFFER. - * @param usage Usage hint, e.g. GL_DYNAMIC_DRAW. - */ - VertexBuffer(size_t size, GLenum target, GLenum usage); - - /** - * Destructor. Does nothing, but must be declared virtual. - */ - virtual ~VertexBuffer(); - - /** - * Get the size of the VertexBuffer, in bytes. - * - * @return The size of the VertexBuffer. - */ - size_t getSize() const - { - return size; - } - - /** - * Get the target buffer object. - * - * @return The target buffer object, e.g. GL_ARRAY_BUFFER. - */ - GLenum getTarget() const - { - return target; - } - - /** - * Get the usage hint for this VertexBuffer. - * - * @return The usage hint, e.g. GL_DYNAMIC_DRAW. - */ - GLenum getUsage() const - { - return usage; - } - - /** - * Map the VertexBuffer to client memory. - * - * This can be faster for large changes to the buffer. For smaller - * changes, see fill(). - * - * The VertexBuffer must be bound to use this function. - * - * @return A pointer to memory which represents the buffer. - */ - virtual void *map() = 0; - - /** - * Unmap a previously mapped VertexBuffer. The buffer must be unmapped - * when used to draw elements. - * - * The VertexBuffer must be bound to use this function. - */ - virtual void unmap() = 0; - - /** - * Bind the VertexBuffer to the specified target. - * (GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER). - * - * @param target GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER. - */ - virtual void bind() = 0; - - /** - * Unbind a prevously bound VertexBuffer. - */ - virtual void unbind() = 0; - - /** - * Fill a portion of the buffer with data. - * - * The VertexBuffer must be bound to use this function. - * - * @param offset The offset in the VertexBuffer to store the data. - * @param size The size of the incoming data. - * @param data Pointer to memory to copy data from. - */ - virtual void fill(size_t offset, size_t size, const void *data) = 0; - - /** - * Get a pointer which represents the specified byte offset. - * - * @param offset The byte offset. (0 is first byte). - * @return A pointer which represents the offset. - */ - virtual const void *getPointer(size_t offset) const = 0; - - /** - * This helper class can bind a VertexArray temporarily, and - * automatically un-bind when it's destroyed. - */ - class Bind - { - public: - - /** - * Bind a VertexBuffer. - */ - Bind(VertexBuffer &buf) - : buf(buf) - { - buf.bind(); - } - - /** - * Unbinds a VertexBuffer. - */ - ~Bind() - { - buf.unbind(); - } - - private: - - // VertexBuffer to work on. - VertexBuffer &buf; - }; - - class Mapper - { - public: - /** - * Memory-maps a VertexBuffer. - */ - Mapper(VertexBuffer &buffer) - : buf(buffer) - { - elems = buf.map(); - } - - /** - * unmaps the buffer - */ - ~Mapper() - { - buf.unmap(); - } - - /** - * Get pointer to memory mapped region - */ - void *get() - { - return elems; - } - - private: - VertexBuffer &buf; - void *elems; - }; - -private: - - // The size of the buffer, in bytes. - size_t size; - - // The target buffer object. (GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER). - GLenum target; - - // Usage hint. GL_[DYNAMIC, STATIC, STREAM]_DRAW. - GLenum usage; -}; - -/** - * Implementation of VertexBuffer which uses plain arrays to store the data. - * - * This implementation should be supported everywhere, and acts as a fallback - * on systems which do not support VBOs. - */ -class VertexArray : public VertexBuffer -{ -public: - - /** - * @copydoc VertexBuffer(int, GLenum, GLenum) - */ - VertexArray(size_t size, GLenum target, GLenum usage); - - /** - * Frees the data we've allocated. - */ - virtual ~VertexArray(); - - // Implements VertexBuffer. - virtual void *map(); - virtual void unmap(); - virtual void bind(); - virtual void unbind(); - virtual void fill(size_t offset, size_t size, const void *data); - virtual const void *getPointer(size_t offset) const ; - -private: - // Holds the data. - char *buf; -}; - -/** - * Vertex Buffer Object (VBO) implementation of VertexBuffer. - * - * This will be used on all systems that support it. It's in general - * faster than vertex arrays, but especially in use-cases where there - * is no need to update the data every frame. - */ -class VBO : public VertexBuffer, public Volatile -{ -public: - - /** - * @copydoc VertexBuffer(size_t, GLenum, GLenum) - */ - VBO(size_t size, GLenum target, GLenum usage); - - /** - * Deletes the VBOs from OpenGL. - */ - virtual ~VBO(); - - // Implements VertexBuffer. - virtual void *map(); - virtual void unmap(); - virtual void bind(); - virtual void unbind(); - virtual void fill(size_t offset, size_t size, const void *data); - virtual const void *getPointer(size_t offset) const ; - - // Implements Volatile. - bool loadVolatile(); - void unloadVolatile(); - -private: - - /** - * Creates the VBO, and optionally restores data we saved earlier. - * - * @param restore True to restore data previously saved with 'unload'. - * @return True on success, false otherwise. - */ - bool load(bool restore); - - /** - * Optionally save the data in the VBO, then delete it. - * - * @param save True to save the data before deleting. - */ - void unload(bool save); - - // The VBO identifier. Assigned by OpenGL. - GLuint vbo; - - // *May* contain data saved by 'unload'. - char *buffer_copy; - - // A pointer to mapped memory. Zero if memory is currently - // not mapped. - void *mapped; - - // Usage hint for map()/unmap() pair. Same as `access' parameter in - // glBufferData or 0 if not mapped. - GLenum mapped_access; -}; - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_SPRITE_BATCH_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + + +#ifndef LOVE_GRAPHICS_OPENGL_VERTEX_BUFFER_H +#define LOVE_GRAPHICS_OPENGL_VERTEX_BUFFER_H + +// LOVE +#include "graphics/Volatile.h" + +// OpenGL +#include "GLee.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +/** + * VertexBuffer is an abstraction over VBOs (Vertex Buffer Objecys), which + * falls back to regular vertex arrays if VBOs are not supported. + * + * This allows code to take advantage of VBOs where available, but still + * work on older systems where it's *not* available. Everyone's happy. + * + * The class is (for now) meant for internal use. + */ +class VertexBuffer +{ +public: + + /** + * Create a new VertexBuffer (either a plain vertex array, or a VBO), + * based on what's supported on the system. + * + * If VBOs are not supported, a plain vertex array will automatically + * be created and returned instead. + * + * @param size The size of the VertexBuffer (in bytes). + * @param target GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER. + * @param usage GL_DYNAMIC_DRAW, etc. + * @return A new VertexBuffer. + */ + static VertexBuffer *Create(size_t size, GLenum target, GLenum usage); + + /** + * Constructor. + * + * @param size The size of the VertexBuffer in bytes. + * @param target The target VertexBuffer object, e.g. GL_ARRAY_BUFFER. + * @param usage Usage hint, e.g. GL_DYNAMIC_DRAW. + */ + VertexBuffer(size_t size, GLenum target, GLenum usage); + + /** + * Destructor. Does nothing, but must be declared virtual. + */ + virtual ~VertexBuffer(); + + /** + * Get the size of the VertexBuffer, in bytes. + * + * @return The size of the VertexBuffer. + */ + size_t getSize() const + { + return size; + } + + /** + * Get the target buffer object. + * + * @return The target buffer object, e.g. GL_ARRAY_BUFFER. + */ + GLenum getTarget() const + { + return target; + } + + /** + * Get the usage hint for this VertexBuffer. + * + * @return The usage hint, e.g. GL_DYNAMIC_DRAW. + */ + GLenum getUsage() const + { + return usage; + } + + /** + * Map the VertexBuffer to client memory. + * + * This can be faster for large changes to the buffer. For smaller + * changes, see fill(). + * + * The VertexBuffer must be bound to use this function. + * + * @return A pointer to memory which represents the buffer. + */ + virtual void *map() = 0; + + /** + * Unmap a previously mapped VertexBuffer. The buffer must be unmapped + * when used to draw elements. + * + * The VertexBuffer must be bound to use this function. + */ + virtual void unmap() = 0; + + /** + * Bind the VertexBuffer to the specified target. + * (GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER). + * + * @param target GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER. + */ + virtual void bind() = 0; + + /** + * Unbind a prevously bound VertexBuffer. + */ + virtual void unbind() = 0; + + /** + * Fill a portion of the buffer with data. + * + * The VertexBuffer must be bound to use this function. + * + * @param offset The offset in the VertexBuffer to store the data. + * @param size The size of the incoming data. + * @param data Pointer to memory to copy data from. + */ + virtual void fill(size_t offset, size_t size, const void *data) = 0; + + /** + * Get a pointer which represents the specified byte offset. + * + * @param offset The byte offset. (0 is first byte). + * @return A pointer which represents the offset. + */ + virtual const void *getPointer(size_t offset) const = 0; + + /** + * This helper class can bind a VertexArray temporarily, and + * automatically un-bind when it's destroyed. + */ + class Bind + { + public: + + /** + * Bind a VertexBuffer. + */ + Bind(VertexBuffer &buf) + : buf(buf) + { + buf.bind(); + } + + /** + * Unbinds a VertexBuffer. + */ + ~Bind() + { + buf.unbind(); + } + + private: + + // VertexBuffer to work on. + VertexBuffer &buf; + }; + + class Mapper + { + public: + /** + * Memory-maps a VertexBuffer. + */ + Mapper(VertexBuffer &buffer) + : buf(buffer) + { + elems = buf.map(); + } + + /** + * unmaps the buffer + */ + ~Mapper() + { + buf.unmap(); + } + + /** + * Get pointer to memory mapped region + */ + void *get() + { + return elems; + } + + private: + VertexBuffer &buf; + void *elems; + }; + +private: + + // The size of the buffer, in bytes. + size_t size; + + // The target buffer object. (GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER). + GLenum target; + + // Usage hint. GL_[DYNAMIC, STATIC, STREAM]_DRAW. + GLenum usage; +}; + +/** + * Implementation of VertexBuffer which uses plain arrays to store the data. + * + * This implementation should be supported everywhere, and acts as a fallback + * on systems which do not support VBOs. + */ +class VertexArray : public VertexBuffer +{ +public: + + /** + * @copydoc VertexBuffer(int, GLenum, GLenum) + */ + VertexArray(size_t size, GLenum target, GLenum usage); + + /** + * Frees the data we've allocated. + */ + virtual ~VertexArray(); + + // Implements VertexBuffer. + virtual void *map(); + virtual void unmap(); + virtual void bind(); + virtual void unbind(); + virtual void fill(size_t offset, size_t size, const void *data); + virtual const void *getPointer(size_t offset) const ; + +private: + // Holds the data. + char *buf; +}; + +/** + * Vertex Buffer Object (VBO) implementation of VertexBuffer. + * + * This will be used on all systems that support it. It's in general + * faster than vertex arrays, but especially in use-cases where there + * is no need to update the data every frame. + */ +class VBO : public VertexBuffer, public Volatile +{ +public: + + /** + * @copydoc VertexBuffer(size_t, GLenum, GLenum) + */ + VBO(size_t size, GLenum target, GLenum usage); + + /** + * Deletes the VBOs from OpenGL. + */ + virtual ~VBO(); + + // Implements VertexBuffer. + virtual void *map(); + virtual void unmap(); + virtual void bind(); + virtual void unbind(); + virtual void fill(size_t offset, size_t size, const void *data); + virtual const void *getPointer(size_t offset) const ; + + // Implements Volatile. + bool loadVolatile(); + void unloadVolatile(); + +private: + + /** + * Creates the VBO, and optionally restores data we saved earlier. + * + * @param restore True to restore data previously saved with 'unload'. + * @return True on success, false otherwise. + */ + bool load(bool restore); + + /** + * Optionally save the data in the VBO, then delete it. + * + * @param save True to save the data before deleting. + */ + void unload(bool save); + + // The VBO identifier. Assigned by OpenGL. + GLuint vbo; + + // *May* contain data saved by 'unload'. + char *buffer_copy; + + // A pointer to mapped memory. Zero if memory is currently + // not mapped. + void *mapped; + + // Usage hint for map()/unmap() pair. Same as `access' parameter in + // glBufferData or 0 if not mapped. + GLenum mapped_access; +}; + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_SPRITE_BATCH_H diff --git a/src/modules/graphics/opengl/wrap_Canvas.cpp b/src/modules/graphics/opengl/wrap_Canvas.cpp index 0a77c35f9..53d9ac637 100644 --- a/src/modules/graphics/opengl/wrap_Canvas.cpp +++ b/src/modules/graphics/opengl/wrap_Canvas.cpp @@ -1,205 +1,205 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Graphics.h" -#include "wrap_Canvas.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Canvas *luax_checkcanvas(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Canvas", GRAPHICS_CANVAS_T); -} - -int w_Canvas_renderTo(lua_State *L) -{ - // As startGrab() clears the framebuffer, better not allow - // grabbing inside another grabbing - if (Canvas::current != NULL) - { - Canvas::bindDefaultCanvas(); - return luaL_error(L, "Current render target not the default canvas!"); - } - - Canvas *canvas = luax_checkcanvas(L, 1); - if (!lua_isfunction(L, 2)) - return luaL_error(L, "Need a function to render to canvas."); - - canvas->startGrab(); - lua_settop(L, 2); // make sure the function is on top of the stack - lua_call(L, 0, 0); - canvas->stopGrab(); - - return 0; -} - -int w_Canvas_getImageData(lua_State *L) -{ - Canvas *canvas = luax_checkcanvas(L, 1); - love::image::Image *image = luax_getmodule(L, "image", MODULE_IMAGE_T); - love::image::ImageData *img = canvas->getImageData(image); - luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)img); - return 1; -} - -int w_Canvas_setFilter(lua_State *L) -{ - Canvas *canvas = luax_checkcanvas(L, 1); - const char *minstr = luaL_checkstring(L, 2); - const char *magstr = luaL_checkstring(L, 3); - - Image::Filter f; - if (!Image::getConstant(minstr, f.min)) - return luaL_error(L, "Invalid min filter mode: %s", minstr); - if (!Image::getConstant(magstr, f.mag)) - return luaL_error(L, "Invalid max filter mode: %s", magstr); - - canvas->setFilter(f); - return 0; -} - -int w_Canvas_getFilter(lua_State *L) -{ - Canvas *canvas = luax_checkcanvas(L, 1); - Image::Filter f = canvas->getFilter(); - - const char *minstr; - const char *magstr; - Image::getConstant(f.min, minstr); - Image::getConstant(f.mag, magstr); - - lua_pushstring(L, minstr); - lua_pushstring(L, magstr); - - return 2; -} - -int w_Canvas_setWrap(lua_State *L) -{ - Canvas *canvas = luax_checkcanvas(L, 1); - const char *wrap_s = luaL_checkstring(L, 2); - const char *wrap_t = luaL_checkstring(L, 3); - - Image::Wrap w; - if (!Image::getConstant(wrap_s, w.s)) - return luaL_error(L, "Invalid wrap mode: %s", wrap_s); - if (!Image::getConstant(wrap_t, w.t)) - return luaL_error(L, "Invalid wrap mode: %s", wrap_t); - - canvas->setWrap(w); - return 0; -} - -int w_Canvas_getWrap(lua_State *L) -{ - Canvas *canvas = luax_checkcanvas(L, 1); - Image::Wrap w = canvas->getWrap(); - - const char *wrap_s; - const char *wrap_t; - Image::getConstant(w.s, wrap_s); - Image::getConstant(w.t, wrap_t); - - lua_pushstring(L, wrap_s); - lua_pushstring(L, wrap_t); - - return 2; -} - -int w_Canvas_clear(lua_State *L) -{ - Canvas *canvas = luax_checkcanvas(L, 1); - Color c; - if (lua_isnoneornil(L, 2)) - { - c.r = 0; - c.g = 0; - c.b = 0; - c.a = 0; - } - else if (lua_istable(L, 2)) - { - lua_pushinteger(L, 1); - lua_gettable(L, 2); - c.r = (unsigned char)luaL_checkint(L, -1); - lua_pushinteger(L, 2); - lua_gettable(L, 2); - c.g = (unsigned char)luaL_checkint(L, -1); - lua_pushinteger(L, 3); - lua_gettable(L, 2); - c.b = (unsigned char)luaL_checkint(L, -1); - lua_pushinteger(L, 4); - lua_gettable(L, 2); - c.g = (unsigned char)luaL_optint(L, -1, 255); - lua_pop(L, 4); - } - else - { - c.r = (unsigned char)luaL_checkint(L, 2); - c.g = (unsigned char)luaL_checkint(L, 3); - c.b = (unsigned char)luaL_checkint(L, 4); - c.a = (unsigned char)luaL_optint(L, 5, 255); - } - canvas->clear(c); - - return 0; -} - -int w_Canvas_getWidth(lua_State *L) -{ - Canvas *canvas = luax_checkcanvas(L, 1); - lua_pushnumber(L, canvas->getWidth()); - return 1; -} - -int w_Canvas_getHeight(lua_State *L) -{ - Canvas *canvas = luax_checkcanvas(L, 1); - lua_pushnumber(L, canvas->getHeight()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "renderTo", w_Canvas_renderTo }, - { "getImageData", w_Canvas_getImageData }, - { "setFilter", w_Canvas_setFilter }, - { "getFilter", w_Canvas_getFilter }, - { "setWrap", w_Canvas_setWrap }, - { "getWrap", w_Canvas_getWrap }, - { "clear", w_Canvas_clear }, - { "getWidth", w_Canvas_getWidth }, - { "getHeight", w_Canvas_getHeight }, - { 0, 0 } -}; - -extern "C" int luaopen_canvas(lua_State *L) -{ - return luax_register_type(L, "Canvas", functions); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Graphics.h" +#include "wrap_Canvas.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Canvas *luax_checkcanvas(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Canvas", GRAPHICS_CANVAS_T); +} + +int w_Canvas_renderTo(lua_State *L) +{ + // As startGrab() clears the framebuffer, better not allow + // grabbing inside another grabbing + if (Canvas::current != NULL) + { + Canvas::bindDefaultCanvas(); + return luaL_error(L, "Current render target not the default canvas!"); + } + + Canvas *canvas = luax_checkcanvas(L, 1); + if (!lua_isfunction(L, 2)) + return luaL_error(L, "Need a function to render to canvas."); + + canvas->startGrab(); + lua_settop(L, 2); // make sure the function is on top of the stack + lua_call(L, 0, 0); + canvas->stopGrab(); + + return 0; +} + +int w_Canvas_getImageData(lua_State *L) +{ + Canvas *canvas = luax_checkcanvas(L, 1); + love::image::Image *image = luax_getmodule(L, "image", MODULE_IMAGE_T); + love::image::ImageData *img = canvas->getImageData(image); + luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)img); + return 1; +} + +int w_Canvas_setFilter(lua_State *L) +{ + Canvas *canvas = luax_checkcanvas(L, 1); + const char *minstr = luaL_checkstring(L, 2); + const char *magstr = luaL_checkstring(L, 3); + + Image::Filter f; + if (!Image::getConstant(minstr, f.min)) + return luaL_error(L, "Invalid min filter mode: %s", minstr); + if (!Image::getConstant(magstr, f.mag)) + return luaL_error(L, "Invalid max filter mode: %s", magstr); + + canvas->setFilter(f); + return 0; +} + +int w_Canvas_getFilter(lua_State *L) +{ + Canvas *canvas = luax_checkcanvas(L, 1); + Image::Filter f = canvas->getFilter(); + + const char *minstr; + const char *magstr; + Image::getConstant(f.min, minstr); + Image::getConstant(f.mag, magstr); + + lua_pushstring(L, minstr); + lua_pushstring(L, magstr); + + return 2; +} + +int w_Canvas_setWrap(lua_State *L) +{ + Canvas *canvas = luax_checkcanvas(L, 1); + const char *wrap_s = luaL_checkstring(L, 2); + const char *wrap_t = luaL_checkstring(L, 3); + + Image::Wrap w; + if (!Image::getConstant(wrap_s, w.s)) + return luaL_error(L, "Invalid wrap mode: %s", wrap_s); + if (!Image::getConstant(wrap_t, w.t)) + return luaL_error(L, "Invalid wrap mode: %s", wrap_t); + + canvas->setWrap(w); + return 0; +} + +int w_Canvas_getWrap(lua_State *L) +{ + Canvas *canvas = luax_checkcanvas(L, 1); + Image::Wrap w = canvas->getWrap(); + + const char *wrap_s; + const char *wrap_t; + Image::getConstant(w.s, wrap_s); + Image::getConstant(w.t, wrap_t); + + lua_pushstring(L, wrap_s); + lua_pushstring(L, wrap_t); + + return 2; +} + +int w_Canvas_clear(lua_State *L) +{ + Canvas *canvas = luax_checkcanvas(L, 1); + Color c; + if (lua_isnoneornil(L, 2)) + { + c.r = 0; + c.g = 0; + c.b = 0; + c.a = 0; + } + else if (lua_istable(L, 2)) + { + lua_pushinteger(L, 1); + lua_gettable(L, 2); + c.r = (unsigned char)luaL_checkint(L, -1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + c.g = (unsigned char)luaL_checkint(L, -1); + lua_pushinteger(L, 3); + lua_gettable(L, 2); + c.b = (unsigned char)luaL_checkint(L, -1); + lua_pushinteger(L, 4); + lua_gettable(L, 2); + c.g = (unsigned char)luaL_optint(L, -1, 255); + lua_pop(L, 4); + } + else + { + c.r = (unsigned char)luaL_checkint(L, 2); + c.g = (unsigned char)luaL_checkint(L, 3); + c.b = (unsigned char)luaL_checkint(L, 4); + c.a = (unsigned char)luaL_optint(L, 5, 255); + } + canvas->clear(c); + + return 0; +} + +int w_Canvas_getWidth(lua_State *L) +{ + Canvas *canvas = luax_checkcanvas(L, 1); + lua_pushnumber(L, canvas->getWidth()); + return 1; +} + +int w_Canvas_getHeight(lua_State *L) +{ + Canvas *canvas = luax_checkcanvas(L, 1); + lua_pushnumber(L, canvas->getHeight()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "renderTo", w_Canvas_renderTo }, + { "getImageData", w_Canvas_getImageData }, + { "setFilter", w_Canvas_setFilter }, + { "getFilter", w_Canvas_getFilter }, + { "setWrap", w_Canvas_setWrap }, + { "getWrap", w_Canvas_getWrap }, + { "clear", w_Canvas_clear }, + { "getWidth", w_Canvas_getWidth }, + { "getHeight", w_Canvas_getHeight }, + { 0, 0 } +}; + +extern "C" int luaopen_canvas(lua_State *L) +{ + return luax_register_type(L, "Canvas", functions); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/wrap_Canvas.h b/src/modules/graphics/opengl/wrap_Canvas.h index 70d9003de..20c70941a 100644 --- a/src/modules/graphics/opengl/wrap_Canvas.h +++ b/src/modules/graphics/opengl/wrap_Canvas.h @@ -1,52 +1,52 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_CANVAS_H -#define LOVE_GRAPHICS_OPENGL_WRAP_CANVAS_H - -// LOVE -#include "common/runtime.h" -#include "Canvas.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -//see Canvas.h -Canvas *luax_checkcanvas(lua_State *L, int idx); -int w_Canvas_renderTo(lua_State *L); -int w_Canvas_getImageData(lua_State *L); -int w_Canvas_setFilter(lua_State *L); -int w_Canvas_getFilter(lua_State *L); -int w_Canvas_setWrap(lua_State *L); -int w_Canvas_getWrap(lua_State *L); -int w_Canvas_clear(lua_State *L); -int w_Canvas_getWidth(lua_State *L); -int w_Canvas_getHeight(lua_State *L); -extern "C" int luaopen_canvas(lua_State *L); - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_WRAP_CANVAS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_WRAP_CANVAS_H +#define LOVE_GRAPHICS_OPENGL_WRAP_CANVAS_H + +// LOVE +#include "common/runtime.h" +#include "Canvas.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +//see Canvas.h +Canvas *luax_checkcanvas(lua_State *L, int idx); +int w_Canvas_renderTo(lua_State *L); +int w_Canvas_getImageData(lua_State *L); +int w_Canvas_setFilter(lua_State *L); +int w_Canvas_getFilter(lua_State *L); +int w_Canvas_setWrap(lua_State *L); +int w_Canvas_getWrap(lua_State *L); +int w_Canvas_clear(lua_State *L); +int w_Canvas_getWidth(lua_State *L); +int w_Canvas_getHeight(lua_State *L); +extern "C" int luaopen_canvas(lua_State *L); + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_WRAP_CANVAS_H diff --git a/src/modules/graphics/opengl/wrap_Font.cpp b/src/modules/graphics/opengl/wrap_Font.cpp index c244b51ee..21d0a0bb3 100644 --- a/src/modules/graphics/opengl/wrap_Font.cpp +++ b/src/modules/graphics/opengl/wrap_Font.cpp @@ -1,110 +1,110 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "wrap_Font.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Font *luax_checkfont(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Font", GRAPHICS_FONT_T); -} - -int w_Font_getHeight(lua_State *L) -{ - Font *t = luax_checkfont(L, 1); - lua_pushnumber(L, t->getHeight()); - return 1; -} - -int w_Font_getWidth(lua_State *L) -{ - Font *t = luax_checkfont(L, 1); - const char *str = luaL_checkstring(L, 2); - try - { - lua_pushinteger(L, t->getWidth(str)); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - return 1; -} - -int w_Font_getWrap(lua_State *L) -{ - Font *t = luax_checkfont(L, 1); - const char *str = luaL_checkstring(L, 2); - float wrap = (float) luaL_checknumber(L, 3); - int max_width = 0, numlines = 0; - try - { - std::vector lines = t->getWrap(str, wrap, &max_width); - numlines = lines.size(); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - lua_pushinteger(L, max_width); - lua_pushinteger(L, numlines); - return 2; -} - -int w_Font_setLineHeight(lua_State *L) -{ - Font *t = luax_checkfont(L, 1); - float h = (float)luaL_checknumber(L, 2); - t->setLineHeight(h); - return 0; -} - -int w_Font_getLineHeight(lua_State *L) -{ - Font *t = luax_checkfont(L, 1); - lua_pushnumber(L, t->getLineHeight()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "getHeight", w_Font_getHeight }, - { "getWidth", w_Font_getWidth }, - { "getWrap", w_Font_getWrap }, - { "setLineHeight", w_Font_setLineHeight }, - { "getLineHeight", w_Font_getLineHeight }, - { 0, 0 } -}; - -extern "C" int luaopen_font(lua_State *L) -{ - return luax_register_type(L, "Font", functions); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "wrap_Font.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Font *luax_checkfont(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Font", GRAPHICS_FONT_T); +} + +int w_Font_getHeight(lua_State *L) +{ + Font *t = luax_checkfont(L, 1); + lua_pushnumber(L, t->getHeight()); + return 1; +} + +int w_Font_getWidth(lua_State *L) +{ + Font *t = luax_checkfont(L, 1); + const char *str = luaL_checkstring(L, 2); + try + { + lua_pushinteger(L, t->getWidth(str)); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + return 1; +} + +int w_Font_getWrap(lua_State *L) +{ + Font *t = luax_checkfont(L, 1); + const char *str = luaL_checkstring(L, 2); + float wrap = (float) luaL_checknumber(L, 3); + int max_width = 0, numlines = 0; + try + { + std::vector lines = t->getWrap(str, wrap, &max_width); + numlines = lines.size(); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + lua_pushinteger(L, max_width); + lua_pushinteger(L, numlines); + return 2; +} + +int w_Font_setLineHeight(lua_State *L) +{ + Font *t = luax_checkfont(L, 1); + float h = (float)luaL_checknumber(L, 2); + t->setLineHeight(h); + return 0; +} + +int w_Font_getLineHeight(lua_State *L) +{ + Font *t = luax_checkfont(L, 1); + lua_pushnumber(L, t->getLineHeight()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "getHeight", w_Font_getHeight }, + { "getWidth", w_Font_getWidth }, + { "getWrap", w_Font_getWrap }, + { "setLineHeight", w_Font_setLineHeight }, + { "getLineHeight", w_Font_getLineHeight }, + { 0, 0 } +}; + +extern "C" int luaopen_font(lua_State *L) +{ + return luax_register_type(L, "Font", functions); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/wrap_Font.h b/src/modules/graphics/opengl/wrap_Font.h index d7f0e953e..452c24696 100644 --- a/src/modules/graphics/opengl/wrap_Font.h +++ b/src/modules/graphics/opengl/wrap_Font.h @@ -1,47 +1,47 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_FONT_H -#define LOVE_GRAPHICS_OPENGL_WRAP_FONT_H - -// LOVE -#include "common/runtime.h" -#include "Font.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Font *luax_checkfont(lua_State *L, int idx); -int w_Font_getHeight(lua_State *L); -int w_Font_getWidth(lua_State *L); -int w_Font_getWrap(lua_State *L); -int w_Font_setLineHeight(lua_State *L); -int w_Font_getLineHeight(lua_State *L); -extern "C" int luaopen_font(lua_State *L); - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_WRAP_FONT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_WRAP_FONT_H +#define LOVE_GRAPHICS_OPENGL_WRAP_FONT_H + +// LOVE +#include "common/runtime.h" +#include "Font.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Font *luax_checkfont(lua_State *L, int idx); +int w_Font_getHeight(lua_State *L); +int w_Font_getWidth(lua_State *L); +int w_Font_getWrap(lua_State *L); +int w_Font_setLineHeight(lua_State *L); +int w_Font_getLineHeight(lua_State *L); +extern "C" int luaopen_font(lua_State *L); + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_WRAP_FONT_H diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 7c4838b2a..e569926b6 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -1,1363 +1,1363 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Graphics.h" -#include "GLee.h" -#include "graphics/DrawQable.h" -#include "image/ImageData.h" -#include "font/Rasterizer.h" - -#include "scripts/graphics.lua.h" -#include - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -static Graphics *instance = 0; - -int w_checkMode(lua_State *L) -{ - int w = luaL_checkint(L, 1); - int h = luaL_checkint(L, 2); - bool fs = luax_toboolean(L, 3); - luax_pushboolean(L, instance->checkMode(w, h, fs)); - return 1; -} - -int w_setMode(lua_State *L) -{ - int w = luaL_checkint(L, 1); - int h = luaL_checkint(L, 2); - bool fs = luax_optboolean(L, 3, false); - bool vsync = luax_optboolean(L, 4, true); - int fsaa = luaL_optint(L, 5, 0); - luax_pushboolean(L, instance->setMode(w, h, fs, vsync, fsaa)); - return 1; -} - -int w_getMode(lua_State *L) -{ - int w, h, fsaa; - bool fs, vsync; - instance->getMode(w, h, fs, vsync, fsaa); - lua_pushnumber(L, w); - lua_pushnumber(L, h); - lua_pushboolean(L, fs); - lua_pushboolean(L, vsync); - lua_pushnumber(L, fsaa); - return 5; -} - -int w_toggleFullscreen(lua_State *L) -{ - luax_pushboolean(L, instance->toggleFullscreen()); - return 1; -} - -int w_reset(lua_State *) -{ - instance->reset(); - return 0; -} - -int w_clear(lua_State *) -{ - instance->clear(); - return 0; -} - -int w_present(lua_State *) -{ - instance->present(); - return 0; -} - -int w_setIcon(lua_State *L) -{ - Image *image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); - instance->setIcon(image); - return 0; -} - -int w_setCaption(lua_State *L) -{ - const char *str = luaL_checkstring(L, 1); - instance->setCaption(str); - return 0; -} - -int w_getCaption(lua_State *L) -{ - return instance->getCaption(L); -} - -int w_getWidth(lua_State *L) -{ - lua_pushnumber(L, instance->getWidth()); - return 1; -} - -int w_getHeight(lua_State *L) -{ - lua_pushnumber(L, instance->getHeight()); - return 1; -} - -int w_isCreated(lua_State *L) -{ - luax_pushboolean(L, instance->isCreated()); - return 1; -} - -int w_getModes(lua_State *L) -{ - return instance->getModes(L); -} - -int w_setScissor(lua_State *L) -{ - if (lua_gettop(L) == 0) - { - instance->setScissor(); - return 0; - } - - int x = luaL_checkint(L, 1); - int y = luaL_checkint(L, 2); - int w = luaL_checkint(L, 3); - int h = luaL_checkint(L, 4); - - if (w < 0 || h < 0) - return luaL_error(L, "Can't set scissor with negative width and/or height."); - - instance->setScissor(x, y, w, h); - return 0; -} - -int w_getScissor(lua_State *L) -{ - return instance->getScissor(L); -} - -int w_newStencil(lua_State *L) -{ - // just return the function - if (!lua_isfunction(L, 1)) - return luaL_typerror(L, 1, "function"); - lua_settop(L, 1); - return 1; -} - -static int setStencil(lua_State *L, bool invert) -{ - // no argument -> clear mask - if (lua_isnoneornil(L, 1)) - { - instance->discardStencil(); - return 0; - } - - if (!lua_isfunction(L, 1)) - return luaL_typerror(L, 1, "mask"); - - instance->defineStencil(); - lua_call(L, lua_gettop(L) - 1, 0); // call mask(...) - instance->useStencil(invert); - - return 0; -} - -int w_setStencil(lua_State *L) -{ - return setStencil(L, false); -} - -int w_setInvertedStencil(lua_State *L) -{ - return setStencil(L, true); -} - -int w_newImage(lua_State *L) -{ - // Convert to File, if necessary. - if (lua_isstring(L, 1)) - luax_convobj(L, 1, "filesystem", "newFile"); - - // Convert to ImageData, if necessary. - if (luax_istype(L, 1, FILESYSTEM_FILE_T)) - luax_convobj(L, 1, "image", "newImageData"); - - love::image::ImageData *data = luax_checktype(L, 1, "ImageData", IMAGE_IMAGE_DATA_T); - - // Create the image. - Image *image = 0; - try - { - image = instance->newImage(data); - } - catch(love::Exception &e) - { - luaL_error(L, e.what()); - } - - if (image == 0) - return luaL_error(L, "Could not load image."); - - - // Push the type. - luax_newtype(L, "Image", GRAPHICS_IMAGE_T, (void *)image); - - return 1; -} - -int w_newQuad(lua_State *L) -{ - float x = (float) luaL_checknumber(L, 1); - float y = (float) luaL_checknumber(L, 2); - float w = (float) luaL_checknumber(L, 3); - float h = (float) luaL_checknumber(L, 4); - float sw = (float) luaL_checknumber(L, 5); - float sh = (float) luaL_checknumber(L, 6); - - Quad *frame = instance->newQuad(x, y, w, h, sw, sh); - - if (frame == 0) - return luaL_error(L, "Could not create frame."); - - luax_newtype(L, "Quad", GRAPHICS_QUAD_T, (void *)frame); - return 1; -} - -int w_newFont1(lua_State *L) -{ - Data *font_data = NULL; - // Convert to File, if necessary. - if (lua_isstring(L, 1)) - luax_convobj(L, 1, "filesystem", "newFile"); - - // Convert to Data, if necessary. - if (luax_istype(L, 1, FILESYSTEM_FILE_T)) - { - love::filesystem::File *f = luax_checktype(L, 1, "File", FILESYSTEM_FILE_T); - try - { - font_data = f->read(); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - lua_remove(L, 1); // get rid of the file - luax_newtype(L, "Data", DATA_T, (void *)font_data); - lua_insert(L, 1); // put it at the bottom of the stack - } - - // Convert to Rasterizer, if necessary. - if (luax_istype(L, 1, DATA_T)) - { - int idxs[] = {1, 2}; - luax_convobj(L, idxs, 2, "font", "newRasterizer"); - } - - if (font_data) - font_data->release(); - - love::font::Rasterizer *rasterizer = luax_checktype(L, 1, "Rasterizer", FONT_RASTERIZER_T); - - // Create the font. - Font *font = instance->newFont(rasterizer, instance->getDefaultImageFilter()); - - if (font == 0) - return luaL_error(L, "Could not load font."); - - // Push the type. - luax_newtype(L, "Font", GRAPHICS_FONT_T, (void *)font); - - return 1; -} - -int w_newImageFont(lua_State *L) -{ - // filter for glyphs, defaults to linear/linear - Image::Filter img_filter; - bool setFilter = false; - - // Convert to ImageData if necessary. - if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T) || (luax_istype(L, 1, DATA_T) && !luax_istype(L, 1, IMAGE_IMAGE_DATA_T))) - luax_convobj(L, 1, "image", "newImageData"); - else if (luax_istype(L, 1, GRAPHICS_IMAGE_T)) - { - Image *i = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); - img_filter = i->getFilter(); - setFilter = true; - love::image::ImageData *id = i->getData(); - luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)id, false); - lua_replace(L, 1); - } - - // Convert to Rasterizer if necessary. - if (luax_istype(L, 1, IMAGE_IMAGE_DATA_T)) - { - int idxs[] = {1, 2}; - luax_convobj(L, idxs, 2, "font", "newRasterizer"); - } - - love::font::Rasterizer *rasterizer = luax_checktype(L, 1, "Rasterizer", FONT_RASTERIZER_T); - - if (lua_isstring(L, 2) && lua_isstring(L, 3)) - { - Image::FilterMode min; - Image::FilterMode mag; - const char *minstr = luaL_checkstring(L, 2); - const char *magstr = luaL_checkstring(L, 3); - if (!Image::getConstant(minstr, min)) - return luaL_error(L, "Invalid filter mode: %s", minstr); - if (!Image::getConstant(magstr, mag)) - return luaL_error(L, "Invalid filter mode: %s", magstr); - - img_filter.min = min; - img_filter.mag = mag; - setFilter = true; - } - - if (!setFilter) - img_filter = instance->getDefaultImageFilter(); - - // Create the font. - Font *font = instance->newFont(rasterizer, img_filter); - - if (font == 0) - return luaL_error(L, "Could not load font."); - - // Push the type. - luax_newtype(L, "Font", GRAPHICS_FONT_T, (void *)font); - - return 1; -} - -int w_newSpriteBatch(lua_State *L) -{ - Image *image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); - int size = luaL_optint(L, 2, 1000); - SpriteBatch::UsageHint usage = SpriteBatch::USAGE_DYNAMIC; - if (lua_gettop(L) > 2) - { - if (!SpriteBatch::getConstant(luaL_checkstring(L, 3), usage)) - usage = SpriteBatch::USAGE_DYNAMIC; - } - SpriteBatch *t = NULL; - try - { - t = instance->newSpriteBatch(image, size, usage); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - luax_newtype(L, "SpriteBatch", GRAPHICS_SPRITE_BATCH_T, (void *)t); - return 1; -} - -int w_newParticleSystem(lua_State *L) -{ - Image *image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); - int size = luaL_checkint(L, 2); - ParticleSystem *t = instance->newParticleSystem(image, size); - luax_newtype(L, "ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_T, (void *)t); - return 1; -} - -int w_newCanvas(lua_State *L) -{ - // check if width and height are given. else default to screen dimensions. - int width = luaL_optint(L, 1, instance->getWidth()); - int height = luaL_optint(L, 2, instance->getHeight()); - glGetError(); // clear opengl error flag - - Canvas *canvas = NULL; - try - { - canvas = instance->newCanvas(width, height); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - - if (NULL == canvas) - return luaL_error(L, "Canvas not created, but no error thrown. I don't even..."); - - luax_newtype(L, "Canvas", GRAPHICS_CANVAS_T, (void *)canvas); - return 1; -} - -int w_newPixelEffect(lua_State *L) -{ - if (!PixelEffect::isSupported()) - return luaL_error(L, "Sorry, your graphics card does not support pixel effects."); - - try - { - luaL_checkstring(L, 1); - - luax_getfunction(L, "graphics", "_effectCodeToGLSL"); - lua_pushvalue(L, 1); - lua_pcall(L, 1, 1, 0); - - const char *code = lua_tostring(L, -1); - PixelEffect *effect = instance->newPixelEffect(code); - luax_newtype(L, "PixelEffect", GRAPHICS_PIXELEFFECT_T, (void *)effect); - } - catch(const love::Exception &e) - { - // memory is freed in Graphics::newPixelEffect - luax_getfunction(L, "graphics", "_transformGLSLErrorMessages"); - lua_pushstring(L, e.what()); - lua_pcall(L, 1,1, 0); - const char *err = lua_tostring(L, -1); - return luaL_error(L, "%s", err); - } - - return 1; -} - -int w_setColor(lua_State *L) -{ - Color c; - if (lua_istable(L, 1)) - { - lua_pushinteger(L, 1); - lua_gettable(L, -2); - c.r = (unsigned char)luaL_checkint(L, -1); - lua_pop(L, 1); - lua_pushinteger(L, 2); - lua_gettable(L, -2); - c.g = (unsigned char)luaL_checkint(L, -1); - lua_pop(L, 1); - lua_pushinteger(L, 3); - lua_gettable(L, -2); - c.b = (unsigned char)luaL_checkint(L, -1); - lua_pop(L, 1); - lua_pushinteger(L, 4); - lua_gettable(L, -2); - c.a = (unsigned char)luaL_optint(L, -1, 255); - lua_pop(L, 1); - } - else - { - c.r = (unsigned char)luaL_checkint(L, 1); - c.g = (unsigned char)luaL_checkint(L, 2); - c.b = (unsigned char)luaL_checkint(L, 3); - c.a = (unsigned char)luaL_optint(L, 4, 255); - } - instance->setColor(c); - return 0; -} - -int w_getColor(lua_State *L) -{ - Color c = instance->getColor(); - lua_pushinteger(L, c.r); - lua_pushinteger(L, c.g); - lua_pushinteger(L, c.b); - lua_pushinteger(L, c.a); - return 4; -} - -int w_setBackgroundColor(lua_State *L) -{ - Color c; - if (lua_istable(L, 1)) - { - lua_pushinteger(L, 1); - lua_gettable(L, -2); - c.r = (unsigned char)luaL_checkint(L, -1); - lua_pop(L, 1); - lua_pushinteger(L, 2); - lua_gettable(L, -2); - c.g = (unsigned char)luaL_checkint(L, -1); - lua_pop(L, 1); - lua_pushinteger(L, 3); - lua_gettable(L, -2); - c.b = (unsigned char)luaL_checkint(L, -1); - lua_pop(L, 1); - lua_pushinteger(L, 4); - lua_gettable(L, -2); - c.a = (unsigned char)luaL_optint(L, -1, 255); - lua_pop(L, 1); - } - else - { - c.r = (unsigned char)luaL_checkint(L, 1); - c.g = (unsigned char)luaL_checkint(L, 2); - c.b = (unsigned char)luaL_checkint(L, 3); - c.a = (unsigned char)luaL_optint(L, 4, 255); - } - instance->setBackgroundColor(c); - return 0; -} - -int w_getBackgroundColor(lua_State *L) -{ - Color c = instance->getBackgroundColor(); - lua_pushinteger(L, c.r); - lua_pushinteger(L, c.g); - lua_pushinteger(L, c.b); - lua_pushinteger(L, c.a); - return 4; -} - -int w_setFont(lua_State *L) -{ - Font *font = luax_checktype(L, 1, "Font", GRAPHICS_FONT_T); - instance->setFont(font); - return 0; -} - -int w_getFont(lua_State *L) -{ - Font *f = instance->getFont(); - - if (f == 0) - return 0; - - f->retain(); - luax_newtype(L, "Font", GRAPHICS_FONT_T, (void *)f); - return 1; -} - -int w_setBlendMode(lua_State *L) -{ - Graphics::BlendMode mode; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, mode)) - return luaL_error(L, "Invalid blend mode: %s", str); - - try - { - instance->setBlendMode(mode); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - return 0; -} - -int w_setColorMode(lua_State *L) -{ - Graphics::ColorMode mode; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, mode)) - return luaL_error(L, "Invalid color mode: %s", str); - - instance->setColorMode(mode); - return 0; -} - -int w_setDefaultImageFilter(lua_State *L) -{ - Image::FilterMode min; - Image::FilterMode mag; - const char *minstr = luaL_checkstring(L, 1); - const char *magstr = luaL_checkstring(L, 2); - if (!Image::getConstant(minstr, min)) - return luaL_error(L, "Invalid filter mode: %s", minstr); - if (!Image::getConstant(magstr, mag)) - return luaL_error(L, "Invalid filter mode: %s", magstr); - - Image::Filter f; - f.min = min; - f.mag = mag; - instance->setDefaultImageFilter(f); - - return 0; -} - -int w_getBlendMode(lua_State *L) -{ - Graphics::BlendMode mode = instance->getBlendMode(); - const char *str; - if (!Graphics::getConstant(mode, str)) - return luaL_error(L, "Invalid blend mode: %s", str); - - lua_pushstring(L, str); - return 1; -} - -int w_getColorMode(lua_State *L) -{ - Graphics::ColorMode mode = instance->getColorMode(); - const char *str; - if (!Graphics::getConstant(mode, str)) - return luaL_error(L, "Invalid color mode: %s", str); - - lua_pushstring(L, str); - return 1; -} - -int w_getDefaultImageFilter(lua_State *L) -{ - const Image::Filter &f = instance->getDefaultImageFilter(); - const char *minstr; - const char *magstr; - Image::getConstant(f.min, minstr); - Image::getConstant(f.mag, magstr); - lua_pushstring(L, minstr); - lua_pushstring(L, magstr); - return 2; -} - -int w_setLineWidth(lua_State *L) -{ - float width = (float)luaL_checknumber(L, 1); - instance->setLineWidth(width); - return 0; -} - -int w_setLineStyle(lua_State *L) -{ - Graphics::LineStyle style; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, style)) - return luaL_error(L, "Invalid line style: %s", str); - - instance->setLineStyle(style); - return 0; -} - -int w_setLine(lua_State *L) -{ - float width = (float)luaL_checknumber(L, 1); - - Graphics::LineStyle style = Graphics::LINE_SMOOTH; - - if (lua_gettop(L) >= 2) - { - const char *str = luaL_checkstring(L, 2); - if (!Graphics::getConstant(str, style)) - return luaL_error(L, "Invalid line style: %s", str); - } - - instance->setLine(width, style); - return 0; -} - -int w_getLineWidth(lua_State *L) -{ - lua_pushnumber(L, instance->getLineWidth()); - return 1; -} - -int w_getLineStyle(lua_State *L) -{ - Graphics::LineStyle style = instance->getLineStyle(); - const char *str; - Graphics::getConstant(style, str); - lua_pushstring(L, str); - return 1; -} - -int w_setPointSize(lua_State *L) -{ - float size = (float)luaL_checknumber(L, 1); - instance->setPointSize(size); - return 0; -} - -int w_setPointStyle(lua_State *L) -{ - Graphics::PointStyle style = Graphics::POINT_SMOOTH; - - if (lua_gettop(L) >= 2) - { - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, style)) - return luaL_error(L, "Invalid point style: %s", str); - } - - instance->setPointStyle(style); - return 0; -} - -int w_setPoint(lua_State *L) -{ - float size = (float)luaL_checknumber(L, 1); - - Graphics::PointStyle style; - const char *str = luaL_checkstring(L, 2); - if (!Graphics::getConstant(str, style)) - return luaL_error(L, "Invalid point style: %s", str); - - instance->setPoint(size, style); - return 0; -} - -int w_getPointSize(lua_State *L) -{ - lua_pushnumber(L, instance->getPointSize()); - return 1; -} - -int w_getPointStyle(lua_State *L) -{ - lua_pushinteger(L, instance->getPointStyle()); - return 1; -} - -int w_getMaxPointSize(lua_State *L) -{ - lua_pushnumber(L, instance->getMaxPointSize()); - return 1; -} - -int w_newScreenshot(lua_State *L) -{ - love::image::Image *image = luax_getmodule(L, "image", MODULE_IMAGE_T); - love::image::ImageData *i = instance->newScreenshot(image); - luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)i); - return 1; -} - -int w_setCanvas(lua_State *L) -{ - // discard stencil testing - instance->discardStencil(); - - // called with nil or none -> reset to default buffer - if (lua_isnoneornil(L,1)) - { - Canvas::bindDefaultCanvas(); - return 0; - } - - Canvas *canvas = luax_checkcanvas(L, 1); - // this unbinds the previous fbo - canvas->startGrab(); - - return 0; -} - -int w_getCanvas(lua_State *L) -{ - Canvas *canvas = Canvas::current; - if (canvas) - { - canvas->retain(); - luax_newtype(L, "Canvas", GRAPHICS_CANVAS_T, (void *) canvas); - } - else - lua_pushnil(L); - return 1; -} - -int w_setPixelEffect(lua_State *L) -{ - if (lua_isnoneornil(L,1)) - { - PixelEffect::detach(); - return 0; - } - - PixelEffect *effect = luax_checkpixeleffect(L, 1); - effect->attach(); - return 0; -} - -int w_getPixelEffect(lua_State *L) -{ - PixelEffect *effect = PixelEffect::current; - if (effect) - { - effect->retain(); - luax_newtype(L, "PixelEffect", GRAPHICS_PIXELEFFECT_T, (void *) effect); - } - else - lua_pushnil(L); - - return 1; -} - -int w_isSupported(lua_State *L) -{ - bool supported = true; - size_t len = lua_gettop(L); - Graphics::Support support; - for (unsigned int i = 1; i <= len; i++) - { - const char *str = luaL_checkstring(L, i); - if (!Graphics::getConstant(str, support)) - supported = false; - switch (support) - { - case Graphics::SUPPORT_CANVAS: - if (!Canvas::isSupported()) - supported = false; - break; - case Graphics::SUPPORT_PIXELEFFECT: - if (!PixelEffect::isSupported()) - supported = false; - break; - case Graphics::SUPPORT_NPOT: - if (!Image::hasNpot()) - supported = false; - break; - case Graphics::SUPPORT_SUBTRACTIVE: - supported = (GLEE_VERSION_1_4 || GLEE_ARB_imaging) || (GLEE_EXT_blend_minmax && GLEE_EXT_blend_subtract); - break; - default: - supported = false; - } - if (!supported) - break; - } - lua_pushboolean(L, supported); - return 1; -} - -/** - * Draws an Image at the specified coordinates, with rotation and - * scaling along both axes. - * @param x The x-coordinate. - * @param y The y-coordinate. - * @param angle The amount of rotation. - * @param sx The scale factor along the x-axis. (1 = normal). - * @param sy The scale factor along the y-axis. (1 = normal). - * @param ox The offset along the x-axis. - * @param oy The offset along the y-axis. - * @param kx Shear along the x-axis. - * @param ky Shear along the y-axis. - **/ -int w_draw(lua_State *L) -{ - Drawable *drawable = luax_checktype(L, 1, "Drawable", GRAPHICS_DRAWABLE_T); - float x = (float)luaL_optnumber(L, 2, 0.0f); - float y = (float)luaL_optnumber(L, 3, 0.0f); - float angle = (float)luaL_optnumber(L, 4, 0.0f); - float sx = (float)luaL_optnumber(L, 5, 1.0f); - float sy = (float)luaL_optnumber(L, 6, sx); - float ox = (float)luaL_optnumber(L, 7, 0); - float oy = (float)luaL_optnumber(L, 8, 0); - float kx = (float)luaL_optnumber(L, 9, 0); - float ky = (float)luaL_optnumber(L, 10, 0); - drawable->draw(x, y, angle, sx, sy, ox, oy, kx, ky); - return 0; -} - -/** - * Draws an Quad of a DrawQable at the specified coordinates, - * with rotation and scaling along both axes. - * - * @param q The Quad to draw. - * @param x The x-coordinate. - * @param y The y-coordinate. - * @param angle The amount of rotation. - * @param sx The scale factor along the x-axis. (1 = normal). - * @param sy The scale factor along the y-axis. (1 = normal). - * @param ox The offset along the x-axis. - * @param oy The offset along the y-axis. - * @param kx Shear along the x-axis. - * @param ky Shear along the y-axis. - **/ -int w_drawq(lua_State *L) -{ - DrawQable *dq = luax_checktype(L, 1, "DrawQable", GRAPHICS_DRAWQABLE_T); - Quad *q = luax_checkframe(L, 2); - float x = (float)luaL_checknumber(L, 3); - float y = (float)luaL_checknumber(L, 4); - float angle = (float)luaL_optnumber(L, 5, 0); - float sx = (float)luaL_optnumber(L, 6, 1); - float sy = (float)luaL_optnumber(L, 7, sx); - float ox = (float)luaL_optnumber(L, 8, 0); - float oy = (float)luaL_optnumber(L, 9, 0); - float kx = (float)luaL_optnumber(L, 10, 0); - float ky = (float)luaL_optnumber(L, 11, 0); - dq->drawq(q, x, y, angle, sx, sy, ox, oy, kx, ky); - return 0; -} - -int w_drawTest(lua_State *L) -{ - Image *image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); - float x = (float)luaL_optnumber(L, 2, 0.0f); - float y = (float)luaL_optnumber(L, 3, 0.0f); - float angle = (float)luaL_optnumber(L, 4, 0.0f); - float sx = (float)luaL_optnumber(L, 5, 1.0f); - float sy = (float)luaL_optnumber(L, 6, sx); - float ox = (float)luaL_optnumber(L, 7, 0); - float oy = (float)luaL_optnumber(L, 8, 0); - instance->drawTest(image, x, y, angle, sx, sy, ox, oy); - return 0; -} - -int w_print1(lua_State *L) -{ - const char *str = luaL_checkstring(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float angle = (float)luaL_optnumber(L, 4, 0.0f); - float sx = (float)luaL_optnumber(L, 5, 1.0f); - float sy = (float)luaL_optnumber(L, 6, sx); - float ox = (float)luaL_optnumber(L, 7, 0.0f); - float oy = (float)luaL_optnumber(L, 8, 0.0f); - float kx = (float)luaL_optnumber(L, 9, 0.0f); - float ky = (float)luaL_optnumber(L, 10, 0.0f); - try - { - instance->print(str, x, y, angle, sx, sy, ox, oy, kx,ky); - } - catch(love::Exception e) - { - return luaL_error(L, "Decoding error: %s", e.what()); - } - return 0; -} - -int w_printf1(lua_State *L) -{ - const char *str = luaL_checkstring(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float wrap = (float)luaL_checknumber(L, 4); - - Graphics::AlignMode align = Graphics::ALIGN_LEFT; - - if (lua_gettop(L) >= 5) - { - const char *str = luaL_checkstring(L, 5); - if (!Graphics::getConstant(str, align)) - return luaL_error(L, "Incorrect alignment: %s", str); - } - - try - { - instance->printf(str, x, y, wrap, align); - } - catch(love::Exception e) - { - return luaL_error(L, "Decoding error: %s", e.what()); - } - return 0; -} - -int w_point(lua_State *L) -{ - float x = (float)luaL_checknumber(L, 1); - float y = (float)luaL_checknumber(L, 2); - instance->point(x, y); - return 0; -} - -int w_line(lua_State *L) -{ - int args = lua_gettop(L); - bool is_table = false; - if (args == 1 && lua_istable(L, 1)) - { - args = lua_objlen(L, 1); - is_table = true; - } - if (args % 2 != 0) - return luaL_error(L, "Number of vertices must be a multiple of two"); - else if (args < 4) - return luaL_error(L, "Need at least two vertices to draw a line"); - - float *coords = new float[args]; - if (is_table) - { - for (int i = 0; i < args; ++i) - { - lua_pushnumber(L, i + 1); - lua_rawget(L, 1); - coords[i] = luax_tofloat(L, -1); - lua_pop(L, 1); - } - } - else - { - for (int i = 0; i < args; ++i) - coords[i] = luax_tofloat(L, i + 1); - } - - instance->polyline(coords, args); - - delete[] coords; - return 0; -} - -int w_triangle(lua_State *L) -{ - Graphics::DrawMode mode; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, mode)) - return luaL_error(L, "Incorrect draw mode %s", str); - - float x1 = (float)luaL_checknumber(L, 2); - float y1 = (float)luaL_checknumber(L, 3); - float x2 = (float)luaL_checknumber(L, 4); - float y2 = (float)luaL_checknumber(L, 5); - float x3 = (float)luaL_checknumber(L, 6); - float y3 = (float)luaL_checknumber(L, 7); - instance->triangle(mode, x1, y1, x2, y2, x3, y3); - return 0; -} - -int w_rectangle(lua_State *L) -{ - Graphics::DrawMode mode; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, mode)) - return luaL_error(L, "Incorrect draw mode %s", str); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float w = (float)luaL_checknumber(L, 4); - float h = (float)luaL_checknumber(L, 5); - instance->rectangle(mode, x, y, w, h); - return 0; -} - -int w_quad(lua_State *L) -{ - Graphics::DrawMode mode; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, mode)) - return luaL_error(L, "Incorrect draw mode %s", str); - - float x1 = (float)luaL_checknumber(L, 2); - float y1 = (float)luaL_checknumber(L, 3); - float x2 = (float)luaL_checknumber(L, 4); - float y2 = (float)luaL_checknumber(L, 5); - float x3 = (float)luaL_checknumber(L, 6); - float y3 = (float)luaL_checknumber(L, 7); - float x4 = (float)luaL_checknumber(L, 8); - float y4 = (float)luaL_checknumber(L, 9); - instance->quad(mode, x1, y1, x2, y2, x3, y3, x4, y4); - return 0; -} - -int w_circle(lua_State *L) -{ - Graphics::DrawMode mode; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, mode)) - return luaL_error(L, "Incorrect draw mode %s", str); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float radius = (float)luaL_checknumber(L, 4); - int points; - if (lua_isnoneornil(L, 5)) - points = radius > 10 ? (int)(radius) : 10; - else - points = luaL_checkint(L, 5); - - instance->circle(mode, x, y, radius, points); - return 0; -} - -int w_arc(lua_State *L) -{ - Graphics::DrawMode mode; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, mode)) - return luaL_error(L, "Incorrect draw mode %s", str); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float radius = (float)luaL_checknumber(L, 4); - float angle1 = (float)luaL_checknumber(L, 5); - float angle2 = (float)luaL_checknumber(L, 6); - int points; - if (lua_isnoneornil(L, 7)) - points = radius > 10 ? (int)(radius) : 10; - else - points = luaL_checkint(L, 7); - - instance->arc(mode, x, y, radius, angle1, angle2, points); - return 0; -} - -int w_polygon(lua_State *L) -{ - int args = lua_gettop(L) - 1; - - Graphics::DrawMode mode; - const char *str = luaL_checkstring(L, 1); - if (!Graphics::getConstant(str, mode)) - return luaL_error(L, "Invalid draw mode: %s", str); - - bool is_table = false; - float *coords; - if (args == 1 && lua_istable(L, 2)) - { - args = lua_objlen(L, 2); - is_table = true; - } - - if (args % 2 != 0) - return luaL_error(L, "Number of vertices must be a multiple of two"); - else if (args < 6) - return luaL_error(L, "Need at least three vertices to draw a polygon"); - - // fetch coords - coords = new float[args + 2]; - if (is_table) - { - for (int i = 0; i < args; ++i) - { - lua_pushnumber(L, i + 1); - lua_rawget(L, 2); - coords[i] = luax_tofloat(L, -1); - lua_pop(L, 1); - } - } - else - { - for (int i = 0; i < args; ++i) - coords[i] = luax_tofloat(L, i + 2); - } - - // make a closed loop - coords[args] = coords[0]; - coords[args+1] = coords[1]; - instance->polygon(mode, coords, args+2); - delete[] coords; - - return 0; -} - -int w_push(lua_State *L) -{ - try - { - instance->push(); - } - catch(love::Exception e) - { - return luaL_error(L, e.what()); - } - return 0; -} - -int w_pop(lua_State *L) -{ - try - { - instance->pop(); - } - catch(love::Exception e) - { - return luaL_error(L, e.what()); - } - return 0; -} - -int w_rotate(lua_State *L) -{ - float deg = (float)luaL_checknumber(L, 1); - instance->rotate(deg); - return 0; -} - -int w_scale(lua_State *L) -{ - float sx = (float)luaL_optnumber(L, 1, 1.0f); - float sy = (float)luaL_optnumber(L, 2, sx); - instance->scale(sx, sy); - return 0; -} - -int w_translate(lua_State *L) -{ - float x = (float)luaL_checknumber(L, 1); - float y = (float)luaL_checknumber(L, 2); - instance->translate(x, y); - return 0; -} - -int w_shear(lua_State *L) -{ - float kx = (float)luaL_checknumber(L, 1); - float ky = (float)luaL_checknumber(L, 2); - instance->shear(kx, ky); - return 0; -} - -int w_hasFocus(lua_State *L) -{ - luax_pushboolean(L, instance->hasFocus()); - return 1; -} - - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "checkMode", w_checkMode }, - { "setMode", w_setMode }, - { "getMode", w_getMode }, - { "toggleFullscreen", w_toggleFullscreen }, - { "reset", w_reset }, - { "clear", w_clear }, - { "present", w_present }, - - { "newImage", w_newImage }, - { "newQuad", w_newQuad }, - { "newFont1", w_newFont1 }, - { "newImageFont", w_newImageFont }, - { "newSpriteBatch", w_newSpriteBatch }, - { "newParticleSystem", w_newParticleSystem }, - { "newCanvas", w_newCanvas }, - { "newPixelEffect", w_newPixelEffect }, - - { "setColor", w_setColor }, - { "getColor", w_getColor }, - { "setBackgroundColor", w_setBackgroundColor }, - { "getBackgroundColor", w_getBackgroundColor }, - - { "setFont", w_setFont }, - { "getFont", w_getFont }, - - { "setBlendMode", w_setBlendMode }, - { "setColorMode", w_setColorMode }, - { "setDefaultImageFilter", w_setDefaultImageFilter }, - { "getBlendMode", w_getBlendMode }, - { "getColorMode", w_getColorMode }, - { "getDefaultImageFilter", w_getDefaultImageFilter }, - { "setLineWidth", w_setLineWidth }, - { "setLineStyle", w_setLineStyle }, - { "setLine", w_setLine }, - { "getLineWidth", w_getLineWidth }, - { "getLineStyle", w_getLineStyle }, - { "setPointSize", w_setPointSize }, - { "setPointStyle", w_setPointStyle }, - { "setPoint", w_setPoint }, - { "getPointSize", w_getPointSize }, - { "getPointStyle", w_getPointStyle }, - { "getMaxPointSize", w_getMaxPointSize }, - { "newScreenshot", w_newScreenshot }, - { "setCanvas", w_setCanvas }, - { "getCanvas", w_getCanvas }, - - { "setPixelEffect", w_setPixelEffect }, - { "getPixelEffect", w_getPixelEffect }, - - { "isSupported", w_isSupported }, - - { "draw", w_draw }, - { "drawq", w_drawq }, - { "drawTest", w_drawTest }, - - { "print1", w_print1 }, - { "printf1", w_printf1 }, - - { "setCaption", w_setCaption }, - { "getCaption", w_getCaption }, - - { "setIcon", w_setIcon }, - - { "getWidth", w_getWidth }, - { "getHeight", w_getHeight }, - - { "isCreated", w_isCreated }, - - { "getModes", w_getModes }, - - { "setScissor", w_setScissor }, - { "getScissor", w_getScissor }, - - { "newStencil", w_newStencil }, - { "setStencil", w_setStencil }, - { "setInvertedStencil", w_setInvertedStencil }, - - { "point", w_point }, - { "line", w_line }, - { "triangle", w_triangle }, - { "rectangle", w_rectangle }, - { "quad", w_quad }, - { "circle", w_circle }, - { "arc", w_arc }, - - { "polygon", w_polygon }, - - { "push", w_push }, - { "pop", w_pop }, - { "rotate", w_rotate }, - { "scale", w_scale }, - { "translate", w_translate }, - { "shear", w_shear }, - - { "hasFocus", w_hasFocus }, - - { 0, 0 } -}; - -// Types for this module. -static const lua_CFunction types[] = -{ - luaopen_font, - luaopen_image, - luaopen_frame, - luaopen_spritebatch, - luaopen_particlesystem, - luaopen_canvas, - luaopen_pixeleffect, - 0 -}; - -extern "C" int luaopen_love_graphics(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new Graphics(); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "graphics"; - w.flags = MODULE_T; - w.functions = functions; - w.types = types; - - int n = luax_register_module(L, w); - - if (luaL_loadbuffer(L, (const char *)graphics_lua, sizeof(graphics_lua), "graphics.lua") == 0) - lua_call(L, 0, 0); - - return n; -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Graphics.h" +#include "GLee.h" +#include "graphics/DrawQable.h" +#include "image/ImageData.h" +#include "font/Rasterizer.h" + +#include "scripts/graphics.lua.h" +#include + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +static Graphics *instance = 0; + +int w_checkMode(lua_State *L) +{ + int w = luaL_checkint(L, 1); + int h = luaL_checkint(L, 2); + bool fs = luax_toboolean(L, 3); + luax_pushboolean(L, instance->checkMode(w, h, fs)); + return 1; +} + +int w_setMode(lua_State *L) +{ + int w = luaL_checkint(L, 1); + int h = luaL_checkint(L, 2); + bool fs = luax_optboolean(L, 3, false); + bool vsync = luax_optboolean(L, 4, true); + int fsaa = luaL_optint(L, 5, 0); + luax_pushboolean(L, instance->setMode(w, h, fs, vsync, fsaa)); + return 1; +} + +int w_getMode(lua_State *L) +{ + int w, h, fsaa; + bool fs, vsync; + instance->getMode(w, h, fs, vsync, fsaa); + lua_pushnumber(L, w); + lua_pushnumber(L, h); + lua_pushboolean(L, fs); + lua_pushboolean(L, vsync); + lua_pushnumber(L, fsaa); + return 5; +} + +int w_toggleFullscreen(lua_State *L) +{ + luax_pushboolean(L, instance->toggleFullscreen()); + return 1; +} + +int w_reset(lua_State *) +{ + instance->reset(); + return 0; +} + +int w_clear(lua_State *) +{ + instance->clear(); + return 0; +} + +int w_present(lua_State *) +{ + instance->present(); + return 0; +} + +int w_setIcon(lua_State *L) +{ + Image *image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); + instance->setIcon(image); + return 0; +} + +int w_setCaption(lua_State *L) +{ + const char *str = luaL_checkstring(L, 1); + instance->setCaption(str); + return 0; +} + +int w_getCaption(lua_State *L) +{ + return instance->getCaption(L); +} + +int w_getWidth(lua_State *L) +{ + lua_pushnumber(L, instance->getWidth()); + return 1; +} + +int w_getHeight(lua_State *L) +{ + lua_pushnumber(L, instance->getHeight()); + return 1; +} + +int w_isCreated(lua_State *L) +{ + luax_pushboolean(L, instance->isCreated()); + return 1; +} + +int w_getModes(lua_State *L) +{ + return instance->getModes(L); +} + +int w_setScissor(lua_State *L) +{ + if (lua_gettop(L) == 0) + { + instance->setScissor(); + return 0; + } + + int x = luaL_checkint(L, 1); + int y = luaL_checkint(L, 2); + int w = luaL_checkint(L, 3); + int h = luaL_checkint(L, 4); + + if (w < 0 || h < 0) + return luaL_error(L, "Can't set scissor with negative width and/or height."); + + instance->setScissor(x, y, w, h); + return 0; +} + +int w_getScissor(lua_State *L) +{ + return instance->getScissor(L); +} + +int w_newStencil(lua_State *L) +{ + // just return the function + if (!lua_isfunction(L, 1)) + return luaL_typerror(L, 1, "function"); + lua_settop(L, 1); + return 1; +} + +static int setStencil(lua_State *L, bool invert) +{ + // no argument -> clear mask + if (lua_isnoneornil(L, 1)) + { + instance->discardStencil(); + return 0; + } + + if (!lua_isfunction(L, 1)) + return luaL_typerror(L, 1, "mask"); + + instance->defineStencil(); + lua_call(L, lua_gettop(L) - 1, 0); // call mask(...) + instance->useStencil(invert); + + return 0; +} + +int w_setStencil(lua_State *L) +{ + return setStencil(L, false); +} + +int w_setInvertedStencil(lua_State *L) +{ + return setStencil(L, true); +} + +int w_newImage(lua_State *L) +{ + // Convert to File, if necessary. + if (lua_isstring(L, 1)) + luax_convobj(L, 1, "filesystem", "newFile"); + + // Convert to ImageData, if necessary. + if (luax_istype(L, 1, FILESYSTEM_FILE_T)) + luax_convobj(L, 1, "image", "newImageData"); + + love::image::ImageData *data = luax_checktype(L, 1, "ImageData", IMAGE_IMAGE_DATA_T); + + // Create the image. + Image *image = 0; + try + { + image = instance->newImage(data); + } + catch(love::Exception &e) + { + luaL_error(L, e.what()); + } + + if (image == 0) + return luaL_error(L, "Could not load image."); + + + // Push the type. + luax_newtype(L, "Image", GRAPHICS_IMAGE_T, (void *)image); + + return 1; +} + +int w_newQuad(lua_State *L) +{ + float x = (float) luaL_checknumber(L, 1); + float y = (float) luaL_checknumber(L, 2); + float w = (float) luaL_checknumber(L, 3); + float h = (float) luaL_checknumber(L, 4); + float sw = (float) luaL_checknumber(L, 5); + float sh = (float) luaL_checknumber(L, 6); + + Quad *frame = instance->newQuad(x, y, w, h, sw, sh); + + if (frame == 0) + return luaL_error(L, "Could not create frame."); + + luax_newtype(L, "Quad", GRAPHICS_QUAD_T, (void *)frame); + return 1; +} + +int w_newFont1(lua_State *L) +{ + Data *font_data = NULL; + // Convert to File, if necessary. + if (lua_isstring(L, 1)) + luax_convobj(L, 1, "filesystem", "newFile"); + + // Convert to Data, if necessary. + if (luax_istype(L, 1, FILESYSTEM_FILE_T)) + { + love::filesystem::File *f = luax_checktype(L, 1, "File", FILESYSTEM_FILE_T); + try + { + font_data = f->read(); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + lua_remove(L, 1); // get rid of the file + luax_newtype(L, "Data", DATA_T, (void *)font_data); + lua_insert(L, 1); // put it at the bottom of the stack + } + + // Convert to Rasterizer, if necessary. + if (luax_istype(L, 1, DATA_T)) + { + int idxs[] = {1, 2}; + luax_convobj(L, idxs, 2, "font", "newRasterizer"); + } + + if (font_data) + font_data->release(); + + love::font::Rasterizer *rasterizer = luax_checktype(L, 1, "Rasterizer", FONT_RASTERIZER_T); + + // Create the font. + Font *font = instance->newFont(rasterizer, instance->getDefaultImageFilter()); + + if (font == 0) + return luaL_error(L, "Could not load font."); + + // Push the type. + luax_newtype(L, "Font", GRAPHICS_FONT_T, (void *)font); + + return 1; +} + +int w_newImageFont(lua_State *L) +{ + // filter for glyphs, defaults to linear/linear + Image::Filter img_filter; + bool setFilter = false; + + // Convert to ImageData if necessary. + if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T) || (luax_istype(L, 1, DATA_T) && !luax_istype(L, 1, IMAGE_IMAGE_DATA_T))) + luax_convobj(L, 1, "image", "newImageData"); + else if (luax_istype(L, 1, GRAPHICS_IMAGE_T)) + { + Image *i = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); + img_filter = i->getFilter(); + setFilter = true; + love::image::ImageData *id = i->getData(); + luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)id, false); + lua_replace(L, 1); + } + + // Convert to Rasterizer if necessary. + if (luax_istype(L, 1, IMAGE_IMAGE_DATA_T)) + { + int idxs[] = {1, 2}; + luax_convobj(L, idxs, 2, "font", "newRasterizer"); + } + + love::font::Rasterizer *rasterizer = luax_checktype(L, 1, "Rasterizer", FONT_RASTERIZER_T); + + if (lua_isstring(L, 2) && lua_isstring(L, 3)) + { + Image::FilterMode min; + Image::FilterMode mag; + const char *minstr = luaL_checkstring(L, 2); + const char *magstr = luaL_checkstring(L, 3); + if (!Image::getConstant(minstr, min)) + return luaL_error(L, "Invalid filter mode: %s", minstr); + if (!Image::getConstant(magstr, mag)) + return luaL_error(L, "Invalid filter mode: %s", magstr); + + img_filter.min = min; + img_filter.mag = mag; + setFilter = true; + } + + if (!setFilter) + img_filter = instance->getDefaultImageFilter(); + + // Create the font. + Font *font = instance->newFont(rasterizer, img_filter); + + if (font == 0) + return luaL_error(L, "Could not load font."); + + // Push the type. + luax_newtype(L, "Font", GRAPHICS_FONT_T, (void *)font); + + return 1; +} + +int w_newSpriteBatch(lua_State *L) +{ + Image *image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); + int size = luaL_optint(L, 2, 1000); + SpriteBatch::UsageHint usage = SpriteBatch::USAGE_DYNAMIC; + if (lua_gettop(L) > 2) + { + if (!SpriteBatch::getConstant(luaL_checkstring(L, 3), usage)) + usage = SpriteBatch::USAGE_DYNAMIC; + } + SpriteBatch *t = NULL; + try + { + t = instance->newSpriteBatch(image, size, usage); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + luax_newtype(L, "SpriteBatch", GRAPHICS_SPRITE_BATCH_T, (void *)t); + return 1; +} + +int w_newParticleSystem(lua_State *L) +{ + Image *image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); + int size = luaL_checkint(L, 2); + ParticleSystem *t = instance->newParticleSystem(image, size); + luax_newtype(L, "ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_T, (void *)t); + return 1; +} + +int w_newCanvas(lua_State *L) +{ + // check if width and height are given. else default to screen dimensions. + int width = luaL_optint(L, 1, instance->getWidth()); + int height = luaL_optint(L, 2, instance->getHeight()); + glGetError(); // clear opengl error flag + + Canvas *canvas = NULL; + try + { + canvas = instance->newCanvas(width, height); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + + if (NULL == canvas) + return luaL_error(L, "Canvas not created, but no error thrown. I don't even..."); + + luax_newtype(L, "Canvas", GRAPHICS_CANVAS_T, (void *)canvas); + return 1; +} + +int w_newPixelEffect(lua_State *L) +{ + if (!PixelEffect::isSupported()) + return luaL_error(L, "Sorry, your graphics card does not support pixel effects."); + + try + { + luaL_checkstring(L, 1); + + luax_getfunction(L, "graphics", "_effectCodeToGLSL"); + lua_pushvalue(L, 1); + lua_pcall(L, 1, 1, 0); + + const char *code = lua_tostring(L, -1); + PixelEffect *effect = instance->newPixelEffect(code); + luax_newtype(L, "PixelEffect", GRAPHICS_PIXELEFFECT_T, (void *)effect); + } + catch(const love::Exception &e) + { + // memory is freed in Graphics::newPixelEffect + luax_getfunction(L, "graphics", "_transformGLSLErrorMessages"); + lua_pushstring(L, e.what()); + lua_pcall(L, 1,1, 0); + const char *err = lua_tostring(L, -1); + return luaL_error(L, "%s", err); + } + + return 1; +} + +int w_setColor(lua_State *L) +{ + Color c; + if (lua_istable(L, 1)) + { + lua_pushinteger(L, 1); + lua_gettable(L, -2); + c.r = (unsigned char)luaL_checkint(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, -2); + c.g = (unsigned char)luaL_checkint(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 3); + lua_gettable(L, -2); + c.b = (unsigned char)luaL_checkint(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 4); + lua_gettable(L, -2); + c.a = (unsigned char)luaL_optint(L, -1, 255); + lua_pop(L, 1); + } + else + { + c.r = (unsigned char)luaL_checkint(L, 1); + c.g = (unsigned char)luaL_checkint(L, 2); + c.b = (unsigned char)luaL_checkint(L, 3); + c.a = (unsigned char)luaL_optint(L, 4, 255); + } + instance->setColor(c); + return 0; +} + +int w_getColor(lua_State *L) +{ + Color c = instance->getColor(); + lua_pushinteger(L, c.r); + lua_pushinteger(L, c.g); + lua_pushinteger(L, c.b); + lua_pushinteger(L, c.a); + return 4; +} + +int w_setBackgroundColor(lua_State *L) +{ + Color c; + if (lua_istable(L, 1)) + { + lua_pushinteger(L, 1); + lua_gettable(L, -2); + c.r = (unsigned char)luaL_checkint(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, -2); + c.g = (unsigned char)luaL_checkint(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 3); + lua_gettable(L, -2); + c.b = (unsigned char)luaL_checkint(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 4); + lua_gettable(L, -2); + c.a = (unsigned char)luaL_optint(L, -1, 255); + lua_pop(L, 1); + } + else + { + c.r = (unsigned char)luaL_checkint(L, 1); + c.g = (unsigned char)luaL_checkint(L, 2); + c.b = (unsigned char)luaL_checkint(L, 3); + c.a = (unsigned char)luaL_optint(L, 4, 255); + } + instance->setBackgroundColor(c); + return 0; +} + +int w_getBackgroundColor(lua_State *L) +{ + Color c = instance->getBackgroundColor(); + lua_pushinteger(L, c.r); + lua_pushinteger(L, c.g); + lua_pushinteger(L, c.b); + lua_pushinteger(L, c.a); + return 4; +} + +int w_setFont(lua_State *L) +{ + Font *font = luax_checktype(L, 1, "Font", GRAPHICS_FONT_T); + instance->setFont(font); + return 0; +} + +int w_getFont(lua_State *L) +{ + Font *f = instance->getFont(); + + if (f == 0) + return 0; + + f->retain(); + luax_newtype(L, "Font", GRAPHICS_FONT_T, (void *)f); + return 1; +} + +int w_setBlendMode(lua_State *L) +{ + Graphics::BlendMode mode; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, mode)) + return luaL_error(L, "Invalid blend mode: %s", str); + + try + { + instance->setBlendMode(mode); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + return 0; +} + +int w_setColorMode(lua_State *L) +{ + Graphics::ColorMode mode; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, mode)) + return luaL_error(L, "Invalid color mode: %s", str); + + instance->setColorMode(mode); + return 0; +} + +int w_setDefaultImageFilter(lua_State *L) +{ + Image::FilterMode min; + Image::FilterMode mag; + const char *minstr = luaL_checkstring(L, 1); + const char *magstr = luaL_checkstring(L, 2); + if (!Image::getConstant(minstr, min)) + return luaL_error(L, "Invalid filter mode: %s", minstr); + if (!Image::getConstant(magstr, mag)) + return luaL_error(L, "Invalid filter mode: %s", magstr); + + Image::Filter f; + f.min = min; + f.mag = mag; + instance->setDefaultImageFilter(f); + + return 0; +} + +int w_getBlendMode(lua_State *L) +{ + Graphics::BlendMode mode = instance->getBlendMode(); + const char *str; + if (!Graphics::getConstant(mode, str)) + return luaL_error(L, "Invalid blend mode: %s", str); + + lua_pushstring(L, str); + return 1; +} + +int w_getColorMode(lua_State *L) +{ + Graphics::ColorMode mode = instance->getColorMode(); + const char *str; + if (!Graphics::getConstant(mode, str)) + return luaL_error(L, "Invalid color mode: %s", str); + + lua_pushstring(L, str); + return 1; +} + +int w_getDefaultImageFilter(lua_State *L) +{ + const Image::Filter &f = instance->getDefaultImageFilter(); + const char *minstr; + const char *magstr; + Image::getConstant(f.min, minstr); + Image::getConstant(f.mag, magstr); + lua_pushstring(L, minstr); + lua_pushstring(L, magstr); + return 2; +} + +int w_setLineWidth(lua_State *L) +{ + float width = (float)luaL_checknumber(L, 1); + instance->setLineWidth(width); + return 0; +} + +int w_setLineStyle(lua_State *L) +{ + Graphics::LineStyle style; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, style)) + return luaL_error(L, "Invalid line style: %s", str); + + instance->setLineStyle(style); + return 0; +} + +int w_setLine(lua_State *L) +{ + float width = (float)luaL_checknumber(L, 1); + + Graphics::LineStyle style = Graphics::LINE_SMOOTH; + + if (lua_gettop(L) >= 2) + { + const char *str = luaL_checkstring(L, 2); + if (!Graphics::getConstant(str, style)) + return luaL_error(L, "Invalid line style: %s", str); + } + + instance->setLine(width, style); + return 0; +} + +int w_getLineWidth(lua_State *L) +{ + lua_pushnumber(L, instance->getLineWidth()); + return 1; +} + +int w_getLineStyle(lua_State *L) +{ + Graphics::LineStyle style = instance->getLineStyle(); + const char *str; + Graphics::getConstant(style, str); + lua_pushstring(L, str); + return 1; +} + +int w_setPointSize(lua_State *L) +{ + float size = (float)luaL_checknumber(L, 1); + instance->setPointSize(size); + return 0; +} + +int w_setPointStyle(lua_State *L) +{ + Graphics::PointStyle style = Graphics::POINT_SMOOTH; + + if (lua_gettop(L) >= 2) + { + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, style)) + return luaL_error(L, "Invalid point style: %s", str); + } + + instance->setPointStyle(style); + return 0; +} + +int w_setPoint(lua_State *L) +{ + float size = (float)luaL_checknumber(L, 1); + + Graphics::PointStyle style; + const char *str = luaL_checkstring(L, 2); + if (!Graphics::getConstant(str, style)) + return luaL_error(L, "Invalid point style: %s", str); + + instance->setPoint(size, style); + return 0; +} + +int w_getPointSize(lua_State *L) +{ + lua_pushnumber(L, instance->getPointSize()); + return 1; +} + +int w_getPointStyle(lua_State *L) +{ + lua_pushinteger(L, instance->getPointStyle()); + return 1; +} + +int w_getMaxPointSize(lua_State *L) +{ + lua_pushnumber(L, instance->getMaxPointSize()); + return 1; +} + +int w_newScreenshot(lua_State *L) +{ + love::image::Image *image = luax_getmodule(L, "image", MODULE_IMAGE_T); + love::image::ImageData *i = instance->newScreenshot(image); + luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)i); + return 1; +} + +int w_setCanvas(lua_State *L) +{ + // discard stencil testing + instance->discardStencil(); + + // called with nil or none -> reset to default buffer + if (lua_isnoneornil(L,1)) + { + Canvas::bindDefaultCanvas(); + return 0; + } + + Canvas *canvas = luax_checkcanvas(L, 1); + // this unbinds the previous fbo + canvas->startGrab(); + + return 0; +} + +int w_getCanvas(lua_State *L) +{ + Canvas *canvas = Canvas::current; + if (canvas) + { + canvas->retain(); + luax_newtype(L, "Canvas", GRAPHICS_CANVAS_T, (void *) canvas); + } + else + lua_pushnil(L); + return 1; +} + +int w_setPixelEffect(lua_State *L) +{ + if (lua_isnoneornil(L,1)) + { + PixelEffect::detach(); + return 0; + } + + PixelEffect *effect = luax_checkpixeleffect(L, 1); + effect->attach(); + return 0; +} + +int w_getPixelEffect(lua_State *L) +{ + PixelEffect *effect = PixelEffect::current; + if (effect) + { + effect->retain(); + luax_newtype(L, "PixelEffect", GRAPHICS_PIXELEFFECT_T, (void *) effect); + } + else + lua_pushnil(L); + + return 1; +} + +int w_isSupported(lua_State *L) +{ + bool supported = true; + size_t len = lua_gettop(L); + Graphics::Support support; + for (unsigned int i = 1; i <= len; i++) + { + const char *str = luaL_checkstring(L, i); + if (!Graphics::getConstant(str, support)) + supported = false; + switch (support) + { + case Graphics::SUPPORT_CANVAS: + if (!Canvas::isSupported()) + supported = false; + break; + case Graphics::SUPPORT_PIXELEFFECT: + if (!PixelEffect::isSupported()) + supported = false; + break; + case Graphics::SUPPORT_NPOT: + if (!Image::hasNpot()) + supported = false; + break; + case Graphics::SUPPORT_SUBTRACTIVE: + supported = (GLEE_VERSION_1_4 || GLEE_ARB_imaging) || (GLEE_EXT_blend_minmax && GLEE_EXT_blend_subtract); + break; + default: + supported = false; + } + if (!supported) + break; + } + lua_pushboolean(L, supported); + return 1; +} + +/** + * Draws an Image at the specified coordinates, with rotation and + * scaling along both axes. + * @param x The x-coordinate. + * @param y The y-coordinate. + * @param angle The amount of rotation. + * @param sx The scale factor along the x-axis. (1 = normal). + * @param sy The scale factor along the y-axis. (1 = normal). + * @param ox The offset along the x-axis. + * @param oy The offset along the y-axis. + * @param kx Shear along the x-axis. + * @param ky Shear along the y-axis. + **/ +int w_draw(lua_State *L) +{ + Drawable *drawable = luax_checktype(L, 1, "Drawable", GRAPHICS_DRAWABLE_T); + float x = (float)luaL_optnumber(L, 2, 0.0f); + float y = (float)luaL_optnumber(L, 3, 0.0f); + float angle = (float)luaL_optnumber(L, 4, 0.0f); + float sx = (float)luaL_optnumber(L, 5, 1.0f); + float sy = (float)luaL_optnumber(L, 6, sx); + float ox = (float)luaL_optnumber(L, 7, 0); + float oy = (float)luaL_optnumber(L, 8, 0); + float kx = (float)luaL_optnumber(L, 9, 0); + float ky = (float)luaL_optnumber(L, 10, 0); + drawable->draw(x, y, angle, sx, sy, ox, oy, kx, ky); + return 0; +} + +/** + * Draws an Quad of a DrawQable at the specified coordinates, + * with rotation and scaling along both axes. + * + * @param q The Quad to draw. + * @param x The x-coordinate. + * @param y The y-coordinate. + * @param angle The amount of rotation. + * @param sx The scale factor along the x-axis. (1 = normal). + * @param sy The scale factor along the y-axis. (1 = normal). + * @param ox The offset along the x-axis. + * @param oy The offset along the y-axis. + * @param kx Shear along the x-axis. + * @param ky Shear along the y-axis. + **/ +int w_drawq(lua_State *L) +{ + DrawQable *dq = luax_checktype(L, 1, "DrawQable", GRAPHICS_DRAWQABLE_T); + Quad *q = luax_checkframe(L, 2); + float x = (float)luaL_checknumber(L, 3); + float y = (float)luaL_checknumber(L, 4); + float angle = (float)luaL_optnumber(L, 5, 0); + float sx = (float)luaL_optnumber(L, 6, 1); + float sy = (float)luaL_optnumber(L, 7, sx); + float ox = (float)luaL_optnumber(L, 8, 0); + float oy = (float)luaL_optnumber(L, 9, 0); + float kx = (float)luaL_optnumber(L, 10, 0); + float ky = (float)luaL_optnumber(L, 11, 0); + dq->drawq(q, x, y, angle, sx, sy, ox, oy, kx, ky); + return 0; +} + +int w_drawTest(lua_State *L) +{ + Image *image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); + float x = (float)luaL_optnumber(L, 2, 0.0f); + float y = (float)luaL_optnumber(L, 3, 0.0f); + float angle = (float)luaL_optnumber(L, 4, 0.0f); + float sx = (float)luaL_optnumber(L, 5, 1.0f); + float sy = (float)luaL_optnumber(L, 6, sx); + float ox = (float)luaL_optnumber(L, 7, 0); + float oy = (float)luaL_optnumber(L, 8, 0); + instance->drawTest(image, x, y, angle, sx, sy, ox, oy); + return 0; +} + +int w_print1(lua_State *L) +{ + const char *str = luaL_checkstring(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float angle = (float)luaL_optnumber(L, 4, 0.0f); + float sx = (float)luaL_optnumber(L, 5, 1.0f); + float sy = (float)luaL_optnumber(L, 6, sx); + float ox = (float)luaL_optnumber(L, 7, 0.0f); + float oy = (float)luaL_optnumber(L, 8, 0.0f); + float kx = (float)luaL_optnumber(L, 9, 0.0f); + float ky = (float)luaL_optnumber(L, 10, 0.0f); + try + { + instance->print(str, x, y, angle, sx, sy, ox, oy, kx,ky); + } + catch(love::Exception e) + { + return luaL_error(L, "Decoding error: %s", e.what()); + } + return 0; +} + +int w_printf1(lua_State *L) +{ + const char *str = luaL_checkstring(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float wrap = (float)luaL_checknumber(L, 4); + + Graphics::AlignMode align = Graphics::ALIGN_LEFT; + + if (lua_gettop(L) >= 5) + { + const char *str = luaL_checkstring(L, 5); + if (!Graphics::getConstant(str, align)) + return luaL_error(L, "Incorrect alignment: %s", str); + } + + try + { + instance->printf(str, x, y, wrap, align); + } + catch(love::Exception e) + { + return luaL_error(L, "Decoding error: %s", e.what()); + } + return 0; +} + +int w_point(lua_State *L) +{ + float x = (float)luaL_checknumber(L, 1); + float y = (float)luaL_checknumber(L, 2); + instance->point(x, y); + return 0; +} + +int w_line(lua_State *L) +{ + int args = lua_gettop(L); + bool is_table = false; + if (args == 1 && lua_istable(L, 1)) + { + args = lua_objlen(L, 1); + is_table = true; + } + if (args % 2 != 0) + return luaL_error(L, "Number of vertices must be a multiple of two"); + else if (args < 4) + return luaL_error(L, "Need at least two vertices to draw a line"); + + float *coords = new float[args]; + if (is_table) + { + for (int i = 0; i < args; ++i) + { + lua_pushnumber(L, i + 1); + lua_rawget(L, 1); + coords[i] = luax_tofloat(L, -1); + lua_pop(L, 1); + } + } + else + { + for (int i = 0; i < args; ++i) + coords[i] = luax_tofloat(L, i + 1); + } + + instance->polyline(coords, args); + + delete[] coords; + return 0; +} + +int w_triangle(lua_State *L) +{ + Graphics::DrawMode mode; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, mode)) + return luaL_error(L, "Incorrect draw mode %s", str); + + float x1 = (float)luaL_checknumber(L, 2); + float y1 = (float)luaL_checknumber(L, 3); + float x2 = (float)luaL_checknumber(L, 4); + float y2 = (float)luaL_checknumber(L, 5); + float x3 = (float)luaL_checknumber(L, 6); + float y3 = (float)luaL_checknumber(L, 7); + instance->triangle(mode, x1, y1, x2, y2, x3, y3); + return 0; +} + +int w_rectangle(lua_State *L) +{ + Graphics::DrawMode mode; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, mode)) + return luaL_error(L, "Incorrect draw mode %s", str); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float w = (float)luaL_checknumber(L, 4); + float h = (float)luaL_checknumber(L, 5); + instance->rectangle(mode, x, y, w, h); + return 0; +} + +int w_quad(lua_State *L) +{ + Graphics::DrawMode mode; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, mode)) + return luaL_error(L, "Incorrect draw mode %s", str); + + float x1 = (float)luaL_checknumber(L, 2); + float y1 = (float)luaL_checknumber(L, 3); + float x2 = (float)luaL_checknumber(L, 4); + float y2 = (float)luaL_checknumber(L, 5); + float x3 = (float)luaL_checknumber(L, 6); + float y3 = (float)luaL_checknumber(L, 7); + float x4 = (float)luaL_checknumber(L, 8); + float y4 = (float)luaL_checknumber(L, 9); + instance->quad(mode, x1, y1, x2, y2, x3, y3, x4, y4); + return 0; +} + +int w_circle(lua_State *L) +{ + Graphics::DrawMode mode; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, mode)) + return luaL_error(L, "Incorrect draw mode %s", str); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float radius = (float)luaL_checknumber(L, 4); + int points; + if (lua_isnoneornil(L, 5)) + points = radius > 10 ? (int)(radius) : 10; + else + points = luaL_checkint(L, 5); + + instance->circle(mode, x, y, radius, points); + return 0; +} + +int w_arc(lua_State *L) +{ + Graphics::DrawMode mode; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, mode)) + return luaL_error(L, "Incorrect draw mode %s", str); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float radius = (float)luaL_checknumber(L, 4); + float angle1 = (float)luaL_checknumber(L, 5); + float angle2 = (float)luaL_checknumber(L, 6); + int points; + if (lua_isnoneornil(L, 7)) + points = radius > 10 ? (int)(radius) : 10; + else + points = luaL_checkint(L, 7); + + instance->arc(mode, x, y, radius, angle1, angle2, points); + return 0; +} + +int w_polygon(lua_State *L) +{ + int args = lua_gettop(L) - 1; + + Graphics::DrawMode mode; + const char *str = luaL_checkstring(L, 1); + if (!Graphics::getConstant(str, mode)) + return luaL_error(L, "Invalid draw mode: %s", str); + + bool is_table = false; + float *coords; + if (args == 1 && lua_istable(L, 2)) + { + args = lua_objlen(L, 2); + is_table = true; + } + + if (args % 2 != 0) + return luaL_error(L, "Number of vertices must be a multiple of two"); + else if (args < 6) + return luaL_error(L, "Need at least three vertices to draw a polygon"); + + // fetch coords + coords = new float[args + 2]; + if (is_table) + { + for (int i = 0; i < args; ++i) + { + lua_pushnumber(L, i + 1); + lua_rawget(L, 2); + coords[i] = luax_tofloat(L, -1); + lua_pop(L, 1); + } + } + else + { + for (int i = 0; i < args; ++i) + coords[i] = luax_tofloat(L, i + 2); + } + + // make a closed loop + coords[args] = coords[0]; + coords[args+1] = coords[1]; + instance->polygon(mode, coords, args+2); + delete[] coords; + + return 0; +} + +int w_push(lua_State *L) +{ + try + { + instance->push(); + } + catch(love::Exception e) + { + return luaL_error(L, e.what()); + } + return 0; +} + +int w_pop(lua_State *L) +{ + try + { + instance->pop(); + } + catch(love::Exception e) + { + return luaL_error(L, e.what()); + } + return 0; +} + +int w_rotate(lua_State *L) +{ + float deg = (float)luaL_checknumber(L, 1); + instance->rotate(deg); + return 0; +} + +int w_scale(lua_State *L) +{ + float sx = (float)luaL_optnumber(L, 1, 1.0f); + float sy = (float)luaL_optnumber(L, 2, sx); + instance->scale(sx, sy); + return 0; +} + +int w_translate(lua_State *L) +{ + float x = (float)luaL_checknumber(L, 1); + float y = (float)luaL_checknumber(L, 2); + instance->translate(x, y); + return 0; +} + +int w_shear(lua_State *L) +{ + float kx = (float)luaL_checknumber(L, 1); + float ky = (float)luaL_checknumber(L, 2); + instance->shear(kx, ky); + return 0; +} + +int w_hasFocus(lua_State *L) +{ + luax_pushboolean(L, instance->hasFocus()); + return 1; +} + + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "checkMode", w_checkMode }, + { "setMode", w_setMode }, + { "getMode", w_getMode }, + { "toggleFullscreen", w_toggleFullscreen }, + { "reset", w_reset }, + { "clear", w_clear }, + { "present", w_present }, + + { "newImage", w_newImage }, + { "newQuad", w_newQuad }, + { "newFont1", w_newFont1 }, + { "newImageFont", w_newImageFont }, + { "newSpriteBatch", w_newSpriteBatch }, + { "newParticleSystem", w_newParticleSystem }, + { "newCanvas", w_newCanvas }, + { "newPixelEffect", w_newPixelEffect }, + + { "setColor", w_setColor }, + { "getColor", w_getColor }, + { "setBackgroundColor", w_setBackgroundColor }, + { "getBackgroundColor", w_getBackgroundColor }, + + { "setFont", w_setFont }, + { "getFont", w_getFont }, + + { "setBlendMode", w_setBlendMode }, + { "setColorMode", w_setColorMode }, + { "setDefaultImageFilter", w_setDefaultImageFilter }, + { "getBlendMode", w_getBlendMode }, + { "getColorMode", w_getColorMode }, + { "getDefaultImageFilter", w_getDefaultImageFilter }, + { "setLineWidth", w_setLineWidth }, + { "setLineStyle", w_setLineStyle }, + { "setLine", w_setLine }, + { "getLineWidth", w_getLineWidth }, + { "getLineStyle", w_getLineStyle }, + { "setPointSize", w_setPointSize }, + { "setPointStyle", w_setPointStyle }, + { "setPoint", w_setPoint }, + { "getPointSize", w_getPointSize }, + { "getPointStyle", w_getPointStyle }, + { "getMaxPointSize", w_getMaxPointSize }, + { "newScreenshot", w_newScreenshot }, + { "setCanvas", w_setCanvas }, + { "getCanvas", w_getCanvas }, + + { "setPixelEffect", w_setPixelEffect }, + { "getPixelEffect", w_getPixelEffect }, + + { "isSupported", w_isSupported }, + + { "draw", w_draw }, + { "drawq", w_drawq }, + { "drawTest", w_drawTest }, + + { "print1", w_print1 }, + { "printf1", w_printf1 }, + + { "setCaption", w_setCaption }, + { "getCaption", w_getCaption }, + + { "setIcon", w_setIcon }, + + { "getWidth", w_getWidth }, + { "getHeight", w_getHeight }, + + { "isCreated", w_isCreated }, + + { "getModes", w_getModes }, + + { "setScissor", w_setScissor }, + { "getScissor", w_getScissor }, + + { "newStencil", w_newStencil }, + { "setStencil", w_setStencil }, + { "setInvertedStencil", w_setInvertedStencil }, + + { "point", w_point }, + { "line", w_line }, + { "triangle", w_triangle }, + { "rectangle", w_rectangle }, + { "quad", w_quad }, + { "circle", w_circle }, + { "arc", w_arc }, + + { "polygon", w_polygon }, + + { "push", w_push }, + { "pop", w_pop }, + { "rotate", w_rotate }, + { "scale", w_scale }, + { "translate", w_translate }, + { "shear", w_shear }, + + { "hasFocus", w_hasFocus }, + + { 0, 0 } +}; + +// Types for this module. +static const lua_CFunction types[] = +{ + luaopen_font, + luaopen_image, + luaopen_frame, + luaopen_spritebatch, + luaopen_particlesystem, + luaopen_canvas, + luaopen_pixeleffect, + 0 +}; + +extern "C" int luaopen_love_graphics(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new Graphics(); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "graphics"; + w.flags = MODULE_T; + w.functions = functions; + w.types = types; + + int n = luax_register_module(L, w); + + if (luaL_loadbuffer(L, (const char *)graphics_lua, sizeof(graphics_lua), "graphics.lua") == 0) + lua_call(L, 0, 0); + + return n; +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/wrap_Graphics.h b/src/modules/graphics/opengl/wrap_Graphics.h index 481300716..09603a471 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.h +++ b/src/modules/graphics/opengl/wrap_Graphics.h @@ -1,120 +1,120 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_GRAPHICS_H -#define LOVE_GRAPHICS_OPENGL_WRAP_GRAPHICS_H - -// LOVE -#include "wrap_Font.h" -#include "wrap_Image.h" -#include "wrap_Quad.h" -#include "wrap_SpriteBatch.h" -#include "wrap_ParticleSystem.h" -#include "wrap_Canvas.h" -#include "wrap_PixelEffect.h" -#include "Graphics.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -int w_checkMode(lua_State *L); -int w_setMode(lua_State *L); -int w_getMode(lua_State *L); -int w_toggleFullscreen(lua_State *L); -int w_reset(lua_State *L); -int w_clear(lua_State *L); -int w_present(lua_State *L); -int w_setIcon(lua_State *L); -int w_setCaption(lua_State *L); -int w_getCaption(lua_State *L); -int w_getWidth(lua_State *L); -int w_getHeight(lua_State *L); -int w_isCreated(lua_State *L); -int w_setScissor(lua_State *L); -int w_getScissor(lua_State *L); -int w_defineMask(lua_State *L); -int w_setMask(lua_State *L); -int w_newImage(lua_State *L); -int w_newQuad(lua_State *L); -int w_newFrame(lua_State *L); -int w_newFont1(lua_State *L); -int w_newImageFont(lua_State *L); -int w_newSpriteBatch(lua_State *L); -int w_newParticleSystem(lua_State *L); -int w_newCanvas(lua_State *L); // comments in function -int w_newPixelEffect(lua_State *L); -int w_setColor(lua_State *L); -int w_getColor(lua_State *L); -int w_setBackgroundColor(lua_State *L); -int w_getBackgroundColor(lua_State *L); -int w_setFont(lua_State *L); -int w_getFont(lua_State *L); -int w_setBlendMode(lua_State *L); -int w_setColorMode(lua_State *L); -int w_setDefaultImageFilter(lua_State *L); -int w_getBlendMode(lua_State *L); -int w_getColorMode(lua_State *L); -int w_getDefaultImageFilter(lua_State *L); -int w_setLineWidth(lua_State *L); -int w_setLineStyle(lua_State *L); -int w_setLine(lua_State *L); -int w_getLineWidth(lua_State *L); -int w_getLineStyle(lua_State *L); -int w_setPointSize(lua_State *L); -int w_setPointStyle(lua_State *L); -int w_setPoint(lua_State *L); -int w_getPointSize(lua_State *L); -int w_getPointStyle(lua_State *L); -int w_getMaxPointSize(lua_State *L); -int w_newScreenshot(lua_State *L); -int w_setCanvas(lua_State *L); -int w_getCanvas(lua_State *L); -int w_setPixelEffect(lua_State *L); -int w_isSupported(lua_State *L); -int w_draw(lua_State *L); -int w_drawq(lua_State *L); -int w_drawTest(lua_State *L); -int w_print1(lua_State *L); -int w_printf1(lua_State *L); -int w_point(lua_State *L); -int w_line(lua_State *L); -int w_triangle(lua_State *L); -int w_rectangle(lua_State *L); -int w_quad(lua_State *L); -int w_circle(lua_State *L); -int w_arc(lua_State *L); -int w_push(lua_State *L); -int w_pop(lua_State *L); -int w_rotate(lua_State *L); -int w_scale(lua_State *L); -int w_translate(lua_State *L); -int w_shear(lua_State *L); -int w_hasFocus(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_graphics(lua_State *L); - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_WRAP_GRAPHICS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_WRAP_GRAPHICS_H +#define LOVE_GRAPHICS_OPENGL_WRAP_GRAPHICS_H + +// LOVE +#include "wrap_Font.h" +#include "wrap_Image.h" +#include "wrap_Quad.h" +#include "wrap_SpriteBatch.h" +#include "wrap_ParticleSystem.h" +#include "wrap_Canvas.h" +#include "wrap_PixelEffect.h" +#include "Graphics.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +int w_checkMode(lua_State *L); +int w_setMode(lua_State *L); +int w_getMode(lua_State *L); +int w_toggleFullscreen(lua_State *L); +int w_reset(lua_State *L); +int w_clear(lua_State *L); +int w_present(lua_State *L); +int w_setIcon(lua_State *L); +int w_setCaption(lua_State *L); +int w_getCaption(lua_State *L); +int w_getWidth(lua_State *L); +int w_getHeight(lua_State *L); +int w_isCreated(lua_State *L); +int w_setScissor(lua_State *L); +int w_getScissor(lua_State *L); +int w_defineMask(lua_State *L); +int w_setMask(lua_State *L); +int w_newImage(lua_State *L); +int w_newQuad(lua_State *L); +int w_newFrame(lua_State *L); +int w_newFont1(lua_State *L); +int w_newImageFont(lua_State *L); +int w_newSpriteBatch(lua_State *L); +int w_newParticleSystem(lua_State *L); +int w_newCanvas(lua_State *L); // comments in function +int w_newPixelEffect(lua_State *L); +int w_setColor(lua_State *L); +int w_getColor(lua_State *L); +int w_setBackgroundColor(lua_State *L); +int w_getBackgroundColor(lua_State *L); +int w_setFont(lua_State *L); +int w_getFont(lua_State *L); +int w_setBlendMode(lua_State *L); +int w_setColorMode(lua_State *L); +int w_setDefaultImageFilter(lua_State *L); +int w_getBlendMode(lua_State *L); +int w_getColorMode(lua_State *L); +int w_getDefaultImageFilter(lua_State *L); +int w_setLineWidth(lua_State *L); +int w_setLineStyle(lua_State *L); +int w_setLine(lua_State *L); +int w_getLineWidth(lua_State *L); +int w_getLineStyle(lua_State *L); +int w_setPointSize(lua_State *L); +int w_setPointStyle(lua_State *L); +int w_setPoint(lua_State *L); +int w_getPointSize(lua_State *L); +int w_getPointStyle(lua_State *L); +int w_getMaxPointSize(lua_State *L); +int w_newScreenshot(lua_State *L); +int w_setCanvas(lua_State *L); +int w_getCanvas(lua_State *L); +int w_setPixelEffect(lua_State *L); +int w_isSupported(lua_State *L); +int w_draw(lua_State *L); +int w_drawq(lua_State *L); +int w_drawTest(lua_State *L); +int w_print1(lua_State *L); +int w_printf1(lua_State *L); +int w_point(lua_State *L); +int w_line(lua_State *L); +int w_triangle(lua_State *L); +int w_rectangle(lua_State *L); +int w_quad(lua_State *L); +int w_circle(lua_State *L); +int w_arc(lua_State *L); +int w_push(lua_State *L); +int w_pop(lua_State *L); +int w_rotate(lua_State *L); +int w_scale(lua_State *L); +int w_translate(lua_State *L); +int w_shear(lua_State *L); +int w_hasFocus(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_graphics(lua_State *L); + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_WRAP_GRAPHICS_H diff --git a/src/modules/graphics/opengl/wrap_Image.cpp b/src/modules/graphics/opengl/wrap_Image.cpp index e864fe529..fa09f000d 100644 --- a/src/modules/graphics/opengl/wrap_Image.cpp +++ b/src/modules/graphics/opengl/wrap_Image.cpp @@ -1,136 +1,136 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "wrap_Image.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Image *luax_checkimage(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Image", GRAPHICS_IMAGE_T); -} - -int w_Image_getWidth(lua_State *L) -{ - Image *t = luax_checkimage(L, 1); - lua_pushnumber(L, t->getWidth()); - return 1; -} - -int w_Image_getHeight(lua_State *L) -{ - Image *t = luax_checkimage(L, 1); - lua_pushnumber(L, t->getHeight()); - return 1; -} - -int w_Image_setFilter(lua_State *L) -{ - Image *t = luax_checkimage(L, 1); - Image::Filter f; - Image::FilterMode min; - Image::FilterMode mag; - const char *minstr = luaL_checkstring(L, 2); - const char *magstr = luaL_checkstring(L, 3); - if (!Image::getConstant(minstr, min)) - return luaL_error(L, "Invalid filter mode: %s", minstr); - if (!Image::getConstant(magstr, mag)) - return luaL_error(L, "Invalid filter mode: %s", magstr); - - f.min = min; - f.mag = mag; - t->setFilter(f); - return 0; -} - -int w_Image_getFilter(lua_State *L) -{ - Image *t = luax_checkimage(L, 1); - Image::Filter f = t->getFilter(); - Image::FilterMode min = f.min; - Image::FilterMode mag = f.mag; - const char *minstr; - const char *magstr; - Image::getConstant(min, minstr); - Image::getConstant(mag, magstr); - lua_pushstring(L, minstr); - lua_pushstring(L, magstr); - return 2; -} - -int w_Image_setWrap(lua_State *L) -{ - Image *i = luax_checkimage(L, 1); - Image::Wrap w; - Image::WrapMode s; - Image::WrapMode t; - const char *sstr = luaL_checkstring(L, 2); - const char *tstr = luaL_checkstring(L, 3); - if (!Image::getConstant(sstr, s)) - return luaL_error(L, "Invalid wrap mode: %s", sstr); - if (!Image::getConstant(tstr, t)) - return luaL_error(L, "Invalid wrap mode, %s", tstr); - - w.s = s; - w.t = t; - i->setWrap(w); - return 0; -} - -int w_Image_getWrap(lua_State *L) -{ - Image *i = luax_checkimage(L, 1); - Image::Wrap w = i->getWrap(); - Image::WrapMode s = w.s; - Image::WrapMode t = w.t; - const char *sstr; - const char *tstr; - Image::getConstant(s, sstr); - Image::getConstant(t, tstr); - lua_pushstring(L, sstr); - lua_pushstring(L, tstr); - return 2; -} - -static const luaL_Reg functions[] = -{ - { "getWidth", w_Image_getWidth }, - { "getHeight", w_Image_getHeight }, - { "setFilter", w_Image_setFilter }, - { "getFilter", w_Image_getFilter }, - { "setWrap", w_Image_setWrap }, - { "getWrap", w_Image_getWrap }, - { 0, 0 } -}; - -extern "C" int luaopen_image(lua_State *L) -{ - return luax_register_type(L, "Image", functions); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "wrap_Image.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Image *luax_checkimage(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Image", GRAPHICS_IMAGE_T); +} + +int w_Image_getWidth(lua_State *L) +{ + Image *t = luax_checkimage(L, 1); + lua_pushnumber(L, t->getWidth()); + return 1; +} + +int w_Image_getHeight(lua_State *L) +{ + Image *t = luax_checkimage(L, 1); + lua_pushnumber(L, t->getHeight()); + return 1; +} + +int w_Image_setFilter(lua_State *L) +{ + Image *t = luax_checkimage(L, 1); + Image::Filter f; + Image::FilterMode min; + Image::FilterMode mag; + const char *minstr = luaL_checkstring(L, 2); + const char *magstr = luaL_checkstring(L, 3); + if (!Image::getConstant(minstr, min)) + return luaL_error(L, "Invalid filter mode: %s", minstr); + if (!Image::getConstant(magstr, mag)) + return luaL_error(L, "Invalid filter mode: %s", magstr); + + f.min = min; + f.mag = mag; + t->setFilter(f); + return 0; +} + +int w_Image_getFilter(lua_State *L) +{ + Image *t = luax_checkimage(L, 1); + Image::Filter f = t->getFilter(); + Image::FilterMode min = f.min; + Image::FilterMode mag = f.mag; + const char *minstr; + const char *magstr; + Image::getConstant(min, minstr); + Image::getConstant(mag, magstr); + lua_pushstring(L, minstr); + lua_pushstring(L, magstr); + return 2; +} + +int w_Image_setWrap(lua_State *L) +{ + Image *i = luax_checkimage(L, 1); + Image::Wrap w; + Image::WrapMode s; + Image::WrapMode t; + const char *sstr = luaL_checkstring(L, 2); + const char *tstr = luaL_checkstring(L, 3); + if (!Image::getConstant(sstr, s)) + return luaL_error(L, "Invalid wrap mode: %s", sstr); + if (!Image::getConstant(tstr, t)) + return luaL_error(L, "Invalid wrap mode, %s", tstr); + + w.s = s; + w.t = t; + i->setWrap(w); + return 0; +} + +int w_Image_getWrap(lua_State *L) +{ + Image *i = luax_checkimage(L, 1); + Image::Wrap w = i->getWrap(); + Image::WrapMode s = w.s; + Image::WrapMode t = w.t; + const char *sstr; + const char *tstr; + Image::getConstant(s, sstr); + Image::getConstant(t, tstr); + lua_pushstring(L, sstr); + lua_pushstring(L, tstr); + return 2; +} + +static const luaL_Reg functions[] = +{ + { "getWidth", w_Image_getWidth }, + { "getHeight", w_Image_getHeight }, + { "setFilter", w_Image_setFilter }, + { "getFilter", w_Image_getFilter }, + { "setWrap", w_Image_setWrap }, + { "getWrap", w_Image_getWrap }, + { 0, 0 } +}; + +extern "C" int luaopen_image(lua_State *L) +{ + return luax_register_type(L, "Image", functions); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/wrap_Image.h b/src/modules/graphics/opengl/wrap_Image.h index 897d45f75..80e0fe96d 100644 --- a/src/modules/graphics/opengl/wrap_Image.h +++ b/src/modules/graphics/opengl/wrap_Image.h @@ -1,45 +1,45 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_IMAGE_H -#define LOVE_GRAPHICS_OPENGL_WRAP_IMAGE_H - -// LOVE -#include "common/runtime.h" -#include "Image.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Image *luax_checkimage(lua_State *L, int idx); -int w_Image_getWidth(lua_State *L); -int w_Image_getHeight(lua_State *L); -int w_Image_setFilter(lua_State *L); -extern "C" int luaopen_image(lua_State *L); - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_WRAP_IMAGE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_WRAP_IMAGE_H +#define LOVE_GRAPHICS_OPENGL_WRAP_IMAGE_H + +// LOVE +#include "common/runtime.h" +#include "Image.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Image *luax_checkimage(lua_State *L, int idx); +int w_Image_getWidth(lua_State *L); +int w_Image_getHeight(lua_State *L); +int w_Image_setFilter(lua_State *L); +extern "C" int luaopen_image(lua_State *L); + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_WRAP_IMAGE_H diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp index 32bfb5b2f..3054b32a5 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp @@ -1,416 +1,416 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_ParticleSystem.h" - -#include "common/Vector.h" - -#include - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -ParticleSystem *luax_checkparticlesystem(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_T); -} - -int w_ParticleSystem_setSprite(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - Image *i = luax_checkimage(L, 2); - t->setSprite(i); - return 0; -} - -int w_ParticleSystem_setBufferSize(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - int arg1 = luaL_checkint(L, 2); - t->setBufferSize((unsigned int)arg1); - return 0; -} - -int w_ParticleSystem_setEmissionRate(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - int arg1 = luaL_checkint(L, 2); - t->setEmissionRate((unsigned int)arg1); - return 0; -} - -int w_ParticleSystem_setLifetime(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setLifetime(arg1); - return 0; -} - -int w_ParticleSystem_setParticleLife(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_optnumber(L, 3, arg1); - t->setParticleLife(arg1, arg2); - return 0; -} - -int w_ParticleSystem_setPosition(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_checknumber(L, 3); - t->setPosition(arg1, arg2); - return 0; -} - -int w_ParticleSystem_setDirection(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setDirection(arg1); - return 0; -} - -int w_ParticleSystem_setSpread(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setSpread(arg1); - return 0; -} - -int w_ParticleSystem_setRelativeDirection(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - bool arg1 = (bool)luax_toboolean(L, 2); - t->setRelativeDirection(arg1); - return 0; -} - -int w_ParticleSystem_setSpeed(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_optnumber(L, 3, arg1); - t->setSpeed(arg1, arg2); - return 0; -} - -int w_ParticleSystem_setGravity(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_optnumber(L, 3, arg1); - t->setGravity(arg1, arg2); - return 0; -} - -int w_ParticleSystem_setRadialAcceleration(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_optnumber(L, 3, arg1); - t->setRadialAcceleration(arg1, arg2); - return 0; -} - -int w_ParticleSystem_setTangentialAcceleration(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_optnumber(L, 3, arg1); - t->setTangentialAcceleration(arg1, arg2); - return 0; -} - -int w_ParticleSystem_setSizes(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - size_t nSizes = lua_gettop(L) - 1; - - if (nSizes > 8) - return luaL_error(L, "At most eight (8) sizes may be used."); - - if (nSizes <= 1) - { - float size = luax_checkfloat(L, 2); - t->setSize(size); - } - else - { - std::vector sizes(nSizes); - for (size_t i = 0; i < nSizes; ++i) - sizes[i] = luax_checkfloat(L, 1 + i + 1); - - t->setSize(sizes); - } - return 0; -} - -int w_ParticleSystem_setSizeVariation(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setSizeVariation(arg1); - return 0; -} - -int w_ParticleSystem_setRotation(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_optnumber(L, 3, arg1); - t->setRotation(arg1, arg2); - return 0; -} - -int w_ParticleSystem_setSpin(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_optnumber(L, 3, arg1); - float arg3 = (float)luaL_optnumber(L, 4, 0); - t->setSpin(arg1, arg2, arg3); - return 0; -} - -int w_ParticleSystem_setSpinVariation(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setSpinVariation(arg1); - return 0; -} - -int w_ParticleSystem_setColors(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - int cargs = lua_gettop(L) - 1; - size_t nColors = (cargs + 3) / 4; // nColors = ceil(color_args / 4) - if (cargs % 4 != 0 || cargs == 0) - return luaL_error(L, "Expected red, green, blue, and alpha. Only got %d of 4 components.", cargs % 4); - - if (nColors > 8) - return luaL_error(L, "At most eight (8) colors may be used."); - - if (nColors == 1) - { - int r = luaL_checkint(L, 2); - int g = luaL_checkint(L, 3); - int b = luaL_checkint(L, 4); - int a = luaL_checkint(L, 5); - t->setColor(Color(r,g,b,a)); - } - else - { - std::vector colors(nColors); - for (size_t i = 0; i < nColors; ++i) - { - int r = luaL_checkint(L, 1 + i*4 + 1); - int g = luaL_checkint(L, 1 + i*4 + 2); - int b = luaL_checkint(L, 1 + i*4 + 3); - int a = luaL_checkint(L, 1 + i*4 + 4); - colors[i] = Color(r,g,b,a); - } - t->setColor(colors); - } - - return 0; -} - -int w_ParticleSystem_setOffset(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - t->setOffset(x, y); - return 0; -} - -int w_ParticleSystem_getX(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - lua_pushnumber(L, t->getX()); - return 1; -} - -int w_ParticleSystem_getY(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - lua_pushnumber(L, t->getY()); - return 1; -} - -int w_ParticleSystem_getPosition(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - const love::Vector &p = t->getPosition(); - lua_pushnumber(L, p.x); - lua_pushnumber(L, p.y); - return 2; -} - -int w_ParticleSystem_getDirection(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - lua_pushnumber(L, t->getDirection()); - return 1; -} - -int w_ParticleSystem_getSpread(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - lua_pushnumber(L, t->getSpread()); - return 1; -} - -int w_ParticleSystem_getOffsetX(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - lua_pushnumber(L, t->getOffsetX()); - return 1; -} - -int w_ParticleSystem_getOffsetY(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - lua_pushnumber(L, t->getOffsetY()); - return 1; -} - -int w_ParticleSystem_count(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - lua_pushnumber(L, t->count()); - return 1; -} - -int w_ParticleSystem_start(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - t->start(); - return 0; -} - -int w_ParticleSystem_stop(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - t->stop(); - return 0; -} - -int w_ParticleSystem_pause(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - t->pause(); - return 0; -} - -int w_ParticleSystem_reset(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - t->reset(); - return 0; -} - -int w_ParticleSystem_isActive(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - luax_pushboolean(L, t->isActive()); - return 1; -} - -int w_ParticleSystem_isEmpty(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - luax_pushboolean(L, t->isEmpty()); - return 1; -} - -int w_ParticleSystem_isFull(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - luax_pushboolean(L, t->isFull()); - return 1; -} - -int w_ParticleSystem_update(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - float dt = (float)luaL_checknumber(L, 2); - t->update(dt); - return 0; -} - -static const luaL_Reg functions[] = -{ - { "setSprite", w_ParticleSystem_setSprite }, - { "setBufferSize", w_ParticleSystem_setBufferSize }, - { "setEmissionRate", w_ParticleSystem_setEmissionRate }, - { "setLifetime", w_ParticleSystem_setLifetime }, - { "setParticleLife", w_ParticleSystem_setParticleLife }, - { "setPosition", w_ParticleSystem_setPosition }, - { "setDirection", w_ParticleSystem_setDirection }, - { "setSpread", w_ParticleSystem_setSpread }, - { "setRelativeDirection", w_ParticleSystem_setRelativeDirection }, - { "setSpeed", w_ParticleSystem_setSpeed }, - { "setGravity", w_ParticleSystem_setGravity }, - { "setRadialAcceleration", w_ParticleSystem_setRadialAcceleration }, - { "setTangentialAcceleration", w_ParticleSystem_setTangentialAcceleration }, - { "setSizes", w_ParticleSystem_setSizes }, - { "setSizeVariation", w_ParticleSystem_setSizeVariation }, - { "setRotation", w_ParticleSystem_setRotation }, - { "setSpin", w_ParticleSystem_setSpin }, - { "setSpinVariation", w_ParticleSystem_setSpinVariation }, - { "setColors", w_ParticleSystem_setColors }, - { "setOffset", w_ParticleSystem_setOffset }, - { "getX", w_ParticleSystem_getX }, - { "getY", w_ParticleSystem_getY }, - { "getPosition", w_ParticleSystem_getPosition }, - { "getDirection", w_ParticleSystem_getDirection }, - { "getSpread", w_ParticleSystem_getSpread }, - { "getOffsetX", w_ParticleSystem_getOffsetX }, - { "getOffsetY", w_ParticleSystem_getOffsetY }, - { "count", w_ParticleSystem_count }, - { "start", w_ParticleSystem_start }, - { "stop", w_ParticleSystem_stop }, - { "pause", w_ParticleSystem_pause }, - { "reset", w_ParticleSystem_reset }, - { "isActive", w_ParticleSystem_isActive }, - { "isEmpty", w_ParticleSystem_isEmpty }, - { "isFull", w_ParticleSystem_isFull }, - { "update", w_ParticleSystem_update }, - { 0, 0 } -}; - -extern "C" int luaopen_particlesystem(lua_State *L) -{ - return luax_register_type(L, "ParticleSystem", functions); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_ParticleSystem.h" + +#include "common/Vector.h" + +#include + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +ParticleSystem *luax_checkparticlesystem(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_T); +} + +int w_ParticleSystem_setSprite(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + Image *i = luax_checkimage(L, 2); + t->setSprite(i); + return 0; +} + +int w_ParticleSystem_setBufferSize(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + int arg1 = luaL_checkint(L, 2); + t->setBufferSize((unsigned int)arg1); + return 0; +} + +int w_ParticleSystem_setEmissionRate(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + int arg1 = luaL_checkint(L, 2); + t->setEmissionRate((unsigned int)arg1); + return 0; +} + +int w_ParticleSystem_setLifetime(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setLifetime(arg1); + return 0; +} + +int w_ParticleSystem_setParticleLife(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_optnumber(L, 3, arg1); + t->setParticleLife(arg1, arg2); + return 0; +} + +int w_ParticleSystem_setPosition(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_checknumber(L, 3); + t->setPosition(arg1, arg2); + return 0; +} + +int w_ParticleSystem_setDirection(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setDirection(arg1); + return 0; +} + +int w_ParticleSystem_setSpread(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setSpread(arg1); + return 0; +} + +int w_ParticleSystem_setRelativeDirection(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + bool arg1 = (bool)luax_toboolean(L, 2); + t->setRelativeDirection(arg1); + return 0; +} + +int w_ParticleSystem_setSpeed(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_optnumber(L, 3, arg1); + t->setSpeed(arg1, arg2); + return 0; +} + +int w_ParticleSystem_setGravity(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_optnumber(L, 3, arg1); + t->setGravity(arg1, arg2); + return 0; +} + +int w_ParticleSystem_setRadialAcceleration(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_optnumber(L, 3, arg1); + t->setRadialAcceleration(arg1, arg2); + return 0; +} + +int w_ParticleSystem_setTangentialAcceleration(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_optnumber(L, 3, arg1); + t->setTangentialAcceleration(arg1, arg2); + return 0; +} + +int w_ParticleSystem_setSizes(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + size_t nSizes = lua_gettop(L) - 1; + + if (nSizes > 8) + return luaL_error(L, "At most eight (8) sizes may be used."); + + if (nSizes <= 1) + { + float size = luax_checkfloat(L, 2); + t->setSize(size); + } + else + { + std::vector sizes(nSizes); + for (size_t i = 0; i < nSizes; ++i) + sizes[i] = luax_checkfloat(L, 1 + i + 1); + + t->setSize(sizes); + } + return 0; +} + +int w_ParticleSystem_setSizeVariation(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setSizeVariation(arg1); + return 0; +} + +int w_ParticleSystem_setRotation(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_optnumber(L, 3, arg1); + t->setRotation(arg1, arg2); + return 0; +} + +int w_ParticleSystem_setSpin(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_optnumber(L, 3, arg1); + float arg3 = (float)luaL_optnumber(L, 4, 0); + t->setSpin(arg1, arg2, arg3); + return 0; +} + +int w_ParticleSystem_setSpinVariation(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setSpinVariation(arg1); + return 0; +} + +int w_ParticleSystem_setColors(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + int cargs = lua_gettop(L) - 1; + size_t nColors = (cargs + 3) / 4; // nColors = ceil(color_args / 4) + if (cargs % 4 != 0 || cargs == 0) + return luaL_error(L, "Expected red, green, blue, and alpha. Only got %d of 4 components.", cargs % 4); + + if (nColors > 8) + return luaL_error(L, "At most eight (8) colors may be used."); + + if (nColors == 1) + { + int r = luaL_checkint(L, 2); + int g = luaL_checkint(L, 3); + int b = luaL_checkint(L, 4); + int a = luaL_checkint(L, 5); + t->setColor(Color(r,g,b,a)); + } + else + { + std::vector colors(nColors); + for (size_t i = 0; i < nColors; ++i) + { + int r = luaL_checkint(L, 1 + i*4 + 1); + int g = luaL_checkint(L, 1 + i*4 + 2); + int b = luaL_checkint(L, 1 + i*4 + 3); + int a = luaL_checkint(L, 1 + i*4 + 4); + colors[i] = Color(r,g,b,a); + } + t->setColor(colors); + } + + return 0; +} + +int w_ParticleSystem_setOffset(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + t->setOffset(x, y); + return 0; +} + +int w_ParticleSystem_getX(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + lua_pushnumber(L, t->getX()); + return 1; +} + +int w_ParticleSystem_getY(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + lua_pushnumber(L, t->getY()); + return 1; +} + +int w_ParticleSystem_getPosition(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + const love::Vector &p = t->getPosition(); + lua_pushnumber(L, p.x); + lua_pushnumber(L, p.y); + return 2; +} + +int w_ParticleSystem_getDirection(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + lua_pushnumber(L, t->getDirection()); + return 1; +} + +int w_ParticleSystem_getSpread(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + lua_pushnumber(L, t->getSpread()); + return 1; +} + +int w_ParticleSystem_getOffsetX(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + lua_pushnumber(L, t->getOffsetX()); + return 1; +} + +int w_ParticleSystem_getOffsetY(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + lua_pushnumber(L, t->getOffsetY()); + return 1; +} + +int w_ParticleSystem_count(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + lua_pushnumber(L, t->count()); + return 1; +} + +int w_ParticleSystem_start(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + t->start(); + return 0; +} + +int w_ParticleSystem_stop(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + t->stop(); + return 0; +} + +int w_ParticleSystem_pause(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + t->pause(); + return 0; +} + +int w_ParticleSystem_reset(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + t->reset(); + return 0; +} + +int w_ParticleSystem_isActive(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + luax_pushboolean(L, t->isActive()); + return 1; +} + +int w_ParticleSystem_isEmpty(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + luax_pushboolean(L, t->isEmpty()); + return 1; +} + +int w_ParticleSystem_isFull(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + luax_pushboolean(L, t->isFull()); + return 1; +} + +int w_ParticleSystem_update(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + float dt = (float)luaL_checknumber(L, 2); + t->update(dt); + return 0; +} + +static const luaL_Reg functions[] = +{ + { "setSprite", w_ParticleSystem_setSprite }, + { "setBufferSize", w_ParticleSystem_setBufferSize }, + { "setEmissionRate", w_ParticleSystem_setEmissionRate }, + { "setLifetime", w_ParticleSystem_setLifetime }, + { "setParticleLife", w_ParticleSystem_setParticleLife }, + { "setPosition", w_ParticleSystem_setPosition }, + { "setDirection", w_ParticleSystem_setDirection }, + { "setSpread", w_ParticleSystem_setSpread }, + { "setRelativeDirection", w_ParticleSystem_setRelativeDirection }, + { "setSpeed", w_ParticleSystem_setSpeed }, + { "setGravity", w_ParticleSystem_setGravity }, + { "setRadialAcceleration", w_ParticleSystem_setRadialAcceleration }, + { "setTangentialAcceleration", w_ParticleSystem_setTangentialAcceleration }, + { "setSizes", w_ParticleSystem_setSizes }, + { "setSizeVariation", w_ParticleSystem_setSizeVariation }, + { "setRotation", w_ParticleSystem_setRotation }, + { "setSpin", w_ParticleSystem_setSpin }, + { "setSpinVariation", w_ParticleSystem_setSpinVariation }, + { "setColors", w_ParticleSystem_setColors }, + { "setOffset", w_ParticleSystem_setOffset }, + { "getX", w_ParticleSystem_getX }, + { "getY", w_ParticleSystem_getY }, + { "getPosition", w_ParticleSystem_getPosition }, + { "getDirection", w_ParticleSystem_getDirection }, + { "getSpread", w_ParticleSystem_getSpread }, + { "getOffsetX", w_ParticleSystem_getOffsetX }, + { "getOffsetY", w_ParticleSystem_getOffsetY }, + { "count", w_ParticleSystem_count }, + { "start", w_ParticleSystem_start }, + { "stop", w_ParticleSystem_stop }, + { "pause", w_ParticleSystem_pause }, + { "reset", w_ParticleSystem_reset }, + { "isActive", w_ParticleSystem_isActive }, + { "isEmpty", w_ParticleSystem_isEmpty }, + { "isFull", w_ParticleSystem_isFull }, + { "update", w_ParticleSystem_update }, + { 0, 0 } +}; + +extern "C" int luaopen_particlesystem(lua_State *L) +{ + return luax_register_type(L, "ParticleSystem", functions); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.h b/src/modules/graphics/opengl/wrap_ParticleSystem.h index 179e2e605..62378d46c 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.h +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.h @@ -1,79 +1,79 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_PARTICLE_SYSTEM_H -#define LOVE_GRAPHICS_OPENGL_WRAP_PARTICLE_SYSTEM_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Image.h" -#include "ParticleSystem.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -ParticleSystem *luax_checkparticlesystem(lua_State *L, int idx); -int w_ParticleSystem_setSprite(lua_State *L); -int w_ParticleSystem_setBufferSize(lua_State *L); -int w_ParticleSystem_setEmissionRate(lua_State *L); -int w_ParticleSystem_setLifetime(lua_State *L); -int w_ParticleSystem_setParticleLife(lua_State *L); -int w_ParticleSystem_setPosition(lua_State *L); -int w_ParticleSystem_setDirection(lua_State *L); -int w_ParticleSystem_setSpread(lua_State *L); -int w_ParticleSystem_setRelativeDirection(lua_State *L); -int w_ParticleSystem_setSpeed(lua_State *L); -int w_ParticleSystem_setGravity(lua_State *L); -int w_ParticleSystem_setRadialAcceleration(lua_State *L); -int w_ParticleSystem_setTangentialAcceleration(lua_State *L); -int w_ParticleSystem_setSizes(lua_State *L); -int w_ParticleSystem_setSizeVariation(lua_State *L); -int w_ParticleSystem_setRotation(lua_State *L); -int w_ParticleSystem_setSpin(lua_State *L); -int w_ParticleSystem_setSpinVariation(lua_State *L); -int w_ParticleSystem_setColors(lua_State *L); -int w_ParticleSystem_setOffset(lua_State *L); -int w_ParticleSystem_getX(lua_State *L); -int w_ParticleSystem_getY(lua_State *L); -int w_ParticleSystem_getPosition(lua_State *L); -int w_ParticleSystem_getDirection(lua_State *L); -int w_ParticleSystem_getSpread(lua_State *L); -int w_ParticleSystem_getOffsetX(lua_State *L); -int w_ParticleSystem_getOffsetY(lua_State *L); -int w_ParticleSystem_count(lua_State *L); -int w_ParticleSystem_start(lua_State *L); -int w_ParticleSystem_stop(lua_State *L); -int w_ParticleSystem_pause(lua_State *L); -int w_ParticleSystem_reset(lua_State *L); -int w_ParticleSystem_isActive(lua_State *L); -int w_ParticleSystem_isEmpty(lua_State *L); -int w_ParticleSystem_isFull(lua_State *L); -int w_ParticleSystem_update(lua_State *L); -extern "C" int luaopen_particlesystem(lua_State *L); - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_WRAP_PARTICLE_SYSTEM_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_WRAP_PARTICLE_SYSTEM_H +#define LOVE_GRAPHICS_OPENGL_WRAP_PARTICLE_SYSTEM_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Image.h" +#include "ParticleSystem.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +ParticleSystem *luax_checkparticlesystem(lua_State *L, int idx); +int w_ParticleSystem_setSprite(lua_State *L); +int w_ParticleSystem_setBufferSize(lua_State *L); +int w_ParticleSystem_setEmissionRate(lua_State *L); +int w_ParticleSystem_setLifetime(lua_State *L); +int w_ParticleSystem_setParticleLife(lua_State *L); +int w_ParticleSystem_setPosition(lua_State *L); +int w_ParticleSystem_setDirection(lua_State *L); +int w_ParticleSystem_setSpread(lua_State *L); +int w_ParticleSystem_setRelativeDirection(lua_State *L); +int w_ParticleSystem_setSpeed(lua_State *L); +int w_ParticleSystem_setGravity(lua_State *L); +int w_ParticleSystem_setRadialAcceleration(lua_State *L); +int w_ParticleSystem_setTangentialAcceleration(lua_State *L); +int w_ParticleSystem_setSizes(lua_State *L); +int w_ParticleSystem_setSizeVariation(lua_State *L); +int w_ParticleSystem_setRotation(lua_State *L); +int w_ParticleSystem_setSpin(lua_State *L); +int w_ParticleSystem_setSpinVariation(lua_State *L); +int w_ParticleSystem_setColors(lua_State *L); +int w_ParticleSystem_setOffset(lua_State *L); +int w_ParticleSystem_getX(lua_State *L); +int w_ParticleSystem_getY(lua_State *L); +int w_ParticleSystem_getPosition(lua_State *L); +int w_ParticleSystem_getDirection(lua_State *L); +int w_ParticleSystem_getSpread(lua_State *L); +int w_ParticleSystem_getOffsetX(lua_State *L); +int w_ParticleSystem_getOffsetY(lua_State *L); +int w_ParticleSystem_count(lua_State *L); +int w_ParticleSystem_start(lua_State *L); +int w_ParticleSystem_stop(lua_State *L); +int w_ParticleSystem_pause(lua_State *L); +int w_ParticleSystem_reset(lua_State *L); +int w_ParticleSystem_isActive(lua_State *L); +int w_ParticleSystem_isEmpty(lua_State *L); +int w_ParticleSystem_isFull(lua_State *L); +int w_ParticleSystem_update(lua_State *L); +extern "C" int luaopen_particlesystem(lua_State *L); + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_WRAP_PARTICLE_SYSTEM_H diff --git a/src/modules/graphics/opengl/wrap_PixelEffect.cpp b/src/modules/graphics/opengl/wrap_PixelEffect.cpp index c0bf4d4ee..42ba270ff 100644 --- a/src/modules/graphics/opengl/wrap_PixelEffect.cpp +++ b/src/modules/graphics/opengl/wrap_PixelEffect.cpp @@ -1,244 +1,244 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_PixelEffect.h" -#include "wrap_Image.h" -#include "wrap_Canvas.h" -#include -#include -using namespace std; - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -PixelEffect *luax_checkpixeleffect(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "PixelEffect", GRAPHICS_PIXELEFFECT_T); -} - -int w_PixelEffect_getWarnings(lua_State *L) -{ - PixelEffect *effect = luax_checkpixeleffect(L, 1); - lua_pushstring(L, effect->getWarnings().c_str()); - return 1; -} - -static int _sendScalars(lua_State *L, PixelEffect *effect, const char *name, int count) -{ - float *values = new float[count]; - for (int i = 0; i < count; ++i) - { - if (!lua_isnumber(L, 3 + i)) - { - delete[] values; - return luaL_typerror(L, 3 + i, "number"); - } - values[i] = (float)lua_tonumber(L, 3 + i); - } - - try - { - effect->sendFloat(name, 1, values, count); - } - catch(love::Exception &e) - { - delete[] values; - return luaL_error(L, e.what()); - } - - delete[] values; - return 0; -} - -static int _sendVectors(lua_State *L, PixelEffect *effect, const char *name, int count) -{ - size_t dimension = lua_objlen(L, 3); - float *values = new float[count * dimension]; - - for (int i = 0; i < count; ++i) - { - if (!lua_istable(L, 3 + i)) - { - delete[] values; - return luaL_typerror(L, 3 + i, "table"); - } - if (lua_objlen(L, 3 + i) != dimension) - { - delete[] values; - return luaL_error(L, "Error in argument %d: Expected table size %d, got %d.", - 3+i, dimension, lua_objlen(L, 3+i)); - } - - for (size_t k = 1; k <= dimension; ++k) - { - lua_rawgeti(L, 3 + i, k); - values[i * dimension + k - 1] = (float)lua_tonumber(L, -1); - } - lua_pop(L, int(dimension)); - } - - try - { - effect->sendFloat(name, dimension, values, count); - } - catch(love::Exception &e) - { - delete[] values; - return luaL_error(L, e.what()); - } - - delete[] values; - return 0; -} - -int w_PixelEffect_sendFloat(lua_State *L) -{ - PixelEffect *effect = luax_checkpixeleffect(L, 1); - const char *name = luaL_checkstring(L, 2); - int count = lua_gettop(L) - 2; - - if (count < 1) - return luaL_error(L, "No variable to send."); - - if (lua_isnumber(L, 3)) - return _sendScalars(L, effect, name, count); - else if (lua_istable(L, 3)) - return _sendVectors(L, effect, name, count); - - return luaL_typerror(L, 3, "number or table"); -} - -int w_PixelEffect_sendMatrix(lua_State *L) -{ - int count = lua_gettop(L) - 2; - PixelEffect *effect = luax_checkpixeleffect(L, 1); - const char *name = luaL_checkstring(L, 2); - - if (!lua_istable(L, 3)) - return luaL_typerror(L, 3, "matrix table"); - - lua_getfield(L, 3, "dimension"); - int dimension = lua_tointeger(L, -1); - lua_pop(L, 1); - - if (dimension < 2 || dimension > 4) - return luaL_error(L, "Invalid matrix size: %dx%d (only 2x2, 3x3 and 4x4 matrices are supported).", - count, count); - - float *values = new float[dimension * dimension * count]; - for (int i = 0; i < count; ++i) - { - lua_getfield(L, 3+i, "dimension"); - if (lua_tointeger(L, -1) != dimension) - { - // You unlock this door with the key of imagination. Beyond it is - // another dimension: a dimension of sound, a dimension of sight, - // a dimension of mind. You're moving into a land of both shadow - // and substance, of things and ideas. You've just crossed over - // into... the Twilight Zone. - int other_dimension = lua_tointeger(L, -1); - delete[] values; - return luaL_error(L, "Invalid matrix size at argument %d: Expected size %dx%d, got %dx%d.", - 3+i, dimension, dimension, other_dimension, other_dimension); - } - - for (int k = 1; k <= dimension*dimension; ++k) - { - lua_rawgeti(L, 3+i, k); - values[i * dimension * dimension + k - 1] = (float)lua_tonumber(L, -1); - } - - lua_pop(L, 1 + dimension); - } - - try - { - effect->sendMatrix(name, dimension, values, count); - } - catch(love::Exception &e) - { - delete[] values; - return luaL_error(L, e.what()); - } - - delete[] values; - return 0; -} - -int w_PixelEffect_sendImage(lua_State *L) -{ - PixelEffect *effect = luax_checkpixeleffect(L, 1); - const char *name = luaL_checkstring(L, 2); - Image *img = luax_checkimage(L, 3); - - try - { - effect->sendImage(name, *img); - } - catch(love::Exception &e) - { - luaL_error(L, e.what()); - } - - return 0; -} - -int w_PixelEffect_sendCanvas(lua_State *L) -{ - PixelEffect *effect = luax_checkpixeleffect(L, 1); - const char *name = luaL_checkstring(L, 2); - Canvas *canvas = luax_checkcanvas(L, 3); - - try - { - effect->sendCanvas(name, *canvas); - } - catch(love::Exception &e) - { - luaL_error(L, e.what()); - } - - return 0; -} - - -static const luaL_Reg functions[] = -{ - { "getWarnings", w_PixelEffect_getWarnings }, - { "sendFloat", w_PixelEffect_sendFloat }, - { "sendMatrix", w_PixelEffect_sendMatrix }, - { "sendImage", w_PixelEffect_sendImage }, - { "sendCanvas", w_PixelEffect_sendCanvas }, - { 0, 0 } -}; - -extern "C" int luaopen_pixeleffect(lua_State *L) -{ - return luax_register_type(L, "PixelEffect", functions); -} - -} // opengl -} // graphics -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_PixelEffect.h" +#include "wrap_Image.h" +#include "wrap_Canvas.h" +#include +#include +using namespace std; + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +PixelEffect *luax_checkpixeleffect(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "PixelEffect", GRAPHICS_PIXELEFFECT_T); +} + +int w_PixelEffect_getWarnings(lua_State *L) +{ + PixelEffect *effect = luax_checkpixeleffect(L, 1); + lua_pushstring(L, effect->getWarnings().c_str()); + return 1; +} + +static int _sendScalars(lua_State *L, PixelEffect *effect, const char *name, int count) +{ + float *values = new float[count]; + for (int i = 0; i < count; ++i) + { + if (!lua_isnumber(L, 3 + i)) + { + delete[] values; + return luaL_typerror(L, 3 + i, "number"); + } + values[i] = (float)lua_tonumber(L, 3 + i); + } + + try + { + effect->sendFloat(name, 1, values, count); + } + catch(love::Exception &e) + { + delete[] values; + return luaL_error(L, e.what()); + } + + delete[] values; + return 0; +} + +static int _sendVectors(lua_State *L, PixelEffect *effect, const char *name, int count) +{ + size_t dimension = lua_objlen(L, 3); + float *values = new float[count * dimension]; + + for (int i = 0; i < count; ++i) + { + if (!lua_istable(L, 3 + i)) + { + delete[] values; + return luaL_typerror(L, 3 + i, "table"); + } + if (lua_objlen(L, 3 + i) != dimension) + { + delete[] values; + return luaL_error(L, "Error in argument %d: Expected table size %d, got %d.", + 3+i, dimension, lua_objlen(L, 3+i)); + } + + for (size_t k = 1; k <= dimension; ++k) + { + lua_rawgeti(L, 3 + i, k); + values[i * dimension + k - 1] = (float)lua_tonumber(L, -1); + } + lua_pop(L, int(dimension)); + } + + try + { + effect->sendFloat(name, dimension, values, count); + } + catch(love::Exception &e) + { + delete[] values; + return luaL_error(L, e.what()); + } + + delete[] values; + return 0; +} + +int w_PixelEffect_sendFloat(lua_State *L) +{ + PixelEffect *effect = luax_checkpixeleffect(L, 1); + const char *name = luaL_checkstring(L, 2); + int count = lua_gettop(L) - 2; + + if (count < 1) + return luaL_error(L, "No variable to send."); + + if (lua_isnumber(L, 3)) + return _sendScalars(L, effect, name, count); + else if (lua_istable(L, 3)) + return _sendVectors(L, effect, name, count); + + return luaL_typerror(L, 3, "number or table"); +} + +int w_PixelEffect_sendMatrix(lua_State *L) +{ + int count = lua_gettop(L) - 2; + PixelEffect *effect = luax_checkpixeleffect(L, 1); + const char *name = luaL_checkstring(L, 2); + + if (!lua_istable(L, 3)) + return luaL_typerror(L, 3, "matrix table"); + + lua_getfield(L, 3, "dimension"); + int dimension = lua_tointeger(L, -1); + lua_pop(L, 1); + + if (dimension < 2 || dimension > 4) + return luaL_error(L, "Invalid matrix size: %dx%d (only 2x2, 3x3 and 4x4 matrices are supported).", + count, count); + + float *values = new float[dimension * dimension * count]; + for (int i = 0; i < count; ++i) + { + lua_getfield(L, 3+i, "dimension"); + if (lua_tointeger(L, -1) != dimension) + { + // You unlock this door with the key of imagination. Beyond it is + // another dimension: a dimension of sound, a dimension of sight, + // a dimension of mind. You're moving into a land of both shadow + // and substance, of things and ideas. You've just crossed over + // into... the Twilight Zone. + int other_dimension = lua_tointeger(L, -1); + delete[] values; + return luaL_error(L, "Invalid matrix size at argument %d: Expected size %dx%d, got %dx%d.", + 3+i, dimension, dimension, other_dimension, other_dimension); + } + + for (int k = 1; k <= dimension*dimension; ++k) + { + lua_rawgeti(L, 3+i, k); + values[i * dimension * dimension + k - 1] = (float)lua_tonumber(L, -1); + } + + lua_pop(L, 1 + dimension); + } + + try + { + effect->sendMatrix(name, dimension, values, count); + } + catch(love::Exception &e) + { + delete[] values; + return luaL_error(L, e.what()); + } + + delete[] values; + return 0; +} + +int w_PixelEffect_sendImage(lua_State *L) +{ + PixelEffect *effect = luax_checkpixeleffect(L, 1); + const char *name = luaL_checkstring(L, 2); + Image *img = luax_checkimage(L, 3); + + try + { + effect->sendImage(name, *img); + } + catch(love::Exception &e) + { + luaL_error(L, e.what()); + } + + return 0; +} + +int w_PixelEffect_sendCanvas(lua_State *L) +{ + PixelEffect *effect = luax_checkpixeleffect(L, 1); + const char *name = luaL_checkstring(L, 2); + Canvas *canvas = luax_checkcanvas(L, 3); + + try + { + effect->sendCanvas(name, *canvas); + } + catch(love::Exception &e) + { + luaL_error(L, e.what()); + } + + return 0; +} + + +static const luaL_Reg functions[] = +{ + { "getWarnings", w_PixelEffect_getWarnings }, + { "sendFloat", w_PixelEffect_sendFloat }, + { "sendMatrix", w_PixelEffect_sendMatrix }, + { "sendImage", w_PixelEffect_sendImage }, + { "sendCanvas", w_PixelEffect_sendCanvas }, + { 0, 0 } +}; + +extern "C" int luaopen_pixeleffect(lua_State *L) +{ + return luax_register_type(L, "PixelEffect", functions); +} + +} // opengl +} // graphics +} // love + diff --git a/src/modules/graphics/opengl/wrap_PixelEffect.h b/src/modules/graphics/opengl/wrap_PixelEffect.h index 9bbad81bc..2f1cafbd8 100644 --- a/src/modules/graphics/opengl/wrap_PixelEffect.h +++ b/src/modules/graphics/opengl/wrap_PixelEffect.h @@ -1,45 +1,45 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_PROGRAM_H -#define LOVE_GRAPHICS_OPENGL_WRAP_PROGRAM_H - -#include "common/runtime.h" -#include "PixelEffect.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -PixelEffect *luax_checkpixeleffect(lua_State *L, int idx); -int w_PixelEffect_getWarnings(lua_State *L); -int w_PixelEffect_sendFloat(lua_State *L); -int w_PixelEffect_sendMatrix(lua_State *L); -int w_PixelEffect_sendImage(lua_State *L); -extern "C" int luaopen_pixeleffect(lua_State *L); - -} // opengl -} // graphics -} // love - -#endif +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_WRAP_PROGRAM_H +#define LOVE_GRAPHICS_OPENGL_WRAP_PROGRAM_H + +#include "common/runtime.h" +#include "PixelEffect.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +PixelEffect *luax_checkpixeleffect(lua_State *L, int idx); +int w_PixelEffect_getWarnings(lua_State *L); +int w_PixelEffect_sendFloat(lua_State *L); +int w_PixelEffect_sendMatrix(lua_State *L); +int w_PixelEffect_sendImage(lua_State *L); +extern "C" int luaopen_pixeleffect(lua_State *L); + +} // opengl +} // graphics +} // love + +#endif diff --git a/src/modules/graphics/opengl/wrap_Quad.cpp b/src/modules/graphics/opengl/wrap_Quad.cpp index 14775a673..29e5bfe38 100644 --- a/src/modules/graphics/opengl/wrap_Quad.cpp +++ b/src/modules/graphics/opengl/wrap_Quad.cpp @@ -1,81 +1,81 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "wrap_Quad.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Quad *luax_checkframe(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Quad", GRAPHICS_QUAD_T); -} - -int w_Quad_flip(lua_State *L) -{ - Quad *quad = luax_checktype(L, 1, "Quad", GRAPHICS_QUAD_T); - quad->flip(luax_toboolean(L, 2), luax_toboolean(L, 3)); - return 0; -} - -int w_Quad_setViewport(lua_State *L) -{ - Quad *quad = luax_checktype(L, 1, "Quad", GRAPHICS_QUAD_T); - Quad::Viewport v; - v.x = (float) luaL_checknumber(L, 2); - v.y = (float) luaL_checknumber(L, 3); - v.w = (float) luaL_checknumber(L, 4); - v.h = (float) luaL_checknumber(L, 5); - quad->setViewport(v); - return 0; -} - -int w_Quad_getViewport(lua_State *L) -{ - Quad *quad = luax_checktype(L, 1, "Quad", GRAPHICS_QUAD_T); - Quad::Viewport v = quad->getViewport(); - lua_pushnumber(L, v.x); - lua_pushnumber(L, v.y); - lua_pushnumber(L, v.w); - lua_pushnumber(L, v.h); - return 4; -} - -static const luaL_Reg w_Quad_functions[] = -{ - { "flip", w_Quad_flip }, - { "setViewport", w_Quad_setViewport }, - { "getViewport", w_Quad_getViewport }, - { 0, 0 } -}; - -extern "C" int luaopen_frame(lua_State *L) -{ - return luax_register_type(L, "Quad", w_Quad_functions); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "wrap_Quad.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Quad *luax_checkframe(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Quad", GRAPHICS_QUAD_T); +} + +int w_Quad_flip(lua_State *L) +{ + Quad *quad = luax_checktype(L, 1, "Quad", GRAPHICS_QUAD_T); + quad->flip(luax_toboolean(L, 2), luax_toboolean(L, 3)); + return 0; +} + +int w_Quad_setViewport(lua_State *L) +{ + Quad *quad = luax_checktype(L, 1, "Quad", GRAPHICS_QUAD_T); + Quad::Viewport v; + v.x = (float) luaL_checknumber(L, 2); + v.y = (float) luaL_checknumber(L, 3); + v.w = (float) luaL_checknumber(L, 4); + v.h = (float) luaL_checknumber(L, 5); + quad->setViewport(v); + return 0; +} + +int w_Quad_getViewport(lua_State *L) +{ + Quad *quad = luax_checktype(L, 1, "Quad", GRAPHICS_QUAD_T); + Quad::Viewport v = quad->getViewport(); + lua_pushnumber(L, v.x); + lua_pushnumber(L, v.y); + lua_pushnumber(L, v.w); + lua_pushnumber(L, v.h); + return 4; +} + +static const luaL_Reg w_Quad_functions[] = +{ + { "flip", w_Quad_flip }, + { "setViewport", w_Quad_setViewport }, + { "getViewport", w_Quad_getViewport }, + { 0, 0 } +}; + +extern "C" int luaopen_frame(lua_State *L) +{ + return luax_register_type(L, "Quad", w_Quad_functions); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/wrap_Quad.h b/src/modules/graphics/opengl/wrap_Quad.h index b0f62713b..05a686830 100644 --- a/src/modules/graphics/opengl/wrap_Quad.h +++ b/src/modules/graphics/opengl/wrap_Quad.h @@ -1,45 +1,45 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H -#define LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H - -// LOVE -#include "common/runtime.h" -#include "Quad.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -Quad *luax_checkframe(lua_State *L, int idx); -int w_Quad_flip(lua_State *L); -int w_Quad_setViewport(lua_State *L); -int w_Quad_getViewport(lua_State *L); -extern "C" int luaopen_frame(lua_State *L); - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H +#define LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H + +// LOVE +#include "common/runtime.h" +#include "Quad.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +Quad *luax_checkframe(lua_State *L, int idx); +int w_Quad_flip(lua_State *L); +int w_Quad_setViewport(lua_State *L); +int w_Quad_getViewport(lua_State *L); +extern "C" int luaopen_frame(lua_State *L); + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H diff --git a/src/modules/graphics/opengl/wrap_SpriteBatch.cpp b/src/modules/graphics/opengl/wrap_SpriteBatch.cpp index 232c2b2ef..1030208bd 100644 --- a/src/modules/graphics/opengl/wrap_SpriteBatch.cpp +++ b/src/modules/graphics/opengl/wrap_SpriteBatch.cpp @@ -1,184 +1,184 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Image.h" -#include "wrap_SpriteBatch.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -SpriteBatch *luax_checkspritebatch(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "SpriteBatch", GRAPHICS_SPRITE_BATCH_T); -} - -int w_SpriteBatch_add(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - float x = (float)luaL_optnumber(L, 2, 0.0f); - float y = (float)luaL_optnumber(L, 3, 0.0f); - float angle = (float)luaL_optnumber(L, 4, 0.0f); - float sx = (float)luaL_optnumber(L, 5, 1.0f); - float sy = (float)luaL_optnumber(L, 6, sx); - float ox = (float)luaL_optnumber(L, 7, 0); - float oy = (float)luaL_optnumber(L, 8, 0); - float kx = (float)luaL_optnumber(L, 9, 0); - float ky = (float)luaL_optnumber(L, 10, 0); - lua_pushnumber(L, t->add(x, y, angle, sx, sy, ox, oy, kx, ky)); - return 1; -} - -int w_SpriteBatch_addq(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - Quad *q = luax_checktype(L, 2, "Quad", GRAPHICS_QUAD_T); - float x = (float)luaL_optnumber(L, 3, 0.0f); - float y = (float)luaL_optnumber(L, 4, 0.0f); - float angle = (float)luaL_optnumber(L, 5, 0.0f); - float sx = (float)luaL_optnumber(L, 6, 1.0f); - float sy = (float)luaL_optnumber(L, 7, sx); - float ox = (float)luaL_optnumber(L, 8, 0); - float oy = (float)luaL_optnumber(L, 9, 0); - float kx = (float)luaL_optnumber(L, 10, 0); - float ky = (float)luaL_optnumber(L, 11, 0); - lua_pushnumber(L, t->addq(q, x, y, angle, sx, sy, ox, oy, kx, ky)); - return 1; -} - -int w_SpriteBatch_set(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - int index = luaL_checkinteger(L, 2); - float x = (float)luaL_optnumber(L, 3, 0.0f); - float y = (float)luaL_optnumber(L, 4, 0.0f); - float angle = (float)luaL_optnumber(L, 5, 0.0f); - float sx = (float)luaL_optnumber(L, 6, 1.0f); - float sy = (float)luaL_optnumber(L, 7, sx); - float ox = (float)luaL_optnumber(L, 8, 0); - float oy = (float)luaL_optnumber(L, 9, 0); - float kx = (float)luaL_optnumber(L, 10, 0); - float ky = (float)luaL_optnumber(L, 11, 0); - t->add(x, y, angle, sx, sy, ox, oy, kx, ky, index); - return 0; -} - -int w_SpriteBatch_setq(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - int index = luaL_checkinteger(L, 2); - Quad *q = luax_checktype(L, 3, "Quad", GRAPHICS_QUAD_T); - float x = (float)luaL_optnumber(L, 4, 0.0f); - float y = (float)luaL_optnumber(L, 5, 0.0f); - float angle = (float)luaL_optnumber(L, 6, 0.0f); - float sx = (float)luaL_optnumber(L, 7, 1.0f); - float sy = (float)luaL_optnumber(L, 8, sx); - float ox = (float)luaL_optnumber(L, 9, 0); - float oy = (float)luaL_optnumber(L, 10, 0); - float kx = (float)luaL_optnumber(L, 11, 0); - float ky = (float)luaL_optnumber(L, 12, 0); - t->addq(q, x, y, angle, sx, sy, ox, oy, kx, ky, index); - return 0; -} - - -int w_SpriteBatch_clear(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - t->clear(); - return 0; -} - -int w_SpriteBatch_bind(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - t->lock(); - return 0; -} - -int w_SpriteBatch_unbind(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - t->unlock(); - return 0; -} - -int w_SpriteBatch_setImage(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - Image *image = luax_checktype(L, 2, "Image", GRAPHICS_IMAGE_T); - t->setImage(image); - return 0; -} - -int w_SpriteBatch_getImage(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - Image *image = t->getImage(); - image->retain(); - luax_newtype(L, "Image", GRAPHICS_IMAGE_T, (void *)image); - return 1; -} - -int w_SpriteBatch_setColor(lua_State *L) -{ - SpriteBatch *t = luax_checkspritebatch(L, 1); - - if (lua_gettop(L) <= 1) - t->setColor(); - else - { - Color c; - c.r = (unsigned char)luaL_checkint(L, 2); - c.g = (unsigned char)luaL_checkint(L, 3); - c.b = (unsigned char)luaL_checkint(L, 4); - c.a = (unsigned char)luaL_optint(L, 5, 255); - t->setColor(c); - } - - return 0; -} - -static const luaL_Reg functions[] = -{ - { "add", w_SpriteBatch_add }, - { "addq", w_SpriteBatch_addq }, - { "set", w_SpriteBatch_set }, - { "setq", w_SpriteBatch_setq }, - { "clear", w_SpriteBatch_clear }, - { "bind", w_SpriteBatch_bind }, - { "unbind", w_SpriteBatch_unbind }, - { "setImage", w_SpriteBatch_setImage }, - { "getImage", w_SpriteBatch_getImage }, - { "setColor", w_SpriteBatch_setColor }, - { 0, 0 } -}; - -extern "C" int luaopen_spritebatch(lua_State *L) -{ - return luax_register_type(L, "SpriteBatch", functions); -} - -} // opengl -} // graphics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Image.h" +#include "wrap_SpriteBatch.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +SpriteBatch *luax_checkspritebatch(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "SpriteBatch", GRAPHICS_SPRITE_BATCH_T); +} + +int w_SpriteBatch_add(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + float x = (float)luaL_optnumber(L, 2, 0.0f); + float y = (float)luaL_optnumber(L, 3, 0.0f); + float angle = (float)luaL_optnumber(L, 4, 0.0f); + float sx = (float)luaL_optnumber(L, 5, 1.0f); + float sy = (float)luaL_optnumber(L, 6, sx); + float ox = (float)luaL_optnumber(L, 7, 0); + float oy = (float)luaL_optnumber(L, 8, 0); + float kx = (float)luaL_optnumber(L, 9, 0); + float ky = (float)luaL_optnumber(L, 10, 0); + lua_pushnumber(L, t->add(x, y, angle, sx, sy, ox, oy, kx, ky)); + return 1; +} + +int w_SpriteBatch_addq(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + Quad *q = luax_checktype(L, 2, "Quad", GRAPHICS_QUAD_T); + float x = (float)luaL_optnumber(L, 3, 0.0f); + float y = (float)luaL_optnumber(L, 4, 0.0f); + float angle = (float)luaL_optnumber(L, 5, 0.0f); + float sx = (float)luaL_optnumber(L, 6, 1.0f); + float sy = (float)luaL_optnumber(L, 7, sx); + float ox = (float)luaL_optnumber(L, 8, 0); + float oy = (float)luaL_optnumber(L, 9, 0); + float kx = (float)luaL_optnumber(L, 10, 0); + float ky = (float)luaL_optnumber(L, 11, 0); + lua_pushnumber(L, t->addq(q, x, y, angle, sx, sy, ox, oy, kx, ky)); + return 1; +} + +int w_SpriteBatch_set(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + int index = luaL_checkinteger(L, 2); + float x = (float)luaL_optnumber(L, 3, 0.0f); + float y = (float)luaL_optnumber(L, 4, 0.0f); + float angle = (float)luaL_optnumber(L, 5, 0.0f); + float sx = (float)luaL_optnumber(L, 6, 1.0f); + float sy = (float)luaL_optnumber(L, 7, sx); + float ox = (float)luaL_optnumber(L, 8, 0); + float oy = (float)luaL_optnumber(L, 9, 0); + float kx = (float)luaL_optnumber(L, 10, 0); + float ky = (float)luaL_optnumber(L, 11, 0); + t->add(x, y, angle, sx, sy, ox, oy, kx, ky, index); + return 0; +} + +int w_SpriteBatch_setq(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + int index = luaL_checkinteger(L, 2); + Quad *q = luax_checktype(L, 3, "Quad", GRAPHICS_QUAD_T); + float x = (float)luaL_optnumber(L, 4, 0.0f); + float y = (float)luaL_optnumber(L, 5, 0.0f); + float angle = (float)luaL_optnumber(L, 6, 0.0f); + float sx = (float)luaL_optnumber(L, 7, 1.0f); + float sy = (float)luaL_optnumber(L, 8, sx); + float ox = (float)luaL_optnumber(L, 9, 0); + float oy = (float)luaL_optnumber(L, 10, 0); + float kx = (float)luaL_optnumber(L, 11, 0); + float ky = (float)luaL_optnumber(L, 12, 0); + t->addq(q, x, y, angle, sx, sy, ox, oy, kx, ky, index); + return 0; +} + + +int w_SpriteBatch_clear(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + t->clear(); + return 0; +} + +int w_SpriteBatch_bind(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + t->lock(); + return 0; +} + +int w_SpriteBatch_unbind(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + t->unlock(); + return 0; +} + +int w_SpriteBatch_setImage(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + Image *image = luax_checktype(L, 2, "Image", GRAPHICS_IMAGE_T); + t->setImage(image); + return 0; +} + +int w_SpriteBatch_getImage(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + Image *image = t->getImage(); + image->retain(); + luax_newtype(L, "Image", GRAPHICS_IMAGE_T, (void *)image); + return 1; +} + +int w_SpriteBatch_setColor(lua_State *L) +{ + SpriteBatch *t = luax_checkspritebatch(L, 1); + + if (lua_gettop(L) <= 1) + t->setColor(); + else + { + Color c; + c.r = (unsigned char)luaL_checkint(L, 2); + c.g = (unsigned char)luaL_checkint(L, 3); + c.b = (unsigned char)luaL_checkint(L, 4); + c.a = (unsigned char)luaL_optint(L, 5, 255); + t->setColor(c); + } + + return 0; +} + +static const luaL_Reg functions[] = +{ + { "add", w_SpriteBatch_add }, + { "addq", w_SpriteBatch_addq }, + { "set", w_SpriteBatch_set }, + { "setq", w_SpriteBatch_setq }, + { "clear", w_SpriteBatch_clear }, + { "bind", w_SpriteBatch_bind }, + { "unbind", w_SpriteBatch_unbind }, + { "setImage", w_SpriteBatch_setImage }, + { "getImage", w_SpriteBatch_getImage }, + { "setColor", w_SpriteBatch_setColor }, + { 0, 0 } +}; + +extern "C" int luaopen_spritebatch(lua_State *L) +{ + return luax_register_type(L, "SpriteBatch", functions); +} + +} // opengl +} // graphics +} // love diff --git a/src/modules/graphics/opengl/wrap_SpriteBatch.h b/src/modules/graphics/opengl/wrap_SpriteBatch.h index 390295bbf..d7ed1f1a0 100644 --- a/src/modules/graphics/opengl/wrap_SpriteBatch.h +++ b/src/modules/graphics/opengl/wrap_SpriteBatch.h @@ -1,51 +1,51 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_SPRITE_BATCH_H -#define LOVE_GRAPHICS_OPENGL_WRAP_SPRITE_BATCH_H - -#include "common/runtime.h" -#include "SpriteBatch.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -SpriteBatch *luax_checkspritebatch(lua_State *L, int idx); -int w_SpriteBatch_add(lua_State *L); -int w_SpriteBatch_addq(lua_State *L); -int w_SpriteBatch_set(lua_State *L); -int w_SpriteBatch_setq(lua_State *L); -int w_SpriteBatch_clear(lua_State *L); -int w_SpriteBatch_lock(lua_State *L); -int w_SpriteBatch_unlock(lua_State *L); -int w_SpriteBatch_setImage(lua_State *L); -int w_SpriteBatch_getImage(lua_State *L); - -extern "C" int luaopen_spritebatch(lua_State *L); - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_WRAP_SPRITE_BATCH_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_GRAPHICS_OPENGL_WRAP_SPRITE_BATCH_H +#define LOVE_GRAPHICS_OPENGL_WRAP_SPRITE_BATCH_H + +#include "common/runtime.h" +#include "SpriteBatch.h" + +namespace love +{ +namespace graphics +{ +namespace opengl +{ + +SpriteBatch *luax_checkspritebatch(lua_State *L, int idx); +int w_SpriteBatch_add(lua_State *L); +int w_SpriteBatch_addq(lua_State *L); +int w_SpriteBatch_set(lua_State *L); +int w_SpriteBatch_setq(lua_State *L); +int w_SpriteBatch_clear(lua_State *L); +int w_SpriteBatch_lock(lua_State *L); +int w_SpriteBatch_unlock(lua_State *L); +int w_SpriteBatch_setImage(lua_State *L); +int w_SpriteBatch_getImage(lua_State *L); + +extern "C" int luaopen_spritebatch(lua_State *L); + +} // opengl +} // graphics +} // love + +#endif // LOVE_GRAPHICS_OPENGL_WRAP_SPRITE_BATCH_H diff --git a/src/modules/image/Image.h b/src/modules/image/Image.h index c9cb6f4ba..07f059b66 100644 --- a/src/modules/image/Image.h +++ b/src/modules/image/Image.h @@ -1,85 +1,85 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_IMAGE_IMAGE_H -#define LOVE_IMAGE_IMAGE_H - -// LOVE -#include "common/config.h" -#include "common/Module.h" -#include "filesystem/File.h" -#include "ImageData.h" - -namespace love -{ -namespace image -{ - -/** - * This module is responsible for decoding files such as PNG, GIF, JPEG - * into raw pixel data. This module does not know how to draw images on - * screen; only love.graphics knows that. - **/ -class Image : public Module -{ -public: - - /** - * Destructor. - **/ - virtual ~Image() {}; - - /** - * Creates new ImageData from a file. - * @param file The file containing the encoded image data. - * @return The new ImageData. - **/ - virtual ImageData *newImageData(love::filesystem::File *file) = 0; - - /** - * Creates new ImageData from a raw Data. - * @param data The object containing encoded pixel data. - * @return The new ImageData. - **/ - virtual ImageData *newImageData(Data *data) = 0; - - /** - * Creates empty ImageData with the given size. - * @param The width of the ImageData. - * @param The height of the ImageData. - * @return The new ImageData. - **/ - virtual ImageData *newImageData(int width, int height) = 0; - - /** - * Creates empty ImageData with the given size. - * @param The width of the ImageData. - * @param The height of the ImageData. - * @param The data to load into the ImageData. - * @return The new ImageData. - **/ - virtual ImageData *newImageData(int width, int height, void *data) = 0; - -}; // Image - -} // image -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_IMAGE_IMAGE_H +#define LOVE_IMAGE_IMAGE_H + +// LOVE +#include "common/config.h" +#include "common/Module.h" +#include "filesystem/File.h" +#include "ImageData.h" + +namespace love +{ +namespace image +{ + +/** + * This module is responsible for decoding files such as PNG, GIF, JPEG + * into raw pixel data. This module does not know how to draw images on + * screen; only love.graphics knows that. + **/ +class Image : public Module +{ +public: + + /** + * Destructor. + **/ + virtual ~Image() {}; + + /** + * Creates new ImageData from a file. + * @param file The file containing the encoded image data. + * @return The new ImageData. + **/ + virtual ImageData *newImageData(love::filesystem::File *file) = 0; + + /** + * Creates new ImageData from a raw Data. + * @param data The object containing encoded pixel data. + * @return The new ImageData. + **/ + virtual ImageData *newImageData(Data *data) = 0; + + /** + * Creates empty ImageData with the given size. + * @param The width of the ImageData. + * @param The height of the ImageData. + * @return The new ImageData. + **/ + virtual ImageData *newImageData(int width, int height) = 0; + + /** + * Creates empty ImageData with the given size. + * @param The width of the ImageData. + * @param The height of the ImageData. + * @param The data to load into the ImageData. + * @return The new ImageData. + **/ + virtual ImageData *newImageData(int width, int height, void *data) = 0; + +}; // Image + +} // image +} // love + #endif // LOVE_IMAGE_IMAGE_H \ No newline at end of file diff --git a/src/modules/image/ImageData.cpp b/src/modules/image/ImageData.cpp index 89748fd76..13880ee01 100644 --- a/src/modules/image/ImageData.cpp +++ b/src/modules/image/ImageData.cpp @@ -1,167 +1,167 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "ImageData.h" - -using love::thread::Lock; - -namespace love -{ -namespace image -{ - -void *ImageData::getData() const -{ - return data; -} - -int ImageData::getSize() const -{ - return getWidth()*getHeight()*sizeof(pixel); -} - -int ImageData::getWidth() const -{ - return width; -} - -int ImageData::getHeight() const -{ - return height; -} - -bool ImageData::inside(int x, int y) const -{ - return x >= 0 && x < getWidth() && y >= 0 && y < getHeight(); -} - -void ImageData::setPixel(int x, int y, pixel c) -{ - if (!inside(x, y)) - throw love::Exception("Attempt to set out-of-range pixel!"); - - Lock lock(mutex); - - pixel *pixels = (pixel *)getData(); - pixels[y*getWidth()+x] = c; -} - -pixel ImageData::getPixel(int x, int y) -{ - if (!inside(x, y)) - throw love::Exception("Attempt to get out-of-range pixel!"); - - Lock lock(mutex); - - pixel *pixels = (pixel *)getData(); - return pixels[y*getWidth()+x]; -} - -void ImageData::paste(ImageData *src, int dx, int dy, int sx, int sy, int sw, int sh) -{ - Lock lock2(src->mutex); - Lock lock1(mutex); - - pixel *s = (pixel *)src->getData(); - pixel *d = (pixel *)getData(); - - // Check bounds; if the data ends up completely out of bounds, get out early. - if (sx >= src->getWidth() || sx + sw < 0 || sy >= src->getHeight() || sy + sh < 0 - || dx >= getWidth() || dx + sw < 0 || dy >= getHeight() || dy + sh < 0) - return; - - // Normalize values to the inside of both images. - if (dx < 0) - { - sw += dx; - sx -= dx; - dx = 0; - } - if (dy < 0) - { - sh += dy; - sy -= dy; - dy = 0; - } - if (sx < 0) - { - sw += sx; - dx -= sx; - sx = 0; - } - if (sy < 0) - { - sh += sy; - dy -= sy; - sy = 0; - } - if (dx + sw > getWidth()) - { - sw = getWidth() - dx; - } - if (dy + sh > getHeight()) - { - sh = getHeight() - dy; - } - if (sx + sw > src->getWidth()) - { - sw = src->getWidth() - sx; - } - if (sy + sh > src->getHeight()) - { - sh = src->getHeight() - sy; - } - - // If the dimensions match up, copy the entire memory stream in one go - if (sw == getWidth() && getWidth() == src->getWidth() - && sh == getHeight() && getHeight() == src->getHeight()) - memcpy(d, s, sizeof(pixel) * sw * sh); - else if (sw > 0 && sh > 0) // Otherwise, copy each row individually - { - for (int i = 0; i < sh; i++) - { - memcpy(d + dx + (i + dy) * getWidth(), s + sx + (i + sy) * src->getWidth(), sizeof(pixel) * sw); - } - } -} - -bool ImageData::getConstant(const char *in, ImageData::Format &out) -{ - return formats.find(in, out); -} - -bool ImageData::getConstant(ImageData::Format in, const char *&out) -{ - return formats.find(in, out); -} - -StringMap::Entry ImageData::formatEntries[] = -{ - {"tga", ImageData::FORMAT_TGA}, - {"bmp", ImageData::FORMAT_BMP}, - {"gif", ImageData::FORMAT_GIF}, - {"jpg", ImageData::FORMAT_JPG}, - {"png", ImageData::FORMAT_PNG}, -}; - -StringMap ImageData::formats(ImageData::formatEntries, sizeof(ImageData::formatEntries)); - -} // image -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "ImageData.h" + +using love::thread::Lock; + +namespace love +{ +namespace image +{ + +void *ImageData::getData() const +{ + return data; +} + +int ImageData::getSize() const +{ + return getWidth()*getHeight()*sizeof(pixel); +} + +int ImageData::getWidth() const +{ + return width; +} + +int ImageData::getHeight() const +{ + return height; +} + +bool ImageData::inside(int x, int y) const +{ + return x >= 0 && x < getWidth() && y >= 0 && y < getHeight(); +} + +void ImageData::setPixel(int x, int y, pixel c) +{ + if (!inside(x, y)) + throw love::Exception("Attempt to set out-of-range pixel!"); + + Lock lock(mutex); + + pixel *pixels = (pixel *)getData(); + pixels[y*getWidth()+x] = c; +} + +pixel ImageData::getPixel(int x, int y) +{ + if (!inside(x, y)) + throw love::Exception("Attempt to get out-of-range pixel!"); + + Lock lock(mutex); + + pixel *pixels = (pixel *)getData(); + return pixels[y*getWidth()+x]; +} + +void ImageData::paste(ImageData *src, int dx, int dy, int sx, int sy, int sw, int sh) +{ + Lock lock2(src->mutex); + Lock lock1(mutex); + + pixel *s = (pixel *)src->getData(); + pixel *d = (pixel *)getData(); + + // Check bounds; if the data ends up completely out of bounds, get out early. + if (sx >= src->getWidth() || sx + sw < 0 || sy >= src->getHeight() || sy + sh < 0 + || dx >= getWidth() || dx + sw < 0 || dy >= getHeight() || dy + sh < 0) + return; + + // Normalize values to the inside of both images. + if (dx < 0) + { + sw += dx; + sx -= dx; + dx = 0; + } + if (dy < 0) + { + sh += dy; + sy -= dy; + dy = 0; + } + if (sx < 0) + { + sw += sx; + dx -= sx; + sx = 0; + } + if (sy < 0) + { + sh += sy; + dy -= sy; + sy = 0; + } + if (dx + sw > getWidth()) + { + sw = getWidth() - dx; + } + if (dy + sh > getHeight()) + { + sh = getHeight() - dy; + } + if (sx + sw > src->getWidth()) + { + sw = src->getWidth() - sx; + } + if (sy + sh > src->getHeight()) + { + sh = src->getHeight() - sy; + } + + // If the dimensions match up, copy the entire memory stream in one go + if (sw == getWidth() && getWidth() == src->getWidth() + && sh == getHeight() && getHeight() == src->getHeight()) + memcpy(d, s, sizeof(pixel) * sw * sh); + else if (sw > 0 && sh > 0) // Otherwise, copy each row individually + { + for (int i = 0; i < sh; i++) + { + memcpy(d + dx + (i + dy) * getWidth(), s + sx + (i + sy) * src->getWidth(), sizeof(pixel) * sw); + } + } +} + +bool ImageData::getConstant(const char *in, ImageData::Format &out) +{ + return formats.find(in, out); +} + +bool ImageData::getConstant(ImageData::Format in, const char *&out) +{ + return formats.find(in, out); +} + +StringMap::Entry ImageData::formatEntries[] = +{ + {"tga", ImageData::FORMAT_TGA}, + {"bmp", ImageData::FORMAT_BMP}, + {"gif", ImageData::FORMAT_GIF}, + {"jpg", ImageData::FORMAT_JPG}, + {"png", ImageData::FORMAT_PNG}, +}; + +StringMap ImageData::formats(ImageData::formatEntries, sizeof(ImageData::formatEntries)); + +} // image +} // love diff --git a/src/modules/image/ImageData.h b/src/modules/image/ImageData.h index 69cf810a2..ebc9df682 100644 --- a/src/modules/image/ImageData.h +++ b/src/modules/image/ImageData.h @@ -1,151 +1,151 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_IMAGE_IMAGE_DATA_H -#define LOVE_IMAGE_IMAGE_DATA_H - -// LOVE -#include "common/Data.h" -#include "filesystem/File.h" -#include "thread/threads.h" - -using love::thread::Mutex; - -namespace love -{ -namespace image -{ - -// Pixel format structure. -struct pixel -{ - // Red, green, blue, alpha. - unsigned char r, g, b, a; -}; - -/** - * Represents raw pixel data. - **/ -class ImageData : public Data -{ -protected: - - // The width of the image data. - int width; - - // The height of the image data. - int height; - - // The actual data. - unsigned char *data; - - // We need to be thread-safe - // so we lock when we're accessing our - // data - Mutex mutex; - -public: - - enum Format - { - FORMAT_TGA = 1, - FORMAT_BMP, - FORMAT_GIF, - FORMAT_JPG, - FORMAT_PNG, - FORMAT_MAX_ENUM - }; - - /** - * Destructor. - **/ - virtual ~ImageData() {}; - - static bool getConstant(const char *in, Format &out); - static bool getConstant(Format in, const char *&out); - - /** - * Paste part of one ImageData onto another. The subregion defined by the top-left - * corner (sx, sy) and the size (sw,sh) will be pasted to (dx,dy) in this ImageData. - * @param dx The destination x-coordinate. - * @param dy The destination y-coordinate. - * @param sx The source x-coordinate. - * @param sy The source y-coordinate. - * @param sw The source width. - * @param sh The source height. - **/ - void paste(ImageData *src, int dx, int dy, int sx, int sy, int sw, int sh); - - /** - * Checks whether a position is inside this ImageData. Useful for checking bounds. - * @param x The position along the x-axis. - * @param y The position along the y-axis. - **/ - bool inside(int x, int y) const; - - /** - * Gets the width of this ImageData. - * @return The width of this ImageData. - **/ - int getWidth() const; - - /** - * Gets the height of this ImageData. - * @return The height of this ImageData. - **/ - int getHeight() const; - - /** - * Sets the pixel at location (x,y). - * @param x The location along the x-axis. - * @param y The location along the y-axis. - * @param p The color to use for the given location. - **/ - void setPixel(int x, int y, pixel p); - - /** - * Gets the pixel at location (x,y). - * @param x The location along the x-axis. - * @param y The location along the y-axis. - * @return The color for the given location. - **/ - pixel getPixel(int x, int y); - - /** - * Encodes raw pixel data into a given format. - * @param f The file to save the encoded image data to. - * @param format The format of the encoded data. - **/ - virtual void encode(love::filesystem::File *f, Format format) = 0; - - // Implements Data. - void *getData() const; - int getSize() const; - -private: - static StringMap::Entry formatEntries[]; - static StringMap formats; - -}; // ImageData - -} // image -} // love - -#endif // LOVE_IMAGE_IMAGE_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_IMAGE_IMAGE_DATA_H +#define LOVE_IMAGE_IMAGE_DATA_H + +// LOVE +#include "common/Data.h" +#include "filesystem/File.h" +#include "thread/threads.h" + +using love::thread::Mutex; + +namespace love +{ +namespace image +{ + +// Pixel format structure. +struct pixel +{ + // Red, green, blue, alpha. + unsigned char r, g, b, a; +}; + +/** + * Represents raw pixel data. + **/ +class ImageData : public Data +{ +protected: + + // The width of the image data. + int width; + + // The height of the image data. + int height; + + // The actual data. + unsigned char *data; + + // We need to be thread-safe + // so we lock when we're accessing our + // data + Mutex mutex; + +public: + + enum Format + { + FORMAT_TGA = 1, + FORMAT_BMP, + FORMAT_GIF, + FORMAT_JPG, + FORMAT_PNG, + FORMAT_MAX_ENUM + }; + + /** + * Destructor. + **/ + virtual ~ImageData() {}; + + static bool getConstant(const char *in, Format &out); + static bool getConstant(Format in, const char *&out); + + /** + * Paste part of one ImageData onto another. The subregion defined by the top-left + * corner (sx, sy) and the size (sw,sh) will be pasted to (dx,dy) in this ImageData. + * @param dx The destination x-coordinate. + * @param dy The destination y-coordinate. + * @param sx The source x-coordinate. + * @param sy The source y-coordinate. + * @param sw The source width. + * @param sh The source height. + **/ + void paste(ImageData *src, int dx, int dy, int sx, int sy, int sw, int sh); + + /** + * Checks whether a position is inside this ImageData. Useful for checking bounds. + * @param x The position along the x-axis. + * @param y The position along the y-axis. + **/ + bool inside(int x, int y) const; + + /** + * Gets the width of this ImageData. + * @return The width of this ImageData. + **/ + int getWidth() const; + + /** + * Gets the height of this ImageData. + * @return The height of this ImageData. + **/ + int getHeight() const; + + /** + * Sets the pixel at location (x,y). + * @param x The location along the x-axis. + * @param y The location along the y-axis. + * @param p The color to use for the given location. + **/ + void setPixel(int x, int y, pixel p); + + /** + * Gets the pixel at location (x,y). + * @param x The location along the x-axis. + * @param y The location along the y-axis. + * @return The color for the given location. + **/ + pixel getPixel(int x, int y); + + /** + * Encodes raw pixel data into a given format. + * @param f The file to save the encoded image data to. + * @param format The format of the encoded data. + **/ + virtual void encode(love::filesystem::File *f, Format format) = 0; + + // Implements Data. + void *getData() const; + int getSize() const; + +private: + static StringMap::Entry formatEntries[]; + static StringMap formats; + +}; // ImageData + +} // image +} // love + +#endif // LOVE_IMAGE_IMAGE_DATA_H diff --git a/src/modules/image/devil/Image.cpp b/src/modules/image/devil/Image.cpp index 29167e794..66eda8c34 100644 --- a/src/modules/image/devil/Image.cpp +++ b/src/modules/image/devil/Image.cpp @@ -1,74 +1,74 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Image.h" - -#include "ImageData.h" - -// DevIL -#include - -namespace love -{ -namespace image -{ -namespace devil -{ - -Image::Image() -{ - ilInit(); - ilOriginFunc(IL_ORIGIN_UPPER_LEFT); - ilEnable(IL_ORIGIN_SET); -} - -Image::~Image() -{ - ilShutDown(); -} - -const char *Image::getName() const -{ - return "love.image.devil"; -} - -love::image::ImageData *Image::newImageData(love::filesystem::File *file) -{ - return new ImageData(file); -} - -love::image::ImageData *Image::newImageData(Data *data) -{ - return new ImageData(data); -} - -love::image::ImageData *Image::newImageData(int width, int height) -{ - return new ImageData(width, height); -} - -love::image::ImageData *Image::newImageData(int width, int height, void *data) -{ - return new ImageData(width, height, data); -} - -} // devil -} // image -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Image.h" + +#include "ImageData.h" + +// DevIL +#include + +namespace love +{ +namespace image +{ +namespace devil +{ + +Image::Image() +{ + ilInit(); + ilOriginFunc(IL_ORIGIN_UPPER_LEFT); + ilEnable(IL_ORIGIN_SET); +} + +Image::~Image() +{ + ilShutDown(); +} + +const char *Image::getName() const +{ + return "love.image.devil"; +} + +love::image::ImageData *Image::newImageData(love::filesystem::File *file) +{ + return new ImageData(file); +} + +love::image::ImageData *Image::newImageData(Data *data) +{ + return new ImageData(data); +} + +love::image::ImageData *Image::newImageData(int width, int height) +{ + return new ImageData(width, height); +} + +love::image::ImageData *Image::newImageData(int width, int height, void *data) +{ + return new ImageData(width, height, data); +} + +} // devil +} // image +} // love diff --git a/src/modules/image/devil/Image.h b/src/modules/image/devil/Image.h index 137edfdaf..8e3294475 100644 --- a/src/modules/image/devil/Image.h +++ b/src/modules/image/devil/Image.h @@ -1,55 +1,55 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_IMAGE_DEVIL_IMAGE_H -#define LOVE_IMAGE_DEVIL_IMAGE_H - -// LOVE -#include "image/Image.h" - -namespace love -{ -namespace image -{ -namespace devil -{ - -class Image : public love::image::Image -{ -public: - - Image(); - ~Image(); - - // Implements Module. - const char *getName() const; - - love::image::ImageData *newImageData(love::filesystem::File *file); - love::image::ImageData *newImageData(Data *data); - love::image::ImageData *newImageData(int width, int height); - love::image::ImageData *newImageData(int width, int height, void *data); - -}; // Image - -} // devil -} // image -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_IMAGE_DEVIL_IMAGE_H +#define LOVE_IMAGE_DEVIL_IMAGE_H + +// LOVE +#include "image/Image.h" + +namespace love +{ +namespace image +{ +namespace devil +{ + +class Image : public love::image::Image +{ +public: + + Image(); + ~Image(); + + // Implements Module. + const char *getName() const; + + love::image::ImageData *newImageData(love::filesystem::File *file); + love::image::ImageData *newImageData(Data *data); + love::image::ImageData *newImageData(int width, int height); + love::image::ImageData *newImageData(int width, int height, void *data); + +}; // Image + +} // devil +} // image +} // love + #endif // LOVE_IMAGE_DEVIL_IMAGE_H \ No newline at end of file diff --git a/src/modules/image/devil/ImageData.cpp b/src/modules/image/devil/ImageData.cpp index 749591284..3c6303f26 100644 --- a/src/modules/image/devil/ImageData.cpp +++ b/src/modules/image/devil/ImageData.cpp @@ -1,227 +1,227 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "ImageData.h" - -// STD -#include -#include - -// LOVE -#include "common/Exception.h" -#include "common/math.h" -#include "filesystem/File.h" - -using love::thread::Lock; - -static Mutex devilMutex; - -namespace love -{ -namespace image -{ -namespace devil -{ - -static inline void ilxClearErrors() -{ - while (ilGetError() != IL_NO_ERROR); -} - -ImageData::ImageData(Data *data) -{ - load(data); -} - -ImageData::ImageData(filesystem::File *file) -{ - Data *data = file->read(); - load(data); - data->release(); -} - -ImageData::ImageData(int width, int height) -{ - this->width = width; - this->height = height; - create(width, height); - - // Set to black. - memset(data, 0, width*height*4); -} - -ImageData::ImageData(int width, int height, void *data) -{ - this->width = width; - this->height = height; - create(width, height, data); -} - -ImageData::~ImageData() -{ - delete[] data; -} - -void ImageData::create(int width, int height, void *data) -{ - try - { - this->data = new unsigned char[width*height*sizeof(pixel)]; - } - catch(std::bad_alloc &) - { - throw love::Exception("Out of memory"); - } - - if (data) - memcpy(this->data, data, width*height*sizeof(pixel)); -} - -void ImageData::load(Data *data) -{ - Lock lock(devilMutex); - ILuint image; - ilGenImages(1, &image); - ilBindImage(image); - - try - { - bool success = IL_TRUE == ilLoadL(IL_TYPE_UNKNOWN, (void *)data->getData(), data->getSize()); - - if (!success) - throw love::Exception("Could not decode image!"); - - width = ilGetInteger(IL_IMAGE_WIDTH); - height = ilGetInteger(IL_IMAGE_HEIGHT); - - // Make sure the image is in RGBA format. - ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE); - - // This should always be four. - int bpp = ilGetInteger(IL_IMAGE_BPP); - if (bpp != sizeof(pixel)) - throw love::Exception("Could not convert image!"); - - create(width, height, ilGetData()); - } - catch(std::exception &) - { - ilDeleteImages(1, &image); - throw; - } - - ilDeleteImages(1, &image); -} - -void ImageData::encode(love::filesystem::File *f, ImageData::Format format) -{ - Lock lock1(devilMutex); - Lock lock2(mutex); - - ILuint tempimage; - ilGenImages(1, &tempimage); - ilBindImage(tempimage); - ilxClearErrors(); - - ILubyte *encoded_data = NULL; - - try - { - bool success = IL_TRUE == ilTexImage(width, height, 1, sizeof(pixel), IL_RGBA, IL_UNSIGNED_BYTE, this->data); - - ILenum err = ilGetError(); - ilxClearErrors(); - - if (!success) - { - if (err != IL_NO_ERROR) - { - switch (err) - { - case IL_ILLEGAL_OPERATION: - throw love::Exception("Illegal operation"); - case IL_INVALID_PARAM: - throw love::Exception("Invalid parameters"); - case IL_OUT_OF_MEMORY: - throw love::Exception("Out of memory"); - default: - throw love::Exception("Unknown error (%d)", (int) err); - } - } - - throw love::Exception("Could not create image for the encoding!"); - } - - ilRegisterOrigin(IL_ORIGIN_UPPER_LEFT); - - ILuint ilFormat; - switch (format) - { - case ImageData::FORMAT_BMP: - ilFormat = IL_BMP; - break; - case ImageData::FORMAT_TGA: - ilFormat = IL_TGA; - break; - case ImageData::FORMAT_GIF: - ilFormat = IL_GIF; - break; - case ImageData::FORMAT_JPG: - ilFormat = IL_JPG; - break; - case ImageData::FORMAT_PNG: - default: // PNG is the default format - ilFormat = IL_PNG; - break; - } - - ILuint size = ilSaveL(ilFormat, NULL, 0); - if (!size) - throw love::Exception("Could not encode image!"); - - try - { - encoded_data = new ILubyte[size]; - } - catch(std::bad_alloc &) - { - throw love::Exception("Out of memory"); - } - - ilSaveL(ilFormat, encoded_data, size); - - f->open(love::filesystem::File::WRITE); - f->write(encoded_data, size); - f->close(); - } - catch(std::exception &) - { - ilDeleteImages(1, &tempimage); - delete[] encoded_data; - throw; - } - - ilDeleteImages(1, &tempimage); - delete[] encoded_data; -} - -} // devil -} // image -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "ImageData.h" + +// STD +#include +#include + +// LOVE +#include "common/Exception.h" +#include "common/math.h" +#include "filesystem/File.h" + +using love::thread::Lock; + +static Mutex devilMutex; + +namespace love +{ +namespace image +{ +namespace devil +{ + +static inline void ilxClearErrors() +{ + while (ilGetError() != IL_NO_ERROR); +} + +ImageData::ImageData(Data *data) +{ + load(data); +} + +ImageData::ImageData(filesystem::File *file) +{ + Data *data = file->read(); + load(data); + data->release(); +} + +ImageData::ImageData(int width, int height) +{ + this->width = width; + this->height = height; + create(width, height); + + // Set to black. + memset(data, 0, width*height*4); +} + +ImageData::ImageData(int width, int height, void *data) +{ + this->width = width; + this->height = height; + create(width, height, data); +} + +ImageData::~ImageData() +{ + delete[] data; +} + +void ImageData::create(int width, int height, void *data) +{ + try + { + this->data = new unsigned char[width*height*sizeof(pixel)]; + } + catch(std::bad_alloc &) + { + throw love::Exception("Out of memory"); + } + + if (data) + memcpy(this->data, data, width*height*sizeof(pixel)); +} + +void ImageData::load(Data *data) +{ + Lock lock(devilMutex); + ILuint image; + ilGenImages(1, &image); + ilBindImage(image); + + try + { + bool success = IL_TRUE == ilLoadL(IL_TYPE_UNKNOWN, (void *)data->getData(), data->getSize()); + + if (!success) + throw love::Exception("Could not decode image!"); + + width = ilGetInteger(IL_IMAGE_WIDTH); + height = ilGetInteger(IL_IMAGE_HEIGHT); + + // Make sure the image is in RGBA format. + ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE); + + // This should always be four. + int bpp = ilGetInteger(IL_IMAGE_BPP); + if (bpp != sizeof(pixel)) + throw love::Exception("Could not convert image!"); + + create(width, height, ilGetData()); + } + catch(std::exception &) + { + ilDeleteImages(1, &image); + throw; + } + + ilDeleteImages(1, &image); +} + +void ImageData::encode(love::filesystem::File *f, ImageData::Format format) +{ + Lock lock1(devilMutex); + Lock lock2(mutex); + + ILuint tempimage; + ilGenImages(1, &tempimage); + ilBindImage(tempimage); + ilxClearErrors(); + + ILubyte *encoded_data = NULL; + + try + { + bool success = IL_TRUE == ilTexImage(width, height, 1, sizeof(pixel), IL_RGBA, IL_UNSIGNED_BYTE, this->data); + + ILenum err = ilGetError(); + ilxClearErrors(); + + if (!success) + { + if (err != IL_NO_ERROR) + { + switch (err) + { + case IL_ILLEGAL_OPERATION: + throw love::Exception("Illegal operation"); + case IL_INVALID_PARAM: + throw love::Exception("Invalid parameters"); + case IL_OUT_OF_MEMORY: + throw love::Exception("Out of memory"); + default: + throw love::Exception("Unknown error (%d)", (int) err); + } + } + + throw love::Exception("Could not create image for the encoding!"); + } + + ilRegisterOrigin(IL_ORIGIN_UPPER_LEFT); + + ILuint ilFormat; + switch (format) + { + case ImageData::FORMAT_BMP: + ilFormat = IL_BMP; + break; + case ImageData::FORMAT_TGA: + ilFormat = IL_TGA; + break; + case ImageData::FORMAT_GIF: + ilFormat = IL_GIF; + break; + case ImageData::FORMAT_JPG: + ilFormat = IL_JPG; + break; + case ImageData::FORMAT_PNG: + default: // PNG is the default format + ilFormat = IL_PNG; + break; + } + + ILuint size = ilSaveL(ilFormat, NULL, 0); + if (!size) + throw love::Exception("Could not encode image!"); + + try + { + encoded_data = new ILubyte[size]; + } + catch(std::bad_alloc &) + { + throw love::Exception("Out of memory"); + } + + ilSaveL(ilFormat, encoded_data, size); + + f->open(love::filesystem::File::WRITE); + f->write(encoded_data, size); + f->close(); + } + catch(std::exception &) + { + ilDeleteImages(1, &tempimage); + delete[] encoded_data; + throw; + } + + ilDeleteImages(1, &tempimage); + delete[] encoded_data; +} + +} // devil +} // image +} // love diff --git a/src/modules/image/devil/ImageData.h b/src/modules/image/devil/ImageData.h index 4d600d899..1b9769214 100644 --- a/src/modules/image/devil/ImageData.h +++ b/src/modules/image/devil/ImageData.h @@ -1,66 +1,66 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_DEVIL_IMAGE_DATA_H -#define LOVE_DEVIL_IMAGE_DATA_H - -// LOVE -#include "filesystem/File.h" -#include "image/ImageData.h" - -// DevIL -#include - - -namespace love -{ -namespace image -{ -namespace devil -{ - -class ImageData : public love::image::ImageData -{ -private: - - // Create imagedata. Initialize with data if not null. - void create(int width, int height, void *data = 0); - - // Load an encoded format. - void load(Data *data); - -public: - - ImageData(Data *data); - ImageData(love::filesystem::File *file); - ImageData(int width, int height); - ImageData(int width, int height, void *data); - virtual ~ImageData(); - - // Implements ImageData. - void encode(love::filesystem::File *f, Format format); - -}; // ImageData - -} // devil -} // image -} // love - -#endif // LOVE_DEVIL_IMAGE_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_DEVIL_IMAGE_DATA_H +#define LOVE_DEVIL_IMAGE_DATA_H + +// LOVE +#include "filesystem/File.h" +#include "image/ImageData.h" + +// DevIL +#include + + +namespace love +{ +namespace image +{ +namespace devil +{ + +class ImageData : public love::image::ImageData +{ +private: + + // Create imagedata. Initialize with data if not null. + void create(int width, int height, void *data = 0); + + // Load an encoded format. + void load(Data *data); + +public: + + ImageData(Data *data); + ImageData(love::filesystem::File *file); + ImageData(int width, int height); + ImageData(int width, int height, void *data); + virtual ~ImageData(); + + // Implements ImageData. + void encode(love::filesystem::File *f, Format format); + +}; // ImageData + +} // devil +} // image +} // love + +#endif // LOVE_DEVIL_IMAGE_DATA_H diff --git a/src/modules/image/wrap_Image.cpp b/src/modules/image/wrap_Image.cpp index 1aaabf637..3786f4170 100644 --- a/src/modules/image/wrap_Image.cpp +++ b/src/modules/image/wrap_Image.cpp @@ -1,136 +1,136 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Image.h" - -#include "common/Data.h" -#include "common/StringMap.h" - -#include "devil/Image.h" - -namespace love -{ -namespace image -{ - -static Image *instance = 0; - -int w_newImageData(lua_State *L) -{ - // Case 1: Integers. - if (lua_isnumber(L, 1)) - { - int w = luaL_checkint(L, 1); - int h = luaL_checkint(L, 2); - if (w <= 0 || h <= 0) - return luaL_error(L, "Invalid image size."); - - ImageData *t = 0; - try - { - t = instance->newImageData(w, h); - } - catch(love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)t); - return 1; - } - - // Case 2: Data - if (luax_istype(L, 1, DATA_T)) - { - Data *d = luax_checktype(L, 1, "Data", DATA_T); - ImageData *t = 0; - try - { - t = instance->newImageData(d); - } - catch(love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)t); - return 1; - } - - // Case 3: String/File. - - // Convert to File, if necessary. - if (lua_isstring(L, 1)) - luax_convobj(L, 1, "filesystem", "newFile"); - - love::filesystem::File *file = luax_checktype(L, 1, "File", FILESYSTEM_FILE_T); - - ImageData *t = 0; - try - { - t = instance->newImageData(file); - } - catch(love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)t); - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "newImageData", w_newImageData }, - { 0, 0 } -}; - -static const lua_CFunction types[] = -{ - luaopen_imagedata, - 0 -}; - -extern "C" int luaopen_love_image(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new love::image::devil::Image(); - } - catch(Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "image"; - w.flags = MODULE_IMAGE_T; - w.functions = functions; - w.types = types; - - return luax_register_module(L, w); -} - -} // image -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Image.h" + +#include "common/Data.h" +#include "common/StringMap.h" + +#include "devil/Image.h" + +namespace love +{ +namespace image +{ + +static Image *instance = 0; + +int w_newImageData(lua_State *L) +{ + // Case 1: Integers. + if (lua_isnumber(L, 1)) + { + int w = luaL_checkint(L, 1); + int h = luaL_checkint(L, 2); + if (w <= 0 || h <= 0) + return luaL_error(L, "Invalid image size."); + + ImageData *t = 0; + try + { + t = instance->newImageData(w, h); + } + catch(love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)t); + return 1; + } + + // Case 2: Data + if (luax_istype(L, 1, DATA_T)) + { + Data *d = luax_checktype(L, 1, "Data", DATA_T); + ImageData *t = 0; + try + { + t = instance->newImageData(d); + } + catch(love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)t); + return 1; + } + + // Case 3: String/File. + + // Convert to File, if necessary. + if (lua_isstring(L, 1)) + luax_convobj(L, 1, "filesystem", "newFile"); + + love::filesystem::File *file = luax_checktype(L, 1, "File", FILESYSTEM_FILE_T); + + ImageData *t = 0; + try + { + t = instance->newImageData(file); + } + catch(love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)t); + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "newImageData", w_newImageData }, + { 0, 0 } +}; + +static const lua_CFunction types[] = +{ + luaopen_imagedata, + 0 +}; + +extern "C" int luaopen_love_image(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new love::image::devil::Image(); + } + catch(Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "image"; + w.flags = MODULE_IMAGE_T; + w.functions = functions; + w.types = types; + + return luax_register_module(L, w); +} + +} // image +} // love diff --git a/src/modules/image/wrap_Image.h b/src/modules/image/wrap_Image.h index 2616548ea..ce832478e 100644 --- a/src/modules/image/wrap_Image.h +++ b/src/modules/image/wrap_Image.h @@ -1,40 +1,40 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_IMAGE_WRAP_IMAGE_H -#define LOVE_IMAGE_WRAP_IMAGE_H - -// LOVE -#include "Image.h" -#include "wrap_ImageData.h" - -namespace love -{ -namespace image -{ - -int w_getFormats(lua_State *L); -int w_newImageData(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_image(lua_State *L); - -} // image -} // love - -#endif // LOVE_IMAGE_WRAP_IMAGE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_IMAGE_WRAP_IMAGE_H +#define LOVE_IMAGE_WRAP_IMAGE_H + +// LOVE +#include "Image.h" +#include "wrap_ImageData.h" + +namespace love +{ +namespace image +{ + +int w_getFormats(lua_State *L); +int w_newImageData(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_image(lua_State *L); + +} // image +} // love + +#endif // LOVE_IMAGE_WRAP_IMAGE_H diff --git a/src/modules/image/wrap_ImageData.cpp b/src/modules/image/wrap_ImageData.cpp index e0579b724..1b2b21c09 100644 --- a/src/modules/image/wrap_ImageData.cpp +++ b/src/modules/image/wrap_ImageData.cpp @@ -1,206 +1,206 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_ImageData.h" - -#include "common/wrap_Data.h" -#include "filesystem/File.h" - -namespace love -{ -namespace image -{ - -ImageData *luax_checkimagedata(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "ImageData", IMAGE_IMAGE_DATA_T); -} - -int w_ImageData_getWidth(lua_State *L) -{ - ImageData *t = luax_checkimagedata(L, 1); - lua_pushinteger(L, t->getWidth()); - return 1; -} - -int w_ImageData_getHeight(lua_State *L) -{ - ImageData *t = luax_checkimagedata(L, 1); - lua_pushinteger(L, t->getHeight()); - return 1; -} - -int w_ImageData_getPixel(lua_State *L) -{ - ImageData *t = luax_checkimagedata(L, 1); - int x = luaL_checkint(L, 2); - int y = luaL_checkint(L, 3); - pixel c; - try - { - c = t->getPixel(x, y); - } - catch(love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - lua_pushnumber(L, c.r); - lua_pushnumber(L, c.g); - lua_pushnumber(L, c.b); - lua_pushnumber(L, c.a); - return 4; -} - -int w_ImageData_setPixel(lua_State *L) -{ - ImageData *t = luax_checkimagedata(L, 1); - int x = luaL_checkint(L, 2); - int y = luaL_checkint(L, 3); - pixel c; - c.r = luaL_checkint(L, 4); - c.g = luaL_checkint(L, 5); - c.b = luaL_checkint(L, 6); - c.a = luaL_checkint(L, 7); - try - { - t->setPixel(x, y, c); - } - catch(love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - return 0; -} - -int w_ImageData_mapPixel(lua_State *L) -{ - ImageData *t = luax_checkimagedata(L, 1); - - if (!lua_isfunction(L, 2)) - return luaL_error(L, "Function expected"); - - int w = t->getWidth(); - int h = t->getHeight(); - - for (int i = 0; i < w; i++) - { - for (int j = 0; j < h; j++) - { - lua_pushvalue(L, 2); - lua_pushnumber(L, i); - lua_pushnumber(L, j); - pixel c = t->getPixel(i, j); - lua_pushnumber(L, c.r); - lua_pushnumber(L, c.g); - lua_pushnumber(L, c.b); - lua_pushnumber(L, c.a); - lua_call(L, 6, 4); - c.r = luaL_optint(L, -4, 0); - c.g = luaL_optint(L, -3, 0); - c.b = luaL_optint(L, -2, 0); - c.a = luaL_optint(L, -1, 0); - t->setPixel(i, j, c); - lua_pop(L, 4); - } - } - return 0; -} - -int w_ImageData_getString(lua_State *L) -{ - ImageData *t = luax_checkimagedata(L, 1); - lua_pushlstring(L, (const char *)t->getData(), t->getSize()); - return 1; -} - -int w_ImageData_paste(lua_State *L) -{ - ImageData *t = luax_checkimagedata(L, 1); - ImageData *src = luax_checkimagedata(L, 2); - int dx = luaL_checkint(L, 3); - int dy = luaL_checkint(L, 4); - int sx = luaL_optint(L, 5, 0); - int sy = luaL_optint(L, 6, 0); - int sw = luaL_optint(L, 7, src->getWidth()); - int sh = luaL_optint(L, 8, src->getHeight()); - t->paste((love::image::ImageData *)src, dx, dy, sx, sy, sw, sh); - return 0; -} - -int w_ImageData_encode(lua_State *L) -{ - std::string ext; - const char *fmt; - ImageData::Format format = ImageData::FORMAT_MAX_ENUM; - ImageData *t = luax_checkimagedata(L, 1); - - if (lua_isstring(L, 2)) - luax_convobj(L, 2, "filesystem", "newFile"); - love::filesystem::File *file = luax_checktype(L, 2, "File", FILESYSTEM_FILE_T); - - if (lua_isnoneornil(L, 3)) - { - ext = file->getExtension(); - fmt = ext.c_str(); - ImageData::getConstant(fmt, format); - } - else - { - fmt = luaL_checkstring(L, 3); - if (!ImageData::getConstant(fmt, format)) - luaL_error(L, "Invalid image format."); - } - - try - { - t->encode(file, format); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - return 0; -} - -static const luaL_Reg functions[] = -{ - - // Data - { "getPointer", w_Data_getPointer }, - { "getSize", w_Data_getSize }, - - { "getWidth", w_ImageData_getWidth }, - { "getHeight", w_ImageData_getHeight }, - { "getPixel", w_ImageData_getPixel }, - { "setPixel", w_ImageData_setPixel }, - { "mapPixel", w_ImageData_mapPixel }, - { "getString", w_ImageData_getString }, - { "paste", w_ImageData_paste }, - { "encode", w_ImageData_encode }, - { 0, 0 } -}; - -extern "C" int luaopen_imagedata(lua_State *L) -{ - return luax_register_type(L, "ImageData", functions); -} - -} // image -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_ImageData.h" + +#include "common/wrap_Data.h" +#include "filesystem/File.h" + +namespace love +{ +namespace image +{ + +ImageData *luax_checkimagedata(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "ImageData", IMAGE_IMAGE_DATA_T); +} + +int w_ImageData_getWidth(lua_State *L) +{ + ImageData *t = luax_checkimagedata(L, 1); + lua_pushinteger(L, t->getWidth()); + return 1; +} + +int w_ImageData_getHeight(lua_State *L) +{ + ImageData *t = luax_checkimagedata(L, 1); + lua_pushinteger(L, t->getHeight()); + return 1; +} + +int w_ImageData_getPixel(lua_State *L) +{ + ImageData *t = luax_checkimagedata(L, 1); + int x = luaL_checkint(L, 2); + int y = luaL_checkint(L, 3); + pixel c; + try + { + c = t->getPixel(x, y); + } + catch(love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + lua_pushnumber(L, c.r); + lua_pushnumber(L, c.g); + lua_pushnumber(L, c.b); + lua_pushnumber(L, c.a); + return 4; +} + +int w_ImageData_setPixel(lua_State *L) +{ + ImageData *t = luax_checkimagedata(L, 1); + int x = luaL_checkint(L, 2); + int y = luaL_checkint(L, 3); + pixel c; + c.r = luaL_checkint(L, 4); + c.g = luaL_checkint(L, 5); + c.b = luaL_checkint(L, 6); + c.a = luaL_checkint(L, 7); + try + { + t->setPixel(x, y, c); + } + catch(love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + return 0; +} + +int w_ImageData_mapPixel(lua_State *L) +{ + ImageData *t = luax_checkimagedata(L, 1); + + if (!lua_isfunction(L, 2)) + return luaL_error(L, "Function expected"); + + int w = t->getWidth(); + int h = t->getHeight(); + + for (int i = 0; i < w; i++) + { + for (int j = 0; j < h; j++) + { + lua_pushvalue(L, 2); + lua_pushnumber(L, i); + lua_pushnumber(L, j); + pixel c = t->getPixel(i, j); + lua_pushnumber(L, c.r); + lua_pushnumber(L, c.g); + lua_pushnumber(L, c.b); + lua_pushnumber(L, c.a); + lua_call(L, 6, 4); + c.r = luaL_optint(L, -4, 0); + c.g = luaL_optint(L, -3, 0); + c.b = luaL_optint(L, -2, 0); + c.a = luaL_optint(L, -1, 0); + t->setPixel(i, j, c); + lua_pop(L, 4); + } + } + return 0; +} + +int w_ImageData_getString(lua_State *L) +{ + ImageData *t = luax_checkimagedata(L, 1); + lua_pushlstring(L, (const char *)t->getData(), t->getSize()); + return 1; +} + +int w_ImageData_paste(lua_State *L) +{ + ImageData *t = luax_checkimagedata(L, 1); + ImageData *src = luax_checkimagedata(L, 2); + int dx = luaL_checkint(L, 3); + int dy = luaL_checkint(L, 4); + int sx = luaL_optint(L, 5, 0); + int sy = luaL_optint(L, 6, 0); + int sw = luaL_optint(L, 7, src->getWidth()); + int sh = luaL_optint(L, 8, src->getHeight()); + t->paste((love::image::ImageData *)src, dx, dy, sx, sy, sw, sh); + return 0; +} + +int w_ImageData_encode(lua_State *L) +{ + std::string ext; + const char *fmt; + ImageData::Format format = ImageData::FORMAT_MAX_ENUM; + ImageData *t = luax_checkimagedata(L, 1); + + if (lua_isstring(L, 2)) + luax_convobj(L, 2, "filesystem", "newFile"); + love::filesystem::File *file = luax_checktype(L, 2, "File", FILESYSTEM_FILE_T); + + if (lua_isnoneornil(L, 3)) + { + ext = file->getExtension(); + fmt = ext.c_str(); + ImageData::getConstant(fmt, format); + } + else + { + fmt = luaL_checkstring(L, 3); + if (!ImageData::getConstant(fmt, format)) + luaL_error(L, "Invalid image format."); + } + + try + { + t->encode(file, format); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + return 0; +} + +static const luaL_Reg functions[] = +{ + + // Data + { "getPointer", w_Data_getPointer }, + { "getSize", w_Data_getSize }, + + { "getWidth", w_ImageData_getWidth }, + { "getHeight", w_ImageData_getHeight }, + { "getPixel", w_ImageData_getPixel }, + { "setPixel", w_ImageData_setPixel }, + { "mapPixel", w_ImageData_mapPixel }, + { "getString", w_ImageData_getString }, + { "paste", w_ImageData_paste }, + { "encode", w_ImageData_encode }, + { 0, 0 } +}; + +extern "C" int luaopen_imagedata(lua_State *L) +{ + return luax_register_type(L, "ImageData", functions); +} + +} // image +} // love diff --git a/src/modules/image/wrap_ImageData.h b/src/modules/image/wrap_ImageData.h index 427ba59f0..8d281430e 100644 --- a/src/modules/image/wrap_ImageData.h +++ b/src/modules/image/wrap_ImageData.h @@ -1,47 +1,47 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_IMAGE_WRAP_IMAGE_DATA_H -#define LOVE_IMAGE_WRAP_IMAGE_DATA_H - -// LOVE -#include "common/runtime.h" -#include "ImageData.h" - -namespace love -{ -namespace image -{ - -ImageData *luax_checkimagedata(lua_State *L, int idx); -int w_ImageData_getWidth(lua_State *L); -int w_ImageData_getHeight(lua_State *L); -int w_ImageData_getPixel(lua_State *L); -int w_ImageData_setPixel(lua_State *L); -int w_ImageData_mapPixel(lua_State *L); -int w_ImageData_getString(lua_State *L); -int w_ImageData_paste(lua_State *L); -int w_ImageData_encode(lua_State *L); -extern "C" int luaopen_imagedata(lua_State *L); - -} // image -} // love - -#endif // LOVE_IMAGE_WRAP_IMAGE_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_IMAGE_WRAP_IMAGE_DATA_H +#define LOVE_IMAGE_WRAP_IMAGE_DATA_H + +// LOVE +#include "common/runtime.h" +#include "ImageData.h" + +namespace love +{ +namespace image +{ + +ImageData *luax_checkimagedata(lua_State *L, int idx); +int w_ImageData_getWidth(lua_State *L); +int w_ImageData_getHeight(lua_State *L); +int w_ImageData_getPixel(lua_State *L); +int w_ImageData_setPixel(lua_State *L); +int w_ImageData_mapPixel(lua_State *L); +int w_ImageData_getString(lua_State *L); +int w_ImageData_paste(lua_State *L); +int w_ImageData_encode(lua_State *L); +extern "C" int luaopen_imagedata(lua_State *L); + +} // image +} // love + +#endif // LOVE_IMAGE_WRAP_IMAGE_DATA_H diff --git a/src/modules/joystick/Joystick.cpp b/src/modules/joystick/Joystick.cpp index a9dd2b2a8..f97817a8f 100644 --- a/src/modules/joystick/Joystick.cpp +++ b/src/modules/joystick/Joystick.cpp @@ -1,58 +1,58 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Joystick.h" - -namespace love -{ -namespace joystick -{ - -Joystick::~Joystick() -{ -} - -bool Joystick::getConstant(const char *in, Joystick::Hat &out) -{ - return hats.find(in, out); -} - -bool Joystick::getConstant(Joystick::Hat in, const char *&out) -{ - return hats.find(in, out); -} - -StringMap::Entry Joystick::hatEntries[] = -{ - {"c", Joystick::HAT_CENTERED}, - {"u", Joystick::HAT_UP}, - {"r", Joystick::HAT_RIGHT}, - {"d", Joystick::HAT_DOWN}, - {"l", Joystick::HAT_LEFT}, - {"ru", Joystick::HAT_RIGHTUP}, - {"rd", Joystick::HAT_RIGHTDOWN}, - {"lu", Joystick::HAT_LEFTUP}, - {"ld", Joystick::HAT_LEFTDOWN}, -}; - -StringMap Joystick::hats(Joystick::hatEntries, sizeof(Joystick::hatEntries)); - -} // joystick -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Joystick.h" + +namespace love +{ +namespace joystick +{ + +Joystick::~Joystick() +{ +} + +bool Joystick::getConstant(const char *in, Joystick::Hat &out) +{ + return hats.find(in, out); +} + +bool Joystick::getConstant(Joystick::Hat in, const char *&out) +{ + return hats.find(in, out); +} + +StringMap::Entry Joystick::hatEntries[] = +{ + {"c", Joystick::HAT_CENTERED}, + {"u", Joystick::HAT_UP}, + {"r", Joystick::HAT_RIGHT}, + {"d", Joystick::HAT_DOWN}, + {"l", Joystick::HAT_LEFT}, + {"ru", Joystick::HAT_RIGHTUP}, + {"rd", Joystick::HAT_RIGHTDOWN}, + {"lu", Joystick::HAT_LEFTUP}, + {"ld", Joystick::HAT_LEFTDOWN}, +}; + +StringMap Joystick::hats(Joystick::hatEntries, sizeof(Joystick::hatEntries)); + +} // joystick +} // love diff --git a/src/modules/joystick/Joystick.h b/src/modules/joystick/Joystick.h index 71d646f06..78220099c 100644 --- a/src/modules/joystick/Joystick.h +++ b/src/modules/joystick/Joystick.h @@ -1,67 +1,67 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_JOYSTICK_JOYSTICK_H -#define LOVE_JOYSTICK_JOYSTICK_H - -// LOVE -#include "common/Module.h" -#include "common/StringMap.h" - -namespace love -{ -namespace joystick -{ - -class Joystick : public Module -{ -public: - - enum Hat - { - HAT_INVALID, - HAT_CENTERED, - HAT_UP, - HAT_RIGHT, - HAT_DOWN, - HAT_LEFT, - HAT_RIGHTUP, - HAT_RIGHTDOWN, - HAT_LEFTUP, - HAT_LEFTDOWN, - HAT_MAX_ENUM = 16 - }; - - virtual ~Joystick(); - - static bool getConstant(const char *in, Hat &out); - static bool getConstant(Hat in, const char *&out); - -private: - - static StringMap::Entry hatEntries[]; - static StringMap hats; - -}; // Joystick - -} // joystick -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_JOYSTICK_JOYSTICK_H +#define LOVE_JOYSTICK_JOYSTICK_H + +// LOVE +#include "common/Module.h" +#include "common/StringMap.h" + +namespace love +{ +namespace joystick +{ + +class Joystick : public Module +{ +public: + + enum Hat + { + HAT_INVALID, + HAT_CENTERED, + HAT_UP, + HAT_RIGHT, + HAT_DOWN, + HAT_LEFT, + HAT_RIGHTUP, + HAT_RIGHTDOWN, + HAT_LEFTUP, + HAT_LEFTDOWN, + HAT_MAX_ENUM = 16 + }; + + virtual ~Joystick(); + + static bool getConstant(const char *in, Hat &out); + static bool getConstant(Hat in, const char *&out); + +private: + + static StringMap::Entry hatEntries[]; + static StringMap hats; + +}; // Joystick + +} // joystick +} // love + #endif // LOVE_JOYSTICK_JOYSTICK_H \ No newline at end of file diff --git a/src/modules/joystick/sdl/Joystick.cpp b/src/modules/joystick/sdl/Joystick.cpp index 0f44ff672..f52c95729 100644 --- a/src/modules/joystick/sdl/Joystick.cpp +++ b/src/modules/joystick/sdl/Joystick.cpp @@ -1,276 +1,276 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Joystick.h" - -// STD -#include - -namespace love -{ -namespace joystick -{ -namespace sdl -{ - -Joystick::Joystick() - : joysticks(0) -{ - // Init the SDL joystick system. - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) - throw love::Exception("%s", SDL_GetError()); - - // Start joystick event watching. - SDL_JoystickEventState(SDL_ENABLE); - - // Open all connected joysticks. - int numjoysticks = this->getNumJoysticks(); - this->joysticks = (SDL_Joystick **)calloc(numjoysticks, sizeof(SDL_Joystick *)); - - for (int i = 0; iopen(i); -} - -Joystick::~Joystick() -{ - // Closes any open joysticks. - for (int i = 0; i != getNumJoysticks(); i++) - { - if (isOpen(i)) - close(i); - } - - free(joysticks); - - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); -} - -void Joystick::reload() -{ - // Closes any open joysticks. - for (int i = 0; i != getNumJoysticks(); i++) - { - if (isOpen(i)) - close(i); - } - - free(joysticks); - - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) - throw love::Exception("%s", SDL_GetError()); - - int numjoysticks = this->getNumJoysticks(); - this->joysticks = (SDL_Joystick **)calloc(numjoysticks, sizeof(SDL_Joystick *)); - - for (int i = 0; iopen(i); -} - -const char *Joystick::getName() const -{ - return "love.joystick.sdl"; -} - -bool Joystick::checkIndex(int index) -{ - return index >= 0 && index < getNumJoysticks(); -} - -int Joystick::getNumJoysticks() -{ - int num = SDL_NumJoysticks(); - return num < 0 ? 0 : num; -} - -const char *Joystick::getName(int index) -{ - return SDL_JoystickName(index); -} - -bool Joystick::open(int index) -{ - if (isOpen(index)) - return true; - - if (!checkIndex(index)) - return false; - - if (!(joysticks[index] = SDL_JoystickOpen(index))) - return false; - - return true; -} - -bool Joystick::isOpen(int index) -{ - if (!checkIndex(index)) - return false; - - return joysticks[index] != 0 ? true : false; -} - -bool Joystick::verifyJoystick(int index) -{ - if (!checkIndex(index)) - return false; - - if (!isOpen(index)) - return false; - - return true; -} - -int Joystick::getNumAxes(int index) -{ - return verifyJoystick(index) ? SDL_JoystickNumAxes(joysticks[index]) : 0; -} - -int Joystick::getNumBalls(int index) -{ - return verifyJoystick(index) ? SDL_JoystickNumBalls(joysticks[index]) : 0; -} - -int Joystick::getNumButtons(int index) -{ - return verifyJoystick(index) ? SDL_JoystickNumButtons(joysticks[index]) : 0; -} - -int Joystick::getNumHats(int index) -{ - return verifyJoystick(index) ? SDL_JoystickNumHats(joysticks[index]) : 0; -} - -float Joystick::clampval(float x) -{ - if (fabs((double)x) < 0.01) return 0.0f; - if (x < -0.99f) return -1.0f; - if (x > 0.99f) return 1.0f; - return x; -} - -float Joystick::getAxis(int index, int axis) -{ - if (!verifyJoystick(index)) - return 0; - - if (axis >= getNumAxes(index)) - return 0; - - return clampval(((float)SDL_JoystickGetAxis(joysticks[index], axis))/32768.0f); -} - -int Joystick::getAxes(lua_State *L) -{ - love::luax_assert_argc(L, 1, 1); - int index = (int)lua_tointeger(L, 1) - 1; - - if (!verifyJoystick(index)) - return 0; - - int num = getNumAxes(index); - - for (int i = 0; i= getNumBalls(index)) - return 0; - - int dx, dy; - SDL_JoystickGetBall(joysticks[index], ball, &dx, &dy); - - lua_pushnumber(L, dx); - lua_pushnumber(L, dy); - return 2; -} - -bool Joystick::isDown(int index, int *buttonlist) -{ - if (!verifyJoystick(index)) - return false; - - int num = getNumButtons(index); - - for (int button = *buttonlist; button != -1; button = *(++buttonlist)) - { - if (button >= 0 && button < num && SDL_JoystickGetButton(joysticks[index], button) == 1) - return true; - } - - return false; -} - -Joystick::Hat Joystick::getHat(int index, int hat) -{ - Hat h = HAT_INVALID; - - if (!verifyJoystick(index)) - return h; - - if (hat >= getNumHats(index)) - return h; - - hats.find(SDL_JoystickGetHat(joysticks[index], hat), h); - - return h; -} - -void Joystick::close(int index) -{ - if (!checkIndex(index)) - return; - - if (joysticks[index]!=0) - { - SDL_JoystickClose(joysticks[index]); - joysticks[index] = 0; - } -} - -EnumMap::Entry Joystick::hatEntries[] = -{ - {Joystick::HAT_CENTERED, SDL_HAT_CENTERED}, - {Joystick::HAT_UP, SDL_HAT_UP}, - {Joystick::HAT_RIGHT, SDL_HAT_RIGHT}, - {Joystick::HAT_DOWN, SDL_HAT_DOWN}, - {Joystick::HAT_LEFT, SDL_HAT_LEFT}, - {Joystick::HAT_RIGHTUP, SDL_HAT_RIGHTUP}, - {Joystick::HAT_RIGHTDOWN, SDL_HAT_RIGHTDOWN}, - {Joystick::HAT_LEFTUP, SDL_HAT_LEFTUP}, - {Joystick::HAT_LEFTDOWN, SDL_HAT_LEFTDOWN}, -}; - -EnumMap Joystick::hats(Joystick::hatEntries, sizeof(Joystick::hatEntries)); - -} // sdl -} // joystick -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Joystick.h" + +// STD +#include + +namespace love +{ +namespace joystick +{ +namespace sdl +{ + +Joystick::Joystick() + : joysticks(0) +{ + // Init the SDL joystick system. + if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) + throw love::Exception("%s", SDL_GetError()); + + // Start joystick event watching. + SDL_JoystickEventState(SDL_ENABLE); + + // Open all connected joysticks. + int numjoysticks = this->getNumJoysticks(); + this->joysticks = (SDL_Joystick **)calloc(numjoysticks, sizeof(SDL_Joystick *)); + + for (int i = 0; iopen(i); +} + +Joystick::~Joystick() +{ + // Closes any open joysticks. + for (int i = 0; i != getNumJoysticks(); i++) + { + if (isOpen(i)) + close(i); + } + + free(joysticks); + + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); +} + +void Joystick::reload() +{ + // Closes any open joysticks. + for (int i = 0; i != getNumJoysticks(); i++) + { + if (isOpen(i)) + close(i); + } + + free(joysticks); + + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); + + if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) + throw love::Exception("%s", SDL_GetError()); + + int numjoysticks = this->getNumJoysticks(); + this->joysticks = (SDL_Joystick **)calloc(numjoysticks, sizeof(SDL_Joystick *)); + + for (int i = 0; iopen(i); +} + +const char *Joystick::getName() const +{ + return "love.joystick.sdl"; +} + +bool Joystick::checkIndex(int index) +{ + return index >= 0 && index < getNumJoysticks(); +} + +int Joystick::getNumJoysticks() +{ + int num = SDL_NumJoysticks(); + return num < 0 ? 0 : num; +} + +const char *Joystick::getName(int index) +{ + return SDL_JoystickName(index); +} + +bool Joystick::open(int index) +{ + if (isOpen(index)) + return true; + + if (!checkIndex(index)) + return false; + + if (!(joysticks[index] = SDL_JoystickOpen(index))) + return false; + + return true; +} + +bool Joystick::isOpen(int index) +{ + if (!checkIndex(index)) + return false; + + return joysticks[index] != 0 ? true : false; +} + +bool Joystick::verifyJoystick(int index) +{ + if (!checkIndex(index)) + return false; + + if (!isOpen(index)) + return false; + + return true; +} + +int Joystick::getNumAxes(int index) +{ + return verifyJoystick(index) ? SDL_JoystickNumAxes(joysticks[index]) : 0; +} + +int Joystick::getNumBalls(int index) +{ + return verifyJoystick(index) ? SDL_JoystickNumBalls(joysticks[index]) : 0; +} + +int Joystick::getNumButtons(int index) +{ + return verifyJoystick(index) ? SDL_JoystickNumButtons(joysticks[index]) : 0; +} + +int Joystick::getNumHats(int index) +{ + return verifyJoystick(index) ? SDL_JoystickNumHats(joysticks[index]) : 0; +} + +float Joystick::clampval(float x) +{ + if (fabs((double)x) < 0.01) return 0.0f; + if (x < -0.99f) return -1.0f; + if (x > 0.99f) return 1.0f; + return x; +} + +float Joystick::getAxis(int index, int axis) +{ + if (!verifyJoystick(index)) + return 0; + + if (axis >= getNumAxes(index)) + return 0; + + return clampval(((float)SDL_JoystickGetAxis(joysticks[index], axis))/32768.0f); +} + +int Joystick::getAxes(lua_State *L) +{ + love::luax_assert_argc(L, 1, 1); + int index = (int)lua_tointeger(L, 1) - 1; + + if (!verifyJoystick(index)) + return 0; + + int num = getNumAxes(index); + + for (int i = 0; i= getNumBalls(index)) + return 0; + + int dx, dy; + SDL_JoystickGetBall(joysticks[index], ball, &dx, &dy); + + lua_pushnumber(L, dx); + lua_pushnumber(L, dy); + return 2; +} + +bool Joystick::isDown(int index, int *buttonlist) +{ + if (!verifyJoystick(index)) + return false; + + int num = getNumButtons(index); + + for (int button = *buttonlist; button != -1; button = *(++buttonlist)) + { + if (button >= 0 && button < num && SDL_JoystickGetButton(joysticks[index], button) == 1) + return true; + } + + return false; +} + +Joystick::Hat Joystick::getHat(int index, int hat) +{ + Hat h = HAT_INVALID; + + if (!verifyJoystick(index)) + return h; + + if (hat >= getNumHats(index)) + return h; + + hats.find(SDL_JoystickGetHat(joysticks[index], hat), h); + + return h; +} + +void Joystick::close(int index) +{ + if (!checkIndex(index)) + return; + + if (joysticks[index]!=0) + { + SDL_JoystickClose(joysticks[index]); + joysticks[index] = 0; + } +} + +EnumMap::Entry Joystick::hatEntries[] = +{ + {Joystick::HAT_CENTERED, SDL_HAT_CENTERED}, + {Joystick::HAT_UP, SDL_HAT_UP}, + {Joystick::HAT_RIGHT, SDL_HAT_RIGHT}, + {Joystick::HAT_DOWN, SDL_HAT_DOWN}, + {Joystick::HAT_LEFT, SDL_HAT_LEFT}, + {Joystick::HAT_RIGHTUP, SDL_HAT_RIGHTUP}, + {Joystick::HAT_RIGHTDOWN, SDL_HAT_RIGHTDOWN}, + {Joystick::HAT_LEFTUP, SDL_HAT_LEFTUP}, + {Joystick::HAT_LEFTDOWN, SDL_HAT_LEFTDOWN}, +}; + +EnumMap Joystick::hats(Joystick::hatEntries, sizeof(Joystick::hatEntries)); + +} // sdl +} // joystick +} // love diff --git a/src/modules/joystick/sdl/Joystick.h b/src/modules/joystick/sdl/Joystick.h index 50e2ff544..9dda902ba 100644 --- a/src/modules/joystick/sdl/Joystick.h +++ b/src/modules/joystick/sdl/Joystick.h @@ -1,79 +1,79 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_JOYSTICK_SDL_JOYSTICK_H -#define LOVE_JOYSTICK_SDL_JOYSTICK_H - -// LOVE -#include "joystick/Joystick.h" -#include "common/EnumMap.h" - -// SDL -#include - -namespace love -{ -namespace joystick -{ -namespace sdl -{ - -class Joystick : public love::joystick::Joystick -{ -private: - SDL_Joystick **joysticks; -public: - Joystick(); - virtual ~Joystick(); - - // Implements Module. - const char *getName() const; - - void reload(); - bool checkIndex(int index); - int getNumJoysticks(); - const char *getName(int index); - bool open(int index); - bool isOpen(int index); - bool verifyJoystick(int index); - int getNumAxes(int index); - int getNumBalls(int index); - int getNumButtons(int index); - int getNumHats(int index); - float clampval(float x); - float getAxis(int index, int axis); - int getAxes(lua_State *L); - int getBall(lua_State *L); - bool isDown(int index, int *buttonlist); - Hat getHat(int index, int hat); - void close(int index); - -private: - - static EnumMap::Entry hatEntries[]; - static EnumMap hats; - -}; // Joystick - -} // sdl -} // joystick -} // love - -#endif // LOVE_JOYSTICK_SDL_JOYSTICK_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_JOYSTICK_SDL_JOYSTICK_H +#define LOVE_JOYSTICK_SDL_JOYSTICK_H + +// LOVE +#include "joystick/Joystick.h" +#include "common/EnumMap.h" + +// SDL +#include + +namespace love +{ +namespace joystick +{ +namespace sdl +{ + +class Joystick : public love::joystick::Joystick +{ +private: + SDL_Joystick **joysticks; +public: + Joystick(); + virtual ~Joystick(); + + // Implements Module. + const char *getName() const; + + void reload(); + bool checkIndex(int index); + int getNumJoysticks(); + const char *getName(int index); + bool open(int index); + bool isOpen(int index); + bool verifyJoystick(int index); + int getNumAxes(int index); + int getNumBalls(int index); + int getNumButtons(int index); + int getNumHats(int index); + float clampval(float x); + float getAxis(int index, int axis); + int getAxes(lua_State *L); + int getBall(lua_State *L); + bool isDown(int index, int *buttonlist); + Hat getHat(int index, int hat); + void close(int index); + +private: + + static EnumMap::Entry hatEntries[]; + static EnumMap hats; + +}; // Joystick + +} // sdl +} // joystick +} // love + +#endif // LOVE_JOYSTICK_SDL_JOYSTICK_H diff --git a/src/modules/joystick/sdl/wrap_Joystick.cpp b/src/modules/joystick/sdl/wrap_Joystick.cpp index f2127e99f..c23e3392f 100644 --- a/src/modules/joystick/sdl/wrap_Joystick.cpp +++ b/src/modules/joystick/sdl/wrap_Joystick.cpp @@ -1,185 +1,185 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Joystick.h" - -namespace love -{ -namespace joystick -{ -namespace sdl -{ - -static Joystick *instance = 0; - -int w_reload(lua_State *L) -{ - try - { - instance->reload(); - } - catch(love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - return 0; -} - -int w_getNumJoysticks(lua_State *L) -{ - lua_pushinteger(L, instance->getNumJoysticks()); - return 1; -} - -int w_getName(lua_State *L) -{ - int index = luaL_checkint(L, 1)-1; - lua_pushstring(L, instance->getName(index)); - return 1; -} - -int w_getNumAxes(lua_State *L) -{ - int index = luaL_checkint(L, 1)-1; - lua_pushinteger(L, instance->getNumAxes(index)); - return 1; -} - -int w_getNumBalls(lua_State *L) -{ - int index = luaL_checkint(L, 1)-1; - lua_pushinteger(L, instance->getNumBalls(index)); - return 1; -} - -int w_getNumButtons(lua_State *L) -{ - int index = luaL_checkint(L, 1)-1; - lua_pushinteger(L, instance->getNumButtons(index)); - return 1; -} - -int w_getNumHats(lua_State *L) -{ - int index = luaL_checkint(L, 1)-1; - lua_pushinteger(L, instance->getNumHats(index)); - return 1; -} - -int w_getAxis(lua_State *L) -{ - int index = luaL_checkint(L, 1)-1; - int axis = luaL_checkint(L, 2)-1; - lua_pushnumber(L, instance->getAxis(index, axis)); - return 1; -} - -int w_getAxes(lua_State *L) -{ - return instance->getAxes(L); -} - -int w_getBall(lua_State *L) -{ - return instance->getBall(L); -} - -int w_isDown(lua_State *L) -{ - int index = luaL_checkint(L, 1)-1; - unsigned int num = lua_gettop(L); - int *buttonlist = new int[num]; - unsigned int counter = 0; - - for (unsigned int i = 1; i < num; i++) - { - buttonlist[counter++] = (int) luaL_checknumber(L, i+1)-1; - } - buttonlist[counter] = -1; - - luax_pushboolean(L, instance->isDown(index, buttonlist)); - delete[] buttonlist; - return 1; -} - -int w_getHat(lua_State *L) -{ - int index = luaL_checkint(L, 1)-1; - int hat = luaL_checkint(L, 2)-1; - - Joystick::Hat h = instance->getHat(index, hat); - - const char *direction = ""; - Joystick::getConstant(h, direction); - lua_pushstring(L, direction); - - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "reload", w_reload }, - { "getNumJoysticks", w_getNumJoysticks }, - { "getName", w_getName }, - { "getNumAxes", w_getNumAxes }, - { "getNumBalls", w_getNumBalls }, - { "getNumButtons", w_getNumButtons }, - { "getNumHats", w_getNumHats }, - { "getAxis", w_getAxis }, - - { "getAxes", w_getAxes }, - { "getBall", w_getBall }, - - { "isDown", w_isDown }, - { "getHat", w_getHat }, - { 0, 0 } -}; - -extern "C" int luaopen_love_joystick(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new Joystick(); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - - WrappedModule w; - w.module = instance; - w.name = "joystick"; - w.flags = MODULE_T; - w.functions = functions; - w.types = 0; - - return luax_register_module(L, w); -} - -} // sdl -} // joystick -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Joystick.h" + +namespace love +{ +namespace joystick +{ +namespace sdl +{ + +static Joystick *instance = 0; + +int w_reload(lua_State *L) +{ + try + { + instance->reload(); + } + catch(love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + return 0; +} + +int w_getNumJoysticks(lua_State *L) +{ + lua_pushinteger(L, instance->getNumJoysticks()); + return 1; +} + +int w_getName(lua_State *L) +{ + int index = luaL_checkint(L, 1)-1; + lua_pushstring(L, instance->getName(index)); + return 1; +} + +int w_getNumAxes(lua_State *L) +{ + int index = luaL_checkint(L, 1)-1; + lua_pushinteger(L, instance->getNumAxes(index)); + return 1; +} + +int w_getNumBalls(lua_State *L) +{ + int index = luaL_checkint(L, 1)-1; + lua_pushinteger(L, instance->getNumBalls(index)); + return 1; +} + +int w_getNumButtons(lua_State *L) +{ + int index = luaL_checkint(L, 1)-1; + lua_pushinteger(L, instance->getNumButtons(index)); + return 1; +} + +int w_getNumHats(lua_State *L) +{ + int index = luaL_checkint(L, 1)-1; + lua_pushinteger(L, instance->getNumHats(index)); + return 1; +} + +int w_getAxis(lua_State *L) +{ + int index = luaL_checkint(L, 1)-1; + int axis = luaL_checkint(L, 2)-1; + lua_pushnumber(L, instance->getAxis(index, axis)); + return 1; +} + +int w_getAxes(lua_State *L) +{ + return instance->getAxes(L); +} + +int w_getBall(lua_State *L) +{ + return instance->getBall(L); +} + +int w_isDown(lua_State *L) +{ + int index = luaL_checkint(L, 1)-1; + unsigned int num = lua_gettop(L); + int *buttonlist = new int[num]; + unsigned int counter = 0; + + for (unsigned int i = 1; i < num; i++) + { + buttonlist[counter++] = (int) luaL_checknumber(L, i+1)-1; + } + buttonlist[counter] = -1; + + luax_pushboolean(L, instance->isDown(index, buttonlist)); + delete[] buttonlist; + return 1; +} + +int w_getHat(lua_State *L) +{ + int index = luaL_checkint(L, 1)-1; + int hat = luaL_checkint(L, 2)-1; + + Joystick::Hat h = instance->getHat(index, hat); + + const char *direction = ""; + Joystick::getConstant(h, direction); + lua_pushstring(L, direction); + + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "reload", w_reload }, + { "getNumJoysticks", w_getNumJoysticks }, + { "getName", w_getName }, + { "getNumAxes", w_getNumAxes }, + { "getNumBalls", w_getNumBalls }, + { "getNumButtons", w_getNumButtons }, + { "getNumHats", w_getNumHats }, + { "getAxis", w_getAxis }, + + { "getAxes", w_getAxes }, + { "getBall", w_getBall }, + + { "isDown", w_isDown }, + { "getHat", w_getHat }, + { 0, 0 } +}; + +extern "C" int luaopen_love_joystick(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new Joystick(); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + + WrappedModule w; + w.module = instance; + w.name = "joystick"; + w.flags = MODULE_T; + w.functions = functions; + w.types = 0; + + return luax_register_module(L, w); +} + +} // sdl +} // joystick +} // love diff --git a/src/modules/joystick/sdl/wrap_Joystick.h b/src/modules/joystick/sdl/wrap_Joystick.h index 805ed7155..ad8d11a91 100644 --- a/src/modules/joystick/sdl/wrap_Joystick.h +++ b/src/modules/joystick/sdl/wrap_Joystick.h @@ -1,53 +1,53 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H -#define LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H - -// LOVE -#include "common/config.h" -#include "Joystick.h" - -namespace love -{ -namespace joystick -{ -namespace sdl -{ - -int w_reload(lua_State *L); -int w_getNumJoysticks(lua_State *L); -int w_getName(lua_State *L); -int w_getNumAxes(lua_State *L); -int w_getNumBalls(lua_State *L); -int w_getNumButtons(lua_State *L); -int w_getNumHats(lua_State *L); -int w_getAxis(lua_State *L); -int w_getAxes(lua_State *L); -int w_getBall(lua_State *L); -int w_isDown(lua_State *L); -int w_getHat(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_joystick(lua_State *L); - -} // sdl -} // joystick -} // love - -#endif // LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H +#define LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H + +// LOVE +#include "common/config.h" +#include "Joystick.h" + +namespace love +{ +namespace joystick +{ +namespace sdl +{ + +int w_reload(lua_State *L); +int w_getNumJoysticks(lua_State *L); +int w_getName(lua_State *L); +int w_getNumAxes(lua_State *L); +int w_getNumBalls(lua_State *L); +int w_getNumButtons(lua_State *L); +int w_getNumHats(lua_State *L); +int w_getAxis(lua_State *L); +int w_getAxes(lua_State *L); +int w_getBall(lua_State *L); +int w_isDown(lua_State *L); +int w_getHat(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_joystick(lua_State *L); + +} // sdl +} // joystick +} // love + +#endif // LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H diff --git a/src/modules/keyboard/Keyboard.cpp b/src/modules/keyboard/Keyboard.cpp index 5be6f50e1..55c6aadc8 100644 --- a/src/modules/keyboard/Keyboard.cpp +++ b/src/modules/keyboard/Keyboard.cpp @@ -1,189 +1,189 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -#include "Keyboard.h" - -namespace love -{ -namespace keyboard -{ - -bool Keyboard::getConstant(const char *in, Keyboard::Key &out) -{ - return keys.find(in, out); -} - -bool Keyboard::getConstant(Keyboard::Key in, const char *&out) -{ - return keys.find(in, out); -} - -StringMap::Entry Keyboard::keyEntries[] = -{ - {"backspace", Keyboard::KEY_BACKSPACE}, - {"tab", Keyboard::KEY_TAB}, - {"clear", Keyboard::KEY_CLEAR}, - {"return", Keyboard::KEY_RETURN}, - {"pause", Keyboard::KEY_PAUSE}, - {"escape", Keyboard::KEY_ESCAPE}, - {" ", Keyboard::KEY_SPACE}, - {"!", Keyboard::KEY_EXCLAIM}, - {"\"", Keyboard::KEY_QUOTEDBL}, - {"#", Keyboard::KEY_HASH}, - {"$", Keyboard::KEY_DOLLAR}, - {"&", Keyboard::KEY_AMPERSAND}, - {"'", Keyboard::KEY_QUOTE}, - {"(", Keyboard::KEY_LEFTPAREN}, - {")", Keyboard::KEY_RIGHTPAREN}, - {"*", Keyboard::KEY_ASTERISK}, - {"+", Keyboard::KEY_PLUS}, - {",", Keyboard::KEY_COMMA}, - {"-", Keyboard::KEY_MINUS}, - {".", Keyboard::KEY_PERIOD}, - {"/", Keyboard::KEY_SLASH}, - {"0", Keyboard::KEY_0}, - {"1", Keyboard::KEY_1}, - {"2", Keyboard::KEY_2}, - {"3", Keyboard::KEY_3}, - {"4", Keyboard::KEY_4}, - {"5", Keyboard::KEY_5}, - {"6", Keyboard::KEY_6}, - {"7", Keyboard::KEY_7}, - {"8", Keyboard::KEY_8}, - {"9", Keyboard::KEY_9}, - {":", Keyboard::KEY_COLON}, - {";", Keyboard::KEY_SEMICOLON}, - {"<", Keyboard::KEY_LESS}, - {"=", Keyboard::KEY_EQUALS}, - {">", Keyboard::KEY_GREATER}, - {"?", Keyboard::KEY_QUESTION}, - {"@", Keyboard::KEY_AT}, - - {"[", Keyboard::KEY_LEFTBRACKET}, - {"\\", Keyboard::KEY_BACKSLASH}, - {"]", Keyboard::KEY_RIGHTBRACKET}, - {"^", Keyboard::KEY_CARET}, - {"_", Keyboard::KEY_UNDERSCORE}, - {"`", Keyboard::KEY_BACKQUOTE}, - {"a", Keyboard::KEY_A}, - {"b", Keyboard::KEY_B}, - {"c", Keyboard::KEY_C}, - {"d", Keyboard::KEY_D}, - {"e", Keyboard::KEY_E}, - {"f", Keyboard::KEY_F}, - {"g", Keyboard::KEY_G}, - {"h", Keyboard::KEY_H}, - {"i", Keyboard::KEY_I}, - {"j", Keyboard::KEY_J}, - {"k", Keyboard::KEY_K}, - {"l", Keyboard::KEY_L}, - {"m", Keyboard::KEY_M}, - {"n", Keyboard::KEY_N}, - {"o", Keyboard::KEY_O}, - {"p", Keyboard::KEY_P}, - {"q", Keyboard::KEY_Q}, - {"r", Keyboard::KEY_R}, - {"s", Keyboard::KEY_S}, - {"t", Keyboard::KEY_T}, - {"u", Keyboard::KEY_U}, - {"v", Keyboard::KEY_V}, - {"w", Keyboard::KEY_W}, - {"x", Keyboard::KEY_X}, - {"y", Keyboard::KEY_Y}, - {"z", Keyboard::KEY_Z}, - {"delete", Keyboard::KEY_DELETE}, - - {"kp0", Keyboard::KEY_KP0}, - {"kp1", Keyboard::KEY_KP1}, - {"kp2", Keyboard::KEY_KP2}, - {"kp3", Keyboard::KEY_KP3}, - {"kp4", Keyboard::KEY_KP4}, - {"kp5", Keyboard::KEY_KP5}, - {"kp6", Keyboard::KEY_KP6}, - {"kp7", Keyboard::KEY_KP7}, - {"kp8", Keyboard::KEY_KP8}, - {"kp9", Keyboard::KEY_KP9}, - {"kp.", Keyboard::KEY_KP_PERIOD}, - {"kp/", Keyboard::KEY_KP_DIVIDE}, - {"kp*", Keyboard::KEY_KP_MULTIPLY}, - {"kp-", Keyboard::KEY_KP_MINUS}, - {"kp+", Keyboard::KEY_KP_PLUS}, - {"kpenter", Keyboard::KEY_KP_ENTER}, - {"kp=", Keyboard::KEY_KP_EQUALS}, - - {"up", Keyboard::KEY_UP}, - {"down", Keyboard::KEY_DOWN}, - {"right", Keyboard::KEY_RIGHT}, - {"left", Keyboard::KEY_LEFT}, - {"insert", Keyboard::KEY_INSERT}, - {"home", Keyboard::KEY_HOME}, - {"end", Keyboard::KEY_END}, - {"pageup", Keyboard::KEY_PAGEUP}, - {"pagedown", Keyboard::KEY_PAGEDOWN}, - - {"f1", Keyboard::KEY_F1}, - {"f2", Keyboard::KEY_F2}, - {"f3", Keyboard::KEY_F3}, - {"f4", Keyboard::KEY_F4}, - {"f5", Keyboard::KEY_F5}, - {"f6", Keyboard::KEY_F6}, - {"f7", Keyboard::KEY_F7}, - {"f8", Keyboard::KEY_F8}, - {"f9", Keyboard::KEY_F9}, - {"f10", Keyboard::KEY_F10}, - {"f11", Keyboard::KEY_F11}, - {"f12", Keyboard::KEY_F12}, - {"f13", Keyboard::KEY_F13}, - {"f14", Keyboard::KEY_F14}, - {"f15", Keyboard::KEY_F15}, - - {"numlock", Keyboard::KEY_NUMLOCK}, - {"capslock", Keyboard::KEY_CAPSLOCK}, - {"scrollock", Keyboard::KEY_SCROLLOCK}, - {"rshift", Keyboard::KEY_RSHIFT}, - {"lshift", Keyboard::KEY_LSHIFT}, - {"rctrl", Keyboard::KEY_RCTRL}, - {"lctrl", Keyboard::KEY_LCTRL}, - {"ralt", Keyboard::KEY_RALT}, - {"lalt", Keyboard::KEY_LALT}, - {"rmeta", Keyboard::KEY_RMETA}, - {"lmeta", Keyboard::KEY_LMETA}, - {"lsuper", Keyboard::KEY_LSUPER}, - {"rsuper", Keyboard::KEY_RSUPER}, - {"mode", Keyboard::KEY_MODE}, - {"compose", Keyboard::KEY_COMPOSE}, - - {"help", Keyboard::KEY_HELP}, - {"print", Keyboard::KEY_PRINT}, - {"sysreq", Keyboard::KEY_SYSREQ}, - {"break", Keyboard::KEY_BREAK}, - {"menu", Keyboard::KEY_MENU}, - {"power", Keyboard::KEY_POWER}, - {"euro", Keyboard::KEY_EURO}, - {"undo", Keyboard::KEY_UNDO}, -}; - -StringMap Keyboard::keys(Keyboard::keyEntries, sizeof(Keyboard::keyEntries)); - - -} // keyboard -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +#include "Keyboard.h" + +namespace love +{ +namespace keyboard +{ + +bool Keyboard::getConstant(const char *in, Keyboard::Key &out) +{ + return keys.find(in, out); +} + +bool Keyboard::getConstant(Keyboard::Key in, const char *&out) +{ + return keys.find(in, out); +} + +StringMap::Entry Keyboard::keyEntries[] = +{ + {"backspace", Keyboard::KEY_BACKSPACE}, + {"tab", Keyboard::KEY_TAB}, + {"clear", Keyboard::KEY_CLEAR}, + {"return", Keyboard::KEY_RETURN}, + {"pause", Keyboard::KEY_PAUSE}, + {"escape", Keyboard::KEY_ESCAPE}, + {" ", Keyboard::KEY_SPACE}, + {"!", Keyboard::KEY_EXCLAIM}, + {"\"", Keyboard::KEY_QUOTEDBL}, + {"#", Keyboard::KEY_HASH}, + {"$", Keyboard::KEY_DOLLAR}, + {"&", Keyboard::KEY_AMPERSAND}, + {"'", Keyboard::KEY_QUOTE}, + {"(", Keyboard::KEY_LEFTPAREN}, + {")", Keyboard::KEY_RIGHTPAREN}, + {"*", Keyboard::KEY_ASTERISK}, + {"+", Keyboard::KEY_PLUS}, + {",", Keyboard::KEY_COMMA}, + {"-", Keyboard::KEY_MINUS}, + {".", Keyboard::KEY_PERIOD}, + {"/", Keyboard::KEY_SLASH}, + {"0", Keyboard::KEY_0}, + {"1", Keyboard::KEY_1}, + {"2", Keyboard::KEY_2}, + {"3", Keyboard::KEY_3}, + {"4", Keyboard::KEY_4}, + {"5", Keyboard::KEY_5}, + {"6", Keyboard::KEY_6}, + {"7", Keyboard::KEY_7}, + {"8", Keyboard::KEY_8}, + {"9", Keyboard::KEY_9}, + {":", Keyboard::KEY_COLON}, + {";", Keyboard::KEY_SEMICOLON}, + {"<", Keyboard::KEY_LESS}, + {"=", Keyboard::KEY_EQUALS}, + {">", Keyboard::KEY_GREATER}, + {"?", Keyboard::KEY_QUESTION}, + {"@", Keyboard::KEY_AT}, + + {"[", Keyboard::KEY_LEFTBRACKET}, + {"\\", Keyboard::KEY_BACKSLASH}, + {"]", Keyboard::KEY_RIGHTBRACKET}, + {"^", Keyboard::KEY_CARET}, + {"_", Keyboard::KEY_UNDERSCORE}, + {"`", Keyboard::KEY_BACKQUOTE}, + {"a", Keyboard::KEY_A}, + {"b", Keyboard::KEY_B}, + {"c", Keyboard::KEY_C}, + {"d", Keyboard::KEY_D}, + {"e", Keyboard::KEY_E}, + {"f", Keyboard::KEY_F}, + {"g", Keyboard::KEY_G}, + {"h", Keyboard::KEY_H}, + {"i", Keyboard::KEY_I}, + {"j", Keyboard::KEY_J}, + {"k", Keyboard::KEY_K}, + {"l", Keyboard::KEY_L}, + {"m", Keyboard::KEY_M}, + {"n", Keyboard::KEY_N}, + {"o", Keyboard::KEY_O}, + {"p", Keyboard::KEY_P}, + {"q", Keyboard::KEY_Q}, + {"r", Keyboard::KEY_R}, + {"s", Keyboard::KEY_S}, + {"t", Keyboard::KEY_T}, + {"u", Keyboard::KEY_U}, + {"v", Keyboard::KEY_V}, + {"w", Keyboard::KEY_W}, + {"x", Keyboard::KEY_X}, + {"y", Keyboard::KEY_Y}, + {"z", Keyboard::KEY_Z}, + {"delete", Keyboard::KEY_DELETE}, + + {"kp0", Keyboard::KEY_KP0}, + {"kp1", Keyboard::KEY_KP1}, + {"kp2", Keyboard::KEY_KP2}, + {"kp3", Keyboard::KEY_KP3}, + {"kp4", Keyboard::KEY_KP4}, + {"kp5", Keyboard::KEY_KP5}, + {"kp6", Keyboard::KEY_KP6}, + {"kp7", Keyboard::KEY_KP7}, + {"kp8", Keyboard::KEY_KP8}, + {"kp9", Keyboard::KEY_KP9}, + {"kp.", Keyboard::KEY_KP_PERIOD}, + {"kp/", Keyboard::KEY_KP_DIVIDE}, + {"kp*", Keyboard::KEY_KP_MULTIPLY}, + {"kp-", Keyboard::KEY_KP_MINUS}, + {"kp+", Keyboard::KEY_KP_PLUS}, + {"kpenter", Keyboard::KEY_KP_ENTER}, + {"kp=", Keyboard::KEY_KP_EQUALS}, + + {"up", Keyboard::KEY_UP}, + {"down", Keyboard::KEY_DOWN}, + {"right", Keyboard::KEY_RIGHT}, + {"left", Keyboard::KEY_LEFT}, + {"insert", Keyboard::KEY_INSERT}, + {"home", Keyboard::KEY_HOME}, + {"end", Keyboard::KEY_END}, + {"pageup", Keyboard::KEY_PAGEUP}, + {"pagedown", Keyboard::KEY_PAGEDOWN}, + + {"f1", Keyboard::KEY_F1}, + {"f2", Keyboard::KEY_F2}, + {"f3", Keyboard::KEY_F3}, + {"f4", Keyboard::KEY_F4}, + {"f5", Keyboard::KEY_F5}, + {"f6", Keyboard::KEY_F6}, + {"f7", Keyboard::KEY_F7}, + {"f8", Keyboard::KEY_F8}, + {"f9", Keyboard::KEY_F9}, + {"f10", Keyboard::KEY_F10}, + {"f11", Keyboard::KEY_F11}, + {"f12", Keyboard::KEY_F12}, + {"f13", Keyboard::KEY_F13}, + {"f14", Keyboard::KEY_F14}, + {"f15", Keyboard::KEY_F15}, + + {"numlock", Keyboard::KEY_NUMLOCK}, + {"capslock", Keyboard::KEY_CAPSLOCK}, + {"scrollock", Keyboard::KEY_SCROLLOCK}, + {"rshift", Keyboard::KEY_RSHIFT}, + {"lshift", Keyboard::KEY_LSHIFT}, + {"rctrl", Keyboard::KEY_RCTRL}, + {"lctrl", Keyboard::KEY_LCTRL}, + {"ralt", Keyboard::KEY_RALT}, + {"lalt", Keyboard::KEY_LALT}, + {"rmeta", Keyboard::KEY_RMETA}, + {"lmeta", Keyboard::KEY_LMETA}, + {"lsuper", Keyboard::KEY_LSUPER}, + {"rsuper", Keyboard::KEY_RSUPER}, + {"mode", Keyboard::KEY_MODE}, + {"compose", Keyboard::KEY_COMPOSE}, + + {"help", Keyboard::KEY_HELP}, + {"print", Keyboard::KEY_PRINT}, + {"sysreq", Keyboard::KEY_SYSREQ}, + {"break", Keyboard::KEY_BREAK}, + {"menu", Keyboard::KEY_MENU}, + {"power", Keyboard::KEY_POWER}, + {"euro", Keyboard::KEY_EURO}, + {"undo", Keyboard::KEY_UNDO}, +}; + +StringMap Keyboard::keys(Keyboard::keyEntries, sizeof(Keyboard::keyEntries)); + + +} // keyboard +} // love diff --git a/src/modules/keyboard/Keyboard.h b/src/modules/keyboard/Keyboard.h index 3b4e14d3f..996d6bde2 100644 --- a/src/modules/keyboard/Keyboard.h +++ b/src/modules/keyboard/Keyboard.h @@ -1,227 +1,227 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_KEYBOARD_KEYBOARD_H -#define LOVE_KEYBOARD_KEYBOARD_H - -// LOVE -#include "common/Module.h" -#include "common/StringMap.h" - -namespace love -{ -namespace keyboard -{ - -class Keyboard : public Module -{ -public: - - enum Key - { - KEY_UNKNOWN, - KEY_BACKSPACE, - KEY_TAB, - KEY_CLEAR, - KEY_RETURN, - KEY_PAUSE, - KEY_ESCAPE, - KEY_SPACE, - KEY_EXCLAIM, - KEY_QUOTEDBL, - KEY_HASH, - KEY_DOLLAR, - KEY_AMPERSAND, - KEY_QUOTE, - KEY_LEFTPAREN, - KEY_RIGHTPAREN, - KEY_ASTERISK, - KEY_PLUS, - KEY_COMMA, - KEY_MINUS, - KEY_PERIOD, - KEY_SLASH, - KEY_0, - KEY_1, - KEY_2, - KEY_3, - KEY_4, - KEY_5, - KEY_6, - KEY_7, - KEY_8, - KEY_9, - KEY_COLON, - KEY_SEMICOLON, - KEY_LESS, - KEY_EQUALS, - KEY_GREATER, - KEY_QUESTION, - KEY_AT, - - KEY_LEFTBRACKET, - KEY_BACKSLASH, - KEY_RIGHTBRACKET, - KEY_CARET, - KEY_UNDERSCORE, - KEY_BACKQUOTE, - KEY_A, - KEY_B, - KEY_C, - KEY_D, - KEY_E, - KEY_F, - KEY_G, - KEY_H, - KEY_I, - KEY_J, - KEY_K, - KEY_L, - KEY_M, - KEY_N, - KEY_O, - KEY_P, - KEY_Q, - KEY_R, - KEY_S, - KEY_T, - KEY_U, - KEY_V, - KEY_W, - KEY_X, - KEY_Y, - KEY_Z, - KEY_DELETE, - - KEY_KP0, - KEY_KP1, - KEY_KP2, - KEY_KP3, - KEY_KP4, - KEY_KP5, - KEY_KP6, - KEY_KP7, - KEY_KP8, - KEY_KP9, - KEY_KP_PERIOD, - KEY_KP_DIVIDE, - KEY_KP_MULTIPLY, - KEY_KP_MINUS, - KEY_KP_PLUS, - KEY_KP_ENTER, - KEY_KP_EQUALS, - - KEY_UP, - KEY_DOWN, - KEY_RIGHT, - KEY_LEFT, - KEY_INSERT, - KEY_HOME, - KEY_END, - KEY_PAGEUP, - KEY_PAGEDOWN, - - KEY_F1, - KEY_F2, - KEY_F3, - KEY_F4, - KEY_F5, - KEY_F6, - KEY_F7, - KEY_F8, - KEY_F9, - KEY_F10, - KEY_F11, - KEY_F12, - KEY_F13, - KEY_F14, - KEY_F15, - - KEY_NUMLOCK, - KEY_CAPSLOCK, - KEY_SCROLLOCK, - KEY_RSHIFT, - KEY_LSHIFT, - KEY_RCTRL, - KEY_LCTRL, - KEY_RALT, - KEY_LALT, - KEY_RMETA, - KEY_LMETA, - KEY_LSUPER, - KEY_RSUPER, - KEY_MODE, - KEY_COMPOSE, - - KEY_HELP, - KEY_PRINT, - KEY_SYSREQ, - KEY_BREAK, - KEY_MENU, - KEY_POWER, - KEY_EURO, - KEY_UNDO, - KEY_MAX_ENUM = 512 - }; - - static const int DEFAULT = -1; - - virtual ~Keyboard() {} - - /** - * Checks whether a certain key is down or not. - * @param key A key identifier. - * @return boolean - **/ - virtual bool isDown(Key *keylist) const = 0; - - /** - * Enables key repeating. - * @param delay The amount of delay before repeating the key (in milliseconds) - * @param interval Specifies the amount of time between repeats (in milliseconds) - **/ - virtual void setKeyRepeat(int delay, int interval) const = 0; - - /** - * Gets the specified delay for the key repeat. - * @return int - **/ - virtual int getKeyRepeatDelay() const = 0; - - /** - * Gets the specified interval for the key repeat. - * @return int - **/ - virtual int getKeyRepeatInterval() const = 0; - - static bool getConstant(const char *in, Key &out); - static bool getConstant(Key in, const char *&out); - -private: - - static StringMap::Entry keyEntries[]; - static StringMap keys; - -}; // Keyboard - -} // keyboard -} // love - -#endif // LOVE_KEYBOARD_KEYBOARD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_KEYBOARD_KEYBOARD_H +#define LOVE_KEYBOARD_KEYBOARD_H + +// LOVE +#include "common/Module.h" +#include "common/StringMap.h" + +namespace love +{ +namespace keyboard +{ + +class Keyboard : public Module +{ +public: + + enum Key + { + KEY_UNKNOWN, + KEY_BACKSPACE, + KEY_TAB, + KEY_CLEAR, + KEY_RETURN, + KEY_PAUSE, + KEY_ESCAPE, + KEY_SPACE, + KEY_EXCLAIM, + KEY_QUOTEDBL, + KEY_HASH, + KEY_DOLLAR, + KEY_AMPERSAND, + KEY_QUOTE, + KEY_LEFTPAREN, + KEY_RIGHTPAREN, + KEY_ASTERISK, + KEY_PLUS, + KEY_COMMA, + KEY_MINUS, + KEY_PERIOD, + KEY_SLASH, + KEY_0, + KEY_1, + KEY_2, + KEY_3, + KEY_4, + KEY_5, + KEY_6, + KEY_7, + KEY_8, + KEY_9, + KEY_COLON, + KEY_SEMICOLON, + KEY_LESS, + KEY_EQUALS, + KEY_GREATER, + KEY_QUESTION, + KEY_AT, + + KEY_LEFTBRACKET, + KEY_BACKSLASH, + KEY_RIGHTBRACKET, + KEY_CARET, + KEY_UNDERSCORE, + KEY_BACKQUOTE, + KEY_A, + KEY_B, + KEY_C, + KEY_D, + KEY_E, + KEY_F, + KEY_G, + KEY_H, + KEY_I, + KEY_J, + KEY_K, + KEY_L, + KEY_M, + KEY_N, + KEY_O, + KEY_P, + KEY_Q, + KEY_R, + KEY_S, + KEY_T, + KEY_U, + KEY_V, + KEY_W, + KEY_X, + KEY_Y, + KEY_Z, + KEY_DELETE, + + KEY_KP0, + KEY_KP1, + KEY_KP2, + KEY_KP3, + KEY_KP4, + KEY_KP5, + KEY_KP6, + KEY_KP7, + KEY_KP8, + KEY_KP9, + KEY_KP_PERIOD, + KEY_KP_DIVIDE, + KEY_KP_MULTIPLY, + KEY_KP_MINUS, + KEY_KP_PLUS, + KEY_KP_ENTER, + KEY_KP_EQUALS, + + KEY_UP, + KEY_DOWN, + KEY_RIGHT, + KEY_LEFT, + KEY_INSERT, + KEY_HOME, + KEY_END, + KEY_PAGEUP, + KEY_PAGEDOWN, + + KEY_F1, + KEY_F2, + KEY_F3, + KEY_F4, + KEY_F5, + KEY_F6, + KEY_F7, + KEY_F8, + KEY_F9, + KEY_F10, + KEY_F11, + KEY_F12, + KEY_F13, + KEY_F14, + KEY_F15, + + KEY_NUMLOCK, + KEY_CAPSLOCK, + KEY_SCROLLOCK, + KEY_RSHIFT, + KEY_LSHIFT, + KEY_RCTRL, + KEY_LCTRL, + KEY_RALT, + KEY_LALT, + KEY_RMETA, + KEY_LMETA, + KEY_LSUPER, + KEY_RSUPER, + KEY_MODE, + KEY_COMPOSE, + + KEY_HELP, + KEY_PRINT, + KEY_SYSREQ, + KEY_BREAK, + KEY_MENU, + KEY_POWER, + KEY_EURO, + KEY_UNDO, + KEY_MAX_ENUM = 512 + }; + + static const int DEFAULT = -1; + + virtual ~Keyboard() {} + + /** + * Checks whether a certain key is down or not. + * @param key A key identifier. + * @return boolean + **/ + virtual bool isDown(Key *keylist) const = 0; + + /** + * Enables key repeating. + * @param delay The amount of delay before repeating the key (in milliseconds) + * @param interval Specifies the amount of time between repeats (in milliseconds) + **/ + virtual void setKeyRepeat(int delay, int interval) const = 0; + + /** + * Gets the specified delay for the key repeat. + * @return int + **/ + virtual int getKeyRepeatDelay() const = 0; + + /** + * Gets the specified interval for the key repeat. + * @return int + **/ + virtual int getKeyRepeatInterval() const = 0; + + static bool getConstant(const char *in, Key &out); + static bool getConstant(Key in, const char *&out); + +private: + + static StringMap::Entry keyEntries[]; + static StringMap keys; + +}; // Keyboard + +} // keyboard +} // love + +#endif // LOVE_KEYBOARD_KEYBOARD_H diff --git a/src/modules/keyboard/sdl/Keyboard.cpp b/src/modules/keyboard/sdl/Keyboard.cpp index 19af516ba..fb6a9f8d9 100644 --- a/src/modules/keyboard/sdl/Keyboard.cpp +++ b/src/modules/keyboard/sdl/Keyboard.cpp @@ -1,223 +1,223 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -#include "Keyboard.h" - -namespace love -{ -namespace keyboard -{ -namespace sdl -{ - -const char *Keyboard::getName() const -{ - return "love.keyboard.sdl"; -} - -bool Keyboard::isDown(Key *keylist) const -{ - SDLKey k; - Uint8 *keystate = SDL_GetKeyState(0); - - for (Key key = *keylist; key != KEY_MAX_ENUM; key = *(++keylist)) - { - if (keys.find(key, k) && keystate[(unsigned)k] == 1) - return true; - } - - return false; -} - -void Keyboard::setKeyRepeat(int delay, int interval) const -{ - delay = (delay == DEFAULT) ? SDL_DEFAULT_REPEAT_DELAY : delay; - interval = (interval == DEFAULT) ? SDL_DEFAULT_REPEAT_INTERVAL : interval; - - SDL_EnableKeyRepeat(delay, interval); -} - -int Keyboard::getKeyRepeatDelay() const -{ - int delay, interval; - SDL_GetKeyRepeat(&delay, &interval); - return delay; -} - -int Keyboard::getKeyRepeatInterval() const -{ - int delay, interval; - SDL_GetKeyRepeat(&delay, &interval); - return interval; -} - -EnumMap::Entry Keyboard::keyEntries[] = -{ - { Keyboard::KEY_BACKSPACE, SDLK_BACKSPACE}, - { Keyboard::KEY_TAB, SDLK_TAB}, - { Keyboard::KEY_CLEAR, SDLK_CLEAR}, - { Keyboard::KEY_RETURN, SDLK_RETURN}, - { Keyboard::KEY_PAUSE, SDLK_PAUSE}, - { Keyboard::KEY_ESCAPE, SDLK_ESCAPE }, - { Keyboard::KEY_SPACE, SDLK_SPACE }, - { Keyboard::KEY_EXCLAIM, SDLK_EXCLAIM }, - { Keyboard::KEY_QUOTEDBL, SDLK_QUOTEDBL }, - { Keyboard::KEY_HASH, SDLK_HASH }, - { Keyboard::KEY_DOLLAR, SDLK_DOLLAR }, - { Keyboard::KEY_AMPERSAND, SDLK_AMPERSAND }, - { Keyboard::KEY_QUOTE, SDLK_QUOTE }, - { Keyboard::KEY_LEFTPAREN, SDLK_LEFTPAREN }, - { Keyboard::KEY_RIGHTPAREN, SDLK_RIGHTPAREN }, - { Keyboard::KEY_ASTERISK, SDLK_ASTERISK }, - { Keyboard::KEY_PLUS, SDLK_PLUS }, - { Keyboard::KEY_COMMA, SDLK_COMMA }, - { Keyboard::KEY_MINUS, SDLK_MINUS }, - { Keyboard::KEY_PERIOD, SDLK_PERIOD }, - { Keyboard::KEY_SLASH, SDLK_SLASH }, - { Keyboard::KEY_0, SDLK_0 }, - { Keyboard::KEY_1, SDLK_1 }, - { Keyboard::KEY_2, SDLK_2 }, - { Keyboard::KEY_3, SDLK_3 }, - { Keyboard::KEY_4, SDLK_4 }, - { Keyboard::KEY_5, SDLK_5 }, - { Keyboard::KEY_6, SDLK_6 }, - { Keyboard::KEY_7, SDLK_7 }, - { Keyboard::KEY_8, SDLK_8 }, - { Keyboard::KEY_9, SDLK_9 }, - { Keyboard::KEY_COLON, SDLK_COLON }, - { Keyboard::KEY_SEMICOLON, SDLK_SEMICOLON }, - { Keyboard::KEY_LESS, SDLK_LESS }, - { Keyboard::KEY_EQUALS, SDLK_EQUALS }, - { Keyboard::KEY_GREATER, SDLK_GREATER }, - { Keyboard::KEY_QUESTION, SDLK_QUESTION }, - { Keyboard::KEY_AT, SDLK_AT }, - - { Keyboard::KEY_LEFTBRACKET, SDLK_LEFTBRACKET }, - { Keyboard::KEY_BACKSLASH, SDLK_BACKSLASH }, - { Keyboard::KEY_RIGHTBRACKET, SDLK_RIGHTBRACKET }, - { Keyboard::KEY_CARET, SDLK_CARET }, - { Keyboard::KEY_UNDERSCORE, SDLK_UNDERSCORE }, - { Keyboard::KEY_BACKQUOTE, SDLK_BACKQUOTE }, - { Keyboard::KEY_A, SDLK_a }, - { Keyboard::KEY_B, SDLK_b }, - { Keyboard::KEY_C, SDLK_c }, - { Keyboard::KEY_D, SDLK_d }, - { Keyboard::KEY_E, SDLK_e }, - { Keyboard::KEY_F, SDLK_f }, - { Keyboard::KEY_G, SDLK_g }, - { Keyboard::KEY_H, SDLK_h }, - { Keyboard::KEY_I, SDLK_i }, - { Keyboard::KEY_J, SDLK_j }, - { Keyboard::KEY_K, SDLK_k }, - { Keyboard::KEY_L, SDLK_l }, - { Keyboard::KEY_M, SDLK_m }, - { Keyboard::KEY_N, SDLK_n }, - { Keyboard::KEY_O, SDLK_o }, - { Keyboard::KEY_P, SDLK_p }, - { Keyboard::KEY_Q, SDLK_q }, - { Keyboard::KEY_R, SDLK_r }, - { Keyboard::KEY_S, SDLK_s }, - { Keyboard::KEY_T, SDLK_t }, - { Keyboard::KEY_U, SDLK_u }, - { Keyboard::KEY_V, SDLK_v }, - { Keyboard::KEY_W, SDLK_w }, - { Keyboard::KEY_X, SDLK_x }, - { Keyboard::KEY_Y, SDLK_y }, - { Keyboard::KEY_Z, SDLK_z }, - { Keyboard::KEY_DELETE, SDLK_DELETE }, - - { Keyboard::KEY_KP0, SDLK_KP0 }, - { Keyboard::KEY_KP1, SDLK_KP1 }, - { Keyboard::KEY_KP2, SDLK_KP2 }, - { Keyboard::KEY_KP3, SDLK_KP3 }, - { Keyboard::KEY_KP4, SDLK_KP4 }, - { Keyboard::KEY_KP5, SDLK_KP5 }, - { Keyboard::KEY_KP6, SDLK_KP6 }, - { Keyboard::KEY_KP7, SDLK_KP7 }, - { Keyboard::KEY_KP8, SDLK_KP8 }, - { Keyboard::KEY_KP9, SDLK_KP9 }, - { Keyboard::KEY_KP_PERIOD, SDLK_KP_PERIOD }, - { Keyboard::KEY_KP_DIVIDE, SDLK_KP_DIVIDE }, - { Keyboard::KEY_KP_MULTIPLY, SDLK_KP_MULTIPLY}, - { Keyboard::KEY_KP_MINUS, SDLK_KP_MINUS }, - { Keyboard::KEY_KP_PLUS, SDLK_KP_PLUS }, - { Keyboard::KEY_KP_ENTER, SDLK_KP_ENTER }, - { Keyboard::KEY_KP_EQUALS, SDLK_KP_EQUALS }, - - { Keyboard::KEY_UP, SDLK_UP }, - { Keyboard::KEY_DOWN, SDLK_DOWN }, - { Keyboard::KEY_RIGHT, SDLK_RIGHT }, - { Keyboard::KEY_LEFT, SDLK_LEFT }, - { Keyboard::KEY_INSERT, SDLK_INSERT }, - { Keyboard::KEY_HOME, SDLK_HOME }, - { Keyboard::KEY_END, SDLK_END }, - { Keyboard::KEY_PAGEUP, SDLK_PAGEUP }, - { Keyboard::KEY_PAGEDOWN, SDLK_PAGEDOWN }, - - { Keyboard::KEY_F1, SDLK_F1 }, - { Keyboard::KEY_F2, SDLK_F2 }, - { Keyboard::KEY_F3, SDLK_F3 }, - { Keyboard::KEY_F4, SDLK_F4 }, - { Keyboard::KEY_F5, SDLK_F5 }, - { Keyboard::KEY_F6, SDLK_F6 }, - { Keyboard::KEY_F7, SDLK_F7 }, - { Keyboard::KEY_F8, SDLK_F8 }, - { Keyboard::KEY_F9, SDLK_F9 }, - { Keyboard::KEY_F10, SDLK_F10 }, - { Keyboard::KEY_F11, SDLK_F11 }, - { Keyboard::KEY_F12, SDLK_F12 }, - { Keyboard::KEY_F13, SDLK_F13 }, - { Keyboard::KEY_F14, SDLK_F14 }, - { Keyboard::KEY_F15, SDLK_F15 }, - - { Keyboard::KEY_NUMLOCK, SDLK_NUMLOCK }, - { Keyboard::KEY_CAPSLOCK, SDLK_CAPSLOCK }, - { Keyboard::KEY_SCROLLOCK, SDLK_SCROLLOCK }, - { Keyboard::KEY_RSHIFT, SDLK_RSHIFT }, - { Keyboard::KEY_LSHIFT, SDLK_LSHIFT }, - { Keyboard::KEY_RCTRL, SDLK_RCTRL }, - { Keyboard::KEY_LCTRL, SDLK_LCTRL }, - { Keyboard::KEY_RALT, SDLK_RALT }, - { Keyboard::KEY_LALT, SDLK_LALT }, - { Keyboard::KEY_RMETA, SDLK_RMETA }, - { Keyboard::KEY_LMETA, SDLK_LMETA }, - { Keyboard::KEY_LSUPER, SDLK_LSUPER }, - { Keyboard::KEY_RSUPER, SDLK_RSUPER }, - { Keyboard::KEY_MODE, SDLK_MODE }, - { Keyboard::KEY_COMPOSE, SDLK_COMPOSE }, - - { Keyboard::KEY_HELP, SDLK_HELP }, - { Keyboard::KEY_PRINT, SDLK_PRINT }, - { Keyboard::KEY_SYSREQ, SDLK_SYSREQ }, - { Keyboard::KEY_BREAK, SDLK_BREAK }, - { Keyboard::KEY_MENU, SDLK_MENU }, - { Keyboard::KEY_POWER, SDLK_POWER }, - { Keyboard::KEY_EURO, SDLK_EURO }, - { Keyboard::KEY_UNDO, SDLK_UNDO }, -}; - -EnumMap Keyboard::keys(Keyboard::keyEntries, sizeof(Keyboard::keyEntries)); - - -} // sdl -} // keyboard -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +#include "Keyboard.h" + +namespace love +{ +namespace keyboard +{ +namespace sdl +{ + +const char *Keyboard::getName() const +{ + return "love.keyboard.sdl"; +} + +bool Keyboard::isDown(Key *keylist) const +{ + SDLKey k; + Uint8 *keystate = SDL_GetKeyState(0); + + for (Key key = *keylist; key != KEY_MAX_ENUM; key = *(++keylist)) + { + if (keys.find(key, k) && keystate[(unsigned)k] == 1) + return true; + } + + return false; +} + +void Keyboard::setKeyRepeat(int delay, int interval) const +{ + delay = (delay == DEFAULT) ? SDL_DEFAULT_REPEAT_DELAY : delay; + interval = (interval == DEFAULT) ? SDL_DEFAULT_REPEAT_INTERVAL : interval; + + SDL_EnableKeyRepeat(delay, interval); +} + +int Keyboard::getKeyRepeatDelay() const +{ + int delay, interval; + SDL_GetKeyRepeat(&delay, &interval); + return delay; +} + +int Keyboard::getKeyRepeatInterval() const +{ + int delay, interval; + SDL_GetKeyRepeat(&delay, &interval); + return interval; +} + +EnumMap::Entry Keyboard::keyEntries[] = +{ + { Keyboard::KEY_BACKSPACE, SDLK_BACKSPACE}, + { Keyboard::KEY_TAB, SDLK_TAB}, + { Keyboard::KEY_CLEAR, SDLK_CLEAR}, + { Keyboard::KEY_RETURN, SDLK_RETURN}, + { Keyboard::KEY_PAUSE, SDLK_PAUSE}, + { Keyboard::KEY_ESCAPE, SDLK_ESCAPE }, + { Keyboard::KEY_SPACE, SDLK_SPACE }, + { Keyboard::KEY_EXCLAIM, SDLK_EXCLAIM }, + { Keyboard::KEY_QUOTEDBL, SDLK_QUOTEDBL }, + { Keyboard::KEY_HASH, SDLK_HASH }, + { Keyboard::KEY_DOLLAR, SDLK_DOLLAR }, + { Keyboard::KEY_AMPERSAND, SDLK_AMPERSAND }, + { Keyboard::KEY_QUOTE, SDLK_QUOTE }, + { Keyboard::KEY_LEFTPAREN, SDLK_LEFTPAREN }, + { Keyboard::KEY_RIGHTPAREN, SDLK_RIGHTPAREN }, + { Keyboard::KEY_ASTERISK, SDLK_ASTERISK }, + { Keyboard::KEY_PLUS, SDLK_PLUS }, + { Keyboard::KEY_COMMA, SDLK_COMMA }, + { Keyboard::KEY_MINUS, SDLK_MINUS }, + { Keyboard::KEY_PERIOD, SDLK_PERIOD }, + { Keyboard::KEY_SLASH, SDLK_SLASH }, + { Keyboard::KEY_0, SDLK_0 }, + { Keyboard::KEY_1, SDLK_1 }, + { Keyboard::KEY_2, SDLK_2 }, + { Keyboard::KEY_3, SDLK_3 }, + { Keyboard::KEY_4, SDLK_4 }, + { Keyboard::KEY_5, SDLK_5 }, + { Keyboard::KEY_6, SDLK_6 }, + { Keyboard::KEY_7, SDLK_7 }, + { Keyboard::KEY_8, SDLK_8 }, + { Keyboard::KEY_9, SDLK_9 }, + { Keyboard::KEY_COLON, SDLK_COLON }, + { Keyboard::KEY_SEMICOLON, SDLK_SEMICOLON }, + { Keyboard::KEY_LESS, SDLK_LESS }, + { Keyboard::KEY_EQUALS, SDLK_EQUALS }, + { Keyboard::KEY_GREATER, SDLK_GREATER }, + { Keyboard::KEY_QUESTION, SDLK_QUESTION }, + { Keyboard::KEY_AT, SDLK_AT }, + + { Keyboard::KEY_LEFTBRACKET, SDLK_LEFTBRACKET }, + { Keyboard::KEY_BACKSLASH, SDLK_BACKSLASH }, + { Keyboard::KEY_RIGHTBRACKET, SDLK_RIGHTBRACKET }, + { Keyboard::KEY_CARET, SDLK_CARET }, + { Keyboard::KEY_UNDERSCORE, SDLK_UNDERSCORE }, + { Keyboard::KEY_BACKQUOTE, SDLK_BACKQUOTE }, + { Keyboard::KEY_A, SDLK_a }, + { Keyboard::KEY_B, SDLK_b }, + { Keyboard::KEY_C, SDLK_c }, + { Keyboard::KEY_D, SDLK_d }, + { Keyboard::KEY_E, SDLK_e }, + { Keyboard::KEY_F, SDLK_f }, + { Keyboard::KEY_G, SDLK_g }, + { Keyboard::KEY_H, SDLK_h }, + { Keyboard::KEY_I, SDLK_i }, + { Keyboard::KEY_J, SDLK_j }, + { Keyboard::KEY_K, SDLK_k }, + { Keyboard::KEY_L, SDLK_l }, + { Keyboard::KEY_M, SDLK_m }, + { Keyboard::KEY_N, SDLK_n }, + { Keyboard::KEY_O, SDLK_o }, + { Keyboard::KEY_P, SDLK_p }, + { Keyboard::KEY_Q, SDLK_q }, + { Keyboard::KEY_R, SDLK_r }, + { Keyboard::KEY_S, SDLK_s }, + { Keyboard::KEY_T, SDLK_t }, + { Keyboard::KEY_U, SDLK_u }, + { Keyboard::KEY_V, SDLK_v }, + { Keyboard::KEY_W, SDLK_w }, + { Keyboard::KEY_X, SDLK_x }, + { Keyboard::KEY_Y, SDLK_y }, + { Keyboard::KEY_Z, SDLK_z }, + { Keyboard::KEY_DELETE, SDLK_DELETE }, + + { Keyboard::KEY_KP0, SDLK_KP0 }, + { Keyboard::KEY_KP1, SDLK_KP1 }, + { Keyboard::KEY_KP2, SDLK_KP2 }, + { Keyboard::KEY_KP3, SDLK_KP3 }, + { Keyboard::KEY_KP4, SDLK_KP4 }, + { Keyboard::KEY_KP5, SDLK_KP5 }, + { Keyboard::KEY_KP6, SDLK_KP6 }, + { Keyboard::KEY_KP7, SDLK_KP7 }, + { Keyboard::KEY_KP8, SDLK_KP8 }, + { Keyboard::KEY_KP9, SDLK_KP9 }, + { Keyboard::KEY_KP_PERIOD, SDLK_KP_PERIOD }, + { Keyboard::KEY_KP_DIVIDE, SDLK_KP_DIVIDE }, + { Keyboard::KEY_KP_MULTIPLY, SDLK_KP_MULTIPLY}, + { Keyboard::KEY_KP_MINUS, SDLK_KP_MINUS }, + { Keyboard::KEY_KP_PLUS, SDLK_KP_PLUS }, + { Keyboard::KEY_KP_ENTER, SDLK_KP_ENTER }, + { Keyboard::KEY_KP_EQUALS, SDLK_KP_EQUALS }, + + { Keyboard::KEY_UP, SDLK_UP }, + { Keyboard::KEY_DOWN, SDLK_DOWN }, + { Keyboard::KEY_RIGHT, SDLK_RIGHT }, + { Keyboard::KEY_LEFT, SDLK_LEFT }, + { Keyboard::KEY_INSERT, SDLK_INSERT }, + { Keyboard::KEY_HOME, SDLK_HOME }, + { Keyboard::KEY_END, SDLK_END }, + { Keyboard::KEY_PAGEUP, SDLK_PAGEUP }, + { Keyboard::KEY_PAGEDOWN, SDLK_PAGEDOWN }, + + { Keyboard::KEY_F1, SDLK_F1 }, + { Keyboard::KEY_F2, SDLK_F2 }, + { Keyboard::KEY_F3, SDLK_F3 }, + { Keyboard::KEY_F4, SDLK_F4 }, + { Keyboard::KEY_F5, SDLK_F5 }, + { Keyboard::KEY_F6, SDLK_F6 }, + { Keyboard::KEY_F7, SDLK_F7 }, + { Keyboard::KEY_F8, SDLK_F8 }, + { Keyboard::KEY_F9, SDLK_F9 }, + { Keyboard::KEY_F10, SDLK_F10 }, + { Keyboard::KEY_F11, SDLK_F11 }, + { Keyboard::KEY_F12, SDLK_F12 }, + { Keyboard::KEY_F13, SDLK_F13 }, + { Keyboard::KEY_F14, SDLK_F14 }, + { Keyboard::KEY_F15, SDLK_F15 }, + + { Keyboard::KEY_NUMLOCK, SDLK_NUMLOCK }, + { Keyboard::KEY_CAPSLOCK, SDLK_CAPSLOCK }, + { Keyboard::KEY_SCROLLOCK, SDLK_SCROLLOCK }, + { Keyboard::KEY_RSHIFT, SDLK_RSHIFT }, + { Keyboard::KEY_LSHIFT, SDLK_LSHIFT }, + { Keyboard::KEY_RCTRL, SDLK_RCTRL }, + { Keyboard::KEY_LCTRL, SDLK_LCTRL }, + { Keyboard::KEY_RALT, SDLK_RALT }, + { Keyboard::KEY_LALT, SDLK_LALT }, + { Keyboard::KEY_RMETA, SDLK_RMETA }, + { Keyboard::KEY_LMETA, SDLK_LMETA }, + { Keyboard::KEY_LSUPER, SDLK_LSUPER }, + { Keyboard::KEY_RSUPER, SDLK_RSUPER }, + { Keyboard::KEY_MODE, SDLK_MODE }, + { Keyboard::KEY_COMPOSE, SDLK_COMPOSE }, + + { Keyboard::KEY_HELP, SDLK_HELP }, + { Keyboard::KEY_PRINT, SDLK_PRINT }, + { Keyboard::KEY_SYSREQ, SDLK_SYSREQ }, + { Keyboard::KEY_BREAK, SDLK_BREAK }, + { Keyboard::KEY_MENU, SDLK_MENU }, + { Keyboard::KEY_POWER, SDLK_POWER }, + { Keyboard::KEY_EURO, SDLK_EURO }, + { Keyboard::KEY_UNDO, SDLK_UNDO }, +}; + +EnumMap Keyboard::keys(Keyboard::keyEntries, sizeof(Keyboard::keyEntries)); + + +} // sdl +} // keyboard +} // love diff --git a/src/modules/keyboard/sdl/Keyboard.h b/src/modules/keyboard/sdl/Keyboard.h index 053565af4..8fe5c264f 100644 --- a/src/modules/keyboard/sdl/Keyboard.h +++ b/src/modules/keyboard/sdl/Keyboard.h @@ -1,60 +1,60 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_KEYBOARD_SDL_KEYBOARD_H -#define LOVE_KEYBOARD_SDL_KEYBOARD_H - -// LOVE -#include "keyboard/Keyboard.h" -#include "common/EnumMap.h" - -// SDL -#include - -namespace love -{ -namespace keyboard -{ -namespace sdl -{ - -class Keyboard : public love::keyboard::Keyboard -{ -public: - - // Implements Module. - const char *getName() const; - bool isDown(Key *keylist) const; - void setKeyRepeat(int delay, int interval) const; - int getKeyRepeatDelay() const; - int getKeyRepeatInterval() const; - -private: - - static EnumMap::Entry keyEntries[]; - static EnumMap keys; - -}; // Keyboard - -} // sdl -} // keyboard -} // love - -#endif // LOVE_KEYBOARD_SDL_KEYBOARD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_KEYBOARD_SDL_KEYBOARD_H +#define LOVE_KEYBOARD_SDL_KEYBOARD_H + +// LOVE +#include "keyboard/Keyboard.h" +#include "common/EnumMap.h" + +// SDL +#include + +namespace love +{ +namespace keyboard +{ +namespace sdl +{ + +class Keyboard : public love::keyboard::Keyboard +{ +public: + + // Implements Module. + const char *getName() const; + bool isDown(Key *keylist) const; + void setKeyRepeat(int delay, int interval) const; + int getKeyRepeatDelay() const; + int getKeyRepeatInterval() const; + +private: + + static EnumMap::Entry keyEntries[]; + static EnumMap keys; + +}; // Keyboard + +} // sdl +} // keyboard +} // love + +#endif // LOVE_KEYBOARD_SDL_KEYBOARD_H diff --git a/src/modules/keyboard/wrap_Keyboard.cpp b/src/modules/keyboard/wrap_Keyboard.cpp index 5df404085..8c7e15030 100644 --- a/src/modules/keyboard/wrap_Keyboard.cpp +++ b/src/modules/keyboard/wrap_Keyboard.cpp @@ -1,111 +1,111 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -#include "wrap_Keyboard.h" - -#include "sdl/Keyboard.h" - -namespace love -{ -namespace keyboard -{ - -static Keyboard *instance; - -int w_isDown(lua_State *L) -{ - Keyboard::Key k; - unsigned int num = lua_gettop(L); - Keyboard::Key *keylist = new Keyboard::Key[num+1]; - unsigned int counter = 0; - - for (unsigned int i = 0; i < num; i++) - { - if (Keyboard::getConstant(luaL_checkstring(L, i+1), k)) - keylist[counter++] = k; - } - keylist[counter] = Keyboard::KEY_MAX_ENUM; - - luax_pushboolean(L, instance->isDown(keylist)); - delete[] keylist; - return 1; -} - -int w_setKeyRepeat(lua_State *L) -{ - if (lua_gettop(L) == 0) - { - // Disables key repeat. - instance->setKeyRepeat(0, 0); - return 0; - } - - int delay = lua_isnumber(L, 1) ? (int)(lua_tonumber(L, 1) * 1000 + 0.5) : Keyboard::DEFAULT; - int interval = lua_isnumber(L, 2) ? (int)(lua_tonumber(L, 2) * 1000 + 0.5) : Keyboard::DEFAULT; - instance->setKeyRepeat(delay, interval); - return 0; -} - -int w_getKeyRepeat(lua_State *L) -{ - lua_pushnumber(L, (lua_Number) instance->getKeyRepeatDelay() * 0.001); - lua_pushnumber(L, (lua_Number) instance->getKeyRepeatInterval() * 0.001); - return 2; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "isDown", w_isDown }, - { "setKeyRepeat", w_setKeyRepeat }, - { "getKeyRepeat", w_getKeyRepeat }, - { 0, 0 } -}; - -extern "C" int luaopen_love_keyboard(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new love::keyboard::sdl::Keyboard(); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "keyboard"; - w.flags = MODULE_T; - w.functions = functions; - w.types = 0; - - return luax_register_module(L, w); -} - -} // keyboard -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +#include "wrap_Keyboard.h" + +#include "sdl/Keyboard.h" + +namespace love +{ +namespace keyboard +{ + +static Keyboard *instance; + +int w_isDown(lua_State *L) +{ + Keyboard::Key k; + unsigned int num = lua_gettop(L); + Keyboard::Key *keylist = new Keyboard::Key[num+1]; + unsigned int counter = 0; + + for (unsigned int i = 0; i < num; i++) + { + if (Keyboard::getConstant(luaL_checkstring(L, i+1), k)) + keylist[counter++] = k; + } + keylist[counter] = Keyboard::KEY_MAX_ENUM; + + luax_pushboolean(L, instance->isDown(keylist)); + delete[] keylist; + return 1; +} + +int w_setKeyRepeat(lua_State *L) +{ + if (lua_gettop(L) == 0) + { + // Disables key repeat. + instance->setKeyRepeat(0, 0); + return 0; + } + + int delay = lua_isnumber(L, 1) ? (int)(lua_tonumber(L, 1) * 1000 + 0.5) : Keyboard::DEFAULT; + int interval = lua_isnumber(L, 2) ? (int)(lua_tonumber(L, 2) * 1000 + 0.5) : Keyboard::DEFAULT; + instance->setKeyRepeat(delay, interval); + return 0; +} + +int w_getKeyRepeat(lua_State *L) +{ + lua_pushnumber(L, (lua_Number) instance->getKeyRepeatDelay() * 0.001); + lua_pushnumber(L, (lua_Number) instance->getKeyRepeatInterval() * 0.001); + return 2; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "isDown", w_isDown }, + { "setKeyRepeat", w_setKeyRepeat }, + { "getKeyRepeat", w_getKeyRepeat }, + { 0, 0 } +}; + +extern "C" int luaopen_love_keyboard(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new love::keyboard::sdl::Keyboard(); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "keyboard"; + w.flags = MODULE_T; + w.functions = functions; + w.types = 0; + + return luax_register_module(L, w); +} + +} // keyboard +} // love diff --git a/src/modules/keyboard/wrap_Keyboard.h b/src/modules/keyboard/wrap_Keyboard.h index 80c0c60f1..ca8275b1d 100644 --- a/src/modules/keyboard/wrap_Keyboard.h +++ b/src/modules/keyboard/wrap_Keyboard.h @@ -1,40 +1,40 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_KEYBOARD_WRAP_KEYBOARD_H -#define LOVE_KEYBOARD_WRAP_KEYBOARD_H - -// LOVE -#include "Keyboard.h" - -namespace love -{ -namespace keyboard -{ - -int w_isDown(lua_State *L); -int w_setKeyRepeat(lua_State *L); -int w_getKeyRepeat(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_keyboard(lua_State *L); - -} // keyboard -} // love - -#endif // LOVE_KEYBOARD_WRAP_KEYBOARD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_KEYBOARD_WRAP_KEYBOARD_H +#define LOVE_KEYBOARD_WRAP_KEYBOARD_H + +// LOVE +#include "Keyboard.h" + +namespace love +{ +namespace keyboard +{ + +int w_isDown(lua_State *L); +int w_setKeyRepeat(lua_State *L); +int w_getKeyRepeat(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_keyboard(lua_State *L); + +} // keyboard +} // love + +#endif // LOVE_KEYBOARD_WRAP_KEYBOARD_H diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index 1fb616720..bd991cd10 100644 --- a/src/modules/love/love.cpp +++ b/src/modules/love/love.cpp @@ -1,205 +1,205 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "common/config.h" -#include "common/version.h" -#include "common/runtime.h" - -#include "love.h" - -#ifdef LOVE_WINDOWS -#include -#endif // LOVE_WINDOWS - -#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK -#include -#include -#include -#include -#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK - -// Libraries. -#include "libraries/luasocket/luasocket.h" - -// Scripts -#include "scripts/boot.lua.h" - -// All modules define a c-accessible luaopen -// so let's make use of those, instead -// of addressing implementations directly. -extern "C" -{ - extern int luaopen_love_audio(lua_State*); - extern int luaopen_love_event(lua_State*); - extern int luaopen_love_filesystem(lua_State*); - extern int luaopen_love_font(lua_State*); - extern int luaopen_love_graphics(lua_State*); - extern int luaopen_love_image(lua_State*); - extern int luaopen_love_joystick(lua_State*); - extern int luaopen_love_keyboard(lua_State*); - extern int luaopen_love_mouse(lua_State*); - extern int luaopen_love_physics(lua_State*); - extern int luaopen_love_sound(lua_State*); - extern int luaopen_love_timer(lua_State*); - extern int luaopen_love_thread(lua_State*); - extern int luaopen_love_boot(lua_State*); -} - -static const luaL_Reg modules[] = { - { "love.audio", luaopen_love_audio }, - { "love.event", luaopen_love_event }, - { "love.filesystem", luaopen_love_filesystem }, - { "love.font", luaopen_love_font }, - { "love.graphics", luaopen_love_graphics }, - { "love.image", luaopen_love_image }, - { "love.joystick", luaopen_love_joystick }, - { "love.keyboard", luaopen_love_keyboard }, - { "love.mouse", luaopen_love_mouse }, - { "love.physics", luaopen_love_physics }, - { "love.sound", luaopen_love_sound }, - { "love.timer", luaopen_love_timer }, - { "love.thread", luaopen_love_thread }, - { "love.boot", luaopen_love_boot }, - { 0, 0 } -}; - -#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK -int w__openConsole(lua_State * L); -#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK - -const char *love_version() -{ - return love::VERSION; -} - -const char *love_codename() -{ - return love::VERSION_CODENAME; -} - -int luaopen_love(lua_State * L) -{ - love::luax_insistglobal(L, "love"); - - // Set version information. - lua_pushstring(L, love::VERSION); - lua_setfield(L, -2, "_version"); - - lua_pushnumber(L, love::VERSION_MAJOR); - lua_setfield(L, -2, "_version_major"); - lua_pushnumber(L, love::VERSION_MINOR); - lua_setfield(L, -2, "_version_minor"); - lua_pushnumber(L, love::VERSION_REV); - lua_setfield(L, -2, "_version_revision"); - - lua_pushstring(L, love::VERSION_CODENAME); - lua_setfield(L, -2, "_version_codename"); - -#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK - lua_pushcfunction(L, w__openConsole); - lua_setfield(L, -2, "_openConsole"); -#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK - - lua_newtable(L); - - for (int i = 0; love::VERSION_COMPATIBILITY[i] != 0; ++i) - { - lua_pushstring(L, love::VERSION_COMPATIBILITY[i]); - lua_rawseti(L, -2, i+1); - } - - lua_setfield(L, -2, "_version_compat"); - -#ifdef LOVE_WINDOWS - lua_pushstring(L, "Windows"); -#elif defined(LOVE_MACOSX) - lua_pushstring(L, "OS X"); -#elif defined(LOVE_LINUX) - lua_pushstring(L, "Linux"); -#else - lua_pushstring(L, "Unknown"); -#endif - lua_setfield(L, -2, "_os"); - - // Preload module loaders. - for (int i = 0; modules[i].name != 0; i++) - { - love::luax_preload(L, modules[i].func, modules[i].name); - } - - love::luasocket::__open(L); - - return 1; -} - -#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK - -int w__openConsole(lua_State * L) -{ - static bool is_open = false; - if (is_open) - return 0; - is_open = true; - - if (GetConsoleWindow() != NULL || AllocConsole() == 0) - return 0; - - const int MAX_CONSOLE_LINES = 5000; - CONSOLE_SCREEN_BUFFER_INFO console_info; - - // Set size. - GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &console_info); - console_info.dwSize.Y = MAX_CONSOLE_LINES; - SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), console_info.dwSize); - - SetConsoleTitle(TEXT("LOVE Console")); - - FILE * fp; - - // Redirect stdout. - fp = freopen("CONOUT$", "w", stdout); - if (L && fp == NULL) - luaL_error(L, "Console redirection of stdout failed."); - - // Redirect stdin. - fp = freopen("CONIN$", "r", stdin); - if (L && fp == NULL) - luaL_error(L, "Console redirection of stdin failed."); - - // Redirect stderr. - fp = freopen("CONOUT$", "w", stderr); - if (L && fp == NULL) - luaL_error(L, "Console redirection of stderr failed."); - - return 0; -} - -#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK - -int luaopen_love_boot(lua_State *L) -{ - if (luaL_loadbuffer(L, (const char *)love::boot_lua, sizeof(love::boot_lua), "boot.lua") == 0) - lua_call(L, 0, 1); - return 1; -} - - - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "common/config.h" +#include "common/version.h" +#include "common/runtime.h" + +#include "love.h" + +#ifdef LOVE_WINDOWS +#include +#endif // LOVE_WINDOWS + +#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK +#include +#include +#include +#include +#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK + +// Libraries. +#include "libraries/luasocket/luasocket.h" + +// Scripts +#include "scripts/boot.lua.h" + +// All modules define a c-accessible luaopen +// so let's make use of those, instead +// of addressing implementations directly. +extern "C" +{ + extern int luaopen_love_audio(lua_State*); + extern int luaopen_love_event(lua_State*); + extern int luaopen_love_filesystem(lua_State*); + extern int luaopen_love_font(lua_State*); + extern int luaopen_love_graphics(lua_State*); + extern int luaopen_love_image(lua_State*); + extern int luaopen_love_joystick(lua_State*); + extern int luaopen_love_keyboard(lua_State*); + extern int luaopen_love_mouse(lua_State*); + extern int luaopen_love_physics(lua_State*); + extern int luaopen_love_sound(lua_State*); + extern int luaopen_love_timer(lua_State*); + extern int luaopen_love_thread(lua_State*); + extern int luaopen_love_boot(lua_State*); +} + +static const luaL_Reg modules[] = { + { "love.audio", luaopen_love_audio }, + { "love.event", luaopen_love_event }, + { "love.filesystem", luaopen_love_filesystem }, + { "love.font", luaopen_love_font }, + { "love.graphics", luaopen_love_graphics }, + { "love.image", luaopen_love_image }, + { "love.joystick", luaopen_love_joystick }, + { "love.keyboard", luaopen_love_keyboard }, + { "love.mouse", luaopen_love_mouse }, + { "love.physics", luaopen_love_physics }, + { "love.sound", luaopen_love_sound }, + { "love.timer", luaopen_love_timer }, + { "love.thread", luaopen_love_thread }, + { "love.boot", luaopen_love_boot }, + { 0, 0 } +}; + +#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK +int w__openConsole(lua_State * L); +#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK + +const char *love_version() +{ + return love::VERSION; +} + +const char *love_codename() +{ + return love::VERSION_CODENAME; +} + +int luaopen_love(lua_State * L) +{ + love::luax_insistglobal(L, "love"); + + // Set version information. + lua_pushstring(L, love::VERSION); + lua_setfield(L, -2, "_version"); + + lua_pushnumber(L, love::VERSION_MAJOR); + lua_setfield(L, -2, "_version_major"); + lua_pushnumber(L, love::VERSION_MINOR); + lua_setfield(L, -2, "_version_minor"); + lua_pushnumber(L, love::VERSION_REV); + lua_setfield(L, -2, "_version_revision"); + + lua_pushstring(L, love::VERSION_CODENAME); + lua_setfield(L, -2, "_version_codename"); + +#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK + lua_pushcfunction(L, w__openConsole); + lua_setfield(L, -2, "_openConsole"); +#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK + + lua_newtable(L); + + for (int i = 0; love::VERSION_COMPATIBILITY[i] != 0; ++i) + { + lua_pushstring(L, love::VERSION_COMPATIBILITY[i]); + lua_rawseti(L, -2, i+1); + } + + lua_setfield(L, -2, "_version_compat"); + +#ifdef LOVE_WINDOWS + lua_pushstring(L, "Windows"); +#elif defined(LOVE_MACOSX) + lua_pushstring(L, "OS X"); +#elif defined(LOVE_LINUX) + lua_pushstring(L, "Linux"); +#else + lua_pushstring(L, "Unknown"); +#endif + lua_setfield(L, -2, "_os"); + + // Preload module loaders. + for (int i = 0; modules[i].name != 0; i++) + { + love::luax_preload(L, modules[i].func, modules[i].name); + } + + love::luasocket::__open(L); + + return 1; +} + +#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK + +int w__openConsole(lua_State * L) +{ + static bool is_open = false; + if (is_open) + return 0; + is_open = true; + + if (GetConsoleWindow() != NULL || AllocConsole() == 0) + return 0; + + const int MAX_CONSOLE_LINES = 5000; + CONSOLE_SCREEN_BUFFER_INFO console_info; + + // Set size. + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &console_info); + console_info.dwSize.Y = MAX_CONSOLE_LINES; + SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), console_info.dwSize); + + SetConsoleTitle(TEXT("LOVE Console")); + + FILE * fp; + + // Redirect stdout. + fp = freopen("CONOUT$", "w", stdout); + if (L && fp == NULL) + luaL_error(L, "Console redirection of stdout failed."); + + // Redirect stdin. + fp = freopen("CONIN$", "r", stdin); + if (L && fp == NULL) + luaL_error(L, "Console redirection of stdin failed."); + + // Redirect stderr. + fp = freopen("CONOUT$", "w", stderr); + if (L && fp == NULL) + luaL_error(L, "Console redirection of stderr failed."); + + return 0; +} + +#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK + +int luaopen_love_boot(lua_State *L) +{ + if (luaL_loadbuffer(L, (const char *)love::boot_lua, sizeof(love::boot_lua), "boot.lua") == 0) + lua_call(L, 0, 1); + return 1; +} + + + diff --git a/src/modules/love/love.h b/src/modules/love/love.h index 6ba7a2e60..d77a6d70c 100644 --- a/src/modules/love/love.h +++ b/src/modules/love/love.h @@ -1,33 +1,33 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "common/config.h" - -// Forward declare lua_State. -struct lua_State; - -extern "C" -{ - LOVE_EXPORT const char *love_version(); - LOVE_EXPORT const char *love_codename(); - LOVE_EXPORT int luaopen_love(lua_State *L); - LOVE_EXPORT int luaopen_love_boot(lua_State *L); -} +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "common/config.h" + +// Forward declare lua_State. +struct lua_State; + +extern "C" +{ + LOVE_EXPORT const char *love_version(); + LOVE_EXPORT const char *love_codename(); + LOVE_EXPORT int luaopen_love(lua_State *L); + LOVE_EXPORT int luaopen_love_boot(lua_State *L); +} diff --git a/src/modules/mouse/Mouse.cpp b/src/modules/mouse/Mouse.cpp index 8a249a34c..fa665586b 100644 --- a/src/modules/mouse/Mouse.cpp +++ b/src/modules/mouse/Mouse.cpp @@ -1,52 +1,52 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Mouse.h" - -namespace love -{ -namespace mouse -{ - -bool Mouse::getConstant(const char *in, Button &out) -{ - return buttons.find(in, out); -} - -bool Mouse::getConstant(Button in, const char *&out) -{ - return buttons.find(in, out); -} - -StringMap::Entry Mouse::buttonEntries[] = -{ - {"l", Mouse::BUTTON_LEFT}, - {"m", Mouse::BUTTON_MIDDLE}, - {"r", Mouse::BUTTON_RIGHT}, - {"wu", Mouse::BUTTON_WHEELUP}, - {"wd", Mouse::BUTTON_WHEELDOWN}, - {"x1", Mouse::BUTTON_X1}, - {"x2", Mouse::BUTTON_X2}, -}; - -StringMap Mouse::buttons(Mouse::buttonEntries, sizeof(Mouse::buttonEntries)); - -} // mouse -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Mouse.h" + +namespace love +{ +namespace mouse +{ + +bool Mouse::getConstant(const char *in, Button &out) +{ + return buttons.find(in, out); +} + +bool Mouse::getConstant(Button in, const char *&out) +{ + return buttons.find(in, out); +} + +StringMap::Entry Mouse::buttonEntries[] = +{ + {"l", Mouse::BUTTON_LEFT}, + {"m", Mouse::BUTTON_MIDDLE}, + {"r", Mouse::BUTTON_RIGHT}, + {"wu", Mouse::BUTTON_WHEELUP}, + {"wd", Mouse::BUTTON_WHEELDOWN}, + {"x1", Mouse::BUTTON_X1}, + {"x2", Mouse::BUTTON_X2}, +}; + +StringMap Mouse::buttons(Mouse::buttonEntries, sizeof(Mouse::buttonEntries)); + +} // mouse +} // love diff --git a/src/modules/mouse/Mouse.h b/src/modules/mouse/Mouse.h index 88e223ffb..730fef5da 100644 --- a/src/modules/mouse/Mouse.h +++ b/src/modules/mouse/Mouse.h @@ -1,77 +1,77 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_MOUSE_MOUSE_H -#define LOVE_MOUSE_MOUSE_H - -// LOVE -#include "common/Module.h" -#include "common/StringMap.h" - -namespace love -{ -namespace mouse -{ - -class Mouse : public Module -{ -public: - - enum Button - { - BUTTON_INVALID, - BUTTON_LEFT, - BUTTON_MIDDLE, - BUTTON_RIGHT, - BUTTON_WHEELUP, - BUTTON_WHEELDOWN, - BUTTON_X1, - BUTTON_X2, - BUTTON_MAX_ENUM - }; - - virtual ~Mouse() {}; - - virtual int getX() const = 0; - virtual int getY() const = 0; - virtual void getPosition(int &x, int &y) const = 0; - virtual void setX(int x) = 0; - virtual void setY(int y) = 0; - virtual void setPosition(int x, int y) = 0; - virtual void setVisible(bool visible) = 0; - virtual bool isDown(Button *buttonlist) const = 0; - virtual bool isVisible() const = 0; - virtual void setGrab(bool grab) = 0; - virtual bool isGrabbed() const = 0; - - static bool getConstant(const char *in, Button &out); - static bool getConstant(Button in, const char *&out); - -private: - - static StringMap::Entry buttonEntries[]; - static StringMap buttons; - -}; // Mouse - -} // mouse -} // love - -#endif // LOVE_MOUSE_MOUSE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_MOUSE_MOUSE_H +#define LOVE_MOUSE_MOUSE_H + +// LOVE +#include "common/Module.h" +#include "common/StringMap.h" + +namespace love +{ +namespace mouse +{ + +class Mouse : public Module +{ +public: + + enum Button + { + BUTTON_INVALID, + BUTTON_LEFT, + BUTTON_MIDDLE, + BUTTON_RIGHT, + BUTTON_WHEELUP, + BUTTON_WHEELDOWN, + BUTTON_X1, + BUTTON_X2, + BUTTON_MAX_ENUM + }; + + virtual ~Mouse() {}; + + virtual int getX() const = 0; + virtual int getY() const = 0; + virtual void getPosition(int &x, int &y) const = 0; + virtual void setX(int x) = 0; + virtual void setY(int y) = 0; + virtual void setPosition(int x, int y) = 0; + virtual void setVisible(bool visible) = 0; + virtual bool isDown(Button *buttonlist) const = 0; + virtual bool isVisible() const = 0; + virtual void setGrab(bool grab) = 0; + virtual bool isGrabbed() const = 0; + + static bool getConstant(const char *in, Button &out); + static bool getConstant(Button in, const char *&out); + +private: + + static StringMap::Entry buttonEntries[]; + static StringMap buttons; + +}; // Mouse + +} // mouse +} // love + +#endif // LOVE_MOUSE_MOUSE_H diff --git a/src/modules/mouse/sdl/Mouse.cpp b/src/modules/mouse/sdl/Mouse.cpp index 09c3e67af..ac20733ef 100644 --- a/src/modules/mouse/sdl/Mouse.cpp +++ b/src/modules/mouse/sdl/Mouse.cpp @@ -1,109 +1,109 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Mouse.h" - -// SDL -#include - -namespace love -{ -namespace mouse -{ -namespace sdl -{ - -const char *Mouse::getName() const -{ - return "love.mouse.sdl"; -} - -int Mouse::getX() const -{ - int x; - SDL_GetMouseState(&x, 0); - return x; -} - -int Mouse::getY() const -{ - int y; - SDL_GetMouseState(0, &y); - return y; -} - -void Mouse::getPosition(int &x, int &y) const -{ - SDL_GetMouseState(&x, &y); -} - -void Mouse::setPosition(int x, int y) -{ - SDL_WarpMouse(x, y); -} - -void Mouse::setX(int x) -{ - int y = getY(); - setPosition(x, y); -} - -void Mouse::setY(int y) -{ - int x = getX(); - setPosition(x, y); -} - -void Mouse::setVisible(bool visible) -{ - SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE); -} - -bool Mouse::isDown(Button *buttonlist) const -{ - Uint8 buttonstate = SDL_GetMouseState(0, 0); - - for (Button button = *buttonlist; button != BUTTON_MAX_ENUM; button = *(++buttonlist)) - { - if (buttonstate & SDL_BUTTON(button)) - return true; - } - - return false; -} - -bool Mouse::isVisible() const -{ - return (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE) ? true : false; -} - -void Mouse::setGrab(bool grab) -{ - SDL_WM_GrabInput(grab ? SDL_GRAB_ON : SDL_GRAB_OFF); -} - -bool Mouse::isGrabbed() const -{ - return (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON ? true : false); -} - -} // sdl -} // mouse -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Mouse.h" + +// SDL +#include + +namespace love +{ +namespace mouse +{ +namespace sdl +{ + +const char *Mouse::getName() const +{ + return "love.mouse.sdl"; +} + +int Mouse::getX() const +{ + int x; + SDL_GetMouseState(&x, 0); + return x; +} + +int Mouse::getY() const +{ + int y; + SDL_GetMouseState(0, &y); + return y; +} + +void Mouse::getPosition(int &x, int &y) const +{ + SDL_GetMouseState(&x, &y); +} + +void Mouse::setPosition(int x, int y) +{ + SDL_WarpMouse(x, y); +} + +void Mouse::setX(int x) +{ + int y = getY(); + setPosition(x, y); +} + +void Mouse::setY(int y) +{ + int x = getX(); + setPosition(x, y); +} + +void Mouse::setVisible(bool visible) +{ + SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE); +} + +bool Mouse::isDown(Button *buttonlist) const +{ + Uint8 buttonstate = SDL_GetMouseState(0, 0); + + for (Button button = *buttonlist; button != BUTTON_MAX_ENUM; button = *(++buttonlist)) + { + if (buttonstate & SDL_BUTTON(button)) + return true; + } + + return false; +} + +bool Mouse::isVisible() const +{ + return (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE) ? true : false; +} + +void Mouse::setGrab(bool grab) +{ + SDL_WM_GrabInput(grab ? SDL_GRAB_ON : SDL_GRAB_OFF); +} + +bool Mouse::isGrabbed() const +{ + return (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON ? true : false); +} + +} // sdl +} // mouse +} // love diff --git a/src/modules/mouse/sdl/Mouse.h b/src/modules/mouse/sdl/Mouse.h index b9dd2b8e8..9ff872ef7 100644 --- a/src/modules/mouse/sdl/Mouse.h +++ b/src/modules/mouse/sdl/Mouse.h @@ -1,58 +1,58 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_MOUSE_SDL_MOUSE_H -#define LOVE_MOUSE_SDL_MOUSE_H - -// LOVE -#include "mouse/Mouse.h" - -namespace love -{ -namespace mouse -{ -namespace sdl -{ - -class Mouse : public love::mouse::Mouse -{ -public: - - // Implements Module. - const char *getName() const; - - int getX() const; - int getY() const; - void getPosition(int &x, int &y) const; - void setX(int x); - void setY(int y); - void setPosition(int x, int y); - void setVisible(bool visible); - bool isDown(Button *buttonlist) const; - bool isVisible() const; - void setGrab(bool grab); - bool isGrabbed() const; -}; // Mouse - -} // sdl -} // mouse -} // love - -#endif // LOVE_MOUSE_SDL_MOUSE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_MOUSE_SDL_MOUSE_H +#define LOVE_MOUSE_SDL_MOUSE_H + +// LOVE +#include "mouse/Mouse.h" + +namespace love +{ +namespace mouse +{ +namespace sdl +{ + +class Mouse : public love::mouse::Mouse +{ +public: + + // Implements Module. + const char *getName() const; + + int getX() const; + int getY() const; + void getPosition(int &x, int &y) const; + void setX(int x); + void setY(int y); + void setPosition(int x, int y); + void setVisible(bool visible); + bool isDown(Button *buttonlist) const; + bool isVisible() const; + void setGrab(bool grab); + bool isGrabbed() const; +}; // Mouse + +} // sdl +} // mouse +} // love + +#endif // LOVE_MOUSE_SDL_MOUSE_H diff --git a/src/modules/mouse/wrap_Mouse.cpp b/src/modules/mouse/wrap_Mouse.cpp index d66849334..fa576ba0d 100644 --- a/src/modules/mouse/wrap_Mouse.cpp +++ b/src/modules/mouse/wrap_Mouse.cpp @@ -1,166 +1,166 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -#include "sdl/Mouse.h" - -#include "wrap_Mouse.h" - -namespace love -{ -namespace mouse -{ - -static Mouse *instance = 0; - -int w_getX(lua_State *L) -{ - lua_pushnumber(L, instance->getX()); - return 1; -} - -int w_getY(lua_State *L) -{ - lua_pushnumber(L, instance->getY()); - return 1; -} - -int w_getPosition(lua_State *L) -{ - int x, y; - instance->getPosition(x, y); - lua_pushinteger(L, x); - lua_pushinteger(L, y); - return 2; -} - -int w_setX(lua_State *L) -{ - int x = luaL_checkint(L, 1); - instance->setX(x); - return 0; -} - -int w_setY(lua_State *L) -{ - int y = luaL_checkint(L, 1); - instance->setY(y); - return 0; -} - -int w_setPosition(lua_State *L) -{ - int x = luaL_checkint(L, 1); - int y = luaL_checkint(L, 2); - instance->setPosition(x, y); - return 0; -} - -int w_isDown(lua_State *L) -{ - Mouse::Button b; - unsigned int num = lua_gettop(L); - Mouse::Button *buttonlist = new Mouse::Button[num+1]; - unsigned int counter = 0; - - for (unsigned int i = 0; i < num; i++) - { - if (Mouse::getConstant(luaL_checkstring(L, i+1), b)) - buttonlist[counter++] = b; - } - buttonlist[counter] = Mouse::BUTTON_MAX_ENUM; - - luax_pushboolean(L, instance->isDown(buttonlist)); - delete[] buttonlist; - return 1; -} - -int w_setVisible(lua_State *L) -{ - bool b = luax_toboolean(L, 1); - instance->setVisible(b); - return 0; -} - -int w_isVisible(lua_State *L) -{ - luax_pushboolean(L, instance->isVisible()); - return 1; -} - -int w_setGrab(lua_State *L) -{ - bool b = luax_toboolean(L, 1); - instance->setGrab(b); - return 0; -} - -int w_isGrabbed(lua_State *L) -{ - luax_pushboolean(L, instance->isGrabbed()); - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "getX", w_getX }, - { "getY", w_getY }, - { "setX", w_setX }, - { "setY", w_setY }, - { "setPosition", w_setPosition }, - { "isDown", w_isDown }, - { "setVisible", w_setVisible }, - { "isVisible", w_isVisible }, - { "getPosition", w_getPosition }, - { "setGrab", w_setGrab }, - { "isGrabbed", w_isGrabbed }, - { 0, 0 } -}; - -extern "C" int luaopen_love_mouse(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new love::mouse::sdl::Mouse(); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "mouse"; - w.flags = MODULE_T; - w.functions = functions; - w.types = 0; - - return luax_register_module(L, w); -} - -} // mouse -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +#include "sdl/Mouse.h" + +#include "wrap_Mouse.h" + +namespace love +{ +namespace mouse +{ + +static Mouse *instance = 0; + +int w_getX(lua_State *L) +{ + lua_pushnumber(L, instance->getX()); + return 1; +} + +int w_getY(lua_State *L) +{ + lua_pushnumber(L, instance->getY()); + return 1; +} + +int w_getPosition(lua_State *L) +{ + int x, y; + instance->getPosition(x, y); + lua_pushinteger(L, x); + lua_pushinteger(L, y); + return 2; +} + +int w_setX(lua_State *L) +{ + int x = luaL_checkint(L, 1); + instance->setX(x); + return 0; +} + +int w_setY(lua_State *L) +{ + int y = luaL_checkint(L, 1); + instance->setY(y); + return 0; +} + +int w_setPosition(lua_State *L) +{ + int x = luaL_checkint(L, 1); + int y = luaL_checkint(L, 2); + instance->setPosition(x, y); + return 0; +} + +int w_isDown(lua_State *L) +{ + Mouse::Button b; + unsigned int num = lua_gettop(L); + Mouse::Button *buttonlist = new Mouse::Button[num+1]; + unsigned int counter = 0; + + for (unsigned int i = 0; i < num; i++) + { + if (Mouse::getConstant(luaL_checkstring(L, i+1), b)) + buttonlist[counter++] = b; + } + buttonlist[counter] = Mouse::BUTTON_MAX_ENUM; + + luax_pushboolean(L, instance->isDown(buttonlist)); + delete[] buttonlist; + return 1; +} + +int w_setVisible(lua_State *L) +{ + bool b = luax_toboolean(L, 1); + instance->setVisible(b); + return 0; +} + +int w_isVisible(lua_State *L) +{ + luax_pushboolean(L, instance->isVisible()); + return 1; +} + +int w_setGrab(lua_State *L) +{ + bool b = luax_toboolean(L, 1); + instance->setGrab(b); + return 0; +} + +int w_isGrabbed(lua_State *L) +{ + luax_pushboolean(L, instance->isGrabbed()); + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "getX", w_getX }, + { "getY", w_getY }, + { "setX", w_setX }, + { "setY", w_setY }, + { "setPosition", w_setPosition }, + { "isDown", w_isDown }, + { "setVisible", w_setVisible }, + { "isVisible", w_isVisible }, + { "getPosition", w_getPosition }, + { "setGrab", w_setGrab }, + { "isGrabbed", w_isGrabbed }, + { 0, 0 } +}; + +extern "C" int luaopen_love_mouse(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new love::mouse::sdl::Mouse(); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "mouse"; + w.flags = MODULE_T; + w.functions = functions; + w.types = 0; + + return luax_register_module(L, w); +} + +} // mouse +} // love diff --git a/src/modules/mouse/wrap_Mouse.h b/src/modules/mouse/wrap_Mouse.h index 610d7fdd8..2644a909f 100644 --- a/src/modules/mouse/wrap_Mouse.h +++ b/src/modules/mouse/wrap_Mouse.h @@ -1,49 +1,49 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_MOUSE_WRAP_MOUSE_H -#define LOVE_MOUSE_WRAP_MOUSE_H - -// LOVE -#include "Mouse.h" - -namespace love -{ -namespace mouse -{ - -int w_getX(lua_State *L); -int w_getY(lua_State *L); -int w_getPosition(lua_State *L); -int w_setX(lua_State *L); -int w_setY(lua_State *L); -int w_setPosition(lua_State *L); -int w_isDown(lua_State *L); -int w_setVisible(lua_State *L); -int w_isVisible(lua_State *L); -int w_setGrap(lua_State *L); -int w_isGrabbed(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_mouse(lua_State *L); - -} // mouse -} // love - -#endif // LOVE_MOUSE_WRAP_MOUSE_H - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_MOUSE_WRAP_MOUSE_H +#define LOVE_MOUSE_WRAP_MOUSE_H + +// LOVE +#include "Mouse.h" + +namespace love +{ +namespace mouse +{ + +int w_getX(lua_State *L); +int w_getY(lua_State *L); +int w_getPosition(lua_State *L); +int w_setX(lua_State *L); +int w_setY(lua_State *L); +int w_setPosition(lua_State *L); +int w_isDown(lua_State *L); +int w_setVisible(lua_State *L); +int w_isVisible(lua_State *L); +int w_setGrap(lua_State *L); +int w_isGrabbed(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_mouse(lua_State *L); + +} // mouse +} // love + +#endif // LOVE_MOUSE_WRAP_MOUSE_H + diff --git a/src/modules/physics/Body.cpp b/src/modules/physics/Body.cpp index 916c76800..4a323f2b4 100644 --- a/src/modules/physics/Body.cpp +++ b/src/modules/physics/Body.cpp @@ -1,52 +1,52 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Body.h" - -namespace love -{ -namespace physics -{ - -Body::~Body() -{ -} - -bool Body::getConstant(const char *in, Type &out) -{ - return types.find(in, out); -} - -bool Body::getConstant(Type in, const char *&out) -{ - return types.find(in, out); -} - -StringMap::Entry Body::typeEntries[] = -{ - {"static", Body::BODY_STATIC}, - {"dynamic", Body::BODY_DYNAMIC}, - {"kinematic", Body::BODY_KINEMATIC}, -}; - -StringMap Body::types(Body::typeEntries, sizeof(Body::typeEntries)); - -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Body.h" + +namespace love +{ +namespace physics +{ + +Body::~Body() +{ +} + +bool Body::getConstant(const char *in, Type &out) +{ + return types.find(in, out); +} + +bool Body::getConstant(Type in, const char *&out) +{ + return types.find(in, out); +} + +StringMap::Entry Body::typeEntries[] = +{ + {"static", Body::BODY_STATIC}, + {"dynamic", Body::BODY_DYNAMIC}, + {"kinematic", Body::BODY_KINEMATIC}, +}; + +StringMap Body::types(Body::typeEntries, sizeof(Body::typeEntries)); + +} // physics +} // love diff --git a/src/modules/physics/Body.h b/src/modules/physics/Body.h index b20b17ae8..f1d02efc9 100644 --- a/src/modules/physics/Body.h +++ b/src/modules/physics/Body.h @@ -1,60 +1,60 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BODY_H -#define LOVE_PHYSICS_BODY_H - -// LOVE -#include "common/Object.h" -#include "common/StringMap.h" - -namespace love -{ -namespace physics -{ - -class Body : public Object -{ -public: - - enum Type - { - BODY_INVALID, - BODY_STATIC, - BODY_DYNAMIC, - BODY_KINEMATIC, - BODY_MAX_ENUM - }; - - virtual ~Body(); - - static bool getConstant(const char *in, Type &out); - static bool getConstant(Type in, const char *&out); - -private: - - static StringMap::Entry typeEntries[]; - static StringMap types; -}; - -} // physics -} // love - -#endif // LOVE_PHYSICS_BODY_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BODY_H +#define LOVE_PHYSICS_BODY_H + +// LOVE +#include "common/Object.h" +#include "common/StringMap.h" + +namespace love +{ +namespace physics +{ + +class Body : public Object +{ +public: + + enum Type + { + BODY_INVALID, + BODY_STATIC, + BODY_DYNAMIC, + BODY_KINEMATIC, + BODY_MAX_ENUM + }; + + virtual ~Body(); + + static bool getConstant(const char *in, Type &out); + static bool getConstant(Type in, const char *&out); + +private: + + static StringMap::Entry typeEntries[]; + static StringMap types; +}; + +} // physics +} // love + +#endif // LOVE_PHYSICS_BODY_H diff --git a/src/modules/physics/Joint.cpp b/src/modules/physics/Joint.cpp index 895e98cea..9d3d2f1e1 100644 --- a/src/modules/physics/Joint.cpp +++ b/src/modules/physics/Joint.cpp @@ -1,59 +1,59 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Joint.h" - -namespace love -{ -namespace physics -{ - -Joint::~Joint() -{ -} - -bool Joint::getConstant(const char *in, Type &out) -{ - return types.find(in, out); -} - -bool Joint::getConstant(Type in, const char *&out) -{ - return types.find(in, out); -} - -StringMap::Entry Joint::typeEntries[] = -{ - {"distance", Joint::JOINT_DISTANCE}, - {"revolute", Joint::JOINT_REVOLUTE}, - {"prismatic", Joint::JOINT_PRISMATIC}, - {"mouse", Joint::JOINT_MOUSE}, - {"pulley", Joint::JOINT_PULLEY}, - {"gear", Joint::JOINT_GEAR}, - {"friction", Joint::JOINT_FRICTION}, - {"weld", Joint::JOINT_WELD}, - {"wheel", Joint::JOINT_WHEEL}, - {"rope", Joint::JOINT_ROPE}, -}; - -StringMap Joint::types(Joint::typeEntries, sizeof(Joint::typeEntries)); - -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Joint.h" + +namespace love +{ +namespace physics +{ + +Joint::~Joint() +{ +} + +bool Joint::getConstant(const char *in, Type &out) +{ + return types.find(in, out); +} + +bool Joint::getConstant(Type in, const char *&out) +{ + return types.find(in, out); +} + +StringMap::Entry Joint::typeEntries[] = +{ + {"distance", Joint::JOINT_DISTANCE}, + {"revolute", Joint::JOINT_REVOLUTE}, + {"prismatic", Joint::JOINT_PRISMATIC}, + {"mouse", Joint::JOINT_MOUSE}, + {"pulley", Joint::JOINT_PULLEY}, + {"gear", Joint::JOINT_GEAR}, + {"friction", Joint::JOINT_FRICTION}, + {"weld", Joint::JOINT_WELD}, + {"wheel", Joint::JOINT_WHEEL}, + {"rope", Joint::JOINT_ROPE}, +}; + +StringMap Joint::types(Joint::typeEntries, sizeof(Joint::typeEntries)); + +} // physics +} // love diff --git a/src/modules/physics/Joint.h b/src/modules/physics/Joint.h index c3a004f37..d0966a852 100644 --- a/src/modules/physics/Joint.h +++ b/src/modules/physics/Joint.h @@ -1,68 +1,68 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_JOINT_H -#define LOVE_PHYSICS_JOINT_H - -// LOVE -#include "common/Object.h" -#include "common/StringMap.h" - -namespace love -{ -namespace physics -{ - -class Joint : public Object -{ -public: - - enum Type - { - JOINT_INVALID, - JOINT_DISTANCE, - JOINT_REVOLUTE, - JOINT_PRISMATIC, - JOINT_MOUSE, - JOINT_PULLEY, - JOINT_GEAR, - JOINT_FRICTION, - JOINT_WELD, - JOINT_WHEEL, - JOINT_ROPE, - JOINT_MAX_ENUM - }; - - - virtual ~Joint(); - - static bool getConstant(const char *in, Type &out); - static bool getConstant(Type in, const char *&out); - -private: - - static StringMap::Entry typeEntries[]; - static StringMap types; -}; - -} // physics -} // love - -#endif // LOVE_PHYSICS_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_JOINT_H +#define LOVE_PHYSICS_JOINT_H + +// LOVE +#include "common/Object.h" +#include "common/StringMap.h" + +namespace love +{ +namespace physics +{ + +class Joint : public Object +{ +public: + + enum Type + { + JOINT_INVALID, + JOINT_DISTANCE, + JOINT_REVOLUTE, + JOINT_PRISMATIC, + JOINT_MOUSE, + JOINT_PULLEY, + JOINT_GEAR, + JOINT_FRICTION, + JOINT_WELD, + JOINT_WHEEL, + JOINT_ROPE, + JOINT_MAX_ENUM + }; + + + virtual ~Joint(); + + static bool getConstant(const char *in, Type &out); + static bool getConstant(Type in, const char *&out); + +private: + + static StringMap::Entry typeEntries[]; + static StringMap types; +}; + +} // physics +} // love + +#endif // LOVE_PHYSICS_JOINT_H diff --git a/src/modules/physics/Shape.cpp b/src/modules/physics/Shape.cpp index 7e76835c1..6937f2879 100644 --- a/src/modules/physics/Shape.cpp +++ b/src/modules/physics/Shape.cpp @@ -1,53 +1,53 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Shape.h" - -namespace love -{ -namespace physics -{ - -Shape::~Shape() -{ -} - -bool Shape::getConstant(const char *in, Type &out) -{ - return types.find(in, out); -} - -bool Shape::getConstant(Type in, const char *&out) -{ - return types.find(in, out); -} - -StringMap::Entry Shape::typeEntries[] = -{ - {"circle", Shape::SHAPE_CIRCLE}, - {"polygon", Shape::SHAPE_POLYGON}, - {"edge", Shape::SHAPE_EDGE}, - {"chain", Shape::SHAPE_CHAIN}, -}; - -StringMap Shape::types(Shape::typeEntries, sizeof(Shape::typeEntries)); - -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Shape.h" + +namespace love +{ +namespace physics +{ + +Shape::~Shape() +{ +} + +bool Shape::getConstant(const char *in, Type &out) +{ + return types.find(in, out); +} + +bool Shape::getConstant(Type in, const char *&out) +{ + return types.find(in, out); +} + +StringMap::Entry Shape::typeEntries[] = +{ + {"circle", Shape::SHAPE_CIRCLE}, + {"polygon", Shape::SHAPE_POLYGON}, + {"edge", Shape::SHAPE_EDGE}, + {"chain", Shape::SHAPE_CHAIN}, +}; + +StringMap Shape::types(Shape::typeEntries, sizeof(Shape::typeEntries)); + +} // physics +} // love diff --git a/src/modules/physics/Shape.h b/src/modules/physics/Shape.h index ba3e71de0..daba76273 100644 --- a/src/modules/physics/Shape.h +++ b/src/modules/physics/Shape.h @@ -1,61 +1,61 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_SHAPE_H -#define LOVE_PHYSICS_SHAPE_H - -// LOVE -#include "common/Object.h" -#include "common/StringMap.h" - -namespace love -{ -namespace physics -{ - -class Shape : public Object -{ -public: - - enum Type - { - SHAPE_INVALID, - SHAPE_CIRCLE, - SHAPE_POLYGON, - SHAPE_EDGE, - SHAPE_CHAIN, - SHAPE_MAX_ENUM - }; - - virtual ~Shape(); - - static bool getConstant(const char *in, Type &out); - static bool getConstant(Type in, const char *&out); - -private: - - static StringMap::Entry typeEntries[]; - static StringMap types; -}; - -} // physics -} // love - -#endif // LOVE_PHYSICS_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_SHAPE_H +#define LOVE_PHYSICS_SHAPE_H + +// LOVE +#include "common/Object.h" +#include "common/StringMap.h" + +namespace love +{ +namespace physics +{ + +class Shape : public Object +{ +public: + + enum Type + { + SHAPE_INVALID, + SHAPE_CIRCLE, + SHAPE_POLYGON, + SHAPE_EDGE, + SHAPE_CHAIN, + SHAPE_MAX_ENUM + }; + + virtual ~Shape(); + + static bool getConstant(const char *in, Type &out); + static bool getConstant(Type in, const char *&out); + +private: + + static StringMap::Entry typeEntries[]; + static StringMap types; +}; + +} // physics +} // love + +#endif // LOVE_PHYSICS_SHAPE_H diff --git a/src/modules/physics/box2d/Body.cpp b/src/modules/physics/box2d/Body.cpp index 0045d2ddd..17e5d5840 100644 --- a/src/modules/physics/box2d/Body.cpp +++ b/src/modules/physics/box2d/Body.cpp @@ -1,474 +1,474 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Body.h" - -#include "common/math.h" -#include "common/Memoizer.h" - -#include "Shape.h" -#include "Fixture.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Body::Body(World *world, b2Vec2 p, Body::Type type) - : world(world) -{ - world->retain(); - b2BodyDef def; - def.position = Physics::scaleDown(p); - body = world->world->CreateBody(&def); - // Box2D body holds a reference to the love Body. - this->retain(); - this->setType(type); - Memoizer::add(body, this); -} - -Body::Body(b2Body *b) - : body(b) -{ - world = (World *)Memoizer::find(b->GetWorld()); - world->retain(); - // Box2D body holds a reference to the love Body. - this->retain(); - Memoizer::add(body, this); -} - -Body::~Body() -{ - world->release(); - body = 0; -} - -float Body::getX() -{ - return Physics::scaleUp(body->GetPosition().x); -} - -float Body::getY() -{ - return Physics::scaleUp(body->GetPosition().y); -} - -void Body::getPosition(float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetPosition()); - x_o = v.x; - y_o = v.y; -} - -void Body::getLinearVelocity(float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetLinearVelocity()); - x_o = v.x; - y_o = v.y; -} - -float Body::getAngle() -{ - return body->GetAngle(); -} - -void Body::getWorldCenter(float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetWorldCenter()); - x_o = v.x; - y_o = v.y; -} - -void Body::getLocalCenter(float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetLocalCenter()); - x_o = v.x; - y_o = v.y; -} - -float Body::getAngularVelocity() const -{ - return body->GetAngularVelocity(); -} - -float Body::getMass() const -{ - return body->GetMass(); -} - -float Body::getInertia() const -{ - return Physics::scaleUp(Physics::scaleUp(body->GetInertia())); -} - -int Body::getMassData(lua_State *L) -{ - b2MassData data; - body->GetMassData(&data); - b2Vec2 center = Physics::scaleUp(data.center); - lua_pushnumber(L, center.x); - lua_pushnumber(L, center.y); - lua_pushnumber(L, data.mass); - lua_pushnumber(L, Physics::scaleUp(Physics::scaleUp(data.I))); - return 4; -} - -float Body::getAngularDamping() const -{ - return body->GetAngularDamping(); -} - -float Body::getLinearDamping() const -{ - return body->GetLinearDamping(); -} - -float Body::getGravityScale() const -{ - return body->GetGravityScale(); -} - -Body::Type Body::getType() const -{ - switch (body->GetType()) - { - case b2_staticBody: - return BODY_STATIC; - break; - case b2_dynamicBody: - return BODY_DYNAMIC; - break; - case b2_kinematicBody: - return BODY_KINEMATIC; - break; - default: - return BODY_INVALID; - break; - } -} - -void Body::applyLinearImpulse(float jx, float jy) -{ - body->ApplyLinearImpulse(Physics::scaleDown(b2Vec2(jx, jy)), body->GetWorldCenter()); -} - -void Body::applyLinearImpulse(float jx, float jy, float rx, float ry) -{ - body->ApplyLinearImpulse(Physics::scaleDown(b2Vec2(jx, jy)), Physics::scaleDown(b2Vec2(rx, ry))); -} - -void Body::applyAngularImpulse(float impulse) -{ - // Angular impulse is in kg*m^2/s, meaning it needs to be scaled twice - body->ApplyAngularImpulse(Physics::scaleDown(Physics::scaleDown(impulse))); -} - -void Body::applyTorque(float t) -{ - // Torque is in N*m, or kg*m^2/s^2, meaning it also needs to be scaled twice - body->ApplyTorque(Physics::scaleDown(Physics::scaleDown(t))); -} - -void Body::applyForce(float fx, float fy, float rx, float ry) -{ - body->ApplyForce(Physics::scaleDown(b2Vec2(fx, fy)), Physics::scaleDown(b2Vec2(rx, ry))); -} - -void Body::applyForce(float fx, float fy) -{ - body->ApplyForceToCenter(Physics::scaleDown(b2Vec2(fx, fy))); -} - -void Body::setX(float x) -{ - body->SetTransform(Physics::scaleDown(b2Vec2(x, getY())), getAngle()); -} - -void Body::setY(float y) -{ - body->SetTransform(Physics::scaleDown(b2Vec2(getX(), y)), getAngle()); -} - -void Body::setLinearVelocity(float x, float y) -{ - body->SetLinearVelocity(Physics::scaleDown(b2Vec2(x, y))); -} - -void Body::setAngle(float d) -{ - body->SetTransform(body->GetPosition(), d); -} - -void Body::setAngularVelocity(float r) -{ - body->SetAngularVelocity(r); -} - -void Body::setPosition(float x, float y) -{ - body->SetTransform(Physics::scaleDown(b2Vec2(x, y)), body->GetAngle()); -} - -void Body::setAngularDamping(float d) -{ - body->SetAngularDamping(d); -} - -void Body::setLinearDamping(float d) -{ - body->SetLinearDamping(d); -} - -void Body::resetMassData() -{ - body->ResetMassData(); -} - -void Body::setMassData(float x, float y, float m, float i) -{ - b2MassData massData; - massData.center = Physics::scaleDown(b2Vec2(x, y)); - massData.mass = m; - massData.I = Physics::scaleDown(Physics::scaleDown(i)); - body->SetMassData(&massData); -} - -void Body::setMass(float m) -{ - b2MassData data; - body->GetMassData(&data); - data.mass = m; - body->SetMassData(&data); -} - -void Body::setInertia(float i) -{ - b2MassData massData; - massData.center = body->GetLocalCenter(); - massData.mass = body->GetMass(); - massData.I = Physics::scaleDown(Physics::scaleDown(i)); - body->SetMassData(&massData); -} - -void Body::setGravityScale(float scale) -{ - body->SetGravityScale(scale); -} - -void Body::setType(Body::Type type) -{ - switch (type) - { - case Body::BODY_STATIC: - body->SetType(b2_staticBody); - break; - case Body::BODY_DYNAMIC: - body->SetType(b2_dynamicBody); - break; - case Body::BODY_KINEMATIC: - body->SetType(b2_kinematicBody); - break; - default: - break; - } -} - -void Body::getWorldPoint(float x, float y, float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetWorldPoint(Physics::scaleDown(b2Vec2(x, y)))); - x_o = v.x; - y_o = v.y; -} - -void Body::getWorldVector(float x, float y, float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetWorldVector(Physics::scaleDown(b2Vec2(x, y)))); - x_o = v.x; - y_o = v.y; -} - -int Body::getWorldPoints(lua_State *L) -{ - int argc = lua_gettop(L); - int vcount = (int)argc/2; - // at least one point - love::luax_assert_argc(L, 2); - - for (int i = 0; iGetWorldPoint(Physics::scaleDown(b2Vec2(x, y)))); - // And then we push the result - lua_pushnumber(L, point.x); - lua_pushnumber(L, point.y); - } - - return argc; -} - -void Body::getLocalPoint(float x, float y, float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetLocalPoint(Physics::scaleDown(b2Vec2(x, y)))); - x_o = v.x; - y_o = v.y; -} - -void Body::getLocalVector(float x, float y, float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetLocalVector(Physics::scaleDown(b2Vec2(x, y)))); - x_o = v.x; - y_o = v.y; -} - -void Body::getLinearVelocityFromWorldPoint(float x, float y, float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetLinearVelocityFromWorldPoint(Physics::scaleDown(b2Vec2(x, y)))); - x_o = v.x; - y_o = v.y; -} - -void Body::getLinearVelocityFromLocalPoint(float x, float y, float &x_o, float &y_o) -{ - b2Vec2 v = Physics::scaleUp(body->GetLinearVelocityFromLocalPoint(Physics::scaleDown(b2Vec2(x, y)))); - x_o = v.x; - y_o = v.y; -} - -bool Body::isBullet() const -{ - return body->IsBullet(); -} - -void Body::setBullet(bool bullet) -{ - return body->SetBullet(bullet); -} - -bool Body::isActive() const -{ - return body->IsActive(); -} - -bool Body::isAwake() const -{ - return body->IsAwake(); -} - -void Body::setSleepingAllowed(bool allow) -{ - body->SetSleepingAllowed(allow); -} - -bool Body::isSleepingAllowed() const -{ - return body->IsSleepingAllowed(); -} - -void Body::setActive(bool active) -{ - body->SetActive(active); -} - -void Body::setAwake(bool awake) -{ - body->SetAwake(awake); -} - -void Body::setFixedRotation(bool fixed) -{ - body->SetFixedRotation(fixed); -} - -bool Body::isFixedRotation() const -{ - return body->IsFixedRotation(); -} - -World *Body::getWorld() const -{ - return world; -} - -int Body::getFixtureList(lua_State *L) const -{ - lua_newtable(L); - b2Fixture *f = body->GetFixtureList(); - int i = 1; - do - { - if (!f) - break; - Fixture *fixture = (Fixture *)Memoizer::find(f); - if (!fixture) - throw love::Exception("A fixture has escaped Memoizer!"); - fixture->retain(); - luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)fixture); - lua_rawseti(L, -2, i); - i++; - } - while ((f = f->GetNext())); - return 1; -} - -b2Vec2 Body::getVector(lua_State *L) -{ - love::luax_assert_argc(L, 2, 2); - b2Vec2 v((float)lua_tonumber(L, 1), (float)lua_tonumber(L, 2)); - lua_pop(L, 2); - return v; -} - -int Body::pushVector(lua_State *L, const b2Vec2 &v) -{ - lua_pushnumber(L, v.x); - lua_pushnumber(L, v.y); - return 2; -} - -void Body::destroy() -{ - if (world->world->IsLocked()) - { - // Called during time step. Save reference for destruction afterwards. - this->retain(); - world->destructBodies.push_back(this); - return; - } - - world->world->DestroyBody(body); - Memoizer::remove(body); - body = NULL; - - // Box2D body destroyed. Release its reference to the love Body. - this->release(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Body.h" + +#include "common/math.h" +#include "common/Memoizer.h" + +#include "Shape.h" +#include "Fixture.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Body::Body(World *world, b2Vec2 p, Body::Type type) + : world(world) +{ + world->retain(); + b2BodyDef def; + def.position = Physics::scaleDown(p); + body = world->world->CreateBody(&def); + // Box2D body holds a reference to the love Body. + this->retain(); + this->setType(type); + Memoizer::add(body, this); +} + +Body::Body(b2Body *b) + : body(b) +{ + world = (World *)Memoizer::find(b->GetWorld()); + world->retain(); + // Box2D body holds a reference to the love Body. + this->retain(); + Memoizer::add(body, this); +} + +Body::~Body() +{ + world->release(); + body = 0; +} + +float Body::getX() +{ + return Physics::scaleUp(body->GetPosition().x); +} + +float Body::getY() +{ + return Physics::scaleUp(body->GetPosition().y); +} + +void Body::getPosition(float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetPosition()); + x_o = v.x; + y_o = v.y; +} + +void Body::getLinearVelocity(float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetLinearVelocity()); + x_o = v.x; + y_o = v.y; +} + +float Body::getAngle() +{ + return body->GetAngle(); +} + +void Body::getWorldCenter(float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetWorldCenter()); + x_o = v.x; + y_o = v.y; +} + +void Body::getLocalCenter(float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetLocalCenter()); + x_o = v.x; + y_o = v.y; +} + +float Body::getAngularVelocity() const +{ + return body->GetAngularVelocity(); +} + +float Body::getMass() const +{ + return body->GetMass(); +} + +float Body::getInertia() const +{ + return Physics::scaleUp(Physics::scaleUp(body->GetInertia())); +} + +int Body::getMassData(lua_State *L) +{ + b2MassData data; + body->GetMassData(&data); + b2Vec2 center = Physics::scaleUp(data.center); + lua_pushnumber(L, center.x); + lua_pushnumber(L, center.y); + lua_pushnumber(L, data.mass); + lua_pushnumber(L, Physics::scaleUp(Physics::scaleUp(data.I))); + return 4; +} + +float Body::getAngularDamping() const +{ + return body->GetAngularDamping(); +} + +float Body::getLinearDamping() const +{ + return body->GetLinearDamping(); +} + +float Body::getGravityScale() const +{ + return body->GetGravityScale(); +} + +Body::Type Body::getType() const +{ + switch (body->GetType()) + { + case b2_staticBody: + return BODY_STATIC; + break; + case b2_dynamicBody: + return BODY_DYNAMIC; + break; + case b2_kinematicBody: + return BODY_KINEMATIC; + break; + default: + return BODY_INVALID; + break; + } +} + +void Body::applyLinearImpulse(float jx, float jy) +{ + body->ApplyLinearImpulse(Physics::scaleDown(b2Vec2(jx, jy)), body->GetWorldCenter()); +} + +void Body::applyLinearImpulse(float jx, float jy, float rx, float ry) +{ + body->ApplyLinearImpulse(Physics::scaleDown(b2Vec2(jx, jy)), Physics::scaleDown(b2Vec2(rx, ry))); +} + +void Body::applyAngularImpulse(float impulse) +{ + // Angular impulse is in kg*m^2/s, meaning it needs to be scaled twice + body->ApplyAngularImpulse(Physics::scaleDown(Physics::scaleDown(impulse))); +} + +void Body::applyTorque(float t) +{ + // Torque is in N*m, or kg*m^2/s^2, meaning it also needs to be scaled twice + body->ApplyTorque(Physics::scaleDown(Physics::scaleDown(t))); +} + +void Body::applyForce(float fx, float fy, float rx, float ry) +{ + body->ApplyForce(Physics::scaleDown(b2Vec2(fx, fy)), Physics::scaleDown(b2Vec2(rx, ry))); +} + +void Body::applyForce(float fx, float fy) +{ + body->ApplyForceToCenter(Physics::scaleDown(b2Vec2(fx, fy))); +} + +void Body::setX(float x) +{ + body->SetTransform(Physics::scaleDown(b2Vec2(x, getY())), getAngle()); +} + +void Body::setY(float y) +{ + body->SetTransform(Physics::scaleDown(b2Vec2(getX(), y)), getAngle()); +} + +void Body::setLinearVelocity(float x, float y) +{ + body->SetLinearVelocity(Physics::scaleDown(b2Vec2(x, y))); +} + +void Body::setAngle(float d) +{ + body->SetTransform(body->GetPosition(), d); +} + +void Body::setAngularVelocity(float r) +{ + body->SetAngularVelocity(r); +} + +void Body::setPosition(float x, float y) +{ + body->SetTransform(Physics::scaleDown(b2Vec2(x, y)), body->GetAngle()); +} + +void Body::setAngularDamping(float d) +{ + body->SetAngularDamping(d); +} + +void Body::setLinearDamping(float d) +{ + body->SetLinearDamping(d); +} + +void Body::resetMassData() +{ + body->ResetMassData(); +} + +void Body::setMassData(float x, float y, float m, float i) +{ + b2MassData massData; + massData.center = Physics::scaleDown(b2Vec2(x, y)); + massData.mass = m; + massData.I = Physics::scaleDown(Physics::scaleDown(i)); + body->SetMassData(&massData); +} + +void Body::setMass(float m) +{ + b2MassData data; + body->GetMassData(&data); + data.mass = m; + body->SetMassData(&data); +} + +void Body::setInertia(float i) +{ + b2MassData massData; + massData.center = body->GetLocalCenter(); + massData.mass = body->GetMass(); + massData.I = Physics::scaleDown(Physics::scaleDown(i)); + body->SetMassData(&massData); +} + +void Body::setGravityScale(float scale) +{ + body->SetGravityScale(scale); +} + +void Body::setType(Body::Type type) +{ + switch (type) + { + case Body::BODY_STATIC: + body->SetType(b2_staticBody); + break; + case Body::BODY_DYNAMIC: + body->SetType(b2_dynamicBody); + break; + case Body::BODY_KINEMATIC: + body->SetType(b2_kinematicBody); + break; + default: + break; + } +} + +void Body::getWorldPoint(float x, float y, float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetWorldPoint(Physics::scaleDown(b2Vec2(x, y)))); + x_o = v.x; + y_o = v.y; +} + +void Body::getWorldVector(float x, float y, float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetWorldVector(Physics::scaleDown(b2Vec2(x, y)))); + x_o = v.x; + y_o = v.y; +} + +int Body::getWorldPoints(lua_State *L) +{ + int argc = lua_gettop(L); + int vcount = (int)argc/2; + // at least one point + love::luax_assert_argc(L, 2); + + for (int i = 0; iGetWorldPoint(Physics::scaleDown(b2Vec2(x, y)))); + // And then we push the result + lua_pushnumber(L, point.x); + lua_pushnumber(L, point.y); + } + + return argc; +} + +void Body::getLocalPoint(float x, float y, float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetLocalPoint(Physics::scaleDown(b2Vec2(x, y)))); + x_o = v.x; + y_o = v.y; +} + +void Body::getLocalVector(float x, float y, float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetLocalVector(Physics::scaleDown(b2Vec2(x, y)))); + x_o = v.x; + y_o = v.y; +} + +void Body::getLinearVelocityFromWorldPoint(float x, float y, float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetLinearVelocityFromWorldPoint(Physics::scaleDown(b2Vec2(x, y)))); + x_o = v.x; + y_o = v.y; +} + +void Body::getLinearVelocityFromLocalPoint(float x, float y, float &x_o, float &y_o) +{ + b2Vec2 v = Physics::scaleUp(body->GetLinearVelocityFromLocalPoint(Physics::scaleDown(b2Vec2(x, y)))); + x_o = v.x; + y_o = v.y; +} + +bool Body::isBullet() const +{ + return body->IsBullet(); +} + +void Body::setBullet(bool bullet) +{ + return body->SetBullet(bullet); +} + +bool Body::isActive() const +{ + return body->IsActive(); +} + +bool Body::isAwake() const +{ + return body->IsAwake(); +} + +void Body::setSleepingAllowed(bool allow) +{ + body->SetSleepingAllowed(allow); +} + +bool Body::isSleepingAllowed() const +{ + return body->IsSleepingAllowed(); +} + +void Body::setActive(bool active) +{ + body->SetActive(active); +} + +void Body::setAwake(bool awake) +{ + body->SetAwake(awake); +} + +void Body::setFixedRotation(bool fixed) +{ + body->SetFixedRotation(fixed); +} + +bool Body::isFixedRotation() const +{ + return body->IsFixedRotation(); +} + +World *Body::getWorld() const +{ + return world; +} + +int Body::getFixtureList(lua_State *L) const +{ + lua_newtable(L); + b2Fixture *f = body->GetFixtureList(); + int i = 1; + do + { + if (!f) + break; + Fixture *fixture = (Fixture *)Memoizer::find(f); + if (!fixture) + throw love::Exception("A fixture has escaped Memoizer!"); + fixture->retain(); + luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)fixture); + lua_rawseti(L, -2, i); + i++; + } + while ((f = f->GetNext())); + return 1; +} + +b2Vec2 Body::getVector(lua_State *L) +{ + love::luax_assert_argc(L, 2, 2); + b2Vec2 v((float)lua_tonumber(L, 1), (float)lua_tonumber(L, 2)); + lua_pop(L, 2); + return v; +} + +int Body::pushVector(lua_State *L, const b2Vec2 &v) +{ + lua_pushnumber(L, v.x); + lua_pushnumber(L, v.y); + return 2; +} + +void Body::destroy() +{ + if (world->world->IsLocked()) + { + // Called during time step. Save reference for destruction afterwards. + this->retain(); + world->destructBodies.push_back(this); + return; + } + + world->world->DestroyBody(body); + Memoizer::remove(body); + body = NULL; + + // Box2D body destroyed. Release its reference to the love Body. + this->release(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/Body.h b/src/modules/physics/box2d/Body.h index d9729a2c5..ecfe46bbc 100644 --- a/src/modules/physics/box2d/Body.h +++ b/src/modules/physics/box2d/Body.h @@ -1,415 +1,415 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_BODY_H -#define LOVE_PHYSICS_BOX2D_BODY_H - -// LOVE -#include "common/math.h" -#include "common/runtime.h" -#include "common/Object.h" -#include "physics/Body.h" - -// Box2D -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ -// Forward declarations. -class World; -class Shape; -class Fixture; - -/** - * A Body is an entity which has position and orientation - * in world space. A Body does have collision geometry - * by itself, but depend on an arbitrary number of child Shape objects - * which together constitute the final geometry for the Body. - **/ -class Body : public love::physics::Body -{ -public: - // Friends. - friend class Joint; - friend class DistanceJoint; - friend class MouseJoint; - friend class CircleShape; - friend class PolygonShape; - friend class Shape; - friend class Fixture; - - // The Box2D body. (Should not be public?) - b2Body *body; - - /** - * Create a Body at position p. - **/ - Body(World *world, b2Vec2 p, Type type); - - /** - * Create a Body from an extant b2Body. - **/ - Body(b2Body *b); - - virtual ~Body(); - - /** - * Gets the current x-position of the Body. - **/ - float getX(); - - /** - * Gets the current y-position of the Body. - **/ - float getY(); - - /** - * Gets the current angle (deg) of the Body. - **/ - float getAngle(); - - /** - * Gets the current position of the Body. - * @returns The current position. - **/ - void getPosition(float &x_o, float &y_o); - - /** - * Gets the velocity in the current center of mass. - * @returns The velocity in the current center of mass. - **/ - void getLinearVelocity(float &x_o, float &y_o); - - /** - * The current center of mass for the Body in world - * coordinates. - * @returns The x-component of the point. - * @returns The y-component of the point. - **/ - void getWorldCenter(float &x_o, float &y_o); - - /** - * The current center of mass for the Body in local - * coordinates. - * @returns The x-component of the point. - * @returns The y-component of the point. - **/ - void getLocalCenter(float &x_o, float &y_o); - - /** - * Get the current Body spin. (Angular velocity). - **/ - float getAngularVelocity() const; - - /** - * Gets the Body's mass. - **/ - float getMass() const; - - /** - * Gets the Body's intertia. - **/ - float getInertia() const; - - /** - * Gets mass properties. - **/ - int getMassData(lua_State *L); - - /** - * Gets the Body's angular damping. - **/ - float getAngularDamping() const; - - /** - * Gets the Body's linear damping. - **/ - float getLinearDamping() const; - - /** - * Gets the Body's gravity scale. - **/ - float getGravityScale() const; - - /** - * Gets the type of body this is. - **/ - Type getType() const; - - /** - * Apply an impulse (jx, jy) with offset (0, 0). - **/ - void applyLinearImpulse(float jx, float jy); - - /** - * Apply an impulse (jx, jy) with offset (rx, ry). - **/ - void applyLinearImpulse(float jx, float jy, float rx, float ry); - - /** - * Apply an angular impulse to the body. - **/ - void applyAngularImpulse(float impulse); - - /** - * Apply torque (t). - **/ - void applyTorque(float t); - - /** - * Apply force (fx, fy) with offset (0, 0). - **/ - void applyForce(float fx, float fy); - - /** - * Apply force (fx, fy) with offset (rx, ry). - **/ - void applyForce(float fx, float fy, float rx, float ry); - - /** - * Sets the x-position of the Body. - **/ - void setX(float x); - - /** - * Sets the Y-position of the Body. - **/ - void setY(float y); - - /** - * Sets the current velocity of the Body. - **/ - void setLinearVelocity(float x, float y); - - /** - * Sets the angle of the Body. - **/ - void setAngle(float d); - - /** - * Sets the current spin of the Body. - **/ - void setAngularVelocity(float r); - - /** - * Sets the current position of the Body. - **/ - void setPosition(float x, float y); - - /** - * Sets the mass from the currently attatched shapes. - **/ - void resetMassData(); - - /** - * Sets mass properties. - * @param x The x-coordinate for the local center of mass. - * @param y The y-coordinate for the local center of mass. - * @param m The mass. - * @param i The inertia. - **/ - void setMassData(float x, float y, float m, float i); - - /** - * Sets just the mass. This is provided as a LOVE bonus. Lovely! - * @param m The mass. - **/ - void setMass(float m); - - /** - * Sets the inertia while keeping the other properties - * (mass and local center). - * @param i The inertia. - **/ - void setInertia(float i); - - /** - * Sets the Body's angular damping. - **/ - void setAngularDamping(float d); - - /** - * Sets the Body's linear damping. - **/ - void setLinearDamping(float d); - - /** - * Sets the Body's gravity scale. - **/ - void setGravityScale(float scale); - - /** - * Sets the type of body this is. - **/ - void setType(Type type); - - /** - * Transforms a point (x, y) from local coordinates - * to world coordinates. - * @param x The x-coordinate of the local point. - * @param y The y-coordinate of the local point. - * @returns The x-coordinate of the point in world coordinates. - * @returns The y-coordinate of the point in world coordinates. - **/ - void getWorldPoint(float x, float y, float &x_o, float &y_o); - - /** - * Transforms a vector (x, y) from local coordinates - * to world coordinates. - * @param x The x-coordinate of the local vector. - * @param y The y-coordinate of the local vector. - * @returns The x-coordinate of the vector in world coordinates. - * @returns The y-coordinate of the vector in world coordinates. - **/ - void getWorldVector(float x, float y, float &x_o, float &y_o); - - /** - * Transforms a series of points (x, y) from local coordinates - * to world coordinates. - **/ - int getWorldPoints(lua_State *L); - - /** - * Transforms a point (x, y) from world coordinates - * to local coordinates. - * @param x The x-coordinate of the world point. - * @param y The y-coordinate of the world point. - * @returns The x-coordinate of the point in local coordinates. - * @returns The y-coordinate of the point in local coordinates. - **/ - void getLocalPoint(float x, float y, float &x_o, float &y_o); - - /** - * Transforms a vector (x, y) from world coordinates - * to local coordinates. - * @param x The x-coordinate of the world vector. - * @param y The y-coordinate of the world vector. - * @returns The x-coordinate of the vector in local coordinates. - * @returns The y-coordinate of the vector in local coordinates. - **/ - void getLocalVector(float x, float y, float &x_o, float &y_o); - - /** - * Gets the velocity on the Body for the given world point. - * @param x The x-coordinate of the world point. - * @param y The y-coordinate of the world point. - * @returns The x-component of the velocity vector. - * @returns The y-component of the velocity vector. - **/ - void getLinearVelocityFromWorldPoint(float x, float y, float &x_o, float &y_o); - - /** - * Gets the velocity on the Body for the given local point. - * @param x The x-coordinate of the local point. - * @param y The y-coordinate of the local point. - * @returns The x-component of the velocity vector. - * @returns The y-component of the velocity vector. - **/ - void getLinearVelocityFromLocalPoint(float x, float y, float &x_o, float &y_o); - - /** - * Returns true if the Body is a bullet, false otherwise. - **/ - bool isBullet() const; - - /** - * Set whether this Body should be treated as a bullet. - * Bullets require more processing power than normal shapes. - **/ - void setBullet(bool bullet); - - /** - * Checks whether a Body is active or not. An inactive body - * cannot be interacted with. - **/ - bool isActive() const; - - /** - * Checks whether a Body is awake or not. A Body - * will fall to sleep if nothing happens to it for while. - **/ - bool isAwake() const; - - /** - * Controls whether this Body should be allowed to sleep. - **/ - void setSleepingAllowed(bool allow); - bool isSleepingAllowed() const; - - /** - * Changes the body's active state. - **/ - void setActive(bool active); - - /** - * Changes the body's sleep state. - **/ - void setAwake(bool awake); - - void setFixedRotation(bool fixed); - bool isFixedRotation() const; - - /** - * Get the World this Body resides in. - */ - World *getWorld() const; - - /** - * Get an array of all the Fixtures attached to this Body. - * @return An array of Fixtures. - **/ - int getFixtureList(lua_State *L) const; - - /** - * Destroy this body. - **/ - void destroy(); - -private: - - /** - * Gets a 2d vector from the arguments on the stack. - **/ - b2Vec2 getVector(lua_State *L); - - /** - * Pushed the x- and y-components of a vector on - * the stack. - **/ - int pushVector(lua_State *L, const b2Vec2 &v); - - // We need a shared_ptr to the parent World, - // because World can not be destroyed as long as - // bodies exists in it. - // - // This ensures that a World only can be destroyed - // once all bodies have been destroyed too. - World *world; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_BODY_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_BODY_H +#define LOVE_PHYSICS_BOX2D_BODY_H + +// LOVE +#include "common/math.h" +#include "common/runtime.h" +#include "common/Object.h" +#include "physics/Body.h" + +// Box2D +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ +// Forward declarations. +class World; +class Shape; +class Fixture; + +/** + * A Body is an entity which has position and orientation + * in world space. A Body does have collision geometry + * by itself, but depend on an arbitrary number of child Shape objects + * which together constitute the final geometry for the Body. + **/ +class Body : public love::physics::Body +{ +public: + // Friends. + friend class Joint; + friend class DistanceJoint; + friend class MouseJoint; + friend class CircleShape; + friend class PolygonShape; + friend class Shape; + friend class Fixture; + + // The Box2D body. (Should not be public?) + b2Body *body; + + /** + * Create a Body at position p. + **/ + Body(World *world, b2Vec2 p, Type type); + + /** + * Create a Body from an extant b2Body. + **/ + Body(b2Body *b); + + virtual ~Body(); + + /** + * Gets the current x-position of the Body. + **/ + float getX(); + + /** + * Gets the current y-position of the Body. + **/ + float getY(); + + /** + * Gets the current angle (deg) of the Body. + **/ + float getAngle(); + + /** + * Gets the current position of the Body. + * @returns The current position. + **/ + void getPosition(float &x_o, float &y_o); + + /** + * Gets the velocity in the current center of mass. + * @returns The velocity in the current center of mass. + **/ + void getLinearVelocity(float &x_o, float &y_o); + + /** + * The current center of mass for the Body in world + * coordinates. + * @returns The x-component of the point. + * @returns The y-component of the point. + **/ + void getWorldCenter(float &x_o, float &y_o); + + /** + * The current center of mass for the Body in local + * coordinates. + * @returns The x-component of the point. + * @returns The y-component of the point. + **/ + void getLocalCenter(float &x_o, float &y_o); + + /** + * Get the current Body spin. (Angular velocity). + **/ + float getAngularVelocity() const; + + /** + * Gets the Body's mass. + **/ + float getMass() const; + + /** + * Gets the Body's intertia. + **/ + float getInertia() const; + + /** + * Gets mass properties. + **/ + int getMassData(lua_State *L); + + /** + * Gets the Body's angular damping. + **/ + float getAngularDamping() const; + + /** + * Gets the Body's linear damping. + **/ + float getLinearDamping() const; + + /** + * Gets the Body's gravity scale. + **/ + float getGravityScale() const; + + /** + * Gets the type of body this is. + **/ + Type getType() const; + + /** + * Apply an impulse (jx, jy) with offset (0, 0). + **/ + void applyLinearImpulse(float jx, float jy); + + /** + * Apply an impulse (jx, jy) with offset (rx, ry). + **/ + void applyLinearImpulse(float jx, float jy, float rx, float ry); + + /** + * Apply an angular impulse to the body. + **/ + void applyAngularImpulse(float impulse); + + /** + * Apply torque (t). + **/ + void applyTorque(float t); + + /** + * Apply force (fx, fy) with offset (0, 0). + **/ + void applyForce(float fx, float fy); + + /** + * Apply force (fx, fy) with offset (rx, ry). + **/ + void applyForce(float fx, float fy, float rx, float ry); + + /** + * Sets the x-position of the Body. + **/ + void setX(float x); + + /** + * Sets the Y-position of the Body. + **/ + void setY(float y); + + /** + * Sets the current velocity of the Body. + **/ + void setLinearVelocity(float x, float y); + + /** + * Sets the angle of the Body. + **/ + void setAngle(float d); + + /** + * Sets the current spin of the Body. + **/ + void setAngularVelocity(float r); + + /** + * Sets the current position of the Body. + **/ + void setPosition(float x, float y); + + /** + * Sets the mass from the currently attatched shapes. + **/ + void resetMassData(); + + /** + * Sets mass properties. + * @param x The x-coordinate for the local center of mass. + * @param y The y-coordinate for the local center of mass. + * @param m The mass. + * @param i The inertia. + **/ + void setMassData(float x, float y, float m, float i); + + /** + * Sets just the mass. This is provided as a LOVE bonus. Lovely! + * @param m The mass. + **/ + void setMass(float m); + + /** + * Sets the inertia while keeping the other properties + * (mass and local center). + * @param i The inertia. + **/ + void setInertia(float i); + + /** + * Sets the Body's angular damping. + **/ + void setAngularDamping(float d); + + /** + * Sets the Body's linear damping. + **/ + void setLinearDamping(float d); + + /** + * Sets the Body's gravity scale. + **/ + void setGravityScale(float scale); + + /** + * Sets the type of body this is. + **/ + void setType(Type type); + + /** + * Transforms a point (x, y) from local coordinates + * to world coordinates. + * @param x The x-coordinate of the local point. + * @param y The y-coordinate of the local point. + * @returns The x-coordinate of the point in world coordinates. + * @returns The y-coordinate of the point in world coordinates. + **/ + void getWorldPoint(float x, float y, float &x_o, float &y_o); + + /** + * Transforms a vector (x, y) from local coordinates + * to world coordinates. + * @param x The x-coordinate of the local vector. + * @param y The y-coordinate of the local vector. + * @returns The x-coordinate of the vector in world coordinates. + * @returns The y-coordinate of the vector in world coordinates. + **/ + void getWorldVector(float x, float y, float &x_o, float &y_o); + + /** + * Transforms a series of points (x, y) from local coordinates + * to world coordinates. + **/ + int getWorldPoints(lua_State *L); + + /** + * Transforms a point (x, y) from world coordinates + * to local coordinates. + * @param x The x-coordinate of the world point. + * @param y The y-coordinate of the world point. + * @returns The x-coordinate of the point in local coordinates. + * @returns The y-coordinate of the point in local coordinates. + **/ + void getLocalPoint(float x, float y, float &x_o, float &y_o); + + /** + * Transforms a vector (x, y) from world coordinates + * to local coordinates. + * @param x The x-coordinate of the world vector. + * @param y The y-coordinate of the world vector. + * @returns The x-coordinate of the vector in local coordinates. + * @returns The y-coordinate of the vector in local coordinates. + **/ + void getLocalVector(float x, float y, float &x_o, float &y_o); + + /** + * Gets the velocity on the Body for the given world point. + * @param x The x-coordinate of the world point. + * @param y The y-coordinate of the world point. + * @returns The x-component of the velocity vector. + * @returns The y-component of the velocity vector. + **/ + void getLinearVelocityFromWorldPoint(float x, float y, float &x_o, float &y_o); + + /** + * Gets the velocity on the Body for the given local point. + * @param x The x-coordinate of the local point. + * @param y The y-coordinate of the local point. + * @returns The x-component of the velocity vector. + * @returns The y-component of the velocity vector. + **/ + void getLinearVelocityFromLocalPoint(float x, float y, float &x_o, float &y_o); + + /** + * Returns true if the Body is a bullet, false otherwise. + **/ + bool isBullet() const; + + /** + * Set whether this Body should be treated as a bullet. + * Bullets require more processing power than normal shapes. + **/ + void setBullet(bool bullet); + + /** + * Checks whether a Body is active or not. An inactive body + * cannot be interacted with. + **/ + bool isActive() const; + + /** + * Checks whether a Body is awake or not. A Body + * will fall to sleep if nothing happens to it for while. + **/ + bool isAwake() const; + + /** + * Controls whether this Body should be allowed to sleep. + **/ + void setSleepingAllowed(bool allow); + bool isSleepingAllowed() const; + + /** + * Changes the body's active state. + **/ + void setActive(bool active); + + /** + * Changes the body's sleep state. + **/ + void setAwake(bool awake); + + void setFixedRotation(bool fixed); + bool isFixedRotation() const; + + /** + * Get the World this Body resides in. + */ + World *getWorld() const; + + /** + * Get an array of all the Fixtures attached to this Body. + * @return An array of Fixtures. + **/ + int getFixtureList(lua_State *L) const; + + /** + * Destroy this body. + **/ + void destroy(); + +private: + + /** + * Gets a 2d vector from the arguments on the stack. + **/ + b2Vec2 getVector(lua_State *L); + + /** + * Pushed the x- and y-components of a vector on + * the stack. + **/ + int pushVector(lua_State *L, const b2Vec2 &v); + + // We need a shared_ptr to the parent World, + // because World can not be destroyed as long as + // bodies exists in it. + // + // This ensures that a World only can be destroyed + // once all bodies have been destroyed too. + World *world; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_BODY_H diff --git a/src/modules/physics/box2d/ChainShape.cpp b/src/modules/physics/box2d/ChainShape.cpp index 94b57176a..c4059d9e4 100644 --- a/src/modules/physics/box2d/ChainShape.cpp +++ b/src/modules/physics/box2d/ChainShape.cpp @@ -1,114 +1,114 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "ChainShape.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -#include "common/Memoizer.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -ChainShape::ChainShape(b2ChainShape *c, bool loop, bool own) - : Shape(c, own), loop(loop) -{ -} - -ChainShape::~ChainShape() -{ -} - -void ChainShape::setNextVertex(float x, float y) -{ - if (loop) - { - throw love::Exception("Physics error: Can't call setNextVertex on a loop ChainShape"); - return; - } - b2Vec2 v(x, y); - b2ChainShape *c = (b2ChainShape *)shape; - c->SetNextVertex(Physics::scaleDown(v)); -} - -void ChainShape::setPrevVertex(float x, float y) -{ - if (loop) - { - throw love::Exception("Physics error: Can't call setPrevVertex on a loop ChainShape"); - return; - } - b2Vec2 v(x, y); - b2ChainShape *c = (b2ChainShape *)shape; - c->SetNextVertex(Physics::scaleDown(v)); -} - -EdgeShape *ChainShape::getChildEdge(int index) const -{ - b2ChainShape *c = (b2ChainShape *)shape; - b2EdgeShape e; - c->GetChildEdge(&e, index); - EdgeShape *edge = (EdgeShape *)Memoizer::find(&e); - if (!edge) - return new EdgeShape(&e); - else - { - edge->retain(); - return edge; - } -} - -int ChainShape::getChildCount() const -{ - b2ChainShape *c = (b2ChainShape *)shape; - return c->GetChildCount(); -} - -int ChainShape::getVertexCount() const -{ - b2ChainShape *c = (b2ChainShape *)shape; - return c->m_count; -} - -b2Vec2 ChainShape::getPoint(int index) const -{ - b2ChainShape *c = (b2ChainShape *)shape; - if (index < 0 || index >= c->m_count) - throw love::Exception("Physics error: index out of bounds"); - const b2Vec2 &v = c->m_vertices[index]; - return Physics::scaleUp(v); -} - -const b2Vec2 *ChainShape::getPoints() const -{ - b2ChainShape *c = (b2ChainShape *)shape; - return c->m_vertices; -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "ChainShape.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +#include "common/Memoizer.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +ChainShape::ChainShape(b2ChainShape *c, bool loop, bool own) + : Shape(c, own), loop(loop) +{ +} + +ChainShape::~ChainShape() +{ +} + +void ChainShape::setNextVertex(float x, float y) +{ + if (loop) + { + throw love::Exception("Physics error: Can't call setNextVertex on a loop ChainShape"); + return; + } + b2Vec2 v(x, y); + b2ChainShape *c = (b2ChainShape *)shape; + c->SetNextVertex(Physics::scaleDown(v)); +} + +void ChainShape::setPrevVertex(float x, float y) +{ + if (loop) + { + throw love::Exception("Physics error: Can't call setPrevVertex on a loop ChainShape"); + return; + } + b2Vec2 v(x, y); + b2ChainShape *c = (b2ChainShape *)shape; + c->SetNextVertex(Physics::scaleDown(v)); +} + +EdgeShape *ChainShape::getChildEdge(int index) const +{ + b2ChainShape *c = (b2ChainShape *)shape; + b2EdgeShape e; + c->GetChildEdge(&e, index); + EdgeShape *edge = (EdgeShape *)Memoizer::find(&e); + if (!edge) + return new EdgeShape(&e); + else + { + edge->retain(); + return edge; + } +} + +int ChainShape::getChildCount() const +{ + b2ChainShape *c = (b2ChainShape *)shape; + return c->GetChildCount(); +} + +int ChainShape::getVertexCount() const +{ + b2ChainShape *c = (b2ChainShape *)shape; + return c->m_count; +} + +b2Vec2 ChainShape::getPoint(int index) const +{ + b2ChainShape *c = (b2ChainShape *)shape; + if (index < 0 || index >= c->m_count) + throw love::Exception("Physics error: index out of bounds"); + const b2Vec2 &v = c->m_vertices[index]; + return Physics::scaleUp(v); +} + +const b2Vec2 *ChainShape::getPoints() const +{ + b2ChainShape *c = (b2ChainShape *)shape; + return c->m_vertices; +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/ChainShape.h b/src/modules/physics/box2d/ChainShape.h index fa3a229d8..7c2564c69 100644 --- a/src/modules/physics/box2d/ChainShape.h +++ b/src/modules/physics/box2d/ChainShape.h @@ -1,106 +1,106 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_CHAIN_SHAPE_H -#define LOVE_PHYSICS_BOX2D_CHAIN_SHAPE_H - -// Module -#include "Shape.h" -#include "EdgeShape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * A ChainShape is a freeform collection of line segments. - **/ -class ChainShape : public Shape -{ -public: - - /** - * Create a new ChainShape from a Box2D chain shape. - * @param c The chain shape. - **/ - ChainShape(b2ChainShape *c, bool loop = false, bool own = true); - - virtual ~ChainShape(); - - /** - * Establish connectivity to a vertex that follows - * the last vertex. Fails if called on a loop. - * @param x The x-coordinate of the vertex. - * @param y The y-coordinate of the vertex. - **/ - void setNextVertex(float x, float y); - - /** - * Establish connectivity to a vertex that precedes - * the first vertex. Fails if called on a loop. - * @param x The x-coordinate of the vertex. - * @param y The y-coordinate of the vertex. - **/ - void setPrevVertex(float x, float y); - - /** - * Gets the number of children shapes. - **/ - int getChildCount() const; - - /** - * Returns a child EdgeShape. - * @param index The index of the child shape. - * @returns The specified child. - **/ - EdgeShape *getChildEdge(int index) const; - - /** - * Returns the number of vertices in the shape. - * @returns The number of vertices in the shape. - **/ - int getVertexCount() const; - - /** - * Returns the vertex at the given index. - * @param index The index of the vertex. - * @returns The specified vertex. - **/ - b2Vec2 getPoint(int index) const; - - /** - * Returns all of the vertices. - * @returns The vertices the shape comprises. - **/ - const b2Vec2 *getPoints() const; - -private: - // True if this ChainShape is a loop. - bool loop; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_CHAIN_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_CHAIN_SHAPE_H +#define LOVE_PHYSICS_BOX2D_CHAIN_SHAPE_H + +// Module +#include "Shape.h" +#include "EdgeShape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * A ChainShape is a freeform collection of line segments. + **/ +class ChainShape : public Shape +{ +public: + + /** + * Create a new ChainShape from a Box2D chain shape. + * @param c The chain shape. + **/ + ChainShape(b2ChainShape *c, bool loop = false, bool own = true); + + virtual ~ChainShape(); + + /** + * Establish connectivity to a vertex that follows + * the last vertex. Fails if called on a loop. + * @param x The x-coordinate of the vertex. + * @param y The y-coordinate of the vertex. + **/ + void setNextVertex(float x, float y); + + /** + * Establish connectivity to a vertex that precedes + * the first vertex. Fails if called on a loop. + * @param x The x-coordinate of the vertex. + * @param y The y-coordinate of the vertex. + **/ + void setPrevVertex(float x, float y); + + /** + * Gets the number of children shapes. + **/ + int getChildCount() const; + + /** + * Returns a child EdgeShape. + * @param index The index of the child shape. + * @returns The specified child. + **/ + EdgeShape *getChildEdge(int index) const; + + /** + * Returns the number of vertices in the shape. + * @returns The number of vertices in the shape. + **/ + int getVertexCount() const; + + /** + * Returns the vertex at the given index. + * @param index The index of the vertex. + * @returns The specified vertex. + **/ + b2Vec2 getPoint(int index) const; + + /** + * Returns all of the vertices. + * @returns The vertices the shape comprises. + **/ + const b2Vec2 *getPoints() const; + +private: + // True if this ChainShape is a loop. + bool loop; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_CHAIN_SHAPE_H diff --git a/src/modules/physics/box2d/CircleShape.cpp b/src/modules/physics/box2d/CircleShape.cpp index a99b1e4f5..8449e876f 100644 --- a/src/modules/physics/box2d/CircleShape.cpp +++ b/src/modules/physics/box2d/CircleShape.cpp @@ -1,58 +1,58 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "CircleShape.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -#include "common/Memoizer.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -CircleShape::CircleShape(b2CircleShape *c, bool own) - : Shape(c, own) -{ -} - -CircleShape::~CircleShape() -{ -} - -float CircleShape::getRadius() const -{ - return Physics::scaleUp(shape->m_radius); -} - -void CircleShape::setRadius(float r) -{ - shape->m_radius = Physics::scaleDown(r); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "CircleShape.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +#include "common/Memoizer.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +CircleShape::CircleShape(b2CircleShape *c, bool own) + : Shape(c, own) +{ +} + +CircleShape::~CircleShape() +{ +} + +float CircleShape::getRadius() const +{ + return Physics::scaleUp(shape->m_radius); +} + +void CircleShape::setRadius(float r) +{ + shape->m_radius = Physics::scaleDown(r); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/CircleShape.h b/src/modules/physics/box2d/CircleShape.h index 89f4daa6a..1e6ff3ac4 100644 --- a/src/modules/physics/box2d/CircleShape.h +++ b/src/modules/physics/box2d/CircleShape.h @@ -1,72 +1,72 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_CIRCLE_SHAPE_H -#define LOVE_PHYSICS_BOX2D_CIRCLE_SHAPE_H - -// Module -#include "Shape.h" - -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * A CircleShape represent a Circle which can - * be used for collision detection and physics. - * - * The CircleShape is much faster than the PolygonShape, - * and should generally be used where possible. - **/ -class CircleShape : public Shape -{ -public: - - /** - * Create a new CircleShape from the parent body and a - * Box2D CircleShape definition. - * @param body The parent body. - * @param def The CircleShape definition. - **/ - CircleShape(b2CircleShape *c, bool own = true); - - virtual ~CircleShape(); - - /** - * Gets the radius for the circle. - **/ - float getRadius() const; - - /** - * Sets the radius for the circle. - **/ - void setRadius(float r); -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_CIRCLE_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_CIRCLE_SHAPE_H +#define LOVE_PHYSICS_BOX2D_CIRCLE_SHAPE_H + +// Module +#include "Shape.h" + +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * A CircleShape represent a Circle which can + * be used for collision detection and physics. + * + * The CircleShape is much faster than the PolygonShape, + * and should generally be used where possible. + **/ +class CircleShape : public Shape +{ +public: + + /** + * Create a new CircleShape from the parent body and a + * Box2D CircleShape definition. + * @param body The parent body. + * @param def The CircleShape definition. + **/ + CircleShape(b2CircleShape *c, bool own = true); + + virtual ~CircleShape(); + + /** + * Gets the radius for the circle. + **/ + float getRadius() const; + + /** + * Sets the radius for the circle. + **/ + void setRadius(float r); +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_CIRCLE_SHAPE_H diff --git a/src/modules/physics/box2d/Contact.cpp b/src/modules/physics/box2d/Contact.cpp index 14aceef5a..6d1162bfa 100644 --- a/src/modules/physics/box2d/Contact.cpp +++ b/src/modules/physics/box2d/Contact.cpp @@ -1,117 +1,117 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Contact.h" -#include "World.h" -#include "Physics.h" - -#include "common/Memoizer.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Contact::Contact(b2Contact *contact) - : contact(contact) -{ - Memoizer::add(contact, this); -} - -Contact::~Contact() -{ - Memoizer::remove(contact); -} - -int Contact::getPositions(lua_State *L) -{ - love::luax_assert_argc(L, 1, 1); - b2WorldManifold manifold; - contact->GetWorldManifold(&manifold); - int points = contact->GetManifold()->pointCount; - for (int i = 0; i < points; i++) - { - b2Vec2 position = Physics::scaleUp(manifold.points[i]); - lua_pushnumber(L, position.x); - lua_pushnumber(L, position.y); - } - return points*2; -} - -int Contact::getNormal(lua_State *L) -{ - love::luax_assert_argc(L, 1, 1); - b2WorldManifold manifold; - contact->GetWorldManifold(&manifold); - lua_pushnumber(L, manifold.normal.x); - lua_pushnumber(L, manifold.normal.y); - return 2; -} - -float Contact::getFriction() const -{ - return contact->GetFriction(); -} - -float Contact::getRestitution() const -{ - return contact->GetRestitution(); -} - -bool Contact::isEnabled() const -{ - return contact->IsEnabled(); -} - -bool Contact::isTouching() const -{ - return contact->IsTouching(); -} - -void Contact::setFriction(float friction) -{ - contact->SetFriction(friction); -} - -void Contact::setRestitution(float restitution) -{ - contact->SetRestitution(restitution); -} - -void Contact::setEnabled(bool enabled) -{ - contact->SetEnabled(enabled); -} - -void Contact::resetFriction() -{ - contact->ResetFriction(); -} - -void Contact::resetRestitution() -{ - contact->ResetRestitution(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Contact.h" +#include "World.h" +#include "Physics.h" + +#include "common/Memoizer.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Contact::Contact(b2Contact *contact) + : contact(contact) +{ + Memoizer::add(contact, this); +} + +Contact::~Contact() +{ + Memoizer::remove(contact); +} + +int Contact::getPositions(lua_State *L) +{ + love::luax_assert_argc(L, 1, 1); + b2WorldManifold manifold; + contact->GetWorldManifold(&manifold); + int points = contact->GetManifold()->pointCount; + for (int i = 0; i < points; i++) + { + b2Vec2 position = Physics::scaleUp(manifold.points[i]); + lua_pushnumber(L, position.x); + lua_pushnumber(L, position.y); + } + return points*2; +} + +int Contact::getNormal(lua_State *L) +{ + love::luax_assert_argc(L, 1, 1); + b2WorldManifold manifold; + contact->GetWorldManifold(&manifold); + lua_pushnumber(L, manifold.normal.x); + lua_pushnumber(L, manifold.normal.y); + return 2; +} + +float Contact::getFriction() const +{ + return contact->GetFriction(); +} + +float Contact::getRestitution() const +{ + return contact->GetRestitution(); +} + +bool Contact::isEnabled() const +{ + return contact->IsEnabled(); +} + +bool Contact::isTouching() const +{ + return contact->IsTouching(); +} + +void Contact::setFriction(float friction) +{ + contact->SetFriction(friction); +} + +void Contact::setRestitution(float restitution) +{ + contact->SetRestitution(restitution); +} + +void Contact::setEnabled(bool enabled) +{ + contact->SetEnabled(enabled); +} + +void Contact::resetFriction() +{ + contact->ResetFriction(); +} + +void Contact::resetRestitution() +{ + contact->ResetRestitution(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/Contact.h b/src/modules/physics/box2d/Contact.h index 016ed8910..6bf5184a4 100644 --- a/src/modules/physics/box2d/Contact.h +++ b/src/modules/physics/box2d/Contact.h @@ -1,137 +1,137 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_CONTACT_H -#define LOVE_PHYSICS_BOX2D_CONTACT_H - -// LOVE -#include "common/Object.h" -#include "common/runtime.h" -#include "World.h" - -// Box2D -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -class World; - -/** - * A Contact represents a collision point between - * two shapes. - **/ -class Contact : public Object -{ -public: - // Friends. - friend class World; - friend class World::ContactCallback; - - /** - * Creates a new Contact by copying a Box2D contact - * point. It does not store the pointer, but copy the - * data pointed to. - * @param point Pointer to the Box2D contact. - **/ - Contact(b2Contact *contact); - - virtual ~Contact(); - - /** - * Gets the position of each point of contact. - * @return The position along the x-axis. - * @return The position along the y-axis. - **/ - int getPositions(lua_State *L); - - /** - * Gets the collision normal. - * @return The x-component of the normal. - * @return The y-component of the normal. - **/ - int getNormal(lua_State *L); - - /** - * The mixed friction between the two fixtures at - * the point of impact. - **/ - float getFriction() const; - - /** - * The mixed restitution of the two fixtures - * at the point of impact. - **/ - float getRestitution() const; - - /** - * Check if the contact is enabled. - **/ - bool isEnabled() const; - - /** - * Check if the contact is touching. - **/ - bool isTouching() const; - - // Only call the setters in PreSolve - - /** - * Override the default friction mixture. - **/ - void setFriction(float friction); - - /** - * Override the default restitution mixture. - **/ - void setRestitution(float restitution); - - /** - * Enable/disable this contact. - **/ - void setEnabled(bool enabled); - - /** - * Reset the friction mixture to the default - * value. - **/ - void resetFriction(); - - /** - * Reset the restitution mixture to the default - * value. - **/ - void resetRestitution(); - -private: - - // The Box2D contact. - b2Contact *contact; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_CONTACT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_CONTACT_H +#define LOVE_PHYSICS_BOX2D_CONTACT_H + +// LOVE +#include "common/Object.h" +#include "common/runtime.h" +#include "World.h" + +// Box2D +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +class World; + +/** + * A Contact represents a collision point between + * two shapes. + **/ +class Contact : public Object +{ +public: + // Friends. + friend class World; + friend class World::ContactCallback; + + /** + * Creates a new Contact by copying a Box2D contact + * point. It does not store the pointer, but copy the + * data pointed to. + * @param point Pointer to the Box2D contact. + **/ + Contact(b2Contact *contact); + + virtual ~Contact(); + + /** + * Gets the position of each point of contact. + * @return The position along the x-axis. + * @return The position along the y-axis. + **/ + int getPositions(lua_State *L); + + /** + * Gets the collision normal. + * @return The x-component of the normal. + * @return The y-component of the normal. + **/ + int getNormal(lua_State *L); + + /** + * The mixed friction between the two fixtures at + * the point of impact. + **/ + float getFriction() const; + + /** + * The mixed restitution of the two fixtures + * at the point of impact. + **/ + float getRestitution() const; + + /** + * Check if the contact is enabled. + **/ + bool isEnabled() const; + + /** + * Check if the contact is touching. + **/ + bool isTouching() const; + + // Only call the setters in PreSolve + + /** + * Override the default friction mixture. + **/ + void setFriction(float friction); + + /** + * Override the default restitution mixture. + **/ + void setRestitution(float restitution); + + /** + * Enable/disable this contact. + **/ + void setEnabled(bool enabled); + + /** + * Reset the friction mixture to the default + * value. + **/ + void resetFriction(); + + /** + * Reset the restitution mixture to the default + * value. + **/ + void resetRestitution(); + +private: + + // The Box2D contact. + b2Contact *contact; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_CONTACT_H diff --git a/src/modules/physics/box2d/DistanceJoint.cpp b/src/modules/physics/box2d/DistanceJoint.cpp index 60c9f2c2e..be8fae1c8 100644 --- a/src/modules/physics/box2d/DistanceJoint.cpp +++ b/src/modules/physics/box2d/DistanceJoint.cpp @@ -1,82 +1,82 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "DistanceJoint.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -DistanceJoint::DistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected) - : Joint(body1, body2) - , joint(NULL) -{ - b2DistanceJointDef def; - def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(x1,y1)), Physics::scaleDown(b2Vec2(x2,y2))); - def.collideConnected = collideConnected; - joint = (b2DistanceJoint *)createJoint(&def); -} - -DistanceJoint::~DistanceJoint() -{ -} - -void DistanceJoint::setLength(float length) -{ - joint->SetLength(Physics::scaleDown(length)); -} - -float DistanceJoint::getLength() const -{ - return Physics::scaleUp(joint->GetLength()); -} - -void DistanceJoint::setFrequency(float hz) -{ - joint->SetFrequency(hz); -} - -float DistanceJoint::getFrequency() const -{ - return joint->GetFrequency(); -} - -void DistanceJoint::setDampingRatio(float d) -{ - joint->SetDampingRatio(d); -} - -float DistanceJoint::getDampingRatio() const -{ - return joint->GetDampingRatio(); -} - - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "DistanceJoint.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +DistanceJoint::DistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected) + : Joint(body1, body2) + , joint(NULL) +{ + b2DistanceJointDef def; + def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(x1,y1)), Physics::scaleDown(b2Vec2(x2,y2))); + def.collideConnected = collideConnected; + joint = (b2DistanceJoint *)createJoint(&def); +} + +DistanceJoint::~DistanceJoint() +{ +} + +void DistanceJoint::setLength(float length) +{ + joint->SetLength(Physics::scaleDown(length)); +} + +float DistanceJoint::getLength() const +{ + return Physics::scaleUp(joint->GetLength()); +} + +void DistanceJoint::setFrequency(float hz) +{ + joint->SetFrequency(hz); +} + +float DistanceJoint::getFrequency() const +{ + return joint->GetFrequency(); +} + +void DistanceJoint::setDampingRatio(float d) +{ + joint->SetDampingRatio(d); +} + +float DistanceJoint::getDampingRatio() const +{ + return joint->GetDampingRatio(); +} + + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/DistanceJoint.h b/src/modules/physics/box2d/DistanceJoint.h index 5e4bd5b08..7a9eef144 100644 --- a/src/modules/physics/box2d/DistanceJoint.h +++ b/src/modules/physics/box2d/DistanceJoint.h @@ -1,90 +1,90 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_DISTANCE_JOINT_H -#define LOVE_PHYSICS_BOX2D_DISTANCE_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * The DistanceJoint keeps Bodies at a fixed distance - * from eachother. - **/ -class DistanceJoint : public Joint -{ -public: - - /** - * Creates a DistanceJoint connecting body1 to body2. - **/ - DistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected); - - virtual ~DistanceJoint(); - - /** - * Sets the equilibrium distance between the two bodies. - **/ - void setLength(float length); - - /** - * Gets the equilibrium distance between the two bodies. - **/ - float getLength() const; - - /** - * Sets the response speed. - **/ - void setFrequency(float hz); - - /** - * Gets the response speed. - **/ - float getFrequency() const; - - /** - * Sets the damping ratio. - * 0 = no damping, 1 = critical damping. - **/ - void setDampingRatio(float d); - - /** - * Gets the damping ratio. - * 0 = no damping, 1 = critical damping. - **/ - float getDampingRatio() const; - -private: - // The Box2D DistanceJoint object. - b2DistanceJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_DISTANCE_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_DISTANCE_JOINT_H +#define LOVE_PHYSICS_BOX2D_DISTANCE_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * The DistanceJoint keeps Bodies at a fixed distance + * from eachother. + **/ +class DistanceJoint : public Joint +{ +public: + + /** + * Creates a DistanceJoint connecting body1 to body2. + **/ + DistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected); + + virtual ~DistanceJoint(); + + /** + * Sets the equilibrium distance between the two bodies. + **/ + void setLength(float length); + + /** + * Gets the equilibrium distance between the two bodies. + **/ + float getLength() const; + + /** + * Sets the response speed. + **/ + void setFrequency(float hz); + + /** + * Gets the response speed. + **/ + float getFrequency() const; + + /** + * Sets the damping ratio. + * 0 = no damping, 1 = critical damping. + **/ + void setDampingRatio(float d); + + /** + * Gets the damping ratio. + * 0 = no damping, 1 = critical damping. + **/ + float getDampingRatio() const; + +private: + // The Box2D DistanceJoint object. + b2DistanceJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_DISTANCE_JOINT_H diff --git a/src/modules/physics/box2d/EdgeShape.cpp b/src/modules/physics/box2d/EdgeShape.cpp index 8b77828e7..d4fb4fa8a 100644 --- a/src/modules/physics/box2d/EdgeShape.cpp +++ b/src/modules/physics/box2d/EdgeShape.cpp @@ -1,61 +1,61 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "EdgeShape.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -#include "common/Memoizer.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -EdgeShape::EdgeShape(b2EdgeShape *e, bool own) - : Shape(e, own) -{ -} - -EdgeShape::~EdgeShape() -{ -} - -int EdgeShape::getPoints(lua_State *L) -{ - b2EdgeShape *e = (b2EdgeShape *)shape; - b2Vec2 v1 = Physics::scaleUp(e->m_vertex1); - b2Vec2 v2 = Physics::scaleUp(e->m_vertex2); - lua_pushnumber(L, v1.x); - lua_pushnumber(L, v1.y); - lua_pushnumber(L, v2.x); - lua_pushnumber(L, v2.y); - return 4; - -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "EdgeShape.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +#include "common/Memoizer.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +EdgeShape::EdgeShape(b2EdgeShape *e, bool own) + : Shape(e, own) +{ +} + +EdgeShape::~EdgeShape() +{ +} + +int EdgeShape::getPoints(lua_State *L) +{ + b2EdgeShape *e = (b2EdgeShape *)shape; + b2Vec2 v1 = Physics::scaleUp(e->m_vertex1); + b2Vec2 v2 = Physics::scaleUp(e->m_vertex2); + lua_pushnumber(L, v1.x); + lua_pushnumber(L, v1.y); + lua_pushnumber(L, v2.x); + lua_pushnumber(L, v2.y); + return 4; + +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/EdgeShape.h b/src/modules/physics/box2d/EdgeShape.h index 76be3a655..6f9f57ce4 100644 --- a/src/modules/physics/box2d/EdgeShape.h +++ b/src/modules/physics/box2d/EdgeShape.h @@ -1,63 +1,63 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_EDGE_SHAPE_H -#define LOVE_PHYSICS_BOX2D_EDGE_SHAPE_H - -// Module -#include "Shape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * An Edge is just a line segment. Edges are designed to - * be connected and/or chained together. - **/ -class EdgeShape : public Shape -{ -public: - - /** - * Create a new EdgeShape from a Box2D edge shape. - * @param e The edge shape. - **/ - EdgeShape(b2EdgeShape *e, bool own = true); - - virtual ~EdgeShape(); - - /** - * Returns the transformed points of the edge shape. - * This function is useful for debug drawing and such. - * - * The result can be directly passed into love.graphics.line(). - **/ - int getPoints(lua_State *L); -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_EDGE_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_EDGE_SHAPE_H +#define LOVE_PHYSICS_BOX2D_EDGE_SHAPE_H + +// Module +#include "Shape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * An Edge is just a line segment. Edges are designed to + * be connected and/or chained together. + **/ +class EdgeShape : public Shape +{ +public: + + /** + * Create a new EdgeShape from a Box2D edge shape. + * @param e The edge shape. + **/ + EdgeShape(b2EdgeShape *e, bool own = true); + + virtual ~EdgeShape(); + + /** + * Returns the transformed points of the edge shape. + * This function is useful for debug drawing and such. + * + * The result can be directly passed into love.graphics.line(). + **/ + int getPoints(lua_State *L); +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_EDGE_SHAPE_H diff --git a/src/modules/physics/box2d/Fixture.cpp b/src/modules/physics/box2d/Fixture.cpp index 8c78e60ab..d804d0323 100644 --- a/src/modules/physics/box2d/Fixture.cpp +++ b/src/modules/physics/box2d/Fixture.cpp @@ -1,325 +1,325 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Fixture.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -#include "common/Memoizer.h" - -// STD -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Fixture::Fixture(Body *body, Shape *shape, float density) - : body(body) - , fixture(NULL) -{ - data = new fixtureudata(); - data->ref = 0; - b2FixtureDef def; - def.shape = shape->shape; - def.userData = (void *)data; - def.density = density; - fixture = body->body->CreateFixture(&def); - this->retain(); - Memoizer::add(fixture, this); -} - -Fixture::Fixture(b2Fixture *f) - : fixture(f) -{ - data = (fixtureudata *)f->GetUserData(); - body = (Body *)Memoizer::find(f->GetBody()); - if (!body) - body = new Body(f->GetBody()); - this->retain(); - Memoizer::add(fixture, this); -} - -Fixture::~Fixture() -{ - if (data->ref != 0) - delete data->ref; - - delete data; - data = NULL; - - fixture = NULL; -} - -Shape::Type Fixture::getType() const -{ - return Shape(fixture->GetShape()).getType(); -} - -void Fixture::setFriction(float friction) -{ - fixture->SetFriction(friction); -} - -void Fixture::setRestitution(float restitution) -{ - fixture->SetRestitution(restitution); -} - -void Fixture::setDensity(float density) -{ - fixture->SetDensity(density); -} - -void Fixture::setSensor(bool sensor) -{ - fixture->SetSensor(sensor); -} - -float Fixture::getFriction() const -{ - return fixture->GetFriction(); -} - -float Fixture::getRestitution() const -{ - return fixture->GetRestitution(); -} - -float Fixture::getDensity() const -{ - return fixture->GetDensity(); -} - -bool Fixture::isSensor() const -{ - return fixture->IsSensor(); -} - -Body *Fixture::getBody() const -{ - return body; -} - -Shape *Fixture::getShape() const -{ - if (!fixture->GetShape()) - return NULL; - - return new Shape(fixture->GetShape(), false); -} - -bool Fixture::isValid() const -{ - return fixture != 0; -} - -void Fixture::setFilterData(int *v) -{ - b2Filter f; - f.categoryBits = (unsigned short)v[0]; - f.maskBits = (unsigned short)v[1]; - f.groupIndex = v[2]; - fixture->SetFilterData(f); -} - -void Fixture::getFilterData(int *v) -{ - b2Filter f = fixture->GetFilterData(); - v[0] = (int)f.categoryBits; - v[1] = (int)f.maskBits; - v[2] = f.groupIndex; -} - -int Fixture::setCategory(lua_State *L) -{ - b2Filter f = fixture->GetFilterData(); - f.categoryBits = (uint16)getBits(L); - fixture->SetFilterData(f); - return 0; -} - -int Fixture::setMask(lua_State *L) -{ - b2Filter f = fixture->GetFilterData(); - f.maskBits = ~(uint16)getBits(L); - fixture->SetFilterData(f); - return 0; -} - -void Fixture::setGroupIndex(int index) -{ - b2Filter f = fixture->GetFilterData(); - f.groupIndex = (uint16)index; - fixture->SetFilterData(f); -} - -int Fixture::getGroupIndex() const -{ - b2Filter f = fixture->GetFilterData(); - return f.groupIndex; -} - -int Fixture::getCategory(lua_State *L) -{ - return pushBits(L, fixture->GetFilterData().categoryBits); -} - -int Fixture::getMask(lua_State *L) -{ - return pushBits(L, ~(fixture->GetFilterData().maskBits)); -} - -uint16 Fixture::getBits(lua_State *L) -{ - // Get number of args. - int argc = lua_gettop(L); - - // The new bitset. - std::bitset<16> b; - - for (int i = 1; i<=argc; i++) - { - size_t bpos = (size_t)(lua_tointeger(L, i)-1); - if (bpos >= 16) - return luaL_error(L, "Values must be in range 1-16."); - b.set(bpos, true); - } - - return (uint16)b.to_ulong(); -} - -int Fixture::pushBits(lua_State *L, uint16 bits) -{ - // Create a bitset. - std::bitset<16> b((int)bits); - - // Push all set bits. - for (int i = 0; i<16; i++) - if (b.test(i)) - lua_pushinteger(L, i+1); - - // Count number of set bits. - return (int)b.count(); -} - -int Fixture::setUserData(lua_State *L) -{ - love::luax_assert_argc(L, 1, 1); - - if (data->ref != 0) - { - delete data->ref; - data->ref = 0; - } - - data->ref = new Reference(L); - return 0; -} - -int Fixture::getUserData(lua_State *L) -{ - love::luax_assert_argc(L, 0, 0); - if (data->ref != 0) - data->ref->push(); - else - lua_pushnil(L); - - return 1; -} - -bool Fixture::testPoint(float x, float y) const -{ - return fixture->TestPoint(Physics::scaleDown(b2Vec2(x, y))); -} - -int Fixture::rayCast(lua_State *L) const -{ - float p1x = Physics::scaleDown((float)luaL_checknumber(L, 1)); - float p1y = Physics::scaleDown((float)luaL_checknumber(L, 2)); - float p2x = Physics::scaleDown((float)luaL_checknumber(L, 3)); - float p2y = Physics::scaleDown((float)luaL_checknumber(L, 4)); - float maxFraction = (float)luaL_checknumber(L, 5); - int childIndex = (int)luaL_optint(L, 6, 1) - 1; // Convert from 1-based index - b2RayCastInput input; - input.p1.Set(p1x, p1y); - input.p2.Set(p2x, p2y); - input.maxFraction = maxFraction; - b2RayCastOutput output; - if (!fixture->RayCast(&output, input, childIndex)) - return 0; // Nothing hit. - lua_pushnumber(L, output.normal.x); - lua_pushnumber(L, output.normal.y); - lua_pushnumber(L, output.fraction); - return 3; -} - -int Fixture::getBoundingBox(lua_State *L) const -{ - int childIndex = (int)luaL_optint(L, 1, 1) - 1; // Convert from 1-based index - b2AABB box = fixture->GetAABB(childIndex); - box = Physics::scaleUp(box); - lua_pushnumber(L, box.lowerBound.x); - lua_pushnumber(L, box.lowerBound.y); - lua_pushnumber(L, box.upperBound.x); - lua_pushnumber(L, box.upperBound.y); - return 4; -} - -int Fixture::getMassData(lua_State *L) const -{ - b2MassData data; - fixture->GetMassData(&data); - b2Vec2 center = Physics::scaleUp(data.center); - lua_pushnumber(L, center.x); - lua_pushnumber(L, center.y); - lua_pushnumber(L, data.mass); - lua_pushnumber(L, data.I); - return 4; -} - -void Fixture::destroy(bool implicit) -{ - if (body->world->world->IsLocked()) - { - // Called during time step. Save reference for destruction afterwards. - this->retain(); - body->world->destructFixtures.push_back(this); - return; - } - - if (!implicit && fixture != 0) - body->body->DestroyFixture(fixture); - Memoizer::remove(fixture); - fixture = NULL; - - // Box2D fixture destroyed. Release its reference to the love Fixture. - this->release(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Fixture.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +#include "common/Memoizer.h" + +// STD +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Fixture::Fixture(Body *body, Shape *shape, float density) + : body(body) + , fixture(NULL) +{ + data = new fixtureudata(); + data->ref = 0; + b2FixtureDef def; + def.shape = shape->shape; + def.userData = (void *)data; + def.density = density; + fixture = body->body->CreateFixture(&def); + this->retain(); + Memoizer::add(fixture, this); +} + +Fixture::Fixture(b2Fixture *f) + : fixture(f) +{ + data = (fixtureudata *)f->GetUserData(); + body = (Body *)Memoizer::find(f->GetBody()); + if (!body) + body = new Body(f->GetBody()); + this->retain(); + Memoizer::add(fixture, this); +} + +Fixture::~Fixture() +{ + if (data->ref != 0) + delete data->ref; + + delete data; + data = NULL; + + fixture = NULL; +} + +Shape::Type Fixture::getType() const +{ + return Shape(fixture->GetShape()).getType(); +} + +void Fixture::setFriction(float friction) +{ + fixture->SetFriction(friction); +} + +void Fixture::setRestitution(float restitution) +{ + fixture->SetRestitution(restitution); +} + +void Fixture::setDensity(float density) +{ + fixture->SetDensity(density); +} + +void Fixture::setSensor(bool sensor) +{ + fixture->SetSensor(sensor); +} + +float Fixture::getFriction() const +{ + return fixture->GetFriction(); +} + +float Fixture::getRestitution() const +{ + return fixture->GetRestitution(); +} + +float Fixture::getDensity() const +{ + return fixture->GetDensity(); +} + +bool Fixture::isSensor() const +{ + return fixture->IsSensor(); +} + +Body *Fixture::getBody() const +{ + return body; +} + +Shape *Fixture::getShape() const +{ + if (!fixture->GetShape()) + return NULL; + + return new Shape(fixture->GetShape(), false); +} + +bool Fixture::isValid() const +{ + return fixture != 0; +} + +void Fixture::setFilterData(int *v) +{ + b2Filter f; + f.categoryBits = (unsigned short)v[0]; + f.maskBits = (unsigned short)v[1]; + f.groupIndex = v[2]; + fixture->SetFilterData(f); +} + +void Fixture::getFilterData(int *v) +{ + b2Filter f = fixture->GetFilterData(); + v[0] = (int)f.categoryBits; + v[1] = (int)f.maskBits; + v[2] = f.groupIndex; +} + +int Fixture::setCategory(lua_State *L) +{ + b2Filter f = fixture->GetFilterData(); + f.categoryBits = (uint16)getBits(L); + fixture->SetFilterData(f); + return 0; +} + +int Fixture::setMask(lua_State *L) +{ + b2Filter f = fixture->GetFilterData(); + f.maskBits = ~(uint16)getBits(L); + fixture->SetFilterData(f); + return 0; +} + +void Fixture::setGroupIndex(int index) +{ + b2Filter f = fixture->GetFilterData(); + f.groupIndex = (uint16)index; + fixture->SetFilterData(f); +} + +int Fixture::getGroupIndex() const +{ + b2Filter f = fixture->GetFilterData(); + return f.groupIndex; +} + +int Fixture::getCategory(lua_State *L) +{ + return pushBits(L, fixture->GetFilterData().categoryBits); +} + +int Fixture::getMask(lua_State *L) +{ + return pushBits(L, ~(fixture->GetFilterData().maskBits)); +} + +uint16 Fixture::getBits(lua_State *L) +{ + // Get number of args. + int argc = lua_gettop(L); + + // The new bitset. + std::bitset<16> b; + + for (int i = 1; i<=argc; i++) + { + size_t bpos = (size_t)(lua_tointeger(L, i)-1); + if (bpos >= 16) + return luaL_error(L, "Values must be in range 1-16."); + b.set(bpos, true); + } + + return (uint16)b.to_ulong(); +} + +int Fixture::pushBits(lua_State *L, uint16 bits) +{ + // Create a bitset. + std::bitset<16> b((int)bits); + + // Push all set bits. + for (int i = 0; i<16; i++) + if (b.test(i)) + lua_pushinteger(L, i+1); + + // Count number of set bits. + return (int)b.count(); +} + +int Fixture::setUserData(lua_State *L) +{ + love::luax_assert_argc(L, 1, 1); + + if (data->ref != 0) + { + delete data->ref; + data->ref = 0; + } + + data->ref = new Reference(L); + return 0; +} + +int Fixture::getUserData(lua_State *L) +{ + love::luax_assert_argc(L, 0, 0); + if (data->ref != 0) + data->ref->push(); + else + lua_pushnil(L); + + return 1; +} + +bool Fixture::testPoint(float x, float y) const +{ + return fixture->TestPoint(Physics::scaleDown(b2Vec2(x, y))); +} + +int Fixture::rayCast(lua_State *L) const +{ + float p1x = Physics::scaleDown((float)luaL_checknumber(L, 1)); + float p1y = Physics::scaleDown((float)luaL_checknumber(L, 2)); + float p2x = Physics::scaleDown((float)luaL_checknumber(L, 3)); + float p2y = Physics::scaleDown((float)luaL_checknumber(L, 4)); + float maxFraction = (float)luaL_checknumber(L, 5); + int childIndex = (int)luaL_optint(L, 6, 1) - 1; // Convert from 1-based index + b2RayCastInput input; + input.p1.Set(p1x, p1y); + input.p2.Set(p2x, p2y); + input.maxFraction = maxFraction; + b2RayCastOutput output; + if (!fixture->RayCast(&output, input, childIndex)) + return 0; // Nothing hit. + lua_pushnumber(L, output.normal.x); + lua_pushnumber(L, output.normal.y); + lua_pushnumber(L, output.fraction); + return 3; +} + +int Fixture::getBoundingBox(lua_State *L) const +{ + int childIndex = (int)luaL_optint(L, 1, 1) - 1; // Convert from 1-based index + b2AABB box = fixture->GetAABB(childIndex); + box = Physics::scaleUp(box); + lua_pushnumber(L, box.lowerBound.x); + lua_pushnumber(L, box.lowerBound.y); + lua_pushnumber(L, box.upperBound.x); + lua_pushnumber(L, box.upperBound.y); + return 4; +} + +int Fixture::getMassData(lua_State *L) const +{ + b2MassData data; + fixture->GetMassData(&data); + b2Vec2 center = Physics::scaleUp(data.center); + lua_pushnumber(L, center.x); + lua_pushnumber(L, center.y); + lua_pushnumber(L, data.mass); + lua_pushnumber(L, data.I); + return 4; +} + +void Fixture::destroy(bool implicit) +{ + if (body->world->world->IsLocked()) + { + // Called during time step. Save reference for destruction afterwards. + this->retain(); + body->world->destructFixtures.push_back(this); + return; + } + + if (!implicit && fixture != 0) + body->body->DestroyFixture(fixture); + Memoizer::remove(fixture); + fixture = NULL; + + // Box2D fixture destroyed. Release its reference to the love Fixture. + this->release(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/Fixture.h b/src/modules/physics/box2d/Fixture.h index 4f087842f..a6fe13f42 100644 --- a/src/modules/physics/box2d/Fixture.h +++ b/src/modules/physics/box2d/Fixture.h @@ -1,225 +1,225 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_FIXTURE_H -#define LOVE_PHYSICS_BOX2D_FIXTURE_H - -// LOVE -#include "physics/Shape.h" -#include "physics/box2d/Body.h" -#include "physics/box2d/Shape.h" -#include "common/Object.h" -#include "common/Reference.h" - -// Box2D -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * This struct is stored in a void pointer - * in the Box2D Fixture class. For now, all we - * need is a Lua reference to arbitrary data, - * but we might need more later. - **/ -struct fixtureudata -{ - // Reference to arbitrary data. - Reference *ref; -}; - -/** - * A Fixture is used to attach a shape to a body for collision detection. - * A Fixture inherits its transform from its parent. Fixtures hold - * additional non-geometric data such as friction, collision filters, - * etc. - **/ -class Fixture : public Object -{ -public: - friend class Physics; - - /** - * Creates a Fixture. - **/ - Fixture(Body *body, Shape *shape, float density); - - /** - * Creates a Fixture. - **/ - Fixture(b2Fixture *f); - - virtual ~Fixture(); - - /** - * Gets the type of the Fixture's Shape. Useful for - * debug drawing. - **/ - Shape::Type getType() const; - - /** - * Gets the Shape attached to this Fixture. - **/ - Shape *getShape() const; - - /** - * Returns true if the fixture is active in a Box2D world. - **/ - bool isValid() const; - - /** - * Checks whether this Fixture acts as a sensor. - * @return True if sensor, false otherwise. - **/ - bool isSensor() const; - - /** - * Set whether this Fixture should be a sensor or not. - * @param sensor True if sensor, false if not. - **/ - void setSensor(bool sensor); - - /** - * Gets the Body this Fixture is attached to. - **/ - Body *getBody() const; - - /** - * Sets the filter data. An integer array is used even though the - * first two elements are unsigned shorts. The elements are: - * category (16-bits), mask (16-bits) and group (32-bits/int). - **/ - void setFilterData(int *v); - - /** - * Gets the filter data. An integer array is used even though the - * first two elements are unsigned shorts. The elements are: - * category (16-bits), mask (16-bits) and group (32-bits/int). - **/ - void getFilterData(int *v); - - /** - * This function stores an in-C reference to - * arbitrary Lua data in the Box2D Fixture object. - * - * The data set here will be passed to the collision - * handler when collisions occur. - **/ - int setUserData(lua_State *L); - - /** - * Gets the data set with setData. If no - * data is set, nil is returned. - **/ - int getUserData(lua_State *L); - - /** - * Sets the friction of the Fixture. - * @param friction The new friction. - **/ - void setFriction(float friction); - - /** - * Sets the restitution for the Fixture. - * @param restitution The restitution. - **/ - void setRestitution(float restitution); - - /** - * Sets the density of the Fixture. - * @param density The density of the Fixture. - **/ - void setDensity(float density); - - /** - * Gets the friction of the Fixture. - * @returns The friction. - **/ - float getFriction() const; - - /** - * Gets the restitution of the Fixture. - * @return The restitution of the Fixture. - **/ - float getRestitution() const; - - /** - * Gets the density of the Fixture. - * @return The density. - **/ - float getDensity() const; - - /** - * Checks if a point is inside the Fixture. - * @param x The x-component of the point. - * @param y The y-component of the point. - **/ - bool testPoint(float x, float y) const; - - /** - * Cast a ray against this Fixture. - **/ - int rayCast(lua_State *L) const; - - void setGroupIndex(int index); - int getGroupIndex() const; - - int setCategory(lua_State *L); - int setMask(lua_State *L); - int getCategory(lua_State *L); - int getMask(lua_State *L); - uint16 getBits(lua_State *L); - int pushBits(lua_State *L, uint16 bits); - - /** - * Gets the bounding box for this Fixture. - * The function returns eight values which can be - * passed directly to love.graphics.polygon. - **/ - int getBoundingBox(lua_State *L) const; - - /** - * Gets the mass data for this Fixture. - * This operation may be expensive. - **/ - int getMassData(lua_State *L) const; - - /** - * Destroys this fixture. - **/ - void destroy(bool implicit = false); - -protected: - - Body *body; - fixtureudata *data; - b2Fixture *fixture; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_FIXTURE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_FIXTURE_H +#define LOVE_PHYSICS_BOX2D_FIXTURE_H + +// LOVE +#include "physics/Shape.h" +#include "physics/box2d/Body.h" +#include "physics/box2d/Shape.h" +#include "common/Object.h" +#include "common/Reference.h" + +// Box2D +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * This struct is stored in a void pointer + * in the Box2D Fixture class. For now, all we + * need is a Lua reference to arbitrary data, + * but we might need more later. + **/ +struct fixtureudata +{ + // Reference to arbitrary data. + Reference *ref; +}; + +/** + * A Fixture is used to attach a shape to a body for collision detection. + * A Fixture inherits its transform from its parent. Fixtures hold + * additional non-geometric data such as friction, collision filters, + * etc. + **/ +class Fixture : public Object +{ +public: + friend class Physics; + + /** + * Creates a Fixture. + **/ + Fixture(Body *body, Shape *shape, float density); + + /** + * Creates a Fixture. + **/ + Fixture(b2Fixture *f); + + virtual ~Fixture(); + + /** + * Gets the type of the Fixture's Shape. Useful for + * debug drawing. + **/ + Shape::Type getType() const; + + /** + * Gets the Shape attached to this Fixture. + **/ + Shape *getShape() const; + + /** + * Returns true if the fixture is active in a Box2D world. + **/ + bool isValid() const; + + /** + * Checks whether this Fixture acts as a sensor. + * @return True if sensor, false otherwise. + **/ + bool isSensor() const; + + /** + * Set whether this Fixture should be a sensor or not. + * @param sensor True if sensor, false if not. + **/ + void setSensor(bool sensor); + + /** + * Gets the Body this Fixture is attached to. + **/ + Body *getBody() const; + + /** + * Sets the filter data. An integer array is used even though the + * first two elements are unsigned shorts. The elements are: + * category (16-bits), mask (16-bits) and group (32-bits/int). + **/ + void setFilterData(int *v); + + /** + * Gets the filter data. An integer array is used even though the + * first two elements are unsigned shorts. The elements are: + * category (16-bits), mask (16-bits) and group (32-bits/int). + **/ + void getFilterData(int *v); + + /** + * This function stores an in-C reference to + * arbitrary Lua data in the Box2D Fixture object. + * + * The data set here will be passed to the collision + * handler when collisions occur. + **/ + int setUserData(lua_State *L); + + /** + * Gets the data set with setData. If no + * data is set, nil is returned. + **/ + int getUserData(lua_State *L); + + /** + * Sets the friction of the Fixture. + * @param friction The new friction. + **/ + void setFriction(float friction); + + /** + * Sets the restitution for the Fixture. + * @param restitution The restitution. + **/ + void setRestitution(float restitution); + + /** + * Sets the density of the Fixture. + * @param density The density of the Fixture. + **/ + void setDensity(float density); + + /** + * Gets the friction of the Fixture. + * @returns The friction. + **/ + float getFriction() const; + + /** + * Gets the restitution of the Fixture. + * @return The restitution of the Fixture. + **/ + float getRestitution() const; + + /** + * Gets the density of the Fixture. + * @return The density. + **/ + float getDensity() const; + + /** + * Checks if a point is inside the Fixture. + * @param x The x-component of the point. + * @param y The y-component of the point. + **/ + bool testPoint(float x, float y) const; + + /** + * Cast a ray against this Fixture. + **/ + int rayCast(lua_State *L) const; + + void setGroupIndex(int index); + int getGroupIndex() const; + + int setCategory(lua_State *L); + int setMask(lua_State *L); + int getCategory(lua_State *L); + int getMask(lua_State *L); + uint16 getBits(lua_State *L); + int pushBits(lua_State *L, uint16 bits); + + /** + * Gets the bounding box for this Fixture. + * The function returns eight values which can be + * passed directly to love.graphics.polygon. + **/ + int getBoundingBox(lua_State *L) const; + + /** + * Gets the mass data for this Fixture. + * This operation may be expensive. + **/ + int getMassData(lua_State *L) const; + + /** + * Destroys this fixture. + **/ + void destroy(bool implicit = false); + +protected: + + Body *body; + fixtureudata *data; + b2Fixture *fixture; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_FIXTURE_H diff --git a/src/modules/physics/box2d/FrictionJoint.cpp b/src/modules/physics/box2d/FrictionJoint.cpp index 8271367f0..31b3ace92 100644 --- a/src/modules/physics/box2d/FrictionJoint.cpp +++ b/src/modules/physics/box2d/FrictionJoint.cpp @@ -1,75 +1,75 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "FrictionJoint.h" - -#include "common/math.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -FrictionJoint::FrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected) - : Joint(body1, body2) - , joint(NULL) -{ - b2FrictionJointDef def; - def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA))); - def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB))); - def.collideConnected = collideConnected; - joint = (b2FrictionJoint *)createJoint(&def); -} - -FrictionJoint::~FrictionJoint() -{ -} - -void FrictionJoint::setMaxForce(float force) -{ - joint->SetMaxForce(Physics::scaleDown(force)); -} - -float FrictionJoint::getMaxForce() const -{ - return Physics::scaleUp(joint->GetMaxForce()); -} - -void FrictionJoint::setMaxTorque(float torque) -{ - joint->SetMaxTorque(Physics::scaleDown(Physics::scaleDown(torque))); -} - -float FrictionJoint::getMaxTorque() const -{ - return Physics::scaleUp(Physics::scaleUp(joint->GetMaxTorque())); -} - - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "FrictionJoint.h" + +#include "common/math.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +FrictionJoint::FrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected) + : Joint(body1, body2) + , joint(NULL) +{ + b2FrictionJointDef def; + def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA))); + def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB))); + def.collideConnected = collideConnected; + joint = (b2FrictionJoint *)createJoint(&def); +} + +FrictionJoint::~FrictionJoint() +{ +} + +void FrictionJoint::setMaxForce(float force) +{ + joint->SetMaxForce(Physics::scaleDown(force)); +} + +float FrictionJoint::getMaxForce() const +{ + return Physics::scaleUp(joint->GetMaxForce()); +} + +void FrictionJoint::setMaxTorque(float torque) +{ + joint->SetMaxTorque(Physics::scaleDown(Physics::scaleDown(torque))); +} + +float FrictionJoint::getMaxTorque() const +{ + return Physics::scaleUp(Physics::scaleUp(joint->GetMaxTorque())); +} + + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/FrictionJoint.h b/src/modules/physics/box2d/FrictionJoint.h index a0b809c0b..dd1b7c630 100644 --- a/src/modules/physics/box2d/FrictionJoint.h +++ b/src/modules/physics/box2d/FrictionJoint.h @@ -1,78 +1,78 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_FRICTION_JOINT_H -#define LOVE_PHYSICS_BOX2D_FRICTION_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * A FrictionJoint applies friction to a body. - **/ -class FrictionJoint : public Joint -{ -public: - - /** - * Creates a new FrictionJoint connecting body1 and body2. - **/ - FrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected); - - virtual ~FrictionJoint(); - - /** - * Sets the maximum friction force in Newtons. - **/ - void setMaxForce(float force); - - /** - * Gets the maximum friction force in Newtons. - **/ - float getMaxForce() const; - - /** - * Sets the maximum friction torque in Newton-meters. - **/ - void setMaxTorque(float torque); - - /** - * Gets the maximum friction torque in Newton-meters. - **/ - float getMaxTorque() const; - -private: - - // The Box2D friction joint object. - b2FrictionJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_FRICTION_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_FRICTION_JOINT_H +#define LOVE_PHYSICS_BOX2D_FRICTION_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * A FrictionJoint applies friction to a body. + **/ +class FrictionJoint : public Joint +{ +public: + + /** + * Creates a new FrictionJoint connecting body1 and body2. + **/ + FrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected); + + virtual ~FrictionJoint(); + + /** + * Sets the maximum friction force in Newtons. + **/ + void setMaxForce(float force); + + /** + * Gets the maximum friction force in Newtons. + **/ + float getMaxForce() const; + + /** + * Sets the maximum friction torque in Newton-meters. + **/ + void setMaxTorque(float torque); + + /** + * Gets the maximum friction torque in Newton-meters. + **/ + float getMaxTorque() const; + +private: + + // The Box2D friction joint object. + b2FrictionJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_FRICTION_JOINT_H diff --git a/src/modules/physics/box2d/GearJoint.cpp b/src/modules/physics/box2d/GearJoint.cpp index bec011582..202ce7c91 100644 --- a/src/modules/physics/box2d/GearJoint.cpp +++ b/src/modules/physics/box2d/GearJoint.cpp @@ -1,65 +1,65 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "GearJoint.h" - -// Module -#include "Body.h" -#include "World.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -GearJoint::GearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected) - : Joint(joint1->body2, joint2->body2) - , joint(NULL) -{ - b2GearJointDef def; - def.joint1 = joint1->joint; - def.joint2 = joint2->joint; - def.bodyA = joint1->body2->body; - def.bodyB = joint2->body2->body; - def.ratio = ratio; - def.collideConnected = collideConnected; - - joint = (b2GearJoint *)createJoint(&def); -} - -GearJoint::~GearJoint() -{ -} - -void GearJoint::setRatio(float ratio) -{ - joint->SetRatio(ratio); -} - -float GearJoint::getRatio() const -{ - return joint->GetRatio(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "GearJoint.h" + +// Module +#include "Body.h" +#include "World.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +GearJoint::GearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected) + : Joint(joint1->body2, joint2->body2) + , joint(NULL) +{ + b2GearJointDef def; + def.joint1 = joint1->joint; + def.joint2 = joint2->joint; + def.bodyA = joint1->body2->body; + def.bodyB = joint2->body2->body; + def.ratio = ratio; + def.collideConnected = collideConnected; + + joint = (b2GearJoint *)createJoint(&def); +} + +GearJoint::~GearJoint() +{ +} + +void GearJoint::setRatio(float ratio) +{ + joint->SetRatio(ratio); +} + +float GearJoint::getRatio() const +{ + return joint->GetRatio(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/GearJoint.h b/src/modules/physics/box2d/GearJoint.h index cf7eaf864..342322a52 100644 --- a/src/modules/physics/box2d/GearJoint.h +++ b/src/modules/physics/box2d/GearJoint.h @@ -1,76 +1,76 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_GEAR_JOINT_H -#define LOVE_PHYSICS_BOX2D_GEAR_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * A gear joint is used to connect two joints together. Either joint - * can be a revolute or prismatic joint. You specify a gear ratio - * to bind the motions together: - * coordinate1 + ratio * coordinate2 = constant - * - * The ratio can be negative or positive. If one joint is a revolute joint - * and the other joint is a prismatic joint, then the ratio will have units - * of length or units of 1/length. - * Warning: The revolute and prismatic joints must be attached to - * fixed bodies (which must be body1 on those joints). - **/ -class GearJoint : public Joint -{ -public: - - /** - * Creates a GearJoint connecting joint1 to joint2. - **/ - GearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected); - - virtual ~GearJoint(); - - /** - * Sets the ratio. - **/ - void setRatio(float ratio); - - /** - * Gets the ratio. - **/ - float getRatio() const; - -private: - // The Box2D GearJoint object. - b2GearJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_GEAR_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_GEAR_JOINT_H +#define LOVE_PHYSICS_BOX2D_GEAR_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * A gear joint is used to connect two joints together. Either joint + * can be a revolute or prismatic joint. You specify a gear ratio + * to bind the motions together: + * coordinate1 + ratio * coordinate2 = constant + * + * The ratio can be negative or positive. If one joint is a revolute joint + * and the other joint is a prismatic joint, then the ratio will have units + * of length or units of 1/length. + * Warning: The revolute and prismatic joints must be attached to + * fixed bodies (which must be body1 on those joints). + **/ +class GearJoint : public Joint +{ +public: + + /** + * Creates a GearJoint connecting joint1 to joint2. + **/ + GearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected); + + virtual ~GearJoint(); + + /** + * Sets the ratio. + **/ + void setRatio(float ratio); + + /** + * Gets the ratio. + **/ + float getRatio() const; + +private: + // The Box2D GearJoint object. + b2GearJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_GEAR_JOINT_H diff --git a/src/modules/physics/box2d/Joint.cpp b/src/modules/physics/box2d/Joint.cpp index a54014408..d45d89bff 100644 --- a/src/modules/physics/box2d/Joint.cpp +++ b/src/modules/physics/box2d/Joint.cpp @@ -1,156 +1,156 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Joint.h" - -// STD -#include - -// LOVE -#include "common/Memoizer.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Joint::Joint(Body *body1) - : body1(body1) - , body2(0) - , world(body1->world) -{ -} - -Joint::Joint(Body *body1, Body *body2) - : body1(body1) - , body2(body2) - , world(body1->world) -{ -} - -Joint::~Joint() -{ -} - -Joint::Type Joint::getType() const -{ - switch (joint->GetType()) - { - case e_revoluteJoint: - return JOINT_REVOLUTE; - case e_prismaticJoint: - return JOINT_PRISMATIC; - case e_distanceJoint: - return JOINT_DISTANCE; - case e_pulleyJoint: - return JOINT_PULLEY; - case e_mouseJoint: - return JOINT_MOUSE; - case e_gearJoint: - return JOINT_GEAR; - case e_frictionJoint: - return JOINT_FRICTION; - case e_weldJoint: - return JOINT_WELD; - case e_wheelJoint: - return JOINT_WHEEL; - case e_ropeJoint: - return JOINT_ROPE; - default: - return JOINT_INVALID; - } -} - -bool Joint::isValid() const -{ - return joint != 0; -} - -int Joint::getAnchors(lua_State *L) -{ - lua_pushnumber(L, Physics::scaleUp(joint->GetAnchorA().x)); - lua_pushnumber(L, Physics::scaleUp(joint->GetAnchorA().y)); - lua_pushnumber(L, Physics::scaleUp(joint->GetAnchorB().x)); - lua_pushnumber(L, Physics::scaleUp(joint->GetAnchorB().y)); - return 4; -} - -int Joint::getReactionForce(lua_State *L) -{ - float dt = (float)luaL_checknumber(L, 1); - b2Vec2 v = Physics::scaleUp(joint->GetReactionForce(dt)); - lua_pushnumber(L, v.x); - lua_pushnumber(L, v.y); - return 2; -} - -float Joint::getReactionTorque(float dt) -{ - return Physics::scaleUp(Physics::scaleUp(joint->GetReactionTorque(dt))); -} - -b2Joint *Joint::createJoint(b2JointDef *def) -{ - joint = world->world->CreateJoint(def); - Memoizer::add(joint, this); - // Box2D joint has a reference to this love Joint. - this->retain(); - return joint; -} - -void Joint::destroyJoint(bool implicit) -{ - if (world->world->IsLocked()) - { - // Called during time step. Save reference for destruction afterwards. - this->retain(); - world->destructJoints.push_back(this); - return; - } - - if (!implicit && joint != 0) - world->world->DestroyJoint(joint); - Memoizer::remove(joint); - joint = NULL; - // Release the reference of the Box2D joint. - this->release(); -} - -bool Joint::isActive() const -{ - return joint->IsActive(); -} - -bool Joint::getCollideConnected() const -{ - return joint->GetCollideConnected(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Joint.h" + +// STD +#include + +// LOVE +#include "common/Memoizer.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Joint::Joint(Body *body1) + : body1(body1) + , body2(0) + , world(body1->world) +{ +} + +Joint::Joint(Body *body1, Body *body2) + : body1(body1) + , body2(body2) + , world(body1->world) +{ +} + +Joint::~Joint() +{ +} + +Joint::Type Joint::getType() const +{ + switch (joint->GetType()) + { + case e_revoluteJoint: + return JOINT_REVOLUTE; + case e_prismaticJoint: + return JOINT_PRISMATIC; + case e_distanceJoint: + return JOINT_DISTANCE; + case e_pulleyJoint: + return JOINT_PULLEY; + case e_mouseJoint: + return JOINT_MOUSE; + case e_gearJoint: + return JOINT_GEAR; + case e_frictionJoint: + return JOINT_FRICTION; + case e_weldJoint: + return JOINT_WELD; + case e_wheelJoint: + return JOINT_WHEEL; + case e_ropeJoint: + return JOINT_ROPE; + default: + return JOINT_INVALID; + } +} + +bool Joint::isValid() const +{ + return joint != 0; +} + +int Joint::getAnchors(lua_State *L) +{ + lua_pushnumber(L, Physics::scaleUp(joint->GetAnchorA().x)); + lua_pushnumber(L, Physics::scaleUp(joint->GetAnchorA().y)); + lua_pushnumber(L, Physics::scaleUp(joint->GetAnchorB().x)); + lua_pushnumber(L, Physics::scaleUp(joint->GetAnchorB().y)); + return 4; +} + +int Joint::getReactionForce(lua_State *L) +{ + float dt = (float)luaL_checknumber(L, 1); + b2Vec2 v = Physics::scaleUp(joint->GetReactionForce(dt)); + lua_pushnumber(L, v.x); + lua_pushnumber(L, v.y); + return 2; +} + +float Joint::getReactionTorque(float dt) +{ + return Physics::scaleUp(Physics::scaleUp(joint->GetReactionTorque(dt))); +} + +b2Joint *Joint::createJoint(b2JointDef *def) +{ + joint = world->world->CreateJoint(def); + Memoizer::add(joint, this); + // Box2D joint has a reference to this love Joint. + this->retain(); + return joint; +} + +void Joint::destroyJoint(bool implicit) +{ + if (world->world->IsLocked()) + { + // Called during time step. Save reference for destruction afterwards. + this->retain(); + world->destructJoints.push_back(this); + return; + } + + if (!implicit && joint != 0) + world->world->DestroyJoint(joint); + Memoizer::remove(joint); + joint = NULL; + // Release the reference of the Box2D joint. + this->release(); +} + +bool Joint::isActive() const +{ + return joint->IsActive(); +} + +bool Joint::getCollideConnected() const +{ + return joint->GetCollideConnected(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/Joint.h b/src/modules/physics/box2d/Joint.h index 75d2c19f0..804acde4c 100644 --- a/src/modules/physics/box2d/Joint.h +++ b/src/modules/physics/box2d/Joint.h @@ -1,137 +1,137 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_JOINT_H -#define LOVE_PHYSICS_BOX2D_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "physics/Joint.h" - -// Box2D -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -// Forward declarations. -class Body; -class World; - -/** - * A Joint acts as positioning constraints on Bodies. - * A Joint can be used to prevent Bodies from going to - * far apart, or coming too close together. - **/ -class Joint : public love::physics::Joint -{ -public: - friend class GearJoint; - - /** - * This constructor will connect one end of the joint to body1, - * and the other one to the default ground body. - * - * This constructor is mainly used by MouseJoint. - **/ - Joint(Body *body1); - - /** - * Create a joint between body1 and body2. - **/ - Joint(Body *body1, Body *body2); - - virtual ~Joint(); - - /** - * Returns true if the joint is active in a Box2D world. - **/ - bool isValid() const; - - - /** - * Gets the type of joint. - **/ - Type getType() const; - - /** - * Gets the anchor positions of the Joint in world - * coordinates. This is useful for debugdrawing the joint. - **/ - int getAnchors(lua_State *L); - - /** - * Gets the reaction force on body2 at the joint anchor. - **/ - int getReactionForce(lua_State *L); - - /** - * Gets the reaction torque on body2. - **/ - float getReactionTorque(float dt); - - bool isActive() const; - - bool getCollideConnected() const; - - /** - * Joints require pointers to a Box2D joint objects at - * different polymorphic levels, which is why these function - * were created. - **/ - - /** - * Destroys the joint. This function was created just to - * get some cinsistency. - **/ - void destroyJoint(bool implicit = false); - -protected: - - /** - * Creates a Joint, and ensures that the parent class - * gets a copy of the pointer. - **/ - b2Joint *createJoint(b2JointDef *def); - - World *world; - -private: - - // A Joint must be destroyed *before* the bodies it acts upon, - // and the world they reside in. We therefore need refs - // parents and associations to prevent wrong destruction order. - Body *body1, * body2; - - - // The Box2D joint object. - b2Joint *joint; - -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_JOINT_H +#define LOVE_PHYSICS_BOX2D_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "physics/Joint.h" + +// Box2D +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +// Forward declarations. +class Body; +class World; + +/** + * A Joint acts as positioning constraints on Bodies. + * A Joint can be used to prevent Bodies from going to + * far apart, or coming too close together. + **/ +class Joint : public love::physics::Joint +{ +public: + friend class GearJoint; + + /** + * This constructor will connect one end of the joint to body1, + * and the other one to the default ground body. + * + * This constructor is mainly used by MouseJoint. + **/ + Joint(Body *body1); + + /** + * Create a joint between body1 and body2. + **/ + Joint(Body *body1, Body *body2); + + virtual ~Joint(); + + /** + * Returns true if the joint is active in a Box2D world. + **/ + bool isValid() const; + + + /** + * Gets the type of joint. + **/ + Type getType() const; + + /** + * Gets the anchor positions of the Joint in world + * coordinates. This is useful for debugdrawing the joint. + **/ + int getAnchors(lua_State *L); + + /** + * Gets the reaction force on body2 at the joint anchor. + **/ + int getReactionForce(lua_State *L); + + /** + * Gets the reaction torque on body2. + **/ + float getReactionTorque(float dt); + + bool isActive() const; + + bool getCollideConnected() const; + + /** + * Joints require pointers to a Box2D joint objects at + * different polymorphic levels, which is why these function + * were created. + **/ + + /** + * Destroys the joint. This function was created just to + * get some cinsistency. + **/ + void destroyJoint(bool implicit = false); + +protected: + + /** + * Creates a Joint, and ensures that the parent class + * gets a copy of the pointer. + **/ + b2Joint *createJoint(b2JointDef *def); + + World *world; + +private: + + // A Joint must be destroyed *before* the bodies it acts upon, + // and the world they reside in. We therefore need refs + // parents and associations to prevent wrong destruction order. + Body *body1, * body2; + + + // The Box2D joint object. + b2Joint *joint; + +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_JOINT_H diff --git a/src/modules/physics/box2d/MouseJoint.cpp b/src/modules/physics/box2d/MouseJoint.cpp index 4c26a7c70..719d7ba90 100644 --- a/src/modules/physics/box2d/MouseJoint.cpp +++ b/src/modules/physics/box2d/MouseJoint.cpp @@ -1,96 +1,96 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "MouseJoint.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -MouseJoint::MouseJoint(Body *body1, float x, float y) - : Joint(body1) - , joint(NULL) -{ - b2MouseJointDef def; - - def.bodyA = body1->world->getGroundBody(); - def.bodyB = body1->body; - def.maxForce = 1000.0f * body1->body->GetMass(); - def.target = Physics::scaleDown(b2Vec2(x,y)); - joint = (b2MouseJoint *)createJoint(&def); -} - -MouseJoint::~MouseJoint() -{ -} - -void MouseJoint::setTarget(float x, float y) -{ - joint->SetTarget(Physics::scaleDown(b2Vec2(x, y))); -} - -int MouseJoint::getTarget(lua_State *L) -{ - lua_pushnumber(L, Physics::scaleUp(joint->GetTarget().x)); - lua_pushnumber(L, Physics::scaleUp(joint->GetTarget().y)); - return 2; -} - -void MouseJoint::setMaxForce(float force) -{ - joint->SetMaxForce(Physics::scaleDown(force)); -} - -float MouseJoint::getMaxForce() const -{ - return Physics::scaleUp(joint->GetMaxForce()); -} - -void MouseJoint::setFrequency(float hz) -{ - joint->SetFrequency(hz); -} - -float MouseJoint::getFrequency() const -{ - return joint->GetFrequency(); -} - -void MouseJoint::setDampingRatio(float d) -{ - joint->SetDampingRatio(d); -} - -float MouseJoint::getDampingRatio() const -{ - return joint->GetDampingRatio(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "MouseJoint.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +MouseJoint::MouseJoint(Body *body1, float x, float y) + : Joint(body1) + , joint(NULL) +{ + b2MouseJointDef def; + + def.bodyA = body1->world->getGroundBody(); + def.bodyB = body1->body; + def.maxForce = 1000.0f * body1->body->GetMass(); + def.target = Physics::scaleDown(b2Vec2(x,y)); + joint = (b2MouseJoint *)createJoint(&def); +} + +MouseJoint::~MouseJoint() +{ +} + +void MouseJoint::setTarget(float x, float y) +{ + joint->SetTarget(Physics::scaleDown(b2Vec2(x, y))); +} + +int MouseJoint::getTarget(lua_State *L) +{ + lua_pushnumber(L, Physics::scaleUp(joint->GetTarget().x)); + lua_pushnumber(L, Physics::scaleUp(joint->GetTarget().y)); + return 2; +} + +void MouseJoint::setMaxForce(float force) +{ + joint->SetMaxForce(Physics::scaleDown(force)); +} + +float MouseJoint::getMaxForce() const +{ + return Physics::scaleUp(joint->GetMaxForce()); +} + +void MouseJoint::setFrequency(float hz) +{ + joint->SetFrequency(hz); +} + +float MouseJoint::getFrequency() const +{ + return joint->GetFrequency(); +} + +void MouseJoint::setDampingRatio(float d) +{ + joint->SetDampingRatio(d); +} + +float MouseJoint::getDampingRatio() const +{ + return joint->GetDampingRatio(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/MouseJoint.h b/src/modules/physics/box2d/MouseJoint.h index c469e62f0..f36d35120 100644 --- a/src/modules/physics/box2d/MouseJoint.h +++ b/src/modules/physics/box2d/MouseJoint.h @@ -1,108 +1,108 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_MOUSE_JOINT_H -#define LOVE_PHYSICS_BOX2D_MOUSE_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * The MouseJoint is a joint type that - * is suitable for controlling objects with the mouse. - * - * One end is anchored in the dynamic body, and the other id - * anchor to a static ground body. The anchor offset can then be - * moved to the current mouse position. - **/ -class MouseJoint : public Joint -{ -public: - - /** - * Creates a MouseJoint which connects body1 to the target point. - **/ - MouseJoint(Body *body1, float x, float y); - - virtual ~MouseJoint(); - - /** - * Sets the target of anchor2. (You usually want - * to set this to the current mouse.) - **/ - void setTarget(float x, float y); - - /** - * Gets the current anchor2 target. - **/ - int getTarget(lua_State *L); - - /** - * Sets the maximum constraint force that can be exerted - * to move the candidate body. - **/ - void setMaxForce(float force); - - /** - * Gets the maximum constraint force that can be exerted - * to move the candidate body. - **/ - float getMaxForce() const; - - /** - * Sets the response speed. - **/ - void setFrequency(float hz); - - /** - * Gets the response speed. - **/ - float getFrequency() const; - - /** - * Sets the damping ratio. - * 0 = no damping, 1 = critical damping. - **/ - void setDampingRatio(float d); - - /** - * Gets the damping ratio. - * 0 = no damping, 1 = critical damping. - **/ - float getDampingRatio() const; - -private: - // The Box2D MouseJoint object. - b2MouseJoint *joint; -}; - -} // box2d -} // physics -} // love - - -#endif // LOVE_PHYSICS_BOX2D_MOUSE_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_MOUSE_JOINT_H +#define LOVE_PHYSICS_BOX2D_MOUSE_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * The MouseJoint is a joint type that + * is suitable for controlling objects with the mouse. + * + * One end is anchored in the dynamic body, and the other id + * anchor to a static ground body. The anchor offset can then be + * moved to the current mouse position. + **/ +class MouseJoint : public Joint +{ +public: + + /** + * Creates a MouseJoint which connects body1 to the target point. + **/ + MouseJoint(Body *body1, float x, float y); + + virtual ~MouseJoint(); + + /** + * Sets the target of anchor2. (You usually want + * to set this to the current mouse.) + **/ + void setTarget(float x, float y); + + /** + * Gets the current anchor2 target. + **/ + int getTarget(lua_State *L); + + /** + * Sets the maximum constraint force that can be exerted + * to move the candidate body. + **/ + void setMaxForce(float force); + + /** + * Gets the maximum constraint force that can be exerted + * to move the candidate body. + **/ + float getMaxForce() const; + + /** + * Sets the response speed. + **/ + void setFrequency(float hz); + + /** + * Gets the response speed. + **/ + float getFrequency() const; + + /** + * Sets the damping ratio. + * 0 = no damping, 1 = critical damping. + **/ + void setDampingRatio(float d); + + /** + * Gets the damping ratio. + * 0 = no damping, 1 = critical damping. + **/ + float getDampingRatio() const; + +private: + // The Box2D MouseJoint object. + b2MouseJoint *joint; +}; + +} // box2d +} // physics +} // love + + +#endif // LOVE_PHYSICS_BOX2D_MOUSE_JOINT_H diff --git a/src/modules/physics/box2d/Physics.cpp b/src/modules/physics/box2d/Physics.cpp index 9c16ccef8..a40e9b3f0 100644 --- a/src/modules/physics/box2d/Physics.cpp +++ b/src/modules/physics/box2d/Physics.cpp @@ -1,338 +1,338 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Physics.h" - -// LOVE -#include "common/math.h" -#include "wrap_Body.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -int Physics::meter = Physics::DEFAULT_METER; - -const char *Physics::getName() const -{ - return "love.physics.box2d"; -} - -World *Physics::newWorld(float gx, float gy, bool sleep) -{ - return new World(b2Vec2(gx, gy), sleep); -} - -Body *Physics::newBody(World *world, float x, float y, Body::Type type) -{ - return new Body(world, b2Vec2(x, y), type); -} - -Body *Physics::newBody(World *world, Body::Type type) -{ - return new Body(world, b2Vec2(0, 0), type); -} - -CircleShape *Physics::newCircleShape(float radius) -{ - return newCircleShape(0, 0, radius); -} - -CircleShape *Physics::newCircleShape(float x, float y, float radius) -{ - b2CircleShape *s = new b2CircleShape(); - s->m_p = Physics::scaleDown(b2Vec2(x, y)); - s->m_radius = Physics::scaleDown(radius); - return new CircleShape(s); -} - -PolygonShape *Physics::newRectangleShape(float w, float h) -{ - return newRectangleShape(0, 0, w, h, 0); -} - -PolygonShape *Physics::newRectangleShape(float x, float y, float w, float h) -{ - return newRectangleShape(x, y, w, h, 0); -} - -PolygonShape *Physics::newRectangleShape(float x, float y, float w, float h, float angle) -{ - b2PolygonShape *s = new b2PolygonShape(); - s->SetAsBox(Physics::scaleDown(w/2.0f), Physics::scaleDown(h/2.0f), Physics::scaleDown(b2Vec2(x, y)), angle); - return new PolygonShape(s); -} - -EdgeShape *Physics::newEdgeShape(float x1, float y1, float x2, float y2) -{ - b2EdgeShape *s = new b2EdgeShape(); - s->Set(Physics::scaleDown(b2Vec2(x1, y1)), Physics::scaleDown(b2Vec2(x2, y2))); - return new EdgeShape(s); -} - -int Physics::newPolygonShape(lua_State *L) -{ - int argc = lua_gettop(L); - if (argc%2 != 0) - return luaL_error(L, "Number of vertices must be a multiple of two."); - // 3 to 8 (b2_maxPolygonVertices) vertices - int vcount = argc / 2; - if (vcount < 3) - luaL_error(L, "Expected a minimum of 3 vertices, got %d.", vcount); - else if (vcount > b2_maxPolygonVertices) - luaL_error(L, "Expected a maximum of %d vertices, got %d.", b2_maxPolygonVertices, vcount); - - b2PolygonShape *s = new b2PolygonShape(); - - bool reverse = false; - b2Vec2 edge1; - b2Vec2 vecs[b2_maxPolygonVertices]; - - for (int i = 0; i < vcount; i++) - { - float x = (float)luaL_checknumber(L, -2); - float y = (float)luaL_checknumber(L, -1); - vecs[i] = Physics::scaleDown(b2Vec2(x, y)); - lua_pop(L, 2); - - if (!reverse) - { - // Detect clockwise winding. - if (i == 1) - { - edge1 = vecs[1] - vecs[0]; - } - else if (i == vcount - 1) - { - b2Vec2 edge2 = vecs[i] - vecs[i-1]; - // Also check the edge from the last and first point. - b2Vec2 edge3 = vecs[0] - vecs[i]; - if (b2Cross(edge1, edge2) < 0.0f || b2Cross(edge2, edge3) < 0.0f) - reverse = true; - } - else if (i > 1) - { - b2Vec2 edge2 = vecs[i] - vecs[i-1]; - if (b2Cross(edge1, edge2) < 0.0f) - reverse = true; - edge1 = edge2; - } - } - } - - if (reverse) - { - for (int i = 0, j = vcount-1; i < j; ++i, --j) - { - b2Vec2 swap = vecs[i]; - vecs[i] = vecs[j]; - vecs[j] = swap; - } - } - - s->Set(vecs, vcount); - PolygonShape *p = new PolygonShape(s); - - luax_newtype(L, "PolygonShape", PHYSICS_POLYGON_SHAPE_T, (void *)p); - return 1; -} - -int Physics::newChainShape(lua_State *L) -{ - int argc = lua_gettop(L)-1; // first argument is looping - int vcount = (int)argc/2; - - b2ChainShape *s = new b2ChainShape(); - - bool loop = luax_toboolean(L, 1); - - b2Vec2 *vecs = new b2Vec2[vcount]; - - for (int i = 0; iCreateLoop(vecs, vcount); - else - s->CreateChain(vecs, vcount); - - ChainShape *c = new ChainShape(s); - delete[] vecs; - - luax_newtype(L, "ChainShape", PHYSICS_CHAIN_SHAPE_T, (void *)c); - - return 1; -} - -DistanceJoint *Physics::newDistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected) -{ - return new DistanceJoint(body1, body2, x1, y1, x2, y2, collideConnected); -} - -MouseJoint *Physics::newMouseJoint(Body *body, float x, float y) -{ - return new MouseJoint(body, x, y); -} - -RevoluteJoint *Physics::newRevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected) -{ - return new RevoluteJoint(body1, body2, x, y, collideConnected); -} - -PrismaticJoint *Physics::newPrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected) -{ - return new PrismaticJoint(body1, body2, xA, yA, xB, yB, ax, ay, collideConnected); -} - -PulleyJoint *Physics::newPulleyJoint(Body *body1, Body *body2, b2Vec2 groundAnchor1, b2Vec2 groundAnchor2, b2Vec2 anchor1, b2Vec2 anchor2, float ratio, bool collideConnected) -{ - return new PulleyJoint(body1, body2, groundAnchor1, groundAnchor2, anchor1, anchor2, ratio, collideConnected); -} - -GearJoint *Physics::newGearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected) -{ - return new GearJoint(joint1, joint2, ratio, collideConnected); -} - -FrictionJoint *Physics::newFrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected) -{ - return new FrictionJoint(body1, body2, xA, yA, xB, yB, collideConnected); -} - -WeldJoint *Physics::newWeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected) -{ - return new WeldJoint(body1, body2, xA, yA, xB, yB, collideConnected); -} - -WheelJoint *Physics::newWheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected) -{ - return new WheelJoint(body1, body2, xA, yA, xB, yB, ax, ay, collideConnected); -} - -RopeJoint *Physics::newRopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected) -{ - return new RopeJoint(body1, body2, x1, y1, x2, y2, maxLength, collideConnected); -} - -Fixture *Physics::newFixture(Body *body, Shape *shape, float density) -{ - return new Fixture(body, shape, density); -} - -int Physics::getDistance(lua_State *L) -{ - Fixture *fixtureA = luax_checktype(L, 1, "Fixture", PHYSICS_FIXTURE_T); - Fixture *fixtureB = luax_checktype(L, 2, "Fixture", PHYSICS_FIXTURE_T); - b2DistanceInput i; - b2DistanceProxy pA; - pA.Set(fixtureA->fixture->GetShape(), 0); - b2DistanceProxy pB; - pB.Set(fixtureB->fixture->GetShape(), 0); - i.proxyA = pA; - i.proxyB = pB; - i.transformA = fixtureA->fixture->GetBody()->GetTransform(); - i.transformB = fixtureB->fixture->GetBody()->GetTransform(); - i.useRadii = true; - b2DistanceOutput o; - b2SimplexCache c; - b2Distance(&o, &c, &i); - lua_pushnumber(L, Physics::scaleUp(o.distance)); - lua_pushnumber(L, Physics::scaleUp(o.pointA.x)); - lua_pushnumber(L, Physics::scaleUp(o.pointA.y)); - lua_pushnumber(L, Physics::scaleUp(o.pointB.x)); - lua_pushnumber(L, Physics::scaleUp(o.pointB.y)); - return 5; -} - -void Physics::setMeter(int meter) -{ - if (meter < 1) throw love::Exception("Physics error: invalid meter"); - Physics::meter = meter; -} - -int Physics::getMeter() -{ - return meter; -} - -void Physics::scaleDown(float &x, float &y) -{ - x /= (float)meter; - y /= (float)meter; -} - -void Physics::scaleUp(float &x, float &y) -{ - x *= (float)meter; - y *= (float)meter; -} - -float Physics::scaleDown(float f) -{ - return f/(float)meter; -} - -float Physics::scaleUp(float f) -{ - return f*(float)meter; -} - -b2Vec2 Physics::scaleDown(const b2Vec2 &v) -{ - b2Vec2 t = v; - scaleDown(t.x, t.y); - return t; -} - -b2Vec2 Physics::scaleUp(const b2Vec2 &v) -{ - b2Vec2 t = v; - scaleUp(t.x, t.y); - return t; -} - -b2AABB Physics::scaleDown(const b2AABB &aabb) -{ - b2AABB t; - t.lowerBound = scaleDown(aabb.lowerBound); - t.upperBound = scaleDown(aabb.upperBound); - return t; -} - -b2AABB Physics::scaleUp(const b2AABB &aabb) -{ - b2AABB t; - t.lowerBound = scaleUp(aabb.lowerBound); - t.upperBound = scaleUp(aabb.upperBound); - return t; -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Physics.h" + +// LOVE +#include "common/math.h" +#include "wrap_Body.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +int Physics::meter = Physics::DEFAULT_METER; + +const char *Physics::getName() const +{ + return "love.physics.box2d"; +} + +World *Physics::newWorld(float gx, float gy, bool sleep) +{ + return new World(b2Vec2(gx, gy), sleep); +} + +Body *Physics::newBody(World *world, float x, float y, Body::Type type) +{ + return new Body(world, b2Vec2(x, y), type); +} + +Body *Physics::newBody(World *world, Body::Type type) +{ + return new Body(world, b2Vec2(0, 0), type); +} + +CircleShape *Physics::newCircleShape(float radius) +{ + return newCircleShape(0, 0, radius); +} + +CircleShape *Physics::newCircleShape(float x, float y, float radius) +{ + b2CircleShape *s = new b2CircleShape(); + s->m_p = Physics::scaleDown(b2Vec2(x, y)); + s->m_radius = Physics::scaleDown(radius); + return new CircleShape(s); +} + +PolygonShape *Physics::newRectangleShape(float w, float h) +{ + return newRectangleShape(0, 0, w, h, 0); +} + +PolygonShape *Physics::newRectangleShape(float x, float y, float w, float h) +{ + return newRectangleShape(x, y, w, h, 0); +} + +PolygonShape *Physics::newRectangleShape(float x, float y, float w, float h, float angle) +{ + b2PolygonShape *s = new b2PolygonShape(); + s->SetAsBox(Physics::scaleDown(w/2.0f), Physics::scaleDown(h/2.0f), Physics::scaleDown(b2Vec2(x, y)), angle); + return new PolygonShape(s); +} + +EdgeShape *Physics::newEdgeShape(float x1, float y1, float x2, float y2) +{ + b2EdgeShape *s = new b2EdgeShape(); + s->Set(Physics::scaleDown(b2Vec2(x1, y1)), Physics::scaleDown(b2Vec2(x2, y2))); + return new EdgeShape(s); +} + +int Physics::newPolygonShape(lua_State *L) +{ + int argc = lua_gettop(L); + if (argc%2 != 0) + return luaL_error(L, "Number of vertices must be a multiple of two."); + // 3 to 8 (b2_maxPolygonVertices) vertices + int vcount = argc / 2; + if (vcount < 3) + luaL_error(L, "Expected a minimum of 3 vertices, got %d.", vcount); + else if (vcount > b2_maxPolygonVertices) + luaL_error(L, "Expected a maximum of %d vertices, got %d.", b2_maxPolygonVertices, vcount); + + b2PolygonShape *s = new b2PolygonShape(); + + bool reverse = false; + b2Vec2 edge1; + b2Vec2 vecs[b2_maxPolygonVertices]; + + for (int i = 0; i < vcount; i++) + { + float x = (float)luaL_checknumber(L, -2); + float y = (float)luaL_checknumber(L, -1); + vecs[i] = Physics::scaleDown(b2Vec2(x, y)); + lua_pop(L, 2); + + if (!reverse) + { + // Detect clockwise winding. + if (i == 1) + { + edge1 = vecs[1] - vecs[0]; + } + else if (i == vcount - 1) + { + b2Vec2 edge2 = vecs[i] - vecs[i-1]; + // Also check the edge from the last and first point. + b2Vec2 edge3 = vecs[0] - vecs[i]; + if (b2Cross(edge1, edge2) < 0.0f || b2Cross(edge2, edge3) < 0.0f) + reverse = true; + } + else if (i > 1) + { + b2Vec2 edge2 = vecs[i] - vecs[i-1]; + if (b2Cross(edge1, edge2) < 0.0f) + reverse = true; + edge1 = edge2; + } + } + } + + if (reverse) + { + for (int i = 0, j = vcount-1; i < j; ++i, --j) + { + b2Vec2 swap = vecs[i]; + vecs[i] = vecs[j]; + vecs[j] = swap; + } + } + + s->Set(vecs, vcount); + PolygonShape *p = new PolygonShape(s); + + luax_newtype(L, "PolygonShape", PHYSICS_POLYGON_SHAPE_T, (void *)p); + return 1; +} + +int Physics::newChainShape(lua_State *L) +{ + int argc = lua_gettop(L)-1; // first argument is looping + int vcount = (int)argc/2; + + b2ChainShape *s = new b2ChainShape(); + + bool loop = luax_toboolean(L, 1); + + b2Vec2 *vecs = new b2Vec2[vcount]; + + for (int i = 0; iCreateLoop(vecs, vcount); + else + s->CreateChain(vecs, vcount); + + ChainShape *c = new ChainShape(s); + delete[] vecs; + + luax_newtype(L, "ChainShape", PHYSICS_CHAIN_SHAPE_T, (void *)c); + + return 1; +} + +DistanceJoint *Physics::newDistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected) +{ + return new DistanceJoint(body1, body2, x1, y1, x2, y2, collideConnected); +} + +MouseJoint *Physics::newMouseJoint(Body *body, float x, float y) +{ + return new MouseJoint(body, x, y); +} + +RevoluteJoint *Physics::newRevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected) +{ + return new RevoluteJoint(body1, body2, x, y, collideConnected); +} + +PrismaticJoint *Physics::newPrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected) +{ + return new PrismaticJoint(body1, body2, xA, yA, xB, yB, ax, ay, collideConnected); +} + +PulleyJoint *Physics::newPulleyJoint(Body *body1, Body *body2, b2Vec2 groundAnchor1, b2Vec2 groundAnchor2, b2Vec2 anchor1, b2Vec2 anchor2, float ratio, bool collideConnected) +{ + return new PulleyJoint(body1, body2, groundAnchor1, groundAnchor2, anchor1, anchor2, ratio, collideConnected); +} + +GearJoint *Physics::newGearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected) +{ + return new GearJoint(joint1, joint2, ratio, collideConnected); +} + +FrictionJoint *Physics::newFrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected) +{ + return new FrictionJoint(body1, body2, xA, yA, xB, yB, collideConnected); +} + +WeldJoint *Physics::newWeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected) +{ + return new WeldJoint(body1, body2, xA, yA, xB, yB, collideConnected); +} + +WheelJoint *Physics::newWheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected) +{ + return new WheelJoint(body1, body2, xA, yA, xB, yB, ax, ay, collideConnected); +} + +RopeJoint *Physics::newRopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected) +{ + return new RopeJoint(body1, body2, x1, y1, x2, y2, maxLength, collideConnected); +} + +Fixture *Physics::newFixture(Body *body, Shape *shape, float density) +{ + return new Fixture(body, shape, density); +} + +int Physics::getDistance(lua_State *L) +{ + Fixture *fixtureA = luax_checktype(L, 1, "Fixture", PHYSICS_FIXTURE_T); + Fixture *fixtureB = luax_checktype(L, 2, "Fixture", PHYSICS_FIXTURE_T); + b2DistanceInput i; + b2DistanceProxy pA; + pA.Set(fixtureA->fixture->GetShape(), 0); + b2DistanceProxy pB; + pB.Set(fixtureB->fixture->GetShape(), 0); + i.proxyA = pA; + i.proxyB = pB; + i.transformA = fixtureA->fixture->GetBody()->GetTransform(); + i.transformB = fixtureB->fixture->GetBody()->GetTransform(); + i.useRadii = true; + b2DistanceOutput o; + b2SimplexCache c; + b2Distance(&o, &c, &i); + lua_pushnumber(L, Physics::scaleUp(o.distance)); + lua_pushnumber(L, Physics::scaleUp(o.pointA.x)); + lua_pushnumber(L, Physics::scaleUp(o.pointA.y)); + lua_pushnumber(L, Physics::scaleUp(o.pointB.x)); + lua_pushnumber(L, Physics::scaleUp(o.pointB.y)); + return 5; +} + +void Physics::setMeter(int meter) +{ + if (meter < 1) throw love::Exception("Physics error: invalid meter"); + Physics::meter = meter; +} + +int Physics::getMeter() +{ + return meter; +} + +void Physics::scaleDown(float &x, float &y) +{ + x /= (float)meter; + y /= (float)meter; +} + +void Physics::scaleUp(float &x, float &y) +{ + x *= (float)meter; + y *= (float)meter; +} + +float Physics::scaleDown(float f) +{ + return f/(float)meter; +} + +float Physics::scaleUp(float f) +{ + return f*(float)meter; +} + +b2Vec2 Physics::scaleDown(const b2Vec2 &v) +{ + b2Vec2 t = v; + scaleDown(t.x, t.y); + return t; +} + +b2Vec2 Physics::scaleUp(const b2Vec2 &v) +{ + b2Vec2 t = v; + scaleUp(t.x, t.y); + return t; +} + +b2AABB Physics::scaleDown(const b2AABB &aabb) +{ + b2AABB t; + t.lowerBound = scaleDown(aabb.lowerBound); + t.upperBound = scaleDown(aabb.upperBound); + return t; +} + +b2AABB Physics::scaleUp(const b2AABB &aabb) +{ + b2AABB t; + t.lowerBound = scaleUp(aabb.lowerBound); + t.upperBound = scaleUp(aabb.upperBound); + return t; +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/Physics.h b/src/modules/physics/box2d/Physics.h index 54705fc01..8bc328b52 100644 --- a/src/modules/physics/box2d/Physics.h +++ b/src/modules/physics/box2d/Physics.h @@ -1,351 +1,351 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_PHYSICS_H -#define LOVE_PHYSICS_BOX2D_PHYSICS_H - -// LOVE -#include "common/Module.h" -#include "World.h" -#include "Contact.h" -#include "Body.h" -#include "Fixture.h" -#include "Shape.h" -#include "CircleShape.h" -#include "PolygonShape.h" -#include "EdgeShape.h" -#include "ChainShape.h" -#include "Joint.h" -#include "MouseJoint.h" -#include "DistanceJoint.h" -#include "PrismaticJoint.h" -#include "RevoluteJoint.h" -#include "PulleyJoint.h" -#include "GearJoint.h" -#include "FrictionJoint.h" -#include "WeldJoint.h" -#include "WheelJoint.h" -#include "RopeJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -class Physics : public Module -{ -public: - - /** - * 30 pixels in one meter by default. - **/ - static const int DEFAULT_METER = 30; - - // Implements Module. - const char *getName() const; - - /** - * Creates a new World. - * @param gx Gravity along x-axis. - * @param gy Gravity along y-axis. - * @param sleep Whether the World allows sleep. - **/ - World *newWorld(float gx, float gy, bool sleep); - - /** - * Creates a new Body at the specified position. - * @param world The world to create the Body in. - * @param x The position along the x-axis. - * @param x The position along the y-axis. - * @param type The type of body to create. - **/ - Body *newBody(World *world, float x, float y, Body::Type type); - - /** - * Creates a new Body at (0, 0) - * @param world The world to create the Body in. - * @param type The type of Body to create. - **/ - Body *newBody(World *world, Body::Type type); - - /** - * Creates a new CircleShape at (0, 0). - * @param radius The radius of the circle. - **/ - CircleShape *newCircleShape(float radius); - - /** - * Creates a new CircleShape at (x,y) in local coordinates. - * @param x The offset along the x-axis. - * @param y The offset along the y-axis. - * @param radius The radius of the circle. - **/ - CircleShape *newCircleShape(float x, float y, float radius); - - /** - * Shorthand for creating rectangular PolygonShapes. The rectangle - * will be created at the local origin. - * @param w The width of the rectangle. - * @param h The height of the rectangle. - **/ - PolygonShape *newRectangleShape(float w, float h); - - /** - * Shorthand for creating rectangular PolygonShapes. The rectangle - * will be created at (x,y) in local coordinates. - * @param x The offset along the x-axis. - * @param y The offset along the y-axis. - * @param w The width of the rectangle. - * @param h The height of the rectangle. - **/ - PolygonShape *newRectangleShape(float x, float y, float w, float h); - - /** - * Shorthand for creating rectangular PolygonShapes. The rectangle - * will be created at (x,y) in local coordinates. - * @param x The offset along the x-axis. - * @param y The offset along the y-axis. - * @param w The width of the rectangle. - * @param h The height of the rectangle. - * @param angle The angle of the rectangle. (rad) - **/ - PolygonShape *newRectangleShape(float x, float y, float w, float h, float angle); - - /** - * Creates a new EdgeShape. The edge will be created from - * (x1,y1) to (x2,y2) in local coordinates. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - **/ - EdgeShape *newEdgeShape(float x1, float y1, float x2, float y2); - - /** - * Creates a new PolygonShape. - * @param ... A variable number of vertices. - **/ - int newPolygonShape(lua_State *L); - - /** - * Creates a new ChainShape. - * @param ... A variable number of vertices. - **/ - int newChainShape(lua_State *L); - - /** - * Creates a new DistanceJoint connecting body1 with body2. - * @param x1 Anchor1 along the x-axis. (World coordinates) - * @param y1 Anchor1 along the y-axis. (World coordinates) - * @param x2 Anchor2 along the x-axis. (World coordinates) - * @param y2 Anchor2 along the y-axis. (World coordinates) - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. - **/ - DistanceJoint *newDistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected); - - /** - * Creates a new MouseJoint connecting the body with an arbitrary point. - * @param x Anchor along the x-axis. (World coordinates) - * @param y Anchor along the y-axis. (World coordinates) - **/ - MouseJoint *newMouseJoint(Body *body, float x, float y); - - /** - * Creates a new RevoluteJoint connecting body1 with body2. - * @param x Anchor along the x-axis. (World coordinates) - * @param y Anchor along the y-axis. (World coordinates) - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. - **/ - RevoluteJoint *newRevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected); - - /** - * Creates a new PrismaticJoint connecting body1 with body2. - * @param xA World-anchor for body1 along the x-axis. - * @param yA World-anchor for body1 along the y-axis. - * @param xB World-anchor for body2 along the x-axis. - * @param yB World-anchor for body2 along the y-axis. - * @param ax The x-component of the world-axis. - * @param ay The y-component of the world-axis. - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. - **/ - PrismaticJoint *newPrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected); - - /** - * Creates a new PulleyJoint connecting body1 with body2. - * @param groundAnchor1 World ground-anchor for body1. - * @param groundAnchor2 World ground-anchor for body2. - * @param anchor1 World anchor on body1. - * @param anchor2 World anchor on body2. - * @param ratio The pulley ratio. - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to true. - **/ - PulleyJoint *newPulleyJoint(Body *body1, Body *body2, b2Vec2 groundAnchor1, b2Vec2 groundAnchor2, b2Vec2 anchor1, b2Vec2 anchor2, float ratio, bool collideConnected); - - /** - * Creates a new GearJoint connecting joint1 with joint2. - * @param joint1 The first joint. - * @param joint2 The second joint. - * @param ratio The gear ratio. - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. - **/ - GearJoint *newGearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected); - - /** - * Creates a new FrictionJoint connecting body1 with body2. - * @param xA Anchor for body 1 along the x-axis. (World coordinates) - * @param yA Anchor for body 1 along the y-axis. (World coordinates) - * @param xB Anchor for body 2 along the x-axis. (World coordinates) - * @param yB Anchor for body 2 along the y-axis. (World coordinates) - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. - **/ - FrictionJoint *newFrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected); - - /** - * Creates a new WeldJoint connecting body1 with body2. - * @param xA Anchor for body 1 along the x-axis. (World coordinates) - * @param yA Anchor for body 1 along the y-axis. (World coordinates) - * @param xB Anchor for body 2 along the x-axis. (World coordinates) - * @param yB Anchor for body 2 along the y-axis. (World coordinates) - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. - **/ - WeldJoint *newWeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected); - - /** - * Creates a new WheelJoint connecting body1 with body2. - * @param xA Anchor for body 1 along the x-axis. (World coordinates) - * @param yA Anchor for body 1 along the y-axis. (World coordinates) - * @param xB Anchor for body 2 along the x-axis. (World coordinates) - * @param yB Anchor for body 2 along the y-axis. (World coordinates) - * @param ax The x-component of the world-axis. - * @param ay The y-component of the world-axis. - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. - **/ - WheelJoint *newWheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected); - - /** - * Creates a new RopeJoint connecting body1 with body2. - * @param x1 Anchor1 along the x-axis. (Local coordinates) - * @param y1 Anchor1 along the y-axis. (Local coordinates) - * @param x2 Anchor2 along the x-axis. (Local coordinates) - * @param y2 Anchor2 along the y-axis. (Local coordinates) - * @param maxLength The maximum distance for the bodies. - * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. - **/ - RopeJoint *newRopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected); - - /** - * Creates a new Fixture attaching shape to body. - * @param body The body to attach the Fixture to. - * @param shape The shape to attach to the Fixture, - * @param density The density of the Fixture. - **/ - - Fixture *newFixture(Body *body, Shape *shape, float density); - - /** - * Calculates the distance between two Fixtures. - * @param fixtureA The first Fixture. - * @param fixtureB The sceond Fixture. - * @return The distance between them, and the two points closest - * to each other. - **/ - int getDistance(lua_State *L); - - /** - * Sets the number of pixels in one meter. - * @param pixels The number of pixels in one meter. (1m ~= 3.3ft). - **/ - static void setMeter(int meter); - - /** - * Gets the number of pixels in one meter. - * @param pixels The number of pixels in one meter. (1m ~= 3.3ft). - **/ - static int getMeter(); - - /** - * Scales a value down according to the current meter in pixels. - * @param f The unscaled input value. - **/ - static float scaleDown(float f); - - /** - * Scales a value up according to the current meter in pixels. - * @param f The unscaled input value. - **/ - static float scaleUp(float f); - - /** - * Scales a point down according to the current meter - * in pixels, for instance x = x0/meter, y = x0/meter. - * @param x The x-coordinate of the point to scale. - * @param y The y-coordinate of the point to scale. - **/ - static void scaleDown(float &x, float &y); - - /** - * Scales a point up according to the current meter - * in pixels, for instance x = x0/meter, y = x0/meter. - * @param x The x-coordinate of the point to scale. - * @param y The y-coordinate of the point to scale. - **/ - static void scaleUp(float &x, float &y); - - /** - * Scales a b2Vec2 down according to the current meter in pixels. - * @param v The unscaled input vector. - * @return The scaled vector. - **/ - static b2Vec2 scaleDown(const b2Vec2 &v); - - /** - * Scales a b2Vec up according to the current meter in pixels. - * @param v The unscaled input vector. - * @return The scaled vector. - **/ - static b2Vec2 scaleUp(const b2Vec2 &v); - - /** - * Scales a b2AABB down according to the current meter in pixels. - * @param v The unscaled input AABB. - * @return The scaled AABB. - **/ - static b2AABB scaleDown(const b2AABB &aabb); - - /** - * Scales a b2AABB up according to the current meter in pixels. - * @param v The unscaled input AABB. - * @return The scaled AABB. - **/ - static b2AABB scaleUp(const b2AABB &aabb); - -private: - - // The length of one meter in pixels. - static int meter; -}; // Physics - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_PHYSICS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_PHYSICS_H +#define LOVE_PHYSICS_BOX2D_PHYSICS_H + +// LOVE +#include "common/Module.h" +#include "World.h" +#include "Contact.h" +#include "Body.h" +#include "Fixture.h" +#include "Shape.h" +#include "CircleShape.h" +#include "PolygonShape.h" +#include "EdgeShape.h" +#include "ChainShape.h" +#include "Joint.h" +#include "MouseJoint.h" +#include "DistanceJoint.h" +#include "PrismaticJoint.h" +#include "RevoluteJoint.h" +#include "PulleyJoint.h" +#include "GearJoint.h" +#include "FrictionJoint.h" +#include "WeldJoint.h" +#include "WheelJoint.h" +#include "RopeJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +class Physics : public Module +{ +public: + + /** + * 30 pixels in one meter by default. + **/ + static const int DEFAULT_METER = 30; + + // Implements Module. + const char *getName() const; + + /** + * Creates a new World. + * @param gx Gravity along x-axis. + * @param gy Gravity along y-axis. + * @param sleep Whether the World allows sleep. + **/ + World *newWorld(float gx, float gy, bool sleep); + + /** + * Creates a new Body at the specified position. + * @param world The world to create the Body in. + * @param x The position along the x-axis. + * @param x The position along the y-axis. + * @param type The type of body to create. + **/ + Body *newBody(World *world, float x, float y, Body::Type type); + + /** + * Creates a new Body at (0, 0) + * @param world The world to create the Body in. + * @param type The type of Body to create. + **/ + Body *newBody(World *world, Body::Type type); + + /** + * Creates a new CircleShape at (0, 0). + * @param radius The radius of the circle. + **/ + CircleShape *newCircleShape(float radius); + + /** + * Creates a new CircleShape at (x,y) in local coordinates. + * @param x The offset along the x-axis. + * @param y The offset along the y-axis. + * @param radius The radius of the circle. + **/ + CircleShape *newCircleShape(float x, float y, float radius); + + /** + * Shorthand for creating rectangular PolygonShapes. The rectangle + * will be created at the local origin. + * @param w The width of the rectangle. + * @param h The height of the rectangle. + **/ + PolygonShape *newRectangleShape(float w, float h); + + /** + * Shorthand for creating rectangular PolygonShapes. The rectangle + * will be created at (x,y) in local coordinates. + * @param x The offset along the x-axis. + * @param y The offset along the y-axis. + * @param w The width of the rectangle. + * @param h The height of the rectangle. + **/ + PolygonShape *newRectangleShape(float x, float y, float w, float h); + + /** + * Shorthand for creating rectangular PolygonShapes. The rectangle + * will be created at (x,y) in local coordinates. + * @param x The offset along the x-axis. + * @param y The offset along the y-axis. + * @param w The width of the rectangle. + * @param h The height of the rectangle. + * @param angle The angle of the rectangle. (rad) + **/ + PolygonShape *newRectangleShape(float x, float y, float w, float h, float angle); + + /** + * Creates a new EdgeShape. The edge will be created from + * (x1,y1) to (x2,y2) in local coordinates. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + **/ + EdgeShape *newEdgeShape(float x1, float y1, float x2, float y2); + + /** + * Creates a new PolygonShape. + * @param ... A variable number of vertices. + **/ + int newPolygonShape(lua_State *L); + + /** + * Creates a new ChainShape. + * @param ... A variable number of vertices. + **/ + int newChainShape(lua_State *L); + + /** + * Creates a new DistanceJoint connecting body1 with body2. + * @param x1 Anchor1 along the x-axis. (World coordinates) + * @param y1 Anchor1 along the y-axis. (World coordinates) + * @param x2 Anchor2 along the x-axis. (World coordinates) + * @param y2 Anchor2 along the y-axis. (World coordinates) + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. + **/ + DistanceJoint *newDistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected); + + /** + * Creates a new MouseJoint connecting the body with an arbitrary point. + * @param x Anchor along the x-axis. (World coordinates) + * @param y Anchor along the y-axis. (World coordinates) + **/ + MouseJoint *newMouseJoint(Body *body, float x, float y); + + /** + * Creates a new RevoluteJoint connecting body1 with body2. + * @param x Anchor along the x-axis. (World coordinates) + * @param y Anchor along the y-axis. (World coordinates) + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. + **/ + RevoluteJoint *newRevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected); + + /** + * Creates a new PrismaticJoint connecting body1 with body2. + * @param xA World-anchor for body1 along the x-axis. + * @param yA World-anchor for body1 along the y-axis. + * @param xB World-anchor for body2 along the x-axis. + * @param yB World-anchor for body2 along the y-axis. + * @param ax The x-component of the world-axis. + * @param ay The y-component of the world-axis. + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. + **/ + PrismaticJoint *newPrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected); + + /** + * Creates a new PulleyJoint connecting body1 with body2. + * @param groundAnchor1 World ground-anchor for body1. + * @param groundAnchor2 World ground-anchor for body2. + * @param anchor1 World anchor on body1. + * @param anchor2 World anchor on body2. + * @param ratio The pulley ratio. + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to true. + **/ + PulleyJoint *newPulleyJoint(Body *body1, Body *body2, b2Vec2 groundAnchor1, b2Vec2 groundAnchor2, b2Vec2 anchor1, b2Vec2 anchor2, float ratio, bool collideConnected); + + /** + * Creates a new GearJoint connecting joint1 with joint2. + * @param joint1 The first joint. + * @param joint2 The second joint. + * @param ratio The gear ratio. + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. + **/ + GearJoint *newGearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected); + + /** + * Creates a new FrictionJoint connecting body1 with body2. + * @param xA Anchor for body 1 along the x-axis. (World coordinates) + * @param yA Anchor for body 1 along the y-axis. (World coordinates) + * @param xB Anchor for body 2 along the x-axis. (World coordinates) + * @param yB Anchor for body 2 along the y-axis. (World coordinates) + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. + **/ + FrictionJoint *newFrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected); + + /** + * Creates a new WeldJoint connecting body1 with body2. + * @param xA Anchor for body 1 along the x-axis. (World coordinates) + * @param yA Anchor for body 1 along the y-axis. (World coordinates) + * @param xB Anchor for body 2 along the x-axis. (World coordinates) + * @param yB Anchor for body 2 along the y-axis. (World coordinates) + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. + **/ + WeldJoint *newWeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected); + + /** + * Creates a new WheelJoint connecting body1 with body2. + * @param xA Anchor for body 1 along the x-axis. (World coordinates) + * @param yA Anchor for body 1 along the y-axis. (World coordinates) + * @param xB Anchor for body 2 along the x-axis. (World coordinates) + * @param yB Anchor for body 2 along the y-axis. (World coordinates) + * @param ax The x-component of the world-axis. + * @param ay The y-component of the world-axis. + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. + **/ + WheelJoint *newWheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected); + + /** + * Creates a new RopeJoint connecting body1 with body2. + * @param x1 Anchor1 along the x-axis. (Local coordinates) + * @param y1 Anchor1 along the y-axis. (Local coordinates) + * @param x2 Anchor2 along the x-axis. (Local coordinates) + * @param y2 Anchor2 along the y-axis. (Local coordinates) + * @param maxLength The maximum distance for the bodies. + * @param collideConnected Whether the connected bodies should collide with each other. Defaults to false. + **/ + RopeJoint *newRopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected); + + /** + * Creates a new Fixture attaching shape to body. + * @param body The body to attach the Fixture to. + * @param shape The shape to attach to the Fixture, + * @param density The density of the Fixture. + **/ + + Fixture *newFixture(Body *body, Shape *shape, float density); + + /** + * Calculates the distance between two Fixtures. + * @param fixtureA The first Fixture. + * @param fixtureB The sceond Fixture. + * @return The distance between them, and the two points closest + * to each other. + **/ + int getDistance(lua_State *L); + + /** + * Sets the number of pixels in one meter. + * @param pixels The number of pixels in one meter. (1m ~= 3.3ft). + **/ + static void setMeter(int meter); + + /** + * Gets the number of pixels in one meter. + * @param pixels The number of pixels in one meter. (1m ~= 3.3ft). + **/ + static int getMeter(); + + /** + * Scales a value down according to the current meter in pixels. + * @param f The unscaled input value. + **/ + static float scaleDown(float f); + + /** + * Scales a value up according to the current meter in pixels. + * @param f The unscaled input value. + **/ + static float scaleUp(float f); + + /** + * Scales a point down according to the current meter + * in pixels, for instance x = x0/meter, y = x0/meter. + * @param x The x-coordinate of the point to scale. + * @param y The y-coordinate of the point to scale. + **/ + static void scaleDown(float &x, float &y); + + /** + * Scales a point up according to the current meter + * in pixels, for instance x = x0/meter, y = x0/meter. + * @param x The x-coordinate of the point to scale. + * @param y The y-coordinate of the point to scale. + **/ + static void scaleUp(float &x, float &y); + + /** + * Scales a b2Vec2 down according to the current meter in pixels. + * @param v The unscaled input vector. + * @return The scaled vector. + **/ + static b2Vec2 scaleDown(const b2Vec2 &v); + + /** + * Scales a b2Vec up according to the current meter in pixels. + * @param v The unscaled input vector. + * @return The scaled vector. + **/ + static b2Vec2 scaleUp(const b2Vec2 &v); + + /** + * Scales a b2AABB down according to the current meter in pixels. + * @param v The unscaled input AABB. + * @return The scaled AABB. + **/ + static b2AABB scaleDown(const b2AABB &aabb); + + /** + * Scales a b2AABB up according to the current meter in pixels. + * @param v The unscaled input AABB. + * @return The scaled AABB. + **/ + static b2AABB scaleUp(const b2AABB &aabb); + +private: + + // The length of one meter in pixels. + static int meter; +}; // Physics + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_PHYSICS_H diff --git a/src/modules/physics/box2d/PolygonShape.cpp b/src/modules/physics/box2d/PolygonShape.cpp index 24f93259b..670de0ab9 100644 --- a/src/modules/physics/box2d/PolygonShape.cpp +++ b/src/modules/physics/box2d/PolygonShape.cpp @@ -1,62 +1,62 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "PolygonShape.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -#include "common/Memoizer.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PolygonShape::PolygonShape(b2PolygonShape *p, bool own) - : Shape(p, own) -{ -} - -PolygonShape::~PolygonShape() -{ -} - -int PolygonShape::getPoints(lua_State *L) -{ - love::luax_assert_argc(L, 0); - b2PolygonShape *p = (b2PolygonShape *)shape; - int count = p->GetVertexCount(); - for (int i = 0; iGetVertex(i)); - lua_pushnumber(L, v.x); - lua_pushnumber(L, v.y); - } - return count*2; -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "PolygonShape.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +#include "common/Memoizer.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PolygonShape::PolygonShape(b2PolygonShape *p, bool own) + : Shape(p, own) +{ +} + +PolygonShape::~PolygonShape() +{ +} + +int PolygonShape::getPoints(lua_State *L) +{ + love::luax_assert_argc(L, 0); + b2PolygonShape *p = (b2PolygonShape *)shape; + int count = p->GetVertexCount(); + for (int i = 0; iGetVertex(i)); + lua_pushnumber(L, v.x); + lua_pushnumber(L, v.y); + } + return count*2; +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/PolygonShape.h b/src/modules/physics/box2d/PolygonShape.h index 177862c3c..f221d7945 100644 --- a/src/modules/physics/box2d/PolygonShape.h +++ b/src/modules/physics/box2d/PolygonShape.h @@ -1,68 +1,68 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_POLYGON_SHAPE_H -#define LOVE_PHYSICS_BOX2D_POLYGON_SHAPE_H - -// Module -#include "Shape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * You should know what a Polygon is. :) - * - * This class is needed so that we can easily get - * the transformed points in Lua. By calling shape:getPoints(), - * the result can be passed directly to love.graphics.polygon(). - **/ -class PolygonShape : public Shape -{ -public: - - /** - * Create a new PolygonShape from the parent Body and - * a Box2D polygon definition. - * @param body The parent Body. - * @param def The polygon definition. - **/ - PolygonShape(b2PolygonShape *p, bool own = true); - - virtual ~PolygonShape(); - - /** - * Returns the transformed points of the polygon. - * This function is useful for debug drawing and such. - * - * The result can be directly passed into love.graphics.polygon(). - **/ - int getPoints(lua_State *L); -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_POLYGON_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_POLYGON_SHAPE_H +#define LOVE_PHYSICS_BOX2D_POLYGON_SHAPE_H + +// Module +#include "Shape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * You should know what a Polygon is. :) + * + * This class is needed so that we can easily get + * the transformed points in Lua. By calling shape:getPoints(), + * the result can be passed directly to love.graphics.polygon(). + **/ +class PolygonShape : public Shape +{ +public: + + /** + * Create a new PolygonShape from the parent Body and + * a Box2D polygon definition. + * @param body The parent Body. + * @param def The polygon definition. + **/ + PolygonShape(b2PolygonShape *p, bool own = true); + + virtual ~PolygonShape(); + + /** + * Returns the transformed points of the polygon. + * This function is useful for debug drawing and such. + * + * The result can be directly passed into love.graphics.polygon(). + **/ + int getPoints(lua_State *L); +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_POLYGON_SHAPE_H diff --git a/src/modules/physics/box2d/PrismaticJoint.cpp b/src/modules/physics/box2d/PrismaticJoint.cpp index db2be10e1..a92695642 100644 --- a/src/modules/physics/box2d/PrismaticJoint.cpp +++ b/src/modules/physics/box2d/PrismaticJoint.cpp @@ -1,144 +1,144 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "PrismaticJoint.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PrismaticJoint::PrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected) - : Joint(body1, body2) - , joint(NULL) -{ - b2PrismaticJointDef def; - - def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA)), b2Vec2(ax,ay)); - def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB))); - def.lowerTranslation = 0.0f; - def.upperTranslation = 100.0f; - def.enableLimit = true; - def.collideConnected = collideConnected; - joint = (b2PrismaticJoint *)createJoint(&def); -} - -PrismaticJoint::~PrismaticJoint() -{ -} - -float PrismaticJoint::getJointTranslation() const -{ - return Physics::scaleUp(joint->GetJointTranslation()); -} - -float PrismaticJoint::getJointSpeed() const -{ - return Physics::scaleUp(joint->GetJointSpeed()); -} - -void PrismaticJoint::enableMotor(bool motor) -{ - return joint->EnableMotor(motor); -} - -bool PrismaticJoint::isMotorEnabled() const -{ - return joint->IsMotorEnabled(); -} - -void PrismaticJoint::setMaxMotorForce(float force) -{ - joint->SetMaxMotorForce(Physics::scaleDown(force)); -} - -void PrismaticJoint::setMotorSpeed(float speed) -{ - joint->SetMotorSpeed(Physics::scaleDown(speed)); -} - -float PrismaticJoint::getMotorSpeed() const -{ - return Physics::scaleUp(joint->GetMotorSpeed()); -} - -float PrismaticJoint::getMotorForce(float inv_dt) const -{ - return Physics::scaleUp(joint->GetMotorForce(inv_dt)); -} - -float PrismaticJoint::getMaxMotorForce() const -{ - return Physics::scaleUp(joint->GetMaxMotorForce()); -} - -void PrismaticJoint::enableLimit(bool limit) -{ - joint->EnableLimit(limit); -} - -bool PrismaticJoint::isLimitEnabled() const -{ - return joint->IsLimitEnabled(); -} - -void PrismaticJoint::setUpperLimit(float limit) -{ - joint->SetLimits(joint->GetLowerLimit(), Physics::scaleDown(limit)); -} - -void PrismaticJoint::setLowerLimit(float limit) -{ - joint->SetLimits(Physics::scaleDown(limit), joint->GetUpperLimit()); -} - -void PrismaticJoint::setLimits(float lower, float upper) -{ - joint->SetLimits(Physics::scaleDown(lower), Physics::scaleDown(upper)); -} - -float PrismaticJoint::getLowerLimit() const -{ - return Physics::scaleUp(joint->GetLowerLimit()); -} - -float PrismaticJoint::getUpperLimit() const -{ - return Physics::scaleUp(joint->GetUpperLimit()); -} - -int PrismaticJoint::getLimits(lua_State *L) -{ - lua_pushnumber(L, Physics::scaleUp(joint->GetLowerLimit())); - lua_pushnumber(L, Physics::scaleUp(joint->GetUpperLimit())); - return 2; -} - - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "PrismaticJoint.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PrismaticJoint::PrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected) + : Joint(body1, body2) + , joint(NULL) +{ + b2PrismaticJointDef def; + + def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA)), b2Vec2(ax,ay)); + def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB))); + def.lowerTranslation = 0.0f; + def.upperTranslation = 100.0f; + def.enableLimit = true; + def.collideConnected = collideConnected; + joint = (b2PrismaticJoint *)createJoint(&def); +} + +PrismaticJoint::~PrismaticJoint() +{ +} + +float PrismaticJoint::getJointTranslation() const +{ + return Physics::scaleUp(joint->GetJointTranslation()); +} + +float PrismaticJoint::getJointSpeed() const +{ + return Physics::scaleUp(joint->GetJointSpeed()); +} + +void PrismaticJoint::enableMotor(bool motor) +{ + return joint->EnableMotor(motor); +} + +bool PrismaticJoint::isMotorEnabled() const +{ + return joint->IsMotorEnabled(); +} + +void PrismaticJoint::setMaxMotorForce(float force) +{ + joint->SetMaxMotorForce(Physics::scaleDown(force)); +} + +void PrismaticJoint::setMotorSpeed(float speed) +{ + joint->SetMotorSpeed(Physics::scaleDown(speed)); +} + +float PrismaticJoint::getMotorSpeed() const +{ + return Physics::scaleUp(joint->GetMotorSpeed()); +} + +float PrismaticJoint::getMotorForce(float inv_dt) const +{ + return Physics::scaleUp(joint->GetMotorForce(inv_dt)); +} + +float PrismaticJoint::getMaxMotorForce() const +{ + return Physics::scaleUp(joint->GetMaxMotorForce()); +} + +void PrismaticJoint::enableLimit(bool limit) +{ + joint->EnableLimit(limit); +} + +bool PrismaticJoint::isLimitEnabled() const +{ + return joint->IsLimitEnabled(); +} + +void PrismaticJoint::setUpperLimit(float limit) +{ + joint->SetLimits(joint->GetLowerLimit(), Physics::scaleDown(limit)); +} + +void PrismaticJoint::setLowerLimit(float limit) +{ + joint->SetLimits(Physics::scaleDown(limit), joint->GetUpperLimit()); +} + +void PrismaticJoint::setLimits(float lower, float upper) +{ + joint->SetLimits(Physics::scaleDown(lower), Physics::scaleDown(upper)); +} + +float PrismaticJoint::getLowerLimit() const +{ + return Physics::scaleUp(joint->GetLowerLimit()); +} + +float PrismaticJoint::getUpperLimit() const +{ + return Physics::scaleUp(joint->GetUpperLimit()); +} + +int PrismaticJoint::getLimits(lua_State *L) +{ + lua_pushnumber(L, Physics::scaleUp(joint->GetLowerLimit())); + lua_pushnumber(L, Physics::scaleUp(joint->GetUpperLimit())); + return 2; +} + + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/PrismaticJoint.h b/src/modules/physics/box2d/PrismaticJoint.h index a1b2251d5..780ac25d8 100644 --- a/src/modules/physics/box2d/PrismaticJoint.h +++ b/src/modules/physics/box2d/PrismaticJoint.h @@ -1,147 +1,147 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_PRISMATIC_JOINT_H -#define LOVE_PHYSICS_BOX2D_PRISMATIC_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * PrismaticJoints allow shapes to move in relation to eachother - * along a defined axis. - **/ -class PrismaticJoint : public Joint -{ -public: - - /** - * Creates a new PrismaticJoint connecting body1 and body2. - **/ - PrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected); - - virtual ~PrismaticJoint(); - - /** - * Get the current joint translation, usually in meters. - **/ - float getJointTranslation() const; - - /** - * Get the current joint translation speed, usually in meters per second. - **/ - float getJointSpeed() const; - - /** - * Enable/disable the joint motor. - **/ - void enableMotor(bool motor); - - /** - * Checks whether the motor is enabled. - **/ - bool isMotorEnabled() const; - - /** - * Set the maximum motor force, usually in N. - **/ - void setMaxMotorForce(float force); - - /** - * Set the motor speed, usually in meters per second. - **/ - void setMotorSpeed(float speed); - - /** - * Get the motor speed, usually in meters per second. - **/ - float getMotorSpeed() const; - - /** - * Get the current motor force, usually in N. - * @param inv_dt The inverse time step. - **/ - float getMotorForce(float inv_dt) const; - - /** - * Get the maximum motor force, usually in N. - **/ - float getMaxMotorForce() const; - - /** - * Enable/disable the joint limit. - **/ - void enableLimit(bool limit); - - /** - * Checks whether limits are enabled. - **/ - bool isLimitEnabled() const; - - /** - * Sets the upper limit, usually in meters. - **/ - void setUpperLimit(float limit); - - /** - * Sets the lower limit, usually in meters. - **/ - void setLowerLimit(float limit); - - /** - * Sets the limits, usually in meters. - **/ - void setLimits(float lower, float upper); - - /** - * Gets the lower limit, usually in meters. - **/ - float getLowerLimit() const; - - /** - * Gets the upper limit, usually in meters. - **/ - float getUpperLimit() const; - - /** - * Gets the limits, usually in meters. - * @returns The upper limit. - * @returns The lower limit. - **/ - int getLimits(lua_State *L); - -private: - - // The Box2D prismatic joint object. - b2PrismaticJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_PRISMATIC_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_PRISMATIC_JOINT_H +#define LOVE_PHYSICS_BOX2D_PRISMATIC_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * PrismaticJoints allow shapes to move in relation to eachother + * along a defined axis. + **/ +class PrismaticJoint : public Joint +{ +public: + + /** + * Creates a new PrismaticJoint connecting body1 and body2. + **/ + PrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected); + + virtual ~PrismaticJoint(); + + /** + * Get the current joint translation, usually in meters. + **/ + float getJointTranslation() const; + + /** + * Get the current joint translation speed, usually in meters per second. + **/ + float getJointSpeed() const; + + /** + * Enable/disable the joint motor. + **/ + void enableMotor(bool motor); + + /** + * Checks whether the motor is enabled. + **/ + bool isMotorEnabled() const; + + /** + * Set the maximum motor force, usually in N. + **/ + void setMaxMotorForce(float force); + + /** + * Set the motor speed, usually in meters per second. + **/ + void setMotorSpeed(float speed); + + /** + * Get the motor speed, usually in meters per second. + **/ + float getMotorSpeed() const; + + /** + * Get the current motor force, usually in N. + * @param inv_dt The inverse time step. + **/ + float getMotorForce(float inv_dt) const; + + /** + * Get the maximum motor force, usually in N. + **/ + float getMaxMotorForce() const; + + /** + * Enable/disable the joint limit. + **/ + void enableLimit(bool limit); + + /** + * Checks whether limits are enabled. + **/ + bool isLimitEnabled() const; + + /** + * Sets the upper limit, usually in meters. + **/ + void setUpperLimit(float limit); + + /** + * Sets the lower limit, usually in meters. + **/ + void setLowerLimit(float limit); + + /** + * Sets the limits, usually in meters. + **/ + void setLimits(float lower, float upper); + + /** + * Gets the lower limit, usually in meters. + **/ + float getLowerLimit() const; + + /** + * Gets the upper limit, usually in meters. + **/ + float getUpperLimit() const; + + /** + * Gets the limits, usually in meters. + * @returns The upper limit. + * @returns The lower limit. + **/ + int getLimits(lua_State *L); + +private: + + // The Box2D prismatic joint object. + b2PrismaticJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_PRISMATIC_JOINT_H diff --git a/src/modules/physics/box2d/PulleyJoint.cpp b/src/modules/physics/box2d/PulleyJoint.cpp index a3d2b068a..69a14267d 100644 --- a/src/modules/physics/box2d/PulleyJoint.cpp +++ b/src/modules/physics/box2d/PulleyJoint.cpp @@ -1,77 +1,77 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "PulleyJoint.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PulleyJoint::PulleyJoint(Body *bodyA, Body *bodyB, b2Vec2 groundAnchorA, b2Vec2 groundAnchorB, b2Vec2 anchorA, b2Vec2 anchorB, float ratio, bool collideConnected) - : Joint(bodyA, bodyB) - , joint(NULL) -{ - b2PulleyJointDef def; - def.Initialize(bodyA->body, bodyB->body, Physics::scaleDown(groundAnchorA), Physics::scaleDown(groundAnchorB), \ - Physics::scaleDown(anchorA), Physics::scaleDown(anchorB), ratio); - def.collideConnected = collideConnected; - - joint = (b2PulleyJoint *)createJoint(&def); -} - -PulleyJoint::~PulleyJoint() -{ -} - -int PulleyJoint::getGroundAnchors(lua_State *L) -{ - lua_pushnumber(L, Physics::scaleUp(joint->GetGroundAnchorA().x)); - lua_pushnumber(L, Physics::scaleUp(joint->GetGroundAnchorA().y)); - lua_pushnumber(L, Physics::scaleUp(joint->GetGroundAnchorB().x)); - lua_pushnumber(L, Physics::scaleUp(joint->GetGroundAnchorB().y)); - return 4; -} - -float PulleyJoint::getLengthA() const -{ - return Physics::scaleUp(joint->GetLengthA()); -} - -float PulleyJoint::getLengthB() const -{ - return Physics::scaleUp(joint->GetLengthB()); -} - -float PulleyJoint::getRatio() const -{ - return joint->GetRatio(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "PulleyJoint.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PulleyJoint::PulleyJoint(Body *bodyA, Body *bodyB, b2Vec2 groundAnchorA, b2Vec2 groundAnchorB, b2Vec2 anchorA, b2Vec2 anchorB, float ratio, bool collideConnected) + : Joint(bodyA, bodyB) + , joint(NULL) +{ + b2PulleyJointDef def; + def.Initialize(bodyA->body, bodyB->body, Physics::scaleDown(groundAnchorA), Physics::scaleDown(groundAnchorB), \ + Physics::scaleDown(anchorA), Physics::scaleDown(anchorB), ratio); + def.collideConnected = collideConnected; + + joint = (b2PulleyJoint *)createJoint(&def); +} + +PulleyJoint::~PulleyJoint() +{ +} + +int PulleyJoint::getGroundAnchors(lua_State *L) +{ + lua_pushnumber(L, Physics::scaleUp(joint->GetGroundAnchorA().x)); + lua_pushnumber(L, Physics::scaleUp(joint->GetGroundAnchorA().y)); + lua_pushnumber(L, Physics::scaleUp(joint->GetGroundAnchorB().x)); + lua_pushnumber(L, Physics::scaleUp(joint->GetGroundAnchorB().y)); + return 4; +} + +float PulleyJoint::getLengthA() const +{ + return Physics::scaleUp(joint->GetLengthA()); +} + +float PulleyJoint::getLengthB() const +{ + return Physics::scaleUp(joint->GetLengthB()); +} + +float PulleyJoint::getRatio() const +{ + return joint->GetRatio(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/PulleyJoint.h b/src/modules/physics/box2d/PulleyJoint.h index 0bfb952c2..0a6098a11 100644 --- a/src/modules/physics/box2d/PulleyJoint.h +++ b/src/modules/physics/box2d/PulleyJoint.h @@ -1,81 +1,81 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_PULLEY_JOINT_H -#define LOVE_PHYSICS_BOX2D_PULLEY_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * The PulleyJoint The pulley connects two bodies to ground and - * to each other. As one body goes up, the other goes down. The - * total length of the pulley rope is conserved according to the - * initial configuration: length1 + ratio * length2 <= constant. - **/ -class PulleyJoint : public Joint -{ -public: - - /** - * Creates a PulleyJoint connecting bodyA to bodyB. - **/ - PulleyJoint(Body *bodyA, Body *bodyB, b2Vec2 groundAnchorA, b2Vec2 groundAnchorB, b2Vec2 anchorA, b2Vec2 anchorB, float ratio, bool collideConnected); - - virtual ~PulleyJoint(); - - /** - * Gets the ground anchors position in world - * coordinates. - **/ - int getGroundAnchors(lua_State *L); - - /** - * Gets the current length of the segment attached to bodyA. - **/ - float getLengthA() const; - - /** - * Gets the current length of the segment attached to bodyB. - **/ - float getLengthB() const; - - /** - * Gets the pulley ratio. - **/ - float getRatio() const; - -private: - // The Box2D DistanceJoint object. - b2PulleyJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_PULLEY_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_PULLEY_JOINT_H +#define LOVE_PHYSICS_BOX2D_PULLEY_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * The PulleyJoint The pulley connects two bodies to ground and + * to each other. As one body goes up, the other goes down. The + * total length of the pulley rope is conserved according to the + * initial configuration: length1 + ratio * length2 <= constant. + **/ +class PulleyJoint : public Joint +{ +public: + + /** + * Creates a PulleyJoint connecting bodyA to bodyB. + **/ + PulleyJoint(Body *bodyA, Body *bodyB, b2Vec2 groundAnchorA, b2Vec2 groundAnchorB, b2Vec2 anchorA, b2Vec2 anchorB, float ratio, bool collideConnected); + + virtual ~PulleyJoint(); + + /** + * Gets the ground anchors position in world + * coordinates. + **/ + int getGroundAnchors(lua_State *L); + + /** + * Gets the current length of the segment attached to bodyA. + **/ + float getLengthA() const; + + /** + * Gets the current length of the segment attached to bodyB. + **/ + float getLengthB() const; + + /** + * Gets the pulley ratio. + **/ + float getRatio() const; + +private: + // The Box2D DistanceJoint object. + b2PulleyJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_PULLEY_JOINT_H diff --git a/src/modules/physics/box2d/RevoluteJoint.cpp b/src/modules/physics/box2d/RevoluteJoint.cpp index b94687a61..137d37059 100644 --- a/src/modules/physics/box2d/RevoluteJoint.cpp +++ b/src/modules/physics/box2d/RevoluteJoint.cpp @@ -1,140 +1,140 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "RevoluteJoint.h" - -#include "common/math.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -RevoluteJoint::RevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected) - : Joint(body1, body2) - , joint(NULL) -{ - b2RevoluteJointDef def; - def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(x,y))); - def.collideConnected = collideConnected; - joint = (b2RevoluteJoint *)createJoint(&def); -} - -RevoluteJoint::~RevoluteJoint() -{ -} - -float RevoluteJoint::getJointAngle() const -{ - return joint->GetJointAngle(); -} - -float RevoluteJoint::getJointSpeed() const -{ - return joint->GetJointSpeed(); -} - -void RevoluteJoint::enableMotor(bool motor) -{ - return joint->EnableMotor(motor); -} - -bool RevoluteJoint::isMotorEnabled() const -{ - return joint->IsMotorEnabled(); -} - -void RevoluteJoint::setMaxMotorTorque(float torque) -{ - joint->SetMaxMotorTorque(Physics::scaleDown(Physics::scaleDown(torque))); -} - -void RevoluteJoint::setMotorSpeed(float speed) -{ - joint->SetMotorSpeed(speed); -} - -float RevoluteJoint::getMotorSpeed() const -{ - return joint->GetMotorSpeed(); -} - -float RevoluteJoint::getMotorTorque(float inv_dt) const -{ - return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt))); -} - -float RevoluteJoint::getMaxMotorTorque() const -{ - return Physics::scaleUp(Physics::scaleUp(joint->GetMaxMotorTorque())); -} - -void RevoluteJoint::enableLimit(bool limit) -{ - joint->EnableLimit(limit); -} - -bool RevoluteJoint::isLimitEnabled() const -{ - return joint->IsLimitEnabled(); -} - -void RevoluteJoint::setUpperLimit(float limit) -{ - joint->SetLimits(joint->GetLowerLimit(), limit); -} - -void RevoluteJoint::setLowerLimit(float limit) -{ - joint->SetLimits(limit, joint->GetUpperLimit()); -} - -void RevoluteJoint::setLimits(float lower, float upper) -{ - joint->SetLimits(lower, upper); -} - -float RevoluteJoint::getLowerLimit() const -{ - return joint->GetLowerLimit(); -} - -float RevoluteJoint::getUpperLimit() const -{ - return joint->GetUpperLimit(); -} - -int RevoluteJoint::getLimits(lua_State *L) -{ - lua_pushnumber(L, joint->GetLowerLimit()); - lua_pushnumber(L, joint->GetUpperLimit()); - return 2; -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "RevoluteJoint.h" + +#include "common/math.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +RevoluteJoint::RevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected) + : Joint(body1, body2) + , joint(NULL) +{ + b2RevoluteJointDef def; + def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(x,y))); + def.collideConnected = collideConnected; + joint = (b2RevoluteJoint *)createJoint(&def); +} + +RevoluteJoint::~RevoluteJoint() +{ +} + +float RevoluteJoint::getJointAngle() const +{ + return joint->GetJointAngle(); +} + +float RevoluteJoint::getJointSpeed() const +{ + return joint->GetJointSpeed(); +} + +void RevoluteJoint::enableMotor(bool motor) +{ + return joint->EnableMotor(motor); +} + +bool RevoluteJoint::isMotorEnabled() const +{ + return joint->IsMotorEnabled(); +} + +void RevoluteJoint::setMaxMotorTorque(float torque) +{ + joint->SetMaxMotorTorque(Physics::scaleDown(Physics::scaleDown(torque))); +} + +void RevoluteJoint::setMotorSpeed(float speed) +{ + joint->SetMotorSpeed(speed); +} + +float RevoluteJoint::getMotorSpeed() const +{ + return joint->GetMotorSpeed(); +} + +float RevoluteJoint::getMotorTorque(float inv_dt) const +{ + return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt))); +} + +float RevoluteJoint::getMaxMotorTorque() const +{ + return Physics::scaleUp(Physics::scaleUp(joint->GetMaxMotorTorque())); +} + +void RevoluteJoint::enableLimit(bool limit) +{ + joint->EnableLimit(limit); +} + +bool RevoluteJoint::isLimitEnabled() const +{ + return joint->IsLimitEnabled(); +} + +void RevoluteJoint::setUpperLimit(float limit) +{ + joint->SetLimits(joint->GetLowerLimit(), limit); +} + +void RevoluteJoint::setLowerLimit(float limit) +{ + joint->SetLimits(limit, joint->GetUpperLimit()); +} + +void RevoluteJoint::setLimits(float lower, float upper) +{ + joint->SetLimits(lower, upper); +} + +float RevoluteJoint::getLowerLimit() const +{ + return joint->GetLowerLimit(); +} + +float RevoluteJoint::getUpperLimit() const +{ + return joint->GetUpperLimit(); +} + +int RevoluteJoint::getLimits(lua_State *L) +{ + lua_pushnumber(L, joint->GetLowerLimit()); + lua_pushnumber(L, joint->GetUpperLimit()); + return 2; +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/RevoluteJoint.h b/src/modules/physics/box2d/RevoluteJoint.h index 62324ba06..47452104c 100644 --- a/src/modules/physics/box2d/RevoluteJoint.h +++ b/src/modules/physics/box2d/RevoluteJoint.h @@ -1,147 +1,147 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_REVOLUTE_JOINT_H -#define LOVE_PHYSICS_BOX2D_REVOLUTE_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * A RevoluteJoint allows two bodies relative rotation - * around a single point. - **/ -class RevoluteJoint : public Joint -{ -public: - - /** - * Creates a new RevoluteJoint connecting body1 and body2. - **/ - RevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected); - - virtual ~RevoluteJoint(); - - /** - * Get the current joint angle in degrees. - **/ - float getJointAngle() const; - - /** - * Get the current joint angle speed in degrees per second. - **/ - float getJointSpeed() const; - - /** - * Enable/disable the joint motor. - **/ - void enableMotor(bool motor); - - /** - * Checks whether the motor is enabled. - **/ - bool isMotorEnabled() const; - - /** - * Set the maximum motor torque, usually in N-m. - **/ - void setMaxMotorTorque(float torque); - - /** - * Sets the motor speed in radians per second. - **/ - void setMotorSpeed(float speed); - - /** - * Gets the motor speed in radians per second. - **/ - float getMotorSpeed() const; - - /** - * Get the current motor torque, usually in N-m. - * @param inv_dt The inverse timestep. - **/ - float getMotorTorque(float inv_dt) const; - - /** - * Get the maximum motor torque, usually in N-m. - **/ - float getMaxMotorTorque() const; - - /** - * Enable/disable the joint limit. - **/ - void enableLimit(bool limit); - - /** - * Checks whether limits are enabled. - **/ - bool isLimitEnabled() const; - - /** - * Sets the upper limit in degrees. - **/ - void setUpperLimit(float limit); - - /** - * Sets the lower limit in degrees. - **/ - void setLowerLimit(float limit); - - /** - * Sets the limits in degrees. - **/ - void setLimits(float lower, float upper); - - /** - * Gets the lower limit in degrees. - **/ - float getLowerLimit() const; - - /** - * Gets the upper limit in degrees. - **/ - float getUpperLimit() const; - - /** - * Gets the limits in degrees. - * @returns The lower limit. - * @returns The upper limit. - **/ - int getLimits(lua_State *L); - -private: - - // The Box2D revolute joint object. - b2RevoluteJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_REVOLUTE_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_REVOLUTE_JOINT_H +#define LOVE_PHYSICS_BOX2D_REVOLUTE_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * A RevoluteJoint allows two bodies relative rotation + * around a single point. + **/ +class RevoluteJoint : public Joint +{ +public: + + /** + * Creates a new RevoluteJoint connecting body1 and body2. + **/ + RevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected); + + virtual ~RevoluteJoint(); + + /** + * Get the current joint angle in degrees. + **/ + float getJointAngle() const; + + /** + * Get the current joint angle speed in degrees per second. + **/ + float getJointSpeed() const; + + /** + * Enable/disable the joint motor. + **/ + void enableMotor(bool motor); + + /** + * Checks whether the motor is enabled. + **/ + bool isMotorEnabled() const; + + /** + * Set the maximum motor torque, usually in N-m. + **/ + void setMaxMotorTorque(float torque); + + /** + * Sets the motor speed in radians per second. + **/ + void setMotorSpeed(float speed); + + /** + * Gets the motor speed in radians per second. + **/ + float getMotorSpeed() const; + + /** + * Get the current motor torque, usually in N-m. + * @param inv_dt The inverse timestep. + **/ + float getMotorTorque(float inv_dt) const; + + /** + * Get the maximum motor torque, usually in N-m. + **/ + float getMaxMotorTorque() const; + + /** + * Enable/disable the joint limit. + **/ + void enableLimit(bool limit); + + /** + * Checks whether limits are enabled. + **/ + bool isLimitEnabled() const; + + /** + * Sets the upper limit in degrees. + **/ + void setUpperLimit(float limit); + + /** + * Sets the lower limit in degrees. + **/ + void setLowerLimit(float limit); + + /** + * Sets the limits in degrees. + **/ + void setLimits(float lower, float upper); + + /** + * Gets the lower limit in degrees. + **/ + float getLowerLimit() const; + + /** + * Gets the upper limit in degrees. + **/ + float getUpperLimit() const; + + /** + * Gets the limits in degrees. + * @returns The lower limit. + * @returns The upper limit. + **/ + int getLimits(lua_State *L); + +private: + + // The Box2D revolute joint object. + b2RevoluteJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_REVOLUTE_JOINT_H diff --git a/src/modules/physics/box2d/RopeJoint.cpp b/src/modules/physics/box2d/RopeJoint.cpp index da4b797fc..625ffaa8e 100644 --- a/src/modules/physics/box2d/RopeJoint.cpp +++ b/src/modules/physics/box2d/RopeJoint.cpp @@ -1,65 +1,65 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "RopeJoint.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -RopeJoint::RopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected) - : Joint(body1, body2) - , joint(NULL) -{ - b2RopeJointDef def; - def.bodyA = body1->body; - def.bodyB = body2->body; - body1->getLocalPoint(x1, y1, x1, y1); - body2->getLocalPoint(x2, y2, x2, y2); - def.localAnchorA.x = Physics::scaleDown(x1); - def.localAnchorA.y = Physics::scaleDown(y1); - def.localAnchorB.x = Physics::scaleDown(x2); - def.localAnchorB.y = Physics::scaleDown(y2); - def.maxLength = Physics::scaleDown(maxLength); - def.collideConnected = collideConnected; - joint = (b2RopeJoint *)createJoint(&def); -} - -RopeJoint::~RopeJoint() -{ -} - -float RopeJoint::getMaxLength() const -{ - return Physics::scaleUp(joint->GetMaxLength()); -} - - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "RopeJoint.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +RopeJoint::RopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected) + : Joint(body1, body2) + , joint(NULL) +{ + b2RopeJointDef def; + def.bodyA = body1->body; + def.bodyB = body2->body; + body1->getLocalPoint(x1, y1, x1, y1); + body2->getLocalPoint(x2, y2, x2, y2); + def.localAnchorA.x = Physics::scaleDown(x1); + def.localAnchorA.y = Physics::scaleDown(y1); + def.localAnchorB.x = Physics::scaleDown(x2); + def.localAnchorB.y = Physics::scaleDown(y2); + def.maxLength = Physics::scaleDown(maxLength); + def.collideConnected = collideConnected; + joint = (b2RopeJoint *)createJoint(&def); +} + +RopeJoint::~RopeJoint() +{ +} + +float RopeJoint::getMaxLength() const +{ + return Physics::scaleUp(joint->GetMaxLength()); +} + + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/RopeJoint.h b/src/modules/physics/box2d/RopeJoint.h index 208b5aa26..2f3778bd5 100644 --- a/src/modules/physics/box2d/RopeJoint.h +++ b/src/modules/physics/box2d/RopeJoint.h @@ -1,63 +1,63 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_ROPE_JOINT_H -#define LOVE_PHYSICS_BOX2D_ROPE_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * The RopeJoint enforces a maximum distance between two points - * on two bodies. It has no other effect. - **/ -class RopeJoint : public Joint -{ -public: - - /** - * Creates a RopeJoint connecting body1 to body2. - **/ - RopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected); - - virtual ~RopeJoint(); - - /** - * Gets the maximum length of the rope. - **/ - float getMaxLength() const; - -private: - // The Box2D RopeJoint object. - b2RopeJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_ROPE_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_ROPE_JOINT_H +#define LOVE_PHYSICS_BOX2D_ROPE_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * The RopeJoint enforces a maximum distance between two points + * on two bodies. It has no other effect. + **/ +class RopeJoint : public Joint +{ +public: + + /** + * Creates a RopeJoint connecting body1 to body2. + **/ + RopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected); + + virtual ~RopeJoint(); + + /** + * Gets the maximum length of the rope. + **/ + float getMaxLength() const; + +private: + // The Box2D RopeJoint object. + b2RopeJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_ROPE_JOINT_H diff --git a/src/modules/physics/box2d/Shape.cpp b/src/modules/physics/box2d/Shape.cpp index f4aacaad0..14cbb0c43 100644 --- a/src/modules/physics/box2d/Shape.cpp +++ b/src/modules/physics/box2d/Shape.cpp @@ -1,155 +1,155 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Shape.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -#include "common/Memoizer.h" - -// STD -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Shape::Shape() - : shape(NULL) - , own(false) -{ -} - -Shape::Shape(b2Shape *shape, bool own) - : shape(shape) - , own(own) -{ - if (own) - Memoizer::add(shape, this); -} - -Shape::~Shape() -{ - if (shape && own) - { - Memoizer::remove(shape); - delete shape; - } - shape = 0; -} - -Shape::Type Shape::getType() const -{ - switch (shape->GetType()) - { - case b2Shape::e_circle: - return SHAPE_CIRCLE; - case b2Shape::e_polygon: - return SHAPE_POLYGON; - case b2Shape::e_edge: - return SHAPE_EDGE; - case b2Shape::e_chain: - return SHAPE_CHAIN; - default: - return SHAPE_INVALID; - } -} - -float Shape::getRadius() const -{ - return Physics::scaleUp(shape->m_radius); -} - -int Shape::getChildCount() const -{ - return shape->GetChildCount(); -} - -bool Shape::testPoint(float x, float y, float r, float px, float py) const -{ - b2Vec2 point(px, py); - b2Transform transform(Physics::scaleDown(b2Vec2(x, y)), b2Rot(r)); - return shape->TestPoint(transform, Physics::scaleDown(point)); -} - -int Shape::rayCast(lua_State *L) const -{ - float p1x = Physics::scaleDown((float)luaL_checknumber(L, 1)); - float p1y = Physics::scaleDown((float)luaL_checknumber(L, 2)); - float p2x = Physics::scaleDown((float)luaL_checknumber(L, 3)); - float p2y = Physics::scaleDown((float)luaL_checknumber(L, 4)); - float maxFraction = (float)luaL_checknumber(L, 5); - float x = Physics::scaleDown((float)luaL_checknumber(L, 6)); - float y = Physics::scaleDown((float)luaL_checknumber(L, 7)); - float r = (float)luaL_checknumber(L, 8); - int childIndex = (int)luaL_optint(L, 9, 1) - 1; // Convert from 1-based index - b2RayCastInput input; - input.p1.Set(p1x, p1y); - input.p2.Set(p2x, p2y); - input.maxFraction = maxFraction; - b2Transform transform(b2Vec2(x, y), b2Rot(r)); - b2RayCastOutput output; - if (!shape->RayCast(&output, input, transform, childIndex)) - return 0; // No hit. - lua_pushnumber(L, output.normal.x); - lua_pushnumber(L, output.normal.y); - lua_pushnumber(L, output.fraction); - return 3; -} - -int Shape::computeAABB(lua_State *L) const -{ - float x = Physics::scaleDown((float)luaL_checknumber(L, 1)); - float y = Physics::scaleDown((float)luaL_checknumber(L, 2)); - float r = (float)luaL_checknumber(L, 3); - int childIndex = (int)luaL_optint(L, 4, 1) - 1; // Convert from 1-based index - b2Transform transform(b2Vec2(x, y), b2Rot(r)); - b2AABB box; - shape->ComputeAABB(&box, transform, childIndex); - box = Physics::scaleUp(box); - lua_pushnumber(L, box.lowerBound.x); - lua_pushnumber(L, box.lowerBound.y); - lua_pushnumber(L, box.upperBound.x); - lua_pushnumber(L, box.upperBound.y); - return 4; -} - -int Shape::computeMass(lua_State *L) const -{ - float density = (float)luaL_checknumber(L, 1); - b2MassData data; - shape->ComputeMass(&data, density); - b2Vec2 center = Physics::scaleUp(data.center); - lua_pushnumber(L, center.x); - lua_pushnumber(L, center.y); - lua_pushnumber(L, data.mass); - lua_pushnumber(L, Physics::scaleUp(Physics::scaleUp(data.I))); - return 4; -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Shape.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +#include "common/Memoizer.h" + +// STD +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Shape::Shape() + : shape(NULL) + , own(false) +{ +} + +Shape::Shape(b2Shape *shape, bool own) + : shape(shape) + , own(own) +{ + if (own) + Memoizer::add(shape, this); +} + +Shape::~Shape() +{ + if (shape && own) + { + Memoizer::remove(shape); + delete shape; + } + shape = 0; +} + +Shape::Type Shape::getType() const +{ + switch (shape->GetType()) + { + case b2Shape::e_circle: + return SHAPE_CIRCLE; + case b2Shape::e_polygon: + return SHAPE_POLYGON; + case b2Shape::e_edge: + return SHAPE_EDGE; + case b2Shape::e_chain: + return SHAPE_CHAIN; + default: + return SHAPE_INVALID; + } +} + +float Shape::getRadius() const +{ + return Physics::scaleUp(shape->m_radius); +} + +int Shape::getChildCount() const +{ + return shape->GetChildCount(); +} + +bool Shape::testPoint(float x, float y, float r, float px, float py) const +{ + b2Vec2 point(px, py); + b2Transform transform(Physics::scaleDown(b2Vec2(x, y)), b2Rot(r)); + return shape->TestPoint(transform, Physics::scaleDown(point)); +} + +int Shape::rayCast(lua_State *L) const +{ + float p1x = Physics::scaleDown((float)luaL_checknumber(L, 1)); + float p1y = Physics::scaleDown((float)luaL_checknumber(L, 2)); + float p2x = Physics::scaleDown((float)luaL_checknumber(L, 3)); + float p2y = Physics::scaleDown((float)luaL_checknumber(L, 4)); + float maxFraction = (float)luaL_checknumber(L, 5); + float x = Physics::scaleDown((float)luaL_checknumber(L, 6)); + float y = Physics::scaleDown((float)luaL_checknumber(L, 7)); + float r = (float)luaL_checknumber(L, 8); + int childIndex = (int)luaL_optint(L, 9, 1) - 1; // Convert from 1-based index + b2RayCastInput input; + input.p1.Set(p1x, p1y); + input.p2.Set(p2x, p2y); + input.maxFraction = maxFraction; + b2Transform transform(b2Vec2(x, y), b2Rot(r)); + b2RayCastOutput output; + if (!shape->RayCast(&output, input, transform, childIndex)) + return 0; // No hit. + lua_pushnumber(L, output.normal.x); + lua_pushnumber(L, output.normal.y); + lua_pushnumber(L, output.fraction); + return 3; +} + +int Shape::computeAABB(lua_State *L) const +{ + float x = Physics::scaleDown((float)luaL_checknumber(L, 1)); + float y = Physics::scaleDown((float)luaL_checknumber(L, 2)); + float r = (float)luaL_checknumber(L, 3); + int childIndex = (int)luaL_optint(L, 4, 1) - 1; // Convert from 1-based index + b2Transform transform(b2Vec2(x, y), b2Rot(r)); + b2AABB box; + shape->ComputeAABB(&box, transform, childIndex); + box = Physics::scaleUp(box); + lua_pushnumber(L, box.lowerBound.x); + lua_pushnumber(L, box.lowerBound.y); + lua_pushnumber(L, box.upperBound.x); + lua_pushnumber(L, box.upperBound.y); + return 4; +} + +int Shape::computeMass(lua_State *L) const +{ + float density = (float)luaL_checknumber(L, 1); + b2MassData data; + shape->ComputeMass(&data, density); + b2Vec2 center = Physics::scaleUp(data.center); + lua_pushnumber(L, center.x); + lua_pushnumber(L, center.y); + lua_pushnumber(L, data.mass); + lua_pushnumber(L, Physics::scaleUp(Physics::scaleUp(data.I))); + return 4; +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/Shape.h b/src/modules/physics/box2d/Shape.h index 5972f57fb..6360b78c1 100644 --- a/src/modules/physics/box2d/Shape.h +++ b/src/modules/physics/box2d/Shape.h @@ -1,82 +1,82 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_SHAPE_H -#define LOVE_PHYSICS_BOX2D_SHAPE_H - -// LOVE -#include "physics/Shape.h" -#include "physics/box2d/Body.h" -#include "common/Reference.h" - -// Box2D -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * A Shape is geometry, attached to a Body via a Fixture. - * A Body has position and orientation, and - * a Shape's geometry will be affected by the parent - * body's transformation. - **/ -class Shape : public love::physics::Shape -{ -public: - - friend class Fixture; - - /** - * Creates a Shape. - **/ - Shape(); - Shape(b2Shape *shape, bool own = true); - - virtual ~Shape(); - - /** - * Gets the type of Shape. Useful for - * debug drawing. - **/ - Type getType() const; - float getRadius() const; - int getChildCount() const; - bool testPoint(float x, float y, float r, float px, float py) const; - int rayCast(lua_State *L) const; - int computeAABB(lua_State *L) const; - int computeMass(lua_State *L) const; - -protected: - - // The Box2D shape. - b2Shape *shape; - bool own; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_SHAPE_H +#define LOVE_PHYSICS_BOX2D_SHAPE_H + +// LOVE +#include "physics/Shape.h" +#include "physics/box2d/Body.h" +#include "common/Reference.h" + +// Box2D +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * A Shape is geometry, attached to a Body via a Fixture. + * A Body has position and orientation, and + * a Shape's geometry will be affected by the parent + * body's transformation. + **/ +class Shape : public love::physics::Shape +{ +public: + + friend class Fixture; + + /** + * Creates a Shape. + **/ + Shape(); + Shape(b2Shape *shape, bool own = true); + + virtual ~Shape(); + + /** + * Gets the type of Shape. Useful for + * debug drawing. + **/ + Type getType() const; + float getRadius() const; + int getChildCount() const; + bool testPoint(float x, float y, float r, float px, float py) const; + int rayCast(lua_State *L) const; + int computeAABB(lua_State *L) const; + int computeMass(lua_State *L) const; + +protected: + + // The Box2D shape. + b2Shape *shape; + bool own; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_SHAPE_H diff --git a/src/modules/physics/box2d/WeldJoint.cpp b/src/modules/physics/box2d/WeldJoint.cpp index 84a8ce7d1..10ada2b37 100644 --- a/src/modules/physics/box2d/WeldJoint.cpp +++ b/src/modules/physics/box2d/WeldJoint.cpp @@ -1,74 +1,74 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "WeldJoint.h" - -#include "common/math.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -WeldJoint::WeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected) - : Joint(body1, body2) - , joint(NULL) -{ - b2WeldJointDef def; - def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA))); - def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB))); - def.collideConnected = collideConnected; - joint = (b2WeldJoint *)createJoint(&def); -} - -WeldJoint::~WeldJoint() -{ -} - -void WeldJoint::setFrequency(float hz) -{ - joint->SetFrequency(hz); -} - -float WeldJoint::getFrequency() const -{ - return joint->GetFrequency(); -} - -void WeldJoint::setDampingRatio(float d) -{ - joint->SetDampingRatio(d); -} - -float WeldJoint::getDampingRatio() const -{ - return joint->GetDampingRatio(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "WeldJoint.h" + +#include "common/math.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +WeldJoint::WeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected) + : Joint(body1, body2) + , joint(NULL) +{ + b2WeldJointDef def; + def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA))); + def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB))); + def.collideConnected = collideConnected; + joint = (b2WeldJoint *)createJoint(&def); +} + +WeldJoint::~WeldJoint() +{ +} + +void WeldJoint::setFrequency(float hz) +{ + joint->SetFrequency(hz); +} + +float WeldJoint::getFrequency() const +{ + return joint->GetFrequency(); +} + +void WeldJoint::setDampingRatio(float d) +{ + joint->SetDampingRatio(d); +} + +float WeldJoint::getDampingRatio() const +{ + return joint->GetDampingRatio(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/WeldJoint.h b/src/modules/physics/box2d/WeldJoint.h index 1e098069e..16a9189d9 100644 --- a/src/modules/physics/box2d/WeldJoint.h +++ b/src/modules/physics/box2d/WeldJoint.h @@ -1,80 +1,80 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WELD_JOINT_H -#define LOVE_PHYSICS_BOX2D_WELD_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * A WeldJoint essentially glues two bodies together. - **/ -class WeldJoint : public Joint -{ -public: - - /** - * Creates a new WeldJoint connecting body1 and body2. - **/ - WeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected); - - virtual ~WeldJoint(); - - /** - * Sets the response speed. - **/ - void setFrequency(float hz); - - /** - * Gets the response speed. - **/ - float getFrequency() const; - - /** - * Sets the damping ratio. - * 0 = no damping, 1 = critical damping. - **/ - void setDampingRatio(float d); - - /** - * Gets the damping ratio. - * 0 = no damping, 1 = critical damping. - **/ - float getDampingRatio() const; - -private: - - // The Box2D weld joint object. - b2WeldJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WELD_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WELD_JOINT_H +#define LOVE_PHYSICS_BOX2D_WELD_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * A WeldJoint essentially glues two bodies together. + **/ +class WeldJoint : public Joint +{ +public: + + /** + * Creates a new WeldJoint connecting body1 and body2. + **/ + WeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected); + + virtual ~WeldJoint(); + + /** + * Sets the response speed. + **/ + void setFrequency(float hz); + + /** + * Gets the response speed. + **/ + float getFrequency() const; + + /** + * Sets the damping ratio. + * 0 = no damping, 1 = critical damping. + **/ + void setDampingRatio(float d); + + /** + * Gets the damping ratio. + * 0 = no damping, 1 = critical damping. + **/ + float getDampingRatio() const; + +private: + + // The Box2D weld joint object. + b2WeldJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WELD_JOINT_H diff --git a/src/modules/physics/box2d/WheelJoint.cpp b/src/modules/physics/box2d/WheelJoint.cpp index fd4bdc5f2..3b4c7b60c 100644 --- a/src/modules/physics/box2d/WheelJoint.cpp +++ b/src/modules/physics/box2d/WheelJoint.cpp @@ -1,119 +1,119 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "WheelJoint.h" - -// Module -#include "Body.h" -#include "World.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -WheelJoint::WheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected) - : Joint(body1, body2) - , joint(NULL) -{ - b2WheelJointDef def; - - def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA)), b2Vec2(ax,ay)); - def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB))); - def.collideConnected = collideConnected; - joint = (b2WheelJoint *)createJoint(&def); -} - -WheelJoint::~WheelJoint() -{ -} - -float WheelJoint::getJointTranslation() const -{ - return Physics::scaleUp(joint->GetJointTranslation()); -} - -float WheelJoint::getJointSpeed() const -{ - return Physics::scaleUp(joint->GetJointSpeed()); -} - -void WheelJoint::enableMotor(bool motor) -{ - return joint->EnableMotor(motor); -} - -bool WheelJoint::isMotorEnabled() const -{ - return joint->IsMotorEnabled(); -} - -void WheelJoint::setMotorSpeed(float speed) -{ - joint->SetMotorSpeed(speed); -} - -float WheelJoint::getMotorSpeed() const -{ - return joint->GetMotorSpeed(); -} - -void WheelJoint::setMaxMotorTorque(float torque) -{ - joint->SetMaxMotorTorque(Physics::scaleDown(Physics::scaleDown(torque))); -} - -float WheelJoint::getMaxMotorTorque() const -{ - return Physics::scaleUp(Physics::scaleUp(joint->GetMaxMotorTorque())); -} - -float WheelJoint::getMotorTorque(float inv_dt) const -{ - return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt))); -} - -void WheelJoint::setSpringFrequency(float hz) -{ - joint->SetSpringFrequencyHz(hz); -} - -float WheelJoint::getSpringFrequency() const -{ - return joint->GetSpringFrequencyHz(); -} - -void WheelJoint::setSpringDampingRatio(float ratio) -{ - joint->SetSpringDampingRatio(ratio); -} - -float WheelJoint::getSpringDampingRatio() const -{ - return joint->GetSpringDampingRatio(); -} - - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "WheelJoint.h" + +// Module +#include "Body.h" +#include "World.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +WheelJoint::WheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected) + : Joint(body1, body2) + , joint(NULL) +{ + b2WheelJointDef def; + + def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA)), b2Vec2(ax,ay)); + def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB))); + def.collideConnected = collideConnected; + joint = (b2WheelJoint *)createJoint(&def); +} + +WheelJoint::~WheelJoint() +{ +} + +float WheelJoint::getJointTranslation() const +{ + return Physics::scaleUp(joint->GetJointTranslation()); +} + +float WheelJoint::getJointSpeed() const +{ + return Physics::scaleUp(joint->GetJointSpeed()); +} + +void WheelJoint::enableMotor(bool motor) +{ + return joint->EnableMotor(motor); +} + +bool WheelJoint::isMotorEnabled() const +{ + return joint->IsMotorEnabled(); +} + +void WheelJoint::setMotorSpeed(float speed) +{ + joint->SetMotorSpeed(speed); +} + +float WheelJoint::getMotorSpeed() const +{ + return joint->GetMotorSpeed(); +} + +void WheelJoint::setMaxMotorTorque(float torque) +{ + joint->SetMaxMotorTorque(Physics::scaleDown(Physics::scaleDown(torque))); +} + +float WheelJoint::getMaxMotorTorque() const +{ + return Physics::scaleUp(Physics::scaleUp(joint->GetMaxMotorTorque())); +} + +float WheelJoint::getMotorTorque(float inv_dt) const +{ + return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt))); +} + +void WheelJoint::setSpringFrequency(float hz) +{ + joint->SetSpringFrequencyHz(hz); +} + +float WheelJoint::getSpringFrequency() const +{ + return joint->GetSpringFrequencyHz(); +} + +void WheelJoint::setSpringDampingRatio(float ratio) +{ + joint->SetSpringDampingRatio(ratio); +} + +float WheelJoint::getSpringDampingRatio() const +{ + return joint->GetSpringDampingRatio(); +} + + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/WheelJoint.h b/src/modules/physics/box2d/WheelJoint.h index d5a89cf47..f36d114a4 100644 --- a/src/modules/physics/box2d/WheelJoint.h +++ b/src/modules/physics/box2d/WheelJoint.h @@ -1,127 +1,127 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WHEEL_JOINT_H -#define LOVE_PHYSICS_BOX2D_WHEEL_JOINT_H - -// Module -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -/** - * WheelJoints provide two degrees of freedom: translation - * along a defined axis and rotation in the plane. Designed - * for vehicle suspensions. - **/ -class WheelJoint : public Joint -{ -public: - - /** - * Creates a new WheelJoint connecting body1 and body2. - **/ - WheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected); - - virtual ~WheelJoint(); - - /** - * Get the current joint translation, usually in meters. - **/ - float getJointTranslation() const; - - /** - * Get the current joint translation speed, usually in meters per second. - **/ - float getJointSpeed() const; - - /** - * Enable/disable the joint motor. - **/ - void enableMotor(bool motor); - - /** - * Checks whether the motor is enabled. - **/ - bool isMotorEnabled() const; - - /** - * Set the motor speed, usually in meters per second. - **/ - void setMotorSpeed(float speed); - - /** - * Get the motor speed, usually in meters per second. - **/ - float getMotorSpeed() const; - - /** - * Set the maximum motor torque, usually in N. - **/ - void setMaxMotorTorque(float torque); - - /** - * Get the maximum motor torque, usually in N. - **/ - float getMaxMotorTorque() const; - - /** - * Get the current motor torque, usually in N. - * @param inv_dt The inverse time step. - **/ - float getMotorTorque(float inv_dt) const; - - /** - * Set the spring frequency, in hertz. Setting the frequency to 0 - * disables the spring. - **/ - void setSpringFrequency(float hz); - - /** - * Get the spring frequency, in hertz. - **/ - float getSpringFrequency() const; - - /** - * Set the spring damping ratio. - **/ - void setSpringDampingRatio(float ratio); - - /** - * Get the spring damping ratio. - **/ - float getSpringDampingRatio() const; - -private: - - // The Box2D wheel joint object. - b2WheelJoint *joint; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WHEEL_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WHEEL_JOINT_H +#define LOVE_PHYSICS_BOX2D_WHEEL_JOINT_H + +// Module +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +/** + * WheelJoints provide two degrees of freedom: translation + * along a defined axis and rotation in the plane. Designed + * for vehicle suspensions. + **/ +class WheelJoint : public Joint +{ +public: + + /** + * Creates a new WheelJoint connecting body1 and body2. + **/ + WheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected); + + virtual ~WheelJoint(); + + /** + * Get the current joint translation, usually in meters. + **/ + float getJointTranslation() const; + + /** + * Get the current joint translation speed, usually in meters per second. + **/ + float getJointSpeed() const; + + /** + * Enable/disable the joint motor. + **/ + void enableMotor(bool motor); + + /** + * Checks whether the motor is enabled. + **/ + bool isMotorEnabled() const; + + /** + * Set the motor speed, usually in meters per second. + **/ + void setMotorSpeed(float speed); + + /** + * Get the motor speed, usually in meters per second. + **/ + float getMotorSpeed() const; + + /** + * Set the maximum motor torque, usually in N. + **/ + void setMaxMotorTorque(float torque); + + /** + * Get the maximum motor torque, usually in N. + **/ + float getMaxMotorTorque() const; + + /** + * Get the current motor torque, usually in N. + * @param inv_dt The inverse time step. + **/ + float getMotorTorque(float inv_dt) const; + + /** + * Set the spring frequency, in hertz. Setting the frequency to 0 + * disables the spring. + **/ + void setSpringFrequency(float hz); + + /** + * Get the spring frequency, in hertz. + **/ + float getSpringFrequency() const; + + /** + * Set the spring damping ratio. + **/ + void setSpringDampingRatio(float ratio); + + /** + * Get the spring damping ratio. + **/ + float getSpringDampingRatio() const; + +private: + + // The Box2D wheel joint object. + b2WheelJoint *joint; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WHEEL_JOINT_H diff --git a/src/modules/physics/box2d/World.cpp b/src/modules/physics/box2d/World.cpp index 4cf5e3283..897e65a78 100644 --- a/src/modules/physics/box2d/World.cpp +++ b/src/modules/physics/box2d/World.cpp @@ -1,551 +1,551 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "World.h" - -#include "Fixture.h" -#include "Shape.h" -#include "Contact.h" -#include "Physics.h" -#include "common/Memoizer.h" -#include "common/Reference.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -World::ContactCallback::ContactCallback() - : ref(0) -{ -} - -World::ContactCallback::~ContactCallback() -{ - if (ref != 0) - delete ref; -} - -void World::ContactCallback::process(b2Contact *contact, const b2ContactImpulse *impulse) -{ - // Process contacts. - if (ref != 0) - { - lua_State *L = ref->getL(); - ref->push(); - - // Push first fixture. - { - Fixture *a = (Fixture *)Memoizer::find(contact->GetFixtureA()); - if (a != 0) - { - a->retain(); - luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)a); - } - else - throw love::Exception("A fixture has escaped Memoizer!"); - } - - // Push second fixture. - { - Fixture *b = (Fixture *)Memoizer::find(contact->GetFixtureB()); - if (b != 0) - { - b->retain(); - luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)b); - } - else - throw love::Exception("A fixture has escaped Memoizer!"); - } - - Contact *c = new Contact(contact); - - luax_newtype(L, "Contact", (PHYSICS_CONTACT_T), (void *)c); - - int args = 3; - if (impulse) - { - for (int c = 0; c < impulse->count; c++) - { - lua_pushnumber(L, Physics::scaleUp(impulse->normalImpulses[c])); - lua_pushnumber(L, Physics::scaleUp(impulse->tangentImpulses[c])); - args += 2; - } - } - lua_call(L, args, 0); - } - -} - -World::ContactFilter::ContactFilter() - : ref(0) -{ -} - -World::ContactFilter::~ContactFilter() -{ - if (ref != 0) - delete ref; -} - -bool World::ContactFilter::process(Fixture *a, Fixture *b) -{ - // Handle masks, reimplemented from the manual - int filterA[3], filterB[3]; - // [0] categoryBits - // [1] maskBits - // [2] groupIndex - a->getFilterData(filterA); - b->getFilterData(filterB); - - if (filterA[2] != 0 && // 0 is the default group, so this does not count - filterA[2] == filterB[2]) // if they are in the same group - return filterA[2] > 0; // Negative indexes mean you don't collide - - if ((filterA[1] & filterB[0]) == 0 || - (filterB[1] & filterA[0]) == 0) - return false; // A and B aren't set to collide - - if (ref != 0) - { - lua_State *L = ref->getL(); - ref->push(); - luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)a); - luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)b); - lua_call(L, 2, 1); - return luax_toboolean(L, -1); - } - return true; -} - -World::QueryCallback::QueryCallback() - : ref(0) -{ -} - -World::QueryCallback::~QueryCallback() -{ - if (ref != 0) - delete ref; -} - -bool World::QueryCallback::ReportFixture(b2Fixture *fixture) -{ - if (ref != 0) - { - lua_State *L = ref->getL(); - ref->push(); - Fixture *f = (Fixture *)Memoizer::find(fixture); - if (!f) - throw love::Exception("A fixture has escaped Memoizer!"); - f->retain(); - luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)f); - lua_call(L, 1, 1); - return luax_toboolean(L, -1); - } - return true; -} - -World::RayCastCallback::RayCastCallback() - : ref(0) -{ -} - -World::RayCastCallback::~RayCastCallback() -{ - if (ref != 0) - delete ref; -} - -float32 World::RayCastCallback::ReportFixture(b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction) -{ - if (ref != 0) - { - lua_State *L = ref->getL(); - ref->push(); - Fixture *f = (Fixture *)Memoizer::find(fixture); - if (!f) - throw love::Exception("A fixture has escaped Memoizer!"); - f->retain(); - luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)f); - b2Vec2 scaledPoint = Physics::scaleUp(point); - lua_pushnumber(L, scaledPoint.x); - lua_pushnumber(L, scaledPoint.y); - lua_pushnumber(L, normal.x); - lua_pushnumber(L, normal.y); - lua_pushnumber(L, fraction); - lua_call(L, 6, 1); - if (!lua_isnumber(L, -1)) - luaL_error(L, "Raycast callback didn't return a number!"); - return (float32)lua_tonumber(L, -1); - } - return 0; -} - -void World::SayGoodbye(b2Fixture *fixture) -{ - Fixture *f = (Fixture *)Memoizer::find(fixture); - // Hint implicit destruction with true. - if (f) f->destroy(true); -} - -void World::SayGoodbye(b2Joint *joint) -{ - Joint *j = (Joint *)Memoizer::find(joint); - // Hint implicit destruction with true. - if (j) j->destroyJoint(true); -} - -World::World() - : world(NULL), destructWorld(false) -{ - world = new b2World(b2Vec2(0,0)); - this->retain(); // The Box2D world holds a reference to this World. - world->SetAllowSleeping(true); - world->SetContactListener(this); - world->SetContactFilter(this); - world->SetDestructionListener(this); - b2BodyDef def; - groundBody = world->CreateBody(&def); - Memoizer::add(world, this); -} - -World::World(b2Vec2 gravity, bool sleep) - : world(NULL), destructWorld(false) -{ - world = new b2World(Physics::scaleDown(gravity)); - // The Box2D world holds a reference to this World. - this->retain(); - world->SetAllowSleeping(sleep); - world->SetContactListener(this); - world->SetContactFilter(this); - world->SetDestructionListener(this); - b2BodyDef def; - groundBody = world->CreateBody(&def); - Memoizer::add(world, this); -} - -World::~World() -{ -} - -void World::update(float dt) -{ - world->Step(dt, 8, 6); - - // Destroy all objects marked during the time step. - for (std::vector::iterator i = destructBodies.begin(); i < destructBodies.end(); i++) - { - Body *b = *i; - if (b->body != 0) b->destroy(); - // Release for reference in vector. - b->release(); - } - for (std::vector::iterator i = destructFixtures.begin(); i < destructFixtures.end(); i++) - { - Fixture *f = *i; - if (f->isValid()) f->destroy(); - // Release for reference in vector. - f->release(); - } - for (std::vector::iterator i = destructJoints.begin(); i < destructJoints.end(); i++) - { - Joint *j = *i; - if (j->isValid()) j->destroyJoint(); - // Release for reference in vector. - j->release(); - } - destructBodies.clear(); - destructFixtures.clear(); - destructJoints.clear(); - - if (destructWorld) - destroy(); -} - -void World::BeginContact(b2Contact *contact) -{ - begin.process(contact); -} - -void World::EndContact(b2Contact *contact) -{ - end.process(contact); -} - -void World::PreSolve(b2Contact *contact, const b2Manifold *oldManifold) -{ - B2_NOT_USED(oldManifold); // not sure what to do with this - presolve.process(contact); -} - -void World::PostSolve(b2Contact *contact, const b2ContactImpulse *impulse) -{ - postsolve.process(contact, impulse); -} - -bool World::ShouldCollide(b2Fixture *fixtureA, b2Fixture *fixtureB) -{ - // Fixtures should be memoized, if we created them - Fixture *a = (Fixture *)Memoizer::find(fixtureA); - if (!a) - throw love::Exception("A fixture has escaped Memoizer!"); - a->retain(); - Fixture *b = (Fixture *)Memoizer::find(fixtureB); - if (!b) - throw love::Exception("A fixture has escaped Memoizer!"); - b->retain(); - return filter.process(a, b); -} - -bool World::isValid() const -{ - return world != 0; -} - -int World::setCallbacks(lua_State *L) -{ - int n = lua_gettop(L); - luax_assert_argc(L, 1, 4); - - switch (n) - { - case 4: - if (postsolve.ref) - delete postsolve.ref; - postsolve.ref = luax_refif (L, LUA_TFUNCTION); - case 3: - if (presolve.ref) - delete presolve.ref; - presolve.ref = luax_refif (L, LUA_TFUNCTION); - case 2: - if (end.ref) - delete end.ref; - end.ref = luax_refif (L, LUA_TFUNCTION); - case 1: - if (begin.ref) - delete begin.ref; - begin.ref = luax_refif (L, LUA_TFUNCTION); - } - - return 0; -} - -int World::getCallbacks(lua_State *L) -{ - begin.ref ? begin.ref->push() : lua_pushnil(L); - end.ref ? end.ref->push() : lua_pushnil(L); - presolve.ref ? presolve.ref->push() : lua_pushnil(L); - postsolve.ref ? postsolve.ref->push() : lua_pushnil(L); - return 4; -} - -int World::setContactFilter(lua_State *L) -{ - luax_assert_argc(L, 1); - if (filter.ref) - delete filter.ref; - filter.ref = luax_refif (L, LUA_TFUNCTION); - return 0; -} - -int World::getContactFilter(lua_State *L) -{ - filter.ref ? filter.ref->push() : lua_pushnil(L); - return 1; -} - -void World::setGravity(float x, float y) -{ - world->SetGravity(Physics::scaleDown(b2Vec2(x, y))); -} - -int World::getGravity(lua_State *L) -{ - b2Vec2 v = Physics::scaleUp(world->GetGravity()); - lua_pushnumber(L, v.x); - lua_pushnumber(L, v.y); - return 2; -} - -void World::setAllowSleeping(bool allow) -{ - world->SetAllowSleeping(allow); -} - -bool World::getAllowSleeping() const -{ - return world->GetAllowSleeping(); -} - -bool World::isLocked() const -{ - return world->IsLocked(); -} - -int World::getBodyCount() const -{ - return world->GetBodyCount()-1; // ignore the ground body -} - -int World::getJointCount() const -{ - return world->GetJointCount(); -} - -int World::getContactCount() const -{ - return world->GetContactCount(); -} - -int World::getBodyList(lua_State *L) const -{ - lua_newtable(L); - b2Body *b = world->GetBodyList(); - int i = 1; - do - { - if (!b) - break; - if (b == groundBody) - continue; - Body *body = (Body *)Memoizer::find(b); - if (!body) - throw love::Exception("A body has escaped Memoizer!"); - body->retain(); - luax_newtype(L, "Body", PHYSICS_BODY_T, (void *)body); - lua_rawseti(L, -2, i); - i++; - } - while ((b = b->GetNext())); - return 1; -} - -int World::getJointList(lua_State *L) const -{ - lua_newtable(L); - b2Joint *j = world->GetJointList(); - int i = 1; - do - { - if (!j) break; - Joint *joint = (Joint *)Memoizer::find(j); - if (!joint) throw love::Exception("A joint has escaped Memoizer!"); - joint->retain(); - luax_newtype(L, "Joint", PHYSICS_JOINT_T, (void *)joint); - lua_rawseti(L, -2, i); - i++; - } - while ((j = j->GetNext())); - return 1; -} - -int World::getContactList(lua_State *L) const -{ - lua_newtable(L); - b2Contact *c = world->GetContactList(); - int i = 1; - do - { - if (!c) break; - Contact *contact = (Contact *)Memoizer::find(c); - if (!contact) throw love::Exception("A contact has escaped Memoizer!"); - contact->retain(); - luax_newtype(L, "Contact", PHYSICS_CONTACT_T, (void *)contact); - lua_rawseti(L, -2, i); - i++; - } - while ((c = c->GetNext())); - return 1; -} - -b2Body *World::getGroundBody() const -{ - return groundBody; -} - -int World::queryBoundingBox(lua_State *L) -{ - luax_assert_argc(L, 5); - b2AABB box; - float lx = (float)luaL_checknumber(L, 1); - float ly = (float)luaL_checknumber(L, 2); - float ux = (float)luaL_checknumber(L, 3); - float uy = (float)luaL_checknumber(L, 4); - box.lowerBound = Physics::scaleDown(b2Vec2(lx, ly)); - box.upperBound = Physics::scaleDown(b2Vec2(ux, uy)); - if (query.ref) delete query.ref; - query.ref = luax_refif (L, LUA_TFUNCTION); - world->QueryAABB(&query, box); - return 0; -} - -int World::rayCast(lua_State *L) -{ - luax_assert_argc(L, 5); - float x1 = (float)luaL_checknumber(L, 1); - float y1 = (float)luaL_checknumber(L, 2); - float x2 = (float)luaL_checknumber(L, 3); - float y2 = (float)luaL_checknumber(L, 4); - b2Vec2 v1 = Physics::scaleDown(b2Vec2(x1, y1)); - b2Vec2 v2 = Physics::scaleDown(b2Vec2(x2, y2)); - if (raycast.ref) - delete raycast.ref; - raycast.ref = luax_refif (L, LUA_TFUNCTION); - world->RayCast(&raycast, v1, v2); - return 0; -} - -void World::destroy() -{ - if (world->IsLocked()) - { - destructWorld = true; - return; - } - - // Cleaning up the world. - b2Body *b = world->GetBodyList(); - while (b) - { - b2Body *t = b; - b = b->GetNext(); - if (t == groundBody) - continue; - Body *body = (Body *)Memoizer::find(t); - if (!body) - throw love::Exception("A body has escaped Memoizer!"); - body->destroy(); - } - - world->DestroyBody(groundBody); - Memoizer::remove(world); - delete world; - world = 0; - - // Box2D world destroyed. Release its reference. - this->release(); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "World.h" + +#include "Fixture.h" +#include "Shape.h" +#include "Contact.h" +#include "Physics.h" +#include "common/Memoizer.h" +#include "common/Reference.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +World::ContactCallback::ContactCallback() + : ref(0) +{ +} + +World::ContactCallback::~ContactCallback() +{ + if (ref != 0) + delete ref; +} + +void World::ContactCallback::process(b2Contact *contact, const b2ContactImpulse *impulse) +{ + // Process contacts. + if (ref != 0) + { + lua_State *L = ref->getL(); + ref->push(); + + // Push first fixture. + { + Fixture *a = (Fixture *)Memoizer::find(contact->GetFixtureA()); + if (a != 0) + { + a->retain(); + luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)a); + } + else + throw love::Exception("A fixture has escaped Memoizer!"); + } + + // Push second fixture. + { + Fixture *b = (Fixture *)Memoizer::find(contact->GetFixtureB()); + if (b != 0) + { + b->retain(); + luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)b); + } + else + throw love::Exception("A fixture has escaped Memoizer!"); + } + + Contact *c = new Contact(contact); + + luax_newtype(L, "Contact", (PHYSICS_CONTACT_T), (void *)c); + + int args = 3; + if (impulse) + { + for (int c = 0; c < impulse->count; c++) + { + lua_pushnumber(L, Physics::scaleUp(impulse->normalImpulses[c])); + lua_pushnumber(L, Physics::scaleUp(impulse->tangentImpulses[c])); + args += 2; + } + } + lua_call(L, args, 0); + } + +} + +World::ContactFilter::ContactFilter() + : ref(0) +{ +} + +World::ContactFilter::~ContactFilter() +{ + if (ref != 0) + delete ref; +} + +bool World::ContactFilter::process(Fixture *a, Fixture *b) +{ + // Handle masks, reimplemented from the manual + int filterA[3], filterB[3]; + // [0] categoryBits + // [1] maskBits + // [2] groupIndex + a->getFilterData(filterA); + b->getFilterData(filterB); + + if (filterA[2] != 0 && // 0 is the default group, so this does not count + filterA[2] == filterB[2]) // if they are in the same group + return filterA[2] > 0; // Negative indexes mean you don't collide + + if ((filterA[1] & filterB[0]) == 0 || + (filterB[1] & filterA[0]) == 0) + return false; // A and B aren't set to collide + + if (ref != 0) + { + lua_State *L = ref->getL(); + ref->push(); + luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)a); + luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)b); + lua_call(L, 2, 1); + return luax_toboolean(L, -1); + } + return true; +} + +World::QueryCallback::QueryCallback() + : ref(0) +{ +} + +World::QueryCallback::~QueryCallback() +{ + if (ref != 0) + delete ref; +} + +bool World::QueryCallback::ReportFixture(b2Fixture *fixture) +{ + if (ref != 0) + { + lua_State *L = ref->getL(); + ref->push(); + Fixture *f = (Fixture *)Memoizer::find(fixture); + if (!f) + throw love::Exception("A fixture has escaped Memoizer!"); + f->retain(); + luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)f); + lua_call(L, 1, 1); + return luax_toboolean(L, -1); + } + return true; +} + +World::RayCastCallback::RayCastCallback() + : ref(0) +{ +} + +World::RayCastCallback::~RayCastCallback() +{ + if (ref != 0) + delete ref; +} + +float32 World::RayCastCallback::ReportFixture(b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction) +{ + if (ref != 0) + { + lua_State *L = ref->getL(); + ref->push(); + Fixture *f = (Fixture *)Memoizer::find(fixture); + if (!f) + throw love::Exception("A fixture has escaped Memoizer!"); + f->retain(); + luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)f); + b2Vec2 scaledPoint = Physics::scaleUp(point); + lua_pushnumber(L, scaledPoint.x); + lua_pushnumber(L, scaledPoint.y); + lua_pushnumber(L, normal.x); + lua_pushnumber(L, normal.y); + lua_pushnumber(L, fraction); + lua_call(L, 6, 1); + if (!lua_isnumber(L, -1)) + luaL_error(L, "Raycast callback didn't return a number!"); + return (float32)lua_tonumber(L, -1); + } + return 0; +} + +void World::SayGoodbye(b2Fixture *fixture) +{ + Fixture *f = (Fixture *)Memoizer::find(fixture); + // Hint implicit destruction with true. + if (f) f->destroy(true); +} + +void World::SayGoodbye(b2Joint *joint) +{ + Joint *j = (Joint *)Memoizer::find(joint); + // Hint implicit destruction with true. + if (j) j->destroyJoint(true); +} + +World::World() + : world(NULL), destructWorld(false) +{ + world = new b2World(b2Vec2(0,0)); + this->retain(); // The Box2D world holds a reference to this World. + world->SetAllowSleeping(true); + world->SetContactListener(this); + world->SetContactFilter(this); + world->SetDestructionListener(this); + b2BodyDef def; + groundBody = world->CreateBody(&def); + Memoizer::add(world, this); +} + +World::World(b2Vec2 gravity, bool sleep) + : world(NULL), destructWorld(false) +{ + world = new b2World(Physics::scaleDown(gravity)); + // The Box2D world holds a reference to this World. + this->retain(); + world->SetAllowSleeping(sleep); + world->SetContactListener(this); + world->SetContactFilter(this); + world->SetDestructionListener(this); + b2BodyDef def; + groundBody = world->CreateBody(&def); + Memoizer::add(world, this); +} + +World::~World() +{ +} + +void World::update(float dt) +{ + world->Step(dt, 8, 6); + + // Destroy all objects marked during the time step. + for (std::vector::iterator i = destructBodies.begin(); i < destructBodies.end(); i++) + { + Body *b = *i; + if (b->body != 0) b->destroy(); + // Release for reference in vector. + b->release(); + } + for (std::vector::iterator i = destructFixtures.begin(); i < destructFixtures.end(); i++) + { + Fixture *f = *i; + if (f->isValid()) f->destroy(); + // Release for reference in vector. + f->release(); + } + for (std::vector::iterator i = destructJoints.begin(); i < destructJoints.end(); i++) + { + Joint *j = *i; + if (j->isValid()) j->destroyJoint(); + // Release for reference in vector. + j->release(); + } + destructBodies.clear(); + destructFixtures.clear(); + destructJoints.clear(); + + if (destructWorld) + destroy(); +} + +void World::BeginContact(b2Contact *contact) +{ + begin.process(contact); +} + +void World::EndContact(b2Contact *contact) +{ + end.process(contact); +} + +void World::PreSolve(b2Contact *contact, const b2Manifold *oldManifold) +{ + B2_NOT_USED(oldManifold); // not sure what to do with this + presolve.process(contact); +} + +void World::PostSolve(b2Contact *contact, const b2ContactImpulse *impulse) +{ + postsolve.process(contact, impulse); +} + +bool World::ShouldCollide(b2Fixture *fixtureA, b2Fixture *fixtureB) +{ + // Fixtures should be memoized, if we created them + Fixture *a = (Fixture *)Memoizer::find(fixtureA); + if (!a) + throw love::Exception("A fixture has escaped Memoizer!"); + a->retain(); + Fixture *b = (Fixture *)Memoizer::find(fixtureB); + if (!b) + throw love::Exception("A fixture has escaped Memoizer!"); + b->retain(); + return filter.process(a, b); +} + +bool World::isValid() const +{ + return world != 0; +} + +int World::setCallbacks(lua_State *L) +{ + int n = lua_gettop(L); + luax_assert_argc(L, 1, 4); + + switch (n) + { + case 4: + if (postsolve.ref) + delete postsolve.ref; + postsolve.ref = luax_refif (L, LUA_TFUNCTION); + case 3: + if (presolve.ref) + delete presolve.ref; + presolve.ref = luax_refif (L, LUA_TFUNCTION); + case 2: + if (end.ref) + delete end.ref; + end.ref = luax_refif (L, LUA_TFUNCTION); + case 1: + if (begin.ref) + delete begin.ref; + begin.ref = luax_refif (L, LUA_TFUNCTION); + } + + return 0; +} + +int World::getCallbacks(lua_State *L) +{ + begin.ref ? begin.ref->push() : lua_pushnil(L); + end.ref ? end.ref->push() : lua_pushnil(L); + presolve.ref ? presolve.ref->push() : lua_pushnil(L); + postsolve.ref ? postsolve.ref->push() : lua_pushnil(L); + return 4; +} + +int World::setContactFilter(lua_State *L) +{ + luax_assert_argc(L, 1); + if (filter.ref) + delete filter.ref; + filter.ref = luax_refif (L, LUA_TFUNCTION); + return 0; +} + +int World::getContactFilter(lua_State *L) +{ + filter.ref ? filter.ref->push() : lua_pushnil(L); + return 1; +} + +void World::setGravity(float x, float y) +{ + world->SetGravity(Physics::scaleDown(b2Vec2(x, y))); +} + +int World::getGravity(lua_State *L) +{ + b2Vec2 v = Physics::scaleUp(world->GetGravity()); + lua_pushnumber(L, v.x); + lua_pushnumber(L, v.y); + return 2; +} + +void World::setAllowSleeping(bool allow) +{ + world->SetAllowSleeping(allow); +} + +bool World::getAllowSleeping() const +{ + return world->GetAllowSleeping(); +} + +bool World::isLocked() const +{ + return world->IsLocked(); +} + +int World::getBodyCount() const +{ + return world->GetBodyCount()-1; // ignore the ground body +} + +int World::getJointCount() const +{ + return world->GetJointCount(); +} + +int World::getContactCount() const +{ + return world->GetContactCount(); +} + +int World::getBodyList(lua_State *L) const +{ + lua_newtable(L); + b2Body *b = world->GetBodyList(); + int i = 1; + do + { + if (!b) + break; + if (b == groundBody) + continue; + Body *body = (Body *)Memoizer::find(b); + if (!body) + throw love::Exception("A body has escaped Memoizer!"); + body->retain(); + luax_newtype(L, "Body", PHYSICS_BODY_T, (void *)body); + lua_rawseti(L, -2, i); + i++; + } + while ((b = b->GetNext())); + return 1; +} + +int World::getJointList(lua_State *L) const +{ + lua_newtable(L); + b2Joint *j = world->GetJointList(); + int i = 1; + do + { + if (!j) break; + Joint *joint = (Joint *)Memoizer::find(j); + if (!joint) throw love::Exception("A joint has escaped Memoizer!"); + joint->retain(); + luax_newtype(L, "Joint", PHYSICS_JOINT_T, (void *)joint); + lua_rawseti(L, -2, i); + i++; + } + while ((j = j->GetNext())); + return 1; +} + +int World::getContactList(lua_State *L) const +{ + lua_newtable(L); + b2Contact *c = world->GetContactList(); + int i = 1; + do + { + if (!c) break; + Contact *contact = (Contact *)Memoizer::find(c); + if (!contact) throw love::Exception("A contact has escaped Memoizer!"); + contact->retain(); + luax_newtype(L, "Contact", PHYSICS_CONTACT_T, (void *)contact); + lua_rawseti(L, -2, i); + i++; + } + while ((c = c->GetNext())); + return 1; +} + +b2Body *World::getGroundBody() const +{ + return groundBody; +} + +int World::queryBoundingBox(lua_State *L) +{ + luax_assert_argc(L, 5); + b2AABB box; + float lx = (float)luaL_checknumber(L, 1); + float ly = (float)luaL_checknumber(L, 2); + float ux = (float)luaL_checknumber(L, 3); + float uy = (float)luaL_checknumber(L, 4); + box.lowerBound = Physics::scaleDown(b2Vec2(lx, ly)); + box.upperBound = Physics::scaleDown(b2Vec2(ux, uy)); + if (query.ref) delete query.ref; + query.ref = luax_refif (L, LUA_TFUNCTION); + world->QueryAABB(&query, box); + return 0; +} + +int World::rayCast(lua_State *L) +{ + luax_assert_argc(L, 5); + float x1 = (float)luaL_checknumber(L, 1); + float y1 = (float)luaL_checknumber(L, 2); + float x2 = (float)luaL_checknumber(L, 3); + float y2 = (float)luaL_checknumber(L, 4); + b2Vec2 v1 = Physics::scaleDown(b2Vec2(x1, y1)); + b2Vec2 v2 = Physics::scaleDown(b2Vec2(x2, y2)); + if (raycast.ref) + delete raycast.ref; + raycast.ref = luax_refif (L, LUA_TFUNCTION); + world->RayCast(&raycast, v1, v2); + return 0; +} + +void World::destroy() +{ + if (world->IsLocked()) + { + destructWorld = true; + return; + } + + // Cleaning up the world. + b2Body *b = world->GetBodyList(); + while (b) + { + b2Body *t = b; + b = b->GetNext(); + if (t == groundBody) + continue; + Body *body = (Body *)Memoizer::find(t); + if (!body) + throw love::Exception("A body has escaped Memoizer!"); + body->destroy(); + } + + world->DestroyBody(groundBody); + Memoizer::remove(world); + delete world; + world = 0; + + // Box2D world destroyed. Release its reference. + this->release(); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/World.h b/src/modules/physics/box2d/World.h index fae891ed8..5e44591d2 100644 --- a/src/modules/physics/box2d/World.h +++ b/src/modules/physics/box2d/World.h @@ -1,285 +1,285 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WORLD_H -#define LOVE_PHYSICS_BOX2D_WORLD_H - -// LOVE -#include "common/Object.h" -#include "common/runtime.h" -#include "common/Reference.h" - -// STD -#include - -// Box2D -#include - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -class Contact; -class Body; -class Fixture; -class Joint; - -/** - * The World is the "God" container class, - * which contains all Bodies and Joints. Shapes - * are contained in their associated Body. - * - * Bodies in different worlds can obviously not - * collide. - * - * The world also controls global parameters, like - * gravity. - **/ -class World : public Object, public b2ContactListener, public b2ContactFilter, public b2DestructionListener -{ -public: - - // Friends. - friend class Joint; - friend class DistanceJoint; - friend class MouseJoint; - friend class Body; - friend class Fixture; - - class ContactCallback - { - public: - Reference *ref; - ContactCallback(); - ~ContactCallback(); - void process(b2Contact *contact, const b2ContactImpulse *impulse = NULL); - }; - - class ContactFilter - { - public: - Reference *ref; - ContactFilter(); - ~ContactFilter(); - bool process(Fixture *a, Fixture *b); - }; - - class QueryCallback : public b2QueryCallback - { - public: - Reference *ref; - QueryCallback(); - ~QueryCallback(); - virtual bool ReportFixture(b2Fixture *fixture); - }; - - class RayCastCallback : public b2RayCastCallback - { - public: - Reference *ref; - RayCastCallback(); - ~RayCastCallback(); - virtual float32 ReportFixture(b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction); - }; - - /** - * Creates a new world. - **/ - World(); - - /** - * Creates a new world with the given gravity - * and whether or not the bodies should sleep when appropriate. - * @param gravity The gravity of the World. - * @param sleep True if the bodies should be able to sleep, - * false otherwise. - **/ - World(b2Vec2 gravity, bool sleep); - - virtual ~World(); - - /** - * Updates everything in the world one timestep. - * This is called update() and not step() to conform - * with all other objects in LOVE. - * @param dt The timestep. - **/ - void update(float dt); - - // From b2ContactListener - void BeginContact(b2Contact *contact); - void EndContact(b2Contact *contact); - void PreSolve(b2Contact *contact, const b2Manifold *oldManifold); - void PostSolve(b2Contact *contact, const b2ContactImpulse *impulse); - - // From b2ContactFilter - bool ShouldCollide(b2Fixture *fixtureA, b2Fixture *fixtureB); - - // From b2DestructionListener - void SayGoodbye(b2Fixture *fixture); - void SayGoodbye(b2Joint *joint); - - /** - * Returns true if the Box2D world is alive. - **/ - bool isValid() const; - - /** - * Receives up to four Lua functions as arguments. Each function is - * collision callback for the four events (in order): begin, end, - * presolve and postsolve. The value "nil" is accepted if one or - * more events are uninteresting. - **/ - int setCallbacks(lua_State *L); - - /** - * Returns the functions previously set by setCallbacks. - **/ - int getCallbacks(lua_State *L); - - /** - * Sets the ContactFilter callback. - **/ - int setContactFilter(lua_State *L); - - /** - * Gets the ContactFilter callback. - **/ - int getContactFilter(lua_State *L); - - /** - * Sets the current gravity of the World. - * @param x Gravity in the x-direction. - * @param y Gravity in the y-direction. - **/ - void setGravity(float x, float y); - - /** - * Gets the current gravity. - * @returns Gravity in the x-direction. - * @returns Gravity in the y-direction. - **/ - int getGravity(lua_State *L); - - /** - * Sets whether this World allows sleep. - * @param allow True to allow, false to disallow. - **/ - void setAllowSleeping(bool allow); - - /** - * Returns whether this World allows sleep. - * @return True if allowed, false if disallowed. - **/ - bool getAllowSleeping() const; - - /** - * Returns whether this World is currently locked. - * If it's locked, it's in the middle of a timestep. - * @return Whether the World is locked. - **/ - bool isLocked() const; - - /** - * Get the current body count. - * @return The number of bodies. - **/ - int getBodyCount() const; - - /** - * Get the current joint count. - * @return The number of joints. - **/ - int getJointCount() const; - - /** - * Get the current contact count. - * @return The number of contacts. - **/ - int getContactCount() const; - - /** - * Get an array of all the Bodies in the World. - * @return An array of Bodies. - **/ - int getBodyList(lua_State *L) const; - - /** - * Get an array of all the Joints in the World. - * @return An array of Joints. - **/ - int getJointList(lua_State *L) const; - - /** - * Get an array of all the Contacts in the World. - * @return An array of Contacts. - **/ - int getContactList(lua_State *L) const; - - /** - * Gets the ground body. - * @return The ground body. - **/ - b2Body *getGroundBody() const; - - /** - * Gets all fixtures that overlap a given bounding box. - **/ - int queryBoundingBox(lua_State *L); - - /** - * Raycasts the World for all Fixtures in the path of the ray. - **/ - int rayCast(lua_State *L); - - /** - * Destroy this world. - **/ - void destroy(); - -private: - - // Pointer to the Box2D world. - b2World *world; - - // Ground body - b2Body *groundBody; - - // The list of to be destructed bodies. - std::vector destructBodies; - std::vector destructFixtures; - std::vector destructJoints; - bool destructWorld; - - // Contact callbacks. - ContactCallback begin, end, presolve, postsolve; - ContactFilter filter; - QueryCallback query; - RayCastCallback raycast; -}; - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WORLD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WORLD_H +#define LOVE_PHYSICS_BOX2D_WORLD_H + +// LOVE +#include "common/Object.h" +#include "common/runtime.h" +#include "common/Reference.h" + +// STD +#include + +// Box2D +#include + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +class Contact; +class Body; +class Fixture; +class Joint; + +/** + * The World is the "God" container class, + * which contains all Bodies and Joints. Shapes + * are contained in their associated Body. + * + * Bodies in different worlds can obviously not + * collide. + * + * The world also controls global parameters, like + * gravity. + **/ +class World : public Object, public b2ContactListener, public b2ContactFilter, public b2DestructionListener +{ +public: + + // Friends. + friend class Joint; + friend class DistanceJoint; + friend class MouseJoint; + friend class Body; + friend class Fixture; + + class ContactCallback + { + public: + Reference *ref; + ContactCallback(); + ~ContactCallback(); + void process(b2Contact *contact, const b2ContactImpulse *impulse = NULL); + }; + + class ContactFilter + { + public: + Reference *ref; + ContactFilter(); + ~ContactFilter(); + bool process(Fixture *a, Fixture *b); + }; + + class QueryCallback : public b2QueryCallback + { + public: + Reference *ref; + QueryCallback(); + ~QueryCallback(); + virtual bool ReportFixture(b2Fixture *fixture); + }; + + class RayCastCallback : public b2RayCastCallback + { + public: + Reference *ref; + RayCastCallback(); + ~RayCastCallback(); + virtual float32 ReportFixture(b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction); + }; + + /** + * Creates a new world. + **/ + World(); + + /** + * Creates a new world with the given gravity + * and whether or not the bodies should sleep when appropriate. + * @param gravity The gravity of the World. + * @param sleep True if the bodies should be able to sleep, + * false otherwise. + **/ + World(b2Vec2 gravity, bool sleep); + + virtual ~World(); + + /** + * Updates everything in the world one timestep. + * This is called update() and not step() to conform + * with all other objects in LOVE. + * @param dt The timestep. + **/ + void update(float dt); + + // From b2ContactListener + void BeginContact(b2Contact *contact); + void EndContact(b2Contact *contact); + void PreSolve(b2Contact *contact, const b2Manifold *oldManifold); + void PostSolve(b2Contact *contact, const b2ContactImpulse *impulse); + + // From b2ContactFilter + bool ShouldCollide(b2Fixture *fixtureA, b2Fixture *fixtureB); + + // From b2DestructionListener + void SayGoodbye(b2Fixture *fixture); + void SayGoodbye(b2Joint *joint); + + /** + * Returns true if the Box2D world is alive. + **/ + bool isValid() const; + + /** + * Receives up to four Lua functions as arguments. Each function is + * collision callback for the four events (in order): begin, end, + * presolve and postsolve. The value "nil" is accepted if one or + * more events are uninteresting. + **/ + int setCallbacks(lua_State *L); + + /** + * Returns the functions previously set by setCallbacks. + **/ + int getCallbacks(lua_State *L); + + /** + * Sets the ContactFilter callback. + **/ + int setContactFilter(lua_State *L); + + /** + * Gets the ContactFilter callback. + **/ + int getContactFilter(lua_State *L); + + /** + * Sets the current gravity of the World. + * @param x Gravity in the x-direction. + * @param y Gravity in the y-direction. + **/ + void setGravity(float x, float y); + + /** + * Gets the current gravity. + * @returns Gravity in the x-direction. + * @returns Gravity in the y-direction. + **/ + int getGravity(lua_State *L); + + /** + * Sets whether this World allows sleep. + * @param allow True to allow, false to disallow. + **/ + void setAllowSleeping(bool allow); + + /** + * Returns whether this World allows sleep. + * @return True if allowed, false if disallowed. + **/ + bool getAllowSleeping() const; + + /** + * Returns whether this World is currently locked. + * If it's locked, it's in the middle of a timestep. + * @return Whether the World is locked. + **/ + bool isLocked() const; + + /** + * Get the current body count. + * @return The number of bodies. + **/ + int getBodyCount() const; + + /** + * Get the current joint count. + * @return The number of joints. + **/ + int getJointCount() const; + + /** + * Get the current contact count. + * @return The number of contacts. + **/ + int getContactCount() const; + + /** + * Get an array of all the Bodies in the World. + * @return An array of Bodies. + **/ + int getBodyList(lua_State *L) const; + + /** + * Get an array of all the Joints in the World. + * @return An array of Joints. + **/ + int getJointList(lua_State *L) const; + + /** + * Get an array of all the Contacts in the World. + * @return An array of Contacts. + **/ + int getContactList(lua_State *L) const; + + /** + * Gets the ground body. + * @return The ground body. + **/ + b2Body *getGroundBody() const; + + /** + * Gets all fixtures that overlap a given bounding box. + **/ + int queryBoundingBox(lua_State *L); + + /** + * Raycasts the World for all Fixtures in the path of the ray. + **/ + int rayCast(lua_State *L); + + /** + * Destroy this world. + **/ + void destroy(); + +private: + + // Pointer to the Box2D world. + b2World *world; + + // Ground body + b2Body *groundBody; + + // The list of to be destructed bodies. + std::vector destructBodies; + std::vector destructFixtures; + std::vector destructJoints; + bool destructWorld; + + // Contact callbacks. + ContactCallback begin, end, presolve, postsolve; + ContactFilter filter; + QueryCallback query; + RayCastCallback raycast; +}; + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WORLD_H diff --git a/src/modules/physics/box2d/wrap_Body.cpp b/src/modules/physics/box2d/wrap_Body.cpp index e3304fc94..bdc2b78df 100644 --- a/src/modules/physics/box2d/wrap_Body.cpp +++ b/src/modules/physics/box2d/wrap_Body.cpp @@ -1,601 +1,601 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Body.h" -#include "wrap_Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Body *luax_checkbody(lua_State *L, int idx) -{ - Body *b = luax_checktype(L, idx, "Body", PHYSICS_BODY_T); - if (b->body == 0) - luaL_error(L, "Attempt to use destroyed body."); - return b; -} - -int w_Body_getX(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getX()); - return 1; -} - -int w_Body_getY(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getY()); - return 1; -} - -int w_Body_getAngle(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getAngle()); - return 1; -} - -int w_Body_getPosition(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x_o, y_o; - t->getPosition(x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getLinearVelocity(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x_o, y_o; - t->getLinearVelocity(x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getWorldCenter(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x_o, y_o; - t->getWorldCenter(x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getLocalCenter(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x_o, y_o; - t->getLocalCenter(x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getAngularVelocity(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getAngularVelocity()); - return 1; -} - -int w_Body_getMass(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getMass()); - return 1; -} - -int w_Body_getInertia(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getInertia()); - return 1; -} - -int w_Body_getMassData(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_remove(L, 1); - return t->getMassData(L); -} - -int w_Body_getAngularDamping(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getAngularDamping()); - return 1; -} - -int w_Body_getLinearDamping(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getLinearDamping()); - return 1; -} - -int w_Body_getGravityScale(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushnumber(L, t->getGravityScale()); - return 1; -} - -int w_Body_getType(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - const char *type = ""; - Body::getConstant(t->getType(), type); - lua_pushstring(L, type); - return 1; -} - -int w_Body_applyLinearImpulse(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float jx = (float)luaL_checknumber(L, 2); - float jy = (float)luaL_checknumber(L, 3); - - if (lua_gettop(L) == 3) - { - t->applyLinearImpulse(jx, jy); - } - else if (lua_gettop(L) == 5) - { - float rx = (float)luaL_checknumber(L, 4); - float ry = (float)luaL_checknumber(L, 5); - t->applyLinearImpulse(jx, jy, rx, ry); - } - else - { - return luaL_error(L, "Wrong number of parameters."); - } - - return 0; -} - -int w_Body_applyAngularImpulse(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float i = (float)luaL_checknumber(L, 2); - t->applyAngularImpulse(i); - return 0; -} - -int w_Body_applyTorque(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg = (float)luaL_checknumber(L, 2); - t->applyTorque(arg); - return 0; -} - -int w_Body_applyForce(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float fx = (float)luaL_checknumber(L, 2); - float fy = (float)luaL_checknumber(L, 3); - - - if (lua_gettop(L) == 3) - { - t->applyForce(fx, fy); - } - else if (lua_gettop(L) == 5) - { - float rx = (float)luaL_checknumber(L, 4); - float ry = (float)luaL_checknumber(L, 5); - t->applyForce(fx, fy, rx, ry); - } - else - { - return luaL_error(L, "Wrong number of parameters."); - } - - return 0; -} - -int w_Body_setX(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setX(arg1); - return 0; -} - -int w_Body_setY(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setY(arg1); - return 0; -} - -int w_Body_setLinearVelocity(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_checknumber(L, 3); - t->setLinearVelocity(arg1, arg2); - return 0; -} - -int w_Body_setAngle(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setAngle(arg1); - return 0; -} - -int w_Body_setAngularVelocity(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setAngularVelocity(arg1); - return 0; -} - -int w_Body_setPosition(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_checknumber(L, 3); - t->setPosition(arg1, arg2); - return 0; -} - -int w_Body_resetMassData(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - t->resetMassData(); - return 0; -} - -int w_Body_setMassData(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float m = (float)luaL_checknumber(L, 4); - float i = (float)luaL_checknumber(L, 5); - ASSERT_GUARD(t->setMassData(x, y, m, i);) - return 0; -} - -int w_Body_setMass(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float m = (float)luaL_checknumber(L, 2); - t->setMass(m); - return 0; -} - -int w_Body_setInertia(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float i = (float)luaL_checknumber(L, 2); - t->setInertia(i); - return 0; -} - -int w_Body_setAngularDamping(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setAngularDamping(arg1); - return 0; -} - -int w_Body_setLinearDamping(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setLinearDamping(arg1); - return 0; -} - -int w_Body_setGravityScale(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setGravityScale(arg1); - return 0; -} - -int w_Body_setType(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - const char *typeStr = luaL_checkstring(L, 2); - Body::Type type; - Body::getConstant(typeStr, type); - t->setType(type); - return 0; -} - -int w_Body_getWorldPoint(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float x_o, y_o; - t->getWorldPoint(x, y, x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getWorldVector(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float x_o, y_o; - t->getWorldVector(x, y, x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getWorldPoints(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_remove(L, 1); - return t->getWorldPoints(L); -} - -int w_Body_getLocalPoint(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float x_o, y_o; - t->getLocalPoint(x, y, x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getLocalVector(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float x_o, y_o; - t->getLocalVector(x, y, x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getLinearVelocityFromWorldPoint(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float x_o, y_o; - t->getLinearVelocityFromWorldPoint(x, y, x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_getLinearVelocityFromLocalPoint(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float x_o, y_o; - t->getLinearVelocityFromLocalPoint(x, y, x_o, y_o); - lua_pushnumber(L, x_o); - lua_pushnumber(L, y_o); - - return 2; -} - -int w_Body_isBullet(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - luax_pushboolean(L, t->isBullet()); - return 1; -} - -int w_Body_setBullet(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - bool b = luax_toboolean(L, 2); - t->setBullet(b); - return 0; -} - -int w_Body_isActive(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - luax_pushboolean(L, t->isActive()); - return 1; -} - -int w_Body_isAwake(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - luax_pushboolean(L, t->isAwake()); - return 1; -} - -int w_Body_setSleepingAllowed(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - bool b = luax_toboolean(L, 2); - t->setSleepingAllowed(b); - return 0; -} - -int w_Body_isSleepingAllowed(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_pushboolean(L, t->isSleepingAllowed()); - return 1; -} - -int w_Body_setActive(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - bool b = luax_toboolean(L, 2); - t->setActive(b); - return 0; -} - -int w_Body_setAwake(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - bool b = luax_toboolean(L, 2); - t->setAwake(b); - return 0; -} - -int w_Body_setFixedRotation(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - bool b = luax_toboolean(L, 2); - t->setFixedRotation(b); - return 0; -} - -int w_Body_isFixedRotation(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - bool b = t->isFixedRotation(); - luax_pushboolean(L, b); - return 1; -} - -int w_Body_getFixtureList(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - lua_remove(L, 1); - return t->getFixtureList(L); -} - -int w_Body_destroy(lua_State *L) -{ - Body *t = luax_checkbody(L, 1); - try - { - t->destroy(); - } - catch(love::Exception &e) - { - luaL_error(L, "%s", e.what()); - } - return 0; -} - -static const luaL_Reg functions[] = -{ - { "getX", w_Body_getX }, - { "getY", w_Body_getY }, - { "getAngle", w_Body_getAngle }, - { "getPosition", w_Body_getPosition }, - { "getLinearVelocity", w_Body_getLinearVelocity }, - { "getWorldCenter", w_Body_getWorldCenter }, - { "getLocalCenter", w_Body_getLocalCenter }, - { "getAngularVelocity", w_Body_getAngularVelocity }, - { "getMass", w_Body_getMass }, - { "getInertia", w_Body_getInertia }, - { "getMassData", w_Body_getMassData }, - { "getAngularDamping", w_Body_getAngularDamping }, - { "getLinearDamping", w_Body_getLinearDamping }, - { "getGravityScale", w_Body_getGravityScale }, - { "getType", w_Body_getType }, - { "applyLinearImpulse", w_Body_applyLinearImpulse }, - { "applyAngularImpulse", w_Body_applyAngularImpulse }, - { "applyTorque", w_Body_applyTorque }, - { "applyForce", w_Body_applyForce }, - { "setX", w_Body_setX }, - { "setY", w_Body_setY }, - { "setLinearVelocity", w_Body_setLinearVelocity }, - { "setAngle", w_Body_setAngle }, - { "setAngularVelocity", w_Body_setAngularVelocity }, - { "setPosition", w_Body_setPosition }, - { "resetMassData", w_Body_resetMassData }, - { "setMassData", w_Body_setMassData }, - { "setMass", w_Body_setMass }, - { "setInertia", w_Body_setInertia }, - { "setAngularDamping", w_Body_setAngularDamping }, - { "setLinearDamping", w_Body_setLinearDamping }, - { "setGravityScale", w_Body_setGravityScale }, - { "setType", w_Body_setType }, - { "getWorldPoint", w_Body_getWorldPoint }, - { "getWorldVector", w_Body_getWorldVector }, - { "getWorldPoints", w_Body_getWorldPoints }, - { "getLocalPoint", w_Body_getLocalPoint }, - { "getLocalVector", w_Body_getLocalVector }, - { "getLinearVelocityFromWorldPoint", w_Body_getLinearVelocityFromWorldPoint }, - { "getLinearVelocityFromLocalPoint", w_Body_getLinearVelocityFromLocalPoint }, - { "isBullet", w_Body_isBullet }, - { "setBullet", w_Body_setBullet }, - { "isActive", w_Body_isActive }, - { "isAwake", w_Body_isAwake }, - { "setSleepingAllowed", w_Body_setSleepingAllowed }, - { "isSleepingAllowed", w_Body_isSleepingAllowed }, - { "setActive", w_Body_setActive }, - { "setAwake", w_Body_setAwake }, - { "setFixedRotation", w_Body_setFixedRotation }, - { "isFixedRotation", w_Body_isFixedRotation }, - { "getFixtureList", w_Body_getFixtureList }, - { "destroy", w_Body_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_body(lua_State *L) -{ - return luax_register_type(L, "Body", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Body.h" +#include "wrap_Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Body *luax_checkbody(lua_State *L, int idx) +{ + Body *b = luax_checktype(L, idx, "Body", PHYSICS_BODY_T); + if (b->body == 0) + luaL_error(L, "Attempt to use destroyed body."); + return b; +} + +int w_Body_getX(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getX()); + return 1; +} + +int w_Body_getY(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getY()); + return 1; +} + +int w_Body_getAngle(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getAngle()); + return 1; +} + +int w_Body_getPosition(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x_o, y_o; + t->getPosition(x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getLinearVelocity(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x_o, y_o; + t->getLinearVelocity(x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getWorldCenter(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x_o, y_o; + t->getWorldCenter(x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getLocalCenter(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x_o, y_o; + t->getLocalCenter(x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getAngularVelocity(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getAngularVelocity()); + return 1; +} + +int w_Body_getMass(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getMass()); + return 1; +} + +int w_Body_getInertia(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getInertia()); + return 1; +} + +int w_Body_getMassData(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_remove(L, 1); + return t->getMassData(L); +} + +int w_Body_getAngularDamping(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getAngularDamping()); + return 1; +} + +int w_Body_getLinearDamping(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getLinearDamping()); + return 1; +} + +int w_Body_getGravityScale(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushnumber(L, t->getGravityScale()); + return 1; +} + +int w_Body_getType(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + const char *type = ""; + Body::getConstant(t->getType(), type); + lua_pushstring(L, type); + return 1; +} + +int w_Body_applyLinearImpulse(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float jx = (float)luaL_checknumber(L, 2); + float jy = (float)luaL_checknumber(L, 3); + + if (lua_gettop(L) == 3) + { + t->applyLinearImpulse(jx, jy); + } + else if (lua_gettop(L) == 5) + { + float rx = (float)luaL_checknumber(L, 4); + float ry = (float)luaL_checknumber(L, 5); + t->applyLinearImpulse(jx, jy, rx, ry); + } + else + { + return luaL_error(L, "Wrong number of parameters."); + } + + return 0; +} + +int w_Body_applyAngularImpulse(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float i = (float)luaL_checknumber(L, 2); + t->applyAngularImpulse(i); + return 0; +} + +int w_Body_applyTorque(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg = (float)luaL_checknumber(L, 2); + t->applyTorque(arg); + return 0; +} + +int w_Body_applyForce(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float fx = (float)luaL_checknumber(L, 2); + float fy = (float)luaL_checknumber(L, 3); + + + if (lua_gettop(L) == 3) + { + t->applyForce(fx, fy); + } + else if (lua_gettop(L) == 5) + { + float rx = (float)luaL_checknumber(L, 4); + float ry = (float)luaL_checknumber(L, 5); + t->applyForce(fx, fy, rx, ry); + } + else + { + return luaL_error(L, "Wrong number of parameters."); + } + + return 0; +} + +int w_Body_setX(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setX(arg1); + return 0; +} + +int w_Body_setY(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setY(arg1); + return 0; +} + +int w_Body_setLinearVelocity(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_checknumber(L, 3); + t->setLinearVelocity(arg1, arg2); + return 0; +} + +int w_Body_setAngle(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setAngle(arg1); + return 0; +} + +int w_Body_setAngularVelocity(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setAngularVelocity(arg1); + return 0; +} + +int w_Body_setPosition(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_checknumber(L, 3); + t->setPosition(arg1, arg2); + return 0; +} + +int w_Body_resetMassData(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + t->resetMassData(); + return 0; +} + +int w_Body_setMassData(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float m = (float)luaL_checknumber(L, 4); + float i = (float)luaL_checknumber(L, 5); + ASSERT_GUARD(t->setMassData(x, y, m, i);) + return 0; +} + +int w_Body_setMass(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float m = (float)luaL_checknumber(L, 2); + t->setMass(m); + return 0; +} + +int w_Body_setInertia(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float i = (float)luaL_checknumber(L, 2); + t->setInertia(i); + return 0; +} + +int w_Body_setAngularDamping(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setAngularDamping(arg1); + return 0; +} + +int w_Body_setLinearDamping(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setLinearDamping(arg1); + return 0; +} + +int w_Body_setGravityScale(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setGravityScale(arg1); + return 0; +} + +int w_Body_setType(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + const char *typeStr = luaL_checkstring(L, 2); + Body::Type type; + Body::getConstant(typeStr, type); + t->setType(type); + return 0; +} + +int w_Body_getWorldPoint(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float x_o, y_o; + t->getWorldPoint(x, y, x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getWorldVector(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float x_o, y_o; + t->getWorldVector(x, y, x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getWorldPoints(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_remove(L, 1); + return t->getWorldPoints(L); +} + +int w_Body_getLocalPoint(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float x_o, y_o; + t->getLocalPoint(x, y, x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getLocalVector(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float x_o, y_o; + t->getLocalVector(x, y, x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getLinearVelocityFromWorldPoint(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float x_o, y_o; + t->getLinearVelocityFromWorldPoint(x, y, x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_getLinearVelocityFromLocalPoint(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float x_o, y_o; + t->getLinearVelocityFromLocalPoint(x, y, x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + + return 2; +} + +int w_Body_isBullet(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + luax_pushboolean(L, t->isBullet()); + return 1; +} + +int w_Body_setBullet(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + bool b = luax_toboolean(L, 2); + t->setBullet(b); + return 0; +} + +int w_Body_isActive(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + luax_pushboolean(L, t->isActive()); + return 1; +} + +int w_Body_isAwake(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + luax_pushboolean(L, t->isAwake()); + return 1; +} + +int w_Body_setSleepingAllowed(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + bool b = luax_toboolean(L, 2); + t->setSleepingAllowed(b); + return 0; +} + +int w_Body_isSleepingAllowed(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_pushboolean(L, t->isSleepingAllowed()); + return 1; +} + +int w_Body_setActive(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + bool b = luax_toboolean(L, 2); + t->setActive(b); + return 0; +} + +int w_Body_setAwake(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + bool b = luax_toboolean(L, 2); + t->setAwake(b); + return 0; +} + +int w_Body_setFixedRotation(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + bool b = luax_toboolean(L, 2); + t->setFixedRotation(b); + return 0; +} + +int w_Body_isFixedRotation(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + bool b = t->isFixedRotation(); + luax_pushboolean(L, b); + return 1; +} + +int w_Body_getFixtureList(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + lua_remove(L, 1); + return t->getFixtureList(L); +} + +int w_Body_destroy(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + try + { + t->destroy(); + } + catch(love::Exception &e) + { + luaL_error(L, "%s", e.what()); + } + return 0; +} + +static const luaL_Reg functions[] = +{ + { "getX", w_Body_getX }, + { "getY", w_Body_getY }, + { "getAngle", w_Body_getAngle }, + { "getPosition", w_Body_getPosition }, + { "getLinearVelocity", w_Body_getLinearVelocity }, + { "getWorldCenter", w_Body_getWorldCenter }, + { "getLocalCenter", w_Body_getLocalCenter }, + { "getAngularVelocity", w_Body_getAngularVelocity }, + { "getMass", w_Body_getMass }, + { "getInertia", w_Body_getInertia }, + { "getMassData", w_Body_getMassData }, + { "getAngularDamping", w_Body_getAngularDamping }, + { "getLinearDamping", w_Body_getLinearDamping }, + { "getGravityScale", w_Body_getGravityScale }, + { "getType", w_Body_getType }, + { "applyLinearImpulse", w_Body_applyLinearImpulse }, + { "applyAngularImpulse", w_Body_applyAngularImpulse }, + { "applyTorque", w_Body_applyTorque }, + { "applyForce", w_Body_applyForce }, + { "setX", w_Body_setX }, + { "setY", w_Body_setY }, + { "setLinearVelocity", w_Body_setLinearVelocity }, + { "setAngle", w_Body_setAngle }, + { "setAngularVelocity", w_Body_setAngularVelocity }, + { "setPosition", w_Body_setPosition }, + { "resetMassData", w_Body_resetMassData }, + { "setMassData", w_Body_setMassData }, + { "setMass", w_Body_setMass }, + { "setInertia", w_Body_setInertia }, + { "setAngularDamping", w_Body_setAngularDamping }, + { "setLinearDamping", w_Body_setLinearDamping }, + { "setGravityScale", w_Body_setGravityScale }, + { "setType", w_Body_setType }, + { "getWorldPoint", w_Body_getWorldPoint }, + { "getWorldVector", w_Body_getWorldVector }, + { "getWorldPoints", w_Body_getWorldPoints }, + { "getLocalPoint", w_Body_getLocalPoint }, + { "getLocalVector", w_Body_getLocalVector }, + { "getLinearVelocityFromWorldPoint", w_Body_getLinearVelocityFromWorldPoint }, + { "getLinearVelocityFromLocalPoint", w_Body_getLinearVelocityFromLocalPoint }, + { "isBullet", w_Body_isBullet }, + { "setBullet", w_Body_setBullet }, + { "isActive", w_Body_isActive }, + { "isAwake", w_Body_isAwake }, + { "setSleepingAllowed", w_Body_setSleepingAllowed }, + { "isSleepingAllowed", w_Body_isSleepingAllowed }, + { "setActive", w_Body_setActive }, + { "setAwake", w_Body_setAwake }, + { "setFixedRotation", w_Body_setFixedRotation }, + { "isFixedRotation", w_Body_isFixedRotation }, + { "getFixtureList", w_Body_getFixtureList }, + { "destroy", w_Body_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_body(lua_State *L) +{ + return luax_register_type(L, "Body", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_Body.h b/src/modules/physics/box2d/wrap_Body.h index 833e57296..d11f7daba 100644 --- a/src/modules/physics/box2d/wrap_Body.h +++ b/src/modules/physics/box2d/wrap_Body.h @@ -1,94 +1,94 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_BODY_H -#define LOVE_PHYSICS_BOX2D_WRAP_BODY_H - -// LOVE -#include "common/runtime.h" -#include "Body.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Body *luax_checkbody(lua_State *L, int idx); -int w_Body_getX(lua_State *L); -int w_Body_getY(lua_State *L); -int w_Body_getAngle(lua_State *L); -int w_Body_getPosition(lua_State *L); -int w_Body_getLinearVelocity(lua_State *L); -int w_Body_getWorldCenter(lua_State *L); -int w_Body_getLocalCenter(lua_State *L); -int w_Body_getAngularVelocity(lua_State *L); -int w_Body_getMass(lua_State *L); -int w_Body_getInertia(lua_State *L); -int w_Body_getMassData(lua_State *L); -int w_Body_getAngularDamping(lua_State *L); -int w_Body_getLinearDamping(lua_State *L); -int w_Body_getGravityScale(lua_State *L); -int w_Body_getType(lua_State *L); -int w_Body_applyLinearImpulse(lua_State *L); -int w_Body_applyAngularImpulse(lua_State *L); -int w_Body_applyTorque(lua_State *L); -int w_Body_applyForce(lua_State *L); -int w_Body_setX(lua_State *L); -int w_Body_setY(lua_State *L); -int w_Body_setLinearVelocity(lua_State *L); -int w_Body_setAngle(lua_State *L); -int w_Body_setAngularVelocity(lua_State *L); -int w_Body_setPosition(lua_State *L); -int w_Body_resetMassData(lua_State *L); -int w_Body_setMassData(lua_State *L); -int w_Body_setMass(lua_State *L); -int w_Body_setInertia(lua_State *L); -int w_Body_setAngularDamping(lua_State *L); -int w_Body_setLinearDamping(lua_State *L); -int w_Body_setGravityScale(lua_State *L); -int w_Body_setType(lua_State *L); -int w_Body_getWorldPoint(lua_State *L); -int w_Body_getWorldVector(lua_State *L); -int w_Body_getWorldPoints(lua_State *L); -int w_Body_getLocalPoint(lua_State *L); -int w_Body_getLocalVector(lua_State *L); -int w_Body_getLinearVelocityFromWorldPoint(lua_State *L); -int w_Body_getLinearVelocityFromLocalPoint(lua_State *L); -int w_Body_isBullet(lua_State *L); -int w_Body_setBullet(lua_State *L); -int w_Body_isActive(lua_State *L); -int w_Body_isAwake(lua_State *L); -int w_Body_setSleepingAllowed(lua_State *L); -int w_Body_isSleepingAllowed(lua_State *L); -int w_Body_setActive(lua_State *L); -int w_Body_setAwake(lua_State *L); -int w_Body_setFixedRotation(lua_State *L); -int w_Body_isFixedRotation(lua_State *L); -int w_Body_getFixtureList(lua_State *L); -int w_Body_destroy(lua_State *L); -extern "C" int luaopen_body(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_BODY_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_BODY_H +#define LOVE_PHYSICS_BOX2D_WRAP_BODY_H + +// LOVE +#include "common/runtime.h" +#include "Body.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Body *luax_checkbody(lua_State *L, int idx); +int w_Body_getX(lua_State *L); +int w_Body_getY(lua_State *L); +int w_Body_getAngle(lua_State *L); +int w_Body_getPosition(lua_State *L); +int w_Body_getLinearVelocity(lua_State *L); +int w_Body_getWorldCenter(lua_State *L); +int w_Body_getLocalCenter(lua_State *L); +int w_Body_getAngularVelocity(lua_State *L); +int w_Body_getMass(lua_State *L); +int w_Body_getInertia(lua_State *L); +int w_Body_getMassData(lua_State *L); +int w_Body_getAngularDamping(lua_State *L); +int w_Body_getLinearDamping(lua_State *L); +int w_Body_getGravityScale(lua_State *L); +int w_Body_getType(lua_State *L); +int w_Body_applyLinearImpulse(lua_State *L); +int w_Body_applyAngularImpulse(lua_State *L); +int w_Body_applyTorque(lua_State *L); +int w_Body_applyForce(lua_State *L); +int w_Body_setX(lua_State *L); +int w_Body_setY(lua_State *L); +int w_Body_setLinearVelocity(lua_State *L); +int w_Body_setAngle(lua_State *L); +int w_Body_setAngularVelocity(lua_State *L); +int w_Body_setPosition(lua_State *L); +int w_Body_resetMassData(lua_State *L); +int w_Body_setMassData(lua_State *L); +int w_Body_setMass(lua_State *L); +int w_Body_setInertia(lua_State *L); +int w_Body_setAngularDamping(lua_State *L); +int w_Body_setLinearDamping(lua_State *L); +int w_Body_setGravityScale(lua_State *L); +int w_Body_setType(lua_State *L); +int w_Body_getWorldPoint(lua_State *L); +int w_Body_getWorldVector(lua_State *L); +int w_Body_getWorldPoints(lua_State *L); +int w_Body_getLocalPoint(lua_State *L); +int w_Body_getLocalVector(lua_State *L); +int w_Body_getLinearVelocityFromWorldPoint(lua_State *L); +int w_Body_getLinearVelocityFromLocalPoint(lua_State *L); +int w_Body_isBullet(lua_State *L); +int w_Body_setBullet(lua_State *L); +int w_Body_isActive(lua_State *L); +int w_Body_isAwake(lua_State *L); +int w_Body_setSleepingAllowed(lua_State *L); +int w_Body_isSleepingAllowed(lua_State *L); +int w_Body_setActive(lua_State *L); +int w_Body_setAwake(lua_State *L); +int w_Body_setFixedRotation(lua_State *L); +int w_Body_isFixedRotation(lua_State *L); +int w_Body_getFixtureList(lua_State *L); +int w_Body_destroy(lua_State *L); +extern "C" int luaopen_body(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_BODY_H diff --git a/src/modules/physics/box2d/wrap_ChainShape.cpp b/src/modules/physics/box2d/wrap_ChainShape.cpp index 1390f6d34..0a682e80e 100644 --- a/src/modules/physics/box2d/wrap_ChainShape.cpp +++ b/src/modules/physics/box2d/wrap_ChainShape.cpp @@ -1,131 +1,131 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_ChainShape.h" -#include "wrap_Physics.h" -#include "Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -ChainShape *luax_checkchainshape(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "ChainShape", PHYSICS_CHAIN_SHAPE_T); -} - -int w_ChainShape_setNextVertex(lua_State *L) -{ - ChainShape *c = luax_checkchainshape(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - c->setNextVertex(x, y); - return 0; -} - -int w_ChainShape_setPrevVertex(lua_State *L) -{ - ChainShape *c = luax_checkchainshape(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - c->setPrevVertex(x, y); - return 0; -} - -int w_ChainShape_getChildCount(lua_State *L) -{ - ChainShape *c = luax_checkchainshape(L, 1); - lua_pushinteger(L, c->getChildCount()); - return 1; -} - -int w_ChainShape_getChildEdge(lua_State *L) -{ - ChainShape *c = luax_checkchainshape(L, 1); - int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index - EdgeShape *e = c->getChildEdge(index); - luax_newtype(L, "EdgeShape", PHYSICS_EDGE_SHAPE_T, e); - return 1; -} - -int w_ChainShape_getVertexCount(lua_State *L) -{ - ChainShape *c = luax_checkchainshape(L, 1); - int count = c->getVertexCount(); - lua_pushinteger(L, count); - return 1; -} - -int w_ChainShape_getPoint(lua_State *L) -{ - ChainShape *c = luax_checkchainshape(L, 1); - int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index - b2Vec2 v; - ASSERT_GUARD(v = c->getPoint(index);) - lua_pushnumber(L, v.x); - lua_pushnumber(L, v.y); - return 2; -} - -int w_ChainShape_getPoints(lua_State *L) -{ - ChainShape *c = luax_checkchainshape(L, 1); - const b2Vec2 *verts = c->getPoints(); - int count = c->getVertexCount(); - for (int i = 0; i < count; i++) - { - b2Vec2 v = Physics::scaleUp(verts[i]); - lua_pushnumber(L, v.x); - lua_pushnumber(L, v.y); - } - return count*2; -} - -static const luaL_Reg functions[] = -{ - { "setNextVertex", w_ChainShape_setNextVertex }, - { "setPrevVertex", w_ChainShape_setPrevVertex }, - { "getChildCount", w_ChainShape_getChildCount }, - { "getChildEdge", w_ChainShape_getChildEdge }, - { "getVertexCount", w_ChainShape_getVertexCount }, - { "getPoint", w_ChainShape_getPoint }, - { "getPoints", w_ChainShape_getPoints }, - // From Shape. - { "getType", w_Shape_getType }, - { "getRadius", w_Shape_getRadius }, - { "getChildCount", w_Shape_getChildCount }, - { "testPoint", w_Shape_testPoint }, - { "rayCast", w_Shape_rayCast }, - { "computeAABB", w_Shape_computeAABB }, - { "computeMass", w_Shape_computeMass }, - { 0, 0 } -}; - -extern "C" int luaopen_chainshape(lua_State *L) -{ - return luax_register_type(L, "ChainShape", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_ChainShape.h" +#include "wrap_Physics.h" +#include "Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +ChainShape *luax_checkchainshape(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "ChainShape", PHYSICS_CHAIN_SHAPE_T); +} + +int w_ChainShape_setNextVertex(lua_State *L) +{ + ChainShape *c = luax_checkchainshape(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + c->setNextVertex(x, y); + return 0; +} + +int w_ChainShape_setPrevVertex(lua_State *L) +{ + ChainShape *c = luax_checkchainshape(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + c->setPrevVertex(x, y); + return 0; +} + +int w_ChainShape_getChildCount(lua_State *L) +{ + ChainShape *c = luax_checkchainshape(L, 1); + lua_pushinteger(L, c->getChildCount()); + return 1; +} + +int w_ChainShape_getChildEdge(lua_State *L) +{ + ChainShape *c = luax_checkchainshape(L, 1); + int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index + EdgeShape *e = c->getChildEdge(index); + luax_newtype(L, "EdgeShape", PHYSICS_EDGE_SHAPE_T, e); + return 1; +} + +int w_ChainShape_getVertexCount(lua_State *L) +{ + ChainShape *c = luax_checkchainshape(L, 1); + int count = c->getVertexCount(); + lua_pushinteger(L, count); + return 1; +} + +int w_ChainShape_getPoint(lua_State *L) +{ + ChainShape *c = luax_checkchainshape(L, 1); + int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index + b2Vec2 v; + ASSERT_GUARD(v = c->getPoint(index);) + lua_pushnumber(L, v.x); + lua_pushnumber(L, v.y); + return 2; +} + +int w_ChainShape_getPoints(lua_State *L) +{ + ChainShape *c = luax_checkchainshape(L, 1); + const b2Vec2 *verts = c->getPoints(); + int count = c->getVertexCount(); + for (int i = 0; i < count; i++) + { + b2Vec2 v = Physics::scaleUp(verts[i]); + lua_pushnumber(L, v.x); + lua_pushnumber(L, v.y); + } + return count*2; +} + +static const luaL_Reg functions[] = +{ + { "setNextVertex", w_ChainShape_setNextVertex }, + { "setPrevVertex", w_ChainShape_setPrevVertex }, + { "getChildCount", w_ChainShape_getChildCount }, + { "getChildEdge", w_ChainShape_getChildEdge }, + { "getVertexCount", w_ChainShape_getVertexCount }, + { "getPoint", w_ChainShape_getPoint }, + { "getPoints", w_ChainShape_getPoints }, + // From Shape. + { "getType", w_Shape_getType }, + { "getRadius", w_Shape_getRadius }, + { "getChildCount", w_Shape_getChildCount }, + { "testPoint", w_Shape_testPoint }, + { "rayCast", w_Shape_rayCast }, + { "computeAABB", w_Shape_computeAABB }, + { "computeMass", w_Shape_computeMass }, + { 0, 0 } +}; + +extern "C" int luaopen_chainshape(lua_State *L) +{ + return luax_register_type(L, "ChainShape", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_ChainShape.h b/src/modules/physics/box2d/wrap_ChainShape.h index 907a28c4b..6e03c2c60 100644 --- a/src/modules/physics/box2d/wrap_ChainShape.h +++ b/src/modules/physics/box2d/wrap_ChainShape.h @@ -1,52 +1,52 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_CHAIN_SHAPE_H -#define LOVE_PHYSICS_BOX2D_WRAP_CHAIN_SHAPE_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Shape.h" -#include "ChainShape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -ChainShape *luax_checkchainshape(lua_State *L, int idx); - -int w_ChainShape_setNextVertex(lua_State *L); -int w_ChainShape_setPrevVertex(lua_State *L); -int w_ChainShape_getChildCount(lua_State *L); -int w_ChainShape_getChildEdge(lua_State *L); -int w_ChainShape_getVertexCount(lua_State *L); -int w_ChainShape_getPoint(lua_State *L); -int w_ChainShape_getPoints(lua_State *L); - -extern "C" int luaopen_chainshape(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_CHAIN_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_CHAIN_SHAPE_H +#define LOVE_PHYSICS_BOX2D_WRAP_CHAIN_SHAPE_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Shape.h" +#include "ChainShape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +ChainShape *luax_checkchainshape(lua_State *L, int idx); + +int w_ChainShape_setNextVertex(lua_State *L); +int w_ChainShape_setPrevVertex(lua_State *L); +int w_ChainShape_getChildCount(lua_State *L); +int w_ChainShape_getChildEdge(lua_State *L); +int w_ChainShape_getVertexCount(lua_State *L); +int w_ChainShape_getPoint(lua_State *L); +int w_ChainShape_getPoints(lua_State *L); + +extern "C" int luaopen_chainshape(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_CHAIN_SHAPE_H diff --git a/src/modules/physics/box2d/wrap_CircleShape.cpp b/src/modules/physics/box2d/wrap_CircleShape.cpp index 392b40242..3ac27c809 100644 --- a/src/modules/physics/box2d/wrap_CircleShape.cpp +++ b/src/modules/physics/box2d/wrap_CircleShape.cpp @@ -1,72 +1,72 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_CircleShape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -CircleShape *luax_checkcircleshape(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "CircleShape", PHYSICS_CIRCLE_SHAPE_T); -} - -int w_CircleShape_getRadius(lua_State *L) -{ - CircleShape *c = luax_checkcircleshape(L, 1); - lua_pushnumber(L, c->getRadius()); - return 1; -} - -int w_CircleShape_setRadius(lua_State *L) -{ - CircleShape *c = luax_checkcircleshape(L, 1); - float r = (float)luaL_checknumber(L, 2); - c->setRadius(r); - return 0; -} - -static const luaL_Reg functions[] = -{ - { "getRadius", w_CircleShape_getRadius }, - { "setRadius", w_CircleShape_setRadius }, - // From Shape. - { "getType", w_Shape_getType }, - { "getRadius", w_Shape_getRadius }, - { "getChildCount", w_Shape_getChildCount }, - { "testPoint", w_Shape_testPoint }, - { "rayCast", w_Shape_rayCast }, - { "computeAABB", w_Shape_computeAABB }, - { "computeMass", w_Shape_computeMass }, - { 0, 0 } -}; - -extern "C" int luaopen_circleshape(lua_State *L) -{ - return luax_register_type(L, "CircleShape", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_CircleShape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +CircleShape *luax_checkcircleshape(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "CircleShape", PHYSICS_CIRCLE_SHAPE_T); +} + +int w_CircleShape_getRadius(lua_State *L) +{ + CircleShape *c = luax_checkcircleshape(L, 1); + lua_pushnumber(L, c->getRadius()); + return 1; +} + +int w_CircleShape_setRadius(lua_State *L) +{ + CircleShape *c = luax_checkcircleshape(L, 1); + float r = (float)luaL_checknumber(L, 2); + c->setRadius(r); + return 0; +} + +static const luaL_Reg functions[] = +{ + { "getRadius", w_CircleShape_getRadius }, + { "setRadius", w_CircleShape_setRadius }, + // From Shape. + { "getType", w_Shape_getType }, + { "getRadius", w_Shape_getRadius }, + { "getChildCount", w_Shape_getChildCount }, + { "testPoint", w_Shape_testPoint }, + { "rayCast", w_Shape_rayCast }, + { "computeAABB", w_Shape_computeAABB }, + { "computeMass", w_Shape_computeMass }, + { 0, 0 } +}; + +extern "C" int luaopen_circleshape(lua_State *L) +{ + return luax_register_type(L, "CircleShape", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_CircleShape.h b/src/modules/physics/box2d/wrap_CircleShape.h index e704aaa2b..8c1385e34 100644 --- a/src/modules/physics/box2d/wrap_CircleShape.h +++ b/src/modules/physics/box2d/wrap_CircleShape.h @@ -1,45 +1,45 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_CIRCLE_SHAPE_H -#define LOVE_PHYSICS_BOX2D_WRAP_CIRCLE_SHAPE_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Shape.h" -#include "CircleShape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -CircleShape *luax_checkcircleshape(lua_State *L, int idx); -int w_CircleShape_getRadius(lua_State *L); -int w_CircleShape_setRadius(lua_State *L); -extern "C" int luaopen_circleshape(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_CIRCLE_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_CIRCLE_SHAPE_H +#define LOVE_PHYSICS_BOX2D_WRAP_CIRCLE_SHAPE_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Shape.h" +#include "CircleShape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +CircleShape *luax_checkcircleshape(lua_State *L, int idx); +int w_CircleShape_getRadius(lua_State *L); +int w_CircleShape_setRadius(lua_State *L); +extern "C" int luaopen_circleshape(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_CIRCLE_SHAPE_H diff --git a/src/modules/physics/box2d/wrap_Contact.cpp b/src/modules/physics/box2d/wrap_Contact.cpp index f0c83d03a..d2d2db348 100644 --- a/src/modules/physics/box2d/wrap_Contact.cpp +++ b/src/modules/physics/box2d/wrap_Contact.cpp @@ -1,136 +1,136 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Contact.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Contact *luax_checkcontact(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Contact", PHYSICS_CONTACT_T); -} - -int w_Contact_getPositions(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - return t->getPositions(L); -} - -int w_Contact_getNormal(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - return t->getNormal(L); -} - -int w_Contact_getFriction(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - lua_pushnumber(L, t->getFriction()); - return 1; -} - -int w_Contact_getRestitution(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - lua_pushnumber(L, t->getRestitution()); - return 1; -} - -int w_Contact_isEnabled(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - lua_pushboolean(L, t->isEnabled()); - return 1; -} - -int w_Contact_isTouching(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - lua_pushboolean(L, t->isTouching()); - return 1; -} - -int w_Contact_setFriction(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - float f = (float)luaL_checknumber(L, 2); - t->setFriction(f); - return 0; -} - -int w_Contact_setRestitution(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - float r = (float)luaL_checknumber(L, 2); - t->setRestitution(r); - return 0; -} - -int w_Contact_setEnabled(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - bool e = luax_toboolean(L, 2); - t->setEnabled(e); - return 0; -} - -int w_Contact_resetFriction(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - t->resetFriction(); - return 0; -} - -int w_Contact_resetRestitution(lua_State *L) -{ - Contact *t = luax_checkcontact(L, 1); - t->resetRestitution(); - return 0; -} - -extern "C" int luaopen_contact(lua_State *L) -{ - static const luaL_Reg functions[] = - { - { "getPositions", w_Contact_getPositions }, - { "getNormal", w_Contact_getNormal }, - { "getFriction", w_Contact_getFriction }, - { "getRestitution", w_Contact_getRestitution }, - { "isEnabled", w_Contact_isEnabled }, - { "isTouching", w_Contact_isTouching }, - { "setFriction", w_Contact_setFriction }, - { "setRestitution", w_Contact_setRestitution }, - { "setEnabled", w_Contact_setEnabled }, - { "resetFriction", w_Contact_resetFriction }, - { "resetRestitution", w_Contact_resetRestitution }, - { 0, 0 } - }; - - return luax_register_type(L, "Contact", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Contact.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Contact *luax_checkcontact(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Contact", PHYSICS_CONTACT_T); +} + +int w_Contact_getPositions(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + return t->getPositions(L); +} + +int w_Contact_getNormal(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + return t->getNormal(L); +} + +int w_Contact_getFriction(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + lua_pushnumber(L, t->getFriction()); + return 1; +} + +int w_Contact_getRestitution(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + lua_pushnumber(L, t->getRestitution()); + return 1; +} + +int w_Contact_isEnabled(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + lua_pushboolean(L, t->isEnabled()); + return 1; +} + +int w_Contact_isTouching(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + lua_pushboolean(L, t->isTouching()); + return 1; +} + +int w_Contact_setFriction(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + float f = (float)luaL_checknumber(L, 2); + t->setFriction(f); + return 0; +} + +int w_Contact_setRestitution(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + float r = (float)luaL_checknumber(L, 2); + t->setRestitution(r); + return 0; +} + +int w_Contact_setEnabled(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + bool e = luax_toboolean(L, 2); + t->setEnabled(e); + return 0; +} + +int w_Contact_resetFriction(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + t->resetFriction(); + return 0; +} + +int w_Contact_resetRestitution(lua_State *L) +{ + Contact *t = luax_checkcontact(L, 1); + t->resetRestitution(); + return 0; +} + +extern "C" int luaopen_contact(lua_State *L) +{ + static const luaL_Reg functions[] = + { + { "getPositions", w_Contact_getPositions }, + { "getNormal", w_Contact_getNormal }, + { "getFriction", w_Contact_getFriction }, + { "getRestitution", w_Contact_getRestitution }, + { "isEnabled", w_Contact_isEnabled }, + { "isTouching", w_Contact_isTouching }, + { "setFriction", w_Contact_setFriction }, + { "setRestitution", w_Contact_setRestitution }, + { "setEnabled", w_Contact_setEnabled }, + { "resetFriction", w_Contact_resetFriction }, + { "resetRestitution", w_Contact_resetRestitution }, + { 0, 0 } + }; + + return luax_register_type(L, "Contact", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_Contact.h b/src/modules/physics/box2d/wrap_Contact.h index 17dd7a4ac..a7a05bbbe 100644 --- a/src/modules/physics/box2d/wrap_Contact.h +++ b/src/modules/physics/box2d/wrap_Contact.h @@ -1,53 +1,53 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_CONTACT_H -#define LOVE_PHYSICS_BOX2D_WRAP_CONTACT_H - -// LOVE -#include "common/runtime.h" -#include "Contact.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Contact *luax_checkcontact(lua_State *L, int idx); -int w_Contact_getPositions(lua_State *L); -int w_Contact_getNormal(lua_State *L); -int w_Contact_getFriction(lua_State *L); -int w_Contact_getRestitution(lua_State *L); -int w_Contact_isEnabled(lua_State *L); -int w_Contact_isTouching(lua_State *L); -int w_Contact_setFriction(lua_State *L); -int w_Contact_setRestitution(lua_State *L); -int w_Contact_setEnabled(lua_State *L); -int w_Contact_resetFriction(lua_State *L); -int w_Contact_resetRestitution(lua_State *L); -extern "C" int luaopen_contact(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_CONTACT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_CONTACT_H +#define LOVE_PHYSICS_BOX2D_WRAP_CONTACT_H + +// LOVE +#include "common/runtime.h" +#include "Contact.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Contact *luax_checkcontact(lua_State *L, int idx); +int w_Contact_getPositions(lua_State *L); +int w_Contact_getNormal(lua_State *L); +int w_Contact_getFriction(lua_State *L); +int w_Contact_getRestitution(lua_State *L); +int w_Contact_isEnabled(lua_State *L); +int w_Contact_isTouching(lua_State *L); +int w_Contact_setFriction(lua_State *L); +int w_Contact_setRestitution(lua_State *L); +int w_Contact_setEnabled(lua_State *L); +int w_Contact_resetFriction(lua_State *L); +int w_Contact_resetRestitution(lua_State *L); +extern "C" int luaopen_contact(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_CONTACT_H diff --git a/src/modules/physics/box2d/wrap_DistanceJoint.cpp b/src/modules/physics/box2d/wrap_DistanceJoint.cpp index c36104983..339110336 100644 --- a/src/modules/physics/box2d/wrap_DistanceJoint.cpp +++ b/src/modules/physics/box2d/wrap_DistanceJoint.cpp @@ -1,108 +1,108 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_DistanceJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -DistanceJoint *luax_checkdistancejoint(lua_State *L, int idx) -{ - DistanceJoint *j = luax_checktype(L, idx, "DistanceJoint", PHYSICS_DISTANCE_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_DistanceJoint_setLength(lua_State *L) -{ - DistanceJoint *t = luax_checkdistancejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setLength(arg1); - return 0; -} - -int w_DistanceJoint_getLength(lua_State *L) -{ - DistanceJoint *t = luax_checkdistancejoint(L, 1); - lua_pushnumber(L, t->getLength()); - return 1; -} - -int w_DistanceJoint_setFrequency(lua_State *L) -{ - DistanceJoint *t = luax_checkdistancejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setFrequency(arg1); - return 0; -} - -int w_DistanceJoint_getFrequency(lua_State *L) -{ - DistanceJoint *t = luax_checkdistancejoint(L, 1); - lua_pushnumber(L, t->getFrequency()); - return 1; -} - -int w_DistanceJoint_setDampingRatio(lua_State *L) -{ - DistanceJoint *t = luax_checkdistancejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setDampingRatio(arg1); - return 0; -} - -int w_DistanceJoint_getDampingRatio(lua_State *L) -{ - DistanceJoint *t = luax_checkdistancejoint(L, 1); - lua_pushnumber(L, t->getDampingRatio()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "setLength", w_DistanceJoint_setLength }, - { "getLength", w_DistanceJoint_getLength }, - { "setFrequency", w_DistanceJoint_setFrequency }, - { "getFrequency", w_DistanceJoint_getFrequency }, - { "setDampingRatio", w_DistanceJoint_setDampingRatio }, - { "getDampingRatio", w_DistanceJoint_getDampingRatio }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_distancejoint(lua_State *L) -{ - return luax_register_type(L, "DistanceJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_DistanceJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +DistanceJoint *luax_checkdistancejoint(lua_State *L, int idx) +{ + DistanceJoint *j = luax_checktype(L, idx, "DistanceJoint", PHYSICS_DISTANCE_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_DistanceJoint_setLength(lua_State *L) +{ + DistanceJoint *t = luax_checkdistancejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setLength(arg1); + return 0; +} + +int w_DistanceJoint_getLength(lua_State *L) +{ + DistanceJoint *t = luax_checkdistancejoint(L, 1); + lua_pushnumber(L, t->getLength()); + return 1; +} + +int w_DistanceJoint_setFrequency(lua_State *L) +{ + DistanceJoint *t = luax_checkdistancejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setFrequency(arg1); + return 0; +} + +int w_DistanceJoint_getFrequency(lua_State *L) +{ + DistanceJoint *t = luax_checkdistancejoint(L, 1); + lua_pushnumber(L, t->getFrequency()); + return 1; +} + +int w_DistanceJoint_setDampingRatio(lua_State *L) +{ + DistanceJoint *t = luax_checkdistancejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setDampingRatio(arg1); + return 0; +} + +int w_DistanceJoint_getDampingRatio(lua_State *L) +{ + DistanceJoint *t = luax_checkdistancejoint(L, 1); + lua_pushnumber(L, t->getDampingRatio()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "setLength", w_DistanceJoint_setLength }, + { "getLength", w_DistanceJoint_getLength }, + { "setFrequency", w_DistanceJoint_setFrequency }, + { "getFrequency", w_DistanceJoint_getFrequency }, + { "setDampingRatio", w_DistanceJoint_setDampingRatio }, + { "getDampingRatio", w_DistanceJoint_getDampingRatio }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_distancejoint(lua_State *L) +{ + return luax_register_type(L, "DistanceJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_DistanceJoint.h b/src/modules/physics/box2d/wrap_DistanceJoint.h index 7dd74faeb..af8c5bfb7 100644 --- a/src/modules/physics/box2d/wrap_DistanceJoint.h +++ b/src/modules/physics/box2d/wrap_DistanceJoint.h @@ -1,49 +1,49 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_DISTANCE_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_DISTANCE_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "DistanceJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -DistanceJoint *luax_checkdistancejoint(lua_State *L, int idx); -int w_DistanceJoint_setLength(lua_State *L); -int w_DistanceJoint_getLength(lua_State *L); -int w_DistanceJoint_setFrequency(lua_State *L); -int w_DistanceJoint_getFrequency(lua_State *L); -int w_DistanceJoint_setDampingRatio(lua_State *L); -int w_DistanceJoint_getDampingRatio(lua_State *L); -extern "C" int luaopen_distancejoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_DISTANCE_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_DISTANCE_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_DISTANCE_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "DistanceJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +DistanceJoint *luax_checkdistancejoint(lua_State *L, int idx); +int w_DistanceJoint_setLength(lua_State *L); +int w_DistanceJoint_getLength(lua_State *L); +int w_DistanceJoint_setFrequency(lua_State *L); +int w_DistanceJoint_getFrequency(lua_State *L); +int w_DistanceJoint_setDampingRatio(lua_State *L); +int w_DistanceJoint_getDampingRatio(lua_State *L); +extern "C" int luaopen_distancejoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_DISTANCE_JOINT_H diff --git a/src/modules/physics/box2d/wrap_EdgeShape.cpp b/src/modules/physics/box2d/wrap_EdgeShape.cpp index 0bd15c9c1..be6b5e311 100644 --- a/src/modules/physics/box2d/wrap_EdgeShape.cpp +++ b/src/modules/physics/box2d/wrap_EdgeShape.cpp @@ -1,63 +1,63 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_EdgeShape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -EdgeShape *luax_checkedgeshape(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "EdgeShape", PHYSICS_EDGE_SHAPE_T); -} - -int w_EdgeShape_getPoints(lua_State *L) -{ - EdgeShape *t = luax_checkedgeshape(L, 1); - lua_remove(L, 1); - return t->getPoints(L); -} - -static const luaL_Reg functions[] = -{ - { "getPoints", w_EdgeShape_getPoints }, - // From Shape. - { "getType", w_Shape_getType }, - { "getRadius", w_Shape_getRadius }, - { "getChildCount", w_Shape_getChildCount }, - { "testPoint", w_Shape_testPoint }, - { "rayCast", w_Shape_rayCast }, - { "computeAABB", w_Shape_computeAABB }, - { "computeMass", w_Shape_computeMass }, - { 0, 0 } -}; - -extern "C" int luaopen_edgeshape(lua_State *L) -{ - return luax_register_type(L, "EdgeShape", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_EdgeShape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +EdgeShape *luax_checkedgeshape(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "EdgeShape", PHYSICS_EDGE_SHAPE_T); +} + +int w_EdgeShape_getPoints(lua_State *L) +{ + EdgeShape *t = luax_checkedgeshape(L, 1); + lua_remove(L, 1); + return t->getPoints(L); +} + +static const luaL_Reg functions[] = +{ + { "getPoints", w_EdgeShape_getPoints }, + // From Shape. + { "getType", w_Shape_getType }, + { "getRadius", w_Shape_getRadius }, + { "getChildCount", w_Shape_getChildCount }, + { "testPoint", w_Shape_testPoint }, + { "rayCast", w_Shape_rayCast }, + { "computeAABB", w_Shape_computeAABB }, + { "computeMass", w_Shape_computeMass }, + { 0, 0 } +}; + +extern "C" int luaopen_edgeshape(lua_State *L) +{ + return luax_register_type(L, "EdgeShape", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_EdgeShape.h b/src/modules/physics/box2d/wrap_EdgeShape.h index f4887ef9d..cb38e7109 100644 --- a/src/modules/physics/box2d/wrap_EdgeShape.h +++ b/src/modules/physics/box2d/wrap_EdgeShape.h @@ -1,44 +1,44 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_EDGE_SHAPE_H -#define LOVE_PHYSICS_BOX2D_WRAP_EDGE_SHAPE_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Shape.h" -#include "EdgeShape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -EdgeShape *luax_checkedgeshape(lua_State *L, int idx); -int w_EdgeShape_getPoints(lua_State *L); -extern "C" int luaopen_edgeshape(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_EDGE_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_EDGE_SHAPE_H +#define LOVE_PHYSICS_BOX2D_WRAP_EDGE_SHAPE_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Shape.h" +#include "EdgeShape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +EdgeShape *luax_checkedgeshape(lua_State *L, int idx); +int w_EdgeShape_getPoints(lua_State *L); +extern "C" int luaopen_edgeshape(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_EDGE_SHAPE_H diff --git a/src/modules/physics/box2d/wrap_Fixture.cpp b/src/modules/physics/box2d/wrap_Fixture.cpp index b1c980217..517c7cf25 100644 --- a/src/modules/physics/box2d/wrap_Fixture.cpp +++ b/src/modules/physics/box2d/wrap_Fixture.cpp @@ -1,309 +1,309 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Fixture.h" -#include "common/StringMap.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Fixture *luax_checkfixture(lua_State *L, int idx) -{ - Fixture *f = luax_checktype(L, idx, "Fixture", PHYSICS_FIXTURE_T); - if (!f->isValid()) - luaL_error(L, "Attempt to use destroyed fixture."); - return f; -} - -int w_Fixture_getType(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - const char *type = ""; - Shape::getConstant(t->getType(), type); - lua_pushstring(L, type); - return 1; -} - -int w_Fixture_setFriction(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setFriction(arg1); - return 0; -} - -int w_Fixture_setRestitution(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setRestitution(arg1); - return 0; -} - -int w_Fixture_setDensity(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setDensity(arg1); - return 0; -} - -int w_Fixture_setSensor(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - bool arg1 = luax_toboolean(L, 2); - t->setSensor(arg1); - return 0; -} - -int w_Fixture_getFriction(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_pushnumber(L, t->getFriction()); - return 1; -} - -int w_Fixture_getRestitution(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_pushnumber(L, t->getRestitution()); - return 1; -} - -int w_Fixture_getDensity(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_pushnumber(L, t->getDensity()); - return 1; -} - -int w_Fixture_isSensor(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - luax_pushboolean(L, t->isSensor()); - return 1; -} - -int w_Fixture_getBody(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - Body *body = t->getBody(); - if (body == 0) - return 0; - body->retain(); - luax_newtype(L, "Body", PHYSICS_BODY_T, (void *)body); - return 1; -} - -int w_Fixture_getShape(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - Shape *shape = t->getShape(); - if (shape == 0) - return 0; - switch (shape->getType()) - { - case Shape::SHAPE_EDGE: - luax_newtype(L, "EdgeShape", PHYSICS_EDGE_SHAPE_T, (void *)shape); - break; - case Shape::SHAPE_CHAIN: - luax_newtype(L, "ChainShape", PHYSICS_CHAIN_SHAPE_T, (void *)shape); - break; - case Shape::SHAPE_CIRCLE: - luax_newtype(L, "CircleShape", PHYSICS_CIRCLE_SHAPE_T, (void *)shape); - break; - case Shape::SHAPE_POLYGON: - luax_newtype(L, "PolygonShape", PHYSICS_POLYGON_SHAPE_T, (void *)shape); - break; - default: - luax_newtype(L, "Shape", PHYSICS_SHAPE_T, (void *)shape); - break; - } - return 1; -} - -int w_Fixture_testPoint(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - luax_pushboolean(L, t->testPoint(x, y)); - return 1; -} - -int w_Fixture_rayCast(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - ASSERT_GUARD(return t->rayCast(L);) -} - -int w_Fixture_setFilterData(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - int v[3]; - v[0] = luaL_checkint(L, 2); - v[1] = luaL_checkint(L, 3); - v[2] = luaL_checkint(L, 4); - t->setFilterData(v); - return 0; -} - -int w_Fixture_getFilterData(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - int v[3]; - t->getFilterData(v); - lua_pushinteger(L, v[0]); - lua_pushinteger(L, v[1]); - lua_pushinteger(L, v[2]); - return 3; -} - -int w_Fixture_setCategory(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - return t->setCategory(L); -} - -int w_Fixture_getCategory(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - return t->getCategory(L); -} - -int w_Fixture_setMask(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - return t->setMask(L); -} - -int w_Fixture_getMask(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - return t->getMask(L); -} - -int w_Fixture_setUserData(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - return t->setUserData(L); -} - -int w_Fixture_getUserData(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - return t->getUserData(L); -} - -int w_Fixture_getBoundingBox(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - return t->getBoundingBox(L); -} - -int w_Fixture_getMassData(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - lua_remove(L, 1); - return t->getMassData(L); -} - -int w_Fixture_getGroupIndex(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - int i = t->getGroupIndex(); - lua_pushinteger(L, i); - return 1; -} - -int w_Fixture_setGroupIndex(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - int i = luaL_checkint(L, 2); - t->setGroupIndex(i); - return 0; -} - -int w_Fixture_destroy(lua_State *L) -{ - Fixture *t = luax_checkfixture(L, 1); - try - { - t->destroy(); - } - catch(love::Exception &e) - { - luaL_error(L, "%s", e.what()); - } - return 0; -} - -static const luaL_Reg functions[] = -{ - { "getType", w_Fixture_getType }, - { "setFriction", w_Fixture_setFriction }, - { "setRestitution", w_Fixture_setRestitution }, - { "setDensity", w_Fixture_setDensity }, - { "setSensor", w_Fixture_setSensor }, - { "getFriction", w_Fixture_getFriction }, - { "getRestitution", w_Fixture_getRestitution }, - { "getDensity", w_Fixture_getDensity }, - { "getBody", w_Fixture_getBody }, - { "getShape", w_Fixture_getShape }, - { "isSensor", w_Fixture_isSensor }, - { "testPoint", w_Fixture_testPoint }, - { "rayCast", w_Fixture_rayCast }, - { "setFilterData", w_Fixture_setFilterData }, - { "getFilterData", w_Fixture_getFilterData }, - { "setCategory", w_Fixture_setCategory }, - { "getCategory", w_Fixture_getCategory }, - { "setMask", w_Fixture_setMask }, - { "getMask", w_Fixture_getMask }, - { "setUserData", w_Fixture_setUserData }, - { "getUserData", w_Fixture_getUserData }, - { "getBoundingBox", w_Fixture_getBoundingBox }, - { "getMassData", w_Fixture_getMassData }, - { "getGroupIndex", w_Fixture_getGroupIndex }, - { "setGroupIndex", w_Fixture_setGroupIndex }, - { "destroy", w_Fixture_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_fixture(lua_State *L) -{ - return luax_register_type(L, "Fixture", functions); -} - -} // box2d -} // physics -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Fixture.h" +#include "common/StringMap.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Fixture *luax_checkfixture(lua_State *L, int idx) +{ + Fixture *f = luax_checktype(L, idx, "Fixture", PHYSICS_FIXTURE_T); + if (!f->isValid()) + luaL_error(L, "Attempt to use destroyed fixture."); + return f; +} + +int w_Fixture_getType(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + const char *type = ""; + Shape::getConstant(t->getType(), type); + lua_pushstring(L, type); + return 1; +} + +int w_Fixture_setFriction(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setFriction(arg1); + return 0; +} + +int w_Fixture_setRestitution(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setRestitution(arg1); + return 0; +} + +int w_Fixture_setDensity(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setDensity(arg1); + return 0; +} + +int w_Fixture_setSensor(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + bool arg1 = luax_toboolean(L, 2); + t->setSensor(arg1); + return 0; +} + +int w_Fixture_getFriction(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_pushnumber(L, t->getFriction()); + return 1; +} + +int w_Fixture_getRestitution(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_pushnumber(L, t->getRestitution()); + return 1; +} + +int w_Fixture_getDensity(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_pushnumber(L, t->getDensity()); + return 1; +} + +int w_Fixture_isSensor(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + luax_pushboolean(L, t->isSensor()); + return 1; +} + +int w_Fixture_getBody(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + Body *body = t->getBody(); + if (body == 0) + return 0; + body->retain(); + luax_newtype(L, "Body", PHYSICS_BODY_T, (void *)body); + return 1; +} + +int w_Fixture_getShape(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + Shape *shape = t->getShape(); + if (shape == 0) + return 0; + switch (shape->getType()) + { + case Shape::SHAPE_EDGE: + luax_newtype(L, "EdgeShape", PHYSICS_EDGE_SHAPE_T, (void *)shape); + break; + case Shape::SHAPE_CHAIN: + luax_newtype(L, "ChainShape", PHYSICS_CHAIN_SHAPE_T, (void *)shape); + break; + case Shape::SHAPE_CIRCLE: + luax_newtype(L, "CircleShape", PHYSICS_CIRCLE_SHAPE_T, (void *)shape); + break; + case Shape::SHAPE_POLYGON: + luax_newtype(L, "PolygonShape", PHYSICS_POLYGON_SHAPE_T, (void *)shape); + break; + default: + luax_newtype(L, "Shape", PHYSICS_SHAPE_T, (void *)shape); + break; + } + return 1; +} + +int w_Fixture_testPoint(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + luax_pushboolean(L, t->testPoint(x, y)); + return 1; +} + +int w_Fixture_rayCast(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + ASSERT_GUARD(return t->rayCast(L);) +} + +int w_Fixture_setFilterData(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + int v[3]; + v[0] = luaL_checkint(L, 2); + v[1] = luaL_checkint(L, 3); + v[2] = luaL_checkint(L, 4); + t->setFilterData(v); + return 0; +} + +int w_Fixture_getFilterData(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + int v[3]; + t->getFilterData(v); + lua_pushinteger(L, v[0]); + lua_pushinteger(L, v[1]); + lua_pushinteger(L, v[2]); + return 3; +} + +int w_Fixture_setCategory(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + return t->setCategory(L); +} + +int w_Fixture_getCategory(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + return t->getCategory(L); +} + +int w_Fixture_setMask(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + return t->setMask(L); +} + +int w_Fixture_getMask(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + return t->getMask(L); +} + +int w_Fixture_setUserData(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + return t->setUserData(L); +} + +int w_Fixture_getUserData(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + return t->getUserData(L); +} + +int w_Fixture_getBoundingBox(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + return t->getBoundingBox(L); +} + +int w_Fixture_getMassData(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + lua_remove(L, 1); + return t->getMassData(L); +} + +int w_Fixture_getGroupIndex(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + int i = t->getGroupIndex(); + lua_pushinteger(L, i); + return 1; +} + +int w_Fixture_setGroupIndex(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + int i = luaL_checkint(L, 2); + t->setGroupIndex(i); + return 0; +} + +int w_Fixture_destroy(lua_State *L) +{ + Fixture *t = luax_checkfixture(L, 1); + try + { + t->destroy(); + } + catch(love::Exception &e) + { + luaL_error(L, "%s", e.what()); + } + return 0; +} + +static const luaL_Reg functions[] = +{ + { "getType", w_Fixture_getType }, + { "setFriction", w_Fixture_setFriction }, + { "setRestitution", w_Fixture_setRestitution }, + { "setDensity", w_Fixture_setDensity }, + { "setSensor", w_Fixture_setSensor }, + { "getFriction", w_Fixture_getFriction }, + { "getRestitution", w_Fixture_getRestitution }, + { "getDensity", w_Fixture_getDensity }, + { "getBody", w_Fixture_getBody }, + { "getShape", w_Fixture_getShape }, + { "isSensor", w_Fixture_isSensor }, + { "testPoint", w_Fixture_testPoint }, + { "rayCast", w_Fixture_rayCast }, + { "setFilterData", w_Fixture_setFilterData }, + { "getFilterData", w_Fixture_getFilterData }, + { "setCategory", w_Fixture_setCategory }, + { "getCategory", w_Fixture_getCategory }, + { "setMask", w_Fixture_setMask }, + { "getMask", w_Fixture_getMask }, + { "setUserData", w_Fixture_setUserData }, + { "getUserData", w_Fixture_getUserData }, + { "getBoundingBox", w_Fixture_getBoundingBox }, + { "getMassData", w_Fixture_getMassData }, + { "getGroupIndex", w_Fixture_getGroupIndex }, + { "setGroupIndex", w_Fixture_setGroupIndex }, + { "destroy", w_Fixture_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_fixture(lua_State *L) +{ + return luax_register_type(L, "Fixture", functions); +} + +} // box2d +} // physics +} // love + diff --git a/src/modules/physics/box2d/wrap_Fixture.h b/src/modules/physics/box2d/wrap_Fixture.h index c9e72703a..4cee7fb80 100644 --- a/src/modules/physics/box2d/wrap_Fixture.h +++ b/src/modules/physics/box2d/wrap_Fixture.h @@ -1,69 +1,69 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_FIXTURE_H -#define LOVE_PHYSICS_BOX2D_WRAP_FIXTURE_H - -// LOVE -#include "common/runtime.h" -#include "Fixture.h" -#include "wrap_Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Fixture *luax_checkfixture(lua_State *L, int idx); -int w_Fixture_getType(lua_State *L); -int w_Fixture_setFriction(lua_State *L); -int w_Fixture_setRestitution(lua_State *L); -int w_Fixture_setDensity(lua_State *L); -int w_Fixture_setSensor(lua_State *L); -int w_Fixture_getFriction(lua_State *L); -int w_Fixture_getRestitution(lua_State *L); -int w_Fixture_getDensity(lua_State *L); -int w_Fixture_isSensor(lua_State *L); -int w_Fixture_getBody(lua_State *L); -int w_Fixture_getShape(lua_State *L); -int w_Fixture_testPoint(lua_State *L); -int w_Fixture_rayCast(lua_State *L); -int w_Fixture_setFilterData(lua_State *L); -int w_Fixture_getFilterData(lua_State *L); -int w_Fixture_setCategory(lua_State *L); -int w_Fixture_getCategory(lua_State *L); -int w_Fixture_setMask(lua_State *L); -int w_Fixture_getMask(lua_State *L); -int w_Fixture_setUserData(lua_State *L); -int w_Fixture_getUserData(lua_State *L); -int w_Fixture_getBoundingBox(lua_State *L); -int w_Fixture_getMassData(lua_State *L); -int w_Fixture_getGroupIndex(lua_State *L); -int w_Fixture_setGroupIndex(lua_State *L); -int w_Fixture_destroy(lua_State *L); -extern "C" int luaopen_fixture(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_FIXTURE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_FIXTURE_H +#define LOVE_PHYSICS_BOX2D_WRAP_FIXTURE_H + +// LOVE +#include "common/runtime.h" +#include "Fixture.h" +#include "wrap_Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Fixture *luax_checkfixture(lua_State *L, int idx); +int w_Fixture_getType(lua_State *L); +int w_Fixture_setFriction(lua_State *L); +int w_Fixture_setRestitution(lua_State *L); +int w_Fixture_setDensity(lua_State *L); +int w_Fixture_setSensor(lua_State *L); +int w_Fixture_getFriction(lua_State *L); +int w_Fixture_getRestitution(lua_State *L); +int w_Fixture_getDensity(lua_State *L); +int w_Fixture_isSensor(lua_State *L); +int w_Fixture_getBody(lua_State *L); +int w_Fixture_getShape(lua_State *L); +int w_Fixture_testPoint(lua_State *L); +int w_Fixture_rayCast(lua_State *L); +int w_Fixture_setFilterData(lua_State *L); +int w_Fixture_getFilterData(lua_State *L); +int w_Fixture_setCategory(lua_State *L); +int w_Fixture_getCategory(lua_State *L); +int w_Fixture_setMask(lua_State *L); +int w_Fixture_getMask(lua_State *L); +int w_Fixture_setUserData(lua_State *L); +int w_Fixture_getUserData(lua_State *L); +int w_Fixture_getBoundingBox(lua_State *L); +int w_Fixture_getMassData(lua_State *L); +int w_Fixture_getGroupIndex(lua_State *L); +int w_Fixture_setGroupIndex(lua_State *L); +int w_Fixture_destroy(lua_State *L); +extern "C" int luaopen_fixture(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_FIXTURE_H diff --git a/src/modules/physics/box2d/wrap_FrictionJoint.cpp b/src/modules/physics/box2d/wrap_FrictionJoint.cpp index 6edd0457c..79d37365f 100644 --- a/src/modules/physics/box2d/wrap_FrictionJoint.cpp +++ b/src/modules/physics/box2d/wrap_FrictionJoint.cpp @@ -1,91 +1,91 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_FrictionJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -FrictionJoint *luax_checkfrictionjoint(lua_State *L, int idx) -{ - FrictionJoint *j = luax_checktype(L, idx, "FrictionJoint", PHYSICS_FRICTION_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_FrictionJoint_setMaxForce(lua_State *L) -{ - FrictionJoint *t = luax_checkfrictionjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setMaxForce(arg1); - return 0; -} - -int w_FrictionJoint_getMaxForce(lua_State *L) -{ - FrictionJoint *t = luax_checkfrictionjoint(L, 1); - lua_pushnumber(L, t->getMaxForce()); - return 1; -} - -int w_FrictionJoint_setMaxTorque(lua_State *L) -{ - FrictionJoint *t = luax_checkfrictionjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setMaxTorque(arg1); - return 0; -} - -int w_FrictionJoint_getMaxTorque(lua_State *L) -{ - FrictionJoint *t = luax_checkfrictionjoint(L, 1); - lua_pushnumber(L, t->getMaxTorque()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "setMaxForce", w_FrictionJoint_setMaxForce }, - { "getMaxForce", w_FrictionJoint_getMaxForce }, - { "setMaxTorque", w_FrictionJoint_setMaxTorque }, - { "getMaxTorque", w_FrictionJoint_getMaxTorque }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_frictionjoint(lua_State *L) -{ - return luax_register_type(L, "FrictionJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_FrictionJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +FrictionJoint *luax_checkfrictionjoint(lua_State *L, int idx) +{ + FrictionJoint *j = luax_checktype(L, idx, "FrictionJoint", PHYSICS_FRICTION_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_FrictionJoint_setMaxForce(lua_State *L) +{ + FrictionJoint *t = luax_checkfrictionjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setMaxForce(arg1); + return 0; +} + +int w_FrictionJoint_getMaxForce(lua_State *L) +{ + FrictionJoint *t = luax_checkfrictionjoint(L, 1); + lua_pushnumber(L, t->getMaxForce()); + return 1; +} + +int w_FrictionJoint_setMaxTorque(lua_State *L) +{ + FrictionJoint *t = luax_checkfrictionjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setMaxTorque(arg1); + return 0; +} + +int w_FrictionJoint_getMaxTorque(lua_State *L) +{ + FrictionJoint *t = luax_checkfrictionjoint(L, 1); + lua_pushnumber(L, t->getMaxTorque()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "setMaxForce", w_FrictionJoint_setMaxForce }, + { "getMaxForce", w_FrictionJoint_getMaxForce }, + { "setMaxTorque", w_FrictionJoint_setMaxTorque }, + { "getMaxTorque", w_FrictionJoint_getMaxTorque }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_frictionjoint(lua_State *L) +{ + return luax_register_type(L, "FrictionJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_FrictionJoint.h b/src/modules/physics/box2d/wrap_FrictionJoint.h index 33e5aa42e..6d8680c51 100644 --- a/src/modules/physics/box2d/wrap_FrictionJoint.h +++ b/src/modules/physics/box2d/wrap_FrictionJoint.h @@ -1,47 +1,47 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_FRICTION_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_FRICTION_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "FrictionJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -FrictionJoint *luax_checkfrictionjoint(lua_State *L, int idx); -int w_FrictionJoint_setMaxForce(lua_State *L); -int w_FrictionJoint_getMaxForce(lua_State *L); -int w_FrictionJoint_setMaxTorque(lua_State *L); -int w_FrictionJoint_getMaxTorque(lua_State *L); -extern "C" int luaopen_frictionjoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_FRICTION_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_FRICTION_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_FRICTION_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "FrictionJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +FrictionJoint *luax_checkfrictionjoint(lua_State *L, int idx); +int w_FrictionJoint_setMaxForce(lua_State *L); +int w_FrictionJoint_getMaxForce(lua_State *L); +int w_FrictionJoint_setMaxTorque(lua_State *L); +int w_FrictionJoint_getMaxTorque(lua_State *L); +extern "C" int luaopen_frictionjoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_FRICTION_JOINT_H diff --git a/src/modules/physics/box2d/wrap_GearJoint.cpp b/src/modules/physics/box2d/wrap_GearJoint.cpp index dc0080d07..07fa1189d 100644 --- a/src/modules/physics/box2d/wrap_GearJoint.cpp +++ b/src/modules/physics/box2d/wrap_GearJoint.cpp @@ -1,74 +1,74 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_GearJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -GearJoint *luax_checkgearjoint(lua_State *L, int idx) -{ - GearJoint *j = luax_checktype(L, idx, "GearJoint", PHYSICS_GEAR_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_GearJoint_setRatio(lua_State *L) -{ - GearJoint *t = luax_checkgearjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setRatio(arg1); - return 0; -} - -int w_GearJoint_getRatio(lua_State *L) -{ - GearJoint *t = luax_checkgearjoint(L, 1); - lua_pushnumber(L, t->getRatio()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "setRatio", w_GearJoint_setRatio }, - { "getRatio", w_GearJoint_getRatio }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_gearjoint(lua_State *L) -{ - return luax_register_type(L, "GearJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_GearJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +GearJoint *luax_checkgearjoint(lua_State *L, int idx) +{ + GearJoint *j = luax_checktype(L, idx, "GearJoint", PHYSICS_GEAR_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_GearJoint_setRatio(lua_State *L) +{ + GearJoint *t = luax_checkgearjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setRatio(arg1); + return 0; +} + +int w_GearJoint_getRatio(lua_State *L) +{ + GearJoint *t = luax_checkgearjoint(L, 1); + lua_pushnumber(L, t->getRatio()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "setRatio", w_GearJoint_setRatio }, + { "getRatio", w_GearJoint_getRatio }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_gearjoint(lua_State *L) +{ + return luax_register_type(L, "GearJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_GearJoint.h b/src/modules/physics/box2d/wrap_GearJoint.h index ab98e4c44..2ace9083f 100644 --- a/src/modules/physics/box2d/wrap_GearJoint.h +++ b/src/modules/physics/box2d/wrap_GearJoint.h @@ -1,45 +1,45 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_GEAR_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_GEAR_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "GearJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -GearJoint *luax_checkgearjoint(lua_State *L, int idx); -int w_GearJoint_setRatio(lua_State *L); -int w_GearJoint_getRatio(lua_State *L); -extern "C" int luaopen_gearjoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_GEAR_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_GEAR_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_GEAR_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "GearJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +GearJoint *luax_checkgearjoint(lua_State *L, int idx); +int w_GearJoint_setRatio(lua_State *L); +int w_GearJoint_getRatio(lua_State *L); +extern "C" int luaopen_gearjoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_GEAR_JOINT_H diff --git a/src/modules/physics/box2d/wrap_Joint.cpp b/src/modules/physics/box2d/wrap_Joint.cpp index b93df6c8d..a41758ee5 100644 --- a/src/modules/physics/box2d/wrap_Joint.cpp +++ b/src/modules/physics/box2d/wrap_Joint.cpp @@ -1,110 +1,110 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "wrap_Joint.h" -#include "common/StringMap.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Joint *luax_checkjoint(lua_State *L, int idx) -{ - Joint *t = luax_checktype(L, idx, "Joint", PHYSICS_JOINT_T); - if (!t->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return t; -} - -int w_Joint_getType(lua_State *L) -{ - Joint *t = luax_checkjoint(L, 1); - const char *type = ""; - Joint::getConstant(t->getType(), type); - lua_pushstring(L, type); - return 1; -} - -int w_Joint_getAnchors(lua_State *L) -{ - Joint *t = luax_checkjoint(L, 1); - lua_remove(L, 1); - return t->getAnchors(L); -} - -int w_Joint_getReactionForce(lua_State *L) -{ - Joint *t = luax_checkjoint(L, 1); - lua_remove(L, 1); - return t->getReactionForce(L); -} - -int w_Joint_getReactionTorque(lua_State *L) -{ - Joint *t = luax_checkjoint(L, 1); - float inv_dt = (float)luaL_checknumber(L, 2); - lua_pushnumber(L, t->getReactionTorque(inv_dt)); - return 1; -} - -int w_Joint_getCollideConnected(lua_State *L) -{ - Joint *t = luax_checkjoint(L, 1); - luax_pushboolean(L, t->getCollideConnected()); - return 1; -} - -int w_Joint_destroy(lua_State *L) -{ - Joint *t = luax_checkjoint(L, 1); - try - { - t->destroyJoint(); - } - catch(love::Exception &e) - { - luaL_error(L, "%s", e.what()); - } - return 0; -} - -static const luaL_Reg functions[] = -{ - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_joint(lua_State *L) -{ - return luax_register_type(L, "Joint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "wrap_Joint.h" +#include "common/StringMap.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Joint *luax_checkjoint(lua_State *L, int idx) +{ + Joint *t = luax_checktype(L, idx, "Joint", PHYSICS_JOINT_T); + if (!t->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return t; +} + +int w_Joint_getType(lua_State *L) +{ + Joint *t = luax_checkjoint(L, 1); + const char *type = ""; + Joint::getConstant(t->getType(), type); + lua_pushstring(L, type); + return 1; +} + +int w_Joint_getAnchors(lua_State *L) +{ + Joint *t = luax_checkjoint(L, 1); + lua_remove(L, 1); + return t->getAnchors(L); +} + +int w_Joint_getReactionForce(lua_State *L) +{ + Joint *t = luax_checkjoint(L, 1); + lua_remove(L, 1); + return t->getReactionForce(L); +} + +int w_Joint_getReactionTorque(lua_State *L) +{ + Joint *t = luax_checkjoint(L, 1); + float inv_dt = (float)luaL_checknumber(L, 2); + lua_pushnumber(L, t->getReactionTorque(inv_dt)); + return 1; +} + +int w_Joint_getCollideConnected(lua_State *L) +{ + Joint *t = luax_checkjoint(L, 1); + luax_pushboolean(L, t->getCollideConnected()); + return 1; +} + +int w_Joint_destroy(lua_State *L) +{ + Joint *t = luax_checkjoint(L, 1); + try + { + t->destroyJoint(); + } + catch(love::Exception &e) + { + luaL_error(L, "%s", e.what()); + } + return 0; +} + +static const luaL_Reg functions[] = +{ + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_joint(lua_State *L) +{ + return luax_register_type(L, "Joint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_Joint.h b/src/modules/physics/box2d/wrap_Joint.h index 525dcc239..6b19eaf94 100644 --- a/src/modules/physics/box2d/wrap_Joint.h +++ b/src/modules/physics/box2d/wrap_Joint.h @@ -1,48 +1,48 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "Joint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Joint *luax_checkjoint(lua_State *L, int idx); -int w_Joint_getType(lua_State *L); -int w_Joint_getAnchors(lua_State *L); -int w_Joint_getReactionForce(lua_State *L); -int w_Joint_getReactionTorque(lua_State *L); -int w_Joint_getCollideConnected(lua_State *L); -int w_Joint_destroy(lua_State *L); -extern "C" int luaopen_joint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "Joint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Joint *luax_checkjoint(lua_State *L, int idx); +int w_Joint_getType(lua_State *L); +int w_Joint_getAnchors(lua_State *L); +int w_Joint_getReactionForce(lua_State *L); +int w_Joint_getReactionTorque(lua_State *L); +int w_Joint_getCollideConnected(lua_State *L); +int w_Joint_destroy(lua_State *L); +extern "C" int luaopen_joint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_JOINT_H diff --git a/src/modules/physics/box2d/wrap_MouseJoint.cpp b/src/modules/physics/box2d/wrap_MouseJoint.cpp index 9617c5c10..5641ab3ce 100644 --- a/src/modules/physics/box2d/wrap_MouseJoint.cpp +++ b/src/modules/physics/box2d/wrap_MouseJoint.cpp @@ -1,126 +1,126 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_MouseJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -MouseJoint *luax_checkmousejoint(lua_State *L, int idx) -{ - MouseJoint *j = luax_checktype(L, idx, "MouseJoint", PHYSICS_MOUSE_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_MouseJoint_setTarget(lua_State *L) -{ - MouseJoint *t = luax_checkmousejoint(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - t->setTarget(x, y); - return 0; -} - -int w_MouseJoint_getTarget(lua_State *L) -{ - MouseJoint *t = luax_checkmousejoint(L, 1); - lua_remove(L, 1); - return t->getTarget(L); -} - -int w_MouseJoint_setMaxForce(lua_State *L) -{ - MouseJoint *t = luax_checkmousejoint(L, 1); - float f = (float)luaL_checknumber(L, 2); - t->setMaxForce(f); - return 0; -} - -int w_MouseJoint_getMaxForce(lua_State *L) -{ - MouseJoint *t = luax_checkmousejoint(L, 1); - lua_pushnumber(L, t->getMaxForce()); - return 1; -} - -int w_MouseJoint_setFrequency(lua_State *L) -{ - MouseJoint *t = luax_checkmousejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setFrequency(arg1); - return 0; -} - -int w_MouseJoint_getFrequency(lua_State *L) -{ - MouseJoint *t = luax_checkmousejoint(L, 1); - lua_pushnumber(L, t->getFrequency()); - return 1; -} - -int w_MouseJoint_setDampingRatio(lua_State *L) -{ - MouseJoint *t = luax_checkmousejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setDampingRatio(arg1); - return 0; -} - -int w_MouseJoint_getDampingRatio(lua_State *L) -{ - MouseJoint *t = luax_checkmousejoint(L, 1); - lua_pushnumber(L, t->getDampingRatio()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "setTarget", w_MouseJoint_setTarget }, - { "getTarget", w_MouseJoint_getTarget }, - { "setMaxForce", w_MouseJoint_setMaxForce }, - { "getMaxForce", w_MouseJoint_getMaxForce }, - { "setFrequency", w_MouseJoint_setFrequency }, - { "getFrequency", w_MouseJoint_getFrequency }, - { "setDampingRatio", w_MouseJoint_setDampingRatio }, - { "getDampingRatio", w_MouseJoint_getDampingRatio }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_mousejoint(lua_State *L) -{ - return luax_register_type(L, "MouseJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_MouseJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +MouseJoint *luax_checkmousejoint(lua_State *L, int idx) +{ + MouseJoint *j = luax_checktype(L, idx, "MouseJoint", PHYSICS_MOUSE_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_MouseJoint_setTarget(lua_State *L) +{ + MouseJoint *t = luax_checkmousejoint(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + t->setTarget(x, y); + return 0; +} + +int w_MouseJoint_getTarget(lua_State *L) +{ + MouseJoint *t = luax_checkmousejoint(L, 1); + lua_remove(L, 1); + return t->getTarget(L); +} + +int w_MouseJoint_setMaxForce(lua_State *L) +{ + MouseJoint *t = luax_checkmousejoint(L, 1); + float f = (float)luaL_checknumber(L, 2); + t->setMaxForce(f); + return 0; +} + +int w_MouseJoint_getMaxForce(lua_State *L) +{ + MouseJoint *t = luax_checkmousejoint(L, 1); + lua_pushnumber(L, t->getMaxForce()); + return 1; +} + +int w_MouseJoint_setFrequency(lua_State *L) +{ + MouseJoint *t = luax_checkmousejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setFrequency(arg1); + return 0; +} + +int w_MouseJoint_getFrequency(lua_State *L) +{ + MouseJoint *t = luax_checkmousejoint(L, 1); + lua_pushnumber(L, t->getFrequency()); + return 1; +} + +int w_MouseJoint_setDampingRatio(lua_State *L) +{ + MouseJoint *t = luax_checkmousejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setDampingRatio(arg1); + return 0; +} + +int w_MouseJoint_getDampingRatio(lua_State *L) +{ + MouseJoint *t = luax_checkmousejoint(L, 1); + lua_pushnumber(L, t->getDampingRatio()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "setTarget", w_MouseJoint_setTarget }, + { "getTarget", w_MouseJoint_getTarget }, + { "setMaxForce", w_MouseJoint_setMaxForce }, + { "getMaxForce", w_MouseJoint_getMaxForce }, + { "setFrequency", w_MouseJoint_setFrequency }, + { "getFrequency", w_MouseJoint_getFrequency }, + { "setDampingRatio", w_MouseJoint_setDampingRatio }, + { "getDampingRatio", w_MouseJoint_getDampingRatio }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_mousejoint(lua_State *L) +{ + return luax_register_type(L, "MouseJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_MouseJoint.h b/src/modules/physics/box2d/wrap_MouseJoint.h index 1de7de330..5f740b5cb 100644 --- a/src/modules/physics/box2d/wrap_MouseJoint.h +++ b/src/modules/physics/box2d/wrap_MouseJoint.h @@ -1,51 +1,51 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_MOUSE_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_MOUSE_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "MouseJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -MouseJoint *luax_checkmousejoint(lua_State *L, int idx); -int w_MouseJoint_setTarget(lua_State *L); -int w_MouseJoint_getTarget(lua_State *L); -int w_MouseJoint_setMaxForce(lua_State *L); -int w_MouseJoint_getMaxForce(lua_State *L); -int w_MouseJoint_setFrequency(lua_State *L); -int w_MouseJoint_getFrequency(lua_State *L); -int w_MouseJoint_setDampingRatio(lua_State *L); -int w_MouseJoint_getDampingRatio(lua_State *L); -extern "C" int luaopen_mousejoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_MOUSE_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_MOUSE_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_MOUSE_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "MouseJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +MouseJoint *luax_checkmousejoint(lua_State *L, int idx); +int w_MouseJoint_setTarget(lua_State *L); +int w_MouseJoint_getTarget(lua_State *L); +int w_MouseJoint_setMaxForce(lua_State *L); +int w_MouseJoint_getMaxForce(lua_State *L); +int w_MouseJoint_setFrequency(lua_State *L); +int w_MouseJoint_getFrequency(lua_State *L); +int w_MouseJoint_setDampingRatio(lua_State *L); +int w_MouseJoint_getDampingRatio(lua_State *L); +extern "C" int luaopen_mousejoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_MOUSE_JOINT_H diff --git a/src/modules/physics/box2d/wrap_Physics.cpp b/src/modules/physics/box2d/wrap_Physics.cpp index 0c0b7a355..0f9d972e4 100644 --- a/src/modules/physics/box2d/wrap_Physics.cpp +++ b/src/modules/physics/box2d/wrap_Physics.cpp @@ -1,475 +1,475 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "wrap_Physics.h" -#include "wrap_World.h" -#include "wrap_Contact.h" -#include "wrap_Body.h" -#include "wrap_Fixture.h" -#include "wrap_Shape.h" -#include "wrap_CircleShape.h" -#include "wrap_PolygonShape.h" -#include "wrap_EdgeShape.h" -#include "wrap_ChainShape.h" -#include "wrap_Joint.h" -#include "wrap_MouseJoint.h" -#include "wrap_DistanceJoint.h" -#include "wrap_PrismaticJoint.h" -#include "wrap_RevoluteJoint.h" -#include "wrap_PulleyJoint.h" -#include "wrap_GearJoint.h" -#include "wrap_FrictionJoint.h" -#include "wrap_WeldJoint.h" -#include "wrap_WheelJoint.h" -#include "wrap_RopeJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -static Physics *instance = 0; - -int w_newWorld(lua_State *L) -{ - float gx = (float)luaL_optnumber(L, 1, 0); - float gy = (float)luaL_optnumber(L, 2, 0); - bool sleep = luax_optboolean(L, 3, true); - - World *w; - ASSERT_GUARD(w = instance->newWorld(gx, gy, sleep);) - luax_newtype(L, "World", PHYSICS_WORLD_T, (void *)w); - - return 1; -} - -int w_newBody(lua_State *L) -{ - World *world = luax_checktype(L, 1, "World", PHYSICS_WORLD_T); - float x = (float)luaL_optnumber(L, 2, 0.0); - float y = (float)luaL_optnumber(L, 3, 0.0); - const char *type = luaL_optstring(L, 4, "static"); - Body::Type bodyType; - Body::getConstant(type, bodyType); - Body *body; - ASSERT_GUARD(body = instance->newBody(world, x, y, bodyType);) - luax_newtype(L, "Body", PHYSICS_BODY_T, (void *)body); - return 1; -} - -int w_newFixture(lua_State *L) -{ - Body *body = luax_checkbody(L, 1); - Shape *shape = luax_checkshape(L, 2); - float density = (float)luaL_optnumber(L, 3, 1.0f); - Fixture *fixture; - ASSERT_GUARD(fixture = instance->newFixture(body, shape, density);) - luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)fixture); - return 1; -} - -int w_newCircleShape(lua_State *L) -{ - int top = lua_gettop(L); - - if (top == 1) - { - float radius = (float)luaL_checknumber(L, 1); - CircleShape *shape; - ASSERT_GUARD(shape = instance->newCircleShape(radius);) - luax_newtype(L, "CircleShape", PHYSICS_CIRCLE_SHAPE_T, (void *)shape); - return 1; - } - else if (top == 3) - { - float x = (float)luaL_checknumber(L, 1); - float y = (float)luaL_checknumber(L, 2); - float radius = (float)luaL_checknumber(L, 3); - CircleShape *shape; - ASSERT_GUARD(shape = instance->newCircleShape(x, y, radius);) - luax_newtype(L, "CircleShape", PHYSICS_CIRCLE_SHAPE_T, (void *)shape); - return 1; - } - else - return luaL_error(L, "Incorrect number of parameters"); -} - -int w_newRectangleShape(lua_State *L) -{ - int top = lua_gettop(L); - - if (top == 2) - { - float w = (float)luaL_checknumber(L, 1); - float h = (float)luaL_checknumber(L, 2); - PolygonShape *shape; - ASSERT_GUARD(shape = instance->newRectangleShape(w, h);) - luax_newtype(L, "PolygonShape", PHYSICS_POLYGON_SHAPE_T, (void *)shape); - return 1; - } - else if (top == 4 || top == 5) - { - float x = (float)luaL_checknumber(L, 1); - float y = (float)luaL_checknumber(L, 2); - float w = (float)luaL_checknumber(L, 3); - float h = (float)luaL_checknumber(L, 4); - float angle = (float)luaL_optnumber(L, 5, 0); - PolygonShape *shape; - ASSERT_GUARD(shape = instance->newRectangleShape(x, y, w, h, angle);) - luax_newtype(L, "PolygonShape", PHYSICS_POLYGON_SHAPE_T, (void *)shape); - return 1; - } - else - return luaL_error(L, "Incorrect number of parameters"); -} - -int w_newEdgeShape(lua_State *L) -{ - float x1 = (float)luaL_checknumber(L, 1); - float y1 = (float)luaL_checknumber(L, 2); - float x2 = (float)luaL_checknumber(L, 3); - float y2 = (float)luaL_checknumber(L, 4); - EdgeShape *shape; - ASSERT_GUARD(shape = instance->newEdgeShape(x1, y1, x2, y2);) - luax_newtype(L, "EdgeShape", PHYSICS_EDGE_SHAPE_T, (void *)shape); - return 1; -} - -int w_newPolygonShape(lua_State *L) -{ - ASSERT_GUARD(return instance->newPolygonShape(L);) -} - -int w_newChainShape(lua_State *L) -{ - ASSERT_GUARD(return instance->newChainShape(L);) -} - -int w_newDistanceJoint(lua_State *L) -{ - Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); - float x1 = (float)luaL_checknumber(L, 3); - float y1 = (float)luaL_checknumber(L, 4); - float x2 = (float)luaL_checknumber(L, 5); - float y2 = (float)luaL_checknumber(L, 6); - bool collideConnected = luax_optboolean(L, 7, false); - DistanceJoint *j; - ASSERT_GUARD(j = instance->newDistanceJoint(body1, body2, x1, y1, x2, y2, collideConnected);) - luax_newtype(L, "DistanceJoint", PHYSICS_DISTANCE_JOINT_T, (void *)j); - return 1; -} - -int w_newMouseJoint(lua_State *L) -{ - Body *body = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - MouseJoint *j; - ASSERT_GUARD(j = instance->newMouseJoint(body, x, y);) - luax_newtype(L, "MouseJoint", PHYSICS_MOUSE_JOINT_T, (void *)j); - return 1; -} - -int w_newRevoluteJoint(lua_State *L) -{ - Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); - float x = (float)luaL_checknumber(L, 3); - float y = (float)luaL_checknumber(L, 4); - bool collideConnected = luax_optboolean(L, 5, false); - RevoluteJoint *j; - ASSERT_GUARD(j = instance->newRevoluteJoint(body1, body2, x, y, collideConnected);) - luax_newtype(L, "RevoluteJoint", PHYSICS_REVOLUTE_JOINT_T, (void *)j); - return 1; -} - -int w_newPrismaticJoint(lua_State *L) -{ - Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); - float xA = (float)luaL_checknumber(L, 3); - float yA = (float)luaL_checknumber(L, 4); - float xB, yB, ax, ay; - bool collideConnected; - if (lua_gettop(L) >= 8) - { - xB = (float)luaL_checknumber(L, 5); - yB = (float)luaL_checknumber(L, 6); - ax = (float)luaL_checknumber(L, 7); - ay = (float)luaL_checknumber(L, 8); - collideConnected = luax_optboolean(L, 9, false); - } - else - { - xB = xA; - yB = yA; - ax = (float)luaL_checknumber(L, 5); - ay = (float)luaL_checknumber(L, 6); - collideConnected = luax_optboolean(L, 7, false); - } - PrismaticJoint *j; - ASSERT_GUARD(j = instance->newPrismaticJoint(body1, body2, xA, yA, xB, yB, ax, ay, collideConnected);) - luax_newtype(L, "PrismaticJoint", PHYSICS_PRISMATIC_JOINT_T, (void *)j); - return 1; -} - -int w_newPulleyJoint(lua_State *L) -{ - Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); - float gx1 = (float)luaL_checknumber(L, 3); - float gy1 = (float)luaL_checknumber(L, 4); - float gx2 = (float)luaL_checknumber(L, 5); - float gy2 = (float)luaL_checknumber(L, 6); - float x1 = (float)luaL_checknumber(L, 7); - float y1 = (float)luaL_checknumber(L, 8); - float x2 = (float)luaL_checknumber(L, 9); - float y2 = (float)luaL_checknumber(L, 10); - float ratio = (float)luaL_optnumber(L, 11, 1.0); - bool collideConnected = luax_optboolean(L, 12, true); // PulleyJoints default to colliding connected bodies, see b2PulleyJoint.h - - PulleyJoint *j; - ASSERT_GUARD(j = instance->newPulleyJoint(body1, body2, b2Vec2(gx1,gy1), b2Vec2(gx2,gy2), b2Vec2(x1,y1), b2Vec2(x2,y2), ratio, collideConnected);) - luax_newtype(L, "PulleyJoint", PHYSICS_PULLEY_JOINT_T, (void *)j); - return 1; -} - -int w_newGearJoint(lua_State *L) -{ - Joint *joint1 = luax_checktype(L, 1, "Joint", PHYSICS_JOINT_T); - Joint *joint2 = luax_checktype(L, 2, "Joint", PHYSICS_JOINT_T); - float ratio = (float)luaL_optnumber(L, 3, 1.0); - bool collideConnected = luax_optboolean(L, 4, false); - - GearJoint *j; - ASSERT_GUARD(j = instance->newGearJoint(joint1, joint2, ratio, collideConnected);) - luax_newtype(L, "GearJoint", PHYSICS_GEAR_JOINT_T, (void *)j); - return 1; -} - -int w_newFrictionJoint(lua_State *L) -{ - Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); - float xA = (float)luaL_checknumber(L, 3); - float yA = (float)luaL_checknumber(L, 4); - float xB, yB; - bool collideConnected; - if (lua_gettop(L) >= 6) - { - xB = (float)luaL_checknumber(L, 5); - yB = (float)luaL_checknumber(L, 6); - collideConnected = luax_optboolean(L, 7, false); - } - else - { - xB = xA; - yB = yA; - collideConnected = luax_optboolean(L, 5, false); - } - FrictionJoint *j; - ASSERT_GUARD(j = instance->newFrictionJoint(body1, body2, xA, yA, xB, yB, collideConnected);) - luax_newtype(L, "FrictionJoint", PHYSICS_FRICTION_JOINT_T, (void *)j); - return 1; -} - -int w_newWeldJoint(lua_State *L) -{ - Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); - float xA = (float)luaL_checknumber(L, 3); - float yA = (float)luaL_checknumber(L, 4); - float xB, yB; - bool collideConnected; - if (lua_gettop(L) >= 6) - { - xB = (float)luaL_checknumber(L, 5); - yB = (float)luaL_checknumber(L, 6); - collideConnected = luax_optboolean(L, 7, false); - } - else - { - xB = xA; - yB = yA; - collideConnected = luax_optboolean(L, 5, false); - } - WeldJoint *j; - ASSERT_GUARD(j = instance->newWeldJoint(body1, body2, xA, yA, xB, yB, collideConnected);) - luax_newtype(L, "WeldJoint", PHYSICS_WELD_JOINT_T, (void *)j); - return 1; -} - -int w_newWheelJoint(lua_State *L) -{ - Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); - float xA = (float)luaL_checknumber(L, 3); - float yA = (float)luaL_checknumber(L, 4); - float xB, yB, ax, ay; - bool collideConnected; - if (lua_gettop(L) >= 8) - { - xB = (float)luaL_checknumber(L, 5); - yB = (float)luaL_checknumber(L, 6); - ax = (float)luaL_checknumber(L, 7); - ay = (float)luaL_checknumber(L, 8); - collideConnected = luax_optboolean(L, 9, false); - } - else - { - xB = xA; - yB = yA; - ax = (float)luaL_checknumber(L, 5); - ay = (float)luaL_checknumber(L, 6); - collideConnected = luax_optboolean(L, 7, false); - } - - WheelJoint *j; - ASSERT_GUARD(j = instance->newWheelJoint(body1, body2, xA, yA, xB, yB, ax, ay, collideConnected);) - luax_newtype(L, "WheelJoint", PHYSICS_WHEEL_JOINT_T, (void *)j); - return 1; -} - -int w_newRopeJoint(lua_State *L) -{ - Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); - Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); - float x1 = (float)luaL_checknumber(L, 3); - float y1 = (float)luaL_checknumber(L, 4); - float x2 = (float)luaL_checknumber(L, 5); - float y2 = (float)luaL_checknumber(L, 6); - float maxLength = (float)luaL_checknumber(L, 7); - bool collideConnected = luax_optboolean(L, 8, false); - RopeJoint *j; - ASSERT_GUARD(j = instance->newRopeJoint(body1, body2, x1, y1, x2, y2, maxLength, collideConnected);) - luax_newtype(L, "RopeJoint", PHYSICS_ROPE_JOINT_T, (void *)j); - return 1; -} - -int w_getDistance(lua_State *L) -{ - return instance->getDistance(L); -} - -int w_setMeter(lua_State *L) -{ - int arg1 = luaL_checkint(L, 1); - try - { - Physics::setMeter(arg1); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - return 0; - -} -int w_getMeter(lua_State *L) -{ - lua_pushinteger(L, Physics::getMeter()); - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "newWorld", w_newWorld }, - { "newBody", w_newBody }, - { "newFixture", w_newFixture }, - { "newCircleShape", w_newCircleShape }, - { "newRectangleShape", w_newRectangleShape }, - { "newPolygonShape", w_newPolygonShape }, - { "newEdgeShape", w_newEdgeShape }, - { "newChainShape", w_newChainShape }, - { "newDistanceJoint", w_newDistanceJoint }, - { "newMouseJoint", w_newMouseJoint }, - { "newRevoluteJoint", w_newRevoluteJoint }, - { "newPrismaticJoint", w_newPrismaticJoint }, - { "newPulleyJoint", w_newPulleyJoint }, - { "newGearJoint", w_newGearJoint }, - { "newFrictionJoint", w_newFrictionJoint }, - { "newWeldJoint", w_newWeldJoint }, - { "newWheelJoint", w_newWheelJoint }, - { "newRopeJoint", w_newRopeJoint }, - { "getDistance", w_getDistance }, - { "getMeter", w_getMeter }, - { "setMeter", w_setMeter }, - { 0, 0 }, -}; - -static const lua_CFunction types[] = -{ - luaopen_world, - luaopen_contact, - luaopen_body, - luaopen_fixture, - luaopen_shape, - luaopen_circleshape, - luaopen_polygonshape, - luaopen_edgeshape, - luaopen_chainshape, - luaopen_joint, - luaopen_mousejoint, - luaopen_distancejoint, - luaopen_prismaticjoint, - luaopen_revolutejoint, - luaopen_pulleyjoint, - luaopen_gearjoint, - luaopen_frictionjoint, - luaopen_weldjoint, - luaopen_wheeljoint, - luaopen_ropejoint, - 0 -}; - -extern "C" int luaopen_love_physics(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new Physics(); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "physics"; - w.flags = MODULE_T; - w.functions = functions; - w.types = types; - - return luax_register_module(L, w); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "wrap_Physics.h" +#include "wrap_World.h" +#include "wrap_Contact.h" +#include "wrap_Body.h" +#include "wrap_Fixture.h" +#include "wrap_Shape.h" +#include "wrap_CircleShape.h" +#include "wrap_PolygonShape.h" +#include "wrap_EdgeShape.h" +#include "wrap_ChainShape.h" +#include "wrap_Joint.h" +#include "wrap_MouseJoint.h" +#include "wrap_DistanceJoint.h" +#include "wrap_PrismaticJoint.h" +#include "wrap_RevoluteJoint.h" +#include "wrap_PulleyJoint.h" +#include "wrap_GearJoint.h" +#include "wrap_FrictionJoint.h" +#include "wrap_WeldJoint.h" +#include "wrap_WheelJoint.h" +#include "wrap_RopeJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +static Physics *instance = 0; + +int w_newWorld(lua_State *L) +{ + float gx = (float)luaL_optnumber(L, 1, 0); + float gy = (float)luaL_optnumber(L, 2, 0); + bool sleep = luax_optboolean(L, 3, true); + + World *w; + ASSERT_GUARD(w = instance->newWorld(gx, gy, sleep);) + luax_newtype(L, "World", PHYSICS_WORLD_T, (void *)w); + + return 1; +} + +int w_newBody(lua_State *L) +{ + World *world = luax_checktype(L, 1, "World", PHYSICS_WORLD_T); + float x = (float)luaL_optnumber(L, 2, 0.0); + float y = (float)luaL_optnumber(L, 3, 0.0); + const char *type = luaL_optstring(L, 4, "static"); + Body::Type bodyType; + Body::getConstant(type, bodyType); + Body *body; + ASSERT_GUARD(body = instance->newBody(world, x, y, bodyType);) + luax_newtype(L, "Body", PHYSICS_BODY_T, (void *)body); + return 1; +} + +int w_newFixture(lua_State *L) +{ + Body *body = luax_checkbody(L, 1); + Shape *shape = luax_checkshape(L, 2); + float density = (float)luaL_optnumber(L, 3, 1.0f); + Fixture *fixture; + ASSERT_GUARD(fixture = instance->newFixture(body, shape, density);) + luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void *)fixture); + return 1; +} + +int w_newCircleShape(lua_State *L) +{ + int top = lua_gettop(L); + + if (top == 1) + { + float radius = (float)luaL_checknumber(L, 1); + CircleShape *shape; + ASSERT_GUARD(shape = instance->newCircleShape(radius);) + luax_newtype(L, "CircleShape", PHYSICS_CIRCLE_SHAPE_T, (void *)shape); + return 1; + } + else if (top == 3) + { + float x = (float)luaL_checknumber(L, 1); + float y = (float)luaL_checknumber(L, 2); + float radius = (float)luaL_checknumber(L, 3); + CircleShape *shape; + ASSERT_GUARD(shape = instance->newCircleShape(x, y, radius);) + luax_newtype(L, "CircleShape", PHYSICS_CIRCLE_SHAPE_T, (void *)shape); + return 1; + } + else + return luaL_error(L, "Incorrect number of parameters"); +} + +int w_newRectangleShape(lua_State *L) +{ + int top = lua_gettop(L); + + if (top == 2) + { + float w = (float)luaL_checknumber(L, 1); + float h = (float)luaL_checknumber(L, 2); + PolygonShape *shape; + ASSERT_GUARD(shape = instance->newRectangleShape(w, h);) + luax_newtype(L, "PolygonShape", PHYSICS_POLYGON_SHAPE_T, (void *)shape); + return 1; + } + else if (top == 4 || top == 5) + { + float x = (float)luaL_checknumber(L, 1); + float y = (float)luaL_checknumber(L, 2); + float w = (float)luaL_checknumber(L, 3); + float h = (float)luaL_checknumber(L, 4); + float angle = (float)luaL_optnumber(L, 5, 0); + PolygonShape *shape; + ASSERT_GUARD(shape = instance->newRectangleShape(x, y, w, h, angle);) + luax_newtype(L, "PolygonShape", PHYSICS_POLYGON_SHAPE_T, (void *)shape); + return 1; + } + else + return luaL_error(L, "Incorrect number of parameters"); +} + +int w_newEdgeShape(lua_State *L) +{ + float x1 = (float)luaL_checknumber(L, 1); + float y1 = (float)luaL_checknumber(L, 2); + float x2 = (float)luaL_checknumber(L, 3); + float y2 = (float)luaL_checknumber(L, 4); + EdgeShape *shape; + ASSERT_GUARD(shape = instance->newEdgeShape(x1, y1, x2, y2);) + luax_newtype(L, "EdgeShape", PHYSICS_EDGE_SHAPE_T, (void *)shape); + return 1; +} + +int w_newPolygonShape(lua_State *L) +{ + ASSERT_GUARD(return instance->newPolygonShape(L);) +} + +int w_newChainShape(lua_State *L) +{ + ASSERT_GUARD(return instance->newChainShape(L);) +} + +int w_newDistanceJoint(lua_State *L) +{ + Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); + float x1 = (float)luaL_checknumber(L, 3); + float y1 = (float)luaL_checknumber(L, 4); + float x2 = (float)luaL_checknumber(L, 5); + float y2 = (float)luaL_checknumber(L, 6); + bool collideConnected = luax_optboolean(L, 7, false); + DistanceJoint *j; + ASSERT_GUARD(j = instance->newDistanceJoint(body1, body2, x1, y1, x2, y2, collideConnected);) + luax_newtype(L, "DistanceJoint", PHYSICS_DISTANCE_JOINT_T, (void *)j); + return 1; +} + +int w_newMouseJoint(lua_State *L) +{ + Body *body = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + MouseJoint *j; + ASSERT_GUARD(j = instance->newMouseJoint(body, x, y);) + luax_newtype(L, "MouseJoint", PHYSICS_MOUSE_JOINT_T, (void *)j); + return 1; +} + +int w_newRevoluteJoint(lua_State *L) +{ + Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); + float x = (float)luaL_checknumber(L, 3); + float y = (float)luaL_checknumber(L, 4); + bool collideConnected = luax_optboolean(L, 5, false); + RevoluteJoint *j; + ASSERT_GUARD(j = instance->newRevoluteJoint(body1, body2, x, y, collideConnected);) + luax_newtype(L, "RevoluteJoint", PHYSICS_REVOLUTE_JOINT_T, (void *)j); + return 1; +} + +int w_newPrismaticJoint(lua_State *L) +{ + Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); + float xA = (float)luaL_checknumber(L, 3); + float yA = (float)luaL_checknumber(L, 4); + float xB, yB, ax, ay; + bool collideConnected; + if (lua_gettop(L) >= 8) + { + xB = (float)luaL_checknumber(L, 5); + yB = (float)luaL_checknumber(L, 6); + ax = (float)luaL_checknumber(L, 7); + ay = (float)luaL_checknumber(L, 8); + collideConnected = luax_optboolean(L, 9, false); + } + else + { + xB = xA; + yB = yA; + ax = (float)luaL_checknumber(L, 5); + ay = (float)luaL_checknumber(L, 6); + collideConnected = luax_optboolean(L, 7, false); + } + PrismaticJoint *j; + ASSERT_GUARD(j = instance->newPrismaticJoint(body1, body2, xA, yA, xB, yB, ax, ay, collideConnected);) + luax_newtype(L, "PrismaticJoint", PHYSICS_PRISMATIC_JOINT_T, (void *)j); + return 1; +} + +int w_newPulleyJoint(lua_State *L) +{ + Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); + float gx1 = (float)luaL_checknumber(L, 3); + float gy1 = (float)luaL_checknumber(L, 4); + float gx2 = (float)luaL_checknumber(L, 5); + float gy2 = (float)luaL_checknumber(L, 6); + float x1 = (float)luaL_checknumber(L, 7); + float y1 = (float)luaL_checknumber(L, 8); + float x2 = (float)luaL_checknumber(L, 9); + float y2 = (float)luaL_checknumber(L, 10); + float ratio = (float)luaL_optnumber(L, 11, 1.0); + bool collideConnected = luax_optboolean(L, 12, true); // PulleyJoints default to colliding connected bodies, see b2PulleyJoint.h + + PulleyJoint *j; + ASSERT_GUARD(j = instance->newPulleyJoint(body1, body2, b2Vec2(gx1,gy1), b2Vec2(gx2,gy2), b2Vec2(x1,y1), b2Vec2(x2,y2), ratio, collideConnected);) + luax_newtype(L, "PulleyJoint", PHYSICS_PULLEY_JOINT_T, (void *)j); + return 1; +} + +int w_newGearJoint(lua_State *L) +{ + Joint *joint1 = luax_checktype(L, 1, "Joint", PHYSICS_JOINT_T); + Joint *joint2 = luax_checktype(L, 2, "Joint", PHYSICS_JOINT_T); + float ratio = (float)luaL_optnumber(L, 3, 1.0); + bool collideConnected = luax_optboolean(L, 4, false); + + GearJoint *j; + ASSERT_GUARD(j = instance->newGearJoint(joint1, joint2, ratio, collideConnected);) + luax_newtype(L, "GearJoint", PHYSICS_GEAR_JOINT_T, (void *)j); + return 1; +} + +int w_newFrictionJoint(lua_State *L) +{ + Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); + float xA = (float)luaL_checknumber(L, 3); + float yA = (float)luaL_checknumber(L, 4); + float xB, yB; + bool collideConnected; + if (lua_gettop(L) >= 6) + { + xB = (float)luaL_checknumber(L, 5); + yB = (float)luaL_checknumber(L, 6); + collideConnected = luax_optboolean(L, 7, false); + } + else + { + xB = xA; + yB = yA; + collideConnected = luax_optboolean(L, 5, false); + } + FrictionJoint *j; + ASSERT_GUARD(j = instance->newFrictionJoint(body1, body2, xA, yA, xB, yB, collideConnected);) + luax_newtype(L, "FrictionJoint", PHYSICS_FRICTION_JOINT_T, (void *)j); + return 1; +} + +int w_newWeldJoint(lua_State *L) +{ + Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); + float xA = (float)luaL_checknumber(L, 3); + float yA = (float)luaL_checknumber(L, 4); + float xB, yB; + bool collideConnected; + if (lua_gettop(L) >= 6) + { + xB = (float)luaL_checknumber(L, 5); + yB = (float)luaL_checknumber(L, 6); + collideConnected = luax_optboolean(L, 7, false); + } + else + { + xB = xA; + yB = yA; + collideConnected = luax_optboolean(L, 5, false); + } + WeldJoint *j; + ASSERT_GUARD(j = instance->newWeldJoint(body1, body2, xA, yA, xB, yB, collideConnected);) + luax_newtype(L, "WeldJoint", PHYSICS_WELD_JOINT_T, (void *)j); + return 1; +} + +int w_newWheelJoint(lua_State *L) +{ + Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); + float xA = (float)luaL_checknumber(L, 3); + float yA = (float)luaL_checknumber(L, 4); + float xB, yB, ax, ay; + bool collideConnected; + if (lua_gettop(L) >= 8) + { + xB = (float)luaL_checknumber(L, 5); + yB = (float)luaL_checknumber(L, 6); + ax = (float)luaL_checknumber(L, 7); + ay = (float)luaL_checknumber(L, 8); + collideConnected = luax_optboolean(L, 9, false); + } + else + { + xB = xA; + yB = yA; + ax = (float)luaL_checknumber(L, 5); + ay = (float)luaL_checknumber(L, 6); + collideConnected = luax_optboolean(L, 7, false); + } + + WheelJoint *j; + ASSERT_GUARD(j = instance->newWheelJoint(body1, body2, xA, yA, xB, yB, ax, ay, collideConnected);) + luax_newtype(L, "WheelJoint", PHYSICS_WHEEL_JOINT_T, (void *)j); + return 1; +} + +int w_newRopeJoint(lua_State *L) +{ + Body *body1 = luax_checktype(L, 1, "Body", PHYSICS_BODY_T); + Body *body2 = luax_checktype(L, 2, "Body", PHYSICS_BODY_T); + float x1 = (float)luaL_checknumber(L, 3); + float y1 = (float)luaL_checknumber(L, 4); + float x2 = (float)luaL_checknumber(L, 5); + float y2 = (float)luaL_checknumber(L, 6); + float maxLength = (float)luaL_checknumber(L, 7); + bool collideConnected = luax_optboolean(L, 8, false); + RopeJoint *j; + ASSERT_GUARD(j = instance->newRopeJoint(body1, body2, x1, y1, x2, y2, maxLength, collideConnected);) + luax_newtype(L, "RopeJoint", PHYSICS_ROPE_JOINT_T, (void *)j); + return 1; +} + +int w_getDistance(lua_State *L) +{ + return instance->getDistance(L); +} + +int w_setMeter(lua_State *L) +{ + int arg1 = luaL_checkint(L, 1); + try + { + Physics::setMeter(arg1); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + return 0; + +} +int w_getMeter(lua_State *L) +{ + lua_pushinteger(L, Physics::getMeter()); + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "newWorld", w_newWorld }, + { "newBody", w_newBody }, + { "newFixture", w_newFixture }, + { "newCircleShape", w_newCircleShape }, + { "newRectangleShape", w_newRectangleShape }, + { "newPolygonShape", w_newPolygonShape }, + { "newEdgeShape", w_newEdgeShape }, + { "newChainShape", w_newChainShape }, + { "newDistanceJoint", w_newDistanceJoint }, + { "newMouseJoint", w_newMouseJoint }, + { "newRevoluteJoint", w_newRevoluteJoint }, + { "newPrismaticJoint", w_newPrismaticJoint }, + { "newPulleyJoint", w_newPulleyJoint }, + { "newGearJoint", w_newGearJoint }, + { "newFrictionJoint", w_newFrictionJoint }, + { "newWeldJoint", w_newWeldJoint }, + { "newWheelJoint", w_newWheelJoint }, + { "newRopeJoint", w_newRopeJoint }, + { "getDistance", w_getDistance }, + { "getMeter", w_getMeter }, + { "setMeter", w_setMeter }, + { 0, 0 }, +}; + +static const lua_CFunction types[] = +{ + luaopen_world, + luaopen_contact, + luaopen_body, + luaopen_fixture, + luaopen_shape, + luaopen_circleshape, + luaopen_polygonshape, + luaopen_edgeshape, + luaopen_chainshape, + luaopen_joint, + luaopen_mousejoint, + luaopen_distancejoint, + luaopen_prismaticjoint, + luaopen_revolutejoint, + luaopen_pulleyjoint, + luaopen_gearjoint, + luaopen_frictionjoint, + luaopen_weldjoint, + luaopen_wheeljoint, + luaopen_ropejoint, + 0 +}; + +extern "C" int luaopen_love_physics(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new Physics(); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "physics"; + w.flags = MODULE_T; + w.functions = functions; + w.types = types; + + return luax_register_module(L, w); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_Physics.h b/src/modules/physics/box2d/wrap_Physics.h index c7edf9b1b..fce406b40 100644 --- a/src/modules/physics/box2d/wrap_Physics.h +++ b/src/modules/physics/box2d/wrap_Physics.h @@ -1,64 +1,64 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_PHYSICS_H -#define LOVE_PHYSICS_BOX2D_WRAP_PHYSICS_H - -// LOVE -#include "common/config.h" -#include "Physics.h" - -#define ASSERT_GUARD(A) try { A } catch (love::Exception & e) { return luaL_error(L, "%s", e.what()); } - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -int w_newWorld(lua_State *L); -int w_newBody(lua_State *L); -int w_newFixture(lua_State *L); -int w_newCircleShape(lua_State *L); -int w_newRectangleShape(lua_State *L); -int w_newPolygonShape(lua_State *L); -int w_newEdgeShape(lua_State *L); -int w_newChainShape(lua_State *L); -int w_newDistanceJoint(lua_State *L); -int w_newMouseJoint(lua_State *L); -int w_newRevoluteJoint(lua_State *L); -int w_newPrismaticJoint(lua_State *L); -int w_newPulleyJoint(lua_State *L); -int w_newGearJoint(lua_State *L); -int w_newFrictionJoint(lua_State *L); -int w_newWeldJoint(lua_State *L); -int w_newWheelJoint(lua_State *L); -int w_newRopeJoint(lua_State *L); -int w_getDistance(lua_State *L); -int w_setMeter(lua_State *L); -int w_getMeter(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_physics(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_PHYSICS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_PHYSICS_H +#define LOVE_PHYSICS_BOX2D_WRAP_PHYSICS_H + +// LOVE +#include "common/config.h" +#include "Physics.h" + +#define ASSERT_GUARD(A) try { A } catch (love::Exception & e) { return luaL_error(L, "%s", e.what()); } + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +int w_newWorld(lua_State *L); +int w_newBody(lua_State *L); +int w_newFixture(lua_State *L); +int w_newCircleShape(lua_State *L); +int w_newRectangleShape(lua_State *L); +int w_newPolygonShape(lua_State *L); +int w_newEdgeShape(lua_State *L); +int w_newChainShape(lua_State *L); +int w_newDistanceJoint(lua_State *L); +int w_newMouseJoint(lua_State *L); +int w_newRevoluteJoint(lua_State *L); +int w_newPrismaticJoint(lua_State *L); +int w_newPulleyJoint(lua_State *L); +int w_newGearJoint(lua_State *L); +int w_newFrictionJoint(lua_State *L); +int w_newWeldJoint(lua_State *L); +int w_newWheelJoint(lua_State *L); +int w_newRopeJoint(lua_State *L); +int w_getDistance(lua_State *L); +int w_setMeter(lua_State *L); +int w_getMeter(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_physics(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_PHYSICS_H diff --git a/src/modules/physics/box2d/wrap_PolygonShape.cpp b/src/modules/physics/box2d/wrap_PolygonShape.cpp index 714e9964d..115813339 100644 --- a/src/modules/physics/box2d/wrap_PolygonShape.cpp +++ b/src/modules/physics/box2d/wrap_PolygonShape.cpp @@ -1,63 +1,63 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_PolygonShape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PolygonShape *luax_checkpolygonshape(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "PolygonShape", PHYSICS_POLYGON_SHAPE_T); -} - -int w_PolygonShape_getPoints(lua_State *L) -{ - PolygonShape *t = luax_checkpolygonshape(L, 1); - lua_remove(L, 1); - return t->getPoints(L); -} - -static const luaL_Reg functions[] = -{ - { "getPoints", w_PolygonShape_getPoints }, - // From Shape. - { "getType", w_Shape_getType }, - { "getRadius", w_Shape_getRadius }, - { "getChildCount", w_Shape_getChildCount }, - { "testPoint", w_Shape_testPoint }, - { "rayCast", w_Shape_rayCast }, - { "computeAABB", w_Shape_computeAABB }, - { "computeMass", w_Shape_computeMass }, - { 0, 0 } -}; - -extern "C" int luaopen_polygonshape(lua_State *L) -{ - return luax_register_type(L, "PolygonShape", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_PolygonShape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PolygonShape *luax_checkpolygonshape(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "PolygonShape", PHYSICS_POLYGON_SHAPE_T); +} + +int w_PolygonShape_getPoints(lua_State *L) +{ + PolygonShape *t = luax_checkpolygonshape(L, 1); + lua_remove(L, 1); + return t->getPoints(L); +} + +static const luaL_Reg functions[] = +{ + { "getPoints", w_PolygonShape_getPoints }, + // From Shape. + { "getType", w_Shape_getType }, + { "getRadius", w_Shape_getRadius }, + { "getChildCount", w_Shape_getChildCount }, + { "testPoint", w_Shape_testPoint }, + { "rayCast", w_Shape_rayCast }, + { "computeAABB", w_Shape_computeAABB }, + { "computeMass", w_Shape_computeMass }, + { 0, 0 } +}; + +extern "C" int luaopen_polygonshape(lua_State *L) +{ + return luax_register_type(L, "PolygonShape", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_PolygonShape.h b/src/modules/physics/box2d/wrap_PolygonShape.h index 87948530e..63167649e 100644 --- a/src/modules/physics/box2d/wrap_PolygonShape.h +++ b/src/modules/physics/box2d/wrap_PolygonShape.h @@ -1,44 +1,44 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_POLYGON_SHAPE_H -#define LOVE_PHYSICS_BOX2D_WRAP_POLYGON_SHAPE_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Shape.h" -#include "PolygonShape.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PolygonShape *luax_checkpolygonshape(lua_State *L, int idx); -int w_PolygonShape_getPoints(lua_State *L); -extern "C" int luaopen_polygonshape(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_POLYGON_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_POLYGON_SHAPE_H +#define LOVE_PHYSICS_BOX2D_WRAP_POLYGON_SHAPE_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Shape.h" +#include "PolygonShape.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PolygonShape *luax_checkpolygonshape(lua_State *L, int idx); +int w_PolygonShape_getPoints(lua_State *L); +extern "C" int luaopen_polygonshape(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_POLYGON_SHAPE_H diff --git a/src/modules/physics/box2d/wrap_PrismaticJoint.cpp b/src/modules/physics/box2d/wrap_PrismaticJoint.cpp index 4b3cf1ab9..5c5b4b671 100644 --- a/src/modules/physics/box2d/wrap_PrismaticJoint.cpp +++ b/src/modules/physics/box2d/wrap_PrismaticJoint.cpp @@ -1,202 +1,202 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_PrismaticJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PrismaticJoint *luax_checkprismaticjoint(lua_State *L, int idx) -{ - PrismaticJoint *j = luax_checktype(L, idx, "PrismaticJoint", PHYSICS_PRISMATIC_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_PrismaticJoint_getJointTranslation(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - lua_pushnumber(L, t->getJointTranslation()); - return 1; -} - -int w_PrismaticJoint_getJointSpeed(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - lua_pushnumber(L, t->getJointSpeed()); - return 1; -} - -int w_PrismaticJoint_enableMotor(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - bool arg1 = luax_toboolean(L, 2); - t->enableMotor(arg1); - return 0; -} - -int w_PrismaticJoint_isMotorEnabled(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - luax_pushboolean(L, t->isMotorEnabled()); - return 1; -} - -int w_PrismaticJoint_setMaxMotorForce(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setMaxMotorForce(arg1); - return 0; -} - -int w_PrismaticJoint_setMotorSpeed(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setMotorSpeed(arg1); - return 0; -} - -int w_PrismaticJoint_getMotorSpeed(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - lua_pushnumber(L, t->getMotorSpeed()); - return 1; -} - -int w_PrismaticJoint_getMotorForce(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - float inv_dt = (float)luaL_checknumber(L, 2); - lua_pushnumber(L, t->getMotorForce(inv_dt)); - return 1; -} - -int w_PrismaticJoint_getMaxMotorForce(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - lua_pushnumber(L, t->getMaxMotorForce()); - return 1; -} - -int w_PrismaticJoint_enableLimit(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - bool arg1 = luax_toboolean(L, 2); - t->enableLimit(arg1); - return 0; -} - -int w_PrismaticJoint_isLimitEnabled(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - luax_pushboolean(L, t->isLimitEnabled()); - return 1; -} - -int w_PrismaticJoint_setUpperLimit(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setUpperLimit(arg1); - return 0; -} - -int w_PrismaticJoint_setLowerLimit(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setLowerLimit(arg1); - return 0; -} - -int w_PrismaticJoint_setLimits(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_checknumber(L, 3); - t->setLimits(arg1, arg2); - return 0; -} - -int w_PrismaticJoint_getLowerLimit(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - lua_pushnumber(L, t->getLowerLimit()); - return 1; -} - -int w_PrismaticJoint_getUpperLimit(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - lua_pushnumber(L, t->getUpperLimit()); - return 1; -} - -int w_PrismaticJoint_getLimits(lua_State *L) -{ - PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - lua_remove(L, 1); - return t->getLimits(L); -} - -static const luaL_Reg functions[] = -{ - { "getJointTranslation", w_PrismaticJoint_getJointTranslation }, - { "getJointSpeed", w_PrismaticJoint_getJointSpeed }, - { "enableMotor", w_PrismaticJoint_enableMotor }, - { "isMotorEnabled", w_PrismaticJoint_isMotorEnabled }, - { "setMaxMotorForce", w_PrismaticJoint_setMaxMotorForce }, - { "setMotorSpeed", w_PrismaticJoint_setMotorSpeed }, - { "getMotorSpeed", w_PrismaticJoint_getMotorSpeed }, - { "getMotorForce", w_PrismaticJoint_getMotorForce }, - { "getMaxMotorForce", w_PrismaticJoint_getMaxMotorForce }, - { "enableLimit", w_PrismaticJoint_enableLimit }, - { "isLimitEnabled", w_PrismaticJoint_isLimitEnabled }, - { "setUpperLimit", w_PrismaticJoint_setUpperLimit }, - { "setLowerLimit", w_PrismaticJoint_setLowerLimit }, - { "setLimits", w_PrismaticJoint_setLimits }, - { "getLowerLimit", w_PrismaticJoint_getLowerLimit }, - { "getUpperLimit", w_PrismaticJoint_getUpperLimit }, - { "getLimits", w_PrismaticJoint_getLimits }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_prismaticjoint(lua_State *L) -{ - return luax_register_type(L, "PrismaticJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_PrismaticJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PrismaticJoint *luax_checkprismaticjoint(lua_State *L, int idx) +{ + PrismaticJoint *j = luax_checktype(L, idx, "PrismaticJoint", PHYSICS_PRISMATIC_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_PrismaticJoint_getJointTranslation(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + lua_pushnumber(L, t->getJointTranslation()); + return 1; +} + +int w_PrismaticJoint_getJointSpeed(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + lua_pushnumber(L, t->getJointSpeed()); + return 1; +} + +int w_PrismaticJoint_enableMotor(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + bool arg1 = luax_toboolean(L, 2); + t->enableMotor(arg1); + return 0; +} + +int w_PrismaticJoint_isMotorEnabled(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + luax_pushboolean(L, t->isMotorEnabled()); + return 1; +} + +int w_PrismaticJoint_setMaxMotorForce(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setMaxMotorForce(arg1); + return 0; +} + +int w_PrismaticJoint_setMotorSpeed(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setMotorSpeed(arg1); + return 0; +} + +int w_PrismaticJoint_getMotorSpeed(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + lua_pushnumber(L, t->getMotorSpeed()); + return 1; +} + +int w_PrismaticJoint_getMotorForce(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + float inv_dt = (float)luaL_checknumber(L, 2); + lua_pushnumber(L, t->getMotorForce(inv_dt)); + return 1; +} + +int w_PrismaticJoint_getMaxMotorForce(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + lua_pushnumber(L, t->getMaxMotorForce()); + return 1; +} + +int w_PrismaticJoint_enableLimit(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + bool arg1 = luax_toboolean(L, 2); + t->enableLimit(arg1); + return 0; +} + +int w_PrismaticJoint_isLimitEnabled(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + luax_pushboolean(L, t->isLimitEnabled()); + return 1; +} + +int w_PrismaticJoint_setUpperLimit(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setUpperLimit(arg1); + return 0; +} + +int w_PrismaticJoint_setLowerLimit(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setLowerLimit(arg1); + return 0; +} + +int w_PrismaticJoint_setLimits(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_checknumber(L, 3); + t->setLimits(arg1, arg2); + return 0; +} + +int w_PrismaticJoint_getLowerLimit(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + lua_pushnumber(L, t->getLowerLimit()); + return 1; +} + +int w_PrismaticJoint_getUpperLimit(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + lua_pushnumber(L, t->getUpperLimit()); + return 1; +} + +int w_PrismaticJoint_getLimits(lua_State *L) +{ + PrismaticJoint *t = luax_checkprismaticjoint(L, 1); + lua_remove(L, 1); + return t->getLimits(L); +} + +static const luaL_Reg functions[] = +{ + { "getJointTranslation", w_PrismaticJoint_getJointTranslation }, + { "getJointSpeed", w_PrismaticJoint_getJointSpeed }, + { "enableMotor", w_PrismaticJoint_enableMotor }, + { "isMotorEnabled", w_PrismaticJoint_isMotorEnabled }, + { "setMaxMotorForce", w_PrismaticJoint_setMaxMotorForce }, + { "setMotorSpeed", w_PrismaticJoint_setMotorSpeed }, + { "getMotorSpeed", w_PrismaticJoint_getMotorSpeed }, + { "getMotorForce", w_PrismaticJoint_getMotorForce }, + { "getMaxMotorForce", w_PrismaticJoint_getMaxMotorForce }, + { "enableLimit", w_PrismaticJoint_enableLimit }, + { "isLimitEnabled", w_PrismaticJoint_isLimitEnabled }, + { "setUpperLimit", w_PrismaticJoint_setUpperLimit }, + { "setLowerLimit", w_PrismaticJoint_setLowerLimit }, + { "setLimits", w_PrismaticJoint_setLimits }, + { "getLowerLimit", w_PrismaticJoint_getLowerLimit }, + { "getUpperLimit", w_PrismaticJoint_getUpperLimit }, + { "getLimits", w_PrismaticJoint_getLimits }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_prismaticjoint(lua_State *L) +{ + return luax_register_type(L, "PrismaticJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_PrismaticJoint.h b/src/modules/physics/box2d/wrap_PrismaticJoint.h index 1eed688ab..709e066ca 100644 --- a/src/modules/physics/box2d/wrap_PrismaticJoint.h +++ b/src/modules/physics/box2d/wrap_PrismaticJoint.h @@ -1,60 +1,60 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "PrismaticJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PrismaticJoint *luax_checkprismaticjoint(lua_State *L, int idx); -int w_PrismaticJoint_getJointTranslation(lua_State *L); -int w_PrismaticJoint_getJointSpeed(lua_State *L); -int w_PrismaticJoint_enableMotor(lua_State *L); -int w_PrismaticJoint_isMotorEnabled(lua_State *L); -int w_PrismaticJoint_setMaxMotorForce(lua_State *L); -int w_PrismaticJoint_setMotorSpeed(lua_State *L); -int w_PrismaticJoint_getMotorSpeed(lua_State *L); -int w_PrismaticJoint_getMotorForce(lua_State *L); -int w_PrismaticJoint_getMaxMotorForce(lua_State *L); -int w_PrismaticJoint_enableLimit(lua_State *L); -int w_PrismaticJoint_isLimitEnabled(lua_State *L); -int w_PrismaticJoint_setUpperLimit(lua_State *L); -int w_PrismaticJoint_setLowerLimit(lua_State *L); -int w_PrismaticJoint_setLimits(lua_State *L); -int w_PrismaticJoint_getLowerLimit(lua_State *L); -int w_PrismaticJoint_getUpperLimit(lua_State *L); -int w_PrismaticJoint_getLimits(lua_State *L); -extern "C" int luaopen_prismaticjoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "PrismaticJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PrismaticJoint *luax_checkprismaticjoint(lua_State *L, int idx); +int w_PrismaticJoint_getJointTranslation(lua_State *L); +int w_PrismaticJoint_getJointSpeed(lua_State *L); +int w_PrismaticJoint_enableMotor(lua_State *L); +int w_PrismaticJoint_isMotorEnabled(lua_State *L); +int w_PrismaticJoint_setMaxMotorForce(lua_State *L); +int w_PrismaticJoint_setMotorSpeed(lua_State *L); +int w_PrismaticJoint_getMotorSpeed(lua_State *L); +int w_PrismaticJoint_getMotorForce(lua_State *L); +int w_PrismaticJoint_getMaxMotorForce(lua_State *L); +int w_PrismaticJoint_enableLimit(lua_State *L); +int w_PrismaticJoint_isLimitEnabled(lua_State *L); +int w_PrismaticJoint_setUpperLimit(lua_State *L); +int w_PrismaticJoint_setLowerLimit(lua_State *L); +int w_PrismaticJoint_setLimits(lua_State *L); +int w_PrismaticJoint_getLowerLimit(lua_State *L); +int w_PrismaticJoint_getUpperLimit(lua_State *L); +int w_PrismaticJoint_getLimits(lua_State *L); +extern "C" int luaopen_prismaticjoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H diff --git a/src/modules/physics/box2d/wrap_PulleyJoint.cpp b/src/modules/physics/box2d/wrap_PulleyJoint.cpp index d76224c72..1e79b74e3 100644 --- a/src/modules/physics/box2d/wrap_PulleyJoint.cpp +++ b/src/modules/physics/box2d/wrap_PulleyJoint.cpp @@ -1,89 +1,89 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_PulleyJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PulleyJoint *luax_checkpulleyjoint(lua_State *L, int idx) -{ - PulleyJoint *j = luax_checktype(L, idx, "PulleyJoint", PHYSICS_PULLEY_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_PulleyJoint_getGroundAnchors(lua_State *L) -{ - PulleyJoint *t = luax_checkpulleyjoint(L, 1); - lua_remove(L, 1); - return t->getGroundAnchors(L); -} - -int w_PulleyJoint_getLengthA(lua_State *L) -{ - PulleyJoint *t = luax_checkpulleyjoint(L, 1); - lua_pushnumber(L, t->getLengthA()); - return 1; -} - -int w_PulleyJoint_getLengthB(lua_State *L) -{ - PulleyJoint *t = luax_checkpulleyjoint(L, 1); - lua_pushnumber(L, t->getLengthB()); - return 1; -} - -int w_PulleyJoint_getRatio(lua_State *L) -{ - PulleyJoint *t = luax_checkpulleyjoint(L, 1); - lua_pushnumber(L, t->getRatio()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "getGroundAnchors", w_PulleyJoint_getGroundAnchors }, - { "getLengthA", w_PulleyJoint_getLengthA }, - { "getLengthB", w_PulleyJoint_getLengthB }, - { "getRatio", w_PulleyJoint_getRatio }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_pulleyjoint(lua_State *L) -{ - return luax_register_type(L, "PulleyJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_PulleyJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PulleyJoint *luax_checkpulleyjoint(lua_State *L, int idx) +{ + PulleyJoint *j = luax_checktype(L, idx, "PulleyJoint", PHYSICS_PULLEY_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_PulleyJoint_getGroundAnchors(lua_State *L) +{ + PulleyJoint *t = luax_checkpulleyjoint(L, 1); + lua_remove(L, 1); + return t->getGroundAnchors(L); +} + +int w_PulleyJoint_getLengthA(lua_State *L) +{ + PulleyJoint *t = luax_checkpulleyjoint(L, 1); + lua_pushnumber(L, t->getLengthA()); + return 1; +} + +int w_PulleyJoint_getLengthB(lua_State *L) +{ + PulleyJoint *t = luax_checkpulleyjoint(L, 1); + lua_pushnumber(L, t->getLengthB()); + return 1; +} + +int w_PulleyJoint_getRatio(lua_State *L) +{ + PulleyJoint *t = luax_checkpulleyjoint(L, 1); + lua_pushnumber(L, t->getRatio()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "getGroundAnchors", w_PulleyJoint_getGroundAnchors }, + { "getLengthA", w_PulleyJoint_getLengthA }, + { "getLengthB", w_PulleyJoint_getLengthB }, + { "getRatio", w_PulleyJoint_getRatio }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_pulleyjoint(lua_State *L) +{ + return luax_register_type(L, "PulleyJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_PulleyJoint.h b/src/modules/physics/box2d/wrap_PulleyJoint.h index 885e186b6..201ca2ddd 100644 --- a/src/modules/physics/box2d/wrap_PulleyJoint.h +++ b/src/modules/physics/box2d/wrap_PulleyJoint.h @@ -1,47 +1,47 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_PULLEY_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_PULLEY_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "PulleyJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -PulleyJoint *luax_checkpulleyjoint(lua_State *L, int idx); -int w_PulleyJoint_getGroundAnchors(lua_State *L); -int w_PulleyJoint_getLengthA(lua_State *L); -int w_PulleyJoint_getLengthB(lua_State *L); -int w_PulleyJoint_getRatio(lua_State *L); -extern "C" int luaopen_pulleyjoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_PULLEY_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_PULLEY_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_PULLEY_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "PulleyJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +PulleyJoint *luax_checkpulleyjoint(lua_State *L, int idx); +int w_PulleyJoint_getGroundAnchors(lua_State *L); +int w_PulleyJoint_getLengthA(lua_State *L); +int w_PulleyJoint_getLengthB(lua_State *L); +int w_PulleyJoint_getRatio(lua_State *L); +extern "C" int luaopen_pulleyjoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_PULLEY_JOINT_H diff --git a/src/modules/physics/box2d/wrap_RevoluteJoint.cpp b/src/modules/physics/box2d/wrap_RevoluteJoint.cpp index 5eb236901..bf6b66c68 100644 --- a/src/modules/physics/box2d/wrap_RevoluteJoint.cpp +++ b/src/modules/physics/box2d/wrap_RevoluteJoint.cpp @@ -1,202 +1,202 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_RevoluteJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -RevoluteJoint *luax_checkrevolutejoint(lua_State *L, int idx) -{ - RevoluteJoint *j = luax_checktype(L, idx, "RevoluteJoint", PHYSICS_REVOLUTE_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_RevoluteJoint_getJointAngle(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - lua_pushnumber(L, t->getJointAngle()); - return 1; -} - -int w_RevoluteJoint_getJointSpeed(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - lua_pushnumber(L, t->getJointSpeed()); - return 1; -} - -int w_RevoluteJoint_enableMotor(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - bool arg1 = luax_toboolean(L, 2); - t->enableMotor(arg1); - return 0; -} - -int w_RevoluteJoint_isMotorEnabled(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - luax_pushboolean(L, t->isMotorEnabled()); - return 1; -} - -int w_RevoluteJoint_setMaxMotorTorque(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setMaxMotorTorque(arg1); - return 0; -} - -int w_RevoluteJoint_setMotorSpeed(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setMotorSpeed(arg1); - return 0; -} - -int w_RevoluteJoint_getMotorSpeed(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - lua_pushnumber(L, t->getMotorSpeed()); - return 1; -} - -int w_RevoluteJoint_getMotorTorque(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - float inv_dt = (float)luaL_checknumber(L, 2); - lua_pushnumber(L, t->getMotorTorque(inv_dt)); - return 1; -} - -int w_RevoluteJoint_getMaxMotorTorque(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - lua_pushnumber(L, t->getMaxMotorTorque()); - return 1; -} - -int w_RevoluteJoint_enableLimit(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - bool arg1 = luax_toboolean(L, 2); - t->enableLimit(arg1); - return 0; -} - -int w_RevoluteJoint_isLimitEnabled(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - luax_pushboolean(L, t->isLimitEnabled()); - return 1; -} - -int w_RevoluteJoint_setUpperLimit(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setUpperLimit(arg1); - return 0; -} - -int w_RevoluteJoint_setLowerLimit(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setLowerLimit(arg1); - return 0; -} - -int w_RevoluteJoint_setLimits(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_checknumber(L, 3); - t->setLimits(arg1, arg2); - return 0; -} - -int w_RevoluteJoint_getLowerLimit(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - lua_pushnumber(L, t->getLowerLimit()); - return 1; -} - -int w_RevoluteJoint_getUpperLimit(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - lua_pushnumber(L, t->getUpperLimit()); - return 1; -} - -int w_RevoluteJoint_getLimits(lua_State *L) -{ - RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - lua_remove(L, 1); - return t->getLimits(L); -} - -static const luaL_Reg functions[] = -{ - { "getJointAngle", w_RevoluteJoint_getJointAngle }, - { "getJointSpeed", w_RevoluteJoint_getJointSpeed }, - { "enableMotor", w_RevoluteJoint_enableMotor }, - { "isMotorEnabled", w_RevoluteJoint_isMotorEnabled }, - { "setMaxMotorTorque", w_RevoluteJoint_setMaxMotorTorque }, - { "setMotorSpeed", w_RevoluteJoint_setMotorSpeed }, - { "getMotorSpeed", w_RevoluteJoint_getMotorSpeed }, - { "getMotorTorque", w_RevoluteJoint_getMotorTorque }, - { "getMaxMotorTorque", w_RevoluteJoint_getMaxMotorTorque }, - { "enableLimit", w_RevoluteJoint_enableLimit }, - { "isLimitEnabled", w_RevoluteJoint_isLimitEnabled }, - { "setUpperLimit", w_RevoluteJoint_setUpperLimit }, - { "setLowerLimit", w_RevoluteJoint_setLowerLimit }, - { "setLimits", w_RevoluteJoint_setLimits }, - { "getLowerLimit", w_RevoluteJoint_getLowerLimit }, - { "getUpperLimit", w_RevoluteJoint_getUpperLimit }, - { "getLimits", w_RevoluteJoint_getLimits }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_revolutejoint(lua_State *L) -{ - return luax_register_type(L, "RevoluteJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_RevoluteJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +RevoluteJoint *luax_checkrevolutejoint(lua_State *L, int idx) +{ + RevoluteJoint *j = luax_checktype(L, idx, "RevoluteJoint", PHYSICS_REVOLUTE_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_RevoluteJoint_getJointAngle(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + lua_pushnumber(L, t->getJointAngle()); + return 1; +} + +int w_RevoluteJoint_getJointSpeed(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + lua_pushnumber(L, t->getJointSpeed()); + return 1; +} + +int w_RevoluteJoint_enableMotor(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + bool arg1 = luax_toboolean(L, 2); + t->enableMotor(arg1); + return 0; +} + +int w_RevoluteJoint_isMotorEnabled(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + luax_pushboolean(L, t->isMotorEnabled()); + return 1; +} + +int w_RevoluteJoint_setMaxMotorTorque(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setMaxMotorTorque(arg1); + return 0; +} + +int w_RevoluteJoint_setMotorSpeed(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setMotorSpeed(arg1); + return 0; +} + +int w_RevoluteJoint_getMotorSpeed(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + lua_pushnumber(L, t->getMotorSpeed()); + return 1; +} + +int w_RevoluteJoint_getMotorTorque(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + float inv_dt = (float)luaL_checknumber(L, 2); + lua_pushnumber(L, t->getMotorTorque(inv_dt)); + return 1; +} + +int w_RevoluteJoint_getMaxMotorTorque(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + lua_pushnumber(L, t->getMaxMotorTorque()); + return 1; +} + +int w_RevoluteJoint_enableLimit(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + bool arg1 = luax_toboolean(L, 2); + t->enableLimit(arg1); + return 0; +} + +int w_RevoluteJoint_isLimitEnabled(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + luax_pushboolean(L, t->isLimitEnabled()); + return 1; +} + +int w_RevoluteJoint_setUpperLimit(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setUpperLimit(arg1); + return 0; +} + +int w_RevoluteJoint_setLowerLimit(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setLowerLimit(arg1); + return 0; +} + +int w_RevoluteJoint_setLimits(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_checknumber(L, 3); + t->setLimits(arg1, arg2); + return 0; +} + +int w_RevoluteJoint_getLowerLimit(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + lua_pushnumber(L, t->getLowerLimit()); + return 1; +} + +int w_RevoluteJoint_getUpperLimit(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + lua_pushnumber(L, t->getUpperLimit()); + return 1; +} + +int w_RevoluteJoint_getLimits(lua_State *L) +{ + RevoluteJoint *t = luax_checkrevolutejoint(L, 1); + lua_remove(L, 1); + return t->getLimits(L); +} + +static const luaL_Reg functions[] = +{ + { "getJointAngle", w_RevoluteJoint_getJointAngle }, + { "getJointSpeed", w_RevoluteJoint_getJointSpeed }, + { "enableMotor", w_RevoluteJoint_enableMotor }, + { "isMotorEnabled", w_RevoluteJoint_isMotorEnabled }, + { "setMaxMotorTorque", w_RevoluteJoint_setMaxMotorTorque }, + { "setMotorSpeed", w_RevoluteJoint_setMotorSpeed }, + { "getMotorSpeed", w_RevoluteJoint_getMotorSpeed }, + { "getMotorTorque", w_RevoluteJoint_getMotorTorque }, + { "getMaxMotorTorque", w_RevoluteJoint_getMaxMotorTorque }, + { "enableLimit", w_RevoluteJoint_enableLimit }, + { "isLimitEnabled", w_RevoluteJoint_isLimitEnabled }, + { "setUpperLimit", w_RevoluteJoint_setUpperLimit }, + { "setLowerLimit", w_RevoluteJoint_setLowerLimit }, + { "setLimits", w_RevoluteJoint_setLimits }, + { "getLowerLimit", w_RevoluteJoint_getLowerLimit }, + { "getUpperLimit", w_RevoluteJoint_getUpperLimit }, + { "getLimits", w_RevoluteJoint_getLimits }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_revolutejoint(lua_State *L) +{ + return luax_register_type(L, "RevoluteJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_RevoluteJoint.h b/src/modules/physics/box2d/wrap_RevoluteJoint.h index 394427957..0ffa9d270 100644 --- a/src/modules/physics/box2d/wrap_RevoluteJoint.h +++ b/src/modules/physics/box2d/wrap_RevoluteJoint.h @@ -1,60 +1,60 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_REVOLUTE_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_REVOLUTE_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "RevoluteJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -RevoluteJoint *luax_checkrevolutejoint(lua_State *L, int idx); -int w_RevoluteJoint_getJointAngle(lua_State *L); -int w_RevoluteJoint_getJointSpeed(lua_State *L); -int w_RevoluteJoint_enableMotor(lua_State *L); -int w_RevoluteJoint_isMotorEnabled(lua_State *L); -int w_RevoluteJoint_setMaxMotorTorque(lua_State *L); -int w_RevoluteJoint_setMotorSpeed(lua_State *L); -int w_RevoluteJoint_getMotorSpeed(lua_State *L); -int w_RevoluteJoint_getMotorTorque(lua_State *L); -int w_RevoluteJoint_getMaxMotorTorque(lua_State *L); -int w_RevoluteJoint_enableLimit(lua_State *L); -int w_RevoluteJoint_isLimitEnabled(lua_State *L); -int w_RevoluteJoint_setUpperLimit(lua_State *L); -int w_RevoluteJoint_setLowerLimit(lua_State *L); -int w_RevoluteJoint_setLimits(lua_State *L); -int w_RevoluteJoint_getLowerLimit(lua_State *L); -int w_RevoluteJoint_getUpperLimit(lua_State *L); -int w_RevoluteJoint_getLimits(lua_State *L); -extern "C" int luaopen_revolutejoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_REVOLUTE_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_REVOLUTE_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_REVOLUTE_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "RevoluteJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +RevoluteJoint *luax_checkrevolutejoint(lua_State *L, int idx); +int w_RevoluteJoint_getJointAngle(lua_State *L); +int w_RevoluteJoint_getJointSpeed(lua_State *L); +int w_RevoluteJoint_enableMotor(lua_State *L); +int w_RevoluteJoint_isMotorEnabled(lua_State *L); +int w_RevoluteJoint_setMaxMotorTorque(lua_State *L); +int w_RevoluteJoint_setMotorSpeed(lua_State *L); +int w_RevoluteJoint_getMotorSpeed(lua_State *L); +int w_RevoluteJoint_getMotorTorque(lua_State *L); +int w_RevoluteJoint_getMaxMotorTorque(lua_State *L); +int w_RevoluteJoint_enableLimit(lua_State *L); +int w_RevoluteJoint_isLimitEnabled(lua_State *L); +int w_RevoluteJoint_setUpperLimit(lua_State *L); +int w_RevoluteJoint_setLowerLimit(lua_State *L); +int w_RevoluteJoint_setLimits(lua_State *L); +int w_RevoluteJoint_getLowerLimit(lua_State *L); +int w_RevoluteJoint_getUpperLimit(lua_State *L); +int w_RevoluteJoint_getLimits(lua_State *L); +extern "C" int luaopen_revolutejoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_REVOLUTE_JOINT_H diff --git a/src/modules/physics/box2d/wrap_RopeJoint.cpp b/src/modules/physics/box2d/wrap_RopeJoint.cpp index 648337a87..d0013c335 100644 --- a/src/modules/physics/box2d/wrap_RopeJoint.cpp +++ b/src/modules/physics/box2d/wrap_RopeJoint.cpp @@ -1,65 +1,65 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_RopeJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -RopeJoint *luax_checkropejoint(lua_State *L, int idx) -{ - RopeJoint *j = luax_checktype(L, idx, "RopeJoint", PHYSICS_ROPE_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_RopeJoint_getMaxLength(lua_State *L) -{ - RopeJoint *t = luax_checkropejoint(L, 1); - lua_pushnumber(L, t->getMaxLength()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "getMaxLength", w_RopeJoint_getMaxLength }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_ropejoint(lua_State *L) -{ - return luax_register_type(L, "RopeJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_RopeJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +RopeJoint *luax_checkropejoint(lua_State *L, int idx) +{ + RopeJoint *j = luax_checktype(L, idx, "RopeJoint", PHYSICS_ROPE_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_RopeJoint_getMaxLength(lua_State *L) +{ + RopeJoint *t = luax_checkropejoint(L, 1); + lua_pushnumber(L, t->getMaxLength()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "getMaxLength", w_RopeJoint_getMaxLength }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_ropejoint(lua_State *L) +{ + return luax_register_type(L, "RopeJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_RopeJoint.h b/src/modules/physics/box2d/wrap_RopeJoint.h index b0d78dee5..12959a090 100644 --- a/src/modules/physics/box2d/wrap_RopeJoint.h +++ b/src/modules/physics/box2d/wrap_RopeJoint.h @@ -1,44 +1,44 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_ROPE_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_ROPE_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "RopeJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -RopeJoint *luax_checkropejoint(lua_State *L, int idx); -int w_RopeJoint_getMaxLength(lua_State *L); -extern "C" int luaopen_ropejoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_ROPE_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_ROPE_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_ROPE_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "RopeJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +RopeJoint *luax_checkropejoint(lua_State *L, int idx); +int w_RopeJoint_getMaxLength(lua_State *L); +extern "C" int luaopen_ropejoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_ROPE_JOINT_H diff --git a/src/modules/physics/box2d/wrap_Shape.cpp b/src/modules/physics/box2d/wrap_Shape.cpp index f8de7492c..41eb937aa 100644 --- a/src/modules/physics/box2d/wrap_Shape.cpp +++ b/src/modules/physics/box2d/wrap_Shape.cpp @@ -1,115 +1,115 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Shape.h" -#include "common/StringMap.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Shape *luax_checkshape(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Shape", PHYSICS_SHAPE_T); -} - -int w_Shape_getType(lua_State *L) -{ - Shape *t = luax_checkshape(L, 1); - const char *type = ""; - Shape::getConstant(t->getType(), type); - lua_pushstring(L, type); - return 1; -} - -int w_Shape_getRadius(lua_State *L) -{ - Shape *t = luax_checkshape(L, 1); - float radius = t->getRadius(); - lua_pushnumber(L, radius); - return 1; -} - -int w_Shape_getChildCount(lua_State *L) -{ - Shape *t = luax_checkshape(L, 1); - int childCount = t->getChildCount(); - lua_pushinteger(L, childCount); - return 1; -} - -int w_Shape_testPoint(lua_State *L) -{ - Shape *t = luax_checkshape(L, 1); - float x = (float)luaL_checknumber(L, 2); - float y = (float)luaL_checknumber(L, 3); - float r = (float)luaL_checknumber(L, 4); - float px = (float)luaL_checknumber(L, 5); - float py = (float)luaL_checknumber(L, 6); - bool result = t->testPoint(x, y, r, px, py); - lua_pushboolean(L, result); - return 1; -} - -int w_Shape_rayCast(lua_State *L) -{ - Shape *t = luax_checkshape(L, 1); - lua_remove(L, 1); - ASSERT_GUARD(return t->rayCast(L);) -} - -int w_Shape_computeAABB(lua_State *L) -{ - Shape *t = luax_checkshape(L, 1); - lua_remove(L, 1); - return t->computeAABB(L); -} - -int w_Shape_computeMass(lua_State *L) -{ - Shape *t = luax_checkshape(L, 1); - lua_remove(L, 1); - return t->computeMass(L); -} - -static const luaL_Reg functions[] = -{ - { "getType", w_Shape_getType }, - { "getRadius", w_Shape_getRadius }, - { "getChildCount", w_Shape_getChildCount }, - { "testPoint", w_Shape_testPoint }, - { "rayCast", w_Shape_rayCast }, - { "computeAABB", w_Shape_computeAABB }, - { "computeMass", w_Shape_computeMass }, - { 0, 0 } -}; - -extern "C" int luaopen_shape(lua_State *L) -{ - return luax_register_type(L, "Shape", functions); -} - -} // box2d -} // physics -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Shape.h" +#include "common/StringMap.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Shape *luax_checkshape(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Shape", PHYSICS_SHAPE_T); +} + +int w_Shape_getType(lua_State *L) +{ + Shape *t = luax_checkshape(L, 1); + const char *type = ""; + Shape::getConstant(t->getType(), type); + lua_pushstring(L, type); + return 1; +} + +int w_Shape_getRadius(lua_State *L) +{ + Shape *t = luax_checkshape(L, 1); + float radius = t->getRadius(); + lua_pushnumber(L, radius); + return 1; +} + +int w_Shape_getChildCount(lua_State *L) +{ + Shape *t = luax_checkshape(L, 1); + int childCount = t->getChildCount(); + lua_pushinteger(L, childCount); + return 1; +} + +int w_Shape_testPoint(lua_State *L) +{ + Shape *t = luax_checkshape(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float r = (float)luaL_checknumber(L, 4); + float px = (float)luaL_checknumber(L, 5); + float py = (float)luaL_checknumber(L, 6); + bool result = t->testPoint(x, y, r, px, py); + lua_pushboolean(L, result); + return 1; +} + +int w_Shape_rayCast(lua_State *L) +{ + Shape *t = luax_checkshape(L, 1); + lua_remove(L, 1); + ASSERT_GUARD(return t->rayCast(L);) +} + +int w_Shape_computeAABB(lua_State *L) +{ + Shape *t = luax_checkshape(L, 1); + lua_remove(L, 1); + return t->computeAABB(L); +} + +int w_Shape_computeMass(lua_State *L) +{ + Shape *t = luax_checkshape(L, 1); + lua_remove(L, 1); + return t->computeMass(L); +} + +static const luaL_Reg functions[] = +{ + { "getType", w_Shape_getType }, + { "getRadius", w_Shape_getRadius }, + { "getChildCount", w_Shape_getChildCount }, + { "testPoint", w_Shape_testPoint }, + { "rayCast", w_Shape_rayCast }, + { "computeAABB", w_Shape_computeAABB }, + { "computeMass", w_Shape_computeMass }, + { 0, 0 } +}; + +extern "C" int luaopen_shape(lua_State *L) +{ + return luax_register_type(L, "Shape", functions); +} + +} // box2d +} // physics +} // love + diff --git a/src/modules/physics/box2d/wrap_Shape.h b/src/modules/physics/box2d/wrap_Shape.h index ece379a98..8e2ff7ac9 100644 --- a/src/modules/physics/box2d/wrap_Shape.h +++ b/src/modules/physics/box2d/wrap_Shape.h @@ -1,52 +1,52 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_SHAPE_H -#define LOVE_PHYSICS_BOX2D_WRAP_SHAPE_H - -// LOVE -#include "common/runtime.h" -#include "Shape.h" -#include "wrap_Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -Shape *luax_checkshape(lua_State *L, int idx); -int w_Shape_getType(lua_State *L); -int w_Shape_getRadius(lua_State *L); - -int w_Shape_getChildCount(lua_State *L); -int w_Shape_testPoint(lua_State *L); -int w_Shape_rayCast(lua_State *L); -int w_Shape_computeAABB(lua_State *L); -int w_Shape_computeMass(lua_State *L); - -extern "C" int luaopen_shape(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_SHAPE_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_SHAPE_H +#define LOVE_PHYSICS_BOX2D_WRAP_SHAPE_H + +// LOVE +#include "common/runtime.h" +#include "Shape.h" +#include "wrap_Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +Shape *luax_checkshape(lua_State *L, int idx); +int w_Shape_getType(lua_State *L); +int w_Shape_getRadius(lua_State *L); + +int w_Shape_getChildCount(lua_State *L); +int w_Shape_testPoint(lua_State *L); +int w_Shape_rayCast(lua_State *L); +int w_Shape_computeAABB(lua_State *L); +int w_Shape_computeMass(lua_State *L); + +extern "C" int luaopen_shape(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_SHAPE_H diff --git a/src/modules/physics/box2d/wrap_WeldJoint.cpp b/src/modules/physics/box2d/wrap_WeldJoint.cpp index ef670e8ce..a4682fa4c 100644 --- a/src/modules/physics/box2d/wrap_WeldJoint.cpp +++ b/src/modules/physics/box2d/wrap_WeldJoint.cpp @@ -1,91 +1,91 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_WeldJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -WeldJoint *luax_checkweldjoint(lua_State *L, int idx) -{ - WeldJoint *j = luax_checktype(L, idx, "WeldJoint", PHYSICS_WELD_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_WeldJoint_setFrequency(lua_State *L) -{ - WeldJoint *t = luax_checkweldjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setFrequency(arg1); - return 0; -} - -int w_WeldJoint_getFrequency(lua_State *L) -{ - WeldJoint *t = luax_checkweldjoint(L, 1); - lua_pushnumber(L, t->getFrequency()); - return 1; -} - -int w_WeldJoint_setDampingRatio(lua_State *L) -{ - WeldJoint *t = luax_checkweldjoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setDampingRatio(arg1); - return 0; -} - -int w_WeldJoint_getDampingRatio(lua_State *L) -{ - WeldJoint *t = luax_checkweldjoint(L, 1); - lua_pushnumber(L, t->getDampingRatio()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "setFrequency", w_WeldJoint_setFrequency }, - { "getFrequency", w_WeldJoint_getFrequency }, - { "setDampingRatio", w_WeldJoint_setDampingRatio }, - { "getDampingRatio", w_WeldJoint_getDampingRatio }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_weldjoint(lua_State *L) -{ - return luax_register_type(L, "WeldJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_WeldJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +WeldJoint *luax_checkweldjoint(lua_State *L, int idx) +{ + WeldJoint *j = luax_checktype(L, idx, "WeldJoint", PHYSICS_WELD_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_WeldJoint_setFrequency(lua_State *L) +{ + WeldJoint *t = luax_checkweldjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setFrequency(arg1); + return 0; +} + +int w_WeldJoint_getFrequency(lua_State *L) +{ + WeldJoint *t = luax_checkweldjoint(L, 1); + lua_pushnumber(L, t->getFrequency()); + return 1; +} + +int w_WeldJoint_setDampingRatio(lua_State *L) +{ + WeldJoint *t = luax_checkweldjoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setDampingRatio(arg1); + return 0; +} + +int w_WeldJoint_getDampingRatio(lua_State *L) +{ + WeldJoint *t = luax_checkweldjoint(L, 1); + lua_pushnumber(L, t->getDampingRatio()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "setFrequency", w_WeldJoint_setFrequency }, + { "getFrequency", w_WeldJoint_getFrequency }, + { "setDampingRatio", w_WeldJoint_setDampingRatio }, + { "getDampingRatio", w_WeldJoint_getDampingRatio }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_weldjoint(lua_State *L) +{ + return luax_register_type(L, "WeldJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_WeldJoint.h b/src/modules/physics/box2d/wrap_WeldJoint.h index 229bae530..706ac8bc0 100644 --- a/src/modules/physics/box2d/wrap_WeldJoint.h +++ b/src/modules/physics/box2d/wrap_WeldJoint.h @@ -1,49 +1,49 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_WELD_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_WELD_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "WeldJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -WeldJoint *luax_checkweldjoint(lua_State *L, int idx); - -int w_WeldJoint_setFrequency(lua_State *L); -int w_WeldJoint_getFrequency(lua_State *L); -int w_WeldJoint_setDampingRatio(lua_State *L); -int w_WeldJoint_getDampingRatio(lua_State *L); - -extern "C" int luaopen_weldjoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_WELD_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_WELD_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_WELD_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "WeldJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +WeldJoint *luax_checkweldjoint(lua_State *L, int idx); + +int w_WeldJoint_setFrequency(lua_State *L); +int w_WeldJoint_getFrequency(lua_State *L); +int w_WeldJoint_setDampingRatio(lua_State *L); +int w_WeldJoint_getDampingRatio(lua_State *L); + +extern "C" int luaopen_weldjoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_WELD_JOINT_H diff --git a/src/modules/physics/box2d/wrap_WheelJoint.cpp b/src/modules/physics/box2d/wrap_WheelJoint.cpp index 4481e679a..d5ef77291 100644 --- a/src/modules/physics/box2d/wrap_WheelJoint.cpp +++ b/src/modules/physics/box2d/wrap_WheelJoint.cpp @@ -1,167 +1,167 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_WheelJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -WheelJoint *luax_checkwheeljoint(lua_State *L, int idx) -{ - WheelJoint *j = luax_checktype(L, idx, "WheelJoint", PHYSICS_WHEEL_JOINT_T); - if (!j->isValid()) - luaL_error(L, "Attempt to use destroyed joint."); - return j; -} - -int w_WheelJoint_getJointTranslation(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - lua_pushnumber(L, t->getJointTranslation()); - return 1; -} - -int w_WheelJoint_getJointSpeed(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - lua_pushnumber(L, t->getJointSpeed()); - return 1; -} - -int w_WheelJoint_enableMotor(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - bool arg1 = luax_toboolean(L, 2); - t->enableMotor(arg1); - return 0; -} - -int w_WheelJoint_isMotorEnabled(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - luax_pushboolean(L, t->isMotorEnabled()); - return 1; -} - -int w_WheelJoint_setMotorSpeed(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setMotorSpeed(arg1); - return 0; -} - -int w_WheelJoint_getMotorSpeed(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - lua_pushnumber(L, t->getMotorSpeed()); - return 1; -} - -int w_WheelJoint_setMaxMotorTorque(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setMaxMotorTorque(arg1); - return 0; -} - -int w_WheelJoint_getMaxMotorTorque(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - lua_pushnumber(L, t->getMaxMotorTorque()); - return 1; -} - -int w_WheelJoint_getMotorTorque(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - float inv_dt = (float)luaL_checknumber(L, 2); - lua_pushnumber(L, t->getMotorTorque(inv_dt)); - return 1; -} - -int w_WheelJoint_setSpringFrequency(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setSpringFrequency(arg1); - return 0; -} - -int w_WheelJoint_getSpringFrequency(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - lua_pushnumber(L, t->getSpringFrequency()); - return 1; -} - -int w_WheelJoint_setSpringDampingRatio(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - t->setSpringDampingRatio(arg1); - return 0; -} - -int w_WheelJoint_getSpringDampingRatio(lua_State *L) -{ - WheelJoint *t = luax_checkwheeljoint(L, 1); - lua_pushnumber(L, t->getSpringDampingRatio()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "getJointTranslation", w_WheelJoint_getJointTranslation }, - { "getJointSpeed", w_WheelJoint_getJointSpeed }, - { "enableMotor", w_WheelJoint_enableMotor }, - { "isMotorEnabled", w_WheelJoint_isMotorEnabled }, - { "setMotorSpeed", w_WheelJoint_setMotorSpeed }, - { "getMotorSpeed", w_WheelJoint_getMotorSpeed }, - { "setMaxMotorTorque", w_WheelJoint_setMaxMotorTorque }, - { "getMaxMotorTorque", w_WheelJoint_getMaxMotorTorque }, - { "getMotorTorque", w_WheelJoint_getMotorTorque }, - { "setSpringFrequency", w_WheelJoint_setSpringFrequency }, - { "getSpringFrequency", w_WheelJoint_getSpringFrequency }, - { "setSpringDampingRatio", w_WheelJoint_setSpringDampingRatio }, - { "getSpringDampingRatio", w_WheelJoint_getSpringDampingRatio }, - // From Joint. - { "getType", w_Joint_getType }, - { "getAnchors", w_Joint_getAnchors }, - { "getReactionForce", w_Joint_getReactionForce }, - { "getReactionTorque", w_Joint_getReactionTorque }, - { "getCollideConnected", w_Joint_getCollideConnected }, - { "destroy", w_Joint_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_wheeljoint(lua_State *L) -{ - return luax_register_type(L, "WheelJoint", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_WheelJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +WheelJoint *luax_checkwheeljoint(lua_State *L, int idx) +{ + WheelJoint *j = luax_checktype(L, idx, "WheelJoint", PHYSICS_WHEEL_JOINT_T); + if (!j->isValid()) + luaL_error(L, "Attempt to use destroyed joint."); + return j; +} + +int w_WheelJoint_getJointTranslation(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + lua_pushnumber(L, t->getJointTranslation()); + return 1; +} + +int w_WheelJoint_getJointSpeed(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + lua_pushnumber(L, t->getJointSpeed()); + return 1; +} + +int w_WheelJoint_enableMotor(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + bool arg1 = luax_toboolean(L, 2); + t->enableMotor(arg1); + return 0; +} + +int w_WheelJoint_isMotorEnabled(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + luax_pushboolean(L, t->isMotorEnabled()); + return 1; +} + +int w_WheelJoint_setMotorSpeed(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setMotorSpeed(arg1); + return 0; +} + +int w_WheelJoint_getMotorSpeed(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + lua_pushnumber(L, t->getMotorSpeed()); + return 1; +} + +int w_WheelJoint_setMaxMotorTorque(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setMaxMotorTorque(arg1); + return 0; +} + +int w_WheelJoint_getMaxMotorTorque(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + lua_pushnumber(L, t->getMaxMotorTorque()); + return 1; +} + +int w_WheelJoint_getMotorTorque(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + float inv_dt = (float)luaL_checknumber(L, 2); + lua_pushnumber(L, t->getMotorTorque(inv_dt)); + return 1; +} + +int w_WheelJoint_setSpringFrequency(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setSpringFrequency(arg1); + return 0; +} + +int w_WheelJoint_getSpringFrequency(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + lua_pushnumber(L, t->getSpringFrequency()); + return 1; +} + +int w_WheelJoint_setSpringDampingRatio(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + t->setSpringDampingRatio(arg1); + return 0; +} + +int w_WheelJoint_getSpringDampingRatio(lua_State *L) +{ + WheelJoint *t = luax_checkwheeljoint(L, 1); + lua_pushnumber(L, t->getSpringDampingRatio()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "getJointTranslation", w_WheelJoint_getJointTranslation }, + { "getJointSpeed", w_WheelJoint_getJointSpeed }, + { "enableMotor", w_WheelJoint_enableMotor }, + { "isMotorEnabled", w_WheelJoint_isMotorEnabled }, + { "setMotorSpeed", w_WheelJoint_setMotorSpeed }, + { "getMotorSpeed", w_WheelJoint_getMotorSpeed }, + { "setMaxMotorTorque", w_WheelJoint_setMaxMotorTorque }, + { "getMaxMotorTorque", w_WheelJoint_getMaxMotorTorque }, + { "getMotorTorque", w_WheelJoint_getMotorTorque }, + { "setSpringFrequency", w_WheelJoint_setSpringFrequency }, + { "getSpringFrequency", w_WheelJoint_getSpringFrequency }, + { "setSpringDampingRatio", w_WheelJoint_setSpringDampingRatio }, + { "getSpringDampingRatio", w_WheelJoint_getSpringDampingRatio }, + // From Joint. + { "getType", w_Joint_getType }, + { "getAnchors", w_Joint_getAnchors }, + { "getReactionForce", w_Joint_getReactionForce }, + { "getReactionTorque", w_Joint_getReactionTorque }, + { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_wheeljoint(lua_State *L) +{ + return luax_register_type(L, "WheelJoint", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_WheelJoint.h b/src/modules/physics/box2d/wrap_WheelJoint.h index 859a7161e..6dc6f8388 100644 --- a/src/modules/physics/box2d/wrap_WheelJoint.h +++ b/src/modules/physics/box2d/wrap_WheelJoint.h @@ -1,56 +1,56 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H -#define LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H - -// LOVE -#include "common/runtime.h" -#include "wrap_Joint.h" -#include "WheelJoint.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -WheelJoint *luax_checkwheeljoint(lua_State *L, int idx); -int w_WheelJoint_getJointTranslation(lua_State *L); -int w_WheelJoint_getJointSpeed(lua_State *L); -int w_WheelJoint_enableMotor(lua_State *L); -int w_WheelJoint_isMotorEnabled(lua_State *L); -int w_WheelJoint_setMotorSpeed(lua_State *L); -int w_WheelJoint_getMotorSpeed(lua_State *L); -int w_WheelJoint_setMaxMotorTorque(lua_State *L); -int w_WheelJoint_getMaxMotorTorque(lua_State *L); -int w_WheelJoint_getMotorTorque(lua_State *L); -int w_WheelJoint_setSpringFrequency(lua_State *L); -int w_WheelJoint_getSpringFrequency(lua_State *L); -int w_WheelJoint_setSpringDampingRatio(lua_State *L); -int w_WheelJoint_getSpringDampingRatio(lua_State *L); -extern "C" int luaopen_wheeljoint(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H +#define LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H + +// LOVE +#include "common/runtime.h" +#include "wrap_Joint.h" +#include "WheelJoint.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +WheelJoint *luax_checkwheeljoint(lua_State *L, int idx); +int w_WheelJoint_getJointTranslation(lua_State *L); +int w_WheelJoint_getJointSpeed(lua_State *L); +int w_WheelJoint_enableMotor(lua_State *L); +int w_WheelJoint_isMotorEnabled(lua_State *L); +int w_WheelJoint_setMotorSpeed(lua_State *L); +int w_WheelJoint_getMotorSpeed(lua_State *L); +int w_WheelJoint_setMaxMotorTorque(lua_State *L); +int w_WheelJoint_getMaxMotorTorque(lua_State *L); +int w_WheelJoint_getMotorTorque(lua_State *L); +int w_WheelJoint_setSpringFrequency(lua_State *L); +int w_WheelJoint_getSpringFrequency(lua_State *L); +int w_WheelJoint_setSpringDampingRatio(lua_State *L); +int w_WheelJoint_getSpringDampingRatio(lua_State *L); +extern "C" int luaopen_wheeljoint(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H diff --git a/src/modules/physics/box2d/wrap_World.cpp b/src/modules/physics/box2d/wrap_World.cpp index d97c98514..4f093be1f 100644 --- a/src/modules/physics/box2d/wrap_World.cpp +++ b/src/modules/physics/box2d/wrap_World.cpp @@ -1,214 +1,214 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_World.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -World *luax_checkworld(lua_State *L, int idx) -{ - World *w = luax_checktype(L, idx, "World", PHYSICS_WORLD_T); - if (!w->isValid()) - luaL_error(L, "Attempt to use destroyed world."); - return w; -} - -int w_World_update(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - float dt = (float)luaL_checknumber(L, 2); - t->update(dt); - return 0; -} - -int w_World_setCallbacks(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->setCallbacks(L); -} - -int w_World_getCallbacks(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->getCallbacks(L); -} - -int w_World_setContactFilter(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->setContactFilter(L); -} - -int w_World_getContactFilter(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->getContactFilter(L); -} - -int w_World_setGravity(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_checknumber(L, 3); - t->setGravity(arg1, arg2); - return 0; -} - -int w_World_getGravity(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->getGravity(L); -} - -int w_World_setAllowSleeping(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - bool b = luax_toboolean(L, 2); - t->setAllowSleeping(b); - return 0; -} - -int w_World_getAllowSleeping(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - luax_pushboolean(L, t->getAllowSleeping()); - return 1; -} - -int w_World_isLocked(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - luax_pushboolean(L, t->isLocked()); - return 1; -} - -int w_World_getBodyCount(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_pushinteger(L, t->getBodyCount()); - return 1; -} - -int w_World_getJointCount(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_pushinteger(L, t->getJointCount()); - return 1; -} - -int w_World_getContactCount(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_pushinteger(L, t->getContactCount()); - return 1; -} - -int w_World_getBodyList(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->getBodyList(L); -} - -int w_World_getJointList(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->getJointList(L); -} - -int w_World_getContactList(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->getContactList(L); -} - -int w_World_queryBoundingBox(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - return t->queryBoundingBox(L); -} - -int w_World_rayCast(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - lua_remove(L, 1); - ASSERT_GUARD(return t->rayCast(L);) -} - -int w_World_destroy(lua_State *L) -{ - World *t = luax_checkworld(L, 1); - try - { - t->destroy(); - } - catch(love::Exception &e) - { - luaL_error(L, "%s", e.what()); - } - return 0; -} - - -static const luaL_Reg functions[] = -{ - { "update", w_World_update }, - { "setCallbacks", w_World_setCallbacks }, - { "getCallbacks", w_World_getCallbacks }, - { "setContactFilter", w_World_setContactFilter }, - { "getContactFilter", w_World_getContactFilter }, - { "setGravity", w_World_setGravity }, - { "getGravity", w_World_getGravity }, - { "setAllowSleeping", w_World_setAllowSleeping }, - { "getAllowSleeping", w_World_getAllowSleeping }, - { "isLocked", w_World_isLocked }, - { "getBodyCount", w_World_getBodyCount }, - { "getJointCount", w_World_getJointCount }, - { "getContactCount", w_World_getContactCount }, - { "getBodyList", w_World_getBodyList }, - { "getJointList", w_World_getJointList }, - { "getContactList", w_World_getContactList }, - { "queryBoundingBox", w_World_queryBoundingBox }, - { "rayCast", w_World_rayCast }, - { "destroy", w_World_destroy }, - { 0, 0 } -}; - -extern "C" int luaopen_world(lua_State *L) -{ - return luax_register_type(L, "World", functions); -} - -} // box2d -} // physics -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_World.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +World *luax_checkworld(lua_State *L, int idx) +{ + World *w = luax_checktype(L, idx, "World", PHYSICS_WORLD_T); + if (!w->isValid()) + luaL_error(L, "Attempt to use destroyed world."); + return w; +} + +int w_World_update(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + float dt = (float)luaL_checknumber(L, 2); + t->update(dt); + return 0; +} + +int w_World_setCallbacks(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->setCallbacks(L); +} + +int w_World_getCallbacks(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->getCallbacks(L); +} + +int w_World_setContactFilter(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->setContactFilter(L); +} + +int w_World_getContactFilter(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->getContactFilter(L); +} + +int w_World_setGravity(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + float arg1 = (float)luaL_checknumber(L, 2); + float arg2 = (float)luaL_checknumber(L, 3); + t->setGravity(arg1, arg2); + return 0; +} + +int w_World_getGravity(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->getGravity(L); +} + +int w_World_setAllowSleeping(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + bool b = luax_toboolean(L, 2); + t->setAllowSleeping(b); + return 0; +} + +int w_World_getAllowSleeping(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + luax_pushboolean(L, t->getAllowSleeping()); + return 1; +} + +int w_World_isLocked(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + luax_pushboolean(L, t->isLocked()); + return 1; +} + +int w_World_getBodyCount(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_pushinteger(L, t->getBodyCount()); + return 1; +} + +int w_World_getJointCount(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_pushinteger(L, t->getJointCount()); + return 1; +} + +int w_World_getContactCount(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_pushinteger(L, t->getContactCount()); + return 1; +} + +int w_World_getBodyList(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->getBodyList(L); +} + +int w_World_getJointList(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->getJointList(L); +} + +int w_World_getContactList(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->getContactList(L); +} + +int w_World_queryBoundingBox(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + return t->queryBoundingBox(L); +} + +int w_World_rayCast(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + lua_remove(L, 1); + ASSERT_GUARD(return t->rayCast(L);) +} + +int w_World_destroy(lua_State *L) +{ + World *t = luax_checkworld(L, 1); + try + { + t->destroy(); + } + catch(love::Exception &e) + { + luaL_error(L, "%s", e.what()); + } + return 0; +} + + +static const luaL_Reg functions[] = +{ + { "update", w_World_update }, + { "setCallbacks", w_World_setCallbacks }, + { "getCallbacks", w_World_getCallbacks }, + { "setContactFilter", w_World_setContactFilter }, + { "getContactFilter", w_World_getContactFilter }, + { "setGravity", w_World_setGravity }, + { "getGravity", w_World_getGravity }, + { "setAllowSleeping", w_World_setAllowSleeping }, + { "getAllowSleeping", w_World_getAllowSleeping }, + { "isLocked", w_World_isLocked }, + { "getBodyCount", w_World_getBodyCount }, + { "getJointCount", w_World_getJointCount }, + { "getContactCount", w_World_getContactCount }, + { "getBodyList", w_World_getBodyList }, + { "getJointList", w_World_getJointList }, + { "getContactList", w_World_getContactList }, + { "queryBoundingBox", w_World_queryBoundingBox }, + { "rayCast", w_World_rayCast }, + { "destroy", w_World_destroy }, + { 0, 0 } +}; + +extern "C" int luaopen_world(lua_State *L) +{ + return luax_register_type(L, "World", functions); +} + +} // box2d +} // physics +} // love diff --git a/src/modules/physics/box2d/wrap_World.h b/src/modules/physics/box2d/wrap_World.h index 31d0895ef..b02704d76 100644 --- a/src/modules/physics/box2d/wrap_World.h +++ b/src/modules/physics/box2d/wrap_World.h @@ -1,63 +1,63 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_PHYSICS_BOX2D_WRAP_WORLD_H -#define LOVE_PHYSICS_BOX2D_WRAP_WORLD_H - -// LOVE -#include "common/runtime.h" -#include "common/Exception.h" -#include "World.h" -#include "wrap_Physics.h" - -namespace love -{ -namespace physics -{ -namespace box2d -{ - -World *luax_checkworld(lua_State *L, int idx); -int w_World_update(lua_State *L); -int w_World_setCallbacks(lua_State *L); -int w_World_getCallbacks(lua_State *L); -int w_World_setContactFilter(lua_State *L); -int w_World_getContactFilter(lua_State *L); -int w_World_setGravity(lua_State *L); -int w_World_getGravity(lua_State *L); -int w_World_setAllowSleeping(lua_State *L); -int w_World_getAllowSleeping(lua_State *L); -int w_World_isLocked(lua_State *L); -int w_World_getBodyCount(lua_State *L); -int w_World_getJointCount(lua_State *L); -int w_World_getContactCount(lua_State *L); -int w_World_getBodyList(lua_State *L); -int w_World_getJointList(lua_State *L); -int w_World_getContactList(lua_State *L); -int w_World_queryBoundingBox(lua_State *L); -int w_World_rayCast(lua_State *L); -int w_World_destroy(lua_State *L); -extern "C" int luaopen_world(lua_State *L); - -} // box2d -} // physics -} // love - -#endif // LOVE_PHYSICS_BOX2D_WRAP_WORLD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_PHYSICS_BOX2D_WRAP_WORLD_H +#define LOVE_PHYSICS_BOX2D_WRAP_WORLD_H + +// LOVE +#include "common/runtime.h" +#include "common/Exception.h" +#include "World.h" +#include "wrap_Physics.h" + +namespace love +{ +namespace physics +{ +namespace box2d +{ + +World *luax_checkworld(lua_State *L, int idx); +int w_World_update(lua_State *L); +int w_World_setCallbacks(lua_State *L); +int w_World_getCallbacks(lua_State *L); +int w_World_setContactFilter(lua_State *L); +int w_World_getContactFilter(lua_State *L); +int w_World_setGravity(lua_State *L); +int w_World_getGravity(lua_State *L); +int w_World_setAllowSleeping(lua_State *L); +int w_World_getAllowSleeping(lua_State *L); +int w_World_isLocked(lua_State *L); +int w_World_getBodyCount(lua_State *L); +int w_World_getJointCount(lua_State *L); +int w_World_getContactCount(lua_State *L); +int w_World_getBodyList(lua_State *L); +int w_World_getJointList(lua_State *L); +int w_World_getContactList(lua_State *L); +int w_World_queryBoundingBox(lua_State *L); +int w_World_rayCast(lua_State *L); +int w_World_destroy(lua_State *L); +extern "C" int luaopen_world(lua_State *L); + +} // box2d +} // physics +} // love + +#endif // LOVE_PHYSICS_BOX2D_WRAP_WORLD_H diff --git a/src/modules/sound/Decoder.h b/src/modules/sound/Decoder.h index 7a9e57c8e..162f68970 100644 --- a/src/modules/sound/Decoder.h +++ b/src/modules/sound/Decoder.h @@ -1,142 +1,142 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_DECODER_H -#define LOVE_SOUND_DECODER_H - -// LOVE -#include "common/Object.h" - -namespace love -{ -namespace sound -{ -/** - * Decoder objects are responsible for decoding audio files. They maintain - * an interal buffer into which they write raw decoded audio data. - **/ -class Decoder : public Object -{ -public: - - /** - * Indicates how many bytes of raw data should be generated at each - * call to Decode. - **/ - static const int DEFAULT_BUFFER_SIZE = 2048; - - /** - * Indicates the quality of the sound. - **/ - static const int DEFAULT_SAMPLE_RATE = 44100; - - /** - * Default is stereo. - **/ - static const int DEFAULT_CHANNELS = 2; - - /** - * 16 bit audio is the default. - **/ - static const int DEFAULT_BITS = 16; - - /** - * Creates a deep of itself. The sound stream can (and should) be - * rewound, and does not have to be at the same place. - * @return A new Decoder object. - **/ - virtual Decoder *clone() = 0; - - /** - * Destructor. Should free internal buffer. - **/ - virtual ~Decoder() {}; - - /** - * Decodes the next chunk of the music stream, this will usually be - * bufferSize amount of bytes, unless EOF occurs. Zero or negative values - * indicate EOF or errors. - * @return The number of bytes actually decoded. - **/ - virtual int decode() = 0; - - /** - * Gets the size of the buffer (NOT the size of the entire stream). - * @return The size of the buffer. - **/ - virtual int getSize() const = 0; - - /** - * Gets a pointer to the actual data. The contents of this buffer will - * change with each call to decode, so the client must copy the data. - * @return A buffer to raw sound data. - **/ - virtual void *getBuffer() const = 0; - - /** - * Seeks to the specified position, if possible. - * @param s The position in the stream in seconds. - * @return True if success, false on fail/unsupported. - **/ - virtual bool seek(float s) = 0; - - /** - * Rewinds the stream to the start. - * @return True if success, false on fail/unsupported. - **/ - virtual bool rewind() = 0; - - /** - * Checks whether a stream is seekable. - * @return True if seekable, false otherwise. - **/ - virtual bool isSeekable() = 0; - - /** - * Checks whether a stream has more data to decode or not. Use - * rewind to start the stream again. - * @return False if there is more data, true on EOF. - **/ - virtual bool isFinished() = 0; - - /** - * Gets the number of channels in a stream. Supported values are 1 (mono) or 2 (stereo). - * @return Either 1 for mono, 2 for stereo, or 0 on errors. - **/ - virtual int getChannels() const = 0; - - /** - * Gets the number of bits per sample. Supported values are 8 or 16. - * @return Either 8, 16, or 0 if unsupported. - **/ - virtual int getBits() const = 0; - - /** - * Gets the sample rate for the Decoder, that is, samples per second. - * @return The sample rate, eg. 44100. - **/ - virtual int getSampleRate() const = 0; - -}; // Decoder - -} // sound -} // love - -#endif // LOVE_SOUND_DECODER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_DECODER_H +#define LOVE_SOUND_DECODER_H + +// LOVE +#include "common/Object.h" + +namespace love +{ +namespace sound +{ +/** + * Decoder objects are responsible for decoding audio files. They maintain + * an interal buffer into which they write raw decoded audio data. + **/ +class Decoder : public Object +{ +public: + + /** + * Indicates how many bytes of raw data should be generated at each + * call to Decode. + **/ + static const int DEFAULT_BUFFER_SIZE = 2048; + + /** + * Indicates the quality of the sound. + **/ + static const int DEFAULT_SAMPLE_RATE = 44100; + + /** + * Default is stereo. + **/ + static const int DEFAULT_CHANNELS = 2; + + /** + * 16 bit audio is the default. + **/ + static const int DEFAULT_BITS = 16; + + /** + * Creates a deep of itself. The sound stream can (and should) be + * rewound, and does not have to be at the same place. + * @return A new Decoder object. + **/ + virtual Decoder *clone() = 0; + + /** + * Destructor. Should free internal buffer. + **/ + virtual ~Decoder() {}; + + /** + * Decodes the next chunk of the music stream, this will usually be + * bufferSize amount of bytes, unless EOF occurs. Zero or negative values + * indicate EOF or errors. + * @return The number of bytes actually decoded. + **/ + virtual int decode() = 0; + + /** + * Gets the size of the buffer (NOT the size of the entire stream). + * @return The size of the buffer. + **/ + virtual int getSize() const = 0; + + /** + * Gets a pointer to the actual data. The contents of this buffer will + * change with each call to decode, so the client must copy the data. + * @return A buffer to raw sound data. + **/ + virtual void *getBuffer() const = 0; + + /** + * Seeks to the specified position, if possible. + * @param s The position in the stream in seconds. + * @return True if success, false on fail/unsupported. + **/ + virtual bool seek(float s) = 0; + + /** + * Rewinds the stream to the start. + * @return True if success, false on fail/unsupported. + **/ + virtual bool rewind() = 0; + + /** + * Checks whether a stream is seekable. + * @return True if seekable, false otherwise. + **/ + virtual bool isSeekable() = 0; + + /** + * Checks whether a stream has more data to decode or not. Use + * rewind to start the stream again. + * @return False if there is more data, true on EOF. + **/ + virtual bool isFinished() = 0; + + /** + * Gets the number of channels in a stream. Supported values are 1 (mono) or 2 (stereo). + * @return Either 1 for mono, 2 for stereo, or 0 on errors. + **/ + virtual int getChannels() const = 0; + + /** + * Gets the number of bits per sample. Supported values are 8 or 16. + * @return Either 8, 16, or 0 if unsupported. + **/ + virtual int getBits() const = 0; + + /** + * Gets the sample rate for the Decoder, that is, samples per second. + * @return The sample rate, eg. 44100. + **/ + virtual int getSampleRate() const = 0; + +}; // Decoder + +} // sound +} // love + +#endif // LOVE_SOUND_DECODER_H diff --git a/src/modules/sound/Sound.cpp b/src/modules/sound/Sound.cpp index 1102bdbb4..5166dd9bf 100644 --- a/src/modules/sound/Sound.cpp +++ b/src/modules/sound/Sound.cpp @@ -1,44 +1,44 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Sound.h" - -namespace love -{ -namespace sound -{ - -Sound::~Sound() -{ -} - -SoundData *Sound::newSoundData(Decoder *decoder) -{ - return new SoundData(decoder); -} - -SoundData *Sound::newSoundData(int samples, int sampleRate, int bits, int channels) -{ - return new SoundData(samples, sampleRate, bits, channels); -} - - -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Sound.h" + +namespace love +{ +namespace sound +{ + +Sound::~Sound() +{ +} + +SoundData *Sound::newSoundData(Decoder *decoder) +{ + return new SoundData(decoder); +} + +SoundData *Sound::newSoundData(int samples, int sampleRate, int bits, int channels) +{ + return new SoundData(samples, sampleRate, bits, channels); +} + + +} // sound +} // love diff --git a/src/modules/sound/Sound.h b/src/modules/sound/Sound.h index 5b804b5ea..7cd61c3ed 100644 --- a/src/modules/sound/Sound.h +++ b/src/modules/sound/Sound.h @@ -1,84 +1,84 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_SOUND_H -#define LOVE_SOUND_SOUND_H - -// LOVE -#include "common/Module.h" -#include "filesystem/File.h" - -#include "SoundData.h" -#include "Decoder.h" - -namespace love -{ -namespace sound -{ - -/** - * The Sound module is responsible for decoding sound data. It is - * not responsible for playing it. - **/ -class Sound : public Module -{ - -public: - - /** - * Destructor. - **/ - virtual ~Sound(); - - /** - * Creates new SoundData from a decoder. Fully expands the - * encoded sound data into raw sound data. Not recommended - * on large (long-duration) files. - * @param decoder The file to decode the data from. - * @return A SoundData object, or zero if the file type couldn't be handled. - **/ - SoundData *newSoundData(Decoder *decoder); - - /** - * Creates a new SoundData with the specified number of samples and format. - * @param duration In seconds. - * @param sampleRate Number of samples per second. - * @param bits Bits per sample (8 or 16). - * @param channels Either 1 for mono, or 2 for stereo. - * @return A new SoundData object, or zero in case of errors. - **/ - SoundData *newSoundData(int samples, int sampleRate, int bits, int channels); - - /** - * Attempts to find a decoder for the encoded sound data in the - * specified file. - * @param file The file with encoded sound data. - * @param bufferSize The size of each decoded chunk. - * @param sampleRate Samples per second, or quality of the audio. 44100 is a good value. - * @return A Decoder object on success, or zero if no decoder could be found. - **/ - virtual Decoder *newDecoder(filesystem::File *file, int bufferSize) = 0; - -}; // Sound - -} // sound -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_SOUND_H +#define LOVE_SOUND_SOUND_H + +// LOVE +#include "common/Module.h" +#include "filesystem/File.h" + +#include "SoundData.h" +#include "Decoder.h" + +namespace love +{ +namespace sound +{ + +/** + * The Sound module is responsible for decoding sound data. It is + * not responsible for playing it. + **/ +class Sound : public Module +{ + +public: + + /** + * Destructor. + **/ + virtual ~Sound(); + + /** + * Creates new SoundData from a decoder. Fully expands the + * encoded sound data into raw sound data. Not recommended + * on large (long-duration) files. + * @param decoder The file to decode the data from. + * @return A SoundData object, or zero if the file type couldn't be handled. + **/ + SoundData *newSoundData(Decoder *decoder); + + /** + * Creates a new SoundData with the specified number of samples and format. + * @param duration In seconds. + * @param sampleRate Number of samples per second. + * @param bits Bits per sample (8 or 16). + * @param channels Either 1 for mono, or 2 for stereo. + * @return A new SoundData object, or zero in case of errors. + **/ + SoundData *newSoundData(int samples, int sampleRate, int bits, int channels); + + /** + * Attempts to find a decoder for the encoded sound data in the + * specified file. + * @param file The file with encoded sound data. + * @param bufferSize The size of each decoded chunk. + * @param sampleRate Samples per second, or quality of the audio. 44100 is a good value. + * @return A Decoder object on success, or zero if no decoder could be found. + **/ + virtual Decoder *newDecoder(filesystem::File *file, int bufferSize) = 0; + +}; // Sound + +} // sound +} // love + #endif // LOVE_SOUND_SOUND_H \ No newline at end of file diff --git a/src/modules/sound/SoundData.cpp b/src/modules/sound/SoundData.cpp index 0dd9b5803..41e925cf3 100644 --- a/src/modules/sound/SoundData.cpp +++ b/src/modules/sound/SoundData.cpp @@ -1,187 +1,187 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "SoundData.h" - -// C -#include -#include -#include - -// STL -#include -#include - -namespace love -{ -namespace sound -{ - -SoundData::SoundData(Decoder *decoder) - : data(0) - , size(0) - , sampleRate(Decoder::DEFAULT_SAMPLE_RATE) - , bits(0) - , channels(0) -{ - size_t bufferSize = 524288; - int decoded = decoder->decode(); - - while (decoded > 0) - { - // Expand or allocate buffer. Note that realloc may move - // memory to other locations. - if (!data || bufferSize < (size_t) size + decoded) - { - while (bufferSize < (size_t) size + decoded) - bufferSize <<= 1; - data = (char *)realloc(data, bufferSize); - } - - if (!data) - throw love::Exception("Not enough memory."); - - // Copy memory into new part of memory. - memcpy(data + size, decoder->getBuffer(), decoded); - - // Keep this up to date. - size += decoded; - - // Overflow check. - if (size < 0) - { - free(data); - throw love::Exception("Not enough memory."); - } - - decoded = decoder->decode(); - } - - // Shrink buffer if necessary. - if (data && bufferSize > (size_t) size) - data = (char *) realloc(data, size); - - channels = decoder->getChannels(); - bits = decoder->getBits(); - sampleRate = decoder->getSampleRate(); -} - -SoundData::SoundData(int samples, int sampleRate, int bits, int channels) - : data(0) - , size(samples*(bits/8)*channels) - , sampleRate(sampleRate) - , bits(bits) - , channels(channels) -{ - double realsize = samples; - realsize *= (bits/8)*channels; - if (realsize > INT_MAX) - throw love::Exception("Data is too big!"); - data = (char *)malloc(size); - if (!data) - throw love::Exception("Not enough memory."); -} - -SoundData::SoundData(void *d, int samples, int sampleRate, int bits, int channels) - : data(0) - , size(samples*(bits/8)*channels) - , sampleRate(sampleRate) - , bits(bits) - , channels(channels) -{ - double realsize = samples; - realsize *= (bits/8)*channels; - if (realsize > INT_MAX) - throw love::Exception("Data is too big!"); - data = (char *)malloc(size); - if (!data) - throw love::Exception("Not enough memory."); - memcpy(data, d, size); -} - -SoundData::~SoundData() -{ - if (data != 0) - free(data); -} - -void *SoundData::getData() const -{ - return (void *)data; -} - -int SoundData::getSize() const -{ - return (int)size; -} - -int SoundData::getChannels() const -{ - return channels; -} - -int SoundData::getBits() const -{ - return bits; -} - -int SoundData::getSampleRate() const -{ - return sampleRate; -} - -void SoundData::setSample(int i, float sample) -{ - // Check range. - if (i < 0 || i >= size/(bits/8)) - return; - - if (bits == 16) - { - short *s = (short *)data; - s[i] = (short)(sample*(float)SHRT_MAX); - return; - } - else - { - data[i] = (char)(sample*(float)CHAR_MAX); - return; - } -} - -float SoundData::getSample(int i) const -{ - // Check range. - if (i < 0 || i >= size/(bits/8)) - return 0; - - if (bits == 16) - { - short *s = (short *)data; - return (float)s[i]/(float)SHRT_MAX; - } - else - { - return (float)data[i]/(float)CHAR_MAX; - } -} - -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "SoundData.h" + +// C +#include +#include +#include + +// STL +#include +#include + +namespace love +{ +namespace sound +{ + +SoundData::SoundData(Decoder *decoder) + : data(0) + , size(0) + , sampleRate(Decoder::DEFAULT_SAMPLE_RATE) + , bits(0) + , channels(0) +{ + size_t bufferSize = 524288; + int decoded = decoder->decode(); + + while (decoded > 0) + { + // Expand or allocate buffer. Note that realloc may move + // memory to other locations. + if (!data || bufferSize < (size_t) size + decoded) + { + while (bufferSize < (size_t) size + decoded) + bufferSize <<= 1; + data = (char *)realloc(data, bufferSize); + } + + if (!data) + throw love::Exception("Not enough memory."); + + // Copy memory into new part of memory. + memcpy(data + size, decoder->getBuffer(), decoded); + + // Keep this up to date. + size += decoded; + + // Overflow check. + if (size < 0) + { + free(data); + throw love::Exception("Not enough memory."); + } + + decoded = decoder->decode(); + } + + // Shrink buffer if necessary. + if (data && bufferSize > (size_t) size) + data = (char *) realloc(data, size); + + channels = decoder->getChannels(); + bits = decoder->getBits(); + sampleRate = decoder->getSampleRate(); +} + +SoundData::SoundData(int samples, int sampleRate, int bits, int channels) + : data(0) + , size(samples*(bits/8)*channels) + , sampleRate(sampleRate) + , bits(bits) + , channels(channels) +{ + double realsize = samples; + realsize *= (bits/8)*channels; + if (realsize > INT_MAX) + throw love::Exception("Data is too big!"); + data = (char *)malloc(size); + if (!data) + throw love::Exception("Not enough memory."); +} + +SoundData::SoundData(void *d, int samples, int sampleRate, int bits, int channels) + : data(0) + , size(samples*(bits/8)*channels) + , sampleRate(sampleRate) + , bits(bits) + , channels(channels) +{ + double realsize = samples; + realsize *= (bits/8)*channels; + if (realsize > INT_MAX) + throw love::Exception("Data is too big!"); + data = (char *)malloc(size); + if (!data) + throw love::Exception("Not enough memory."); + memcpy(data, d, size); +} + +SoundData::~SoundData() +{ + if (data != 0) + free(data); +} + +void *SoundData::getData() const +{ + return (void *)data; +} + +int SoundData::getSize() const +{ + return (int)size; +} + +int SoundData::getChannels() const +{ + return channels; +} + +int SoundData::getBits() const +{ + return bits; +} + +int SoundData::getSampleRate() const +{ + return sampleRate; +} + +void SoundData::setSample(int i, float sample) +{ + // Check range. + if (i < 0 || i >= size/(bits/8)) + return; + + if (bits == 16) + { + short *s = (short *)data; + s[i] = (short)(sample*(float)SHRT_MAX); + return; + } + else + { + data[i] = (char)(sample*(float)CHAR_MAX); + return; + } +} + +float SoundData::getSample(int i) const +{ + // Check range. + if (i < 0 || i >= size/(bits/8)) + return 0; + + if (bits == 16) + { + short *s = (short *)data; + return (float)s[i]/(float)SHRT_MAX; + } + else + { + return (float)data[i]/(float)CHAR_MAX; + } +} + +} // sound +} // love diff --git a/src/modules/sound/SoundData.h b/src/modules/sound/SoundData.h index 5b06e7b0e..254dd092d 100644 --- a/src/modules/sound/SoundData.h +++ b/src/modules/sound/SoundData.h @@ -1,68 +1,68 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_SOUND_DATA_H -#define LOVE_SOUND_SOUND_DATA_H - -// LOVE -#include "filesystem/File.h" - -#include "Decoder.h" - -namespace love -{ -namespace sound -{ - -class SoundData : public love::Data -{ -public: - - SoundData(Decoder *decoder); - SoundData(int samples, int sampleRate, int bits, int channels); - SoundData(void *d, int samples, int sampleRate, int bits, int channels); - - virtual ~SoundData(); - - // Implements Data. - void *getData() const; - int getSize() const; - - virtual int getChannels() const; - virtual int getBits() const; - virtual int getSampleRate() const; - - void setSample(int i, float sample); - float getSample(int i) const; - -private: - - char *data; - int size; - - int sampleRate; - int bits; - int channels; -}; // SoundData - -} // sound -} // love - -#endif // LOVE_SOUND_SOUND_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_SOUND_DATA_H +#define LOVE_SOUND_SOUND_DATA_H + +// LOVE +#include "filesystem/File.h" + +#include "Decoder.h" + +namespace love +{ +namespace sound +{ + +class SoundData : public love::Data +{ +public: + + SoundData(Decoder *decoder); + SoundData(int samples, int sampleRate, int bits, int channels); + SoundData(void *d, int samples, int sampleRate, int bits, int channels); + + virtual ~SoundData(); + + // Implements Data. + void *getData() const; + int getSize() const; + + virtual int getChannels() const; + virtual int getBits() const; + virtual int getSampleRate() const; + + void setSample(int i, float sample); + float getSample(int i) const; + +private: + + char *data; + int size; + + int sampleRate; + int bits; + int channels; +}; // SoundData + +} // sound +} // love + +#endif // LOVE_SOUND_SOUND_DATA_H diff --git a/src/modules/sound/lullaby/Decoder.cpp b/src/modules/sound/lullaby/Decoder.cpp index 2c3fd0f73..3e061c7c1 100644 --- a/src/modules/sound/lullaby/Decoder.cpp +++ b/src/modules/sound/lullaby/Decoder.cpp @@ -1,75 +1,75 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "Decoder.h" - -#include "common/Exception.h" - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -Decoder::Decoder(Data *data, const std::string &ext, int bufferSize) - : data(data) - , ext(ext) - , bufferSize(bufferSize) - , sampleRate(DEFAULT_SAMPLE_RATE) - , buffer(0) - , eof(false) -{ - data->retain(); - buffer = new char[bufferSize]; -} - -Decoder::~Decoder() -{ - if (buffer != 0) - delete [](char *) buffer; - if (data != 0) - data->release(); -} - -void *Decoder::getBuffer() const -{ - return buffer; -} - -int Decoder::getSize() const -{ - return bufferSize; -} - -int Decoder::getSampleRate() const -{ - return sampleRate; -} - -bool Decoder::isFinished() -{ - return eof; -} - - -} // lullaby -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "Decoder.h" + +#include "common/Exception.h" + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +Decoder::Decoder(Data *data, const std::string &ext, int bufferSize) + : data(data) + , ext(ext) + , bufferSize(bufferSize) + , sampleRate(DEFAULT_SAMPLE_RATE) + , buffer(0) + , eof(false) +{ + data->retain(); + buffer = new char[bufferSize]; +} + +Decoder::~Decoder() +{ + if (buffer != 0) + delete [](char *) buffer; + if (data != 0) + data->release(); +} + +void *Decoder::getBuffer() const +{ + return buffer; +} + +int Decoder::getSize() const +{ + return bufferSize; +} + +int Decoder::getSampleRate() const +{ + return sampleRate; +} + +bool Decoder::isFinished() +{ + return eof; +} + + +} // lullaby +} // sound +} // love diff --git a/src/modules/sound/lullaby/Decoder.h b/src/modules/sound/lullaby/Decoder.h index 4d2c068a7..2cc9ebf51 100644 --- a/src/modules/sound/lullaby/Decoder.h +++ b/src/modules/sound/lullaby/Decoder.h @@ -1,79 +1,79 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_LULLABY_DECODER_H -#define LOVE_SOUND_LULLABY_DECODER_H - -// LOVE -#include "sound/Decoder.h" -#include "filesystem/File.h" - -#include - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -class Decoder : public love::sound::Decoder -{ -public: - - Decoder(Data *data, const std::string &ext, int bufferSize); - - virtual ~Decoder(); - - // Implement some of love::sound::Decoder, but allow subclasses - // to override them. - virtual void *getBuffer() const; - virtual int getSize() const; - virtual int getSampleRate() const; - virtual bool isFinished(); - -protected: - - // The encoded data. This should be replaced with buffered file - // reads in the future. - Data *data; - - // File extension. - std::string ext; - - // When the decoder decodes data incrementally, it writes - // this many bytes at a time (at most). - int bufferSize; - - // The desired frequency of the samples. 44100, 22050, or 11025. - int sampleRate; - - // Holds internal memory. - void *buffer; - - // Set this to true when eof has been reached. - bool eof; -}; // Decoder - -} // lullaby -} // sound -} // love - -#endif // LOVE_SOUND_LULLABY_DECODER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_LULLABY_DECODER_H +#define LOVE_SOUND_LULLABY_DECODER_H + +// LOVE +#include "sound/Decoder.h" +#include "filesystem/File.h" + +#include + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +class Decoder : public love::sound::Decoder +{ +public: + + Decoder(Data *data, const std::string &ext, int bufferSize); + + virtual ~Decoder(); + + // Implement some of love::sound::Decoder, but allow subclasses + // to override them. + virtual void *getBuffer() const; + virtual int getSize() const; + virtual int getSampleRate() const; + virtual bool isFinished(); + +protected: + + // The encoded data. This should be replaced with buffered file + // reads in the future. + Data *data; + + // File extension. + std::string ext; + + // When the decoder decodes data incrementally, it writes + // this many bytes at a time (at most). + int bufferSize; + + // The desired frequency of the samples. 44100, 22050, or 11025. + int sampleRate; + + // Holds internal memory. + void *buffer; + + // Set this to true when eof has been reached. + bool eof; +}; // Decoder + +} // lullaby +} // sound +} // love + +#endif // LOVE_SOUND_LULLABY_DECODER_H diff --git a/src/modules/sound/lullaby/FLACDecoder.cpp b/src/modules/sound/lullaby/FLACDecoder.cpp index 5be7628de..f6fd70616 100644 --- a/src/modules/sound/lullaby/FLACDecoder.cpp +++ b/src/modules/sound/lullaby/FLACDecoder.cpp @@ -1,186 +1,186 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#if 0 - -#include "FLACDecoder.h" - -#include -#include "common/Exception.h" - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -FLACDecoder::FLACDecoder(Data *data, const std::string &ext, int nbufferSize) - : Decoder(data, ext, nbufferSize) - , pos(0) -{ - init(); - init_ogg(); - process_until_end_of_metadata(); - process_single(); - seek(0); - bufferSize = 256 * getBits() * getChannels() * 2; - delete[](char *) buffer; - buffer = new char[bufferSize]; -} - -FLACDecoder::~FLACDecoder() -{ - finish(); -} - -bool FLACDecoder::accepts(const std::string &ext) -{ - static const std::string supported[] = - { - "flac", "" - }; - - for (int i = 0; !(supported[i].empty()); i++) - { - if (supported[i].compare(ext) == 0) - return true; - } - - return false; -} - -love::sound::Decoder *FLACDecoder::clone() -{ - return new FLACDecoder(data, ext, bufferSize, sampleRate); -} - -int FLACDecoder::decode() -{ - process_single(); - return bufferSize; -} - -bool FLACDecoder::seek(float s) -{ - return seek_absolute((int)(s*1000.0f)); -} - -bool FLACDecoder::rewind() -{ - return seek_absolute(0); -} - -bool FLACDecoder::isSeekable() -{ - return true; -} - -int FLACDecoder::getChannels() const -{ - return get_channels(); -} - -int FLACDecoder::getBits() const -{ - return get_bits_per_sample(); -} - -int FLACDecoder::getSampleRate() const -{ - return get_sample_rate(); -} - -FLAC__StreamDecoderReadStatus FLACDecoder::read_callback(FLAC__byte buffer[], size_t *bytes) -{ - int size = data->getSize(); - char *d = (char *) data->getData() + pos; - if (pos >= size) - { - eof = true; - return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - } - if (pos+*bytes <= (unsigned int)size) - { - memcpy(buffer, d, *bytes); - pos = pos+*bytes; - } - else - { - memcpy(buffer, d, size-pos); - *bytes = size-pos; - pos = size; - } - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; -} - -FLAC__StreamDecoderSeekStatus FLACDecoder::seek_callback(FLAC__uint64 offset) -{ - pos = (int)offset; - return FLAC__STREAM_DECODER_SEEK_STATUS_OK; -} - -FLAC__StreamDecoderTellStatus FLACDecoder::tell_callback(FLAC__uint64 *offset) -{ - *offset = pos; - return FLAC__STREAM_DECODER_TELL_STATUS_OK; -} - -FLAC__StreamDecoderLengthStatus FLACDecoder::length_callback(FLAC__uint64 *length) -{ - *length = data->getSize(); - return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; -} - -bool FLACDecoder::eof_callback() -{ - eof = (pos >= data->getSize()); - return eof; -} - -FLAC__StreamDecoderWriteStatus FLACDecoder::write_callback(const FLAC__Frame *frame, const FLAC__int32 *const fbuffer[]) -{ - int i, j; - for (i = 0, j = 0; i < bufferSize; i += 4, j++) - { - ((char *)buffer)[i] = fbuffer[0][j]; - ((char *)buffer)[i+1] = fbuffer[0][j] >> 8; - ((char *)buffer)[i+2] = fbuffer[1][j]; - ((char *)buffer)[i+3] = fbuffer[1][j] >> 8; - } - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -void FLACDecoder::metadata_callback(const FLAC__StreamMetadata *metadata) -{ - //we do nothing with metadata... - return; -} - -void FLACDecoder::error_callback(FLAC__StreamDecoderErrorStatus status) -{ - //wow.. error, let's throw one (please clean this part up sometime) - throw love::Exception("FLAC error: %s!", FLAC__StreamDecoderErrorStatusString[status]); -} -} // lullaby -} // sound -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#if 0 + +#include "FLACDecoder.h" + +#include +#include "common/Exception.h" + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +FLACDecoder::FLACDecoder(Data *data, const std::string &ext, int nbufferSize) + : Decoder(data, ext, nbufferSize) + , pos(0) +{ + init(); + init_ogg(); + process_until_end_of_metadata(); + process_single(); + seek(0); + bufferSize = 256 * getBits() * getChannels() * 2; + delete[](char *) buffer; + buffer = new char[bufferSize]; +} + +FLACDecoder::~FLACDecoder() +{ + finish(); +} + +bool FLACDecoder::accepts(const std::string &ext) +{ + static const std::string supported[] = + { + "flac", "" + }; + + for (int i = 0; !(supported[i].empty()); i++) + { + if (supported[i].compare(ext) == 0) + return true; + } + + return false; +} + +love::sound::Decoder *FLACDecoder::clone() +{ + return new FLACDecoder(data, ext, bufferSize, sampleRate); +} + +int FLACDecoder::decode() +{ + process_single(); + return bufferSize; +} + +bool FLACDecoder::seek(float s) +{ + return seek_absolute((int)(s*1000.0f)); +} + +bool FLACDecoder::rewind() +{ + return seek_absolute(0); +} + +bool FLACDecoder::isSeekable() +{ + return true; +} + +int FLACDecoder::getChannels() const +{ + return get_channels(); +} + +int FLACDecoder::getBits() const +{ + return get_bits_per_sample(); +} + +int FLACDecoder::getSampleRate() const +{ + return get_sample_rate(); +} + +FLAC__StreamDecoderReadStatus FLACDecoder::read_callback(FLAC__byte buffer[], size_t *bytes) +{ + int size = data->getSize(); + char *d = (char *) data->getData() + pos; + if (pos >= size) + { + eof = true; + return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; + } + if (pos+*bytes <= (unsigned int)size) + { + memcpy(buffer, d, *bytes); + pos = pos+*bytes; + } + else + { + memcpy(buffer, d, size-pos); + *bytes = size-pos; + pos = size; + } + return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; +} + +FLAC__StreamDecoderSeekStatus FLACDecoder::seek_callback(FLAC__uint64 offset) +{ + pos = (int)offset; + return FLAC__STREAM_DECODER_SEEK_STATUS_OK; +} + +FLAC__StreamDecoderTellStatus FLACDecoder::tell_callback(FLAC__uint64 *offset) +{ + *offset = pos; + return FLAC__STREAM_DECODER_TELL_STATUS_OK; +} + +FLAC__StreamDecoderLengthStatus FLACDecoder::length_callback(FLAC__uint64 *length) +{ + *length = data->getSize(); + return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; +} + +bool FLACDecoder::eof_callback() +{ + eof = (pos >= data->getSize()); + return eof; +} + +FLAC__StreamDecoderWriteStatus FLACDecoder::write_callback(const FLAC__Frame *frame, const FLAC__int32 *const fbuffer[]) +{ + int i, j; + for (i = 0, j = 0; i < bufferSize; i += 4, j++) + { + ((char *)buffer)[i] = fbuffer[0][j]; + ((char *)buffer)[i+1] = fbuffer[0][j] >> 8; + ((char *)buffer)[i+2] = fbuffer[1][j]; + ((char *)buffer)[i+3] = fbuffer[1][j] >> 8; + } + return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; +} + +void FLACDecoder::metadata_callback(const FLAC__StreamMetadata *metadata) +{ + //we do nothing with metadata... + return; +} + +void FLACDecoder::error_callback(FLAC__StreamDecoderErrorStatus status) +{ + //wow.. error, let's throw one (please clean this part up sometime) + throw love::Exception("FLAC error: %s!", FLAC__StreamDecoderErrorStatusString[status]); +} +} // lullaby +} // sound +} // love + #endif // 0 \ No newline at end of file diff --git a/src/modules/sound/lullaby/FLACDecoder.h b/src/modules/sound/lullaby/FLACDecoder.h index 7b2814137..617d7da8a 100644 --- a/src/modules/sound/lullaby/FLACDecoder.h +++ b/src/modules/sound/lullaby/FLACDecoder.h @@ -1,76 +1,76 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_LULLABY_FLAC_DECODER_H -#define LOVE_SOUND_LULLABY_FLAC_DECODER_H - -#if 0 - -// LOVE -#include "common/Data.h" -#include "Decoder.h" - -#include -#include - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -class FLACDecoder : public Decoder, public FLAC::Decoder::Stream -{ -public: - FLACDecoder(Data *data, const std::string &ext, int bufferSize); - ~FLACDecoder(); - - static bool accepts(const std::string &ext); - love::sound::Decoder *clone(); - int decode(); - bool seek(float s); - bool rewind(); - bool isSeekable(); - int getChannels() const; - int getBits() const; - int getSampleRate() const; - - //needed for FLAC - FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes); - FLAC__StreamDecoderSeekStatus seek_callback(FLAC__uint64 offset); - FLAC__StreamDecoderTellStatus tell_callback(FLAC__uint64 *offset); - FLAC__StreamDecoderLengthStatus length_callback(FLAC__uint64 *length); - bool eof_callback(); - FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *frame, const FLAC__int32 *const buffer[]); - void metadata_callback(const FLAC__StreamMetadata *metadata); - void error_callback(FLAC__StreamDecoderErrorStatus status); - -private: - int pos; -}; // Decoder - -} // lullaby -} // sound -} // love - -#endif // 0 - -#endif // LOVE_SOUND_LULLABY_FLAC_DECODER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_LULLABY_FLAC_DECODER_H +#define LOVE_SOUND_LULLABY_FLAC_DECODER_H + +#if 0 + +// LOVE +#include "common/Data.h" +#include "Decoder.h" + +#include +#include + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +class FLACDecoder : public Decoder, public FLAC::Decoder::Stream +{ +public: + FLACDecoder(Data *data, const std::string &ext, int bufferSize); + ~FLACDecoder(); + + static bool accepts(const std::string &ext); + love::sound::Decoder *clone(); + int decode(); + bool seek(float s); + bool rewind(); + bool isSeekable(); + int getChannels() const; + int getBits() const; + int getSampleRate() const; + + //needed for FLAC + FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes); + FLAC__StreamDecoderSeekStatus seek_callback(FLAC__uint64 offset); + FLAC__StreamDecoderTellStatus tell_callback(FLAC__uint64 *offset); + FLAC__StreamDecoderLengthStatus length_callback(FLAC__uint64 *length); + bool eof_callback(); + FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *frame, const FLAC__int32 *const buffer[]); + void metadata_callback(const FLAC__StreamMetadata *metadata); + void error_callback(FLAC__StreamDecoderErrorStatus status); + +private: + int pos; +}; // Decoder + +} // lullaby +} // sound +} // love + +#endif // 0 + +#endif // LOVE_SOUND_LULLABY_FLAC_DECODER_H diff --git a/src/modules/sound/lullaby/GmeDecoder.cpp b/src/modules/sound/lullaby/GmeDecoder.cpp index e13b8ed8f..2280dd2be 100644 --- a/src/modules/sound/lullaby/GmeDecoder.cpp +++ b/src/modules/sound/lullaby/GmeDecoder.cpp @@ -1,141 +1,141 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -#ifdef LOVE_SUPPORT_GME - -#include "common/Exception.h" -#include "GmeDecoder.h" - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -GmeDecoder::GmeDecoder(Data *data, const std::string &ext, int bufferSize) - : Decoder(data, ext, bufferSize) - , emu(0) - , num_tracks(0) - , cur_track(0) -{ - void *d = data->getData(); - int s = data->getSize(); - - if (gme_open_data(d, s, &emu, sampleRate) != 0) - throw love::Exception("Could not open game music file"); - - num_tracks = gme_track_count(emu); - - if (num_tracks <= 0) - throw love::Exception("Game music file has no tracks"); - - if (gme_start_track(emu, cur_track) != 0) - throw love::Exception("Could not start game music playback"); -} - -GmeDecoder::~GmeDecoder() -{ - if (emu) - gme_delete(emu); -} - -bool GmeDecoder::accepts(const std::string &ext) -{ - static const std::string supported[] = - { - "ay", "gbs", "gym", "hes", "kss", "nsf", - "nsfe", "sap", "spc", "vgm", "vgz" - }; - - for (int i = 0; !(supported[i].empty()); i++) - { - if (supported[i].compare(ext) == 0) - return true; - } - - return false; -} - -love::sound::Decoder *GmeDecoder::clone() -{ - return new GmeDecoder(data, ext, bufferSize); -} - -int GmeDecoder::decode() -{ - short *sbuf = static_cast(buffer); - int size = bufferSize / sizeof(short); - - if (gme_play(emu, size, sbuf) != 0) - throw love::Exception("Error while decoding game music"); - - if (!eof && gme_track_ended(emu)) - { - // Start the next track if this one ended. - if (cur_track < num_tracks - 1) - gme_start_track(emu, ++cur_track); - else - eof = true; - } - - return bufferSize; -} - -bool GmeDecoder::seek(float s) -{ - return gme_seek(emu, static_cast(s * 1000.f)) != 0; -} - -bool GmeDecoder::rewind() -{ - // If we're in the first track, rewind. - if (cur_track == 0) - return gme_seek(emu, 0) == 0; - else - { - // Otherwise, start from the first track again. - cur_track = 0; - return gme_start_track(emu, cur_track) == 0; - } -} - -bool GmeDecoder::isSeekable() -{ - return true; -} - -int GmeDecoder::getChannels() const -{ - return 2; -} - -int GmeDecoder::getBits() const -{ - return 16; -} - -} // lullaby -} // sound -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +#ifdef LOVE_SUPPORT_GME + +#include "common/Exception.h" +#include "GmeDecoder.h" + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +GmeDecoder::GmeDecoder(Data *data, const std::string &ext, int bufferSize) + : Decoder(data, ext, bufferSize) + , emu(0) + , num_tracks(0) + , cur_track(0) +{ + void *d = data->getData(); + int s = data->getSize(); + + if (gme_open_data(d, s, &emu, sampleRate) != 0) + throw love::Exception("Could not open game music file"); + + num_tracks = gme_track_count(emu); + + if (num_tracks <= 0) + throw love::Exception("Game music file has no tracks"); + + if (gme_start_track(emu, cur_track) != 0) + throw love::Exception("Could not start game music playback"); +} + +GmeDecoder::~GmeDecoder() +{ + if (emu) + gme_delete(emu); +} + +bool GmeDecoder::accepts(const std::string &ext) +{ + static const std::string supported[] = + { + "ay", "gbs", "gym", "hes", "kss", "nsf", + "nsfe", "sap", "spc", "vgm", "vgz" + }; + + for (int i = 0; !(supported[i].empty()); i++) + { + if (supported[i].compare(ext) == 0) + return true; + } + + return false; +} + +love::sound::Decoder *GmeDecoder::clone() +{ + return new GmeDecoder(data, ext, bufferSize); +} + +int GmeDecoder::decode() +{ + short *sbuf = static_cast(buffer); + int size = bufferSize / sizeof(short); + + if (gme_play(emu, size, sbuf) != 0) + throw love::Exception("Error while decoding game music"); + + if (!eof && gme_track_ended(emu)) + { + // Start the next track if this one ended. + if (cur_track < num_tracks - 1) + gme_start_track(emu, ++cur_track); + else + eof = true; + } + + return bufferSize; +} + +bool GmeDecoder::seek(float s) +{ + return gme_seek(emu, static_cast(s * 1000.f)) != 0; +} + +bool GmeDecoder::rewind() +{ + // If we're in the first track, rewind. + if (cur_track == 0) + return gme_seek(emu, 0) == 0; + else + { + // Otherwise, start from the first track again. + cur_track = 0; + return gme_start_track(emu, cur_track) == 0; + } +} + +bool GmeDecoder::isSeekable() +{ + return true; +} + +int GmeDecoder::getChannels() const +{ + return 2; +} + +int GmeDecoder::getBits() const +{ + return 16; +} + +} // lullaby +} // sound +} // love + #endif // LOVE_SUPPORT_GME \ No newline at end of file diff --git a/src/modules/sound/lullaby/GmeDecoder.h b/src/modules/sound/lullaby/GmeDecoder.h index 311d5ef8a..ccbc4dd35 100644 --- a/src/modules/sound/lullaby/GmeDecoder.h +++ b/src/modules/sound/lullaby/GmeDecoder.h @@ -1,68 +1,68 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_LULLABY_GME_DECODER_H -#define LOVE_SOUND_LULLABY_GME_DECODER_H - -#ifdef LOVE_SUPPORT_GME - -// LOVE -#include "common/Data.h" -#include "Decoder.h" - -#include - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -class GmeDecoder : public Decoder -{ -public: - - GmeDecoder(Data *data, const std::string &ext, int bufferSize); - virtual ~GmeDecoder(); - - static bool accepts(const std::string &ext); - - love::sound::Decoder *clone(); - int decode(); - bool seek(float s); - bool rewind(); - bool isSeekable(); - int getChannels() const; - int getBits() const; - -private: - Music_Emu *emu; - int num_tracks; - int cur_track; -}; // Decoder - -} // lullaby -} // sound -} // love - -#endif // LOVE_SUPPORT_GME - -#endif // LOVE_SOUND_LULLABY_GME_DECODER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_LULLABY_GME_DECODER_H +#define LOVE_SOUND_LULLABY_GME_DECODER_H + +#ifdef LOVE_SUPPORT_GME + +// LOVE +#include "common/Data.h" +#include "Decoder.h" + +#include + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +class GmeDecoder : public Decoder +{ +public: + + GmeDecoder(Data *data, const std::string &ext, int bufferSize); + virtual ~GmeDecoder(); + + static bool accepts(const std::string &ext); + + love::sound::Decoder *clone(); + int decode(); + bool seek(float s); + bool rewind(); + bool isSeekable(); + int getChannels() const; + int getBits() const; + +private: + Music_Emu *emu; + int num_tracks; + int cur_track; +}; // Decoder + +} // lullaby +} // sound +} // love + +#endif // LOVE_SUPPORT_GME + +#endif // LOVE_SOUND_LULLABY_GME_DECODER_H diff --git a/src/modules/sound/lullaby/ModPlugDecoder.cpp b/src/modules/sound/lullaby/ModPlugDecoder.cpp index 4bf9f3325..9e130a689 100644 --- a/src/modules/sound/lullaby/ModPlugDecoder.cpp +++ b/src/modules/sound/lullaby/ModPlugDecoder.cpp @@ -1,147 +1,147 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ -#include "common/config.h" -#include "ModPlugDecoder.h" - -#include "common/Exception.h" - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -ModPlugDecoder::ModPlugDecoder(Data *data, const std::string &ext, int bufferSize) - : Decoder(data, ext, bufferSize) - , plug(0) -{ - - // Set some ModPlug settings. - settings.mFlags = MODPLUG_ENABLE_OVERSAMPLING | MODPLUG_ENABLE_NOISE_REDUCTION; - settings.mChannels = 2; - settings.mBits = 16; - settings.mFrequency = sampleRate; - settings.mResamplingMode = MODPLUG_RESAMPLE_LINEAR; - - // fill with modplug defaults (modplug _memsets_, so we could get - // garbage settings when the struct is only partially initialized) - // This does not exist yet on Windows. - - // Some settings not supported by some older versions -#ifndef LOVE_OLD_MODPLUG - settings.mStereoSeparation = 128; - settings.mMaxMixChannels = 32; -#endif - settings.mReverbDepth = 0; - settings.mReverbDelay = 0; - settings.mBassAmount = 0; - settings.mBassRange = 0; - settings.mSurroundDepth = 0; - settings.mSurroundDelay = 0; - settings.mLoopCount = 0; - - ModPlug_SetSettings(&settings); - - // Load the module. - plug = ModPlug_Load(data->getData(), data->getSize()); - - if (plug == 0) - throw love::Exception("Could not load file with ModPlug."); - - // set master volume for delicate ears - ModPlug_SetMasterVolume(plug, 128); -} - -ModPlugDecoder::~ModPlugDecoder() -{ - if (plug != 0) - ModPlug_Unload(plug); -} - -bool ModPlugDecoder::accepts(const std::string &ext) -{ - static const std::string supported[] = - { - "699", "abc", "amf", "ams", "dbm", "dmf", - "dsm", "far", "it", "j2b", "mdl", "med", - "mid", "mod", "mt2", "mtm", "okt", "pat", - "psm", "s3m", "stm", "ult", "umx", "wav", - "xm", "" - }; - - for (int i = 0; !(supported[i].empty()); i++) - { - if (supported[i].compare(ext) == 0) - return true; - } - - return false; -} - -love::sound::Decoder *ModPlugDecoder::clone() -{ - return new ModPlugDecoder(data, ext, bufferSize); -} - -int ModPlugDecoder::decode() -{ - int r = ModPlug_Read(plug, buffer, bufferSize); - - if (r == 0) - eof = true; - - return r; -} - -bool ModPlugDecoder::seek(float s) -{ - ModPlug_Seek(plug, (int)(s*1000.0f)); - return true; -} - -bool ModPlugDecoder::rewind() -{ - // Let's reload. - ModPlug_Unload(plug); - plug = ModPlug_Load(data->getData(), data->getSize()); - ModPlug_SetMasterVolume(plug, 128); - eof = false; - return (plug != 0); -} - -bool ModPlugDecoder::isSeekable() -{ - return true; -} - -int ModPlugDecoder::getChannels() const -{ - return 2; -} - -int ModPlugDecoder::getBits() const -{ - return 16; -} - -} // lullaby -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ +#include "common/config.h" +#include "ModPlugDecoder.h" + +#include "common/Exception.h" + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +ModPlugDecoder::ModPlugDecoder(Data *data, const std::string &ext, int bufferSize) + : Decoder(data, ext, bufferSize) + , plug(0) +{ + + // Set some ModPlug settings. + settings.mFlags = MODPLUG_ENABLE_OVERSAMPLING | MODPLUG_ENABLE_NOISE_REDUCTION; + settings.mChannels = 2; + settings.mBits = 16; + settings.mFrequency = sampleRate; + settings.mResamplingMode = MODPLUG_RESAMPLE_LINEAR; + + // fill with modplug defaults (modplug _memsets_, so we could get + // garbage settings when the struct is only partially initialized) + // This does not exist yet on Windows. + + // Some settings not supported by some older versions +#ifndef LOVE_OLD_MODPLUG + settings.mStereoSeparation = 128; + settings.mMaxMixChannels = 32; +#endif + settings.mReverbDepth = 0; + settings.mReverbDelay = 0; + settings.mBassAmount = 0; + settings.mBassRange = 0; + settings.mSurroundDepth = 0; + settings.mSurroundDelay = 0; + settings.mLoopCount = 0; + + ModPlug_SetSettings(&settings); + + // Load the module. + plug = ModPlug_Load(data->getData(), data->getSize()); + + if (plug == 0) + throw love::Exception("Could not load file with ModPlug."); + + // set master volume for delicate ears + ModPlug_SetMasterVolume(plug, 128); +} + +ModPlugDecoder::~ModPlugDecoder() +{ + if (plug != 0) + ModPlug_Unload(plug); +} + +bool ModPlugDecoder::accepts(const std::string &ext) +{ + static const std::string supported[] = + { + "699", "abc", "amf", "ams", "dbm", "dmf", + "dsm", "far", "it", "j2b", "mdl", "med", + "mid", "mod", "mt2", "mtm", "okt", "pat", + "psm", "s3m", "stm", "ult", "umx", "wav", + "xm", "" + }; + + for (int i = 0; !(supported[i].empty()); i++) + { + if (supported[i].compare(ext) == 0) + return true; + } + + return false; +} + +love::sound::Decoder *ModPlugDecoder::clone() +{ + return new ModPlugDecoder(data, ext, bufferSize); +} + +int ModPlugDecoder::decode() +{ + int r = ModPlug_Read(plug, buffer, bufferSize); + + if (r == 0) + eof = true; + + return r; +} + +bool ModPlugDecoder::seek(float s) +{ + ModPlug_Seek(plug, (int)(s*1000.0f)); + return true; +} + +bool ModPlugDecoder::rewind() +{ + // Let's reload. + ModPlug_Unload(plug); + plug = ModPlug_Load(data->getData(), data->getSize()); + ModPlug_SetMasterVolume(plug, 128); + eof = false; + return (plug != 0); +} + +bool ModPlugDecoder::isSeekable() +{ + return true; +} + +int ModPlugDecoder::getChannels() const +{ + return 2; +} + +int ModPlugDecoder::getBits() const +{ + return 16; +} + +} // lullaby +} // sound +} // love diff --git a/src/modules/sound/lullaby/ModPlugDecoder.h b/src/modules/sound/lullaby/ModPlugDecoder.h index 302b90d36..de4702f07 100644 --- a/src/modules/sound/lullaby/ModPlugDecoder.h +++ b/src/modules/sound/lullaby/ModPlugDecoder.h @@ -1,65 +1,65 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_LULLABY_MODPLUG_DECODER_H -#define LOVE_SOUND_LULLABY_MODPLUG_DECODER_H - -// LOVE -#include "common/Data.h" -#include "Decoder.h" - -// SDL_sound -#include - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -class ModPlugDecoder : public Decoder -{ -public: - - ModPlugDecoder(Data *data, const std::string &ext, int bufferSize); - virtual ~ModPlugDecoder(); - - static bool accepts(const std::string &ext); - - love::sound::Decoder *clone(); - int decode(); - bool seek(float s); - bool rewind(); - bool isSeekable(); - int getChannels() const; - int getBits() const; - -private: - - ModPlugFile *plug; - ModPlug_Settings settings; -}; // Decoder - -} // lullaby -} // sound -} // love - -#endif // LOVE_SOUND_LULLABY_MODPLUG_DECODER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_LULLABY_MODPLUG_DECODER_H +#define LOVE_SOUND_LULLABY_MODPLUG_DECODER_H + +// LOVE +#include "common/Data.h" +#include "Decoder.h" + +// SDL_sound +#include + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +class ModPlugDecoder : public Decoder +{ +public: + + ModPlugDecoder(Data *data, const std::string &ext, int bufferSize); + virtual ~ModPlugDecoder(); + + static bool accepts(const std::string &ext); + + love::sound::Decoder *clone(); + int decode(); + bool seek(float s); + bool rewind(); + bool isSeekable(); + int getChannels() const; + int getBits() const; + +private: + + ModPlugFile *plug; + ModPlug_Settings settings; +}; // Decoder + +} // lullaby +} // sound +} // love + +#endif // LOVE_SOUND_LULLABY_MODPLUG_DECODER_H diff --git a/src/modules/sound/lullaby/Mpg123Decoder.cpp b/src/modules/sound/lullaby/Mpg123Decoder.cpp index f46f41e9e..be302b782 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.cpp +++ b/src/modules/sound/lullaby/Mpg123Decoder.cpp @@ -1,238 +1,238 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_NOMPG123 - -#include "Mpg123Decoder.h" - -#include "common/Exception.h" - -#include - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -bool Mpg123Decoder::inited = false; - -Mpg123Decoder::Mpg123Decoder(Data *data, const std::string &ext, int bufferSize) - : Decoder(data, ext, bufferSize) - , handle(0) - , channels(MPG123_STEREO) -{ - - data_size = data->getSize(); - data_offset = 0; - - int ret; - - if (!inited) - { - ret = mpg123_init(); - if (ret != MPG123_OK) - throw love::Exception("Could not initialize mpg123."); - inited = (ret == MPG123_OK); - } - - //Intialize the handle - handle = mpg123_new(NULL, &ret); - if (handle == NULL) - throw love::Exception("Could not create handle."); - ret = mpg123_open_feed(handle); - if (ret != MPG123_OK) - throw love::Exception("Could not open feed."); - - ret = feed(16384); - - if (ret != MPG123_OK && ret != MPG123_DONE) - throw love::Exception("Could not feed!"); -} - -Mpg123Decoder::~Mpg123Decoder() -{ - mpg123_delete(handle); - -} - -bool Mpg123Decoder::accepts(const std::string &ext) -{ - static const std::string supported[] = - { - "mp3", "" - }; - - for (int i = 0; !(supported[i].empty()); i++) - { - if (supported[i].compare(ext) == 0) - return true; - } - - return false; -} - -void Mpg123Decoder::quit() -{ - if (inited) - mpg123_exit(); -} - -love::sound::Decoder *Mpg123Decoder::clone() -{ - return new Mpg123Decoder(data, ext, bufferSize); -} - -int Mpg123Decoder::decode() -{ - int size = 0; - bool done = false; - - while (size < bufferSize && !done && !eof) - { - size_t numbytes = 0; - - int r = mpg123_read(handle, (unsigned char *) buffer + size, bufferSize - size, &numbytes); - - switch (r) - { - case MPG123_NEW_FORMAT: - { - size += numbytes; - long rate = 0; - int encoding = 0; - int ret = mpg123_getformat(handle, &rate, &channels, &encoding); - if (rate == 0) - rate = sampleRate; - else - sampleRate = rate; - if (channels == 0) - channels = MPG123_STEREO; - if (encoding == 0) - encoding = MPG123_ENC_SIGNED_16; - ret = mpg123_format(handle, rate, channels, encoding); - if (ret != MPG123_OK) - throw love::Exception("Could not set output format."); - } - continue; - case MPG123_NEED_MORE: - { - size += numbytes; - int v = feed(8192); - - switch (v) - { - case MPG123_OK: - continue; - case MPG123_DONE: - if (numbytes == 0) - eof = true; - break; - default: - done = true; - } - - continue; - } - case MPG123_OK: - size += numbytes; - continue; - case MPG123_DONE: - // Apparently, mpg123_read does not return MPG123_DONE, but - // let's keep it here anyway. - eof = true; - default: - done = true; - break; - } - } - - return size; -} - -bool Mpg123Decoder::seek(float s) -{ - off_t offset = static_cast(s * static_cast(sampleRate)); - - if (offset < 0) - return false; - - if (mpg123_feedseek(handle, offset, SEEK_SET, &offset) >= 0) - { - data_offset = offset; - eof = false; - return true; - } - else - return false; -} - -bool Mpg123Decoder::rewind() -{ - eof = false; - off_t offset; - - if (mpg123_feedseek(handle, 0, SEEK_SET, &offset) >= 0) - { - data_offset = offset; - return true; - } - else - return false; -} - -bool Mpg123Decoder::isSeekable() -{ - return true; -} - -int Mpg123Decoder::getChannels() const -{ - return channels; -} - -int Mpg123Decoder::getBits() const -{ - return 16; -} - -int Mpg123Decoder::feed(int bytes) -{ - int remaining = data_size - data_offset; - - if (remaining <= 0) - return MPG123_DONE; - - int feed_bytes = remaining < bytes ? remaining : bytes; - - int r = mpg123_feed(handle, (unsigned char *)data->getData() + data_offset, feed_bytes); - - if (r == MPG123_OK || r == MPG123_DONE) - data_offset += feed_bytes; - - return r; -} - -} // lullaby -} // sound -} // love - -#endif // LOVE_NOMPG123 +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_NOMPG123 + +#include "Mpg123Decoder.h" + +#include "common/Exception.h" + +#include + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +bool Mpg123Decoder::inited = false; + +Mpg123Decoder::Mpg123Decoder(Data *data, const std::string &ext, int bufferSize) + : Decoder(data, ext, bufferSize) + , handle(0) + , channels(MPG123_STEREO) +{ + + data_size = data->getSize(); + data_offset = 0; + + int ret; + + if (!inited) + { + ret = mpg123_init(); + if (ret != MPG123_OK) + throw love::Exception("Could not initialize mpg123."); + inited = (ret == MPG123_OK); + } + + //Intialize the handle + handle = mpg123_new(NULL, &ret); + if (handle == NULL) + throw love::Exception("Could not create handle."); + ret = mpg123_open_feed(handle); + if (ret != MPG123_OK) + throw love::Exception("Could not open feed."); + + ret = feed(16384); + + if (ret != MPG123_OK && ret != MPG123_DONE) + throw love::Exception("Could not feed!"); +} + +Mpg123Decoder::~Mpg123Decoder() +{ + mpg123_delete(handle); + +} + +bool Mpg123Decoder::accepts(const std::string &ext) +{ + static const std::string supported[] = + { + "mp3", "" + }; + + for (int i = 0; !(supported[i].empty()); i++) + { + if (supported[i].compare(ext) == 0) + return true; + } + + return false; +} + +void Mpg123Decoder::quit() +{ + if (inited) + mpg123_exit(); +} + +love::sound::Decoder *Mpg123Decoder::clone() +{ + return new Mpg123Decoder(data, ext, bufferSize); +} + +int Mpg123Decoder::decode() +{ + int size = 0; + bool done = false; + + while (size < bufferSize && !done && !eof) + { + size_t numbytes = 0; + + int r = mpg123_read(handle, (unsigned char *) buffer + size, bufferSize - size, &numbytes); + + switch (r) + { + case MPG123_NEW_FORMAT: + { + size += numbytes; + long rate = 0; + int encoding = 0; + int ret = mpg123_getformat(handle, &rate, &channels, &encoding); + if (rate == 0) + rate = sampleRate; + else + sampleRate = rate; + if (channels == 0) + channels = MPG123_STEREO; + if (encoding == 0) + encoding = MPG123_ENC_SIGNED_16; + ret = mpg123_format(handle, rate, channels, encoding); + if (ret != MPG123_OK) + throw love::Exception("Could not set output format."); + } + continue; + case MPG123_NEED_MORE: + { + size += numbytes; + int v = feed(8192); + + switch (v) + { + case MPG123_OK: + continue; + case MPG123_DONE: + if (numbytes == 0) + eof = true; + break; + default: + done = true; + } + + continue; + } + case MPG123_OK: + size += numbytes; + continue; + case MPG123_DONE: + // Apparently, mpg123_read does not return MPG123_DONE, but + // let's keep it here anyway. + eof = true; + default: + done = true; + break; + } + } + + return size; +} + +bool Mpg123Decoder::seek(float s) +{ + off_t offset = static_cast(s * static_cast(sampleRate)); + + if (offset < 0) + return false; + + if (mpg123_feedseek(handle, offset, SEEK_SET, &offset) >= 0) + { + data_offset = offset; + eof = false; + return true; + } + else + return false; +} + +bool Mpg123Decoder::rewind() +{ + eof = false; + off_t offset; + + if (mpg123_feedseek(handle, 0, SEEK_SET, &offset) >= 0) + { + data_offset = offset; + return true; + } + else + return false; +} + +bool Mpg123Decoder::isSeekable() +{ + return true; +} + +int Mpg123Decoder::getChannels() const +{ + return channels; +} + +int Mpg123Decoder::getBits() const +{ + return 16; +} + +int Mpg123Decoder::feed(int bytes) +{ + int remaining = data_size - data_offset; + + if (remaining <= 0) + return MPG123_DONE; + + int feed_bytes = remaining < bytes ? remaining : bytes; + + int r = mpg123_feed(handle, (unsigned char *)data->getData() + data_offset, feed_bytes); + + if (r == MPG123_OK || r == MPG123_DONE) + data_offset += feed_bytes; + + return r; +} + +} // lullaby +} // sound +} // love + +#endif // LOVE_NOMPG123 diff --git a/src/modules/sound/lullaby/Mpg123Decoder.h b/src/modules/sound/lullaby/Mpg123Decoder.h index 0aa0703ab..95c2038ca 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.h +++ b/src/modules/sound/lullaby/Mpg123Decoder.h @@ -1,80 +1,80 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_NOMPG123 -#ifndef LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H -#define LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H - -// LOVE -#include "common/Data.h" -#include "Decoder.h" - -// libmpg123 -#ifdef LOVE_MACOSX -#include -#else -#include -#endif - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -class Mpg123Decoder : public Decoder -{ -public: - - Mpg123Decoder(Data *data, const std::string &ext, int bufferSize); - virtual ~Mpg123Decoder(); - - static bool accepts(const std::string &ext); - static void quit(); - - love::sound::Decoder *clone(); - int decode(); - bool seek(float s); - bool rewind(); - bool isSeekable(); - int getChannels() const; - int getBits() const; - -private: - - int feed(int bytes); - - mpg123_handle *handle; - static bool inited; - - int data_offset; - int data_size; - - int channels; - -}; // Decoder - -} // lullaby -} // sound -} // love - -#endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H -#endif // LOVE_NOMPG123 +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_NOMPG123 +#ifndef LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H +#define LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H + +// LOVE +#include "common/Data.h" +#include "Decoder.h" + +// libmpg123 +#ifdef LOVE_MACOSX +#include +#else +#include +#endif + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +class Mpg123Decoder : public Decoder +{ +public: + + Mpg123Decoder(Data *data, const std::string &ext, int bufferSize); + virtual ~Mpg123Decoder(); + + static bool accepts(const std::string &ext); + static void quit(); + + love::sound::Decoder *clone(); + int decode(); + bool seek(float s); + bool rewind(); + bool isSeekable(); + int getChannels() const; + int getBits() const; + +private: + + int feed(int bytes); + + mpg123_handle *handle; + static bool inited; + + int data_offset; + int data_size; + + int channels; + +}; // Decoder + +} // lullaby +} // sound +} // love + +#endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H +#endif // LOVE_NOMPG123 diff --git a/src/modules/sound/lullaby/Sound.cpp b/src/modules/sound/lullaby/Sound.cpp index 33c98954c..9b7df1799 100644 --- a/src/modules/sound/lullaby/Sound.cpp +++ b/src/modules/sound/lullaby/Sound.cpp @@ -1,86 +1,86 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -#include "Sound.h" - -#include "ModPlugDecoder.h" -#include "Mpg123Decoder.h" -#include "VorbisDecoder.h" -#include "GmeDecoder.h" -//#include "FLACDecoder.h" - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -Sound::Sound() -{ -} - -Sound::~Sound() -{ -#ifndef LOVE_NOMPG123 - Mpg123Decoder::quit(); -#endif // LOVE_NOMPG123 -} - -const char *Sound::getName() const -{ - return "love.sound.lullaby"; -} - -sound::Decoder *Sound::newDecoder(love::filesystem::File *file, int bufferSize) -{ - Data *data = file->read(); - std::string ext = file->getExtension(); - - sound::Decoder *decoder = 0; - - // Find a suitable decoder here, and return it. - if (ModPlugDecoder::accepts(ext)) - decoder = new ModPlugDecoder(data, ext, bufferSize); -#ifndef LOVE_NOMPG123 - else if (Mpg123Decoder::accepts(ext)) - decoder = new Mpg123Decoder(data, ext, bufferSize); -#endif // LOVE_NOMPG123 - else if (VorbisDecoder::accepts(ext)) - decoder = new VorbisDecoder(data, ext, bufferSize); -#ifdef LOVE_SUPPORT_GME - else if (GmeDecoder::accepts(ext)) - decoder = new GmeDecoder(data, ext, bufferSize); -#endif // LOVE_SUPPORT_GME - /*else if (FLACDecoder::accepts(ext)) - decoder = new FLACDecoder(data, ext, bufferSize);*/ - - // else if (OtherDecoder::accept(ext)) - - data->release(); - - return decoder; -} - -} // lullaby -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +#include "Sound.h" + +#include "ModPlugDecoder.h" +#include "Mpg123Decoder.h" +#include "VorbisDecoder.h" +#include "GmeDecoder.h" +//#include "FLACDecoder.h" + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +Sound::Sound() +{ +} + +Sound::~Sound() +{ +#ifndef LOVE_NOMPG123 + Mpg123Decoder::quit(); +#endif // LOVE_NOMPG123 +} + +const char *Sound::getName() const +{ + return "love.sound.lullaby"; +} + +sound::Decoder *Sound::newDecoder(love::filesystem::File *file, int bufferSize) +{ + Data *data = file->read(); + std::string ext = file->getExtension(); + + sound::Decoder *decoder = 0; + + // Find a suitable decoder here, and return it. + if (ModPlugDecoder::accepts(ext)) + decoder = new ModPlugDecoder(data, ext, bufferSize); +#ifndef LOVE_NOMPG123 + else if (Mpg123Decoder::accepts(ext)) + decoder = new Mpg123Decoder(data, ext, bufferSize); +#endif // LOVE_NOMPG123 + else if (VorbisDecoder::accepts(ext)) + decoder = new VorbisDecoder(data, ext, bufferSize); +#ifdef LOVE_SUPPORT_GME + else if (GmeDecoder::accepts(ext)) + decoder = new GmeDecoder(data, ext, bufferSize); +#endif // LOVE_SUPPORT_GME + /*else if (FLACDecoder::accepts(ext)) + decoder = new FLACDecoder(data, ext, bufferSize);*/ + + // else if (OtherDecoder::accept(ext)) + + data->release(); + + return decoder; +} + +} // lullaby +} // sound +} // love diff --git a/src/modules/sound/lullaby/Sound.h b/src/modules/sound/lullaby/Sound.h index 0eabebe5b..cbf9ac1e6 100644 --- a/src/modules/sound/lullaby/Sound.h +++ b/src/modules/sound/lullaby/Sound.h @@ -1,70 +1,70 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - - - -#ifndef LOVE_SOUND_LULLABY_SOUND_H -#define LOVE_SOUND_LULLABY_SOUND_H - -// LOVE -#include -#include "sound/Decoder.h" - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -/** - * The love.sound.lullaby module is the custom sound decoder module for LOVE. Instead - * of using an intermediate library like SDL_sound, it interfaces with relevant libraries - * directly (libmpg123, libmodplug, libFLAC, etc). - * - * It was Mike that came up with the name Lullaby, which we both instantly recognized as awesome. - **/ -class Sound : public love::sound::Sound -{ -public: - - /** - * Constructor. Initializes relevant libraries. - **/ - Sound(); - - /** - * Destructor. Deinitializes relevant libraries. - **/ - virtual ~Sound(); - - /// @copydoc love::Module::getName - const char *getName() const; - - /// @copydoc love::sound::Sound::newDecoder - sound::Decoder *newDecoder(love::filesystem::File *file, int bufferSize); - -}; // Sound - -} // lullaby -} // sound -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + + + +#ifndef LOVE_SOUND_LULLABY_SOUND_H +#define LOVE_SOUND_LULLABY_SOUND_H + +// LOVE +#include +#include "sound/Decoder.h" + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +/** + * The love.sound.lullaby module is the custom sound decoder module for LOVE. Instead + * of using an intermediate library like SDL_sound, it interfaces with relevant libraries + * directly (libmpg123, libmodplug, libFLAC, etc). + * + * It was Mike that came up with the name Lullaby, which we both instantly recognized as awesome. + **/ +class Sound : public love::sound::Sound +{ +public: + + /** + * Constructor. Initializes relevant libraries. + **/ + Sound(); + + /** + * Destructor. Deinitializes relevant libraries. + **/ + virtual ~Sound(); + + /// @copydoc love::Module::getName + const char *getName() const; + + /// @copydoc love::sound::Sound::newDecoder + sound::Decoder *newDecoder(love::filesystem::File *file, int bufferSize); + +}; // Sound + +} // lullaby +} // sound +} // love + #endif // LOVE_SOUND_LULLABY_SOUND_H \ No newline at end of file diff --git a/src/modules/sound/lullaby/VorbisDecoder.cpp b/src/modules/sound/lullaby/VorbisDecoder.cpp index 9a30e7ced..e7877bf4d 100644 --- a/src/modules/sound/lullaby/VorbisDecoder.cpp +++ b/src/modules/sound/lullaby/VorbisDecoder.cpp @@ -1,258 +1,258 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "VorbisDecoder.h" - -#include -#include "common/config.h" -#include "common/Exception.h" - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -/** - * CALLBACK FUNCTIONS - **/ -int vorbisClose(void * /* ptr to the data that the vorbis files need*/) -{ - // Does nothing (handled elsewhere) - return 1; -} - -size_t vorbisRead(void *ptr /* ptr to the data that the vorbis files need*/, - size_t byteSize /* how big a byte is*/, - size_t sizeToRead /* How much we can read*/, - void *datasource /* this is a pointer to the data we passed into ov_open_callbacks (our SOggFile struct*/) -{ - size_t spaceToEOF; // How much more we can read till we hit the EOF marker - size_t actualSizeToRead; // How much data we are actually going to read from memory - SOggFile *vorbisData; // Our vorbis data, for the typecast - - // Get the data in the right format - vorbisData = (SOggFile *)datasource; - - // Calculate how much we need to read. This can be sizeToRead*byteSize or less depending on how near the EOF marker we are - spaceToEOF = vorbisData->dataSize - vorbisData->dataRead; - if ((sizeToRead*byteSize) < spaceToEOF) - actualSizeToRead = (sizeToRead*byteSize); - else - actualSizeToRead = spaceToEOF; - - // A simple copy of the data from memory to the datastruct that the vorbis libs will use - if (actualSizeToRead) - { - // Copy the data from the start of the file PLUS how much we have already read in - memcpy(ptr, (char *)vorbisData->dataPtr + vorbisData->dataRead, actualSizeToRead); - // Increase by how much we have read by - vorbisData->dataRead += (actualSizeToRead); - } - - // Return how much we read (in the same way fread would) - return actualSizeToRead; -} - -int vorbisSeek(void *datasource /* ptr to the data that the vorbis files need*/, - ogg_int64_t offset /*offset from the point we wish to seek to*/, - int whence /*where we want to seek to*/) -{ - int spaceToEOF; // How much more we can read till we hit the EOF marker - ogg_int64_t actualOffset; // How much we can actually offset it by - SOggFile *vorbisData; // The data we passed in (for the typecast) - - // Get the data in the right format - vorbisData = (SOggFile *) datasource; - - // Goto where we wish to seek to - switch (whence) - { - case SEEK_SET: // Seek to the start of the data file - // Make sure we are not going to the end of the file - if (vorbisData->dataSize >= offset) - actualOffset = offset; - else - actualOffset = vorbisData->dataSize; - // Set where we now are - vorbisData->dataRead = (int)actualOffset; - break; - case SEEK_CUR: // Seek from where we are - // Make sure we dont go past the end - spaceToEOF = vorbisData->dataSize - vorbisData->dataRead; - if (offset < spaceToEOF) - actualOffset = (offset); - else - actualOffset = spaceToEOF; - // Seek from our currrent location - vorbisData->dataRead += (int)actualOffset; - break; - case SEEK_END: // Seek from the end of the file - vorbisData->dataRead = vorbisData->dataSize+1; - break; - default: - throw love::Exception("Unknown seek command in vorbisSeek\n"); - break; - }; - - return 0; -} - -long vorbisTell(void *datasource /* ptr to the data that the vorbis files need*/) -{ - SOggFile *vorbisData; - vorbisData = (SOggFile *) datasource; - return vorbisData->dataRead; -} -/** - * END CALLBACK FUNCTIONS - **/ - -VorbisDecoder::VorbisDecoder(Data *data, const std::string &ext, int bufferSize) - : Decoder(data, ext, bufferSize) -{ - // Initialize callbacks - vorbisCallbacks.close_func = vorbisClose; - vorbisCallbacks.seek_func = vorbisSeek; - vorbisCallbacks.read_func = vorbisRead; - vorbisCallbacks.tell_func = vorbisTell; - - // Check endianness -#ifdef LOVE_BIG_ENDIAN - endian = 1; -#else - endian = 0; -#endif - - // Initialize OGG file - oggFile.dataPtr = (char *) data->getData(); - oggFile.dataSize = data->getSize(); - oggFile.dataRead = 0; - - // Open Vorbis handle - if (ov_open_callbacks(&oggFile, &handle, NULL, 0, vorbisCallbacks) < 0) - throw love::Exception("Could not read Ogg bitstream"); - - // Get info and comments - vorbisInfo = ov_info(&handle, -1); - vorbisComment = ov_comment(&handle, -1); -} - -VorbisDecoder::~VorbisDecoder() -{ - ov_clear(&handle); -} - -bool VorbisDecoder::accepts(const std::string &ext) -{ - static const std::string supported[] = - { - "ogg", "oga", "" - }; - - for (int i = 0; !(supported[i].empty()); i++) - { - if (supported[i].compare(ext) == 0) - return true; - } - - return false; -} - -love::sound::Decoder *VorbisDecoder::clone() -{ - return new VorbisDecoder(data, ext, bufferSize); -} - -int VorbisDecoder::decode() -{ - int size = 0; - - while (size < bufferSize) - { - int result = ov_read(&handle, (char *) buffer + size, bufferSize - size, endian, (getBits() == 16 ? 2 : 1), 1, 0); - - if (result == OV_HOLE) - continue; - else if (result <= OV_EREAD) - return -1; - else if (result == 0) - { - eof = true; - break; - } - else if (result > 0) - size += result; - } - - return size; -} - -bool VorbisDecoder::seek(float s) -{ - int result = ov_time_seek(&handle, s); - - if (result == 0) - { - eof = false; - return true; - } - - return false; -} - -bool VorbisDecoder::rewind() -{ - int result = ov_pcm_seek(&handle, 0); - - if (result == 0) - { - eof = false; - return true; - } - - return false; -} - -bool VorbisDecoder::isSeekable() -{ - long result = ov_seekable(&handle); - return (result != 0); -} - -int VorbisDecoder::getChannels() const -{ - return vorbisInfo->channels; -} - -int VorbisDecoder::getBits() const -{ - return 16; -} - -int VorbisDecoder::getSampleRate() const -{ - return vorbisInfo->rate; -} - -} // lullaby -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "VorbisDecoder.h" + +#include +#include "common/config.h" +#include "common/Exception.h" + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +/** + * CALLBACK FUNCTIONS + **/ +int vorbisClose(void * /* ptr to the data that the vorbis files need*/) +{ + // Does nothing (handled elsewhere) + return 1; +} + +size_t vorbisRead(void *ptr /* ptr to the data that the vorbis files need*/, + size_t byteSize /* how big a byte is*/, + size_t sizeToRead /* How much we can read*/, + void *datasource /* this is a pointer to the data we passed into ov_open_callbacks (our SOggFile struct*/) +{ + size_t spaceToEOF; // How much more we can read till we hit the EOF marker + size_t actualSizeToRead; // How much data we are actually going to read from memory + SOggFile *vorbisData; // Our vorbis data, for the typecast + + // Get the data in the right format + vorbisData = (SOggFile *)datasource; + + // Calculate how much we need to read. This can be sizeToRead*byteSize or less depending on how near the EOF marker we are + spaceToEOF = vorbisData->dataSize - vorbisData->dataRead; + if ((sizeToRead*byteSize) < spaceToEOF) + actualSizeToRead = (sizeToRead*byteSize); + else + actualSizeToRead = spaceToEOF; + + // A simple copy of the data from memory to the datastruct that the vorbis libs will use + if (actualSizeToRead) + { + // Copy the data from the start of the file PLUS how much we have already read in + memcpy(ptr, (char *)vorbisData->dataPtr + vorbisData->dataRead, actualSizeToRead); + // Increase by how much we have read by + vorbisData->dataRead += (actualSizeToRead); + } + + // Return how much we read (in the same way fread would) + return actualSizeToRead; +} + +int vorbisSeek(void *datasource /* ptr to the data that the vorbis files need*/, + ogg_int64_t offset /*offset from the point we wish to seek to*/, + int whence /*where we want to seek to*/) +{ + int spaceToEOF; // How much more we can read till we hit the EOF marker + ogg_int64_t actualOffset; // How much we can actually offset it by + SOggFile *vorbisData; // The data we passed in (for the typecast) + + // Get the data in the right format + vorbisData = (SOggFile *) datasource; + + // Goto where we wish to seek to + switch (whence) + { + case SEEK_SET: // Seek to the start of the data file + // Make sure we are not going to the end of the file + if (vorbisData->dataSize >= offset) + actualOffset = offset; + else + actualOffset = vorbisData->dataSize; + // Set where we now are + vorbisData->dataRead = (int)actualOffset; + break; + case SEEK_CUR: // Seek from where we are + // Make sure we dont go past the end + spaceToEOF = vorbisData->dataSize - vorbisData->dataRead; + if (offset < spaceToEOF) + actualOffset = (offset); + else + actualOffset = spaceToEOF; + // Seek from our currrent location + vorbisData->dataRead += (int)actualOffset; + break; + case SEEK_END: // Seek from the end of the file + vorbisData->dataRead = vorbisData->dataSize+1; + break; + default: + throw love::Exception("Unknown seek command in vorbisSeek\n"); + break; + }; + + return 0; +} + +long vorbisTell(void *datasource /* ptr to the data that the vorbis files need*/) +{ + SOggFile *vorbisData; + vorbisData = (SOggFile *) datasource; + return vorbisData->dataRead; +} +/** + * END CALLBACK FUNCTIONS + **/ + +VorbisDecoder::VorbisDecoder(Data *data, const std::string &ext, int bufferSize) + : Decoder(data, ext, bufferSize) +{ + // Initialize callbacks + vorbisCallbacks.close_func = vorbisClose; + vorbisCallbacks.seek_func = vorbisSeek; + vorbisCallbacks.read_func = vorbisRead; + vorbisCallbacks.tell_func = vorbisTell; + + // Check endianness +#ifdef LOVE_BIG_ENDIAN + endian = 1; +#else + endian = 0; +#endif + + // Initialize OGG file + oggFile.dataPtr = (char *) data->getData(); + oggFile.dataSize = data->getSize(); + oggFile.dataRead = 0; + + // Open Vorbis handle + if (ov_open_callbacks(&oggFile, &handle, NULL, 0, vorbisCallbacks) < 0) + throw love::Exception("Could not read Ogg bitstream"); + + // Get info and comments + vorbisInfo = ov_info(&handle, -1); + vorbisComment = ov_comment(&handle, -1); +} + +VorbisDecoder::~VorbisDecoder() +{ + ov_clear(&handle); +} + +bool VorbisDecoder::accepts(const std::string &ext) +{ + static const std::string supported[] = + { + "ogg", "oga", "" + }; + + for (int i = 0; !(supported[i].empty()); i++) + { + if (supported[i].compare(ext) == 0) + return true; + } + + return false; +} + +love::sound::Decoder *VorbisDecoder::clone() +{ + return new VorbisDecoder(data, ext, bufferSize); +} + +int VorbisDecoder::decode() +{ + int size = 0; + + while (size < bufferSize) + { + int result = ov_read(&handle, (char *) buffer + size, bufferSize - size, endian, (getBits() == 16 ? 2 : 1), 1, 0); + + if (result == OV_HOLE) + continue; + else if (result <= OV_EREAD) + return -1; + else if (result == 0) + { + eof = true; + break; + } + else if (result > 0) + size += result; + } + + return size; +} + +bool VorbisDecoder::seek(float s) +{ + int result = ov_time_seek(&handle, s); + + if (result == 0) + { + eof = false; + return true; + } + + return false; +} + +bool VorbisDecoder::rewind() +{ + int result = ov_pcm_seek(&handle, 0); + + if (result == 0) + { + eof = false; + return true; + } + + return false; +} + +bool VorbisDecoder::isSeekable() +{ + long result = ov_seekable(&handle); + return (result != 0); +} + +int VorbisDecoder::getChannels() const +{ + return vorbisInfo->channels; +} + +int VorbisDecoder::getBits() const +{ + return 16; +} + +int VorbisDecoder::getSampleRate() const +{ + return vorbisInfo->rate; +} + +} // lullaby +} // sound +} // love diff --git a/src/modules/sound/lullaby/VorbisDecoder.h b/src/modules/sound/lullaby/VorbisDecoder.h index 1d26cea67..b003ad640 100644 --- a/src/modules/sound/lullaby/VorbisDecoder.h +++ b/src/modules/sound/lullaby/VorbisDecoder.h @@ -1,78 +1,78 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_LULLABY_VORBIS_DECODER_H -#define LOVE_SOUND_LULLABY_VORBIS_DECODER_H - -// LOVE -#include "common/Data.h" -#include "Decoder.h" - -// vorbis -#include -#include - -namespace love -{ -namespace sound -{ -namespace lullaby -{ - -// Struct for handling data -struct SOggFile -{ - char *dataPtr; // Pointer to the data in memory - int dataSize; // Size of the data - int dataRead; // How much we've read so far -}; - -class VorbisDecoder : public Decoder -{ -public: - - VorbisDecoder(Data *data, const std::string &ext, int bufferSize); - virtual ~VorbisDecoder(); - - static bool accepts(const std::string &ext); - - love::sound::Decoder *clone(); - int decode(); - bool seek(float s); - bool rewind(); - bool isSeekable(); - int getChannels() const; - int getBits() const; - int getSampleRate() const; - -private: - SOggFile oggFile; // (see struct) - ov_callbacks vorbisCallbacks; // Callbacks used to read the file from mem - OggVorbis_File handle; // Handle to the file - vorbis_info *vorbisInfo; // Info - vorbis_comment *vorbisComment; // Comments - int endian; // Endianness -}; // VorbisDecoder - -} // lullaby -} // sound -} // love - -#endif // LOVE_SOUND_LULLABY_VORBIS_DECODER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_LULLABY_VORBIS_DECODER_H +#define LOVE_SOUND_LULLABY_VORBIS_DECODER_H + +// LOVE +#include "common/Data.h" +#include "Decoder.h" + +// vorbis +#include +#include + +namespace love +{ +namespace sound +{ +namespace lullaby +{ + +// Struct for handling data +struct SOggFile +{ + char *dataPtr; // Pointer to the data in memory + int dataSize; // Size of the data + int dataRead; // How much we've read so far +}; + +class VorbisDecoder : public Decoder +{ +public: + + VorbisDecoder(Data *data, const std::string &ext, int bufferSize); + virtual ~VorbisDecoder(); + + static bool accepts(const std::string &ext); + + love::sound::Decoder *clone(); + int decode(); + bool seek(float s); + bool rewind(); + bool isSeekable(); + int getChannels() const; + int getBits() const; + int getSampleRate() const; + +private: + SOggFile oggFile; // (see struct) + ov_callbacks vorbisCallbacks; // Callbacks used to read the file from mem + OggVorbis_File handle; // Handle to the file + vorbis_info *vorbisInfo; // Info + vorbis_comment *vorbisComment; // Comments + int endian; // Endianness +}; // VorbisDecoder + +} // lullaby +} // sound +} // love + +#endif // LOVE_SOUND_LULLABY_VORBIS_DECODER_H diff --git a/src/modules/sound/wrap_Decoder.cpp b/src/modules/sound/wrap_Decoder.cpp index 7639b22f6..1210cde2b 100644 --- a/src/modules/sound/wrap_Decoder.cpp +++ b/src/modules/sound/wrap_Decoder.cpp @@ -1,68 +1,68 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Decoder.h" - -namespace love -{ -namespace sound -{ - -Decoder *luax_checkdecoder(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Decoder", SOUND_DECODER_T); -} - -int w_Decoder_getChannels(lua_State *L) -{ - Decoder *t = luax_checkdecoder(L, 1); - lua_pushinteger(L, t->getChannels()); - return 1; -} - -int w_Decoder_getBits(lua_State *L) -{ - Decoder *t = luax_checkdecoder(L, 1); - lua_pushinteger(L, t->getBits()); - return 1; -} - -int w_Decoder_getSampleRate(lua_State *L) -{ - Decoder *t = luax_checkdecoder(L, 1); - lua_pushinteger(L, t->getSampleRate()); - return 1; -} - -static const luaL_Reg functions[] = -{ - { "getChannels", w_Decoder_getChannels }, - { "getBits", w_Decoder_getBits }, - { "getSampleRate", w_Decoder_getSampleRate }, - { 0, 0 } -}; - -extern "C" int luaopen_decoder(lua_State *L) -{ - return luax_register_type(L, "Decoder", functions); -} - -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Decoder.h" + +namespace love +{ +namespace sound +{ + +Decoder *luax_checkdecoder(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Decoder", SOUND_DECODER_T); +} + +int w_Decoder_getChannels(lua_State *L) +{ + Decoder *t = luax_checkdecoder(L, 1); + lua_pushinteger(L, t->getChannels()); + return 1; +} + +int w_Decoder_getBits(lua_State *L) +{ + Decoder *t = luax_checkdecoder(L, 1); + lua_pushinteger(L, t->getBits()); + return 1; +} + +int w_Decoder_getSampleRate(lua_State *L) +{ + Decoder *t = luax_checkdecoder(L, 1); + lua_pushinteger(L, t->getSampleRate()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "getChannels", w_Decoder_getChannels }, + { "getBits", w_Decoder_getBits }, + { "getSampleRate", w_Decoder_getSampleRate }, + { 0, 0 } +}; + +extern "C" int luaopen_decoder(lua_State *L) +{ + return luax_register_type(L, "Decoder", functions); +} + +} // sound +} // love diff --git a/src/modules/sound/wrap_Decoder.h b/src/modules/sound/wrap_Decoder.h index a2e6d8afb..047c025cb 100644 --- a/src/modules/sound/wrap_Decoder.h +++ b/src/modules/sound/wrap_Decoder.h @@ -1,42 +1,42 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_WRAP_DECODER_H -#define LOVE_SOUND_WRAP_DECODER_H - -// LOVE -#include "common/runtime.h" -#include "Decoder.h" - -namespace love -{ -namespace sound -{ - -Decoder *luax_checkdecoder(lua_State *L, int idx); -int w_Decoder_getChannels(lua_State *L); -int w_Decoder_getBits(lua_State *L); -int w_Decoder_getSampleRate(lua_State *L); -extern "C" int luaopen_decoder(lua_State *L); - -} // sound -} // love - -#endif // LOVE_SOUND_WRAP_DECODER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_WRAP_DECODER_H +#define LOVE_SOUND_WRAP_DECODER_H + +// LOVE +#include "common/runtime.h" +#include "Decoder.h" + +namespace love +{ +namespace sound +{ + +Decoder *luax_checkdecoder(lua_State *L, int idx); +int w_Decoder_getChannels(lua_State *L); +int w_Decoder_getBits(lua_State *L); +int w_Decoder_getSampleRate(lua_State *L); +extern "C" int luaopen_decoder(lua_State *L); + +} // sound +} // love + +#endif // LOVE_SOUND_WRAP_DECODER_H diff --git a/src/modules/sound/wrap_Sound.cpp b/src/modules/sound/wrap_Sound.cpp index 9c6c7acb6..8b5568757 100644 --- a/src/modules/sound/wrap_Sound.cpp +++ b/src/modules/sound/wrap_Sound.cpp @@ -1,147 +1,147 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Sound.h" - -// Implementations. -#include "lullaby/Sound.h" - -namespace love -{ -namespace sound -{ - -static Sound *instance = 0; - -int w_newSoundData(lua_State *L) -{ - SoundData *t = 0; - - if (lua_isnumber(L, 1)) - { - int samples = luaL_checkint(L, 1); - int sampleRate = luaL_optint(L, 2, Decoder::DEFAULT_SAMPLE_RATE); - int bits = luaL_optint(L, 3, Decoder::DEFAULT_BITS); - int channels = luaL_optint(L, 4, Decoder::DEFAULT_CHANNELS); - - try - { - t = instance->newSoundData(samples, sampleRate, bits, channels); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - - } - // Must be string or decoder. - else - { - - // Convert to Decoder, if necessary. - if (!luax_istype(L, 1, SOUND_DECODER_T)) - { - w_newDecoder(L); - lua_replace(L, 1); - } - - try - { - t = instance->newSoundData(luax_checkdecoder(L, 1)); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - } - - luax_newtype(L, "SoundData", SOUND_SOUND_DATA_T, (void *)t); - - return 1; -} - -int w_newDecoder(lua_State *L) -{ - // Convert to File, if necessary. - if (lua_isstring(L, 1)) - luax_convobj(L, 1, "filesystem", "newFile"); - - love::filesystem::File *file = luax_checktype(L, 1, "File", FILESYSTEM_FILE_T); - int bufferSize = luaL_optint(L, 2, Decoder::DEFAULT_BUFFER_SIZE); - - try - { - Decoder *t = instance->newDecoder(file, bufferSize); - if (t == 0) - return luaL_error(L, "Extension \"%s\" not supported.", file->getExtension().c_str()); - luax_newtype(L, "Decoder", SOUND_DECODER_T, (void *)t); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "newSoundData", w_newSoundData }, - { "newDecoder", w_newDecoder }, - { 0, 0 } -}; - -static const lua_CFunction types[] = -{ - luaopen_sounddata, - luaopen_decoder, - 0 -}; - -extern "C" int luaopen_love_sound(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new lullaby::Sound(); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - - WrappedModule w; - w.module = instance; - w.name = "sound"; - w.flags = MODULE_SOUND_T; - w.functions = functions; - w.types = types; - - return luax_register_module(L, w); -} - -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Sound.h" + +// Implementations. +#include "lullaby/Sound.h" + +namespace love +{ +namespace sound +{ + +static Sound *instance = 0; + +int w_newSoundData(lua_State *L) +{ + SoundData *t = 0; + + if (lua_isnumber(L, 1)) + { + int samples = luaL_checkint(L, 1); + int sampleRate = luaL_optint(L, 2, Decoder::DEFAULT_SAMPLE_RATE); + int bits = luaL_optint(L, 3, Decoder::DEFAULT_BITS); + int channels = luaL_optint(L, 4, Decoder::DEFAULT_CHANNELS); + + try + { + t = instance->newSoundData(samples, sampleRate, bits, channels); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + + } + // Must be string or decoder. + else + { + + // Convert to Decoder, if necessary. + if (!luax_istype(L, 1, SOUND_DECODER_T)) + { + w_newDecoder(L); + lua_replace(L, 1); + } + + try + { + t = instance->newSoundData(luax_checkdecoder(L, 1)); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + } + + luax_newtype(L, "SoundData", SOUND_SOUND_DATA_T, (void *)t); + + return 1; +} + +int w_newDecoder(lua_State *L) +{ + // Convert to File, if necessary. + if (lua_isstring(L, 1)) + luax_convobj(L, 1, "filesystem", "newFile"); + + love::filesystem::File *file = luax_checktype(L, 1, "File", FILESYSTEM_FILE_T); + int bufferSize = luaL_optint(L, 2, Decoder::DEFAULT_BUFFER_SIZE); + + try + { + Decoder *t = instance->newDecoder(file, bufferSize); + if (t == 0) + return luaL_error(L, "Extension \"%s\" not supported.", file->getExtension().c_str()); + luax_newtype(L, "Decoder", SOUND_DECODER_T, (void *)t); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "newSoundData", w_newSoundData }, + { "newDecoder", w_newDecoder }, + { 0, 0 } +}; + +static const lua_CFunction types[] = +{ + luaopen_sounddata, + luaopen_decoder, + 0 +}; + +extern "C" int luaopen_love_sound(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new lullaby::Sound(); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + + WrappedModule w; + w.module = instance; + w.name = "sound"; + w.flags = MODULE_SOUND_T; + w.functions = functions; + w.types = types; + + return luax_register_module(L, w); +} + +} // sound +} // love diff --git a/src/modules/sound/wrap_Sound.h b/src/modules/sound/wrap_Sound.h index 2096dfc1c..334b6a29d 100644 --- a/src/modules/sound/wrap_Sound.h +++ b/src/modules/sound/wrap_Sound.h @@ -1,42 +1,42 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_WRAP_SOUND_H -#define LOVE_SOUND_WRAP_SOUND_H - -// LOVE -#include "common/config.h" -#include "Sound.h" -#include "wrap_SoundData.h" -#include "wrap_Decoder.h" - -namespace love -{ -namespace sound -{ - -int w_newSoundData(lua_State *L); -int w_newDecoder(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_sound(lua_State *L); - -} // sound -} // love - -#endif // LOVE_SOUND_WRAP_SOUND_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_WRAP_SOUND_H +#define LOVE_SOUND_WRAP_SOUND_H + +// LOVE +#include "common/config.h" +#include "Sound.h" +#include "wrap_SoundData.h" +#include "wrap_Decoder.h" + +namespace love +{ +namespace sound +{ + +int w_newSoundData(lua_State *L); +int w_newDecoder(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_sound(lua_State *L); + +} // sound +} // love + +#endif // LOVE_SOUND_WRAP_SOUND_H diff --git a/src/modules/sound/wrap_SoundData.cpp b/src/modules/sound/wrap_SoundData.cpp index 5c2f46f67..897be515e 100644 --- a/src/modules/sound/wrap_SoundData.cpp +++ b/src/modules/sound/wrap_SoundData.cpp @@ -1,94 +1,94 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_SoundData.h" - -#include "common/wrap_Data.h" - -namespace love -{ -namespace sound -{ - -SoundData *luax_checksounddata(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "SoundData", SOUND_SOUND_DATA_T); -} - -int w_SoundData_getChannels(lua_State *L) -{ - SoundData *t = luax_checksounddata(L, 1); - lua_pushinteger(L, t->getChannels()); - return 1; -} - -int w_SoundData_getBits(lua_State *L) -{ - SoundData *t = luax_checksounddata(L, 1); - lua_pushinteger(L, t->getBits()); - return 1; -} - -int w_SoundData_getSampleRate(lua_State *L) -{ - SoundData *t = luax_checksounddata(L, 1); - lua_pushinteger(L, t->getSampleRate()); - return 1; -} - -int w_SoundData_setSample(lua_State *L) -{ - SoundData *sd = luax_checksounddata(L, 1); - int i = (int)lua_tointeger(L, 2); - float sample = (float)lua_tonumber(L, 3); - sd->setSample(i, sample); - return 0; -} - -int w_SoundData_getSample(lua_State *L) -{ - SoundData *sd = luax_checksounddata(L, 1); - int i = (int)lua_tointeger(L, 2); - lua_pushnumber(L, sd->getSample(i)); - return 1; -} - -static const luaL_Reg functions[] = -{ - - // Data - { "getPointer", w_Data_getPointer }, - { "getSize", w_Data_getSize }, - - { "getChannels", w_SoundData_getChannels }, - { "getBits", w_SoundData_getBits }, - { "getSampleRate", w_SoundData_getSampleRate }, - { "setSample", w_SoundData_setSample }, - { "getSample", w_SoundData_getSample }, - { 0, 0 } -}; - -extern "C" int luaopen_sounddata(lua_State *L) -{ - return luax_register_type(L, "SoundData", functions); -} - -} // sound -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_SoundData.h" + +#include "common/wrap_Data.h" + +namespace love +{ +namespace sound +{ + +SoundData *luax_checksounddata(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "SoundData", SOUND_SOUND_DATA_T); +} + +int w_SoundData_getChannels(lua_State *L) +{ + SoundData *t = luax_checksounddata(L, 1); + lua_pushinteger(L, t->getChannels()); + return 1; +} + +int w_SoundData_getBits(lua_State *L) +{ + SoundData *t = luax_checksounddata(L, 1); + lua_pushinteger(L, t->getBits()); + return 1; +} + +int w_SoundData_getSampleRate(lua_State *L) +{ + SoundData *t = luax_checksounddata(L, 1); + lua_pushinteger(L, t->getSampleRate()); + return 1; +} + +int w_SoundData_setSample(lua_State *L) +{ + SoundData *sd = luax_checksounddata(L, 1); + int i = (int)lua_tointeger(L, 2); + float sample = (float)lua_tonumber(L, 3); + sd->setSample(i, sample); + return 0; +} + +int w_SoundData_getSample(lua_State *L) +{ + SoundData *sd = luax_checksounddata(L, 1); + int i = (int)lua_tointeger(L, 2); + lua_pushnumber(L, sd->getSample(i)); + return 1; +} + +static const luaL_Reg functions[] = +{ + + // Data + { "getPointer", w_Data_getPointer }, + { "getSize", w_Data_getSize }, + + { "getChannels", w_SoundData_getChannels }, + { "getBits", w_SoundData_getBits }, + { "getSampleRate", w_SoundData_getSampleRate }, + { "setSample", w_SoundData_setSample }, + { "getSample", w_SoundData_getSample }, + { 0, 0 } +}; + +extern "C" int luaopen_sounddata(lua_State *L) +{ + return luax_register_type(L, "SoundData", functions); +} + +} // sound +} // love diff --git a/src/modules/sound/wrap_SoundData.h b/src/modules/sound/wrap_SoundData.h index 8c9a0ecf3..9d0fca2a8 100644 --- a/src/modules/sound/wrap_SoundData.h +++ b/src/modules/sound/wrap_SoundData.h @@ -1,46 +1,46 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_SOUND_WRAP_SOUND_DATA_H -#define LOVE_SOUND_WRAP_SOUND_DATA_H - -// LOVE -#include "common/runtime.h" -#include "SoundData.h" - -namespace love -{ -namespace sound -{ - -SoundData *luax_checksounddata(lua_State *L, int idx); -int w_getPointer(lua_State *L); -int w_getSize(lua_State *L); -int w_getChannels(lua_State *L); -int w_getBits(lua_State *L); -int w_getSampleRate(lua_State *L); -int w_setSample(lua_State *L); -int w_getSample(lua_State *L); -extern "C" int luaopen_sounddata(lua_State *L); - -} // sound -} // love - -#endif // LOVE_SOUND_WRAP_SOUND_DATA_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_SOUND_WRAP_SOUND_DATA_H +#define LOVE_SOUND_WRAP_SOUND_DATA_H + +// LOVE +#include "common/runtime.h" +#include "SoundData.h" + +namespace love +{ +namespace sound +{ + +SoundData *luax_checksounddata(lua_State *L, int idx); +int w_getPointer(lua_State *L); +int w_getSize(lua_State *L); +int w_getChannels(lua_State *L); +int w_getBits(lua_State *L); +int w_getSampleRate(lua_State *L); +int w_setSample(lua_State *L); +int w_getSample(lua_State *L); +extern "C" int luaopen_sounddata(lua_State *L); + +} // sound +} // love + +#endif // LOVE_SOUND_WRAP_SOUND_DATA_H diff --git a/src/modules/thread/Thread.cpp b/src/modules/thread/Thread.cpp index 61bdd56dd..d792a1e58 100644 --- a/src/modules/thread/Thread.cpp +++ b/src/modules/thread/Thread.cpp @@ -1,317 +1,317 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -#include "Thread.h" - -#ifdef LOVE_BUILD_STANDALONE -extern "C" int luaopen_love(lua_State *L); -#endif // LOVE_BUILD_STANDALONE -extern "C" int luaopen_love_thread(lua_State *L); - -namespace love -{ -namespace thread -{ - -Thread::ThreadThread::ThreadThread(ThreadData *comm) - : comm(comm) -{ -} - -void Thread::ThreadThread::main() -{ - lua_State *L = lua_open(); - luaL_openlibs(L); -#ifdef LOVE_BUILD_STANDALONE - love::luax_preload(L, luaopen_love, "love"); - luaopen_love(L); -#endif // LOVE_BUILD_STANDALONE - luaopen_love_thread(L); - { - size_t len; - const char *name = comm->getName(&len); - lua_pushlstring(L, name, len); - } - luax_convobj(L, lua_gettop(L), "thread", "getThread"); - lua_getglobal(L, "love"); - lua_pushvalue(L, -2); - lua_setfield(L, -2, "_curthread"); - if (luaL_dostring(L, comm->getCode()) == 1) - { - { - Lock lock((Mutex *) comm->mutex); - Variant *v = new Variant(lua_tostring(L, -1), lua_strlen(L, -1)); - comm->setValue("error", v); - v->release(); - } - ((Conditional *) comm->cond)->broadcast(); - } - lua_close(L); -} - -ThreadData::ThreadData(const char *name, size_t len, const char *code, void *mutex, void *cond) - : len(len), mutex(mutex), cond(cond) -{ - this->name = new char[len+1]; - memset(this->name, 0, len+1); - memcpy(this->name, name, len); - if (code) - { - len = strlen(code); - this->code = new char[len+1]; - memset(this->code, 0, len+1); - memcpy(this->code, code, len); - } - else - this->code = 0; -} - -ThreadData::~ThreadData() -{ - delete[] name; - delete[] code; -} - -const char *ThreadData::getCode() -{ - return code; -} - -const char *ThreadData::getName(size_t *len) -{ - if (len) - *len = this->len; - return name; -} - -Variant *ThreadData::getValue(const std::string &name) -{ - if (shared.count(name) == 0) - return 0; - return shared[name]; -} - -void ThreadData::clearValue(const std::string &name) -{ - if (shared.count(name) == 0) - return; - shared[name]->release(); - shared.erase(name); -} - -void ThreadData::setValue(const std::string &name, Variant *v) -{ - if (shared.count(name) != 0) - shared[name]->release(); - v->retain(); - shared[name] = v; -} - -std::vector ThreadData::getKeys() -{ - std::vector keys; - for (std::map::iterator it = shared.begin(); it != shared.end(); it++) - { - keys.push_back(it->first); - } - return keys; -} - -Thread::Thread(love::thread::ThreadModule *module, const std::string &name, love::Data *data) - : handle(0), module(module), name(name), isThread(true) -{ - module->retain(); - unsigned int len = data->getSize(); - this->data = new char[len+1]; - memset(this->data, 0, len+1); - memcpy(this->data, data->getData(), len); - mutex = new Mutex(); - cond = new Conditional(); - comm = new ThreadData(name.c_str(), name.length(), this->data, mutex, cond); -} - -Thread::Thread(love::thread::ThreadModule *module, const std::string &name) - : handle(0), module(module), name(name), data(0), isThread(false) -{ - module->retain(); - mutex = new Mutex(); - cond = new Conditional(); - comm = new ThreadData(name.c_str(), name.length(), NULL, mutex, cond); -} - -Thread::~Thread() -{ - if (data) - delete[] data; - delete comm; - module->unregister(name); - delete mutex; - delete cond; - module->release(); -} - -void Thread::start() -{ - if (!handle && isThread) - { - handle = new ThreadThread(comm); - handle->start(); - } -} - -void Thread::kill() -{ - if (handle) - { - Lock lock((Mutex *) _gcmutex); - handle->kill(); - delete handle; - handle = 0; - } -} - -void Thread::wait() -{ - if (handle) - { - handle->wait(); - delete handle; - handle = 0; - } -} - -void Thread::lock() -{ - mutex->lock(); -} - -void Thread::unlock() -{ - mutex->unlock(); -} - -std::string Thread::getName() -{ - return name; -} - -Variant *Thread::get(const std::string &name) -{ - Variant *v = comm->getValue(name); - if (v) - v->retain(); - return v; -} - -std::vector Thread::getKeys() -{ - return comm->getKeys(); -} - -Variant *Thread::demand(const std::string &name) -{ - Variant *v = comm->getValue(name); - while (!v) - { - if (comm->getValue("error")) - return 0; - cond->wait(mutex); - v = comm->getValue(name); - } - v->retain(); - return v; -} - -void Thread::clear(const std::string &name) -{ - comm->clearValue(name); -} - -void Thread::set(const std::string &name, Variant *v) -{ - lock(); //this function explicitly locks - comm->setValue(name, v); //because we need - unlock(); //it to unlock here for the cond - cond->broadcast(); -} - -ThreadModule::ThreadModule() -{ - threads["main"] = new Thread(this, "main"); -} - -ThreadModule::~ThreadModule() -{ - for (threadlist_t::iterator i = threads.begin(); i != threads.end(); i++) - { - i->second->kill(); - delete i->second; - } -} - -Thread *ThreadModule::newThread(const std::string &name, love::Data *data) -{ - if (threads.count(name) != 0) - return 0; - Thread *t = new Thread(this, name, data); - threads[name] = t; - return t; -} - -Thread *ThreadModule::getThread(const std::string &name) -{ - if (threads.count(name) == 0) - return 0; - threadlist_t::iterator i = threads.find(name); - return i->second; -} - -void ThreadModule::getThreads(Thread **list) -{ - int c = 0; - for (threadlist_t::iterator i = threads.begin(); i != threads.end(); i++, c++) - { - list[c] = i->second; - } -} - -unsigned ThreadModule::getThreadCount() const -{ - return threads.size(); -} - -void ThreadModule::unregister(const std::string &name) -{ - if (threads.count(name) == 0) - return; - threadlist_t::iterator i = threads.find(name); - // FIXME: shouldn't the thread be deleted? - threads.erase(i); -} - -const char *ThreadModule::getName() const -{ - return "love.thread.sdl"; -} - -} // thread -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +#include "Thread.h" + +#ifdef LOVE_BUILD_STANDALONE +extern "C" int luaopen_love(lua_State *L); +#endif // LOVE_BUILD_STANDALONE +extern "C" int luaopen_love_thread(lua_State *L); + +namespace love +{ +namespace thread +{ + +Thread::ThreadThread::ThreadThread(ThreadData *comm) + : comm(comm) +{ +} + +void Thread::ThreadThread::main() +{ + lua_State *L = lua_open(); + luaL_openlibs(L); +#ifdef LOVE_BUILD_STANDALONE + love::luax_preload(L, luaopen_love, "love"); + luaopen_love(L); +#endif // LOVE_BUILD_STANDALONE + luaopen_love_thread(L); + { + size_t len; + const char *name = comm->getName(&len); + lua_pushlstring(L, name, len); + } + luax_convobj(L, lua_gettop(L), "thread", "getThread"); + lua_getglobal(L, "love"); + lua_pushvalue(L, -2); + lua_setfield(L, -2, "_curthread"); + if (luaL_dostring(L, comm->getCode()) == 1) + { + { + Lock lock((Mutex *) comm->mutex); + Variant *v = new Variant(lua_tostring(L, -1), lua_strlen(L, -1)); + comm->setValue("error", v); + v->release(); + } + ((Conditional *) comm->cond)->broadcast(); + } + lua_close(L); +} + +ThreadData::ThreadData(const char *name, size_t len, const char *code, void *mutex, void *cond) + : len(len), mutex(mutex), cond(cond) +{ + this->name = new char[len+1]; + memset(this->name, 0, len+1); + memcpy(this->name, name, len); + if (code) + { + len = strlen(code); + this->code = new char[len+1]; + memset(this->code, 0, len+1); + memcpy(this->code, code, len); + } + else + this->code = 0; +} + +ThreadData::~ThreadData() +{ + delete[] name; + delete[] code; +} + +const char *ThreadData::getCode() +{ + return code; +} + +const char *ThreadData::getName(size_t *len) +{ + if (len) + *len = this->len; + return name; +} + +Variant *ThreadData::getValue(const std::string &name) +{ + if (shared.count(name) == 0) + return 0; + return shared[name]; +} + +void ThreadData::clearValue(const std::string &name) +{ + if (shared.count(name) == 0) + return; + shared[name]->release(); + shared.erase(name); +} + +void ThreadData::setValue(const std::string &name, Variant *v) +{ + if (shared.count(name) != 0) + shared[name]->release(); + v->retain(); + shared[name] = v; +} + +std::vector ThreadData::getKeys() +{ + std::vector keys; + for (std::map::iterator it = shared.begin(); it != shared.end(); it++) + { + keys.push_back(it->first); + } + return keys; +} + +Thread::Thread(love::thread::ThreadModule *module, const std::string &name, love::Data *data) + : handle(0), module(module), name(name), isThread(true) +{ + module->retain(); + unsigned int len = data->getSize(); + this->data = new char[len+1]; + memset(this->data, 0, len+1); + memcpy(this->data, data->getData(), len); + mutex = new Mutex(); + cond = new Conditional(); + comm = new ThreadData(name.c_str(), name.length(), this->data, mutex, cond); +} + +Thread::Thread(love::thread::ThreadModule *module, const std::string &name) + : handle(0), module(module), name(name), data(0), isThread(false) +{ + module->retain(); + mutex = new Mutex(); + cond = new Conditional(); + comm = new ThreadData(name.c_str(), name.length(), NULL, mutex, cond); +} + +Thread::~Thread() +{ + if (data) + delete[] data; + delete comm; + module->unregister(name); + delete mutex; + delete cond; + module->release(); +} + +void Thread::start() +{ + if (!handle && isThread) + { + handle = new ThreadThread(comm); + handle->start(); + } +} + +void Thread::kill() +{ + if (handle) + { + Lock lock((Mutex *) _gcmutex); + handle->kill(); + delete handle; + handle = 0; + } +} + +void Thread::wait() +{ + if (handle) + { + handle->wait(); + delete handle; + handle = 0; + } +} + +void Thread::lock() +{ + mutex->lock(); +} + +void Thread::unlock() +{ + mutex->unlock(); +} + +std::string Thread::getName() +{ + return name; +} + +Variant *Thread::get(const std::string &name) +{ + Variant *v = comm->getValue(name); + if (v) + v->retain(); + return v; +} + +std::vector Thread::getKeys() +{ + return comm->getKeys(); +} + +Variant *Thread::demand(const std::string &name) +{ + Variant *v = comm->getValue(name); + while (!v) + { + if (comm->getValue("error")) + return 0; + cond->wait(mutex); + v = comm->getValue(name); + } + v->retain(); + return v; +} + +void Thread::clear(const std::string &name) +{ + comm->clearValue(name); +} + +void Thread::set(const std::string &name, Variant *v) +{ + lock(); //this function explicitly locks + comm->setValue(name, v); //because we need + unlock(); //it to unlock here for the cond + cond->broadcast(); +} + +ThreadModule::ThreadModule() +{ + threads["main"] = new Thread(this, "main"); +} + +ThreadModule::~ThreadModule() +{ + for (threadlist_t::iterator i = threads.begin(); i != threads.end(); i++) + { + i->second->kill(); + delete i->second; + } +} + +Thread *ThreadModule::newThread(const std::string &name, love::Data *data) +{ + if (threads.count(name) != 0) + return 0; + Thread *t = new Thread(this, name, data); + threads[name] = t; + return t; +} + +Thread *ThreadModule::getThread(const std::string &name) +{ + if (threads.count(name) == 0) + return 0; + threadlist_t::iterator i = threads.find(name); + return i->second; +} + +void ThreadModule::getThreads(Thread **list) +{ + int c = 0; + for (threadlist_t::iterator i = threads.begin(); i != threads.end(); i++, c++) + { + list[c] = i->second; + } +} + +unsigned ThreadModule::getThreadCount() const +{ + return threads.size(); +} + +void ThreadModule::unregister(const std::string &name) +{ + if (threads.count(name) == 0) + return; + threadlist_t::iterator i = threads.find(name); + // FIXME: shouldn't the thread be deleted? + threads.erase(i); +} + +const char *ThreadModule::getName() const +{ + return "love.thread.sdl"; +} + +} // thread +} // love diff --git a/src/modules/thread/Thread.h b/src/modules/thread/Thread.h index 9d6f67d24..170d1a01c 100644 --- a/src/modules/thread/Thread.h +++ b/src/modules/thread/Thread.h @@ -1,125 +1,125 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_THREAD_SDL_THREAD_H -#define LOVE_THREAD_SDL_THREAD_H - -// STL -#include -#include -#include -#include - -// LOVE -#include "filesystem/File.h" -#include "common/runtime.h" -#include "common/Module.h" -#include "common/Variant.h" -#include "thread/threads.h" - -namespace love -{ -namespace thread -{ - -class ThreadModule; - -class ThreadData -{ -public: - ThreadData(const char *name, size_t len, const char *code, void *mutex, void *cond); - ~ThreadData(); - const char *getCode(); - const char *getName(size_t *len = 0); - Variant *getValue(const std::string &name); - void clearValue(const std::string &name); - void setValue(const std::string &name, Variant *v); - std::vector getKeys(); - - void *mutex; - void *cond; -private: - char *code; - char *name; - std::map shared; - size_t len; -}; - -class Thread : public love::Object -{ -public: - Thread(love::thread::ThreadModule *module, const std::string &name, love::Data *data); - Thread(love::thread::ThreadModule *module, const std::string &name); - virtual ~Thread(); - void start(); - void kill(); - void wait(); - std::string getName(); - Variant *get(const std::string &name); - std::vector getKeys(); - Variant *demand(const std::string &name); - void clear(const std::string &name); - void set(const std::string &name, Variant *v); - void lock(); - void unlock(); -private: - class ThreadThread: public ThreadBase - { - private: - ThreadData *comm; - - protected: - virtual void main(); - - public: - ThreadThread(ThreadData *comm); - }; - - ThreadThread *handle; - - ThreadModule *module; - ThreadData *comm; - std::string name; - char *data; - Mutex *mutex; - Conditional *cond; - bool isThread; -}; // Thread - -typedef std::map threadlist_t; - -class ThreadModule : public love::Module -{ -public: - ThreadModule(); - virtual ~ThreadModule(); - Thread *newThread(const std::string &name, love::Data *data); - void getThreads(Thread **list); - Thread *getThread(const std::string &name); - unsigned getThreadCount() const; - void unregister(const std::string &name); - const char *getName() const; -private: - threadlist_t threads; -}; // ThreadModule -} // thread -} // love - -#endif // LOVE_THREAD_SDL_THREAD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_THREAD_SDL_THREAD_H +#define LOVE_THREAD_SDL_THREAD_H + +// STL +#include +#include +#include +#include + +// LOVE +#include "filesystem/File.h" +#include "common/runtime.h" +#include "common/Module.h" +#include "common/Variant.h" +#include "thread/threads.h" + +namespace love +{ +namespace thread +{ + +class ThreadModule; + +class ThreadData +{ +public: + ThreadData(const char *name, size_t len, const char *code, void *mutex, void *cond); + ~ThreadData(); + const char *getCode(); + const char *getName(size_t *len = 0); + Variant *getValue(const std::string &name); + void clearValue(const std::string &name); + void setValue(const std::string &name, Variant *v); + std::vector getKeys(); + + void *mutex; + void *cond; +private: + char *code; + char *name; + std::map shared; + size_t len; +}; + +class Thread : public love::Object +{ +public: + Thread(love::thread::ThreadModule *module, const std::string &name, love::Data *data); + Thread(love::thread::ThreadModule *module, const std::string &name); + virtual ~Thread(); + void start(); + void kill(); + void wait(); + std::string getName(); + Variant *get(const std::string &name); + std::vector getKeys(); + Variant *demand(const std::string &name); + void clear(const std::string &name); + void set(const std::string &name, Variant *v); + void lock(); + void unlock(); +private: + class ThreadThread: public ThreadBase + { + private: + ThreadData *comm; + + protected: + virtual void main(); + + public: + ThreadThread(ThreadData *comm); + }; + + ThreadThread *handle; + + ThreadModule *module; + ThreadData *comm; + std::string name; + char *data; + Mutex *mutex; + Conditional *cond; + bool isThread; +}; // Thread + +typedef std::map threadlist_t; + +class ThreadModule : public love::Module +{ +public: + ThreadModule(); + virtual ~ThreadModule(); + Thread *newThread(const std::string &name, love::Data *data); + void getThreads(Thread **list); + Thread *getThread(const std::string &name); + unsigned getThreadCount() const; + void unregister(const std::string &name); + const char *getName() const; +private: + threadlist_t threads; +}; // ThreadModule +} // thread +} // love + +#endif // LOVE_THREAD_SDL_THREAD_H diff --git a/src/modules/thread/posix/threads.cpp b/src/modules/thread/posix/threads.cpp index fab1ff812..e4247b235 100644 --- a/src/modules/thread/posix/threads.cpp +++ b/src/modules/thread/posix/threads.cpp @@ -1,192 +1,192 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "threads.h" -#ifdef LOVE_MACOSX -#include "common/delay.h" // for Mac OS X's fake sem_timedwait -#endif - -namespace love -{ -namespace thread -{ - -Mutex::Mutex() -{ - pthread_mutex_init(&mutex, NULL); -} - -Mutex::~Mutex() -{ - pthread_mutex_destroy(&mutex); -} - -void Mutex::lock() -{ - pthread_mutex_lock(&mutex); -} - -void Mutex::unlock() -{ - pthread_mutex_unlock(&mutex); -} - -void *ThreadBase::thread_runner(void *param) -{ - ThreadBase *thread = (ThreadBase *)param; - thread->main(); - return NULL; -} - -ThreadBase::ThreadBase() - : running(false) -{ - pthread_t thread; -} - -ThreadBase::~ThreadBase() -{ - if (running) - { - wait(); - } -} - -bool ThreadBase::start() -{ - if (pthread_create(&thread, NULL, thread_runner, this)) - return false; - return (running = true); -} - -void ThreadBase::wait() -{ - pthread_join(thread, NULL); - running = false; -} - -void ThreadBase::kill() -{ - pthread_kill(thread, 9); - running = false; -} - -unsigned int ThreadBase::threadId() -{ - return (unsigned int)((size_t)pthread_self()); -} - -Semaphore::Semaphore(unsigned int initial_value) -{ - sem_init(&sem, 0, initial_value); -} - -Semaphore::~Semaphore() -{ - sem_destroy(&sem); -} - -unsigned int Semaphore::value() -{ - int val = 0; - if (sem_getvalue(&sem, &val)) - return 0; - else - return val; -} - -void Semaphore::post() -{ - sem_post(&sem); -} - -bool Semaphore::wait(int timeout) -{ - if (timeout < 0) - return !sem_wait(&sem); - else if (timeout == 0) - return !sem_trywait(&sem); - else - { -#ifdef LOVE_MACOSX - // OS X lacks sem_timedwait, so we fake it with a busy loop - time_t timer = time(NULL)*1000 + timeout; - int retval = 0; - do - { - retval = sem_trywait(&sem); - if (retval == 0) break; - delay(1); - } - while (time(NULL)*1000 < timer); - return !retval; -#else - struct timespec ts; - ts.tv_sec = timeout/1000; - ts.tv_nsec = (timeout % 1000) * 1000000; - return !sem_timedwait(&sem, &ts); -#endif - } -} - -bool Semaphore::tryWait() -{ - return !sem_trywait(&sem); -} - -Conditional::Conditional() -{ - pthread_cond_init(&cond, NULL); -} - -Conditional::~Conditional() -{ - pthread_cond_destroy(&cond); -} - -void Conditional::signal() -{ - pthread_cond_signal(&cond); -} - -void Conditional::broadcast() -{ - pthread_cond_broadcast(&cond); -} - -bool Conditional::wait(Mutex *mutex, int timeout) -{ - if (timeout < 0) - return !pthread_cond_wait(&cond, &mutex->mutex); - else - { - struct timespec ts; - int ret; - - ts.tv_sec = timeout / 1000; - ts.tv_nsec = (timeout % 1000) * 1000000; - - ret = pthread_cond_timedwait(&cond, &mutex->mutex, &ts); - return (ret == 0); - } -} -} // thread -} // love - +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "threads.h" +#ifdef LOVE_MACOSX +#include "common/delay.h" // for Mac OS X's fake sem_timedwait +#endif + +namespace love +{ +namespace thread +{ + +Mutex::Mutex() +{ + pthread_mutex_init(&mutex, NULL); +} + +Mutex::~Mutex() +{ + pthread_mutex_destroy(&mutex); +} + +void Mutex::lock() +{ + pthread_mutex_lock(&mutex); +} + +void Mutex::unlock() +{ + pthread_mutex_unlock(&mutex); +} + +void *ThreadBase::thread_runner(void *param) +{ + ThreadBase *thread = (ThreadBase *)param; + thread->main(); + return NULL; +} + +ThreadBase::ThreadBase() + : running(false) +{ + pthread_t thread; +} + +ThreadBase::~ThreadBase() +{ + if (running) + { + wait(); + } +} + +bool ThreadBase::start() +{ + if (pthread_create(&thread, NULL, thread_runner, this)) + return false; + return (running = true); +} + +void ThreadBase::wait() +{ + pthread_join(thread, NULL); + running = false; +} + +void ThreadBase::kill() +{ + pthread_kill(thread, 9); + running = false; +} + +unsigned int ThreadBase::threadId() +{ + return (unsigned int)((size_t)pthread_self()); +} + +Semaphore::Semaphore(unsigned int initial_value) +{ + sem_init(&sem, 0, initial_value); +} + +Semaphore::~Semaphore() +{ + sem_destroy(&sem); +} + +unsigned int Semaphore::value() +{ + int val = 0; + if (sem_getvalue(&sem, &val)) + return 0; + else + return val; +} + +void Semaphore::post() +{ + sem_post(&sem); +} + +bool Semaphore::wait(int timeout) +{ + if (timeout < 0) + return !sem_wait(&sem); + else if (timeout == 0) + return !sem_trywait(&sem); + else + { +#ifdef LOVE_MACOSX + // OS X lacks sem_timedwait, so we fake it with a busy loop + time_t timer = time(NULL)*1000 + timeout; + int retval = 0; + do + { + retval = sem_trywait(&sem); + if (retval == 0) break; + delay(1); + } + while (time(NULL)*1000 < timer); + return !retval; +#else + struct timespec ts; + ts.tv_sec = timeout/1000; + ts.tv_nsec = (timeout % 1000) * 1000000; + return !sem_timedwait(&sem, &ts); +#endif + } +} + +bool Semaphore::tryWait() +{ + return !sem_trywait(&sem); +} + +Conditional::Conditional() +{ + pthread_cond_init(&cond, NULL); +} + +Conditional::~Conditional() +{ + pthread_cond_destroy(&cond); +} + +void Conditional::signal() +{ + pthread_cond_signal(&cond); +} + +void Conditional::broadcast() +{ + pthread_cond_broadcast(&cond); +} + +bool Conditional::wait(Mutex *mutex, int timeout) +{ + if (timeout < 0) + return !pthread_cond_wait(&cond, &mutex->mutex); + else + { + struct timespec ts; + int ret; + + ts.tv_sec = timeout / 1000; + ts.tv_nsec = (timeout % 1000) * 1000000; + + ret = pthread_cond_timedwait(&cond, &mutex->mutex, &ts); + return (ret == 0); + } +} +} // thread +} // love + diff --git a/src/modules/thread/posix/threads.h b/src/modules/thread/posix/threads.h index 13f145e3e..959eb08c0 100644 --- a/src/modules/thread/posix/threads.h +++ b/src/modules/thread/posix/threads.h @@ -1,107 +1,107 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_THREAD_POSIX_THREADS_H -#define LOVE_THREAD_POSIX_THREADS_H - -#include -#include -#include - -namespace love -{ -namespace thread -{ -class Mutex -{ -public: - Mutex(); - ~Mutex(); - - void lock(); - void unlock(); - -private: - pthread_mutex_t mutex; - Mutex(const Mutex &mutex) {} - - friend class Conditional; -}; - - -class ThreadBase -{ -public: - ThreadBase(); - virtual ~ThreadBase(); - - bool start(); - void wait(); - void kill(); - - static unsigned int threadId(); - -protected: - virtual void main() = 0; - -private: - pthread_t thread; - ThreadBase(ThreadBase &thread) {} - - static void *thread_runner(void *param); - bool running; -}; - -class Semaphore -{ -public: - Semaphore(unsigned int initial_value); - ~Semaphore(); - - unsigned int value(); - void post(); - bool wait(int timeout = -1); - bool tryWait(); - -private: - Semaphore(const Semaphore &sem) {} - sem_t sem; -}; - -// Should conditional inherit from mutex? -class Conditional -{ -public: - Conditional(); - ~Conditional(); - - void signal(); - void broadcast(); - bool wait(Mutex *mutex, int timeout=-1); - -private: - pthread_cond_t cond; -}; - -} // thread -} // love - - -#endif // LOVE_THREAD_POSIX_THREADS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_THREAD_POSIX_THREADS_H +#define LOVE_THREAD_POSIX_THREADS_H + +#include +#include +#include + +namespace love +{ +namespace thread +{ +class Mutex +{ +public: + Mutex(); + ~Mutex(); + + void lock(); + void unlock(); + +private: + pthread_mutex_t mutex; + Mutex(const Mutex &mutex) {} + + friend class Conditional; +}; + + +class ThreadBase +{ +public: + ThreadBase(); + virtual ~ThreadBase(); + + bool start(); + void wait(); + void kill(); + + static unsigned int threadId(); + +protected: + virtual void main() = 0; + +private: + pthread_t thread; + ThreadBase(ThreadBase &thread) {} + + static void *thread_runner(void *param); + bool running; +}; + +class Semaphore +{ +public: + Semaphore(unsigned int initial_value); + ~Semaphore(); + + unsigned int value(); + void post(); + bool wait(int timeout = -1); + bool tryWait(); + +private: + Semaphore(const Semaphore &sem) {} + sem_t sem; +}; + +// Should conditional inherit from mutex? +class Conditional +{ +public: + Conditional(); + ~Conditional(); + + void signal(); + void broadcast(); + bool wait(Mutex *mutex, int timeout=-1); + +private: + pthread_cond_t cond; +}; + +} // thread +} // love + + +#endif // LOVE_THREAD_POSIX_THREADS_H diff --git a/src/modules/thread/sdl/threads.cpp b/src/modules/thread/sdl/threads.cpp index 381606255..9497d5046 100644 --- a/src/modules/thread/sdl/threads.cpp +++ b/src/modules/thread/sdl/threads.cpp @@ -1,161 +1,161 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "threads.h" - -namespace love -{ -namespace thread -{ - -Mutex::Mutex() -{ - mutex = SDL_CreateMutex(); -} - -Mutex::~Mutex() -{ - SDL_DestroyMutex(mutex); -} - -void Mutex::lock() -{ - SDL_mutexP(mutex); -} - -void Mutex::unlock() -{ - SDL_mutexV(mutex); -} - -int ThreadBase::thread_runner(void *param) -{ - ThreadBase *thread = (ThreadBase *)param; - thread->main(); - return 0; -} - -ThreadBase::ThreadBase() - : running(false) -{ -} - -ThreadBase::~ThreadBase() -{ - if (running) - { - wait(); - } -} - -bool ThreadBase::start() -{ - thread = SDL_CreateThread(thread_runner, this); - if (thread == NULL) - return false; - else - return (running = true); -} - -void ThreadBase::wait() -{ - SDL_WaitThread(thread, NULL); - running = false; -} - -void ThreadBase::kill() -{ - SDL_KillThread(thread); - running = false; -} - -unsigned int ThreadBase::threadId() -{ - return (unsigned int)SDL_ThreadID(); -} - -Semaphore::Semaphore(unsigned int initial_value) -{ - semaphore = SDL_CreateSemaphore(initial_value); -} - -Semaphore::~Semaphore() -{ - SDL_DestroySemaphore(semaphore); -} - -unsigned int Semaphore::value() -{ - return SDL_SemValue(semaphore); -} - -void Semaphore::post() -{ - SDL_SemPost(semaphore); -} - -bool Semaphore::wait(int timeout) -{ - if (timeout < 0) - return SDL_SemWait(semaphore) ? false : true; - else if (timeout == 0) - return SDL_SemTryWait(semaphore) ? false : true; - else - { - int ret = SDL_SemWaitTimeout(semaphore, timeout); - return (ret == 0); - } -} - -bool Semaphore::tryWait() -{ - return SDL_SemTryWait(semaphore) ? false : true; -} - -Conditional::Conditional() -{ - cond = SDL_CreateCond(); -} - -Conditional::~Conditional() -{ - SDL_DestroyCond(cond); -} - -void Conditional::signal() -{ - SDL_CondSignal(cond); -} - -void Conditional::broadcast() -{ - SDL_CondBroadcast(cond); -} - -bool Conditional::wait(Mutex *mutex, int timeout) -{ - if (timeout < 0) - return !SDL_CondWait(cond, mutex->mutex); - else - return (SDL_CondWaitTimeout(cond, mutex->mutex, timeout) == 0); -} - -} // thread -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "threads.h" + +namespace love +{ +namespace thread +{ + +Mutex::Mutex() +{ + mutex = SDL_CreateMutex(); +} + +Mutex::~Mutex() +{ + SDL_DestroyMutex(mutex); +} + +void Mutex::lock() +{ + SDL_mutexP(mutex); +} + +void Mutex::unlock() +{ + SDL_mutexV(mutex); +} + +int ThreadBase::thread_runner(void *param) +{ + ThreadBase *thread = (ThreadBase *)param; + thread->main(); + return 0; +} + +ThreadBase::ThreadBase() + : running(false) +{ +} + +ThreadBase::~ThreadBase() +{ + if (running) + { + wait(); + } +} + +bool ThreadBase::start() +{ + thread = SDL_CreateThread(thread_runner, this); + if (thread == NULL) + return false; + else + return (running = true); +} + +void ThreadBase::wait() +{ + SDL_WaitThread(thread, NULL); + running = false; +} + +void ThreadBase::kill() +{ + SDL_KillThread(thread); + running = false; +} + +unsigned int ThreadBase::threadId() +{ + return (unsigned int)SDL_ThreadID(); +} + +Semaphore::Semaphore(unsigned int initial_value) +{ + semaphore = SDL_CreateSemaphore(initial_value); +} + +Semaphore::~Semaphore() +{ + SDL_DestroySemaphore(semaphore); +} + +unsigned int Semaphore::value() +{ + return SDL_SemValue(semaphore); +} + +void Semaphore::post() +{ + SDL_SemPost(semaphore); +} + +bool Semaphore::wait(int timeout) +{ + if (timeout < 0) + return SDL_SemWait(semaphore) ? false : true; + else if (timeout == 0) + return SDL_SemTryWait(semaphore) ? false : true; + else + { + int ret = SDL_SemWaitTimeout(semaphore, timeout); + return (ret == 0); + } +} + +bool Semaphore::tryWait() +{ + return SDL_SemTryWait(semaphore) ? false : true; +} + +Conditional::Conditional() +{ + cond = SDL_CreateCond(); +} + +Conditional::~Conditional() +{ + SDL_DestroyCond(cond); +} + +void Conditional::signal() +{ + SDL_CondSignal(cond); +} + +void Conditional::broadcast() +{ + SDL_CondBroadcast(cond); +} + +bool Conditional::wait(Mutex *mutex, int timeout) +{ + if (timeout < 0) + return !SDL_CondWait(cond, mutex->mutex); + else + return (SDL_CondWaitTimeout(cond, mutex->mutex, timeout) == 0); +} + +} // thread +} // love diff --git a/src/modules/thread/sdl/threads.h b/src/modules/thread/sdl/threads.h index f07add994..678b49d04 100644 --- a/src/modules/thread/sdl/threads.h +++ b/src/modules/thread/sdl/threads.h @@ -1,107 +1,107 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_THREAD_SDL_THREADS_H -#define LOVE_THREAD_SDL_THREADS_H - -#include "SDL.h" -#include "common/config.h" - -namespace love -{ -namespace thread -{ - -class Mutex -{ -public: - Mutex(); - ~Mutex(); - - void lock(); - void unlock(); -private: - SDL_mutex *mutex; - Mutex(const Mutex &/* mutex*/) {} - - friend class Conditional; -}; - - - -class ThreadBase -{ -public: - ThreadBase(); - virtual ~ThreadBase(); - - bool start(); - void wait(); - void kill(); // FIXME: not supported by SDL (SDL's kill is probably cancel)? - - static unsigned int threadId(); - -protected: - virtual void main() = 0; - -private: - SDL_Thread *thread; - ThreadBase(ThreadBase &/* thread*/) {} - bool running; - - static int thread_runner(void *param); -}; - -class Semaphore -{ -public: - Semaphore(unsigned int initial_value); - ~Semaphore(); - - unsigned int value(); - void post(); - bool wait(int timeout = -1); - bool tryWait(); - -private: - Semaphore(const Semaphore &/* sem*/) {} - SDL_sem *semaphore; -}; - -// Should conditional inherit from mutex? -class Conditional -{ -public: - Conditional(); - ~Conditional(); - - void signal(); - void broadcast(); - bool wait(Mutex *mutex, int timeout=-1); - -private: - SDL_cond *cond; -}; - -} // thread -} // love - - -#endif // LOVE_THREAD_SDL_THREADS_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_THREAD_SDL_THREADS_H +#define LOVE_THREAD_SDL_THREADS_H + +#include "SDL.h" +#include "common/config.h" + +namespace love +{ +namespace thread +{ + +class Mutex +{ +public: + Mutex(); + ~Mutex(); + + void lock(); + void unlock(); +private: + SDL_mutex *mutex; + Mutex(const Mutex &/* mutex*/) {} + + friend class Conditional; +}; + + + +class ThreadBase +{ +public: + ThreadBase(); + virtual ~ThreadBase(); + + bool start(); + void wait(); + void kill(); // FIXME: not supported by SDL (SDL's kill is probably cancel)? + + static unsigned int threadId(); + +protected: + virtual void main() = 0; + +private: + SDL_Thread *thread; + ThreadBase(ThreadBase &/* thread*/) {} + bool running; + + static int thread_runner(void *param); +}; + +class Semaphore +{ +public: + Semaphore(unsigned int initial_value); + ~Semaphore(); + + unsigned int value(); + void post(); + bool wait(int timeout = -1); + bool tryWait(); + +private: + Semaphore(const Semaphore &/* sem*/) {} + SDL_sem *semaphore; +}; + +// Should conditional inherit from mutex? +class Conditional +{ +public: + Conditional(); + ~Conditional(); + + void signal(); + void broadcast(); + bool wait(Mutex *mutex, int timeout=-1); + +private: + SDL_cond *cond; +}; + +} // thread +} // love + + +#endif // LOVE_THREAD_SDL_THREADS_H diff --git a/src/modules/thread/threads.cpp b/src/modules/thread/threads.cpp index 8a48c6bdc..900fbd779 100644 --- a/src/modules/thread/threads.cpp +++ b/src/modules/thread/threads.cpp @@ -1,48 +1,48 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "threads.h" - -#if LOVE_THREADS == LOVE_THREADS_POSIX -# include "posix/threads.cpp" -#elif LOVE_THREADS == LOVE_THREADS_WIN32 -# include "win32/threads.cpp" -#elif LOVE_THREADS == LOVE_THREADS_SDL -# include "sdl/threads.cpp" -#endif - -namespace love -{ -namespace thread -{ - -const char *threadAPI() -{ -#if LOVE_THREADS == LOVE_THREADS_POSIX - return "posix"; -#elif LOVE_THREADS == LOVE_THREADS_WIN32 - return "win32"; -#elif LOVE_THREADS == LOVE_THREADS_SDL - return "sdl"; -#endif -} - -} // thread -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "threads.h" + +#if LOVE_THREADS == LOVE_THREADS_POSIX +# include "posix/threads.cpp" +#elif LOVE_THREADS == LOVE_THREADS_WIN32 +# include "win32/threads.cpp" +#elif LOVE_THREADS == LOVE_THREADS_SDL +# include "sdl/threads.cpp" +#endif + +namespace love +{ +namespace thread +{ + +const char *threadAPI() +{ +#if LOVE_THREADS == LOVE_THREADS_POSIX + return "posix"; +#elif LOVE_THREADS == LOVE_THREADS_WIN32 + return "win32"; +#elif LOVE_THREADS == LOVE_THREADS_SDL + return "sdl"; +#endif +} + +} // thread +} // love diff --git a/src/modules/thread/threads.h b/src/modules/thread/threads.h index 3b99c1d79..f3e903b23 100644 --- a/src/modules/thread/threads.h +++ b/src/modules/thread/threads.h @@ -1,87 +1,87 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_THREAD_THREADS_H -#define LOVE_THREAD_THREADS_H - -#include "common/config.h" - -#define LOVE_THREADS_SDL 0 -#define LOVE_THREADS_WIN32 1 -#define LOVE_THREADS_POSIX 2 - -// Choose correct threads API. -// Headless love uses either windows threads or posix threads. -// Headed (standard) love uses SDL threads. -#ifdef LOVE_HEADLESS -# ifdef WIN32 -# define LOVE_THREADS LOVE_THREADS_WIN32 -# else -# define LOVE_THREADS LOVE_THREADS_POSIX -# endif -#else -# define LOVE_THREADS LOVE_THREADS_SDL -#endif - - -// include the correct header -#if LOVE_THREADS == LOVE_THREADS_POSIX -# include "posix/threads.h" -#elif LOVE_THREADS == LOVE_THREADS_WIN32 -# include "win32/threads.h" -#elif LOVE_THREADS == LOVE_THREADS_SDL -# include "sdl/threads.h" -#endif - - -namespace love -{ -namespace thread -{ - -const char *threadAPI(); - -class Lock -{ -public: - Lock(Mutex *m): mutex(m) - { - mutex->lock(); - } - - Lock(Mutex &m): mutex(&m) - { - mutex->lock(); - } - - ~Lock() - { - mutex->unlock(); - } -private: - Mutex *mutex; - - Lock(Lock &/* lock*/) {} -}; - -} // thread -} // love - -#endif /* LOVE_THREAD_THREADS_H */ +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_THREAD_THREADS_H +#define LOVE_THREAD_THREADS_H + +#include "common/config.h" + +#define LOVE_THREADS_SDL 0 +#define LOVE_THREADS_WIN32 1 +#define LOVE_THREADS_POSIX 2 + +// Choose correct threads API. +// Headless love uses either windows threads or posix threads. +// Headed (standard) love uses SDL threads. +#ifdef LOVE_HEADLESS +# ifdef WIN32 +# define LOVE_THREADS LOVE_THREADS_WIN32 +# else +# define LOVE_THREADS LOVE_THREADS_POSIX +# endif +#else +# define LOVE_THREADS LOVE_THREADS_SDL +#endif + + +// include the correct header +#if LOVE_THREADS == LOVE_THREADS_POSIX +# include "posix/threads.h" +#elif LOVE_THREADS == LOVE_THREADS_WIN32 +# include "win32/threads.h" +#elif LOVE_THREADS == LOVE_THREADS_SDL +# include "sdl/threads.h" +#endif + + +namespace love +{ +namespace thread +{ + +const char *threadAPI(); + +class Lock +{ +public: + Lock(Mutex *m): mutex(m) + { + mutex->lock(); + } + + Lock(Mutex &m): mutex(&m) + { + mutex->lock(); + } + + ~Lock() + { + mutex->unlock(); + } +private: + Mutex *mutex; + + Lock(Lock &/* lock*/) {} +}; + +} // thread +} // love + +#endif /* LOVE_THREAD_THREADS_H */ diff --git a/src/modules/thread/win32/threads.cpp b/src/modules/thread/win32/threads.cpp index 0ec56ea37..572d8dad5 100644 --- a/src/modules/thread/win32/threads.cpp +++ b/src/modules/thread/win32/threads.cpp @@ -1,211 +1,211 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "threads.h" - -namespace love -{ -namespace thread -{ - -Mutex::Mutex() -{ - InitializeCriticalSection(&mutex); -} - -Mutex::~Mutex() -{ - DeleteCriticalSection(&mutex); -} - -void Mutex::lock() -{ - EnterCriticalSection(&mutex); -} - -void Mutex::unlock() -{ - LeaveCriticalSection(&mutex); -} - -int ThreadBase::thread_runner(void *param) -{ - ThreadBase *thread = (ThreadBase *)param; - thread->main(); - return 0; -} - -ThreadBase::ThreadBase() - : running(false) -{ -} - -ThreadBase::~ThreadBase() -{ - if (running) - wait(); -} - -bool ThreadBase::start() -{ - thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) thread_runner, this, 0, NULL); - if (thread == NULL) - return false; - else - return (running = true); -} - -void ThreadBase::wait() -{ - WaitForSingleObject(thread, INFINITE); - CloseHandle(thread); - running = false; -} - -void ThreadBase::kill() -{ - TerminateThread(thread, FALSE); - running = false; -} - -unsigned int ThreadBase::threadId() -{ - return (unsigned int)GetCurrentThreadId(); -} - -Semaphore::Semaphore(unsigned int initial_value) - : count(initial_value) -{ - semaphore = CreateSemaphore(NULL, initial_value, UINT_MAX, NULL); -} - -Semaphore::~Semaphore() -{ - CloseHandle(semaphore); -} - -unsigned int Semaphore::value() -{ - return count; -} - -void Semaphore::post() -{ - InterlockedIncrement(&count); - if (ReleaseSemaphore(semaphore, 1, NULL) == FALSE) - InterlockedDecrement(&count); -} - -bool Semaphore::wait(int timeout) -{ - int result; - - result = WaitForSingleObject(semaphore, timeout < 0 ? INFINITE : timeout); - if (result == WAIT_OBJECT_0) - { - InterlockedDecrement(&count); - return true; - } - else - return false; -} - -bool Semaphore::tryWait() -{ - return wait(0); -} - - -// Conditional variable implementation based on semaphores. -// Vista+ builds should probably use CONDITIONAL_VARIABLE. -// -// based on http://www.cs.wustl.edu/~schmidt/win32-cv-2.html and ACE - - -Conditional::Conditional() - : waiting(0), signals(0) -{ -} - -Conditional::~Conditional() -{ -} - -void Conditional::signal() -{ - mutex.lock(); - if (waiting > signals) - { - signals++; - sem.post(); - mutex.unlock(); - done.wait(); - } - else - { - mutex.unlock(); - } -} - -void Conditional::broadcast() -{ - mutex.lock(); - if (waiting > signals) - { - int num = waiting - signals; - signals = waiting; - for (int i = 0; i < num; i++) - sem.post(); - mutex.unlock(); - for (int i = 0; i < num; i++) - done.wait(); - } - else - { - mutex.unlock(); - } -} - -bool Conditional::wait(Mutex *cmutex, int timeout) -{ - mutex.lock(); - waiting++; - mutex.unlock(); - - cmutex->unlock(); - bool ret = sem.wait(timeout); - - mutex.lock(); - if (signals > 0) - { - if (!ret) - sem.wait(); - done.post(); - signals--; - } - waiting--; - mutex.unlock(); - cmutex->lock(); - - return true; -} - -} // thread -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "threads.h" + +namespace love +{ +namespace thread +{ + +Mutex::Mutex() +{ + InitializeCriticalSection(&mutex); +} + +Mutex::~Mutex() +{ + DeleteCriticalSection(&mutex); +} + +void Mutex::lock() +{ + EnterCriticalSection(&mutex); +} + +void Mutex::unlock() +{ + LeaveCriticalSection(&mutex); +} + +int ThreadBase::thread_runner(void *param) +{ + ThreadBase *thread = (ThreadBase *)param; + thread->main(); + return 0; +} + +ThreadBase::ThreadBase() + : running(false) +{ +} + +ThreadBase::~ThreadBase() +{ + if (running) + wait(); +} + +bool ThreadBase::start() +{ + thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) thread_runner, this, 0, NULL); + if (thread == NULL) + return false; + else + return (running = true); +} + +void ThreadBase::wait() +{ + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + running = false; +} + +void ThreadBase::kill() +{ + TerminateThread(thread, FALSE); + running = false; +} + +unsigned int ThreadBase::threadId() +{ + return (unsigned int)GetCurrentThreadId(); +} + +Semaphore::Semaphore(unsigned int initial_value) + : count(initial_value) +{ + semaphore = CreateSemaphore(NULL, initial_value, UINT_MAX, NULL); +} + +Semaphore::~Semaphore() +{ + CloseHandle(semaphore); +} + +unsigned int Semaphore::value() +{ + return count; +} + +void Semaphore::post() +{ + InterlockedIncrement(&count); + if (ReleaseSemaphore(semaphore, 1, NULL) == FALSE) + InterlockedDecrement(&count); +} + +bool Semaphore::wait(int timeout) +{ + int result; + + result = WaitForSingleObject(semaphore, timeout < 0 ? INFINITE : timeout); + if (result == WAIT_OBJECT_0) + { + InterlockedDecrement(&count); + return true; + } + else + return false; +} + +bool Semaphore::tryWait() +{ + return wait(0); +} + + +// Conditional variable implementation based on semaphores. +// Vista+ builds should probably use CONDITIONAL_VARIABLE. +// +// based on http://www.cs.wustl.edu/~schmidt/win32-cv-2.html and ACE + + +Conditional::Conditional() + : waiting(0), signals(0) +{ +} + +Conditional::~Conditional() +{ +} + +void Conditional::signal() +{ + mutex.lock(); + if (waiting > signals) + { + signals++; + sem.post(); + mutex.unlock(); + done.wait(); + } + else + { + mutex.unlock(); + } +} + +void Conditional::broadcast() +{ + mutex.lock(); + if (waiting > signals) + { + int num = waiting - signals; + signals = waiting; + for (int i = 0; i < num; i++) + sem.post(); + mutex.unlock(); + for (int i = 0; i < num; i++) + done.wait(); + } + else + { + mutex.unlock(); + } +} + +bool Conditional::wait(Mutex *cmutex, int timeout) +{ + mutex.lock(); + waiting++; + mutex.unlock(); + + cmutex->unlock(); + bool ret = sem.wait(timeout); + + mutex.lock(); + if (signals > 0) + { + if (!ret) + sem.wait(); + done.post(); + signals--; + } + waiting--; + mutex.unlock(); + cmutex->lock(); + + return true; +} + +} // thread +} // love diff --git a/src/modules/thread/win32/threads.h b/src/modules/thread/win32/threads.h index ab77127fa..3822f46be 100644 --- a/src/modules/thread/win32/threads.h +++ b/src/modules/thread/win32/threads.h @@ -1,107 +1,107 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_THREAD_WIN32_THREADS_H -#define LOVE_THREAD_WIN32_THREADS_H - -#include -#include - -namespace love -{ -namespace thread -{ - -class Mutex -{ -public: - Mutex(); - ~Mutex(); - - void lock(); - void unlock(); -private: - CRITICAL_SECTION mutex; - Mutex(const Mutex &mutex) {} -}; - -class ThreadBase -{ -public: - ThreadBase(); - virtual ~ThreadBase(); - - bool start(); - void wait(); - void kill(); - - static unsigned int threadId(); - -protected: - - virtual void main() = 0; - -private: - HANDLE thread; - ThreadBase(ThreadBase &thread) {} - bool running; - - static int WINAPI thread_runner(void *param); -}; - - -class Semaphore -{ -public: - Semaphore(unsigned int initial_value = 0); - ~Semaphore(); - - unsigned int value(); - void post(); - bool wait(int timeout = -1); - bool tryWait(); -private: - Semaphore(const Semaphore &sem) {} - HANDLE semaphore; - unsigned int count; -}; - - -// Should conditional inherit from mutex? -class Conditional -{ -public: - Conditional(); - ~Conditional(); - - void signal(); - void broadcast(); - bool wait(Mutex *cmutex, int timeout=-1); -private: - Mutex mutex; - int waiting; - int signals; - Semaphore sem; - Semaphore done; -}; -} // thread -} // love - -#endif /* LOVE_THREAD_WIN32_THREADS_H */ +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_THREAD_WIN32_THREADS_H +#define LOVE_THREAD_WIN32_THREADS_H + +#include +#include + +namespace love +{ +namespace thread +{ + +class Mutex +{ +public: + Mutex(); + ~Mutex(); + + void lock(); + void unlock(); +private: + CRITICAL_SECTION mutex; + Mutex(const Mutex &mutex) {} +}; + +class ThreadBase +{ +public: + ThreadBase(); + virtual ~ThreadBase(); + + bool start(); + void wait(); + void kill(); + + static unsigned int threadId(); + +protected: + + virtual void main() = 0; + +private: + HANDLE thread; + ThreadBase(ThreadBase &thread) {} + bool running; + + static int WINAPI thread_runner(void *param); +}; + + +class Semaphore +{ +public: + Semaphore(unsigned int initial_value = 0); + ~Semaphore(); + + unsigned int value(); + void post(); + bool wait(int timeout = -1); + bool tryWait(); +private: + Semaphore(const Semaphore &sem) {} + HANDLE semaphore; + unsigned int count; +}; + + +// Should conditional inherit from mutex? +class Conditional +{ +public: + Conditional(); + ~Conditional(); + + void signal(); + void broadcast(); + bool wait(Mutex *cmutex, int timeout=-1); +private: + Mutex mutex; + int waiting; + int signals; + Semaphore sem; + Semaphore done; +}; +} // thread +} // love + +#endif /* LOVE_THREAD_WIN32_THREADS_H */ diff --git a/src/modules/thread/wrap_Thread.cpp b/src/modules/thread/wrap_Thread.cpp index 9fd73bbc7..1947e12da 100644 --- a/src/modules/thread/wrap_Thread.cpp +++ b/src/modules/thread/wrap_Thread.cpp @@ -1,290 +1,290 @@ -/** - * Copyright (c) 2006-2010 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "wrap_Thread.h" - -namespace love -{ -namespace thread -{ - -Thread *luax_checkthread(lua_State *L, int idx) -{ - return luax_checktype(L, idx, "Thread", THREAD_THREAD_T); -} - -int w_Thread_start(lua_State *L) -{ - Thread *t = luax_checkthread(L, 1); - t->start(); - return 0; -} - -int w_Thread_wait(lua_State *L) -{ - Thread *t = luax_checkthread(L, 1); - t->wait(); - return 0; -} - -int w_Thread_getName(lua_State *L) -{ - Thread *t = luax_checkthread(L, 1); - // allow names containing \0 - luax_pushstring(L, t->getName()); - return 1; -} - - -int w_Thread_get(lua_State *L) -{ - Thread *t = luax_checkthread(L, 1); - std::string name = luax_checkstring(L, 2); - t->lock(); - Variant *v = t->get(name); - t->clear(name); - t->unlock(); - if (!v) - { - lua_pushnil(L); - return 1; - } - v->toLua(L); - t->lock(); - v->release(); - t->unlock(); - return 1; -} - -int w_Thread_getKeys(lua_State *L) -{ - Thread *t = luax_checkthread(L, 1); - t->lock(); - std::vector keys = t->getKeys(); - t->unlock(); - lua_createtable(L, keys.size(), 0); - int i = 1; - for (std::vector::iterator it = keys.begin(); it != keys.end(); it++) - { - lua_pushnumber(L, i++); - luax_pushstring(L, *it); - lua_settable(L, -3); - } - return 1; -} - -int w_Thread_demand(lua_State *L) -{ - Thread *t = luax_checkthread(L, 1); - std::string name = luax_checkstring(L, 2); - t->lock(); - Variant *v = t->demand(name); - t->clear(name); - t->unlock(); - if (!v) - { - lua_pushnil(L); - return 1; - } - v->toLua(L); - t->lock(); - v->release(); - t->unlock(); - return 1; -} - -int w_Thread_peek(lua_State *L) -{ - Thread *t = luax_checkthread(L, 1); - std::string name = luax_checkstring(L, 2); - t->lock(); - Variant *v = t->get(name); - t->unlock(); - if (!v) - { - lua_pushnil(L); - return 1; - } - v->toLua(L); - t->lock(); - v->release(); - t->unlock(); - return 1; -} - - -int w_Thread_set(lua_State *L) -{ - Thread *t = luax_checkthread(L, 1); - std::string name = luax_checkstring(L, 2); - Variant *v = Variant::fromLua(L, 3); - if (!v) - return luaL_error(L, "Expected boolean, number, string or userdata"); - t->set(name, v); - t->lock(); - v->release(); - t->unlock(); - return 0; -} - -static const luaL_Reg type_functions[] = -{ - { "start", w_Thread_start }, - { "wait", w_Thread_wait }, - { "getName", w_Thread_getName }, - { "get", w_Thread_get }, - { "getKeys", w_Thread_getKeys }, - { "demand", w_Thread_demand }, - { "peek", w_Thread_peek }, - { "set", w_Thread_set }, - { 0, 0 } -}; - -extern "C" int luaopen_thread(lua_State *L) -{ - return luax_register_type(L, "Thread", type_functions); -} - -static ThreadModule *instance; - -int w_newThread(lua_State *L) -{ - std::string name = luax_checkstring(L, 1); - love::Data *data; - if (lua_isstring(L, 2)) - luax_convobj(L, 2, "filesystem", "newFile"); - if (luax_istype(L, 2, FILESYSTEM_FILE_T)) - { - try - { - data = luax_checktype(L, 2, "File", FILESYSTEM_FILE_T)->read(); - } - catch(love::Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - { - data = luax_checktype(L, 2, "Data", DATA_T); - data->retain(); - } - Thread *t = instance->newThread(name, data); - // do not worry, file->read() returns retained data - data->release(); - if (!t) - return luaL_error(L, "A thread with that name already exists."); - luax_newtype(L, "Thread", THREAD_THREAD_T, (void *)t); - return 1; -} - -int w_getThreads(lua_State *L) -{ - unsigned count = instance->getThreadCount(); - Thread **list = new Thread*[count]; - instance->getThreads(list); - lua_newtable(L); - for (unsigned int i = 0; igetName()); - luax_newtype(L, "Thread", THREAD_THREAD_T, (void *) list[i]); - list[i]->lock(); - list[i]->retain(); - list[i]->unlock(); - lua_settable(L, -3); - } - delete[] list; - return 1; -} - -int w_getThread(lua_State *L) -{ - if (lua_isnoneornil(L, 1)) - { - lua_getglobal(L, "love"); - lua_getfield(L, -1, "_curthread"); - return 1; - } - std::string name = luax_checkstring(L, 1); - Thread *t = instance->getThread(name); - if (t) - { - luax_newtype(L, "Thread", THREAD_THREAD_T, (void *)t); - t->lock(); - t->retain(); - t->unlock(); - } - else - lua_pushnil(L); - return 1; -} - - -// List of functions to wrap. -static const luaL_Reg module_functions[] = -{ - { "newThread", w_newThread }, - { "getThread", w_getThread }, - { "getThreads", w_getThreads }, - { 0, 0 } -}; - -static const lua_CFunction types[] = -{ - luaopen_thread, - 0 -}; - -extern "C" int luaopen_love_thread(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new ThreadModule(); - lua_getglobal(L, "love"); - Thread *curthread = instance->getThread("main"); - curthread->lock(); - curthread->retain(); - curthread->unlock(); - luax_newtype(L, "Thread", THREAD_THREAD_T, (void *)curthread); - lua_setfield(L, -2, "_curthread"); - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "thread"; - w.flags = MODULE_T; - w.functions = module_functions; - w.types = types; - - return luax_register_module(L, w); -} - -} // thread -} // love +/** + * Copyright (c) 2006-2010 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Thread.h" + +namespace love +{ +namespace thread +{ + +Thread *luax_checkthread(lua_State *L, int idx) +{ + return luax_checktype(L, idx, "Thread", THREAD_THREAD_T); +} + +int w_Thread_start(lua_State *L) +{ + Thread *t = luax_checkthread(L, 1); + t->start(); + return 0; +} + +int w_Thread_wait(lua_State *L) +{ + Thread *t = luax_checkthread(L, 1); + t->wait(); + return 0; +} + +int w_Thread_getName(lua_State *L) +{ + Thread *t = luax_checkthread(L, 1); + // allow names containing \0 + luax_pushstring(L, t->getName()); + return 1; +} + + +int w_Thread_get(lua_State *L) +{ + Thread *t = luax_checkthread(L, 1); + std::string name = luax_checkstring(L, 2); + t->lock(); + Variant *v = t->get(name); + t->clear(name); + t->unlock(); + if (!v) + { + lua_pushnil(L); + return 1; + } + v->toLua(L); + t->lock(); + v->release(); + t->unlock(); + return 1; +} + +int w_Thread_getKeys(lua_State *L) +{ + Thread *t = luax_checkthread(L, 1); + t->lock(); + std::vector keys = t->getKeys(); + t->unlock(); + lua_createtable(L, keys.size(), 0); + int i = 1; + for (std::vector::iterator it = keys.begin(); it != keys.end(); it++) + { + lua_pushnumber(L, i++); + luax_pushstring(L, *it); + lua_settable(L, -3); + } + return 1; +} + +int w_Thread_demand(lua_State *L) +{ + Thread *t = luax_checkthread(L, 1); + std::string name = luax_checkstring(L, 2); + t->lock(); + Variant *v = t->demand(name); + t->clear(name); + t->unlock(); + if (!v) + { + lua_pushnil(L); + return 1; + } + v->toLua(L); + t->lock(); + v->release(); + t->unlock(); + return 1; +} + +int w_Thread_peek(lua_State *L) +{ + Thread *t = luax_checkthread(L, 1); + std::string name = luax_checkstring(L, 2); + t->lock(); + Variant *v = t->get(name); + t->unlock(); + if (!v) + { + lua_pushnil(L); + return 1; + } + v->toLua(L); + t->lock(); + v->release(); + t->unlock(); + return 1; +} + + +int w_Thread_set(lua_State *L) +{ + Thread *t = luax_checkthread(L, 1); + std::string name = luax_checkstring(L, 2); + Variant *v = Variant::fromLua(L, 3); + if (!v) + return luaL_error(L, "Expected boolean, number, string or userdata"); + t->set(name, v); + t->lock(); + v->release(); + t->unlock(); + return 0; +} + +static const luaL_Reg type_functions[] = +{ + { "start", w_Thread_start }, + { "wait", w_Thread_wait }, + { "getName", w_Thread_getName }, + { "get", w_Thread_get }, + { "getKeys", w_Thread_getKeys }, + { "demand", w_Thread_demand }, + { "peek", w_Thread_peek }, + { "set", w_Thread_set }, + { 0, 0 } +}; + +extern "C" int luaopen_thread(lua_State *L) +{ + return luax_register_type(L, "Thread", type_functions); +} + +static ThreadModule *instance; + +int w_newThread(lua_State *L) +{ + std::string name = luax_checkstring(L, 1); + love::Data *data; + if (lua_isstring(L, 2)) + luax_convobj(L, 2, "filesystem", "newFile"); + if (luax_istype(L, 2, FILESYSTEM_FILE_T)) + { + try + { + data = luax_checktype(L, 2, "File", FILESYSTEM_FILE_T)->read(); + } + catch(love::Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + { + data = luax_checktype(L, 2, "Data", DATA_T); + data->retain(); + } + Thread *t = instance->newThread(name, data); + // do not worry, file->read() returns retained data + data->release(); + if (!t) + return luaL_error(L, "A thread with that name already exists."); + luax_newtype(L, "Thread", THREAD_THREAD_T, (void *)t); + return 1; +} + +int w_getThreads(lua_State *L) +{ + unsigned count = instance->getThreadCount(); + Thread **list = new Thread*[count]; + instance->getThreads(list); + lua_newtable(L); + for (unsigned int i = 0; igetName()); + luax_newtype(L, "Thread", THREAD_THREAD_T, (void *) list[i]); + list[i]->lock(); + list[i]->retain(); + list[i]->unlock(); + lua_settable(L, -3); + } + delete[] list; + return 1; +} + +int w_getThread(lua_State *L) +{ + if (lua_isnoneornil(L, 1)) + { + lua_getglobal(L, "love"); + lua_getfield(L, -1, "_curthread"); + return 1; + } + std::string name = luax_checkstring(L, 1); + Thread *t = instance->getThread(name); + if (t) + { + luax_newtype(L, "Thread", THREAD_THREAD_T, (void *)t); + t->lock(); + t->retain(); + t->unlock(); + } + else + lua_pushnil(L); + return 1; +} + + +// List of functions to wrap. +static const luaL_Reg module_functions[] = +{ + { "newThread", w_newThread }, + { "getThread", w_getThread }, + { "getThreads", w_getThreads }, + { 0, 0 } +}; + +static const lua_CFunction types[] = +{ + luaopen_thread, + 0 +}; + +extern "C" int luaopen_love_thread(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new ThreadModule(); + lua_getglobal(L, "love"); + Thread *curthread = instance->getThread("main"); + curthread->lock(); + curthread->retain(); + curthread->unlock(); + luax_newtype(L, "Thread", THREAD_THREAD_T, (void *)curthread); + lua_setfield(L, -2, "_curthread"); + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "thread"; + w.flags = MODULE_T; + w.functions = module_functions; + w.types = types; + + return luax_register_module(L, w); +} + +} // thread +} // love diff --git a/src/modules/thread/wrap_Thread.h b/src/modules/thread/wrap_Thread.h index 403333598..6b77ad12a 100644 --- a/src/modules/thread/wrap_Thread.h +++ b/src/modules/thread/wrap_Thread.h @@ -1,54 +1,54 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_THREAD_SDL_WRAP_THREAD_H -#define LOVE_THREAD_SDL_WRAP_THREAD_H - -// LOVE -#include "common/config.h" -#include "Thread.h" - -namespace love -{ -namespace thread -{ - -Thread *luax_checkthread(lua_State *L, int idx); -int w_Thread_start(lua_State *L); -int w_Thread_wait(lua_State *L); -int w_Thread_getName(lua_State *L); -int w_Thread_get(lua_State *L); -int w_Thread_getKeys(lua_State *L); -int w_Thread_demand(lua_State *L); -int w_Thread_peek(lua_State *L); -int w_Thread_set(lua_State *L); - -extern "C" int luaopen_thread(lua_State *L); - -int w_newThread(lua_State *L); -int w_getThreads(lua_State *L); -int w_getThread(lua_State *L); - -extern "C" LOVE_EXPORT int luaopen_love_thread(lua_State *L); - -} // thread -} // love - -#endif // LOVE_THREAD_SDL_WRAP_THREAD_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_THREAD_SDL_WRAP_THREAD_H +#define LOVE_THREAD_SDL_WRAP_THREAD_H + +// LOVE +#include "common/config.h" +#include "Thread.h" + +namespace love +{ +namespace thread +{ + +Thread *luax_checkthread(lua_State *L, int idx); +int w_Thread_start(lua_State *L); +int w_Thread_wait(lua_State *L); +int w_Thread_getName(lua_State *L); +int w_Thread_get(lua_State *L); +int w_Thread_getKeys(lua_State *L); +int w_Thread_demand(lua_State *L); +int w_Thread_peek(lua_State *L); +int w_Thread_set(lua_State *L); + +extern "C" int luaopen_thread(lua_State *L); + +int w_newThread(lua_State *L); +int w_getThreads(lua_State *L); +int w_getThread(lua_State *L); + +extern "C" LOVE_EXPORT int luaopen_love_thread(lua_State *L); + +} // thread +} // love + +#endif // LOVE_THREAD_SDL_WRAP_THREAD_H diff --git a/src/modules/timer/Timer.h b/src/modules/timer/Timer.h index a957b8bee..3de8a4e7b 100644 --- a/src/modules/timer/Timer.h +++ b/src/modules/timer/Timer.h @@ -1,86 +1,86 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_TIMER_TIMER_H -#define LOVE_TIMER_TIMER_H - -// LOVE -#include "common/Module.h" - -namespace love -{ -namespace timer -{ - -class Timer : public Module -{ -public: - - /** - * Destructor. - **/ - virtual ~Timer() {} - - /** - * Measures the time between this call and the previous call, - * and updates internal values accordinly. - **/ - virtual void step() = 0; - - /** - * Tries to sleep for the specified amount of time. The precision is - * usually 1ms. - * @param seconds The number of seconds to sleep for. - **/ - virtual void sleep(double seconds) = 0; - - /** - * Gets the time between the last two frames, assuming step is called - * each frame. - **/ - virtual double getDelta() const = 0; - - /** - * Gets the average FPS over the last second. Beucase the value is only updated - * once per second, it does not look erratic when displayed on screen. - * @return The "current" FPS. - **/ - virtual int getFPS() const = 0; - - /** - * Gets the amount of time since the program started. Only useful for timing - * code or measuring intervals. - * @return The time (in seconds) since the program started. - **/ - virtual double getTime() const = 0; - - /** - * Gets the amount of time passed since an unspecified time. The time is accurate - * to the microsecond, and is limited to 24 hours. - * @return The time (in seconds) - **/ - virtual double getMicroTime() const = 0; - -}; // Timer - -} // timer -} // love - -#endif // LOVE_TIMER_TIMER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_TIMER_TIMER_H +#define LOVE_TIMER_TIMER_H + +// LOVE +#include "common/Module.h" + +namespace love +{ +namespace timer +{ + +class Timer : public Module +{ +public: + + /** + * Destructor. + **/ + virtual ~Timer() {} + + /** + * Measures the time between this call and the previous call, + * and updates internal values accordinly. + **/ + virtual void step() = 0; + + /** + * Tries to sleep for the specified amount of time. The precision is + * usually 1ms. + * @param seconds The number of seconds to sleep for. + **/ + virtual void sleep(double seconds) = 0; + + /** + * Gets the time between the last two frames, assuming step is called + * each frame. + **/ + virtual double getDelta() const = 0; + + /** + * Gets the average FPS over the last second. Beucase the value is only updated + * once per second, it does not look erratic when displayed on screen. + * @return The "current" FPS. + **/ + virtual int getFPS() const = 0; + + /** + * Gets the amount of time since the program started. Only useful for timing + * code or measuring intervals. + * @return The time (in seconds) since the program started. + **/ + virtual double getTime() const = 0; + + /** + * Gets the amount of time passed since an unspecified time. The time is accurate + * to the microsecond, and is limited to 24 hours. + * @return The time (in seconds) + **/ + virtual double getMicroTime() const = 0; + +}; // Timer + +} // timer +} // love + +#endif // LOVE_TIMER_TIMER_H diff --git a/src/modules/timer/sdl/Timer.cpp b/src/modules/timer/sdl/Timer.cpp index 81020ddeb..ce50ba32b 100644 --- a/src/modules/timer/sdl/Timer.cpp +++ b/src/modules/timer/sdl/Timer.cpp @@ -1,138 +1,138 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" -#include "common/delay.h" - -#ifdef LOVE_WINDOWS -# include -# include -#else -# include -#endif - -#include "Timer.h" - -namespace love -{ -namespace timer -{ -namespace sdl -{ - -Timer::Timer() - : currTime(0) - , prevFpsUpdate(0) - , fps(0) - , fpsUpdateFrequency(1) - , frames(0) - , dt(0) -{ - // Init the SDL timer system. - if (SDL_InitSubSystem(SDL_INIT_TIMER) < 0) - throw Exception(SDL_GetError()); -} - -Timer::~Timer() -{ - // Quit SDL timer. - SDL_QuitSubSystem(SDL_INIT_TIMER); -} - -const char *Timer::getName() const -{ - return "love.timer.sdl"; -} - -void Timer::step() -{ - // Frames rendered - frames++; - - // "Current" time is previous time by now. - prevTime = currTime; - - // Get ticks from SDL - currTime = SDL_GetTicks(); - - // Convert to number of seconds - dt = (currTime - prevTime)/1000.0; - - double timeSinceLast = (currTime - prevFpsUpdate)/1000.0; - // Update FPS? - if (timeSinceLast > fpsUpdateFrequency) - { - fps = int((frames/timeSinceLast) + 0.5); - prevFpsUpdate = currTime; - frames = 0; - } -} - -void Timer::sleep(double seconds) -{ - if (seconds > 0) - delay((int)(seconds*1000)); -} - -double Timer::getDelta() const -{ - return dt; -} - -int Timer::getFPS() const -{ - return fps; -} - -double Timer::getTime() const -{ - return SDL_GetTicks()/1000.0; -} - -double Timer::getMicroTime() const -{ -#ifdef LOVE_WINDOWS - static __int64 freq = 0; - - if (!freq) - { - LARGE_INTEGER temp; - QueryPerformanceFrequency(&temp); - - freq = (__int64) temp.QuadPart; - } - - LARGE_INTEGER microTime; - QueryPerformanceCounter(µTime); - - // The 64 to 32 bit integer conversion, assuming the fraction part down - // to microseconds takes 20 bits, should not be a problem unless the - // system has an uptime of a few decades. - return (double) microTime.QuadPart / (double) freq; -#else - timeval t; - gettimeofday(&t, NULL); - return t.tv_sec + t.tv_usec/1000000.0; -#endif -} - -} // sdl -} // timer -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" +#include "common/delay.h" + +#ifdef LOVE_WINDOWS +# include +# include +#else +# include +#endif + +#include "Timer.h" + +namespace love +{ +namespace timer +{ +namespace sdl +{ + +Timer::Timer() + : currTime(0) + , prevFpsUpdate(0) + , fps(0) + , fpsUpdateFrequency(1) + , frames(0) + , dt(0) +{ + // Init the SDL timer system. + if (SDL_InitSubSystem(SDL_INIT_TIMER) < 0) + throw Exception(SDL_GetError()); +} + +Timer::~Timer() +{ + // Quit SDL timer. + SDL_QuitSubSystem(SDL_INIT_TIMER); +} + +const char *Timer::getName() const +{ + return "love.timer.sdl"; +} + +void Timer::step() +{ + // Frames rendered + frames++; + + // "Current" time is previous time by now. + prevTime = currTime; + + // Get ticks from SDL + currTime = SDL_GetTicks(); + + // Convert to number of seconds + dt = (currTime - prevTime)/1000.0; + + double timeSinceLast = (currTime - prevFpsUpdate)/1000.0; + // Update FPS? + if (timeSinceLast > fpsUpdateFrequency) + { + fps = int((frames/timeSinceLast) + 0.5); + prevFpsUpdate = currTime; + frames = 0; + } +} + +void Timer::sleep(double seconds) +{ + if (seconds > 0) + delay((int)(seconds*1000)); +} + +double Timer::getDelta() const +{ + return dt; +} + +int Timer::getFPS() const +{ + return fps; +} + +double Timer::getTime() const +{ + return SDL_GetTicks()/1000.0; +} + +double Timer::getMicroTime() const +{ +#ifdef LOVE_WINDOWS + static __int64 freq = 0; + + if (!freq) + { + LARGE_INTEGER temp; + QueryPerformanceFrequency(&temp); + + freq = (__int64) temp.QuadPart; + } + + LARGE_INTEGER microTime; + QueryPerformanceCounter(µTime); + + // The 64 to 32 bit integer conversion, assuming the fraction part down + // to microseconds takes 20 bits, should not be a problem unless the + // system has an uptime of a few decades. + return (double) microTime.QuadPart / (double) freq; +#else + timeval t; + gettimeofday(&t, NULL); + return t.tv_sec + t.tv_usec/1000000.0; +#endif +} + +} // sdl +} // timer +} // love diff --git a/src/modules/timer/sdl/Timer.h b/src/modules/timer/sdl/Timer.h index 9342884d5..cc2490130 100644 --- a/src/modules/timer/sdl/Timer.h +++ b/src/modules/timer/sdl/Timer.h @@ -1,91 +1,91 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_TIMER_SDL_TIMER_H -#define LOVE_TIMER_SDL_TIMER_H - -// SDL -#include - -// LOVE -#include - -namespace love -{ -namespace timer -{ -namespace sdl -{ - -/** - * An SDL timer module. Can keep track of time between certain function - * calls, and provides access to a FPS metric which updates once each second. - **/ -class Timer : public love::timer::Timer -{ -public: - - /** - * Constructor. Initializes the SDL/timer subsystem. - **/ - Timer(); - - /** - * Destructor. - **/ - virtual ~Timer(); - - const char *getName() const; - void step(); - void sleep(double seconds); - double getDelta() const; - int getFPS() const; - double getTime() const; - double getMicroTime() const; - -private: - - // Timing vars for benchmarking. - Uint32 time_init; - - // Frame delta vars. - Uint32 currTime; - Uint32 prevTime; - Uint32 prevFpsUpdate; - - // Updated with a certain frequency. - int fps; - - // The frequency by which to update the FPS. - double fpsUpdateFrequency; - - // Frames since last FPS update. - int frames; - - // The current timestep. - double dt; - -}; // Timer - -} // sdl -} // timer -} // love - -#endif // LOVE_TIMER_SDL_TIMER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_TIMER_SDL_TIMER_H +#define LOVE_TIMER_SDL_TIMER_H + +// SDL +#include + +// LOVE +#include + +namespace love +{ +namespace timer +{ +namespace sdl +{ + +/** + * An SDL timer module. Can keep track of time between certain function + * calls, and provides access to a FPS metric which updates once each second. + **/ +class Timer : public love::timer::Timer +{ +public: + + /** + * Constructor. Initializes the SDL/timer subsystem. + **/ + Timer(); + + /** + * Destructor. + **/ + virtual ~Timer(); + + const char *getName() const; + void step(); + void sleep(double seconds); + double getDelta() const; + int getFPS() const; + double getTime() const; + double getMicroTime() const; + +private: + + // Timing vars for benchmarking. + Uint32 time_init; + + // Frame delta vars. + Uint32 currTime; + Uint32 prevTime; + Uint32 prevFpsUpdate; + + // Updated with a certain frequency. + int fps; + + // The frequency by which to update the FPS. + double fpsUpdateFrequency; + + // Frames since last FPS update. + int frames; + + // The current timestep. + double dt; + +}; // Timer + +} // sdl +} // timer +} // love + +#endif // LOVE_TIMER_SDL_TIMER_H diff --git a/src/modules/timer/wrap_Timer.cpp b/src/modules/timer/wrap_Timer.cpp index 3ff280620..79a5dc88e 100644 --- a/src/modules/timer/wrap_Timer.cpp +++ b/src/modules/timer/wrap_Timer.cpp @@ -1,112 +1,112 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#include "common/config.h" - -// LOVE -#include "wrap_Timer.h" - -#include "sdl/Timer.h" - -namespace love -{ -namespace timer -{ - -static Timer *instance = 0; - -int w_step(lua_State *) -{ - instance->step(); - return 0; -} - -int w_getDelta(lua_State *L) -{ - lua_pushnumber(L, instance->getDelta()); - return 1; -} - -int w_getFPS(lua_State *L) -{ - lua_pushnumber(L, instance->getFPS()); - return 1; -} - -int w_sleep(lua_State *L) -{ - instance->sleep((float) luaL_checknumber(L, 1)); - return 0; -} - -int w_getTime(lua_State *L) -{ - lua_pushnumber(L, instance->getTime()); - return 1; -} - -int w_getMicroTime(lua_State *L) -{ - lua_pushnumber(L, instance->getMicroTime()); - return 1; -} - -// List of functions to wrap. -static const luaL_Reg functions[] = -{ - { "step", w_step }, - { "getDelta", w_getDelta }, - { "getFPS", w_getFPS }, - { "sleep", w_sleep }, - { "getTime", w_getTime }, - { "getMicroTime", w_getMicroTime }, - { 0, 0 } -}; - - -extern "C" int luaopen_love_timer(lua_State *L) -{ - if (instance == 0) - { - try - { - instance = new love::timer::sdl::Timer(); - - } - catch(Exception &e) - { - return luaL_error(L, e.what()); - } - } - else - instance->retain(); - - WrappedModule w; - w.module = instance; - w.name = "timer"; - w.flags = MODULE_T; - w.functions = functions; - w.types = 0; - - return luax_register_module(L, w); -} - -} // timer -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "common/config.h" + +// LOVE +#include "wrap_Timer.h" + +#include "sdl/Timer.h" + +namespace love +{ +namespace timer +{ + +static Timer *instance = 0; + +int w_step(lua_State *) +{ + instance->step(); + return 0; +} + +int w_getDelta(lua_State *L) +{ + lua_pushnumber(L, instance->getDelta()); + return 1; +} + +int w_getFPS(lua_State *L) +{ + lua_pushnumber(L, instance->getFPS()); + return 1; +} + +int w_sleep(lua_State *L) +{ + instance->sleep((float) luaL_checknumber(L, 1)); + return 0; +} + +int w_getTime(lua_State *L) +{ + lua_pushnumber(L, instance->getTime()); + return 1; +} + +int w_getMicroTime(lua_State *L) +{ + lua_pushnumber(L, instance->getMicroTime()); + return 1; +} + +// List of functions to wrap. +static const luaL_Reg functions[] = +{ + { "step", w_step }, + { "getDelta", w_getDelta }, + { "getFPS", w_getFPS }, + { "sleep", w_sleep }, + { "getTime", w_getTime }, + { "getMicroTime", w_getMicroTime }, + { 0, 0 } +}; + + +extern "C" int luaopen_love_timer(lua_State *L) +{ + if (instance == 0) + { + try + { + instance = new love::timer::sdl::Timer(); + + } + catch(Exception &e) + { + return luaL_error(L, e.what()); + } + } + else + instance->retain(); + + WrappedModule w; + w.module = instance; + w.name = "timer"; + w.flags = MODULE_T; + w.functions = functions; + w.types = 0; + + return luax_register_module(L, w); +} + +} // timer +} // love diff --git a/src/modules/timer/wrap_Timer.h b/src/modules/timer/wrap_Timer.h index 8a1fe86ea..5afad2786 100644 --- a/src/modules/timer/wrap_Timer.h +++ b/src/modules/timer/wrap_Timer.h @@ -1,43 +1,43 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_TIMER_WRAP_TIMER_H -#define LOVE_TIMER_WRAP_TIMER_H - -// LOVE -#include "Timer.h" - -namespace love -{ -namespace timer -{ - -int w_step(lua_State *L); -int w_getDelta(lua_State *L); -int w_getFPS(lua_State *L); -int w_sleep(lua_State *L); -int w_getTime(lua_State *L); -int w_getMicroTime(lua_State *L); -extern "C" LOVE_EXPORT int luaopen_love_timer(lua_State *L); - -} // timer -} // love - -#endif // LOVE_TIMER_WRAP_TIMER_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_TIMER_WRAP_TIMER_H +#define LOVE_TIMER_WRAP_TIMER_H + +// LOVE +#include "Timer.h" + +namespace love +{ +namespace timer +{ + +int w_step(lua_State *L); +int w_getDelta(lua_State *L); +int w_getFPS(lua_State *L); +int w_sleep(lua_State *L); +int w_getTime(lua_State *L); +int w_getMicroTime(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_timer(lua_State *L); + +} // timer +} // love + +#endif // LOVE_TIMER_WRAP_TIMER_H diff --git a/src/modules/window/Window.cpp b/src/modules/window/Window.cpp index 01150835e..4de7feb55 100644 --- a/src/modules/window/Window.cpp +++ b/src/modules/window/Window.cpp @@ -1,42 +1,42 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// LOVE -#include "Window.h" - -namespace love -{ -namespace window -{ - -Window *Window::singleton = NULL; - -Window::~Window() -{ - if (singleton == this) - singleton = NULL; -} - -void Window::swapBuffers() -{ -} - -} // window -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// LOVE +#include "Window.h" + +namespace love +{ +namespace window +{ + +Window *Window::singleton = NULL; + +Window::~Window() +{ + if (singleton == this) + singleton = NULL; +} + +void Window::swapBuffers() +{ +} + +} // window +} // love diff --git a/src/modules/window/Window.h b/src/modules/window/Window.h index bf9503141..eadb87254 100644 --- a/src/modules/window/Window.h +++ b/src/modules/window/Window.h @@ -1,80 +1,80 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_WINDOW_WINDOW_H -#define LOVE_WINDOW_WINDOW_H - -// STL -#include - -// LOVE -#include "common/Module.h" -#include - -namespace love -{ -namespace window -{ - -class Window : public Module -{ -public: - struct WindowSize - { - int width; - int height; - }; - - virtual ~Window(); - - virtual bool setWindow(int width = 800, int height = 600, bool fullscreen = false, bool vsync = true, int fsaa = 0) = 0; - virtual void getWindow(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa) = 0; - - virtual bool checkWindowSize(int width, int height, bool fullscreen) = 0; - virtual WindowSize **getFullscreenSizes(int &n) = 0; - - virtual int getWidth() = 0; - virtual int getHeight() = 0; - - virtual bool isCreated() = 0; - - virtual void setWindowTitle(std::string &title) = 0; - virtual std::string getWindowTitle() = 0; - - virtual bool setIcon(love::image::ImageData *imgd) = 0; - - // default no-op implementation - virtual void swapBuffers(); - - virtual bool hasFocus() = 0; - virtual void setMouseVisible(bool visible) = 0; - virtual bool getMouseVisible() = 0; - - //virtual static Window *getSingleton() = 0; - // No virtual statics, of course, but you are supposed to implement this static. - -protected: - static Window *singleton; - -}; // Window -} // window -} // love - -#endif // LOVE_WINDOW_WINDOW_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_WINDOW_WINDOW_H +#define LOVE_WINDOW_WINDOW_H + +// STL +#include + +// LOVE +#include "common/Module.h" +#include + +namespace love +{ +namespace window +{ + +class Window : public Module +{ +public: + struct WindowSize + { + int width; + int height; + }; + + virtual ~Window(); + + virtual bool setWindow(int width = 800, int height = 600, bool fullscreen = false, bool vsync = true, int fsaa = 0) = 0; + virtual void getWindow(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa) = 0; + + virtual bool checkWindowSize(int width, int height, bool fullscreen) = 0; + virtual WindowSize **getFullscreenSizes(int &n) = 0; + + virtual int getWidth() = 0; + virtual int getHeight() = 0; + + virtual bool isCreated() = 0; + + virtual void setWindowTitle(std::string &title) = 0; + virtual std::string getWindowTitle() = 0; + + virtual bool setIcon(love::image::ImageData *imgd) = 0; + + // default no-op implementation + virtual void swapBuffers(); + + virtual bool hasFocus() = 0; + virtual void setMouseVisible(bool visible) = 0; + virtual bool getMouseVisible() = 0; + + //virtual static Window *getSingleton() = 0; + // No virtual statics, of course, but you are supposed to implement this static. + +protected: + static Window *singleton; + +}; // Window +} // window +} // love + +#endif // LOVE_WINDOW_WINDOW_H diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index be8040d60..39e812725 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -1,309 +1,309 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -// STL -#include - -// SDL -#include - -// OpenGL -#include - -// LOVE -#include "common/config.h" -#include "Window.h" - -namespace love -{ -namespace window -{ -namespace sdl -{ - -Window::Window() - : windowTitle("") - , created(false) - , mouseVisible(true) -{ - // Window should be centered. - SDL_putenv(const_cast("SDL_VIDEO_CENTERED=center")); - - if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) - throw Exception(SDL_GetError()); -} - -Window::~Window() -{ - SDL_QuitSubSystem(SDL_INIT_VIDEO); -} - -Window::_currentMode::_currentMode() - : width(800), height(600), fullscreen(false), vsync(true), fsaa(0) -{ -} - -bool Window::setWindow(int width, int height, bool fullscreen, bool vsync, int fsaa) -{ - bool mouseVisible = getMouseVisible(); - - // We need to restart the subsystem for two reasons: - // 1) Special case for fullscreen -> windowed. Windows XP did not - // work well with "normal" display mode change in this case. - // The application window does leave fullscreen, but the desktop - // resolution does not revert to the correct one. Restarting the - // SDL video subsystem does the trick, though. - // 2) Restart the event system (for whatever reason the event system - // started and stopped with SDL_INIT_VIDEO, see: - // http://sdl.beuc.net/sdl.wiki/Introduction_to_Events) - // because the mouse position will not be able to exceed - // the previous' video mode window size (i.e. alway - // love.mouse.getX() < 800 when switching from 800x600 to a - // higher resolution) - SDL_QuitSubSystem(SDL_INIT_VIDEO); - if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) - { - std::cout << "Could not init SDL_VIDEO: " << SDL_GetError() << std::endl; - return false; - } - - // Set caption. - setWindowTitle(windowTitle); - setMouseVisible(mouseVisible); - - // Set GL attributes - SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vsync ? 1 : 0)); - SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1); - - // FSAA - if (fsaa > 0) - { - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, fsaa); - } - - // Fullscreen? - Uint32 sdlflags = fullscreen ? (SDL_OPENGL | SDL_FULLSCREEN) : SDL_OPENGL; - - // Have SDL set the video mode. - if (SDL_SetVideoMode(width, height, 32, sdlflags) == 0) - { - bool failed = true; - if (fsaa > 0) - { - // FSAA might have failed, disable it and try again - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0); - failed = SDL_SetVideoMode(width, height, 32, sdlflags) == 0; - if (failed) - { - // There might be no FSAA at all - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); - failed = SDL_SetVideoMode(width, height, 32, sdlflags) == 0; - } - } - if (failed) - { - std::cerr << "Could not set video mode: " << SDL_GetError() << std::endl; - return false; - } - } - - created = true; - - if (width == 0 || height == 0) - { - const SDL_VideoInfo *videoinfo = SDL_GetVideoInfo(); - width = videoinfo->current_w; - height = videoinfo->current_h; - } - - if (fsaa > 0) - glEnable(GL_MULTISAMPLE); - - GLint buffers; - GLint samples; - - glGetIntegerv(GL_SAMPLE_BUFFERS_ARB, &buffers); - glGetIntegerv(GL_SAMPLES_ARB, &samples); - - // Don't fail because of this, but issue a warning. - if ((!buffers && fsaa) || (samples != fsaa)) - { - std::cerr << "Warning, quality setting failed! (Result: buffers: " << buffers << ", samples: " << samples << ")" << std::endl; - fsaa = !buffers ? 0 : samples; - } - - // Get the actual vsync status - int real_vsync; - SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &real_vsync); - - // Set the new display mode as the current display mode. - currentMode.width = width; - currentMode.height = height; - currentMode.fsaa = fsaa; - currentMode.fullscreen = fullscreen; - currentMode.vsync = (real_vsync != 0); - - return true; -} - -void Window::getWindow(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa) -{ - width = currentMode.width; - height = currentMode.height; - fullscreen = currentMode.fullscreen; - vsync = currentMode.vsync; - fsaa = currentMode.fsaa; -} - -bool Window::checkWindowSize(int width, int height, bool fullscreen) -{ - Uint32 sdlflags = fullscreen ? (SDL_OPENGL | SDL_FULLSCREEN) : SDL_OPENGL; - - // Check if mode is supported - int bpp = SDL_VideoModeOK(width, height, 32, sdlflags); - - return (bpp >= 16); -} - -typedef Window::WindowSize WindowSize; - -WindowSize **Window::getFullscreenSizes(int &n) -{ - SDL_Rect **modes = SDL_ListModes(0, SDL_OPENGL | SDL_FULLSCREEN); - - if (modes == (SDL_Rect **)0 || modes == (SDL_Rect **)-1) - { - n = 0; - return NULL; - } - - n = 0; - for (int i = 0; modes[i]; i++) - n++; - - WindowSize **sizes = new WindowSize*[n]; - - for (int i = 0; i < n; i++) - { - sizes[i] = new WindowSize; - sizes[i]->width = modes[i]->w; - sizes[i]->height = modes[i]->h; - } - return sizes; -} - -int Window::getWidth() -{ - return currentMode.width; -} - -int Window::getHeight() -{ - return currentMode.height; -} - -bool Window::isCreated() -{ - return created; -} - -void Window::setWindowTitle(std::string &title) -{ - windowTitle = title; - SDL_WM_SetCaption(windowTitle.c_str(), 0); -} - -std::string Window::getWindowTitle() -{ - // not a reference - // because we want this untouched - // const std::string& might be an option - return windowTitle; -} - -bool Window::setIcon(love::image::ImageData *imgd) -{ - Uint32 rmask, gmask, bmask, amask; -#ifdef LOVE_BIG_ENDIAN - rmask = 0xFF000000; - gmask = 0x00FF0000; - bmask = 0x0000FF00; - amask = 0x000000FF; -#else - rmask = 0x000000FF; - gmask = 0x0000FF00; - bmask = 0x00FF0000; - amask = 0xFF000000; -#endif - - int w = static_cast(imgd->getWidth()); - int h = static_cast(imgd->getHeight()); - int pitch = static_cast(imgd->getWidth() * 4); - - SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(imgd->getData(), w, h, 32, pitch, rmask, gmask, bmask, amask); - SDL_WM_SetIcon(icon, NULL); - SDL_FreeSurface(icon); - return true; -} - -void Window::swapBuffers() -{ - SDL_GL_SwapBuffers(); -} - -bool Window::hasFocus() -{ - return (SDL_GetAppState() & SDL_APPINPUTFOCUS) != 0; -} - -void Window::setMouseVisible(bool visible) -{ - SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE); -} - -bool Window::getMouseVisible() -{ - return (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE) ? true : false; -} - -love::window::Window *Window::getSingleton() -{ - if (!singleton) - singleton = new Window(); - else - singleton->retain(); - - return singleton; -} - -const char *Window::getName() const -{ - return "love.window.sdl"; -} - -} // sdl -} // window -} // love +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +// STL +#include + +// SDL +#include + +// OpenGL +#include + +// LOVE +#include "common/config.h" +#include "Window.h" + +namespace love +{ +namespace window +{ +namespace sdl +{ + +Window::Window() + : windowTitle("") + , created(false) + , mouseVisible(true) +{ + // Window should be centered. + SDL_putenv(const_cast("SDL_VIDEO_CENTERED=center")); + + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) + throw Exception(SDL_GetError()); +} + +Window::~Window() +{ + SDL_QuitSubSystem(SDL_INIT_VIDEO); +} + +Window::_currentMode::_currentMode() + : width(800), height(600), fullscreen(false), vsync(true), fsaa(0) +{ +} + +bool Window::setWindow(int width, int height, bool fullscreen, bool vsync, int fsaa) +{ + bool mouseVisible = getMouseVisible(); + + // We need to restart the subsystem for two reasons: + // 1) Special case for fullscreen -> windowed. Windows XP did not + // work well with "normal" display mode change in this case. + // The application window does leave fullscreen, but the desktop + // resolution does not revert to the correct one. Restarting the + // SDL video subsystem does the trick, though. + // 2) Restart the event system (for whatever reason the event system + // started and stopped with SDL_INIT_VIDEO, see: + // http://sdl.beuc.net/sdl.wiki/Introduction_to_Events) + // because the mouse position will not be able to exceed + // the previous' video mode window size (i.e. alway + // love.mouse.getX() < 800 when switching from 800x600 to a + // higher resolution) + SDL_QuitSubSystem(SDL_INIT_VIDEO); + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) + { + std::cout << "Could not init SDL_VIDEO: " << SDL_GetError() << std::endl; + return false; + } + + // Set caption. + setWindowTitle(windowTitle); + setMouseVisible(mouseVisible); + + // Set GL attributes + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vsync ? 1 : 0)); + SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1); + + // FSAA + if (fsaa > 0) + { + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, fsaa); + } + + // Fullscreen? + Uint32 sdlflags = fullscreen ? (SDL_OPENGL | SDL_FULLSCREEN) : SDL_OPENGL; + + // Have SDL set the video mode. + if (SDL_SetVideoMode(width, height, 32, sdlflags) == 0) + { + bool failed = true; + if (fsaa > 0) + { + // FSAA might have failed, disable it and try again + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0); + failed = SDL_SetVideoMode(width, height, 32, sdlflags) == 0; + if (failed) + { + // There might be no FSAA at all + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); + failed = SDL_SetVideoMode(width, height, 32, sdlflags) == 0; + } + } + if (failed) + { + std::cerr << "Could not set video mode: " << SDL_GetError() << std::endl; + return false; + } + } + + created = true; + + if (width == 0 || height == 0) + { + const SDL_VideoInfo *videoinfo = SDL_GetVideoInfo(); + width = videoinfo->current_w; + height = videoinfo->current_h; + } + + if (fsaa > 0) + glEnable(GL_MULTISAMPLE); + + GLint buffers; + GLint samples; + + glGetIntegerv(GL_SAMPLE_BUFFERS_ARB, &buffers); + glGetIntegerv(GL_SAMPLES_ARB, &samples); + + // Don't fail because of this, but issue a warning. + if ((!buffers && fsaa) || (samples != fsaa)) + { + std::cerr << "Warning, quality setting failed! (Result: buffers: " << buffers << ", samples: " << samples << ")" << std::endl; + fsaa = !buffers ? 0 : samples; + } + + // Get the actual vsync status + int real_vsync; + SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &real_vsync); + + // Set the new display mode as the current display mode. + currentMode.width = width; + currentMode.height = height; + currentMode.fsaa = fsaa; + currentMode.fullscreen = fullscreen; + currentMode.vsync = (real_vsync != 0); + + return true; +} + +void Window::getWindow(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa) +{ + width = currentMode.width; + height = currentMode.height; + fullscreen = currentMode.fullscreen; + vsync = currentMode.vsync; + fsaa = currentMode.fsaa; +} + +bool Window::checkWindowSize(int width, int height, bool fullscreen) +{ + Uint32 sdlflags = fullscreen ? (SDL_OPENGL | SDL_FULLSCREEN) : SDL_OPENGL; + + // Check if mode is supported + int bpp = SDL_VideoModeOK(width, height, 32, sdlflags); + + return (bpp >= 16); +} + +typedef Window::WindowSize WindowSize; + +WindowSize **Window::getFullscreenSizes(int &n) +{ + SDL_Rect **modes = SDL_ListModes(0, SDL_OPENGL | SDL_FULLSCREEN); + + if (modes == (SDL_Rect **)0 || modes == (SDL_Rect **)-1) + { + n = 0; + return NULL; + } + + n = 0; + for (int i = 0; modes[i]; i++) + n++; + + WindowSize **sizes = new WindowSize*[n]; + + for (int i = 0; i < n; i++) + { + sizes[i] = new WindowSize; + sizes[i]->width = modes[i]->w; + sizes[i]->height = modes[i]->h; + } + return sizes; +} + +int Window::getWidth() +{ + return currentMode.width; +} + +int Window::getHeight() +{ + return currentMode.height; +} + +bool Window::isCreated() +{ + return created; +} + +void Window::setWindowTitle(std::string &title) +{ + windowTitle = title; + SDL_WM_SetCaption(windowTitle.c_str(), 0); +} + +std::string Window::getWindowTitle() +{ + // not a reference + // because we want this untouched + // const std::string& might be an option + return windowTitle; +} + +bool Window::setIcon(love::image::ImageData *imgd) +{ + Uint32 rmask, gmask, bmask, amask; +#ifdef LOVE_BIG_ENDIAN + rmask = 0xFF000000; + gmask = 0x00FF0000; + bmask = 0x0000FF00; + amask = 0x000000FF; +#else + rmask = 0x000000FF; + gmask = 0x0000FF00; + bmask = 0x00FF0000; + amask = 0xFF000000; +#endif + + int w = static_cast(imgd->getWidth()); + int h = static_cast(imgd->getHeight()); + int pitch = static_cast(imgd->getWidth() * 4); + + SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(imgd->getData(), w, h, 32, pitch, rmask, gmask, bmask, amask); + SDL_WM_SetIcon(icon, NULL); + SDL_FreeSurface(icon); + return true; +} + +void Window::swapBuffers() +{ + SDL_GL_SwapBuffers(); +} + +bool Window::hasFocus() +{ + return (SDL_GetAppState() & SDL_APPINPUTFOCUS) != 0; +} + +void Window::setMouseVisible(bool visible) +{ + SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE); +} + +bool Window::getMouseVisible() +{ + return (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE) ? true : false; +} + +love::window::Window *Window::getSingleton() +{ + if (!singleton) + singleton = new Window(); + else + singleton->retain(); + + return singleton; +} + +const char *Window::getName() const +{ + return "love.window.sdl"; +} + +} // sdl +} // window +} // love diff --git a/src/modules/window/sdl/Window.h b/src/modules/window/sdl/Window.h index a552241e2..52bb9279b 100644 --- a/src/modules/window/sdl/Window.h +++ b/src/modules/window/sdl/Window.h @@ -1,84 +1,84 @@ -/** - * Copyright (c) 2006-2012 LOVE Development Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_WINDOW_SDL_WINDOW_H -#define LOVE_WINDOW_SDL_WINDOW_H - -// LOVE -#include - -namespace love -{ -namespace window -{ -namespace sdl -{ - -class Window : public love::window::Window -{ -public: - Window(); - ~Window(); - - bool setWindow(int width = 800, int height = 600, bool fullscreen = false, bool vsync = true, int fsaa = 0); - void getWindow(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa); - - bool checkWindowSize(int width, int height, bool fullscreen); - WindowSize **getFullscreenSizes(int &n); - - int getWidth(); - int getHeight(); - - bool isCreated(); - - void setWindowTitle(std::string &title); - std::string getWindowTitle(); - - bool setIcon(love::image::ImageData *imgd); - - void swapBuffers(); - - bool hasFocus(); - void setMouseVisible(bool visible); - bool getMouseVisible(); - - static love::window::Window *getSingleton(); - - const char *getName() const; -private: - std::string windowTitle; - struct _currentMode - { - _currentMode(); - int width; - int height; - bool fullscreen; - bool vsync; - int fsaa; - } currentMode; - bool created; - bool mouseVisible; -}; // Window - -} // sdl -} // window -} // love - -#endif // LOVE_WINDOW_WINDOW_H +/** + * Copyright (c) 2006-2012 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_WINDOW_SDL_WINDOW_H +#define LOVE_WINDOW_SDL_WINDOW_H + +// LOVE +#include + +namespace love +{ +namespace window +{ +namespace sdl +{ + +class Window : public love::window::Window +{ +public: + Window(); + ~Window(); + + bool setWindow(int width = 800, int height = 600, bool fullscreen = false, bool vsync = true, int fsaa = 0); + void getWindow(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa); + + bool checkWindowSize(int width, int height, bool fullscreen); + WindowSize **getFullscreenSizes(int &n); + + int getWidth(); + int getHeight(); + + bool isCreated(); + + void setWindowTitle(std::string &title); + std::string getWindowTitle(); + + bool setIcon(love::image::ImageData *imgd); + + void swapBuffers(); + + bool hasFocus(); + void setMouseVisible(bool visible); + bool getMouseVisible(); + + static love::window::Window *getSingleton(); + + const char *getName() const; +private: + std::string windowTitle; + struct _currentMode + { + _currentMode(); + int width; + int height; + bool fullscreen; + bool vsync; + int fsaa; + } currentMode; + bool created; + bool mouseVisible; +}; // Window + +} // sdl +} // window +} // love + +#endif // LOVE_WINDOW_WINDOW_H diff --git a/src/scripts/audio.lua b/src/scripts/audio.lua index 99670cb0d..18d672d38 100644 --- a/src/scripts/audio.lua +++ b/src/scripts/audio.lua @@ -1,41 +1,41 @@ ---[[ -Copyright (c) 2006-2012 LOVE Development Team - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. ---]] - -function love.audio.newSource(a, b) - if type(a) == "string" then - a = love.filesystem.newFile(a) - end - if type(a) == "userdata" then - if a:typeOf("File") then - a = love.sound.newDecoder(a) - end - - if a:typeOf("Decoder") then - if b == "static" then - a = love.sound.newSoundData(a) - end - return love.audio.newSource1(a) - end - if a:typeOf("SoundData") then - return love.audio.newSource1(a) - end - end - error("No matching overload") +--[[ +Copyright (c) 2006-2012 LOVE Development Team + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +--]] + +function love.audio.newSource(a, b) + if type(a) == "string" then + a = love.filesystem.newFile(a) + end + if type(a) == "userdata" then + if a:typeOf("File") then + a = love.sound.newDecoder(a) + end + + if a:typeOf("Decoder") then + if b == "static" then + a = love.sound.newSoundData(a) + end + return love.audio.newSource1(a) + end + if a:typeOf("SoundData") then + return love.audio.newSource1(a) + end + end + error("No matching overload") end \ No newline at end of file diff --git a/src/scripts/auto.lua b/src/scripts/auto.lua index 2fb6cd148..80ed973f6 100644 --- a/src/scripts/auto.lua +++ b/src/scripts/auto.lua @@ -1,116 +1,116 @@ --- Usage: --- lua auto.lua .. --- --- Example: --- lua auto.lua boot graphics - -local max_width = 18 -local pattern = [[ -/** -* Copyright (c) 2006-2012 LOVE Development Team -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -**/ - -namespace love -{ - -// [%s] -const unsigned char %s[] = -{ -%s -}; // [%s] -} // love]] ---formatting parameters: --- - input file name --- - c variable name --- - array contents --- - input file name - - -function auto(name) - --the input file name - local src = name .. ".lua" - --and the output one - local dst = name .. ".lua.h" - --the name of the variable - local cpp_name = name .. "_lua" - - --do a minimal code check - --(syntax errors, really) - loadfile(src) - --no error catching? no - --we have the main loop doing that for us - - --what character is this on this line? - local counter = 0 - - local function tohex(c) - counter = counter + 1 - --if we've reached the maximum width (or 0) - --then we'll carry on and add a newline - if counter % max_width == 0 then - return ("\n\t0x%02x, "):format(c:byte()) - end - --otherwise we just use the hex of the current byte - return ("0x%02x, "):format(c:byte()) - end - - --let's open the input file - local src_file = io.open(src, "rb") - --create an output string - local out_data = "" - --go through the input file line-by-line - for line in src_file:lines() do - --if the line is non-empty - if #line > 0 then - --set the counter to -1 - --this will start a new line (see tohex) - counter = -1 - --append the output to what we had, plus a newline character (0x0a is newline) - out_data = ("%s%s0x0a,"):format(out_data, line:gsub("\r", ""):gsub(".", tohex)) - end - end - --close our input - src_file:close() - - --open, write and close the output - out_file = io.open(dst, "wb") - --see pattern above - out_file:write(pattern:format(src, cpp_name, out_data, src)) - out_file:close() - - --tell the world we succeeded! - print(name .. ": Success") -end - ---usage -if #arg == 0 then - return print("Usage: lua auto.lua .. ") -end - ---the 'main' procedure -for i, v in ipairs(arg) do - --run the auto function for every argument - --but do it with pcall, to catch errors - local ok, err = pcall(auto, v:gsub("%.lua$","")) - if not ok then - --inform people we've failed - print(v .. ": " .. err) - end -end - +-- Usage: +-- lua auto.lua .. +-- +-- Example: +-- lua auto.lua boot graphics + +local max_width = 18 +local pattern = [[ +/** +* Copyright (c) 2006-2012 LOVE Development Team +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +**/ + +namespace love +{ + +// [%s] +const unsigned char %s[] = +{ +%s +}; // [%s] +} // love]] +--formatting parameters: +-- - input file name +-- - c variable name +-- - array contents +-- - input file name + + +function auto(name) + --the input file name + local src = name .. ".lua" + --and the output one + local dst = name .. ".lua.h" + --the name of the variable + local cpp_name = name .. "_lua" + + --do a minimal code check + --(syntax errors, really) + loadfile(src) + --no error catching? no + --we have the main loop doing that for us + + --what character is this on this line? + local counter = 0 + + local function tohex(c) + counter = counter + 1 + --if we've reached the maximum width (or 0) + --then we'll carry on and add a newline + if counter % max_width == 0 then + return ("\n\t0x%02x, "):format(c:byte()) + end + --otherwise we just use the hex of the current byte + return ("0x%02x, "):format(c:byte()) + end + + --let's open the input file + local src_file = io.open(src, "rb") + --create an output string + local out_data = "" + --go through the input file line-by-line + for line in src_file:lines() do + --if the line is non-empty + if #line > 0 then + --set the counter to -1 + --this will start a new line (see tohex) + counter = -1 + --append the output to what we had, plus a newline character (0x0a is newline) + out_data = ("%s%s0x0a,"):format(out_data, line:gsub("\r", ""):gsub(".", tohex)) + end + end + --close our input + src_file:close() + + --open, write and close the output + out_file = io.open(dst, "wb") + --see pattern above + out_file:write(pattern:format(src, cpp_name, out_data, src)) + out_file:close() + + --tell the world we succeeded! + print(name .. ": Success") +end + +--usage +if #arg == 0 then + return print("Usage: lua auto.lua .. ") +end + +--the 'main' procedure +for i, v in ipairs(arg) do + --run the auto function for every argument + --but do it with pcall, to catch errors + local ok, err = pcall(auto, v:gsub("%.lua$","")) + if not ok then + --inform people we've failed + print(v .. ": " .. err) + end +end + diff --git a/src/scripts/boot.lua b/src/scripts/boot.lua index dd15862bd..eee219e60 100644 --- a/src/scripts/boot.lua +++ b/src/scripts/boot.lua @@ -1,817 +1,817 @@ ---[[ -Copyright (c) 2006-2012 LOVE Development Team - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. ---]] - --- Make sure love table exists. -if not love then love = {} end - --- Used for setup: -love.path = {} -love.arg = {} - --- Unparsed arguments: -argv = {} - --- Replace any \ with /. -function love.path.normalslashes(p) - return string.gsub(p, "\\", "/") -end - --- Makes sure there is a slash at the end --- of a path. -function love.path.endslash(p) - if string.sub(p, string.len(p)-1) ~= "/" then - return p .. "/" - else - return p - end -end - --- Checks whether a path is absolute or not. -function love.path.abs(p) - - local tmp = love.path.normalslashes(p) - - -- Path is absolute if it starts with a "/". - if string.find(tmp, "/") == 1 then - return true - end - - -- Path is absolute if it starts with a - -- letter followed by a colon. - if string.find(tmp, "%a:") == 1 then - return true - end - - -- Relative. - return false - -end - --- Converts any path into a full path. -function love.path.getfull(p) - - if love.path.abs(p) then - return love.path.normalslashes(p) - end - - local cwd = love.filesystem.getWorkingDirectory() - cwd = love.path.normalslashes(cwd) - cwd = love.path.endslash(cwd) - - -- Construct a full path. - local full = cwd .. love.path.normalslashes(p) - - -- Remove trailing /., if applicable - return full:match("(.-)/%.$") or full -end - --- Returns the leaf of a full path. -function love.path.leaf(p) - local a = 1 - local last = p - - while a do - a = string.find(p, "/", a+1) - - if a then - last = string.sub(p, a+1) - end - end - - return last -end - --- Finds the key in the table with the lowest integral index. The lowest --- will typically the executable, for instance "lua5.1.exe". -function love.arg.getLow(a) - local m = math.huge - for k,v in pairs(a) do - if k < m then - m = k - end - end - return a[m] -end - -love.arg.options = { - console = { a = 0 }, - fused = {a = 0 }, - game = { a = 1 } -} - -function love.arg.parse_option(m, i) - m.set = true - - if m.a > 0 then - m.arg = {} - for j=i,i+m.a-1 do - table.insert(m.arg, arg[j]) - i = j - end - end - - return i -end - -function love.arg.parse_options() - - local game - local argc = #arg - - for i=1,argc do - -- Look for options. - local s, e, m = string.find(arg[i], "%-%-(.+)") - - if m and love.arg.options[m] then - i = love.arg.parse_option(love.arg.options[m], i+1) - elseif not game then - game = i - end - end - - if not love.arg.options.game.set then - love.arg.parse_option(love.arg.options.game, game or 0) - end -end - -function love.createhandlers() - - -- Standard callback handlers. - love.handlers = setmetatable({ - keypressed = function (b, u) - if love.keypressed then love.keypressed(b, u) end - end, - keyreleased = function (b) - if love.keyreleased then love.keyreleased(b) end - end, - mousepressed = function (x,y,b) - if love.mousepressed then love.mousepressed(x,y,b) end - end, - mousereleased = function (x,y,b) - if love.mousereleased then love.mousereleased(x,y,b) end - end, - joystickpressed = function (j,b) - if love.joystickpressed then love.joystickpressed(j,b) end - end, - joystickreleased = function (j,b) - if love.joystickreleased then love.joystickreleased(j,b) end - end, - focus = function (f) - if love.focus then love.focus(f) end - end, - quit = function () - return - end, - }, { - __index = function(self, name) - error("Unknown event: " .. name) - end, - }) - -end - -local is_fused_game = false -local no_game_code = false - --- This can't be overriden. -function love.boot() - - -- This is absolutely needed. - require("love") - require("love.filesystem") - - love.arg.parse_options() - - local o = love.arg.options - - local arg0 = love.arg.getLow(arg) - love.filesystem.init(arg0) - - -- Is this one of those fancy "fused" games? - local can_has_game = pcall(love.filesystem.setSource, arg0) - is_fused_game = can_has_game - if love.arg.options.fused.set then - is_fused_game = true - end - - if not can_has_game and o.game.set and o.game.arg[1] then - local nouri = o.game.arg[1] - if nouri:sub(1, 7) == "file://" then - nouri = nouri:sub(8) - end - local full_source = love.path.getfull(nouri) - local leaf = love.path.leaf(full_source) - love.filesystem.setIdentity(leaf) - can_has_game = pcall(love.filesystem.setSource, full_source) - end - - if can_has_game and not (love.filesystem.exists("main.lua") or love.filesystem.exists("conf.lua")) then - no_game_code = true - end - - if not can_has_game then - love.nogame() - end - -end - -function love.init() - - -- Create default configuration settings. - -- NOTE: Adding a new module to the modules list - -- will NOT make it load, see below. - local c = { - title = "Untitled", - author = "Unnamed", - version = love._version, - screen = { - width = 800, - height = 600, - fullscreen = false, - vsync = true, - fsaa = 0, - }, - modules = { - event = true, - keyboard = true, - mouse = true, - timer = true, - joystick = true, - image = true, - graphics = true, - audio = true, - physics = true, - sound = true, - font = true, - thread = true, - }, - console = false, -- Only relevant for windows. - identity = false, - release = false, - } - - -- If config file exists, load it and allow it to update config table. - if not love.conf and love.filesystem and love.filesystem.exists("conf.lua") then - require("conf") - end - - -- Yes, conf.lua might not exist, but there are other ways of making - -- love.conf appear, so we should check for it anyway. - if love.conf then - local ok, err = pcall(love.conf, c) - if not ok then - print(err) - -- continue - end - end - - if c.release then - love._release = { - title = c.title ~= "Untitled" and c.title or nil, - author = c.author ~= "Unnamed" and c.author or nil, - url = c.url - } - end - - if love.arg.options.console.set then - c.console = true - end - - -- Gets desired modules. - for k,v in ipairs{ - "thread", - "timer", - "event", - "keyboard", - "joystick", - "mouse", - "sound", - "audio", - "image", - "font", - "graphics", - "physics", - } do - if c.modules[v] then - require("love." .. v) - end - end - - if love.event then - love.createhandlers() - end - - -- Setup screen here. - if c.screen and c.modules.graphics then - if love.graphics.checkMode(c.screen.width, c.screen.height, c.screen.fullscreen) or (c.screen.width == 0 and c.screen.height == 0) then - assert(love.graphics.setMode(c.screen.width, c.screen.height, c.screen.fullscreen, c.screen.vsync, c.screen.fsaa), "Could not set screen mode") - else - error("Could not set screen mode") - end - love.graphics.setCaption(c.title) - end - - -- Our first timestep, because screen creation can take some time - if love.timer then - love.timer.step() - end - - if love.filesystem then - love.filesystem.setRelease(c.release and is_fused_game) - if c.identity then love.filesystem.setIdentity(c.identity) end - if love.filesystem.exists("main.lua") then require("main") end - end - - if no_game_code then - error("No code to run\nYour game might be packaged incorrectly\nMake sure main.lua is at the top level of the zip") - end - - -- Console hack - if c.console and love._openConsole then - love._openConsole() - end - - -- Check the version - local compat = false - c.version = tostring(c.version) - for i, v in ipairs(love._version_compat) do - if c.version == v then - compat = true - break - end - end - if not compat then - local major, minor, revision = c.version:match("^(%d+)%.(%d+)%.(%d+)$") - if (not major or not minor or not revision) or (major ~= love._version_major and minor ~= love._version_minor) then - local msg = "This game was made for a version that is probably incompatible.\n".. - "The game might still work, but it is not guaranteed.\n" .. - "Furthermore, this means one should not judge this game or the engine if not." - print(msg) - if love.graphics and love.timer and love.event then - love.event.pump() - love.graphics.setBackgroundColor(89, 157, 220) - love.graphics.clear() - love.graphics.print(msg, 70, 70) - love.graphics.present() - love.graphics.setBackgroundColor(0, 0, 0) - love.timer.sleep(3) - end - end - end - -end - -function love.run() - - math.randomseed(os.time()) - math.random() math.random() - - if love.load then love.load(arg) end - - local dt = 0 - - -- Main loop time. - while true do - -- Process events. - if love.event then - love.event.pump() - for e,a,b,c,d in love.event.poll() do - if e == "quit" then - if not love.quit or not love.quit() then - if love.audio then - love.audio.stop() - end - return - end - end - love.handlers[e](a,b,c,d) - end - end - - -- Update dt, as we'll be passing it to update - if love.timer then - love.timer.step() - dt = love.timer.getDelta() - end - - -- Call update and draw - if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled - if love.graphics then - love.graphics.clear() - if love.draw then love.draw() end - end - - if love.timer then love.timer.sleep(0.001) end - if love.graphics then love.graphics.present() end - - end - -end - ------------------------------------------------------------ --- Default screen. ------------------------------------------------------------ - -function love.nogame() - local pig_png = - "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ\ - bWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdp\ - bj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6\ - eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEz\ - NDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJo\ - dHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlw\ - dGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAv\ - IiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RS\ - ZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpD\ - cmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlE\ - PSJ4bXAuaWlkOjdCQTYxREYxOUQ5RDExRTBBNjY4RTc1NEVEQTU1MERDIiB4bXBNTTpEb2N1bWVu\ - dElEPSJ4bXAuZGlkOjdCQTYxREYyOUQ5RDExRTBBNjY4RTc1NEVEQTU1MERDIj4gPHhtcE1NOkRl\ - cml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0JBNjFERUY5RDlEMTFFMEE2NjhF\ - NzU0RURBNTUwREMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0JBNjFERjA5RDlEMTFFMEE2\ - NjhFNzU0RURBNTUwREMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1l\ - dGE+IDw/eHBhY2tldCBlbmQ9InIiPz6gRGuzAAAYXklEQVR42uydX2hcV37Hz4xkeTdxNrITkpBk\ - 0/EmgWxLbKlhyZZCPYJtSw3FUpe+FTzzsG9LLdFCH2W9FzwufeuDRtDX4tGLS0tBo0IpS1s8Tmk3\ - S9x4kniXeMnKk7/eWLLU87vzu9LV/L/3nnPv79z7/cBlFEcjjc45v+/5/s7fwsHBgQIA5JMiigAA\ - CAAAAAIAAIAAAAAgAAAACAAAAAIAAIAAAAAgAAAACAAAAAIAAIAAAAAgAAAACAAAAAIAAIAAAAAg\ - AAAACAAAAAIAAIAAAAAgAAAACAAAAAIAAIAAAAAgAAAACAAAAAIAADDBdNg3FAoFax+m89f/XNYv\ - 9JzXz6x+5viVaPJrSz8f0OvsX/5BE1UIQD+T3vlZCHs5qGkB0EFPAb6sn8v6KYV9OwvDpn4aWhA6\ - qHoAHBEAHfwU+KuBXj4uDf1saCFooAkACIBQAeBe/wbbfRu09XNdP3W4AgABECQAHPxbnN/bpsNC\ - UIMQAAhAP4nOAiQc/IpTC0ox7urffRXNAoAUHYAOwi2Ltn/S1GAFYwQgLXimi2jZdKXiUgDugVeF\ - 1ENTP1VdAW00SWAgqMnRltjZPh1wuMFp7HG0OGX1p7mbun22MiEArHpbAutuTRcyUgMQJoWdU0dr\ - VUqW09nI09zSBOBWgnl/WFrsBlpo4qCn3ZY42C9w+02zDVPwN7jTajsjALoQK/pl3YH6hhtAwFMP\ - v8gBX1bhF6YlRY3ba8cFAbgruCAHuYEll8cGdi7WZgf0VOWYPU/QHXXO3FxuZSjo5zjoLwl2qYNo\ - s3NtihUAh3r/3gZflThToIPbH1TyX/09E7MpNd6gONDrpyowmKWFoiM46C9z4JeU21BbrUsVgLsO\ - FzAtHlpJKdB9+1liO1pyuBybLAi3WRxIGNoIersikLoACB75D5sSLNicr+Vgn+PePO2BpqSFoeUL\ - g420ggfxrmQ06HuZDw5kSxAAsv6VLKSJLAItA8E+q45Glcs5CvYw6cQ2iYMWhGbEoPcH8q7krHzb\ - uo2elSQAD5S5XX4SGufKoFwLAW/dJWyyILQmDH6bm8ykcziTlaoA6IpY5IrIVGPUhbswQdD7C0Uu\ - 5bgh2hLhBjuExqgBxoD1r2SoE5qojHQbPS1BALJi/4m6GrP4goM+qwNMUmkE3EF7RFuscN3kRYy9\ - AcG0BcB1++9vI64PC3wEvbhUYWOUM+BZgCsZ6piGCqNus0upCQAX9C3HA3/g+QE66EvqaIAJQS/X\ - GWxoIWiMSA8qXIeZTA902y2kKQB0zNe1jAX+YqC3B+7UKaVv1welCDHPopTOwtN/8fvNtATApfx/\ - aOBzb1/JaAPJZYqghaA+YpxgNUP1vKIFoJaWAEje+TdJ4Jc56CuIm8zR5rGC2qCxggwJQU0LwEpa\ - AnDgcOBT5ZcRJ7lID7yttUPSgwqnsa6OETS1ACwkLgDCl/8O3EKpAz9r9g+Eoz5ICAJjBC4OFqYm\ - ABRM6xIruHc6D4EPQgrBahYFYNrwL5YUTE3VXb7bGmD1ryksywXHoQ6hotvHMSFgx3hVC0GdRaCS\ - pT/atANI+9Rfgiqu76AE5PggJGtqwGAhp7nSO5CJHUCWbgf2N+ycDQY/TefpZ53HJhD8YFK8+yQ4\ - VTyE2pZ+5qmT4TbnNKYFIK0AI3tGgV/r6fWvqu6qxAraM4gA5f/ruh3dYgcZFAKvzanu4LKzTDte\ - QaPs/rrCAB8wA9n9LR4fWPHTAh4fWNFpwaawtKCduAPgNdZJUhtg92f1c43tPoIfmKbCacHikLRg\ - Tcjn/CCNFCCpgPNP6Fnp6fWpUugMwmW0U2A5Lbih29sNPvAlKASUcs6H6YEz4wASgqb05of0+jdU\ - vg5/AOmyOMQNtFgEGhAAs9S552/35Pq30OsDSW6AxgZoT35aKcGwuwJsC0DZ4t9E03vV4DJeHuFH\ - rg+kuIFbfEhMb0qQ9HRhqPRDugPw8/1aj+WnwF9FuwOCKLEILPeIgOdcExSBVlYEwD+TP5jvk8Le\ - VVjQA+RyjRae9aQELRaBdgK/fzsLAuAHfysQ/BXO9zHQB6RDbXWLD5UJisB82B46Ak3XBYAO4pzv\ - yfdpUc862hVwiDlOCcoBEeiwE7AlAp2wF9gUBQZ/tSffv6GwlBe4ySw7gUpCItAM+wZJArDWG/yq\ - O8qPgziB66zzrJVtEdh2VQCq/pVGHPxzHPzYsw+ywiqnsjZFoOGiABy72hjBDzJMxaIItEbdXiVV\ - AIYFP0b6AUQgHBtR3lRE8AOQCRFouCQAdQQ/gAgYE4FI9j8tAeid6kPwA4jAkQjQJqKwy4Y3on6A\ - pAWgOWCqD9t4AUTgSATaKvzegYYEARhnQVqsbsHgx24+ALoisBwQgWOxMi74o9r/JAWA1KzacysP\ - 9fyY6gOgy7WeFYNN1d1KbM3+J5kCVHs29pDlKaPOAegTgbmACNTV6FOH2/p7GtIFoBb8kKxyFdQ1\ - AH34eweCW4np7Mumjd4/iRSgFTy8k9UNu/oAGCMCPf+2NCS+amIEYMBARCeYwwRG/AEAo5njg279\ - 2PKnB4PUe2+6lpYCrPXsTcZFHQBMznLwxGGOpeBR+EYOHDUtAO2A9Q+e40dTHNjWC0A4eo8Wq/F4\ - QD3O1F+QaQsCUAoqFR+LhAM8AYg2HkBpc/Cm36rJX2DaAXRYnZqBf8NKPwCiU+5ZJNQ21fvbEIDb\ - wdyEPzgW+wAQj9XgAaMmKRwcHIR7Q6Ew0ffxB8YpvgCYoXHm5vKky4PVpHFtcxbgGoIfAGMsBk8Y\ - lpoC+L0/fVCM+gNglnUnBEBhtR8ANigFTxcWKQC81r+EugLACleCawMkOgDM+QNgDwr+ZZECgN4f\ - ALdcgGkHgN4fAIdcgDEBQO8PgHsuwKQDQO8PQLIuoCJCAHjeH70/AAm7ACkO4ArqAoDEKQXPDEhF\ - AHjNP1b9AZAOl9N2AAh+ANJjMc5goAkBuIw6ACBVKqkIANt/7PcHwNE0IK4DgP0HIH3moh4YElcA\ - YP8BkEE5UQHggQfYfwBkcClpBwD7D0BeHYDmAsocADHMRjkyLI4AlFHmALjtAiIJAOf/JZQ3AKI4\ - n5QDwOAfAPKYS0oAYP8BkEcp7LLgqAJwHmUNgPsuIKoA4MIPAHIsAEgBAJCJ3RTA5JnkAADjXLAq\ - AAozAABkhiKKAACMAYShhDIGIKdjABAAAJACAAAgAAAACAAAQAxhtgVDAACAAwAAZIgWBACAnHLm\ - 5nIHAgAAsCIAHRQbAPkVgBaKDYD8CgAAQC5N2wLQRhkDkFMHcObmMgQAALmEStGnI/4SEoESytod\ - CqefUIWZqeP/9uRJVTh1cuh79u9/1v9vD75S6tFjFKhcPoUA5M3GPf+UUiemVfHME/p1ygt279/p\ - tSfowzD15osj//+BFoMDEoPdPf31Q/31XvffvnikDr78GhXjwBhAVAHYVjgXMJVA93pt6s31EzfA\ - jbgK/z9ePj1YILQQkDiQm4B7SIR2EgKAcQDbwcWB7gU9vzqZdpBIaXHw3URXEL7SgvC599DXwBxh\ - x+iiCgDWAtjo4XWgUKD7QZ9ZYdNP0XcM2hHs//KzriB81EHqkKD9jywAWmVaOxdrtCLQ6gnBD/cf\ - qZ98eUc//6fuPdo5/hmmT6lz33xFvf3kq+rlmTNuVpe271MU9N+ePQqIvKHLwBM++vvfesUTABKC\ - x+9/4qQ7oDb7zsMPvTb73q8/7muzr598Qb196lXv1QLbiQhAQG0WbRXkP356W219/r9egQ5iZ+8L\ - 1dT/n563n3xN/fD099Q3izMI+gw4hKk3nveeQzF4974TzoAC/+9/9W8j2+xP9u54ndrr33hB/cns\ - 90x3Xq0kBWDbhgBQ4f3NL/+pr8cfBRUoFf6fP/eHYt0AWXqvYVPQpzhw56wYaDdAQkDOQCIU+NQO\ - J4XcAbVz6rioA0srBSgm+csmIWzw9woHqawkpr7zrDrxgzfUzMXf8r5G8EcX0OnfOatO/ulvq+lz\ - L3ni4GrwB9ssvZc6LxO9f5htwLEFgMYBlOHZgH948B+Rgj9YoH/3yZaYwJ9ZPOc1WhdH8EWnUG++\ - eFi2aQtBN9+/E1tAhqUNIdiM8qa4m4GMuQA/p48LCUjcCjEV+JJ6qSwSLOu0nBV1WibSXgM/p5GG\ - AGyaKsitz39qrFKaBn9WGItKVh+Bn44QnLx03ksNkoQ6GlMpJ/2sGC6gzY48WQHQv5RUx8gBIYby\ - oEMXkNhYgO55pt96xcvxYfVlpAZJ1cN7v75vPJ1Isvc34QCIuqkUwCT3dnesNwBqaN7g3hvPIwCF\ - QO7Lc2JalK0LwNcfG/15O3tfRn3rRpoCsCGtIImfP3pgtfLJblJDg90XmhZoUSZxtlk/xjutaAPg\ - raj234gA8C/Pz9JgbTVPXHht7E45IMANnH7CqdTs4UGkMYDrsVysoc8e60O8fML84p0z009aCf4Z\ - 3etjBZ9jgq3rzFuDYbyNnTL68yIsD+7Eyf9NCkCswUBawmt6Ge9LpkWFgz+rm3SyDs3OmBYB0x1X\ - hE6rEWXxj3EB4A8RywXQxh6Tymx0STCCHyIwqMf+htnB3wgOYC3u7zR5KnA9zptph5Qpvm9ubbXH\ - CZrbR/BnQwTeesVYXdIaflPOlTYHhUwp6ibO5zQmAPxhIosAqZ8JF0CFWH7qu+YazLmXkPNnbUzg\ - wmtGVg5S8C889ZtGPhbtDAzJhonfa/pegFiW5M+e+d3YimriZ/h4O/gw2p85aGpw+k0zqwb/6Onz\ - Xu8dB9oRGDJlpdy/KU4A2AXU4igqbemNGsAU/CYPWkhiMQlIB1onYGp68EfPLkQec6I0ohzeRayY\ - KgcbNwORC4g8MkkFufbiD0OpKtn+v3rhj03uqz48mgtkWAQMuQC/4woTyPQe6rDoCUnd5N0chYOD\ - g3BvKBTGfs/OxdpV/bIa98PRCsHmZz8dukaaxILy/bcND/oRlCci988+jxrvGD1tiFYH3vz0ttdm\ - B23uoc7q+16v/90oTpc61vlJBGDSuLYiACwCd5XBuwN6lwvTHKy1I8BmpryDJ0D2oVOG9v7rQys/\ - m5b2Blf3PTN1Ku7ioTUd/Fcn+cZJ43raYtlW9WPsdA5LhygOtobo+XODzTTP8PF07UmDP+0xgK7V\ - 6Y5SNlxsFJjzzw8O1XXVigAm8KE7aBQgry7AEDVT036JCgAvEa6iiQEQ3forA0t+03IA/qlBDdRj\ - 91os72jr//6F99BtOGAy6Dhwv9y8o8Hzc8dgNe6Gn1FMJ/VH6GdO5fhGYWq4e+/8fKD9PPF7r+O4\ - 8GGi+eArtbt9p2+qbm/mQ6/cMr5Ww5r1T8wBBFKBJWeKfXcvkeAnyAU8+pd3EelDHBOVzcB5eu0A\ - dun/Gbg+jK4zFwid9LNi+5cUk/pr+OSgFSca3oOHRhvxsOAP9nJSb7xJk73//Gis1Y89h69/vsBr\ - xxLrMItJ/lVaBGifQF28Xf/I3HmCdLfdRN8HAegvk3vj68G7YjxGANPNxAJZMrncV4wAMOQCRJ8h\ - SD2ysV5h9zEiOUpghhggjWPhJxXoJOPDdt6fqgDweMCCEr4+YP/9X5n5QScwuBepYYZYi1E4FXFJ\ - uLb/j+89kPRn19klq8wKgCsisPfux0ammuga8Im+D8uPjzMzNdEIPy3ainr09+Of3Zc0ndjUcZH4\ - mpliWn8tDwrKXSREvcPP4t/84l9xPa4R43KRfrzzGMZMj0Y9s8EbnH33Yyl/KsVCKrNkxTT/al4k\ - JFYEaPTexDQTNdJhAe6dXf+DNxDtQ8pm6BoJupItxs3Lk8wwJBj8CzYX+4wsY1vbgcOwc7FW0S/r\ - UhuhF6AGFuqQmOzf66j9+595zqCgG6+N8+ozB7mx9z85HBgs+uUWsU5sbgEOSYeD3/igeOrnAWRJ\ - BCg/9w6SBM5DIrIrY+GVteAPIwBFKRWjC6IuNR2g+ei9f7+L6HEcb1nxv76X+eB3ZgzAJREgCwoR\ - cDv4vSXX6ef9YoJfnABABIAt2y8k+Cnoz0oJfpECEBCBJSVwnQCJwKOb/5On7ahOQwN+u3KCP7XR\ - fqcEgEWApghFLhYiO/n15m3s55cM7RbcviNltL8uMfgJMbMAw9i5WCvplxuqe56AOGh+37tlBvv5\ - RVl+StWE7PKrJbGtt6+Tcm0acIwI0HpamiJclNjgvKumYixKAeZ6ferxBW2trnI6qyAAZoTgqjJw\ - 4Yi1fEoLAAlB1LXpIEauT4euGNq/YYDUR/ozKQAsAovsBmalNkZapTZ17kUIQRKBT2cFvvMLSYd6\ - NFV3P3+q+X5mBcCFcQEIgX2rT9t4hQU+sWbj8g4IwHAhuKZflqW3V2/tOt1Giy2/8Rq1DnY6p0GQ\ - 1Q9a/qUkD/KAAByJQJlTgpL0BuxtDX71WVX8zjNwBSFtPp3csy/r8A4fb0ertCm+3AgAiwCNB6y6\ - 4AYOy5HOANApAh0YAjHoh4Kdgt47sUfmoqsOB77IOy9yJQAuuoE+Mfj2aZ0izOb3WjLO6w/ufy45\ - 6EX3+rkXAFfdwDFmprzbiemsABo7yKw70AFOJ/LSoh3vZF8DB68kQFt1D+0Uf9NVbgUgIAQ0Q0CD\ - hGWnA4XOxnvuW6p45glVeO6p7mGZDq469I/vph5+n05ddiPgg9D9fDXJvT4EYLAQVFgIZlVWIFGg\ - wzD5QEzv9dRM+m6BenUK7N0973KV/Z3u8eoOBnuQJtv99jEr8LdNak/l0o/LGANwQARmOSW4kikh\ - GCEORPH5bx3V23P9y5THLV327kfoycW9YOa7Dg6++Lob4HS7jttBPszuVwdN7engr3CaWdLPvBaB\ - FgTADSEoccVVFADDA39t0Br+nsA/dAhaABYgABAC4DaU218flOfrwC9zeykPee+CFoEmBABCAPIV\ - +GJdAAQAQgAmsPr6acQI/CCixgIgAP35Gw0CtkZZNRYCEoHsDxbmFwrS60Ny/CiB71PXbasKAZAr\ - AA84qEkANnRl1UcIAX3fouof8AHuQvW9MWRUP07gB1OJs7pddSAAMgXgYJgFHFVpvLz4MtIDZ23+\ - hureutse0CZ8t2dqW3l1VMcCAZAlAEHlpkq7riuvPYErMNlgQPK9vb8m5LIFd0edyRIEwC0BOFaB\ - LATNUd/EYwVXWBCQIsiA6m5TDRjU4/qf4zqz6eQ6uu2chgDIC36y8VshrePY9IDFYI57E4iBvKCf\ - VUeDuknVjYjZAAhAv/rfiqLoAVcwtlJZDPwxA6QJFnpY1R3EHRr0XN+LAVFOGhHjABCAaCnAKLzp\ - o0lcQc+YwQUWBbiD6OXuBf2oI7dY5P3B2jSncNd0+7gKAcieAAy0npNO+wTcwQV2BxCE0QG/Ta+j\ - tt8Ggl5S+gUByIEABPEbayNM7scDiSQI51kQyjkM9jYH/G0O9uYE9VjigJeaZkEAhArA3QR6CT9H\ - 9Rp02A0i7BJ8d3CBX7PiFJoc8B/w162wh2voOtxyQCidEoDpnPU2toPJz/u9VYS6wQYdQotFYWij\ - 55tkWgOEocw/m8ThaX6dFdYDdgKffTvw3+1Bi3Aisp1Tp2SNPDkAKXcItAMuoWViGykLhE/w698Y\ - IXqDBKQ5JvgGBbvJAJfi5OLg1CxAnhzAB0I+BzXeSqBB+4G3qRtOLcoP7MmdmxmvR9pwsyX487Vc\ - KsxijgRAcmD4Fh+MU8+uY6oJ/XhticeDQQC6DafF1hUC5X5drgjtaTdcK8tiztpOQ3CjhgCEY0mY\ - oHcEOxMIALOJ3j8zLqCtXxYEicCalLMAIADDG01DaBqwiZCOnNatSHCWUQdwIQDJcx2pSaZEoK66\ - MwNp0Ur590MAQlIT5gJaow4iAROLwHwK9Uqp24KL1j+3AsCVJckFXEcIG0sHFlRyswM1Ogrc5eDP\ - qwPwXYCEXrcD+29FBGzm4y3u9VeyUGa5vRcgwilBNhCxcSSLGDrp99iP5Pqqu/D3YzfgZI3kKjeS\ - tHr/s65bSEeEwD+/MQrk0Dak3gIMAYjfQNZVOkd+V13pTTJSzyV2A5dUdz/GsJ2UTbb53oEkrgo0\ - BEC2CIg5Phpkk0njuoii8gaPaB43qd6YcskqSh1IAAJwXASqyu5cMv3sJeT9AAIgUwTIBdCCEhsD\ - PtTzL7i2XRRkG4wBDB8XKCtz00gkKFX0/EDaGAAEYLwQlFT0a8Cot19zbQoJQAAgAIPFwD+++zyL\ - QXlAju9PITVg90HmBAAAkB0wCAgABAAAAAEAAEAAAAAQAAAABAAAAAEAAEAAAAAQAAAABAAAAAEA\ - AEAAAAAQAAAABAAAAAEAAEAAAAAQAAAABAAAAAEAAEAAAAAQAAAABAAAAAEAAEAAAAD2+H8BBgCz\ - 4xkvbY9d6gAAAABJRU5ErkJggg==" - local heart_png = - "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ\ - bWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdp\ - bj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6\ - eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEz\ - NDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJo\ - dHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlw\ - dGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAv\ - IiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RS\ - ZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpD\ - cmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlE\ - PSJ4bXAuaWlkOjk3NUYxN0NGOUQ5RDExRTA5MTgyQjc4MkNEQkY5RkI1IiB4bXBNTTpEb2N1bWVu\ - dElEPSJ4bXAuZGlkOjk3NUYxN0QwOUQ5RDExRTA5MTgyQjc4MkNEQkY5RkI1Ij4gPHhtcE1NOkRl\ - cml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OTc1RjE3Q0Q5RDlEMTFFMDkxODJC\ - NzgyQ0RCRjlGQjUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6OTc1RjE3Q0U5RDlEMTFFMDkx\ - ODJCNzgyQ0RCRjlGQjUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1l\ - dGE+IDw/eHBhY2tldCBlbmQ9InIiPz7MtgYTAAACd0lEQVR42uyajW2CUBDHH8YBWKBJR8AJChvY\ - AZriBNYJrBOIE9imA6gTyAZlg9p0ATaw99IzfSEgvI9DlLvk5UUUuPu9/71PvePxKPpsA9FzYwAM\ - gAEwAAbAABgAA2AADIABMAAG0EcbmtzkeV7p9Z+nVQhViB8PUNK7j+nBxkF4ZgzVHMp9ydeZfAeU\ - d3hPVnZ/3X6HZ7IhUgQATgZQraEEJT+XDi7AwVQzcB+qjQK0zuTzJ0Xg5ACw1aWjfs1tCTg30wh+\ - XwH0nOVQIlUNpACw5fcNglclKx3MCYJXIYxOSqiLb2CRm75m8AKD+kJwVba2CF6gP+s2RoGlZvCq\ - g/syCHDtFaqxg849hGeNyQDAw2WPHFu20gZVpKbT3OEI90ypgKkDB+9RCScIG8dDfCMFDE0l5shJ\ - 2epLgPBdMc5bGaoqowAQOPQzFnTmU6XAVViTydctA2g0Bb9lAGnfAewoAaQdDz6H/N9SAth1HMCK\ - eiq87XLry5UnKQBcaXUVwurcatNlJzi79ta3AoAqSDoGYKHT+tYbIjjf/nQ8NTa1DIIfFS+SbYgo\ - 9ojSu7RNTG6yBoCpEF0YwqJqV5g8BQpLT90tMjLpt5kCJyVkqIRDi8HnptInWQsghFHdJoRDm5lK\ - n2wxhMOQVMIbcfDynMH6Hc76gDKDfuFF/O0eO1/qQvBRkx+21gdUqCHBlHDZL2Q49Dox8v0ApV9I\ - HAUf6c72LpYCJSkRYkoEbQXfyumwAYhYVB95O235TgIogJjWKCKVOW8q+04DKMwi5UnOg/g/dMlx\ - imvVd5AAuCXjP0kxAAbAABgAA2AADIABMAAGwAB6ab8CDACjlPepVvE3rwAAAABJRU5ErkJggg==" - - local hearts = {} - local rings = {} - - local cx = 400 - local cy = 300 - - local pig - local heart_image - - local function add_heart_ring(radius, number, speed) - local step = math.pi*2/number - for i = 1,number do - local heart = { - radius = radius, - position = step*i, - speed = speed, - opacity = radius/450 - } - table.insert(hearts, heart) - end - table.insert(rings, radius) - end - - local function update_hearts(dt) - for i,v in ipairs(hearts) do - v.position = v.position + v.speed*dt*0.6 - end - end - - local function draw_hearts() - for i,v in ipairs(hearts) do - local x = math.cos(v.position) * v.radius + cx - local y = math.sin(v.position) * v.radius + cy - love.graphics.setColor(255, 255, 255, v.opacity*255) - love.graphics.draw(heart_image, x, y, v.position+0.4, 1, 1, 32, 32) - end - end - - local function draw_pig(p) - love.graphics.setColor(255, 255, 255, 255) - love.graphics.draw(p.img, p.x, p.y, 0, 1, 1, 128, 128) - end - - local function loadimage(file, name) - return love.graphics.newImage(love.image.newImageData(love.filesystem.newFileData(file, name:gsub("_", "."), "base64"))) - end - - function love.load() - math.randomseed(os.time()) - pig = { - x = cx, - y = cy, - img = loadimage(pig_png, "pig.png") - } - heart_image = loadimage(heart_png, "heart.png") - - add_heart_ring(100, 10, 2.4) - add_heart_ring(150, 20, 2.2) - add_heart_ring(200, 25, 2.0) - add_heart_ring(250, 35, 1.8) - add_heart_ring(300, 40, 1.6) - add_heart_ring(350, 50, 1.4) - add_heart_ring(400, 60, 1.2) - add_heart_ring(450, 70, 1) - end - - function love.update(dt) - update_hearts(dt) - end - - function love.draw() - love.graphics.setBackgroundColor(254, 224, 238) - draw_hearts() - draw_pig(pig) - end - - function love.keyreleased(key) - if key == "escape" then - love.event.quit() - end - end - - function love.conf(t) - t.title = "L\195\150VE " .. love._version .. " (" .. love._version_codename .. ")" - t.modules.audio = false - t.modules.sound = false - t.modules.physics = false - t.modules.joystick = false - end -end - ------------------------------------------------------------ --- Error screen. ------------------------------------------------------------ - -local debug = debug - -local function error_printer(msg, layer) - print((debug.traceback("Error: " .. tostring(msg), 1+(layer or 1)):gsub("\n[^\n]+$", ""))) -end - -function love.errhand(msg) - msg = tostring(msg) - - error_printer(msg, 2) - - if not love.graphics or not love.event or not love.graphics.isCreated() then - return - end - - -- Load. - if love.audio then love.audio.stop() end - love.graphics.reset() - love.graphics.setBackgroundColor(89, 157, 220) - local font = love.graphics.newFont(14) - love.graphics.setFont(font) - - love.graphics.setColor(255, 255, 255, 255) - - local trace = debug.traceback() - - love.graphics.clear() - - local err = {} - - table.insert(err, "Error\n") - table.insert(err, msg.."\n\n") - - for l in string.gmatch(trace, "(.-)\n") do - if not string.match(l, "boot.lua") then - l = string.gsub(l, "stack traceback:", "Traceback\n") - table.insert(err, l) - end - end - - local p = table.concat(err, "\n") - - p = string.gsub(p, "\t", "") - p = string.gsub(p, "%[string \"(.-)\"%]", "%1") - - local function draw() - love.graphics.clear() - love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70) - love.graphics.present() - end - - draw() - - local e, a, b, c - while true do - e, a, b, c = love.event.wait() - - if e == "quit" then - return - end - if e == "keypressed" and a == "escape" then - return - end - - draw() - - end - -end - -function love.releaseerrhand(msg) - print("An error has occured, the game has been stopped.") - - if not love.graphics or not love.event or not love.graphics.isCreated() then - return - end - - love.graphics.setCanvas() - love.graphics.setPixelEffect() - - -- Load. - if love.audio then love.audio.stop() end - love.graphics.reset() - love.graphics.setBackgroundColor(89, 157, 220) - local font = love.graphics.newFont(14) - love.graphics.setFont(font) - - love.graphics.setColor(255, 255, 255, 255) - - love.graphics.clear() - - local err = {} - - p = string.format("An error has occured that caused %s to stop.\nYou can notify %s about this%s.", love._release.title or "this game", love._release.author or "the author", love._release.url and " at " .. love._release.url or "") - - local function draw() - love.graphics.clear() - love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70) - love.graphics.present() - end - - draw() - - local e, a, b, c - while true do - e, a, b, c = love.event.wait() - - if e == "quit" then - return - end - if e == "keypressed" and a == "escape" then - return - end - - draw() - - end -end - - ------------------------------------------------------------ --- The root of all calls. ------------------------------------------------------------ - -return function() - local result = xpcall(love.boot, error_printer) - if not result then return 1 end - local result = xpcall(love.init, love._release and love.releaseerrhand or love.errhand) - if not result then return 1 end - local result, retval = xpcall(love.run, love._release and love.releaseerrhand or love.errhand) - if not result then return 1 end - - return tonumber(retval) or 0 -end +--[[ +Copyright (c) 2006-2012 LOVE Development Team + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +--]] + +-- Make sure love table exists. +if not love then love = {} end + +-- Used for setup: +love.path = {} +love.arg = {} + +-- Unparsed arguments: +argv = {} + +-- Replace any \ with /. +function love.path.normalslashes(p) + return string.gsub(p, "\\", "/") +end + +-- Makes sure there is a slash at the end +-- of a path. +function love.path.endslash(p) + if string.sub(p, string.len(p)-1) ~= "/" then + return p .. "/" + else + return p + end +end + +-- Checks whether a path is absolute or not. +function love.path.abs(p) + + local tmp = love.path.normalslashes(p) + + -- Path is absolute if it starts with a "/". + if string.find(tmp, "/") == 1 then + return true + end + + -- Path is absolute if it starts with a + -- letter followed by a colon. + if string.find(tmp, "%a:") == 1 then + return true + end + + -- Relative. + return false + +end + +-- Converts any path into a full path. +function love.path.getfull(p) + + if love.path.abs(p) then + return love.path.normalslashes(p) + end + + local cwd = love.filesystem.getWorkingDirectory() + cwd = love.path.normalslashes(cwd) + cwd = love.path.endslash(cwd) + + -- Construct a full path. + local full = cwd .. love.path.normalslashes(p) + + -- Remove trailing /., if applicable + return full:match("(.-)/%.$") or full +end + +-- Returns the leaf of a full path. +function love.path.leaf(p) + local a = 1 + local last = p + + while a do + a = string.find(p, "/", a+1) + + if a then + last = string.sub(p, a+1) + end + end + + return last +end + +-- Finds the key in the table with the lowest integral index. The lowest +-- will typically the executable, for instance "lua5.1.exe". +function love.arg.getLow(a) + local m = math.huge + for k,v in pairs(a) do + if k < m then + m = k + end + end + return a[m] +end + +love.arg.options = { + console = { a = 0 }, + fused = {a = 0 }, + game = { a = 1 } +} + +function love.arg.parse_option(m, i) + m.set = true + + if m.a > 0 then + m.arg = {} + for j=i,i+m.a-1 do + table.insert(m.arg, arg[j]) + i = j + end + end + + return i +end + +function love.arg.parse_options() + + local game + local argc = #arg + + for i=1,argc do + -- Look for options. + local s, e, m = string.find(arg[i], "%-%-(.+)") + + if m and love.arg.options[m] then + i = love.arg.parse_option(love.arg.options[m], i+1) + elseif not game then + game = i + end + end + + if not love.arg.options.game.set then + love.arg.parse_option(love.arg.options.game, game or 0) + end +end + +function love.createhandlers() + + -- Standard callback handlers. + love.handlers = setmetatable({ + keypressed = function (b, u) + if love.keypressed then love.keypressed(b, u) end + end, + keyreleased = function (b) + if love.keyreleased then love.keyreleased(b) end + end, + mousepressed = function (x,y,b) + if love.mousepressed then love.mousepressed(x,y,b) end + end, + mousereleased = function (x,y,b) + if love.mousereleased then love.mousereleased(x,y,b) end + end, + joystickpressed = function (j,b) + if love.joystickpressed then love.joystickpressed(j,b) end + end, + joystickreleased = function (j,b) + if love.joystickreleased then love.joystickreleased(j,b) end + end, + focus = function (f) + if love.focus then love.focus(f) end + end, + quit = function () + return + end, + }, { + __index = function(self, name) + error("Unknown event: " .. name) + end, + }) + +end + +local is_fused_game = false +local no_game_code = false + +-- This can't be overriden. +function love.boot() + + -- This is absolutely needed. + require("love") + require("love.filesystem") + + love.arg.parse_options() + + local o = love.arg.options + + local arg0 = love.arg.getLow(arg) + love.filesystem.init(arg0) + + -- Is this one of those fancy "fused" games? + local can_has_game = pcall(love.filesystem.setSource, arg0) + is_fused_game = can_has_game + if love.arg.options.fused.set then + is_fused_game = true + end + + if not can_has_game and o.game.set and o.game.arg[1] then + local nouri = o.game.arg[1] + if nouri:sub(1, 7) == "file://" then + nouri = nouri:sub(8) + end + local full_source = love.path.getfull(nouri) + local leaf = love.path.leaf(full_source) + love.filesystem.setIdentity(leaf) + can_has_game = pcall(love.filesystem.setSource, full_source) + end + + if can_has_game and not (love.filesystem.exists("main.lua") or love.filesystem.exists("conf.lua")) then + no_game_code = true + end + + if not can_has_game then + love.nogame() + end + +end + +function love.init() + + -- Create default configuration settings. + -- NOTE: Adding a new module to the modules list + -- will NOT make it load, see below. + local c = { + title = "Untitled", + author = "Unnamed", + version = love._version, + screen = { + width = 800, + height = 600, + fullscreen = false, + vsync = true, + fsaa = 0, + }, + modules = { + event = true, + keyboard = true, + mouse = true, + timer = true, + joystick = true, + image = true, + graphics = true, + audio = true, + physics = true, + sound = true, + font = true, + thread = true, + }, + console = false, -- Only relevant for windows. + identity = false, + release = false, + } + + -- If config file exists, load it and allow it to update config table. + if not love.conf and love.filesystem and love.filesystem.exists("conf.lua") then + require("conf") + end + + -- Yes, conf.lua might not exist, but there are other ways of making + -- love.conf appear, so we should check for it anyway. + if love.conf then + local ok, err = pcall(love.conf, c) + if not ok then + print(err) + -- continue + end + end + + if c.release then + love._release = { + title = c.title ~= "Untitled" and c.title or nil, + author = c.author ~= "Unnamed" and c.author or nil, + url = c.url + } + end + + if love.arg.options.console.set then + c.console = true + end + + -- Gets desired modules. + for k,v in ipairs{ + "thread", + "timer", + "event", + "keyboard", + "joystick", + "mouse", + "sound", + "audio", + "image", + "font", + "graphics", + "physics", + } do + if c.modules[v] then + require("love." .. v) + end + end + + if love.event then + love.createhandlers() + end + + -- Setup screen here. + if c.screen and c.modules.graphics then + if love.graphics.checkMode(c.screen.width, c.screen.height, c.screen.fullscreen) or (c.screen.width == 0 and c.screen.height == 0) then + assert(love.graphics.setMode(c.screen.width, c.screen.height, c.screen.fullscreen, c.screen.vsync, c.screen.fsaa), "Could not set screen mode") + else + error("Could not set screen mode") + end + love.graphics.setCaption(c.title) + end + + -- Our first timestep, because screen creation can take some time + if love.timer then + love.timer.step() + end + + if love.filesystem then + love.filesystem.setRelease(c.release and is_fused_game) + if c.identity then love.filesystem.setIdentity(c.identity) end + if love.filesystem.exists("main.lua") then require("main") end + end + + if no_game_code then + error("No code to run\nYour game might be packaged incorrectly\nMake sure main.lua is at the top level of the zip") + end + + -- Console hack + if c.console and love._openConsole then + love._openConsole() + end + + -- Check the version + local compat = false + c.version = tostring(c.version) + for i, v in ipairs(love._version_compat) do + if c.version == v then + compat = true + break + end + end + if not compat then + local major, minor, revision = c.version:match("^(%d+)%.(%d+)%.(%d+)$") + if (not major or not minor or not revision) or (major ~= love._version_major and minor ~= love._version_minor) then + local msg = "This game was made for a version that is probably incompatible.\n".. + "The game might still work, but it is not guaranteed.\n" .. + "Furthermore, this means one should not judge this game or the engine if not." + print(msg) + if love.graphics and love.timer and love.event then + love.event.pump() + love.graphics.setBackgroundColor(89, 157, 220) + love.graphics.clear() + love.graphics.print(msg, 70, 70) + love.graphics.present() + love.graphics.setBackgroundColor(0, 0, 0) + love.timer.sleep(3) + end + end + end + +end + +function love.run() + + math.randomseed(os.time()) + math.random() math.random() + + if love.load then love.load(arg) end + + local dt = 0 + + -- Main loop time. + while true do + -- Process events. + if love.event then + love.event.pump() + for e,a,b,c,d in love.event.poll() do + if e == "quit" then + if not love.quit or not love.quit() then + if love.audio then + love.audio.stop() + end + return + end + end + love.handlers[e](a,b,c,d) + end + end + + -- Update dt, as we'll be passing it to update + if love.timer then + love.timer.step() + dt = love.timer.getDelta() + end + + -- Call update and draw + if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled + if love.graphics then + love.graphics.clear() + if love.draw then love.draw() end + end + + if love.timer then love.timer.sleep(0.001) end + if love.graphics then love.graphics.present() end + + end + +end + +----------------------------------------------------------- +-- Default screen. +----------------------------------------------------------- + +function love.nogame() + local pig_png = + "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ\ + bWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdp\ + bj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6\ + eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEz\ + NDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJo\ + dHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlw\ + dGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAv\ + IiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RS\ + ZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpD\ + cmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlE\ + PSJ4bXAuaWlkOjdCQTYxREYxOUQ5RDExRTBBNjY4RTc1NEVEQTU1MERDIiB4bXBNTTpEb2N1bWVu\ + dElEPSJ4bXAuZGlkOjdCQTYxREYyOUQ5RDExRTBBNjY4RTc1NEVEQTU1MERDIj4gPHhtcE1NOkRl\ + cml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0JBNjFERUY5RDlEMTFFMEE2NjhF\ + NzU0RURBNTUwREMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0JBNjFERjA5RDlEMTFFMEE2\ + NjhFNzU0RURBNTUwREMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1l\ + dGE+IDw/eHBhY2tldCBlbmQ9InIiPz6gRGuzAAAYXklEQVR42uydX2hcV37Hz4xkeTdxNrITkpBk\ + 0/EmgWxLbKlhyZZCPYJtSw3FUpe+FTzzsG9LLdFCH2W9FzwufeuDRtDX4tGLS0tBo0IpS1s8Tmk3\ + S9x4kniXeMnKk7/eWLLU87vzu9LV/L/3nnPv79z7/cBlFEcjjc45v+/5/s7fwsHBgQIA5JMiigAA\ + CAAAAAIAAIAAAAAgAAAACAAAAAIAAIAAAAAgAAAACAAAAAIAAIAAAAAgAAAACAAAAAIAAIAAAAAg\ + AAAACAAAAAIAAIAAAAAgAAAACAAAAAIAAIAAAAAgAAAACAAAAAIAADDBdNg3FAoFax+m89f/XNYv\ + 9JzXz6x+5viVaPJrSz8f0OvsX/5BE1UIQD+T3vlZCHs5qGkB0EFPAb6sn8v6KYV9OwvDpn4aWhA6\ + qHoAHBEAHfwU+KuBXj4uDf1saCFooAkACIBQAeBe/wbbfRu09XNdP3W4AgABECQAHPxbnN/bpsNC\ + UIMQAAhAP4nOAiQc/IpTC0ox7urffRXNAoAUHYAOwi2Ltn/S1GAFYwQgLXimi2jZdKXiUgDugVeF\ + 1ENTP1VdAW00SWAgqMnRltjZPh1wuMFp7HG0OGX1p7mbun22MiEArHpbAutuTRcyUgMQJoWdU0dr\ + VUqW09nI09zSBOBWgnl/WFrsBlpo4qCn3ZY42C9w+02zDVPwN7jTajsjALoQK/pl3YH6hhtAwFMP\ + v8gBX1bhF6YlRY3ba8cFAbgruCAHuYEll8cGdi7WZgf0VOWYPU/QHXXO3FxuZSjo5zjoLwl2qYNo\ + s3NtihUAh3r/3gZflThToIPbH1TyX/09E7MpNd6gONDrpyowmKWFoiM46C9z4JeU21BbrUsVgLsO\ + FzAtHlpJKdB9+1liO1pyuBybLAi3WRxIGNoIersikLoACB75D5sSLNicr+Vgn+PePO2BpqSFoeUL\ + g420ggfxrmQ06HuZDw5kSxAAsv6VLKSJLAItA8E+q45Glcs5CvYw6cQ2iYMWhGbEoPcH8q7krHzb\ + uo2elSQAD5S5XX4SGufKoFwLAW/dJWyyILQmDH6bm8ykcziTlaoA6IpY5IrIVGPUhbswQdD7C0Uu\ + 5bgh2hLhBjuExqgBxoD1r2SoE5qojHQbPS1BALJi/4m6GrP4goM+qwNMUmkE3EF7RFuscN3kRYy9\ + AcG0BcB1++9vI64PC3wEvbhUYWOUM+BZgCsZ6piGCqNus0upCQAX9C3HA3/g+QE66EvqaIAJQS/X\ + GWxoIWiMSA8qXIeZTA902y2kKQB0zNe1jAX+YqC3B+7UKaVv1welCDHPopTOwtN/8fvNtATApfx/\ + aOBzb1/JaAPJZYqghaA+YpxgNUP1vKIFoJaWAEje+TdJ4Jc56CuIm8zR5rGC2qCxggwJQU0LwEpa\ + AnDgcOBT5ZcRJ7lID7yttUPSgwqnsa6OETS1ACwkLgDCl/8O3EKpAz9r9g+Eoz5ICAJjBC4OFqYm\ + ABRM6xIruHc6D4EPQgrBahYFYNrwL5YUTE3VXb7bGmD1ryksywXHoQ6hotvHMSFgx3hVC0GdRaCS\ + pT/atANI+9Rfgiqu76AE5PggJGtqwGAhp7nSO5CJHUCWbgf2N+ycDQY/TefpZ53HJhD8YFK8+yQ4\ + VTyE2pZ+5qmT4TbnNKYFIK0AI3tGgV/r6fWvqu6qxAraM4gA5f/ruh3dYgcZFAKvzanu4LKzTDte\ + QaPs/rrCAB8wA9n9LR4fWPHTAh4fWNFpwaawtKCduAPgNdZJUhtg92f1c43tPoIfmKbCacHikLRg\ + Tcjn/CCNFCCpgPNP6Fnp6fWpUugMwmW0U2A5Lbih29sNPvAlKASUcs6H6YEz4wASgqb05of0+jdU\ + vg5/AOmyOMQNtFgEGhAAs9S552/35Pq30OsDSW6AxgZoT35aKcGwuwJsC0DZ4t9E03vV4DJeHuFH\ + rg+kuIFbfEhMb0qQ9HRhqPRDugPw8/1aj+WnwF9FuwOCKLEILPeIgOdcExSBVlYEwD+TP5jvk8Le\ + VVjQA+RyjRae9aQELRaBdgK/fzsLAuAHfysQ/BXO9zHQB6RDbXWLD5UJisB82B46Ak3XBYAO4pzv\ + yfdpUc862hVwiDlOCcoBEeiwE7AlAp2wF9gUBQZ/tSffv6GwlBe4ySw7gUpCItAM+wZJArDWG/yq\ + O8qPgziB66zzrJVtEdh2VQCq/pVGHPxzHPzYsw+ywiqnsjZFoOGiABy72hjBDzJMxaIItEbdXiVV\ + AIYFP0b6AUQgHBtR3lRE8AOQCRFouCQAdQQ/gAgYE4FI9j8tAeid6kPwA4jAkQjQJqKwy4Y3on6A\ + pAWgOWCqD9t4AUTgSATaKvzegYYEARhnQVqsbsHgx24+ALoisBwQgWOxMi74o9r/JAWA1KzacysP\ + 9fyY6gOgy7WeFYNN1d1KbM3+J5kCVHs29pDlKaPOAegTgbmACNTV6FOH2/p7GtIFoBb8kKxyFdQ1\ + AH34eweCW4np7Mumjd4/iRSgFTy8k9UNu/oAGCMCPf+2NCS+amIEYMBARCeYwwRG/AEAo5njg279\ + 2PKnB4PUe2+6lpYCrPXsTcZFHQBMznLwxGGOpeBR+EYOHDUtAO2A9Q+e40dTHNjWC0A4eo8Wq/F4\ + QD3O1F+QaQsCUAoqFR+LhAM8AYg2HkBpc/Cm36rJX2DaAXRYnZqBf8NKPwCiU+5ZJNQ21fvbEIDb\ + wdyEPzgW+wAQj9XgAaMmKRwcHIR7Q6Ew0ffxB8YpvgCYoXHm5vKky4PVpHFtcxbgGoIfAGMsBk8Y\ + lpoC+L0/fVCM+gNglnUnBEBhtR8ANigFTxcWKQC81r+EugLACleCawMkOgDM+QNgDwr+ZZECgN4f\ + ALdcgGkHgN4fAIdcgDEBQO8PgHsuwKQDQO8PQLIuoCJCAHjeH70/AAm7ACkO4ArqAoDEKQXPDEhF\ + AHjNP1b9AZAOl9N2AAh+ANJjMc5goAkBuIw6ACBVKqkIANt/7PcHwNE0IK4DgP0HIH3moh4YElcA\ + YP8BkEE5UQHggQfYfwBkcClpBwD7D0BeHYDmAsocADHMRjkyLI4AlFHmALjtAiIJAOf/JZQ3AKI4\ + n5QDwOAfAPKYS0oAYP8BkEcp7LLgqAJwHmUNgPsuIKoA4MIPAHIsAEgBAJCJ3RTA5JnkAADjXLAq\ + AAozAABkhiKKAACMAYShhDIGIKdjABAAAJACAAAgAAAACAAAQAxhtgVDAACAAwAAZIgWBACAnHLm\ + 5nIHAgAAsCIAHRQbAPkVgBaKDYD8CgAAQC5N2wLQRhkDkFMHcObmMgQAALmEStGnI/4SEoESytod\ + CqefUIWZqeP/9uRJVTh1cuh79u9/1v9vD75S6tFjFKhcPoUA5M3GPf+UUiemVfHME/p1ygt279/p\ + tSfowzD15osj//+BFoMDEoPdPf31Q/31XvffvnikDr78GhXjwBhAVAHYVjgXMJVA93pt6s31EzfA\ + jbgK/z9ePj1YILQQkDiQm4B7SIR2EgKAcQDbwcWB7gU9vzqZdpBIaXHw3URXEL7SgvC599DXwBxh\ + x+iiCgDWAtjo4XWgUKD7QZ9ZYdNP0XcM2hHs//KzriB81EHqkKD9jywAWmVaOxdrtCLQ6gnBD/cf\ + qZ98eUc//6fuPdo5/hmmT6lz33xFvf3kq+rlmTNuVpe271MU9N+ePQqIvKHLwBM++vvfesUTABKC\ + x+9/4qQ7oDb7zsMPvTb73q8/7muzr598Qb196lXv1QLbiQhAQG0WbRXkP356W219/r9egQ5iZ+8L\ + 1dT/n563n3xN/fD099Q3izMI+gw4hKk3nveeQzF4974TzoAC/+9/9W8j2+xP9u54ndrr33hB/cns\ + 90x3Xq0kBWDbhgBQ4f3NL/+pr8cfBRUoFf6fP/eHYt0AWXqvYVPQpzhw56wYaDdAQkDOQCIU+NQO\ + J4XcAbVz6rioA0srBSgm+csmIWzw9woHqawkpr7zrDrxgzfUzMXf8r5G8EcX0OnfOatO/ulvq+lz\ + L3ni4GrwB9ssvZc6LxO9f5htwLEFgMYBlOHZgH948B+Rgj9YoH/3yZaYwJ9ZPOc1WhdH8EWnUG++\ + eFi2aQtBN9+/E1tAhqUNIdiM8qa4m4GMuQA/p48LCUjcCjEV+JJ6qSwSLOu0nBV1WibSXgM/p5GG\ + AGyaKsitz39qrFKaBn9WGItKVh+Bn44QnLx03ksNkoQ6GlMpJ/2sGC6gzY48WQHQv5RUx8gBIYby\ + oEMXkNhYgO55pt96xcvxYfVlpAZJ1cN7v75vPJ1Isvc34QCIuqkUwCT3dnesNwBqaN7g3hvPIwCF\ + QO7Lc2JalK0LwNcfG/15O3tfRn3rRpoCsCGtIImfP3pgtfLJblJDg90XmhZoUSZxtlk/xjutaAPg\ + raj234gA8C/Pz9JgbTVPXHht7E45IMANnH7CqdTs4UGkMYDrsVysoc8e60O8fML84p0z009aCf4Z\ + 3etjBZ9jgq3rzFuDYbyNnTL68yIsD+7Eyf9NCkCswUBawmt6Ge9LpkWFgz+rm3SyDs3OmBYB0x1X\ + hE6rEWXxj3EB4A8RywXQxh6Tymx0STCCHyIwqMf+htnB3wgOYC3u7zR5KnA9zptph5Qpvm9ubbXH\ + CZrbR/BnQwTeesVYXdIaflPOlTYHhUwp6ibO5zQmAPxhIosAqZ8JF0CFWH7qu+YazLmXkPNnbUzg\ + wmtGVg5S8C889ZtGPhbtDAzJhonfa/pegFiW5M+e+d3YimriZ/h4O/gw2p85aGpw+k0zqwb/6Onz\ + Xu8dB9oRGDJlpdy/KU4A2AXU4igqbemNGsAU/CYPWkhiMQlIB1onYGp68EfPLkQec6I0ohzeRayY\ + KgcbNwORC4g8MkkFufbiD0OpKtn+v3rhj03uqz48mgtkWAQMuQC/4woTyPQe6rDoCUnd5N0chYOD\ + g3BvKBTGfs/OxdpV/bIa98PRCsHmZz8dukaaxILy/bcND/oRlCci988+jxrvGD1tiFYH3vz0ttdm\ + B23uoc7q+16v/90oTpc61vlJBGDSuLYiACwCd5XBuwN6lwvTHKy1I8BmpryDJ0D2oVOG9v7rQys/\ + m5b2Blf3PTN1Ku7ioTUd/Fcn+cZJ43raYtlW9WPsdA5LhygOtobo+XODzTTP8PF07UmDP+0xgK7V\ + 6Y5SNlxsFJjzzw8O1XXVigAm8KE7aBQgry7AEDVT036JCgAvEa6iiQEQ3forA0t+03IA/qlBDdRj\ + 91os72jr//6F99BtOGAy6Dhwv9y8o8Hzc8dgNe6Gn1FMJ/VH6GdO5fhGYWq4e+/8fKD9PPF7r+O4\ + 8GGi+eArtbt9p2+qbm/mQ6/cMr5Ww5r1T8wBBFKBJWeKfXcvkeAnyAU8+pd3EelDHBOVzcB5eu0A\ + dun/Gbg+jK4zFwid9LNi+5cUk/pr+OSgFSca3oOHRhvxsOAP9nJSb7xJk73//Gis1Y89h69/vsBr\ + xxLrMItJ/lVaBGifQF28Xf/I3HmCdLfdRN8HAegvk3vj68G7YjxGANPNxAJZMrncV4wAMOQCRJ8h\ + SD2ysV5h9zEiOUpghhggjWPhJxXoJOPDdt6fqgDweMCCEr4+YP/9X5n5QScwuBepYYZYi1E4FXFJ\ + uLb/j+89kPRn19klq8wKgCsisPfux0ammuga8Im+D8uPjzMzNdEIPy3ainr09+Of3Zc0ndjUcZH4\ + mpliWn8tDwrKXSREvcPP4t/84l9xPa4R43KRfrzzGMZMj0Y9s8EbnH33Yyl/KsVCKrNkxTT/al4k\ + JFYEaPTexDQTNdJhAe6dXf+DNxDtQ8pm6BoJupItxs3Lk8wwJBj8CzYX+4wsY1vbgcOwc7FW0S/r\ + UhuhF6AGFuqQmOzf66j9+595zqCgG6+N8+ozB7mx9z85HBgs+uUWsU5sbgEOSYeD3/igeOrnAWRJ\ + BCg/9w6SBM5DIrIrY+GVteAPIwBFKRWjC6IuNR2g+ei9f7+L6HEcb1nxv76X+eB3ZgzAJREgCwoR\ + cDv4vSXX6ef9YoJfnABABIAt2y8k+Cnoz0oJfpECEBCBJSVwnQCJwKOb/5On7ahOQwN+u3KCP7XR\ + fqcEgEWApghFLhYiO/n15m3s55cM7RbcviNltL8uMfgJMbMAw9i5WCvplxuqe56AOGh+37tlBvv5\ + RVl+StWE7PKrJbGtt6+Tcm0acIwI0HpamiJclNjgvKumYixKAeZ6ferxBW2trnI6qyAAZoTgqjJw\ + 4Yi1fEoLAAlB1LXpIEauT4euGNq/YYDUR/ozKQAsAovsBmalNkZapTZ17kUIQRKBT2cFvvMLSYd6\ + NFV3P3+q+X5mBcCFcQEIgX2rT9t4hQU+sWbj8g4IwHAhuKZflqW3V2/tOt1Giy2/8Rq1DnY6p0GQ\ + 1Q9a/qUkD/KAAByJQJlTgpL0BuxtDX71WVX8zjNwBSFtPp3csy/r8A4fb0ertCm+3AgAiwCNB6y6\ + 4AYOy5HOANApAh0YAjHoh4Kdgt47sUfmoqsOB77IOy9yJQAuuoE+Mfj2aZ0izOb3WjLO6w/ufy45\ + 6EX3+rkXAFfdwDFmprzbiemsABo7yKw70AFOJ/LSoh3vZF8DB68kQFt1D+0Uf9NVbgUgIAQ0Q0CD\ + hGWnA4XOxnvuW6p45glVeO6p7mGZDq469I/vph5+n05ddiPgg9D9fDXJvT4EYLAQVFgIZlVWIFGg\ + wzD5QEzv9dRM+m6BenUK7N0973KV/Z3u8eoOBnuQJtv99jEr8LdNak/l0o/LGANwQARmOSW4kikh\ + GCEORPH5bx3V23P9y5THLV327kfoycW9YOa7Dg6++Lob4HS7jttBPszuVwdN7engr3CaWdLPvBaB\ + FgTADSEoccVVFADDA39t0Br+nsA/dAhaABYgABAC4DaU218flOfrwC9zeykPee+CFoEmBABCAPIV\ + +GJdAAQAQgAmsPr6acQI/CCixgIgAP35Gw0CtkZZNRYCEoHsDxbmFwrS60Ny/CiB71PXbasKAZAr\ + AA84qEkANnRl1UcIAX3fouof8AHuQvW9MWRUP07gB1OJs7pddSAAMgXgYJgFHFVpvLz4MtIDZ23+\ + hureutse0CZ8t2dqW3l1VMcCAZAlAEHlpkq7riuvPYErMNlgQPK9vb8m5LIFd0edyRIEwC0BOFaB\ + LATNUd/EYwVXWBCQIsiA6m5TDRjU4/qf4zqz6eQ6uu2chgDIC36y8VshrePY9IDFYI57E4iBvKCf\ + VUeDuknVjYjZAAhAv/rfiqLoAVcwtlJZDPwxA6QJFnpY1R3EHRr0XN+LAVFOGhHjABCAaCnAKLzp\ + o0lcQc+YwQUWBbiD6OXuBf2oI7dY5P3B2jSncNd0+7gKAcieAAy0npNO+wTcwQV2BxCE0QG/Ta+j\ + tt8Ggl5S+gUByIEABPEbayNM7scDiSQI51kQyjkM9jYH/G0O9uYE9VjigJeaZkEAhArA3QR6CT9H\ + 9Rp02A0i7BJ8d3CBX7PiFJoc8B/w162wh2voOtxyQCidEoDpnPU2toPJz/u9VYS6wQYdQotFYWij\ + 55tkWgOEocw/m8ThaX6dFdYDdgKffTvw3+1Bi3Aisp1Tp2SNPDkAKXcItAMuoWViGykLhE/w698Y\ + IXqDBKQ5JvgGBbvJAJfi5OLg1CxAnhzAB0I+BzXeSqBB+4G3qRtOLcoP7MmdmxmvR9pwsyX487Vc\ + KsxijgRAcmD4Fh+MU8+uY6oJ/XhticeDQQC6DafF1hUC5X5drgjtaTdcK8tiztpOQ3CjhgCEY0mY\ + oHcEOxMIALOJ3j8zLqCtXxYEicCalLMAIADDG01DaBqwiZCOnNatSHCWUQdwIQDJcx2pSaZEoK66\ + MwNp0Ur590MAQlIT5gJaow4iAROLwHwK9Uqp24KL1j+3AsCVJckFXEcIG0sHFlRyswM1Ogrc5eDP\ + qwPwXYCEXrcD+29FBGzm4y3u9VeyUGa5vRcgwilBNhCxcSSLGDrp99iP5Pqqu/D3YzfgZI3kKjeS\ + tHr/s65bSEeEwD+/MQrk0Dak3gIMAYjfQNZVOkd+V13pTTJSzyV2A5dUdz/GsJ2UTbb53oEkrgo0\ + BEC2CIg5Phpkk0njuoii8gaPaB43qd6YcskqSh1IAAJwXASqyu5cMv3sJeT9AAIgUwTIBdCCEhsD\ + PtTzL7i2XRRkG4wBDB8XKCtz00gkKFX0/EDaGAAEYLwQlFT0a8Cot19zbQoJQAAgAIPFwD+++zyL\ + QXlAju9PITVg90HmBAAAkB0wCAgABAAAAAEAAEAAAAAQAAAABAAAAAEAAEAAAAAQAAAABAAAAAEA\ + AEAAAAAQAAAABAAAAAEAAEAAAAAQAAAABAAAAAEAAEAAAAAQAAAABAAAAAEAAEAAAAD2+H8BBgCz\ + 4xkvbY9d6gAAAABJRU5ErkJggg==" + local heart_png = + "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ\ + bWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdp\ + bj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6\ + eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEz\ + NDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJo\ + dHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlw\ + dGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAv\ + IiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RS\ + ZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpD\ + cmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlE\ + PSJ4bXAuaWlkOjk3NUYxN0NGOUQ5RDExRTA5MTgyQjc4MkNEQkY5RkI1IiB4bXBNTTpEb2N1bWVu\ + dElEPSJ4bXAuZGlkOjk3NUYxN0QwOUQ5RDExRTA5MTgyQjc4MkNEQkY5RkI1Ij4gPHhtcE1NOkRl\ + cml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OTc1RjE3Q0Q5RDlEMTFFMDkxODJC\ + NzgyQ0RCRjlGQjUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6OTc1RjE3Q0U5RDlEMTFFMDkx\ + ODJCNzgyQ0RCRjlGQjUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1l\ + dGE+IDw/eHBhY2tldCBlbmQ9InIiPz7MtgYTAAACd0lEQVR42uyajW2CUBDHH8YBWKBJR8AJChvY\ + AZriBNYJrBOIE9imA6gTyAZlg9p0ATaw99IzfSEgvI9DlLvk5UUUuPu9/71PvePxKPpsA9FzYwAM\ + gAEwAAbAABgAA2AADIABMAAG0EcbmtzkeV7p9Z+nVQhViB8PUNK7j+nBxkF4ZgzVHMp9ydeZfAeU\ + d3hPVnZ/3X6HZ7IhUgQATgZQraEEJT+XDi7AwVQzcB+qjQK0zuTzJ0Xg5ACw1aWjfs1tCTg30wh+\ + XwH0nOVQIlUNpACw5fcNglclKx3MCYJXIYxOSqiLb2CRm75m8AKD+kJwVba2CF6gP+s2RoGlZvCq\ + g/syCHDtFaqxg849hGeNyQDAw2WPHFu20gZVpKbT3OEI90ypgKkDB+9RCScIG8dDfCMFDE0l5shJ\ + 2epLgPBdMc5bGaoqowAQOPQzFnTmU6XAVViTydctA2g0Bb9lAGnfAewoAaQdDz6H/N9SAth1HMCK\ + eiq87XLry5UnKQBcaXUVwurcatNlJzi79ta3AoAqSDoGYKHT+tYbIjjf/nQ8NTa1DIIfFS+SbYgo\ + 9ojSu7RNTG6yBoCpEF0YwqJqV5g8BQpLT90tMjLpt5kCJyVkqIRDi8HnptInWQsghFHdJoRDm5lK\ + n2wxhMOQVMIbcfDynMH6Hc76gDKDfuFF/O0eO1/qQvBRkx+21gdUqCHBlHDZL2Q49Dox8v0ApV9I\ + HAUf6c72LpYCJSkRYkoEbQXfyumwAYhYVB95O235TgIogJjWKCKVOW8q+04DKMwi5UnOg/g/dMlx\ + imvVd5AAuCXjP0kxAAbAABgAA2AADIABMAAGwAB6ab8CDACjlPepVvE3rwAAAABJRU5ErkJggg==" + + local hearts = {} + local rings = {} + + local cx = 400 + local cy = 300 + + local pig + local heart_image + + local function add_heart_ring(radius, number, speed) + local step = math.pi*2/number + for i = 1,number do + local heart = { + radius = radius, + position = step*i, + speed = speed, + opacity = radius/450 + } + table.insert(hearts, heart) + end + table.insert(rings, radius) + end + + local function update_hearts(dt) + for i,v in ipairs(hearts) do + v.position = v.position + v.speed*dt*0.6 + end + end + + local function draw_hearts() + for i,v in ipairs(hearts) do + local x = math.cos(v.position) * v.radius + cx + local y = math.sin(v.position) * v.radius + cy + love.graphics.setColor(255, 255, 255, v.opacity*255) + love.graphics.draw(heart_image, x, y, v.position+0.4, 1, 1, 32, 32) + end + end + + local function draw_pig(p) + love.graphics.setColor(255, 255, 255, 255) + love.graphics.draw(p.img, p.x, p.y, 0, 1, 1, 128, 128) + end + + local function loadimage(file, name) + return love.graphics.newImage(love.image.newImageData(love.filesystem.newFileData(file, name:gsub("_", "."), "base64"))) + end + + function love.load() + math.randomseed(os.time()) + pig = { + x = cx, + y = cy, + img = loadimage(pig_png, "pig.png") + } + heart_image = loadimage(heart_png, "heart.png") + + add_heart_ring(100, 10, 2.4) + add_heart_ring(150, 20, 2.2) + add_heart_ring(200, 25, 2.0) + add_heart_ring(250, 35, 1.8) + add_heart_ring(300, 40, 1.6) + add_heart_ring(350, 50, 1.4) + add_heart_ring(400, 60, 1.2) + add_heart_ring(450, 70, 1) + end + + function love.update(dt) + update_hearts(dt) + end + + function love.draw() + love.graphics.setBackgroundColor(254, 224, 238) + draw_hearts() + draw_pig(pig) + end + + function love.keyreleased(key) + if key == "escape" then + love.event.quit() + end + end + + function love.conf(t) + t.title = "L\195\150VE " .. love._version .. " (" .. love._version_codename .. ")" + t.modules.audio = false + t.modules.sound = false + t.modules.physics = false + t.modules.joystick = false + end +end + +----------------------------------------------------------- +-- Error screen. +----------------------------------------------------------- + +local debug = debug + +local function error_printer(msg, layer) + print((debug.traceback("Error: " .. tostring(msg), 1+(layer or 1)):gsub("\n[^\n]+$", ""))) +end + +function love.errhand(msg) + msg = tostring(msg) + + error_printer(msg, 2) + + if not love.graphics or not love.event or not love.graphics.isCreated() then + return + end + + -- Load. + if love.audio then love.audio.stop() end + love.graphics.reset() + love.graphics.setBackgroundColor(89, 157, 220) + local font = love.graphics.newFont(14) + love.graphics.setFont(font) + + love.graphics.setColor(255, 255, 255, 255) + + local trace = debug.traceback() + + love.graphics.clear() + + local err = {} + + table.insert(err, "Error\n") + table.insert(err, msg.."\n\n") + + for l in string.gmatch(trace, "(.-)\n") do + if not string.match(l, "boot.lua") then + l = string.gsub(l, "stack traceback:", "Traceback\n") + table.insert(err, l) + end + end + + local p = table.concat(err, "\n") + + p = string.gsub(p, "\t", "") + p = string.gsub(p, "%[string \"(.-)\"%]", "%1") + + local function draw() + love.graphics.clear() + love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70) + love.graphics.present() + end + + draw() + + local e, a, b, c + while true do + e, a, b, c = love.event.wait() + + if e == "quit" then + return + end + if e == "keypressed" and a == "escape" then + return + end + + draw() + + end + +end + +function love.releaseerrhand(msg) + print("An error has occured, the game has been stopped.") + + if not love.graphics or not love.event or not love.graphics.isCreated() then + return + end + + love.graphics.setCanvas() + love.graphics.setPixelEffect() + + -- Load. + if love.audio then love.audio.stop() end + love.graphics.reset() + love.graphics.setBackgroundColor(89, 157, 220) + local font = love.graphics.newFont(14) + love.graphics.setFont(font) + + love.graphics.setColor(255, 255, 255, 255) + + love.graphics.clear() + + local err = {} + + p = string.format("An error has occured that caused %s to stop.\nYou can notify %s about this%s.", love._release.title or "this game", love._release.author or "the author", love._release.url and " at " .. love._release.url or "") + + local function draw() + love.graphics.clear() + love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70) + love.graphics.present() + end + + draw() + + local e, a, b, c + while true do + e, a, b, c = love.event.wait() + + if e == "quit" then + return + end + if e == "keypressed" and a == "escape" then + return + end + + draw() + + end +end + + +----------------------------------------------------------- +-- The root of all calls. +----------------------------------------------------------- + +return function() + local result = xpcall(love.boot, error_printer) + if not result then return 1 end + local result = xpcall(love.init, love._release and love.releaseerrhand or love.errhand) + if not result then return 1 end + local result, retval = xpcall(love.run, love._release and love.releaseerrhand or love.errhand) + if not result then return 1 end + + return tonumber(retval) or 0 +end diff --git a/src/scripts/graphics.lua b/src/scripts/graphics.lua index c5ea5a863..133550cb3 100644 --- a/src/scripts/graphics.lua +++ b/src/scripts/graphics.lua @@ -1,1374 +1,1374 @@ ---[[ -Copyright (c) 2006-2012 LOVE Development Team - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. ---]] - -do - - local vera_ttf = love.filesystem.newFileData([[ - AAEAAAARAQAABAAQT1MvMrRf9GMAAOtwAAAAVlBDTFTRil6XAADryAAAADZjbWFwpMPooAAA - sWwAAANYY3Z0IP/THTkAAB78AAAB/GZwZ23ntPHEAAAmYAAAAItnYXNwAAcABwABAUgAAAAM - Z2x5Zgx0Qc8AACbsAACKfmhkbXg08CEOAADsAAAAFUhoZWFk3YSi0AABAVQAAAA2aGhlYRBF - CG8AAOtMAAAAJGhtdHgJxo6yAAC0xAAABDBrZXJu3FLVmQAAvaAAAC2KbG9jYfPL0j0AALuE - AAACGm1heHAFRwY6AADrLAAAACBuYW1l2bzItQAAARwAAB3fcG9zdLRaL7sAALj0AAACjnBy - ZXA7B/EAAAAg+AAABWgAAAAWAQ4AAQAAAAAAAAA6AAAAAQAAAAAAAQATADoAAQAAAAAAAgAF - AF8AAQAAAAAAAwATADoAAQAAAAAABAATADoAAQAAAAAABQAMAGQAAQAAAAAABgAXAE0AAQAA - AAAABwAwAK0AAQAAAAAACAAOCGwAAQAAAAAACwAYCYMAAQAAAAAADQkTAHAAAwABBAkAAAB0 - CZsAAwABBAkAAQAmCg8AAwABBAkAAgAKClkAAwABBAkAAwAmCg8AAwABBAkABAAmCg8AAwAB - BAkABQAYCmMAAwABBAkABgAuCjUAAwABBAkABwBgCvUAAwABBAkACAAcGnMAAwABBAkACwAw - HKEAAwABBAkADRImCntDb3B5cmlnaHQgKGMpIDIwMDMgYnkgQml0c3RyZWFtLCBJbmMuIEFs - bCBSaWdodHMgUmVzZXJ2ZWQuQml0c3RyZWFtIFZlcmEgU2Fuc0JpdHN0cmVhbVZlcmFTYW5z - LVJvbWFuUmVsZWFzZSAxLjEwQ29weXJpZ2h0IChjKSAyMDAzIGJ5IEJpdHN0cmVhbSwgSW5j - Lg0KQWxsIFJpZ2h0cyBSZXNlcnZlZC4NCkJpdHN0cmVhbSBWZXJhIGlzIGEgdHJhZGVtYXJr - IG9mIEJpdHN0cmVhbSwgSW5jLg0KDQpQZXJtaXNzaW9uIGlzIGhlcmVieSBncmFudGVkLCBm - cmVlIG9mIGNoYXJnZSwgdG8gYW55IHBlcnNvbiBvYnRhaW5pbmcgYSBjb3B5IG9mIHRoZSBm - b250cyBhY2NvbXBhbnlpbmcgdGhpcyBsaWNlbnNlICgiRm9udHMiKSBhbmQgYXNzb2NpYXRl - ZCBkb2N1bWVudGF0aW9uIGZpbGVzICh0aGUgIkZvbnQgU29mdHdhcmUiKSwgdG8gcmVwcm9k - dWNlIGFuZCBkaXN0cmlidXRlIHRoZSBGb250IFNvZnR3YXJlLCBpbmNsdWRpbmcgd2l0aG91 - dCBsaW1pdGF0aW9uIHRoZSByaWdodHMgdG8gdXNlLCBjb3B5LCBtZXJnZSwgcHVibGlzaCwg - ZGlzdHJpYnV0ZSwgYW5kL29yIHNlbGwgY29waWVzIG9mIHRoZSBGb250IFNvZnR3YXJlLCBh - bmQgdG8gcGVybWl0IHBlcnNvbnMgdG8gd2hvbSB0aGUgRm9udCBTb2Z0d2FyZSBpcyBmdXJu - aXNoZWQgdG8gZG8gc28sIHN1YmplY3QgdG8gdGhlIGZvbGxvd2luZyBjb25kaXRpb25zOg0K - DQpUaGUgYWJvdmUgY29weXJpZ2h0IGFuZCB0cmFkZW1hcmsgbm90aWNlcyBhbmQgdGhpcyBw - ZXJtaXNzaW9uIG5vdGljZSBzaGFsbCBiZSBpbmNsdWRlZCBpbiBhbGwgY29waWVzIG9mIG9u - ZSBvciBtb3JlIG9mIHRoZSBGb250IFNvZnR3YXJlIHR5cGVmYWNlcy4NCg0KVGhlIEZvbnQg - U29mdHdhcmUgbWF5IGJlIG1vZGlmaWVkLCBhbHRlcmVkLCBvciBhZGRlZCB0bywgYW5kIGlu - IHBhcnRpY3VsYXIgdGhlIGRlc2lnbnMgb2YgZ2x5cGhzIG9yIGNoYXJhY3RlcnMgaW4gdGhl - IEZvbnRzIG1heSBiZSBtb2RpZmllZCBhbmQgYWRkaXRpb25hbCBnbHlwaHMgb3IgY2hhcmFj - dGVycyBtYXkgYmUgYWRkZWQgdG8gdGhlIEZvbnRzLCBvbmx5IGlmIHRoZSBmb250cyBhcmUg - cmVuYW1lZCB0byBuYW1lcyBub3QgY29udGFpbmluZyBlaXRoZXIgdGhlIHdvcmRzICJCaXRz - dHJlYW0iIG9yIHRoZSB3b3JkICJWZXJhIi4NCg0KVGhpcyBMaWNlbnNlIGJlY29tZXMgbnVs - bCBhbmQgdm9pZCB0byB0aGUgZXh0ZW50IGFwcGxpY2FibGUgdG8gRm9udHMgb3IgRm9udCBT - b2Z0d2FyZSB0aGF0IGhhcyBiZWVuIG1vZGlmaWVkIGFuZCBpcyBkaXN0cmlidXRlZCB1bmRl - ciB0aGUgIkJpdHN0cmVhbSBWZXJhIiBuYW1lcy4NCg0KVGhlIEZvbnQgU29mdHdhcmUgbWF5 - IGJlIHNvbGQgYXMgcGFydCBvZiBhIGxhcmdlciBzb2Z0d2FyZSBwYWNrYWdlIGJ1dCBubyBj - b3B5IG9mIG9uZSBvciBtb3JlIG9mIHRoZSBGb250IFNvZnR3YXJlIHR5cGVmYWNlcyBtYXkg - YmUgc29sZCBieSBpdHNlbGYuDQoNClRIRSBGT05UIFNPRlRXQVJFIElTIFBST1ZJREVEICJB - UyBJUyIsIFdJVEhPVVQgV0FSUkFOVFkgT0YgQU5ZIEtJTkQsIEVYUFJFU1MgT1IgSU1QTElF - RCwgSU5DTFVESU5HIEJVVCBOT1QgTElNSVRFRCBUTyBBTlkgV0FSUkFOVElFUyBPRiBNRVJD - SEFOVEFCSUxJVFksIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFIEFORCBOT05J - TkZSSU5HRU1FTlQgT0YgQ09QWVJJR0hULCBQQVRFTlQsIFRSQURFTUFSSywgT1IgT1RIRVIg - UklHSFQuIElOIE5PIEVWRU5UIFNIQUxMIEJJVFNUUkVBTSBPUiBUSEUgR05PTUUgRk9VTkRB - VElPTiBCRSBMSUFCTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdFUyBPUiBPVEhFUiBMSUFCSUxJ - VFksIElOQ0xVRElORyBBTlkgR0VORVJBTCwgU1BFQ0lBTCwgSU5ESVJFQ1QsIElOQ0lERU5U - QUwsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0Yg - Q09OVFJBQ1QsIFRPUlQgT1IgT1RIRVJXSVNFLCBBUklTSU5HIEZST00sIE9VVCBPRiBUSEUg - VVNFIE9SIElOQUJJTElUWSBUTyBVU0UgVEhFIEZPTlQgU09GVFdBUkUgT1IgRlJPTSBPVEhF - UiBERUFMSU5HUyBJTiBUSEUgRk9OVCBTT0ZUV0FSRS4NCg0KRXhjZXB0IGFzIGNvbnRhaW5l - ZCBpbiB0aGlzIG5vdGljZSwgdGhlIG5hbWVzIG9mIEdub21lLCB0aGUgR25vbWUgRm91bmRh - dGlvbiwgYW5kIEJpdHN0cmVhbSBJbmMuLCBzaGFsbCBub3QgYmUgdXNlZCBpbiBhZHZlcnRp - c2luZyBvciBvdGhlcndpc2UgdG8gcHJvbW90ZSB0aGUgc2FsZSwgdXNlIG9yIG90aGVyIGRl - YWxpbmdzIGluIHRoaXMgRm9udCBTb2Z0d2FyZSB3aXRob3V0IHByaW9yIHdyaXR0ZW4gYXV0 - aG9yaXphdGlvbiBmcm9tIHRoZSBHbm9tZSBGb3VuZGF0aW9uIG9yIEJpdHN0cmVhbSBJbmMu - LCByZXNwZWN0aXZlbHkuIEZvciBmdXJ0aGVyIGluZm9ybWF0aW9uLCBjb250YWN0OiBmb250 - cyBhdCBnbm9tZSBkb3Qgb3JnLmh0dHA6Ly93d3cuYml0c3RyZWFtLmNvbQBDAG8AcAB5AHIA - aQBnAGgAdAAgACgAYwApACAAMgAwADAAMwAgAGIAeQAgAEIAaQB0AHMAdAByAGUAYQBtACwA - IABJAG4AYwAuACAAQQBsAGwAIABSAGkAZwBoAHQAcwAgAFIAZQBzAGUAcgB2AGUAZAAuAEIA - aQB0AHMAdAByAGUAYQBtACAAVgBlAHIAYQAgAFMAYQBuAHMAQgBpAHQAcwB0AHIAZQBhAG0A - VgBlAHIAYQBTAGEAbgBzAC0AUgBvAG0AYQBuAFIAZQBsAGUAYQBzAGUAIAAxAC4AMQAwAEMA - bwBwAHkAcgBpAGcAaAB0ACAAKABjACkAIAAyADAAMAAzACAAYgB5ACAAQgBpAHQAcwB0AHIA - ZQBhAG0ALAAgAEkAbgBjAC4ADQAKAEEAbABsACAAUgBpAGcAaAB0AHMAIABSAGUAcwBlAHIA - dgBlAGQALgANAAoAQgBpAHQAcwB0AHIAZQBhAG0AIABWAGUAcgBhACAAaQBzACAAYQAgAHQA - cgBhAGQAZQBtAGEAcgBrACAAbwBmACAAQgBpAHQAcwB0AHIAZQBhAG0ALAAgAEkAbgBjAC4A - DQAKAA0ACgBQAGUAcgBtAGkAcwBzAGkAbwBuACAAaQBzACAAaABlAHIAZQBiAHkAIABnAHIA - YQBuAHQAZQBkACwAIABmAHIAZQBlACAAbwBmACAAYwBoAGEAcgBnAGUALAAgAHQAbwAgAGEA - bgB5ACAAcABlAHIAcwBvAG4AIABvAGIAdABhAGkAbgBpAG4AZwAgAGEAIABjAG8AcAB5ACAA - bwBmACAAdABoAGUAIABmAG8AbgB0AHMAIABhAGMAYwBvAG0AcABhAG4AeQBpAG4AZwAgAHQA - aABpAHMAIABsAGkAYwBlAG4AcwBlACAAKAAiAEYAbwBuAHQAcwAiACkAIABhAG4AZAAgAGEA - cwBzAG8AYwBpAGEAdABlAGQAIABkAG8AYwB1AG0AZQBuAHQAYQB0AGkAbwBuACAAZgBpAGwA - ZQBzACAAKAB0AGgAZQAgACIARgBvAG4AdAAgAFMAbwBmAHQAdwBhAHIAZQAiACkALAAgAHQA - bwAgAHIAZQBwAHIAbwBkAHUAYwBlACAAYQBuAGQAIABkAGkAcwB0AHIAaQBiAHUAdABlACAA - dABoAGUAIABGAG8AbgB0ACAAUwBvAGYAdAB3AGEAcgBlACwAIABpAG4AYwBsAHUAZABpAG4A - ZwAgAHcAaQB0AGgAbwB1AHQAIABsAGkAbQBpAHQAYQB0AGkAbwBuACAAdABoAGUAIAByAGkA - ZwBoAHQAcwAgAHQAbwAgAHUAcwBlACwAIABjAG8AcAB5ACwAIABtAGUAcgBnAGUALAAgAHAA - dQBiAGwAaQBzAGgALAAgAGQAaQBzAHQAcgBpAGIAdQB0AGUALAAgAGEAbgBkAC8AbwByACAA - cwBlAGwAbAAgAGMAbwBwAGkAZQBzACAAbwBmACAAdABoAGUAIABGAG8AbgB0ACAAUwBvAGYA - dAB3AGEAcgBlACwAIABhAG4AZAAgAHQAbwAgAHAAZQByAG0AaQB0ACAAcABlAHIAcwBvAG4A - cwAgAHQAbwAgAHcAaABvAG0AIAB0AGgAZQAgAEYAbwBuAHQAIABTAG8AZgB0AHcAYQByAGUA - IABpAHMAIABmAHUAcgBuAGkAcwBoAGUAZAAgAHQAbwAgAGQAbwAgAHMAbwAsACAAcwB1AGIA - agBlAGMAdAAgAHQAbwAgAHQAaABlACAAZgBvAGwAbABvAHcAaQBuAGcAIABjAG8AbgBkAGkA - dABpAG8AbgBzADoADQAKAA0ACgBUAGgAZQAgAGEAYgBvAHYAZQAgAGMAbwBwAHkAcgBpAGcA - aAB0ACAAYQBuAGQAIAB0AHIAYQBkAGUAbQBhAHIAawAgAG4AbwB0AGkAYwBlAHMAIABhAG4A - ZAAgAHQAaABpAHMAIABwAGUAcgBtAGkAcwBzAGkAbwBuACAAbgBvAHQAaQBjAGUAIABzAGgA - YQBsAGwAIABiAGUAIABpAG4AYwBsAHUAZABlAGQAIABpAG4AIABhAGwAbAAgAGMAbwBwAGkA - ZQBzACAAbwBmACAAbwBuAGUAIABvAHIAIABtAG8AcgBlACAAbwBmACAAdABoAGUAIABGAG8A - bgB0ACAAUwBvAGYAdAB3AGEAcgBlACAAdAB5AHAAZQBmAGEAYwBlAHMALgANAAoADQAKAFQA - aABlACAARgBvAG4AdAAgAFMAbwBmAHQAdwBhAHIAZQAgAG0AYQB5ACAAYgBlACAAbQBvAGQA - aQBmAGkAZQBkACwAIABhAGwAdABlAHIAZQBkACwAIABvAHIAIABhAGQAZABlAGQAIAB0AG8A - LAAgAGEAbgBkACAAaQBuACAAcABhAHIAdABpAGMAdQBsAGEAcgAgAHQAaABlACAAZABlAHMA - aQBnAG4AcwAgAG8AZgAgAGcAbAB5AHAAaABzACAAbwByACAAYwBoAGEAcgBhAGMAdABlAHIA - cwAgAGkAbgAgAHQAaABlACAARgBvAG4AdABzACAAbQBhAHkAIABiAGUAIABtAG8AZABpAGYA - aQBlAGQAIABhAG4AZAAgAGEAZABkAGkAdABpAG8AbgBhAGwAIABnAGwAeQBwAGgAcwAgAG8A - cgAgAGMAaABhAHIAYQBjAHQAZQByAHMAIABtAGEAeQAgAGIAZQAgAGEAZABkAGUAZAAgAHQA - bwAgAHQAaABlACAARgBvAG4AdABzACwAIABvAG4AbAB5ACAAaQBmACAAdABoAGUAIABmAG8A - bgB0AHMAIABhAHIAZQAgAHIAZQBuAGEAbQBlAGQAIAB0AG8AIABuAGEAbQBlAHMAIABuAG8A - dAAgAGMAbwBuAHQAYQBpAG4AaQBuAGcAIABlAGkAdABoAGUAcgAgAHQAaABlACAAdwBvAHIA - ZABzACAAIgBCAGkAdABzAHQAcgBlAGEAbQAiACAAbwByACAAdABoAGUAIAB3AG8AcgBkACAA - IgBWAGUAcgBhACIALgANAAoADQAKAFQAaABpAHMAIABMAGkAYwBlAG4AcwBlACAAYgBlAGMA - bwBtAGUAcwAgAG4AdQBsAGwAIABhAG4AZAAgAHYAbwBpAGQAIAB0AG8AIAB0AGgAZQAgAGUA - eAB0AGUAbgB0ACAAYQBwAHAAbABpAGMAYQBiAGwAZQAgAHQAbwAgAEYAbwBuAHQAcwAgAG8A - cgAgAEYAbwBuAHQAIABTAG8AZgB0AHcAYQByAGUAIAB0AGgAYQB0ACAAaABhAHMAIABiAGUA - ZQBuACAAbQBvAGQAaQBmAGkAZQBkACAAYQBuAGQAIABpAHMAIABkAGkAcwB0AHIAaQBiAHUA - dABlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgACIAQgBpAHQAcwB0AHIAZQBhAG0AIABWAGUA - cgBhACIAIABuAGEAbQBlAHMALgANAAoADQAKAFQAaABlACAARgBvAG4AdAAgAFMAbwBmAHQA - dwBhAHIAZQAgAG0AYQB5ACAAYgBlACAAcwBvAGwAZAAgAGEAcwAgAHAAYQByAHQAIABvAGYA - IABhACAAbABhAHIAZwBlAHIAIABzAG8AZgB0AHcAYQByAGUAIABwAGEAYwBrAGEAZwBlACAA - YgB1AHQAIABuAG8AIABjAG8AcAB5ACAAbwBmACAAbwBuAGUAIABvAHIAIABtAG8AcgBlACAA - bwBmACAAdABoAGUAIABGAG8AbgB0ACAAUwBvAGYAdAB3AGEAcgBlACAAdAB5AHAAZQBmAGEA - YwBlAHMAIABtAGEAeQAgAGIAZQAgAHMAbwBsAGQAIABiAHkAIABpAHQAcwBlAGwAZgAuAA0A - CgANAAoAVABIAEUAIABGAE8ATgBUACAAUwBPAEYAVABXAEEAUgBFACAASQBTACAAUABSAE8A - VgBJAEQARQBEACAAIgBBAFMAIABJAFMAIgAsACAAVwBJAFQASABPAFUAVAAgAFcAQQBSAFIA - QQBOAFQAWQAgAE8ARgAgAEEATgBZACAASwBJAE4ARAAsACAARQBYAFAAUgBFAFMAUwAgAE8A - UgAgAEkATQBQAEwASQBFAEQALAAgAEkATgBDAEwAVQBEAEkATgBHACAAQgBVAFQAIABOAE8A - VAAgAEwASQBNAEkAVABFAEQAIABUAE8AIABBAE4AWQAgAFcAQQBSAFIAQQBOAFQASQBFAFMA - IABPAEYAIABNAEUAUgBDAEgAQQBOAFQAQQBCAEkATABJAFQAWQAsACAARgBJAFQATgBFAFMA - UwAgAEYATwBSACAAQQAgAFAAQQBSAFQASQBDAFUATABBAFIAIABQAFUAUgBQAE8AUwBFACAA - QQBOAEQAIABOAE8ATgBJAE4ARgBSAEkATgBHAEUATQBFAE4AVAAgAE8ARgAgAEMATwBQAFkA - UgBJAEcASABUACwAIABQAEEAVABFAE4AVAAsACAAVABSAEEARABFAE0AQQBSAEsALAAgAE8A - UgAgAE8AVABIAEUAUgAgAFIASQBHAEgAVAAuACAASQBOACAATgBPACAARQBWAEUATgBUACAA - UwBIAEEATABMACAAQgBJAFQAUwBUAFIARQBBAE0AIABPAFIAIABUAEgARQAgAEcATgBPAE0A - RQAgAEYATwBVAE4ARABBAFQASQBPAE4AIABCAEUAIABMAEkAQQBCAEwARQAgAEYATwBSACAA - QQBOAFkAIABDAEwAQQBJAE0ALAAgAEQAQQBNAEEARwBFAFMAIABPAFIAIABPAFQASABFAFIA - IABMAEkAQQBCAEkATABJAFQAWQAsACAASQBOAEMATABVAEQASQBOAEcAIABBAE4AWQAgAEcA - RQBOAEUAUgBBAEwALAAgAFMAUABFAEMASQBBAEwALAAgAEkATgBEAEkAUgBFAEMAVAAsACAA - SQBOAEMASQBEAEUATgBUAEEATAAsACAATwBSACAAQwBPAE4AUwBFAFEAVQBFAE4AVABJAEEA - TAAgAEQAQQBNAEEARwBFAFMALAAgAFcASABFAFQASABFAFIAIABJAE4AIABBAE4AIABBAEMA - VABJAE8ATgAgAE8ARgAgAEMATwBOAFQAUgBBAEMAVAAsACAAVABPAFIAVAAgAE8AUgAgAE8A - VABIAEUAUgBXAEkAUwBFACwAIABBAFIASQBTAEkATgBHACAARgBSAE8ATQAsACAATwBVAFQA - IABPAEYAIABUAEgARQAgAFUAUwBFACAATwBSACAASQBOAEEAQgBJAEwASQBUAFkAIABUAE8A - IABVAFMARQAgAFQASABFACAARgBPAE4AVAAgAFMATwBGAFQAVwBBAFIARQAgAE8AUgAgAEYA - UgBPAE0AIABPAFQASABFAFIAIABEAEUAQQBMAEkATgBHAFMAIABJAE4AIABUAEgARQAgAEYA - TwBOAFQAIABTAE8ARgBUAFcAQQBSAEUALgANAAoADQAKAEUAeABjAGUAcAB0ACAAYQBzACAA - YwBvAG4AdABhAGkAbgBlAGQAIABpAG4AIAB0AGgAaQBzACAAbgBvAHQAaQBjAGUALAAgAHQA - aABlACAAbgBhAG0AZQBzACAAbwBmACAARwBuAG8AbQBlACwAIAB0AGgAZQAgAEcAbgBvAG0A - ZQAgAEYAbwB1AG4AZABhAHQAaQBvAG4ALAAgAGEAbgBkACAAQgBpAHQAcwB0AHIAZQBhAG0A - IABJAG4AYwAuACwAIABzAGgAYQBsAGwAIABuAG8AdAAgAGIAZQAgAHUAcwBlAGQAIABpAG4A - IABhAGQAdgBlAHIAdABpAHMAaQBuAGcAIABvAHIAIABvAHQAaABlAHIAdwBpAHMAZQAgAHQA - bwAgAHAAcgBvAG0AbwB0AGUAIAB0AGgAZQAgAHMAYQBsAGUALAAgAHUAcwBlACAAbwByACAA - bwB0AGgAZQByACAAZABlAGEAbABpAG4AZwBzACAAaQBuACAAdABoAGkAcwAgAEYAbwBuAHQA - IABTAG8AZgB0AHcAYQByAGUAIAB3AGkAdABoAG8AdQB0ACAAcAByAGkAbwByACAAdwByAGkA - dAB0AGUAbgAgAGEAdQB0AGgAbwByAGkAegBhAHQAaQBvAG4AIABmAHIAbwBtACAAdABoAGUA - IABHAG4AbwBtAGUAIABGAG8AdQBuAGQAYQB0AGkAbwBuACAAbwByACAAQgBpAHQAcwB0AHIA - ZQBhAG0AIABJAG4AYwAuACwAIAByAGUAcwBwAGUAYwB0AGkAdgBlAGwAeQAuACAARgBvAHIA - IABmAHUAcgB0AGgAZQByACAAaQBuAGYAbwByAG0AYQB0AGkAbwBuACwAIABjAG8AbgB0AGEA - YwB0ADoAIABmAG8AbgB0AHMAIABhAHQAIABnAG4AbwBtAGUAIABkAG8AdAAgAG8AcgBnAC4A - aAB0AHQAcAA6AC8ALwB3AHcAdwAuAGIAaQB0AHMAdAByAGUAYQBtAC4AYwBvAG0AATUAuADL - AMsAwQCqAJwBpgC4AGYAAABxAMsAoAKyAIUAdQC4AMMBywGJAi0AywCmAPAA0wCqAIcAywOq - BAABSgAzAMsAAADZBQIA9AFUALQAnAE5ARQBOQcGBAAETgS0BFIEuATnBM0ANwRzBM0EYARz - ATMDogVWBaYFVgU5A8UCEgDJAB8AuAHfAHMAugPpAzMDvAREBA4A3wPNA6oA5QOqBAQAAADL - AI8ApAB7ALgAFAFvAH8CewJSAI8AxwXNAJoAmgBvAMsAzQGeAdMA8AC6AYMA1QCYAwQCSACe - AdUAwQDLAPYAgwNUAn8AAAMzAmYA0wDHAKQAzQCPAJoAcwQABdUBCgD+AisApAC0AJwAAABi - AJwAAAAdAy0F1QXVBdUF8AB/AHsAVACkBrgGFAcjAdMAuADLAKYBwwHsBpMAoADTA1wDcQPb - AYUEIwSoBEgAjwE5ARQBOQNgAI8F1QGaBhQHIwZmAXkEYARgBGAEewCcAAACdwRgAaoA6QRg - B2IAewDFAH8CewAAALQCUgXNAGYAvABmAHcGEADNATsBhQOJAI8AewAAAB0AzQdKBC8AnACc - AAAHfQBvAAAAbwM1AGoAbwB7AK4AsgAtA5YAjwJ7APYAgwNUBjcF9gCPAJwE4QJmAI8BjQL2 - AM0DRAApAGYE7gBzAAAUALgCgED/+/4D+hQD+SUD+DID95YD9g4D9f4D9P4D8yUD8g4D8ZYD - 8CUD74pBBe/+A+6WA+2WA+z6A+v6A+r+A+k6A+hCA+f+A+YyA+XkUwXllgPkikEF5FMD4+Iv - BeP6A+IvA+H+A+D+A98yA94UA92WA9z+A9sSA9p9A9m7A9j+A9aKQQXWfQPV1EcF1X0D1EcD - 09IbBdP+A9IbA9H+A9D+A8/+A87+A82WA8zLHgXM/gPLHgPKMgPJ/gPGhREFxhwDxRYDxP4D - w/4Dwv4Dwf4DwP4Dv/4Dvv4Dvf4DvP4Du/4DuhEDuYYlBbn+A7i3uwW4/gO3tl0Ft7sDt4AE - trUlBbZdQP8DtkAEtSUDtP4Ds5YDsv4Dsf4DsP4Dr/4DrmQDrQ4DrKslBaxkA6uqEgWrJQOq - EgOpikEFqfoDqP4Dp/4Dpv4DpRIDpP4Do6IOBaMyA6IOA6FkA6CKQQWglgOf/gOenQwFnv4D - nQwDnJsZBZxkA5uaEAWbGQOaEAOZCgOY/gOXlg0Fl/4Dlg0DlYpBBZWWA5STDgWUKAOTDgOS - +gORkLsFkf4DkI9dBZC7A5CABI+OJQWPXQOPQASOJQON/gOMiy4FjP4Diy4DioYlBYpBA4mI - CwWJFAOICwOHhiUFh2QDhoURBYYlA4URA4T+A4OCEQWD/gOCEQOB/gOA/gN//gNA/359fQV+ - /gN9fQN8ZAN7VBUFeyUDev4Def4DeA4DdwwDdgoDdf4DdPoDc/oDcvoDcfoDcP4Db/4Dbv4D - bCEDa/4DahFCBWpTA2n+A2h9A2cRQgVm/gNl/gNk/gNj/gNi/gNhOgNg+gNeDANd/gNb/gNa - /gNZWAoFWfoDWAoDVxYZBVcyA1b+A1VUFQVVQgNUFQNTARAFUxgDUhQDUUoTBVH+A1ALA0/+ - A05NEAVO/gNNEANM/gNLShMFS/4DSkkQBUoTA0kdDQVJEANIDQNH/gNGlgNFlgNE/gNDAi0F - Q/oDQrsDQUsDQP4DP/4DPj0SBT4UAz08DwU9EgM8Ow0FPED/DwM7DQM6/gM5/gM4NxQFOPoD - NzYQBTcUAzY1CwU2EAM1CwM0HgMzDQMyMQsFMv4DMQsDMC8LBTANAy8LAy4tCQUuEAMtCQMs - MgMrKiUFK2QDKikSBSolAykSAygnJQUoQQMnJQMmJQsFJg8DJQsDJP4DI/4DIg8DIQEQBSES - AyBkAx/6Ax4dDQUeZAMdDQMcEUIFHP4DG/oDGkIDGRFCBRn+AxhkAxcWGQUX/gMWARAFFhkD - Ff4DFP4DE/4DEhFCBRL+AxECLQURQgMQfQMPZAMO/gMNDBYFDf4DDAEQBQwWAwv+AwoQAwn+ - AwgCLQUI/gMHFAMGZAMEARAFBP4DQBUDAi0FA/4DAgEQBQItAwEQAwD+AwG4AWSFjQErKysr - KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr - KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr - KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysA - KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr - KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr - KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKx22BgUE - AwIBACwgELACJUlksEBRWCDIWSEtLLACJUlksEBRWCDIWSEtLCAQByCwAFCwDXkguP//UFgE - GwVZsAUcsAMlCLAEJSPhILAAULANeSC4//9QWAQbBVmwBRywAyUI4S0sS1BYILD9RURZIS0s - sAIlRWBELSxLU1iwAiWwAiVFRFkhIS0sRUQtAAACAGb+lgRmBaQAAwAHABpADAT7AAb7AQgF - fwIEAC/E1OwxABDU7NTsMBMRIRElIREhZgQA/HMDG/zl/pYHDvjycgYpAAIBNQAAAgAF1QAD - AAkAQEAPBwCDBIECCAcFAQMEAAAKEPw87DI5OTEAL+T8zDABS7ALVFi9AAoAQAABAAoACv/A - OBE3OFm2AAsgC1ALA10lMxUjETMRAyMDATXLy8sUohX+/gXV/XH+mwFlAAIAxQOqAukF1QAD - AAcATUAPBQGEBACBCAQFBgAFAgQIEPz83OwxABD0POwyMAFLsBJUS7ATVFtYvQAIAEAAAQAI - AAj/wDgRNzhZQA8wCUAJUAlgCXAJoAm/CQddAREjESERIxEBb6oCJKoF1f3VAiv91QIrAAAC - AJ4AAAYXBb4AAwAfAGBAMRsLAIcHBB0JBRkNAocXEw8VER8eHBsaFxYVFBMSERAODQwJCAcG - BQQDAgEAGgoYBiAQ/MwXOTEALzzUPDz8PDzUPDzEMuwyMjBAEQsBCwILDAsNFAQaERoSFB8I - AV0BIQMhCwEhEzMDIRUhAyEVIQMjEyEDIxMhNSETITUhEwQX/t1UASVEaAEkaaBnATj+oVIB - Pv6baKBn/ttnoWj+xQFgVP6+AWlmA4X+sgOH/mEBn/5hmv6ymf5iAZ7+YgGemQFOmgGfAAAD - AKr+0wRtBhQAIQAoAC8A1UBVIgIKCwonASYoAgsLCh0BHhwCLykvGwIpKS9CExEQIgobKQQX - BgkqIQUCF4YWBoYFESMaihaJEAAqigWJAi0IFgoeBykaEgMACSIQCQMBByYIDQUGMBD8POz0 - Fzz8Fzz05OwxAC/k7MTU5OwyxBDuEO4REjkRORESFzkREjkwS1NYBxAE7QcQDu0RFzkHEA7t - ERc5BxAE7VkiAUuwCVRYvQAwAEAAAQAwADD/wDgRNzhZAUuwDFRLsBBUW0uwD1RbWL0AMP/A - AAEAMAAwAEA4ETc4WQEjAy4BJzUeARcRLgE1NDY3NTMVHgEXFS4BJxEeARUUBgcDEQ4BFRQW - FxE+ATU0JgK0ZAFp0mpm0W/dydrMZF2uU1OvXOPW49ZkdHpx4X+Be/7TAS0CLS20QEEBAcgk - rJajvA7r6AQfG68qLgT+VSO0nKnDDwMAAZoNalhWYNX+TxFuWlhoAAAFAHH/4wcpBfAACwAX - ACMAJwAzAJVANiQPJSYlJg8nJCdCAJIMHpIujRiSJAaSDI0mEowoJJE0JyEbJQkDDRUOCQ0P - IQ0rDhsNDzELNBD8xOz07BDu9u4RORESOTEAEOQy9Dzk7BDu9u4Q7jBLU1gHEAXtBxAF7Vki - AUuwCVRLsAtUW0uwDFRbS7AUVFtLsA5UW0uwDVRbWL0ANABAAAEANAA0/8A4ETc4WQEiBhUU - FjMyNjU0JicyFhUUBiMiJjU0NgEiBhUUFjMyNjU0JiUzASMTMhYVFAYjIiY1NDYF0VdjY1dV - Y2NVnrq7naC6u/yXVmNiV1djZAMxoPxaoB+evLufn7m6ApGUhIKVlYKDlX/cu7vb27u82wJh - lYKElJSEgZZ/+fMGDdu7vdrbvLrcAAACAIH/4wX+BfAACQAwAc1Alg0BDgyGERIRC4YKCxIS - EQmGAAkVFhUHAQYIhhYWFQIBAwGGHR4dAIYJAB4eHSAfAiEeEQoTChcWFQMYFBETCgcIAgYJ - ERMTCgIBAgMAEQoTChcWAhgVERMKFBETEwpCEgsJAwYACh4DKBUOBignBpUYK5UnlCSRGIwO - EwouCw4JAC4SFScOHgMuEichDhEPEyEDEhsQMRD87MTU1OwQxu4RORESOTkROTkRORE5MQAv - xuT25u4Q7hDGERI5ERc5ERc5MEtTWAcQBe0HBe0RFzkHEAXtERc5BxAF7REXOQcF7REXOQcQ - Be0RFzkHEAjtBxAO7REXOQcQDu0RFzkHEAjtBxAI7QcQDu0RFzlZIrIPMgEBXUCyBwsFIgkp - HAAcAR8CFwsqACoBJhI6ADQSRAteAFkBWgpVEloaWh9ZMGceewCbAJoBmQKXCJULkxWVFpUi - mS0fCQsJDAgRDCcMKBgCGwkZCxkMGREcFBwVFh0fMicAJwEpCSMSKhMqFCgVLzI7CTQSORM/ - MkoJTBRLFUYZTzJWAVoJWQxVElkTXB9fMmoMaRFgMnUBeQx6EZMAkwGXApUFnAecCJ8Imgmb - C5oMkDKgMrAyOV0AXQEOARUUFjMyNjcJAT4BNzMGAgcBIycOASMiADU0NjcuATU0NjMyFhcV - LgEjIgYVFBYB8ltV1KBfpkn+ewH8O0IGugxoXQEX/I9o5IPx/s6GhjAy3rhTpVVXnkRpgzsD - I1GhWJLCP0ACj/34WctyhP7+fv7jk1lXARPXgOFjP308osUkJLYvMW9YM2cAAQDFA6oBbwXV - AAMAQkAKAYQAgQQABQIEBBD87DEAEPTsMAFLsBJUS7ATVFtYvQAEAEAAAQAEAAT/wDgRNzhZ - QA1ABVAFYAVwBZAFoAUGXQERIxEBb6oF1f3VAisAAAEAsP7yAnsGEgANAE9ADwaYAJcODQcA - AxIGABMKDhDc5DLsETk5MQAQ/OwwAUuwE1RYvQAOAEAAAQAOAA7/wDgRNzhZAUuwD1RYvQAO - /8AAAQAOAA4AQDgRNzhZAQYCFRQSFyMmAjU0EjcCe4aCg4WglpWUlwYS5v4+5+f+O+XrAcbg - 3wHE7AABAKT+8gJvBhIADQAfQA8HmACXDgcBAAsSBBMIAA4Q3Dz07BE5OTEAEPzsMBMzFhIV - FAIHIzYSNTQCpKCWlZWWoIWDgwYS7P483+D+OuvlAcXn5wHCAAEAPQJKA8MF8AARAE5ALBAN - CwAEDAkHBAIECAOZBREMmQoBDpESCAwKAwkGEQMBAwIAFA8ECwkUDQYSENQ85DLcPOQyFzkR - Ehc5MQAQ9NQ87DLE7DIXORIXOTABBQUHJREjEQUnJSU3BREzESUDw/6ZAWc6/rBy/rA6AWf+ - mToBUHIBUATfwsNiy/6HAXnLYsPCY8sBef6HywABANkAAAXbBQQACwAjQBEACQGcBwMFAhUE - ABcKBhUIDBDc/Dz8POwxAC/UPPw8xDABESEVIREjESE1IREDrgIt/dOo/dMCLQUE/dOq/dMC - LaoCLQABAJ7/EgHDAP4ABQAZQAwDngCDBgMEARkAGAYQ/OzUzDEAEPzsMDczFQMjE/DTpIFS - /qz+wAFAAAEAZAHfAn8CgwADABG2AJwCBAEABBDczDEAENTsMBMhFSFkAhv95QKDpAAAAQDb - AAABrgD+AAMAEbcAgwIBGQAYBBD87DEAL+wwNzMVI9vT0/7+AAEAAP9CArIF1QADAC1AFAAa - AQIBAhoDAANCAp8AgQQCAAEDL8Q5OTEAEPTsMEtTWAcQBe0HEAXtWSIBMwEjAgiq/fiqBdX5 - bQAAAgCH/+MEjwXwAAsAFwAjQBMGoBIAoAyREowYCRwPHgMcFRsYEPzs9OwxABDk9OwQ7jAB - IgIREBIzMhIREAInMgAREAAjIgAREAACi5ydnZydnZ2d+wEJ/vf7+/73AQkFUP7N/sz+zf7N - ATMBMwE0ATOg/nP+hv6H/nMBjQF5AXoBjQAAAQDhAAAEWgXVAAoAS0AVQgOgBAKgBYEHAKAJ - CB8GHAMAHwELENTsxPzsMQAv7DL07NTsMEtTWFkiAUuwD1RYvQAL/8AAAQALAAsAQDgRNzhZ - tA8DDwQCXTchEQU1JTMRIRUh/gFK/pkBZcoBSvykqgRzSLhI+tWqAAABAJYAAARKBfAAHACl - QCcZGhsDGBwRBQQAEQUFBEIQoRGUDaAUkQQAoAIAEAoCAQocFxADBh0Q/MTU7MDAERI5MQAv - 7DL07PTsMEtTWAcQBe0HBe0RFzlZIgFLsBVUS7AWVFtLsBRUW1i9AB0AQAABAB0AHf/AOBE3 - OFlAMlUEVgVWB3oEegV2G4cZBwQABBkEGgQbBRx0AHYGdRpzG3QcggCGGYIaghuCHKgAqBsR - XQBdJSEVITU2ADc+ATU0JiMiBgc1PgEzMgQVFAYHBgABiQLB/ExzAY0zYU2nhl/TeHrUWOgB - FEVbGf70qqqqdwGROm2XSXeWQkPMMTLowlylcB3+6wAAAQCc/+MEcwXwACgAe0AuABUTCoYJ - H4YgE6AVDaAJkwYcoCCTI5EGjBWjKRYcEwADFBkcJiAQHAMUHwkGKRD8xMTU7PTsERc5OTEA - EOzk9OTsEObuEO4Q7hDuERI5MAFLsBZUS7AUVFtYvQApAEAAAQApACn/wDgRNzhZQAlkHmEf - YSBkIQQAXQEeARUUBCEiJic1HgEzMjY1NCYrATUzMjY1NCYjIgYHNT4BMzIEFRQGAz+Ro/7Q - /uhex2pUyG2+x7mlrraVnqOYU75yc8lZ5gEMjgMlH8SQ3fIlJcMxMpaPhJWmd3BzeyQmtCAg - 0bJ8qwACAGQAAASkBdUAAgANAIxAHQENAw0AAwMNQgADCwegBQEDgQkBDAoAHAYIBAwOENzU - PMTsMhE5MQAv5NQ87DISOTBLU1gHEATJBxAFyVkiAUuwC1RLsA1UW1i9AA4AQAABAA4ADv/A - OBE3OFlAKgsAKgBIAFkAaQB3AIoABxYBKwAmASsDNgFOAU8MTw1WAWYBdQF6A4UBDV0AXQkB - IQMzETMVIxEjESE1Awb+AgH+Nf7V1cn9XgUl/OMDzfwzqP6gAWDDAAABAJ7/4wRkBdUAHQB1 - QCMEGgcRhhAdGqAHFKAQiQ0CoACBDYwHpB4XHAEKAxwAChAGHhD8xNTsEMTuMQAQ5OT07BDm - 7hD+xBDuERI5MAFLsBZUS7AUVFtYvQAeAEAAAQAeAB7/wDgRNzhZAUuwD1RYvQAe/8AAAQAe - AB4AQDgRNzhZEyEVIRE+ATMyABUUACEiJic1HgEzMjY1NCYjIgYH3QMZ/aAsWCz6AST+1P7v - XsNoWsBrrcrKrVGhVAXVqv6SDw/+7urx/vUgIMsxMLacnLYkJgAAAgCP/+MElgXwAAsAJABY - QCQTBgANhgwAoBYGoBwWpRCgDIkikRyMJQwiCRwZHhMcAyEfGyUQ/Ozs9OzkMQAQ5PTk/OQQ - 7hDuEO4REjkwQBTLAMsBzQLNA80EywXLBgekHrIeAl0BXQEiBhUUFjMyNjU0JgEVLgEjIgID - PgEzMgAVFAAjIAAREAAhMhYCpIifn4iIn58BCUybTMjTDzuya+EBBf7w4v79/u4BUAEbTJsD - O7qiobu7oaK6Anm4JCb+8v7vV13+7+vm/uoBjQF5AWIBpR4AAAEAqAAABGgF1QAGAGNAGAUR - AgMCAxEEBQRCBaAAgQMFAwEEAQAGBxD8zMQROTkxAC/07DBLU1gHEAXtBxAF7VkiAUuwFlRY - vQAHAEAAAQAHAAf/wDgRNzhZQBJYAgEGAxoFOQVIBWcDsACwBgddAF0TIRUBIwEhqAPA/eLT - Af79MwXVVvqBBSsAAAMAi//jBIsF8AALACMALwBDQCUYDACgJwagHi2gEpEejCejMBgMJCoc - FSQcDwkcFRseAxwPIRswEPzE7PTE7BDuEO4ROTkxABDs5PTsEO4Q7jk5MAEiBhUUFjMyNjU0 - JiUmJjU0NjMyFhUUBgcWFhUUBCMiJDU0NhMUFjMyNjU0JiMiBgKLkKWlkJCmpf6lgpH/3t/+ - kYGSo/739/f+96RIkYOCk5OCg5ECxZqHh5qbhoeaViCygLPQ0LOAsiAixo/Z6OjZj8YBYXSC - gnR0goIAAAIAgf/jBIcF8AAYACQAWEAjBx8ZAYYAGaAKpQSgAIkWH6AQkRaMJQccHCETHgAi - IhwNGyUQ/Ozk9OzsMQAQ5PTsEOb+9e4Q7hESOTBAFsQZwhrAG8AcwB3CHsQfB6oSvBLpEgNd - AV03NR4BMzISEw4BIyIANTQAMyAAERAAISImATI2NTQmIyIGFRQW4UycS8jTDzqybOD++wEQ - 4gEDARH+sf7lTJwBPoifn4iIn58fuCQmAQ0BElZcAQ/r5gEW/nP+hv6f/lseApe6oqG7u6Gi - ugAAAgDwAAABwwQjAAMABwAcQA4GgwSmAIMCBQEDBAAYCBD8POwyMQAv7PTsMDczFSMRMxUj - 8NPT09P+/gQj/gACAJ7/EgHDBCMAAwAJACVAEwKDAAeeBIMApgoHCAUBGQQAGAoQ/DzsMtTM - MQAQ5PzsEO4wEzMVIxEzFQMjE/DT09OkgVIEI/792az+wAFAAAEA2QBeBdsEpgAGAE1AKgKc - AwQDAZwAAQQEAwGcAgEFBgUAnAYFQgUEAgEABQOoBqcHAQIAJAQjBxD87DI5MQAQ9OwXOTBL - U1gHBO0HEAjtBxAI7QcQBO1ZIgkCFQE1AQXb+/gECPr+BQID8P6R/pO2AdGmAdEAAAIA2QFg - BdsDogADAAcAHEANAJwCBpwECAUBBAAjCBD8PMQyMQAQ1OzU7DATIRUhFSEVIdkFAvr+BQL6 - /gOiqPCqAAEA2QBeBdsEpgAGAE9AKwacAAYDBAMFnAQEAwCcAQIBBpwFBgICAUIGBQMCAAUE - qAGnBwYCJAQAIwcQ/DzsOTEAEPTsFzkwS1NYBxAI7QcQBO0HEATtBxAI7VkiEzUBFQE1AdkF - Avr+BAYD8Lb+L6b+L7YBbQACAJMAAAOwBfAAAwAkAHBAKyQeCQYECh0TBAAUhhOIEJUXkQCD - Ah0aDQkFBAoeAQ0cGgQcBQEDACYaEyUQ3MT87NTsEO4ROTkREjkREjkxAC/u9v707hDNETk5 - FzkwAUuwDFRYvQAlAEAAAQAlACX/wDgRNzhZtnkJegp6IANdJTMVIxMjNTQ2PwE+ATU0JiMi - Bgc1PgEzMhYVFAYPAQ4BBw4BFQGHy8vFvzhaWjkzg2xPs2FewWe430haWC8nCAYG/v4BkZpl - glZZNV4xWW5GQ7w5OMKfTIlWVi81GRU8NAAAAgCH/pwHcQWiAAsATACVQDIYDAMJqRkVGwOp - TA80Mw+sMKk3FawkqTdDTTM0HhoAKBIGGAwoGiseKEkSKyooSSw9TRDc7PzsEP79/jzGEO4R - Ejk5MQAQ1MT87BD+7dTGEMXuMhDE7hE5OTAAS7AJVEuwDFRbS7AQVFtLsBNUW0uwFFRbWL0A - Tf/AAAEATQBNAEA4ETc4WUAJD04fTi9OP04EAV0BFBYzMjY1NCYjIgYBDgEjIiY1NDYzMhYX - NTMRPgE1NCYnJiQjIgYHBgIVFBIXFgQzMjY3FwYEIyIkJyYCNTQSNzYkMzIEFx4BFRAABQL6 - jnx7jZB6eY8CITybZ6zX2KtnnDuPkqU/QGj+1bB74mCdsXNtaQEUnYH5aFp9/tmYuf64gICG - iH6BAVK91AFre0tP/sL+6AIZj6OkjoylpP5ITUn5yMj6S0yD/SAW37FrvFCDi0FAZv61wZ/+ - 6mpobVdRb2Fng319AUm9tgFKfX+HrqBi5nv++f7QBgAAAgAQAAAFaAXVAAIACgC6QEEAEQEA - BAUEAhEFBQQBEQoDCgARAgADAwoHEQUEBhEFBQQJEQMKCBEKAwpCAAMHlQEDgQkFCQgHBgQD - AgEACQUKCxDUxBc5MQAvPOTU7BI5MEtTWAcQBe0HBe0HEAXtBwXtBxAI7QcQBe0HEAXtBxAI - 7VkisiAMAQFdQDoPAFgAdgBwAIwABQcBCAIGAwkEFgEZAlYBWAJQDGcBaAJ4AXYCfANyBHcH - eAiHAYgCgAyYApkDlgQXXQBdCQEhATMBIwMhAyMCvP7uAiX+e+UCOdKI/V+I1QUO/RkDrvor - AX/+gQADAMkAAATsBdUACAARACAAQ0AjGQCVCgmVEoEBlQqtHxELCAITGR8FAA4cFgUZHC4J - ABwSBCEQ/Owy/OzU7BEXOTk5MQAv7Oz07BDuOTCyDyIBAV0BESEyNjU0JiMBESEyNjU0JiMl - ITIWFRQGBx4BFRQEIyEBkwFEo52do/68ASuUkZGU/gsCBOf6gHyVpf7w+/3oAsn93YeLjIUC - Zv4+b3JxcKbAsYmiFCDLmMjaAAEAc//jBScF8AAZADZAGg2hDq4KlREBoQCuBJUXkRGMGgcZ - DQAwFBAaEPzsMuwxABDk9Oz07BDu9u4wtA8bHxsCAV0BFS4BIyAAERAAITI2NxUOASMgABEQ - ACEyFgUnZueC/wD+8AEQAQCC52Zq7YT+rf56AYYBU4btBWLVX17+x/7Y/tn+x15f00hIAZ8B - ZwFoAZ9HAAIAyQAABbAF1QAIABEALkAVAJUJgQGVEAgCEAoABRkNMgAcCQQSEPzs9OwROTk5 - OTEAL+z07DCyYBMBAV0BETMgABEQACElISAAERAAKQEBk/QBNQEf/uH+y/5CAZ8BsgGW/mj+ - UP5hBS/7dwEYAS4BLAEXpv6X/oD+fv6WAAEAyQAABIsF1QALAC5AFQaVBAKVAIEIlQStCgUB - CQcDHAAEDBD87DLUxMQxAC/s7PTsEO4wsh8NAQFdEyEVIREhFSERIRUhyQOw/RoCx/05Avj8 - PgXVqv5Gqv3jqgABAMkAAAQjBdUACQApQBIGlQQClQCBBK0IBQEHAxwABAoQ/Owy1MQxAC/s - 9OwQ7jCyDwsBAV0TIRUhESEVIREjyQNa/XACUP2wygXVqv5Iqv03AAABAHP/4wWLBfAAHQA5 - QCAABRsBlQMblQgSoRGuFZUOkQiMHgIAHBE0BDMYGQsQHhD87Pzk/MQxABDk9Oz07BD+1O4R - OTkwJREhNSERBgQjIAAREAAhMgQXFSYmIyAAERAAITI2BMP+tgISdf7moP6i/nUBiwFekgEH - b3D8i/7u/u0BEwESa6jVAZGm/X9TVQGZAW0BbgGZSEbXX2D+zv7R/tL+ziUAAQDJAAAFOwXV - AAsALEAUCJUCrQQAgQoGBwMcBTgJARwABAwQ/Owy/OwyMQAvPOQy/OwwslANAQFdEzMRIREz - ESMRIREjycoC3srK/SLKBdX9nAJk+isCx/05AAABAMkAAAGTBdUAAwA5twCvAgEcAAQEEPzs - MQAv7DABS7AQVFi9AAT/wAABAAQABABAOBE3OFlADTAFQAVQBWAFjwWfBQZdEzMRI8nKygXV - +isAAf+W/mYBkwXVAAsATUATCwIAB5UFsACBDAUIBjkBHAAEDBD87OQ5OTEAEOT87BE5OTAB - S7AQVFi9AAz/wAABAAwADABAOBE3OFlADTANQA1QDWANjw2fDQZdEzMREAYrATUzMjY1ycrN - 400/hm4F1fqT/vL0qpbCAAABAMkAAAVqBdUACgDvQCgIEQUGBQcRBgYFAxEEBQQCEQUFBEII - BQIDAwCvCQYFAQQGCAEcAAQLEPzsMtTEETkxAC887DIXOTBLU1gHEATtBxAF7QcQBe0HEATt - WSKyCAMBAV1AkhQCAQQCCQgWAigFKAg3AjYFNAhHAkYFQwhVAmcCdgJ3BYMCiAWPCJQCmwjn - AhUGAwkFCQYbAxkHBQoDCgcYAygFKwYqBzYENgU2BjUHMAxBA0AERQVABkAHQAxiA2AEaAVn - B3cFcAyLA4sFjgaPB48MmgOdBp0HtgO1B8UDxQfXA9YH6APpBOgF6gb3A/gF+QYsXXEAXXET - MxEBIQkBIQERI8nKAp4BBP0bAxr+9v0zygXV/YkCd/1I/OMCz/0xAAABAMkAAARqBdUABQAl - QAwClQCBBAEcAzoABAYQ/OzsMQAv5OwwQAkwB1AHgAOABAQBXRMzESEVIcnKAtf8XwXV+tWq - AAEAyQAABh8F1QAMAL9ANAMRBwgHAhEBAggIBwIRAwIJCgkBEQoKCUIKBwIDCAMArwgLBQkI - AwIBBQoGHAQ+ChwABA0Q/Oz87BEXOTEALzzE7DIRFzkwS1NYBxAF7QcQCO0HEAjtBxAF7Vki - snAOAQFdQFYDBw8IDwkCChUCFAcTCiYCJgcgByYKIAo0BzUKaQJ8AnsHeQqAAoIHggqQAhYE - AQsDEwEbAyMBLAMnCCgJNAE8A1YIWQllCGoJdgh5CYEBjQOVAZsDFF0AXRMhCQEhESMRASMB - ESPJAS0BfQF/AS3F/n/L/n/EBdX8CAP4+isFH/wABAD64QABAMkAAAUzBdUACQB5QB4HEQEC - AQIRBgcGQgcCAwCvCAUGAQcCHAQ2BxwABAoQ/Oz87BE5OTEALzzsMjk5MEtTWAcQBO0HEATt - WSKyHwsBAV1AMDYCOAdIAkcHaQJmB4ACBwYBCQYVARoGRgFJBlcBWAZlAWkGeQaFAYoGlQGa - Bp8LEF0AXRMhAREzESEBESPJARAClsT+8P1qxAXV+x8E4forBOH7HwACAHP/4wXZBfAACwAX - ACNAEwaVEgCVDJESjBgJGQ8zAxkVEBgQ/Oz87DEAEOT07BDuMAEiABEQADMyABEQACcgABEQ - ACEgABEQAAMn3P79AQPc3AEB/v/cAToBeP6I/sb+xf6HAXkFTP64/uX+5v64AUgBGgEbAUik - /lv+nv6f/lsBpAFiAWIBpQACAMkAAASNBdUACAATADpAGAGVEACVCYESEAoIAgQABRkNPxEA - HAkEFBD87DL87BEXOTEAL/Ts1OwwQAsPFR8VPxVfFa8VBQFdAREzMjY1NCYjJSEyBBUUBCsB - ESMBk/6NmpqN/jgByPsBAf7/+/7KBS/9z5KHhpKm49vd4v2oAAIAc/74BdkF8AALAB0AUkAq - ERACDwEMDQwOAQ0NDEIPHgwGlRIAlRiREowNHg0bDwwDCRkbMwMZFRAeEPzs/OwROTkROTEA - EMTk9OwQ7jkSOTBLU1gHEAXtBxAF7Rc5WSIBIgAREAAzMgAREAATASMnBgYjIAAREAAhIAAR - EAIDJ9z+/QED3NwBAf7/PwEK9N0hIxD+xf6HAXkBOwE6AXjRBUz+uP7l/ub+uAFIARoBGwFI - +s/+3e8CAgGlAWEBYgGl/lv+nv78/o4AAAIAyQAABVQF1QATABwAsUA1CQgHAwoGEQMEAwUR - BAQDQgYEABUDBBWVCRSVDYELBAUGAxEJABwWDgUKGRkEET8UChwMBB0Q/Owy/MTsERc5ETk5 - OTEALzz07NTsEjkSORI5MEtTWAcQBe0HEAXtERc5WSKyQB4BAV1AQnoTAQUABQEFAgYDBwQV - ABUBFAIWAxcEJQAlASUCJgMnBiYHJggmCSAeNgE2AkYBRgJoBXUEdQV3E4gGiAeYBpgHH10A - XQEeARcTIwMuASsBESMRISAWFRQGAREzMjY1NCYjA41Bez7N2b9Ki3jcygHIAQD8g/2J/pKV - lZICvBaQfv5oAX+WYv2JBdXW2I26Ak/97oeDg4UAAAEAh//jBKIF8AAnAH5APA0MAg4LAh4f - HggJAgcKAh8fHkIKCx4fBBUBABWhFJQYlREElQCUJZERjCgeCgsfGwcAIhsZDi0HGRQiKBDc - xOz87OQREjk5OTkxABDk9OTsEO727hDGERc5MEtTWAcQDu0RFzkHEA7tERc5WSKyDykBAV22 - HykvKU8pA10BFS4BIyIGFRQWHwEeARUUBCEiJic1HgEzMjY1NCYvAS4BNTQkMzIWBEhzzF+l - s3emeuLX/t3+52rvgHvscq28h5p74soBF/Vp2gWkxTc2gHZjZR8ZK9m22eAwL9BFRoh+bnwf - GC3Aq8bkJgAAAf/6AAAE6QXVAAcASkAOBgKVAIEEAUADHABABQgQ1OT85DEAL/TsMjABS7AK - VFi9AAgAQAABAAgACP/AOBE3OFlAEwAJHwAQARACHwcQCUAJcAmfCQldAyEVIREjESEGBO/9 - 7sv97gXVqvrVBSsAAAEAsv/jBSkF1QARAEtAFggCEQsABZUOjAkAgRIIHAo4ARwAQRIQ/Oz8 - 7DEAEOQy9OwROTk5OTABS7AQVFi9ABIAQAABABIAEv/AOBE3OFm2HxOPE58TA10TMxEUFjMy - NjURMxEQACEgABGyy67Dwq7L/t/+5v7l/t8F1fx18NPT8AOL/Fz+3P7WASoBJAABABAAAAVo - BdUABgC3QCcEEQUGBQMRAgMGBgUDEQQDAAEAAhEBAQBCAwQBrwAGBAMCAAUFAQcQ1MQXOTEA - L+wyOTBLU1gHEAXtBxAI7QcQCO0HEAXtWSKyUAgBAV1AYgADKgNHBEcFWgN9A4MDBwYABwII - BAkGFQEUAhoEGgUqACYBJgIpBCkFJQYgCDgAMwEzAjwEPAU3BkgARQFFAkkESQVHBlkAVgZm - AmkEaQV6AHYBdgJ5BHkFdQaACJgAlwYpXQBdIQEzCQEzAQJK/cbTAdkB2tL9xwXV+xcE6for - AAEARAAAB6YF1QAMAXtASQUaBgUJCgkEGgoJAxoKCwoCGgECCwsKBhEHCAcFEQQFCAgHAhED - AgwADAERAAAMQgoFAgMGAwCvCwgMCwoJCAYFBAMCAQsHAA0Q1MwXOTEALzzsMjIXOTBLU1gH - EAXtBxAI7QcQCO0HEAXtBxAI7QcQBe0HBe0HEAjtWSKyAA4BAV1A8gYCBgUCCgAKAAoSCigF - JAogCj4CPgU0CjAKTAJNBUIKQApZAmoCawVnCmAKewJ/AnwFfwWACpYClQUdBwAJAggDAAQG - BQAFAAYBBwQIAAgHCQAJBAoKDAAOGgMVBBUIGQwQDiAEIQUgBiAHIAgjCSQKJQsgDiAOPAI6 - AzUEMwUwCDYJOQs/DDAORgBGAUoCQARFBUAFQgZCB0IIQAhACUQKTQxADkAOWAJWCFkMUA5m - AmcDYQRiBWAGYAdgCGQJZApkC3cAdgF7AngDdwR0BXkGeQd3CHAIeAx/DH8OhgKHA4gEiQWF - CYoLjw6XBJ8Orw5bXQBdEzMJATMJATMBIwkBI0TMAToBOeMBOgE5zf6J/v7F/sL+BdX7EgTu - +xIE7vorBRD68AABAD0AAAU7BdUACwFdQEYJEQoLCggRBwgLCwoIEQkIBQYFBxEGBgUDEQQF - BAIRAQIFBQQCEQMCCwALAREAAAtCCwgFAgQDAK8JBgsIBQIEAAQGAAoMENTE3MQRFzkxAC88 - 7DIXOTBLU1gHEAXtBxAI7QcQCO0HEAXtBxAF7QcQCO0HEAjtBxAF7VkiAUuwDFRLsA1UW0uw - DlRbWL0ADP/AAAEADAAMAEA4ETc4WUC4BwIICBYCGQgXCycIJws0AjgINgtLCFgFWwhmAmsI - dwJ3C4YCgAKHBYsIhQuUApAClwWdCJYLGwYBCQMIBwcJFgEZAxkHFwkQDSYBKAIpAyYFKAcn - CSkLIA01ADQBPAM7BDoGOwc0CTQKOAs/DUgJTw1YC18NZQBlAWoDagRoBWkGaQdsCWwKeAN5 - BnkHeAh9CX8KeAuAAIABgwKIA4UFhAiDC48NkACQAZQClwWXBpUIkwufDa8NQF0AXRMzCQEz - CQEjCQEjAYHZAXMBddn+IAIA2f5c/lnaAhUF1f3VAiv9M/z4Anv9hQMdAAH//AAABOcF1QAI - AJRAKAMRBAUEAhEBAgUFBAIRAwIIAAgBEQAACEICAwCvBgIHBEAFHABABwkQ1OT85BI5MQAv - 7DI5MEtTWAcQBe0HEAjtBxAI7QcQBe1ZIrIACgEBXUA8BQIUAjUCMAIwBTAIRgJAAkAFQAhR - AlEFUQhlAoQCkwIQFgEaAx8KJgEpAzcBOANACmcBaAN4A3AKnwoNXQBdAzMJATMBESMRBNkB - ngGb2f3wywXV/ZoCZvzy/TkCxwAAAQBcAAAFHwXVAAkAm0AbAxEHCAcIEQIDAkIIlQCBA5UF - CAMAAUIEAAYKENzE1OQROTkxAC/s9OwwS1NYBxAF7QcQBe1ZIgFLsAlUS7AKVFtYvQAKAEAA - AQAKAAr/wDgRNzhZQEAFAgoHGAcpAiYHOAdIAkcHSAgJBQMLCAALFgMaCBALLws1AzkIPwtH - A0oITwtVA1kIZgNpCG8LdwN4CH8LnwsWXQBdEyEVASEVITUBIXMElfxQA8f7PQOw/GcF1Zr7 - b6qaBJEAAAEAsP7yAlgGFAAHAFNADwSpBrICqQCxCAUBA0MACBDc/MwyMQAQ/Oz07DABS7AM - VFi9AAj/wAABAAgACABAOBE3OFkBS7ASVEuwE1RbWL0ACABAAAEACAAI/8A4ETc4WRMhFSMR - MxUhsAGo8PD+WAYUj/n8jwABAAD/QgKyBdUAAwAtQBQCGgEBAAAaAwMCQgGfAIEEAgABAy/E - OTkxABD07DBLU1gHEAXtBxAF7VkiEwEjAaoCCKr9+AXV+W0GkwAAAQDH/vICbwYUAAcAPEAQ - A6kBsgWpALEIAEMEBgIECBD8PNzsMQAQ/Oz07DABS7APVEuwEFRbWL0ACP/AAAEACAAIAEA4 - ETc4WQERITUzESM1Am/+WO/vBhT43o8GBI8AAQDZA6gF2wXVAAYAGEAKAwQBAIEHAwEFBxDc - zDkxABD0zDI5MAEBIwEBIwEDvAIfyf5I/kjJAh8F1f3TAYv+dQItAAAB/+z+HQQU/qwAAwAP - tQCpAQACBBDExDEA1OwwARUhNQQU+9j+rI+PAAABAKoE8AKJBmYAAwAxQAkBtACzBANEAQQQ - 3OwxABD07DAAS7AJVEuwDlRbWL0ABP/AAAEABAAEAEA4ETc4WQkBIwEBbwEamf66Bmb+igF2 - AAIAe//jBC0EewAKACUAvEAnGR8LFwkOAKkXBrkOESCGH7ocuSO4EYwXDAAXAxgNCQgLHwMI - FEUmEPzszNTsMjIROTkxAC/E5PT89OwQxu4Q7hE5ETkSOTBAbjAdMB4wHzAgMCEwIj8nQB1A - HkAfQCBAIUAiUB1QHlAfUCBQIVAiUCdwJ4Udhx6HH4cghyGFIpAnoCfwJx4wHjAfMCAwIUAe - QB9AIEAhUB5QH1AgUCFgHmAfYCBgIXAecB9wIHAhgB6AH4AggCEYXQFdASIGFRQWMzI2PQE3 - ESM1DgEjIiY1NDYzITU0JiMiBgc1PgEzMhYCvt+sgW+Zubi4P7yIrMv9+wECp5dgtlRlvlrz - 8AIzZntic9m0KUz9gapmYcGivcASf4suLqonJ/wAAAIAuv/jBKQGFAALABwAOEAZA7kMDwm5 - GBWMD7gblxkAEhJHGAwGCBpGHRD87DIy9OwxAC/s5PTE7BDG7jC2YB6AHqAeAwFdATQmIyIG - FRQWMzI2AT4BMzISERACIyImJxUjETMD5aeSkqenkpKn/Y46sXvM///Me7E6ubkCL8vn58vL - 5+cCUmRh/rz++P74/rxhZKgGFAAAAQBx/+MD5wR7ABkAP0AbAIYBiAQOhg2ICrkRBLkXuBGM - GgcSDQBIFEUaEPzkMuwxABDk9OwQ/vTuEPXuMEALDxsQG4AbkBugGwUBXQEVLgEjIgYVFBYz - MjY3FQ4BIyIAERAAITIWA+dOnVCzxsazUJ1OTaVd/f7WAS0BBlWiBDWsKyvjzc3jKyuqJCQB - PgEOARIBOiMAAgBx/+MEWgYUABAAHAA4QBkauQAOFLkFCIwOuAGXAxcEAAgCRxESC0UdEPzs - 9OwyMjEAL+zk9MTsEMTuMLZgHoAeoB4DAV0BETMRIzUOASMiAhEQEjMyFgEUFjMyNjU0JiMi - BgOiuLg6sXzL///LfLH9x6eSkqiokpKnA7YCXvnsqGRhAUQBCAEIAURh/hXL5+fLy+fnAAAC - AHH/4wR/BHsAFAAbAHBAJAAVAQmGCIgFFakBBbkMAbsYuRK4DIwcGxUCCBUIAEsCEg9FHBD8 - 7PTsxBESOTEAEOT07OQQ7hDuEPTuERI5MEApPx1wHaAd0B3wHQU/AD8BPwI/FT8bBSwHLwgv - CSwKbwBvAW8CbxVvGwldcQFdARUhHgEzMjY3FQ4BIyAAERAAMzIABy4BIyIGBwR//LIMzbdq - x2Jj0Gv+9P7HASn84gEHuAKliJq5DgJeWr7HNDSuKiwBOAEKARMBQ/7dxJe0rp4AAAEALwAA - AvgGFAATAHBAHAUQAQwIqQYBhwCXDga8CgITBwAHCQUIDQ8LTBQQ/DzE/DzExBI5OTEAL+Qy - /OwQ7jISOTkwAUuwClRYvQAU/8AAAQAUABQAQDgRNzhZAUuwDlRYvQAUAEAAAQAUABT/wDgR - NzhZtkAVUBWgFQNdARUjIgYdASEVIREjESM1MzU0NjMC+LBjTQEv/tG5sLCuvQYUmVBoY4/8 - LwPRj067qwAAAgBx/lYEWgR7AAsAKABKQCMZDB0JEoYTFrkPA7kmI7gnvAm5D70aHSYZAAgM - RwYSEiBFKRD8xOz07DIyMQAvxOTs5PTE7BD+1e4REjk5MLZgKoAqoCoDAV0BNCYjIgYVFBYz - MjYXEAIhIiYnNR4BMzI2PQEOASMiAhEQEjMyFhc1MwOipZWUpaWUlaW4/v76YaxRUZ5StbQ5 - snzO/PzOfLI5uAI9yNzcyMfc3Ov+4v7pHR6zLCq9v1tjYgE6AQMBBAE6YmOqAAABALoAAARk - BhQAEwA0QBkDCQADDgEGhw4RuAyXCgECCABODQkIC0YUEPzsMvTsMQAvPOz0xOwREhc5MLJg - FQEBXQERIxE0JiMiBhURIxEzET4BMzIWBGS4fHyVrLm5QrN1wcYCpP1cAp6fnr6k/YcGFP2e - ZWTvAAACAMEAAAF5BhQAAwAHACtADga+BLEAvAIFAQgEAEYIEPw87DIxAC/k/OwwQAsQCUAJ - UAlgCXAJBQFdEzMRIxEzFSPBuLi4uARg+6AGFOkAAAL/2/5WAXkGFAALAA8AREAcCwIHAA6+ - DAeHBb0AvAyxEAgQBQZPDQEIDABGEBD8POwy5DkSOTEAEOzk9OwQ7hESOTkwQAsQEUARUBFg - EXARBQFdEzMRFAYrATUzMjY1ETMVI8G4o7VGMWlMuLgEYPuM1sCcYZkGKOkAAQC6AAAEnAYU - AAoAvEApCBEFBgUHEQYGBQMRBAUEAhEFBQRCCAUCAwO8AJcJBgUBBAYIAQgARgsQ/Owy1MQR - OTEALzzs5Bc5MEtTWAcQBO0HEAXtBxAF7QcQBO1ZIrIQDAEBXUBfBAIKCBYCJwIpBSsIVgJm - AmcIcwJ3BYICiQWOCJMClgWXCKMCEgkFCQYCCwMKBygDJwQoBSsGKwdADGgDYAyJA4UEiQWN - Bo8HmgOXB6oDpwW2B8UH1gf3A/AD9wTwBBpdcQBdEzMRATMJASMBESO6uQIl6/2uAmvw/ce5 - BhT8aQHj/fT9rAIj/d0AAQDBAAABeQYUAAMAIrcAlwIBCABGBBD87DEAL+wwQA0QBUAFUAVg - BXAF8AUGAV0TMxEjwbi4BhT57AAAAQC6AAAHHQR7ACIAWkAmBhIJGA8ABh0HFQyHHSADuBu8 - GRAHABEPCAgGUBEID1AcGAgaRiMQ/Owy/Pz87BESOTEALzw85PQ8xOwyERIXOTBAEzAkUCRw - JJAkoCSgJL8k3yT/JAkBXQE+ATMyFhURIxE0JiMiBhURIxE0JiMiBhURIxEzFT4BMzIWBClF - wIKvvrlydY+muXJ3jaa5uT+weXqrA4l8dvXi/VwCnqGcvqT9hwKeopu/o/2HBGCuZ2J8AAAB - ALoAAARkBHsAEwA2QBkDCQADDgEGhw4RuAy8CgECCABODQkIC0YUEPzsMvTsMQAvPOT0xOwR - Ehc5MLRgFc8VAgFdAREjETQmIyIGFREjETMVPgEzMhYEZLh8fJWsublCs3XBxgKk/VwCnp+e - vqT9hwRgrmVk7wACAHH/4wR1BHsACwAXAEpAEwa5EgC5DLgSjBgJEg9RAxIVRRgQ/Oz07DEA - EOT07BDuMEAjPxl7AHsGfwd/CH8Jfwp/C3sMfw1/Dn8PfxB/EXsSoBnwGREBXQEiBhUUFjMy - NjU0JicyABEQACMiABEQAAJzlKyrlZOsrJPwARL+7vDx/u8BEQPf58nJ5+jIx+mc/sj+7P7t - /scBOQETARQBOAACALr+VgSkBHsAEAAcAD5AGxq5AA4UuQUIuA6MAb0DvB0REgtHFwQACAJG - HRD87DIy9OwxABDk5OT0xOwQxO4wQAlgHoAeoB7gHgQBXSURIxEzFT4BMzISERACIyImATQm - IyIGFRQWMzI2AXO5uTqxe8z//8x7sQI4p5KSp6eSkqeo/a4GCqpkYf68/vj++P68YQHry+fn - y8vn5wACAHH+VgRaBHsACwAcAD5AGwO5DA8JuRgVuA+MG70ZvB0YDAYIGkcAEhJFHRD87PTs - MjIxABDk5OT0xOwQxu4wQAlgHoAeoB7gHgQBXQEUFjMyNjU0JiMiBgEOASMiAhEQEjMyFhc1 - MxEjAS+nkpKoqJKSpwJzOrF8y///y3yxOri4Ai/L5+fLy+fn/a5kYQFEAQgBCAFEYWSq+fYA - AAEAugAAA0oEewARADBAFAYLBwARCwOHDrgJvAcKBggACEYSEPzE7DIxAC/k9OzE1MwREjkw - tFATnxMCAV0BLgEjIgYVESMRMxU+ATMyFhcDSh9JLJynubk6uoUTLhwDtBIRy779sgRgrmZj - BQUAAQBv/+MDxwR7ACcA50A8DQwCDgtTHx4ICQIHClMeHx5CCgseHwQVAIYBiQQUhhWJGLkR - BLkluBGMKB4KCx8bBwBSGwgOBwgUIkUoEPzE7NTs5BESOTk5OTEAEOT07BD+9e4Q9e4SFzkw - S1NYBxAO7REXOQcO7REXOVkisgAnAQFdQG0cChwLHAwuCSwKLAssDDsJOwo7CzsMCyAAIAEk - AigKKAsqEy8ULxUqFigeKB8pICkhJCeGCoYLhgyGDRIAAAABAgIGCgYLAwwDDQMOAw8DEAMZ - AxoDGwMcBB0JJy8pPylfKX8pgCmQKaAp8CkYXQBdcQEVLgEjIgYVFBYfAR4BFRQGIyImJzUe - ATMyNjU0Ji8BLgE1NDYzMhYDi06oWomJYpQ/xKX32FrDbGbGYYKMZatAq5jgzma0BD+uKChU - VEBJIQ4qmYmctiMjvjU1WVFLUCUPJJWCnqweAAABADcAAALyBZ4AEwA4QBkOBQgPA6kAEQG8 - CIcKCwgJAgQACBASDkYUEPw8xPw8xDI5OTEAL+z0PMTsMhE5OTCyrxUBAV0BESEVIREUFjsB - FSMiJjURIzUzEQF3AXv+hUtzvb3VooeHBZ7+wo/9oIlOmp/SAmCPAT4AAAEArv/jBFgEYAAT - ADZAGQMJAAMOAQaHDhGMCgG8DA0JCAtOAggARhQQ/Oz07DIxAC/kMvTE7BESFzkwtGAVzxUC - AV0TETMRFBYzMjY1ETMRIzUOASMiJq64fHyVrbi4Q7F1wcgBugKm/WGfn76kAnv7oKxmY/AA - AAEAPQAABH8EYAAGARJAJwMRBAUEAhEBAgUFBAIRAwIGAAYBEQAABkICAwC/BQYFAwIBBQQA - BxDUxBc5MQAv7DI5MEtTWAcQBe0HEAjtBxAI7QcQBe1ZIgFLsApUWL0AB//AAAEABwAHAEA4 - ETc4WQFLsBRUS7AVVFtYvQAHAEAAAQAHAAf/wDgRNzhZQI5IAmoCewJ/AoYCgAKRAqQCCAYA - BgEJAwkEFQAVARoDGgQmACYBKQMpBCAINQA1AToDOgQwCEYARgFJA0kERgVIBkAIVgBWAVkD - WQRQCGYAZgFpA2kEZwVoBmAIdQB0AXsDewR1BXoGhQCFAYkDiQSJBYYGlgCWAZcCmgOYBJgF - lwaoBacGsAjACN8I/wg+XQBdEzMJATMBIz3DAV4BXsP+XPoEYPxUA6z7oAAAAQBWAAAGNQRg - AAwCAUBJBVUGBQkKCQRVCgkDVQoLCgJVAQILCwoGEQcIBwURBAUICAcCEQMCDAAMAREAAAxC - CgUCAwYDAL8LCAwLCgkIBgUEAwIBCwcADRDUzBc5MQAvPOwyMhc5MEtTWAcQBe0HEAjtBxAI - 7QcQBe0HEAjtBxAF7QcF7QcQCO1ZIgFLsApUS7ARVFtLsBJUW0uwE1RbS7ALVFtYvQAN/8AA - AQANAA0AQDgRNzhZAUuwDFRLsA1UW0uwEFRbWL0ADQBAAAEADQAN/8A4ETc4WUD/BQIWAhYF - Igo1CkkCSQVGCkAKWwJbBVUKUApuAm4FZgp5An8CeQV/BYcCmQKYBZQKvAK8Bc4CxwPPBR0F - AgkDBgQLBQoICwkECwUMFQIZAxYEGgUbCBsJFAsVDCUAJQEjAicDIQQlBSIGIgclCCcJJAoh - CyMMOQM2BDYIOQwwDkYCSANGBEAEQgVABkAHQAhECUQKRAtADkAOVgBWAVYCUARRBVIGUgdQ - CFMJVApVC2MAZAFlAmoDZQRqBWoGagduCWELZwxvDnUAdQF5An0DeAR9BXoGfwZ6B38HeAh5 - CX8Jewp2C30MhwKIBY8OlwCXAZQCkwOcBJsFmAaYB5kIQC+WDJ8OpgCmAaQCpAOrBKsFqQap - B6sIpAyvDrUCsQO9BLsFuAm/DsQCwwPMBMoFeV0AXRMzGwEzGwEzASMLASNWuObl2ebluP7b - 2fHy2QRg/JYDavyWA2r7oAOW/GoAAQA7AAAEeQRgAAsBWkBGBREGBwYEEQMEBwcGBBEFBAEC - AQMRAgIBCxEAAQAKEQkKAQEAChELCgcIBwkRCAgHQgoHBAEECAC/BQIKBwQBBAgAAggGDBDU - xNTEERc5MQAvPOwyFzkwS1NYBxAF7QcQCO0HEAjtBxAF7QcQBe0HEAjtBxAI7QcQBe1ZIgFL - sApUS7APVFtLsBBUW0uwEVRbWL0ADP/AAAEADAAMAEA4ETc4WQFLsBRUWL0ADABAAAEADAAM - /8A4ETc4WUCYCgQEChoEFQomCj0EMQpVBFcHWApmCnYBegR2B3QKjQSCCpkEnwSXB5IKkAqm - AakErwSlB6MKoAocCgMEBQUJCgsaAxUFFQkaCykDJgUlCSoLIA06ATkDNwU0BzYJOQswDUkD - RgVFCUoLQA1ZAFYBWQJZA1cFVgZZB1YIVglZC1ANbw14AX8NmwGUB6sBpAewDc8N3w3/DS9d - AF0JAiMJASMJATMJAQRk/msBqtn+uv662QGz/nLZASkBKQRg/d/9wQG4/kgCSgIW/nEBjwAB - AD3+VgR/BGAADwGiQEMHCAIJEQAPChELCgAADw4RDwAPDREMDQAADw0RDg0KCwoMEQsLCkIN - CwkQAAsFhwO9Dgu8EA4NDAoJBgMACA8EDwsQENTExBEXOTEAEOQy9OwRORE5EjkwS1NYBxAF - 7QcQCO0HEAjtBxAF7QcQCO0HBe0XMlkiAUuwClRLsAhUW1i9ABD/wAABABAAEABAOBE3OFkB - S7AUVFi9ABAAQAABABAAEP/AOBE3OFlA8AYABQgGCQMNFgoXDRANIw01DUkKTwpODVoJWgpq - CocNgA2TDRIKAAoJBgsFDAsOCw8XARUCEAQQBRcKFAsUDBoOGg8nACQBJAIgBCAFKQgoCSUK - JAskDCcNKg4qDyARNwA1ATUCMAQwBTgKNgs2DDgNOQ45DzARQQBAAUACQANABEAFQAZAB0AI - QglFCkcNSQ5JD0ARVABRAVECVQNQBFAFVgZVB1YIVwlXClULVQxZDlkPUBFmAWYCaAppDmkP - YBF7CHgOeA+JAIoJhQuFDIkNiQ6JD5kJlQuVDJoOmg+kC6QMqw6rD7ARzxHfEf8RZV0AXQUO - ASsBNTMyNj8BATMJATMCk06UfJNsTFQzIf47wwFeAV7DaMh6mkiGVARO/JQDbAABAFgAAAPb - BGAACQC0QBoIEQIDAgMRBwgHQgipALwDqQUIAwEABAEGChDcxDLEETk5MQAv7PTsMEtTWAcQ - Be0HEAXtWSIBS7ALVEuwDFRbWL0ACgBAAAEACgAK/8A4ETc4WQFLsBNUWL0ACv/AAAEACgAK - AEA4ETc4WUBCBQIWAiYCRwJJBwULCA8LGAMbCCsIIAs2AzkIMAtAAUACRQNABEAFQwhXA1kI - XwtgAWACZgNgBGAFYgh/C4ALrwsbXQBdEyEVASEVITUBIXEDav1MArT8fQK0/WUEYKj825Oo - AyUAAQEA/rIEFwYUACQAgkA0GQ8VCwYlCRoQFR0LBSAhAwALqQkAqQHACRWpE7ElDAkKBSQW - GQAdCgUTAhQAIBlDCg8FJRDUPMT8PMQyOTkREjkREjk5ERI5OTEAEPzsxPTsEO4SFzkSORE5 - ORESORESOTkwAUuwDFRYvQAl/8AAAQAlACUAQDgRNzhZsgAmAV0FFSMiJj0BNCYrATUzMjY9 - ATQ2OwEVIyIGHQEUBgceAR0BFBYzBBc++alsjj09j2up+T5EjVZbbm9aVo2+kJTd75d0j3OV - 8N2Tj1iN+J2OGRuOnPiNWAABAQT+HQGuBh0AAwAStwEAsQQABQIEENTsMQAQ/MwwAREjEQGu - qgYd+AAIAAAAAQEA/rIEFwYUACQAnkA2HyUbFgwPCBsLFRkPBAUgAwAZqRsAqSPAGw+pEbEl - HBkaFQ8BBAAIGhUjEgQAGh8VQxAACwQlENQ8xDL8PMQREjk5ERI5ERI5ORESOTkxABD87MT0 - 7BDuEhc5ERI5ORE5ETk5ERI5MAFLsApUWL0AJQBAAAEAJQAl/8A4ETc4WQFLsA5UWL0AJf/A - AAEAJQAlAEA4ETc4WbIAJgFdBTMyNj0BNDY3LgE9ATQmKwE1MzIWHQEUFjsBFSMiBh0BFAYr - AQEARoxVWm9vWlWMRj/5p2yOPj6ObKf5P75Wj/icjhsZjp34jlePk93wlXOPdJfv3ZQAAQDZ - AdMF2wMxAB0AI0AQARAbDAATBJwbE5wMHgAPHhDUxDEAENT81OwQwBESOTkwARUGBiMiJyYn - JicmIyIGBzU2NjMyFxYXFhcWMzI2Bdtps2FukgsFBw+bXlisYmmzYW6TCgUIDpteVqkDMbJP - RDsEAgMFPk1Tsk9FPAQCAwU+TAD//wAQAAAFaAdOAicAJAAAAAAABwEDALwBdQADABAAAAVo - B20ACwAOACEAy0BUDBENDBscGw4RHBseERwbHREcHBsNESEPIQwRDgwPDyEgEQ8hHxEhDyFC - DBsPDQkDwRUJHpUNCY4gHB4dHBggHyENEgYOGAwGGwBWGBwPBlYSHCEiENTE1OwyENTuMhE5 - ETkREjkROTkREjk5MQAvPObW7hDU7hESOTk5MEtTWAcQBe0HBe0HEAjtBxAF7QcQBe0HBe0H - Be0HEAjtWSKyICMBAV1AIBoMcwybDAMHDwgbUCNmDWkOdQ17DnkceR12IHYhgCMMXQBdATQm - IyIGFRQWMzI2AwEhAS4BNTQ2MzIWFRQGBwEjAyEDIwNUWT9AV1g/P1mY/vACIf5YPT6fc3Kh - PzwCFNKI/V+I1QZaP1lXQT9YWP7z/RkDTilzSXOgoXJGdin6iwF//oEA//8Ac/51BScF8AIn - ACYAAAAAAAcA3QEtAAD//wDJAAAEiwdrAicAKAAAAAAABwEEAJ4Bdf//AMkAAAUzB14CJwAx - AAAAAAAHAQUA/gF1//8Ac//jBdkHTgInADIAAAAAAAcBAwEnAXX//wCy/+MFKQdOAicAOAAA - AAAABwEDAO4Bdf//AHv/4wQtBmYCJwBEAAAAAAAHAI0AUgAA//8Ae//jBC0GZgInAEQAAAAA - AAcAQwBSAAD//wB7/+MELQZmAicARAAAAAAABwDXAFIAAP//AHv/4wQtBhACJwBEAAAAAAAH - AI4AUgAA//8Ae//jBC0GNwInAEQAAAAAAAcA2ABSAAD//wB7/+MELQcGAicARAAAAAAABwDc - AFIAAP//AHH+dQPnBHsCJwBGAAAAAAAHAN0AjwAA//8Acf/jBH8GZgInAEgAAAAAAAcAjQCL - AAD//wBx/+MEfwZmAicASAAAAAAABwBDAIsAAP//AHH/4wR/BmYCJwBIAAAAAAAHANcAiwAA - //8Acf/jBH8GEAInAEgAAAAAAAcAjgCLAAD//wCQAAACbwZmAicA1gAAAAAABwCN/x0AAP// - /8cAAAGmBmYCJwDWAAAAAAAHAEP/HQAA////3gAAAlwGZgInANYAAAAAAAcA1/8dAAD////0 - AAACRgYQAicA1gAAAAAABwCO/x0AAP//ALoAAARkBjcCJwBRAAAAAAAHANgAmAAA//8Acf/j - BHUGZgInAFIAAAAAAAcAjQBzAAD//wBx/+MEdQZmAicAUgAAAAAABwBDAHMAAP//AHH/4wR1 - BmYCJwBSAAAAAAAHANcAcwAA//8Acf/jBHUGEAInAFIAAAAAAAcAjgBzAAD//wBx/+MEdQY3 - AicAUgAAAAAABwDYAHMAAP//AK7/4wRYBmYCJwBYAAAAAAAHAI0AewAA//8Arv/jBFgGZgIn - AFgAAAAAAAcAQwB7AAD//wCu/+MEWAZmAicAWAAAAAAABwDXAHsAAP//AK7/4wRYBhACJwBY - AAAAAAAHAI4AewAAAAEAOf87A8cF1QALACdAFAgEuQoCAIEGwgwDWQUBVwlZBwAMENQ87Pw8 - 7DEAEOT01DzsMjABMxEhFSERIxEhNSEBqLABb/6RsP6RAW8F1f5cmfujBF2ZAAACAMMDdQM9 - BfAACwAaACBAEQbDFcQAwwyRGwlaElsDWhgbENzs/OwxABD07PzsMAEiBhUUFjMyNjU0Jicy - FhcWFhUUBiMiJjU0NgIAUG5uUFBub09AdisuLrmGh7S4BW9vUE9tbU9PcIExLi1yQoS3tIeG - ugAAAgCs/scEIwWYAAYAIQBRQCsTFhQADwwBCweGCIgLEIYPiAy5FBYLuR0fHLgWjCIcFQAJ - HhMLDwcEEhkiENzs1DzUPDzsMjIxABDk9DzE7BDE/vTuEPXuEjkREjkREjkwJREGBhUUFgEV - JiYnAzY2NxUGBgcRIxEmABEQADcRMxMWFgKmk6SkAhBKiEQBRolIQYlNZvH+9wEJ8WYBSYmD - A1gS4ri54gOhrCkqA/ygBSonqh4jB/7kASAUATMBAQECATIWAR/+4QQhAAEAgQAABGIF8AAb - AGBAIQcWCAGGABIKqRQIDASgAJQZkRAMoA4ADQkLBxwTDxURHBDcPMzM/DzE1MQxAC/sMvTk - 7BDUPO4yEO4ROTkwAUuwDFRYvQAc/8AAAQAcABwAQDgRNzhZtDYBNgICAF0BFS4BIyIGHQEh - FSERIRUhNTMRIzUzNRA2MzIWBE5MiD2UdAGH/nkCLfwf7MfH1ug9lwW0tikpm9TXj/4vqqoB - 0Y/uAQXzHwAAAgBc/z0DogXwAAsAPgCRQDwvMCoGABcdMDYEDSeKJg2KDCrGJsUjEMYMxTyR - Iz8vBgAXMAQTHS0JNgMTVzktVyAJVwwiGjkmIgNXMz8Q3OzkxNTk7NTsEO4RORESOREXOTkx - ABDE9OTsEObuEO4Q7hEXOTk5ERI5MAFLsApUS7ALVFtLsAxUW0uwDlRbWL0APwBAAAEAPwA/ - /8A4ETc4WQEOARUUFhc+ATU0JhMVLgEjIgYVFBcWFx4BFRQGBx4BFRQGIyImJzUeATMyNjU0 - LwEuATU0NjcuATU0NjMyFgF7Pz6L+j8+j8xTjzhhbM4aDtODXF0+OcytSZpYV5Q6ZnHdGdaA - XVs7O8imSZkDqC5aLkyFhy1bLkuIApOkJydQR1pzDwh3mmVajDU0bUCOqB0dpCcnVExmew54 - mWZbjzEscEWCnx0AAAEBMwHRA4UEIQALABK3CccDDAZcAAwQ1OwxABDU7DABNDYzMhYVFAYj - IiYBM61+fKusfX2sAvp8q6t8faysAAABAJ7/OwQ5BdUADQAlQBIIAgTBAIEGAg4AB10FA10B - Cw4Q1NT83Ow5MQAQxDL07BE5MAEhESMRIxEjESYmNTQkAnkBwI2+jtfrAQQF1flmBh/54QNO - Ed24vugAAAEAuv/jBKwGFAAvAJpAMC0nIQwEBg0gAAQqFoYXGrkTKrkDlxOMLgwJDR0gIScJ - CCQnCAYdCCQQFi0IEABGMBD8xPzMEMbu1O4Q7hE5ORI5EjkxAC/k/u4Q/tXuEhc5FzkwQEAP - BQ8GDwcPJw8oigyKDQcKBgoHCgsKDAoNCh8NIAohDCIEJhkNGR8ZIDogOiFNH00gSSFJImof - aiClBqUHpiAYXQFdEzQ2MzIWFw4BFRQWHwEeARUUBiMiJic1HgEzMjY1NCYvAS4BNTQ2Ny4B - IyIGFREjuu/a0NsDl6g6QTmmYOHTQIhJUIxBdHg7ZVxgV6eXCINxgoi7BHHI2+jgCHNgL1Eq - JWqOZKy3GRikHh1fWz9UPjc7h1t/rB1ncIuD+5MAAAQBGwAABuUFzQAXAC8AOABMAGBANkVC - Qz8yyUgwyTlKQ8oMOcoAyRjIDMkkSEUzMAQxQjw/OTZJMWBLNmBDPF4SCR5LXgYJHl8qTRDc - 5PzsEP79xO4Q7jIROTkSORIXOTEAL+72/u0Q7TIQ7tbuORI5OTABIgYHBgYVFBYXFhYzMjY3 - NjY1NCYnJiYnMgQXFhIVFAIHBgQjIiQnJgI1NBI3NiQTIxEzMjY1NCYnMhYVFAYHFhYXFyMn - JiYjIxEjEQQAg+JeXmBgXl7ig4TjXl1dXlxe44SYAQdtbWxsbW3++ZiY/vltbWxsbW0BB317 - e25XWGawrmlgGEMuiayBO0k2QpsFZl5eXuWCgeNeXl9fXl3ig4XjXV5eZ25tbf76mpj++21t - bm5tbQEFmJoBBm1tbv5i/uw+S0w/Z3d5VnARCE1J39FgM/6cA0QAAwEbAAAG5QXNABcALwBJ - AENAJj3LPjrMQcokMcswNMxHyhjJAMgkyQw3YUQ9MF4qCQZEXh4JBhJKENzM/OwQ/u0yEO4x - AC/u9v797tbuEP3u1u4wATIEFxYSFRQCBwYEIyIkJyYCNTQSNzYkFyIGBwYGFRQWFxYWMzI2 - NzY2NTQmJyYmFxUmJiMiBhUUFjMyNjcVBgYjIiY1NDYzMhYEAJgBB21tbGxtbf75mJj++W1t - bGxtbQEHmIPiXl5gYF5e4oOE415dXV5cXuOnQoJClaerm0B6QkOJRtj7+9hJiAXNbm1t/vqa - mP77bW1ubm1tAQWYmgEGbW1uZ15eXuWCgeNeXl9fXl3ig4XjXV5e9YEhIK+dn64fIn8dHPTQ - 0fIcAAACAScDkwZGBdUADAAUAD5AIQEGBxAKBBIOCQMGyQ0CAIEVAQkFYgMJYgsNYw9iE2MR - FRDU5Pzk1OzU7BE5MQAQ9Dw87Bcy1Dw8xBE5MAETEzMRIxEDIwMRIxEjFSMRIxEjNQRKrqSq - ccM3y3Jxy3LJBdX/AAEA/b4B5P7RAS/+HAJCXv4cAeReAAABAXME7gNSBmYAAwAxQAkCtACz - BANEAQQQ1OwxABD07DAAS7AJVEuwDlRbWL0ABP/AAAEABAAEAEA4ETc4WQEzASMCi8f+upkG - Zv6IAAACANcFRgMpBhAAAwAHAJJADgYCzgQAzQgBZAAFZAQIENz81OwxABD8POwyMABLsApU - S7ANVFtYvQAIAEAAAQAIAAj/wDgRNzhZAUuwDFRLsA1UW0uwDlRbS7AXVFtYvQAI/8AAAQAI - AAgAQDgRNzhZAUuwD1RLsBlUW1i9AAgAQAABAAgACP/AOBE3OFlAEWABYAJgBWAGcAFwAnAF - cAYIXQEzFSMlMxUjAl7Ly/55y8sGEMrKygAAAQDZACcF2wTdABMAPkAiDQwKAwLPBACcBgzP - DgqcEgYQCBQSDg0MCAQDAggJBQ8AFBDcPMQyFzkxABDUPMwy/DzsEP487DkREjkwEyEBFwch - FSEHIRUhASc3ITUhNyHZAwQBAH2uAS/+SMMCe/z6/v59rv7VAbbD/YcDogE7ZtWo8Kr+x2bT - qvAAAgAIAAAHSAXVAA8AEwCHQDkREQ4PDhARDw8ODREPDgwRDg8OQgWVAwuVEQGVEJUAgREH - lQOtDQkREA8NDAUOCgAECAYCHBIKDhQQ1NQ87DLUxMQREhc5MQAvPOzsxPTs7BDuEO4wS1NY - BxAF7QcF7QcQBe0HEAXtWSKygBUBAV1AE2cRdxB3EYYMhRCWEZAVoBW/FQldARUhESEVIREh - FSERIQMjARcBIREHNf0bAsf9OQL4/D398KDNAnGL/rYBywXVqv5Gqv3jqgF//oEF1Z788AMQ - AAMAZv+6BeUGFwAJABMAKwCeQDwdHxoNKywTCgEABA0pJiAUDQQqJh4aBJUmDZUakSaMLCss - KhQXECAeIxMKAQAEHSkQBx8HGSMzEBkXECwQ/Oz87MAREjk5FzkSOTkREjk5ETkxABDk9OwQ - 7hDAEMAREjk5EjkSFzkSORESOTkwQCpXAFoVVxlVIWoVZSF7FXYcdSEJRhNZAFYTagBkE2Qc - aih8AHMTdhx6KAtdAV0JAR4BMzIAETQmJy4BIyIAERQWFwcmAjUQACEyFhc3FwcWEhUQACEi - JicHJwS2/TM+oV/cAQEneT2hX9z+/Scnhk5PAXkBO4LdV6Jmqk5Q/oj+xoDdW6JnBFj8skBD - AUgBGnC4uEBD/rj+5XC8RJ5mAQigAWIBpU1Lv1nGZ/72nv6f/ltLS79YAAMA3QDdBc8D7gAL - ABcALwD/QB0tGxUJIQMAJBgEFQ8nIRUbDyEwDAAkGBIGKhIeMBDUxNTEETk5OTkxABDUxNTE - EMAREhc5EjkREjkwQL4FAgUDBQQABQAGAAcFCAUJBQoKEA8RDxIPEwoUFQIVAxUEEAUQBhAH - FQgVCRUKGg4aDxoQHxEfEh8TGhQaFRoWJAIkAyQEIAUgBiAHJAgkCSQKKg4qDyoQLxEvEi8T - KhQqFSoWNQI1AzUEMAUwBjAHNQg1CTUKOg46DzoQPxE/Ej8TOhQ6FToWRQJFA0UEQAVABkAH - RQhFCUUKSg5KD0oQTxFPEk8TShRKFUoWVrQfsCCwIbAisCawJ7AotCkIXQFdAR4BMzI2NTQm - IyIGBy4BIyIGFRQWMzI2Fw4BIyImNTQ2MzIWFz4BMzIWFRQGIyImA5MxhlRlgHZZUoXEMYVV - Zn92WVKGkEadXoi6p4ZfmUhEnmGGvKeGXpUCL1hah2llhoc3WFiEamWGiBaHf9+mr9h+ioqD - 4aev1ncAAAIA2QAABdsFBAALAA8ALkAYBdAHA5wA0AkBDJwODQIVBAAXDAgVCgYQENQ87DL8 - POwyMQAv7NQ87Pw87DABESEVIREjESE1IREBIRUhA64CLf3TqP3TAi390wUC+v4FBP59qv59 - AYOqAYP7pqoAAgDZAAAF2wSoAAYACgBUQC4CnAMEAwGcAAEEBAMBnAIBBQYFAJwGBUIFBAIB - AAUD0QanB5wJAQgCACQHBCMLEPw87DIyOTEAL+z07Bc5MEtTWAcE7QcQCO0HEAjtBxAE7Vki - CQIVATUBASEVIQXb/EADwPr+BQL6/gUC+v4D+P7r/u6yAXCqAW/8AqoAAAIA2QAABdsEqAAG - AAoAVkAvBpwABgMEAwWcBAQDAJwBAgEGnAUGAgIBQgYFAwIABQTRAacHnAgGBwIkCQQAIwsQ - /Dw87DI5MQAv7PTsFzkwS1NYBxAI7QcQBO0HEATtBxAI7VkiEzUBFQE1AQEVITXZBQL6/gPB - AUH6/gP4sP6Rqv6QsgES/ceqqgAAAQBSAAAEwwXVABgAxkBGEAIRFhEPAg4PFhYRDwIQDwgN - CA4CDQ0IQg8LCQQA0xcGEgvTFAkQDYECDAkOAwUWDwMVEhADABFmEwBlARwNZgoFZQcDGRDU - POwy7PzsMuwSFzkSOTkRFzkxAC/kMtQ87DLUPOwyERI5MEtTWAcQBe0HEAjtBxAI7QcQBe1Z - IgFLsAxUWL0AGf/AAAEAGQAZAEA4ETc4WUAohg+QD6YPoA+1DwUnDCcNJw4pECgRKBI3DjkQ - hwyIEqYNpQ6qEKkRDl0AXQEhESMRITUhNSchNSEBMwkBMwEhFSEHFSEEjf5jyf5gAaBU/rQB - CP7DvgF7AXm//sIBCP61VAGfAcf+OQHHezObewJK/UQCvP22e5szAAABAK7+VgTlBGAAIABN - QCUTGR8DFgYDCQwDARIPBoccFowKAbwAvSEZCRIJCAtOHwIIAEYhEPzsMvTsxBI5MQAQ5OQy - 9Dzs3MQRFzkREhc5MLYfImAizyIDAV0TETMRFBYzMjY1ETMRFBYzMjY3FQ4BIyImJw4BIyIm - JxGuuIqHlJW4IyUJIBwpSSNFUg8ykWJmjyr+VgYK/UiRlKioAo38ojw5CwyUFxZOUE9PTk79 - 1wAAAgBo/+cDwQUtAB0AKQBiQBkAJyEJGwYnFQYPIRsPFdUqDCQDAB4SJBgqENTM3Mw5ORE5 - MQAQ5MzczBDOEM4REjkREjkwAUuwDFRLsAtUW0uwDlRbS7AQVFtLsBRUW1i9ACoAQAABACoA - Kv/AOBE3OFkBPgE1NCYjIgYjIiY1NDYzMhIREAAjIiY1NBIzMhYHNCYjIgIVFBYzMhIC9A8P - SUg3kCQkMJBltNb+39WYy92iZYILV09tjVZQbY0CbVejS4GDdCwfPmL+yv75/rH+RtijxgEB - W+B0ff7+z3R7AQQAAAEAGf53BTsFwQALAF1AFAoEDAIFBwIABwwKBQQDAQAGBggMENTEFzkx - ABDE1MwQzhESOTkwQDBRA1YFUAVaCnMDcAN2BHUFcAV6CoADgAUMWgl/An8DcAVwBnsJdAuP - Ao8DgAWABgtdAV0TIRUhCQEhFSE1CQE3BOr8QQKg/UoD7/reAtX9SQXBwf0z/QTAlQMhAuMA - AAEAnP53BXEFwQAHAB5ADwYC1wTWAK8IA2cBBWcACBDU7NTsMQAQ/OzsMjATIREjESERI5wE - 1fD9Cu8Fwfi2Bn35gwAAAf/h//AEqgQvACMAy0AxCwIVHx4DAAjaDxoWANki2A/VGAweGxoZ - GBcGJBIBAAsCBCMWFQUiHxIMIxJoBSMfJBDU1NTsEjkREjkSOTkRFzkREhc5MQAvPOT07DIy - EO4RFzk5OTABS7AKVFi9ACT/wAABACQAJABAOBE3OFlAVhgeGB8CCQAJAQ0CDQMPBA8FDwYP - Bw8IDwkPCg8LDwwPDQ8ODw8PEA8RDxIPEw4UDRUJFgsXCBgPGA0ZCBoJIxEAEQEWAhYDFxQW - FREWFxccGBwZESMoXQBdASMDDgEVFBYzMjY3Bw4BIyImNTQ2NxMhAyMTIyIGByM+ATMhBIe2 - aQ8PLzcRLiUeHjcadnkVIlD+usK1wyk2PAmgHI+lA3kDkf4ZSlwWOjEFBY0ICGZkLpChAXj8 - bwORQEWmfQAAAQAv/o0D+gYOACUAJkAUINsAGg3bExrcB7EmCmkXah1pBCYQ3Oz87DEAEPzs - 3OQQ3uQwATITNjcSEjMyFhUUBiMiJicmJiMiAwYHAgIjIiY1NDYzMhYXFhYBN2oOAgEMvspQ - ZEA3KjgMBgkQaw4EBBG9xE9lRD0hMA8KCv76ArBsOQIDAbxUQTY/JiMPSP2VwW7+If5iU0E4 - Px0cElMAAAMAcwHVAzsF8AADAB4AKQBfQDMoByUEHxIYEALjAB/dEADhJd0FChnfGN4V3Qrg - HJEqABgNHxAiBgIBKBEGawRsGCJrDSoQ3OzM/OwyMsDAERI5ORESOTEAEPTk/PTsEMTu7dbu - EO4REjkSORE5OTATIRUhAREjNQYGIyImNTQ2MzM1NCYjIgYHNTY2MzIWBSIGFRQWMzI2NTWL - ArD9UAKulSyQXYCYv7y2dXU+iERJkUW3s/7soX5iUmiCAlB7Arj+QHA/RIdxh4oEW1siIn8c - HLDwQ09ATZByHQADAGAB1QNkBfAAAwAPABsALkAZAuMA4RbdCuAQ3QSRHAATDQEZawdsE2sN - HBDc7PzsORESOTEAEPTs9Oz87DATIRUhATIWFRQGIyImNTQ2FyIGFRQWMzI2NTQmiwKw/VAB - WLPOzrOz0NCzaX5/aGl9fAJQewQb3b+/29y+v91zoYiFoKCFiaAAAQBOAAAFzwXnAB8AQEAi - CeUZkRIPAwMA5RABESAWEw8MHwYCAQACbQYcHA9tDBwWIBDU7OzU7OzAwBESORESORESOTEA - LzzsFzL07DAlFSE1NhI1NAAjIgAVFBIXFSE1ISYCNRAAISAAERQCBwXP/aixxv742Nj+98ey - /agBP56RAX8BMQEvAYGOobKysmEBTMrwASL+3e/K/rRhsrKLASq4AT4Biv53/svC/tiNAAAD - AHv/4wdvBHsABgAzAD4BA0BDJy0lPQ4NADSpJRaGFYgSAKkOOhK5HBkuhi26KgO5DrsHMQq4 - HxmMJT80NyYGDwAlNxwHJg8VAAgNPSYIDy03CCJFPxD87MzU/DzU7MQREjk5ETkREjkREjkx - ABDE5DL0PMTk/Dz07BDE7jIQ7hD07hDuETkRORESOTBAgTArMCwwLTAuMC8wMEArQCxALUAu - QC9AMFArUCxQLVAuUC9QMIUrhTCAQJBAoECwQMBA0EDgQOBA8EAdPwA/Bj8NPw4/DwUwLDAt - MC4wL0AsQC1ALkAvUCxQLVAuUC9vAG8Gbw1vDm8PYCxgLWAuYC9wLHAtcC5wL4AsgC2ALoAv - HV1xAV0BLgEjIgYHAz4BMzIAHQEhHgEzMjY3FQ4BIyImJw4BIyImNTQ2MyE1NCYjIgYHNT4B - MzIWAyIGFRQWMzI2PQEGtgGliZm5DkRK1ITiAQj8sgzMt2jIZGTQaqf4TUnYj73S/fsBAqeX - YLZUZb5ajtXv36yBb5m5ApSXtK6eATBaXv7d+lq/yDU1rioseXd4eLuovcASf4suLqonJ2D+ - GGZ7YnPZtCkAAwBI/6IEnAS8AAkAEwArAORAPCssJh8dGhMKAQAEDSkmIBQNBComHhoEuSYN - uRq4JowsKywqFBcQIB4jEwoBAAQQBx8dBxIjUSkQEhdFLBD87DL07DLAERIXORI5ORESOTkR - OTEAEOT07BDuEMAQwBESOTkSORIXORE5ORESOTBAcCgBPy1ZFFYcVR1WIGoVZiF/AHsEfwV/ - Bn8Hfwh/CX8Kfwt/DHsNehV7Gn8bfxx/HX8efx9/IHshfyJ/I38kfyV7JpsZlSWoGaAt8C0m - WQBWE1UdWihpAGYTZRxqKHoAdBN2HHooiR6VGJokohitJBFdAV0JAR4BMzI2NTQmJy4BIyIG - FRQWFwcuATUQADMyFhc3FwceARUQACMiJicHJwOJ/hkpZ0GTrBRcKmc+l6kTFH02NgER8V2f - Q4tfkjU2/u7wYKE/i2ADIf2wKijoyE91mikp69NIbi6XTcV3ARQBODM0qE+zTcZ4/u3+xzQz - qE4AAgCP/+MDrAXVACAAJACGQC8gGgUCBAYZABCGD4gMACGDIwyVE4wjgSUGIhkWCQUBABoi - CQAcASIcISYPCRwWJRDc7NT87NTsERI5ERI5ERI5EjkxABDk9OwQ/s0Q9O4SOTkXOTABS7AQ - VEuwElRbS7ATVFtYvQAl/8AAAQAlACUAQDgRNzhZQAt0BHQFdAZ0B3YcBV0BMxUUBg8BDgEV - FBYzMjY3FQ4BIyImNTQ2PwE+ATc+ATUTIzUzAfS+N1paOjODbU60YF7AZ7jgSVlYMCYIBwbE - ysoERJxlgldYNV4xWW5GQ7w5OMKfTIlWVi81GRU8NgEO/gACATUAAAIABdUAAwAJAGJADwcA - gwKBBAgHBAADBQEAChD8POwyOTkxAC/0/MwwAUuwC1RYvQAKAEAAAQAKAAr/wDgRNzhZAUuw - D1RLsBBUW0uwE1RbWL0ACv/AAAEACgAKAEA4ETc4WbYACyALUAsDXQEjNTMRIxETMxMCAMvL - yxWiFATX/vorAo8BZf6bAAABANkBHwXbA14ABQAXQAoEnAIABgMXAQAGENzU7DEAENTE7DAT - IREjESHZBQKo+6YDXv3BAZUAAAEAPf/XBRkGfQAKACpAGAoJCAcGBQsCBAIACwoJBwYFBAMA - CAEICxDUzBc5MQAQ1MzEERIXOTABMxUjASMBByclAQRcvXP9rkL+wX0ZARsBAAZ9YPm6A3Mt - UGL9OwABAB/+VgUCBhQAIwCKQEAODQIPDBEZHhkLCgkIBAcRHh4ZQhkMEwoHHgEaCqkIE4oS - 5hapDwGKAOYEqSGXDxwIJB4dGxoZDAsJCAcKABIkENTMFzkxABDEMsT87PTsEO727hDuMhI5 - ORESOTkwS1NYBxAF7RcyBxAF7REXOVkiAUuwDFRYvQAk/8AAAQAkACQAQDgRNzhZARUuASMi - BgcDIRUhAwIGIyImJzUeATMyNjcTIzUhEz4BMzIWBQImUCxgchk8AR/+w386vLo6ZC80YS9h - bSKJ+AEXPyTGlzVkBfCkHRx6hP7Jj/2F/uPTFRamISGJpgKtjwFKt8MSAAIA2QEQBdsD9AAd - ADsAP0AfLh85KgAtIhMBEBsMHiqcMTmcIgScGwycEzweAC0PPBDUPMQyMQAQ1OzU7Nz81OzA - ERI5ORESOTkREjk5MAEVBgYjIicmJyYnJiMiBgc1NjYzMhcWFxYXFjMyNhMVBgYjIicmJyYn - JiMiBgc1NjYzMhcWFxYXFjMyNgXbabNhbpIKBwYPm15YrGJps2FukwsFBg+bXlapZ2mzYW6S - CgcGD5teWKxiabNhbpMKBQcPm15WqQJvs05FOwQDAgY9TFSzTkU7BQICBj1LAdqyT0U7BAMC - Bj1MU7JORTsEAgMGPUsAAv/6AAAFYAXBAAIABgA4QA8AAwEDBQQDAgEABQcFBgcQ1MwRFzkx - AC/EzBE5MEAUYwFtAnABeAJ/AnkFdgYHbgB/AAJdAV0JASEBMwEhAqz+XgNE/e/gAkP6mgTu - +8QFD/o/AAIAngCNBCUEIwAGAA0AhkBJA+gEBQQC6AECBQUEAugDAgYABgHoAAAGCugLDAsJ - 6AgJDAwLCegKCQ0HDQjoBwcNQgkCCwTnBwCmDgkMBQIHAwBvBQoHbwxuDhD8/DzU7DIRORES - OTEAEPQ87DI5OTBLU1gHEATtBxAI7QcQCO0HEATtBxAE7QcQCO0HEAjtBxAE7VkiARUBARUB - NRMVAQEVATUEJf7TAS3+KyP+0wEt/isEI7/+9P70vwGiUgGiv/70/vS/AaJSAAACAMEAjQRI - BCMABgANAIZASQzoDQwJCgkL6AoKCQ3oBwgHDOgLDAgIBwXoBgUCAwIE6AMDAgboAAEABegE - BQEBAEIMBQoD5wcApg4MCAEFAAhvCgcBbwMAcA4Q/Dz81DzsEjkREjkxABD0POwyOTkwS1NY - BxAI7QcQBO0HEATtBxAI7QcQCO0HEATtBxAE7QcQCO1ZIhMBFQE1AQElARUBNQEBwQHV/isB - Lf7TAbIB1f4rAS3+0wQj/l5S/l6/AQwBDL/+XlL+Xr8BDAEMAAMA7AAABxQA/gADAAcACwAj - QBEIBACDCgYCBBkFABkBCRkIDBDU/NTs1OwxAC88POwyMjAlMxUjJTMVIyUzFSMDltTUAqnV - 1fqt1dX+/v7+/v4A//8AEAAABWgHawInACQAAAAAAAcBBgC8AXX//wAQAAAFaAdeAicAJAAA - AAAABwEFALwBdf//AHP/4wXZB14CJwAyAAAAAAAHAQUBJwF1AAIAcwAACAwF1QAQABkAO0Af - BZUDEQGVAIEYB5UDrQkYEhAKFQYCHBEABAgVGQ0QGhD87NTExNTsMhI5OTk5MQAv7Owy9Owy - EO4wARUhESEVIREhFSEgABEQACEXIyAAERAAITMH+v0aAsf9OQL4+9f+T/5BAb8BsWeB/r/+ - wAFAAUGBBdWq/kaq/eOqAXwBcAFtAXyq/uH+4P7f/t8AAwBx/+MHwwR7AAYAJwAzAIRAMQcI - ABCGD4gMAKkILgy5FhMoA7kIuyIlH7gZE4w0BgAWIjEJDwAIB0sxEglRKxIcRTQQ/Oz0/PTs - xBESOTkSOTEAEOQy9DzE5OwyEMTuMhDuEPTuERI5MEAlPzVfNXA1nzXPNdA18DUHPwA/Bj8H - Pwg/CQVvAG8GbwdvCG8JBV1xAV0BLgEjIgYHBRUhHgEzMjY3FQ4BIyImJw4BIyIAERAAMzIW - Fz4BMzIAJSIGFRQWMzI2NTQmBwoCpImZuQ4DSPyyDMy3ashiZNBqoPJRR9GM8f7vARHxjNNC - TuiP4gEI+rCUrKuVk6ysApSYs66eNVq+xzQ0riosbm1ubQE5ARMBFAE4b2xrcP7dh+fJyefo - yMfpAAABAAAB6QQAAnkAAwAQtgKpAOkEAQAvxjEAEPzsMBEhFSEEAPwAAnmQAAABAAAB6QgA - AnkAAwAPtQKpAAQBAC/MMQAQ1OwwESEVIQgA+AACeZAAAgCuA+kDbQXVAAUACwAnQBMGAJ4J - A4EMCQoGGQcDBAcAGQEMENz8zNTMEP7UzjEAEPQ87DIwASM1EzMDBSM1EzMDAYHTpIFSAZrT - pIFSA+mtAT/+wa2tAT/+wQACAK4D6QNtBdUABQALACdAEwkDngYAgQwJCgcZBgEDBAEZAAwQ - 3OzUzBDc7tTOMQAQ9DzsMjABMxUDIxMlMxUDIxMBANOkgVIBmtOkgVIF1az+wAFArKz+wAFA - AAEArgPpAdMF1QAFABhACwCeA4EGAwQAGQEGENz81MwxABD07DABIzUTMwMBgdOkgVID6a0B - P/7BAAABALID/gHXBdUABQAYQAsDngCBBgMEAXEABhDc7NTMMQAQ9OwwATMVAyMTAQTTpIFS - BdWY/sEBPwAAAwDZAJYF2wRvAAMABwALAClAFADqAgbqBAIInAQKDAkFAXIEAAgMENzUPPw8 - xDEAENTE/MQQ7hDuMAEzFSMRMxUjASEVIQLf9vb29v36BQL6/gRv9v4S9QJBqgACAAb+IwPu - BnUAAwAHACJAEQIGAAgEBggGBAMCAQAGBQcIENTMFzkxABDUzBE5EjkwCQcB+v5/AYEBgf5/ - AfT+DP4MBYH8z/zHAzkEJfvb+9MELf//AD3+VgR/BhACJwBcAAAAAAAHAI4AXgAA/////AAA - BOcHTgInADwAAAAAAAcBAwBzAXUAAf6J/+MCzQXwAAMAK0ATAA8BAgECDwMAA0ICjACRBAED - BBDUzDEAEOTkMEtTWAcQBe0HEAXtWSIBMwEjAi2g/FygBfD58wAAAgBeAFIEvASyACMALwCD - QEkDCRsVBC0eACccAiEdDBItFAsKAxMPAR0tuRPrD+wnuR3rITAeDAASBCokFDAcFRsqHRMc - GAkDJAsKAQMCJCgCcwZ0KigccxgwENzk7PTk7BIXORI5ORESOTkSOTkREjkREhc5MQAQ1OTs - 9OTsEMAREhc5Ejk5ERI5ORE5ORIXOTABNxcHFhYVFAYHFwcnBgYjIiYnByc3JiY1NDY3JzcX - NjYzMhYTNCYjIgYVFBYzMjYDe89yziUkJijRcs87dD06eD3Pcc8lJSYmz3PPN3RAPHVcm3Jw - np1xcZwD4dFzzjt3Pj9zOc9xzygmJSXPc84+djpAdDjOc88nJST+fHCamnBynJ0AAAEAngCN - AnMEIwAGAEdAJQPoBAUEAugBAgUFBALoAwIGAAYB6AAGQgIE5wCmBwIDAG8FbgcQ/OwyOTEA - EPTsOTBLU1gHBO0HEAjtBxAI7QcQBO1ZIgEVAQEVATUCc/7TAS3+KwQjv/70/vS/AaJSAAAB - AMEAjQKWBCMABgBJQCYF6AYFAgMCBOgDAwIG6AABAAXoBAUBAQBCBQPnAKYHBQFvAwBwBxD8 - POw5MQAQ9Ow5MEtTWAcQCO0HEATtBxAE7QcQCO1ZIhMBFQE1AQHBAdX+KwEt/tMEI/5eUv5e - vwEMAQwAAAIALwAABEoGFAAVABkAm0AoCxQYBwOpABCHDhi+FrEOlwkAvAUBEQ4PBBYCCAAP - FAQICBcACgZMGhD8PMQyxPw8xBDuMhESOTkxAC885jLu/u4Q7hDuMhI5OTABS7AKVFi9ABr/ - wAABABoAGgBAOBE3OFkBS7AOVFi9ABoAQAABABoAGv/AOBE3OFlAGhAWEBcQGBAZBDAbUBuA - D4AQgBugG9Ab7xsIXQBdAREjESERIxEjNTM1NDY7ARUjIgYdAQEzFSMESrn+B7mwsK2zubBj - TQH5ubkEYPugA9H8LwPRj063r5lQaGMBsukAAQAvAAAESgYUABUAhEAhCBMEDwupCQSHAJcR - CbwNAgUACggDCAEKDAgIEAESDkwWEPw8xMT8PMQQ7hESOTkxAC885jL+7hDuMhI5OTABS7AK - VFi9ABb/wAABABYAFgBAOBE3OFkBS7AOVFi9ABYAQAABABYAFv/AOBE3OFlAETAXUBeACoAL - gBegF9AX7xcIXQEhESMRISIGHQEhFSERIxEjNTM1NDYCSgIAuf63Y00BL/7RubCwrgYU+ewF - e1BoY4/8LwPRj067qwAAAQA5/zsDxwXVABMAPkAgEga5ABAIuQoEAAIOCgyBAsIUDwBZEQ0B - VwkFWQsHAxQQ1Dw87DL8PDzsMjEAEOT0xDIQxDIQ7jIQ7jIwJSERIxEhNSERITUhETMRIRUh - ESEDx/6RsP6RAW/+kQFvsAFv/pEBb9/+XAGkmgIfmQGk/lyZ/eEAAQDbAkgBrgNGAAMAErcC - gwAEARkABBDU7DEAENTsMBMzFSPb09MDRv4AAQCu/xIB0wD+AAUAGEALA54AgwYDBAEZAAYQ - 1OzUzDEAEPzsMCUzFQMjEwEA06SBUv6s/sABQAACAK7/EgNtAP4ABQALACdAEwkDngYAgwwD - BAEZAAcJCgcZBgwQ3OzUzBDc7tTOMQAQ/DzsMjAlMxUDIxMlMxUDIxMCmtOkgVL+ZtOkgVL+ - rP7AAUCsrP7AAUAAAAcAcf/jCkwF8AALABcAIwAnADMAPwBLAK5ARCQPJSYlJg8nJCdCQACS - DC6SHo0okhhGBpI0DI06JhKMJBiRTCVJQycxK0MNPQkNDw4DDRUxDRs9DkkNFTcrDRsOIQtM - EPzk7NTE7OQQ7hDu9u4Q7hESORESOTEAEOQy9Dw85DLsMhDu9u4Q7jIwS1NYBxAF7QcQBe1Z - IgFLsBRUS7AJVFtLsAtUW0uwDFRbS7ANVFtLsA5UW1i9AEwAQAABAEwATP/AOBE3OFkBIgYV - FBYzMjY1NCYnMhYVFAYjIiY1NDYBMhYVFAYjIiY1NDYhMwEjEyIGFRQWMzI2NTQmATIWFRQG - IyImNTQ2FyIGFRQWMzI2NTQmCPRXZGRXVWNjVZ66u52gurv5dJ68u5+fuboEJaD8WqAfVmNi - V1djZAOynrq7naC6u59XY2NXVWNjApGUhIKVlYKDlX/cu7vb27u82wLg27u92tu8utz58wWO - lYKElJSEgZb9n9y7u9vbu7zbf5SEgpWVgoOVAP//ABAAAAVoB20CJwAkAAAAAAAHAQcAvAF1 - //8AyQAABIsHbQInACgAAAAAAAcBBwCeAXX//wAQAAAFaAdrAicAJAAAAAAABwEEALwBdf// - AMkAAASLB04CJwAoAAAAAAAHAQMAngF1//8AyQAABIsHawInACgAAAAAAAcBBgCeAXX//wCi - AAACHwdrAicALAAAAAAABwEE/y8Bdf////4AAAJgB20CJwAsAAAAAAAHAQf/LwF1//8ABgAA - AlgHTgInACwAAAAAAAcBA/8vAXX//wA7AAABugdrAicALAAAAAAABwEG/y8Bdf//AHP/4wXZ - B2sCJwAyAAAAAAAHAQQBJwF1//8Ac//jBdkHbQInADIAAAAAAAcBBwEnAXX//wBz/+MF2Qdr - AicAMgAAAAAABwEGAScBdf//ALL/4wUpB2sCJwA4AAAAAAAHAQQA7gF1//8Asv/jBSkHbQIn - ADgAAAAAAAcBBwDuAXX//wCy/+MFKQdrAicAOAAAAAAABwEGAO4BdQABAMEAAAF5BGAAAwAg - twC/AgEIAEYEEPzsMQAv7DBACxAFQAVQBWAFcAUFAV0TMxEjwbi4BGD7oAAAAQDBBO4DPwZm - AAYAN0AMBAUCtACzBwQCdQYHENzsOTEAEPTsMjkwAEuwCVRLsA5UW1i9AAf/wAABAAcABwBA - OBE3OFkBMxMjJwcjAbaU9Yu0tIsGZv6I9fUAAQC2BR0DSgY3ABsAY0AkABIHDgsEARIHDwsE - EsMZBwTDFQvtHA8BDgAHFVYWdwdWCHYcEPTs/OwROTk5OTEAEPw8/NQ87BESORESORESORES - OTAAS7AJVEuwDFRbWL0AHP/AAAEAHAAcAEA4ETc4WQEnLgEjIgYHIz4BMzIWHwEeATMyNjcz - DgEjIiYB/DkWIQ0mJAJ9AmZbJkAlORYhDSYkAn0CZlsmQAVaNxQTSVKHkxwhNxQTSVKHkxwA - AAEA1QViAysF9gADAC+3Au8A7gQBAAQQ1MwxABD87DAAS7AJVEuwDlRbWL0ABP/AAAEABAAE - AEA4ETc4WRMhFSHVAlb9qgX2lAAAAQDHBSkDOQZIAA0AV0AOC/AEBwCzDgdWCAFWAA4Q3OzU - 7DEAEPQ81OwwAEuwCVRYvQAO/8AAAQAOAA4AQDgRNzhZAEuwD1RLsBBUW0uwEVRbWL0ADgBA - AAEADgAO/8A4ETc4WRMzHgEzMjY3Mw4BIyImx3YLYVdWYA12Cp6RkZ4GSEtLSkyPkJAAAQGa - BUQCZgYQAAMALEAJAs4AzQQBZAAEENTsMQAQ/OwwAEuwCVRYvQAE/8AAAQAEAAQAQDgRNzhZ - ATMVIwGazMwGEMwAAAIA7gThAxIHBgALABcAX0ARA8EV8gnBD/EYAFYMeAZWEhgQ1Oz07DEA - EPTs9OwwAEuwCVRLsAxUW1i9ABj/wAABABgAGABAOBE3OFkBS7AKVEuwC1RbS7AMVFtYvQAY - /8AAAQAYABgAQDgRNzhZATQmIyIGFRQWMzI2NxQGIyImNTQ2MzIWAphYQEFXV0FAWHqfc3Of - n3NznwX0P1hXQEFXWEBzoKBzc5+fAAABASP+dQLBAAAAEwAfQA4JBgoN8wYAEwAQJwMJFBDc - 1OzUzDEAL9T8xBI5MCEWFhUUBiMiJic1FhYzMjY1NCYnAlQ3Nnh2LlcrIkovOzwrLT5pMFlb - DAyDEQ8wLh5XPQACAPAE7gOuBmYAAwAHAEJAEQYCtAQAswgEBwMABQEDBQcIENTc1MwRORES - OTEAEPQ87DIwAEuwCVRLsA5UW1i9AAj/wAABAAgACABAOBE3OFkBMwMjAzMDIwL8sviHgarf - iQZm/ogBeP6IAAABAUz+dQLBAAAAEwAgQA8LDgoH8w70AAEACgQnERQQ1OzE1MwxAC/8/MQS - OTAhMwYGFRQWMzI2NxUGBiMiJjU0NgG4dy0rNzYgPh8mRB56czU9WB8uLg8PhQoKV10waQAB - AMEE7gM/BmYABgA3QAwDALQEAbMHAwV1AQcQ3Ow5MQAQ9DzsOTAAS7AJVEuwDlRbWL0AB//A - AAEABwAHAEA4ETc4WQEDMxc3MwMBtvWLtLSL9QTuAXj19f6IAAH/8gAABHUF1QANAD9AHgwL - CgQDAgYABpUAgQgDBAELDgAEBQEcDAc6CQB5DhD0POzE/DzEERI5ERI5MQAv5OwRFzkwtDAP - UA8CAV0TMxElFwERIRUhEQcnN9PLATlQ/ncC1/xelE3hBdX9mNtv/u7946oCO2pungAAAQAC - AAACSAYUAAsAXkAaCgkIBAMCBgCXBgMEAQkKAAR6BQEICnoHAAwQ1Dzk/DzkERI5ERI5MQAv - 7Bc5MAFLsBBUWL0ADABAAAEADAAM/8A4ETc4WUATEA1ADVANYA1zBHoKcA3gDfANCV0TMxE3 - FwcRIxEHJzfHuH1Mybh7SsUGFP2mWmqN/OMCmlhqjQD//wCH/+MEogdtAicANgAAAAAABwEI - AIsBdf//AG//4wPHBmYCJwBWAAAAAAAHAOAAFwAA//8AXAAABR8HbQInAD0AAAAAAAcBCAC+ - AXX//wBYAAAD2wZmAicAXQAAAAAABwDgABsAAAACAQT+ogGuBZgAAwAHABxADQH1AAT1BQgE - AAUGAggQ3DzsMjEAENTs1OwwAREjERMRIxEBrqqqqgGY/QoC9gQA/QoC9gAAAgAKAAAFugXV - AAwAGQBnQCAQCakLDZUAgRKVDgsHBwEZEwQPDRYZBDIKEQ0cCAB5GhD0POwyxPTsEMQXOTEA - L8Yy7vbuEO4yMEAoIBt/G7AbA58JnwqfC58Mnw6fD58QnxG/Cb8Kvwu/DL8Ovw+/EL8REF0B - XRMhIAAREAApAREjNTMTESEVIREzIAAREAAh0wGgAbEBlv5p/lD+YMnJywFQ/rDzATUBH/7h - /ssF1f6X/oD+fv6WAryQAeP+HZD96gEYAS4BLAEXAAIAcf/jBHUGFAAOACgBJ0BeJXsmJR4j - HiR7IyMeD3sjHih7JygeIx4mJygnJSQlKCgnIiMiHyAfISAgH0IoJyYlIiEgHwgjHgMPIwO5 - Gwm5FYwbI7EpJicSDCEgGCglIyIfBR4PBgwSElEGEhhFKRD87PTsETk5FzkSOTkREjk5MQAQ - 7MT07BDuEjkSORIXOTBLU1gHEA7JBxAIyQcQCMkHEA7JBxAI7QcO7QcQBe0HEAjtWSKyPyoB - AV1AdhYlKx8oIi8jLyQpJS0mLScqKDYlRiVYIFghYCBgIWYidSB1IXUiEyUjJSQmJiYnJyg2 - JDYlRiRFJVogWiFiIGIhfwB/AX8CegN7CX8Kfwt/DH8Nfw5/D38QfxF/En8TfxR7FXobehx/ - HX8ediB2IXgioCrwKiddAF0BLgEjIgYVFBYzMjY1NCYTFhIVFAAjIgA1NAAzMhYXJwUnJScz - FyUXBQNGMlgpp7mukpGuNgl+cv7k5uf+5QEU3RI0Kp/+wSEBGbXkfwFNIf7ZA5MRENjDvN7e - vHq8ASaP/uCt//7JATf/+gE3BQW0a2NczJFvYWIA/////AAABOcHawInADwAAAAAAAcBBABz - AXX//wA9/lYEfwZmAicAXAAAAAAABwCNAF4AAAACAMkAAASNBdUADAAVAD1AGw6VCQ2VAvYA - gQsVDwkDBAESGQY/DQoBHAAEFhD87DIy/OwRFzkxAC/0/OzU7DBACQ8XHxc/F18XBAFdEzMR - MzIEFRQEKwERIxMRMzI2NTQmI8nK/vsBAf7/+/7Kyv6NmpmOBdX++OHc3OL+rgQn/dGShoaR - AAIAuv5WBKQGFAAQABwAPkAbFLkFCBq5AA6MCLgBvQOXHRESC0cXBAAIAkYdEPzsMjL07DEA - EOzk5PTE7BDG7jBACWAegB6gHuAeBAFdJREjETMRPgEzMhIREAIjIiYBNCYjIgYVFBYzMjYB - c7m5OrF7zP//zHuxAjinkpKnp5KSp6j9rge+/aJkYf68/vj++P68YQHry+fny8vn5wAAAQDZ - Ai0F2wLXAAMAEbYAnAIEAQAEENTEMQAQ1OwwEyEVIdkFAvr+AteqAAABARkAPwWcBMUACwCF - QE0KnAsKBwgHCZwICAcEnAMEBwcGBZwGBwYEnAUEAQIBA5wCAgELnAABAAqcCQoBAQBCCggH - BgQCAQAIBQMLCQwLCgkHBQQDAQgCAAgGDBDUPMwyFzkxABDUPMwyFzkwS1NYBxAI7QcQBe0H - EAXtBxAI7QcQBe0HEAjtBxAF7QcQCO1ZIgkCBwEBJwEBNwEBBZz+NwHJd/41/jV2Acj+OHYB - ywHLBEz+Nf43eQHL/jV5AckBy3n+NQHLAAEAiQKcAsUF3wAKACxAGAcA3QkD3QQC3Qn3BZEL - CHwGXQN8AXwACxDc9OT85DEAEPTs7NTsEO4yMBMzEQc1NzMRMxUhnMzf5onN/dcDCgJjKXQn - /StuAAABAF4CnAK0BfAAGABKQCQAfQYEABd9BgYEQgQCAA7dDwDdAvcL3Q8SkRkADgh+ARUO - AxkQ3MTUxOwROTEAEPTE7PzsEO4REjkwS1NYBxAF7RcyBwXtWSIBIRUhNTY3ADU0JiMiBgc1 - NjYzMhYVFAEGAQwBqP2qIj8BWGhVNHpITYU5ka7+tTgDDnJuHzgBMV5CUSMjexwchGyL/uQw - AAEAYgKNAs0F8AAoAEhAJwAVEwrdCR/dIBPdFQ3dCfgG9xzdIPgjkSkWEwAUGX4mEH4DFB8J - KRDcxMTU7NTsETk5OTEAEPTk7Pzk7NTsEO4Q7hESOTABFhYVFAYjIiYnNRYWMzI2NTQmIyM1 - MzI2NTQmIyIGBzU2NjMyFhUUBgIMXGW+sTl9RjR3Q214b2xWXl5hZF8oZlFJgDeQqVoEYBJt - UnyGFRR5GxpPRkpMbD88Oj0SF3MREnZjRWD//wCJ/+MHfwXwACcA8AAAAAAAJwC8AzUAAAAH - AQkEi/1k//8Aif/jBz8F8AAnAPAAAAAAACcAvAM1AAAABwDxBIv9ZP//AGL/4wd/BfAAJwDy - AAAAAAAnALwDNQAAAAcBCQSL/WT//wBz/+MFiwdtAicAKgAAAAAABwEKARsBdf//AHH+VgRa - BkgCJwBKAAAAAAAHANoAiwAA//8AyQAAAZUHUAInACwAAAAAAAcBC/8vAXX//wCH/nUEogXw - AicANgAAAAAABwDdAIsAAP//AG/+dQPHBHsCJwBWAAAAAAAHAN0AFwAA//8Ac//jBScHawIn - ACYAAAAAAAcBBAEtAXX//wBx/+MD5wZmAicARgAAAAAABwCNAIkAAP//AHP/4wUnB20CJwAm - AAAAAAAHAQgBLQF1//8Acf/jA+cGZgInAEYAAAAAAAcA4ACJAAAAAgBx/+ME9AYUABgAJABK - QCQHA9MJAfkiuQAWHLkNEIwWuAWXCwIfDAQDAAgICgZHGRITRSUQ/Oz0PMT8FzzEMQAv7OT0 - xOwQxO79PO4yMLZgJoAmoCYDAV0BESE1ITUzFTMVIxEjNQ4BIyICERASMzIWARQWMzI2NTQm - IyIGA6L+ugFGuJqauDqxfMv//8t8sf3Hp5KSqKiSkqcDtgFOfZOTffr8qGRhAUQBCAEIAURh - /hXL5+fLy+fnAAABAGQB3wJ/AoMAAwARtgCcAgQBAAQQ3MwxABDU7DATIRUhZAIb/eUCg6QA - AAEA2wJIAa4DRgADABK3AoMABAEZAAQQ1OwxABDU7DATMxUj29PTA0b+AAEAAP/jBI8F8AAx - ARxAOiAS0yIQKwfTCRmhGq4WlR0BoQCuBJUvkR2MKQkyKyIhKSMmEhAKAw0JEQgsICYTBxEI - EQ0cGQAmKiEvPNTEMvzExBI5ORI5ORESOREXORI5ORE5OTEAEMQy5PTs9OwQ7vbuEO4y3Tzu - MjABS7AJVEuwDFRbS7ANVFtLsA9UW0uwF1RbS7AYVFtYvQAy/8AAAQAyADIAQDgRNzhZQHoO - AA4BCwILMVQUaQxsDm4PbxBvEW8SbxNpFGsfbyBvIW8ibyNuJGwlaSdpLZ8HnwifCZ8Knwuf - DJ8Nnw6fD58QnxGfEp8Tlh+fIJ8hnyKfI58knyWfJp8nnyifKZ8qnyufLJ0tMgAIAAkQCBAJ - IAggCVUVUx5qFWcfCl0AXQEVLgEjIgYHIQchDgEVFBYXIQchHgEzMjY3FQ4BIyIAAyM3MzQm - NTQ2NSM3MxIAMzIWBI9bqWadyiACQTf95gIBAQIBvjj+iiDKnWapW1m5YO3+yyjTN4sBAcI3 - nCgBNuxiuQVi1WlayLt7GC4jIC4Ye7vKWmnTSEgBIgEDexcvICMvF3sBAQEiRwACANcFDgMp - BdkAAwAHAKVADQQAzgYCCAFkAAVkBAgQ1Pzc7DEAENQ87DIwAEuwDlRLsBFUW1i9AAgAQAAB - AAgACP/AOBE3OFkBS7AOVEuwDVRbS7AXVFtYvQAI/8AAAQAIAAgAQDgRNzhZAUuwEVRLsBlU - W1i9AAgAQAABAAgACP/AOBE3OFkAS7AYVFi9AAj/wAABAAgACABAOBE3OFlAEWABYAJgBWAG - cAFwAnAFcAYIAV0BMxUjJTMVIwJey8v+ecvLBdnLy8sAAQFzBO4C8AX2AAMAf0ARAgMAAwEA - AANCAAL6BAEDAwQQxBDAMQAQ9MwwS1NYBxAFyQcQBclZIgBLsAxUWL0ABP/AAAEABAAEAEA4 - ETc4WQBLsA5UWL0ABABAAAEABAAE/8A4ETc4WUAgBgIVAiUBJQI2AkYCVgJqAWcCCQ8ADwEf - AB8BLwAvAQZdAV0BMwMjAje55JkF9v74AAEAtgUOA0oF6QAdAHVAIRYQDwMTDAcBAAMIFwzD - BBPDGwj6HhABDwAHFlYYB1YJHhDU7NTsETk5OTkxABD0POzU7DISFzkREhc5MABLsAxUWL0A - Hv/AAAEAHgAeAEA4ETc4WQBLsA5UWL0AHgBAAAEAHgAe/8A4ETc4WbQQCx8aAl0BJy4BIyIG - HQEjNDYzMhYfAR4BMzI2PQEzDgEjIiYB/DkZHwwkKH1nViQ9MDkXIg8gKH0CZ1QiOwU5IQ4L - Mi0GZXYQGx4NDDMpBmR3EAABAQwE7gKLBfYAAwCJQBEBAgMCAAMDAkIAAfoEAQMDBBDEEMAx - ABD0zDBLU1gHEAXJBxAFyVkiAEuwDFRYvQAE/8AAAQAEAAQAQDgRNzhZAEuwDlRYvQAEAEAA - AQAEAAT/wDgRNzhZQCoGAAYBFgASASQAJAE1AUMBVQBVAZ8AnwGvAK8BDg8ADwMfAB8DLwAv - AwZdAV0BEyMDAcfEmeYF9v74AQgAAQDPBO4DMQX4AAYAd0AKBAAFAvoHBAIGBxDUxDkxABD0 - PMQ5MABLsAxUWL0AB//AAAEABwAHAEA4ETc4WQBLsA5UWL0ABwBAAAEABwAH/8A4ETc4WQFL - sA5UWL0AB//AAAEABwAHAEA4ETc4WUATDwAPAQwEHwAfAR0ELwAvAS0ECQBdATMTIycHIwGi - vNOLpqaLBfj+9rKyAAEAzwTuAzEF+AAGAIZACgMEAQD6BwMFAQcQ1MQ5MQAQ9MQyOTAAS7AM - VEuwCVRbS7AKVFtLsAtUW1i9AAf/wAABAAcABwBAOBE3OFkAS7AOVFi9AAcAQAABAAcAB//A - OBE3OFkBS7AOVFi9AAf/wAABAAcABwBAOBE3OFlAEwAAAwMABhAAEgMQBiAAIgMgBgkAXQED - Mxc3MwMBotOLpqaL0wTuAQqysv72AAACAD8CnAL0Bd8AAgANANRAFgADCwfdBQEJ9wORDgEM - CgBdBggEDA4Q3NQ8xOwyETkxABD0/NQ87DISOTABS7AOVEuwD1RbS7AQVFtLsBFUW0uwC1Rb - S7AKVFtYvQAOAEAAAQAOAA7/wDgRNzhZAEuwEVRLsA5UW1i9AA7/wAABAA4ADgBAOBE3OFlA - VAsBHQEvATkBSQFGA1kDaQOLA6sDuwMLAQAPAQ8CDwUPBg8HDwgPCw8MDw0TAB8BHwIfBR8G - HwcfCB8LHwwfDSIANQBHAEsNUwBbDWUAhAClALUAHl0BXQkBIQMzETMVIxUjNSE1Ad3+ywE1 - FqaHh5D+YgVm/l0CHP3kbbq6eQAAAQDHBQYDOQX4AA0AakAOBwAEwwv6DgdWCAFWAA4Q1OzU - 7DEAEPT8xDIwAEuwDFRYvQAO/8AAAQAOAA4AQDgRNzhZAEuwDlRYvQAOAEAAAQAOAA7/wDgR - NzhZAUuwDlRLsA9UW1i9AA7/wAABAA4ADgBAOBE3OFkTMx4BMzI2NzMOASMiJsd2DWNTUmEQ - dgqgj5CfBfg2OTc4d3t6AAABAZoFDgJmBdsAAwARtgAC+gQBAAQQ1MwxABD0zDABMxUjAZrM - zAXbzQAAAAAAAgABAAAAAAAUAAMAAQAAARoAAAEGAAABAAAAAAAAAAEDAAAAAgAAAAAAAAAA - AAAAAAAAAAEAAAMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIyQlJicoKSorLC0u - LzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2BhAGJj - ZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZ - mpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGx8jJysvMzc7P - 0NEA0tPU1dbX2Nna29zd3t/gAAQCPgAAADoAIAAEABoAfgD/AQcBEQEfATEBQgFTAWEBeAF+ - AZICxwLdA6kDwCAmIDAgOiCsISIiBiIeIisiSCJlJcr7Av//AAAAIACgAQYBDAEeATABQQFS - AV4BeAF9AZICxgLYA6kDwCATIDAgOSCsISIiAiIPIisiSCJgJcr7Af///+MAAP/1AAD/2AAA - /6D/XgAA/0P/aP8UAAAAAPz2/NsAAOCW4IXgVt9qAAAAAN5x3l8AANrvBb8AAQAAADgAAAD0 - AAAA/AAAAAAA+gAAAAAAAAD6APwAAAAAAQIAAAAAAAAAAAEgASgAAAAAAUIAAAAAAAAArACj - AIQAhQC9AJYA5wCGAI4AiwCdAKkApAEAAIoA2QCDAJMA8QDyAI0AlwCIAMMA3QDwAJ4AqgDz - APQA9QCiAK0AyQDHAK4AYgBjAJAAZADLAGUAyADKAM8AzADNAM4A6ABmANIA0ADRAK8AZwDv - AJEA1QDTANQAaADqAOwAiQBqAGkAawBtAGwAbgCgAG8AcQBwAHIAcwB1AHQAdgB3AOkAeAB6 - AHkAewB9AHwAuAChAH8AfgCAAIEA6wDtALoA/QD+AAAAAAAAAP8A+ADWAPkA+gDjAOQA1wDg - ANoA2wDcAN8A2ADeALIAswAAAAAAAAC2ALcAxAAAALQAtQDFAAAAggDCAIcAAAAAAAAAqwCY - AAAAAAAAAKgAmgAAAJkA7gAAAAAAvAAAAAAAAAEBAKUAAAAAAAAAkgCPAAAAAAAAAJQAlQTN - AGYAAAAAAosAAAKLAAADNQE1A64AxQa0AJ4FFwCqB5oAcQY9AIECMwDFAx8AsAMfAKQEAAA9 - BrQA2QKLAJ4C4wBkAosA2wKyAAAFFwCHBRcA4QUXAJYFFwCcBRcAZAUXAJ4FFwCPBRcAqAUX - AIsFFwCBArIA8AKyAJ4GtADZBrQA2Qa0ANkEPwCTCAAAhwV5ABAFfQDJBZYAcwYpAMkFDgDJ - BJoAyQYzAHMGBADJAlwAyQJc/5YFPwDJBHUAyQbnAMkF/ADJBkwAcwTTAMkGTABzBY8AyQUU - AIcE4//6BdsAsgV5ABAH6QBEBXsAPQTj//wFewBcAx8AsAKyAAADHwDHBrQA2QQA/+wEAACq - BOcAewUUALoEZgBxBRQAcQTsAHEC0QAvBRQAcQUSALoCOQDBAjn/2wSiALoCOQDBB8sAugUS - ALoE5QBxBRQAugUUAHEDSgC6BCsAbwMjADcFEgCuBLwAPQaLAFYEvAA7BLwAPQQzAFgFFwEA - ArIBBAUXAQAGtADZBXkAEAV5ABAFlgBzBQ4AyQX8AMkGTABzBdsAsgTnAHsE5wB7BOcAewTn - AHsE5wB7BOcAewRmAHEE7ABxBOwAcQTsAHEE7ABxAjkAkAI5/8cCOf/eAjn/9AUSALoE5QBx - BOUAcQTlAHEE5QBxBOUAcQUSAK4FEgCuBRIArgUSAK4EAAA5BAAAwwUXAKwFFwCBBAAAXAS4 - ATMFFwCeBQoAuggAARsIAAEbCAABJwQAAXMEAADXBrQA2QfLAAgGTABmBqoA3Qa0ANkGtADZ - BrQA2QUXAFIFFwCuBCMAaAVkABkGDgCcBLb/4QQrAC8DxQBzA8UAYAYdAE4H2wB7BOUASAQ/ - AI8DNQE1BrQA2QUZAD0FFwAfBrQA2QVa//oE5QCeBOUAwQgAAOwFFwAABXkAEAV5ABAGTABz - CI8AcwgvAHEEAAAACAAAAAQlAK4EJQCuAosArgKLALIGtADZA/QABgS8AD0E4//8AVb+iQUX - AF4DMwCeAzMAwQUKAC8FCgAvBAAAOQKLANsCiwCuBCUArgq8AHEFeQAQBQ4AyQV5ABAFDgDJ - BQ4AyQJcAKICXP/+AlwABgJcADsGTABzBkwAcwZMAHMF2wCyBdsAsgXbALICOQDBBAAAwQQA - ALYEAADVBAAAxwQAAZoEAADuBAABIwQAAPAEAAFMBAAAwQR///ICRgACBRQAhwQrAG8FewBc - BDMAWAKyAQQGMwAKBOUAcQTj//wEvAA9BNcAyQUUALoGtADZBrQBGQM1AIkDNQBeAzUAYgfB - AIkHwQCJB8EAYgYzAHMFFABxAlwAyQUUAIcEKwBvBZYAcwRmAHEFlgBzBGYAcQUUAHEC4wBk - AosA2wUXAAAEAADXBAABcwQAALYEAAEMBAAAzwQAAM8DNQA/BAAAxwQAAZoAAgAAAAAAAP8r - AI8AAAAAAAAAAAAAAAAAAAAAAAAAAAEMAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAO - AA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAAp - ACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBE - AEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBf - AGAAYQBiAGMAZABlAGYAZwBoAGkAagBrAGwAbQBuAG8AcABxAHIAcwB0AHUAdgB3AHgAeQB6 - AHsAfAB9AH4AfwCAAIEAggCDAIQAhQCGAIcAiACJAIoAiwCMAI0AjgCPAJAAkQCSAJMAlACV - AJYAlwCYAJkAmgCbAJwAnQCeAJ8AoAChAKIAowCkAKUApgCnAKgAqQCqAKsArACtAK4ArwCw - ALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDL - AMwAzQDOAM8A0ADRANMA1ADVANYA1wDYANkA2gDbANwA3QDeAN8A4ADhAOIA4wDkAOUA5gDn - AOgA6QDqAOsA7ADtAO4A7wDwAPEA8gDzAPUA9AD2APgA+QD6APsA/AD9AP4A/wEAAQEBAgED - AQQBBQEGAQcBCAEJAQoBCwEMAQ0Jc2Z0aHlwaGVuDnBlcmlvZGNlbnRlcmVkBEV1cm8FYzY0 - NTkFYzY0NjAFYzY0NjEFYzY0NjIFYzY0NjMFYzY0NjYFYzY0NjcFYzY0NjgFYzY0NjkAAAAA - ACIAIgAiACIAWACTAP8BtgJPA4MDsgP2BCEEbgSYBLQEygTeBQMFRQWCBgUGfgbhB0wHtwf8 - CGUIzwjuCRYJUglzCa4KHwrfC1gLsAv7DDoMaQyTDOYNFA09DXoODQ4vDqwPAA9FD4UP6xB1 - EPERKRFwEeASvROKE+sUUBSLFLEU4RUDFRgVQBXWFiIWbRa5FyMXexffGBsYQxiAGPgZFhl3 - GbMaBBpSGqEa2BuHG8QcABydHboehx93H+ggWyByIPMhNSFCIeIh7yH8IgkiFiIjIjAiPSJK - IlciZCJxIn4iiyKYIqUisiK/Iswi2SLmIvMjACMNIxojJyM0I0EjTiNbI2gjlCPPJDQkjyUz - JVMlgSYUJronSyeQJ7coEyhYKMMpXyolKlwqoyrpK3or0yxELI8ssS1QLaAuDi5SLqovhzBB - ML0xBTEhMVAxzzJIMnoy3zNGM3AzcDN9M4ozlzPmNHo0jzSjNNE0/zUcNTk1ZzWRNZ41qzXP - Nls2kzbNN0M3qTfrOAA4HDhKOQ85HDkpOTY5QzlQOV05ajl3OYQ5kTmeOas5uDnFOdI57zoc - Ons6oDrlOwg7XjuOO8Q79DwiPF88pzy0PME8zjzbPP49Yz47Pkg+VT6YPuc+/T9hP40/3EA6 - QEtAXEBtQHpAh0CUQKFArkC7QMhA1UDiQUBBVkFrQkVCqkL3Q19DskP/RFVE20UqRT8AAAAA - AAEAAC2GAAEHlBgAAAoVeAAQACT/0wAQACX/twAQACYAAAAQACcAAAAQACkAAAAQACoASwAQ - ACsAAAAQAC0AcgAQAC4AAAAQAC8AAAAQADIAOQAQADMAAAAQADQASwAQADUAAAAQADf/RAAQ - ADn/iAAQADr/rQAQADv/mgAQADz/DQAQAD0AAAAQAEkAAAAQAFEAAAAQAFIAJgAQAFUAAAAQ - AFn/yQAQAFoAAAAQAFz/3AAQAGL/0wAQAGQAAAAQAGcAOQAQAHgAAAAQAHkAJgAQAHoAJgAQ - AHsAJgAQAHwAJgAQAH0AJgAQAIkAAAAQAJAAAAAQAK3/0wAQAK7/0wAQAK8AOQAQALr/3AAQ - ALv/DQAQAMf/0wAQAMn/0wAQANAAOQAQANEAOQAQANIAOQAQAOUAAAAQAOkAAAAQAOr/DQAQ - AOv/3AAQAOwAAAAQAPYASwAQAPsAAAAQAP0AAAAkABD/0wAkABH/3AAkAB3/3AAkACQAOQAk - ACb/3AAkACr/3AAkADL/3AAkADT/3AAkADYAAAAkADf/YQAkADgAAAAkADn/fQAkADr/kAAk - ADsAAAAkADz/YQAkAEb/3AAkAEf/3AAkAEj/3AAkAEn/twAkAFL/3AAkAFT/3AAkAFf/3AAk - AFgAAAAkAFn/iAAkAFr/rQAkAFz/dQAkAGIAOQAkAGT/3AAkAGf/3AAkAGgAAAAkAG//3AAk - AHD/3AAkAHH/3AAkAHL/3AAkAHP/3AAkAHn/3AAkAHr/3AAkAHv/3AAkAHz/3AAkAH3/3AAk - AH4AAAAkAH8AAAAkAIAAAAAkAIEAAAAkAKn/twAkAKoAAAAkAK0AOQAkAK4AOQAkAK//3AAk - ALT++AAkALX/AwAkALr/dQAkALv/YQAkAMUALwAkAMcAOQAkAMkAOQAkAND/3AAkANH/3AAk - ANL/3AAkANMAAAAkANQAAAAkANUAAAAkAOMAAAAkAOr/YQAkAOv/dQAkAPb/3AAkAPkAAAAk - APv/3AAkAPz/3AAkAP3/3AAkAP7/3AAlABAAAAAlACb/3AAlACr/3AAlADL/3AAlADb/3AAl - ADn/wQAlADr/twAlADz/kAAlAGT/3AAlAGf/3AAlAKn/wQAlAKr/3AAlAK//3AAlALT/kAAl - ALX/kAAlALv/kAAlAMX/rQAlAND/3AAlANH/3AAlANL/3AAlAOP/3AAlAOr/kAAlAPb/3AAl - APn/3AAlAPv/3AAlAP3/3AAmABAAAAAmACQAAAAmADYAAAAmADz/3AAmAGIAAAAmAKn/3AAm - AKr/3AAmAK0AAAAmAK4AAAAmALQAAAAmALUAJgAmALv/3AAmAMUAAAAmAMcAAAAmAMkAAAAm - AOMAAAAmAOr/3AAmAPkAAAAnABAAAAAnACT/3AAnADn/3AAnADoAAAAnADz/kAAnAGL/3AAn - AKn/3AAnAKr/3AAnAK3/3AAnAK7/3AAnALT/0wAnALX/yQAnALv/kAAnAMX/RAAnAMf/3AAn - AMn/3AAnAOr/kAApABAAAAApABH+twApAB3/YQApACT/RAApADb/3AApADf/3AApAET/RAAp - AEj/kAApAEz/awApAFL/twApAFX/awApAFj/kAApAFz/RAApAGL/RAApAGn/RAApAGr/RAAp - AGv/RAApAGz/RAApAG3/RAApAG7/RAApAHD/kAApAHH/kAApAHL/kAApAHP/kAApAHn/twAp - AHr/twApAHv/twApAHz/twApAH3/twApAH7/kAApAH//kAApAID/kAApAIH/kAApAKkAAAAp - AKoAAAApAK3/RAApAK7/RAApALT/0wApALUAAAApALr/RAApAMX+iAApAMf/RAApAMn/RAAp - AOP/3AApAOv/RAApAPn/3AAqABAAAAAqACQAAAAqADf/twAqADoAAAAqADz/mgAqAGIAAAAq - AKn/3AAqAKr/3AAqAK0AAAAqAK4AAAAqALT/0wAqALX/0wAqALv/mgAqAMX/yQAqAMcAAAAq - AMkAAAAqAOr/mgArABAAAAArABH/3AArAB0AAAArAKkAAAArAKoAAAArALT/twArALX/wQAr - AMX/twAtABD/twAtACT/3AAtAGL/3AAtAKn/3AAtAKr/3AAtAK3/3AAtAK7/3AAtALT/twAt - ALX/wQAtAMX/kAAtAMf/3AAtAMn/3AAuABD/KQAuACT/3AAuACb/kAAuADL/kAAuADf/YQAu - ADj/yQAuADr/twAuADz/twAuAET/3AAuAEj/mgAuAFL/mgAuAFj/mgAuAFz/awAuAGL/3AAu - AGT/kAAuAGf/kAAuAGj/yQAuAGn/3AAuAGr/3AAuAGv/3AAuAGz/3AAuAG3/3AAuAG7/3AAu - AHD/mgAuAHH/mgAuAHL/mgAuAHP/mgAuAHn/mgAuAHr/mgAuAHv/mgAuAHz/mgAuAH3/mgAu - AH7/mgAuAH//mgAuAID/mgAuAIH/mgAuAKn/fQAuAKoAAAAuAK3/3AAuAK7/3AAuAK//kAAu - ALT/wQAuALX/wQAuALr/awAuALv/twAuAMUAAAAuAMf/3AAuAMn/3AAuAND/kAAuANH/kAAu - ANL/kAAuANP/yQAuANT/yQAuANX/yQAuAOr/twAuAOv/awAuAPv/kAAuAP3/kAAvABD/3AAv - ACQALwAvADL/twAvADf+5gAvADj/mgAvADn/HwAvADr/RAAvADz+8AAvAEQAAAAvAEj/3AAv - AFL/3AAvAFj/3AAvAFz/RAAvAGIALwAvAGf/twAvAGj/mgAvAGkAAAAvAGoAAAAvAGsAAAAv - AGwAAAAvAG0AAAAvAG4AAAAvAHD/3AAvAHH/3AAvAHL/3AAvAHP/3AAvAHn/3AAvAHr/3AAv - AHv/3AAvAHz/3AAvAH3/3AAvAH7/3AAvAH//3AAvAID/3AAvAIH/3AAvAKkAAAAvAKoAAAAv - AK0ALwAvAK4ALwAvAK//twAvALT+YQAvALX95gAvALr/RAAvALv+8AAvAMUAAAAvAMcALwAv - AMkALwAvAND/twAvANH/twAvANL/twAvANP/mgAvANT/mgAvANX/mgAvAOr+8AAvAOv/RAAy - ABAAOQAyABH/rQAyAB3/3AAyACT/3AAyADn/3AAyADv/fQAyADz/kAAyAGL/3AAyAKn/3AAy - AKoAAAAyAK3/3AAyAK7/3AAyALT/0wAyALX/3AAyALv/kAAyAMX/RAAyAMf/3AAyAMn/3AAy - AOr/kAAzABD/0wAzABH+wQAzAB0AAAAzACT/fQAzADgAAAAzADoAAAAzADz/0wAzAET/pAAz - AEj/twAzAEz/0wAzAFH/3AAzAFL/twAzAFX/3AAzAFb/3AAzAFj/3AAzAFwAAAAzAGL/fQAz - AGgAAAAzAGn/pAAzAGr/pAAzAGv/pAAzAGz/pAAzAG3/pAAzAG7/pAAzAHD/twAzAHH/twAz - AHL/twAzAHP/twAzAHj/3AAzAHn/twAzAHr/twAzAHv/twAzAHz/twAzAH3/twAzAH7/3AAz - AH//3AAzAID/3AAzAIH/3AAzAKn/3AAzAKoAAAAzAK3/fQAzAK7/fQAzALQAJgAzALUAJgAz - ALoAAAAzALv/0wAzAMX+twAzAMf/fQAzAMn/fQAzANMAAAAzANQAAAAzANUAAAAzAOT/3AAz - AOr/0wAzAOsAAAAzAPr/3AA0ABAAOQA0AKkAAAA0AKoAAAA0ALT/0wA0ALX/3AA0AMX/fQA1 - ABD/rQA1ABH/twA1AB3/wQA1ACT/rQA1ACb/mgA1ADf/awA1ADn/kAA1ADr/rQA1ADz/fQA1 - AET/0wA1AEj/pAA1AFL/pAA1AFj/pAA1AFz/kAA1AGL/rQA1AGT/mgA1AGn/0wA1AGr/0wA1 - AGv/0wA1AGz/0wA1AG3/0wA1AG7/0wA1AHD/pAA1AHH/pAA1AHL/pAA1AHP/pAA1AHn/pAA1 - AHr/pAA1AHv/pAA1AHz/pAA1AH3/pAA1AH7/pAA1AH//pAA1AID/pAA1AIH/pAA1AKn/kAA1 - AKr/3AA1AK3/rQA1AK7/rQA1ALT/awA1ALX/fQA1ALr/kAA1ALv/fQA1AMX/3AA1AMf/rQA1 - AMn/rQA1AOr/fQA1AOv/kAA1APv/mgA1AP3/mgA2ACQAJgA2ACYAAAA2ACoAAAA2ADIAAAA2 - ADQAAAA2ADYAAAA2AGIAJgA2AGQAAAA2AGcAAAA2AK0AJgA2AK4AJgA2AK8AAAA2AMcAJgA2 - AMkAJgA2ANAAAAA2ANEAAAA2ANIAAAA2AOMAAAA2APYAAAA2APkAAAA2APsAAAA2AP0AAAA3 - ABD/RAA3ABH/DQA3AB3/HwA3ACT/YQA3ACb/iAA3ADf/3AA3AET+rQA3AEb+pAA3AEj+pAA3 - AEz/wQA3AFL+pAA3AFX+0wA3AFb+rQA3AFj+yQA3AFr+rQA3AFz+wQA3AGL/YQA3AGT/iAA3 - AGn+rQA3AGr+rQA3AGv+rQA3AGz+rQA3AG3+rQA3AG7+rQA3AG/+pAA3AHD+pAA3AHH+pAA3 - AHL+pAA3AHP+pAA3AHn+pAA3AHr+pAA3AHv+pAA3AHz+pAA3AH3+pAA3AH7+yQA3AH/+yQA3 - AID+yQA3AIH+yQA3AKn/RAA3AKr/kAA3AK3/YQA3AK7/YQA3ALQAAAA3ALX/0wA3ALr+wQA3 - AMX++AA3AMf/YQA3AMn/YQA3AOT+rQA3AOv+wQA3APr+rQA3APv/iAA3APz+pAA3AP3/iAA3 - AP7+pAA4ACQAAAA4AC0AAAA4AD3/3AA4AGIAAAA4AK0AAAA4AK4AAAA4AMcAAAA4AMkAAAA4 - AOX/3AA5ABD/iAA5ABH++AA5AB3/WQA5ACT/fQA5ADL/3AA5AET/YQA5AEj/YQA5AEz/0wA5 - AFL/YQA5AFj/dQA5AFz/yQA5AGL/fQA5AGf/3AA5AGn/YQA5AGr/YQA5AGv/YQA5AGz/YQA5 - AG3/YQA5AG7/YQA5AHD/YQA5AHH/YQA5AHL/YQA5AHP/YQA5AHn/YQA5AHr/YQA5AHv/YQA5 - AHz/YQA5AH3/YQA5AH7/dQA5AH//dQA5AID/dQA5AIH/dQA5AKn/TgA5AKr/kAA5AK3/fQA5 - AK7/fQA5AK//3AA5ALQAAAA5ALUAAAA5ALr/yQA5AMX+5gA5AMf/fQA5AMn/fQA5AND/3AA5 - ANH/3AA5ANL/3AA5AOv/yQA6ABD/rQA6ABH/FQA6AB3/iAA6ACT/kAA6AET/fQA6AEj/iAA6 - AEz/0wA6AFL/iAA6AFX/pAA6AFj/twA6AFz/3AA6AGL/kAA6AGn/fQA6AGr/fQA6AGv/fQA6 - AGz/fQA6AG3/fQA6AG7/fQA6AHD/iAA6AHH/iAA6AHL/iAA6AHP/iAA6AHn/iAA6AHr/iAA6 - AHv/iAA6AHz/iAA6AH3/iAA6AH7/twA6AH//twA6AID/twA6AIH/twA6AKn/kAA6AKr/3AA6 - AK3/kAA6AK7/kAA6ALT/3AA6ALUAAAA6ALr/3AA6AMX++AA6AMf/kAA6AMn/kAA6AOv/3AA7 - ABD/mgA7ACQAAAA7ACb/awA7ADL/fQA7ADf/3AA7AEj/pAA7AGIAAAA7AGT/awA7AGf/fQA7 - AHD/pAA7AHH/pAA7AHL/pAA7AHP/pAA7AKn/kAA7AKoAAAA7AK0AAAA7AK4AAAA7AK//fQA7 - ALT/YQA7ALX/rQA7AMX/0wA7AMcAAAA7AMkAAAA7AND/fQA7ANH/fQA7ANL/fQA7APv/awA7 - AP3/awA8ABD/DQA8ABH+YQA8AB3+8AA8ACT/YQA8ACb/kAA8ADL/kAA8AET+5gA8AEj+8AA8 - AEz/twA8AFL+8AA8AFj/FQA8AGL/YQA8AGT/kAA8AGf/kAA8AGn+5gA8AGr+5gA8AGv+5gA8 - AGz+5gA8AG3+5gA8AG7+5gA8AHD+8AA8AHH+8AA8AHL+8AA8AHP+8AA8AHn+8AA8AHr+8AA8 - AHv+8AA8AHz+8AA8AH3+8AA8AH7/FQA8AH//FQA8AID/FQA8AIH/FQA8AKn/HwA8AKr/awA8 - AK3/YQA8AK7/YQA8AK//kAA8ALT/kAA8ALX/3AA8AMX++AA8AMf/YQA8AMn/YQA8AND/kAA8 - ANH/kAA8ANL/kAA8APv/kAA8AP3/kAA9ABD/3AA9AKkAAAA9AKoAAAA9ALT/3AA9ALX/3AA9 - AMX/3ABIAFv/3ABJABD/kABJABH/awBJAB3/twBJAFf/3ABJAFr/3ABJAFz/3ABJAKn/twBJ - AKr/3ABJALQAQQBJALUAAABJALr/3ABJAMX/FQBJAOv/3ABOAET/3ABOAEj/twBOAFL/twBO - AFj/wQBOAFz/twBOAGn/3ABOAGr/3ABOAGv/3ABOAGz/3ABOAG3/3ABOAG7/3ABOAHD/twBO - AHH/twBOAHL/twBOAHP/twBOAHn/twBOAHr/twBOAHv/twBOAHz/twBOAH3/twBOAH7/wQBO - AH//wQBOAID/wQBOAIH/wQBOALr/twBOAOv/twBRABAAAABRABEAAABRAB0AAABRAKkAAABR - AKoAAABRALT/awBRALX/kABRAMX/pABSABAAJgBSABH/3ABSAB0AAABSAFv/wQBSAKkAAABS - AKoAAABSALT/awBSALX/twBSAMX/fQBVABD/fQBVABH/RABVAB3/3ABVAEb/0wBVAEf/3ABV - AEj/0wBVAEkAAABVAEr/3ABVAEv/3ABVAFD/3ABVAFH/3ABVAFL/0wBVAFT/3ABVAFX/3ABV - AFgAAABVAFkAAABVAFoAAABVAFv/yQBVAFwAAABVAF0AAABVAG//0wBVAHD/0wBVAHH/0wBV - AHL/0wBVAHP/0wBVAHj/3ABVAHn/0wBVAHr/0wBVAHv/0wBVAHz/0wBVAH3/0wBVAH4AAABV - AH8AAABVAIAAAABVAIEAAABVAKn/twBVAKoAAABVALQAAABVALUAVgBVALoAAABVAMX+yQBV - AOYAAABVAOsAAABVAPf/3ABVAPz/0wBVAP7/0wBZABD/yQBZABH/YQBZAB3/kABZAKn/3ABZ - AKr/3ABZALQAAABZALX/3ABZAMX+8ABaABAAAABaABH/RABaAB3/kABaAKn/3ABaAKr/3ABa - ALQAAABaALUAAABaAMX/KQBbAEb/3ABbAEj/wQBbAFL/wQBbAG//3ABbAHD/wQBbAHH/wQBb - AHL/wQBbAHP/wQBbAHn/wQBbAHr/wQBbAHv/wQBbAHz/wQBbAH3/wQBbAPz/3ABbAP7/3ABc - ABD/3ABcABH+3ABcAB3/awBcAKn/3ABcAKr/3ABcALQAAABcALUAAABcAMX+0wBiABD/0wBi - ABH/3ABiAB3/3ABiACQAOQBiACb/3ABiACr/3ABiADL/3ABiADT/3ABiADYAAABiADf/YQBi - ADgAAABiADn/fQBiADr/kABiADsAAABiADz/YQBiAEb/3ABiAEf/3ABiAEj/3ABiAEn/twBi - AFL/3ABiAFT/3ABiAFf/3ABiAFgAAABiAFn/iABiAFr/rQBiAFz/dQBiAGIAOQBiAGT/3ABi - AGf/3ABiAGgAAABiAG//3ABiAHD/3ABiAHH/3ABiAHL/3ABiAHP/3ABiAHn/3ABiAHr/3ABi - AHv/3ABiAHz/3ABiAH3/3ABiAH4AAABiAH8AAABiAIAAAABiAIEAAABiAKn/twBiAKoAAABi - AK0AOQBiAK4AOQBiAK//3ABiALT++ABiALX/AwBiALr/dQBiALv/YQBiAMUALwBiAMcAOQBi - AMkAOQBiAND/3ABiANH/3ABiANL/3ABiANMAAABiANQAAABiANUAAABiAOMAAABiAOr/YQBi - AOv/dQBiAPb/3ABiAPkAAABiAPv/3ABiAPz/3ABiAP3/3ABiAP7/3ABkABAAAABkACQAAABk - ADYAAABkADz/3ABkAGIAAABkAKn/3ABkAKr/3ABkAK0AAABkAK4AAABkALQAAABkALUAJgBk - ALv/3ABkAMUAAABkAMcAAABkAMkAAABkAOMAAABkAOr/3ABkAPkAAABnABAAOQBnABH/rQBn - AB3/3ABnACT/3ABnADn/3ABnADv/fQBnADz/kABnAGL/3ABnAKn/3ABnAKoAAABnAK3/3ABn - AK7/3ABnALT/0wBnALX/3ABnALv/kABnAMX/RABnAMf/3ABnAMn/3ABnAOr/kABoACQAAABo - AC0AAABoAD3/3ABoAGIAAABoAK0AAABoAK4AAABoAMcAAABoAMkAAABoAOX/3ABwAFv/3ABx - AFv/3AByAFv/3ABzAFv/3AB4ABAAAAB4ABEAAAB4AB0AAAB4AKkAAAB4AKoAAAB4ALT/awB4 - ALX/kAB4AMX/pAB5ABAAJgB5ABH/3AB5AB0AAAB5AFv/wQB5AKkAAAB5AKoAAAB5ALT/awB5 - ALX/twB5AMX/fQB6ABAAJgB6ABH/3AB6AB0AAAB6AFv/wQB6AKkAAAB6AKoAAAB6ALT/awB6 - ALX/twB6AMX/fQB7ABAAJgB7ABH/3AB7AB0AAAB7AFv/wQB7AKkAAAB7AKoAAAB7ALT/awB7 - ALX/twB7AMX/fQB8ABAAJgB8ABH/3AB8AB0AAAB8AFv/wQB8AKkAAAB8AKoAAAB8ALT/awB8 - ALX/twB8AMX/fQB9ABAAJgB9ABH/3AB9AB0AAAB9AFv/wQB9AKkAAAB9AKoAAAB9ALT/awB9 - ALX/twB9AMX/fQCJABAAJgCJAKkAAACJAKoAAACJALT/kACJALX/kACJAMX/rQCQABAAAACQ - AKkAAACQAKoAAACQALT/rQCQALX/pACQAMX/kACpACQAAACpACX/3ACpACb/3ACpACf/3ACp - ACkAAACpACr/3ACpACsAAACpAC3/3ACpAC4AAACpAC8AAACpADIAAACpADMAAACpADQAAACp - ADUAAACpADf/kACpADn/kACpADr/3ACpADsAAACpADz/awCpAD0AAACpAEkAAACpAFEAAACp - AFIAAACpAFUAAACpAFn/3ACpAFr/3ACpAFz/3ACpAGIAAACpAGT/3ACpAGcAAACpAHgAAACp - AHkAAACpAHoAAACpAHsAAACpAHwAAACpAH0AAACpAIkAAACpAJAAlwCpAK0AAACpAK4AAACp - AK8AAACpALr/3ACpALv/awCpAMcAAACpAMkAAACpANAAAACpANEAAACpANIAAACpAOUAAACp - AOkAAACpAOr/awCpAOv/3ACpAOwAAACpAPb/3ACpAPv/3ACpAP3/3ACqACT/twCqACX/twCq - ACb/3ACqACf/3ACqACkAAACqACoAAACqACsAAACqAC3/3ACqAC4AAACqAC8AAACqADL/3ACq - ADMAAACqADQAAACqADUAAACqADf/RACqADn/TgCqADr/kACqADv/kACqADz/HwCqAD0AAACq - AEkAAACqAFEAAACqAFIAAACqAFUAAACqAFn/3ACqAFr/3ACqAFz/3ACqAGL/twCqAGT/3ACq - AGf/3ACqAHgAAACqAHkAAACqAHoAAACqAHsAAACqAHwAAACqAH0AAACqAIkAAACqAJAAAACq - AK3/twCqAK7/twCqAK//3ACqALr/3ACqALv/HwCqAMf/twCqAMn/twCqAND/3ACqANH/3ACq - ANL/3ACqAOUAAACqAOkAAACqAOr/HwCqAOv/3ACqAOwAAACqAPYAAACqAPv/3ACqAP3/3ACt - ABD/0wCtABH/3ACtAB3/3ACtACQAOQCtACb/3ACtACr/3ACtADL/3ACtADT/3ACtADYAAACt - ADf/YQCtADgAAACtADn/fQCtADr/kACtADsAAACtADz/YQCtAEb/3ACtAEf/3ACtAEj/3ACt - AEn/twCtAFL/3ACtAFT/3ACtAFf/3ACtAFgAAACtAFn/iACtAFr/rQCtAFz/dQCtAGIAOQCt - AGT/3ACtAGf/3ACtAGgAAACtAG//3ACtAHD/3ACtAHH/3ACtAHL/3ACtAHP/3ACtAHn/3ACt - AHr/3ACtAHv/3ACtAHz/3ACtAH3/3ACtAH4AAACtAH8AAACtAIAAAACtAIEAAACtAKn/twCt - AKoAAACtAK0AOQCtAK4AOQCtAK//3ACtALT++ACtALX/AwCtALr/dQCtALv/YQCtAMUALwCt - AMcAOQCtAMkAOQCtAND/3ACtANH/3ACtANL/3ACtANMAAACtANQAAACtANUAAACtAOMAAACt - AOr/YQCtAOv/dQCtAPb/3ACtAPkAAACtAPv/3ACtAPz/3ACtAP3/3ACtAP7/3ACuABD/0wCu - ABH/3ACuAB3/3ACuACQAOQCuACb/3ACuACr/3ACuADL/3ACuADT/3ACuADYAAACuADf/YQCu - ADgAAACuADn/fQCuADr/kACuADsAAACuADz/YQCuAEb/3ACuAEf/3ACuAEj/3ACuAEn/twCu - AFL/3ACuAFT/3ACuAFf/3ACuAFgAAACuAFn/iACuAFr/rQCuAFz/dQCuAGIAOQCuAGT/3ACu - AGf/3ACuAGgAAACuAG//3ACuAHD/3ACuAHH/3ACuAHL/3ACuAHP/3ACuAHn/3ACuAHr/3ACu - AHv/3ACuAHz/3ACuAH3/3ACuAH4AAACuAH8AAACuAIAAAACuAIEAAACuAKn/twCuAKoAAACu - AK0AOQCuAK4AOQCuAK//3ACuALT++ACuALX/AwCuALr/dQCuALv/YQCuAMUALwCuAMcAOQCu - AMkAOQCuAND/3ACuANH/3ACuANL/3ACuANMAAACuANQAAACuANUAAACuAOMAAACuAOr/YQCu - AOv/dQCuAPb/3ACuAPkAAACuAPv/3ACuAPz/3ACuAP3/3ACuAP7/3ACvABAAOQCvABH/rQCv - AB3/3ACvACT/3ACvADn/3ACvADv/fQCvADz/kACvAGL/3ACvAKn/3ACvAKoAAACvAK3/3ACv - AK7/3ACvALT/0wCvALX/3ACvALv/kACvAMX/RACvAMf/3ACvAMn/3ACvAOr/kAC0ACT++AC0 - ACX/wQC0ACb/twC0ACf/wQC0ACn/wQC0ACr/twC0ACv/wQC0AC3/wQC0AC7/wQC0AC//wQC0 - ADL/twC0ADP/wQC0ADT/twC0ADX/wQC0ADcAAAC0ADkAAAC0ADoAAAC0ADv/iAC0ADwAAAC0 - AD3/3AC0AEn/twC0AFH/kAC0AFL/awC0AFX/kAC0AFn/twC0AFr/twC0AFz/twC0AGL++AC0 - AGT/twC0AGf/twC0AHj/kAC0AHn/awC0AHr/awC0AHv/awC0AHz/awC0AH3/awC0AIn/wQC0 - AJD+fQC0AK3++AC0AK7++AC0AK//twC0ALr/twC0ALsAAAC0AMf++AC0AMn++AC0AND/twC0 - ANH/twC0ANL/twC0AOX/3AC0AOn/twC0AOoAAAC0AOv/twC0AOz/wQC0APb/twC0APv/twC0 - AP3/twC6ABD/3AC6ABH+3AC6AB3/awC6AKn/3AC6AKr/3AC6ALQAAAC6ALUAAAC6AMX+0wC7 - ABD/DQC7ABH+YQC7AB3+8AC7ACT/YQC7ACb/kAC7ADL/kAC7AET+5gC7AEj+8AC7AEz/twC7 - AFL+8AC7AFj/FQC7AGL/YQC7AGT/kAC7AGf/kAC7AGn+5gC7AGr+5gC7AGv+5gC7AGz+5gC7 - AG3+5gC7AG7+5gC7AHD+8AC7AHH+8AC7AHL+8AC7AHP+8AC7AHn+8AC7AHr+8AC7AHv+8AC7 - AHz+8AC7AH3+8AC7AH7/FQC7AH//FQC7AID/FQC7AIH/FQC7AKn/HwC7AKr/awC7AK3/YQC7 - AK7/YQC7AK//kAC7ALT/kAC7ALX/3AC7AMX++AC7AMf/YQC7AMn/YQC7AND/kAC7ANH/kAC7 - ANL/kAC7APv/kAC7AP3/kADFACQAJgDFACX/twDFACb/kADFACf/twDFACn/twDFACr/twDF - ACv/twDFAC0ALwDFAC7/twDFAC//twDFADL/kADFADP/twDFADT/kADFADX/twDFADf+5gDF - ADn+iADFADr/AwDFADv/twDFADz+iADFAD0AAADFAEn/3ADFAFH/twDFAFL/twDFAFX/twDF - AFn/FQDFAFr/PADFAFz/kADFAGIAJgDFAGT/kADFAGf/kADFAHj/twDFAHn/twDFAHr/twDF - AHv/twDFAHz/twDFAH3/twDFAIn/twDFAJAAJgDFAK0AJgDFAK4AJgDFAK//kADFALr/kADF - ALv+iADFAMcAJgDFAMkAJgDFAND/kADFANH/kADFANL/kADFAOUAAADFAOn/twDFAOr+iADF - AOv/kADFAOz/twDFAPb/twDFAPv/kADFAP3/kADHABD/0wDHABH/3ADHAB3/3ADHACQAOQDH - ACb/3ADHACr/3ADHADL/3ADHADT/3ADHADYAAADHADf/YQDHADgAAADHADn/fQDHADr/kADH - ADsAAADHADz/YQDHAEb/3ADHAEf/3ADHAEj/3ADHAEn/twDHAFL/3ADHAFT/3ADHAFf/3ADH - AFgAAADHAFn/iADHAFr/rQDHAFz/dQDHAGIAOQDHAGT/3ADHAGf/3ADHAGgAAADHAG//3ADH - AHD/3ADHAHH/3ADHAHL/3ADHAHP/3ADHAHn/3ADHAHr/3ADHAHv/3ADHAHz/3ADHAH3/3ADH - AH4AAADHAH8AAADHAIAAAADHAIEAAADHAKn/twDHAKoAAADHAK0AOQDHAK4AOQDHAK//3ADH - ALT++ADHALX/AwDHALr/dQDHALv/YQDHAMUALwDHAMcAOQDHAMkAOQDHAND/3ADHANH/3ADH - ANL/3ADHANMAAADHANQAAADHANUAAADHAOMAAADHAOr/YQDHAOv/dQDHAPb/3ADHAPkAAADH - APv/3ADHAPz/3ADHAP3/3ADHAP7/3ADJABD/0wDJABH/3ADJAB3/3ADJACQAOQDJACb/3ADJ - ACr/3ADJADL/3ADJADT/3ADJADYAAADJADf/YQDJADgAAADJADn/fQDJADr/kADJADsAAADJ - ADz/YQDJAEb/3ADJAEf/3ADJAEj/3ADJAEn/twDJAFL/3ADJAFT/3ADJAFf/3ADJAFgAAADJ - AFn/iADJAFr/rQDJAFz/dQDJAGIAOQDJAGT/3ADJAGf/3ADJAGgAAADJAG//3ADJAHD/3ADJ - AHH/3ADJAHL/3ADJAHP/3ADJAHn/3ADJAHr/3ADJAHv/3ADJAHz/3ADJAH3/3ADJAH4AAADJ - AH8AAADJAIAAAADJAIEAAADJAKn/twDJAKoAAADJAK0AOQDJAK4AOQDJAK//3ADJALT++ADJ - ALX/AwDJALr/dQDJALv/YQDJAMUALwDJAMcAOQDJAMkAOQDJAND/3ADJANH/3ADJANL/3ADJ - ANMAAADJANQAAADJANUAAADJAOMAAADJAOr/YQDJAOv/dQDJAPb/3ADJAPkAAADJAPv/3ADJ - APz/3ADJAP3/3ADJAP7/3ADQABAAOQDQABH/rQDQAB3/3ADQACT/3ADQADn/3ADQADv/fQDQ - ADz/kADQAGL/3ADQAKn/3ADQAKoAAADQAK3/3ADQAK7/3ADQALT/0wDQALX/3ADQALv/kADQ - AMX/RADQAMf/3ADQAMn/3ADQAOr/kADRABAAOQDRABH/rQDRAB3/3ADRACT/3ADRADn/3ADR - ADv/fQDRADz/kADRAGL/3ADRAKn/3ADRAKoAAADRAK3/3ADRAK7/3ADRALT/0wDRALX/3ADR - ALv/kADRAMX/RADRAMf/3ADRAMn/3ADRAOr/kADSABAAOQDSABH/rQDSAB3/3ADSACT/3ADS - ADn/3ADSADv/fQDSADz/kADSAGL/3ADSAKn/3ADSAKoAAADSAK3/3ADSAK7/3ADSALT/0wDS - ALX/3ADSALv/kADSAMX/RADSAMf/3ADSAMn/3ADSAOr/kADTACQAAADTAC0AAADTAD3/3ADT - AGIAAADTAK0AAADTAK4AAADTAMcAAADTAMkAAADTAOX/3ADUACQAAADUAC0AAADUAD3/3ADU - AGIAAADUAK0AAADUAK4AAADUAMcAAADUAMkAAADUAOX/3ADVACQAAADVAC0AAADVAD3/3ADV - AGIAAADVAK0AAADVAK4AAADVAMcAAADVAMkAAADVAOX/3ADjACQAJgDjACYAAADjACoAAADj - ADIAAADjADQAAADjADYAAADjAGIAJgDjAGQAAADjAGcAAADjAK0AJgDjAK4AJgDjAK8AAADj - AMcAJgDjAMkAJgDjANAAAADjANEAAADjANIAAADjAOMAAADjAPYAAADjAPkAAADjAPsAAADj - AP0AAADlABD/3ADlAKkAAADlAKoAAADlALT/3ADlALX/3ADlAMX/3ADpABAAAADpAKkAAADp - AKoAAADpALT/pADpALX/kADpAMX/twDqABD/DQDqABH+YQDqAB3+8ADqACT/YQDqACb/kADq - ADL/kADqAET+5gDqAEj+8ADqAEz/twDqAFL+8ADqAFj/FQDqAGL/YQDqAGT/kADqAGf/kADq - AGn+5gDqAGr+5gDqAGv+5gDqAGz+5gDqAG3+5gDqAG7+5gDqAHD+8ADqAHH+8ADqAHL+8ADq - AHP+8ADqAHn+8ADqAHr+8ADqAHv+8ADqAHz+8ADqAH3+8ADqAH7/FQDqAH//FQDqAID/FQDq - AIH/FQDqAKn/HwDqAKr/awDqAK3/YQDqAK7/YQDqAK//kADqALT/kADqALX/3ADqAMX++ADq - AMf/YQDqAMn/YQDqAND/kADqANH/kADqANL/kADqAPv/kADqAP3/kADrABD/3ADrABH+3ADr - AB3/awDrAKn/3ADrAKr/3ADrALQAAADrALUAAADrAMX+0wDsABAAAADsABH/awDsAB3/twDs - AKkAAADsAKoAAADsALT/3ADsALUAAADsAMX/RAD2ABAAAAD2ACQAAAD2ADf/twD2ADoAAAD2 - ADz/mgD2AGIAAAD2AKn/3AD2AKr/3AD2AK0AAAD2AK4AAAD2ALT/0wD2ALX/0wD2ALv/mgD2 - AMX/yQD2AMcAAAD2AMkAAAD2AOr/mgD5ACQAJgD5ACYAAAD5ACoAAAD5ADIAAAD5ADQAAAD5 - ADYAAAD5AGIAJgD5AGQAAAD5AGcAAAD5AK0AJgD5AK4AJgD5AK8AAAD5AMcAJgD5AMkAJgD5 - ANAAAAD5ANEAAAD5ANIAAAD5AOMAAAD5APYAAAD5APkAAAD5APsAAAD5AP0AAAD7ABAAAAD7 - ACQAAAD7ADYAAAD7ADz/3AD7AGIAAAD7AKn/3AD7AKr/3AD7AK0AAAD7AK4AAAD7ALQAAAD7 - ALUAJgD7ALv/3AD7AMUAAAD7AMcAAAD7AMkAAAD7AOMAAAD7AOr/3AD7APkAAAD9ABAAAAD9 - ACQAAAD9ADYAAAD9ADz/3AD9AGIAAAD9AKn/3AD9AKr/3AD9AK0AAAD9AK4AAAD9ALQAAAD9 - ALUAJgD9ALv/3AD9AMUAAAD9AMcAAAD9AMkAAAD9AOMAAAD9AOr/3AD9APkAAAAAAAEAAAEM - AE0ABwBCAAQAAgAQAEAABwAABBUFaAADAAEAAQAAB23+HQAACrz+if6JCkwAAQAAAAAAAAAA - AAAAAAAAAQwAAQQOAZAABQAEBUcEzAAA/kIFRwTMAAACUwCPAmYIAgILBgMDCAQCAgSAAACv - EAAgSgAAAAAAAAAAQml0cwBAACD7AgYU/hQBmgdtAeMAAAABAAAAAAAAAAEAAEIAHbECiwRg - AAAjYwXVAABWZXJhU2FucwAAAAAAAAAA/////zb///42MjhSMDAAAEAAAAAAAAAUAAABEAkM - BQADAwMECAYJCAIEBAUIAwMDAwYGBgYGBgYGBgYDAwgICAUKBgcHBwYGBwcDAwYFCAcHBgcG - BwUHBgcGBQUEAwQIBQUGBgYGBgMGBgMDBQMJBgYGBgQFBAYFBwUFBgUDBQgGBgcGBwcHBgYG - BgYGBgYGBgYDAwMDBgYGBgYGBgYGBgUFBgYFBQYGCQkJBQUICQcICAgIBgYFBgcFBQQEBwkG - BQMIBgYIBgYGCQYGBgcKCQUJBQUDAwgEBQUCBgQEBgYFAwMFDAYGBgYGAwMDAwcHBwcHBwMF - BQUFBQUFBQUFBQMHBQUGAwcGBQUGBggIBAQECQkJBwYDBwUHBgcGBgMDBgUFBQUFBQQFBQAA - Cg0GAAMDBAUIBgoJAwQEBQgDBAMDBgYGBgYGBgYGBgMDCAgIBQsHBwgIBwYICAMDBwYJCAgH - CAcHBQgHCQYHBgQDBAgFBQYGBQYGBAYGAgIFAgoGBgYGBAUEBgYIBgYFBgMGCAcHCAcICAgG - BgYGBgYFBgYGBgICAgIGBgYGBgYGBgYGBQUGBgUGBgYKCgoFBQgKCAgICAgGBwUHCAYFBQUI - CgYFBAgGBggHBgYKBgcHCAsKBQoFBQMDCAUGBwIGBAQGBgUDAwUNBwcHBwcDAwMDCAgICAgI - AgUFBQUFBQUFBQUGAgcFBgUDCAYHBgcGCAgEBAQKCgoIBgMHBQgFCAUGBAMGBQUFBQUFBAUF - AAALDwcAAwMDBQkHCgoDBAQGCQQEBAQHBwcHBwcHBwcHBAQJCQkGDAcICAgHBgkIAwMHBgkI - CQcJBwgHCAcJBwcJBAQECQYGBwcGBwcEBwcDAwYDCwcHBwcFBwQHBgkGBgUHBAcJBwcIBwgJ - CAcHBwcHBwYHBwcHAwMDAwcHBwcHBwcHBwcGBgcHBgYHBwsLCwYGCQsJCQkJCQcHBgcIBgYF - BQgLBwYDCQcHCQcHBwsHBwcJDAsGCwYGBAQJBQYHAgcEBAcHBgQEBg8HBwcHBwMDAwMJCQkI - CAgDBgYGBgYGBgYGBgYDCAcJBQQIBwcGBwcJCQQEBAsLCwkHAwgHCAYIBgcEBAcGBgYGBgYE - BgYAAAwQBwAEBAUFCggLCgMFBQYKBAQEBAgICAgICAgICAgEBAoKCgYNCAgICQgHCQkDAwcG - CgkJCAkICAcJCAsJBwkFBAUKBgYICAcICAQICAMDBwMLCAgICAUHBQgGCQYGBQgECAoICAgI - CQkJCAgICAgIBwgICAgDAwMDCAgICAgICAgICAYGCAgGBwgIDAwMBgYKDAkKCgoKCAgGCAkH - BgYGCQwIBgUKCAgKCAcHDAgICAkNDQYMBgYEBAoGBgcCCAUFBwcGBAQGEAgICAgIAwMDAwkJ - CQkJCQMGBgYGBgYGBgYGBgMIBwkFBAkIBwYICAoKBQUFDAwMCQgDCAcIBwgHCAQECAYGBgYG - BgUGBgAADREIAAQEBQULCAwLAwUFBwsEBQQECAgICAgICAgICAQECwsLBw0JCQkKCAcKCgMD - CAcLCgoICggJBwoJCwoHCgUEBQsHBwgIBwgIBAgIAwMHAw0ICAgIBQcFCAcJBwcHCAQICwkJ - CQgKCgoICAgICAgHCAgICAMDAwMICAgICAgICAgIBwcICAcICAgNDQ0HBwsNCgsLCwsICAcJ - CggHBgYKDQgHBQsICAsJCAgNCAkJCg4NBw0HBwQECwYHBwIIBQUICAcEBAcRCQgJCAgDAwMD - CgoKCgoKAwcHBwcHBwcHBwcHAwkHCgcECggHBwgICwsFBQUNDQ0KCAMJBwkHCQcIBQQIBwcH - BwcHBQcHAAAOEwgABAQFBQwJDQwDBQUHDAQFBAUJCQkJCQkJCQkJBQUMDAwHDgkKCgsJCAsK - AwMJBwwKCwkLCgkJCgkNCwkKBQUFDAcHCAkICQkECQkDAwgDDQkJCQkFCAUJBwsHBwgJBQkM - CQkKCQoLCggICAgICAgJCQkJAwMDAwkJCQkJCQkJCQkHBwkJBwgJCQ4ODgcHDA4LDAwMDAkJ - BwkLCAcHBwsOCQcFDAkJDAkJCQ4JCQkLDw8HDgcHBAQMBwcJAgkGBggIBwQEBxMJCQkJCQMD - AwMLCwsKCgoDBwcHBwcHBwcHBwcDCQgKCAULCQkHCQkMDAYGBg4ODgsJAwkICggKCAkFBAkH - BwcHBwcGBwcAAA8UCQAFBQYGDQoOCwMGBggNBQUFBQoKCgoKCgoKCgoFBQ0NDQgPCgoKCwkJ - DAsDAwoIDQsMCQwKCgkLCg8KCQsGBQYNCAgJCQgJCQUJCQMDCAMPCQkJCQYIBgkIDQoICAoF - Cg0KCgoJCwwLCQkJCQkJCAkJCQkDAwMDCQkJCQkJCQkJCQgICgoICQoJDw8PCAgNDwwNDQ0N - CgkICgsJCAcHCw8JCAYNCgoNCgkJDwoKCgwQDwgPCAgFBQ0HCAkDCgYGCQkIBQUIFAoJCgkJ - AwMDAwwMDAsLCwMICAgICAgICAgICAMKCAsIBQwJCQgJCQ0NBgYGDw8PDAkDCggKCAoICQUF - CggICAgICAYICAAAEBUKAAUFBgYNCg8MAwYGCA0FBgUFCgoKCgoKCgoKCgUFDQ0NCRALCwsM - CgkMDAUFCgkNDA0KDQsKCQwLEQsJDAYFBg0ICAkKCQoJBgoKAwMJAw8KCgoKBwkGCgkNCgkJ - CgUKDQsLCwoMDQwJCQkJCQkJCQkJCQMDAwMKCgoKCgoKCgoKCAgKCggJCgoQEBAICA0QDQ0N - DQ0KCggLDAkICAgMEAoJBg0KCg0LCgoQCgsLDREPCBAICAUFDQgJCQMKBgYKCggFBQgVCwoL - CgoFBQUFDQ0NDAwMAwgICAgICAgICAgJBAoJDAkFDQoJCQoKDQ0GBgYQEBAMCgUKCQsJCwkK - BgUKCAgICAgIBggIAAARFwoABQUHCA4LEA0FBwcJDgUGBQYLCwsLCwsLCwsLBgYODg4JEQsM - DA0LCg0NBgYMCQ8NDQoNDAsKDQsSDQoMBwYHDgkJCgoICgoGCgsFBQoFEQsKCgoHCAcLCg8K - CggLBgsOCwsMCw0NDQoKCgoKCggKCgoKBQUFBQsKCgoKCgsLCwsJCQsLCQoLCxEREQkJDhAN - Dg4ODgsLCQsNCgkICA0QCgkHDgsLDgsKChELCwsNEhEJEQkJBQUOCAoKAwsHBwoKCQUFCRcL - CwsLCwYGBgYNDQ0NDQ0FCQkJCQkJCQkJCQoFCwgMCAYNCgoKCgoODgcHBxAQEA0KBgsIDAgM - CAoGBQsJCQkJCQkHCQkAABIYCwAGBgcIDwsRDQQHBwkPBgcGBgsLCwsLCwsLCwsGBg8PDwoS - DAwNDgsKDg4GBgwKEA4OCw4NCwwODBMNDA0HBgcPCQkKCwkLCwYLCwUFCgURCwsLCwgIBwsL - EAsLCQsGCw8MDA0LDg4OCgoKCgoKCQsLCwsFBQUFCwsLCwsLCwsLCwkJCwsJCwsLEhISCQkP - EQ4PDw8PCwsJDA4LCQgIDhELCgcPCwsPDAsLEgsMDA4TEwkSCQkGBg8JCwwDCwcHCwsJBgYJ - GAwLDAsLBgYGBg4ODg4ODgUJCQkJCQkJCQkJCgULCA0JBg4LDAsLCw8PBwcHERERDgsGCwgN - CQ0JCwcGCwkJCQkJCQcJCQAAExoLAAYGCAgQDBIOBAcHChAGBwYGDAwMDAwMDAwMDAYGEBAQ - ChMNDQ0PDAsPDgYGDAsQDg8MDw0MDA4NFA4MDQcGBxAKCgsLCQsLBgsMBQULBREMCwsLCAkI - DAsRCwsLDAYMEA0NDQwODw4LCwsLCwsJCwsLCwUFBQUMCwsLCwsMDAwMCgoMDAoLDAwTExMK - ChASDxAQEBAMDAoNDgsKCQkPEgsKCBAMDBANDAwTDA0NDxQTChMKCgYGEAkLDAMMCAgLCwoG - BgoaDQwNDAwGBgYGDw8PDg4OBQoKCgoKCgoKCgoLBQwJDQsGDwsMCwwLEBAICAgSEhIPCwYM - CQ0JDQkLBwYMCgoKCgoKCAoKAAAUGwwABgYIChENEw8GCAgKEQYHBgcNDQ0NDQ0NDQ0NBwcR - ERELFA4ODg8NDBAPBgYNCxEPEAwQDg0MDw4UDgwOCAcIEQoKDA0LDQwHDQ0GBgwGFA0MDQ0I - CggNCxELCwsNBw0RDg4ODQ8QDwwMDAwMDAsMDAwMBgYGBg0MDAwMDA0NDQ0KCg0NCgwNDRQU - FAoKERQQEREREQ0NCg0PDAoJCQ8TDAsIEQ0NEQ0MDBQNDg4QFRQKFAoKBgYRCgsMAw0ICA0N - CgYGChsODQ4NDQYGBgYQEBAPDw8GCgoKCgoKCgoKCgsGDQoOCwcPDAwLDA0REQgICBMTExAN - Bg0KDgsOCw0HBg0KCgoKCgoICgoAABUcDQAHBwgKEg0UEAYICAsSBwgHBw0NDQ0NDQ0NDQ0H - BxISEgsVDg4PEA0MEBAGBg4MEhARDREPDQ0PDhUODQ4IBwgSCwsNDQwNDQcNDQYGDAYUDg0N - DQkLCA4LEQ0NCw0HDRIODg8NEBEPDQ0NDQ0NDA0NDQ0GBgYGDg0NDQ0NDg4ODgsLDQ0LDA0N - FRUVCwsSFBESEhISDQ4LDhAMCwoKEBQNCwgSDQ0SDg0NFQ0ODhEWFgsVCwsHBxIKDQ0EDQgI - DQ0LBwcLHA4NDg0NBgYGBhEREQ8PDwYLCwsLCwsLCwsLDAYNCw4LBxANDQ0NDRISCAgIFBQU - EA0GDQsPDA8MDQgHDQsLCwsLCwgLCwAAFh4NAAcHCQoSDhURBgkJCxIHCAcHDg4ODg4ODg4O - DgcHEhISDBYPDw8RDg0REQYGDgwTEBENEQ8ODRAPFg8NDwkHCRILCw0ODA4NCA4OBgYNBhYO - DQ4OCQsJDg4SDg4MDgcOEg8PDw4QERANDQ0NDQ0MDQ0NDQYGBgYODQ0NDQ0ODg4OCwsODgsN - Dg4WFhYLCxIVERISEhIODgsPEQ0LCgoRFQ0MCRIODhIPDQ0WDg8PERgWCxYLCwcHEgsODQQO - CQkNDQsHBwseDw4PDg4GBgYGEREREBAQBgsLCwsLCwsLCwsMBg4LDwwHEQ0NDg0OEhIJCQkV - FRURDgYOCw8MDwwOCAcOCwsLCwsLCQsLAAAXHw4ABwcJCxMPFhIGCQkMEwcIBwgPDw8PDw8P - Dw8PCAgTExMMFxAQEBIPDRIRBwcPDRQREg4SEA8OERAXEA4QCQgJEwwMDg8NDw4IDw8GBg0G - Fg8ODg4JDAkPDhMODgwPCA8TEBAQDxESEQ4ODg4ODg0ODg4OBgYGBg8ODg4ODg8PDw8MDA8P - DA4PDhcXFwwMExYSExMTEw8PDBARDgwLCxIVDgwJEw8PEw8ODhcPEBASGRgMFwwMBwcTCw4O - BA8JCQ8PDAcHDB8QDxAPDwcHBwcSEhIREREGDAwMDAwMDAwMDA0GDwwQDAgSDg4ODg4TEwkJ - CRYWFhIPBw8MEA0QDQ8IBw8MDAwMDAwJDAwAABggDgAICAoLFA8XEwcJCQwUCAkICA8PDw8P - Dw8PDw8ICBQUFA0YEBAREg8OExIHBxANFRITDhMRDw8SEBgQDxAJCAkUDAwODw0PDggPDwcH - DgYYDw4PDwoMCQ8PFA8PDQ8IDxQQEBEPEhMSDg4ODg4ODQ4ODg4HBwcHDw4ODg4ODw8PDwwM - Dw8MDg8PGBgYDAwUFxMUFBQUDw8MEBIODQsLEhcODQoUDw8UEA8PGA8QEBMaGAwYDAwICBQM - Dw8EDwoKDw8MCAgMIBAPEA8PBwcHBxMTExISEgcMDAwMDAwMDAwMDQYPDBANCBMODw8PDxQU - CgoKFxcXEw8HDwwRDRENDwkIDwwMDAwMDAoMDAAAGSIPAAgICgwVEBgUBwoKDRUICQgIEBAQ - EBAQEBAQEAgIFRUVDRkRERETEA4TEwcHEA4WExQPFBEQDxIRGREPEQoIChUNDQ8QDhAPCRAQ - BwcOBxgQDxAQCg0KEA8UDw8NEAgQFRERERATFBIPDw8PDw8ODw8PDwcHBwcQDw8PDw8QEBAQ - DQ0QEA0PEBAZGRkNDRUYFBUVFRUQEA0REw8NDAwTGQ8NChUQEBURDw8ZEBERFBsaDRkNDQgI - FQwPDwQQCgoQEA0ICA0iERAREBAHBwcHFBQUEhISBw0NDQ0NDQ0NDQ0OBxANEQ0IEw8PDw8Q - FRUKCgoYGBgTEAcQDREOEQ4QCQgQDQ0NDQ0NCg0NAAAaIxAACAgKDBYRGRQHCgoNFggJCAkR - ERERERERERERCQkWFhYOGhISEhQQDxQUCAgRDhYTFBAUEhEQExIaEhASCgkKFg0NEBEOERAJ - ERAHBw8HGRAQERELDgoQDxUPDw4RCREWEhISEBMUExAQEBAQEA4QEBAQBwcHBxAQEBAQEBAQ - EBANDRERDQ8REBoaGg0NFhkUFhYWFhERDRIUDw4MDBQaEA4KFhERFhEQEBoREhIUHBsNGg0N - CAgWDQ8QBBEKChAQDQgIDSMSEBIQEAgICAgUFBQTExMHDQ0NDQ0NDQ0NDQ8HEQ4SDgkUEBAP - EBEWFgoKChkZGRQRCBEOEg4SDhEJCBENDQ0NDQ0KDQ0AABskEAAJCQsMFxEaFQcLCw4XCQoJ - CREREREREREREREJCRcXFw4bEhMTFREQFRQICBIPFxQVEBUTEREUEhsTERMLCQsXDg4REQ8R - EQoREQgIEAgaEREREQsOCxEQFhAQDhEJERcSEhMRFBUUERERERERDxEREREICAgIERERERER - EREREQ4OEREOEBERGxsbDg4XGhUWFxcXEREOEhQQDg0NFRsRDgsXEREXEhERGxESEhUdHA4b - Dg4JCRcNEBEFEQsLEREOCQkOJBIREhERCAgICBUVFRQUFAgODg4ODg4ODg4ODwgRDhMOCRUR - ERAQERcXCwsLGhoaFREIEQ4TDxMPEQoJEQ4ODg4ODgsODgAAHCYRAAkJCw0XEhsWCAsLDhcJ - CgkJEhISEhISEhISEgkJFxcXDxwTExQWEhAWFQgIEhAYFRYRFhMSERUTHBMREwsJCxcODhES - DxIRChISCAgQCBsSERISDA8LEhEXEREPEgkSFxMTFBIVFhUREREREREPEREREQgICAgSERER - ERESEhISDg4SEg4REhIcHBwODhcbFhcXFxcSEg4TFRAPDQ0VHBEPCxcSEhcTEREcEhMTFh4d - DhwPDwkJFw4REQUSCwsSEg4JCQ8mExITEhIICAgIFhYWFRUVCA4ODg4ODg4ODg4QCBIPEw8J - FhERERESFxcLCwsbGxsWEggSDxQPFA8SCgkSDg4ODg4OCw4OAAAAAAACAAgAAv//AAMAAQAA - AAIAAAxQCuxfDzz1AB8IAAAAAAC6ufC4AAAAALrCZ5H+if4dCkwHbQAAAAgAAQAAAAAAAA== - ]], "Vera.ttf", "base64") - - love.graphics.newFont = function(font, size) - if type(font) == "number" or not font then - size = font - font = vera_ttf - end - return love.graphics.newFont1(font, size or 12) - end - - love.graphics.setNewFont = function(...) - local font = love.graphics.newFont(...) - love.graphics.setFont(font) - return font - end - - love.graphics.print = function (...) - if not love.graphics.getFont() then - love.graphics.setNewFont(12) - end - love.graphics.print1(...) - love.graphics.print = love.graphics.print1 - end - - love.graphics.printf = function (...) - if not love.graphics.getFont() then - love.graphics.setNewFont(12) - end - love.graphics.printf1(...) - love.graphics.printf = love.graphics.printf1 - end - - -- PIXEL EFFECTS - function love.graphics._effectCodeToGLSL(code) - local header = [[#version 120 - #define number float - #define Image sampler2D - #define extern uniform - #define Texel texture2D - uniform sampler2D _tex0_;]] - local footer = [[void main() { - // fix weird crashing issue in OSX when _tex0_ is unused within effect() - float dummy = texture2D(_tex0_, vec2(.5)).r; - gl_FragColor = effect(gl_Color, _tex0_, gl_TexCoord[0].xy, gl_FragCoord.xy); - }]] - - local function include(quoted_path) return (love.filesystem.read(quoted_path:sub(2,-2))) end - code = code:gsub("#include (%b'')", include) - code = code:gsub('#include (%b"")', include) - - return table.concat{header, "\n", code, footer} - end - - function love.graphics._transformGLSLErrorMessages(message) - if not message:match("Cannot compile shader") then return message end - local lines = {"Cannot compile shader:"} - for l in message:gmatch("[^\n]+") do - -- nvidia compiler message: - -- 0() : error/warning [NUMBER]: - local linenumber, what, message = l:match("^0%((%d+)%)%s*:%s*(%w+)[^:]+:%s*(.+)$") - if not linenumber then - -- ati compiler message: - -- ERROR 0:: error/warning(#[NUMBER]) [ERRORNAME]: - linenumber, what, message = l:match("^%w+: 0:(%d+):%s*(%w+)%([^%)]+%)%s*(.+)$") - end - if linenumber and what and message then - lines[#lines+1] = ("Line %d: %s: %s"):format(linenumber - 5, what, message) - end - end - -- did not match any known error messages - if #lines == 1 then return message end - return table.concat(lines, "\n") - end - - -- helper to transform a matrix from {{a,b,c}, {d,e,f}, ...} to - -- {a, b, c, d, e, f, ...} - local function flattenMatrices(mat, ...) - if not mat then return end - - local ret,l = {}, 1 - ret.dimension = #mat - - for i = 1,#mat do - for k = 1,#mat[i] do - ret[l], l = tonumber(mat[i][k]), l+1 - end - end - - return ret, flattenMatrices(...) - end - - -- automagic uniform setter - local function pixeleffect_dispatch_send(self, name, value, ...) - if type(value) == "number" then -- scalar - self:sendFloat(name, value, ...) - elseif type(value) == "userdata" and value:typeOf("Image") then - self:sendImage(name, value) - elseif type(value) == "userdata" and value:typeOf("Canvas") then - self:sendCanvas(name, value) - elseif type(value) == "table" then -- vector or matrix - if type(value[1]) == "number" then - self:sendFloat(name, value, ...) - elseif type(value[1]) == "table" then - self:sendMatrix(name, flattenMatrices(value, ...)) - else - error("Cannot send value (unsupported type: {"..type(value[1]).."}).") - end - else - local t = type(value) - if t == "userdata" and value.type then t = value.type end - error("Cannot send value (unsupported type: "..t..").") - end - end - - local newPixelEffect = love.graphics.newPixelEffect - function love.graphics.newPixelEffect(code) - love.graphics.newPixelEffect = function(code) - if love.filesystem and love.filesystem.exists(code) then - code = love.filesystem.read(code) - end - return newPixelEffect(code) - end - - local effect = love.graphics.newPixelEffect(code) - local meta = getmetatable(effect) - meta.send = pixeleffect_dispatch_send - return effect - end - -end +--[[ +Copyright (c) 2006-2012 LOVE Development Team + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software +in a product, an acknowledgment in the product documentation would be +appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +--]] + +do + + local vera_ttf = love.filesystem.newFileData([[ + AAEAAAARAQAABAAQT1MvMrRf9GMAAOtwAAAAVlBDTFTRil6XAADryAAAADZjbWFwpMPooAAA + sWwAAANYY3Z0IP/THTkAAB78AAAB/GZwZ23ntPHEAAAmYAAAAItnYXNwAAcABwABAUgAAAAM + Z2x5Zgx0Qc8AACbsAACKfmhkbXg08CEOAADsAAAAFUhoZWFk3YSi0AABAVQAAAA2aGhlYRBF + CG8AAOtMAAAAJGhtdHgJxo6yAAC0xAAABDBrZXJu3FLVmQAAvaAAAC2KbG9jYfPL0j0AALuE + AAACGm1heHAFRwY6AADrLAAAACBuYW1l2bzItQAAARwAAB3fcG9zdLRaL7sAALj0AAACjnBy + ZXA7B/EAAAAg+AAABWgAAAAWAQ4AAQAAAAAAAAA6AAAAAQAAAAAAAQATADoAAQAAAAAAAgAF + AF8AAQAAAAAAAwATADoAAQAAAAAABAATADoAAQAAAAAABQAMAGQAAQAAAAAABgAXAE0AAQAA + AAAABwAwAK0AAQAAAAAACAAOCGwAAQAAAAAACwAYCYMAAQAAAAAADQkTAHAAAwABBAkAAAB0 + CZsAAwABBAkAAQAmCg8AAwABBAkAAgAKClkAAwABBAkAAwAmCg8AAwABBAkABAAmCg8AAwAB + BAkABQAYCmMAAwABBAkABgAuCjUAAwABBAkABwBgCvUAAwABBAkACAAcGnMAAwABBAkACwAw + HKEAAwABBAkADRImCntDb3B5cmlnaHQgKGMpIDIwMDMgYnkgQml0c3RyZWFtLCBJbmMuIEFs + bCBSaWdodHMgUmVzZXJ2ZWQuQml0c3RyZWFtIFZlcmEgU2Fuc0JpdHN0cmVhbVZlcmFTYW5z + LVJvbWFuUmVsZWFzZSAxLjEwQ29weXJpZ2h0IChjKSAyMDAzIGJ5IEJpdHN0cmVhbSwgSW5j + Lg0KQWxsIFJpZ2h0cyBSZXNlcnZlZC4NCkJpdHN0cmVhbSBWZXJhIGlzIGEgdHJhZGVtYXJr + IG9mIEJpdHN0cmVhbSwgSW5jLg0KDQpQZXJtaXNzaW9uIGlzIGhlcmVieSBncmFudGVkLCBm + cmVlIG9mIGNoYXJnZSwgdG8gYW55IHBlcnNvbiBvYnRhaW5pbmcgYSBjb3B5IG9mIHRoZSBm + b250cyBhY2NvbXBhbnlpbmcgdGhpcyBsaWNlbnNlICgiRm9udHMiKSBhbmQgYXNzb2NpYXRl + ZCBkb2N1bWVudGF0aW9uIGZpbGVzICh0aGUgIkZvbnQgU29mdHdhcmUiKSwgdG8gcmVwcm9k + dWNlIGFuZCBkaXN0cmlidXRlIHRoZSBGb250IFNvZnR3YXJlLCBpbmNsdWRpbmcgd2l0aG91 + dCBsaW1pdGF0aW9uIHRoZSByaWdodHMgdG8gdXNlLCBjb3B5LCBtZXJnZSwgcHVibGlzaCwg + ZGlzdHJpYnV0ZSwgYW5kL29yIHNlbGwgY29waWVzIG9mIHRoZSBGb250IFNvZnR3YXJlLCBh + bmQgdG8gcGVybWl0IHBlcnNvbnMgdG8gd2hvbSB0aGUgRm9udCBTb2Z0d2FyZSBpcyBmdXJu + aXNoZWQgdG8gZG8gc28sIHN1YmplY3QgdG8gdGhlIGZvbGxvd2luZyBjb25kaXRpb25zOg0K + DQpUaGUgYWJvdmUgY29weXJpZ2h0IGFuZCB0cmFkZW1hcmsgbm90aWNlcyBhbmQgdGhpcyBw + ZXJtaXNzaW9uIG5vdGljZSBzaGFsbCBiZSBpbmNsdWRlZCBpbiBhbGwgY29waWVzIG9mIG9u + ZSBvciBtb3JlIG9mIHRoZSBGb250IFNvZnR3YXJlIHR5cGVmYWNlcy4NCg0KVGhlIEZvbnQg + U29mdHdhcmUgbWF5IGJlIG1vZGlmaWVkLCBhbHRlcmVkLCBvciBhZGRlZCB0bywgYW5kIGlu + IHBhcnRpY3VsYXIgdGhlIGRlc2lnbnMgb2YgZ2x5cGhzIG9yIGNoYXJhY3RlcnMgaW4gdGhl + IEZvbnRzIG1heSBiZSBtb2RpZmllZCBhbmQgYWRkaXRpb25hbCBnbHlwaHMgb3IgY2hhcmFj + dGVycyBtYXkgYmUgYWRkZWQgdG8gdGhlIEZvbnRzLCBvbmx5IGlmIHRoZSBmb250cyBhcmUg + cmVuYW1lZCB0byBuYW1lcyBub3QgY29udGFpbmluZyBlaXRoZXIgdGhlIHdvcmRzICJCaXRz + dHJlYW0iIG9yIHRoZSB3b3JkICJWZXJhIi4NCg0KVGhpcyBMaWNlbnNlIGJlY29tZXMgbnVs + bCBhbmQgdm9pZCB0byB0aGUgZXh0ZW50IGFwcGxpY2FibGUgdG8gRm9udHMgb3IgRm9udCBT + b2Z0d2FyZSB0aGF0IGhhcyBiZWVuIG1vZGlmaWVkIGFuZCBpcyBkaXN0cmlidXRlZCB1bmRl + ciB0aGUgIkJpdHN0cmVhbSBWZXJhIiBuYW1lcy4NCg0KVGhlIEZvbnQgU29mdHdhcmUgbWF5 + IGJlIHNvbGQgYXMgcGFydCBvZiBhIGxhcmdlciBzb2Z0d2FyZSBwYWNrYWdlIGJ1dCBubyBj + b3B5IG9mIG9uZSBvciBtb3JlIG9mIHRoZSBGb250IFNvZnR3YXJlIHR5cGVmYWNlcyBtYXkg + YmUgc29sZCBieSBpdHNlbGYuDQoNClRIRSBGT05UIFNPRlRXQVJFIElTIFBST1ZJREVEICJB + UyBJUyIsIFdJVEhPVVQgV0FSUkFOVFkgT0YgQU5ZIEtJTkQsIEVYUFJFU1MgT1IgSU1QTElF + RCwgSU5DTFVESU5HIEJVVCBOT1QgTElNSVRFRCBUTyBBTlkgV0FSUkFOVElFUyBPRiBNRVJD + SEFOVEFCSUxJVFksIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFIEFORCBOT05J + TkZSSU5HRU1FTlQgT0YgQ09QWVJJR0hULCBQQVRFTlQsIFRSQURFTUFSSywgT1IgT1RIRVIg + UklHSFQuIElOIE5PIEVWRU5UIFNIQUxMIEJJVFNUUkVBTSBPUiBUSEUgR05PTUUgRk9VTkRB + VElPTiBCRSBMSUFCTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdFUyBPUiBPVEhFUiBMSUFCSUxJ + VFksIElOQ0xVRElORyBBTlkgR0VORVJBTCwgU1BFQ0lBTCwgSU5ESVJFQ1QsIElOQ0lERU5U + QUwsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0Yg + Q09OVFJBQ1QsIFRPUlQgT1IgT1RIRVJXSVNFLCBBUklTSU5HIEZST00sIE9VVCBPRiBUSEUg + VVNFIE9SIElOQUJJTElUWSBUTyBVU0UgVEhFIEZPTlQgU09GVFdBUkUgT1IgRlJPTSBPVEhF + UiBERUFMSU5HUyBJTiBUSEUgRk9OVCBTT0ZUV0FSRS4NCg0KRXhjZXB0IGFzIGNvbnRhaW5l + ZCBpbiB0aGlzIG5vdGljZSwgdGhlIG5hbWVzIG9mIEdub21lLCB0aGUgR25vbWUgRm91bmRh + dGlvbiwgYW5kIEJpdHN0cmVhbSBJbmMuLCBzaGFsbCBub3QgYmUgdXNlZCBpbiBhZHZlcnRp + c2luZyBvciBvdGhlcndpc2UgdG8gcHJvbW90ZSB0aGUgc2FsZSwgdXNlIG9yIG90aGVyIGRl + YWxpbmdzIGluIHRoaXMgRm9udCBTb2Z0d2FyZSB3aXRob3V0IHByaW9yIHdyaXR0ZW4gYXV0 + aG9yaXphdGlvbiBmcm9tIHRoZSBHbm9tZSBGb3VuZGF0aW9uIG9yIEJpdHN0cmVhbSBJbmMu + LCByZXNwZWN0aXZlbHkuIEZvciBmdXJ0aGVyIGluZm9ybWF0aW9uLCBjb250YWN0OiBmb250 + cyBhdCBnbm9tZSBkb3Qgb3JnLmh0dHA6Ly93d3cuYml0c3RyZWFtLmNvbQBDAG8AcAB5AHIA + aQBnAGgAdAAgACgAYwApACAAMgAwADAAMwAgAGIAeQAgAEIAaQB0AHMAdAByAGUAYQBtACwA + IABJAG4AYwAuACAAQQBsAGwAIABSAGkAZwBoAHQAcwAgAFIAZQBzAGUAcgB2AGUAZAAuAEIA + aQB0AHMAdAByAGUAYQBtACAAVgBlAHIAYQAgAFMAYQBuAHMAQgBpAHQAcwB0AHIAZQBhAG0A + VgBlAHIAYQBTAGEAbgBzAC0AUgBvAG0AYQBuAFIAZQBsAGUAYQBzAGUAIAAxAC4AMQAwAEMA + bwBwAHkAcgBpAGcAaAB0ACAAKABjACkAIAAyADAAMAAzACAAYgB5ACAAQgBpAHQAcwB0AHIA + ZQBhAG0ALAAgAEkAbgBjAC4ADQAKAEEAbABsACAAUgBpAGcAaAB0AHMAIABSAGUAcwBlAHIA + dgBlAGQALgANAAoAQgBpAHQAcwB0AHIAZQBhAG0AIABWAGUAcgBhACAAaQBzACAAYQAgAHQA + cgBhAGQAZQBtAGEAcgBrACAAbwBmACAAQgBpAHQAcwB0AHIAZQBhAG0ALAAgAEkAbgBjAC4A + DQAKAA0ACgBQAGUAcgBtAGkAcwBzAGkAbwBuACAAaQBzACAAaABlAHIAZQBiAHkAIABnAHIA + YQBuAHQAZQBkACwAIABmAHIAZQBlACAAbwBmACAAYwBoAGEAcgBnAGUALAAgAHQAbwAgAGEA + bgB5ACAAcABlAHIAcwBvAG4AIABvAGIAdABhAGkAbgBpAG4AZwAgAGEAIABjAG8AcAB5ACAA + bwBmACAAdABoAGUAIABmAG8AbgB0AHMAIABhAGMAYwBvAG0AcABhAG4AeQBpAG4AZwAgAHQA + aABpAHMAIABsAGkAYwBlAG4AcwBlACAAKAAiAEYAbwBuAHQAcwAiACkAIABhAG4AZAAgAGEA + cwBzAG8AYwBpAGEAdABlAGQAIABkAG8AYwB1AG0AZQBuAHQAYQB0AGkAbwBuACAAZgBpAGwA + ZQBzACAAKAB0AGgAZQAgACIARgBvAG4AdAAgAFMAbwBmAHQAdwBhAHIAZQAiACkALAAgAHQA + bwAgAHIAZQBwAHIAbwBkAHUAYwBlACAAYQBuAGQAIABkAGkAcwB0AHIAaQBiAHUAdABlACAA + dABoAGUAIABGAG8AbgB0ACAAUwBvAGYAdAB3AGEAcgBlACwAIABpAG4AYwBsAHUAZABpAG4A + ZwAgAHcAaQB0AGgAbwB1AHQAIABsAGkAbQBpAHQAYQB0AGkAbwBuACAAdABoAGUAIAByAGkA + ZwBoAHQAcwAgAHQAbwAgAHUAcwBlACwAIABjAG8AcAB5ACwAIABtAGUAcgBnAGUALAAgAHAA + dQBiAGwAaQBzAGgALAAgAGQAaQBzAHQAcgBpAGIAdQB0AGUALAAgAGEAbgBkAC8AbwByACAA + cwBlAGwAbAAgAGMAbwBwAGkAZQBzACAAbwBmACAAdABoAGUAIABGAG8AbgB0ACAAUwBvAGYA + dAB3AGEAcgBlACwAIABhAG4AZAAgAHQAbwAgAHAAZQByAG0AaQB0ACAAcABlAHIAcwBvAG4A + cwAgAHQAbwAgAHcAaABvAG0AIAB0AGgAZQAgAEYAbwBuAHQAIABTAG8AZgB0AHcAYQByAGUA + IABpAHMAIABmAHUAcgBuAGkAcwBoAGUAZAAgAHQAbwAgAGQAbwAgAHMAbwAsACAAcwB1AGIA + agBlAGMAdAAgAHQAbwAgAHQAaABlACAAZgBvAGwAbABvAHcAaQBuAGcAIABjAG8AbgBkAGkA + dABpAG8AbgBzADoADQAKAA0ACgBUAGgAZQAgAGEAYgBvAHYAZQAgAGMAbwBwAHkAcgBpAGcA + aAB0ACAAYQBuAGQAIAB0AHIAYQBkAGUAbQBhAHIAawAgAG4AbwB0AGkAYwBlAHMAIABhAG4A + ZAAgAHQAaABpAHMAIABwAGUAcgBtAGkAcwBzAGkAbwBuACAAbgBvAHQAaQBjAGUAIABzAGgA + YQBsAGwAIABiAGUAIABpAG4AYwBsAHUAZABlAGQAIABpAG4AIABhAGwAbAAgAGMAbwBwAGkA + ZQBzACAAbwBmACAAbwBuAGUAIABvAHIAIABtAG8AcgBlACAAbwBmACAAdABoAGUAIABGAG8A + bgB0ACAAUwBvAGYAdAB3AGEAcgBlACAAdAB5AHAAZQBmAGEAYwBlAHMALgANAAoADQAKAFQA + aABlACAARgBvAG4AdAAgAFMAbwBmAHQAdwBhAHIAZQAgAG0AYQB5ACAAYgBlACAAbQBvAGQA + aQBmAGkAZQBkACwAIABhAGwAdABlAHIAZQBkACwAIABvAHIAIABhAGQAZABlAGQAIAB0AG8A + LAAgAGEAbgBkACAAaQBuACAAcABhAHIAdABpAGMAdQBsAGEAcgAgAHQAaABlACAAZABlAHMA + aQBnAG4AcwAgAG8AZgAgAGcAbAB5AHAAaABzACAAbwByACAAYwBoAGEAcgBhAGMAdABlAHIA + cwAgAGkAbgAgAHQAaABlACAARgBvAG4AdABzACAAbQBhAHkAIABiAGUAIABtAG8AZABpAGYA + aQBlAGQAIABhAG4AZAAgAGEAZABkAGkAdABpAG8AbgBhAGwAIABnAGwAeQBwAGgAcwAgAG8A + cgAgAGMAaABhAHIAYQBjAHQAZQByAHMAIABtAGEAeQAgAGIAZQAgAGEAZABkAGUAZAAgAHQA + bwAgAHQAaABlACAARgBvAG4AdABzACwAIABvAG4AbAB5ACAAaQBmACAAdABoAGUAIABmAG8A + bgB0AHMAIABhAHIAZQAgAHIAZQBuAGEAbQBlAGQAIAB0AG8AIABuAGEAbQBlAHMAIABuAG8A + dAAgAGMAbwBuAHQAYQBpAG4AaQBuAGcAIABlAGkAdABoAGUAcgAgAHQAaABlACAAdwBvAHIA + ZABzACAAIgBCAGkAdABzAHQAcgBlAGEAbQAiACAAbwByACAAdABoAGUAIAB3AG8AcgBkACAA + IgBWAGUAcgBhACIALgANAAoADQAKAFQAaABpAHMAIABMAGkAYwBlAG4AcwBlACAAYgBlAGMA + bwBtAGUAcwAgAG4AdQBsAGwAIABhAG4AZAAgAHYAbwBpAGQAIAB0AG8AIAB0AGgAZQAgAGUA + eAB0AGUAbgB0ACAAYQBwAHAAbABpAGMAYQBiAGwAZQAgAHQAbwAgAEYAbwBuAHQAcwAgAG8A + cgAgAEYAbwBuAHQAIABTAG8AZgB0AHcAYQByAGUAIAB0AGgAYQB0ACAAaABhAHMAIABiAGUA + ZQBuACAAbQBvAGQAaQBmAGkAZQBkACAAYQBuAGQAIABpAHMAIABkAGkAcwB0AHIAaQBiAHUA + dABlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgACIAQgBpAHQAcwB0AHIAZQBhAG0AIABWAGUA + cgBhACIAIABuAGEAbQBlAHMALgANAAoADQAKAFQAaABlACAARgBvAG4AdAAgAFMAbwBmAHQA + dwBhAHIAZQAgAG0AYQB5ACAAYgBlACAAcwBvAGwAZAAgAGEAcwAgAHAAYQByAHQAIABvAGYA + IABhACAAbABhAHIAZwBlAHIAIABzAG8AZgB0AHcAYQByAGUAIABwAGEAYwBrAGEAZwBlACAA + YgB1AHQAIABuAG8AIABjAG8AcAB5ACAAbwBmACAAbwBuAGUAIABvAHIAIABtAG8AcgBlACAA + bwBmACAAdABoAGUAIABGAG8AbgB0ACAAUwBvAGYAdAB3AGEAcgBlACAAdAB5AHAAZQBmAGEA + YwBlAHMAIABtAGEAeQAgAGIAZQAgAHMAbwBsAGQAIABiAHkAIABpAHQAcwBlAGwAZgAuAA0A + CgANAAoAVABIAEUAIABGAE8ATgBUACAAUwBPAEYAVABXAEEAUgBFACAASQBTACAAUABSAE8A + VgBJAEQARQBEACAAIgBBAFMAIABJAFMAIgAsACAAVwBJAFQASABPAFUAVAAgAFcAQQBSAFIA + QQBOAFQAWQAgAE8ARgAgAEEATgBZACAASwBJAE4ARAAsACAARQBYAFAAUgBFAFMAUwAgAE8A + UgAgAEkATQBQAEwASQBFAEQALAAgAEkATgBDAEwAVQBEAEkATgBHACAAQgBVAFQAIABOAE8A + VAAgAEwASQBNAEkAVABFAEQAIABUAE8AIABBAE4AWQAgAFcAQQBSAFIAQQBOAFQASQBFAFMA + IABPAEYAIABNAEUAUgBDAEgAQQBOAFQAQQBCAEkATABJAFQAWQAsACAARgBJAFQATgBFAFMA + UwAgAEYATwBSACAAQQAgAFAAQQBSAFQASQBDAFUATABBAFIAIABQAFUAUgBQAE8AUwBFACAA + QQBOAEQAIABOAE8ATgBJAE4ARgBSAEkATgBHAEUATQBFAE4AVAAgAE8ARgAgAEMATwBQAFkA + UgBJAEcASABUACwAIABQAEEAVABFAE4AVAAsACAAVABSAEEARABFAE0AQQBSAEsALAAgAE8A + UgAgAE8AVABIAEUAUgAgAFIASQBHAEgAVAAuACAASQBOACAATgBPACAARQBWAEUATgBUACAA + UwBIAEEATABMACAAQgBJAFQAUwBUAFIARQBBAE0AIABPAFIAIABUAEgARQAgAEcATgBPAE0A + RQAgAEYATwBVAE4ARABBAFQASQBPAE4AIABCAEUAIABMAEkAQQBCAEwARQAgAEYATwBSACAA + QQBOAFkAIABDAEwAQQBJAE0ALAAgAEQAQQBNAEEARwBFAFMAIABPAFIAIABPAFQASABFAFIA + IABMAEkAQQBCAEkATABJAFQAWQAsACAASQBOAEMATABVAEQASQBOAEcAIABBAE4AWQAgAEcA + RQBOAEUAUgBBAEwALAAgAFMAUABFAEMASQBBAEwALAAgAEkATgBEAEkAUgBFAEMAVAAsACAA + SQBOAEMASQBEAEUATgBUAEEATAAsACAATwBSACAAQwBPAE4AUwBFAFEAVQBFAE4AVABJAEEA + TAAgAEQAQQBNAEEARwBFAFMALAAgAFcASABFAFQASABFAFIAIABJAE4AIABBAE4AIABBAEMA + VABJAE8ATgAgAE8ARgAgAEMATwBOAFQAUgBBAEMAVAAsACAAVABPAFIAVAAgAE8AUgAgAE8A + VABIAEUAUgBXAEkAUwBFACwAIABBAFIASQBTAEkATgBHACAARgBSAE8ATQAsACAATwBVAFQA + IABPAEYAIABUAEgARQAgAFUAUwBFACAATwBSACAASQBOAEEAQgBJAEwASQBUAFkAIABUAE8A + IABVAFMARQAgAFQASABFACAARgBPAE4AVAAgAFMATwBGAFQAVwBBAFIARQAgAE8AUgAgAEYA + UgBPAE0AIABPAFQASABFAFIAIABEAEUAQQBMAEkATgBHAFMAIABJAE4AIABUAEgARQAgAEYA + TwBOAFQAIABTAE8ARgBUAFcAQQBSAEUALgANAAoADQAKAEUAeABjAGUAcAB0ACAAYQBzACAA + YwBvAG4AdABhAGkAbgBlAGQAIABpAG4AIAB0AGgAaQBzACAAbgBvAHQAaQBjAGUALAAgAHQA + aABlACAAbgBhAG0AZQBzACAAbwBmACAARwBuAG8AbQBlACwAIAB0AGgAZQAgAEcAbgBvAG0A + ZQAgAEYAbwB1AG4AZABhAHQAaQBvAG4ALAAgAGEAbgBkACAAQgBpAHQAcwB0AHIAZQBhAG0A + IABJAG4AYwAuACwAIABzAGgAYQBsAGwAIABuAG8AdAAgAGIAZQAgAHUAcwBlAGQAIABpAG4A + IABhAGQAdgBlAHIAdABpAHMAaQBuAGcAIABvAHIAIABvAHQAaABlAHIAdwBpAHMAZQAgAHQA + bwAgAHAAcgBvAG0AbwB0AGUAIAB0AGgAZQAgAHMAYQBsAGUALAAgAHUAcwBlACAAbwByACAA + bwB0AGgAZQByACAAZABlAGEAbABpAG4AZwBzACAAaQBuACAAdABoAGkAcwAgAEYAbwBuAHQA + IABTAG8AZgB0AHcAYQByAGUAIAB3AGkAdABoAG8AdQB0ACAAcAByAGkAbwByACAAdwByAGkA + dAB0AGUAbgAgAGEAdQB0AGgAbwByAGkAegBhAHQAaQBvAG4AIABmAHIAbwBtACAAdABoAGUA + IABHAG4AbwBtAGUAIABGAG8AdQBuAGQAYQB0AGkAbwBuACAAbwByACAAQgBpAHQAcwB0AHIA + ZQBhAG0AIABJAG4AYwAuACwAIAByAGUAcwBwAGUAYwB0AGkAdgBlAGwAeQAuACAARgBvAHIA + IABmAHUAcgB0AGgAZQByACAAaQBuAGYAbwByAG0AYQB0AGkAbwBuACwAIABjAG8AbgB0AGEA + YwB0ADoAIABmAG8AbgB0AHMAIABhAHQAIABnAG4AbwBtAGUAIABkAG8AdAAgAG8AcgBnAC4A + aAB0AHQAcAA6AC8ALwB3AHcAdwAuAGIAaQB0AHMAdAByAGUAYQBtAC4AYwBvAG0AATUAuADL + AMsAwQCqAJwBpgC4AGYAAABxAMsAoAKyAIUAdQC4AMMBywGJAi0AywCmAPAA0wCqAIcAywOq + BAABSgAzAMsAAADZBQIA9AFUALQAnAE5ARQBOQcGBAAETgS0BFIEuATnBM0ANwRzBM0EYARz + ATMDogVWBaYFVgU5A8UCEgDJAB8AuAHfAHMAugPpAzMDvAREBA4A3wPNA6oA5QOqBAQAAADL + AI8ApAB7ALgAFAFvAH8CewJSAI8AxwXNAJoAmgBvAMsAzQGeAdMA8AC6AYMA1QCYAwQCSACe + AdUAwQDLAPYAgwNUAn8AAAMzAmYA0wDHAKQAzQCPAJoAcwQABdUBCgD+AisApAC0AJwAAABi + AJwAAAAdAy0F1QXVBdUF8AB/AHsAVACkBrgGFAcjAdMAuADLAKYBwwHsBpMAoADTA1wDcQPb + AYUEIwSoBEgAjwE5ARQBOQNgAI8F1QGaBhQHIwZmAXkEYARgBGAEewCcAAACdwRgAaoA6QRg + B2IAewDFAH8CewAAALQCUgXNAGYAvABmAHcGEADNATsBhQOJAI8AewAAAB0AzQdKBC8AnACc + AAAHfQBvAAAAbwM1AGoAbwB7AK4AsgAtA5YAjwJ7APYAgwNUBjcF9gCPAJwE4QJmAI8BjQL2 + AM0DRAApAGYE7gBzAAAUALgCgED/+/4D+hQD+SUD+DID95YD9g4D9f4D9P4D8yUD8g4D8ZYD + 8CUD74pBBe/+A+6WA+2WA+z6A+v6A+r+A+k6A+hCA+f+A+YyA+XkUwXllgPkikEF5FMD4+Iv + BeP6A+IvA+H+A+D+A98yA94UA92WA9z+A9sSA9p9A9m7A9j+A9aKQQXWfQPV1EcF1X0D1EcD + 09IbBdP+A9IbA9H+A9D+A8/+A87+A82WA8zLHgXM/gPLHgPKMgPJ/gPGhREFxhwDxRYDxP4D + w/4Dwv4Dwf4DwP4Dv/4Dvv4Dvf4DvP4Du/4DuhEDuYYlBbn+A7i3uwW4/gO3tl0Ft7sDt4AE + trUlBbZdQP8DtkAEtSUDtP4Ds5YDsv4Dsf4DsP4Dr/4DrmQDrQ4DrKslBaxkA6uqEgWrJQOq + EgOpikEFqfoDqP4Dp/4Dpv4DpRIDpP4Do6IOBaMyA6IOA6FkA6CKQQWglgOf/gOenQwFnv4D + nQwDnJsZBZxkA5uaEAWbGQOaEAOZCgOY/gOXlg0Fl/4Dlg0DlYpBBZWWA5STDgWUKAOTDgOS + +gORkLsFkf4DkI9dBZC7A5CABI+OJQWPXQOPQASOJQON/gOMiy4FjP4Diy4DioYlBYpBA4mI + CwWJFAOICwOHhiUFh2QDhoURBYYlA4URA4T+A4OCEQWD/gOCEQOB/gOA/gN//gNA/359fQV+ + /gN9fQN8ZAN7VBUFeyUDev4Def4DeA4DdwwDdgoDdf4DdPoDc/oDcvoDcfoDcP4Db/4Dbv4D + bCEDa/4DahFCBWpTA2n+A2h9A2cRQgVm/gNl/gNk/gNj/gNi/gNhOgNg+gNeDANd/gNb/gNa + /gNZWAoFWfoDWAoDVxYZBVcyA1b+A1VUFQVVQgNUFQNTARAFUxgDUhQDUUoTBVH+A1ALA0/+ + A05NEAVO/gNNEANM/gNLShMFS/4DSkkQBUoTA0kdDQVJEANIDQNH/gNGlgNFlgNE/gNDAi0F + Q/oDQrsDQUsDQP4DP/4DPj0SBT4UAz08DwU9EgM8Ow0FPED/DwM7DQM6/gM5/gM4NxQFOPoD + NzYQBTcUAzY1CwU2EAM1CwM0HgMzDQMyMQsFMv4DMQsDMC8LBTANAy8LAy4tCQUuEAMtCQMs + MgMrKiUFK2QDKikSBSolAykSAygnJQUoQQMnJQMmJQsFJg8DJQsDJP4DI/4DIg8DIQEQBSES + AyBkAx/6Ax4dDQUeZAMdDQMcEUIFHP4DG/oDGkIDGRFCBRn+AxhkAxcWGQUX/gMWARAFFhkD + Ff4DFP4DE/4DEhFCBRL+AxECLQURQgMQfQMPZAMO/gMNDBYFDf4DDAEQBQwWAwv+AwoQAwn+ + AwgCLQUI/gMHFAMGZAMEARAFBP4DQBUDAi0FA/4DAgEQBQItAwEQAwD+AwG4AWSFjQErKysr + KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr + KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr + KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysA + KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr + KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr + KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKx22BgUE + AwIBACwgELACJUlksEBRWCDIWSEtLLACJUlksEBRWCDIWSEtLCAQByCwAFCwDXkguP//UFgE + GwVZsAUcsAMlCLAEJSPhILAAULANeSC4//9QWAQbBVmwBRywAyUI4S0sS1BYILD9RURZIS0s + sAIlRWBELSxLU1iwAiWwAiVFRFkhIS0sRUQtAAACAGb+lgRmBaQAAwAHABpADAT7AAb7AQgF + fwIEAC/E1OwxABDU7NTsMBMRIRElIREhZgQA/HMDG/zl/pYHDvjycgYpAAIBNQAAAgAF1QAD + AAkAQEAPBwCDBIECCAcFAQMEAAAKEPw87DI5OTEAL+T8zDABS7ALVFi9AAoAQAABAAoACv/A + OBE3OFm2AAsgC1ALA10lMxUjETMRAyMDATXLy8sUohX+/gXV/XH+mwFlAAIAxQOqAukF1QAD + AAcATUAPBQGEBACBCAQFBgAFAgQIEPz83OwxABD0POwyMAFLsBJUS7ATVFtYvQAIAEAAAQAI + AAj/wDgRNzhZQA8wCUAJUAlgCXAJoAm/CQddAREjESERIxEBb6oCJKoF1f3VAiv91QIrAAAC + AJ4AAAYXBb4AAwAfAGBAMRsLAIcHBB0JBRkNAocXEw8VER8eHBsaFxYVFBMSERAODQwJCAcG + BQQDAgEAGgoYBiAQ/MwXOTEALzzUPDz8PDzUPDzEMuwyMjBAEQsBCwILDAsNFAQaERoSFB8I + AV0BIQMhCwEhEzMDIRUhAyEVIQMjEyEDIxMhNSETITUhEwQX/t1UASVEaAEkaaBnATj+oVIB + Pv6baKBn/ttnoWj+xQFgVP6+AWlmA4X+sgOH/mEBn/5hmv6ymf5iAZ7+YgGemQFOmgGfAAAD + AKr+0wRtBhQAIQAoAC8A1UBVIgIKCwonASYoAgsLCh0BHhwCLykvGwIpKS9CExEQIgobKQQX + BgkqIQUCF4YWBoYFESMaihaJEAAqigWJAi0IFgoeBykaEgMACSIQCQMBByYIDQUGMBD8POz0 + Fzz8Fzz05OwxAC/k7MTU5OwyxBDuEO4REjkRORESFzkREjkwS1NYBxAE7QcQDu0RFzkHEA7t + ERc5BxAE7VkiAUuwCVRYvQAwAEAAAQAwADD/wDgRNzhZAUuwDFRLsBBUW0uwD1RbWL0AMP/A + AAEAMAAwAEA4ETc4WQEjAy4BJzUeARcRLgE1NDY3NTMVHgEXFS4BJxEeARUUBgcDEQ4BFRQW + FxE+ATU0JgK0ZAFp0mpm0W/dydrMZF2uU1OvXOPW49ZkdHpx4X+Be/7TAS0CLS20QEEBAcgk + rJajvA7r6AQfG68qLgT+VSO0nKnDDwMAAZoNalhWYNX+TxFuWlhoAAAFAHH/4wcpBfAACwAX + ACMAJwAzAJVANiQPJSYlJg8nJCdCAJIMHpIujRiSJAaSDI0mEowoJJE0JyEbJQkDDRUOCQ0P + IQ0rDhsNDzELNBD8xOz07BDu9u4RORESOTEAEOQy9Dzk7BDu9u4Q7jBLU1gHEAXtBxAF7Vki + AUuwCVRLsAtUW0uwDFRbS7AUVFtLsA5UW0uwDVRbWL0ANABAAAEANAA0/8A4ETc4WQEiBhUU + FjMyNjU0JicyFhUUBiMiJjU0NgEiBhUUFjMyNjU0JiUzASMTMhYVFAYjIiY1NDYF0VdjY1dV + Y2NVnrq7naC6u/yXVmNiV1djZAMxoPxaoB+evLufn7m6ApGUhIKVlYKDlX/cu7vb27u82wJh + lYKElJSEgZZ/+fMGDdu7vdrbvLrcAAACAIH/4wX+BfAACQAwAc1Alg0BDgyGERIRC4YKCxIS + EQmGAAkVFhUHAQYIhhYWFQIBAwGGHR4dAIYJAB4eHSAfAiEeEQoTChcWFQMYFBETCgcIAgYJ + ERMTCgIBAgMAEQoTChcWAhgVERMKFBETEwpCEgsJAwYACh4DKBUOBignBpUYK5UnlCSRGIwO + EwouCw4JAC4SFScOHgMuEichDhEPEyEDEhsQMRD87MTU1OwQxu4RORESOTkROTkRORE5MQAv + xuT25u4Q7hDGERI5ERc5ERc5MEtTWAcQBe0HBe0RFzkHEAXtERc5BxAF7REXOQcF7REXOQcQ + Be0RFzkHEAjtBxAO7REXOQcQDu0RFzkHEAjtBxAI7QcQDu0RFzlZIrIPMgEBXUCyBwsFIgkp + HAAcAR8CFwsqACoBJhI6ADQSRAteAFkBWgpVEloaWh9ZMGceewCbAJoBmQKXCJULkxWVFpUi + mS0fCQsJDAgRDCcMKBgCGwkZCxkMGREcFBwVFh0fMicAJwEpCSMSKhMqFCgVLzI7CTQSORM/ + MkoJTBRLFUYZTzJWAVoJWQxVElkTXB9fMmoMaRFgMnUBeQx6EZMAkwGXApUFnAecCJ8Imgmb + C5oMkDKgMrAyOV0AXQEOARUUFjMyNjcJAT4BNzMGAgcBIycOASMiADU0NjcuATU0NjMyFhcV + LgEjIgYVFBYB8ltV1KBfpkn+ewH8O0IGugxoXQEX/I9o5IPx/s6GhjAy3rhTpVVXnkRpgzsD + I1GhWJLCP0ACj/34WctyhP7+fv7jk1lXARPXgOFjP308osUkJLYvMW9YM2cAAQDFA6oBbwXV + AAMAQkAKAYQAgQQABQIEBBD87DEAEPTsMAFLsBJUS7ATVFtYvQAEAEAAAQAEAAT/wDgRNzhZ + QA1ABVAFYAVwBZAFoAUGXQERIxEBb6oF1f3VAisAAAEAsP7yAnsGEgANAE9ADwaYAJcODQcA + AxIGABMKDhDc5DLsETk5MQAQ/OwwAUuwE1RYvQAOAEAAAQAOAA7/wDgRNzhZAUuwD1RYvQAO + /8AAAQAOAA4AQDgRNzhZAQYCFRQSFyMmAjU0EjcCe4aCg4WglpWUlwYS5v4+5+f+O+XrAcbg + 3wHE7AABAKT+8gJvBhIADQAfQA8HmACXDgcBAAsSBBMIAA4Q3Dz07BE5OTEAEPzsMBMzFhIV + FAIHIzYSNTQCpKCWlZWWoIWDgwYS7P483+D+OuvlAcXn5wHCAAEAPQJKA8MF8AARAE5ALBAN + CwAEDAkHBAIECAOZBREMmQoBDpESCAwKAwkGEQMBAwIAFA8ECwkUDQYSENQ85DLcPOQyFzkR + Ehc5MQAQ9NQ87DLE7DIXORIXOTABBQUHJREjEQUnJSU3BREzESUDw/6ZAWc6/rBy/rA6AWf+ + mToBUHIBUATfwsNiy/6HAXnLYsPCY8sBef6HywABANkAAAXbBQQACwAjQBEACQGcBwMFAhUE + ABcKBhUIDBDc/Dz8POwxAC/UPPw8xDABESEVIREjESE1IREDrgIt/dOo/dMCLQUE/dOq/dMC + LaoCLQABAJ7/EgHDAP4ABQAZQAwDngCDBgMEARkAGAYQ/OzUzDEAEPzsMDczFQMjE/DTpIFS + /qz+wAFAAAEAZAHfAn8CgwADABG2AJwCBAEABBDczDEAENTsMBMhFSFkAhv95QKDpAAAAQDb + AAABrgD+AAMAEbcAgwIBGQAYBBD87DEAL+wwNzMVI9vT0/7+AAEAAP9CArIF1QADAC1AFAAa + AQIBAhoDAANCAp8AgQQCAAEDL8Q5OTEAEPTsMEtTWAcQBe0HEAXtWSIBMwEjAgiq/fiqBdX5 + bQAAAgCH/+MEjwXwAAsAFwAjQBMGoBIAoAyREowYCRwPHgMcFRsYEPzs9OwxABDk9OwQ7jAB + IgIREBIzMhIREAInMgAREAAjIgAREAACi5ydnZydnZ2d+wEJ/vf7+/73AQkFUP7N/sz+zf7N + ATMBMwE0ATOg/nP+hv6H/nMBjQF5AXoBjQAAAQDhAAAEWgXVAAoAS0AVQgOgBAKgBYEHAKAJ + CB8GHAMAHwELENTsxPzsMQAv7DL07NTsMEtTWFkiAUuwD1RYvQAL/8AAAQALAAsAQDgRNzhZ + tA8DDwQCXTchEQU1JTMRIRUh/gFK/pkBZcoBSvykqgRzSLhI+tWqAAABAJYAAARKBfAAHACl + QCcZGhsDGBwRBQQAEQUFBEIQoRGUDaAUkQQAoAIAEAoCAQocFxADBh0Q/MTU7MDAERI5MQAv + 7DL07PTsMEtTWAcQBe0HBe0RFzlZIgFLsBVUS7AWVFtLsBRUW1i9AB0AQAABAB0AHf/AOBE3 + OFlAMlUEVgVWB3oEegV2G4cZBwQABBkEGgQbBRx0AHYGdRpzG3QcggCGGYIaghuCHKgAqBsR + XQBdJSEVITU2ADc+ATU0JiMiBgc1PgEzMgQVFAYHBgABiQLB/ExzAY0zYU2nhl/TeHrUWOgB + FEVbGf70qqqqdwGROm2XSXeWQkPMMTLowlylcB3+6wAAAQCc/+MEcwXwACgAe0AuABUTCoYJ + H4YgE6AVDaAJkwYcoCCTI5EGjBWjKRYcEwADFBkcJiAQHAMUHwkGKRD8xMTU7PTsERc5OTEA + EOzk9OTsEObuEO4Q7hDuERI5MAFLsBZUS7AUVFtYvQApAEAAAQApACn/wDgRNzhZQAlkHmEf + YSBkIQQAXQEeARUUBCEiJic1HgEzMjY1NCYrATUzMjY1NCYjIgYHNT4BMzIEFRQGAz+Ro/7Q + /uhex2pUyG2+x7mlrraVnqOYU75yc8lZ5gEMjgMlH8SQ3fIlJcMxMpaPhJWmd3BzeyQmtCAg + 0bJ8qwACAGQAAASkBdUAAgANAIxAHQENAw0AAwMNQgADCwegBQEDgQkBDAoAHAYIBAwOENzU + PMTsMhE5MQAv5NQ87DISOTBLU1gHEATJBxAFyVkiAUuwC1RLsA1UW1i9AA4AQAABAA4ADv/A + OBE3OFlAKgsAKgBIAFkAaQB3AIoABxYBKwAmASsDNgFOAU8MTw1WAWYBdQF6A4UBDV0AXQkB + IQMzETMVIxEjESE1Awb+AgH+Nf7V1cn9XgUl/OMDzfwzqP6gAWDDAAABAJ7/4wRkBdUAHQB1 + QCMEGgcRhhAdGqAHFKAQiQ0CoACBDYwHpB4XHAEKAxwAChAGHhD8xNTsEMTuMQAQ5OT07BDm + 7hD+xBDuERI5MAFLsBZUS7AUVFtYvQAeAEAAAQAeAB7/wDgRNzhZAUuwD1RYvQAe/8AAAQAe + AB4AQDgRNzhZEyEVIRE+ATMyABUUACEiJic1HgEzMjY1NCYjIgYH3QMZ/aAsWCz6AST+1P7v + XsNoWsBrrcrKrVGhVAXVqv6SDw/+7urx/vUgIMsxMLacnLYkJgAAAgCP/+MElgXwAAsAJABY + QCQTBgANhgwAoBYGoBwWpRCgDIkikRyMJQwiCRwZHhMcAyEfGyUQ/Ozs9OzkMQAQ5PTk/OQQ + 7hDuEO4REjkwQBTLAMsBzQLNA80EywXLBgekHrIeAl0BXQEiBhUUFjMyNjU0JgEVLgEjIgID + PgEzMgAVFAAjIAAREAAhMhYCpIifn4iIn58BCUybTMjTDzuya+EBBf7w4v79/u4BUAEbTJsD + O7qiobu7oaK6Anm4JCb+8v7vV13+7+vm/uoBjQF5AWIBpR4AAAEAqAAABGgF1QAGAGNAGAUR + AgMCAxEEBQRCBaAAgQMFAwEEAQAGBxD8zMQROTkxAC/07DBLU1gHEAXtBxAF7VkiAUuwFlRY + vQAHAEAAAQAHAAf/wDgRNzhZQBJYAgEGAxoFOQVIBWcDsACwBgddAF0TIRUBIwEhqAPA/eLT + Af79MwXVVvqBBSsAAAMAi//jBIsF8AALACMALwBDQCUYDACgJwagHi2gEpEejCejMBgMJCoc + FSQcDwkcFRseAxwPIRswEPzE7PTE7BDuEO4ROTkxABDs5PTsEO4Q7jk5MAEiBhUUFjMyNjU0 + JiUmJjU0NjMyFhUUBgcWFhUUBCMiJDU0NhMUFjMyNjU0JiMiBgKLkKWlkJCmpf6lgpH/3t/+ + kYGSo/739/f+96RIkYOCk5OCg5ECxZqHh5qbhoeaViCygLPQ0LOAsiAixo/Z6OjZj8YBYXSC + gnR0goIAAAIAgf/jBIcF8AAYACQAWEAjBx8ZAYYAGaAKpQSgAIkWH6AQkRaMJQccHCETHgAi + IhwNGyUQ/Ozk9OzsMQAQ5PTsEOb+9e4Q7hESOTBAFsQZwhrAG8AcwB3CHsQfB6oSvBLpEgNd + AV03NR4BMzISEw4BIyIANTQAMyAAERAAISImATI2NTQmIyIGFRQW4UycS8jTDzqybOD++wEQ + 4gEDARH+sf7lTJwBPoifn4iIn58fuCQmAQ0BElZcAQ/r5gEW/nP+hv6f/lseApe6oqG7u6Gi + ugAAAgDwAAABwwQjAAMABwAcQA4GgwSmAIMCBQEDBAAYCBD8POwyMQAv7PTsMDczFSMRMxUj + 8NPT09P+/gQj/gACAJ7/EgHDBCMAAwAJACVAEwKDAAeeBIMApgoHCAUBGQQAGAoQ/DzsMtTM + MQAQ5PzsEO4wEzMVIxEzFQMjE/DT09OkgVIEI/792az+wAFAAAEA2QBeBdsEpgAGAE1AKgKc + AwQDAZwAAQQEAwGcAgEFBgUAnAYFQgUEAgEABQOoBqcHAQIAJAQjBxD87DI5MQAQ9OwXOTBL + U1gHBO0HEAjtBxAI7QcQBO1ZIgkCFQE1AQXb+/gECPr+BQID8P6R/pO2AdGmAdEAAAIA2QFg + BdsDogADAAcAHEANAJwCBpwECAUBBAAjCBD8PMQyMQAQ1OzU7DATIRUhFSEVIdkFAvr+BQL6 + /gOiqPCqAAEA2QBeBdsEpgAGAE9AKwacAAYDBAMFnAQEAwCcAQIBBpwFBgICAUIGBQMCAAUE + qAGnBwYCJAQAIwcQ/DzsOTEAEPTsFzkwS1NYBxAI7QcQBO0HEATtBxAI7VkiEzUBFQE1AdkF + Avr+BAYD8Lb+L6b+L7YBbQACAJMAAAOwBfAAAwAkAHBAKyQeCQYECh0TBAAUhhOIEJUXkQCD + Ah0aDQkFBAoeAQ0cGgQcBQEDACYaEyUQ3MT87NTsEO4ROTkREjkREjkxAC/u9v707hDNETk5 + FzkwAUuwDFRYvQAlAEAAAQAlACX/wDgRNzhZtnkJegp6IANdJTMVIxMjNTQ2PwE+ATU0JiMi + Bgc1PgEzMhYVFAYPAQ4BBw4BFQGHy8vFvzhaWjkzg2xPs2FewWe430haWC8nCAYG/v4BkZpl + glZZNV4xWW5GQ7w5OMKfTIlWVi81GRU8NAAAAgCH/pwHcQWiAAsATACVQDIYDAMJqRkVGwOp + TA80Mw+sMKk3FawkqTdDTTM0HhoAKBIGGAwoGiseKEkSKyooSSw9TRDc7PzsEP79/jzGEO4R + Ejk5MQAQ1MT87BD+7dTGEMXuMhDE7hE5OTAAS7AJVEuwDFRbS7AQVFtLsBNUW0uwFFRbWL0A + Tf/AAAEATQBNAEA4ETc4WUAJD04fTi9OP04EAV0BFBYzMjY1NCYjIgYBDgEjIiY1NDYzMhYX + NTMRPgE1NCYnJiQjIgYHBgIVFBIXFgQzMjY3FwYEIyIkJyYCNTQSNzYkMzIEFx4BFRAABQL6 + jnx7jZB6eY8CITybZ6zX2KtnnDuPkqU/QGj+1bB74mCdsXNtaQEUnYH5aFp9/tmYuf64gICG + iH6BAVK91AFre0tP/sL+6AIZj6OkjoylpP5ITUn5yMj6S0yD/SAW37FrvFCDi0FAZv61wZ/+ + 6mpobVdRb2Fng319AUm9tgFKfX+HrqBi5nv++f7QBgAAAgAQAAAFaAXVAAIACgC6QEEAEQEA + BAUEAhEFBQQBEQoDCgARAgADAwoHEQUEBhEFBQQJEQMKCBEKAwpCAAMHlQEDgQkFCQgHBgQD + AgEACQUKCxDUxBc5MQAvPOTU7BI5MEtTWAcQBe0HBe0HEAXtBwXtBxAI7QcQBe0HEAXtBxAI + 7VkisiAMAQFdQDoPAFgAdgBwAIwABQcBCAIGAwkEFgEZAlYBWAJQDGcBaAJ4AXYCfANyBHcH + eAiHAYgCgAyYApkDlgQXXQBdCQEhATMBIwMhAyMCvP7uAiX+e+UCOdKI/V+I1QUO/RkDrvor + AX/+gQADAMkAAATsBdUACAARACAAQ0AjGQCVCgmVEoEBlQqtHxELCAITGR8FAA4cFgUZHC4J + ABwSBCEQ/Owy/OzU7BEXOTk5MQAv7Oz07BDuOTCyDyIBAV0BESEyNjU0JiMBESEyNjU0JiMl + ITIWFRQGBx4BFRQEIyEBkwFEo52do/68ASuUkZGU/gsCBOf6gHyVpf7w+/3oAsn93YeLjIUC + Zv4+b3JxcKbAsYmiFCDLmMjaAAEAc//jBScF8AAZADZAGg2hDq4KlREBoQCuBJUXkRGMGgcZ + DQAwFBAaEPzsMuwxABDk9Oz07BDu9u4wtA8bHxsCAV0BFS4BIyAAERAAITI2NxUOASMgABEQ + ACEyFgUnZueC/wD+8AEQAQCC52Zq7YT+rf56AYYBU4btBWLVX17+x/7Y/tn+x15f00hIAZ8B + ZwFoAZ9HAAIAyQAABbAF1QAIABEALkAVAJUJgQGVEAgCEAoABRkNMgAcCQQSEPzs9OwROTk5 + OTEAL+z07DCyYBMBAV0BETMgABEQACElISAAERAAKQEBk/QBNQEf/uH+y/5CAZ8BsgGW/mj+ + UP5hBS/7dwEYAS4BLAEXpv6X/oD+fv6WAAEAyQAABIsF1QALAC5AFQaVBAKVAIEIlQStCgUB + CQcDHAAEDBD87DLUxMQxAC/s7PTsEO4wsh8NAQFdEyEVIREhFSERIRUhyQOw/RoCx/05Avj8 + PgXVqv5Gqv3jqgABAMkAAAQjBdUACQApQBIGlQQClQCBBK0IBQEHAxwABAoQ/Owy1MQxAC/s + 9OwQ7jCyDwsBAV0TIRUhESEVIREjyQNa/XACUP2wygXVqv5Iqv03AAABAHP/4wWLBfAAHQA5 + QCAABRsBlQMblQgSoRGuFZUOkQiMHgIAHBE0BDMYGQsQHhD87Pzk/MQxABDk9Oz07BD+1O4R + OTkwJREhNSERBgQjIAAREAAhMgQXFSYmIyAAERAAITI2BMP+tgISdf7moP6i/nUBiwFekgEH + b3D8i/7u/u0BEwESa6jVAZGm/X9TVQGZAW0BbgGZSEbXX2D+zv7R/tL+ziUAAQDJAAAFOwXV + AAsALEAUCJUCrQQAgQoGBwMcBTgJARwABAwQ/Owy/OwyMQAvPOQy/OwwslANAQFdEzMRIREz + ESMRIREjycoC3srK/SLKBdX9nAJk+isCx/05AAABAMkAAAGTBdUAAwA5twCvAgEcAAQEEPzs + MQAv7DABS7AQVFi9AAT/wAABAAQABABAOBE3OFlADTAFQAVQBWAFjwWfBQZdEzMRI8nKygXV + +isAAf+W/mYBkwXVAAsATUATCwIAB5UFsACBDAUIBjkBHAAEDBD87OQ5OTEAEOT87BE5OTAB + S7AQVFi9AAz/wAABAAwADABAOBE3OFlADTANQA1QDWANjw2fDQZdEzMREAYrATUzMjY1ycrN + 400/hm4F1fqT/vL0qpbCAAABAMkAAAVqBdUACgDvQCgIEQUGBQcRBgYFAxEEBQQCEQUFBEII + BQIDAwCvCQYFAQQGCAEcAAQLEPzsMtTEETkxAC887DIXOTBLU1gHEATtBxAF7QcQBe0HEATt + WSKyCAMBAV1AkhQCAQQCCQgWAigFKAg3AjYFNAhHAkYFQwhVAmcCdgJ3BYMCiAWPCJQCmwjn + AhUGAwkFCQYbAxkHBQoDCgcYAygFKwYqBzYENgU2BjUHMAxBA0AERQVABkAHQAxiA2AEaAVn + B3cFcAyLA4sFjgaPB48MmgOdBp0HtgO1B8UDxQfXA9YH6APpBOgF6gb3A/gF+QYsXXEAXXET + MxEBIQkBIQERI8nKAp4BBP0bAxr+9v0zygXV/YkCd/1I/OMCz/0xAAABAMkAAARqBdUABQAl + QAwClQCBBAEcAzoABAYQ/OzsMQAv5OwwQAkwB1AHgAOABAQBXRMzESEVIcnKAtf8XwXV+tWq + AAEAyQAABh8F1QAMAL9ANAMRBwgHAhEBAggIBwIRAwIJCgkBEQoKCUIKBwIDCAMArwgLBQkI + AwIBBQoGHAQ+ChwABA0Q/Oz87BEXOTEALzzE7DIRFzkwS1NYBxAF7QcQCO0HEAjtBxAF7Vki + snAOAQFdQFYDBw8IDwkCChUCFAcTCiYCJgcgByYKIAo0BzUKaQJ8AnsHeQqAAoIHggqQAhYE + AQsDEwEbAyMBLAMnCCgJNAE8A1YIWQllCGoJdgh5CYEBjQOVAZsDFF0AXRMhCQEhESMRASMB + ESPJAS0BfQF/AS3F/n/L/n/EBdX8CAP4+isFH/wABAD64QABAMkAAAUzBdUACQB5QB4HEQEC + AQIRBgcGQgcCAwCvCAUGAQcCHAQ2BxwABAoQ/Oz87BE5OTEALzzsMjk5MEtTWAcQBO0HEATt + WSKyHwsBAV1AMDYCOAdIAkcHaQJmB4ACBwYBCQYVARoGRgFJBlcBWAZlAWkGeQaFAYoGlQGa + Bp8LEF0AXRMhAREzESEBESPJARAClsT+8P1qxAXV+x8E4forBOH7HwACAHP/4wXZBfAACwAX + ACNAEwaVEgCVDJESjBgJGQ8zAxkVEBgQ/Oz87DEAEOT07BDuMAEiABEQADMyABEQACcgABEQ + ACEgABEQAAMn3P79AQPc3AEB/v/cAToBeP6I/sb+xf6HAXkFTP64/uX+5v64AUgBGgEbAUik + /lv+nv6f/lsBpAFiAWIBpQACAMkAAASNBdUACAATADpAGAGVEACVCYESEAoIAgQABRkNPxEA + HAkEFBD87DL87BEXOTEAL/Ts1OwwQAsPFR8VPxVfFa8VBQFdAREzMjY1NCYjJSEyBBUUBCsB + ESMBk/6NmpqN/jgByPsBAf7/+/7KBS/9z5KHhpKm49vd4v2oAAIAc/74BdkF8AALAB0AUkAq + ERACDwEMDQwOAQ0NDEIPHgwGlRIAlRiREowNHg0bDwwDCRkbMwMZFRAeEPzs/OwROTkROTEA + EMTk9OwQ7jkSOTBLU1gHEAXtBxAF7Rc5WSIBIgAREAAzMgAREAATASMnBgYjIAAREAAhIAAR + EAIDJ9z+/QED3NwBAf7/PwEK9N0hIxD+xf6HAXkBOwE6AXjRBUz+uP7l/ub+uAFIARoBGwFI + +s/+3e8CAgGlAWEBYgGl/lv+nv78/o4AAAIAyQAABVQF1QATABwAsUA1CQgHAwoGEQMEAwUR + BAQDQgYEABUDBBWVCRSVDYELBAUGAxEJABwWDgUKGRkEET8UChwMBB0Q/Owy/MTsERc5ETk5 + OTEALzz07NTsEjkSORI5MEtTWAcQBe0HEAXtERc5WSKyQB4BAV1AQnoTAQUABQEFAgYDBwQV + ABUBFAIWAxcEJQAlASUCJgMnBiYHJggmCSAeNgE2AkYBRgJoBXUEdQV3E4gGiAeYBpgHH10A + XQEeARcTIwMuASsBESMRISAWFRQGAREzMjY1NCYjA41Bez7N2b9Ki3jcygHIAQD8g/2J/pKV + lZICvBaQfv5oAX+WYv2JBdXW2I26Ak/97oeDg4UAAAEAh//jBKIF8AAnAH5APA0MAg4LAh4f + HggJAgcKAh8fHkIKCx4fBBUBABWhFJQYlREElQCUJZERjCgeCgsfGwcAIhsZDi0HGRQiKBDc + xOz87OQREjk5OTkxABDk9OTsEO727hDGERc5MEtTWAcQDu0RFzkHEA7tERc5WSKyDykBAV22 + HykvKU8pA10BFS4BIyIGFRQWHwEeARUUBCEiJic1HgEzMjY1NCYvAS4BNTQkMzIWBEhzzF+l + s3emeuLX/t3+52rvgHvscq28h5p74soBF/Vp2gWkxTc2gHZjZR8ZK9m22eAwL9BFRoh+bnwf + GC3Aq8bkJgAAAf/6AAAE6QXVAAcASkAOBgKVAIEEAUADHABABQgQ1OT85DEAL/TsMjABS7AK + VFi9AAgAQAABAAgACP/AOBE3OFlAEwAJHwAQARACHwcQCUAJcAmfCQldAyEVIREjESEGBO/9 + 7sv97gXVqvrVBSsAAAEAsv/jBSkF1QARAEtAFggCEQsABZUOjAkAgRIIHAo4ARwAQRIQ/Oz8 + 7DEAEOQy9OwROTk5OTABS7AQVFi9ABIAQAABABIAEv/AOBE3OFm2HxOPE58TA10TMxEUFjMy + NjURMxEQACEgABGyy67Dwq7L/t/+5v7l/t8F1fx18NPT8AOL/Fz+3P7WASoBJAABABAAAAVo + BdUABgC3QCcEEQUGBQMRAgMGBgUDEQQDAAEAAhEBAQBCAwQBrwAGBAMCAAUFAQcQ1MQXOTEA + L+wyOTBLU1gHEAXtBxAI7QcQCO0HEAXtWSKyUAgBAV1AYgADKgNHBEcFWgN9A4MDBwYABwII + BAkGFQEUAhoEGgUqACYBJgIpBCkFJQYgCDgAMwEzAjwEPAU3BkgARQFFAkkESQVHBlkAVgZm + AmkEaQV6AHYBdgJ5BHkFdQaACJgAlwYpXQBdIQEzCQEzAQJK/cbTAdkB2tL9xwXV+xcE6for + AAEARAAAB6YF1QAMAXtASQUaBgUJCgkEGgoJAxoKCwoCGgECCwsKBhEHCAcFEQQFCAgHAhED + AgwADAERAAAMQgoFAgMGAwCvCwgMCwoJCAYFBAMCAQsHAA0Q1MwXOTEALzzsMjIXOTBLU1gH + EAXtBxAI7QcQCO0HEAXtBxAI7QcQBe0HBe0HEAjtWSKyAA4BAV1A8gYCBgUCCgAKAAoSCigF + JAogCj4CPgU0CjAKTAJNBUIKQApZAmoCawVnCmAKewJ/AnwFfwWACpYClQUdBwAJAggDAAQG + BQAFAAYBBwQIAAgHCQAJBAoKDAAOGgMVBBUIGQwQDiAEIQUgBiAHIAgjCSQKJQsgDiAOPAI6 + AzUEMwUwCDYJOQs/DDAORgBGAUoCQARFBUAFQgZCB0IIQAhACUQKTQxADkAOWAJWCFkMUA5m + AmcDYQRiBWAGYAdgCGQJZApkC3cAdgF7AngDdwR0BXkGeQd3CHAIeAx/DH8OhgKHA4gEiQWF + CYoLjw6XBJ8Orw5bXQBdEzMJATMJATMBIwkBI0TMAToBOeMBOgE5zf6J/v7F/sL+BdX7EgTu + +xIE7vorBRD68AABAD0AAAU7BdUACwFdQEYJEQoLCggRBwgLCwoIEQkIBQYFBxEGBgUDEQQF + BAIRAQIFBQQCEQMCCwALAREAAAtCCwgFAgQDAK8JBgsIBQIEAAQGAAoMENTE3MQRFzkxAC88 + 7DIXOTBLU1gHEAXtBxAI7QcQCO0HEAXtBxAF7QcQCO0HEAjtBxAF7VkiAUuwDFRLsA1UW0uw + DlRbWL0ADP/AAAEADAAMAEA4ETc4WUC4BwIICBYCGQgXCycIJws0AjgINgtLCFgFWwhmAmsI + dwJ3C4YCgAKHBYsIhQuUApAClwWdCJYLGwYBCQMIBwcJFgEZAxkHFwkQDSYBKAIpAyYFKAcn + CSkLIA01ADQBPAM7BDoGOwc0CTQKOAs/DUgJTw1YC18NZQBlAWoDagRoBWkGaQdsCWwKeAN5 + BnkHeAh9CX8KeAuAAIABgwKIA4UFhAiDC48NkACQAZQClwWXBpUIkwufDa8NQF0AXRMzCQEz + CQEjCQEjAYHZAXMBddn+IAIA2f5c/lnaAhUF1f3VAiv9M/z4Anv9hQMdAAH//AAABOcF1QAI + AJRAKAMRBAUEAhEBAgUFBAIRAwIIAAgBEQAACEICAwCvBgIHBEAFHABABwkQ1OT85BI5MQAv + 7DI5MEtTWAcQBe0HEAjtBxAI7QcQBe1ZIrIACgEBXUA8BQIUAjUCMAIwBTAIRgJAAkAFQAhR + AlEFUQhlAoQCkwIQFgEaAx8KJgEpAzcBOANACmcBaAN4A3AKnwoNXQBdAzMJATMBESMRBNkB + ngGb2f3wywXV/ZoCZvzy/TkCxwAAAQBcAAAFHwXVAAkAm0AbAxEHCAcIEQIDAkIIlQCBA5UF + CAMAAUIEAAYKENzE1OQROTkxAC/s9OwwS1NYBxAF7QcQBe1ZIgFLsAlUS7AKVFtYvQAKAEAA + AQAKAAr/wDgRNzhZQEAFAgoHGAcpAiYHOAdIAkcHSAgJBQMLCAALFgMaCBALLws1AzkIPwtH + A0oITwtVA1kIZgNpCG8LdwN4CH8LnwsWXQBdEyEVASEVITUBIXMElfxQA8f7PQOw/GcF1Zr7 + b6qaBJEAAAEAsP7yAlgGFAAHAFNADwSpBrICqQCxCAUBA0MACBDc/MwyMQAQ/Oz07DABS7AM + VFi9AAj/wAABAAgACABAOBE3OFkBS7ASVEuwE1RbWL0ACABAAAEACAAI/8A4ETc4WRMhFSMR + MxUhsAGo8PD+WAYUj/n8jwABAAD/QgKyBdUAAwAtQBQCGgEBAAAaAwMCQgGfAIEEAgABAy/E + OTkxABD07DBLU1gHEAXtBxAF7VkiEwEjAaoCCKr9+AXV+W0GkwAAAQDH/vICbwYUAAcAPEAQ + A6kBsgWpALEIAEMEBgIECBD8PNzsMQAQ/Oz07DABS7APVEuwEFRbWL0ACP/AAAEACAAIAEA4 + ETc4WQERITUzESM1Am/+WO/vBhT43o8GBI8AAQDZA6gF2wXVAAYAGEAKAwQBAIEHAwEFBxDc + zDkxABD0zDI5MAEBIwEBIwEDvAIfyf5I/kjJAh8F1f3TAYv+dQItAAAB/+z+HQQU/qwAAwAP + tQCpAQACBBDExDEA1OwwARUhNQQU+9j+rI+PAAABAKoE8AKJBmYAAwAxQAkBtACzBANEAQQQ + 3OwxABD07DAAS7AJVEuwDlRbWL0ABP/AAAEABAAEAEA4ETc4WQkBIwEBbwEamf66Bmb+igF2 + AAIAe//jBC0EewAKACUAvEAnGR8LFwkOAKkXBrkOESCGH7ocuSO4EYwXDAAXAxgNCQgLHwMI + FEUmEPzszNTsMjIROTkxAC/E5PT89OwQxu4Q7hE5ETkSOTBAbjAdMB4wHzAgMCEwIj8nQB1A + HkAfQCBAIUAiUB1QHlAfUCBQIVAiUCdwJ4Udhx6HH4cghyGFIpAnoCfwJx4wHjAfMCAwIUAe + QB9AIEAhUB5QH1AgUCFgHmAfYCBgIXAecB9wIHAhgB6AH4AggCEYXQFdASIGFRQWMzI2PQE3 + ESM1DgEjIiY1NDYzITU0JiMiBgc1PgEzMhYCvt+sgW+Zubi4P7yIrMv9+wECp5dgtlRlvlrz + 8AIzZntic9m0KUz9gapmYcGivcASf4suLqonJ/wAAAIAuv/jBKQGFAALABwAOEAZA7kMDwm5 + GBWMD7gblxkAEhJHGAwGCBpGHRD87DIy9OwxAC/s5PTE7BDG7jC2YB6AHqAeAwFdATQmIyIG + FRQWMzI2AT4BMzISERACIyImJxUjETMD5aeSkqenkpKn/Y46sXvM///Me7E6ubkCL8vn58vL + 5+cCUmRh/rz++P74/rxhZKgGFAAAAQBx/+MD5wR7ABkAP0AbAIYBiAQOhg2ICrkRBLkXuBGM + GgcSDQBIFEUaEPzkMuwxABDk9OwQ/vTuEPXuMEALDxsQG4AbkBugGwUBXQEVLgEjIgYVFBYz + MjY3FQ4BIyIAERAAITIWA+dOnVCzxsazUJ1OTaVd/f7WAS0BBlWiBDWsKyvjzc3jKyuqJCQB + PgEOARIBOiMAAgBx/+MEWgYUABAAHAA4QBkauQAOFLkFCIwOuAGXAxcEAAgCRxESC0UdEPzs + 9OwyMjEAL+zk9MTsEMTuMLZgHoAeoB4DAV0BETMRIzUOASMiAhEQEjMyFgEUFjMyNjU0JiMi + BgOiuLg6sXzL///LfLH9x6eSkqiokpKnA7YCXvnsqGRhAUQBCAEIAURh/hXL5+fLy+fnAAAC + AHH/4wR/BHsAFAAbAHBAJAAVAQmGCIgFFakBBbkMAbsYuRK4DIwcGxUCCBUIAEsCEg9FHBD8 + 7PTsxBESOTEAEOT07OQQ7hDuEPTuERI5MEApPx1wHaAd0B3wHQU/AD8BPwI/FT8bBSwHLwgv + CSwKbwBvAW8CbxVvGwldcQFdARUhHgEzMjY3FQ4BIyAAERAAMzIABy4BIyIGBwR//LIMzbdq + x2Jj0Gv+9P7HASn84gEHuAKliJq5DgJeWr7HNDSuKiwBOAEKARMBQ/7dxJe0rp4AAAEALwAA + AvgGFAATAHBAHAUQAQwIqQYBhwCXDga8CgITBwAHCQUIDQ8LTBQQ/DzE/DzExBI5OTEAL+Qy + /OwQ7jISOTkwAUuwClRYvQAU/8AAAQAUABQAQDgRNzhZAUuwDlRYvQAUAEAAAQAUABT/wDgR + NzhZtkAVUBWgFQNdARUjIgYdASEVIREjESM1MzU0NjMC+LBjTQEv/tG5sLCuvQYUmVBoY4/8 + LwPRj067qwAAAgBx/lYEWgR7AAsAKABKQCMZDB0JEoYTFrkPA7kmI7gnvAm5D70aHSYZAAgM + RwYSEiBFKRD8xOz07DIyMQAvxOTs5PTE7BD+1e4REjk5MLZgKoAqoCoDAV0BNCYjIgYVFBYz + MjYXEAIhIiYnNR4BMzI2PQEOASMiAhEQEjMyFhc1MwOipZWUpaWUlaW4/v76YaxRUZ5StbQ5 + snzO/PzOfLI5uAI9yNzcyMfc3Ov+4v7pHR6zLCq9v1tjYgE6AQMBBAE6YmOqAAABALoAAARk + BhQAEwA0QBkDCQADDgEGhw4RuAyXCgECCABODQkIC0YUEPzsMvTsMQAvPOz0xOwREhc5MLJg + FQEBXQERIxE0JiMiBhURIxEzET4BMzIWBGS4fHyVrLm5QrN1wcYCpP1cAp6fnr6k/YcGFP2e + ZWTvAAACAMEAAAF5BhQAAwAHACtADga+BLEAvAIFAQgEAEYIEPw87DIxAC/k/OwwQAsQCUAJ + UAlgCXAJBQFdEzMRIxEzFSPBuLi4uARg+6AGFOkAAAL/2/5WAXkGFAALAA8AREAcCwIHAA6+ + DAeHBb0AvAyxEAgQBQZPDQEIDABGEBD8POwy5DkSOTEAEOzk9OwQ7hESOTkwQAsQEUARUBFg + EXARBQFdEzMRFAYrATUzMjY1ETMVI8G4o7VGMWlMuLgEYPuM1sCcYZkGKOkAAQC6AAAEnAYU + AAoAvEApCBEFBgUHEQYGBQMRBAUEAhEFBQRCCAUCAwO8AJcJBgUBBAYIAQgARgsQ/Owy1MQR + OTEALzzs5Bc5MEtTWAcQBO0HEAXtBxAF7QcQBO1ZIrIQDAEBXUBfBAIKCBYCJwIpBSsIVgJm + AmcIcwJ3BYICiQWOCJMClgWXCKMCEgkFCQYCCwMKBygDJwQoBSsGKwdADGgDYAyJA4UEiQWN + Bo8HmgOXB6oDpwW2B8UH1gf3A/AD9wTwBBpdcQBdEzMRATMJASMBESO6uQIl6/2uAmvw/ce5 + BhT8aQHj/fT9rAIj/d0AAQDBAAABeQYUAAMAIrcAlwIBCABGBBD87DEAL+wwQA0QBUAFUAVg + BXAF8AUGAV0TMxEjwbi4BhT57AAAAQC6AAAHHQR7ACIAWkAmBhIJGA8ABh0HFQyHHSADuBu8 + GRAHABEPCAgGUBEID1AcGAgaRiMQ/Owy/Pz87BESOTEALzw85PQ8xOwyERIXOTBAEzAkUCRw + JJAkoCSgJL8k3yT/JAkBXQE+ATMyFhURIxE0JiMiBhURIxE0JiMiBhURIxEzFT4BMzIWBClF + wIKvvrlydY+muXJ3jaa5uT+weXqrA4l8dvXi/VwCnqGcvqT9hwKeopu/o/2HBGCuZ2J8AAAB + ALoAAARkBHsAEwA2QBkDCQADDgEGhw4RuAy8CgECCABODQkIC0YUEPzsMvTsMQAvPOT0xOwR + Ehc5MLRgFc8VAgFdAREjETQmIyIGFREjETMVPgEzMhYEZLh8fJWsublCs3XBxgKk/VwCnp+e + vqT9hwRgrmVk7wACAHH/4wR1BHsACwAXAEpAEwa5EgC5DLgSjBgJEg9RAxIVRRgQ/Oz07DEA + EOT07BDuMEAjPxl7AHsGfwd/CH8Jfwp/C3sMfw1/Dn8PfxB/EXsSoBnwGREBXQEiBhUUFjMy + NjU0JicyABEQACMiABEQAAJzlKyrlZOsrJPwARL+7vDx/u8BEQPf58nJ5+jIx+mc/sj+7P7t + /scBOQETARQBOAACALr+VgSkBHsAEAAcAD5AGxq5AA4UuQUIuA6MAb0DvB0REgtHFwQACAJG + HRD87DIy9OwxABDk5OT0xOwQxO4wQAlgHoAeoB7gHgQBXSURIxEzFT4BMzISERACIyImATQm + IyIGFRQWMzI2AXO5uTqxe8z//8x7sQI4p5KSp6eSkqeo/a4GCqpkYf68/vj++P68YQHry+fn + y8vn5wACAHH+VgRaBHsACwAcAD5AGwO5DA8JuRgVuA+MG70ZvB0YDAYIGkcAEhJFHRD87PTs + MjIxABDk5OT0xOwQxu4wQAlgHoAeoB7gHgQBXQEUFjMyNjU0JiMiBgEOASMiAhEQEjMyFhc1 + MxEjAS+nkpKoqJKSpwJzOrF8y///y3yxOri4Ai/L5+fLy+fn/a5kYQFEAQgBCAFEYWSq+fYA + AAEAugAAA0oEewARADBAFAYLBwARCwOHDrgJvAcKBggACEYSEPzE7DIxAC/k9OzE1MwREjkw + tFATnxMCAV0BLgEjIgYVESMRMxU+ATMyFhcDSh9JLJynubk6uoUTLhwDtBIRy779sgRgrmZj + BQUAAQBv/+MDxwR7ACcA50A8DQwCDgtTHx4ICQIHClMeHx5CCgseHwQVAIYBiQQUhhWJGLkR + BLkluBGMKB4KCx8bBwBSGwgOBwgUIkUoEPzE7NTs5BESOTk5OTEAEOT07BD+9e4Q9e4SFzkw + S1NYBxAO7REXOQcO7REXOVkisgAnAQFdQG0cChwLHAwuCSwKLAssDDsJOwo7CzsMCyAAIAEk + AigKKAsqEy8ULxUqFigeKB8pICkhJCeGCoYLhgyGDRIAAAABAgIGCgYLAwwDDQMOAw8DEAMZ + AxoDGwMcBB0JJy8pPylfKX8pgCmQKaAp8CkYXQBdcQEVLgEjIgYVFBYfAR4BFRQGIyImJzUe + ATMyNjU0Ji8BLgE1NDYzMhYDi06oWomJYpQ/xKX32FrDbGbGYYKMZatAq5jgzma0BD+uKChU + VEBJIQ4qmYmctiMjvjU1WVFLUCUPJJWCnqweAAABADcAAALyBZ4AEwA4QBkOBQgPA6kAEQG8 + CIcKCwgJAgQACBASDkYUEPw8xPw8xDI5OTEAL+z0PMTsMhE5OTCyrxUBAV0BESEVIREUFjsB + FSMiJjURIzUzEQF3AXv+hUtzvb3VooeHBZ7+wo/9oIlOmp/SAmCPAT4AAAEArv/jBFgEYAAT + ADZAGQMJAAMOAQaHDhGMCgG8DA0JCAtOAggARhQQ/Oz07DIxAC/kMvTE7BESFzkwtGAVzxUC + AV0TETMRFBYzMjY1ETMRIzUOASMiJq64fHyVrbi4Q7F1wcgBugKm/WGfn76kAnv7oKxmY/AA + AAEAPQAABH8EYAAGARJAJwMRBAUEAhEBAgUFBAIRAwIGAAYBEQAABkICAwC/BQYFAwIBBQQA + BxDUxBc5MQAv7DI5MEtTWAcQBe0HEAjtBxAI7QcQBe1ZIgFLsApUWL0AB//AAAEABwAHAEA4 + ETc4WQFLsBRUS7AVVFtYvQAHAEAAAQAHAAf/wDgRNzhZQI5IAmoCewJ/AoYCgAKRAqQCCAYA + BgEJAwkEFQAVARoDGgQmACYBKQMpBCAINQA1AToDOgQwCEYARgFJA0kERgVIBkAIVgBWAVkD + WQRQCGYAZgFpA2kEZwVoBmAIdQB0AXsDewR1BXoGhQCFAYkDiQSJBYYGlgCWAZcCmgOYBJgF + lwaoBacGsAjACN8I/wg+XQBdEzMJATMBIz3DAV4BXsP+XPoEYPxUA6z7oAAAAQBWAAAGNQRg + AAwCAUBJBVUGBQkKCQRVCgkDVQoLCgJVAQILCwoGEQcIBwURBAUICAcCEQMCDAAMAREAAAxC + CgUCAwYDAL8LCAwLCgkIBgUEAwIBCwcADRDUzBc5MQAvPOwyMhc5MEtTWAcQBe0HEAjtBxAI + 7QcQBe0HEAjtBxAF7QcF7QcQCO1ZIgFLsApUS7ARVFtLsBJUW0uwE1RbS7ALVFtYvQAN/8AA + AQANAA0AQDgRNzhZAUuwDFRLsA1UW0uwEFRbWL0ADQBAAAEADQAN/8A4ETc4WUD/BQIWAhYF + Igo1CkkCSQVGCkAKWwJbBVUKUApuAm4FZgp5An8CeQV/BYcCmQKYBZQKvAK8Bc4CxwPPBR0F + AgkDBgQLBQoICwkECwUMFQIZAxYEGgUbCBsJFAsVDCUAJQEjAicDIQQlBSIGIgclCCcJJAoh + CyMMOQM2BDYIOQwwDkYCSANGBEAEQgVABkAHQAhECUQKRAtADkAOVgBWAVYCUARRBVIGUgdQ + CFMJVApVC2MAZAFlAmoDZQRqBWoGagduCWELZwxvDnUAdQF5An0DeAR9BXoGfwZ6B38HeAh5 + CX8Jewp2C30MhwKIBY8OlwCXAZQCkwOcBJsFmAaYB5kIQC+WDJ8OpgCmAaQCpAOrBKsFqQap + B6sIpAyvDrUCsQO9BLsFuAm/DsQCwwPMBMoFeV0AXRMzGwEzGwEzASMLASNWuObl2ebluP7b + 2fHy2QRg/JYDavyWA2r7oAOW/GoAAQA7AAAEeQRgAAsBWkBGBREGBwYEEQMEBwcGBBEFBAEC + AQMRAgIBCxEAAQAKEQkKAQEAChELCgcIBwkRCAgHQgoHBAEECAC/BQIKBwQBBAgAAggGDBDU + xNTEERc5MQAvPOwyFzkwS1NYBxAF7QcQCO0HEAjtBxAF7QcQBe0HEAjtBxAI7QcQBe1ZIgFL + sApUS7APVFtLsBBUW0uwEVRbWL0ADP/AAAEADAAMAEA4ETc4WQFLsBRUWL0ADABAAAEADAAM + /8A4ETc4WUCYCgQEChoEFQomCj0EMQpVBFcHWApmCnYBegR2B3QKjQSCCpkEnwSXB5IKkAqm + AakErwSlB6MKoAocCgMEBQUJCgsaAxUFFQkaCykDJgUlCSoLIA06ATkDNwU0BzYJOQswDUkD + RgVFCUoLQA1ZAFYBWQJZA1cFVgZZB1YIVglZC1ANbw14AX8NmwGUB6sBpAewDc8N3w3/DS9d + AF0JAiMJASMJATMJAQRk/msBqtn+uv662QGz/nLZASkBKQRg/d/9wQG4/kgCSgIW/nEBjwAB + AD3+VgR/BGAADwGiQEMHCAIJEQAPChELCgAADw4RDwAPDREMDQAADw0RDg0KCwoMEQsLCkIN + CwkQAAsFhwO9Dgu8EA4NDAoJBgMACA8EDwsQENTExBEXOTEAEOQy9OwRORE5EjkwS1NYBxAF + 7QcQCO0HEAjtBxAF7QcQCO0HBe0XMlkiAUuwClRLsAhUW1i9ABD/wAABABAAEABAOBE3OFkB + S7AUVFi9ABAAQAABABAAEP/AOBE3OFlA8AYABQgGCQMNFgoXDRANIw01DUkKTwpODVoJWgpq + CocNgA2TDRIKAAoJBgsFDAsOCw8XARUCEAQQBRcKFAsUDBoOGg8nACQBJAIgBCAFKQgoCSUK + JAskDCcNKg4qDyARNwA1ATUCMAQwBTgKNgs2DDgNOQ45DzARQQBAAUACQANABEAFQAZAB0AI + QglFCkcNSQ5JD0ARVABRAVECVQNQBFAFVgZVB1YIVwlXClULVQxZDlkPUBFmAWYCaAppDmkP + YBF7CHgOeA+JAIoJhQuFDIkNiQ6JD5kJlQuVDJoOmg+kC6QMqw6rD7ARzxHfEf8RZV0AXQUO + ASsBNTMyNj8BATMJATMCk06UfJNsTFQzIf47wwFeAV7DaMh6mkiGVARO/JQDbAABAFgAAAPb + BGAACQC0QBoIEQIDAgMRBwgHQgipALwDqQUIAwEABAEGChDcxDLEETk5MQAv7PTsMEtTWAcQ + Be0HEAXtWSIBS7ALVEuwDFRbWL0ACgBAAAEACgAK/8A4ETc4WQFLsBNUWL0ACv/AAAEACgAK + AEA4ETc4WUBCBQIWAiYCRwJJBwULCA8LGAMbCCsIIAs2AzkIMAtAAUACRQNABEAFQwhXA1kI + XwtgAWACZgNgBGAFYgh/C4ALrwsbXQBdEyEVASEVITUBIXEDav1MArT8fQK0/WUEYKj825Oo + AyUAAQEA/rIEFwYUACQAgkA0GQ8VCwYlCRoQFR0LBSAhAwALqQkAqQHACRWpE7ElDAkKBSQW + GQAdCgUTAhQAIBlDCg8FJRDUPMT8PMQyOTkREjkREjk5ERI5OTEAEPzsxPTsEO4SFzkSORE5 + ORESORESOTkwAUuwDFRYvQAl/8AAAQAlACUAQDgRNzhZsgAmAV0FFSMiJj0BNCYrATUzMjY9 + ATQ2OwEVIyIGHQEUBgceAR0BFBYzBBc++alsjj09j2up+T5EjVZbbm9aVo2+kJTd75d0j3OV + 8N2Tj1iN+J2OGRuOnPiNWAABAQT+HQGuBh0AAwAStwEAsQQABQIEENTsMQAQ/MwwAREjEQGu + qgYd+AAIAAAAAQEA/rIEFwYUACQAnkA2HyUbFgwPCBsLFRkPBAUgAwAZqRsAqSPAGw+pEbEl + HBkaFQ8BBAAIGhUjEgQAGh8VQxAACwQlENQ8xDL8PMQREjk5ERI5ERI5ORESOTkxABD87MT0 + 7BDuEhc5ERI5ORE5ETk5ERI5MAFLsApUWL0AJQBAAAEAJQAl/8A4ETc4WQFLsA5UWL0AJf/A + AAEAJQAlAEA4ETc4WbIAJgFdBTMyNj0BNDY3LgE9ATQmKwE1MzIWHQEUFjsBFSMiBh0BFAYr + AQEARoxVWm9vWlWMRj/5p2yOPj6ObKf5P75Wj/icjhsZjp34jlePk93wlXOPdJfv3ZQAAQDZ + AdMF2wMxAB0AI0AQARAbDAATBJwbE5wMHgAPHhDUxDEAENT81OwQwBESOTkwARUGBiMiJyYn + JicmIyIGBzU2NjMyFxYXFhcWMzI2Bdtps2FukgsFBw+bXlisYmmzYW6TCgUIDpteVqkDMbJP + RDsEAgMFPk1Tsk9FPAQCAwU+TAD//wAQAAAFaAdOAicAJAAAAAAABwEDALwBdQADABAAAAVo + B20ACwAOACEAy0BUDBENDBscGw4RHBseERwbHREcHBsNESEPIQwRDgwPDyEgEQ8hHxEhDyFC + DBsPDQkDwRUJHpUNCY4gHB4dHBggHyENEgYOGAwGGwBWGBwPBlYSHCEiENTE1OwyENTuMhE5 + ETkREjkROTkREjk5MQAvPObW7hDU7hESOTk5MEtTWAcQBe0HBe0HEAjtBxAF7QcQBe0HBe0H + Be0HEAjtWSKyICMBAV1AIBoMcwybDAMHDwgbUCNmDWkOdQ17DnkceR12IHYhgCMMXQBdATQm + IyIGFRQWMzI2AwEhAS4BNTQ2MzIWFRQGBwEjAyEDIwNUWT9AV1g/P1mY/vACIf5YPT6fc3Kh + PzwCFNKI/V+I1QZaP1lXQT9YWP7z/RkDTilzSXOgoXJGdin6iwF//oEA//8Ac/51BScF8AIn + ACYAAAAAAAcA3QEtAAD//wDJAAAEiwdrAicAKAAAAAAABwEEAJ4Bdf//AMkAAAUzB14CJwAx + AAAAAAAHAQUA/gF1//8Ac//jBdkHTgInADIAAAAAAAcBAwEnAXX//wCy/+MFKQdOAicAOAAA + AAAABwEDAO4Bdf//AHv/4wQtBmYCJwBEAAAAAAAHAI0AUgAA//8Ae//jBC0GZgInAEQAAAAA + AAcAQwBSAAD//wB7/+MELQZmAicARAAAAAAABwDXAFIAAP//AHv/4wQtBhACJwBEAAAAAAAH + AI4AUgAA//8Ae//jBC0GNwInAEQAAAAAAAcA2ABSAAD//wB7/+MELQcGAicARAAAAAAABwDc + AFIAAP//AHH+dQPnBHsCJwBGAAAAAAAHAN0AjwAA//8Acf/jBH8GZgInAEgAAAAAAAcAjQCL + AAD//wBx/+MEfwZmAicASAAAAAAABwBDAIsAAP//AHH/4wR/BmYCJwBIAAAAAAAHANcAiwAA + //8Acf/jBH8GEAInAEgAAAAAAAcAjgCLAAD//wCQAAACbwZmAicA1gAAAAAABwCN/x0AAP// + /8cAAAGmBmYCJwDWAAAAAAAHAEP/HQAA////3gAAAlwGZgInANYAAAAAAAcA1/8dAAD////0 + AAACRgYQAicA1gAAAAAABwCO/x0AAP//ALoAAARkBjcCJwBRAAAAAAAHANgAmAAA//8Acf/j + BHUGZgInAFIAAAAAAAcAjQBzAAD//wBx/+MEdQZmAicAUgAAAAAABwBDAHMAAP//AHH/4wR1 + BmYCJwBSAAAAAAAHANcAcwAA//8Acf/jBHUGEAInAFIAAAAAAAcAjgBzAAD//wBx/+MEdQY3 + AicAUgAAAAAABwDYAHMAAP//AK7/4wRYBmYCJwBYAAAAAAAHAI0AewAA//8Arv/jBFgGZgIn + AFgAAAAAAAcAQwB7AAD//wCu/+MEWAZmAicAWAAAAAAABwDXAHsAAP//AK7/4wRYBhACJwBY + AAAAAAAHAI4AewAAAAEAOf87A8cF1QALACdAFAgEuQoCAIEGwgwDWQUBVwlZBwAMENQ87Pw8 + 7DEAEOT01DzsMjABMxEhFSERIxEhNSEBqLABb/6RsP6RAW8F1f5cmfujBF2ZAAACAMMDdQM9 + BfAACwAaACBAEQbDFcQAwwyRGwlaElsDWhgbENzs/OwxABD07PzsMAEiBhUUFjMyNjU0Jicy + FhcWFhUUBiMiJjU0NgIAUG5uUFBub09AdisuLrmGh7S4BW9vUE9tbU9PcIExLi1yQoS3tIeG + ugAAAgCs/scEIwWYAAYAIQBRQCsTFhQADwwBCweGCIgLEIYPiAy5FBYLuR0fHLgWjCIcFQAJ + HhMLDwcEEhkiENzs1DzUPDzsMjIxABDk9DzE7BDE/vTuEPXuEjkREjkREjkwJREGBhUUFgEV + JiYnAzY2NxUGBgcRIxEmABEQADcRMxMWFgKmk6SkAhBKiEQBRolIQYlNZvH+9wEJ8WYBSYmD + A1gS4ri54gOhrCkqA/ygBSonqh4jB/7kASAUATMBAQECATIWAR/+4QQhAAEAgQAABGIF8AAb + AGBAIQcWCAGGABIKqRQIDASgAJQZkRAMoA4ADQkLBxwTDxURHBDcPMzM/DzE1MQxAC/sMvTk + 7BDUPO4yEO4ROTkwAUuwDFRYvQAc/8AAAQAcABwAQDgRNzhZtDYBNgICAF0BFS4BIyIGHQEh + FSERIRUhNTMRIzUzNRA2MzIWBE5MiD2UdAGH/nkCLfwf7MfH1ug9lwW0tikpm9TXj/4vqqoB + 0Y/uAQXzHwAAAgBc/z0DogXwAAsAPgCRQDwvMCoGABcdMDYEDSeKJg2KDCrGJsUjEMYMxTyR + Iz8vBgAXMAQTHS0JNgMTVzktVyAJVwwiGjkmIgNXMz8Q3OzkxNTk7NTsEO4RORESOREXOTkx + ABDE9OTsEObuEO4Q7hEXOTk5ERI5MAFLsApUS7ALVFtLsAxUW0uwDlRbWL0APwBAAAEAPwA/ + /8A4ETc4WQEOARUUFhc+ATU0JhMVLgEjIgYVFBcWFx4BFRQGBx4BFRQGIyImJzUeATMyNjU0 + LwEuATU0NjcuATU0NjMyFgF7Pz6L+j8+j8xTjzhhbM4aDtODXF0+OcytSZpYV5Q6ZnHdGdaA + XVs7O8imSZkDqC5aLkyFhy1bLkuIApOkJydQR1pzDwh3mmVajDU0bUCOqB0dpCcnVExmew54 + mWZbjzEscEWCnx0AAAEBMwHRA4UEIQALABK3CccDDAZcAAwQ1OwxABDU7DABNDYzMhYVFAYj + IiYBM61+fKusfX2sAvp8q6t8faysAAABAJ7/OwQ5BdUADQAlQBIIAgTBAIEGAg4AB10FA10B + Cw4Q1NT83Ow5MQAQxDL07BE5MAEhESMRIxEjESYmNTQkAnkBwI2+jtfrAQQF1flmBh/54QNO + Ed24vugAAAEAuv/jBKwGFAAvAJpAMC0nIQwEBg0gAAQqFoYXGrkTKrkDlxOMLgwJDR0gIScJ + CCQnCAYdCCQQFi0IEABGMBD8xPzMEMbu1O4Q7hE5ORI5EjkxAC/k/u4Q/tXuEhc5FzkwQEAP + BQ8GDwcPJw8oigyKDQcKBgoHCgsKDAoNCh8NIAohDCIEJhkNGR8ZIDogOiFNH00gSSFJImof + aiClBqUHpiAYXQFdEzQ2MzIWFw4BFRQWHwEeARUUBiMiJic1HgEzMjY1NCYvAS4BNTQ2Ny4B + IyIGFREjuu/a0NsDl6g6QTmmYOHTQIhJUIxBdHg7ZVxgV6eXCINxgoi7BHHI2+jgCHNgL1Eq + JWqOZKy3GRikHh1fWz9UPjc7h1t/rB1ncIuD+5MAAAQBGwAABuUFzQAXAC8AOABMAGBANkVC + Qz8yyUgwyTlKQ8oMOcoAyRjIDMkkSEUzMAQxQjw/OTZJMWBLNmBDPF4SCR5LXgYJHl8qTRDc + 5PzsEP79xO4Q7jIROTkSORIXOTEAL+72/u0Q7TIQ7tbuORI5OTABIgYHBgYVFBYXFhYzMjY3 + NjY1NCYnJiYnMgQXFhIVFAIHBgQjIiQnJgI1NBI3NiQTIxEzMjY1NCYnMhYVFAYHFhYXFyMn + JiYjIxEjEQQAg+JeXmBgXl7ig4TjXl1dXlxe44SYAQdtbWxsbW3++ZiY/vltbWxsbW0BB317 + e25XWGawrmlgGEMuiayBO0k2QpsFZl5eXuWCgeNeXl9fXl3ig4XjXV5eZ25tbf76mpj++21t + bm5tbQEFmJoBBm1tbv5i/uw+S0w/Z3d5VnARCE1J39FgM/6cA0QAAwEbAAAG5QXNABcALwBJ + AENAJj3LPjrMQcokMcswNMxHyhjJAMgkyQw3YUQ9MF4qCQZEXh4JBhJKENzM/OwQ/u0yEO4x + AC/u9v797tbuEP3u1u4wATIEFxYSFRQCBwYEIyIkJyYCNTQSNzYkFyIGBwYGFRQWFxYWMzI2 + NzY2NTQmJyYmFxUmJiMiBhUUFjMyNjcVBgYjIiY1NDYzMhYEAJgBB21tbGxtbf75mJj++W1t + bGxtbQEHmIPiXl5gYF5e4oOE415dXV5cXuOnQoJClaerm0B6QkOJRtj7+9hJiAXNbm1t/vqa + mP77bW1ubm1tAQWYmgEGbW1uZ15eXuWCgeNeXl9fXl3ig4XjXV5e9YEhIK+dn64fIn8dHPTQ + 0fIcAAACAScDkwZGBdUADAAUAD5AIQEGBxAKBBIOCQMGyQ0CAIEVAQkFYgMJYgsNYw9iE2MR + FRDU5Pzk1OzU7BE5MQAQ9Dw87Bcy1Dw8xBE5MAETEzMRIxEDIwMRIxEjFSMRIxEjNQRKrqSq + ccM3y3Jxy3LJBdX/AAEA/b4B5P7RAS/+HAJCXv4cAeReAAABAXME7gNSBmYAAwAxQAkCtACz + BANEAQQQ1OwxABD07DAAS7AJVEuwDlRbWL0ABP/AAAEABAAEAEA4ETc4WQEzASMCi8f+upkG + Zv6IAAACANcFRgMpBhAAAwAHAJJADgYCzgQAzQgBZAAFZAQIENz81OwxABD8POwyMABLsApU + S7ANVFtYvQAIAEAAAQAIAAj/wDgRNzhZAUuwDFRLsA1UW0uwDlRbS7AXVFtYvQAI/8AAAQAI + AAgAQDgRNzhZAUuwD1RLsBlUW1i9AAgAQAABAAgACP/AOBE3OFlAEWABYAJgBWAGcAFwAnAF + cAYIXQEzFSMlMxUjAl7Ly/55y8sGEMrKygAAAQDZACcF2wTdABMAPkAiDQwKAwLPBACcBgzP + DgqcEgYQCBQSDg0MCAQDAggJBQ8AFBDcPMQyFzkxABDUPMwy/DzsEP487DkREjkwEyEBFwch + FSEHIRUhASc3ITUhNyHZAwQBAH2uAS/+SMMCe/z6/v59rv7VAbbD/YcDogE7ZtWo8Kr+x2bT + qvAAAgAIAAAHSAXVAA8AEwCHQDkREQ4PDhARDw8ODREPDgwRDg8OQgWVAwuVEQGVEJUAgREH + lQOtDQkREA8NDAUOCgAECAYCHBIKDhQQ1NQ87DLUxMQREhc5MQAvPOzsxPTs7BDuEO4wS1NY + BxAF7QcF7QcQBe0HEAXtWSKygBUBAV1AE2cRdxB3EYYMhRCWEZAVoBW/FQldARUhESEVIREh + FSERIQMjARcBIREHNf0bAsf9OQL4/D398KDNAnGL/rYBywXVqv5Gqv3jqgF//oEF1Z788AMQ + AAMAZv+6BeUGFwAJABMAKwCeQDwdHxoNKywTCgEABA0pJiAUDQQqJh4aBJUmDZUakSaMLCss + KhQXECAeIxMKAQAEHSkQBx8HGSMzEBkXECwQ/Oz87MAREjk5FzkSOTkREjk5ETkxABDk9OwQ + 7hDAEMAREjk5EjkSFzkSORESOTkwQCpXAFoVVxlVIWoVZSF7FXYcdSEJRhNZAFYTagBkE2Qc + aih8AHMTdhx6KAtdAV0JAR4BMzIAETQmJy4BIyIAERQWFwcmAjUQACEyFhc3FwcWEhUQACEi + JicHJwS2/TM+oV/cAQEneT2hX9z+/Scnhk5PAXkBO4LdV6Jmqk5Q/oj+xoDdW6JnBFj8skBD + AUgBGnC4uEBD/rj+5XC8RJ5mAQigAWIBpU1Lv1nGZ/72nv6f/ltLS79YAAMA3QDdBc8D7gAL + ABcALwD/QB0tGxUJIQMAJBgEFQ8nIRUbDyEwDAAkGBIGKhIeMBDUxNTEETk5OTkxABDUxNTE + EMAREhc5EjkREjkwQL4FAgUDBQQABQAGAAcFCAUJBQoKEA8RDxIPEwoUFQIVAxUEEAUQBhAH + FQgVCRUKGg4aDxoQHxEfEh8TGhQaFRoWJAIkAyQEIAUgBiAHJAgkCSQKKg4qDyoQLxEvEi8T + KhQqFSoWNQI1AzUEMAUwBjAHNQg1CTUKOg46DzoQPxE/Ej8TOhQ6FToWRQJFA0UEQAVABkAH + RQhFCUUKSg5KD0oQTxFPEk8TShRKFUoWVrQfsCCwIbAisCawJ7AotCkIXQFdAR4BMzI2NTQm + IyIGBy4BIyIGFRQWMzI2Fw4BIyImNTQ2MzIWFz4BMzIWFRQGIyImA5MxhlRlgHZZUoXEMYVV + Zn92WVKGkEadXoi6p4ZfmUhEnmGGvKeGXpUCL1hah2llhoc3WFiEamWGiBaHf9+mr9h+ioqD + 4aev1ncAAAIA2QAABdsFBAALAA8ALkAYBdAHA5wA0AkBDJwODQIVBAAXDAgVCgYQENQ87DL8 + POwyMQAv7NQ87Pw87DABESEVIREjESE1IREBIRUhA64CLf3TqP3TAi390wUC+v4FBP59qv59 + AYOqAYP7pqoAAgDZAAAF2wSoAAYACgBUQC4CnAMEAwGcAAEEBAMBnAIBBQYFAJwGBUIFBAIB + AAUD0QanB5wJAQgCACQHBCMLEPw87DIyOTEAL+z07Bc5MEtTWAcE7QcQCO0HEAjtBxAE7Vki + CQIVATUBASEVIQXb/EADwPr+BQL6/gUC+v4D+P7r/u6yAXCqAW/8AqoAAAIA2QAABdsEqAAG + AAoAVkAvBpwABgMEAwWcBAQDAJwBAgEGnAUGAgIBQgYFAwIABQTRAacHnAgGBwIkCQQAIwsQ + /Dw87DI5MQAv7PTsFzkwS1NYBxAI7QcQBO0HEATtBxAI7VkiEzUBFQE1AQEVITXZBQL6/gPB + AUH6/gP4sP6Rqv6QsgES/ceqqgAAAQBSAAAEwwXVABgAxkBGEAIRFhEPAg4PFhYRDwIQDwgN + CA4CDQ0IQg8LCQQA0xcGEgvTFAkQDYECDAkOAwUWDwMVEhADABFmEwBlARwNZgoFZQcDGRDU + POwy7PzsMuwSFzkSOTkRFzkxAC/kMtQ87DLUPOwyERI5MEtTWAcQBe0HEAjtBxAI7QcQBe1Z + IgFLsAxUWL0AGf/AAAEAGQAZAEA4ETc4WUAohg+QD6YPoA+1DwUnDCcNJw4pECgRKBI3DjkQ + hwyIEqYNpQ6qEKkRDl0AXQEhESMRITUhNSchNSEBMwkBMwEhFSEHFSEEjf5jyf5gAaBU/rQB + CP7DvgF7AXm//sIBCP61VAGfAcf+OQHHezObewJK/UQCvP22e5szAAABAK7+VgTlBGAAIABN + QCUTGR8DFgYDCQwDARIPBoccFowKAbwAvSEZCRIJCAtOHwIIAEYhEPzsMvTsxBI5MQAQ5OQy + 9Dzs3MQRFzkREhc5MLYfImAizyIDAV0TETMRFBYzMjY1ETMRFBYzMjY3FQ4BIyImJw4BIyIm + JxGuuIqHlJW4IyUJIBwpSSNFUg8ykWJmjyr+VgYK/UiRlKioAo38ojw5CwyUFxZOUE9PTk79 + 1wAAAgBo/+cDwQUtAB0AKQBiQBkAJyEJGwYnFQYPIRsPFdUqDCQDAB4SJBgqENTM3Mw5ORE5 + MQAQ5MzczBDOEM4REjkREjkwAUuwDFRLsAtUW0uwDlRbS7AQVFtLsBRUW1i9ACoAQAABACoA + Kv/AOBE3OFkBPgE1NCYjIgYjIiY1NDYzMhIREAAjIiY1NBIzMhYHNCYjIgIVFBYzMhIC9A8P + SUg3kCQkMJBltNb+39WYy92iZYILV09tjVZQbY0CbVejS4GDdCwfPmL+yv75/rH+RtijxgEB + W+B0ff7+z3R7AQQAAAEAGf53BTsFwQALAF1AFAoEDAIFBwIABwwKBQQDAQAGBggMENTEFzkx + ABDE1MwQzhESOTkwQDBRA1YFUAVaCnMDcAN2BHUFcAV6CoADgAUMWgl/An8DcAVwBnsJdAuP + Ao8DgAWABgtdAV0TIRUhCQEhFSE1CQE3BOr8QQKg/UoD7/reAtX9SQXBwf0z/QTAlQMhAuMA + AAEAnP53BXEFwQAHAB5ADwYC1wTWAK8IA2cBBWcACBDU7NTsMQAQ/OzsMjATIREjESERI5wE + 1fD9Cu8Fwfi2Bn35gwAAAf/h//AEqgQvACMAy0AxCwIVHx4DAAjaDxoWANki2A/VGAweGxoZ + GBcGJBIBAAsCBCMWFQUiHxIMIxJoBSMfJBDU1NTsEjkREjkSOTkRFzkREhc5MQAvPOT07DIy + EO4RFzk5OTABS7AKVFi9ACT/wAABACQAJABAOBE3OFlAVhgeGB8CCQAJAQ0CDQMPBA8FDwYP + Bw8IDwkPCg8LDwwPDQ8ODw8PEA8RDxIPEw4UDRUJFgsXCBgPGA0ZCBoJIxEAEQEWAhYDFxQW + FREWFxccGBwZESMoXQBdASMDDgEVFBYzMjY3Bw4BIyImNTQ2NxMhAyMTIyIGByM+ATMhBIe2 + aQ8PLzcRLiUeHjcadnkVIlD+usK1wyk2PAmgHI+lA3kDkf4ZSlwWOjEFBY0ICGZkLpChAXj8 + bwORQEWmfQAAAQAv/o0D+gYOACUAJkAUINsAGg3bExrcB7EmCmkXah1pBCYQ3Oz87DEAEPzs + 3OQQ3uQwATITNjcSEjMyFhUUBiMiJicmJiMiAwYHAgIjIiY1NDYzMhYXFhYBN2oOAgEMvspQ + ZEA3KjgMBgkQaw4EBBG9xE9lRD0hMA8KCv76ArBsOQIDAbxUQTY/JiMPSP2VwW7+If5iU0E4 + Px0cElMAAAMAcwHVAzsF8AADAB4AKQBfQDMoByUEHxIYEALjAB/dEADhJd0FChnfGN4V3Qrg + HJEqABgNHxAiBgIBKBEGawRsGCJrDSoQ3OzM/OwyMsDAERI5ORESOTEAEPTk/PTsEMTu7dbu + EO4REjkSORE5OTATIRUhAREjNQYGIyImNTQ2MzM1NCYjIgYHNTY2MzIWBSIGFRQWMzI2NTWL + ArD9UAKulSyQXYCYv7y2dXU+iERJkUW3s/7soX5iUmiCAlB7Arj+QHA/RIdxh4oEW1siIn8c + HLDwQ09ATZByHQADAGAB1QNkBfAAAwAPABsALkAZAuMA4RbdCuAQ3QSRHAATDQEZawdsE2sN + HBDc7PzsORESOTEAEPTs9Oz87DATIRUhATIWFRQGIyImNTQ2FyIGFRQWMzI2NTQmiwKw/VAB + WLPOzrOz0NCzaX5/aGl9fAJQewQb3b+/29y+v91zoYiFoKCFiaAAAQBOAAAFzwXnAB8AQEAi + CeUZkRIPAwMA5RABESAWEw8MHwYCAQACbQYcHA9tDBwWIBDU7OzU7OzAwBESORESORESOTEA + LzzsFzL07DAlFSE1NhI1NAAjIgAVFBIXFSE1ISYCNRAAISAAERQCBwXP/aixxv742Nj+98ey + /agBP56RAX8BMQEvAYGOobKysmEBTMrwASL+3e/K/rRhsrKLASq4AT4Biv53/svC/tiNAAAD + AHv/4wdvBHsABgAzAD4BA0BDJy0lPQ4NADSpJRaGFYgSAKkOOhK5HBkuhi26KgO5DrsHMQq4 + HxmMJT80NyYGDwAlNxwHJg8VAAgNPSYIDy03CCJFPxD87MzU/DzU7MQREjk5ETkREjkREjkx + ABDE5DL0PMTk/Dz07BDE7jIQ7hD07hDuETkRORESOTBAgTArMCwwLTAuMC8wMEArQCxALUAu + QC9AMFArUCxQLVAuUC9QMIUrhTCAQJBAoECwQMBA0EDgQOBA8EAdPwA/Bj8NPw4/DwUwLDAt + MC4wL0AsQC1ALkAvUCxQLVAuUC9vAG8Gbw1vDm8PYCxgLWAuYC9wLHAtcC5wL4AsgC2ALoAv + HV1xAV0BLgEjIgYHAz4BMzIAHQEhHgEzMjY3FQ4BIyImJw4BIyImNTQ2MyE1NCYjIgYHNT4B + MzIWAyIGFRQWMzI2PQEGtgGliZm5DkRK1ITiAQj8sgzMt2jIZGTQaqf4TUnYj73S/fsBAqeX + YLZUZb5ajtXv36yBb5m5ApSXtK6eATBaXv7d+lq/yDU1rioseXd4eLuovcASf4suLqonJ2D+ + GGZ7YnPZtCkAAwBI/6IEnAS8AAkAEwArAORAPCssJh8dGhMKAQAEDSkmIBQNBComHhoEuSYN + uRq4JowsKywqFBcQIB4jEwoBAAQQBx8dBxIjUSkQEhdFLBD87DL07DLAERIXORI5ORESOTkR + OTEAEOT07BDuEMAQwBESOTkSORIXORE5ORESOTBAcCgBPy1ZFFYcVR1WIGoVZiF/AHsEfwV/ + Bn8Hfwh/CX8Kfwt/DHsNehV7Gn8bfxx/HX8efx9/IHshfyJ/I38kfyV7JpsZlSWoGaAt8C0m + WQBWE1UdWihpAGYTZRxqKHoAdBN2HHooiR6VGJokohitJBFdAV0JAR4BMzI2NTQmJy4BIyIG + FRQWFwcuATUQADMyFhc3FwceARUQACMiJicHJwOJ/hkpZ0GTrBRcKmc+l6kTFH02NgER8V2f + Q4tfkjU2/u7wYKE/i2ADIf2wKijoyE91mikp69NIbi6XTcV3ARQBODM0qE+zTcZ4/u3+xzQz + qE4AAgCP/+MDrAXVACAAJACGQC8gGgUCBAYZABCGD4gMACGDIwyVE4wjgSUGIhkWCQUBABoi + CQAcASIcISYPCRwWJRDc7NT87NTsERI5ERI5ERI5EjkxABDk9OwQ/s0Q9O4SOTkXOTABS7AQ + VEuwElRbS7ATVFtYvQAl/8AAAQAlACUAQDgRNzhZQAt0BHQFdAZ0B3YcBV0BMxUUBg8BDgEV + FBYzMjY3FQ4BIyImNTQ2PwE+ATc+ATUTIzUzAfS+N1paOjODbU60YF7AZ7jgSVlYMCYIBwbE + ysoERJxlgldYNV4xWW5GQ7w5OMKfTIlWVi81GRU8NgEO/gACATUAAAIABdUAAwAJAGJADwcA + gwKBBAgHBAADBQEAChD8POwyOTkxAC/0/MwwAUuwC1RYvQAKAEAAAQAKAAr/wDgRNzhZAUuw + D1RLsBBUW0uwE1RbWL0ACv/AAAEACgAKAEA4ETc4WbYACyALUAsDXQEjNTMRIxETMxMCAMvL + yxWiFATX/vorAo8BZf6bAAABANkBHwXbA14ABQAXQAoEnAIABgMXAQAGENzU7DEAENTE7DAT + IREjESHZBQKo+6YDXv3BAZUAAAEAPf/XBRkGfQAKACpAGAoJCAcGBQsCBAIACwoJBwYFBAMA + CAEICxDUzBc5MQAQ1MzEERIXOTABMxUjASMBByclAQRcvXP9rkL+wX0ZARsBAAZ9YPm6A3Mt + UGL9OwABAB/+VgUCBhQAIwCKQEAODQIPDBEZHhkLCgkIBAcRHh4ZQhkMEwoHHgEaCqkIE4oS + 5hapDwGKAOYEqSGXDxwIJB4dGxoZDAsJCAcKABIkENTMFzkxABDEMsT87PTsEO727hDuMhI5 + ORESOTkwS1NYBxAF7RcyBxAF7REXOVkiAUuwDFRYvQAk/8AAAQAkACQAQDgRNzhZARUuASMi + BgcDIRUhAwIGIyImJzUeATMyNjcTIzUhEz4BMzIWBQImUCxgchk8AR/+w386vLo6ZC80YS9h + bSKJ+AEXPyTGlzVkBfCkHRx6hP7Jj/2F/uPTFRamISGJpgKtjwFKt8MSAAIA2QEQBdsD9AAd + ADsAP0AfLh85KgAtIhMBEBsMHiqcMTmcIgScGwycEzweAC0PPBDUPMQyMQAQ1OzU7Nz81OzA + ERI5ORESOTkREjk5MAEVBgYjIicmJyYnJiMiBgc1NjYzMhcWFxYXFjMyNhMVBgYjIicmJyYn + JiMiBgc1NjYzMhcWFxYXFjMyNgXbabNhbpIKBwYPm15YrGJps2FukwsFBg+bXlapZ2mzYW6S + CgcGD5teWKxiabNhbpMKBQcPm15WqQJvs05FOwQDAgY9TFSzTkU7BQICBj1LAdqyT0U7BAMC + Bj1MU7JORTsEAgMGPUsAAv/6AAAFYAXBAAIABgA4QA8AAwEDBQQDAgEABQcFBgcQ1MwRFzkx + AC/EzBE5MEAUYwFtAnABeAJ/AnkFdgYHbgB/AAJdAV0JASEBMwEhAqz+XgNE/e/gAkP6mgTu + +8QFD/o/AAIAngCNBCUEIwAGAA0AhkBJA+gEBQQC6AECBQUEAugDAgYABgHoAAAGCugLDAsJ + 6AgJDAwLCegKCQ0HDQjoBwcNQgkCCwTnBwCmDgkMBQIHAwBvBQoHbwxuDhD8/DzU7DIRORES + OTEAEPQ87DI5OTBLU1gHEATtBxAI7QcQCO0HEATtBxAE7QcQCO0HEAjtBxAE7VkiARUBARUB + NRMVAQEVATUEJf7TAS3+KyP+0wEt/isEI7/+9P70vwGiUgGiv/70/vS/AaJSAAACAMEAjQRI + BCMABgANAIZASQzoDQwJCgkL6AoKCQ3oBwgHDOgLDAgIBwXoBgUCAwIE6AMDAgboAAEABegE + BQEBAEIMBQoD5wcApg4MCAEFAAhvCgcBbwMAcA4Q/Dz81DzsEjkREjkxABD0POwyOTkwS1NY + BxAI7QcQBO0HEATtBxAI7QcQCO0HEATtBxAE7QcQCO1ZIhMBFQE1AQElARUBNQEBwQHV/isB + Lf7TAbIB1f4rAS3+0wQj/l5S/l6/AQwBDL/+XlL+Xr8BDAEMAAMA7AAABxQA/gADAAcACwAj + QBEIBACDCgYCBBkFABkBCRkIDBDU/NTs1OwxAC88POwyMjAlMxUjJTMVIyUzFSMDltTUAqnV + 1fqt1dX+/v7+/v4A//8AEAAABWgHawInACQAAAAAAAcBBgC8AXX//wAQAAAFaAdeAicAJAAA + AAAABwEFALwBdf//AHP/4wXZB14CJwAyAAAAAAAHAQUBJwF1AAIAcwAACAwF1QAQABkAO0Af + BZUDEQGVAIEYB5UDrQkYEhAKFQYCHBEABAgVGQ0QGhD87NTExNTsMhI5OTk5MQAv7Owy9Owy + EO4wARUhESEVIREhFSEgABEQACEXIyAAERAAITMH+v0aAsf9OQL4+9f+T/5BAb8BsWeB/r/+ + wAFAAUGBBdWq/kaq/eOqAXwBcAFtAXyq/uH+4P7f/t8AAwBx/+MHwwR7AAYAJwAzAIRAMQcI + ABCGD4gMAKkILgy5FhMoA7kIuyIlH7gZE4w0BgAWIjEJDwAIB0sxEglRKxIcRTQQ/Oz0/PTs + xBESOTkSOTEAEOQy9DzE5OwyEMTuMhDuEPTuERI5MEAlPzVfNXA1nzXPNdA18DUHPwA/Bj8H + Pwg/CQVvAG8GbwdvCG8JBV1xAV0BLgEjIgYHBRUhHgEzMjY3FQ4BIyImJw4BIyIAERAAMzIW + Fz4BMzIAJSIGFRQWMzI2NTQmBwoCpImZuQ4DSPyyDMy3ashiZNBqoPJRR9GM8f7vARHxjNNC + TuiP4gEI+rCUrKuVk6ysApSYs66eNVq+xzQ0riosbm1ubQE5ARMBFAE4b2xrcP7dh+fJyefo + yMfpAAABAAAB6QQAAnkAAwAQtgKpAOkEAQAvxjEAEPzsMBEhFSEEAPwAAnmQAAABAAAB6QgA + AnkAAwAPtQKpAAQBAC/MMQAQ1OwwESEVIQgA+AACeZAAAgCuA+kDbQXVAAUACwAnQBMGAJ4J + A4EMCQoGGQcDBAcAGQEMENz8zNTMEP7UzjEAEPQ87DIwASM1EzMDBSM1EzMDAYHTpIFSAZrT + pIFSA+mtAT/+wa2tAT/+wQACAK4D6QNtBdUABQALACdAEwkDngYAgQwJCgcZBgEDBAEZAAwQ + 3OzUzBDc7tTOMQAQ9DzsMjABMxUDIxMlMxUDIxMBANOkgVIBmtOkgVIF1az+wAFArKz+wAFA + AAEArgPpAdMF1QAFABhACwCeA4EGAwQAGQEGENz81MwxABD07DABIzUTMwMBgdOkgVID6a0B + P/7BAAABALID/gHXBdUABQAYQAsDngCBBgMEAXEABhDc7NTMMQAQ9OwwATMVAyMTAQTTpIFS + BdWY/sEBPwAAAwDZAJYF2wRvAAMABwALAClAFADqAgbqBAIInAQKDAkFAXIEAAgMENzUPPw8 + xDEAENTE/MQQ7hDuMAEzFSMRMxUjASEVIQLf9vb29v36BQL6/gRv9v4S9QJBqgACAAb+IwPu + BnUAAwAHACJAEQIGAAgEBggGBAMCAQAGBQcIENTMFzkxABDUzBE5EjkwCQcB+v5/AYEBgf5/ + AfT+DP4MBYH8z/zHAzkEJfvb+9MELf//AD3+VgR/BhACJwBcAAAAAAAHAI4AXgAA/////AAA + BOcHTgInADwAAAAAAAcBAwBzAXUAAf6J/+MCzQXwAAMAK0ATAA8BAgECDwMAA0ICjACRBAED + BBDUzDEAEOTkMEtTWAcQBe0HEAXtWSIBMwEjAi2g/FygBfD58wAAAgBeAFIEvASyACMALwCD + QEkDCRsVBC0eACccAiEdDBItFAsKAxMPAR0tuRPrD+wnuR3rITAeDAASBCokFDAcFRsqHRMc + GAkDJAsKAQMCJCgCcwZ0KigccxgwENzk7PTk7BIXORI5ORESOTkSOTkREjkREhc5MQAQ1OTs + 9OTsEMAREhc5Ejk5ERI5ORE5ORIXOTABNxcHFhYVFAYHFwcnBgYjIiYnByc3JiY1NDY3JzcX + NjYzMhYTNCYjIgYVFBYzMjYDe89yziUkJijRcs87dD06eD3Pcc8lJSYmz3PPN3RAPHVcm3Jw + np1xcZwD4dFzzjt3Pj9zOc9xzygmJSXPc84+djpAdDjOc88nJST+fHCamnBynJ0AAAEAngCN + AnMEIwAGAEdAJQPoBAUEAugBAgUFBALoAwIGAAYB6AAGQgIE5wCmBwIDAG8FbgcQ/OwyOTEA + EPTsOTBLU1gHBO0HEAjtBxAI7QcQBO1ZIgEVAQEVATUCc/7TAS3+KwQjv/70/vS/AaJSAAAB + AMEAjQKWBCMABgBJQCYF6AYFAgMCBOgDAwIG6AABAAXoBAUBAQBCBQPnAKYHBQFvAwBwBxD8 + POw5MQAQ9Ow5MEtTWAcQCO0HEATtBxAE7QcQCO1ZIhMBFQE1AQHBAdX+KwEt/tMEI/5eUv5e + vwEMAQwAAAIALwAABEoGFAAVABkAm0AoCxQYBwOpABCHDhi+FrEOlwkAvAUBEQ4PBBYCCAAP + FAQICBcACgZMGhD8PMQyxPw8xBDuMhESOTkxAC885jLu/u4Q7hDuMhI5OTABS7AKVFi9ABr/ + wAABABoAGgBAOBE3OFkBS7AOVFi9ABoAQAABABoAGv/AOBE3OFlAGhAWEBcQGBAZBDAbUBuA + D4AQgBugG9Ab7xsIXQBdAREjESERIxEjNTM1NDY7ARUjIgYdAQEzFSMESrn+B7mwsK2zubBj + TQH5ubkEYPugA9H8LwPRj063r5lQaGMBsukAAQAvAAAESgYUABUAhEAhCBMEDwupCQSHAJcR + CbwNAgUACggDCAEKDAgIEAESDkwWEPw8xMT8PMQQ7hESOTkxAC885jL+7hDuMhI5OTABS7AK + VFi9ABb/wAABABYAFgBAOBE3OFkBS7AOVFi9ABYAQAABABYAFv/AOBE3OFlAETAXUBeACoAL + gBegF9AX7xcIXQEhESMRISIGHQEhFSERIxEjNTM1NDYCSgIAuf63Y00BL/7RubCwrgYU+ewF + e1BoY4/8LwPRj067qwAAAQA5/zsDxwXVABMAPkAgEga5ABAIuQoEAAIOCgyBAsIUDwBZEQ0B + VwkFWQsHAxQQ1Dw87DL8PDzsMjEAEOT0xDIQxDIQ7jIQ7jIwJSERIxEhNSERITUhETMRIRUh + ESEDx/6RsP6RAW/+kQFvsAFv/pEBb9/+XAGkmgIfmQGk/lyZ/eEAAQDbAkgBrgNGAAMAErcC + gwAEARkABBDU7DEAENTsMBMzFSPb09MDRv4AAQCu/xIB0wD+AAUAGEALA54AgwYDBAEZAAYQ + 1OzUzDEAEPzsMCUzFQMjEwEA06SBUv6s/sABQAACAK7/EgNtAP4ABQALACdAEwkDngYAgwwD + BAEZAAcJCgcZBgwQ3OzUzBDc7tTOMQAQ/DzsMjAlMxUDIxMlMxUDIxMCmtOkgVL+ZtOkgVL+ + rP7AAUCsrP7AAUAAAAcAcf/jCkwF8AALABcAIwAnADMAPwBLAK5ARCQPJSYlJg8nJCdCQACS + DC6SHo0okhhGBpI0DI06JhKMJBiRTCVJQycxK0MNPQkNDw4DDRUxDRs9DkkNFTcrDRsOIQtM + EPzk7NTE7OQQ7hDu9u4Q7hESORESOTEAEOQy9Dw85DLsMhDu9u4Q7jIwS1NYBxAF7QcQBe1Z + IgFLsBRUS7AJVFtLsAtUW0uwDFRbS7ANVFtLsA5UW1i9AEwAQAABAEwATP/AOBE3OFkBIgYV + FBYzMjY1NCYnMhYVFAYjIiY1NDYBMhYVFAYjIiY1NDYhMwEjEyIGFRQWMzI2NTQmATIWFRQG + IyImNTQ2FyIGFRQWMzI2NTQmCPRXZGRXVWNjVZ66u52gurv5dJ68u5+fuboEJaD8WqAfVmNi + V1djZAOynrq7naC6u59XY2NXVWNjApGUhIKVlYKDlX/cu7vb27u82wLg27u92tu8utz58wWO + lYKElJSEgZb9n9y7u9vbu7zbf5SEgpWVgoOVAP//ABAAAAVoB20CJwAkAAAAAAAHAQcAvAF1 + //8AyQAABIsHbQInACgAAAAAAAcBBwCeAXX//wAQAAAFaAdrAicAJAAAAAAABwEEALwBdf// + AMkAAASLB04CJwAoAAAAAAAHAQMAngF1//8AyQAABIsHawInACgAAAAAAAcBBgCeAXX//wCi + AAACHwdrAicALAAAAAAABwEE/y8Bdf////4AAAJgB20CJwAsAAAAAAAHAQf/LwF1//8ABgAA + AlgHTgInACwAAAAAAAcBA/8vAXX//wA7AAABugdrAicALAAAAAAABwEG/y8Bdf//AHP/4wXZ + B2sCJwAyAAAAAAAHAQQBJwF1//8Ac//jBdkHbQInADIAAAAAAAcBBwEnAXX//wBz/+MF2Qdr + AicAMgAAAAAABwEGAScBdf//ALL/4wUpB2sCJwA4AAAAAAAHAQQA7gF1//8Asv/jBSkHbQIn + ADgAAAAAAAcBBwDuAXX//wCy/+MFKQdrAicAOAAAAAAABwEGAO4BdQABAMEAAAF5BGAAAwAg + twC/AgEIAEYEEPzsMQAv7DBACxAFQAVQBWAFcAUFAV0TMxEjwbi4BGD7oAAAAQDBBO4DPwZm + AAYAN0AMBAUCtACzBwQCdQYHENzsOTEAEPTsMjkwAEuwCVRLsA5UW1i9AAf/wAABAAcABwBA + OBE3OFkBMxMjJwcjAbaU9Yu0tIsGZv6I9fUAAQC2BR0DSgY3ABsAY0AkABIHDgsEARIHDwsE + EsMZBwTDFQvtHA8BDgAHFVYWdwdWCHYcEPTs/OwROTk5OTEAEPw8/NQ87BESORESORESORES + OTAAS7AJVEuwDFRbWL0AHP/AAAEAHAAcAEA4ETc4WQEnLgEjIgYHIz4BMzIWHwEeATMyNjcz + DgEjIiYB/DkWIQ0mJAJ9AmZbJkAlORYhDSYkAn0CZlsmQAVaNxQTSVKHkxwhNxQTSVKHkxwA + AAEA1QViAysF9gADAC+3Au8A7gQBAAQQ1MwxABD87DAAS7AJVEuwDlRbWL0ABP/AAAEABAAE + AEA4ETc4WRMhFSHVAlb9qgX2lAAAAQDHBSkDOQZIAA0AV0AOC/AEBwCzDgdWCAFWAA4Q3OzU + 7DEAEPQ81OwwAEuwCVRYvQAO/8AAAQAOAA4AQDgRNzhZAEuwD1RLsBBUW0uwEVRbWL0ADgBA + AAEADgAO/8A4ETc4WRMzHgEzMjY3Mw4BIyImx3YLYVdWYA12Cp6RkZ4GSEtLSkyPkJAAAQGa + BUQCZgYQAAMALEAJAs4AzQQBZAAEENTsMQAQ/OwwAEuwCVRYvQAE/8AAAQAEAAQAQDgRNzhZ + ATMVIwGazMwGEMwAAAIA7gThAxIHBgALABcAX0ARA8EV8gnBD/EYAFYMeAZWEhgQ1Oz07DEA + EPTs9OwwAEuwCVRLsAxUW1i9ABj/wAABABgAGABAOBE3OFkBS7AKVEuwC1RbS7AMVFtYvQAY + /8AAAQAYABgAQDgRNzhZATQmIyIGFRQWMzI2NxQGIyImNTQ2MzIWAphYQEFXV0FAWHqfc3Of + n3NznwX0P1hXQEFXWEBzoKBzc5+fAAABASP+dQLBAAAAEwAfQA4JBgoN8wYAEwAQJwMJFBDc + 1OzUzDEAL9T8xBI5MCEWFhUUBiMiJic1FhYzMjY1NCYnAlQ3Nnh2LlcrIkovOzwrLT5pMFlb + DAyDEQ8wLh5XPQACAPAE7gOuBmYAAwAHAEJAEQYCtAQAswgEBwMABQEDBQcIENTc1MwRORES + OTEAEPQ87DIwAEuwCVRLsA5UW1i9AAj/wAABAAgACABAOBE3OFkBMwMjAzMDIwL8sviHgarf + iQZm/ogBeP6IAAABAUz+dQLBAAAAEwAgQA8LDgoH8w70AAEACgQnERQQ1OzE1MwxAC/8/MQS + OTAhMwYGFRQWMzI2NxUGBiMiJjU0NgG4dy0rNzYgPh8mRB56czU9WB8uLg8PhQoKV10waQAB + AMEE7gM/BmYABgA3QAwDALQEAbMHAwV1AQcQ3Ow5MQAQ9DzsOTAAS7AJVEuwDlRbWL0AB//A + AAEABwAHAEA4ETc4WQEDMxc3MwMBtvWLtLSL9QTuAXj19f6IAAH/8gAABHUF1QANAD9AHgwL + CgQDAgYABpUAgQgDBAELDgAEBQEcDAc6CQB5DhD0POzE/DzEERI5ERI5MQAv5OwRFzkwtDAP + UA8CAV0TMxElFwERIRUhEQcnN9PLATlQ/ncC1/xelE3hBdX9mNtv/u7946oCO2pungAAAQAC + AAACSAYUAAsAXkAaCgkIBAMCBgCXBgMEAQkKAAR6BQEICnoHAAwQ1Dzk/DzkERI5ERI5MQAv + 7Bc5MAFLsBBUWL0ADABAAAEADAAM/8A4ETc4WUATEA1ADVANYA1zBHoKcA3gDfANCV0TMxE3 + FwcRIxEHJzfHuH1Mybh7SsUGFP2mWmqN/OMCmlhqjQD//wCH/+MEogdtAicANgAAAAAABwEI + AIsBdf//AG//4wPHBmYCJwBWAAAAAAAHAOAAFwAA//8AXAAABR8HbQInAD0AAAAAAAcBCAC+ + AXX//wBYAAAD2wZmAicAXQAAAAAABwDgABsAAAACAQT+ogGuBZgAAwAHABxADQH1AAT1BQgE + AAUGAggQ3DzsMjEAENTs1OwwAREjERMRIxEBrqqqqgGY/QoC9gQA/QoC9gAAAgAKAAAFugXV + AAwAGQBnQCAQCakLDZUAgRKVDgsHBwEZEwQPDRYZBDIKEQ0cCAB5GhD0POwyxPTsEMQXOTEA + L8Yy7vbuEO4yMEAoIBt/G7AbA58JnwqfC58Mnw6fD58QnxG/Cb8Kvwu/DL8Ovw+/EL8REF0B + XRMhIAAREAApAREjNTMTESEVIREzIAAREAAh0wGgAbEBlv5p/lD+YMnJywFQ/rDzATUBH/7h + /ssF1f6X/oD+fv6WAryQAeP+HZD96gEYAS4BLAEXAAIAcf/jBHUGFAAOACgBJ0BeJXsmJR4j + HiR7IyMeD3sjHih7JygeIx4mJygnJSQlKCgnIiMiHyAfISAgH0IoJyYlIiEgHwgjHgMPIwO5 + Gwm5FYwbI7EpJicSDCEgGCglIyIfBR4PBgwSElEGEhhFKRD87PTsETk5FzkSOTkREjk5MQAQ + 7MT07BDuEjkSORIXOTBLU1gHEA7JBxAIyQcQCMkHEA7JBxAI7QcO7QcQBe0HEAjtWSKyPyoB + AV1AdhYlKx8oIi8jLyQpJS0mLScqKDYlRiVYIFghYCBgIWYidSB1IXUiEyUjJSQmJiYnJyg2 + JDYlRiRFJVogWiFiIGIhfwB/AX8CegN7CX8Kfwt/DH8Nfw5/D38QfxF/En8TfxR7FXobehx/ + HX8ediB2IXgioCrwKiddAF0BLgEjIgYVFBYzMjY1NCYTFhIVFAAjIgA1NAAzMhYXJwUnJScz + FyUXBQNGMlgpp7mukpGuNgl+cv7k5uf+5QEU3RI0Kp/+wSEBGbXkfwFNIf7ZA5MRENjDvN7e + vHq8ASaP/uCt//7JATf/+gE3BQW0a2NczJFvYWIA/////AAABOcHawInADwAAAAAAAcBBABz + AXX//wA9/lYEfwZmAicAXAAAAAAABwCNAF4AAAACAMkAAASNBdUADAAVAD1AGw6VCQ2VAvYA + gQsVDwkDBAESGQY/DQoBHAAEFhD87DIy/OwRFzkxAC/0/OzU7DBACQ8XHxc/F18XBAFdEzMR + MzIEFRQEKwERIxMRMzI2NTQmI8nK/vsBAf7/+/7Kyv6NmpmOBdX++OHc3OL+rgQn/dGShoaR + AAIAuv5WBKQGFAAQABwAPkAbFLkFCBq5AA6MCLgBvQOXHRESC0cXBAAIAkYdEPzsMjL07DEA + EOzk5PTE7BDG7jBACWAegB6gHuAeBAFdJREjETMRPgEzMhIREAIjIiYBNCYjIgYVFBYzMjYB + c7m5OrF7zP//zHuxAjinkpKnp5KSp6j9rge+/aJkYf68/vj++P68YQHry+fny8vn5wAAAQDZ + Ai0F2wLXAAMAEbYAnAIEAQAEENTEMQAQ1OwwEyEVIdkFAvr+AteqAAABARkAPwWcBMUACwCF + QE0KnAsKBwgHCZwICAcEnAMEBwcGBZwGBwYEnAUEAQIBA5wCAgELnAABAAqcCQoBAQBCCggH + BgQCAQAIBQMLCQwLCgkHBQQDAQgCAAgGDBDUPMwyFzkxABDUPMwyFzkwS1NYBxAI7QcQBe0H + EAXtBxAI7QcQBe0HEAjtBxAF7QcQCO1ZIgkCBwEBJwEBNwEBBZz+NwHJd/41/jV2Acj+OHYB + ywHLBEz+Nf43eQHL/jV5AckBy3n+NQHLAAEAiQKcAsUF3wAKACxAGAcA3QkD3QQC3Qn3BZEL + CHwGXQN8AXwACxDc9OT85DEAEPTs7NTsEO4yMBMzEQc1NzMRMxUhnMzf5onN/dcDCgJjKXQn + /StuAAABAF4CnAK0BfAAGABKQCQAfQYEABd9BgYEQgQCAA7dDwDdAvcL3Q8SkRkADgh+ARUO + AxkQ3MTUxOwROTEAEPTE7PzsEO4REjkwS1NYBxAF7RcyBwXtWSIBIRUhNTY3ADU0JiMiBgc1 + NjYzMhYVFAEGAQwBqP2qIj8BWGhVNHpITYU5ka7+tTgDDnJuHzgBMV5CUSMjexwchGyL/uQw + AAEAYgKNAs0F8AAoAEhAJwAVEwrdCR/dIBPdFQ3dCfgG9xzdIPgjkSkWEwAUGX4mEH4DFB8J + KRDcxMTU7NTsETk5OTEAEPTk7Pzk7NTsEO4Q7hESOTABFhYVFAYjIiYnNRYWMzI2NTQmIyM1 + MzI2NTQmIyIGBzU2NjMyFhUUBgIMXGW+sTl9RjR3Q214b2xWXl5hZF8oZlFJgDeQqVoEYBJt + UnyGFRR5GxpPRkpMbD88Oj0SF3MREnZjRWD//wCJ/+MHfwXwACcA8AAAAAAAJwC8AzUAAAAH + AQkEi/1k//8Aif/jBz8F8AAnAPAAAAAAACcAvAM1AAAABwDxBIv9ZP//AGL/4wd/BfAAJwDy + AAAAAAAnALwDNQAAAAcBCQSL/WT//wBz/+MFiwdtAicAKgAAAAAABwEKARsBdf//AHH+VgRa + BkgCJwBKAAAAAAAHANoAiwAA//8AyQAAAZUHUAInACwAAAAAAAcBC/8vAXX//wCH/nUEogXw + AicANgAAAAAABwDdAIsAAP//AG/+dQPHBHsCJwBWAAAAAAAHAN0AFwAA//8Ac//jBScHawIn + ACYAAAAAAAcBBAEtAXX//wBx/+MD5wZmAicARgAAAAAABwCNAIkAAP//AHP/4wUnB20CJwAm + AAAAAAAHAQgBLQF1//8Acf/jA+cGZgInAEYAAAAAAAcA4ACJAAAAAgBx/+ME9AYUABgAJABK + QCQHA9MJAfkiuQAWHLkNEIwWuAWXCwIfDAQDAAgICgZHGRITRSUQ/Oz0PMT8FzzEMQAv7OT0 + xOwQxO79PO4yMLZgJoAmoCYDAV0BESE1ITUzFTMVIxEjNQ4BIyICERASMzIWARQWMzI2NTQm + IyIGA6L+ugFGuJqauDqxfMv//8t8sf3Hp5KSqKiSkqcDtgFOfZOTffr8qGRhAUQBCAEIAURh + /hXL5+fLy+fnAAABAGQB3wJ/AoMAAwARtgCcAgQBAAQQ3MwxABDU7DATIRUhZAIb/eUCg6QA + AAEA2wJIAa4DRgADABK3AoMABAEZAAQQ1OwxABDU7DATMxUj29PTA0b+AAEAAP/jBI8F8AAx + ARxAOiAS0yIQKwfTCRmhGq4WlR0BoQCuBJUvkR2MKQkyKyIhKSMmEhAKAw0JEQgsICYTBxEI + EQ0cGQAmKiEvPNTEMvzExBI5ORI5ORESOREXORI5ORE5OTEAEMQy5PTs9OwQ7vbuEO4y3Tzu + MjABS7AJVEuwDFRbS7ANVFtLsA9UW0uwF1RbS7AYVFtYvQAy/8AAAQAyADIAQDgRNzhZQHoO + AA4BCwILMVQUaQxsDm4PbxBvEW8SbxNpFGsfbyBvIW8ibyNuJGwlaSdpLZ8HnwifCZ8Knwuf + DJ8Nnw6fD58QnxGfEp8Tlh+fIJ8hnyKfI58knyWfJp8nnyifKZ8qnyufLJ0tMgAIAAkQCBAJ + IAggCVUVUx5qFWcfCl0AXQEVLgEjIgYHIQchDgEVFBYXIQchHgEzMjY3FQ4BIyIAAyM3MzQm + NTQ2NSM3MxIAMzIWBI9bqWadyiACQTf95gIBAQIBvjj+iiDKnWapW1m5YO3+yyjTN4sBAcI3 + nCgBNuxiuQVi1WlayLt7GC4jIC4Ye7vKWmnTSEgBIgEDexcvICMvF3sBAQEiRwACANcFDgMp + BdkAAwAHAKVADQQAzgYCCAFkAAVkBAgQ1Pzc7DEAENQ87DIwAEuwDlRLsBFUW1i9AAgAQAAB + AAgACP/AOBE3OFkBS7AOVEuwDVRbS7AXVFtYvQAI/8AAAQAIAAgAQDgRNzhZAUuwEVRLsBlU + W1i9AAgAQAABAAgACP/AOBE3OFkAS7AYVFi9AAj/wAABAAgACABAOBE3OFlAEWABYAJgBWAG + cAFwAnAFcAYIAV0BMxUjJTMVIwJey8v+ecvLBdnLy8sAAQFzBO4C8AX2AAMAf0ARAgMAAwEA + AANCAAL6BAEDAwQQxBDAMQAQ9MwwS1NYBxAFyQcQBclZIgBLsAxUWL0ABP/AAAEABAAEAEA4 + ETc4WQBLsA5UWL0ABABAAAEABAAE/8A4ETc4WUAgBgIVAiUBJQI2AkYCVgJqAWcCCQ8ADwEf + AB8BLwAvAQZdAV0BMwMjAje55JkF9v74AAEAtgUOA0oF6QAdAHVAIRYQDwMTDAcBAAMIFwzD + BBPDGwj6HhABDwAHFlYYB1YJHhDU7NTsETk5OTkxABD0POzU7DISFzkREhc5MABLsAxUWL0A + Hv/AAAEAHgAeAEA4ETc4WQBLsA5UWL0AHgBAAAEAHgAe/8A4ETc4WbQQCx8aAl0BJy4BIyIG + HQEjNDYzMhYfAR4BMzI2PQEzDgEjIiYB/DkZHwwkKH1nViQ9MDkXIg8gKH0CZ1QiOwU5IQ4L + Mi0GZXYQGx4NDDMpBmR3EAABAQwE7gKLBfYAAwCJQBEBAgMCAAMDAkIAAfoEAQMDBBDEEMAx + ABD0zDBLU1gHEAXJBxAFyVkiAEuwDFRYvQAE/8AAAQAEAAQAQDgRNzhZAEuwDlRYvQAEAEAA + AQAEAAT/wDgRNzhZQCoGAAYBFgASASQAJAE1AUMBVQBVAZ8AnwGvAK8BDg8ADwMfAB8DLwAv + AwZdAV0BEyMDAcfEmeYF9v74AQgAAQDPBO4DMQX4AAYAd0AKBAAFAvoHBAIGBxDUxDkxABD0 + PMQ5MABLsAxUWL0AB//AAAEABwAHAEA4ETc4WQBLsA5UWL0ABwBAAAEABwAH/8A4ETc4WQFL + sA5UWL0AB//AAAEABwAHAEA4ETc4WUATDwAPAQwEHwAfAR0ELwAvAS0ECQBdATMTIycHIwGi + vNOLpqaLBfj+9rKyAAEAzwTuAzEF+AAGAIZACgMEAQD6BwMFAQcQ1MQ5MQAQ9MQyOTAAS7AM + VEuwCVRbS7AKVFtLsAtUW1i9AAf/wAABAAcABwBAOBE3OFkAS7AOVFi9AAcAQAABAAcAB//A + OBE3OFkBS7AOVFi9AAf/wAABAAcABwBAOBE3OFlAEwAAAwMABhAAEgMQBiAAIgMgBgkAXQED + Mxc3MwMBotOLpqaL0wTuAQqysv72AAACAD8CnAL0Bd8AAgANANRAFgADCwfdBQEJ9wORDgEM + CgBdBggEDA4Q3NQ8xOwyETkxABD0/NQ87DISOTABS7AOVEuwD1RbS7AQVFtLsBFUW0uwC1Rb + S7AKVFtYvQAOAEAAAQAOAA7/wDgRNzhZAEuwEVRLsA5UW1i9AA7/wAABAA4ADgBAOBE3OFlA + VAsBHQEvATkBSQFGA1kDaQOLA6sDuwMLAQAPAQ8CDwUPBg8HDwgPCw8MDw0TAB8BHwIfBR8G + HwcfCB8LHwwfDSIANQBHAEsNUwBbDWUAhAClALUAHl0BXQkBIQMzETMVIxUjNSE1Ad3+ywE1 + FqaHh5D+YgVm/l0CHP3kbbq6eQAAAQDHBQYDOQX4AA0AakAOBwAEwwv6DgdWCAFWAA4Q1OzU + 7DEAEPT8xDIwAEuwDFRYvQAO/8AAAQAOAA4AQDgRNzhZAEuwDlRYvQAOAEAAAQAOAA7/wDgR + NzhZAUuwDlRLsA9UW1i9AA7/wAABAA4ADgBAOBE3OFkTMx4BMzI2NzMOASMiJsd2DWNTUmEQ + dgqgj5CfBfg2OTc4d3t6AAABAZoFDgJmBdsAAwARtgAC+gQBAAQQ1MwxABD0zDABMxUjAZrM + zAXbzQAAAAAAAgABAAAAAAAUAAMAAQAAARoAAAEGAAABAAAAAAAAAAEDAAAAAgAAAAAAAAAA + AAAAAAAAAAEAAAMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIyQlJicoKSorLC0u + LzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2BhAGJj + ZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZ + mpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGx8jJysvMzc7P + 0NEA0tPU1dbX2Nna29zd3t/gAAQCPgAAADoAIAAEABoAfgD/AQcBEQEfATEBQgFTAWEBeAF+ + AZICxwLdA6kDwCAmIDAgOiCsISIiBiIeIisiSCJlJcr7Av//AAAAIACgAQYBDAEeATABQQFS + AV4BeAF9AZICxgLYA6kDwCATIDAgOSCsISIiAiIPIisiSCJgJcr7Af///+MAAP/1AAD/2AAA + /6D/XgAA/0P/aP8UAAAAAPz2/NsAAOCW4IXgVt9qAAAAAN5x3l8AANrvBb8AAQAAADgAAAD0 + AAAA/AAAAAAA+gAAAAAAAAD6APwAAAAAAQIAAAAAAAAAAAEgASgAAAAAAUIAAAAAAAAArACj + AIQAhQC9AJYA5wCGAI4AiwCdAKkApAEAAIoA2QCDAJMA8QDyAI0AlwCIAMMA3QDwAJ4AqgDz + APQA9QCiAK0AyQDHAK4AYgBjAJAAZADLAGUAyADKAM8AzADNAM4A6ABmANIA0ADRAK8AZwDv + AJEA1QDTANQAaADqAOwAiQBqAGkAawBtAGwAbgCgAG8AcQBwAHIAcwB1AHQAdgB3AOkAeAB6 + AHkAewB9AHwAuAChAH8AfgCAAIEA6wDtALoA/QD+AAAAAAAAAP8A+ADWAPkA+gDjAOQA1wDg + ANoA2wDcAN8A2ADeALIAswAAAAAAAAC2ALcAxAAAALQAtQDFAAAAggDCAIcAAAAAAAAAqwCY + AAAAAAAAAKgAmgAAAJkA7gAAAAAAvAAAAAAAAAEBAKUAAAAAAAAAkgCPAAAAAAAAAJQAlQTN + AGYAAAAAAosAAAKLAAADNQE1A64AxQa0AJ4FFwCqB5oAcQY9AIECMwDFAx8AsAMfAKQEAAA9 + BrQA2QKLAJ4C4wBkAosA2wKyAAAFFwCHBRcA4QUXAJYFFwCcBRcAZAUXAJ4FFwCPBRcAqAUX + AIsFFwCBArIA8AKyAJ4GtADZBrQA2Qa0ANkEPwCTCAAAhwV5ABAFfQDJBZYAcwYpAMkFDgDJ + BJoAyQYzAHMGBADJAlwAyQJc/5YFPwDJBHUAyQbnAMkF/ADJBkwAcwTTAMkGTABzBY8AyQUU + AIcE4//6BdsAsgV5ABAH6QBEBXsAPQTj//wFewBcAx8AsAKyAAADHwDHBrQA2QQA/+wEAACq + BOcAewUUALoEZgBxBRQAcQTsAHEC0QAvBRQAcQUSALoCOQDBAjn/2wSiALoCOQDBB8sAugUS + ALoE5QBxBRQAugUUAHEDSgC6BCsAbwMjADcFEgCuBLwAPQaLAFYEvAA7BLwAPQQzAFgFFwEA + ArIBBAUXAQAGtADZBXkAEAV5ABAFlgBzBQ4AyQX8AMkGTABzBdsAsgTnAHsE5wB7BOcAewTn + AHsE5wB7BOcAewRmAHEE7ABxBOwAcQTsAHEE7ABxAjkAkAI5/8cCOf/eAjn/9AUSALoE5QBx + BOUAcQTlAHEE5QBxBOUAcQUSAK4FEgCuBRIArgUSAK4EAAA5BAAAwwUXAKwFFwCBBAAAXAS4 + ATMFFwCeBQoAuggAARsIAAEbCAABJwQAAXMEAADXBrQA2QfLAAgGTABmBqoA3Qa0ANkGtADZ + BrQA2QUXAFIFFwCuBCMAaAVkABkGDgCcBLb/4QQrAC8DxQBzA8UAYAYdAE4H2wB7BOUASAQ/ + AI8DNQE1BrQA2QUZAD0FFwAfBrQA2QVa//oE5QCeBOUAwQgAAOwFFwAABXkAEAV5ABAGTABz + CI8AcwgvAHEEAAAACAAAAAQlAK4EJQCuAosArgKLALIGtADZA/QABgS8AD0E4//8AVb+iQUX + AF4DMwCeAzMAwQUKAC8FCgAvBAAAOQKLANsCiwCuBCUArgq8AHEFeQAQBQ4AyQV5ABAFDgDJ + BQ4AyQJcAKICXP/+AlwABgJcADsGTABzBkwAcwZMAHMF2wCyBdsAsgXbALICOQDBBAAAwQQA + ALYEAADVBAAAxwQAAZoEAADuBAABIwQAAPAEAAFMBAAAwQR///ICRgACBRQAhwQrAG8FewBc + BDMAWAKyAQQGMwAKBOUAcQTj//wEvAA9BNcAyQUUALoGtADZBrQBGQM1AIkDNQBeAzUAYgfB + AIkHwQCJB8EAYgYzAHMFFABxAlwAyQUUAIcEKwBvBZYAcwRmAHEFlgBzBGYAcQUUAHEC4wBk + AosA2wUXAAAEAADXBAABcwQAALYEAAEMBAAAzwQAAM8DNQA/BAAAxwQAAZoAAgAAAAAAAP8r + AI8AAAAAAAAAAAAAAAAAAAAAAAAAAAEMAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAO + AA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAAp + ACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBE + AEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBf + AGAAYQBiAGMAZABlAGYAZwBoAGkAagBrAGwAbQBuAG8AcABxAHIAcwB0AHUAdgB3AHgAeQB6 + AHsAfAB9AH4AfwCAAIEAggCDAIQAhQCGAIcAiACJAIoAiwCMAI0AjgCPAJAAkQCSAJMAlACV + AJYAlwCYAJkAmgCbAJwAnQCeAJ8AoAChAKIAowCkAKUApgCnAKgAqQCqAKsArACtAK4ArwCw + ALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDL + AMwAzQDOAM8A0ADRANMA1ADVANYA1wDYANkA2gDbANwA3QDeAN8A4ADhAOIA4wDkAOUA5gDn + AOgA6QDqAOsA7ADtAO4A7wDwAPEA8gDzAPUA9AD2APgA+QD6APsA/AD9AP4A/wEAAQEBAgED + AQQBBQEGAQcBCAEJAQoBCwEMAQ0Jc2Z0aHlwaGVuDnBlcmlvZGNlbnRlcmVkBEV1cm8FYzY0 + NTkFYzY0NjAFYzY0NjEFYzY0NjIFYzY0NjMFYzY0NjYFYzY0NjcFYzY0NjgFYzY0NjkAAAAA + ACIAIgAiACIAWACTAP8BtgJPA4MDsgP2BCEEbgSYBLQEygTeBQMFRQWCBgUGfgbhB0wHtwf8 + CGUIzwjuCRYJUglzCa4KHwrfC1gLsAv7DDoMaQyTDOYNFA09DXoODQ4vDqwPAA9FD4UP6xB1 + EPERKRFwEeASvROKE+sUUBSLFLEU4RUDFRgVQBXWFiIWbRa5FyMXexffGBsYQxiAGPgZFhl3 + GbMaBBpSGqEa2BuHG8QcABydHboehx93H+ggWyByIPMhNSFCIeIh7yH8IgkiFiIjIjAiPSJK + IlciZCJxIn4iiyKYIqUisiK/Iswi2SLmIvMjACMNIxojJyM0I0EjTiNbI2gjlCPPJDQkjyUz + JVMlgSYUJronSyeQJ7coEyhYKMMpXyolKlwqoyrpK3or0yxELI8ssS1QLaAuDi5SLqovhzBB + ML0xBTEhMVAxzzJIMnoy3zNGM3AzcDN9M4ozlzPmNHo0jzSjNNE0/zUcNTk1ZzWRNZ41qzXP + Nls2kzbNN0M3qTfrOAA4HDhKOQ85HDkpOTY5QzlQOV05ajl3OYQ5kTmeOas5uDnFOdI57zoc + Ons6oDrlOwg7XjuOO8Q79DwiPF88pzy0PME8zjzbPP49Yz47Pkg+VT6YPuc+/T9hP40/3EA6 + QEtAXEBtQHpAh0CUQKFArkC7QMhA1UDiQUBBVkFrQkVCqkL3Q19DskP/RFVE20UqRT8AAAAA + AAEAAC2GAAEHlBgAAAoVeAAQACT/0wAQACX/twAQACYAAAAQACcAAAAQACkAAAAQACoASwAQ + ACsAAAAQAC0AcgAQAC4AAAAQAC8AAAAQADIAOQAQADMAAAAQADQASwAQADUAAAAQADf/RAAQ + ADn/iAAQADr/rQAQADv/mgAQADz/DQAQAD0AAAAQAEkAAAAQAFEAAAAQAFIAJgAQAFUAAAAQ + AFn/yQAQAFoAAAAQAFz/3AAQAGL/0wAQAGQAAAAQAGcAOQAQAHgAAAAQAHkAJgAQAHoAJgAQ + AHsAJgAQAHwAJgAQAH0AJgAQAIkAAAAQAJAAAAAQAK3/0wAQAK7/0wAQAK8AOQAQALr/3AAQ + ALv/DQAQAMf/0wAQAMn/0wAQANAAOQAQANEAOQAQANIAOQAQAOUAAAAQAOkAAAAQAOr/DQAQ + AOv/3AAQAOwAAAAQAPYASwAQAPsAAAAQAP0AAAAkABD/0wAkABH/3AAkAB3/3AAkACQAOQAk + ACb/3AAkACr/3AAkADL/3AAkADT/3AAkADYAAAAkADf/YQAkADgAAAAkADn/fQAkADr/kAAk + ADsAAAAkADz/YQAkAEb/3AAkAEf/3AAkAEj/3AAkAEn/twAkAFL/3AAkAFT/3AAkAFf/3AAk + AFgAAAAkAFn/iAAkAFr/rQAkAFz/dQAkAGIAOQAkAGT/3AAkAGf/3AAkAGgAAAAkAG//3AAk + AHD/3AAkAHH/3AAkAHL/3AAkAHP/3AAkAHn/3AAkAHr/3AAkAHv/3AAkAHz/3AAkAH3/3AAk + AH4AAAAkAH8AAAAkAIAAAAAkAIEAAAAkAKn/twAkAKoAAAAkAK0AOQAkAK4AOQAkAK//3AAk + ALT++AAkALX/AwAkALr/dQAkALv/YQAkAMUALwAkAMcAOQAkAMkAOQAkAND/3AAkANH/3AAk + ANL/3AAkANMAAAAkANQAAAAkANUAAAAkAOMAAAAkAOr/YQAkAOv/dQAkAPb/3AAkAPkAAAAk + APv/3AAkAPz/3AAkAP3/3AAkAP7/3AAlABAAAAAlACb/3AAlACr/3AAlADL/3AAlADb/3AAl + ADn/wQAlADr/twAlADz/kAAlAGT/3AAlAGf/3AAlAKn/wQAlAKr/3AAlAK//3AAlALT/kAAl + ALX/kAAlALv/kAAlAMX/rQAlAND/3AAlANH/3AAlANL/3AAlAOP/3AAlAOr/kAAlAPb/3AAl + APn/3AAlAPv/3AAlAP3/3AAmABAAAAAmACQAAAAmADYAAAAmADz/3AAmAGIAAAAmAKn/3AAm + AKr/3AAmAK0AAAAmAK4AAAAmALQAAAAmALUAJgAmALv/3AAmAMUAAAAmAMcAAAAmAMkAAAAm + AOMAAAAmAOr/3AAmAPkAAAAnABAAAAAnACT/3AAnADn/3AAnADoAAAAnADz/kAAnAGL/3AAn + AKn/3AAnAKr/3AAnAK3/3AAnAK7/3AAnALT/0wAnALX/yQAnALv/kAAnAMX/RAAnAMf/3AAn + AMn/3AAnAOr/kAApABAAAAApABH+twApAB3/YQApACT/RAApADb/3AApADf/3AApAET/RAAp + AEj/kAApAEz/awApAFL/twApAFX/awApAFj/kAApAFz/RAApAGL/RAApAGn/RAApAGr/RAAp + AGv/RAApAGz/RAApAG3/RAApAG7/RAApAHD/kAApAHH/kAApAHL/kAApAHP/kAApAHn/twAp + AHr/twApAHv/twApAHz/twApAH3/twApAH7/kAApAH//kAApAID/kAApAIH/kAApAKkAAAAp + AKoAAAApAK3/RAApAK7/RAApALT/0wApALUAAAApALr/RAApAMX+iAApAMf/RAApAMn/RAAp + AOP/3AApAOv/RAApAPn/3AAqABAAAAAqACQAAAAqADf/twAqADoAAAAqADz/mgAqAGIAAAAq + AKn/3AAqAKr/3AAqAK0AAAAqAK4AAAAqALT/0wAqALX/0wAqALv/mgAqAMX/yQAqAMcAAAAq + AMkAAAAqAOr/mgArABAAAAArABH/3AArAB0AAAArAKkAAAArAKoAAAArALT/twArALX/wQAr + AMX/twAtABD/twAtACT/3AAtAGL/3AAtAKn/3AAtAKr/3AAtAK3/3AAtAK7/3AAtALT/twAt + ALX/wQAtAMX/kAAtAMf/3AAtAMn/3AAuABD/KQAuACT/3AAuACb/kAAuADL/kAAuADf/YQAu + ADj/yQAuADr/twAuADz/twAuAET/3AAuAEj/mgAuAFL/mgAuAFj/mgAuAFz/awAuAGL/3AAu + AGT/kAAuAGf/kAAuAGj/yQAuAGn/3AAuAGr/3AAuAGv/3AAuAGz/3AAuAG3/3AAuAG7/3AAu + AHD/mgAuAHH/mgAuAHL/mgAuAHP/mgAuAHn/mgAuAHr/mgAuAHv/mgAuAHz/mgAuAH3/mgAu + AH7/mgAuAH//mgAuAID/mgAuAIH/mgAuAKn/fQAuAKoAAAAuAK3/3AAuAK7/3AAuAK//kAAu + ALT/wQAuALX/wQAuALr/awAuALv/twAuAMUAAAAuAMf/3AAuAMn/3AAuAND/kAAuANH/kAAu + ANL/kAAuANP/yQAuANT/yQAuANX/yQAuAOr/twAuAOv/awAuAPv/kAAuAP3/kAAvABD/3AAv + ACQALwAvADL/twAvADf+5gAvADj/mgAvADn/HwAvADr/RAAvADz+8AAvAEQAAAAvAEj/3AAv + AFL/3AAvAFj/3AAvAFz/RAAvAGIALwAvAGf/twAvAGj/mgAvAGkAAAAvAGoAAAAvAGsAAAAv + AGwAAAAvAG0AAAAvAG4AAAAvAHD/3AAvAHH/3AAvAHL/3AAvAHP/3AAvAHn/3AAvAHr/3AAv + AHv/3AAvAHz/3AAvAH3/3AAvAH7/3AAvAH//3AAvAID/3AAvAIH/3AAvAKkAAAAvAKoAAAAv + AK0ALwAvAK4ALwAvAK//twAvALT+YQAvALX95gAvALr/RAAvALv+8AAvAMUAAAAvAMcALwAv + AMkALwAvAND/twAvANH/twAvANL/twAvANP/mgAvANT/mgAvANX/mgAvAOr+8AAvAOv/RAAy + ABAAOQAyABH/rQAyAB3/3AAyACT/3AAyADn/3AAyADv/fQAyADz/kAAyAGL/3AAyAKn/3AAy + AKoAAAAyAK3/3AAyAK7/3AAyALT/0wAyALX/3AAyALv/kAAyAMX/RAAyAMf/3AAyAMn/3AAy + AOr/kAAzABD/0wAzABH+wQAzAB0AAAAzACT/fQAzADgAAAAzADoAAAAzADz/0wAzAET/pAAz + AEj/twAzAEz/0wAzAFH/3AAzAFL/twAzAFX/3AAzAFb/3AAzAFj/3AAzAFwAAAAzAGL/fQAz + AGgAAAAzAGn/pAAzAGr/pAAzAGv/pAAzAGz/pAAzAG3/pAAzAG7/pAAzAHD/twAzAHH/twAz + AHL/twAzAHP/twAzAHj/3AAzAHn/twAzAHr/twAzAHv/twAzAHz/twAzAH3/twAzAH7/3AAz + AH//3AAzAID/3AAzAIH/3AAzAKn/3AAzAKoAAAAzAK3/fQAzAK7/fQAzALQAJgAzALUAJgAz + ALoAAAAzALv/0wAzAMX+twAzAMf/fQAzAMn/fQAzANMAAAAzANQAAAAzANUAAAAzAOT/3AAz + AOr/0wAzAOsAAAAzAPr/3AA0ABAAOQA0AKkAAAA0AKoAAAA0ALT/0wA0ALX/3AA0AMX/fQA1 + ABD/rQA1ABH/twA1AB3/wQA1ACT/rQA1ACb/mgA1ADf/awA1ADn/kAA1ADr/rQA1ADz/fQA1 + AET/0wA1AEj/pAA1AFL/pAA1AFj/pAA1AFz/kAA1AGL/rQA1AGT/mgA1AGn/0wA1AGr/0wA1 + AGv/0wA1AGz/0wA1AG3/0wA1AG7/0wA1AHD/pAA1AHH/pAA1AHL/pAA1AHP/pAA1AHn/pAA1 + AHr/pAA1AHv/pAA1AHz/pAA1AH3/pAA1AH7/pAA1AH//pAA1AID/pAA1AIH/pAA1AKn/kAA1 + AKr/3AA1AK3/rQA1AK7/rQA1ALT/awA1ALX/fQA1ALr/kAA1ALv/fQA1AMX/3AA1AMf/rQA1 + AMn/rQA1AOr/fQA1AOv/kAA1APv/mgA1AP3/mgA2ACQAJgA2ACYAAAA2ACoAAAA2ADIAAAA2 + ADQAAAA2ADYAAAA2AGIAJgA2AGQAAAA2AGcAAAA2AK0AJgA2AK4AJgA2AK8AAAA2AMcAJgA2 + AMkAJgA2ANAAAAA2ANEAAAA2ANIAAAA2AOMAAAA2APYAAAA2APkAAAA2APsAAAA2AP0AAAA3 + ABD/RAA3ABH/DQA3AB3/HwA3ACT/YQA3ACb/iAA3ADf/3AA3AET+rQA3AEb+pAA3AEj+pAA3 + AEz/wQA3AFL+pAA3AFX+0wA3AFb+rQA3AFj+yQA3AFr+rQA3AFz+wQA3AGL/YQA3AGT/iAA3 + AGn+rQA3AGr+rQA3AGv+rQA3AGz+rQA3AG3+rQA3AG7+rQA3AG/+pAA3AHD+pAA3AHH+pAA3 + AHL+pAA3AHP+pAA3AHn+pAA3AHr+pAA3AHv+pAA3AHz+pAA3AH3+pAA3AH7+yQA3AH/+yQA3 + AID+yQA3AIH+yQA3AKn/RAA3AKr/kAA3AK3/YQA3AK7/YQA3ALQAAAA3ALX/0wA3ALr+wQA3 + AMX++AA3AMf/YQA3AMn/YQA3AOT+rQA3AOv+wQA3APr+rQA3APv/iAA3APz+pAA3AP3/iAA3 + AP7+pAA4ACQAAAA4AC0AAAA4AD3/3AA4AGIAAAA4AK0AAAA4AK4AAAA4AMcAAAA4AMkAAAA4 + AOX/3AA5ABD/iAA5ABH++AA5AB3/WQA5ACT/fQA5ADL/3AA5AET/YQA5AEj/YQA5AEz/0wA5 + AFL/YQA5AFj/dQA5AFz/yQA5AGL/fQA5AGf/3AA5AGn/YQA5AGr/YQA5AGv/YQA5AGz/YQA5 + AG3/YQA5AG7/YQA5AHD/YQA5AHH/YQA5AHL/YQA5AHP/YQA5AHn/YQA5AHr/YQA5AHv/YQA5 + AHz/YQA5AH3/YQA5AH7/dQA5AH//dQA5AID/dQA5AIH/dQA5AKn/TgA5AKr/kAA5AK3/fQA5 + AK7/fQA5AK//3AA5ALQAAAA5ALUAAAA5ALr/yQA5AMX+5gA5AMf/fQA5AMn/fQA5AND/3AA5 + ANH/3AA5ANL/3AA5AOv/yQA6ABD/rQA6ABH/FQA6AB3/iAA6ACT/kAA6AET/fQA6AEj/iAA6 + AEz/0wA6AFL/iAA6AFX/pAA6AFj/twA6AFz/3AA6AGL/kAA6AGn/fQA6AGr/fQA6AGv/fQA6 + AGz/fQA6AG3/fQA6AG7/fQA6AHD/iAA6AHH/iAA6AHL/iAA6AHP/iAA6AHn/iAA6AHr/iAA6 + AHv/iAA6AHz/iAA6AH3/iAA6AH7/twA6AH//twA6AID/twA6AIH/twA6AKn/kAA6AKr/3AA6 + AK3/kAA6AK7/kAA6ALT/3AA6ALUAAAA6ALr/3AA6AMX++AA6AMf/kAA6AMn/kAA6AOv/3AA7 + ABD/mgA7ACQAAAA7ACb/awA7ADL/fQA7ADf/3AA7AEj/pAA7AGIAAAA7AGT/awA7AGf/fQA7 + AHD/pAA7AHH/pAA7AHL/pAA7AHP/pAA7AKn/kAA7AKoAAAA7AK0AAAA7AK4AAAA7AK//fQA7 + ALT/YQA7ALX/rQA7AMX/0wA7AMcAAAA7AMkAAAA7AND/fQA7ANH/fQA7ANL/fQA7APv/awA7 + AP3/awA8ABD/DQA8ABH+YQA8AB3+8AA8ACT/YQA8ACb/kAA8ADL/kAA8AET+5gA8AEj+8AA8 + AEz/twA8AFL+8AA8AFj/FQA8AGL/YQA8AGT/kAA8AGf/kAA8AGn+5gA8AGr+5gA8AGv+5gA8 + AGz+5gA8AG3+5gA8AG7+5gA8AHD+8AA8AHH+8AA8AHL+8AA8AHP+8AA8AHn+8AA8AHr+8AA8 + AHv+8AA8AHz+8AA8AH3+8AA8AH7/FQA8AH//FQA8AID/FQA8AIH/FQA8AKn/HwA8AKr/awA8 + AK3/YQA8AK7/YQA8AK//kAA8ALT/kAA8ALX/3AA8AMX++AA8AMf/YQA8AMn/YQA8AND/kAA8 + ANH/kAA8ANL/kAA8APv/kAA8AP3/kAA9ABD/3AA9AKkAAAA9AKoAAAA9ALT/3AA9ALX/3AA9 + AMX/3ABIAFv/3ABJABD/kABJABH/awBJAB3/twBJAFf/3ABJAFr/3ABJAFz/3ABJAKn/twBJ + AKr/3ABJALQAQQBJALUAAABJALr/3ABJAMX/FQBJAOv/3ABOAET/3ABOAEj/twBOAFL/twBO + AFj/wQBOAFz/twBOAGn/3ABOAGr/3ABOAGv/3ABOAGz/3ABOAG3/3ABOAG7/3ABOAHD/twBO + AHH/twBOAHL/twBOAHP/twBOAHn/twBOAHr/twBOAHv/twBOAHz/twBOAH3/twBOAH7/wQBO + AH//wQBOAID/wQBOAIH/wQBOALr/twBOAOv/twBRABAAAABRABEAAABRAB0AAABRAKkAAABR + AKoAAABRALT/awBRALX/kABRAMX/pABSABAAJgBSABH/3ABSAB0AAABSAFv/wQBSAKkAAABS + AKoAAABSALT/awBSALX/twBSAMX/fQBVABD/fQBVABH/RABVAB3/3ABVAEb/0wBVAEf/3ABV + AEj/0wBVAEkAAABVAEr/3ABVAEv/3ABVAFD/3ABVAFH/3ABVAFL/0wBVAFT/3ABVAFX/3ABV + AFgAAABVAFkAAABVAFoAAABVAFv/yQBVAFwAAABVAF0AAABVAG//0wBVAHD/0wBVAHH/0wBV + AHL/0wBVAHP/0wBVAHj/3ABVAHn/0wBVAHr/0wBVAHv/0wBVAHz/0wBVAH3/0wBVAH4AAABV + AH8AAABVAIAAAABVAIEAAABVAKn/twBVAKoAAABVALQAAABVALUAVgBVALoAAABVAMX+yQBV + AOYAAABVAOsAAABVAPf/3ABVAPz/0wBVAP7/0wBZABD/yQBZABH/YQBZAB3/kABZAKn/3ABZ + AKr/3ABZALQAAABZALX/3ABZAMX+8ABaABAAAABaABH/RABaAB3/kABaAKn/3ABaAKr/3ABa + ALQAAABaALUAAABaAMX/KQBbAEb/3ABbAEj/wQBbAFL/wQBbAG//3ABbAHD/wQBbAHH/wQBb + AHL/wQBbAHP/wQBbAHn/wQBbAHr/wQBbAHv/wQBbAHz/wQBbAH3/wQBbAPz/3ABbAP7/3ABc + ABD/3ABcABH+3ABcAB3/awBcAKn/3ABcAKr/3ABcALQAAABcALUAAABcAMX+0wBiABD/0wBi + ABH/3ABiAB3/3ABiACQAOQBiACb/3ABiACr/3ABiADL/3ABiADT/3ABiADYAAABiADf/YQBi + ADgAAABiADn/fQBiADr/kABiADsAAABiADz/YQBiAEb/3ABiAEf/3ABiAEj/3ABiAEn/twBi + AFL/3ABiAFT/3ABiAFf/3ABiAFgAAABiAFn/iABiAFr/rQBiAFz/dQBiAGIAOQBiAGT/3ABi + AGf/3ABiAGgAAABiAG//3ABiAHD/3ABiAHH/3ABiAHL/3ABiAHP/3ABiAHn/3ABiAHr/3ABi + AHv/3ABiAHz/3ABiAH3/3ABiAH4AAABiAH8AAABiAIAAAABiAIEAAABiAKn/twBiAKoAAABi + AK0AOQBiAK4AOQBiAK//3ABiALT++ABiALX/AwBiALr/dQBiALv/YQBiAMUALwBiAMcAOQBi + AMkAOQBiAND/3ABiANH/3ABiANL/3ABiANMAAABiANQAAABiANUAAABiAOMAAABiAOr/YQBi + AOv/dQBiAPb/3ABiAPkAAABiAPv/3ABiAPz/3ABiAP3/3ABiAP7/3ABkABAAAABkACQAAABk + ADYAAABkADz/3ABkAGIAAABkAKn/3ABkAKr/3ABkAK0AAABkAK4AAABkALQAAABkALUAJgBk + ALv/3ABkAMUAAABkAMcAAABkAMkAAABkAOMAAABkAOr/3ABkAPkAAABnABAAOQBnABH/rQBn + AB3/3ABnACT/3ABnADn/3ABnADv/fQBnADz/kABnAGL/3ABnAKn/3ABnAKoAAABnAK3/3ABn + AK7/3ABnALT/0wBnALX/3ABnALv/kABnAMX/RABnAMf/3ABnAMn/3ABnAOr/kABoACQAAABo + AC0AAABoAD3/3ABoAGIAAABoAK0AAABoAK4AAABoAMcAAABoAMkAAABoAOX/3ABwAFv/3ABx + AFv/3AByAFv/3ABzAFv/3AB4ABAAAAB4ABEAAAB4AB0AAAB4AKkAAAB4AKoAAAB4ALT/awB4 + ALX/kAB4AMX/pAB5ABAAJgB5ABH/3AB5AB0AAAB5AFv/wQB5AKkAAAB5AKoAAAB5ALT/awB5 + ALX/twB5AMX/fQB6ABAAJgB6ABH/3AB6AB0AAAB6AFv/wQB6AKkAAAB6AKoAAAB6ALT/awB6 + ALX/twB6AMX/fQB7ABAAJgB7ABH/3AB7AB0AAAB7AFv/wQB7AKkAAAB7AKoAAAB7ALT/awB7 + ALX/twB7AMX/fQB8ABAAJgB8ABH/3AB8AB0AAAB8AFv/wQB8AKkAAAB8AKoAAAB8ALT/awB8 + ALX/twB8AMX/fQB9ABAAJgB9ABH/3AB9AB0AAAB9AFv/wQB9AKkAAAB9AKoAAAB9ALT/awB9 + ALX/twB9AMX/fQCJABAAJgCJAKkAAACJAKoAAACJALT/kACJALX/kACJAMX/rQCQABAAAACQ + AKkAAACQAKoAAACQALT/rQCQALX/pACQAMX/kACpACQAAACpACX/3ACpACb/3ACpACf/3ACp + ACkAAACpACr/3ACpACsAAACpAC3/3ACpAC4AAACpAC8AAACpADIAAACpADMAAACpADQAAACp + ADUAAACpADf/kACpADn/kACpADr/3ACpADsAAACpADz/awCpAD0AAACpAEkAAACpAFEAAACp + AFIAAACpAFUAAACpAFn/3ACpAFr/3ACpAFz/3ACpAGIAAACpAGT/3ACpAGcAAACpAHgAAACp + AHkAAACpAHoAAACpAHsAAACpAHwAAACpAH0AAACpAIkAAACpAJAAlwCpAK0AAACpAK4AAACp + AK8AAACpALr/3ACpALv/awCpAMcAAACpAMkAAACpANAAAACpANEAAACpANIAAACpAOUAAACp + AOkAAACpAOr/awCpAOv/3ACpAOwAAACpAPb/3ACpAPv/3ACpAP3/3ACqACT/twCqACX/twCq + ACb/3ACqACf/3ACqACkAAACqACoAAACqACsAAACqAC3/3ACqAC4AAACqAC8AAACqADL/3ACq + ADMAAACqADQAAACqADUAAACqADf/RACqADn/TgCqADr/kACqADv/kACqADz/HwCqAD0AAACq + AEkAAACqAFEAAACqAFIAAACqAFUAAACqAFn/3ACqAFr/3ACqAFz/3ACqAGL/twCqAGT/3ACq + AGf/3ACqAHgAAACqAHkAAACqAHoAAACqAHsAAACqAHwAAACqAH0AAACqAIkAAACqAJAAAACq + AK3/twCqAK7/twCqAK//3ACqALr/3ACqALv/HwCqAMf/twCqAMn/twCqAND/3ACqANH/3ACq + ANL/3ACqAOUAAACqAOkAAACqAOr/HwCqAOv/3ACqAOwAAACqAPYAAACqAPv/3ACqAP3/3ACt + ABD/0wCtABH/3ACtAB3/3ACtACQAOQCtACb/3ACtACr/3ACtADL/3ACtADT/3ACtADYAAACt + ADf/YQCtADgAAACtADn/fQCtADr/kACtADsAAACtADz/YQCtAEb/3ACtAEf/3ACtAEj/3ACt + AEn/twCtAFL/3ACtAFT/3ACtAFf/3ACtAFgAAACtAFn/iACtAFr/rQCtAFz/dQCtAGIAOQCt + AGT/3ACtAGf/3ACtAGgAAACtAG//3ACtAHD/3ACtAHH/3ACtAHL/3ACtAHP/3ACtAHn/3ACt + AHr/3ACtAHv/3ACtAHz/3ACtAH3/3ACtAH4AAACtAH8AAACtAIAAAACtAIEAAACtAKn/twCt + AKoAAACtAK0AOQCtAK4AOQCtAK//3ACtALT++ACtALX/AwCtALr/dQCtALv/YQCtAMUALwCt + AMcAOQCtAMkAOQCtAND/3ACtANH/3ACtANL/3ACtANMAAACtANQAAACtANUAAACtAOMAAACt + AOr/YQCtAOv/dQCtAPb/3ACtAPkAAACtAPv/3ACtAPz/3ACtAP3/3ACtAP7/3ACuABD/0wCu + ABH/3ACuAB3/3ACuACQAOQCuACb/3ACuACr/3ACuADL/3ACuADT/3ACuADYAAACuADf/YQCu + ADgAAACuADn/fQCuADr/kACuADsAAACuADz/YQCuAEb/3ACuAEf/3ACuAEj/3ACuAEn/twCu + AFL/3ACuAFT/3ACuAFf/3ACuAFgAAACuAFn/iACuAFr/rQCuAFz/dQCuAGIAOQCuAGT/3ACu + AGf/3ACuAGgAAACuAG//3ACuAHD/3ACuAHH/3ACuAHL/3ACuAHP/3ACuAHn/3ACuAHr/3ACu + AHv/3ACuAHz/3ACuAH3/3ACuAH4AAACuAH8AAACuAIAAAACuAIEAAACuAKn/twCuAKoAAACu + AK0AOQCuAK4AOQCuAK//3ACuALT++ACuALX/AwCuALr/dQCuALv/YQCuAMUALwCuAMcAOQCu + AMkAOQCuAND/3ACuANH/3ACuANL/3ACuANMAAACuANQAAACuANUAAACuAOMAAACuAOr/YQCu + AOv/dQCuAPb/3ACuAPkAAACuAPv/3ACuAPz/3ACuAP3/3ACuAP7/3ACvABAAOQCvABH/rQCv + AB3/3ACvACT/3ACvADn/3ACvADv/fQCvADz/kACvAGL/3ACvAKn/3ACvAKoAAACvAK3/3ACv + AK7/3ACvALT/0wCvALX/3ACvALv/kACvAMX/RACvAMf/3ACvAMn/3ACvAOr/kAC0ACT++AC0 + ACX/wQC0ACb/twC0ACf/wQC0ACn/wQC0ACr/twC0ACv/wQC0AC3/wQC0AC7/wQC0AC//wQC0 + ADL/twC0ADP/wQC0ADT/twC0ADX/wQC0ADcAAAC0ADkAAAC0ADoAAAC0ADv/iAC0ADwAAAC0 + AD3/3AC0AEn/twC0AFH/kAC0AFL/awC0AFX/kAC0AFn/twC0AFr/twC0AFz/twC0AGL++AC0 + AGT/twC0AGf/twC0AHj/kAC0AHn/awC0AHr/awC0AHv/awC0AHz/awC0AH3/awC0AIn/wQC0 + AJD+fQC0AK3++AC0AK7++AC0AK//twC0ALr/twC0ALsAAAC0AMf++AC0AMn++AC0AND/twC0 + ANH/twC0ANL/twC0AOX/3AC0AOn/twC0AOoAAAC0AOv/twC0AOz/wQC0APb/twC0APv/twC0 + AP3/twC6ABD/3AC6ABH+3AC6AB3/awC6AKn/3AC6AKr/3AC6ALQAAAC6ALUAAAC6AMX+0wC7 + ABD/DQC7ABH+YQC7AB3+8AC7ACT/YQC7ACb/kAC7ADL/kAC7AET+5gC7AEj+8AC7AEz/twC7 + AFL+8AC7AFj/FQC7AGL/YQC7AGT/kAC7AGf/kAC7AGn+5gC7AGr+5gC7AGv+5gC7AGz+5gC7 + AG3+5gC7AG7+5gC7AHD+8AC7AHH+8AC7AHL+8AC7AHP+8AC7AHn+8AC7AHr+8AC7AHv+8AC7 + AHz+8AC7AH3+8AC7AH7/FQC7AH//FQC7AID/FQC7AIH/FQC7AKn/HwC7AKr/awC7AK3/YQC7 + AK7/YQC7AK//kAC7ALT/kAC7ALX/3AC7AMX++AC7AMf/YQC7AMn/YQC7AND/kAC7ANH/kAC7 + ANL/kAC7APv/kAC7AP3/kADFACQAJgDFACX/twDFACb/kADFACf/twDFACn/twDFACr/twDF + ACv/twDFAC0ALwDFAC7/twDFAC//twDFADL/kADFADP/twDFADT/kADFADX/twDFADf+5gDF + ADn+iADFADr/AwDFADv/twDFADz+iADFAD0AAADFAEn/3ADFAFH/twDFAFL/twDFAFX/twDF + AFn/FQDFAFr/PADFAFz/kADFAGIAJgDFAGT/kADFAGf/kADFAHj/twDFAHn/twDFAHr/twDF + AHv/twDFAHz/twDFAH3/twDFAIn/twDFAJAAJgDFAK0AJgDFAK4AJgDFAK//kADFALr/kADF + ALv+iADFAMcAJgDFAMkAJgDFAND/kADFANH/kADFANL/kADFAOUAAADFAOn/twDFAOr+iADF + AOv/kADFAOz/twDFAPb/twDFAPv/kADFAP3/kADHABD/0wDHABH/3ADHAB3/3ADHACQAOQDH + ACb/3ADHACr/3ADHADL/3ADHADT/3ADHADYAAADHADf/YQDHADgAAADHADn/fQDHADr/kADH + ADsAAADHADz/YQDHAEb/3ADHAEf/3ADHAEj/3ADHAEn/twDHAFL/3ADHAFT/3ADHAFf/3ADH + AFgAAADHAFn/iADHAFr/rQDHAFz/dQDHAGIAOQDHAGT/3ADHAGf/3ADHAGgAAADHAG//3ADH + AHD/3ADHAHH/3ADHAHL/3ADHAHP/3ADHAHn/3ADHAHr/3ADHAHv/3ADHAHz/3ADHAH3/3ADH + AH4AAADHAH8AAADHAIAAAADHAIEAAADHAKn/twDHAKoAAADHAK0AOQDHAK4AOQDHAK//3ADH + ALT++ADHALX/AwDHALr/dQDHALv/YQDHAMUALwDHAMcAOQDHAMkAOQDHAND/3ADHANH/3ADH + ANL/3ADHANMAAADHANQAAADHANUAAADHAOMAAADHAOr/YQDHAOv/dQDHAPb/3ADHAPkAAADH + APv/3ADHAPz/3ADHAP3/3ADHAP7/3ADJABD/0wDJABH/3ADJAB3/3ADJACQAOQDJACb/3ADJ + ACr/3ADJADL/3ADJADT/3ADJADYAAADJADf/YQDJADgAAADJADn/fQDJADr/kADJADsAAADJ + ADz/YQDJAEb/3ADJAEf/3ADJAEj/3ADJAEn/twDJAFL/3ADJAFT/3ADJAFf/3ADJAFgAAADJ + AFn/iADJAFr/rQDJAFz/dQDJAGIAOQDJAGT/3ADJAGf/3ADJAGgAAADJAG//3ADJAHD/3ADJ + AHH/3ADJAHL/3ADJAHP/3ADJAHn/3ADJAHr/3ADJAHv/3ADJAHz/3ADJAH3/3ADJAH4AAADJ + AH8AAADJAIAAAADJAIEAAADJAKn/twDJAKoAAADJAK0AOQDJAK4AOQDJAK//3ADJALT++ADJ + ALX/AwDJALr/dQDJALv/YQDJAMUALwDJAMcAOQDJAMkAOQDJAND/3ADJANH/3ADJANL/3ADJ + ANMAAADJANQAAADJANUAAADJAOMAAADJAOr/YQDJAOv/dQDJAPb/3ADJAPkAAADJAPv/3ADJ + APz/3ADJAP3/3ADJAP7/3ADQABAAOQDQABH/rQDQAB3/3ADQACT/3ADQADn/3ADQADv/fQDQ + ADz/kADQAGL/3ADQAKn/3ADQAKoAAADQAK3/3ADQAK7/3ADQALT/0wDQALX/3ADQALv/kADQ + AMX/RADQAMf/3ADQAMn/3ADQAOr/kADRABAAOQDRABH/rQDRAB3/3ADRACT/3ADRADn/3ADR + ADv/fQDRADz/kADRAGL/3ADRAKn/3ADRAKoAAADRAK3/3ADRAK7/3ADRALT/0wDRALX/3ADR + ALv/kADRAMX/RADRAMf/3ADRAMn/3ADRAOr/kADSABAAOQDSABH/rQDSAB3/3ADSACT/3ADS + ADn/3ADSADv/fQDSADz/kADSAGL/3ADSAKn/3ADSAKoAAADSAK3/3ADSAK7/3ADSALT/0wDS + ALX/3ADSALv/kADSAMX/RADSAMf/3ADSAMn/3ADSAOr/kADTACQAAADTAC0AAADTAD3/3ADT + AGIAAADTAK0AAADTAK4AAADTAMcAAADTAMkAAADTAOX/3ADUACQAAADUAC0AAADUAD3/3ADU + AGIAAADUAK0AAADUAK4AAADUAMcAAADUAMkAAADUAOX/3ADVACQAAADVAC0AAADVAD3/3ADV + AGIAAADVAK0AAADVAK4AAADVAMcAAADVAMkAAADVAOX/3ADjACQAJgDjACYAAADjACoAAADj + ADIAAADjADQAAADjADYAAADjAGIAJgDjAGQAAADjAGcAAADjAK0AJgDjAK4AJgDjAK8AAADj + AMcAJgDjAMkAJgDjANAAAADjANEAAADjANIAAADjAOMAAADjAPYAAADjAPkAAADjAPsAAADj + AP0AAADlABD/3ADlAKkAAADlAKoAAADlALT/3ADlALX/3ADlAMX/3ADpABAAAADpAKkAAADp + AKoAAADpALT/pADpALX/kADpAMX/twDqABD/DQDqABH+YQDqAB3+8ADqACT/YQDqACb/kADq + ADL/kADqAET+5gDqAEj+8ADqAEz/twDqAFL+8ADqAFj/FQDqAGL/YQDqAGT/kADqAGf/kADq + AGn+5gDqAGr+5gDqAGv+5gDqAGz+5gDqAG3+5gDqAG7+5gDqAHD+8ADqAHH+8ADqAHL+8ADq + AHP+8ADqAHn+8ADqAHr+8ADqAHv+8ADqAHz+8ADqAH3+8ADqAH7/FQDqAH//FQDqAID/FQDq + AIH/FQDqAKn/HwDqAKr/awDqAK3/YQDqAK7/YQDqAK//kADqALT/kADqALX/3ADqAMX++ADq + AMf/YQDqAMn/YQDqAND/kADqANH/kADqANL/kADqAPv/kADqAP3/kADrABD/3ADrABH+3ADr + AB3/awDrAKn/3ADrAKr/3ADrALQAAADrALUAAADrAMX+0wDsABAAAADsABH/awDsAB3/twDs + AKkAAADsAKoAAADsALT/3ADsALUAAADsAMX/RAD2ABAAAAD2ACQAAAD2ADf/twD2ADoAAAD2 + ADz/mgD2AGIAAAD2AKn/3AD2AKr/3AD2AK0AAAD2AK4AAAD2ALT/0wD2ALX/0wD2ALv/mgD2 + AMX/yQD2AMcAAAD2AMkAAAD2AOr/mgD5ACQAJgD5ACYAAAD5ACoAAAD5ADIAAAD5ADQAAAD5 + ADYAAAD5AGIAJgD5AGQAAAD5AGcAAAD5AK0AJgD5AK4AJgD5AK8AAAD5AMcAJgD5AMkAJgD5 + ANAAAAD5ANEAAAD5ANIAAAD5AOMAAAD5APYAAAD5APkAAAD5APsAAAD5AP0AAAD7ABAAAAD7 + ACQAAAD7ADYAAAD7ADz/3AD7AGIAAAD7AKn/3AD7AKr/3AD7AK0AAAD7AK4AAAD7ALQAAAD7 + ALUAJgD7ALv/3AD7AMUAAAD7AMcAAAD7AMkAAAD7AOMAAAD7AOr/3AD7APkAAAD9ABAAAAD9 + ACQAAAD9ADYAAAD9ADz/3AD9AGIAAAD9AKn/3AD9AKr/3AD9AK0AAAD9AK4AAAD9ALQAAAD9 + ALUAJgD9ALv/3AD9AMUAAAD9AMcAAAD9AMkAAAD9AOMAAAD9AOr/3AD9APkAAAAAAAEAAAEM + AE0ABwBCAAQAAgAQAEAABwAABBUFaAADAAEAAQAAB23+HQAACrz+if6JCkwAAQAAAAAAAAAA + AAAAAAAAAQwAAQQOAZAABQAEBUcEzAAA/kIFRwTMAAACUwCPAmYIAgILBgMDCAQCAgSAAACv + EAAgSgAAAAAAAAAAQml0cwBAACD7AgYU/hQBmgdtAeMAAAABAAAAAAAAAAEAAEIAHbECiwRg + AAAjYwXVAABWZXJhU2FucwAAAAAAAAAA/////zb///42MjhSMDAAAEAAAAAAAAAUAAABEAkM + BQADAwMECAYJCAIEBAUIAwMDAwYGBgYGBgYGBgYDAwgICAUKBgcHBwYGBwcDAwYFCAcHBgcG + BwUHBgcGBQUEAwQIBQUGBgYGBgMGBgMDBQMJBgYGBgQFBAYFBwUFBgUDBQgGBgcGBwcHBgYG + BgYGBgYGBgYDAwMDBgYGBgYGBgYGBgUFBgYFBQYGCQkJBQUICQcICAgIBgYFBgcFBQQEBwkG + BQMIBgYIBgYGCQYGBgcKCQUJBQUDAwgEBQUCBgQEBgYFAwMFDAYGBgYGAwMDAwcHBwcHBwMF + BQUFBQUFBQUFBQMHBQUGAwcGBQUGBggIBAQECQkJBwYDBwUHBgcGBgMDBgUFBQUFBQQFBQAA + Cg0GAAMDBAUIBgoJAwQEBQgDBAMDBgYGBgYGBgYGBgMDCAgIBQsHBwgIBwYICAMDBwYJCAgH + CAcHBQgHCQYHBgQDBAgFBQYGBQYGBAYGAgIFAgoGBgYGBAUEBgYIBgYFBgMGCAcHCAcICAgG + BgYGBgYFBgYGBgICAgIGBgYGBgYGBgYGBQUGBgUGBgYKCgoFBQgKCAgICAgGBwUHCAYFBQUI + CgYFBAgGBggHBgYKBgcHCAsKBQoFBQMDCAUGBwIGBAQGBgUDAwUNBwcHBwcDAwMDCAgICAgI + AgUFBQUFBQUFBQUGAgcFBgUDCAYHBgcGCAgEBAQKCgoIBgMHBQgFCAUGBAMGBQUFBQUFBAUF + AAALDwcAAwMDBQkHCgoDBAQGCQQEBAQHBwcHBwcHBwcHBAQJCQkGDAcICAgHBgkIAwMHBgkI + CQcJBwgHCAcJBwcJBAQECQYGBwcGBwcEBwcDAwYDCwcHBwcFBwQHBgkGBgUHBAcJBwcIBwgJ + CAcHBwcHBwYHBwcHAwMDAwcHBwcHBwcHBwcGBgcHBgYHBwsLCwYGCQsJCQkJCQcHBgcIBgYF + BQgLBwYDCQcHCQcHBwsHBwcJDAsGCwYGBAQJBQYHAgcEBAcHBgQEBg8HBwcHBwMDAwMJCQkI + CAgDBgYGBgYGBgYGBgYDCAcJBQQIBwcGBwcJCQQEBAsLCwkHAwgHCAYIBgcEBAcGBgYGBgYE + BgYAAAwQBwAEBAUFCggLCgMFBQYKBAQEBAgICAgICAgICAgEBAoKCgYNCAgICQgHCQkDAwcG + CgkJCAkICAcJCAsJBwkFBAUKBgYICAcICAQICAMDBwMLCAgICAUHBQgGCQYGBQgECAoICAgI + CQkJCAgICAgIBwgICAgDAwMDCAgICAgICAgICAYGCAgGBwgIDAwMBgYKDAkKCgoKCAgGCAkH + BgYGCQwIBgUKCAgKCAcHDAgICAkNDQYMBgYEBAoGBgcCCAUFBwcGBAQGEAgICAgIAwMDAwkJ + CQkJCQMGBgYGBgYGBgYGBgMIBwkFBAkIBwYICAoKBQUFDAwMCQgDCAcIBwgHCAQECAYGBgYG + BgUGBgAADREIAAQEBQULCAwLAwUFBwsEBQQECAgICAgICAgICAQECwsLBw0JCQkKCAcKCgMD + CAcLCgoICggJBwoJCwoHCgUEBQsHBwgIBwgIBAgIAwMHAw0ICAgIBQcFCAcJBwcHCAQICwkJ + CQgKCgoICAgICAgHCAgICAMDAwMICAgICAgICAgIBwcICAcICAgNDQ0HBwsNCgsLCwsICAcJ + CggHBgYKDQgHBQsICAsJCAgNCAkJCg4NBw0HBwQECwYHBwIIBQUICAcEBAcRCQgJCAgDAwMD + CgoKCgoKAwcHBwcHBwcHBwcHAwkHCgcECggHBwgICwsFBQUNDQ0KCAMJBwkHCQcIBQQIBwcH + BwcHBQcHAAAOEwgABAQFBQwJDQwDBQUHDAQFBAUJCQkJCQkJCQkJBQUMDAwHDgkKCgsJCAsK + AwMJBwwKCwkLCgkJCgkNCwkKBQUFDAcHCAkICQkECQkDAwgDDQkJCQkFCAUJBwsHBwgJBQkM + CQkKCQoLCggICAgICAgJCQkJAwMDAwkJCQkJCQkJCQkHBwkJBwgJCQ4ODgcHDA4LDAwMDAkJ + BwkLCAcHBwsOCQcFDAkJDAkJCQ4JCQkLDw8HDgcHBAQMBwcJAgkGBggIBwQEBxMJCQkJCQMD + AwMLCwsKCgoDBwcHBwcHBwcHBwcDCQgKCAULCQkHCQkMDAYGBg4ODgsJAwkICggKCAkFBAkH + BwcHBwcGBwcAAA8UCQAFBQYGDQoOCwMGBggNBQUFBQoKCgoKCgoKCgoFBQ0NDQgPCgoKCwkJ + DAsDAwoIDQsMCQwKCgkLCg8KCQsGBQYNCAgJCQgJCQUJCQMDCAMPCQkJCQYIBgkIDQoICAoF + Cg0KCgoJCwwLCQkJCQkJCAkJCQkDAwMDCQkJCQkJCQkJCQgICgoICQoJDw8PCAgNDwwNDQ0N + CgkICgsJCAcHCw8JCAYNCgoNCgkJDwoKCgwQDwgPCAgFBQ0HCAkDCgYGCQkIBQUIFAoJCgkJ + AwMDAwwMDAsLCwMICAgICAgICAgICAMKCAsIBQwJCQgJCQ0NBgYGDw8PDAkDCggKCAoICQUF + CggICAgICAYICAAAEBUKAAUFBgYNCg8MAwYGCA0FBgUFCgoKCgoKCgoKCgUFDQ0NCRALCwsM + CgkMDAUFCgkNDA0KDQsKCQwLEQsJDAYFBg0ICAkKCQoJBgoKAwMJAw8KCgoKBwkGCgkNCgkJ + CgUKDQsLCwoMDQwJCQkJCQkJCQkJCQMDAwMKCgoKCgoKCgoKCAgKCggJCgoQEBAICA0QDQ0N + DQ0KCggLDAkICAgMEAoJBg0KCg0LCgoQCgsLDREPCBAICAUFDQgJCQMKBgYKCggFBQgVCwoL + CgoFBQUFDQ0NDAwMAwgICAgICAgICAgJBAoJDAkFDQoJCQoKDQ0GBgYQEBAMCgUKCQsJCwkK + BgUKCAgICAgIBggIAAARFwoABQUHCA4LEA0FBwcJDgUGBQYLCwsLCwsLCwsLBgYODg4JEQsM + DA0LCg0NBgYMCQ8NDQoNDAsKDQsSDQoMBwYHDgkJCgoICgoGCgsFBQoFEQsKCgoHCAcLCg8K + CggLBgsOCwsMCw0NDQoKCgoKCggKCgoKBQUFBQsKCgoKCgsLCwsJCQsLCQoLCxEREQkJDhAN + Dg4ODgsLCQsNCgkICA0QCgkHDgsLDgsKChELCwsNEhEJEQkJBQUOCAoKAwsHBwoKCQUFCRcL + CwsLCwYGBgYNDQ0NDQ0FCQkJCQkJCQkJCQoFCwgMCAYNCgoKCgoODgcHBxAQEA0KBgsIDAgM + CAoGBQsJCQkJCQkHCQkAABIYCwAGBgcIDwsRDQQHBwkPBgcGBgsLCwsLCwsLCwsGBg8PDwoS + DAwNDgsKDg4GBgwKEA4OCw4NCwwODBMNDA0HBgcPCQkKCwkLCwYLCwUFCgURCwsLCwgIBwsL + EAsLCQsGCw8MDA0LDg4OCgoKCgoKCQsLCwsFBQUFCwsLCwsLCwsLCwkJCwsJCwsLEhISCQkP + EQ4PDw8PCwsJDA4LCQgIDhELCgcPCwsPDAsLEgsMDA4TEwkSCQkGBg8JCwwDCwcHCwsJBgYJ + GAwLDAsLBgYGBg4ODg4ODgUJCQkJCQkJCQkJCgULCA0JBg4LDAsLCw8PBwcHERERDgsGCwgN + CQ0JCwcGCwkJCQkJCQcJCQAAExoLAAYGCAgQDBIOBAcHChAGBwYGDAwMDAwMDAwMDAYGEBAQ + ChMNDQ0PDAsPDgYGDAsQDg8MDw0MDA4NFA4MDQcGBxAKCgsLCQsLBgsMBQULBREMCwsLCAkI + DAsRCwsLDAYMEA0NDQwODw4LCwsLCwsJCwsLCwUFBQUMCwsLCwsMDAwMCgoMDAoLDAwTExMK + ChASDxAQEBAMDAoNDgsKCQkPEgsKCBAMDBANDAwTDA0NDxQTChMKCgYGEAkLDAMMCAgLCwoG + BgoaDQwNDAwGBgYGDw8PDg4OBQoKCgoKCgoKCgoLBQwJDQsGDwsMCwwLEBAICAgSEhIPCwYM + CQ0JDQkLBwYMCgoKCgoKCAoKAAAUGwwABgYIChENEw8GCAgKEQYHBgcNDQ0NDQ0NDQ0NBwcR + ERELFA4ODg8NDBAPBgYNCxEPEAwQDg0MDw4UDgwOCAcIEQoKDA0LDQwHDQ0GBgwGFA0MDQ0I + CggNCxELCwsNBw0RDg4ODQ8QDwwMDAwMDAsMDAwMBgYGBg0MDAwMDA0NDQ0KCg0NCgwNDRQU + FAoKERQQEREREQ0NCg0PDAoJCQ8TDAsIEQ0NEQ0MDBQNDg4QFRQKFAoKBgYRCgsMAw0ICA0N + CgYGChsODQ4NDQYGBgYQEBAPDw8GCgoKCgoKCgoKCgsGDQoOCwcPDAwLDA0REQgICBMTExAN + Bg0KDgsOCw0HBg0KCgoKCgoICgoAABUcDQAHBwgKEg0UEAYICAsSBwgHBw0NDQ0NDQ0NDQ0H + BxISEgsVDg4PEA0MEBAGBg4MEhARDREPDQ0PDhUODQ4IBwgSCwsNDQwNDQcNDQYGDAYUDg0N + DQkLCA4LEQ0NCw0HDRIODg8NEBEPDQ0NDQ0NDA0NDQ0GBgYGDg0NDQ0NDg4ODgsLDQ0LDA0N + FRUVCwsSFBESEhISDQ4LDhAMCwoKEBQNCwgSDQ0SDg0NFQ0ODhEWFgsVCwsHBxIKDQ0EDQgI + DQ0LBwcLHA4NDg0NBgYGBhEREQ8PDwYLCwsLCwsLCwsLDAYNCw4LBxANDQ0NDRISCAgIFBQU + EA0GDQsPDA8MDQgHDQsLCwsLCwgLCwAAFh4NAAcHCQoSDhURBgkJCxIHCAcHDg4ODg4ODg4O + DgcHEhISDBYPDw8RDg0REQYGDgwTEBENEQ8ODRAPFg8NDwkHCRILCw0ODA4NCA4OBgYNBhYO + DQ4OCQsJDg4SDg4MDgcOEg8PDw4QERANDQ0NDQ0MDQ0NDQYGBgYODQ0NDQ0ODg4OCwsODgsN + Dg4WFhYLCxIVERISEhIODgsPEQ0LCgoRFQ0MCRIODhIPDQ0WDg8PERgWCxYLCwcHEgsODQQO + CQkNDQsHBwseDw4PDg4GBgYGEREREBAQBgsLCwsLCwsLCwsMBg4LDwwHEQ0NDg0OEhIJCQkV + FRURDgYOCw8MDwwOCAcOCwsLCwsLCQsLAAAXHw4ABwcJCxMPFhIGCQkMEwcIBwgPDw8PDw8P + Dw8PCAgTExMMFxAQEBIPDRIRBwcPDRQREg4SEA8OERAXEA4QCQgJEwwMDg8NDw4IDw8GBg0G + Fg8ODg4JDAkPDhMODgwPCA8TEBAQDxESEQ4ODg4ODg0ODg4OBgYGBg8ODg4ODg8PDw8MDA8P + DA4PDhcXFwwMExYSExMTEw8PDBARDgwLCxIVDgwJEw8PEw8ODhcPEBASGRgMFwwMBwcTCw4O + BA8JCQ8PDAcHDB8QDxAPDwcHBwcSEhIREREGDAwMDAwMDAwMDA0GDwwQDAgSDg4ODg4TEwkJ + CRYWFhIPBw8MEA0QDQ8IBw8MDAwMDAwJDAwAABggDgAICAoLFA8XEwcJCQwUCAkICA8PDw8P + Dw8PDw8ICBQUFA0YEBAREg8OExIHBxANFRITDhMRDw8SEBgQDxAJCAkUDAwODw0PDggPDwcH + DgYYDw4PDwoMCQ8PFA8PDQ8IDxQQEBEPEhMSDg4ODg4ODQ4ODg4HBwcHDw4ODg4ODw8PDwwM + Dw8MDg8PGBgYDAwUFxMUFBQUDw8MEBIODQsLEhcODQoUDw8UEA8PGA8QEBMaGAwYDAwICBQM + Dw8EDwoKDw8MCAgMIBAPEA8PBwcHBxMTExISEgcMDAwMDAwMDAwMDQYPDBANCBMODw8PDxQU + CgoKFxcXEw8HDwwRDRENDwkIDwwMDAwMDAoMDAAAGSIPAAgICgwVEBgUBwoKDRUICQgIEBAQ + EBAQEBAQEAgIFRUVDRkRERETEA4TEwcHEA4WExQPFBEQDxIRGREPEQoIChUNDQ8QDhAPCRAQ + BwcOBxgQDxAQCg0KEA8UDw8NEAgQFRERERATFBIPDw8PDw8ODw8PDwcHBwcQDw8PDw8QEBAQ + DQ0QEA0PEBAZGRkNDRUYFBUVFRUQEA0REw8NDAwTGQ8NChUQEBURDw8ZEBERFBsaDRkNDQgI + FQwPDwQQCgoQEA0ICA0iERAREBAHBwcHFBQUEhISBw0NDQ0NDQ0NDQ0OBxANEQ0IEw8PDw8Q + FRUKCgoYGBgTEAcQDREOEQ4QCQgQDQ0NDQ0NCg0NAAAaIxAACAgKDBYRGRQHCgoNFggJCAkR + ERERERERERERCQkWFhYOGhISEhQQDxQUCAgRDhYTFBAUEhEQExIaEhASCgkKFg0NEBEOERAJ + ERAHBw8HGRAQERELDgoQDxUPDw4RCREWEhISEBMUExAQEBAQEA4QEBAQBwcHBxAQEBAQEBAQ + EBANDRERDQ8REBoaGg0NFhkUFhYWFhERDRIUDw4MDBQaEA4KFhERFhEQEBoREhIUHBsNGg0N + CAgWDQ8QBBEKChAQDQgIDSMSEBIQEAgICAgUFBQTExMHDQ0NDQ0NDQ0NDQ8HEQ4SDgkUEBAP + EBEWFgoKChkZGRQRCBEOEg4SDhEJCBENDQ0NDQ0KDQ0AABskEAAJCQsMFxEaFQcLCw4XCQoJ + CREREREREREREREJCRcXFw4bEhMTFREQFRQICBIPFxQVEBUTEREUEhsTERMLCQsXDg4REQ8R + EQoREQgIEAgaEREREQsOCxEQFhAQDhEJERcSEhMRFBUUERERERERDxEREREICAgIERERERER + EREREQ4OEREOEBERGxsbDg4XGhUWFxcXEREOEhQQDg0NFRsRDgsXEREXEhERGxESEhUdHA4b + Dg4JCRcNEBEFEQsLEREOCQkOJBIREhERCAgICBUVFRQUFAgODg4ODg4ODg4ODwgRDhMOCRUR + ERAQERcXCwsLGhoaFREIEQ4TDxMPEQoJEQ4ODg4ODgsODgAAHCYRAAkJCw0XEhsWCAsLDhcJ + CgkJEhISEhISEhISEgkJFxcXDxwTExQWEhAWFQgIEhAYFRYRFhMSERUTHBMREwsJCxcODhES + DxIRChISCAgQCBsSERISDA8LEhEXEREPEgkSFxMTFBIVFhUREREREREPEREREQgICAgSERER + ERESEhISDg4SEg4REhIcHBwODhcbFhcXFxcSEg4TFRAPDQ0VHBEPCxcSEhcTEREcEhMTFh4d + DhwPDwkJFw4REQUSCwsSEg4JCQ8mExITEhIICAgIFhYWFRUVCA4ODg4ODg4ODg4QCBIPEw8J + FhERERESFxcLCwsbGxsWEggSDxQPFA8SCgkSDg4ODg4OCw4OAAAAAAACAAgAAv//AAMAAQAA + AAIAAAxQCuxfDzz1AB8IAAAAAAC6ufC4AAAAALrCZ5H+if4dCkwHbQAAAAgAAQAAAAAAAA== + ]], "Vera.ttf", "base64") + + love.graphics.newFont = function(font, size) + if type(font) == "number" or not font then + size = font + font = vera_ttf + end + return love.graphics.newFont1(font, size or 12) + end + + love.graphics.setNewFont = function(...) + local font = love.graphics.newFont(...) + love.graphics.setFont(font) + return font + end + + love.graphics.print = function (...) + if not love.graphics.getFont() then + love.graphics.setNewFont(12) + end + love.graphics.print1(...) + love.graphics.print = love.graphics.print1 + end + + love.graphics.printf = function (...) + if not love.graphics.getFont() then + love.graphics.setNewFont(12) + end + love.graphics.printf1(...) + love.graphics.printf = love.graphics.printf1 + end + + -- PIXEL EFFECTS + function love.graphics._effectCodeToGLSL(code) + local header = [[#version 120 + #define number float + #define Image sampler2D + #define extern uniform + #define Texel texture2D + uniform sampler2D _tex0_;]] + local footer = [[void main() { + // fix weird crashing issue in OSX when _tex0_ is unused within effect() + float dummy = texture2D(_tex0_, vec2(.5)).r; + gl_FragColor = effect(gl_Color, _tex0_, gl_TexCoord[0].xy, gl_FragCoord.xy); + }]] + + local function include(quoted_path) return (love.filesystem.read(quoted_path:sub(2,-2))) end + code = code:gsub("#include (%b'')", include) + code = code:gsub('#include (%b"")', include) + + return table.concat{header, "\n", code, footer} + end + + function love.graphics._transformGLSLErrorMessages(message) + if not message:match("Cannot compile shader") then return message end + local lines = {"Cannot compile shader:"} + for l in message:gmatch("[^\n]+") do + -- nvidia compiler message: + -- 0() : error/warning [NUMBER]: + local linenumber, what, message = l:match("^0%((%d+)%)%s*:%s*(%w+)[^:]+:%s*(.+)$") + if not linenumber then + -- ati compiler message: + -- ERROR 0:: error/warning(#[NUMBER]) [ERRORNAME]: + linenumber, what, message = l:match("^%w+: 0:(%d+):%s*(%w+)%([^%)]+%)%s*(.+)$") + end + if linenumber and what and message then + lines[#lines+1] = ("Line %d: %s: %s"):format(linenumber - 5, what, message) + end + end + -- did not match any known error messages + if #lines == 1 then return message end + return table.concat(lines, "\n") + end + + -- helper to transform a matrix from {{a,b,c}, {d,e,f}, ...} to + -- {a, b, c, d, e, f, ...} + local function flattenMatrices(mat, ...) + if not mat then return end + + local ret,l = {}, 1 + ret.dimension = #mat + + for i = 1,#mat do + for k = 1,#mat[i] do + ret[l], l = tonumber(mat[i][k]), l+1 + end + end + + return ret, flattenMatrices(...) + end + + -- automagic uniform setter + local function pixeleffect_dispatch_send(self, name, value, ...) + if type(value) == "number" then -- scalar + self:sendFloat(name, value, ...) + elseif type(value) == "userdata" and value:typeOf("Image") then + self:sendImage(name, value) + elseif type(value) == "userdata" and value:typeOf("Canvas") then + self:sendCanvas(name, value) + elseif type(value) == "table" then -- vector or matrix + if type(value[1]) == "number" then + self:sendFloat(name, value, ...) + elseif type(value[1]) == "table" then + self:sendMatrix(name, flattenMatrices(value, ...)) + else + error("Cannot send value (unsupported type: {"..type(value[1]).."}).") + end + else + local t = type(value) + if t == "userdata" and value.type then t = value.type end + error("Cannot send value (unsupported type: "..t..").") + end + end + + local newPixelEffect = love.graphics.newPixelEffect + function love.graphics.newPixelEffect(code) + love.graphics.newPixelEffect = function(code) + if love.filesystem and love.filesystem.exists(code) then + code = love.filesystem.read(code) + end + return newPixelEffect(code) + end + + local effect = love.graphics.newPixelEffect(code) + local meta = getmetatable(effect) + meta.send = pixeleffect_dispatch_send + return effect + end + +end