make engine branding optional

main
Dominik Madarász 2024-08-19 01:13:13 +02:00
parent 1112e99c58
commit 17108374ea
5 changed files with 88 additions and 0 deletions

View File

@ -391568,6 +391568,11 @@ bool window_create_from_handle(void *handle, float scale, unsigned flags) {
int gl_version = gladLoadGL(glfwGetProcAddress); int gl_version = gladLoadGL(glfwGetProcAddress);
#endif #endif
// set black screen
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glfwSwapBuffers(window);
glDebugEnable(); glDebugEnable();
// setup nuklear ui // setup nuklear ui
@ -394620,6 +394625,44 @@ static void v4k_post_init(float refresh_rate) {
// display window // display window
glfwShowWindow(window); glfwShowWindow(window);
// set black screen
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glfwSwapBuffers(window);
#if !DISABLE_ENGINE_BRANDING
texture_t logo_bg = texture("v4_logo_background.png", 0);
if (logo_bg.id != texture_checker().id) {
texture_t logo_mask = texture("v4_logo_mask.png", 0);
font_face(FONT_FACE3, "fonts/Montserrat-Regular.ttf", 48.0f, FONT_EU | FONT_4096 | FONT_OVERSAMPLE_X | FONT_OVERSAMPLE_Y);
sprite(logo_bg, vec3(w/2.f, h/2.f, 0).array, 0.0f, 0xFFFFFFFF, SPRITE_CENTERED|SPRITE_RESOLUTION_INDEPENDANT);
sprite(logo_mask, vec3(w/2.f, h/2.f, 1).array, 0.0f, 0xFFFFFFFF, SPRITE_CENTERED|SPRITE_RESOLUTION_INDEPENDANT);
sprite_flush();
font_print(
FONT_BOTTOM FONT_CENTER FONT_FACE3 FONT_H3
"Powered by V4K engine\n\n\n\n\n\n\n\n\n\n"
);
int year = 2024;
{
time_t now;
time(&now);
struct tm *local_time = localtime(&now);
year = local_time->tm_year + 1900;
}
char *legalese = va(FONT_CENTER FONT_FACE3 FONT_H4
"© %d v4.games. All rights reserved.\nAll other trademarks and copyrights\n" \
"are properties of their owners.\n\n\n\n", year);
vec2 dims = font_rect(legalese);
font_goto(0, window_height()-dims.y);
font_print(legalese);
glfwSwapBuffers(window);
}
#endif
glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h); glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h);
randset(time_ns() * !tests_captureframes()); randset(time_ns() * !tests_captureframes());

View File

@ -38,6 +38,44 @@ static void v4k_post_init(float refresh_rate) {
// display window // display window
glfwShowWindow(window); glfwShowWindow(window);
// set black screen
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glfwSwapBuffers(window);
#if !DISABLE_ENGINE_BRANDING
texture_t logo_bg = texture("v4_logo_background.png", 0);
if (logo_bg.id != texture_checker().id) {
texture_t logo_mask = texture("v4_logo_mask.png", 0);
font_face(FONT_FACE3, "fonts/Montserrat-Regular.ttf", 48.0f, FONT_EU | FONT_4096 | FONT_OVERSAMPLE_X | FONT_OVERSAMPLE_Y);
sprite(logo_bg, vec3(w/2.f, h/2.f, 0).array, 0.0f, 0xFFFFFFFF, SPRITE_CENTERED|SPRITE_RESOLUTION_INDEPENDANT);
sprite(logo_mask, vec3(w/2.f, h/2.f, 1).array, 0.0f, 0xFFFFFFFF, SPRITE_CENTERED|SPRITE_RESOLUTION_INDEPENDANT);
sprite_flush();
font_print(
FONT_BOTTOM FONT_CENTER FONT_FACE3 FONT_H3
"Powered by V4K engine\n\n\n\n\n\n\n\n\n\n"
);
int year = 2024;
{
time_t now;
time(&now);
struct tm *local_time = localtime(&now);
year = local_time->tm_year + 1900;
}
char *legalese = va(FONT_CENTER FONT_FACE3 FONT_H4
"© %d v4.games. All rights reserved.\nAll other trademarks and copyrights\n" \
"are properties of their owners.\n\n\n\n", year);
vec2 dims = font_rect(legalese);
font_goto(0, window_height()-dims.y);
font_print(legalese);
glfwSwapBuffers(window);
}
#endif
glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h); glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h);
randset(time_ns() * !tests_captureframes()); randset(time_ns() * !tests_captureframes());

View File

@ -383,6 +383,11 @@ bool window_create_from_handle(void *handle, float scale, unsigned flags) {
int gl_version = gladLoadGL(glfwGetProcAddress); int gl_version = gladLoadGL(glfwGetProcAddress);
#endif #endif
// set black screen
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glfwSwapBuffers(window);
glDebugEnable(); glDebugEnable();
// setup nuklear ui // setup nuklear ui

View File

@ -29811,6 +29811,7 @@ static void v4k_post_init(float refresh_rate) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glfwSwapBuffers(window); glfwSwapBuffers(window);
#if !DISABLE_ENGINE_BRANDING
texture_t logo_bg = texture("v4_logo_background.png", 0); texture_t logo_bg = texture("v4_logo_background.png", 0);
if (logo_bg.id != texture_checker().id) { if (logo_bg.id != texture_checker().id) {
texture_t logo_mask = texture("v4_logo_mask.png", 0); texture_t logo_mask = texture("v4_logo_mask.png", 0);
@ -29840,6 +29841,7 @@ static void v4k_post_init(float refresh_rate) {
glfwSwapBuffers(window); glfwSwapBuffers(window);
} }
#endif
glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h); glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h);

Binary file not shown.