I'm writing a program in OpenGL, and I wanted to compile the shader file into the executable directly, so the user can't ruin the program (by deleting the shader file or editing it) without knowing what he's doing.
I compiled the shader into an object file with:
ld -r -b binary -o basic_shader.o res/shaders/Basic.gl
And I got these symbols:
SYMBOL TABLE:
0000000000000000 l d .data 0000000000000000 .data
00000000000000e5 g *ABS* 0000000000000000 _binary_res_shaders_Basic_gl_size
00000000000000e5 g .data 0000000000000000 _binary_res_shaders_Basic_gl_end
0000000000000000 g .data 0000000000000000 _binary_res_shaders_Basic_gl_start
I already created a class for managing shaders. But the constructor is supposed to get as a param, the shader file path, to open it and read it.
So is it possible to read the symbol _binary_res_shaders_Basic_gl_start
(which is a char[]
) line by line ?