[client] added renderer abstratction

This moves the bulk of the rendering code into seperate rendering
modules cleaning up much of intertwined SDL & OpenGL mess.
This commit is contained in:
Geoffrey McRae
2017-12-05 20:33:05 +11:00
parent 5c335fca67
commit c1a82e853d
8 changed files with 699 additions and 311 deletions

View File

@@ -2,6 +2,10 @@ BINARY = looking-glass-client
CFLAGS = -g -Og -std=gnu99 -march=native -Wall -Werror -I./ -I../common -DDEBUG
LDFLAGS = -lrt
CFLAGS += -ffast-math
CFLAGS += -fdata-sections -ffunction-sections
LDFLAGS += -Wl,--gc-sections
LIBS = sdl2 SDL2_ttf gl glu libssl openssl spice-protocol
CFLAGS += $(shell pkg-config --cflags $(LIBS))
LDFLAGS += $(shell pkg-config --libs $(LIBS))
@@ -10,19 +14,21 @@ BIN ?= bin
OBJS = main.o \
spice/spice.o \
ivshmem/ivshmem.o
ivshmem/ivshmem.o \
renderers/basic.o \
renderers/opengl.o
BUILD_OBJS = $(foreach obj,$(OBJS),$(BUILD)/$(obj))
all: $(BINARY)
all: $(BIN)/$(BINARY)
$(BUILD)/%.o: %.c
@mkdir -p $(dir $@)
gcc -c $(CFLAGS) -o $@ $< $(LDFLAGS)
gcc -c $(CFLAGS) -o $@ $<
$(BINARY): $(BUILD_OBJS)
$(BIN)/$(BINARY): $(BUILD_OBJS)
@mkdir -p $(dir $(BIN)/$@)
gcc $(CFLAGS) -o $(BIN)/$(BINARY) $(BUILD_OBJS) $(LDFLAGS)
gcc -o $(BIN)/$(BINARY) $(BUILD_OBJS) $(LDFLAGS)
clean:
rm -rf $(BUILD) $(BIN)