Last active
August 29, 2015 14:06
-
-
Save Ulu2005/4f41ca4ab1b0c11d80cc to your computer and use it in GitHub Desktop.
soji fsopengl lib mouse func usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "fssimplewindow.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct cursor *PtrCursor; | |
struct cursor | |
{ | |
int lb, mb, rb, mx, my; | |
}; | |
PtrCursor mouse; | |
mouse = (PtrCursor)malloc(sizeof(cursor)); | |
FsGetMouseState(mouse->lb, mouse->mb, mouse->rb, mouse->mx, mouse->my); | |
//need check boundary, mx my can be outside window | |
printf("mx=%d,my=%d\n",mouse->mx,mouse->my); | |
//lb,mb,rb: whether left,mid,right button of mouse is pressed. 1=yes,0=no; | |
printf("lb=%d,mb=%d,rb=%d\n", mouse->lb, mouse->mb,mouse->rb); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
snippet. cannot use directly