mirror of https://github.com/xemu-project/xemu.git
ui: Add build version and debug indicator to window title bar
This commit is contained in:
parent
1b5e97e37f
commit
263870a7c3
2
build.sh
2
build.sh
|
@ -99,7 +99,7 @@ do
|
|||
shift
|
||||
;;
|
||||
'--debug')
|
||||
build_cflags='-O0 -g'
|
||||
build_cflags='-O0 -g -DXEMU_DEBUG_BUILD=1'
|
||||
debug_opts='--enable-debug'
|
||||
shift
|
||||
;;
|
||||
|
|
13
ui/xemu.c
13
ui/xemu.c
|
@ -46,6 +46,7 @@
|
|||
#include "xemu-input.h"
|
||||
#include "xemu-settings.h"
|
||||
#include "xemu-shaders.h"
|
||||
#include "xemu-version.h"
|
||||
|
||||
#include "hw/xbox/smbus.h" // For eject, drive tray
|
||||
#include "hw/xbox/nv2a/nv2a.h"
|
||||
|
@ -804,18 +805,22 @@ static void sdl2_display_very_early_init(DisplayOptions *o)
|
|||
SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
|
||||
char *title = g_strdup_printf("xemu | v%s"
|
||||
#if XEMU_DEBUG_BUILD
|
||||
" Debug"
|
||||
#endif
|
||||
, xemu_version);
|
||||
|
||||
// Create main window
|
||||
m_window = SDL_CreateWindow(
|
||||
"xemu",
|
||||
SDL_WINDOWPOS_CENTERED,
|
||||
SDL_WINDOWPOS_CENTERED,
|
||||
1024, 768,
|
||||
title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1024, 768,
|
||||
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
|
||||
if (m_window == NULL) {
|
||||
fprintf(stderr, "Failed to create main window\n");
|
||||
SDL_Quit();
|
||||
exit(1);
|
||||
}
|
||||
g_free(title);
|
||||
|
||||
m_context = SDL_GL_CreateContext(m_window);
|
||||
assert(m_context != NULL);
|
||||
|
|
Loading…
Reference in New Issue