Skip to content

Quan1umMango/reloading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hr - Hot reloading module in C

Warning

This project is still in development

preview.mp4

A (currently) bare-bones implementation of a hot-reloading system in C.

Build

Clone this repo, cd into it and run make

Running examples

cd into the examples/ directory and run make initially. Then cd into the main directory and run:

    ./main ./examples/<example name> ./examples/<example name>.c ./example 

Then you can change and save the <example name>.c file and watch it auto reload.

Usage

  • Declare a constant named HR_STATE_SIZE (of type size_t or similar) and set it to the size of the state you want to save (optional, default value is 0)
  • Define a function void hr_setup(void* state). This will be run only once, when the hot-reloading program first loads your program. The parameter is a pointer to the memory which holds the state. (optional, defaults to do nothing)
  • Define a function void hr_main(void* state). This will be called every time your code is reloaded.

TODOS

  • Raylib example
  • Watch over directories
  • Watch over multiple files
  • Add option for custom build commands

About

Hot-reloading program in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages