glTexSubImage2D Performance

Discuss programming topics that involve the OpenGL API.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

mh wrote:You're never going to get 24-bit colour no matter what you specify
Even in Linux? I know 24-bit color is the only color depth I can specify (yeah thanks a lot xorg)

As for Windows, the only time i've ever seen 24-bit color selectable in my life is on a crappy ISA video card that died in a week's use.
i should not be here
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

24bit colour doesn't rule out 32bit frame buffers.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

24-bit is just shorthand for "really 32 but 8 of those are unused". If you don't have 24-bit available in hardware (and trust me, you don't) no OS is going to make it magically appear. ;)

You can check this on Windows by sticking these lines in your bSetupPixelFormat function just before returning TRUE:

Code: Select all

	memset (&pfd, 0, sizeof (PIXELFORMATDESCRIPTOR));
	DescribePixelFormat (hDC, pixelformat, sizeof (PIXELFORMATDESCRIPTOR), &pfd);
(Or doing the equivalent on Linux, I'm sure there's a glx function to tell you what format you actually got.)
Set a breakpoint on the return, run, and examine the contents of "pfd" - it will tell whether or not you really got that 32-bit depth and 24-bit colour you asked for. Quite an eye-opener.

It will also give you shift-bits for each of R, G, B and A which will tell you whether your PFD_TYPE_RGBA is actually laid out in BGRA, ABGR, ARGB or whatever order.

Read the documentation on ChoosePixelFormat again - there is no contract to give you exactly what you ask for. The sample code given should look familiar and raise a chuckle as well.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
Post Reply