Author Topic: Improvement to windowed mode  (Read 2058 times)

pziko

  • Guest
Improvement to windowed mode
« on: 24 February 2008, 21:53:44 »
In windowed mode the windows cursor is visible as well as the game cursor. This is annoying but the following simple addition to window.cpp gets rid of it.

At the end of Window::eventRouter, just after the WM_DESTROY message handler add:

   case WM_SETCURSOR:  //Remove cursor in windowed mode
      ShowCursor(false);
      return false;
      break;
« Last Edit: 1 January 1970, 00:00:00 by pziko »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #1 on: 24 February 2008, 23:04:09 »
I did the same thing a while back but I can't find the post now.

Anyway, the problem is that the same value for Windowed in glest.ini is being used to decide whether to show the cursor or not.

In main.cpp:
Code: [Select]
int glestMain(int argc, char** argv){
...
...
showCursor(config.getBool("Windowed"));
...
...


What I did was create another entry in glest.ini to do this task so it is independent of being fullscreen. The other option would just to set it to false.

This way will work on Windows and other OSs. I'm not sure if it works with toggling fullscreen. I'd say the cursor stays what the value is set in main. There is nothing to suggest otherwise in window.cpp in Window::toggleFullscreen().
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

pziko

  • Guest
(No subject)
« Reply #2 on: 24 February 2008, 23:29:33 »
Ha, I hadn't noticed the showCursor command in glestMain().

You are quite right, changing it there is all you need, no need to intercept the message. I can't think of any reason a user would ever want to see two cursors so I'm just going to change it to showCursor(false) there and leave it at that.
« Last Edit: 1 January 1970, 00:00:00 by pziko »

ArcaneTime

  • Guest
(No subject)
« Reply #3 on: 16 April 2008, 22:37:21 »
Where would I find the window.cpp file?
B/c this cursor thing is driving me nuts...
I tried to open the .exe with the C++ software -- guessing this isn't how it's done, so any suggestions?
« Last Edit: 1 January 1970, 00:00:00 by ArcaneTime »

ZaggyDad

  • Guest
(No subject)
« Reply #4 on: 16 April 2008, 22:49:52 »
You have to get the source. You should probably take a look at this:

http://www.glest.org/glest_board/viewtopic.php?t=3271

~Zaggy
« Last Edit: 1 January 1970, 00:00:00 by ZaggyDad »

 

anything