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

Pages: [1]
Feature requests / Primitives
« on: December 07, 2010, 07:56:08 pm »
Hm, maybe someone asked this before, but I wasn't able to find a post about it, so ... here we go:

I wonder if SFML will bring support for drawing simple stuff like lines, rectangles, ellipses, splines and paths.
The GDI+ API seems to be pretty powerful and a lot of people like it because of it's simplicity. However, it is not hardware accelerated and maybe SFML could fix this issue. Transfer the powerful GDI+ API to SFML and I would not see a better 2D library out there!

SFML website / "Mark all as read" - button on forums
« on: September 11, 2009, 03:41:01 pm »
Hey there =)

Just a little request...or maybe suggestion w/e:

I saw a lot of forums have a button that allows you to mark all currently unread topics as read. I usually come online, and click "View posts since last visit". Then I read the posts I am interested in and they get marked as read. But since I dont read all, there are always some topics marked as unread...So, maybe you can find the option somewhere in the forums configuration and enable it.
It's for lazy people like me a pretty nice help. =)


Audio / How does Sound.Position work?
« on: June 25, 2009, 06:01:50 pm »
I got an Sound.Object playing a stereo sound from a Soundbuffer.
Now I want to set the .Position property. But what scales are expected for the vector's elements? Is it something between 0..1.0? Or maybe something like 0..1000?
I tried to produce some kind of 2D-Sound: If a rocket flies by on the left side the sound should be much louder on the left side then on the right side. I made it like this:

Code: [Select]

With New Sound (daBuffer)
    .Position = New Vector3((rock_x-self_x)/app.width, (rock_y-self_y)/app.height, 0)
    .RelativeToListener = true
End With

So, rock_XY=Rocket, self_XY=listener. The .Position gets a new value relative to the listener and by setting .RelativeToListener that should be applied to the sound.
But sadly the volume on both speakers is the same...so no 2D-Sound =(
Am I doing wrong or isnt it supposed to support that?

PS: rock_XY and self_XY are screen coordinates, so vector3.X and .Y are between 0...1.

Audio / Delayed playing.
« on: June 25, 2009, 01:34:05 am »
I use SFML 1.5 (latest SVN) with .NET. I experienced a small delay after calling SOUND.Play().

Ok, lets check this:

Code: [Select]

        Dim boomBuf As New SoundBuffer("hq_boom.wav")
        Dim somesound As New Sound(boomBuf))

        With New Microsoft.VisualBasic.Devices.Audio
            .Play(ByteArrayThatConatainsTheAudioFile, AudioPlayMode.Background)
        End With

What it does is basically load a sound into a buffer and create a sound object.
Then it instanciates a new .NET-Audio Device and then starts playing with both objects (the default .NET player and the SFML Sound).

The sound file I load is just a WAV with a single short "beep".

If both sounds would start playing right after another (like it should be) one would more or less just hear a "bebeep". But what you hear is "beep"...(delay ~300 to 500msec)..."beep".

The SFML sound is delayed. I realized this when I was making a simple application (Press key -> play sound). One could really "hear" the delay, it is pretty much too long for...let's say a game with a rocket exploding or something.

So, anyone got an idea about this? I saw someone posted something similar a few weeks ago but that problem got fixed back then, so this can / should not be related to this.

I just tried if it got fixed in SFML2-branch...but no, same think. Playing starts slightly delayed. =(

Edit: The order I start the sounds playing doesnt matter (first .NET-Player then SFML-Sound = same like first SFML then .NET). There is always a delay.

Graphics / PostFX Problem...
« on: June 23, 2009, 11:37:36 am »
I tried to make a new blur effect. Well, first, here is my code:

Code: [Select]

texture framebuffer

float x = _in.x;
float y = _in.y;

float zx = 1.0 / 640.0;
float zy = 1.0 / 480.0;

vec4 p1 = framebuffer(vec2(_in.x, _in.y));
vec4 p2 = framebuffer(vec2(_in.x + zx, _in.y + zy));
vec4 p3 = framebuffer(vec2(_in.x - zx, _in.y + zy));
vec4 p4 = framebuffer(vec2(_in.x + zx, _in.y - zy));
vec4 p5 = framebuffer(vec2(_in.x - zx, _in.y - zy));

_out = (p1 + p2 + p3 + p4 + p5) * 0.2;

What I do is basically just get the vec4s of the colors that are a bit right, left, above or below the current pixel and just sum them up and multiply them by a factor to keep the brightness.

But the problem is: This example only works for me as long as I replace the last line (   _out = (p1 + p2 + p3 + p4 + p5) * f;) by this line:

   _out = (p1 + p2 + p3) * f;

As you can see I can not sum up all 5 vectors...It keeps crashing. As soon as I add more then 3 (no matter which ones I add, it just have to be less then 4) the effect simply doesn't show and the App.Window doesnt update anymore (oh and CPU usage goes up to 100%). If i just ad 3 vectors: everything works fine... Does anyone know what I am doing wrong?

EDIT: Strange enough, but this works too:

_out = p1 + p1 + p1 + p1 + p2 + p2 + p2;

So, the error occures as soon as I want to sum up more then 3 different vectors. A work around like

vec4 dummy = p1 + p2 + p3;
_out = dummy + p4 + p5;

doesnt work, too...

Another EDIT:

I thoguht it might be a memory problem with the GLSL compiler or something so i tried this code:

Code: [Select]

texture framebuffer

float x = _in.x;
float y = _in.y;

float zx = 1.0 / 640.0;
float zy = 1.0 / 480.0;

vec4 val;
vec4 p1 = framebuffer(vec2(_in.x, _in.y));

val = framebuffer(vec2(_in.x + zx, _in.y + zy));
p1 = p1 + val;

val = framebuffer(vec2(_in.x - zx, _in.y + zy));
p1 = p1 + val;

val = framebuffer(vec2(_in.x + zx, _in.y - zy));
p1 = p1 + val;

val = framebuffer(vec2(_in.x - zx, _in.y - zy));
p1 = p1 + val;

float f = 0.2;

_out = p1 * f;

Problem remains: As soon as i sum up more then 3 different pixels i get a crash. If i just add 3 or less all is fine....

General / Just a question about the progress
« on: May 19, 2009, 12:26:54 am »

I will start a new projekt next month and we are thinking about switching from SDL to SFML. As mentioned in several topics and in the todo-list there is a major issue with SFML crashing when the main program closes and you used drawtext (or however it's called...) before.
I myself would prefer to use SFML for that projekt but i wonder if that bug will be fixed during the next few days / weeks. I checked the todo-list and found out that the last edit was on 06 March =(. So, my question is if there is a chance that this bug will get fixed "soon" or if there is a work around for that crashing issue...
Does anyone know?

DotNet / Change RenderWindow's Title after creation...
« on: May 17, 2009, 09:02:18 pm »
Is there a way to change the renderwindow's title after it got created?

Something like this would be nice:

Code: [Select]
Dim vMode As New VideoMode(640, 480, 32)
App = New RenderWindow(vMode, "TEST!")
App.SetWindowTitle (....) 'This would be nice to have

As far as i am informed the only way to set the window's title is to set it in the constructor... =(

Pages: [1]