SFML community forums

Bindings - other languages => C => Topic started by: Cukta on September 26, 2011, 12:58:38 am

Title: Using sfInput
Post by: Cukta 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

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.
Title: Using sfInput
Post by: Laurent on September 26, 2011, 06:05:12 am
The compiler says that App is a void, it should be a sfRenderWindow.