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

Pages: 1 2 [3] 4 5 ... 10
Graphics / Most efficient way to draw a picture pixel by pixel?
« on: November 13, 2010, 07:00:42 pm »
Think of it this way: row one (top-left corner to top-right corner) is index 0 to Width. To get to row two (right below row one), you have to add the number of pixels in row one, which is = Width. So (y * Width) is your row offset, and x is your column offset.

DotNet / RenderImage woes
« on: November 13, 2010, 06:57:18 pm »
Here is a minimalist C# console app to recreate the problem:

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFML.Graphics;

namespace ConsoleApplication2
    class Program
        static void Main(string[] args)
            using (var rw = new RenderWindow(new SFML.Window.VideoMode(800, 600), "Test"))
                Shape sh = Shape.Rectangle(new FloatRect(8,8,32,32), Color.Green);

                RenderImage buffer = null;
                while (rw.IsOpened())

                    buffer = CreateBuffer(rw, buffer);


                    var s = new Sprite(buffer.Image);

        static RenderImage CreateBuffer(RenderWindow rw, RenderImage existingBuffer)
            if (existingBuffer == null || existingBuffer.Width != rw.Width || existingBuffer.Height != rw.Height)
                if (existingBuffer != null)

                return new RenderImage(rw.Width, rw.Height);

            return existingBuffer;

I have been having this issue for a while, but always assumed it was my fault up until now. RenderImage doesn't seem to want to dispose properly. In my game, I use a few RenderImages to draw to, then combine them all to the screen. If the RenderWindow changes in size, the RenderImages are disposed then created again with the new size. But when disposing them, that is when the problems seem to arise.

If you take out the Dispose in the program above, it also seems to make it work just fine.

General discussions / SFML 2.0
« on: November 12, 2010, 08:19:25 pm »
I would assume the reliance on OpenGL is too strong in some places to be able to use a different backend transparently while retaining all the available features. Shaders are a good example.

Not to say that it wouldn't be nice to have, but hard to see it being worth the effort to allow for a variety of backends when they don't play so nicely with one another.

SFML projects / NetGore - C# open source MORPG engine
« on: November 11, 2010, 01:42:30 am »
Version 0.3.3 released, and the size of the download has been shrunk significantly (to ~3.5 MB) to make it easier to quickly check out.

Audio / sf::Sound destructor crash
« on: November 10, 2010, 11:17:10 pm »
Just noticed the error says its trying to read address 0xFEEEFEEE, which indicates it is freed heap memory. Though why it would be happening... not sure.

Audio / sf::Sound destructor crash
« on: November 10, 2010, 09:53:03 pm »
Does it happen just when the program closes, or any time that the audio is destroyed? Did this happen with SFML 1.6? Do the SFML samples work for you?

General discussions / Alternative to SOIL
« on: November 09, 2010, 01:58:59 am »
Alrighty, back in business. OptiPNG seems to enjoy causing trouble:


Switches used:
Code: [Select]
-quiet -fix -o7

Files marked with "-opt" are the optimized ones, and the others are the originals. The originals work fine, optimized don't. All loaded just fine by every other program I tried.

General / Changing Key Repeat Speed
« on: November 08, 2010, 01:21:28 am »
If you want to define your own repeat rate, you will need to implement your own repeat logic by polling the state of keys each frame instead of relying on the events.

This can be changed in Windows, but I don't think it can be changed on a per-application basis. Wouldn't be surprised if the same was for OS X and *nix.

DotNet / Call to invalid method: sfShader_Create
« on: November 07, 2010, 09:59:51 pm »
The default Shader() constructor calls sfShader_Create, which doesn't seem to exist in csfml.

General discussions / Moving bindings directories on the repository
« on: November 07, 2010, 09:49:03 pm »
I'm definitely up for this. Cleans things up a bit and will be especially useful as more bindings are added.

General discussions / Alternative to SOIL
« on: November 07, 2010, 08:57:01 pm »
Well this is really odd, for some reason things are loading fine now. It used to be very easy to make it fail to load an optimized PNG, but even after running pngcrush -brute on all my PNGs and reverting to an earlier version of my code (where I know the failure happened), it works just fine.

I have no idea what changed, but guess its a good thing.

If it ever happens again I'll be sure to post back.

DotNet / Missing CallingConvention.Cdecl
« on: November 07, 2010, 07:41:36 pm »
Seems the CallingConvention.Cdecl parameter is missing in the .NET bindings on:

Code: [Select]
static extern void sfText_SetString(IntPtr This, string Text);

General discussions / Alternative to SOIL
« on: November 05, 2010, 05:26:19 pm »
Quote from: "Laurent"

I can live with most of the limitations of stb_image. Progressive JPEG is for internet, not for desktop applications.

While I do agree it doesn't make sense to use, it is just a nice convenience - especially when you are unfamiliar with the library and just expect it to work. But not really an issue, just a nice convenience, and definitely not something worth putting much effort into or having result in more dependencies.

How about FreeImage? That, too, uses libpng and has OpenGL integration. But since it is a "full package" kind of thing, I could see this introducing too many extra dependencies as well. And the choices of license are between GPL and the "FreeImage Public License", which looks a lot like LGPL.

Not like I personally really want anything other than better PNG support, just figured might as well mention these while I'm at it. :)

General discussions / Alternative to SOIL
« on: November 05, 2010, 05:02:13 pm »
Mm, I like the idea of using libpng. Even if it doesn't help with other formats, PNG is easily the most popular when it comes to 2d games. It does look like stb_image doesn't have complete JPEG support either, though (no progressive support, for instance).

From what I can see, DevIL seems to use libpng internally and provide an easier interface for it. At the same time, it supports many other formats.

But again, I have almost no experience with image loading libraries. I have always used higher level libraries like SFML to do it for me. ;)

In any case, I really think using libpng would be a great idea, no matter the approach.

General discussions / Alternative to SOIL
« on: November 05, 2010, 04:00:22 pm »
I'm not too familiar with SOIL and know almost nothing about its alternatives, but I did think this would still be worth mentioning. So far, my experiences with loading images in SFML (namely PNG) has been less than ideal. Most any PNG that has been optimized (optipng, pngcrush, etc) seems to completely fail to load. I have also had a few people using my engine mention that PNGs created by some applications also fail to load.

So, is there any better alternative to SOIL that could be used for SFML? Or is there a particular reason for SOIL being used? Or...?

Pages: 1 2 [3] 4 5 ... 10