Browse Source

Merge branch 'master' into compatibility

Vladimír Vondruš 14 years ago
parent
commit
ec675b25cc
  1. 31
      src/Context.h
  2. 5
      src/Math/Vector.h

31
src/Context.h

@ -144,19 +144,34 @@ class MAGNUM_EXPORT Context {
/** @brief Current context */ /** @brief Current context */
inline static Context* current() { return _current; } inline static Context* current() { return _current; }
/** @brief OpenGL version */ /**
* @brief OpenGL version
*
* @see majorVersion(), minorVersion(), versionString(),
* shadingLanguageVersionString()
*/
inline Version version() const { return _version; } inline Version version() const { return _version; }
/** @brief Major OpenGL version (e.g. `4`) */ /**
* @brief Major OpenGL version (e.g. `4`)
*
* @see minorVersion(), version(), versionString(),
* shadingLanguageVersionString()
*/
inline GLint majorVersion() const { return _majorVersion; } inline GLint majorVersion() const { return _majorVersion; }
/** @brief Minor OpenGL version (e.g. `3`) */ /**
* @brief Minor OpenGL version (e.g. `3`)
*
* @see majorVersion(), version(), versionString(),
* shadingLanguageVersionString()
*/
inline GLint minorVersion() const { return _minorVersion; } inline GLint minorVersion() const { return _minorVersion; }
/** /**
* @brief Vendor string * @brief Vendor string
* *
* @see @fn_gl{GetString} with @def_gl{VENDOR} * @see rendererString(), @fn_gl{GetString} with @def_gl{VENDOR}
*/ */
inline std::string vendorString() const { inline std::string vendorString() const {
return reinterpret_cast<const char*>(glGetString(GL_VENDOR)); return reinterpret_cast<const char*>(glGetString(GL_VENDOR));
@ -165,7 +180,7 @@ class MAGNUM_EXPORT Context {
/** /**
* @brief Renderer string * @brief Renderer string
* *
* @see @fn_gl{GetString} with @def_gl{RENDERER} * @see vendorString(), @fn_gl{GetString} with @def_gl{RENDERER}
*/ */
inline std::string rendererString() const { inline std::string rendererString() const {
return reinterpret_cast<const char*>(glGetString(GL_RENDERER)); return reinterpret_cast<const char*>(glGetString(GL_RENDERER));
@ -174,7 +189,8 @@ class MAGNUM_EXPORT Context {
/** /**
* @brief Version string * @brief Version string
* *
* @see @fn_gl{GetString} with @def_gl{VERSION} * @see shadingLanguageVersionString(), version(), @fn_gl{GetString}
* with @def_gl{VERSION}
*/ */
inline std::string versionString() const { inline std::string versionString() const {
return reinterpret_cast<const char*>(glGetString(GL_VERSION)); return reinterpret_cast<const char*>(glGetString(GL_VERSION));
@ -183,7 +199,8 @@ class MAGNUM_EXPORT Context {
/** /**
* @brief Shading language version string * @brief Shading language version string
* *
* @see @fn_gl{GetString} with @def_gl{SHADING_LANGUAGE_VERSION} * @see versionString(), version(), @fn_gl{GetString} with
* @def_gl{SHADING_LANGUAGE_VERSION}
*/ */
inline std::string shadingLanguageVersionString() const { inline std::string shadingLanguageVersionString() const {
return reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)); return reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION));

5
src/Math/Vector.h

@ -53,13 +53,12 @@ template<std::size_t size, class T> class Vector: public RectangularMatrix<1, si
} }
/** /**
* @brief Angle between normalized vectors * @brief Angle between normalized vectors (in radians)
* *
* @f[ * @f[
* \phi = acos \left(\frac{a \cdot b}{|a| \cdot |b|} \right) * \phi = acos \left(\frac{a \cdot b}{|a| \cdot |b|} \right)
* @f] * @f]
* @attention Assertion fails on non-normalized vectors and NaN is * @attention Both vectors must be normalized.
* returned.
*/ */
inline static T angle(const Vector<size, T>& normalizedA, const Vector<size, T>& normalizedB) { inline static T angle(const Vector<size, T>& normalizedA, const Vector<size, T>& normalizedB) {
CORRADE_ASSERT(MathTypeTraits<T>::equals(normalizedA.dot(), T(1)) && MathTypeTraits<T>::equals(normalizedB.dot(), T(1)), CORRADE_ASSERT(MathTypeTraits<T>::equals(normalizedA.dot(), T(1)) && MathTypeTraits<T>::equals(normalizedB.dot(), T(1)),

Loading…
Cancel
Save