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

Pages: [1]
1
Network / SFML - FTP not working
« on: January 29, 2012, 10:44:32 pm »
Oh your right! The include of the windows.h was in an other headerfile!

But if I'm using now the GetMessage - the program compile successfully - I get no message! It means the consol is empty.

2
Network / SFML - FTP not working
« on: January 29, 2012, 10:36:36 pm »
2.0 (Beta)

3
Network / SFML - FTP not working
« on: January 29, 2012, 10:32:54 pm »
And how can I fix this?!

My Header:
Code: [Select]
#include <iostream>
#include <string>
#include <fstream>
#include <SFML/Network.hpp>

4
Network / SFML - FTP not working
« on: January 29, 2012, 10:24:01 pm »
Okay I test with this code:
Code: [Select]
sf::Ftp FTP;
sf::Ftp::Response ConnectResponse = FTP.Connect("ftp://ftp.lima-city.de");
sf::Ftp::Response LoginResponse = FTP.Login("amd", "xxx");


ConnectResponse.GetStatus() = 1001
LoginResponse.GetStatus() = 1002

If I use GetMessage, then I can't compile the project.
LoginResponse.GetMessage() = 'GetMessageW': Is not an element of 'sf::Ftp::Response'

5
Network / SFML - FTP not working
« on: January 29, 2012, 10:06:08 pm »
Hey!

I' try to download a file over my ftp server but it don't work! :/
Here is my Code (only the login but this dont work!):
Code: [Select]
sf::Ftp ftp;
 sf::Ftp::Response response = ftp.Connect("ftp://ftp.lima-city.de");
 if (response.IsOk())
     std::cout << "Connected" << std::endl;

response = ftp.Login("amd", "xxx");
 if (response.IsOk())
     std::cout << "Logged in" << std::endl;


._.

6
Audio / How to delete a sound?
« on: October 15, 2011, 08:48:54 pm »
Okay, I am using int main :wink:

But I have no solution for my problem...
It must be possible to play a sound in other function without to use a pointer but this is not possible in my case? But why?
You see my last post with the second code which isn't working! I don't using pointers and I don't listen any sound  :cry:

7
Audio / How to delete a sound?
« on: October 15, 2011, 08:35:48 pm »
Yes I using C/C++ and you can use void main and not int main  :roll:
I think normally you write:
Code: [Select]
int main() {
//Some code here
return 0;
};


But this will work to:
Code: [Select]
void main() {
//Code...
return;
};


Don't return the nil  :wink:
But thats not important for the problem...

I will show some short codes with the problem:
THIS WORK:
Code: [Select]
int main()
{
sf::SoundBuffer Buffer;
Buffer.LoadFromFile(sound);
sf::Sound Sound(Buffer);
Sound.Play();

return 0;
};


THIS WORK NOT:
Code: [Select]

void CallMySound()
{
sf::SoundBuffer Buffer;
Buffer.LoadFromFile(sound);
sf::Sound Sound(Buffer);
Sound.Play();
};

int main()
{
CallMySound();
return 0;
};



THIS WORK:
Code: [Select]

void CallMySound()
{
    sf::SoundBuffer *Buffer = new sf::SoundBuffer;
    Buffer->LoadFromFile(sound);
    sf::Sound *Sound = new sf::Sound(*Buffer);
    Sound->Play();
};

int main()
{
CallMySound();
return 0;
};



You see it? I can't play a sound outside the main!
The function will load correctly but I don't listen any sound! The new stuff fix this but that's not really good for the ram if I call this again and again...

8
Audio / How to delete a sound?
« on: October 15, 2011, 08:17:43 pm »
This will not work...
Always if I include the sound function outside from the void main() it will not work... I dont know why but outside the main it works only with new... you know why?

9
Audio / How to delete a sound?
« on: October 15, 2011, 08:06:42 pm »
I'am not sure what you mean  :oops:

Can you show me a fixxed code how to do it right?!

10
Audio / How to delete a sound?
« on: October 15, 2011, 07:41:15 pm »
Hello :)

I wrote a function to play a sound and delete the sound after playing but this isn't possible.
If I try to delete the sound the application crash!

Here is the small code:
Code: [Select]
   sf::SoundBuffer *Buffer = new sf::SoundBuffer;
    Buffer->LoadFromFile(sound);
    sf::Sound *Sound = new sf::Sound(*Buffer);
    Sound->Play();
//    sf::Sleep(Buffer->GetDuration());
    delete Sound;
    delete Buffer;


If I delete the both lines with "delete Sound" and "delete Buffer" the function works good but I need more and more ram if I play the sound again.
I try to include a sleep and wait if the sound done but it makes no diffrence....

I hope you understand all the problem and can help me to fix this.
(I am using SFML 1.6)

Pages: [1]
anything