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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Tomaszlek

Pages: [1]
1
General / Re: Trouble with textures
« on: January 28, 2018, 11:08:30 pm »
Well, your advice will help me,maybe it's too early for me to write games in SFML, surely I go back to my C ++ book (very good indeed, written by Jerzy Grębosz). I have already understand the error in the code and I fixed it but I think it's better that I have to learn C ++ for about next half a year and then start writing games seriously. Thank you and best regards

2
General / Re: Trouble with textures
« on: January 28, 2018, 09:41:25 pm »
So what should I change in this code because I don't know(I've learned C++ since 4 months and SFML since 2 weeks but I know I'm stupid)

3
General / Re: Trouble with textures
« on: January 28, 2018, 08:09:55 pm »
The error is: no matching function for call to 'TextureManager::loadTexture(sf::Sprite& const char[17])

4
General / Trouble with textures
« on: January 28, 2018, 07:30:33 pm »
That's my first topic on this forum and I have trouble with this error and I don't know how it fix.
There's the code:
#include <stack>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include "game.h"
#include "game_state.h"
#include "texture_manager.h"
using namespace sf;
void Game::loadTextures()
{
    menedzertekstur.loadTexture(background, "RTS/tlo_menu.png");
}
and
void TextureManager::loadTexture(const std::string& name, const std::string& filename)
{
    /* Load the texture */
    sf::Texture tex;
    tex.loadFromFile(filename);

    /* Add it to the list of textures */
    this->textures[name] = tex;
    return;
}
public:

    /* Add a texture from a file */
    void loadTexture(const std::string& name, const std::string &filename);
class Game
{
private:
    void loadTextures();

    public:
    stack<GameState*> states;

    RenderWindow window;
    TextureManager menedzertekstur ;
    Sprite background;

Pages: [1]
anything