I didn't think this is worthy of the Graphics section because its mainly me going off on one but I totally don't agree with this:
Code:
_RGB565(255,511,255) // White
Does anyone know if its normal for 16bit (565 mode) to have the color white as this?
I totally disagree, any thoughts?
(What have I opened this up to posting here, I know I'll get some smart arse answers but I welcome them .)
Last edited by Electroman; Sep 20th, 2004 at 09:09 AM.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
But it took me ages to find that 255,511,255 makes it white, I was trying all sorts .
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
BTW it is one of the normal screen resolutions that DX uses....I also think it has one that uses the last bit as "Alpha" as I said earlier.-..but I have to look up that on my other PC tomorrow...
No no no, 555mode just has one bit left over, I don't think it gets used at all.
As for it taking me ages it did, I was mainly trying thingsing in the 255 area in the exam. And when I shoed you it earlier I only then decided to try higher numbers. Its totally messed up I best not loose marks for it or I'll have to kick some ass at Uni .
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
lol, you have a lot more point you still gotta get yet . I admit my defeate here but I won in the C++ thingy .
I actually hate 16bit color to be honest and I'm really not happy that this year they made us use it . 32bit is a whole lot nicer .
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Originally posted by Electroman lol, you have a lot more point you still gotta get yet . I admit my defeate here but I won in the C++ thingy .
I actually hate 16bit color to be honest and I'm really not happy that this year they made us use it . 32bit is a whole lot nicer .
No you did not win that one either...you said that the "" was the error, and I said NO...and I was right..and found the actual error...2-0 to me....YOU ARE OUT buddy,..
Posted by NoteMe No you did not win that one either...you said that the "" was the error, and I said NO...and I was right..and found the actual error...2-0 to me....YOU ARE OUT buddy,..
Was I right or not? it wasn't the problem but I was right . As for this one I don't believe the Alpha thingy had anything to do with my problem so its either 0-0 or 1-1 (not counting my other thousand or so other wins .)
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Originally posted by NoteMe Did it take you ages...:
2^5 = 256
2^6 = 512
...
No ages there...
BTW it is one of the normal screen resolutions that DX uses....I also think it has one that uses the last bit as "Alpha" as I said earlier.-..but I have to look up that on my other PC tomorrow...
That seems backwards.... the g would be divided by 16, the r and b are divied by 8.... it seems that'd be 545... ***.
Cuz say you give it 8 bits... b to 5... g to 4... r to 5....
But uhm... if you're passing a larger g... say an int(16 bits) then there would be 12 left... Yea.. that make sense! 65536 / 16 / 64 = 64. Tada There you go, 565, byte, int(2 bytes), byte. Would be the passable args.
BTW if I am right about this....then there will be more then 255,511,255 that will make white. But if you are sure that you are never writing bigger numbers then this, then the engine would work faster without the % part in your define line....
So you'd atleast need 1024... / 16 = 64, but mod that by 64, and you get zero. So 255,1023,255 would make white(and be the minimum value). Unless it really is R5G5B5 A1....
I'm so gonna kick this lectures ass, its part of his Dx2 (maybe 3) graphics engine. I have already correct some of his code for him on hiding the mouse, he was just using SetCursor(NULL); in the game loop and he was saying he didn't have a clue how to keep it hidden. I simply told him your meant to put it in when you get the message: WM_SETCURSOR.
Anyway back to this, what would you say the macro should be then? Cos as I've said before I totally hate 16bit graphics and thats mainly because the fuss you have to go through to work out colors (makes pixel perfect collisions a real hassle).
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
I'd thought that just before, this seems to have turned out to be a good thread. When I posted it I was only wanting to rant on about how stupid the macro was to start with.
BTW what values does your function take? it is sensible yes?
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Originally posted by Electroman I'd thought that just before, this seems to have turned out to be a good thread. When I posted it I was only wanting to rant on about how stupid the macro was to start with.
BTW what ales does your function take? it is sensible yes?
What it take?? A COLORREF??....don't get you...and yeah I took it from a book...but I wrote it off, so I hope I didn't screw it up. The other one is a bit more genral...hop I didn't miss anything trying to make it genral for all display formats.
Mind I don't think I've used Colorref's before, your forgetting I'm very new to the whole C++ part of stuff .
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
COLORREF
The COLORREF value is a 32-bit value used to specify an RGB color.
Remarks
When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form:
0x00bbggrr
The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.
Added by me:
The format in pseudo bits are something like
00000000 RRRRRRRR GGGGGGGG BBBBBBBB
The 0's are unused bits.
GetRValue and GetBValue and GetGValue is three macros.
Not sure if this is usefull at all. But it at least converts something....
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Might have to have a look and see if I can work out a macro for it....
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.