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

Pages: [1]
1
General / Dynamic linkage curiosity (linux)
« on: September 22, 2011, 01:55:32 am »
Never mind, I've made a quick test to see for myself and solved my doubts. I didn't know that, if you create a library and link its dependences when creating the .so file, then you don't need to link them later when you use the library. Quite curious.

2
General / Dynamic linkage curiosity (linux)
« on: September 21, 2011, 11:32:31 pm »
Hi there.

I was wondering, why isn't it necessary to link all the dependencies when I compile a game using SFML? For example, I'm now dealing with a game about audio, so I use -lsfml-graphics and -lsfml-audio. However, if I inspect the compiled program:

Code: [Select]
ldd ./programa
linux-vdso.so.1 =>  (0x00007fff2ee8e000)
libsfml-audio.so.1.6 => /usr/lib/libsfml-audio.so.1.6 (0x00007f8244546000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f8244240000)
libm.so.6 => /lib/libm.so.6 (0x00007f8243fbc000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f8243da6000)
libc.so.6 => /lib/libc.so.6 (0x00007f8243a23000)
libsfml-system.so.1.6 => /usr/lib/libsfml-system.so.1.6 (0x00007f8243819000)
libsndfile.so.1 => /usr/lib/libsndfile.so.1 (0x00007f82435b4000)
libopenal.so.1 => /usr/lib/libopenal.so.1 (0x00007f824335c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8244789000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f824313e000)
libFLAC.so.8 => /usr/lib/libFLAC.so.8 (0x00007f8242ef4000)
libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0x00007f8242a25000)
libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x00007f82427f8000)
libogg.so.0 => /usr/lib/libogg.so.0 (0x00007f82425f1000)
librt.so.1 => /lib/librt.so.1 (0x00007f82423e9000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f82421e4000)


There are many other libraries, specially libopenal, that get "automatically linked". How do you do it? It's interesting.

I've used OpenAl in other projects, and in all of them I had to either manually link using -lopenal, or use something like the output of pkg-config --libs

3
Audio / Clear buffer of sf::SoundBufferRecorder
« on: September 21, 2011, 05:02:59 pm »
I'm looking at the source code of SoundRecorder (at https://github.com/SFML/SFML/blob/master/src/SFML/Audio/SoundRecorder.cpp) It's really easy to follow. Looks like the call to Sleep (100) is the one forcing the update interval to be 100ms.

Guess I'll copy the code to another class and change the value there. However, it would be great for future releases to add a parameter for that time, defaulting it to 100.

4
Audio / Clear buffer of sf::SoundBufferRecorder
« on: September 21, 2011, 04:51:58 pm »
I need at least half that.

What I'm trying to achieve is this: . This is a video of my project, currently developed using the PulseAudio API (and Gosu as 2D api). I'm looking to port it to Windows, and SFML seemed like a nice way of dealing with cross-platform audio.

5
Audio / Clear buffer of sf::SoundBufferRecorder
« on: September 21, 2011, 04:24:37 pm »
It's very basic, I start recording at the beginning of the program, and in each iteration, if a certain amount of time has past, I check the buffer. That's when I'd like to erase the buffer.

Anyways, I've tried your suggestion of creating my own SoundRecorder

Code: [Select]
class Analyser : public sf::SoundRecorder{
    sf::Clock clock;

    bool OnStart(){
        clock.Reset();
        return true;
    }

    bool OnProcessSamples (const sf::Int16 * Samples, std::size_t SamplesCount){
        std::cout << "NumSamples: " << SamplesCount << " time: " << clock.GetElapsedTime() << std::endl;
        return true;
    }
};


And looks like the "OnProcessSamples" is getting executed every 0.1 seconds, no matter what sample rate I use. Is there a way of changing it? 0.1 is too much time, I need some more resolution.

6
Audio / Clear buffer of sf::SoundBufferRecorder
« on: September 21, 2011, 02:57:43 pm »
I'm applying a FFT, so I need to store chunks of data in a buffer no matter what.

7
Audio / Clear buffer of sf::SoundBufferRecorder
« on: September 21, 2011, 02:38:00 pm »
Hi.

I'm trying to do some pseudo-real time processing, using sf::SoundBufferRecorder. The question I have is, how do I clear empty the buffer captured by sf::SoundBufferRecorder once I have processed the data?

I've tried deleting the sf::SoundBufferRecorder using something like

Code: [Select]
recorder = sf::SoundBufferRecorder();


But it gives me an error in compile time. I can't directly modify the buffer that returns GetBuffer() because it's const.

