Skip to content

Instantly share code, notes, and snippets.

@Ulu2005
Last active August 29, 2015 14:06
Show Gist options
  • Save Ulu2005/4f41ca4ab1b0c11d80cc to your computer and use it in GitHub Desktop.
Save Ulu2005/4f41ca4ab1b0c11d80cc to your computer and use it in GitHub Desktop.
soji fsopengl lib mouse func usage
#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);
@Ulu2005
Copy link
Author

Ulu2005 commented Sep 25, 2014

snippet. cannot use directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment