mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-20 22:03:12 +01:00
Cleanup.
This commit is contained in:
12
src/bgfx.cpp
12
src/bgfx.cpp
@@ -2407,7 +2407,7 @@ again:
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
BX_CHECK(NULL != _mem, "_mem can't be NULL");
|
||||
return s_ctx->createTexture(_mem, _flags, _skip, _info, BackbufferRatio::None);
|
||||
return s_ctx->createTexture(_mem, _flags, _skip, _info, BackbufferRatio::Count);
|
||||
}
|
||||
|
||||
void getTextureSizeFromRatio(BackbufferRatio::Enum _ratio, uint16_t& _width, uint16_t& _height)
|
||||
@@ -2453,7 +2453,7 @@ again:
|
||||
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
|
||||
bx::write(&writer, magic);
|
||||
|
||||
if (BackbufferRatio::None != _ratio)
|
||||
if (BackbufferRatio::Count != _ratio)
|
||||
{
|
||||
_width = uint16_t(s_ctx->m_frame->m_resolution.m_width);
|
||||
_height = uint16_t(s_ctx->m_frame->m_resolution.m_height);
|
||||
@@ -2477,11 +2477,12 @@ again:
|
||||
|
||||
TextureHandle createTexture2D(uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint32_t _flags, const Memory* _mem)
|
||||
{
|
||||
return createTexture2D(BackbufferRatio::None, _width, _height, _numMips, _format, _flags, _mem);
|
||||
return createTexture2D(BackbufferRatio::Count, _width, _height, _numMips, _format, _flags, _mem);
|
||||
}
|
||||
|
||||
TextureHandle createTexture2D(BackbufferRatio::Enum _ratio, uint8_t _numMips, TextureFormat::Enum _format, uint32_t _flags)
|
||||
{
|
||||
BX_CHECK(_ratio < BackbufferRatio::Count, "Invalid back buffer ratio.");
|
||||
return createTexture2D(_ratio, 0, 0, _numMips, _format, _flags, NULL);
|
||||
}
|
||||
|
||||
@@ -2523,7 +2524,7 @@ again:
|
||||
tc.m_mem = _mem;
|
||||
bx::write(&writer, tc);
|
||||
|
||||
return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::None);
|
||||
return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::Count);
|
||||
}
|
||||
|
||||
TextureHandle createTextureCube(uint16_t _size, uint8_t _numMips, TextureFormat::Enum _format, uint32_t _flags, const Memory* _mem)
|
||||
@@ -2563,7 +2564,7 @@ again:
|
||||
tc.m_mem = _mem;
|
||||
bx::write(&writer, tc);
|
||||
|
||||
return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::None);
|
||||
return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::Count);
|
||||
}
|
||||
|
||||
void destroyTexture(TextureHandle _handle)
|
||||
@@ -2628,6 +2629,7 @@ again:
|
||||
|
||||
FrameBufferHandle createFrameBuffer(BackbufferRatio::Enum _ratio, TextureFormat::Enum _format, uint32_t _textureFlags)
|
||||
{
|
||||
BX_CHECK(_ratio < BackbufferRatio::Count, "Invalid back buffer ratio.");
|
||||
_textureFlags |= _textureFlags&BGFX_TEXTURE_RT_MSAA_MASK ? 0 : BGFX_TEXTURE_RT;
|
||||
TextureHandle th = createTexture2D(_ratio, 1, _format, _textureFlags);
|
||||
return createFrameBuffer(1, &th, true);
|
||||
|
||||
Reference in New Issue
Block a user