13 #ifndef OGLPLUS_PROGRAM_PIPELINE_1107121519_HPP
14 #define OGLPLUS_PROGRAM_PIPELINE_1107121519_HPP
21 #include <oglplus/detail/prog_pl_stages.hpp>
28 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_1 || GL_ARB_separate_shader_objects
43 static void Gen(tag::Generate, GLsizei count, GLuint* names)
45 assert(names !=
nullptr);
46 OGLPLUS_GLFUNC(GenProgramPipelines)(count, names);
47 OGLPLUS_CHECK_SIMPLE(GenProgramPipelines);
50 #if GL_VERSION_4_5 || GL_ARB_direct_state_access
51 static void Gen(tag::Create, GLsizei count, GLuint* names)
53 assert(names !=
nullptr);
54 OGLPLUS_GLFUNC(CreateProgramPipelines)(count, names);
55 OGLPLUS_CHECK_SIMPLE(CreateProgramPipelines);
59 static void Delete(GLsizei count, GLuint* names)
61 assert(names !=
nullptr);
62 OGLPLUS_GLFUNC(DeleteProgramPipelines)(count, names);
63 OGLPLUS_VERIFY_SIMPLE(DeleteProgramPipelines);
66 static GLboolean IsA(GLuint name)
69 GLboolean result = OGLPLUS_GLFUNC(IsProgramPipeline)(name);
70 OGLPLUS_VERIFY_SIMPLE(IsProgramPipeline);
80 static GLuint _binding(
void)
83 OGLPLUS_GLFUNC(GetIntegerv)(GL_PROGRAM_PIPELINE_BINDING, &name);
87 EnumParam(GLenum(GL_PROGRAM_PIPELINE_BINDING))
109 OGLPLUS_GLFUNC(BindProgramPipeline)(
GetGLName(pipeline));
125 ,
public ObjBindingOps<tag::ProgramPipeline>
148 :
public ObjZeroOps<tag::DirectState, tag::ProgramPipeline>
160 GLint GetIntParam(GLenum query)
const
163 OGLPLUS_GLFUNC(GetProgramPipelineiv)(_name, query, &result);
165 GetProgramPipelineiv,
200 return ProgPLUseStages(
218 OGLPLUS_GLFUNC(UseProgramStages)(
230 #if defined GL_ALL_SHADER_BITS
239 OGLPLUS_GLFUNC(UseProgramStages)(
258 String GetInfoLog(
void)
const;
269 return GetIntParam(GL_VALIDATE_STATUS) == GL_TRUE;
280 void Validate(
void)
const;
290 OGLPLUS_GLFUNC(ActiveShaderProgram)(
309 return ProgramName(GetIntParam(GL_ACTIVE_PROGRAM));
319 return GetIntParam(GLenum(shader_type)) != 0;
329 return ProgramName(GetIntParam(GLenum(shader_type)));
334 typedef ObjectOps<tag::DirectState, tag::ProgramPipeline>
341 typedef ObjectZero<ObjZeroOps<tag::DirectState, tag::ProgramPipeline>>
350 #endif // program pipeline
354 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
355 #include <oglplus/program_pipeline.ipp>
356 #endif // OGLPLUS_LINK_LIBRARY
358 #endif // include guard
ProgramPipelineStage Stage
The stage of a ProgramPipeline.
Definition: program_pipeline.hpp:157
ShaderType
The type of a Shader.
Definition: shader_type.hpp:26
ProgramName ActiveShaderProgram(void) const
Returns the current active shader program.
Definition: program_pipeline.hpp:307
ProgramPipelineStage enumeration.
Generic OpenGL object wrapper.
This template serves as a wrapper for OpenGL bitfields.
Definition: bitfield.hpp:56
::std::basic_string< ALchar > String
static ProgramPipelineName Binding(void)
Returns the currently bound ProgramPipeline.
Definition: program_pipeline.hpp:97
Implements operations applicable to named (non-zero) objects.
Definition: wrap_tpl.hpp:45
static void Bind(ProgramPipelineName pipeline)
Binds the specified vertex_array object.
Definition: program_pipeline.hpp:107
ProgPLUseStages UseStages(ProgramName program) const
Specifies program stages by calling functions of the returned object.
Definition: program_pipeline.hpp:197
GLuint GetGLName(ObjectName< ObjTag > named)
Returns the GLuint OpenGL name assigned to named object.
Definition: name.hpp:38
Object< ProgramPipelineOps > ProgramPipeline
An oglplus_object encapsulating the OpenGL program pipeline functionality.
Definition: program_pipeline.hpp:348
ObjectZero< ObjZeroOps< tag::DirectState, tag::ProgramPipeline > > NoProgramPipeline
Class that can be used to unbind the currently bound program pipeline.
Definition: program_pipeline.hpp:342
Helper macro for optional checking of availability of GL function.
Implements operations applicable to any object including object 0 (zero)
Definition: fwd.hpp:157
bool HasShader(ShaderType shader_type) const
Returns true if this pipeline contains a shader of a particular type.
Definition: program_pipeline.hpp:317
bool IsValid(void) const
Returns true if the pipeline is validated, false otherwise.
Definition: program_pipeline.hpp:267
ProgramPipelineStage
Program pipeline stage enumeration.
Definition: program_pipeline_stage.hpp:29
ObjectOps< tag::DirectState, tag::ProgramPipeline > ProgramPipelineOps
Program pipeline operations with direct state access.
Definition: program_pipeline.hpp:335
ProgramName ShaderProgram(ShaderType shader_type) const
Returns the program from which the shader_type is used.
Definition: program_pipeline.hpp:327
Exception class for general OpenGL errors.
Definition: basic.hpp:43
Exception class for GL object-related errors.
Definition: object.hpp:24
void UseStages(Bitfield< ProgramPipelineStage > stages, ProgramName program) const
Use the specified stages of the program.
Definition: program_pipeline.hpp:212
void Bind(void) const
Binds this program pipeline object.
Definition: program_pipeline.hpp:137
Implements operations applicable to any object and any operation kind.
Definition: fwd.hpp:151
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136
void ActiveShaderProgram(ProgramName program) const
Make the program active for this program pipeline.
Definition: program_pipeline.hpp:287