PrevUpHomeNext

DSA framebuffers

#include <oglplus/dsa/framebuffer.hpp>

Operations with direct state access

template <>
class ObjectOps<tag::DirectState, tag::Framebuffer>
 : public ObjZeroOps<tag::DirectState, tag::Framebuffer> 1
{
public:
	struct Property
	{
		typedef OneOf<
			FramebufferBuffer,
			FramebufferAttachment,
			FramebufferColorAttachment
		> Buffer; 2

		typedef OneOf<
			FramebufferAttachment,
			FramebufferColorAttachment
		> Attachment; 3

		typedef FramebufferStatus Status;
	};

	void Bind(FramebufferTarget target);

	FramebufferStatus Status(FramebufferTarget target) const; 4
	bool IsComplete(FramebufferTarget target) const; 5
	void Complete(FramebufferTarget target) const; 6

	void AttachRenderbuffer(
		Property::Attachment attachment,
		RenderbufferName renderbuffer
	); 7
	void AttachColorRenderbuffer(
		FramebufferColorAttachmentNumber attachment_no,
		RenderbufferName renderbuffer
	); 8

	void AttachTexture(
		Property::Attachment attachment,
		TextureName texture,
		GLint level
	); 9
	void AttachColorTexture(
		FramebufferColorAttachmentNumber attachment_no,
		TextureName texture,
		GLint level
	); 10

	void AttachTextureLayer(
		Property::Attachment attachment,
		TextureName texture,
		GLint level,
		GLint layer
	); 11
};

1

Indirectly inherits from ObjCommonOps<tag::Framebuffer>.

2

Enumerations specifying framebuffer output buffer.

3

Enumerations specifying framebuffer attachments.

4

Returns the status of this framebuffer for the specified target. See glCheckNamedFramebufferStatus.

5

Returns true if this framebuffer is complete for the specified target. See glCheckNamedFramebufferStatus.

6

Throws an IncompleteFramebuffer exception if this framebuffer is not complete.

7

Attaches a renderbuffer object as an attachment to this framebuffer. See glNamedFramebufferRenderbuffer.

8

Attaches a renderbuffer object as a color attachment with index specified by attachment_no to this framebuffer.

9

Attaches the specified texture level as an attachment to this framebuffer. See glNamedFramebufferTexture.

10

Attaches the specified texture level as a color attachment with index specified by attachment_no to this framebuffer.

11

Attaches the level (or level's layer) of a 1D, 2D or 3D texture as an attachment of this framebuffer. See glNamedFramebufferTextureLayer.

Definition

typedef ObjectOps<tag::DirectState, tag::Framebuffer>
	DSAFramebufferOps;

typedef Object<DSAFramebufferOps> DSAFramebuffer;

Syntax sugar operators

struct DSAFramebufferOpsAndAttch { }; 1

DSAFramebufferOpsAndAttch operator << (
	DSAFramebufferOps& fbo,
	DSAFramebufferOps::Property::Attachment attch
);

DSAFramebufferOps& operator << (
	DSAFramebufferOps& fbo,
	FramebufferTarget target
); 2

DSAFramebufferOps& operator << (
	DSAFramebufferOpsAndAttch&& faa,
	TextureName tex
); 3

DSAFramebufferOps& operator << (
	DSAFramebufferOpsAndAttch&& faa,
	RenderbufferName rbo
); 4

1

Helper class used with syntax-sugar operators. Stores a framebuffer name and attachment.

2

Equivalent to fbo.Bind(target).

3

Attaches tex to the attachment of the framebuffer specified by faa.

4

Attaches rbo to the attachment of the framebuffer specified by faa.


PrevUpHomeNext