OpenGL problems

Use debugger. Use -lefence. Use valgrind.On Mon, Aug 12, 2002 at 07:14:52PM +0200, Florian Schulze wrote:

I get more and more complaints about not possible compiles and crashes. I
don’t understand the crashes though. I think I’m doing everything right, but
it doesn’t work.


http://decopter.sf.net - free unrealistic helicopter simulator

It’s crashing only in Linux, only with NVidia, only when using an extension
and those people have problems with other self compiled OpenGL apps.
SDL_GL_GetProcAddress returns a not null value and the extension is listed
in the GL_EXTENSIONS string. It works with nvidia on windows.
I don’t have linux, I can’t debug it. Those people aren’t programmers, so
can’t debug it.
If anyone would like to help me, then please contact me.

Florian> ----- Original Message -----

From: jpopl@interia.pl (Jacek Poplawski)
To:
Sent: Monday, August 12, 2002 8:26 PM
Subject: Re: [SDL] OpenGL problems

On Mon, Aug 12, 2002 at 07:14:52PM +0200, Florian Schulze wrote:

I get more and more complaints about not possible compiles and crashes.
I

don’t understand the crashes though. I think I’m doing everything right,
but

it doesn’t work.

Use debugger. Use -lefence. Use valgrind.


http://decopter.sf.net - free unrealistic helicopter simulator


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

Hmm… I found an interesting color bug in Linux
running an SDL app in X in 16bpp mode. I am also
running “everybuddy” (an multi-IM client) that I have
set to pop up a window whenever I get mail on my Yahoo
account. My app is running fullscreen in 16 bpp
natively. Color-wise it runs fine until “everybuddy"
decides to pop up a window notifying me of email. The
SDL application then sets itself temporarily into
windowed mode. (This is fine, but it might be nice to
have an option to iconify it instead… but this isn’t
the problem)… When the SDL app is in windowed mode
the colors are still correct. When I close the
"everybuddy” window the SDL app returns itself to full
screen again, but the app displays itself as if it has
a corrupt pallette, (as it is a 16bpp app it shouldn’t
have a pallette at all… should it?) or a 5-6-5 vs.
5-5-5 issue… This particular app has both the
ability to adjust a “brightness” setting as well as
display either in 565 or 555 to the current video
surface independant of its actual surface format.

Adjusting the 555/565 setting makes the screen appear
worse. Adjusting the brightness, however you can
USUALLY find a “sweet-spot” where MOST of the
pixels on the screen are close to the right color.

Any time “everybuddy” pops up a new window, the (now
windowed) SDL application’s colors return to normal.
When the SDL application returns to fullscreen, not
only are the colors corrupt again, but the
"sweet-spot" has moved (indicating that the color
palette is different than it was the time before)…

Has anyone else experienced anything like this before?

FYI, Fullscreen the program is running in 640x480…
from previous experimentation I suspect that using
"xvidtune -unlock", changing resolutions, and changing
back will resolve this, but I have not confirmed this
in this instance.

Thanks in advance,

-Loren__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

Hello Sam,

Saturday, August 10, 2002, 18:20:23, you wrote:

SL> This is often caused by memory problems in your program.
SL> Try using a debug memory allocation tool.

Well, I`ve found something strange…

 If I have an array of SDL_Surface* and want to replace one element
 like:

 CArray <SDL_Surface*, SDL_Surface*> ar;
 ...
 SDL_Surface * p = ar.GetAt(i);
 ar.SetAt(i,newp);
SDL_FreeSurface(p);
 ...
 SDL_Quit();

 If I free the surface "p" by
 "SDL_FreeSurface(p)", SDL_Quit will never finish, if I dont free
 the surface, it`s ok.

 What can it be?-- 

Best regards,
Alexander mailto:Editor at echo.ru

Has anyone been able to reproduce this yet???

Thanks in advance,

-Loren

— Loren Osborn <@Loren_Osborn> wrote:> Hmm… I found an interesting color bug in Linux

running an SDL app in X in 16bpp mode. I am also
running “everybuddy” (an multi-IM client) that I
have
set to pop up a window whenever I get mail on my
Yahoo
account. My app is running fullscreen in 16 bpp
natively. Color-wise it runs fine until
"everybuddy"
decides to pop up a window notifying me of email.
The
SDL application then sets itself temporarily into
windowed mode. (This is fine, but it might be nice
to
have an option to iconify it instead… but this
isn’t
the problem)… When the SDL app is in windowed mode
the colors are still correct. When I close the
"everybuddy" window the SDL app returns itself to
full
screen again, but the app displays itself as if it
has
a corrupt pallette, (as it is a 16bpp app it
shouldn’t
have a pallette at all… should it?) or a 5-6-5 vs.
5-5-5 issue… This particular app has both the
ability to adjust a “brightness” setting as well as
display either in 565 or 555 to the current video
surface independant of its actual surface format.

