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

Pages: [1]
1
DotNet / SFML.NET doesn't expose sf::Context
« on: November 16, 2011, 07:09:58 pm »
Like the title says. I've looked at all 3 DLLs and none of them includes a class named "Context".
I need this class because I'm trying to make a multithreaded loading screen and, even though in my PC everything works fine, some computers seem to be experiencing a crash after the load. My current theory(untested) is that the lack of explicit context setting might be the reason for weird behavior.

So... are there plans to expose it to .NET or am I doing something wrong?

2
Graphics / Extra-smooth textures
« on: November 11, 2011, 04:58:36 pm »
I'm developing a game with SFML(.Net) 2.0 and almost all of my textures have "Smooth = true;" set when they are loaded.
While the appearance is generally good(for instance, zooming in gives the smooth appearance I want), the zoom-out appearance doesn't look smooth enough.
I'd like to make the zoomed out appearance more smooth. Is there any way to do this? (Maybe using OpenGL API calls since SFML smooth doesn't seem to be enough?)

3
Feature requests / Mechanism to detect Intel cards
« on: October 12, 2011, 05:45:58 pm »
I've been having trouble with intel cards so my game currently has two modes - with rendertextures and without rendertextures.
I can easily toggle on and off the RenderTextures, so I'd like to deactivate them only on Intel cards, since those seem to be the cards with problems.
I'd like SFML(and SFML.Net) to provide a call like "IsIntelGPU" or something like that, so that I could selectively enable some features.

4
DotNet / Suggestion: Show warning when resource is not disposed
« on: October 11, 2011, 07:57:22 pm »
In SFML.Net, not disposing resources can have horrible effects on both performance AND stability of the program.

What I'm suggesting is this, using the dispose finalizers(see http://msdn.microsoft.com/en-us/library/b1yfkh5e.aspx for examples), add a check that, if a resource is being garbage collected without having been previously disposed, then add a Console.WriteLine warning about it(possibly with a stack trace?)
In my opinion, this would be helpful and assist in the development of more stable SFML.Net code.

5
SFML projects / My SFML game - Terrena (alpha 10)
« on: October 10, 2011, 08:23:59 pm »
I've decided to publish an alpha version of my own (SFML 2.0/.NET-based) game.
It's called Terrena.

It is a strategy game that mixes TCG(trading card games) with board games.
Each player has a deck and a hand, and places them on the board, expanding his/her territory, with the goal of conquering the capitals of enemy players, while preventing the enemies from doing the same.

In Terrena, the board starts mostly empty so each player has a very customizable landscape. Different types of terrain have different costs to place on the board, and also give different type of resources. Additionally, unit cards are used to conquer and defend terrain tiles.
Finally, events/magics allow players to do special actions such as destroying enemy terrain.

Requires .NET 4.0(tested on Linux/Mono 2.10). SFML libraries come included in the ZIP. Not tested on Windows but it should work. Not tested on Mac OS X at all. Might work with the proper libraries.
Also, despite being 2D, it seems to be rather slow. On my PC, it sometimes gets only 10FPS. I'm hoping the new drawing API will improve things.
It also fails miserably on Intel GPUs with no FBO support.

It's an early version so expect the game to be unbalanced and some of the textures not to be perfect. The final version will hopefully offer more variety.
Feedback is welcome.



Download:
http://dl.dropbox.com/u/6459451/Terrena-a10.zip

EDIT:
Alpha 10 version is available(link above)
Game should now work on .NET 3.5, there are some image improvements, the game now works better on Intel GPUs, a few settings were added and the game is now (I hope) a bit easier to understand for beginners.

6
Feature requests / Simple way to merge textures
« on: October 06, 2011, 06:25:34 pm »
Apparently, the new SFML 2 Graphics API will allow things to "batch" multiple drawing calls, provided they use the same texture.

The trick I'm proposing is to have a new class, such as TexturePack, to "pack" many textures in a single one. These textures would have a bunch of shared properties(for instance, either they are all smooth or none of them are smooth).

The idea is that, internally, SFML would merge all textures into a single bigger one(with perhaps each texture having a border to ensure that smoothing wouldn't pick parts of the other textures). Internally, it would be a single texture so many calls using it could be batched. The public API would be like handling multiple textures.

Of course, using TexturePacks incorrectly would cause *worse* performance, so it really needs to be a separate class and not a built-in Texture feature. This could perhaps come in a later SFML version(such as 2.x), since it seems like the kind of thing that shouldn't be too hard to add once the basic graphics API is done.

What do you think?

7
Graphics / RenderTexture problems
« on: September 08, 2011, 08:59:51 pm »
I'm in a system with an Intel GMA without FBO.
RenderTextures seem to mostly work on my .NET game but I'm having two issues:

1. When I close the application, it crashes. This ONLY happens if I create at least one RenderTexture.
2. Occasionally, the screen stops rendering(so either freezes or goes all black). Sometimes resizing the window makes it go back to normal(and if that happens I can see that the texture was rendered correctly), but not always.

Here's my C# code for texture creation:
Code: [Select]

        public void GenerateCardTexture(GameContext info, CardType card)
        {
            RenderTexture t = new RenderTexture(256, 384);

            t.Clear(new Color(0, 0, 0, 0));

            //Some code to Render Stuff to texture

            t.Display();

            cardRendering[card] = new Texture(t.Texture);
            t.Dispose();
        }


The "new Texture(t.Texture)" is there because I'm unsure about what Dispose() actually disposes, so I played it safe. In fact, if I make it just "= t.Texture;" and remove the Dispose, I get exceptions later on sfSprite_SetTexture.

Note that if I comment the code that calls Draw(), but still create the texture, call Clear() and Display(), then these problems do not happen. So I'm guessing the problem really is in Draw() functions.
I'm not using shaders, since my card doesn't support those anyway.

Am I doing something wrong? If not, is there any workaround for this issue(aside from not using RenderTexture)?

8
Graphics / Speeding up rendering
« on: September 05, 2011, 09:31:42 pm »
I'm using SFML 2(.NET) and my game is in some cases a bit too slow. In some admittedly not very realistic - although certainly possible -situations, the framerate actually goes below 20FPS and I would like to speed things up.

So I decided to do some profiling and I got to the conclusion that most of the elapsed time is spent on RenderWindow.Draw and RenderWindow.Display.
My profiler is suggesting that 37% of the time on my main thread is spent on RenderWindow.Display alone. And at least 29% of the total time(probably more since I didn't finish counting and I rounded the number down on a few calculations) is spent on RenderWindow.Draw.
The system monitor shows one of my CPU cores is very busy, so I guess my bottleneck is more specifically the software side of these functions, but to be honest I'm on an Intel system with OpenGL<2.0 so I'm not even sure my OpenGL is hardware accelerated. But even considering my hardware situation, I still think this is kind of slow.

So I was wondering, is there anything I can do aside from reducing the number of drawing calls to speed things up?

9
DotNet / Problems with SFML.NET (Version 2.0)
« on: August 17, 2011, 04:06:17 am »
EDIT: Somehow, I managed to screw up and post this on the wrong category. Could somebody move this?

I've been using SFML.NET (based on SFML 2) for a bit and, although I eventually got the Windows version to mostly work, I'm encountering some issues on Linux:

1. On Linux, The RenderWindow title gets weird for characters like é and ç. Perhaps an encoding-related issue? If the window title is composed entirely of "common" characters, then it looks ok.
2. On Linux, when the program draws text on the screen, there seems to be garbage at the end of the string(usually one square character, although different sequences appear ocasionally).
Code: [Select]

            using (var fps = new Text("some fps counter", FontManager.Font16px, 16))

            {

                fps.Position = new Vector2f(0, 580);
 //Window size (800, 600)
                fps.Color = Color.Black;

                target.Draw(fps);
 //where target is a RenderWindow
            }

3. On both Windows AND Linux, using the string constructor in Font(rather than the Stream one) causes a NullReferenceException on SFML.Graphics.Font.Destroy when the font is disposed. This seems to be due to a null Stream being disposed. A simple workaround for this is to simply use:
Code: [Select]

new Font(new FileStream(filename, FileMode.Open));


Aside from that, SFML 2 looks generally solid, although it took me quite some time to get the *.dll.config files to work on Linux.
Also, although my system is x64 and as such sfml/csfml were probably compiled as x64. However, the sfmlnet-*.dll were compiled as x86(because they were compiled on Windows x86 and I was too lazy to compile them again on Linux x64). Not sure if that makes a difference, since aside from fonts SFML seems to be working great(haven't tested audio, though)
The font I'm using on both OS is arial.ttf taken from Windows 7.

Looking forward to information on these potential bugs, especially the second one(since it's the one I haven't found a workaround for). Aside from that, thank you for designing a great library like SFML. Looking forward for the official SFML 2 release.

Pages: [1]
anything