helloworld
This commit is contained in:
commit
3a2609f8e4
|
@ -0,0 +1,9 @@
|
|||
BasedOnStyle: LLVM
|
||||
IndentWidth: 8
|
||||
UseTab: AlignWithSpaces
|
||||
BreakBeforeBraces: Linux
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
IndentCaseLabels: false
|
||||
ColumnLimit: 80
|
||||
AlignConsecutiveMacros: true
|
||||
AlwaysBreakAfterReturnType: TopLevelDefinitions
|
|
@ -0,0 +1,7 @@
|
|||
out/
|
||||
build/
|
||||
build-cg/
|
||||
build-fx/
|
||||
*.g3a
|
||||
*.g1a
|
||||
*.png~
|
|
@ -0,0 +1,6 @@
|
|||
[submodule "fe"]
|
||||
path = fe
|
||||
url = https://github.com/rxi/fe
|
||||
[submodule "raygint"]
|
||||
path = raygint
|
||||
url = https://gitea.planet-casio.com/KikooDX/raygint
|
|
@ -0,0 +1,46 @@
|
|||
# Configure with [fxsdk build-cg], which provide the
|
||||
# toolchain file and module path of the fxSDK
|
||||
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
project(CRYSTAL C)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
include_directories(inc out raygint/include fe/src)
|
||||
|
||||
set(SOURCES
|
||||
src/main.c
|
||||
raygint/src/display.c
|
||||
raygint/src/keyboard.c
|
||||
fe/src/fe.c
|
||||
)
|
||||
|
||||
set(ASSETS
|
||||
)
|
||||
|
||||
set(FLAGS
|
||||
-Wall -Wextra -Wshadow -O3
|
||||
)
|
||||
|
||||
if ("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
|
||||
find_package(Gint 2.6.0 REQUIRED)
|
||||
|
||||
include(GenerateG3A)
|
||||
include(Fxconv)
|
||||
fxconv_declare_assets(${ASSETS} WITH_METADATA)
|
||||
|
||||
add_executable(target ${SOURCES} ${ASSETS})
|
||||
target_compile_options(target PRIVATE ${FLAGS} -DGINT)
|
||||
target_link_libraries(target Gint::Gint)
|
||||
target_link_options(target PRIVATE -Wl,-Map=map)
|
||||
|
||||
generate_g3a(TARGET target
|
||||
OUTPUT "${PROJECT_NAME}.g3a"
|
||||
NAME ""
|
||||
ICONS res/icon-uns.png res/icon-sel.png
|
||||
)
|
||||
else()
|
||||
add_executable(target ${SOURCES})
|
||||
target_compile_options(target PRIVATE ${FLAGS} -DRAYLIB -g)
|
||||
target_link_libraries(target raylib)
|
||||
endif()
|
|
@ -0,0 +1,21 @@
|
|||
all: format
|
||||
fxsdk build-cg
|
||||
|
||||
ray: clean format
|
||||
mkdir -p build
|
||||
cmake -B build .
|
||||
make -C build
|
||||
|
||||
run: ray
|
||||
build/target
|
||||
|
||||
format:
|
||||
clang-format -style=file -i src/**.c inc/**.h || true
|
||||
|
||||
clean:
|
||||
rm -Rf out/
|
||||
rm -Rf build/
|
||||
rm -Rf build-cg/
|
||||
rm -f *.g3a
|
||||
|
||||
.PHONY: format ray run clean
|
|
@ -0,0 +1 @@
|
|||
Subproject commit ed4cda96bd582cbb08520964ba627efb40f3dd91
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 2403783b3a7574828815aa9be9b541342d4684fa
|
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
|
@ -0,0 +1,34 @@
|
|||
#include "fe.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
const int size = 0xffffff;
|
||||
void *data = malloc(size);
|
||||
fe_Context *ctx = fe_open(data, size);
|
||||
#ifdef RAYLIB
|
||||
FILE *fp = fopen("test.fe", "rb");
|
||||
int gc = fe_savegc(ctx);
|
||||
|
||||
for (;;) {
|
||||
fe_Object *obj = fe_readfp(ctx, fp);
|
||||
|
||||
/* break if there's nothing left to read */
|
||||
if (!obj)
|
||||
break;
|
||||
|
||||
/* evaluate read object */
|
||||
fe_eval(ctx, obj);
|
||||
|
||||
/* restore GC stack which would now contain both the
|
||||
* read object and result from evaluation */
|
||||
fe_restoregc(ctx, gc);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
#endif
|
||||
fe_close(ctx);
|
||||
free(data);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue