CSEngine
|
#include <SFrameBuffer.h>
Public Member Functions | |
RESOURCE_DEFINE_CONSTRUCTOR (SFrameBuffer) | |
void | GenerateFramebuffer (BufferDimension dimension, int width, int height) |
unsigned int | GenerateRenderbuffer (BufferType type, int internalFormat) |
STexture * | GenerateTexturebuffer (BufferType type, int channel, int level=0) |
void | RasterizeFramebuffer () |
void | AttachCubeBuffer (int index, int level=0) const |
void | AttachFrameBuffer (int target=GL_FRAMEBUFFER) const |
void | DetachFrameBuffer () const |
void | ResizeFrameBuffer (int width, int height) |
void | Exterminate () override |
void | PostFrameBuffer (GLProgramHandle *handle, const CameraBase &camera) |
STexture * | BlitCopiedFrameBuffer () const |
int | GetWidth () const |
int | GetHeight () const |
const ivec2 & | GetSize () const |
BufferStatus | GetBufferStatus () const |
STexture * | GetTexture (int index) const |
STexture * | GetTexture (const char *id) const |
unsigned int | GetRenderbufferID (int index) const |
STexture * | GetMainColorTexture () const |
STexture * | GetDepthTexture () const |
void | SetValue (std::string name_str, Arguments value) override |
std::string | PrintValue () const override |
![]() | |
SResource (std::string classType) | |
SResource (const SResource *resource, bool isRegister) | |
void | SetName (std::string name) |
void | SetAbsoluteID (std::string id) |
std::string | GetName () const |
std::string | GetAbsoluteID () const |
AssetMgr::AssetReference * | GetAssetReference (std::string hash="") const |
void | LinkResource (AssetMgr::AssetReference *asset) |
void | LinkResource (std::string name) |
void | SetHash (std::string &hash) override |
![]() | |
SObject (bool isRegister) | |
virtual void | SetUndestroyable (bool enable) |
virtual void | Destroy () |
std::string | GetHash () const |
![]() | |
![]() | |
ReflectionObject (std::string type) | |
void | SetClassType (std::string type) |
const char * | GetClassType () const |
bool | IsSameClass (const char *classType) const |
Protected Member Functions | |
void | Init (const AssetMgr::AssetReference *asset) override |
![]() | |
![]() |
Additional Inherited Members | |
![]() | |
template<class T > | |
static T * | Create (const std::string &name) |
static SResource * | Create (const std::string &name, const std::string &classType) |
template<class T > | |
static T * | Create (const AssetMgr::AssetReference *asset) |
static SResource * | Create (const AssetMgr::AssetReference *asset, const std::string &classType) |
template<class T > | |
static T * | Get (std::string name) |
static SResource * | Get (std::string &name) |
![]() | |
static ReflectionObject * | NewObject (const std::string &name) |
![]() | |
typedef std::vector< std::string > | Arguments |
![]() | |
std::string | m_hash |
![]() | |
std::string | m_class |
Definition at line 33 of file SFrameBuffer.h.
enum CSE::SFrameBuffer::BlitType |
Definition at line 44 of file SFrameBuffer.h.
enum CSE::SFrameBuffer::BufferDimension |
Definition at line 38 of file SFrameBuffer.h.
enum CSE::SFrameBuffer::BufferStatus |
Definition at line 41 of file SFrameBuffer.h.
enum CSE::SFrameBuffer::BufferType |
Definition at line 35 of file SFrameBuffer.h.
void SFrameBuffer::AttachCubeBuffer | ( | int | index, |
int | level = 0 ) const |
Definition at line 188 of file SFrameBuffer.cpp.
void SFrameBuffer::AttachFrameBuffer | ( | int | target = GL_FRAMEBUFFER | ) | const |
Definition at line 199 of file SFrameBuffer.cpp.
STexture * SFrameBuffer::BlitCopiedFrameBuffer | ( | ) | const |
Definition at line 272 of file SFrameBuffer.cpp.
void SFrameBuffer::DetachFrameBuffer | ( | ) | const |
Definition at line 204 of file SFrameBuffer.cpp.
|
overridevirtual |
Implements CSE::SObject.
Definition at line 37 of file SFrameBuffer.cpp.
void SFrameBuffer::GenerateFramebuffer | ( | BufferDimension | dimension, |
int | width, | ||
int | height ) |
This is the first function called when creating a framebuffer. You specify the dimensions of the framebuffer through that function.
dimension | Sets the dimensions of the framebuffer. The default is SFrameBuffer::PLANE. |
width | Write the width of the render buffer. |
height | Writes the height of the render buffer. |
Definition at line 104 of file SFrameBuffer.cpp.
unsigned int SFrameBuffer::GenerateRenderbuffer | ( | BufferType | type, |
int | internalFormat ) |
Creates a render buffer in a non-texture format.
type | Specifies the type of buffer to create. The default is RENDER. |
internalFormat | Sets the internal format for the render buffer. Format details can be found at this link. |
Definition at line 113 of file SFrameBuffer.cpp.
STexture * SFrameBuffer::GenerateTexturebuffer | ( | BufferType | type, |
int | channel, | ||
int | level = 0 ) |
Creates a render buffer in texture format.
type | Specifies the type of buffer to create. The default is RENDER. |
channel | Sets the channel format for the render buffer. Format details can be found at this link. |
level | Sets the texture mipmap level. Default is 0. |
Definition at line 138 of file SFrameBuffer.cpp.
Referenced by RasterizeFramebuffer().
SFrameBuffer::BufferStatus SFrameBuffer::GetBufferStatus | ( | ) | const |
Definition at line 359 of file SFrameBuffer.cpp.
|
inline |
Get the texture assigned to the framebuffer as depth.
Definition at line 160 of file SFrameBuffer.h.
int SFrameBuffer::GetHeight | ( | ) | const |
Definition at line 296 of file SFrameBuffer.cpp.
|
inline |
Get the texture assigned to the framebuffer as GL_COLOR_ATTACHMENT0.
Definition at line 151 of file SFrameBuffer.h.
unsigned int SFrameBuffer::GetRenderbufferID | ( | int | index | ) | const |
Get renderbuffer ID that exist in the framebuffer.
index | buffer index in framebuffer |
Definition at line 381 of file SFrameBuffer.cpp.
|
inline |
Definition at line 120 of file SFrameBuffer.h.
STexture * SFrameBuffer::GetTexture | ( | const char * | id | ) | const |
Get textures that exist in the framebuffer.
id | texture id in framebuffer |
Definition at line 370 of file SFrameBuffer.cpp.
STexture * SFrameBuffer::GetTexture | ( | int | index | ) | const |
Get textures that exist in the framebuffer.
index | buffer index in framebuffer |
Definition at line 363 of file SFrameBuffer.cpp.
int SFrameBuffer::GetWidth | ( | ) | const |
Definition at line 292 of file SFrameBuffer.cpp.
|
overrideprotectedvirtual |
Implements CSE::SResource.
Definition at line 49 of file SFrameBuffer.cpp.
void SFrameBuffer::PostFrameBuffer | ( | GLProgramHandle * | handle, |
const CameraBase & | camera ) |
Definition at line 234 of file SFrameBuffer.cpp.
|
overridevirtual |
Implements CSE::VariableBinder.
Definition at line 391 of file SFrameBuffer.cpp.
void SFrameBuffer::RasterizeFramebuffer | ( | ) |
Create all the render buffers to allocate to the framebuffer and proceed with rasterization. You can use the framebuffer after calling the function.
Definition at line 168 of file SFrameBuffer.cpp.
References GenerateTexturebuffer().
void SFrameBuffer::ResizeFrameBuffer | ( | int | width, |
int | height ) |
Definition at line 208 of file SFrameBuffer.cpp.
|
overridevirtual |
Used to get serialized values. All classes that inherit from VariableBinder will unconditionally call this function first during initialization.
name_str | Name of values |
value | Serialized values |
Implements CSE::VariableBinder.
Definition at line 388 of file SFrameBuffer.cpp.