Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add conditional style configurator to all demos #748

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions demo/allegro5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@
/*#define INCLUDE_CALCULATOR */
/*#define INCLUDE_CANVAS */
#define INCLUDE_OVERVIEW
/*#define INCLUDE_CONFIGURATOR */
/*#define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
#define INCLUDE_STYLE
#define INCLUDE_CALCULATOR
#define INCLUDE_CANVAS
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -64,6 +66,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand All @@ -81,6 +86,11 @@ int main(void)
NkAllegro5Font *font;
struct nk_context *ctx;

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

if (!al_init()) {
fprintf(stdout, "failed to initialize allegro5!\n");
exit(1);
Expand Down Expand Up @@ -168,6 +178,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
13 changes: 13 additions & 0 deletions demo/d3d11/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
/*#define INCLUDE_CALCULATOR */
/*#define INCLUDE_CANVAS */
#define INCLUDE_OVERVIEW
/*#define INCLUDE_CONFIGURATOR */
/*#define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
#define INCLUDE_STYLE
#define INCLUDE_CALCULATOR
#define INCLUDE_CANVAS
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -60,6 +62,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand Down Expand Up @@ -149,6 +154,11 @@ int main(void)
D3D_FEATURE_LEVEL feature_level;
DXGI_SWAP_CHAIN_DESC swap_chain_desc;

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

/* Win32 */
memset(&wc, 0, sizeof(wc));
wc.style = CS_DBLCLKS;
Expand Down Expand Up @@ -267,6 +277,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
13 changes: 13 additions & 0 deletions demo/d3d12/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@
/*#define INCLUDE_CALCULATOR */
/*#define INCLUDE_CANVAS */
#define INCLUDE_OVERVIEW
/*#define INCLUDE_CONFIGURATOR */
/*#define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
#define INCLUDE_STYLE
#define INCLUDE_CALCULATOR
#define INCLUDE_CANVAS
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -63,6 +65,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand Down Expand Up @@ -207,6 +212,11 @@ int main(void)
DXGI_SWAP_CHAIN_DESC1 swap_chain_desc;
D3D12_DESCRIPTOR_HEAP_DESC rtv_desc_heap_desc;

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

/* Win32 */
memset(&wc, 0, sizeof(wc));
wc.style = CS_DBLCLKS;
Expand Down Expand Up @@ -359,6 +369,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
13 changes: 13 additions & 0 deletions demo/d3d9/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
/*#define INCLUDE_CALCULATOR */
/*#define INCLUDE_CANVAS */
#define INCLUDE_OVERVIEW
/*#define INCLUDE_CONFIGURATOR */
/*#define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
#define INCLUDE_STYLE
#define INCLUDE_CALCULATOR
#define INCLUDE_CANVAS
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -57,6 +59,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand Down Expand Up @@ -179,6 +184,11 @@ int main(void)
HWND wnd;
int running = 1;

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

/* Win32 */
memset(&wc, 0, sizeof(wc));
wc.style = CS_DBLCLKS;
Expand Down Expand Up @@ -272,6 +282,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
13 changes: 13 additions & 0 deletions demo/gdi/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
/*#define INCLUDE_CALCULATOR */
/*#define INCLUDE_CANVAS */
#define INCLUDE_OVERVIEW
/*#define INCLUDE_CONFIGURATOR */
/*#define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
#define INCLUDE_STYLE
#define INCLUDE_CALCULATOR
#define INCLUDE_CANVAS
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -52,6 +54,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand Down Expand Up @@ -92,6 +97,11 @@ int main(void)
int running = 1;
int needs_refresh = 1;

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

/* Win32 */
memset(&wc, 0, sizeof(wc));
wc.style = CS_DBLCLKS;
Expand Down Expand Up @@ -167,6 +177,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
13 changes: 13 additions & 0 deletions demo/gdip/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
/*#define INCLUDE_CALCULATOR */
/*#define INCLUDE_CANVAS */
#define INCLUDE_OVERVIEW
/*#define INCLUDE_CONFIGURATOR */
/*#define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
#define INCLUDE_STYLE
#define INCLUDE_CALCULATOR
#define INCLUDE_CANVAS
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -52,6 +54,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand Down Expand Up @@ -87,6 +92,11 @@ int main(void)
int running = 1;
int needs_refresh = 1;

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

/* Win32 */
memset(&wc, 0, sizeof(wc));
wc.style = CS_DBLCLKS;
Expand Down Expand Up @@ -162,6 +172,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
13 changes: 13 additions & 0 deletions demo/glfw_opengl2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
/* #define INCLUDE_CANVAS */
/* #define INCLUDE_FILE_BROWSER */
/* #define INCLUDE_OVERVIEW */
/* #define INCLUDE_CONFIGURATOR */
/* #define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
Expand All @@ -51,6 +52,7 @@
#define INCLUDE_CANVAS
#define INCLUDE_FILE_BROWSER
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -69,6 +71,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand All @@ -95,6 +100,11 @@ int main(void)
struct media media;
#endif

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

/* GLFW */
glfwSetErrorCallback(error_callback);
if (!glfwInit()) {
Expand Down Expand Up @@ -195,6 +205,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
13 changes: 13 additions & 0 deletions demo/glfw_opengl3/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@
/*#define INCLUDE_CALCULATOR */
/*#define INCLUDE_CANVAS */
#define INCLUDE_OVERVIEW
/*#define INCLUDE_CONFIGURATOR */
/*#define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
#define INCLUDE_STYLE
#define INCLUDE_CALCULATOR
#define INCLUDE_CANVAS
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -65,6 +67,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand All @@ -86,6 +91,11 @@ int main(void)
struct nk_context *ctx;
struct nk_colorf bg;

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

/* GLFW */
glfwSetErrorCallback(error_callback);
if (!glfwInit()) {
Expand Down Expand Up @@ -177,6 +187,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
Loading