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

Pages: 1 [2] 3
16
General / Here are compiled SFML 2.0 lib for Visual Studio 2010
« on: September 28, 2010, 06:59:48 pm »
Look at the Date of the Post....Name change was ~1 Month ago, the post is from July....

17
General / [C++] sf::RenderWindow
« on: September 27, 2010, 07:13:06 pm »
You can only use init lists in the classes constructor, like this example:

Code: [Select]

class myClass {
    sf::RenderWindow &app;
    myClass(sf::RenderWindow &app);
}

myClass::myClass ( sf::RenderWindow &app) : app(app) {
   <foo>
}



int main() {

sf::RenderWindow App(...);

myClass foo(App);
}

18
Python / Python binding buggy?
« on: September 23, 2010, 02:21:23 pm »
I rebuilt the sf.pyd using mingw32-gcc-4.5.0 . Did not changed anything in the sources or whatever.

Now the error does not happen.

Download it here :



Built with Python 2.7
http://www.apeironstudios.com/sf-mingw32-4.5.0-python-2.7.zip

Built with Python 3.1.2
http://www.apeironstudios.com/sf-mingw32-4.5.0-python-3.1.2.zip

Greets,

Spellbreaker

19
Python / Python binding buggy?
« on: September 23, 2010, 02:02:03 pm »
I can confirm that, I'll try to get more information. Python2.7 & SFML 1.6 on Win7 - 64 Bit

20
Network / selector.Wait() behavior
« on: September 22, 2010, 01:40:53 pm »
Thanks :) Quite obvious now :D

Quote from: "Laurent"

By the way, if you'd given me a true minimal code (ie. with no cClient class), you'd have found the error by yourself... ;)
When people here ask for minimal codes, they are not asking for pieces of your original code, but instead they want the poster to find the actual piece of code which is really causing the problem; the solution often comes naturally after doing that.


Okay, will keep that in Mind for the next Time :D

21
Network / selector.Wait() behavior
« on: September 22, 2010, 12:44:43 pm »
Sure.
Here's an archive with the Source, just two files ( client.cpp and server.cpp ) with project files ( c::b ) and stuff.

http://www.apeironstudios.com/nettest.7z

22
Network / selector.Wait() behavior
« on: September 22, 2010, 11:13:27 am »
Hi again .

I have a strange behavior regarding the selector.Wait() behavior :


Code: [Select]

#include "server.hpp"

cClient::cClient(sf::TcpSocket *socket, sf::Uint32 UID) {
    this->socket = socket;
    this->UID = UID;
}

cClient::~cClient() {
    this->socket->Disconnect();
    delete this->socket;
}

sf::Uint32 cClient::getUID() {
    return this->UID;
}

int main() {
    unsigned short Port = 1337;
    sf::SocketSelector selector;
    sf::TcpListener listener;
    //std::list<sf::TcpSocket*> clients;
    std::list<cClient> clientList;
    listener.Listen(Port);
    selector.Add(listener);
    sf::Uint32 UID;
    std::cout << "Server is listening to Port " << Port << ", waiting for connections..." << std::endl;
    while (true) {
        if (selector.Wait()) {
        std::cout << "#" << std::endl;
            if (selector.IsReady(listener)) {
                std::cout << "b" << std::endl;
                UID++;
                sf::TcpSocket* client = new sf::TcpSocket;
                if (listener.Accept(*client) == sf::Socket::Done) {
                    cClient newClient(client, UID);
                   // clients.push_back(client);
                    clientList.push_back(newClient);
                    selector.Add(*client);
                    std::cout << "New Client connected!" << std::endl;
                }
            } else {
                std::cout << "or what?" << std::endl;
                for ( tClientList::iterator it = clientList.begin(); it != clientList.end(); ++it ) {
                    sf::TcpSocket& client = *it->socket;
                    if ( selector.IsReady(client) ) {
                        sf::Packet packet;
                        if (client.Receive(packet) == sf::Socket::Done) {
                            std::string Message;
                            packet >> Message;
                            if ( Message == "qq" ) {
                                selector.Remove(client);
                                client.Disconnect();
                                std::cout << "Socket closed." << std::endl;
                            } else {
                                std::cout << "A client says : \"" << Message << "\"" << std::endl;
                            }
                        } else {
                            std::cout << "Socket Killed" << std::endl;
                            selector.Remove(client);
                        }
                    }
                }
            }
        }
    }
}


For some reason, the Wait() only waits until the first client is connected, after that the cout "#" never appears again, and the loop is looping endlessly (of course ).

What am I doing wrong?

Usign SFML 2 rev 1570


greets,

Spellbreajer[/code]

23
Network / [SOLVED] undefined reference to `socket@12'|
« on: September 22, 2010, 10:12:34 am »
Seems to be a C::B problem, I inserted a "pause" after every code::blocks call, now it compiles without problems.

Don't know why....

Thanks again :)

24
Network / [SOLVED] undefined reference to `socket@12'|
« on: September 22, 2010, 09:49:52 am »
sorry, doesn't work with ws2_32 either :| Do I have to use a specific order for the libs?

25
Network / [SOLVED] undefined reference to `socket@12'|
« on: September 22, 2010, 09:47:56 am »
Ah okay.

I have problems with batch-build ( codeblocks ). Sometimes it simply hangs, so I compiled sfml using the codeblocks workspace. But now it works, thanks :)

26
Network / [SOLVED] undefined reference to `socket@12'|
« on: September 22, 2010, 09:18:05 am »
Hi there!

I just downloaded SFML 2 SVN, built the libs, and when I want to compile my little network test, the following Error appears:

...undefined reference to `socket@12'|


and a bunch of other undefined references.

I am linking statically to system, network and wsock32, using mingw/gcc 4.5

Thanks in Advance.


Spellbreaker

27
Window / Question
« on: August 20, 2010, 09:11:53 am »
Thanks, that was my problem :) So i simply added the view as a class member, now I can reset the window without problems :)

28
Window / Question
« on: August 20, 2010, 09:04:17 am »
Hi again,

now, I am using the following code to "reset" the Main Window, but after that all draw commands do not seem to work :| The screen keeps beeing white. When I cut that code out, drawing / refreshing works fine.


Code: [Select]
                   
sf::View tmpView = app.GetView();
sf::FloatRect tmpRect;
sf::VideoMode vMode;
vMode = vMode.GetDesktopMode();
sf::Uint32 posL = (vMode.Width/2) - (width/2);
sf::Uint32 posT = (vMode.Height/2) - (height/2);
tmpRect.Top = 0;
tmpRect.Bottom = height;
tmpRect.Left = 0;
tmpRect.Right = width;
tmpView.SetFromRect(tmpRect);
app.SetView(tmpView);
app.SetSize(width, height);
app.SetPosition(posL, posT);
app.Clear(sf::Color(255,255,255));
app.Display();

29
Window / Question
« on: August 19, 2010, 11:17:22 pm »
Hey there!

I have a question about SetSize: Does it only "strech" the window, or does it really create a new render region?

I am developing a little game, and there are left-right scrolling levels, and up/down scrolling, so I have to change the window from 407x594 to 594x407 while the game is running.

Is that done with SetSize() ?


Sincerly,

Spellbreaker.

30
General discussions / Game Maker flooding the market with crap?
« on: August 06, 2010, 05:10:29 pm »
I also have to admit, that I created my very first RPG with "Forgotten Realms Unlimited Adventures" :) It was a lot of fun to create Games with that tool :D :D

Pages: 1 [2] 3
anything