IPHONE: Implement cursor visibility change again.

This commit is contained in:
Johannes Schickel 2012-02-20 00:29:08 +01:00
parent 438bc50115
commit 93d80793b4
3 changed files with 9 additions and 1 deletions

View File

@ -75,6 +75,7 @@ bool iPhone_isHighResDevice();
int iPhone_getScreenHeight();
int iPhone_getScreenWidth();
void iPhone_enableOverlay(int state);
void iPhone_showCursor(int state);
void iPhone_setMouseCursor(short *buffer, int width, int height, int hotspotX, int hotspotY);
uint getSizeNextPOT(uint size);

View File

@ -55,6 +55,7 @@ static int _mouseCursorHotspotX = 0;
static int _mouseCursorHotspotY = 0;
static int _mouseX = 0;
static int _mouseY = 0;
static int _mouseCursorEnabled = 0;
// static long lastTick = 0;
// static int frames = 0;
@ -74,6 +75,10 @@ int printOglError(const char *file, int line) {
return retCode;
}
void iPhone_showCursor(int state) {
_mouseCursorEnabled = state;
}
void iPhone_setMouseCursor(short *buffer, int width, int height, int hotspotX, int hotspotY) {
_mouseCursor = buffer;
@ -271,7 +276,8 @@ bool getLocalMouseCoords(CGPoint *point) {
if (_overlayIsEnabled)
[self updateOverlaySurface];
[self updateMouseSurface];
if (_mouseCursorEnabled)
[self updateMouseSurface];
glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer); printOpenGLError();
[_context presentRenderbuffer:GL_RENDERBUFFER_OES];

View File

@ -332,6 +332,7 @@ int16 OSystem_IPHONE::getOverlayWidth() {
bool OSystem_IPHONE::showMouse(bool visible) {
bool last = _mouseVisible;
_mouseVisible = visible;
iPhone_showCursor(visible);
_mouseDirty = true;
return last;