1
C / Using sfInput
« on: September 26, 2011, 12:58:38 am »
I'm just writing a simple pong game, for that reason I think I need to use sfInput instead of sfEvent, the problem is that I don't know how.
If I use
I get the following error:
But if I use:
It compiles fine, but everything fails during performance. So my cuestion is how to use correctly this function.
Plus I have to say I'm not using csfml, I'm using derelict.sfml a binding from csfml to D.
If I use
Code: [Select]
sfInput *input = sfRenderWindow_GetInput(App);
if(sfInput_IsKeyDown(input, sfKeyUP)
sfShape_Move(racket, 0.f, moveY);
I get the following error:
Code: [Select]
cannot inplicity convert expresison (module App) of type void to sfRenderWindow
But if I use:
Code: [Select]
sfInput *input;
if(sfInput_IsKeyDown(input, sfKeyUP)
sfShape_Move(racket, 0.f, moveY);
It compiles fine, but everything fails during performance. So my cuestion is how to use correctly this function.
Plus I have to say I'm not using csfml, I'm using derelict.sfml a binding from csfml to D.