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 - Mr_Blame

Pages: 1 ... 3 4 [5] 6 7 ... 13
61
And yes, in C++11 we can initialize structures this way.

My bad :)

Didn't try this feature so long that I began to think, that this is a C only style.

62
Right click on sf::RenderWindow and press "go to defenition" and you will arrive at "RenderWindow.hpp".

63
Look at RenderWindow.h maybe somehow the sf::RenderWindow::create got renamed.

EDIT:
Which SFML version you have?

64
Why do you include "Window.h" in "Window.h" this already must cause compilation error.
#ifndef WINDOW_H
#define WINDOW_H

#include <string>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
class Window
{
public:
    Window();
    Window(std::string& title, sf::Vector2u& windowSize);
    ~Window();

private:
    std::string m_title;
    sf::Vector2u m_windowSize;
    sf::RenderWindow m_window;
    bool m_fullScreen;
    bool m_isDone;

    void setup(const std::string& title, sf::Vector2u windowSize);
    void create();
};

#include "Window.h" //<- why


Window::Window()
{
    setup("My Window", sf::Vector2u(640, 480));
}

Window::Window(std::string & title, sf::Vector2u & windowSize)
{
    setup(title, windowSize);
}


Window::~Window()
{
}

void Window::setup(const std::string & title, sf::Vector2u windowSize)
{
    m_title = title;
    m_windowSize = windowSize;
    m_fullScreen = false;
    m_isDone = false;
    create();
}

void Window::create()
{
    auto style = (m_fullScreen ? sf::Style::Fullscreen : sf::Style::Default);
    m_window.create() //sf::RenderWindow has no member "create"
}

#endif // !WINDOW_H

 
Because as long as I see this, it makes me think, that function definitions and function declarations are in the same file.

65
Rename your "create" to something another e.g. initMyWindow.

66
Which error message you get? Still the same?

EDIT:
Are you supposed to initialize sf::VideoMode that way?

67
Sf::RenderWindow::create needs some arguments, it cannot be called with no arguments(see API documentation). So error message, that you get, is correct there is no such sf::RenderWindow::create overload that accepts no arguments.

68
Yes for 2 reasons
1.) you must have the sperate array for textures, because the sprite holds only a const pointer to texture.
2.) texture gets destroyed when its instance goes out of scope.

69
Material system!!! 8) :)

70
Graphics / Re: Keyobard input lowers FPS and almost pauses the game
« on: May 02, 2016, 02:40:24 pm »
Show us game.render. It will be interesting to look inside, rendering because 30 fps with no events processed seems weird to me... It invokes a simple question: "what are you rendering".

71
I would give level editor access to render system, so when you start editing -> level editor calls "disableEffectRendering" and "disableFogRendering".
Rendering doesn't have to know what level editor doing, but level editor must.

72
Graphics / Re: Keyobard input lowers FPS and almost pauses the game
« on: May 02, 2016, 12:28:38 pm »
What's up with with your SFML .lib files, reinstalling SFML from scratch because some .lib issues can cause slowdown.

P.S

Which SFML versions you have?

73
Feature requests / Re: More Events
« on: April 18, 2016, 04:02:12 pm »
these events are not game-realted.

74
General / Re: Creating array from image
« on: April 17, 2016, 03:36:10 pm »
Well, thats because std::map uses operator of comparison in its functions and sf::Colour doesn't have overlapping ad of it.

75
General / Re: Help! I'm an idiot (and new) pollEvent()
« on: April 16, 2016, 09:47:05 pm »
Sfml has an event queue when you call
window.pollEvent();
you take one
sf::Event
from queue and process it, then you usually repeat using while it until queue gets empty, after this goes something to related to event polling.

Pages: 1 ... 3 4 [5] 6 7 ... 13