It takes the vertex and fragment shader files and converts them into a header file (.h) and a source file (.c).
> hsth --help
Common usage: hsth -n <shader_name>
-n --name - Shader name
-s --shaders - Shaders path
-o --output - Output dir
-m --header-output - Header output override
-i --include - Source header include path override
-g --guard - Header guard override
-h --help - Show this help
cd /path/to/hmah-shader-to-header
mkdir build
cd build
cmake ..
# Windows
cmake --build . --config Release
# Linux
cmake --build .
HMAH_MAX_STRING_SIZE
(default: 65535) - Max string size for the source/header file
Directory files: image.vs
, image.fs
hsth -n image
Will generate: image.h
, image.c
image.h
#ifndef __HSTH_IMAGE_H__
#define __HSTH_IMAGE_H__
extern const char* image_vs;
extern const char* image_fs;
#endif // __HSTH_IMAGE_H__
image.c
#include "image.h"
const char* image_vs = ""
"#version 330 core\n"
"\n"
"void main() {\n"
" gl_Position = vec4(0, 0, 0, 1);\n"
"}";
const char* image_fs = ""
"#version 330 core\n"
"\n"
"void main() {\n"
" gl_FragColor = vec4(0, 0, 0, 1);\n"
"}";
MIT