Browse Source

Camera::setClearColor() is now static. Removed getter.

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
a32498361c
  1. 5
      src/Camera.cpp
  2. 16
      src/Camera.h

5
src/Camera.cpp

@ -115,11 +115,6 @@ void Camera::fixAspectRatio() {
} else _projectionMatrix = rawProjectionMatrix;
}
void Camera::setClearColor(const Magnum::Vector4& color) {
glClearColor(color.r(), color.g(), color.b(), color.a());
_clearColor = color;
}
void Camera::draw() {
Scene* s = scene();
CORRADE_ASSERT(s, "Camera: cannot draw without camera attached to scene", )

16
src/Camera.h

@ -69,6 +69,15 @@ class MAGNUM_EXPORT Camera: public Object {
/** @brief Set feature */
static void setFeature(Feature feature, bool enabled);
/**
* @brief Set clear color
*
* Initial value is `{0.0f, 0.0f, 0.0f, 1.0f}`.
*/
inline static void setClearColor(const Vector4& color) {
glClearColor(color.r(), color.g(), color.b(), color.a());
}
/**
* @brief Constructor
* @param parent Parent object
@ -140,12 +149,6 @@ class MAGNUM_EXPORT Camera: public Object {
*/
virtual void setViewport(const Math::Vector2<GLsizei>& size);
/** @brief Clear color */
inline Vector4 clearColor() const { return _clearColor; }
/** @brief Set clear color */
void setClearColor(const Vector4& color);
/**
* @brief Draw the scene
*
@ -185,7 +188,6 @@ class MAGNUM_EXPORT Camera: public Object {
Matrix4 rawProjectionMatrix;
Matrix4 _projectionMatrix;
Matrix4 _cameraMatrix;
Vector4 _clearColor;
GLfloat _near, _far;
Math::Vector2<GLsizei> _viewport;

Loading…
Cancel
Save