Closed sasmaster closed 10 years ago
Hi,
Well it allows you for example to say that a function accepts only a FragmentShader or only a ComputeShader and check that at compile-time. Like in:
// some function that would work only with geometry shader void Func(GeometryShader& gs);
// doing this will fail at compile-time VertexShader vs; Func(vs);
I've got some closed-source apps where we use this. But you don't have to use the {Vertex,Geometry,...,Fragment}Shader classes if you don't want to. There is the Shader class in which you specify the ShaderType at run-time. See for example here:
https://github.com/matus-chochlik/oglplus/blob/develop/example/standalone/002_dsa_buffer.cpp
Great ,now I see.Thanks for the clarification.
On Thu, Jan 2, 2014 at 10:06 AM, Matus Chochlik notifications@github.comwrote:
Hi,
Well it allows you for example to say that a function accepts only a FragmentShader or only a ComputeShader and check that at compile-time. Like in:
// some function that would work only with geometry shader void Func(GeometryShader& gs);
// doing this will fail at compile-time VertexShader vs; Func(vs);
I've got some closed-source apps where we use this. But you don't have to use the {Vertex,Geometry,...,Fragment}Shader classes if you don't want to. There is the Shader class in which you specify the ShaderType at run-time. See for example here:
https://github.com/matus-chochlik/oglplus/blob/develop/example/standalone/002_dsa_buffer.cpp
— Reply to this email directly or view it on GitHubhttps://github.com/matus-chochlik/oglplus/issues/41#issuecomment-31441048 .
Michael Ivanov Independent Pixel Commander onlygraphix.com Tel:+972 54 4962254
Hi.I wonder why the API has a separate class for each type of shaders.VertexShader,FragmentShader,GeometryShader etc...It seems to be like a over-engineered design,unless I miss something here...