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

Pages: [1] 2
1
Network / Basic FTP code crashes at runtime
« on: April 23, 2016, 03:53:44 pm »
Hello

This basic FTP-code ain't working for some reason. I don't get an error while compiling, but only when running.

Code:
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Network.hpp>

using namespace std;
int main() {
        sf::Ftp ftp;
        sf::Ftp::Response resp;
       
        //I have emptied these variables for this post
        string server = "";
        string user = "";
        string pass = "";
        string file = "";
        string dest = "";
       
        resp = ftp.connect(server, 21, sf::seconds(120));
        if (!resp.isOk()) cout << resp.getMessage() << " " << resp.getStatus() << endl;
       
        resp = ftp.login(user, pass);
        if (!resp.isOk()) cout << resp.getMessage() << " " << resp.getStatus() << endl;
       
        resp = ftp.download(file, dest, sf::Ftp::Ascii);
        if (!resp.isOk()) cout << resp.getMessage() << " " << resp.getStatus() << endl;
       
        ftp.disconnect();
        cin.ignore().get();
        return 0;
}

G++:
Quote
g++ c:/users/name/desktop/test3.cpp -o c:/users/name/desktop/test3 -lsfml-system -lsfml-network -std=c++11

I am using Windows 8.1, and MinGW to use G++.
I have no compiling errors, only when I execute the executable (test3.exe) I get the "test3.exe doesn't work anymore, search online for solutions ...".

Details of that error:
Probleemhandtekening:
  Gebeurtenisnaam van probleem: APPCRASH
  Naam van de toepassing:       test3.exe
  Versie van toepassing:        0.0.0.0
  Tijdstempel van toepassing:   571b7a03
  Naam van foutmodule:  libstdc++-6.dll
  Versie van foutmodule:        0.0.0.0
  Tijdstempel van foutmodule:   55b39025
  Uitzonderingscode:    c0000005
  Uitzonderingsmarge:   00021225
  Versie van besturingssysteem: 6.3.9600.2.0.0.768.101
  Landinstelling-id:    2067
  Aanvullende informatie 1:     5861
  Aanvullende informatie 2:     5861822e1919d7c014bbb064c64908b2
  Aanvullende informatie 3:     bb02
  Aanvullende informatie 4:     bb02c3b29c3f075104f1d0629e885cfc
 
Translation to English

Also note, that when I request a non existing file on the server, I get a SFML-error but the executable itself doesn't crashes. It only crashes when the file actually does exist...

Why ain't this basic code working?

Thanks!

2
Feature requests / SQL Connector Module
« on: November 06, 2015, 07:50:21 pm »
Hello

A lot of games, and other applications of which the developing can be made easier and more productive using SFML, still require a database (for storing scores, or other data).

But SFML doesn't have an option, feature, or module to connect easily to a (My)SQL-database.
It'd be nice if SFML would have this, because I personally like the style of SFML more than the one of other libraries, and than the developer ain't forced to bloat his program with loads of different libraries; but can stick to a few, or even just one or two.

Maybe, this could be a handy feature for in the (far) future? :)

Thanks for reading,

3
Network / Receiving weird characters when using UDP
« on: October 07, 2015, 03:19:11 pm »
Hello

My code does not give any error, but it ain't really working like it should be.
I'm trying to send a simple message over UDP.

Code:
#include <iostream>
#include <string>
#include <SFML/System.hpp>
#include <SFML/Network.hpp>

using namespace std;

int main() {
        sf::UdpSocket socket;
        string receiver;
        string msg;
        socket.bind(55001);
       
        //Configure send options
        /*cout << "Send to: ";
        getline(cin, receiver);*/

        receiver = "MY ONLINE IP";
        cout << "Message: ";
        getline(cin, msg);

        //Send to myself (IPCONFIG)
        socket.send(msg.c_str(), msg.size() +1, receiver, 55001);

        //Receive from myself
        char buffer[1024];
        size_t received = 0;
        sf::IpAddress sender;
        unsigned short port;
       
        socket.receive(buffer, sizeof(buffer), received, sender, port);
        cout << endl << endl << "From: " << sender << " - " << buffer << endl;

        cin.ignore().get();
        return 0;
}


 

