Prepare simple API interface
This commit is contained in:
parent
43f48ab374
commit
2c44f21748
|
@ -0,0 +1,9 @@
|
||||||
|
#pragma once
|
||||||
|
#include <PSX/GPU/gpu_types.hpp>
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
struct FontInfo {
|
||||||
|
GPU::SizeU16 VRAMSize;
|
||||||
|
GPU::SizeU16 FontSize;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
#pragma once
|
||||||
|
#include "Type/types.hpp"
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
struct DefaultFont {
|
||||||
|
static constexpr auto Info = FontInfo {
|
||||||
|
.VRAMSize = {64, 80},
|
||||||
|
.FontSize = {12, 16}
|
||||||
|
};
|
||||||
|
|
||||||
|
static void load(GPU::PositionU16 vram_dst);
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,3 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "Type/types.hpp"
|
||||||
|
|
||||||
void test();
|
namespace JabyEngine {
|
||||||
|
struct FontWriter {
|
||||||
|
static void setup(GPU::PositionU16 vram_pos, const FontInfo& font_info);
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
FontWriter/src/default_font_data.hpp
|
|
@ -4,6 +4,8 @@ include $(JABY_ENGINE_DIR)/mkfile/RebuildTarget.mk
|
||||||
ARTIFACT = libFontWriter
|
ARTIFACT = libFontWriter
|
||||||
BUILD_DIR = bin
|
BUILD_DIR = bin
|
||||||
|
|
||||||
|
DEFAULT_FONT_IMAGE = src/default_font_data.hpp
|
||||||
|
|
||||||
CCFLAGS += -I../../include -I$(JABY_ENGINE_DIR)/include
|
CCFLAGS += -I../../include -I$(JABY_ENGINE_DIR)/include
|
||||||
CCFLAGS += -save-temps=obj
|
CCFLAGS += -save-temps=obj
|
||||||
|
|
||||||
|
@ -18,6 +20,9 @@ LIB_OBJS = $(filter-out $(MAIN_BOOT_OBJ) $(OVERLAY_BOOT_OBJ),$(OBJS))
|
||||||
#$(info $$var is [${MAIN_BOOT_OBJ}])
|
#$(info $$var is [${MAIN_BOOT_OBJ}])
|
||||||
#$(info $$var2 is [${LIB_OBJS}])
|
#$(info $$var2 is [${LIB_OBJS}])
|
||||||
|
|
||||||
|
$(DEFAULT_FONT_IMAGE): ressources/DefaultFont.png
|
||||||
|
jaby_engine_fconv --lz4 $< simple-tim clut4 | cpp_out --name default_font_data -o $@
|
||||||
|
|
||||||
#Linking rule
|
#Linking rule
|
||||||
$(TARGET).a: $(LIB_OBJS)
|
$(TARGET).a: $(LIB_OBJS)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
|
@ -29,7 +34,7 @@ $(LIB_DIR)/$(ARTIFACT).a: $(TARGET).a
|
||||||
cp $(TARGET).a $(LIB_DIR)/$(ARTIFACT).a
|
cp $(TARGET).a $(LIB_DIR)/$(ARTIFACT).a
|
||||||
|
|
||||||
#Rules section for default compilation and linking
|
#Rules section for default compilation and linking
|
||||||
all: $(LIB_DIR)/$(ARTIFACT).a
|
all: $(DEFAULT_FONT_IMAGE) $(LIB_DIR)/$(ARTIFACT).a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr $(OUTPUT_DIR)
|
rm -fr $(OUTPUT_DIR)
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +0,0 @@
|
||||||
#include <FontWriter/FontWriter.hpp>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
void test() {
|
|
||||||
printf("Hello Planschi c:\n");
|
|
||||||
}
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include "default_font_data.hpp"
|
||||||
|
#include <FontWriter/default_font.hpp>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
void DefaultFont :: load(GPU::PositionU16 vram_dst) {
|
||||||
|
printf("Loading DefaultFont @0x%p -> %lu\n", default_font_data, sizeof(default_font_data));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include <FontWriter/font_writer.hpp>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
void FontWriter :: setup(GPU::PositionU16 vram_pos, const FontInfo& font_info) {
|
||||||
|
printf("Hello Planschi c:\n");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue