Adding raylib debug build
This commit is contained in:
parent
e6bb0cb1f7
commit
7e3ca0c95a
7 changed files with 20 additions and 16 deletions
|
|
@ -8,6 +8,14 @@ windows_library_dest="../../windows"
|
|||
darwin_library_dest="../../darwin"
|
||||
wasm_library_dest="../../wasm"
|
||||
|
||||
if [ "$1" = "DEBUG" ]; then
|
||||
MFLAGS="RAYLIB_BUILD_MODE=DEBUG"
|
||||
CFLAGS="-g"
|
||||
else
|
||||
MFLAGS="RAYLIB_BUILD_MODE=RELEASE"
|
||||
CFLAGS=""
|
||||
fi
|
||||
|
||||
config_cflags="\
|
||||
-DSUPPORT_MODULE_RSHAPES=1 \
|
||||
-DSUPPORT_MODULE_RTEXTURES=1 \
|
||||
|
|
@ -70,9 +78,14 @@ config_cflags="\
|
|||
|
||||
source $emsdk_env
|
||||
|
||||
echo "MFLAGS MFLAGS MFLAGS MFLAGS MFLAGS"
|
||||
echo $MFLAGS
|
||||
echo "MFLAGS MFLAGS MFLAGS MFLAGS MFLAGS"
|
||||
echo $CFLAGS
|
||||
|
||||
pushd raylib/src
|
||||
echo "Compiling raylib static library for linux"
|
||||
make --silent $modules RAYLIB_CONFIG_FLAGS="$config_cflags" CUSTOM_CFLAGS="-Os -ffunction-sections -fdata-sections" PLATFORM_OS=LINUX
|
||||
make --silent $modules $MFLAGS RAYLIB_CONFIG_FLAGS="$config_cflags" CUSTOM_CFLAGS="-Os -ffunction-sections -fdata-sections" PLATFORM_OS=LINUX
|
||||
mv libraylib.a $linux_library_dest
|
||||
make --silent clean
|
||||
|
||||
|
|
@ -90,7 +103,7 @@ popd
|
|||
|
||||
pushd raygui
|
||||
echo "Compiling raygui static library for linux"
|
||||
gcc -c -Os -ffunction-sections -fdata-sections -fPIC -x c -DRAYGUI_IMPLEMENTATION -I../raylib/src raygui.h -o raygui.o
|
||||
gcc $CFLAGS -c -Os -ffunction-sections -fdata-sections -fPIC -x c -DRAYGUI_IMPLEMENTATION -I../raylib/src raygui.h -o raygui.o
|
||||
ar rcs ../linux/libraygui.a raygui.o
|
||||
rm raygui.o
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12
program.odin
12
program.odin
|
|
@ -6,7 +6,6 @@ import "core:mem"
|
|||
import "core:fmt"
|
||||
import "core:math/linalg"
|
||||
import "core:strings"
|
||||
import "core:os"
|
||||
|
||||
RAYGUI_ICON_PLAY :: "#131#"
|
||||
RAYGUI_ICON_PAUSE :: "#132#"
|
||||
|
|
@ -280,9 +279,8 @@ program_save_project :: proc(program: ^Program, path: string) -> ProjectWriteErr
|
|||
}
|
||||
|
||||
program_save_project_from_project_string_or_open_dialog :: proc(program: ^Program) {
|
||||
path: string
|
||||
project_save_string := strings.string_from_null_terminated_ptr(&program.project_save_string[0], DIALOG_STATE_TEXT_INPUT_FIELD_SIZE)
|
||||
if len(project_save_string) > 0 {
|
||||
path := strings.string_from_null_terminated_ptr(&program.project_save_string[0], DIALOG_STATE_TEXT_INPUT_FIELD_SIZE)
|
||||
if len(path) > 0 {
|
||||
if err := program_save_project(program, path); err != nil {
|
||||
msg := fmt.caprint("Failed to save project to '", path, "'\n" ,typeid_of(type_of(err)), ".", err, sep = "")
|
||||
program_show_dialog(program, .Error, msg)
|
||||
|
|
@ -504,7 +502,7 @@ program_update :: proc() {
|
|||
program.ui_element_focus = program_render_ui_and_handle_focus(&program.ui_context, ui_element_focus, program.font_style, ui_elements)
|
||||
|
||||
if len(ui_overlay_elements) > 0 {
|
||||
rl.DrawRectangle(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, {0, 0, 0, 192})
|
||||
rl.DrawRectangle(0, 0, rl.GetScreenWidth(), rl.GetScreenHeight(), {0, 0, 0, 192})
|
||||
program.ui_overlay_element_focus = program_render_ui_and_handle_focus(
|
||||
&program.ui_overlay_context,
|
||||
program.ui_overlay_element_focus,
|
||||
|
|
@ -728,10 +726,10 @@ program_build_workspace_ui :: proc(ctx: ^ui.Context) ->
|
|||
side_bar_container_config := ui.ElementConfiguration {margin = 4.0}
|
||||
side_bar_container_data := new(UiElementData_Container, context.temp_allocator)
|
||||
side_bar_container_data^ = {type = .Scroll, scroll = program.matrix_scroll}
|
||||
matrix_container = ui.container_begin({ui.Size_Percentage(0.2), ui.Size_PercentageRemainder(1.0)}, side_bar_container_config, side_bar_container_data)
|
||||
matrix_container = ui.container_begin({ui.Size_Pixels(320.0), ui.Size_PercentageRemainder(1.0)}, side_bar_container_config, side_bar_container_data)
|
||||
for i in 0..<program.matrix_count {
|
||||
container_config := ui.ElementConfiguration{margin = 8.0, label = fmt.ctprintf("Matrix %d", i)}
|
||||
container_dimensions := ui.Dimensions {ui.Size_Percentage(1.0), ui.Size_Pixels(140.0)}
|
||||
container_dimensions := ui.Dimensions {ui.Size_Percentage(1.0), ui.Size_Pixels(192.0)}
|
||||
mat := program.matrix_float_pool[i * 9 : i * 9 + 9]
|
||||
value_strings := program.matrix_value_string_pool[i * 9 : i * 9 + 9]
|
||||
ui_mat3(i, mat, value_strings, container_dimensions, container_config)
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ project_write :: proc(project: ^ProjectData, path: string) -> ProjectWriteError
|
|||
io.write_ptr(w, &version, size_of(version)) or_return
|
||||
io.write_ptr(w, &project.matrix_count, size_of(project.matrix_count)) or_return
|
||||
n := io.write_ptr(w, raw_data(project.matrices), int(project.matrix_count) * 9 * size_of(f32)) or_return
|
||||
fmt.println(n)
|
||||
// io.write_ptr(w, &project.grid, size_of(Grid))
|
||||
os.close(f)
|
||||
return nil
|
||||
}
|
||||
|
|
@ -55,8 +53,6 @@ ProjectReadErrorType :: enum {
|
|||
VersionNeedsUpgrade,
|
||||
}
|
||||
|
||||
import "core:fmt"
|
||||
|
||||
project_read :: proc(project: ^ProjectData, path: string) -> ProjectReadError {
|
||||
f := os.open(path, {.Read}) or_return
|
||||
defer os.close(f)
|
||||
|
|
@ -75,8 +71,5 @@ project_read :: proc(project: ^ProjectData, path: string) -> ProjectReadError {
|
|||
}
|
||||
_ = io.read_ptr(r, &project.matrix_count, size_of(project.matrix_count)) or_return
|
||||
n := io.read_ptr(r, raw_data(project.matrices), size_of(f32) * len(project.matrices)) or_return
|
||||
fmt.println(n)
|
||||
// _ = io.read_ptr(r, &project.grid, size_of(Grid)) or_return
|
||||
// _ = io.read_ptr(r, &project.animation, size_of(Animation)) or_return
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue