Ok, I appreciate your reply. You made several good points. I will have to keep this in mind. I'll have to review your tutorial as it seems it goes over exactly what i'm trying to accomplish.
If I understand you right this is how I could create a buffer between my code and SFML:
/////Only reason I define functions in the same file as the header is to save space////
class SFMLInput
{
private:
public:
bool IsKeyDown(sf::Input & Input, sf::Key::Code KeyCode)
{return (input.IsKeyDown(Keycode));}
//...
};
class GenInput
{
private:
//...
public:
bool IsKeyDown(Keycode keycode)
{return (SFMLInput.IsKeyDown(keycode));}
}
Is this somewhat what you're talking about? With this example it seems I would run into the problem of separating Keycodes from SFML's keycodes. The first solution I see is to create my own enum of keycodes, but that is kind of redundant and doesn't reuse code, so probably a bad idea.
So unless I can use a reference or pointer to an enum (i've never really tried), i'm going to have to think this through further. I could use a get function to return the value of the key, so:
class SFMLInput
{
public:
//Get functions for all keys I would use
int GetKeyW() {return sf::Key::W;}
//...
};
class GenInput
{
bool IsKeyDown(int KeyCode)
{return SFMLInput.IsKeyDown(KeyCode);}
//And Could Be Used As Such///
class SomethingToDoWithSpriteMovement
{
private:
vector2 position;
GenInput genInput;
SFMLInput sfmlInput;
public:
void move() {
if (genInput.IsKeyDown(sfmlInput.GetKeyW()))
position.x += speed;
};
If I don't get this implemented 100% I won't mind but it is good practice to try anyway.
I am more concerned with my game's architecture and class structure.
[EDIT]
I just realized I messed this up because I was not passing sf::Input to SFMLInput.IskeyDown.
So this doesn't work.