erebus

diff liberebus/src/erebus.cc @ 10:506e114b7ca2

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 24 May 2014 17:43:46 +0300
parents d38e13d6063c
children 20d6c05529f1
line diff
     1.1 --- a/liberebus/src/erebus.cc	Sat May 24 17:22:53 2014 +0300
     1.2 +++ b/liberebus/src/erebus.cc	Sat May 24 17:43:46 2014 +0300
     1.3 @@ -57,6 +57,8 @@
     1.4  		return 0;
     1.5  	}
     1.6  
     1.7 +	rnd_gen.seed(time(0));
     1.8 +
     1.9  	ctx->scn = 0;
    1.10  	ctx->cur_time = 0;
    1.11  	ctx->cur_rect = INVALID_RECT;
    1.12 @@ -216,6 +218,13 @@
    1.13  	if(ctx->keystate.size() <= key) ctx->keystate.resize(key < 256 ? 256 : key + 1);
    1.14  
    1.15  	ctx->keystate[key] = pressed;
    1.16 +
    1.17 +	if(pressed) {
    1.18 +		switch(key) {
    1.19 +		case '=':
    1.20 +		case '-':
    1.21 +		}
    1.22 +	}
    1.23  	return false;
    1.24  }
    1.25  
    1.26 @@ -227,11 +236,29 @@
    1.27  	ctx->bnstate[bn] = pressed;
    1.28  	ctx->mouse_pos[0] = x;
    1.29  	ctx->mouse_pos[1] = y;
    1.30 +	return false;
    1.31  }
    1.32  
    1.33 -bool erb_input_mouse_motion(struct erebus *ctx, int x, int y);
    1.34 -bool erb_input_6dof_button(struct erebus *ctx, int bn, bool pressed);
    1.35 -bool erb_input_6dof_motion(struct erebus *ctx, float x, float y, float z);
    1.36 +bool erb_input_mouse_motion(struct erebus *ctx, int x, int y)
    1.37 +{
    1.38 +	if(!ctx) return false;
    1.39 +
    1.40 +	ctx->mouse_pos[0] = x;
    1.41 +	ctx->mouse_pos[1] = y;
    1.42 +	return false;
    1.43 +}
    1.44 +
    1.45 +bool erb_input_6dof_button(struct erebus *ctx, int bn, bool pressed)
    1.46 +{
    1.47 +	if(!ctx) return false;
    1.48 +	return false;
    1.49 +}
    1.50 +
    1.51 +bool erb_input_6dof_motion(struct erebus *ctx, float x, float y, float z)
    1.52 +{
    1.53 +	if(!ctx) return false;
    1.54 +	return false;
    1.55 +}
    1.56  
    1.57  
    1.58  }	// extern "C"