Adjusting the 555/565 setting makes the screen
appear
worse. Adjusting the brightness, however you can
USUALLY find a “sweet-spot” where MOST of the
pixels on the screen are close to the right color.

Any time “everybuddy” pops up a new window, the (now
windowed) SDL application’s colors return to normal.

When the SDL application returns to fullscreen, not
only are the colors corrupt again, but the
"sweet-spot" has moved (indicating that the color
palette is different than it was the time before)…

Has anyone else experienced anything like this
before?

FYI, Fullscreen the program is running in 640x480…
from previous experimentation I suspect that using
"xvidtune -unlock", changing resolutions, and
changing
back will resolve this, but I have not confirmed
this
in this instance.

Thanks in advance,

-Loren


Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com


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


Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

It’s crashing only in Linux, only with NVidia,
(…)
If anyone would like to help me, then please contact me.

Then go to nVidia support. You aren’t using open source drivers.On Mon, Aug 12, 2002 at 09:06:04PM +0200, Florian Schulze wrote:


http://decopter.sf.net - free unrealistic helicopter simulator

Erm, someone can’t read. Ahem, he is NOT USING LINUX. He is using
Windows, but was nice enough to try and make his program run in Linux. It
crashes, he doesn’t know why. He wants someone who actually uses Linux
and knows how to debug software to help him figure out why.

I hate it when people see the words NVIDIA and Linux in the same paragraph
and assume this gives them the right to be assholes about requests for
help. I’d offer to help debug it, but am extraordinarily busy this week.On Wed, Aug 14, 2002 at 11:32:52PM +0200, Jacek Pop?awski wrote:

It’s crashing only in Linux, only with NVidia,
(…)
If anyone would like to help me, then please contact me.

Then go to nVidia support. You aren’t using open source drivers.


Joseph Carter What’re you looking at?

“Pacific Bell Customer Service, this is […], how can I provide you with
excellent customer service today?”
“HAHAHAHAHA!! That’s good, I like it…”
“Um, thanks, they make us say that.”
– knghtbrd and a pacbell rep, name removed to protect her job

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020814/86c71cf2/attachment.pgp

If it crashes only with nVidia+Linux - it’s related to nVidia drivers.On Wed, Aug 14, 2002 at 02:59:00PM -0700, Joseph Carter wrote:

I hate it when people see the words NVIDIA and Linux in the same paragraph
and assume this gives them the right to be assholes about requests for
help.


http://decopter.sf.net - free unrealistic helicopter simulator

Or it’s a bug in his code, more likely than not.On Thu, Aug 15, 2002 at 12:22:37AM +0200, Jacek Pop?awski wrote:

I hate it when people see the words NVIDIA and Linux in the same paragraph
and assume this gives them the right to be assholes about requests for
help.

If it crashes only with nVidia+Linux - it’s related to nVidia drivers.


Joseph Carter Not many fishes

partycle: I seriously do need a vacation from this package.
I actually had a DREAM about introducing a stupid new bug
into xbase-preinst last night. That’s a Bad Sign.

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020814/275e9d01/attachment.pgp

Someone on this list gave me a tip a few days ago and yesterday I got
someone else to test that out. It fixes the crashing problems and it almost
works perfectly now, but I seem to have discovered a bug in NVidias
implementation of GL_EXT_paletted_textures on Linux. I will try to write a
small test case so it’s possible to send a descent bug report to them.

This doesn’t have to do anything with SDL anymore, so I will stop this
thread now.

Thank you all,
Florian

This doesn’t have to do anything with SDL anymore, so I will stop this
thread now.

Hehe, never mind that… We’re a mailing list. We have to flame :wink:

Cheers, Kai

PS: If you want desperately want to flame me, please send a mail to /dev/null
:)On Thursday 15 August 2002 09:55, Florian Schulze wrote:


Kai Blin Linux system administrator Tel: Ring-86592
Allgemeine Chirurgie Universitaetsklinikum Tuebingen

