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

Pages: 1 2 [3]
31
Graphics / Divide By Zero When Drawing
« on: July 05, 2012, 04:54:15 pm »
I don't think it's normal to get a divide by zero error when drawing a sprite. Haha.

Check this out...
for (unsigned i = 0; i < tiles.size(); ++i)
        if (tiles[i]->GetSprites().size() > 0) {
                cout << "Error ";
                cout << tiles[i]->GetSprites()[0].getPosition().x;
                _window->draw(tiles[i]->GetSprites().at(0));
                /// The only thing Tile::GetSprites() does is return the vector of sprites for the tile.
                /// I'm only using the first sprite though.
                cout << " Here!" << endl;
        }

I ran through the code a lot and isolated the error to this section of the code.... drawing my sprites. The output of the program into the console shows that its the drawing that causes the error.
The output is as follows (verbatum):
Quote
Error 32 Here!
Error 64 Here!
Error 96 Here!
Error 128 Here!
Error 160 Here!
Error 192 Here!
Error 224 Here!
Error 256

Unhandled exception at 0x0f6d2382 in TheReverendGUI.exe: 0xC0000094: Integer division by zero.
As you can see, it successfully accesses the sprites in the vector well enough to output their position, but I get this error only on ONE of these sprites... Any idea what this might be?

Windows 7
SFML 2.0

32
Graphics / Re: sf::Sprite in 2
« on: July 03, 2012, 03:29:49 pm »
Oh!!! Nice. That is a really cool modification that Laurent made. It will help make my programs run faster. Thanks for the awesome information, buddy. If I could upvote your posts, I would.

33
General / Re: GUI Question
« on: July 02, 2012, 09:36:17 pm »
Okay sweet. Thanks for the awesome answers guys. :) Much appreciated.

34
Graphics / Re: sf::Sprite in 2
« on: July 02, 2012, 09:35:12 pm »
Okay so basically what you're saying is that the image class is normal except it can't load from file? It has to be set pixel by pixel and texture is the opposite?

35
Graphics / sf::Sprite in 2
« on: July 02, 2012, 07:44:09 pm »
I can't seem to figure out how the SF::Sprite class changed from 1.6 to 2.0. I had a line of code that had a Sprite being made with an image in the parameters. The constructor has changed to contain a texture now and I'm not sure how to use that. Do all my images need to change to textures? Are they equivalent?

36
General / Re: GUI Question
« on: July 01, 2012, 11:26:39 pm »
Well, I know what I want to turn out, but I don't know which is best. Haha. I'll just try one and see how it goes. :P Thanks for the help.

37
General / Re: GUI Question
« on: July 01, 2012, 09:48:18 pm »
That's the problem. I'm not quite sure which method is best suited for this situation. I know the GUI needs to interact with the game but you can pass stuff to it through Qt. An SFML GUI seems more practical but I'm not sure. Haha

38
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: July 01, 2012, 08:58:20 pm »
Sweet. This system looks very promising. You've got my vote.

39
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: July 01, 2012, 08:43:39 pm »
So, in other words, the picture class can be used as a button?

40
General / GUI Question
« on: July 01, 2012, 08:18:57 pm »
I'm working on an RPG Dungeon Crawler and I need to make a GUI for it. Would the best way be to use a GUI System that was made with SFML or simply integrate my game into a Qt widget and make the GUI from Qt?

41
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: July 01, 2012, 08:08:33 pm »
If this feature doesn't already exist, it would be nice to have a picture button. If you add that, I will totally use this GUI.

42
General / Re: SFML and Qt
« on: July 01, 2012, 06:32:28 pm »
Thanks for the answer. :)

43
General / SFML and Qt
« on: June 30, 2012, 10:18:19 pm »
Hey guys. I want to use SFML and Qt together but not in the way described in the tutorial. Is there possibly a way to have an SFML window first and put Qt widgets into it to create a GUI rather then he other way?

44
Graphics / Deleting Images
« on: April 12, 2012, 09:01:23 pm »
Hey.
I have a for loop that creates an sf::Image* every time it loops. I want to put those sf::Image*'s into a vector and delete them to free up memory, for I wouldn't be able to access them for deletion later. I understand the sf::Sprite needs the source image around when I stick it in another vector which it why I want to keep the sf::Image*'s in a vector, but the sf::Image*'s lose there data when I copy them into the vector. A white screen is displayed where the image is supposed to be.
Is there a way to safely transfer the images and sprites into vectors?

Pages: 1 2 [3]
anything