This code, is filling the rest of the buffer with weird characters.

Quote
Message: Test


From: 0.0.0.0 - ╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠pï▬☺Test

How do I need to fix this?

Thanks for reading,

4
Window / Can't check LControl or RControl
« on: October 05, 2015, 12:09:29 pm »
Hi

I'm encountering a problem.
I want to check if the user presses the left Control (Ctrl) key.

But it ain't working.
This is my code:
else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Key::LControl) || sf::Keyboard::isKeyPressed(sf::Keyboard::Key::RControl)) {
                                                //SFML Error
                                                switch(character) {
                                                        case 13:
                                                                //Send as FIRST!!!
                                                                cout << "pressed"<<endl;
                                                                break;
                                                }
                                        }

But, what I find weird:
When I replace LControl with "Left", it's working perfectly. It only ain't working with Shift or Alt.

To be more clear, I'm using:
Asus X555LD,
Azerty keyboard-layout,
Windows 8.1,
Visual Studio 2015 Enterprise,
SFML 2.3.2.

It can't be a problem because of if/else-if orders, because I get the exact same result when placing that block on top. So, is this a problem of me, my hardware, or SFML? And how to fix it?

Thanks!

5
General / Can't get position of mouse in window
« on: October 03, 2015, 02:07:14 pm »
Hello,

I've got a small problem, I need to get the position of the mouse to check if a certain button is hovered (and clicked if sf::Mouse::isButtonPressed(sf::Mouse::Left) is true). But the problem is, that my code has a pretty complex structure.

From the main function, I launch a function (deviation), the meaning of this function is a login-box. If the login was successful (in this example it isn't checked) thread show (which shows the whole GUI), and mousePosition (which lifetime gets the position of the cursor).

The actual problem now is, that mousePosition can't get the defined values of 'window'. So the position always is (0,0). It is working if I just make a new window in the mousePosition function, but that isn't the wanted solution because then I don't have the definitions (colours, other buttons,...) and I'd have to change 80% of my code (variable places, classes,...) which have cost me a lot of hours.

This is an exact representation of my code (with lot of parts leaved out because they don't have anything to do with this problem).

Code:
#include <iostream>
#include <thread>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

using namespace std;

class A {
public:
        sf::RenderWindow window;

        void show();
        int mousePosition();
};
void A::show() {
        cout << "show Successfully launched!" <<endl;
        window.create(sf::VideoMode(800,600), "Title");
        while(window.isOpen()) {
                sf::Event windowEvent;
                while(window.pollEvent(windowEvent)) {
                        if(windowEvent.type == sf::Event::Closed) {
                                window.close();
                        }

                        window.clear(sf::Color::Black);
                        window.display();
                }
        }
}

int A::mousePosition() {
        A a;

        //Not the wanted solution:
        //sf::RenderWindow window(sf::VideoMode(800, 600), "Title");
        cout << "mousePosition Successfully launched!" <<endl;
        while (true) {
                //ERROR HERE: How to just get position of mouse relative to the window declared in class A, and defined in function show() ??
                int x = sf::Mouse::getPosition(a.window).x;
                int y = sf::Mouse::getPosition(a.window).y;

                cout << "x: " << x << endl << "y: " << y << endl << endl;
        }

        return 0;
}

class B {
public:
        void deviation() {
        A a;
                thread show(&A::show, &a);
                thread mousePosition(&A::mousePosition, &a);
                mousePosition.join();
                show.join();
        }
};

int main() {
        A a;
        B b;

        b.deviation();
}
 
There is also some explanation in the code comments.

To avoid mistakes, I don't get any compiling errors. I probably just made a logical error.

Thanks a lot for reading and helping!

6
Graphics / Can't display typed text
« on: September 23, 2015, 11:21:36 pm »
Hello

I'm having a beginner problem, I've already searched Google, Youtube, and the SFML documentation.
All I want to do, is catching what the user types and output (cout) that to the console window (I'll do it to the GUI later on).

Code:
void msgBoxTxt() {
                gui gui; //Class where the function is in
                sf::Event msgBoxEvent = sf::Event();

                cout << "Text: ";
                while (true) {
                        if (msgBoxEvent.type == sf::Event::TextEntered) {
                                cout << static_cast<char>(msgBoxEvent.text.unicode) <<endl;
                        }
                }
        }

The function is triggered correctly because "Text: " is displaying.
What am I doing wrong here?

Thanks for helping!

7
General / Can't place variables outside function
« on: September 21, 2015, 12:29:34 pm »
Hello

I'm encountering a small problem.
I've got all my variables placed in a function, who's in a class. That's working. But when I place my variables outside the function still in the class, I get the error: Expected a ')' AND Type identifier expected.

Code:
Working:
class a {
public:
void function() {
sf::RenderWindow window(sf::VideoMode(800, 600) "Title");
}
}

Not working:
class a {
public:
sf::RenderWindow window(sf::VideoMode(800, 600) "Title");
void function() {
//
}
}

How to solve this?

Thanks for reading,
Niely

8
Graphics / Hexadecimal colour codes?
« on: September 19, 2015, 10:38:36 pm »
Hello

I was wondering if there's a way to use hexadecimal colour codes in the sf::Color class.
E.g: #000000 = black, instead of using words or the RGB-system.

Any way to do this?

Thanks for reading,
Niely

9
General / Problems using SFML with Visual Studio 2015 Enterprise (Solved)
« on: September 11, 2015, 08:43:22 pm »
Hello

I'm trying to add SFML to Visual Studio 2015 Enterprise, I've followed this tutorial EXACTLY the same way:
http://www.sfml-dev.org/tutorials/2.0/start-vc.php

And tried out the code listed there.
But it ain't working, I get this error:
Quote
Severity   Code   Description   Project   File   Line
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::isOpen(void)const " (__imp_?isOpen@Window@sf@@QBE_NXZ) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2001   unresolved external symbol "__declspec(dllimport) public: static class sf::Color const sf::Color::Green" (__imp_?Green@Color@sf@@2V12@B)   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2001   unresolved external symbol "__declspec(dllimport) public: static class sf::RenderStates const sf::RenderStates::Default" (__imp_?Default@RenderStates@sf@@2V12@B)   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::CircleShape::~CircleShape(void)" (__imp_??1CircleShape@sf@@UAE@XZ) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UAE@XZ) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::RenderTarget::clear(class sf::Color const &)" (__imp_?clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::RenderTarget::draw(class sf::Drawable const &,class sf::RenderStates const &)" (__imp_?draw@RenderTarget@sf@@QAEXABVDrawable@2@ABVRenderStates@2@@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Shape::setFillColor(class sf::Color const &)" (__imp_?setFillColor@Shape@sf@@QAEXABVColor@2@@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::close(void)" (__imp_?close@Window@sf@@QAEXXZ) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::display(void)" (__imp_?display@Window@sf@@QAEXXZ) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: __thiscall sf::CircleShape::CircleShape(float,unsigned int)" (__imp_??0CircleShape@sf@@QAE@MI@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (__imp_??0Color@sf@@QAE@EEEE@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (__imp_??0RenderWindow@sf@@QAE@VVideoMode@1@ABVString@1@IABUContextSettings@1@@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::String(char const *,class std::locale const &)" (__imp_??0String@sf@@QAE@PBDABVlocale@std@@@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::~String(void)" (__imp_??1String@sf@@QAE@XZ) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main   ConsoleApplication1   c:\Users\Niel\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj   1
Error   LNK1120   17 unresolved externals   ConsoleApplication1   c:\users\niel\documents\visual studio 2015\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe   1


The only problem I could think of, is that I'm using Visual C++ version 14, and not the supported ones by SFML.

I'm using Windows 8 by the way.

But anyway, how can I fix this problem?

Thanks for reading,
Niely

10
General / Compiling Linux to Windows statically using Mingw
« on: May 25, 2015, 08:20:56 pm »
Hi

I've already tried different other methods, but I can't find a working one. I need to compile a SFML program from Linux to Windows (it should only work on Windows). And no, I won't be using Windows for programming this application.

I am now using Mingw on Linux, but it ain't working. My command:
i586-mingw32msvc-g++ st2.cpp -o st2.exe -lsfml-system -lsfml-graphics -lsfml-window -I /home/niely/Projects/screen_terminator/SFML/

I've also tried to put the SFML folder by the Mingw executable. Also that ain't working.

How can I do this? And how can I compile it statically so I don't need the SFML folder on other computers?

Thanks for reading,
Niely

11
General / Can SFML run on PCs without having it installed?
« on: April 15, 2015, 08:53:32 pm »
Hello

I tried to run my SFML applications on other Linux distributions, but it didn't worked because SFML wasn't found.
But, it's a compiled program.

Does this mean SFML can only run on computers who have SFML installed?
Or can it run even on computers without having it installed? Because it's compiled?

Thanks for reading,
Niely

12
Network / Sending mails using SFML
« on: February 28, 2015, 04:42:26 pm »
Hello

Does someone know how to send a mail with SFML C++?
My idea was to use TCP sockets, and send SMTP commands to the SMTP-server; but it ain't working.

This is my code:
sf::TcpSocket socket;
sf::Packet packet;

socket.send("smtp.gmail.com", 587);

packet << "Hi there!";
socket.send(packet);
packet.clear();

packet << "MAIL FROM: mymail@mail.com";
socket.send(packet);
packet.clear();

packet << "RCPT TO: mymail@mail.com";
socket.send(packet);
packet.clear();

packet << "DATA";
socket.send(packet);
packet.clear();

packet << "Message2";
socket.send(packet);
packet.clear();

packet << ".";
socket.send(packet);
packet.clear();

packet << "QUIT";
socket.send(packet);
packet.clear();
 

I get no compiling error, but I just don't receive a mail.

Thanks for reading,
Niely

13
Window / Problems with keeping checking if button is pressed.
« on: February 15, 2015, 11:30:41 pm »
Hello

I have a problem regarding checking if an user pressed a button.

Code:
#include <iostream>

using namespace std;
int main() {
bool repeat = true;

while (repeat) {
        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape) {
                cout << "Are you sure you want to quit?" <<endl;
        } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::A) {
                cout << "A is pressed, moving forward." <<endl;
        }
}
}

What I need to do, is checking if an user pressed a button, if it does it should print a message.

My problems:
- If I put it in a while loop to repeat checking if a button is pressed, my window gets spammed with "A is pressed, moving forward". The message should just appear once.
- If I don't put a while loop, my program just terminates without me even having the chance to type.

How do I keep repeating that checking for when a button is pressed without my program terminating and without my window spammed with the couts?

Thanks for reading,
Niely

14
Network / FTP requests using sockets
« on: January 28, 2015, 10:19:20 pm »
Hello

I was wondering, for some reason I need to use sockets to send a request to a FTP server; instead of the FTP module SFML has.

So, SFML sockets to send something to a FTP-server.
The only thing I need to send, is a request and a login. Nothing more, no uploading or something.

Is it possible to do this?
Sending the requests isn't that hard, but I've got problems figuring out how to send a login requests.

Thanks for reading,
Niely

15
Network / Error if port isn't open - Sockets
« on: January 10, 2015, 12:10:42 am »
Hello

I was wondering, I'm working with sockets now and connecting etc just works fine.
But the problem is, if I'm connecting to an IP and a closing port, the socket just keeps connecting and trying and doing nothing.

When I use an open port it works without problems.

Is it possible to make it like that
if the port isn't open => Throw an error back instantly.

Thanks for reading,
Niely

Pages: [1] 2
anything