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

Pages: 1 [2] 3 4 ... 16
16
Window / C++ problem with sf::Event::TextEntered
« on: October 01, 2010, 11:08:08 am »
If you look closely at the documentation, you can see this :
Code: [Select]
class Event
00205 {
00206 public :
00207
00212     struct KeyEvent
00213     {
00214         Key::Code Code;    
00215         bool      Alt;    
00216         bool      Control;
00217         bool      Shift;  
00218     };
00219
00224     struct TextEvent
00225     {
00226         Uint32 Unicode;
00227     };
Meaning that Event.Key.Code is to use only when a KeyEvent occurs, not a TextEvent !

17
Feature requests / SetCursor in sf::Window
« on: October 01, 2010, 11:03:20 am »
Quote from: "NoIdea"
if you prefer, we can do a SetCursor(sf::Drawable).
No, what I pointed is that one, two or three functions are maybe not sufficient for what every one needs : what about an animated sprite ?
I'm sure that if Laurent accpet this feature, he'll have to think a lot more than just add two functions...

Quote from: "NoIdea"
Thirdly because even if it is there and you dont use it, whats the problem ?
This point is important for Laurent, he wants to keep the S of SFML : "Simple". He doesn't like add lots of functions just to have mre functions. I, actually, don't see a simple way to do what you wat and use a sprite, and use an animated sprite, and etc... This is certainly why Laurent didn't create this function first (and maybe because this is not the aim of the SFML like mooglwy said ;)).

18
Feature requests / SetCursor in sf::Window
« on: September 30, 2010, 03:29:36 pm »
Quote from: "mooglwy"
in my opinion, there is no place for such feature in a multimedia library.
As Hiura said it on the french forum, can you give us more than just a "no" ?

NoIdea explained why he wanted something like this (windowed app, not a game).

19
Feature requests / SetCursor in sf::Window
« on: September 30, 2010, 09:50:35 am »
Quote from: "NoIdea"
I don't exactly understand what you mean by "crappy cursors".
Well, I don't like the basic cursor of the OS :)

Quote from: "NoIdea"
I'm proposing to add 2 functions to sf::Window :
SetCursor(sf::Sprite);
SetCursor(CURSOR_TYPE);

Can you add a third function for an animated sprite (like I use in my games) ?
What if I want to use a sf::Shape instead ?

As you can see, there is a lot of possibilities about cursor thing. I really don't think that creating a specific function is a good thing.
I'm not against using a system cursor, just against the idea of a "specific function"...

20
Graphics / Renderimage memory leak?
« on: September 29, 2010, 01:17:33 pm »
System ?
Graphic card ?

Are your graphic drivers up to date ?

21
Network / Connected UDP
« on: September 29, 2010, 09:09:17 am »
Excuse me, but you are doing very strange things here...
- When lauching the server, the server is never finishing, so client(1) will never be launched.
- Why stopping the clien to start a server (with z), when launching client ?

What is important is that UDP socket can send and receive, no need to be a server in order to receive packets.
What is meant by "connected UDP" is that your packets must manage a "virtual connexion" between server and client :
- ask to connect to the server
- if authorized, connect effectively
- when deconnecting, send it to the server in order the server deconnect the client
- etc...

So, I would modify your code as this (directly, no verification, there can be some errors ;) ) :
Code: [Select]
int main()
{
    cout << "Type: \'s\' to run server or \'c\' to run client." <<endl;
    char input;
    cin >> input;

    if(input == 's')
    {
        server();
    }
    else if(input == 'c')
    {
        client();
    }
}


