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

Pages: 1 [2] 3 4
16
DotNet / SFML.NET doesn't expose sf::Context
« on: November 17, 2011, 05:59:55 pm »
The person is telling me that he's running with updated drivers.

17
DotNet / SFML.NET doesn't expose sf::Context
« on: November 17, 2011, 05:56:55 pm »
On the computer in which this program crashes, the program simple crashes(returning 1) without printing anything(so no stacktrace is shown)

Quote
Have you tried it on other 64-bits systems?

My computer is 64 bits Intel CPU+NVIDIA GPU and runs that example just fine, so it seems very specific to some computers.

18
DotNet / SFML.NET doesn't expose sf::Context
« on: November 17, 2011, 05:11:07 pm »
This program:
http://dl.dropbox.com/u/6459451/threading.zip

works on my PC, but crashes on some computers(at least a Sandy Bridge Linux 64 bits, maybe more)

To run it:
LD_LIBRARY_PATH=. mono ThreadingTest.exe

Source code:
Code: [Select]

using System;
using System.Threading;
using SFML.Window;
using SFML.Graphics;

namespace ThreadingTest
{
public class Test
{
static Texture myTexture;
static bool threadOver = false;

static void myThreadProc()
{
myTexture = new Texture("texture.png");

threadOver = true;
}

static void Main()
{
using (var win = new RenderWindow(new VideoMode(640, 480, 32), "threading test"))
{
new Thread(myThreadProc).Start();

win.Closed += (sender, e) => win.Close();

while (win.IsOpened()) {
win.DispatchEvents();

win.Clear(Color.Black);

if (threadOver)
{
using (var mySprite = new Sprite(myTexture))
{
win.Draw(mySprite);
}
}

win.Display();
}
}
}
}
}


Since it works on my PC, this bug is particularly bad since it's hard for me to reproduce.
Hopefully, the above source code should be simple enough to make it obvious what the problem is.

19
DotNet / SFML.NET doesn't expose sf::Context
« on: November 16, 2011, 10:43:22 pm »
SFML 2(a few weeks old version)

20
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?

21
General / [SOLVED]Custom Icons in SFML?
« on: November 14, 2011, 05:18:39 pm »
window.SetIcon(image.GetWidth(), image.GetHeight(), image.GetPixelsPtr());

That should work.

22
DotNet / Performance questions
« on: November 14, 2011, 01:36:55 pm »
Quote
Creating many objects every frame is a bad idea. Not because of SFML internals, but because .NET's garbage collector will need to collect them very often. Hence your performance drops.

.NET garbage collector is very efficient when collecting short-lived objects, though.
If this is a concern, you could always use structs instead of classes, but be aware of the implications this has.

23
General / Sprite moving speed same on all computers
« on: November 13, 2011, 07:46:54 pm »
Aside from the fact that your code won't work on SFML 2, you are over complicating that formula. You can simplify it to be:

Code: [Select]
sprite.Move(speed * clock.GetElapsedTime());
Remember to reset the clock at the end of each frame.

If you follow this formula and use the clock properly, this should ensure the same speed across all computers...

24
Graphics / Extra-smooth textures
« on: November 11, 2011, 10:23:51 pm »

25
Graphics / Extra-smooth textures
« on: November 11, 2011, 08:23:06 pm »
So can we expect "native" mipmapping in a future SFML version?

26
Graphics / Font issues
« on: November 11, 2011, 07:04:21 pm »
Make sure all of your shared resources remain in scope while the side thread is running.
One easy way to ensure this is to make your shared resources global variables.

Because if your code tries to use a variable that goes out of scope(e.g. is used after being destroyed), that'd be a memory corruption bug, which can indeed cause crashes and unexpected behavior.

27
Graphics / Extra-smooth textures
« on: November 11, 2011, 06:49:18 pm »
Why would depth information be required?
I certainly did not enable the depth buffer since I use translucency a lot.

To use the texture, I use the ordinary Sprite API:

Code: [Select]

t = img.GetTextureForName("Interface/TileOutline");
using (var spr = new Sprite(t))
{
spr.Position = pos;
spr.Origin = new Vector2f(128, t.Height / 2);
spr.Scale = new Vector2f(zoomLevel, zoomLevel);
spr.Color = color;
info.Target.Draw(spr);
}


Where info.Target is a RenderWindow, GetTextureForName gives me a texture stored in a IDictionary<string, Texture>, which is previously populated using the code I showed before.

28
Graphics / Extra-smooth textures
« on: November 11, 2011, 06:15:06 pm »
Is there any chance you could add mipmap support to SFML(Texture's constructor, maybe?)
From what I'm reading here, it should be only a few extra lines of code (GL_GENERATE_MIPMAP for OpenGL>=1.4 and glGenerateMipmap for OpenGL>=3.0)...

I managed to get it to work, but it looks really ugly.
Anyway, this is what I have now(and it does give me the results I want), if anyone else is interested:

(in C# using Tao.OpenGL via OpenTK.Compatibility)
Code: [Select]

string texPath = "hello-world.png";
using (var img = new Image(texPath))
{
var tex = new Texture(img);
tex.Smooth = true;
tex.Bind();
Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_GENERATE_MIPMAP, Gl.GL_TRUE);
Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR_MIPMAP_LINEAR);

tex.Update(img);
//Store tex somewhere
}


I can say that it's not just 3D games that benefit from mipmaps, that's for sure.

29
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?)

30
Feature requests / Mechanism to detect Intel cards
« on: November 07, 2011, 11:01:56 pm »
Unless the Intel RenderTexture bug is fixed, the only alternative is to disable RenderTextures entirely.
So the options are 1) disable RTs everywhere 2) disable RTs on Intel cards only
I think the option is quite clear.
Also, I don't think there's any way to detect this bug at runtime aside from vendor strings.

Pages: 1 [2] 3 4