glTexSubImage2D Performance
Moderator: InsideQC Admins
18 posts
• Page 2 of 2 • 1, 2
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
- leileilol
- Posts: 2783
- Joined: Fri Oct 15, 2004 3:23 am
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:
(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.
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
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
18 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest