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.


Topics - Robin

Pages: [1]
1
DotNet / Fps counter results differ from SetFrameLimit() value
« on: October 29, 2014, 04:16:55 pm »
So I wrote a simple FPS counter class which literally counts how many times it is updated per second. Seems to work fine, however when using the RenderWindow.SetFramerateLimit() method the counter gives a different count to what I'm limiting to.

RenderWindow.SetFramerateLimit(16) returns a count of 17.
RenderWindow.SetFramerateLimit(30) returns a count of 32.
RenderWindow.SetFramerateLimit(60) returns a count of 64.
RenderWindow.SetFramerateLimit(120) returns a count of 144.

Is this expected behaviour or is my counter just horribly written?

public class FpsCounter
{
        private uint _timer;
        private int _frameCount;
        private int _fps;

        public int Fps
        {
                get
                {
                        return _fps;
                }
        }

        public void Update()
        {
                if (_timer < Time.TickCount)
                {
                        _fps = _frameCount;
                        _frameCount = 0;
                        _timer = Time.TickCount + 1000;
                }

                _frameCount++;
        }
}
 

2
DotNet / Easier way to clear a specific area of a render target?
« on: September 25, 2014, 05:05:38 pm »
Afternoon all,

To cut down on drawing calls I'm playing around with the idea of rendering map sprites to a render target then drawing that to the main screen.

However as this is a map editor I need to be able to invalidate specific regions so I can re-draw the changes the user made.

Here's my current code:

Code: [Select]
var clearShape = new RectangleShape
{
Size = new Vector2f(32, 32),
FillColor = new Color(0, 0, 0, 1)
};
clearShape.Position = new Vector2f(0, 0);
_mapTexture.Draw(clearShape, new RenderStates(BlendMode.None));

It works very well, but I feel like there must be an easier (and less hacky. see: alpha value of 1 in colour) way to do this.

Any ideas?

Thanks,
Robin

3
Graphics / NPOT artefacts on .Repeated = true texture?
« on: January 14, 2014, 06:39:57 pm »
Afternoon gents,

I'll keep it simple.

We all know that when running non power-of-two textures you get slight artefacts which make the texture look 'off'. EDIT - This is entirely assumed on my part due to consistencies when using DirectX8 like... 5 years ago. May not be true?

I'm getting the same artefacts when running a power-of-two texture with the .Repeated flag set to true on a larger NPOT sprite.



I had a look around but couldn't really find any information on this. Should this be happening? Is there a workaround?

The artefacts are showing up on the grid as well as the 'transparency' checked background. The grid is a 32x32 texture, the checked effect is a 16x16 texture. Both of them are running on a >1024 sprite size, but occur on smaller ones too.

I'm running the .NET implementation of SFML 2.0.

Thanks,
Robin

4
SFML projects / Crystal Toolset - 2D MMORPG Development Suite
« on: July 01, 2013, 06:08:53 pm »
Decided to teach myself C#, .NET, MDI and SFML (After first wrestling with XNA's MSBuild.exe resource... thing *shudder*).

Somewhere along the way I went a bit crazy and actually wrote a fairly large chunk of a game development application.

(Large image, click thumbnail or link: http://i.imgur.com/MbWOsxF.png)



So far I've managed to work around just about every problem I've come across with getting SFML to play nice with such an interface style. (Control handles being lost was the bane of my existence for a good few days.)

No doubt I'll be coming along with my tail between my legs asking how to fix/optimise things as the core application hits the gym and starts to bulk up.

Thought it might be polite to come along and show what I've accomplished so far before asking people to do my job for me.

Everything you see enabled in that screenshot is fully working in the application itself. There are still a few dozen inconsistencies in the way processes are carried out, but user experience is one of my few strengths, so those will be ironed out as I near completion of this portion of the application.

In terms of SFML related features, things are pretty slim. I have a resource manager... of sorts. Map renderer, tileset renderer, some fancy caching and image exporting stuff. The usual.

As time goes on I'll probably have to be a bit more concious about performance, but everything works at the very least.

Haven't fully decided on whether this will actually be released or not. It was actually supposed to be a simple in-house editor for my personal projects.

I'm sure the draw of free testing will cause me to release it eventually.

Thanks to everyone who contributed to the library and wrote all those wiki articles. Really made things easy to get started with.

Pages: [1]