From a64fbfbe6379eba8b302a0787b23ded510f680a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 20 Feb 2012 22:28:04 +0100 Subject: [PATCH] Use OpenGL-compatible types in camera viewport size. --- src/Camera.cpp | 2 +- src/Camera.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Camera.cpp b/src/Camera.cpp index 72c97bd31..fd90620fc 100644 --- a/src/Camera.cpp +++ b/src/Camera.cpp @@ -62,7 +62,7 @@ void Camera::setPerspective(GLfloat fov, GLfloat near, GLfloat far) { fixAspectRatio(); } -void Camera::setViewport(const Math::Vector2& size) { +void Camera::setViewport(const Math::Vector2& size) { glViewport(0, 0, size.x(), size.y()); _viewport = size; diff --git a/src/Camera.h b/src/Camera.h index 5a9713777..f242a5012 100644 --- a/src/Camera.h +++ b/src/Camera.h @@ -103,7 +103,7 @@ class MAGNUM_EXPORT Camera: public Object { inline Matrix4 projectionMatrix() const { return _projectionMatrix; } /** @brief Viewport size */ - inline Math::Vector2 viewport() const { return _viewport; } + inline Math::Vector2 viewport() const { return _viewport; } /** * @brief Set viewport size @@ -111,10 +111,10 @@ class MAGNUM_EXPORT Camera: public Object { * Called when assigning the camera to the scene or when window * size changes. */ - void setViewport(const Math::Vector2& size); + void setViewport(const Math::Vector2& size); - /** @copydoc setViewport(const Math::Vector2& size); */ - inline void setViewport(unsigned int width, unsigned int height) { + /** @copydoc setViewport(const Math::Vector2& size); */ + inline void setViewport(GLsizei width, GLsizei height) { setViewport({width, height}); } @@ -157,7 +157,7 @@ class MAGNUM_EXPORT Camera: public Object { Vector4 _clearColor; GLfloat _near, _far; - Math::Vector2 _viewport; + Math::Vector2 _viewport; AspectRatioPolicy _aspectRatioPolicy; void fixAspectRatio();