Loading...
Searching...
No Matches
Gfx::CFramebuffer Class Referenceabstract

Abstract interface of default framebuffer and offscreen framebuffers. More...

`#include <src/graphics/core/framebuffer.h>`

Inheritance diagram for Gfx::CFramebuffer:
[legend]

## Public Member Functions

virtual bool | Create ()=0
| Creates this framebuffer.
virtual void | Destroy ()=0
| Destroys this framebuffer.
virtual bool | IsDefault ()=0
| Returns true if this is default framebuffer.
virtual int | GetWidth ()=0
| Returns width of buffers in this framebuffer.
virtual int | GetHeight ()=0
| Returns height of buffers in this framebuffer.
virtual int | GetDepth ()=0
| Returns depth size in bits.
virtual int | GetSamples ()=0
| Returns number of samples or 1 if multisampling is not supported.
virtual int | GetColorTexture ()=0
| Returns texture that contains color buffer or 0 if not available.
virtual int | GetDepthTexture ()=0
| Returns texture that contains depth buffer or 0 if not available.
virtual void | Bind ()=0
| Binds this framebuffer to context.
virtual void | Unbind ()=0
| Unbinds this framebuffer from context.
virtual void | CopyToScreen (int fromX, int fromY, int fromWidth, int fromHeight, int toX, int toY, int toWidth, int toHeight)=0
| Copies content of color buffer to screen.

## Detailed Description

Abstract interface of default framebuffer and offscreen framebuffers.

This code encapsulates basics of default framebuffer and offscreen buffers and allows offscreen rendering in generic way. CDevice may or may not implement offscreen buffers depending on available hardware but is required to provide default framebuffer implementation. Because of some hardware restrictions and in order to simplify interface, you can't bind/unbind textures from offscreen buffers and you can't change it's parameters.

## Member Function Documentation

## Create()

virtual bool Gfx::CFramebuffer::Create | ( |  | ) |

pure virtual

Creates this framebuffer.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## Destroy()

virtual void Gfx::CFramebuffer::Destroy | ( |  | ) |

pure virtual

Destroys this framebuffer.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## IsDefault()

virtual bool Gfx::CFramebuffer::IsDefault | ( |  | ) |

pure virtual

Returns true if this is default framebuffer.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## GetWidth()

virtual int Gfx::CFramebuffer::GetWidth | ( |  | ) |

pure virtual

Returns width of buffers in this framebuffer.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## GetHeight()

virtual int Gfx::CFramebuffer::GetHeight | ( |  | ) |

pure virtual

Returns height of buffers in this framebuffer.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## GetDepth()

virtual int Gfx::CFramebuffer::GetDepth | ( |  | ) |

pure virtual

Returns depth size in bits.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## GetSamples()

virtual int Gfx::CFramebuffer::GetSamples | ( |  | ) |

pure virtual

Returns number of samples or 1 if multisampling is not supported.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## GetColorTexture()

virtual int Gfx::CFramebuffer::GetColorTexture | ( |  | ) |

pure virtual

Returns texture that contains color buffer or 0 if not available.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## GetDepthTexture()

virtual int Gfx::CFramebuffer::GetDepthTexture | ( |  | ) |

pure virtual

Returns texture that contains depth buffer or 0 if not available.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## Bind()

virtual void Gfx::CFramebuffer::Bind | ( |  | ) |

pure virtual

Binds this framebuffer to context.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## Unbind()

virtual void Gfx::CFramebuffer::Unbind | ( |  | ) |

pure virtual

Unbinds this framebuffer from context.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

## CopyToScreen()

virtual void Gfx::CFramebuffer::CopyToScreen | ( | int | fromX,
|  | int | fromY,
|  | int | fromWidth,
|  | int | fromHeight,
|  | int | toX,
|  | int | toY,
|  | int | toWidth,
|  | int | toHeight )

pure virtual

Copies content of color buffer to screen.

Implemented in Gfx::CDefaultFramebuffer, Gfx::CGLFramebuffer, and Gfx::CGLFramebufferEXT.

The documentation for this class was generated from the following file:

- src/graphics/core/framebuffer.h