Coder Social home page Coder Social logo

karl-zylinski / odin-raylib-hot-reload-game-template Goto Github PK

View Code? Open in Web Editor NEW
178.0 3.0 17.0 370 KB

An Odin + Raylib game template with Hot Reloading pre-setup

License: MIT License

Batchfile 1.04% Odin 96.69% GLSL 0.95% Shell 1.32%
odin-lang game-development gamedev raylib raylib-odin hot-reload odin odin-programming-language

odin-raylib-hot-reload-game-template's Introduction

I create video games and teach how to use the Odin Programming Language.

My Odin gists:

odin-raylib-hot-reload-game-template's People

Contributors

alfredbaudisch avatar bersk avatar cat-person avatar karl-zylinski avatar laytan avatar marcinkuder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

odin-raylib-hot-reload-game-template's Issues

linux support

I have tried following your blog post on hot reloading, in linux, substituting .dll's for .so's where ever needed but I ran in to troubles and gave up.

Might try again soon.

Build release optimized for speed?

Shouldn't build_release be optimized for speed with -o:speed? Maybe also -strict-style.

From https://github.com/odin-lang/Odin/wiki/Compiler-Flags

  • o:minimal: Set the optimization mode for compilation. Valid strings are minimal, size, speed

And from https://github.com/odin-lang/Odin/blob/76229cabfaf1f3fd973842b8e11e16c2e4e64896/src/main.cpp#L2000

print_usage_line(1, "-strict-style");
print_usage_line(2, "Errs on unneeded tokens, such as unneeded semicolons.");
print_usage_line(2, "Errs on missing trailing commas followed by a newline.");
print_usage_line(2, "Errs on deprecated syntax.");

I.e.:

odin build main_release -define:RAYLIB_SHARED=false -out:game_release.exe -no-bounds-check -subsystem:windows -o:speed -strict-style

qprocess can't be found while running build_hot_reload.bat

As the microsoft qprocess documentation page states, qprocess is only available in windows server

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

I'm running Windows 11, and as such, qprocess can't be found when running build_hot_reload.bat

I fixed this by applying this solution as follows, feel free to copy it, adapt it or find some other fix.

@echo off
SETLOCAL EnableExtensions

rem Build game.dll
odin build . -show-timings -use-separate-modules -define:RAYLIB_SHARED=true -build-mode:dll -out:game.dll -strict-style -vet-unused -vet-using-stmt -vet-using-param -vet-style -vet-semicolon -debug
IF %ERRORLEVEL% NEQ 0 exit /b 1

rem If game.exe already running: Then only compile game.dll and exit cleanly
set EXE=game.exe

FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto ProcessFound

goto ProcessNotFound

:ProcessFound
exit /b 1

:ProcessNotFound

rem build game.exe
odin build main_hot_reload -use-separate-modules -out:game.exe -strict-style -vet-using-stmt -vet-using-param -vet-style -vet-semicolon -debug
IF %ERRORLEVEL% NEQ 0 exit /b 1

rem copy raylib.dll from odin folder to here
if not exist "raylib.dll" (
	echo "Please copy raylib.dll from <your_odin_compiler>/vendor/raylib/windows/raylib.dll to the same directory as game.exe"
	exit /b 1
)

exit /b 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.