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

Pages: [1]
1
Audio / Lack with Music and spatialization
« on: October 14, 2009, 12:18:50 pm »
How stupid.

Thanks a lot for the Link.
That made it clear (first i couldn't understand why that should be expected).

2
Audio / Lack with Music and spatialization
« on: October 14, 2009, 08:24:55 am »
Hi.

First I hope this wasn't a topic before, but i couldn't find anything similar.

Ok, my goal is to implement a voicechat to a game, where players can hear their group members in the 3d environment.
To test if it is possible with something that is no sf::Sound, I tested it with Music first.

It works quite well but I think there is an issue.
With the Listener at 0,0,0 and the Music at 1,0,0 I hear the Music from the right speaker an with the Music at -1,0,0 from the left speaker.
So far so good. Then I extended the loop (check if the sound is still playing and wait) to let the sound move from x = -1 to 1.
Then I realized that 1. The sound doesn't move. It just hops from one speaker to the other then it switches from 0.1 to -0.1 and other wise.
I'm not really sure what happens at 0,0,0 but I can hear exactly the jump point.

Well I would expect that the Music will smothely switch the speakers.

Some details to the example. The sound goes from -1 to 1 and back. The Position switches every 100ms with the stepsize 0.1. I also tried with the Stepsize 0.01.


It meight be an OpenAL Problem. So I hope someone had the same issue and propably knows a workaround.


Regards Chriss


EDIT:
I'm using SFML 1.5 and extended this example:
http://www.sfml-dev.org/tutorials/1.5/audio-spatialization.php

3
System / Thread startet from a Thread
« on: August 24, 2009, 09:48:02 pm »
Yes i know, thanks.

In my current projecti'm storing those pointers.
First placed my objects on the stack. So i was wondering, why the threads didn't start.

Id didn't tried it, but would somithing like this work?
Code: [Select]

class TC2 : public sf::Thread{
public: int number;
private :
    virtual void Run()
    {
        // Print something...
        for (int i = 0; i < 10; ++i)
            std::cout << "I'm the thread number " << number << std::endl;
        delete this;
    }

};



Not a nice way, but could do the job, if this still deletes the thread from the system.

4
System / Thread startet from a Thread
« on: August 22, 2009, 12:01:29 am »
It is as i thought.
The primary Thread terminates and so the subthreads are terminated before they could start.


This code does not start the sub threads.

Code: [Select]

#include <iostream>
#include "SFML/System.hpp"

class TC2 : public sf::Thread{
public: int number;
private :
    virtual void Run()
    {
        // Print something...
        for (int i = 0; i < 10; ++i)
            std::cout << "I'm the thread number " << number << std::endl;
    }

};

class TC1 : public sf::Thread{
private :
    virtual void Run()
    {
std::cout << "I'm the main thread" << std::endl;
        // Print something...
        for (int i = 0; i < 10; ++i)
{
TC2 tc;
tc.number = i;
tc.Launch();
}
    }

};

int main(int argc, char** argv)
{
TC1 tc;
tc.Launch();

system("PAUSE");
}


This code starts the Threads (but produces memory leaks)

Code: [Select]

#include <iostream>
#include "SFML/System.hpp"

class TC2 : public sf::Thread{
public: int number;
private :
    virtual void Run()
    {
        // Print something...
        for (int i = 0; i < 10; ++i)
            std::cout << "I'm the thread number " << number << std::endl;
    }

};

class TC1 : public sf::Thread{
private :
    virtual void Run()
    {
std::cout << "I'm the main thread" << std::endl;
        // Print something...
        for (int i = 0; i < 10; ++i)
{
TC2 *tc = new TC2;
tc->number = i;
tc->Launch();
}
    }

};

int main(int argc, char** argv)
{
TC1 tc;
tc.Launch();

system("PAUSE");
}

5
System / Thread startet from a Thread
« on: July 22, 2009, 12:24:33 am »
Hi,

there is somethin i don't understand at the Thread class.
When i write my own class and let it inerhit sf::Thread, i can start it that way

Code: [Select]

myThreadClass myThread;
myThread.Launch();


This works really well, but when I do that within a running thread, the function Run of myThreadClass isn't called.

It seams that the Object is destroyed, before the Run Method could be launched.
In functions of the Main thread does everything work well.
Any idears, how this could be?

6
System / Threadlimit?
« on: July 04, 2009, 04:28:50 pm »
Thanks for that info.

7
System / Threadlimit?
« on: July 02, 2009, 07:47:14 pm »
I found this topic with google.

I have nearly the same problem as describet at top.
After a while i become the message "Failed to create thread".

I'm writing a server application that has to run 24 hours the whole week.

I'm using less than 10 threads for looping checks, many threads are used by the network library raknet.
So far so good.


Every time a user initiates an action a thread is createt and executet. Those threads have a regulary lifetime of max. one second.

So my main questin on this: Do those threads destroy themself after reaching the end of the execution function or do they stay alive?

Because i'm creating tones of threads i'm wondering if i hvae to reuse the old ones (since this topic).


I hope anyone understands my problem and can tell me if i have to reuse old threads or another issue in my application.


Thanks,   Chriss

Pages: [1]