Compare commits
No commits in common. "72a3d601460c9341864a892aad9ebab4ab85914b" and "8720b2db3b5be2d4a71b916fd349e74f69ab9c61" have entirely different histories.
72a3d60146
...
8720b2db3b
5 changed files with 7 additions and 13832 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,3 @@
|
||||||
.DS_Store
|
|
||||||
.cache/
|
.cache/
|
||||||
.session.vim
|
.session.vim
|
||||||
log.txt
|
log.txt
|
||||||
|
|
15
Makefile
15
Makefile
|
@ -6,17 +6,16 @@ CFLAGS=-I. -Iinclude -Wall -Wextra -Werror -Wno-header-guard -Wno-comment -g
|
||||||
LDFLAGS=-g
|
LDFLAGS=-g
|
||||||
SHADER_FLAGS=--slang glsl430:hlsl5:metal_macos
|
SHADER_FLAGS=--slang glsl430:hlsl5:metal_macos
|
||||||
|
|
||||||
C_FILES=$(shell find -L src -type f -name '*.c')
|
C_FILES=$(shell find -L * -type f -name '*.c')
|
||||||
C_OBJ=$(C_FILES:.c=.o)
|
C_OBJ=$(C_FILES:.c=.o)
|
||||||
|
|
||||||
SHADER_FILES=$(shell find -L * -type f -name '*.glsl')
|
SHADER_FILES=$(shell find -L * -type f -name '*.glsl')
|
||||||
SHADER_OBJ=$(SHADER_FILES:.glsl=.glsl.h)
|
SHADER_OBJ=$(SHADER_FILES:.glsl=.glsl.h)
|
||||||
|
|
||||||
RESOURCES_DIR=res
|
RESOURCES_DIR=res
|
||||||
RESOURCES_C=$(RESOURCES_DIR)/res.c
|
|
||||||
RESOURCES_OBJ=$(RESOURCES_DIR)/res.o
|
RESOURCES_OBJ=$(RESOURCES_DIR)/res.o
|
||||||
RESOURCES_H=include/gear/resources.h
|
RESOURCES_H=include/gear/resources.h
|
||||||
RESOURCE_FILES=$(shell find -L res -type f -not -name '*.o' -not -name '*.c')
|
RESOURCE_FILES=$(shell find -L $(RESOURCES_DIR) -type f -not -wholename $(RESOURCES_OBJ))
|
||||||
|
|
||||||
ifeq ($(CC), gcc)
|
ifeq ($(CC), gcc)
|
||||||
CFLAGS += -Wno-use-after-free
|
CFLAGS += -Wno-use-after-free
|
||||||
|
@ -42,21 +41,17 @@ endif
|
||||||
|
|
||||||
.PHONY: shaders resources
|
.PHONY: shaders resources
|
||||||
|
|
||||||
$(BINARY): shaders resources $(C_OBJ) $(OBJC_OBJ)
|
$(BINARY): shaders resources $(RESOURCES_OBJ) $(C_OBJ) $(OBJC_OBJ)
|
||||||
$(CC) $(C_OBJ) $(OBJC_OBJ) $(RESOURCES_OBJ) $(LDFLAGS) -o $(BINARY)
|
$(CC) $(C_OBJ) $(OBJC_OBJ) $(RESOURCES_OBJ) $(LDFLAGS) -o $(BINARY)
|
||||||
|
|
||||||
shaders: $(SHADER_OBJ)
|
shaders: $(SHADER_OBJ)
|
||||||
@echo Shaders compiled
|
@echo Shaders compiled
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
@echo "// Generated resource file" > res/res.c
|
$(LD) -r -b binary -o $(RESOURCES_OBJ) $(RESOURCE_FILES)
|
||||||
$(foreach res, $(RESOURCE_FILES), xxd -i $(res) >> $(RESOURCES_C);)
|
|
||||||
$(CC) -o $(RESOURCES_OBJ) -c $(RESOURCES_C)
|
|
||||||
|
|
||||||
@echo "#ifndef __G_RESOURCES_H__" > $(RESOURCES_H)
|
@echo "#ifndef __G_RESOURCES_H__" > $(RESOURCES_H)
|
||||||
@echo "#define __G_RESOURCES_H__" >> $(RESOURCES_H)
|
@echo "#define __G_RESOURCES_H__" >> $(RESOURCES_H)
|
||||||
@nm -g -j $(RESOURCES_OBJ) | \
|
@nm -j $(RESOURCES_OBJ) | awk '{ print "extern char " $$0 "[];" }' >> $(RESOURCES_H)
|
||||||
awk '{ if($$0 ~ /len$$/) { print "extern int " substr($$0, 2) ";" } else { print "extern char " substr($$0, 2) "[];" } }' >> $(RESOURCES_H)
|
|
||||||
@echo "#endif" >> $(RESOURCES_H)
|
@echo "#endif" >> $(RESOURCES_H)
|
||||||
@echo Resources compiled
|
@echo Resources compiled
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#include "gear/base.h"
|
#include "gear/base.h"
|
||||||
#include "gear/graphics/pipeline.h"
|
#include "gear/graphics/pipeline.h"
|
||||||
#include "gear/images.h"
|
#include "gear/images.h"
|
||||||
#define SL_IMPLEMENTATION
|
|
||||||
#include "slibs/slibs.h"
|
#include "slibs/slibs.h"
|
||||||
#include <gear/graphics/renderer.h>
|
#include <gear/graphics/renderer.h>
|
||||||
#include <gear/camera.h>
|
#include <gear/camera.h>
|
||||||
|
|
|
@ -37,8 +37,8 @@ g_gui* g_gui_create() {
|
||||||
config.pixel_snap = true;
|
config.pixel_snap = true;
|
||||||
|
|
||||||
g_gui_font = nk_font_atlas_add_from_memory(atlas,
|
g_gui_font = nk_font_atlas_add_from_memory(atlas,
|
||||||
res_OpenSans_Regular_ttf,
|
_binary_res_OpenSans_Regular_ttf_start,
|
||||||
res_OpenSans_Regular_ttf_len,
|
_binary_res_OpenSans_Regular_ttf_end - _binary_res_OpenSans_Regular_ttf_start,
|
||||||
font_size, &config);
|
font_size, &config);
|
||||||
|
|
||||||
i32 atlas_width, atlas_height;
|
i32 atlas_width, atlas_height;
|
||||||
|
|
Loading…
Add table
Reference in a new issue