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

Pages: [1]
1
Network / Problems with compiling
« on: October 09, 2013, 01:44:16 am »
I have a problem when compiling.Keep getting these errors.http://prntscr.com/1w4zts
Heres the code
#include <iostream>
#include <SFML/Network.hpp>
using namespace std;


class NewBot{
sf::TcpSocket socket;
int ChatID;
public:
bool Connect(string ip,int port);
bool sendPackets(char data[100]);
string recievePackets();
NewBot(int k,int id);
};

NewBot::NewBot(int k,int id){
string ip="151.5151.15151.5418541";
int port=10014;
if(this->Connect(ip,port)){
    cout <<"Test1";
    //Room Number here
    char sendthingy[100]="<y r=\"15\" m=\"1\" />";
    this->sendPackets(sendthingy);
    cout << this->recievePackets();
}
}

bool NewBot::Connect(string ip,int port){
    sf::Socket::Status status=socket.connect(ip,port);
    bool returnvalue;
    if(status!=sf::Socket::Done){
        returnvalue=false;
    }
    else{
        returnvalue=true;
    }
    return returnvalue;
}

bool NewBot::sendPackets(char data[100]){
if(socket.send(data,100)!=sf::Socket::Done){
    cout<<"Error Could not send Packets";
    return false;
}
else{
    return true;
}
}

string NewBot::recievePackets(){
char data[100];
std::size_t received;
socket.receive(data, 100, received);
return data;
}


int main(){
int k,id; cin>>k; cin>>id;
NewBot Bot(k,id);
}
 
I compiled it with sfml 2.1

2
General discussions / Flash Chat
« on: February 25, 2013, 03:05:33 am »
Flash Chat to get help for SFML(mostly for me to get help) :P
http://xat.com/sfml

3
General / Installing SFML Eclipse
« on: February 21, 2013, 03:31:16 am »
Can someone please tell me how to install eclipse.(in steps by steps)

4
Window / video mode thingy
« on: February 18, 2013, 03:57:11 am »
hi i'm new to sfml/c++ can some one explain how
 sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
 
  works? Hows doe it make an constructor equal an function?

5
Window / SFML window won't show
« on: February 16, 2013, 04:17:54 am »
I recently tryed to using SFML with code block using http://www.sfml-dev.org/tutorials/2.0/start-cb.php
When i try to use the code :
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
All i get is   
This happens when i try other code that makes a window

Pages: [1]