I'd like to know if I can use any API functions to read the mouse status (position and buttons, most likely). If so, which.
I don't like having to include SDL.DLL just for mouse support, y'know
There are API functions to load a cursor, Show, Hide, check your windows reference.
To get the mouse clicks you must check in your callback function for these messages:
Inside the client area:
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_LBUTTONDBLCLK >> only if window's windclass.style has the bit CS_DBLCLKS
(the same for RBUTTON and MBUTTON)
also
WM_MOUSEMOVE
The hparam of the message comes with the position of the mouse buttons and control keys HT_xxxx (Winuser.h)
The mouse position in client area coords comes in the lparam of each message..
pt[iCount].x = LOWORD (lParam) ;
pt[iCount].y = HIWORD (lParam) ;
If mouse is outside the client area of the window you will receive
WM_NCLBUTTONDOWN WM_NCLBUTTONUP WM_NCLBUTTONDBLCLK
WM_NCMBUTTONDOWN WM_NCMBUTTONUP WM_NCMBUTTONDBLCLK
WM_NCRBUTTONDOWN WM_NCRBUTTONUP WM_NCRBUTTONDBLCLK
In the lparam you will have screen coords and in the hparam you will have an enum HT_xxxx (Winuser.h) indicating where the user has clicked.
You have these functions to convert client coords to screen coords and vice-versa
ScreenToClient (hwnd, &pt) ;
ClientToScreen (hwnd, &pt) ;
What I don't know is how will combine this with FB's graphics lib...
Yeah, but I want to avoid the message loop as much as possible. I was wondering if there were any easy-to-call functions. I'll keep researching.
We could ask Angelo to add mouse and a multikey handler to the to the graphics lib...
The event loop must be somewhere inside the graphics lib...
Yeah, that would be really useful. The problem is that he claimed that his replacement was... a replacement
I'll ask him anyways. If he added those two things, coding a game in fB would be easy as hell.
Awesome, thank you very much. That's exactly what I needed. I'll work the other functions out myself, knowing that it is in user32.dll (Google wonders
)
Thanks again.