Fixed compile error (trailing enum comma) and other minor things
This commit is contained in:
parent
fe7d6f513d
commit
05d196d86d
4 changed files with 37 additions and 33 deletions
|
@ -1,7 +1,7 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
@ -26,7 +26,6 @@
|
|||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics/BlendMode.hpp>
|
||||
#include <SFML/Graphics/GLCheck.hpp>
|
||||
|
||||
|
||||
namespace sf
|
||||
|
@ -58,14 +57,14 @@ alphaEquation (BlendMode::Add)
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
BlendMode::BlendMode(BlendFactor colorSourceFactor, BlendFactor colorDstFactor,
|
||||
BlendMode::BlendMode(BlendFactor colorSourceFactor, BlendFactor colorDestinationFactor,
|
||||
BlendEquation colorBlendEquation, BlendFactor alphaSourceFactor,
|
||||
BlendFactor alphaDstFactor, BlendEquation alphaBlendEquation) :
|
||||
BlendFactor alphaDestinationFactor, BlendEquation alphaBlendEquation) :
|
||||
colorSrcFactor(colorSourceFactor),
|
||||
colorDstFactor(colorDstFactor),
|
||||
colorDstFactor(colorDestinationFactor),
|
||||
colorEquation (colorBlendEquation),
|
||||
alphaSrcFactor(alphaSourceFactor),
|
||||
alphaDstFactor(alphaDstFactor),
|
||||
alphaDstFactor(alphaDestinationFactor),
|
||||
alphaEquation (alphaBlendEquation)
|
||||
{
|
||||
|
||||
|
|
|
@ -388,22 +388,32 @@ void RenderTarget::applyCurrentView()
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void RenderTarget::applyBlendMode(BlendMode mode)
|
||||
void RenderTarget::applyBlendMode(const BlendMode& mode)
|
||||
{
|
||||
// Apply the blend mode, falling back to the non-separate versions if necessary
|
||||
if (GLEW_EXT_blend_func_separate)
|
||||
glCheck(glBlendFuncSeparateEXT(factorToGlConstant(mode.colorSrcFactor),
|
||||
factorToGlConstant(mode.colorDstFactor), factorToGlConstant(mode.alphaSrcFactor),
|
||||
factorToGlConstant(mode.alphaDstFactor)));
|
||||
{
|
||||
glCheck(glBlendFuncSeparateEXT(
|
||||
factorToGlConstant(mode.colorSrcFactor), factorToGlConstant(mode.colorDstFactor),
|
||||
factorToGlConstant(mode.alphaSrcFactor), factorToGlConstant(mode.alphaDstFactor)));
|
||||
}
|
||||
else
|
||||
glCheck(glBlendFunc(factorToGlConstant(mode.colorSrcFactor),
|
||||
{
|
||||
glCheck(glBlendFunc(
|
||||
factorToGlConstant(mode.colorSrcFactor),
|
||||
factorToGlConstant(mode.colorDstFactor)));
|
||||
}
|
||||
|
||||
if (GLEW_EXT_blend_equation_separate)
|
||||
glCheck(glBlendEquationSeparateEXT(equationToGlConstant(mode.colorEquation),
|
||||
{
|
||||
glCheck(glBlendEquationSeparateEXT(
|
||||
equationToGlConstant(mode.colorEquation),
|
||||
equationToGlConstant(mode.alphaEquation)));
|
||||
}
|
||||
else
|
||||
{
|
||||
glCheck(glBlendEquation(equationToGlConstant(mode.colorEquation)));
|
||||
}
|
||||
|
||||
m_cache.lastBlendMode = mode;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue