al_map_rgb()
sai pavan boddu

Hello all,

I am going through the basic tutorials of allegro 5, so to change the display color there is function al_clear_to_display(), which takes the argument al_map_rgb(0,0,0).

In the Tutorial it is well explained that 0,0,0 are the values of RED, GREEN & BLUE . So in that case if we change r,g,b values we should have a change of colour in the display.

But that is not happening when I try with different values. The display remains Black irrespective of the values(r,g,b).

Any reason for this problem?

You can find the code at "http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Displays"

Thank you.

Thomas Fjellstrom

Have you flipped the display after clearing the screen?

Edgar Reynaldo
Thomas Fjellstrom

Edgar: given he's changed it, there no guarantee that's still there.

pkrcel

With which values are you trying? those are int values ranging from 0 to 255.

just sayin'

sai pavan boddu

Edgar & Thomas : Yes I had flipped the dispaly

pkrcel : I gave inputs like (2,5,5)&(28,32,56)

?????? Does that problem any thing to do with, static and dynamic linking?

LennyLen
Quote:

pkrcel : I gave inputs like (2,5,5)&(28,32,56)

The first set of values will give a colour that is most likely indistinguishable from black. The second set should definitely be noticeably different though.

Does that problem any thing to do with, static and dynamic linking?

No.

Post the full final code that exhibits the problem.

sai pavan boddu

Oh! Brilliant , that worked for even higher values than what I mentioned .

Kris Asick

White = 255,255,255

Any values below 48 are going to be difficult to notice, especially if there's no comparison.

There's also floating-point versions of the map_rgb commands that take values from 0.0 to 1.0 instead of 0 to 255.

pkrcel

to me also the 2nd set of values gives a color VEEEERY close to black.

please try with something like magenta (255, 0, 255) and tell us what you get, please.

EDIT: missed that it was already sorted.....well CVD.

LennyLen
pkrcel said:

to me also the 2nd set of values gives a color VEEEERY close to black.

It could be your monitor settings. When I ran it, there was a console window behind that was black so the difference was pretty clear.

Arthur Kalliokoski

{"name":"brightness_contrast_setting.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/c\/ac68cc994b8fdb9bfabe20ad908132fc.png","w":720,"h":540,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/c\/ac68cc994b8fdb9bfabe20ad908132fc"}brightness_contrast_setting.png

Thread #611696. Printed from Allegro.cc