SDL_net : Own IP/Port?

I have actually come to another conclusion regarding my problem.
It no longer requires that I know the IP/Port but any information on this
would be helpfull for future reference.

Regards,

Si.

If I setup a listening port with…
udpSocket = SDLNet_UDP_Open(0);

How can I find what port was actually opened?
I have tried…
tempIPAddress = SDLNet_UDP_GetPeerAddress(udpSocket, -1);
But as reported in docs it only returns info on the port that was specified
with SDLNet_UDP_Open(port);

Im really just after the port number. Any ideas would be greatly appreciated.
I know gethostname will get the IP, but this is not a part of SDL_net :frowning:

Regards,

Si.

I’ve been writting some tests apps using SDL for the last couple of months.
Being a linux and windows user, I test my applications at both OSes. My
results confuse me a little. You see, the source code remains the same (since
SDL is portable), however speed varies a lot between the Operating Systems.
Here are some of my results ::

Mandrake 8.2 with nvidia 2960 drivers
getpixels test -> time needed = 8 seconds
SDL_Blit test -> speed = almost good (constant at window/fullscreen mode!)

Windows ME with nvidia 29.42 drivers + direct X 8.1
getpixels test -> not tested
SDL_Blit test -> speed = unbelievably SLOW

Windows XP with nvidia 29.42 drivers + direct X 8.1
getpixels test -> time needed = 22 seconds !!!
SDL_Blit test -> speed = almost good (at window mode)
SUPERFAST at fullscreen mode

Considering the source code doesn’t change at all, could there be a
logical explenation of this speed variation?—
http://www.freemail.gr - ??? ??? ??? ???.

I’m no expert w/ SDL, but I think I can partially answer this. I assume
that with Mandrake your getpixel test is accessing pixels on a software
surface, and your Windows XP getpixel test is accessing pixels on a
hardware surface, that would explain the differences in those times.
Somebody correct me if I’m wrong. Is that what’s going on? Do you have
software surfaces in Mandrake and hardware surfaces in Windows XP?
Because as far as I understand it, accessing pixels, like a getpixel
test would do, is much quicker to a software surface than to a hardware
surface, since it has to go through the PCI/AGI bus. Right?On Mon, 2002-07-29 at 15:58, George wrote:

Mandrake 8.2 with nvidia 2960 drivers
getpixels test -> time needed = 8 seconds
SDL_Blit test -> speed = almost good (constant at window/fullscreen mode!)

Windows ME with nvidia 29.42 drivers + direct X 8.1
getpixels test -> not tested
SDL_Blit test -> speed = unbelievably SLOW

Windows XP with nvidia 29.42 drivers + direct X 8.1
getpixels test -> time needed = 22 seconds !!!
SDL_Blit test -> speed = almost good (at window mode)
SUPERFAST at fullscreen mode

I’m no expert w/ SDL, but I think I can partially answer this. I assume
that with Mandrake your getpixel test is accessing pixels on a software
surface, and your Windows XP getpixel test is accessing pixels on a
hardware surface, that would explain the differences in those times.
Somebody correct me if I’m wrong. Is that what’s going on? Do you have
software surfaces in Mandrake and hardware surfaces in Windows XP?
Because as far as I understand it, accessing pixels, like a getpixel
test would do, is much quicker to a software surface than to a hardware
surface, since it has to go through the PCI/AGI bus. Right?

Yep, that’s correct.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Mandrake 8.2 with nvidia 2960 drivers
getpixels test -> time needed = 8 seconds
SDL_Blit test -> speed = almost good (constant at window/fullscreen
mode!)

Windows ME with nvidia 29.42 drivers + direct X 8.1
getpixels test -> not tested
SDL_Blit test -> speed = unbelievably SLOW

Windows XP with nvidia 29.42 drivers + direct X 8.1
getpixels test -> time needed = 22 seconds !!!
SDL_Blit test -> speed = almost good (at window mode)
SUPERFAST at fullscreen mode

I’m no expert w/ SDL, but I think I can partially answer this. I assume
that with Mandrake your getpixel test is accessing pixels on a software
surface, and your Windows XP getpixel test is accessing pixels on a
hardware surface, that would explain the differences in those times.
Somebody correct me if I’m wrong. Is that what’s going on? Do you have
software surfaces in Mandrake and hardware surfaces in Windows XP?
Because as far as I understand it, accessing pixels, like a getpixel
test would do, is much quicker to a software surface than to a hardware
surface, since it has to go through the PCI/AGI bus. Right?

Also, I think in Linux, fullscreen mode is created by simply taking a
window and putting a black border around it, then restricting the mouse
to that area. That would explain why windowed and fullscreen are the
same. Both are windows, and neither has hardware access. There are no
hardware surfaces (except for the one explained below).

Unless of course you use the DGA backend, where fullscreen is actually
hardware access.

SteveOn July 29, 2002 11:19 pm, Chris Thielen wrote:

On Mon, 2002-07-29 at 15:58, George wrote:

I’m no expert w/ SDL, but I think I can partially answer this. I assume
that with Mandrake your getpixel test is accessing pixels on a software
surface, and your Windows XP getpixel test is accessing pixels on a
hardware surface, that would explain the differences in those times.
Somebody correct me if I’m wrong. Is that what’s going on? Do you have
software surfaces in Mandrake and hardware surfaces in Windows XP?
Because as far as I understand it, accessing pixels, like a getpixel
test would do, is much quicker to a software surface than to a hardware
surface, since it has to go through the PCI/AGI bus. Right?

Yep, that’s correct.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Does this mean that every surface I create under linux is Software
Accelarated? If so, that explains all my test results, however it is not
very encouraging…
Is this a problem with the nvidia drivers? Is there any way to get
Hardware Accelaration for the Surfaces of the 2D game I’m creating?

Thanks for all the answers so far :)—
http://www.freemail.gr - ??? ??? ??? ???.

Also, I think in Linux, fullscreen mode is created by simply taking a
window and putting a black border around it, then restricting the mouse
to that area. That would explain why windowed and fullscreen are the
same. Both are windows, and neither has hardware access. There are no
hardware surfaces (except for the one explained below).

Unless of course you use the DGA backend, where fullscreen is actually
hardware access.

Steve

thanx a lot, guys! Ignore my previous question, since it has been already
answered.
Thanks again :)—
http://www.freemail.gr - ??? ??? ??? ???.