SGCT
master (487fac4)
Simple Graphics Cluster Toolkit
Toggle main menu visibility
Loading...
Searching...
No Matches
offscreenbuffer.h
Go to the documentation of this file.
1
/*****************************************************************************************
2
* SGCT *
3
* Simple Graphics Cluster Toolkit *
4
* *
5
* Copyright (c) 2012-2026 *
6
* For conditions of distribution and use, see copyright notice in LICENSE.md *
7
****************************************************************************************/
8
9
#ifndef __SGCT__OFFSCREENBUFFER__H__
10
#define __SGCT__OFFSCREENBUFFER__H__
11
12
#include <sgct/sgctexports.h>
13
14
#include <
sgct/math.h
>
15
16
namespace
sgct
{
17
21
class
SGCT_EXPORT
OffScreenBuffer
{
22
public
:
23
static
void
unbind
();
24
25
explicit
OffScreenBuffer
(
unsigned
int
internalFormat);
26
~OffScreenBuffer
();
27
28
void
createFBO
(
int
width,
int
height,
int
samples = 1);
29
void
resizeFBO
(
int
width,
int
height,
int
samples = 1);
30
35
void
attachColorTexture
(
unsigned
int
texId,
unsigned
int
attachment)
const
;
36
void
attachDepthTexture
(
unsigned
int
texId)
const
;
37
43
void
attachCubeMapTexture
(
unsigned
int
texId,
unsigned
int
face,
44
unsigned
int
attachment)
const
;
45
void
attachCubeMapDepthTexture
(
unsigned
int
texId,
unsigned
int
face)
const
;
46
50
void
bind
()
const
;
51
59
void
bind
(
bool
isMultisampled,
int
n,
const
unsigned
int
* bufs)
const
;
60
void
bindBlit
()
const
;
61
void
blit
()
const
;
62
bool
isMultiSampled
()
const
;
63
64
private
:
65
unsigned
int
_frameBuffer = 0;
66
unsigned
int
_multiSampledFrameBuffer = 0;
67
unsigned
int
_colorBuffer = 0;
68
unsigned
int
_normalBuffer = 0;
69
unsigned
int
_positionBuffer = 0;
70
unsigned
int
_depthBuffer = 0;
71
const
unsigned
int
_internalColorFormat = 0x8058;
// GL_RGBA8;
72
73
ivec2
_size =
ivec2
{ -1, -1 };
74
bool
_isMultiSampled =
false
;
75
};
76
77
}
// namespace sgct
78
79
#endif
// __SGCT__OFFSCREENBUFFER__H__
sgct::OffScreenBuffer::blit
void blit() const
sgct::OffScreenBuffer::unbind
static void unbind()
sgct::OffScreenBuffer::createFBO
void createFBO(int width, int height, int samples=1)
sgct::OffScreenBuffer::attachColorTexture
void attachColorTexture(unsigned int texId, unsigned int attachment) const
sgct::OffScreenBuffer::isMultiSampled
bool isMultiSampled() const
sgct::OffScreenBuffer::bind
void bind(bool isMultisampled, int n, const unsigned int *bufs) const
Bind framebuffer.
sgct::OffScreenBuffer::attachCubeMapDepthTexture
void attachCubeMapDepthTexture(unsigned int texId, unsigned int face) const
sgct::OffScreenBuffer::attachCubeMapTexture
void attachCubeMapTexture(unsigned int texId, unsigned int face, unsigned int attachment) const
sgct::OffScreenBuffer::~OffScreenBuffer
~OffScreenBuffer()
sgct::OffScreenBuffer::resizeFBO
void resizeFBO(int width, int height, int samples=1)
sgct::OffScreenBuffer::OffScreenBuffer
OffScreenBuffer(unsigned int internalFormat)
sgct::OffScreenBuffer::bind
void bind() const
Bind framebuffer, auto-set multisampling and draw buffers.
sgct::OffScreenBuffer::bindBlit
void bindBlit() const
sgct::OffScreenBuffer::attachDepthTexture
void attachDepthTexture(unsigned int texId) const
math.h
sgct
Definition
actions.h:16
sgct::ivec2
Definition
math.h:17
sgct
offscreenbuffer.h
Generated by
1.18.0