This commit is contained in:
John Alanbrook 2022-06-26 04:19:29 +00:00
parent 496b9ca5d7
commit 8009c48547
4 changed files with 15 additions and 21 deletions

View file

@ -9,8 +9,10 @@ endif
UNAME_P != uname -m UNAME_P != uname -m
CCACHE = ccache
#CC specifies which compiler we're using #CC specifies which compiler we're using
CC = clang CC = $(CCACHE) clang
MUSL = /usr/local/musl/include MUSL = /usr/local/musl/include
@ -94,7 +96,7 @@ ifeq ($(UNAME), Windows_NT)
EXT = .exe EXT = .exe
else else
LINKER_FLAGS = -fuse-ld=lld #/usr/local/lib/tcc/bcheck.o /usr/local/lib/tcc/bt-exe.o /usr/local/lib/tcc/bt-log.o LINKER_FLAGS = -fuse-ld=lld #/usr/local/lib/tcc/bcheck.o /usr/local/lib/tcc/bt-exe.o /usr/local/lib/tcc/bt-log.o
ELIBS = m c engine editor glfw3 tcc1 ELIBS = m c engine editor glfw3
CLIBS = CLIBS =
EXT = EXT =
endif endif

View file

@ -42,7 +42,7 @@ struct sFont *MakeFont(const char *fontfile, int height)
int tw,th; int tw,th;
unsigned char *testbitmap = stbtt_GetCodepointBitmap(&fontinfo, 0, stbtt_ScaleForPixelHeight(&fontinfo, 40), 'a', &tw, &th, 0,0); unsigned char *testbitmap = stbtt_GetCodepointBitmap(&fontinfo, 0, stbtt_ScaleForPixelHeight(&fontinfo, 100), 'G', &tw, &th, 0,0);
for (int i = 0; i < th; ++i) { for (int i = 0; i < th; ++i) {
for (int j = 0; j<tw; ++j) for (int j = 0; j<tw; ++j)

View file

@ -9,10 +9,6 @@
#define LOG_CRITICAL 3 #define LOG_CRITICAL 3
#define YughLog(cat, pri, msg, ...) mYughLog(cat, pri, __LINE__, __FILE__, msg, __VA_ARGS__) #define YughLog(cat, pri, msg, ...) mYughLog(cat, pri, __LINE__, __FILE__, msg, __VA_ARGS__)
#define YughInfo(msg, ...) mYughLog(0, LOG_INFO, __LINE__, __FILE__, msg, __VA_ARGS__)
#define YughWarn(msg, ...) mYughLog(0, LOG_WARN, __LINE__, __FILE__, msg, __VA_ARGS__)
#define YughError(msg, ...) mYughLog(0, LOG_ERROR, __LINE__, __FILE__, msg, __VA_ARGS__)
#define YughCritical(msg, ...) mYughLog(0, LOG_CRITICAL, __LINE__, __FILE__, msg, __VA_ARGS__)
void mYughLog(int category, int priority, int line, const char *file, const char *message, ...); void mYughLog(int category, int priority, int line, const char *file, const char *message, ...);

View file

@ -10,23 +10,15 @@
struct mSDLWindow *mainwin; struct mSDLWindow *mainwin;
static struct mSDLWindow windows[5]; static struct mSDLWindow *windows[5];
static int numWindows = 0; static int numWindows = 0;
struct mSDLWindow *MakeSDLWindow(const char *name, int width, int height, struct mSDLWindow *MakeSDLWindow(const char *name, int width, int height,
uint32_t flags) uint32_t flags)
{ {
if (numWindows >= 5) { struct mSDLWindow *w = calloc(1, sizeof(struct mSDLWindow));
YughError("Already max number of windows.", 5);
}
struct mSDLWindow *w = &windows[numWindows++];
w->width = width; w->width = width;
w->height = height; w->height = height;
if (numWindows > 0)
w->window = glfwCreateWindow(width, height, name, NULL, windows[0].window);
else
w->window = glfwCreateWindow(width, height, name, NULL, NULL); w->window = glfwCreateWindow(width, height, name, NULL, NULL);
if (!w->window) { if (!w->window) {
@ -37,11 +29,15 @@ struct mSDLWindow *MakeSDLWindow(const char *name, int width, int height,
glfwSwapInterval(1); glfwSwapInterval(1);
w->id = numWindows-1; w->id = numWindows;
if (numWindows < 5)
windows[numWindows++] = w;
} }
mainwin = &windows[0]; mainwin = windows[0];
return w; return w;
} }
@ -136,7 +132,7 @@ void window_handle_event(struct mSDLWindow *w)
void window_all_handle_events() void window_all_handle_events()
{ {
for (int i = 0; i < numWindows; i++) { for (int i = 0; i < numWindows; i++) {
window_handle_event(&windows[i]); window_handle_event(windows[i]);
} }
} }