I'm currently working on a CLI based audio player. But I'm having trouble with sfml's threading class.
I've privately inherited sf::Thread and overridden their virtual member function Run(). As I've done before and as the tutorial for using their libraries tells me to.
But this time around it's not executing the code in Run() when I start the thread.
Here is the class in question:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class input : private sf::Thread{
public:
int get_RetLevel();
input();
void startThread();
private:
virtualvoid Run(){
while(running){
parse_Input();
}
}
void parse_Input();
int retLevel;
bool running;
};
Nevermind, I fixed it. The main thread was finishing before the input one could take an input...adding a sleep function that waited while the program was running fixed this.