versioning script
This commit is contained in:
@@ -632,6 +632,13 @@ void App::initLayout()
|
||||
init_menu_layer();
|
||||
init_menu_timelapse();
|
||||
|
||||
// set version string
|
||||
if (auto* version_label = layout[main_id]->find<NodeText>("version"))
|
||||
{
|
||||
version_label->set_text(g_version);
|
||||
}
|
||||
|
||||
|
||||
if (auto* menu_entry = layout[main_id]->find<NodeButtonCustom>("menu-about"))
|
||||
{
|
||||
menu_entry->on_click = [=](Node*) {
|
||||
|
||||
@@ -357,6 +357,9 @@ int main(int argc, char** argv)
|
||||
LOG("GL vendor: %s", glGetString(GL_VENDOR));
|
||||
LOG("GL renderer: %s", glGetString(GL_RENDERER));
|
||||
|
||||
static wchar_t window_title[512];
|
||||
swprintf_s(window_title, L"PanoPainter %s", g_version_number_w);
|
||||
|
||||
// If supported create a 3.1 context
|
||||
if (wglewIsSupported("WGL_ARB_create_context"))
|
||||
{
|
||||
@@ -388,7 +391,7 @@ int main(int argc, char** argv)
|
||||
wglDeleteContext(hRC);
|
||||
DestroyWindow(hWnd);
|
||||
|
||||
hWnd = CreateWindow(wc.lpszClassName, L"PanoPainter 0.1.2 alpha - OpenGL 3.1", WS_OVERLAPPEDWINDOW,
|
||||
hWnd = CreateWindow(wc.lpszClassName, window_title, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, clientRect.right - clientRect.left,
|
||||
clientRect.bottom - clientRect.top, 0, 0, hInst, 0);
|
||||
|
||||
@@ -451,9 +454,9 @@ int main(int argc, char** argv)
|
||||
|
||||
if (one_sec > 1.f)
|
||||
{
|
||||
static char title[512];
|
||||
sprintf_s(title, "PanoPainter 0.1.2 alpha - OpenGL 3.1 - %d fps", frames);
|
||||
SetWindowTextA(hWnd, title);
|
||||
static wchar_t title_fps[512];
|
||||
swprintf_s(title_fps, L"%s - %d fps", window_title, frames);
|
||||
SetWindowText(hWnd, title_fps);
|
||||
one_sec = 0;
|
||||
frames = 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//#pragma once
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#define USE_VBO 1
|
||||
#define USE_SAMPLER 1
|
||||
|
||||
|
||||
11
engine/version.cpp
Normal file
11
engine/version.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "version.h"
|
||||
#include "version.gen.h"
|
||||
#include "windows.h"
|
||||
|
||||
const char* g_version = PP_VERSION_STRING;
|
||||
const char* g_version_number = PP_VERSION_NUMBER_STRING;
|
||||
const char* g_window_title = "PanoPainter " PP_VERSION_NUMBER_STRING;
|
||||
|
||||
const wchar_t* g_version_w = TEXT(PP_VERSION_STRING);
|
||||
const wchar_t* g_version_number_w = TEXT(PP_VERSION_NUMBER_STRING);
|
||||
const wchar_t* g_window_title_w = L"PanoPainter " TEXT(PP_VERSION_NUMBER_STRING);
|
||||
9
engine/version.h
Normal file
9
engine/version.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
extern const char* g_version;
|
||||
extern const char* g_version_number;
|
||||
extern const char* g_window_title;
|
||||
|
||||
extern const wchar_t* g_version_w;
|
||||
extern const wchar_t* g_version_number_w;
|
||||
extern const wchar_t* g_window_title_w;
|
||||
Reference in New Issue
Block a user