changelog shortlog graph tags branches changeset file revisions annotate raw help

Mercurial > core / lisp/ffi/nuklear/nk.c

revision 401: b10f5822bc58
parent 400: 122554547517
child 402: d770292afa4c
     1.1--- a/lisp/ffi/nuklear/nk.c	Sun Jun 02 22:34:29 2024 -0400
     1.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3@@ -1,70 +0,0 @@
     1.4-#include <stdio.h>
     1.5-#include <stdlib.h>
     1.6-#include <stdint.h>
     1.7-#include <stdarg.h>
     1.8-#include <string.h>
     1.9-#include <math.h>
    1.10-#include <assert.h>
    1.11-#include <time.h>
    1.12-#include <limits.h>
    1.13-#include <unistd.h>
    1.14-#include <dirent.h>
    1.15-
    1.16-#include <GL/glew.h>
    1.17-#include <GLFW/glfw3.h>
    1.18-
    1.19-#define NK_INCLUDE_FIXED_TYPES
    1.20-#define NK_INCLUDE_STANDARD_IO
    1.21-#define NK_INCLUDE_DEFAULT_ALLOCATOR
    1.22-#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
    1.23-#define NK_INCLUDE_FONT_BAKING
    1.24-#define NK_INCLUDE_DEFAULT_FONT
    1.25-#define NK_IMPLEMENTATION
    1.26-#include "nuklear.h"
    1.27-
    1.28-#define STB_IMAGE_IMPLEMENTATION
    1.29-#include "stb_image.h"
    1.30-
    1.31-/* macros */
    1.32-#define WINDOW_WIDTH 1200
    1.33-#define WINDOW_HEIGHT 800
    1.34-
    1.35-#define MAX_VERTEX_MEMORY 512 * 1024
    1.36-#define MAX_ELEMENT_MEMORY 128 * 1024
    1.37-
    1.38-#define UNUSED(a) (void)a
    1.39-#define MIN(a,b) ((a) < (b) ? (a) : (b))
    1.40-#define MAX(a,b) ((a) < (b) ? (b) : (a))
    1.41-#define LEN(a) (sizeof(a)/sizeof(a)[0])
    1.42-
    1.43-/// enum {EASY, HARD};
    1.44-/// static int op = EASY;
    1.45-/// static float value = 0.6f;
    1.46-/// static int i =  20;
    1.47-/// struct nk_context ctx;
    1.48-///
    1.49-/// nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);
    1.50-/// if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
    1.51-///     NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
    1.52-///     // fixed widget pixel width
    1.53-///     nk_layout_row_static(&ctx, 30, 80, 1);
    1.54-///     if (nk_button_label(&ctx, "button")) {
    1.55-///         // event handling
    1.56-///     }
    1.57-///
    1.58-///     // fixed widget window ratio width
    1.59-///     nk_layout_row_dynamic(&ctx, 30, 2);
    1.60-///     if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
    1.61-///     if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;
    1.62-///
    1.63-///     // custom widget pixel width
    1.64-///     nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
    1.65-///     {
    1.66-///         nk_layout_row_push(&ctx, 50);
    1.67-///         nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
    1.68-///         nk_layout_row_push(&ctx, 110);
    1.69-///         nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
    1.70-///     }
    1.71-///     nk_layout_row_end(&ctx);
    1.72-/// }
    1.73-/// nk_end(&ctx);