Added GUI Frame

This commit is contained in:
2021-08-11 09:48:56 -07:00
parent 247df18225
commit 7229981177
13 changed files with 247 additions and 16 deletions

View File

@ -60,6 +60,7 @@
#include "poker/winner.h"
// User Interface Objects
#include "ui/frame.h"
#include "ui/label.h"
// Utility Objects

View File

@ -14,4 +14,5 @@ typedef struct {
font_t font;
shader_t shader;
language_t language;
texture_t testTexture;
} pokergameassets_t;

20
include/dawn/ui/frame.h Normal file
View File

@ -0,0 +1,20 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../libs.h"
#include "../display/primitive.h"
#include "../display/gui/font.h"
#define FRAME_BORDER_SIZE 16
#define FRAME_PRIMITIVE_COUNT 9
typedef struct {
float x, y, z;
texture_t *texture;
primitive_t primitive;
} frame_t;

View File

@ -9,8 +9,10 @@
#include "../libs.h"
#define STRING_HANDLEBAR_KEY_MAXLENGTH 32
#define STRING_HANDLEBAR_LIST_VARIABLE_SIZE 512
#define STRING_HANDLEBAR_LIST_VARIABLE_COUNT 64
#define STRING_STACK_STRING_SIZE 256
#define STRING_STACK_STRING_COUNT 128
#define STRING_STACK_BUFFER STRING_STACK_STRING_SIZE * STRING_STACK_STRING_COUNT
/** Representation of a String Handlebar Variable */
typedef struct {
@ -20,9 +22,12 @@ typedef struct {
char *value;
} stringhandlebarvariable_t;
/** Definition of a string stack to push and pop strings from. */
typedef struct {
char buffer[
STRING_HANDLEBAR_LIST_VARIABLE_SIZE * STRING_HANDLEBAR_LIST_VARIABLE_COUNT
];
stringhandlebarvariable_t variables[STRING_HANDLEBAR_LIST_VARIABLE_COUNT];
} stringhandlebarvariablelist_t;
/** Raw char buffer, for holding strings */
char buffer[STRING_STACK_BUFFER];
/** Strings themselves */
char *strings[STRING_STACK_STRING_COUNT];
/** How many strings are on the stack */
int32_t size;
} stringstack_t;