Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Using sfInput  (Read 4380 times)

0 Members and 1 Guest are viewing this topic.

Cukta

  • Newbie
  • *
  • Posts: 2
    • View Profile
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

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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Using sfInput
« Reply #1 on: September 26, 2011, 06:05:12 am »
The compiler says that App is a void, it should be a sfRenderWindow.
Laurent Gomila - SFML developer