Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Pages: 1 [2]

Author Topic: Mouse Cursor  (Read 3409 times)

KungFooMasta

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 47
    • View Profile
Mouse Cursor
« Reply #15 on: March 29, 2007, 08:49:47 AM »

I have a function called "sync_OS_mouse_to_CEGUI_Mouse" or something like that.  Whenever the mouse is moved, this function is called.  The mouse cursor looks the same insides and outside the window.  Are you using DISCL_NONEXCLUSIVE for your mouse? (Thats what I have mine set to)

KungFooMasta
Logged

Arcanor

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 47
    • View Profile
    • http://arcanoria.com
Mouse Cursor
« Reply #16 on: March 29, 2007, 01:37:55 PM »

Yes, DISCL_NONEXCLUSIVE for mouse events.
Logged
Arcanoria - online medieval fantasy RPG - www.arcanoria.com

KungFooMasta

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 47
    • View Profile
Mouse Cursor
« Reply #17 on: March 30, 2007, 09:32:39 AM »

Starting at line 272, in OgreD3D9RenderWindow.cpp:

Code: [Select]

// Register the window class
// NB allow 4 bytes of window data for D3D9RenderWindow pointer
WNDCLASS wc = { 0, WndProc, 0, 0, hInst,
LoadIcon(0, IDI_APPLICATION), LoadCursor(NULL, IDC_ARROW),
(HBRUSH)GetStockObject(BLACK_BRUSH), 0, "OgreD3D9Wnd" };
RegisterClass(&wc);

// Create our main window
// Pass pointer to self
mIsExternal = false;
mHWnd = CreateWindow("OgreD3D9Wnd", title.c_str(), dwStyle,
mLeft, mTop, mWidth, mHeight, parentHWnd, 0, hInst, this);


This is the code that sets the os cursor image when over the window.

Now I need to try and change the LoadCursor parameter to be a transparent icon, hope it works out!

I'm also hoping I can easily change the icon, to make the app more unique.  :D

KungFooMasta
Logged

KungFooMasta

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 47
    • View Profile
Mouse Cursor
« Reply #18 on: April 04, 2007, 04:38:58 PM »

Hm, I got it working now, but with a different method...

Code: [Select]

void LumeriaApplication::run()
{
ShowCursor(false);

showRenderStats(true);
// This is needed to calculate time since last frame,
// and give the Active System a chance to do some calculations every frame
mRoot->addFrameListener(this);

while( !mQuit )
{
mWindow->setActive(true);

Ogre::WindowEventUtilities::messagePump();

if( !mPaused ) mRoot->renderOneFrame();
updateRenderStats();

//Need to capture/update each device
if(mKeyboard) mKeyboard->capture();
if(mMouse) mMouse->capture();
if(mJoyStick) mJoyStick->capture();

// processUnbufferedKeyInput(evt);
// processUnbufferedMouseInput(evt);
}

ShowCursor(true);
}


Basically show cursor before program runs, and hide before program terminates.

KungFooMasta
Logged
Pages: 1 [2]