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

Pages: [1] 2
1
General / [ANSWERED] Window not showing up (perhaps ATI-related)
« on: December 06, 2011, 04:56:35 pm »
I get BSOD when adding that DLL  :lol:

2
General / Compiling SFML 2.0
« on: December 02, 2011, 09:19:29 am »
Thanks, everything is working!

3
General / Compiling SFML 2.0
« on: December 02, 2011, 12:29:13 am »
Hi,
i'm trying to build sfml 2.0 ...
according to tutorial i generated CodeBlock project file, but when i open it and try to build i get this:

Code: [Select]

-------------- Clean: all in SFML ---------------

Cleaned "SFML - all"

-------------- Build: all in SFML ---------------

Using makefile: Makefile
[  1%]
Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.obj
[  2%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Err.cpp.obj
[  3%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Lock.cpp.obj
[  4%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Mutex.cpp.obj
[  6%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Sleep.cpp.obj
[  7%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/String.cpp.obj
[  8%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Thread.cpp.obj
[  9%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/ThreadLocal.cpp.obj
[ 10%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/MutexImpl.cpp.obj
[ 12%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/Platform.cpp.obj
[ 13%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/ThreadImpl.cpp.obj
[ 14%]
Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/ThreadLocalImpl.cpp.obj
Linking CXX shared library ..\..\..\lib\sfml-system-2.dll
mingw32-g++.exe: unrecognized option '-static-libstdc++'
Creating library file: ..\..\..\lib\libsfml-system.a
process_begin: CreateProcess((null), echo Built target sfml-system, ...) failed.
make (e=2): The system cannot find the file specified.
make.exe[1]: *** [src/SFML/System/CMakeFiles/sfml-system.dir/all] Error 2
make.exe: *** [all] Error 2
[ 14%]
Process terminated with status 2 (0 minutes, 4 seconds)
0 errors, 0 warnings
 

4
General / Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
« on: December 23, 2010, 10:17:08 pm »
Quote from: "Laurent"
-static-libgcc in linker options.

it doesnt work
i hope this time there isn't spell mistakes  :lol:

5
General / Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
« on: December 23, 2010, 09:59:53 pm »
ouuu..  :oops:   :lol:

but question  how to statically link libgcc_s_dw2-1.dll is still active  :?

6
General / Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
« on: December 23, 2010, 09:42:03 pm »
Quote from: "Laurent"
Did you define SFML_DYNAMIC?

yes

7
General / Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
« on: December 23, 2010, 06:58:44 pm »
i have the same problem.. can anyone help?

and why i get this:
Quote

||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|
||Info: resolving vtable for sf::Sprite by linking to __imp___ZTVN2sf6SpriteE |
||Info: resolving sf::Color::Black     by linking to __imp___ZN2sf5Color5BlackE |
||=== Build finished: 0 errors, 1 warnings ===|

8
Network / my first network program
« on: September 20, 2010, 06:13:12 pm »
feel free to say anything, people   :?

9
Network / my first network program
« on: September 17, 2010, 12:10:27 am »
Quote from: "andbal"

In that pic he posted u can see some clients and a server exchanging packets. Problem is the one I described previously - server is already receiving/sending ~134th packet to clients but the last packet clients received is ~80-90th.


yup thats the problem..
someone help please?! ;(

10
Network / UDP Server - Handling multiple connections
« on: September 16, 2010, 09:14:28 pm »
i was asking something similar few topicks lower
you dont need selector if you are using only one socket

and here is my attempt to creat multiple client <-> server application with UDP, but it lags :/

11
Network / [SOLVED] Server and client
« on: September 16, 2010, 06:21:24 pm »
server:
Code: [Select]
#include <SFML/Network.hpp>
#include <iostream>


int main()
{
    const unsigned short Port = 2435;

    sf::SocketUDP Server;
    if (!Server.Bind(Port))
    {
        std::cout << " error" << std::endl;
    }

    sf::Packet Packet;
    sf::IPAddress ClientAddress;
    unsigned short ClientPort;
    Server.Receive(Packet, ClientAddress, ClientPort);

    int a;
    Packet >> a;
    std::cout << "packet : " << a << " from "<< ClientAddress <<" port: "<< ClientPort << std::endl;

    a=12345;
    Packet.Clear();
    Packet << a;
    Server.Send(Packet, ClientAddress, ClientPort);

    std::cin.ignore(10000, '\n');
    Server.Close();
    return EXIT_SUCCESS;
}


client:
Code: [Select]
#include <SFML/Network.hpp>
#include <iostream>


int main()
{
    const unsigned short Port = 2400;

    sf::SocketUDP Client;
    if (!Client.Bind(Port))
    {
        std::cout << " error" << std::endl;
    }

    sf::Packet Packet;
    sf::IPAddress ServerAddress="127.0.0.1";
    unsigned short ServerPort=2435;

    int a;
    a=54321;
    Packet << a;
    Client.Send(Packet, ServerAddress, ServerPort);

    Packet.Clear();
    Client.Receive(Packet, ServerAddress, ServerPort);

    Packet >> a;
    std::cout << "packet : " << a << " from "<< ServerAddress <<" port: "<< ServerPort << std::endl;

    std::cin.ignore(10000, '\n');
    Client.Close();
    return EXIT_SUCCESS;
}


 this will do?

12
Network / my first network program
« on: September 15, 2010, 10:31:26 pm »
ok.. i rewrote my masterpiece ;D
server:
Code: [Select]
#include <SFML/Network.hpp>
#include <iostream>
#include <stdlib.h>

#define max_clients 5

struct client_s
{
    sf::IPAddress   ip;
    unsigned short  port;
    float   x;
    float   y;
} client [max_clients];

bool SenderExist(sf::IPAddress ip, unsigned short ports)
{
    for (int n=0; n<max_clients; n++)
    {
        if(ip==client[n].ip && client[n].port==ports)
            return true;
    }
    return false;
}

int main()
{
    sf::IPAddress SenderIP;

    sf::SocketUDP Server;
    if (!Server.Bind(2323))
    {
        std::cout << " errors bindojot" << std::endl;
    }

    for (int n=0; n<max_clients; n++)
    {
        client[n].ip="0";
        client[n].port=0;
        client[n].x=0;
        client[n].y=0;
    }

    int s=0;
    float x ,y ;

    unsigned short SenderPort;

    while(true)
    {
        system("cls");

        for (int n=0; n<max_clients; n++)
            std::cout << "ID[" << n << "] " << client[n].ip << ":"<< client[n].port << " " << client[n].x << " " << client[n].y  << std::endl;

        sf::Packet Packet;
        if (Server.Receive(Packet, SenderIP, SenderPort) == sf::Socket::Done)
        {
            Packet >> x >> y;

            s++;
            std::cout << s << std::endl;

            if(SenderExist(SenderIP,SenderPort)==false)
            {
                for (int n=0; n<max_clients; n++)
                {
                    if(client[n].ip=="0" && client[n].port==0)
                    {
                        client[n].ip=SenderIP;
                        client[n].port=SenderPort;
                        break;
                    }
                }
            }
            else
            {
                for (int n=0; n<max_clients; n++)
                {
                    if(client[n].ip==SenderIP && client[n].port==SenderPort)
                    {
                        client[n].x=x;
                        client[n].y=y;
                    }
                }
            }
        }

        for (int n=0; n<max_clients; n++)
        {
            for (int n2=0; n2<max_clients; n2++)
            {
                Packet.Clear();
                Packet << n2 << client[n2].x << client[n2].y;
                Server.Send(Packet,client[n].ip, client[n].port);
            }
        }
    }
    Server.Close();
    return EXIT_SUCCESS;
}


client:
Code: [Select]
#include <SFML/Network.hpp>
#include <iostream>

#define max_clients 5

struct client_s
{
    sf::IPAddress   ip;
    unsigned short  port;
    float   x;
    float   y;
} client [max_clients];

int main()
{
    sf::IPAddress ServerAddress = "78.154.134.179";

    sf::SocketUDP Client;

    int port = sf::Randomizer::Random(1024, 3000);

    if (!Client.Bind(port))
    {
        std::cout << " errors bindojot" << std::endl;
    }
    std::cout << " bindoju " << port << " portu" << std::endl;
    Client.SetBlocking(false);

    for (int n=0; n<max_clients; n++)
    {
        client[n].ip="0";
        client[n].port=0;
        client[n].x=0;
        client[n].y=0;
    }

    float x = sf::Randomizer::Random(124.f, 200.f);
    float y = 0.0;

    sf::IPAddress ServerIP;
    unsigned short ServerPort;

    sf::Clock Clock;
    float Send_Time=0;

    while(true)
    {
        system("cls");

        for (int n=0; n<max_clients; n++)
            std::cout << "ID[" << n << "] "<< client[n].ip << ":"<< client[n].port << " " << client[n].x << " " << client[n].y  << std::endl;

        sf::Packet Packet;
        if (Client.Receive(Packet, ServerIP, ServerPort) == sf::Socket::Done)
        {
            int nn;
            float xx,yy;
            Packet >> nn >> xx >> yy;
            client[nn].x=xx;
            client[nn].y=yy;
        }

        if(Clock.GetElapsedTime()-Send_Time>0.3)
        {
            Send_Time=Clock.GetElapsedTime();
            y++;
            Packet.Clear();
            Packet << x << y;
            Client.Send(Packet, ServerAddress, 2323);
        }
    }
    Client.Close();
    return EXIT_SUCCESS;
}


every time clients sends a packet, Y is increased by 1
When server receives a packet from client, it stores it into array and sends whole array to all clients, so array at server and client should be +/- equal
but i get this:
Is it becouse I run 4 clients at 1 pc or I do something stupid at program?

13
Network / my first network program
« on: September 14, 2010, 06:33:40 pm »
Anyone?   :cry:

14
Network / my first network program
« on: September 13, 2010, 09:02:16 pm »
hey,
i want to make simple program that receives coordinates from client and sends them to other clients.
so far i've made this: http://www.failiem.lv/down.php?i=aofrvh&n=multi_graf.rar
can someone take a look at it?  :roll:

everything seams to be working fine if only one client is "connected"
that sprite who looks like shadow is player coords which are sent to server and received back..

BUT when 2 clients are active and moving, its starts to lag :?
Server log shows those received coordinates and the same are sent back, but client displays them later, because there are already dozens of coordinates waiting in line to be displayed.

What am I doing wrong?

and another question - how to statically link  libgcc_s_dw2-1.dll
i trayed  -static-libgcc but it doesn't work :/

15
Network / UDP and Selector
« on: September 12, 2010, 02:35:06 pm »
Quote from: "Laurent"

It's not, as long as you don't share variables between threads. Have you read the corresponding tutorial?

you think this:
http://www.sfml-dev.org/tutorials/1.6/system-threads.php
i haven't read it :lol:

so i just need to aad this: Server.SetBlocking(false); ?

Pages: [1] 2
anything