mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Remove redundant parentheses
This commit is contained in:
parent
e6d4ee7ad1
commit
6f459bb14c
@ -37,7 +37,7 @@ namespace sf
|
||||
////////////////////////////////////////////////////////////
|
||||
AudioResource::AudioResource() :
|
||||
m_device(
|
||||
[]()
|
||||
[]
|
||||
{
|
||||
// Ensure we only ever create a single instance of an
|
||||
// AudioDevice that is shared between all AudioResources
|
||||
|
@ -66,7 +66,7 @@ namespace
|
||||
// Retrieve the maximum number of texture units available
|
||||
std::size_t getMaxTextureUnits()
|
||||
{
|
||||
static const GLint maxUnits = []()
|
||||
static const GLint maxUnits = []
|
||||
{
|
||||
GLint value = 0;
|
||||
glCheck(glGetIntegerv(GLEXT_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &value));
|
||||
@ -739,7 +739,7 @@ void Shader::bind(const Shader* shader)
|
||||
////////////////////////////////////////////////////////////
|
||||
bool Shader::isAvailable()
|
||||
{
|
||||
static const bool available = []()
|
||||
static const bool available = []
|
||||
{
|
||||
const TransientContextLock contextLock;
|
||||
|
||||
@ -757,7 +757,7 @@ bool Shader::isAvailable()
|
||||
////////////////////////////////////////////////////////////
|
||||
bool Shader::isGeometryAvailable()
|
||||
{
|
||||
static const bool available = []()
|
||||
static const bool available = []
|
||||
{
|
||||
const TransientContextLock contextLock;
|
||||
|
||||
|
@ -916,7 +916,7 @@ void Texture::bind(const Texture* texture, CoordinateType coordinateType)
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int Texture::getMaximumSize()
|
||||
{
|
||||
static const unsigned int size = []()
|
||||
static const unsigned int size = []
|
||||
{
|
||||
const TransientContextLock transientLock;
|
||||
|
||||
|
@ -333,14 +333,14 @@ VertexBuffer::Usage VertexBuffer::getUsage() const
|
||||
////////////////////////////////////////////////////////////
|
||||
bool VertexBuffer::isAvailable()
|
||||
{
|
||||
static const bool available = []() -> bool
|
||||
static const bool available = []
|
||||
{
|
||||
const TransientContextLock contextLock;
|
||||
|
||||
// Make sure that extensions are initialized
|
||||
sf::priv::ensureExtensionsInit();
|
||||
|
||||
return GLEXT_vertex_buffer_object;
|
||||
return GLEXT_vertex_buffer_object != 0;
|
||||
}();
|
||||
|
||||
return available;
|
||||
|
@ -87,7 +87,7 @@ void ensureInit()
|
||||
static std::once_flag flag;
|
||||
|
||||
std::call_once(flag,
|
||||
[]()
|
||||
[]
|
||||
{
|
||||
if (!gladLoaderLoadEGL(EGL_NO_DISPLAY))
|
||||
{
|
||||
|
@ -461,7 +461,7 @@ struct GlContext::Impl
|
||||
////////////////////////////////////////////////////////////
|
||||
std::shared_ptr<UnsharedGlObjects> unsharedGlObjects; //!< The current object's handle to unshared objects
|
||||
const std::uint64_t id{
|
||||
[]()
|
||||
[]
|
||||
{
|
||||
static std::atomic<std::uint64_t> atomicId(1); // start at 1, zero is "no context"
|
||||
return atomicId.fetch_add(1);
|
||||
|
@ -210,7 +210,7 @@ void WindowBase::setMinimumSize(const std::optional<Vector2u>& minimumSize)
|
||||
{
|
||||
if (m_impl)
|
||||
{
|
||||
[[maybe_unused]] const auto validateMinimumSize = [this, minimumSize]()
|
||||
[[maybe_unused]] const auto validateMinimumSize = [this, minimumSize]
|
||||
{
|
||||
if (!minimumSize.has_value() || !m_impl->getMaximumSize().has_value())
|
||||
return true;
|
||||
@ -229,7 +229,7 @@ void WindowBase::setMaximumSize(const std::optional<Vector2u>& maximumSize)
|
||||
{
|
||||
if (m_impl)
|
||||
{
|
||||
[[maybe_unused]] const auto validateMaxiumSize = [this, maximumSize]()
|
||||
[[maybe_unused]] const auto validateMaxiumSize = [this, maximumSize]
|
||||
{
|
||||
if (!maximumSize.has_value() || !m_impl->getMinimumSize().has_value())
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user