Skip to content

Fill window with dark grey at creation time, fix #373#374

Merged
illwieckz merged 1 commit intoDaemonEngine:0.52.0/syncfrom
illwieckz:earlyblack
Oct 26, 2020
Merged

Fill window with dark grey at creation time, fix #373#374
illwieckz merged 1 commit intoDaemonEngine:0.52.0/syncfrom
illwieckz:earlyblack

Conversation

@illwieckz
Copy link
Copy Markdown
Member

@illwieckz illwieckz commented Sep 12, 2020

Attempt to fill window with black at creation time, to prevent this (and fix #373):

empty window

It works but I know nothing about OpenGL and SDL, so maybe I'm introducing a time bomb…

@gimhael or @Kangz, is it OK to do that?

@illwieckz illwieckz added T-Improvement Improvement for an existing feature A-Renderer labels Sep 12, 2020
@illwieckz illwieckz changed the title [WIP] renderer: paint window in black at creation time, fix #373 [WIP] renderer: fill window with black at creation time, fix #373 Sep 12, 2020
@illwieckz illwieckz changed the title [WIP] renderer: fill window with black at creation time, fix #373 renderer: fill window with dark grey at creation time, fix #373 Oct 4, 2020
@illwieckz
Copy link
Copy Markdown
Member Author

I've updated the code to not use a pitch black color but a dark grey one (#141414), because dark is really intimidating and can also give the impression of something being uninitialized.

The window looks like this until the main menu is displayed:

empty window

In fact, the best we can do is to just display a nice “powered with Dæmon engine” picture in the middle, with a nice logo. Because this is expected to be displayed as early as possible, it would require to embed the picture in the engine and display it with OpenGL functions by hand. That would be perfect.

Anyway, I consider my PR ready, so please tell if something is wrong with my implementation.

@illwieckz
Copy link
Copy Markdown
Member Author

@cmf028, do you have something to say about this?

@illwieckz illwieckz requested a review from cmf028 October 12, 2020 00:51
@illwieckz illwieckz changed the title renderer: fill window with dark grey at creation time, fix #373 Fill window with dark grey at creation time, fix #373 Oct 23, 2020
@DolceTriade
Copy link
Copy Markdown
Contributor

It's probalby fine to merge

@illwieckz
Copy link
Copy Markdown
Member Author

Yes, for what I now understand, this is not asking to really do something, but to set what must be the default color of something that is left untouched, then asking to not let untouched pixels uncolored, and to finish the frame. This is very unlikely to have any effect on subsequent draw calls, because anyway this code is expected to only do things on pixels that were never drawn.

We can see similar code there (which looks like to share a bit the purpose):

glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
glClearDepth( 1.0 );
glDrawBuffer( GL_BACK );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );

And there:

void GL_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
if ( glState.clearColorRed != red || glState.clearColorGreen != green || glState.clearColorBlue != blue || glState.clearColorAlpha != alpha )
{
glState.clearColorRed = red;
glState.clearColorGreen = green;
glState.clearColorBlue = blue;
glState.clearColorAlpha = alpha;
glClearColor( red, green, blue, alpha );
}
}

@illwieckz illwieckz merged commit 82b06a4 into DaemonEngine:0.52.0/sync Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Renderer T-Improvement Improvement for an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants