13 #ifndef OGLPLUS_FRAMEBUFFER_1107121519_HPP
14 #define OGLPLUS_FRAMEBUFFER_1107121519_HPP
46 static void Gen(tag::Generate, GLsizei count, GLuint* names)
48 assert(names !=
nullptr);
49 OGLPLUS_GLFUNC(GenFramebuffers)(count, names);
50 OGLPLUS_CHECK_SIMPLE(GenFramebuffers);
52 #if GL_VERSION_4_5 || GL_ARB_direct_state_access
53 static void Gen(tag::Create, GLsizei count, GLuint* names)
55 assert(names !=
nullptr);
56 OGLPLUS_GLFUNC(CreateFramebuffers)(count, names);
57 OGLPLUS_CHECK_SIMPLE(CreateFramebuffers);
61 static void Delete(GLsizei count, GLuint* names)
63 assert(names !=
nullptr);
64 OGLPLUS_GLFUNC(DeleteFramebuffers)(count, names);
65 OGLPLUS_VERIFY_SIMPLE(DeleteFramebuffers);
68 static GLboolean IsA(GLuint name)
71 GLboolean result = OGLPLUS_GLFUNC(IsFramebuffer)(name);
72 OGLPLUS_VERIFY_SIMPLE(IsFramebuffer);
109 OGLPLUS_GLFUNC(BindFramebuffer)(
116 ObjectBinding(target)
128 ,
public ObjBindingOps<tag::Framebuffer>
151 :
public ObjZeroOps<tag::ExplicitSel, tag::Framebuffer>
194 GLenum result = OGLPLUS_GLFUNC(CheckFramebufferStatus)(
197 if(result == 0) OGLPLUS_CHECK(
198 CheckFramebufferStatus,
200 ObjectBinding(target)
226 HandleIncompleteError(target, status);
249 OGLPLUS_GLFUNC(FramebufferRenderbuffer)(
256 FramebufferRenderbuffer,
258 Subject(renderbuffer).
259 ObjectBinding(target)
282 OGLPLUS_GLFUNC(FramebufferRenderbuffer)(
284 GL_COLOR_ATTACHMENT0 + GLuint(attachment_no),
289 FramebufferRenderbuffer,
291 Subject(renderbuffer).
292 ObjectBinding(target)
296 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_2
318 OGLPLUS_GLFUNC(FramebufferTexture)(
328 ObjectBinding(target).
353 OGLPLUS_GLFUNC(FramebufferTexture)(
355 GL_COLOR_ATTACHMENT0 + GLenum(attachment_no),
363 ObjectBinding(target).
369 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_0
391 OGLPLUS_GLFUNC(FramebufferTexture1D)(
399 FramebufferTexture1D,
402 ObjectBinding(target).
429 OGLPLUS_GLFUNC(FramebufferTexture2D)(
437 FramebufferTexture2D,
440 ObjectBinding(target).
445 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_0
468 OGLPLUS_GLFUNC(FramebufferTexture3D)(
477 FramebufferTexture3D,
480 ObjectBinding(target).
507 OGLPLUS_GLFUNC(FramebufferTextureLayer)(
515 FramebufferTextureLayer,
518 ObjectBinding(target).
523 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_3 || GL_ARB_invalidate_subdata
532 const EnumArray<Property::Buffer>& buffers
535 OGLPLUS_GLFUNC(InvalidateFramebuffer)(
541 InvalidateFramebuffer,
543 ObjectBinding(target)
561 EnumArray<Property::Buffer>(count, buffers)
573 const EnumArray<Property::Buffer>& buffers,
580 OGLPLUS_GLFUNC(InvalidateSubFramebuffer)(
590 InvalidateSubFramebuffer,
592 ObjectBinding(target)
614 EnumArray<Property::Buffer>(count, buffers),
625 typedef ObjectOps<tag::ExplicitSel, tag::Framebuffer>
632 struct FramebufferTargetAndAttch
636 typedef FramebufferOps::Property::Attachment Attachment;
637 Attachment attachment;
646 inline FramebufferTargetAndAttch operator | (
648 FramebufferOps::Property::Attachment attachment
651 return FramebufferTargetAndAttch(target, attachment);
654 inline FramebufferTargetAndAttch operator << (
656 FramebufferOps::Property::Attachment attachment
659 return FramebufferTargetAndAttch(target, attachment);
672 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_2
675 FramebufferTargetAndAttch taa,
691 FramebufferTargetAndAttch taa,
717 typedef ObjectZero<ObjZeroOps<tag::ExplicitSel, tag::Framebuffer>>
737 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
738 #include <oglplus/framebuffer.ipp>
739 #endif // OGLPLUS_LINK_LIBRARY
741 #endif // include guard
void Bind(Target target) const
Binds this framebuffer to the specified target.
Definition: framebuffer.hpp:140
FramebufferStatus
Framebuffer status enumeration.
Definition: framebuffer_status.hpp:24
ObjectOps< tag::ExplicitSel, tag::Framebuffer > FramebufferOps
Framebuffer operations with explicit selector.
Definition: framebuffer.hpp:626
OneOf< GLenum, std::tuple< FramebufferBuffer, FramebufferAttachment, FramebufferColorAttachment > > Buffer
Buffer of default FB or attachment of a FBO.
Definition: framebuffer.hpp:167
static void AttachColorTexture(Target target, FramebufferColorAttachmentNumber attachment_no, TextureName texture, GLint level)
Attach a texture to the color attachment point of target.
Definition: framebuffer.hpp:346
Type for the framebuffer color attachment (implementation-dependent) number.
Definition: framebuffer_attachment.hpp:23
static void AttachRenderbuffer(Target target, Property::Attachment attachment, RenderbufferName renderbuffer)
Attach a renderbuffer to the attachment point of target.
Definition: framebuffer.hpp:243
FramebufferAttachment
Framebuffer object attachment points.
Definition: framebuffer_attachment.hpp:56
OneOf< GLenum, std::tuple< FramebufferAttachment, FramebufferColorAttachment > > Attachment
Attachment of a Framebuffer.
Definition: framebuffer.hpp:176
Framebuffer bind target enumerations.
Generic OpenGL object wrapper.
ObjectZero< ObjZeroOps< tag::ExplicitSel, tag::Framebuffer > > DefaultFramebuffer
An oglplus_object encapsulating the default framebuffer functionality.
Definition: framebuffer.hpp:718
Implements operations applicable to named (non-zero) objects.
Definition: wrap_tpl.hpp:45
Framebuffer status enumeration.
GLuint GetGLName(ObjectName< ObjTag > named)
Returns the GLuint OpenGL name assigned to named object.
Definition: name.hpp:38
Helper class used with syntax-sugar operators.
Definition: framebuffer.hpp:629
static bool IsComplete(Target target)
Returns true if the framebuffer is complete.
Definition: framebuffer.hpp:213
static FramebufferStatus Status(Target target)
Checks the status of the framebuffer.
Definition: framebuffer.hpp:192
static void AttachTexture1D(Target target, Property::Attachment attachment, TextureTarget textarget, TextureName texture, GLint level)
Attach a 1D texture to the attachment point of target.
Definition: framebuffer.hpp:383
FramebufferStatus Status
Status of a Framebuffer.
Definition: framebuffer.hpp:179
Helper macro for optional checking of availability of GL function.
Implements operations applicable to any object including object 0 (zero)
Definition: fwd.hpp:157
static void Complete(Target target)
Throws an exception if the framebuffer is not complete.
Definition: framebuffer.hpp:221
FramebufferTarget Target
Framebuffer bind targets.
Definition: framebuffer.hpp:87
TextureTarget
Texture bind and image specification targets.
Definition: texture_target.hpp:27
Stores a value having one of the listed types in a common representation.
Definition: one_of.hpp:60
static void Bind(Target target, FramebufferName framebuffer)
Binds the specified framebuffer to the specified target.
Definition: framebuffer.hpp:104
static void Invalidate(Target target, GLsizei count, const Property::Buffer *buffers)
Invalidates the specified attachments or buffers of the Framebuffer.
Definition: framebuffer.hpp:553
FramebufferBuffer
Default framebuffer buffers.
Definition: framebuffer_attachment.hpp:40
static void AttachColorRenderbuffer(Target target, FramebufferColorAttachmentNumber attachment_no, RenderbufferName renderbuffer)
Attach a renderbuffer to the color attachment_no of target.
Definition: framebuffer.hpp:276
static void AttachTexture2D(Target target, Property::Attachment attachment, TextureTarget textarget, TextureName texture, GLint level)
Attach a 2D texture to the attachment point of target.
Definition: framebuffer.hpp:421
static FramebufferName Binding(Target target)
Returns the current Framebuffer bound to specified target.
Definition: framebuffer.hpp:94
static void AttachTexture3D(Target target, Property::Attachment attachment, TextureTarget textarget, TextureName texture, GLint level, GLint layer)
Attach a 3D texture to the attachment point of target.
Definition: framebuffer.hpp:459
Exception class for GL object-related errors.
Definition: object.hpp:24
FramebufferTarget
Framebuffer bind target.
Definition: framebuffer_target.hpp:24
Implements operations applicable to any object and any operation kind.
Definition: fwd.hpp:151
static void Invalidate(Target target, const EnumArray< Property::Buffer > &buffers)
Invalidates the specified attachments or buffers of the Framebuffer.
Definition: framebuffer.hpp:530
static void Invalidate(Target target, const EnumArray< Property::Buffer > &buffers, GLint x, GLint y, GLsizei width, GLsizei height)
Invalidates parts of attachments or buffers of the Framebuffer.
Definition: framebuffer.hpp:571
static void AttachTextureLayer(Target target, Property::Attachment attachment, TextureName texture, GLint level, GLint layer)
Attach a texture layer to the attachment point of target.
Definition: framebuffer.hpp:499
OpenGL Framebuffer attachment enumerations.
Object< FramebufferOps > Framebuffer
An oglplus_object encapsulating the framebuffer object functionality.
Definition: framebuffer.hpp:733
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136
static void AttachTexture(Target target, Property::Attachment attachment, TextureName texture, GLint level)
Attach a texture to the attachment point of target.
Definition: framebuffer.hpp:311
static void Invalidate(Target target, GLsizei count, const Property::Buffer *buffers, GLint x, GLint y, GLsizei width, GLsizei height)
Invalidates parts of attachments or buffers of the Framebuffer.
Definition: framebuffer.hpp:602
Texture target enumeration.
Variant helper class used mostly with enums.
FramebufferColorAttachment
Framebuffer color attachment points.
Definition: framebuffer_attachment.hpp:72