From f879f8af04b5114d05d3adadf3c1efac49cf8b91 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 7 Jan 2015 20:02:10 +0100 Subject: OPENGL: Limit mouse cursor drawing to inside game screen when no overlay is visible. --- backends/graphics/opengl/opengl-graphics.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'backends/graphics/opengl/opengl-graphics.h') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index dde21533b0..cec970e0cc 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -155,7 +155,7 @@ protected: * @param x X coordinate in physical coordinates. * @param y Y coordinate in physical coordinates. */ - void setMousePosition(int x, int y) { _cursorX = x; _cursorY = y; } + void setMousePosition(int x, int y); /** * Query the mouse position in physical coordinates. @@ -393,6 +393,16 @@ private: */ int _cursorY; + /** + * X coordinate used for drawing the cursor. + */ + int _cursorDisplayX; + + /** + * Y coordinate used for drawing the cursor. + */ + int _cursorDisplayY; + /** * The X offset for the cursor hotspot in unscaled coordinates. */ @@ -454,6 +464,11 @@ private: */ byte _cursorPalette[3 * 256]; + /** + * Draws a rectangle + */ + void drawRect(GLfloat x, GLfloat y, GLfloat w, GLfloat h); + #ifdef USE_OSD // // OSD -- cgit v1.2.3