What can I do?

8
Window / [Linux] UTF-8 on window titlebar (UTF-8 encoded file)
« on: February 14, 2011, 09:24:48 pm »
However, I've downloaded and compiled the SVN Snapshot of SFML 2 and the problem remains... I don't know :(

9
Window / [Linux] UTF-8 on window titlebar (UTF-8 encoded file)
« on: February 14, 2011, 08:58:54 pm »
I'll wait for V.2 to get to the Ubuntu repositories then  :lol:

10
Window / [Linux] UTF-8 on window titlebar (UTF-8 encoded file)
« on: February 14, 2011, 05:45:45 pm »
caption.size() returns 6, because the character "á" is represented using two bytes.

With the back inserter code it freezes too.

11
Window / [Linux] UTF-8 on window titlebar (UTF-8 encoded file)
« on: February 14, 2011, 04:18:44 pm »
This is really weird... after the first resize, it gets frozen when the first conversion starts:

Code: [Select]
string caption = "ááá";
sf::Unicode::UTF32String cap32;
cap32.resize(caption.size());
cout << "1st resize" << endl;
sf::Unicode::UTF32String::iterator end = sf::Unicode::UTF8ToUTF32(caption.begin(), caption.end(), cap32.begin());
cout << "1st conversion" << endl;
cap32.erase(end, cap32.end());
cout << "1st erase" << endl;

string final;
final.resize(cap32.size());
cout << "2nd resize" << endl;
string::iterator endA = sf::Unicode::UTF32ToANSI(cap32.begin(), cap32.end(), final.begin());
cout << "2nd conversion" << endl;
final.erase(endA, final.end());
cout << "2nd erase" << endl;


That only prints "1st resize" and there it stays forever.

By the way, if I remove all the non-ascii chracters from the string caption, for instance "string caption = "aaa", it works (but hey, I want those accents back xD)

12
Window / [Linux] UTF-8 on window titlebar (UTF-8 encoded file)
« on: February 14, 2011, 02:17:11 am »
I haven't had any luck with this, and tried everything:

Code: [Select]
#include <SFML/Graphics.hpp>

int main(int argc, char *argv[])
{
    sf::RenderWindow MyWindow;

    // MyWindow.Create(sf::VideoMode(800, 600), "ááá"); // Appears "Ä¡Ä¡Ä¡

    // sf::Unicode::Text Titlebar("ááá");
    // MyWindow.Create(sf::VideoMode(800, 600), Titlebar); // Blank title

    // sf::Unicode::Text Titlebar(L"ááá"); // Note the L
    // MyWindow.Create(sf::VideoMode(800, 600), Titlebar); // Blank title as well

    std::string caption = "ááá", destAnsi;
    sf::Unicode::UTF32String cap32;
    sf::Unicode::UTF8ToUTF32(caption.begin(), caption.end(), cap32.begin());
    sf::Unicode::UTF32ToANSI(cap32.begin(), cap32.end(), destAnsi.begin()); // Gets frozen!!
    MyWindow.Create(sf::VideoMode(800, 600), destAnsi);

    while(MyWindow.IsOpened()){
sf::Event Event;
while(MyWindow.GetEvent(Event)){
   if(Event.Type == sf::Event::Closed){
MyWindow.Close();
   }
}

MyWindow.Clear();
MyWindow.Display();
    }

    return 0;
}

13
Window / [Linux] UTF-8 on window titlebar (UTF-8 encoded file)
« on: February 07, 2011, 12:32:24 pm »
Looks like there's no UTF8 to Ansi in 1.6 :(

14
Window / [Linux] UTF-8 on window titlebar (UTF-8 encoded file)
« on: February 07, 2011, 08:35:13 am »
Thanks. How would I do it under SFML 1.6? Looks like sf::UTF8 is only part of 2.0.

15
Window / [Linux] UTF-8 on window titlebar (UTF-8 encoded file)
« on: February 07, 2011, 01:11:48 am »
Hi there.

I've just started using SFML and one of the first problems I've come across is some weird characters on the the titlebar whenever I try to use accents or any other extended char.

For instance, I've got:
Code: [Select]
   sf::RenderWindow Ventana(sf::VideoMode(800, 600, 32), "Año nuevóóó");

And the titlebar renders like: "AÂ+o nuevoA³A³A³".

This ONLY HAPPENS if my source code file is enconded in UTF-8. If I change encoding to ISO-8859-1, it shows properly. Obviously all of my files use UTF-8, as its the system-wide encoding.

Pages: [1]
anything