1
Window / Can't access requestFocus function
« on: September 22, 2017, 02:07:43 am »
This is my first project working with sfml and I'm creating a full screen program on a Raspberry Pi 3 that captures keyboard input and tracks the outcome of a board game. I noticed that occasionally my fullscreen renderwindow will "freeze"- not accept input from keyboard, as well as stopping a rotating set of 4 graphics in one area - and the only way to exit is to kill the program from the command line. Reading more into it, I think I realized that it has to do with my window losing focus. I've researched in depth and found the requestFocus function which I'm hoping will fix my problem- along with some hasFocus booleans - but when I went to implement this, apparently the requestFocus function doesn't exist.
Sf::RenderWindow window;
window.requestFocus();
When I try to compile, it says class sf::RenderWindow has no member named 'requestFocus'. I've tried it with just a Window class as well.
This is honestly one of my first full projects, so it might be a stupid question/simple fix like a #include that I missed or something, but I can't find anything about why this isn't working for me. Anyone got any ideas or workarounds?
Here's my heading:
#include <SFML/Graphics.hpp>
#include <iostream>
#include <cstdio>
#include <cstdlib>
Thanks
Sf::RenderWindow window;
window.requestFocus();
When I try to compile, it says class sf::RenderWindow has no member named 'requestFocus'. I've tried it with just a Window class as well.
This is honestly one of my first full projects, so it might be a stupid question/simple fix like a #include that I missed or something, but I can't find anything about why this isn't working for me. Anyone got any ideas or workarounds?
Here's my heading:
#include <SFML/Graphics.hpp>
#include <iostream>
#include <cstdio>
#include <cstdlib>
Thanks