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

Pages: [1]
1
Feature requests / Drawing textured shape?
« on: February 05, 2011, 02:03:17 am »
Hey,

I think it would be great to be able to draw shapes with texture instead of just color in them.

Thanks.

2
DotNet / extlibs folder
« on: July 26, 2010, 09:38:42 pm »
Hey,

Just a small suggestion. I think the csfml DLLs in the extlibs folder should either be removed or kept up to date with the latest revision. I just spent 2 hours trying to figure out what was going on with my FloatRects when I finally got that it was because I had used those DLLs.

On a side note, are VS2010 build scripts planned?

Thanks!

3
Window / Get window position
« on: May 12, 2010, 02:54:40 am »
Hey folks,

I was wondering, how can I get the on screen position of a RenderWindow object using SFML 2.0? If not is there a way to get a valid handle to pass to GetWindowRect from user32.dll?

Thanks.

4
Graphics / GLSL language version?
« on: May 01, 2010, 02:59:25 pm »
Hey all,

I'm using SFML.Net 2.0 and I want to learn to use shaders with GLSL. Only thing is, I found many tutorials on the internet but they all are for different versions and they explicitly say to avoid certain older functions since they are deprecated since x version and whatnot. My question is, what version does SFML use? Is it even related to SFML? If not, how can I find out the version on my computer? At run time?

5
DotNet / More detailed exceptions
« on: April 22, 2010, 07:52:59 pm »
Hey folks,

I was wondering if it could be possible to incorporate more detailed exceptions in SFML 2.0. For example, I just tried to load a .gif image and it gave me an exception, "Failed to load image from file test.gif." However, I noticed that in stderr there is a more detailed exception, "Reason: image not of any known type or corrupt." I searched within LoadingFailedException and I couldn't find this message anywhere. Could we maybe get the reason at runtime without having to read from stderr?

Thanks!

6
DotNet / GC Problem with RenderImage...
« on: March 02, 2010, 03:06:32 am »
Okay, here we go again, this time I hope it'll be less of a headache :D.

The following code draws a white rectangle instead of the blue one it should. The reason is that the RenderImage entity in Test's constructor is garbage collected.
Code: [Select]

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

namespace SFMLSandbox
{
class Program
{
static void Main()
{
RenderWindow app = new RenderWindow(new VideoMode(500, 500), "SFML Sandbox");
app.Closed += new EventHandler(OnClosed);

Test test = new Test();
GC.Collect();

while(app.IsOpened())
{
app.DispatchEvents();
app.Clear();

test.Draw(app);

app.Display();
}
}

static void OnClosed(object sender, EventArgs e)
{
((RenderWindow)sender).Close();
}
}

class Test
{
public Sprite sprite;

public Test()
{
RenderImage i = new RenderImage(500, 500);
i.Clear(Color.Blue);
i.Display();
sprite = new Sprite(i.Image);
}

public void Draw(RenderTarget target)
{
target.Draw(sprite);
}
}
}

My guess is it has something to do with weak references or whatever, this stuff is over my head. If I declare the RenderImage outside of the method (but still inside the class), it works as expected:
Code: [Select]

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

namespace SFMLSandbox
{
class Program
{
static void Main()
{
RenderWindow app = new RenderWindow(new VideoMode(500, 500), "SFML Sandbox");
app.Closed += new EventHandler(OnClosed);

Test test = new Test();
GC.Collect();

while(app.IsOpened())
{
app.DispatchEvents();
app.Clear();

test.Draw(app);

app.Display();
}
}

static void OnClosed(object sender, EventArgs e)
{
((RenderWindow)sender).Close();
}
}

class Test
{
public Sprite sprite;
RenderImage i;

public Test()
{
i = new RenderImage(500, 500);
i.Clear(Color.Blue);
i.Display();
sprite = new Sprite(i.Image);
}

public void Draw(RenderTarget target)
{
target.Draw(sprite);
}
}
}


Is this an actual bug or am I just using this wrong?

Thanks.

7
Graphics / Shape.Rectangle(FloatRect rect)
« on: February 25, 2010, 12:37:27 am »
Hey guys,

Extremely simple, useless and dumb question, but why doesn't Shape.Rectangle have an overload that takes a FloatRect as an argument? Instead you gotta create two Vector2s and pass em the top left bottom and right coords. That's probably just a pet peeves but something I'm wondering nonetheless.

Thanks.

8
DotNet / View
« on: February 20, 2010, 01:30:11 am »
Hey folks,

So I have been starting to work on my game's camera and I have a few questions about the working of views. More specifically, what is Viewport? It's a rectangle of some sort but I can't figure what it does, it only always seems start at 0, 0 and be of size 1, 1. Some example code:

Code: [Select]

RenderWindow app = new RenderWindow(new VideoMode(800, 600), "Test");
Console.WriteLine(app.DefaultView.Viewport);
//Outputs [FloatRect] Left(0) Top(0) Right(1) Bottom(1)

View camera = new View(new Vector2(0, 0), new Vector2(app.Width, app.Height));
Console.WriteLine(camera.Viewport);
//Outputs [FloatRect] Left(0) Top(0) Right(1) Bottom(1)


Perhaps I don't understand this both in cases I would expect it to look like:
Code: [Select]

[FloatRect] Left(0) Top(0) Right (800) Bottom(600)


I found that RenderWindow.GetViewport seems to be what I am looking for, as passing it my view returns the expected Rectangle. However, why does this one return an IntRect and the other ones FloatRect's?

Thanks.

9
Hey all,

I recently started working on a Console for my game and I quickly noticed that the font I was using is having trouble rendering certain escape characters ('\r', '\b' to name a few). Instead it renders the "glyph not found" square. I was wondering if it would be possible to have a way to check if a certain character is part of a font, a bit like XNA's SpriteFont.Characters which returns a collection (or vector I guess for you C++ guys) that contains a list of drawable characters.

I was also wondering about TextEntered's behavior. First of all why does it return a string instead of a char? (That's for .NET, not sure about the other libraries). Also, should this event be raised even when the entered characters are escape sequences? Stuff like backspaces, enters and the like should be handled by the KeyPress event? Of course this problem can be easily fixed with a way to verify if I font contains a certain character.

Thanks!

10
DotNet / Performance?
« on: January 23, 2010, 06:23:46 pm »
Hey all,

I've been messing around with SFML 2.0 and I found a few things. First of all, this basic app takes 25% of my CPU usage and about 23 MBs of memory. Is this normal?

Code: [Select]

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

namespace SFML1
{
class Game
{
static void Main()
{
RenderWindow app = new RenderWindow(new VideoMode(500, 500, 32), "SFML1");
app.Closed += new EventHandler(OnClosed);

while (app.IsOpened())
{
app.DispatchEvents();
app.Clear();


app.Display();
}
}

static void OnClosed(object sender, EventArgs e)
{
((Window)sender).Close();

if (System.Diagnostics.Debugger.IsAttached) //Hotfix for app crashing in Debug mode when using a String2D
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
}
}


Adding a call System.Threading.Thread.Sleep(1) puts the CPU usage at 0% instead of 25. Shouldn't SFML already implement a mechanism like that already? I'm sure there's a good reason it doesn't, if you guys could enlighten me.

Also, instantiating a Text object every frame ends up locking up the application after ~10 seconds or so on my machine:
Code: [Select]

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

namespace SFML1
{
class Game
{
static void Main()
{
RenderWindow app = new RenderWindow(new VideoMode(500, 500, 32), "SFML1");
app.Closed += new EventHandler(OnClosed);

float time = 0;

while (app.IsOpened())
{
app.DispatchEvents();
app.Clear();

time += app.GetFrameTime();
app.Draw(new Text(time.ToString()));

app.Display();
}
}

static void OnClosed(object sender, EventArgs e)
{
((Window)sender).Close();

if (System.Diagnostics.Debugger.IsAttached) //Hotfix for app crashing in Debug mode when using a String2D
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
}
}


Monitoring the Task Manager's memory usage and System.GC.GetTotalMemory I can observe that memory usage gradually increases until the hang up, where it shoots back down. Of course, instantiating the Text object only once and then changing its DisplayedString property does not make it hang, but does that mean we always have to declare our Text objects before the loop?

Thanks, and sorry for all these topics and questions I'm making as of lately.

11
DotNet / SFML 2.0 problems?
« on: January 21, 2010, 04:13:22 am »
Hey all,

Recently started messing around with 2.0. I understand this is still a WIP, but I still thought I'd point out a few problems I'm having. First of all, I seem to be unable to draw any kind of shape or text whatsoever. This code, which works in 1.5:
Code: [Select]

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

namespace Project2
{
class Program
{
static void Main()
{
RenderWindow app = new RenderWindow(new VideoMode(500, 500, 32), "Project2");
app.Closed += new EventHandler(OnClosed);

while (app.IsOpened())
{
app.DispatchEvents();
app.Clear();

app.Draw(Shape.Rectangle(new Vector2(0, 0), new Vector2(250, 250), Color.White));

app.Display();
}

}

static void OnClosed(object sender, EventArgs e)
{
((Window)sender).Close();
}
}
}


Doesn't work in 2.0 (that's copied and pasted). There was probably a change of some sort, but I can't get any Shape or Text to draw.

Second of all, whenever I draw a Text object, the application will crash on closing.
Code: [Select]

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

namespace Project2
{
class Program
{
static void Main()
{
RenderWindow app = new RenderWindow(new VideoMode(500, 500, 32), "Project2");
app.Closed += new EventHandler(OnClosed);

Text t = new Text("afafee");

while (app.IsOpened())
{
app.DispatchEvents();
app.Clear();

app.Draw(Shape.Rectangle(new Vector2(0, 0), new Vector2(250, 250), Color.White));

app.Draw(t);

app.Display();
}
}

static void OnClosed(object sender, EventArgs e)
{
((Window)sender).Close();
}
}
}


I think this is somehow related to SFML's RenderWindow.Close method because if I close directly the underlying system console window or exit the app by using "return" in Main, everything closes correctly. Maybe related to some cleanup done on closing?

12
DotNet / Override ToString
« on: December 29, 2009, 11:48:04 pm »
Hey,

I don't know where to post this, but it would be nice if in the next version the ToString functions were overridden in the structs for SFML.Net. The bugtracker seems exclusive to the C++ version so I posted here.

Pages: [1]
anything