libglui / glui

GLUI is a GLUT-based C++ user interface library which provides controls such as buttons, checkboxes, radio buttons, and spinners to OpenGL applications. It is window-system independent, using GLUT or FreeGLUT.
Other
194 stars 82 forks source link

Background is 200, radio buttons is 192. Windows 95 is 193. #97

Closed m-7761 closed 5 years ago

m-7761 commented 5 years ago

FYI: I noticed the gray background color doesn't match the radio buttons. These are pretty well fixed values without changing how the images are displayed. The title says it all. But I've changed my code to use 193 by doing find-replace in the image's CPP file, and setting the background to 193 in the constructor.

Maybe the lighter background was chosen to look better on Apple or Linux systems. In which case the radios should be changed to 200. But it looks so much like Windows 95 that I reckon it is the better reference.

I've changed the code so the data in the CPP file is sent to the graphics driver. That means it could conceivably do find-replace in memory to choose a darker/lighter background color within some tolerance.

m-7761 commented 5 years ago

I haven't gotten this far just yet, but I was interested in if glDrawPixels used for the bitmaps worked like glBitmap that the fonts use.

The documentation doesn't appear to say, but this (https://community.khronos.org/t/gldrawpixels-affected-from-texturing/55917/2) discussions suggests that glColor should augment the color.

It probably makes more sense to pack them into a resident texture. But I think the background color limitation can easily be solved if it's possible to mix these APIs.

I mean, the images are grayscale. So it seems enough color to me to be able to filter them through a lens.

I think Windows 7 made its grays slightly yellow. Or one did. The color has changed somewhat until Windows 10 abandoned it as a user theme option. Applications can still disable theming. Most of my Win32 projects do so by default. I would like to be able to port them eventually. It's why I'm interested in GLUI's appearance.

Darkening can be done with a lens, but lightening cannot. Doing some brightness by modifying the memory is a good approach too. But the background color setting I think should just be a glColor thing.

nigels-com commented 5 years ago

glDrawPixels is known to be a slow path. Best to avoid that, if all possible.

m-7761 commented 5 years ago

Well it's what's used, and it's no bid deal to stream these tiny bitmaps. Anyone is welcome to consolidate them into a texture. GLUT is streaming the font. It's really peanuts and fine. It's really not worth the complication of rewriting the code as long as it works. If glColor only works with a texture, it's probably worth rewriting.

nigels-com commented 5 years ago

Are you certain about 193?

HTML Silver is #C0C0C0 (192) X11 Silver is #C0C0C0 (192) https://en.wikipedia.org/wiki/Web_colors

The Wikipedia screen shot also seems to be 192: https://en.wikipedia.org/wiki/Windows_95

Windows_95_at_first_run

Is 192 something we can agree on?

nigels-com commented 5 years ago

Sure enough, the 192 of the radio and the 200 of the background are clearly mis-matched.

Screenshot from 2019-06-10 21-34-17

nigels-com commented 5 years ago

Yeah, that's better.

Screenshot from 2019-06-11 20-13-44

nigels-com commented 5 years ago

Fixed, closing.