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

Pages: [1] 2
1
Graphics / sf::Texture bind
« on: October 11, 2011, 10:46:59 pm »
Is this function slow and should not be used? I just switched over a little texture manager over I made that used GLuints to store the textures and what not to use sf::Texture and now instead of doing glBindTexture I do texture->Bind();

I see about a 10% increase in my CPU usage, before about 8-12% now 22-28%.

I may have done something wrong , I'm going to look over everything once again. I'll edit this post with updates.

2
Network / Cannot receive when sending to myself
« on: July 02, 2011, 03:57:13 am »
http://www.sfml-dev.org/documentation/2.0/classsf_1_1UdpSocket.php

There is an example there, try that out : o

3
Network / UDP and send AND receiving?
« on: June 30, 2011, 09:10:24 pm »
Yeah.. if I have it set to non blocking, any packets sent BEFORE a single socket.receive is called will make it. But any after do not make it.. I am so confused .. any help please, as I wish to continue work on my project :c

EDIT:
I now have it working... I was passing a filled IPAddress and port to receive.. this really threw me off for a while :C oh well all good now. Thanks.

4
General / Pac man game
« on: June 28, 2011, 09:08:59 pm »
Just check the piece in the array if pac man is allowed to move there, and let pac man move if it is allowed.

5
Network / UDP and send AND receiving?
« on: June 28, 2011, 01:51:35 am »
I am trying to receive and send with a UDP socket, but it never works.. I can either just send, or receive. I have tried non blocking, I have tried more than one thread.. It just seems that I can only send and receive if I use 2 sockets..? Any input on this? :c

if I have a loop like so:

Code: [Select]
while(running)
{
     receive();
     sendAPacket();
}

and receive is like so:
Code: [Select]

sf::Socket::Status socketStatus = recvSocket.Receive(recvPacket, serverIP, port);
if(socketStatus == sf::Socket::Done)
{
if(recvPacket >> receivePacket)
{
                }
         }
}

No packets will be received by the server, whether the socket is blocking or not....... if I comment out receive, the server gets all packets.. but the client no longer can receive...

What is happening!??!

Should I switch to something else? I really enjoy the whole packet thing though :|!

6
General discussions / How to handle GUI Events Correctly?
« on: June 17, 2011, 04:46:37 pm »
I know that rect's have a Contains(x, y) function, maybe make a Rect for each button, and then just have a function where you pass a rect and x and y and it does the check?
Code: [Select]
if(outline_rect.Contains(cords.x, cords.y))
{
activate();
}

7
General discussions / The Concept of Screen moving [2d camera]
« on: June 16, 2011, 03:38:02 pm »
For my 2d top down tile based game I take the players position, and the camera's center then I subtract the two and I do camera.move * difference * delta time

gives a nice effect and works well!

8
SFML website / Sometimes you have to logon twice..
« on: June 15, 2011, 03:21:13 pm »
I can say that this never happens to me, one time seems to do the trick.

9
Network / Packet transmission is unreliable and badly designed
« on: June 11, 2011, 09:31:03 pm »
Quote from: "Laurent"
Quote
I'll change the implementation and update the corresponding documentation as soon as possible.

Done.


This is great Laurent, it is nice to see someone respond so quickly to a matter ^^. Especially since I'll be using UDP networking with sfml soon! :p

10
Network / Tile based network game
« on: June 10, 2011, 10:58:11 pm »
I'm going to be making a networked top down tile based game, and I will have many questions [hopefully not too many] so I want to open a thread to ask them in so I don't have to make 100 threads.
Anyway, I'll start with my first question...
Would it be more sensible to have text files of all the maps in the game, for both the client AND server or the server to send map information whenever they move to new areas, etc?
I see the upside of the both client and server for less network work on the server.
This may also show all the areas of the world to the client if they found the files.. and they would be able to edit them, although the server would always check with its copy and it wouldn't matter.
Any input appreciated.

11
General / [Solved] Moving from 1.6 to 2.0
« on: June 10, 2011, 02:04:54 am »
So I compiled 2.0 and I get lots of errors using it with my 1.6 code, yay.
I fixed most, such as string to text.. but I was using ::Shape.SetOutline etc to make a nice little textbox wrapper

How do I go about doing this now? It seems they are not part of ::Text now
Code: [Select]
outline.EnableOutline(true);
outline.EnableFill(false);
outline.SetOutlineWidth(1);

:C[/size]

-- Nevermind, did not look closely enough. :x sorry! Will not make a useless thread again. -.-

12
Graphics / Tile based theory
« on: June 09, 2011, 05:59:44 pm »
Can one sprite be redrawn many times? I can not try at the moment as I am not on my desktop computer.
Code: [Select]

sf::Sprite test;
test.SetImage...
screen.Draw(test);
test.SetPosition(x, y);
screen.Draw(test);


I'm assuming this works..

13
Graphics / Tile based theory
« on: June 09, 2011, 05:47:56 pm »
I'm going to start working on a tile based game, but I would like to run some questions by to get some input on how to do this correctly and efficiently.

I assume I would use.. a vector of tiles? where tile would be a struct

Code: [Select]
enum tileType
{
   grass,
   water
};

struct tile
{
    sf::Sprite tileSprite;
    tileType type;
};

vector<tile> tiles;

An image manager would make sure only one copy of an image was loaded and a reference was passed to each tileSprite.
And I would loop through a text file / string and grab each character and make it into a tile with a nested for loop.
I would later loop through it to draw.

Does any of this seem to be incorrect, or a simple/superior way of doing it?

14
Graphics / String Class
« on: June 09, 2011, 05:36:56 pm »
You want.. sf::String

Code: [Select]
sf::String Text("Nacho Cheese");
   Text.SetFont(sf::Font::GetDefaultFont());
   Text.SetScale(2.f, 2.f);

You must initalize Text like that so it calls the constructor to initalize the text inside the string.. you could also

Code: [Select]
sf::String Text;
Text.SetText("Cheese");
...



oh... I haven't used 2.0 yet.. so I guess it is sf::Text.. disregard this I guess, unless you are using 1.6. :\..
I guess I should try 2.0....

15
General discussions / radeon xxxx
« on: June 05, 2011, 03:51:39 am »
ah okay, was using 1.6. thanks for the heads up

Pages: [1] 2