summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2020-02-13 18:26:38 -0600
committerepoch <epoch@hacking.allowed.org>2020-02-13 18:26:38 -0600
commitcd860515cd91c07b6cd88fab8a9c23acd5dbb46d (patch)
tree132ffbdfdf89196ef5a66c2b349b0bd73e04e2ed /src
parentc2762d3d34bee711169c12559a224714949b4c85 (diff)
downloadhackvr-cd860515cd91c07b6cd88fab8a9c23acd5dbb46d.tar.gz
hackvr-cd860515cd91c07b6cd88fab8a9c23acd5dbb46d.zip
ignore the comment. going to set camera angle directly from mouse_x11.c for now. will move to generic place later.
Diffstat (limited to 'src')
-rw-r--r--src/mouse_x11.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mouse_x11.c b/src/mouse_x11.c
index 0c4f1e9..2442953 100644
--- a/src/mouse_x11.c
+++ b/src/mouse_x11.c
@@ -1,3 +1,4 @@
+#include <stdio.h>//for fprintf stderr. remove me later.
#include "mouse_x11.h"
#include "common.h"
#include "graphics_c3.h"
@@ -48,7 +49,8 @@ int mouse_event_handler() {//this returns HVM_ key + for buttondown and - for bu
}
}
if(motion_notify) {
- //mouse.x and mouse.y are shorts. this function expects ints. why are these shorts?
+ //mouse.x and mouse.y are both ints now...
+ //fprintf(stderr,"# mouse.x: %f mouse.y: %f\n# width: %u height: %u\n",gra_global.mouse.x,gra_global.mouse.y,gra_global.width,gra_global.height);
XQueryPointer(x11_global.dpy,x11_global.w,&root,&child,&rmouse.x,&rmouse.y,&mouse.x,&mouse.y,&mask);
gra_global.mouse=cs_to_c2(mouse);
//return 1;
@@ -57,8 +59,10 @@ int mouse_event_handler() {//this returns HVM_ key + for buttondown and - for bu
//self-command myself to rotate myself?
//snprintf(cmd,sizeof(cmd),"%s rotate +%d +%d +%d\n",global.user,3,11,1);
//selfcommand(cmd);
- //global.camera.r.x.d=((gra_global.height/2) - gra_global.mouse.y);
- //global.camera.r.y.d=(gra_global.mouse.x - (gra_global.width/2));
+ //global.camera.r.x.d=(gra_global.height - gra_global.mouse.y);//up and down camera controls backwards
+ //fprintf(stderr,"# mouse.x: %f mouse.y: %f\n# width: %u height: %u\n",gra_global.mouse.x,gra_global.mouse.y,gra_global.width,gra_global.height);
+ global.camera.r.x.d=(gra_global.mouse.y);
+ global.camera.r.y.d=(gra_global.mouse.x);
}
if(redrawplzkthx) {
redraw();