2012-07-23 00:08:58 -04:00
|
|
|
/*
|
2014-02-11 01:07:04 -05:00
|
|
|
* Copyright 2011-2014 Branimir Karadzic. All rights reserved.
|
2012-07-23 00:08:58 -04:00
|
|
|
* License: http://www.opensource.org/licenses/BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "bgfx_p.h"
|
|
|
|
|
|
|
|
#if BGFX_CONFIG_RENDERER_NULL
|
|
|
|
|
|
|
|
namespace bgfx
|
|
|
|
{
|
2014-05-26 17:09:26 -04:00
|
|
|
struct RendererContextNULL : public RendererContextI
|
2012-07-23 00:08:58 -04:00
|
|
|
{
|
2014-05-26 17:09:26 -04:00
|
|
|
RendererContextNULL()
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
~RendererContextNULL()
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
RendererType::Enum getRendererType() const BX_OVERRIDE
|
|
|
|
{
|
|
|
|
return RendererType::Null;
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
const char* getRendererName() const BX_OVERRIDE
|
|
|
|
{
|
|
|
|
return BGFX_RENDERER_NULL_NAME;
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void flip() BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyIndexBuffer(IndexBufferHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createVertexDecl(VertexDeclHandle /*_handle*/, const VertexDecl& /*_decl*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyVertexDecl(VertexDeclHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyVertexBuffer(VertexBufferHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void updateDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_offset*/, uint32_t /*_size*/, Memory* /*_mem*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyDynamicIndexBuffer(IndexBufferHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void updateDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_offset*/, uint32_t /*_size*/, Memory* /*_mem*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyDynamicVertexBuffer(VertexBufferHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createShader(ShaderHandle /*_handle*/, Memory* /*_mem*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyShader(ShaderHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createProgram(ProgramHandle /*_handle*/, ShaderHandle /*_vsh*/, ShaderHandle /*_fsh*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyProgram(ProgramHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createTexture(TextureHandle /*_handle*/, Memory* /*_mem*/, uint32_t /*_flags*/, uint8_t /*_skip*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void updateTextureBegin(TextureHandle /*_handle*/, uint8_t /*_side*/, uint8_t /*_mip*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void updateTexture(TextureHandle /*_handle*/, uint8_t /*_side*/, uint8_t /*_mip*/, const Rect& /*_rect*/, uint16_t /*_z*/, uint16_t /*_depth*/, uint16_t /*_pitch*/, const Memory* /*_mem*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void updateTextureEnd() BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2013-03-03 00:35:09 -05:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyTexture(TextureHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-08-13 00:02:11 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createFrameBuffer(FrameBufferHandle /*_handle*/, uint8_t /*_num*/, const TextureHandle* /*_textureHandles*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2013-03-03 00:35:09 -05:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyFrameBuffer(FrameBufferHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void createUniform(UniformHandle /*_handle*/, UniformType::Enum /*_type*/, uint16_t /*_num*/, const char* /*_name*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void destroyUniform(UniformHandle /*_handle*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void saveScreenShot(const char* /*_filePath*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void updateViewName(uint8_t /*_id*/, const char* /*_name*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void updateUniform(uint16_t /*_loc*/, const void* /*_data*/, uint32_t /*_size*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
2013-06-09 18:28:25 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void setMarker(const char* /*_marker*/, uint32_t /*_size*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void submit(Frame* /*_render*/, ClearQuad& /*_clearQuad*/, TextVideoMemBlitter& /*_textVideoMemBlitter*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void blitSetup(TextVideoMemBlitter& /*_blitter*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void blitRender(TextVideoMemBlitter& /*_blitter*/, uint32_t /*_numIndices*/) BX_OVERRIDE
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static RendererContextNULL* s_renderNULL;
|
|
|
|
|
|
|
|
RendererContextI* rendererCreateNULL()
|
2012-07-23 00:08:58 -04:00
|
|
|
{
|
2014-05-26 17:09:26 -04:00
|
|
|
s_renderNULL = BX_NEW(g_allocator, RendererContextNULL);
|
|
|
|
return s_renderNULL;
|
2012-07-23 00:08:58 -04:00
|
|
|
}
|
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void rendererDestroyNULL()
|
2012-07-23 00:08:58 -04:00
|
|
|
{
|
2014-05-26 17:09:26 -04:00
|
|
|
BX_DELETE(g_allocator, s_renderNULL);
|
|
|
|
s_renderNULL = NULL;
|
2012-07-23 00:08:58 -04:00
|
|
|
}
|
2014-05-26 17:09:26 -04:00
|
|
|
} // namespace bgfx
|
|
|
|
|
|
|
|
#else
|
2012-07-23 00:08:58 -04:00
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
namespace bgfx
|
|
|
|
{
|
|
|
|
RendererContextI* rendererCreateNULL()
|
2013-06-11 01:41:03 -04:00
|
|
|
{
|
2014-05-26 17:09:26 -04:00
|
|
|
return NULL;
|
2013-06-11 01:41:03 -04:00
|
|
|
}
|
|
|
|
|
2014-05-26 17:09:26 -04:00
|
|
|
void rendererDestroyNULL()
|
2012-07-23 00:08:58 -04:00
|
|
|
{
|
|
|
|
}
|
2014-05-26 17:09:26 -04:00
|
|
|
} // namespace bgfx
|
2012-07-23 00:08:58 -04:00
|
|
|
|
|
|
|
#endif // BGFX_CONFIG_RENDERER_NULL
|