Started in ui.

This commit is contained in:
Sheldon Lee 2020-07-09 01:26:08 +01:00
parent 41ee67b718
commit 41db31e121
2 changed files with 33 additions and 0 deletions

29
ui.c
View File

@ -1 +1,30 @@
#include <stddef.h>
#include <stdlib.h>
#include "ui.h"
typedef struct {
char* msg;
int* var;
}Linei;
static unsigned int ln_count = 0;
static Linei* lines = NULL;
void initUI()
{
lines = (Linei*)malloc(sizeof(Linei) * ++ln_count);
}
void addLinei(char* msg, int* var)
{
if (!lines) return;
if (ln_count >1) lines = realloc(lines, sizeof(Linei) * ++ln_count);
Linei line = { msg, var };
lines[ln_count-1] = line;
}
void drawUI()
{
}

4
ui.h
View File

@ -1,6 +1,10 @@
#ifndef UI_H
#define UI_H
void initUI();
void addLinei(char* msg, int* var);
void drawUI();
#endif