basic rendering for both opengl and vulkan
This commit is contained in:
parent
4b18afa040
commit
dadd2edaf1
29 changed files with 1140 additions and 38 deletions
24
makefile
24
makefile
|
|
@ -5,6 +5,10 @@ ifeq (${DEBUG_BUILD},1)
|
|||
CFLAGS += -ggdb -fsanitize=address,undefined -DDEBUG
|
||||
endif
|
||||
|
||||
SHADER_DIR := assets/shaders
|
||||
SHADER_SRC := $(wildcard $(SHADER_DIR)/*.vert) $(wildcard $(SHADER_DIR)/*.frag)
|
||||
SHADER_SPV := $(SHADER_SRC:%=%.spv)
|
||||
|
||||
SRC:=\
|
||||
topaz.c\
|
||||
core/linear.c\
|
||||
|
|
@ -22,7 +26,14 @@ ifeq (${GRAPHICS_BACKEND},vk)
|
|||
rendering/vk/instance.c\
|
||||
rendering/vk/physical_device.c\
|
||||
rendering/vk/device.c\
|
||||
rendering/vk/surface.c
|
||||
rendering/vk/surface.c\
|
||||
rendering/vk/swapchain.c\
|
||||
rendering/vk/renderpass.c\
|
||||
rendering/vk/pipeline.c\
|
||||
rendering/vk/framebuffer.c\
|
||||
rendering/vk/command.c\
|
||||
rendering/vk/sync.c\
|
||||
rendering/vk/buffer.c
|
||||
|
||||
ifeq (${PLATFORM},Darwin)
|
||||
SRC += rendering/vk/macos_platform.c
|
||||
|
|
@ -32,15 +43,20 @@ endif
|
|||
|
||||
OBJ:=${SRC:.c=.o}
|
||||
|
||||
all: ${OBJ}
|
||||
all: shaders ${OBJ}
|
||||
${CC} ${LIBS} ${CFLAGS} ${OBJ} -o topaz
|
||||
|
||||
shaders: ${SHADER_SPV}
|
||||
|
||||
$(SHADER_DIR)/%.spv: $(SHADER_DIR)/%
|
||||
glslc $< -o $@
|
||||
|
||||
%.o: %.c
|
||||
${CC} ${CFLAGS} -c $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
.PHONY: clean shaders
|
||||
clean:
|
||||
@rm -rfv ${OBJ} topaz
|
||||
@rm -rfv ${OBJ} ${SHADER_SPV} topaz
|
||||
|
||||
INDENTABLE := $(shell find . -name "*.c" -o -name "*.h")
|
||||
INDENTABLE := $(filter-out ./gl/gl.h,$(INDENTABLE))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue