Hi. I'm really sorry for my noob questions, but I'm pretty new to all this. The thing is I donĀ“t know how to make Joystick works. For Example, I have this code:
int parsekey() {
char k;
if (_kbhit() == 0) return 0;
k = _getch();
switch (k){
case 'w': if (movedir != 3) {movedir = 1;} return 0; break;
case 'a': if (movedir != 4) {movedir = 2;} return 0; break;
case 's': if (movedir != 1) {movedir = 3;} return 0; break;
case 'd': if (movedir != 2) {movedir = 4;} return 0; break;
case 'p':
gotoxy(console_x / 2 - 5, console_y / 2 - 1);
printf ("P A U S E D");
do { k = _getch(); } while (k != 'p');
pos p; p.y = (world_y) / 2 - 1;
for ( p.x = (world_x) / 2 - 5;
p.x <= (world_x) / 2 + 5;
p.x++)
render_pos(p);
break;
case 27: // esc
return 1;
break;
}
return 0;
}
This is an actual code intended to move a character, and it is functionally working. What I want to do is make use of the joystick function. I have Code::Blocks and SFML 1.6 already working and well configured, but maybe I'm missing something (I have followed
THIS tutorial).
So, what I started doing is adding this lines just to make sure it is compilling.
float x;
x = sf::Input::GetJoystickAxis(1, sf::Joy::AxisX);
And I have the following error:
cannot call member function 'float sf::Input::GetJoystickAxis(unsigned int, sf::Joy::Axis) const' without objectAs I said, I'm pretty noob with all this, so I don't even know what's that error meaning. Please, if you could help I would be really gratefull. If you need to know something more, please tell. I need to have this working.