SDL_ListModes(), what modes?

Hi,

when i display the values filled in from SDL_ListModes()
there are several “doubles” in there, i guess because
these resolutions are available in several video formats?
Is that assumption correct?

Is there a way for me to get the actual video format that
SDL can use for a certain resolution?

E.g. when “1024x768” is returned three times, what are the
video modes i can use with this resolution?

Best regards,
Torsten.

Hi,

when i display the values filled in from SDL_ListModes()
there are several “doubles” in there, i guess because
these resolutions are available in several video formats?
Is that assumption correct?

Is there a way for me to get the actual video format that
SDL can use for a certain resolution?

E.g. when “1024x768” is returned three times, what are the
video modes i can use with this resolution?

This is actually a bug, resolutions are supposed to be listed once.
SDL 1.3 will support multiple refresh rates, which is where these
duplicated modes are coming from.

Can you check to make sure this is fixed in the SDL 1.2.10 prelease
snapshot?
http://www.libsdl.org/tmp/SDL-1.2.10.tar.gz

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Hi,

i just downloaded and installed the prerelease.

I’m on a Linux system, x86-based, german distribution SuSE 9.3
with additional software installed, graphics card is NVidia
GeForce 4MX (or MX4 ?).

Iconfigured with:
./configure --prefix=/usr

sdl-config --version shows 1.2.10.

I can confirm that the modes are listed only once now.

But sadly the program that i write at the moment dies with a
"Speicherzugriffsfehler" (what is this in english, bus error?).
It does not crash immediately, but when exiting, something
seems to go wrong.

Quite in the beginning i do:
atexit(exit_func);

#define QWE fprintf(stderr, “File %s, Line %i\n”, FILE, LINE)

static void exit_func(void) {
QWE;
SDL_Quit();
QWE;
}

At shutdown i get:
File ui_sdl/ui_sdl.c, Line 112
File ui_sdl/ui_sdl.c, Line 114
./qwe: line 4: 30749 Speicherzugriffsfehler db_sdl

“qwe” is just a script that starts the program, nothing special.

Is there anything that i can do to track this further down?

Best regards,
Torsten.> > Hi,

when i display the values filled in from SDL_ListModes()
there are several “doubles” in there, i guess because
these resolutions are available in several video formats?
Is that assumption correct?

Is there a way for me to get the actual video format that
SDL can use for a certain resolution?

E.g. when “1024x768” is returned three times, what are the
video modes i can use with this resolution?

This is actually a bug, resolutions are supposed to be listed once.
SDL 1.3 will support multiple refresh rates, which is where these
duplicated modes are coming from.

Can you check to make sure this is fixed in the SDL 1.2.10 prelease
snapshot?
http://www.libsdl.org/tmp/SDL-1.2.10.tar.gz

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

But sadly the program that i write at the moment dies with a

“Speicherzugriffsfehler” (what is this in english, bus error?).

segmentation fault. your program trys to access memory it does not own
(anymore).

It does not crash immediately, but when exiting, something

seems to go wrong.

could be a double free in the exit handler.

Is there anything that i can do to track this further down?

first use gdb:
gdb ./yourprog
run

after the crash type:
where

you should see the stackbacktrace and get an idea what had happened.
handling gdb needs practicing though. valgrind is the next you should
explore.

best regards …
clemensOn 5/14/06, Torsten Mohr wrote:

Hi,

thanks for the hint to use valgrind. It is the first time i
used that tool. So i’m not really used to interpreting the
output, but this looks suspicious to me:

==8411== Jump to the invalid address stated on the next line
==8411== at 0x0: ???
==8411== by 0x1BA96F40: (within /usr/lib/libGL.so.1.0.8756)
==8411== Address 0x0 is not stack’d, malloc’d or (recently) free’d
==8411==
==8411== Process terminating with default action of signal 11 (SIGSEGV)
==8411== Access not within mapped region at address 0x0
==8411== at 0x0: ???
==8411== by 0x1BA96F40: (within /usr/lib/libGL.so.1.0.8756)
==8411==

It seems to me that this is the latest available NVidia driver for
my graphics card, which is called:
NVIDIA-Linux-x86-1.0-8756-pkg1.run

Would it be ok to post the log file (10 k) here? Is anybody
interested in that file?

Please let me also mention that i malloc() lots of memory in the
init phase of my game that i don’t free() at all. I depend on
libc to clean up after me.

Best regards,
Torsten.Am Montag, 15. Mai 2006 07:41 schrieb clemens kirchgatterer:

On 5/14/06, Torsten Mohr <@Torsten_Mohr> wrote:

But sadly the program that i write at the moment dies with a

“Speicherzugriffsfehler” (what is this in english, bus error?).

segmentation fault. your program trys to access memory it does not own
(anymore).

It does not crash immediately, but when exiting, something

seems to go wrong.

could be a double free in the exit handler.

Is there anything that i can do to track this further down?

first use gdb:
gdb ./yourprog
run

after the crash type:
where

you should see the stackbacktrace and get an idea what had happened.
handling gdb needs practicing though. valgrind is the next you should
explore.

best regards …
clemens