From da62c82d3f556942afc6767e20b6834608b3c8ae Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Wed, 8 Jan 2014 22:08:37 -0800 Subject: [PATCH] Cleanup. --- include/bgfx.h | 12 ++++++------ src/bgfx.cpp | 6 +++--- src/renderer_gl.cpp | 18 +++++++++--------- src/renderer_gl.h | 6 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/bgfx.h b/include/bgfx.h index 6ae2d7d1..59a975c3 100644 --- a/include/bgfx.h +++ b/include/bgfx.h @@ -355,7 +355,7 @@ namespace bgfx RGBA4, RGB5A1, RGB10A2, - + Count }; }; @@ -449,17 +449,17 @@ namespace bgfx /// Renderer backend type. RendererType::Enum rendererType; - /// Supported functionality, it includes emulated functionality. - /// Checking supported and not emulated will give functionality + /// Supported functionality, it includes emulated functionality. + /// Checking supported and not emulated will give functionality /// natively supported by renderer. uint64_t supported; - /// Emulated functionality. For example some texture compression + /// Emulated functionality. For example some texture compression /// modes are not natively supported by all renderers. The library /// internally decompresses texture into supported format. uint64_t emulated; - uint16_t maxTextureSize; ///< Maximum texture size. + uint16_t maxTextureSize; ///< Maximum texture size. uint16_t maxDrawCalls; ///< Maximum draw calls. }; @@ -628,7 +628,7 @@ namespace bgfx /// singlethreaded renderer this call does frame rendering. /// /// @returns Current frame number. This might be used in conjunction with - /// double/multi buffering data outside the library and passing it to + /// double/multi buffering data outside the library and passing it to /// library via makeRef calls. /// uint32_t frame(); diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 170cb4e6..b1ba0d78 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -34,7 +34,7 @@ namespace bgfx #elif BX_PLATFORM_OSX void* g_bgfxNSWindow = NULL; - + void osxSetNSWindow(void* _window) { g_bgfxNSWindow = _window; @@ -421,7 +421,7 @@ namespace bgfx uint32_t fg = palette[attr&0xf]; uint32_t bg = palette[(attr>>4)&0xf]; - Vertex vert[4] = + Vertex vert[4] = { { (xx )*8.0f, (yy )*fontHeight, 0.0f, fg, bg, (ch )*8.0f*texelWidth - texelWidthHalf, utop }, { (xx+1)*8.0f, (yy )*fontHeight, 0.0f, fg, bg, (ch+1)*8.0f*texelWidth - texelWidthHalf, utop }, @@ -616,7 +616,7 @@ namespace bgfx m_sortValues[m_num] = m_numRenderStates; ++m_num; } - + m_state.m_constEnd = m_constantBuffer->getPos(); m_state.m_flags |= m_flags; m_renderState[m_numRenderStates] = m_state; diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index c5d7f3a3..8d6bb743 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -729,7 +729,7 @@ namespace bgfx GLenum minFilter = s_textureFilterMin[min][1 < _numMips ? mip+1 : 0]; GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, s_textureFilterMag[mag]) ); GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, minFilter) ); - if (0 != (_flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) ) + if (0 != (_flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) ) && 0.0f < m_maxAnisotropy) { GL_CHECK(glSamplerParameterf(sampler, GL_TEXTURE_MAX_ANISOTROPY_EXT, m_maxAnisotropy) ); @@ -1748,7 +1748,7 @@ namespace bgfx GLenum minFilter = s_textureFilterMin[min][1 < numMips ? mip+1 : 0]; GL_CHECK(glTexParameteri(target, GL_TEXTURE_MAG_FILTER, s_textureFilterMag[mag]) ); GL_CHECK(glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter) ); - if (0 != (flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) ) + if (0 != (flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) ) && 0.0f < s_renderCtx->m_maxAnisotropy) { GL_CHECK(glTexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, s_renderCtx->m_maxAnisotropy) ); @@ -1992,7 +1992,7 @@ namespace bgfx { m_color.createColor(colorFormat, _width, _height, minFilter, magFilter); } - + #if 0 // GLES can't create texture with depth texture format... if (0 < depthFormat) { @@ -2018,7 +2018,7 @@ namespace bgfx , GL_RENDERBUFFER , m_colorRbo ) ); - + GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_fbo[1]) ); } else @@ -2177,7 +2177,7 @@ namespace bgfx GL_CHECK(glUniform##_glsuffix(loc, num, value) ); \ } \ break; - + #define CASE_IMPLEMENT_UNIFORM_T(_uniform, _glsuffix, _dxsuffix, _type) \ case UniformType::_uniform: \ { \ @@ -2537,7 +2537,7 @@ namespace bgfx { len = bx::uint32_min(sizeof(name), (uint32_t)strlen(pos) ); } - + strncpy(name, pos, len); name[len] = '\0'; @@ -2703,7 +2703,7 @@ namespace bgfx s_textureFormat[TextureFormat::BGRA8].m_fmt = GL_BGRA_EXT; // Mixing GLES and GL extensions here. OpenGL EXT_bgra wants - // format to be BGRA but internal format to stay RGBA, but + // format to be BGRA but internal format to stay RGBA, but // EXT_texture_format_BGRA8888 wants both format and internal // format to be BGRA. // @@ -3273,8 +3273,8 @@ namespace bgfx programIdx = key.m_program; GLuint id = invalidHandle == programIdx ? 0 : s_renderCtx->m_program[programIdx].m_id; GL_CHECK(glUseProgram(id) ); - programChanged = - constantsChanged = + programChanged = + constantsChanged = bindAttribs = true; } diff --git a/src/renderer_gl.h b/src/renderer_gl.h index cc66a56d..901d600d 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -332,7 +332,7 @@ namespace bgfx void dumpExtensions(const char* _extensions); class ConstantBuffer; - + class VaoStateCache { public: @@ -501,7 +501,7 @@ namespace bgfx uint32_t m_size; VaoCacheRef m_vcref; }; - + struct VertexBuffer { void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle) @@ -636,7 +636,7 @@ namespace bgfx { m_constantBuffer->commit(); } - + void add(uint32_t _hash) { m_vcref.add(_hash);