Renamed null renderer to noop.

This commit is contained in:
Branimir Karadžić 2016-09-24 08:35:31 -07:00
parent 55dc1e2168
commit 9f53d33e80
5 changed files with 23 additions and 23 deletions

View File

@ -16,7 +16,7 @@
#include "renderer_d3d9.cpp"
#include "renderer_d3d11.cpp"
#include "renderer_d3d12.cpp"
#include "renderer_null.cpp"
#include "renderer_noop.cpp"
#include "renderer_gl.cpp"
#include "renderer_vk.cpp"
#include "renderer_gnm.cpp"

View File

@ -1767,14 +1767,14 @@ namespace bgfx
static RendererCreator s_rendererCreator[] =
{
{ noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NULL_NAME, !!BGFX_CONFIG_RENDERER_NULL }, // Noop
{ noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NOOP_NAME, !!BGFX_CONFIG_RENDERER_NOOP }, // Noop
{ d3d9::rendererCreate, d3d9::rendererDestroy, BGFX_RENDERER_DIRECT3D9_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D9 }, // Direct3D9
{ d3d11::rendererCreate, d3d11::rendererDestroy, BGFX_RENDERER_DIRECT3D11_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D11 }, // Direct3D11
{ d3d12::rendererCreate, d3d12::rendererDestroy, BGFX_RENDERER_DIRECT3D12_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D12 }, // Direct3D12
#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
{ mtl::rendererCreate, mtl::rendererDestroy, BGFX_RENDERER_METAL_NAME, !!BGFX_CONFIG_RENDERER_METAL }, // Metal
#else
{ noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NULL_NAME, !!BGFX_CONFIG_RENDERER_NULL }, // Noop
{ noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NOOP_NAME, !!BGFX_CONFIG_RENDERER_NOOP }, // Noop
#endif // BX_PLATFORM_OSX || BX_PLATFORM_IOS
{ gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGLES }, // OpenGLES
{ gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGL }, // OpenGL
@ -1782,7 +1782,7 @@ namespace bgfx
#if BX_PLATFORM_PS4
{ gnm::rendererCreate, gnm::rendererDestroy, BGFX_RENDERER_GNM_NAME, !!BGFX_CONFIG_RENDERER_GNM }, // GNM
#else
{ noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NULL_NAME, !!BGFX_CONFIG_RENDERER_NULL }, // Noop
{ noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NOOP_NAME, !!BGFX_CONFIG_RENDERER_NOOP }, // Noop
#endif // BX_PLATFORM_PS4
};
BX_STATIC_ASSERT(BX_COUNTOF(s_rendererCreator) == RendererType::Count);

View File

@ -221,7 +221,7 @@ namespace stl
#define BGFX_RENDERER_METAL_NAME "Metal"
#define BGFX_RENDERER_VULKAN_NAME "Vulkan"
#define BGFX_RENDERER_GNM_NAME "GNM"
#define BGFX_RENDERER_NULL_NAME "NULL"
#define BGFX_RENDERER_NOOP_NAME "Noop"
#if BGFX_CONFIG_RENDERER_OPENGL
# if BGFX_CONFIG_RENDERER_OPENGL >= 31 && BGFX_CONFIG_RENDERER_OPENGL <= 33

View File

@ -20,7 +20,7 @@
&& !defined(BGFX_CONFIG_RENDERER_OPENGLES) \
&& !defined(BGFX_CONFIG_RENDERER_VULKAN) \
&& !defined(BGFX_CONFIG_RENDERER_GNM) \
&& !defined(BGFX_CONFIG_RENDERER_NULL)
&& !defined(BGFX_CONFIG_RENDERER_NOOP)
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
# define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \
@ -80,8 +80,8 @@
# define BGFX_CONFIG_RENDERER_GNM 0
# endif // BGFX_CONFIG_RENDERER_GNM
# ifndef BGFX_CONFIG_RENDERER_NULL
# define BGFX_CONFIG_RENDERER_NULL (!(0 \
# ifndef BGFX_CONFIG_RENDERER_NOOP
# define BGFX_CONFIG_RENDERER_NOOP (!(0 \
|| BGFX_CONFIG_RENDERER_DIRECT3D9 \
|| BGFX_CONFIG_RENDERER_DIRECT3D11 \
|| BGFX_CONFIG_RENDERER_DIRECT3D12 \
@ -91,7 +91,7 @@
|| BGFX_CONFIG_RENDERER_VULKAN \
|| BGFX_CONFIG_RENDERER_GNM \
? 1 : 0) )
# endif // BGFX_CONFIG_RENDERER_NULL
# endif // BGFX_CONFIG_RENDERER_NOOP
#else
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
# define BGFX_CONFIG_RENDERER_DIRECT3D9 0
@ -125,9 +125,9 @@
# define BGFX_CONFIG_RENDERER_GNM 0
# endif // BGFX_CONFIG_RENDERER_GNM
# ifndef BGFX_CONFIG_RENDERER_NULL
# define BGFX_CONFIG_RENDERER_NULL 0
# endif // BGFX_CONFIG_RENDERER_NULL
# ifndef BGFX_CONFIG_RENDERER_NOOP
# define BGFX_CONFIG_RENDERER_NOOP 0
# endif // BGFX_CONFIG_RENDERER_NOOP
#endif // !defined...
#if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21

View File

@ -5,17 +5,17 @@
#include "bgfx_p.h"
#if BGFX_CONFIG_RENDERER_NULL
#if BGFX_CONFIG_RENDERER_NOOP
namespace bgfx { namespace noop
{
struct RendererContextNULL : public RendererContextI
struct RendererContextNOOP : public RendererContextI
{
RendererContextNULL()
RendererContextNOOP()
{
}
~RendererContextNULL()
~RendererContextNOOP()
{
}
@ -26,7 +26,7 @@ namespace bgfx { namespace noop
const char* getRendererName() const BX_OVERRIDE
{
return BGFX_RENDERER_NULL_NAME;
return BGFX_RENDERER_NOOP_NAME;
}
void flip(HMD& /*_hmd*/) BX_OVERRIDE
@ -183,18 +183,18 @@ namespace bgfx { namespace noop
}
};
static RendererContextNULL* s_renderNULL;
static RendererContextNOOP* s_renderNOOP;
RendererContextI* rendererCreate()
{
s_renderNULL = BX_NEW(g_allocator, RendererContextNULL);
return s_renderNULL;
s_renderNOOP = BX_NEW(g_allocator, RendererContextNOOP);
return s_renderNOOP;
}
void rendererDestroy()
{
BX_DELETE(g_allocator, s_renderNULL);
s_renderNULL = NULL;
BX_DELETE(g_allocator, s_renderNOOP);
s_renderNOOP = NULL;
}
} /* namespace noop */ } // namespace bgfx
@ -212,4 +212,4 @@ namespace bgfx { namespace noop
}
} /* namespace noop */ } // namespace bgfx
#endif // BGFX_CONFIG_RENDERER_NULL
#endif // BGFX_CONFIG_RENDERER_NOOP