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

Pages: [1]
1
General discussions / Re: SFML Game Development -- A book on SFML
« on: June 29, 2013, 03:37:15 pm »
Ok!

Thanks a lot, I loved the ebook concept.

2
General discussions / Re: SFML Game Development -- A book on SFML
« on: June 29, 2013, 02:36:17 pm »
Wow, nice work guys!

Oh, does it explain how to create the structure of your game? Like how to handle inputs, render, update...

Thanks!

3
General / Re: How should inputs be handled properly on a game?
« on: June 23, 2013, 04:38:18 pm »
Thank you,

I tought it could be somthing everyone does in a way I didn't think of.

4
General / How should inputs be handled properly on a game?
« on: June 22, 2013, 07:41:38 pm »
Hello,

I'm making my first game and I until now I have been handling inputs (keyboard and mouse) in each class separately. So in my Sprite Editor class I have a method called "handler" which check the inputs and make actions depending on what are them:

void SpriteEditor::handler(sf::Vector2i mousePosition)
{
    if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
        {
         //Code here

    }
}
 

(the mouse position is sent to handler as I don't want to send the sf::RenderWindow to that method.)

But when I use the mouse in another class I also treat it in the same way as above. Of course I take care so that both classes wouldn't be in conflict using the same input at the same time.

The way I'm using is working, but something inside me tells that it is the worst way of doing it. How should I properly handle inputs with SFML?

Thank you.

5
Graphics / Re: How to work with std::vector when using pixel array.
« on: June 13, 2013, 02:21:51 pm »
Thank you all  :)

6
Graphics / How to work with std::vector when using pixel array.
« on: June 13, 2013, 03:54:26 am »
Hello,

I'm currently using a pixel array on my project. I want to use std::vector but werdly I can't.

For now I'm using:
sf::Uint8* pixels =  new sf::Uint8[sizeX * sizeY * 4];

sf::Image image;
image.create(sizeX, sizeY, pixels);
 

But if I try to change it to:
std::vector<sf::Uint8> pixels; //or even with sf::Uint8*
sf::Image image;
image.create(sizeX, sizeY, pixels);

My IDE gives me an error (before compiling) on image.create saying "no instance of overloaded function "sf::Image::create matches the argument list".

How do I properly create an image with a std::vector of pixels?

Thanks

Pages: [1]