LearnJUCEOpenGL icon indicating copy to clipboard operation
LearnJUCEOpenGL copied to clipboard

Shader BinaryData include

Open mhamilt opened this issue 5 years ago • 0 comments

This is a great project for introducing OpenGL concepts. I initially had a little trouble with with reading the shader files with the declared MainComponent::parse_shaders()

Issue

Shader files fail to load from MainComponent::parse_shaders()

Fix

Currently the shader files are checked in the producer project to compile

Suggested fix is to embed the shaders as a binary resource. They are then included in the JUCE Library Code directory and accessible as BinaryData. This simplifies the shader parsing to

MainComponent::ShaderProgramSource MainComponent::parse_shaders()
{
    return { BinaryData::Vert_vert, BinaryData::Frag_frag };
}

mhamilt avatar Aug 12 '19 16:08 mhamilt