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

Pages: [1]
1
Graphics / Re: [2.0] Low FPS when Drawing
« on: November 11, 2012, 04:24:49 am »
If you wanted to know, replacing the sf::RectangleShapes with sf::Sprites increased the fps from 10 to 30.

2
Graphics / Re: [2.0] Low FPS when Drawing
« on: November 11, 2012, 04:19:10 am »
Oh, then I think it's probably just too much for my graphics card. 4000 shapes seemed pretty small, so I didn't think it was due to that. Seeing that I'm only using the rectangles to make solid colored squares, I'm going to see if replacing them with sprites increases my render speed.

3
Graphics / [2.0] Low FPS when Drawing [SOLVED]
« on: November 11, 2012, 04:05:38 am »
I've been getting really low framerates (10 fps) when drawing around 2000 sf::RectangleShapes alternating with 2000 sf::Sprites, which are all sized 8px X 12px. The drawable objects are contained in a class extending sf::Drawable and sf::Transform, with a very simple draw overload, which basically looks like this:
{
   states.transform *= getTransform();
   for(//... iterate through list
   {
       target.draw(rectangle, states);
       target.draw(sprite,states);
   }
}

After profiling I've noticed that that a huge amount of time is spent in sf::Transform::getInverse and new and delete calls made from sf::Transform::getInverse, which are found right after this draw call in the call stack. After looking through the SFML source code on GitHub for quite some time I haven't been able to find where this code calls getInverse().

If I comment out the calls to draw rectangles, the fps jumps up to over 200, while if I do the same for the sprites it only goes up to about 40 fps. With both removed it stays well over 500 fps.

Is there a problem with the way I am drawing these rectangles and sprites or does the problem lie elsewhere?

4
I didn't feel like I should start another topic for this, seeing as it's the same question.
So I've ported over to SFML 2.0, but I've run into the same problem. Maybe I'm missing something, but it looks like Sprite::setColor() changes the values of the verticies directly
If I want to set a color on my AnimatedSprite I have to manually calculate the blended value of the AnimatedSprite color and the color of the Sprites it contains. Additionally, I have to store the original values of the Sprites if I want to set the color of AnimatedSprite back to sf::Color::White while maintaining any modifications I made to the original Sprites I provided.

So to recap, is there any built in functionality for "overlaying" colors, similar to the way you can "overlay" transformations?

5
General / Re:Crash On Closing Window [SFML 2.0]
« on: August 21, 2012, 08:32:23 am »
Are you using global resources (textures/font/text/etc)?
Or are you mixong release libraries in debug mode?

I've checked the libraries, and they're correctly linked. I am using textures, however.

6
General / Re:Crash On Closing Window [SFML 2.0]
« on: August 20, 2012, 07:45:22 am »
I'm having the same issue seen in this old thread, the program crashes after main() exits with an access violation reading error, but only when running from the dev environment.

http://en.sfml-dev.org/forums/index.php?topic=3976.0

I'm using VC++ 2010 with Window 7 64-bit on an Intel HD integrated graphics card.
I'm also using the dynamically linked libraries.

I just ported from 1.6 to 2.0, so I wasn't sure if it was a bug (seeing as there has been trouble with this previously) or I had made some error on my part. I haven't tried using the static libraries.

EDIT: I'll add more information if needed, I just wanted to make sure this wasn't a bug before I delved to far into it.

7
Okay, I'll get on that. Thank's for your help.

8
Oh, in that case, is it easy to transition from SFML 1.6 to 2.0? I've already got a framework built up around 1.6 and I waited to ask this question until I was finished in case I figured out how to do it as I worked with the API.

9
Graphics / Blending Drawable whose Render() calls another Drawable 1.6
« on: August 17, 2012, 07:35:51 pm »
Hello, I've just started using SFML 1.6, and I've run into a little problem when implementing animated sprites.

The class extends sf::Drawable and contains an array of sprites. In its Render function AnimatedSprite determines which sprite to draw and calls renderTarget.Draw(currentSprite). Unfortunately, since the blend values are set in the sf::Drawable::Draw() function I have no control over their settings without editing the original sprites.

Is there any way I can blend the AnimatedSprite color with the color of the sprites it contains without editing the color and blending values of the sprites themselves?

Pages: [1]
anything