ngfx::GraphicsContext

Inherited by ngfx::D3DGraphicsContext, ngfx::MTLGraphicsContext, ngfx::VKGraphicsContext

Public Classes

Name
struct AttachmentDescription
struct RenderPassConfig

Public Functions

Name
GraphicsContext * create(const char * appName, bool enableDepthStencil =false, bool debug =true)
virtual ~GraphicsContext()
virtual void setSurface(Surface * surface) =0
virtual void beginRenderPass(CommandBuffer * commandBuffer, Graphics * graphics)
virtual void beginOffscreenRenderPass(CommandBuffer * commandBuffer, Graphics * graphics, Framebuffer * outputFramebuffer)
virtual void endRenderPass(CommandBuffer * commandBuffer, Graphics * graphics)
virtual void endOffscreenRenderPass(CommandBuffer * commandBuffer, Graphics * graphics)
virtual void submit(CommandBuffer * commandBuffer)
virtual CommandBuffer * drawCommandBuffer(int32_t index =-1) =0
virtual CommandBuffer * copyCommandBuffer() =0
virtual CommandBuffer * computeCommandBuffer() =0
virtual RenderPass * getRenderPass(RenderPassConfig config) =0

Public Attributes

Name
Device * device
uint32_t numDrawCommandBuffers
std::vector< Framebuffer * > swapchainFramebuffers
Queue * queue
RenderPass * defaultRenderPass
RenderPass * defaultOffscreenRenderPass
Swapchain * swapchain
Surface * surface
uint32_t currentImageIndex
std::vector< Fence * > frameFences
Fence * computeFence
Semaphore * presentCompleteSemaphore
Semaphore * renderCompleteSemaphore
PipelineCache * pipelineCache
PixelFormat surfaceFormat
PixelFormat defaultOffscreenSurfaceFormat
PixelFormat depthFormat
glm::vec4 clearColor

Protected Attributes

Name
bool debug
bool enableDepthStencil

Public Functions Documentation

function create

static GraphicsContext * create(
    const char * appName,
    bool enableDepthStencil =false,
    bool debug =true
)

function ~GraphicsContext

inline virtual ~GraphicsContext()

function setSurface

virtual void setSurface(
    Surface * surface
) =0

Reimplemented by: ngfx::MTLGraphicsContext::setSurface, ngfx::D3DGraphicsContext::setSurface, ngfx::VKGraphicsContext::setSurface

function beginRenderPass

inline virtual void beginRenderPass(
    CommandBuffer * commandBuffer,
    Graphics * graphics
)

function beginOffscreenRenderPass

inline virtual void beginOffscreenRenderPass(
    CommandBuffer * commandBuffer,
    Graphics * graphics,
    Framebuffer * outputFramebuffer
)

function endRenderPass

inline virtual void endRenderPass(
    CommandBuffer * commandBuffer,
    Graphics * graphics
)

function endOffscreenRenderPass

inline virtual void endOffscreenRenderPass(
    CommandBuffer * commandBuffer,
    Graphics * graphics
)

function submit

inline virtual void submit(
    CommandBuffer * commandBuffer
)

Reimplemented by: ngfx::MTLGraphicsContext::submit

function drawCommandBuffer

virtual CommandBuffer * drawCommandBuffer(
    int32_t index =-1
) =0

Reimplemented by: ngfx::MTLGraphicsContext::drawCommandBuffer, ngfx::D3DGraphicsContext::drawCommandBuffer, ngfx::VKGraphicsContext::drawCommandBuffer

function copyCommandBuffer

virtual CommandBuffer * copyCommandBuffer() =0

Reimplemented by: ngfx::MTLGraphicsContext::copyCommandBuffer, ngfx::D3DGraphicsContext::copyCommandBuffer, ngfx::VKGraphicsContext::copyCommandBuffer

function computeCommandBuffer

virtual CommandBuffer * computeCommandBuffer() =0

Reimplemented by: ngfx::MTLGraphicsContext::computeCommandBuffer, ngfx::D3DGraphicsContext::computeCommandBuffer, ngfx::VKGraphicsContext::computeCommandBuffer

function getRenderPass

virtual RenderPass * getRenderPass(
    RenderPassConfig config
) =0

Reimplemented by: ngfx::MTLGraphicsContext::getRenderPass, ngfx::D3DGraphicsContext::getRenderPass, ngfx::VKGraphicsContext::getRenderPass

Public Attributes Documentation

variable device

Device * device;

variable numDrawCommandBuffers

uint32_t numDrawCommandBuffers = 0;

variable swapchainFramebuffers

std::vector< Framebuffer * > swapchainFramebuffers;

variable queue

Queue * queue = nullptr;

variable defaultRenderPass

RenderPass * defaultRenderPass = nullptr;

variable defaultOffscreenRenderPass

RenderPass * defaultOffscreenRenderPass = nullptr;

variable swapchain

Swapchain * swapchain = nullptr;

variable surface

Surface * surface = nullptr;

variable currentImageIndex

uint32_t currentImageIndex = 0;

variable frameFences

std::vector< Fence * > frameFences;

variable computeFence

Fence * computeFence = nullptr;

variable presentCompleteSemaphore

Semaphore * presentCompleteSemaphore = nullptr;

variable renderCompleteSemaphore

Semaphore * renderCompleteSemaphore = nullptr;

variable pipelineCache

PipelineCache * pipelineCache = nullptr;

variable surfaceFormat

PixelFormat surfaceFormat = PIXELFORMAT_UNDEFINED;

variable defaultOffscreenSurfaceFormat

PixelFormat defaultOffscreenSurfaceFormat = PIXELFORMAT_UNDEFINED;

variable depthFormat

PixelFormat depthFormat = PIXELFORMAT_UNDEFINED;

variable clearColor

glm::vec4 clearColor = glm::vec4(0.0f);

Protected Attributes Documentation

variable debug

bool debug = false;

variable enableDepthStencil

bool enableDepthStencil = false;

Updated on 3 April 2021 at 20:21:51 PDT