Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
index 0a96fbbe503..24c0102a87c 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
@@ -31,10 +31,6 @@
#include <assert.h>
#include "GHOST_ISystem.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPG_Canvas::GPG_Canvas(GHOST_IWindow* window)
: GPC_Canvas(0, 0), m_window(window)
{
@@ -79,6 +75,8 @@ void GPG_Canvas::SetMousePosition(int x, int y)
void GPG_Canvas::SetMouseState(RAS_MouseState mousestate)
{
+ m_mousestate = mousestate;
+
if (m_window)
{
switch (mousestate)
@@ -106,3 +104,13 @@ void GPG_Canvas::SwapBuffers()
m_window->swapBuffers();
}
}
+
+float GPG_Canvas::GetMouseNormalizedX(int x)
+{
+ return float(x)/this->GetWidth();
+}
+
+float GPG_Canvas::GetMouseNormalizedY(int y)
+{
+ return float(y)/this->GetHeight();
+}