Code: [Select]
void server(int param)
{
    SocketUDP Server;

    if (!Server.Bind(10023))
    {
        cout << "Error" << endl;
        return;
    }
    cout << "Server initialized." << endl;

    std::vector<IPAddress> MyClients; // Important : the list of clients connected
    IPAddress SenderIP;
    unsigned short SenderPort;
    sf::Packet Packet;

    while (true)
    {
        if(Server.Receive(Packet, SenderIP, SenderPort) == sf::Socket::Done)
        {
            // Extract the message to know what to do
            string message;
            Packet >> message;

            // Is a new client trying to connect ?
            if (message=="CONN")
            {
            //... Verify that the client is not connected yet  (in our client vector)
            //... If not, verify we are not going over the MAX CLIENT count
            //... If not, send to the client that the connection is ok (message="OK")
            //... Add the IPAddress of the client in our vector
            }
            //A connected client is sending a message
            {
            //... Verify that the client is a connected one (in our client vector)
            //... If not, do nothing or send it something to explain
            //... If yes, ok, you can use the message
            //... If the message is "DECO", then remove the client from the vector, because it just deconnect !
            }
        }
    }
    Server.Close();
}


By the way, you'll need something to close the server properly.

22
SFML website / div#mainmenu display improperly in my browser
« on: September 29, 2010, 08:46:45 am »
Can you say which browser you are using ?
Mayebe it could be possibel to use a better way than the "10pt" thing. Thinking about the '1.2em' thing for example...

23
Feature requests / SetCursor in sf::Window
« on: September 29, 2010, 08:45:15 am »
No. Another reason.

If you are developping a game, I really think you don't want to use those crappy cursors, but instead use a beautiful cursor made by your team and more "inside" the game.

If you are developping an application, there is two possibilities (IMHO) :
- Something like an editor : use your own cursors, like in the game
- Something like an app : there is a lot of chance you are going t ouse Qt or WxWidgets, or such a lib. Use their cursors in order to maintain a compatibility between platforms

24
Network / my first network program
« on: September 23, 2010, 09:07:09 am »
Tested...
Nothing seems really annoying here. Numbers are increasing correctly.

What I could suggest is some modification in the Server code :
Code: [Select]
           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;

                        //Sending only information changed
                        Packet.Clear();
                        Packet << n << x << y;
                        break;
                    }
                }

                //Sending to connected clients
                for (int n=0; n<max_clients; n++)
                {
                    if (client[n].ip!="0")
                    {
                        Server.Send(Packet,client[n].ip, client[n].port);
                    }
                }
            }
This will send only modified information only when the information changed and not resending all the information every time something may have changed. You could even add a test verifying that x or y has been effectively modified.

In the client code :
Code: [Select]
if(Clock.GetElapsedTime()>0.3)
        {
            Clock.Reset();
            y ++;
            Packet.Clear();
            Packet << x << y;
            Client.Send(Packet, ServerAddress, 2323);
        }
Nothing really important, but you can use the clock as this. No need to keep a Timer object ;)

25
General / Beginner Code Problems
« on: September 23, 2010, 08:36:23 am »
Quote from: "Friend"
Is there maybe a better way to do this? Maybe I can build some kind of function where you give it the string of text and the location of where you want the text displayed and have some kind of fading effect built into that function?
Since you understood basics, now you can create an object containing a string, a begining alpha value, a ending alpha value, and a speed changing value in order to make some text appears or disappears easily...

26
Network / Problem with IP
« on: September 22, 2010, 04:21:20 pm »
Quote from: "Krosan"
your pc behind the modem has a private or public ip?
Under Windows : Execute : cmd
then ipconfig

Under Linux : ifconfig in a terminal ;)

27
Network / Problem with IP
« on: September 22, 2010, 08:46:34 am »
So, can you try the SFML network samples ? Is this working ?

28
Graphics / Sprite and view artifact
« on: September 22, 2010, 08:45:50 am »
Hello,

Did you try to use Image.SetSmooth(false) ?

29
SFML projects / Excellence (previously Eve Shooter)
« on: September 21, 2010, 09:06:46 am »
Quote from: "Friend"
How did you compile the game so that the resources are encrypted in a special file format and all? I'm a beginner programmer so I'm not totally familiar with these things.
I could say that he used something like this tutorial ;)

30
Network / my first network program
« on: September 21, 2010, 09:02:36 am »
Hmmm
Downloading SFML 1.7 to test your code...

Pages: 1 [2] 3 4 ... 16