Programmers used to batch environments may find it hard to live without
giant listings; we would find it hard to use them.
– D.M. Ritchie

It sounds like the gamma ramp is being lost when the window loses focus,
and is not being reset properly. I don’t have a way to set this up, so
could you watch the X11 messages and see what’s going on?

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

Sam,

I have to agree with your assesment: It does look like the gamma ramp. I
have to admit however, I never crept much into the deep dark places in
X. Could you refresh my memory on how to get a log of the X messages
sent?

Thanks,

-LorenOn Mon, 2002-08-19 at 23:13, Sam Lantinga wrote:

It sounds like the gamma ramp is being lost when the window loses focus,
and is not being reset properly. I don’t have a way to set this up, so
could you watch the X11 messages and see what’s going on?

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


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

Sam,

I have to agree with your assesment: It does look like the gamma ramp. I
have to admit however, I never crept much into the deep dark places in
X. Could you refresh my memory on how to get a log of the X messages
sent?

Look at SDL_x11events.c

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

Hmmm… I made the following changes, and came up with the following
events, but none of them seem relavant. I thought you might want to
look at them anyway… I also observed that, since I switched from gcc
2.96 to 3.1.1, sometimes the bug appears on startup (possibly %10 of the
time), and less often after returning to a windowed state (perhaps %30
instead of %80)…

I’m open to any ideas,

-Loren

===============BEGIN EVENTS===============
PropertyNotify! Property “WM_HINTS” changed Unhandled event 28
PropertyNotify! Property “WM_NAME” changed Unhandled event 28
PropertyNotify! Property “WM_ICON_NAME” changed Unhandled event 28
PropertyNotify! Property “WM_NORMAL_HINTS” changed Unhandled event 28
PropertyNotify! Property “WM_HINTS” changed Unhandled event 28
PropertyNotify! Property “WM_NAME” changed Unhandled event 28
PropertyNotify! Property “WM_ICON_NAME” changed Unhandled event 28
PropertyNotify! Property “WM_NORMAL_HINTS” changed Unhandled event 28
================END EVENTS================

===============BEGIN PATCH===============
Index: src/video/x11/SDL_x11events.c===================================================================
RCS file:
/home/sdlweb/libsdl.org/cvs/SDL12/src/video/x11/SDL_x11events.c,v
retrieving revision 1.14
diff -u -r1.14 SDL_x11events.c
— src/video/x11/SDL_x11events.c 2002/06/13 16:54:38 1.14
+++ src/video/x11/SDL_x11events.c 2002/08/25 09:57:43
@@ -412,6 +412,14 @@
}
break;

  •   /* property changed? */
    
  •   case PropertyNotify: {
    

+#ifdef DEBUG_XEVENTS
+printf("PropertyNotify! Property “%s” %s ", XGetAtomName(SDL_Display,
xevent.xproperty.atom), (xevent.xproperty.state !=
PropertyNewValue)?“deleted”:“changed”);
+#endif

  •   }
    
  •   // break;
    
  •   default: {
    

#ifdef DEBUG_XEVENTS
printf(“Unhandled event %d\n”, xevent.type);
================END PATCH================

On Fri, 2002-08-23 at 21:07, Sam Lantinga wrote:

Sam,

I have to agree with your assesment: It does look like the gamma ramp. I
have to admit however, I never crept much into the deep dark places in
X. Could you refresh my memory on how to get a log of the X messages
sent?

Look at SDL_x11events.c

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

I looked at this a little more closely, and the X server is supposed to
automatically set the gamma ramp for the window when the window gains
focus. Is it possible that the window occasionally isn’t getting focus
in your window manager?

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

Hmm window manager?..

Well I’ve been running “sawfish” which exibits the bug, but “twm” and
"enlightenment" both work ok…

Now, the question is what to do about it.

Thanks,

-LorenOn Sun, 2002-08-25 at 09:10, Sam Lantinga wrote:

I looked at this a little more closely, and the X server is supposed to
automatically set the gamma ramp for the window when the window gains
focus. Is it possible that the window occasionally isn’t getting focus
in your window manager?

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


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

In the api reference where it says that SDL_Quit frees allocated
resources, does that include things like surfaces or loaded wave files?

Hello !

In the api reference where it says that SDL_Quit frees allocated
resources, does that include things like surfaces or loaded wave files?

No. SDL_Quit frees the screen surface, …
Everything that SDL itself needs and uses.

Your are responsible to free loaded wave files, images …

CU