Browse Source

Nothing to see here.

pull/638/head
Vladimír Vondruš 2 years ago
parent
commit
13ee03868e
  1. 7
      src/Magnum/British.h
  2. 18
      src/Magnum/GL/AbstractFramebuffer.h
  3. 8
      src/Magnum/GL/DefaultFramebuffer.h
  4. 4
      src/Magnum/GL/Framebuffer.h
  5. 21
      src/Magnum/GL/Renderer.h
  6. 58
      src/Magnum/Test/BritishTest.cpp
  7. 7
      src/Magnum/Test/CMakeLists.txt

7
src/Magnum/British.h

@ -25,7 +25,12 @@
DEALINGS IN THE SOFTWARE.
*/
/* You bloody hell better not tell anybody you bumped into this, aye? Ta! */
/* You bloody hell better not tell anybody you bumped into this, aye? Ta!
This file, and everything wrapped in #ifdef Magnum_British_h, is only
allowed to be edited on April 1st. I don't make the rules. All such changes
should also be ABI-independent, so it's effectively limited to enum aliases
and typedefs. */
#include "Magnum/Magnum.h"

18
src/Magnum/GL/AbstractFramebuffer.h

@ -45,9 +45,12 @@ namespace Magnum { namespace GL {
@m_enum_values_as_keywords
*/
enum class FramebufferClear: GLbitfield {
Color = GL_COLOR_BUFFER_BIT, /**< Color buffer */
Depth = GL_DEPTH_BUFFER_BIT, /**< Depth buffer */
Stencil = GL_STENCIL_BUFFER_BIT /**< Stencil buffer */
Color = GL_COLOR_BUFFER_BIT, /**< Color buffer */
Depth = GL_DEPTH_BUFFER_BIT, /**< Depth buffer */
Stencil = GL_STENCIL_BUFFER_BIT, /**< Stencil buffer */
#ifdef Magnum_British_h
Colour = Color
#endif
};
/**
@ -74,9 +77,12 @@ typedef Containers::EnumSet<FramebufferClear> FramebufferClearMask;
@requires_webgl20 Framebuffer blit is not available in WebGL 1.0.
*/
enum class FramebufferBlit: GLbitfield {
Color = GL_COLOR_BUFFER_BIT, /**< Color buffer */
Depth = GL_DEPTH_BUFFER_BIT, /**< Depth buffer */
Stencil = GL_STENCIL_BUFFER_BIT /**< Stencil buffer */
Color = GL_COLOR_BUFFER_BIT, /**< Color buffer */
Depth = GL_DEPTH_BUFFER_BIT, /**< Depth buffer */
Stencil = GL_STENCIL_BUFFER_BIT, /**< Stencil buffer */
#ifdef Magnum_British_h
Colour = Color
#endif
};
/**

8
src/Magnum/GL/DefaultFramebuffer.h

@ -301,9 +301,13 @@ class MAGNUM_GL_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
/** Invalidate stencil buffer. */
#ifndef MAGNUM_TARGET_GLES2
Stencil = GL_STENCIL
Stencil = GL_STENCIL,
#else
Stencil = GL_STENCIL_EXT
Stencil = GL_STENCIL_EXT,
#endif
#ifdef Magnum_British_h
Colour = Color
#endif
};
#endif

4
src/Magnum/GL/Framebuffer.h

@ -146,6 +146,10 @@ class MAGNUM_GL_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractO
GLenum attachment;
};
#ifdef Magnum_British_h
typedef ColorAttachment ColurAttachment;
#endif
/**
* @brief Draw attachment
*

21
src/Magnum/GL/Renderer.h

@ -1667,7 +1667,13 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_webgl_extension Extension
* @webgl_extension{WEBGL,blend_equation_advanced_coherent}
*/
HslLuminosity = GL_HSL_LUMINOSITY_KHR
HslLuminosity = GL_HSL_LUMINOSITY_KHR,
#ifdef Magnum_British_h
ColourDodge = ColorDodge,
ColourBurn = ColorBurn,
HslColour = HslColor
#endif
};
/**
@ -1812,7 +1818,18 @@ class MAGNUM_GL_EXPORT Renderer {
/**
* One minus source alpha (@f$ RGB = (1.0 - A_d, 1.0 - A_d, 1.0 - A_d); A = 1.0 - A_d @f$)
*/
OneMinusDestinationAlpha = GL_ONE_MINUS_DST_ALPHA
OneMinusDestinationAlpha = GL_ONE_MINUS_DST_ALPHA,
#ifdef Magnum_British_h
ConstantColour = ConstantColor,
OneMinusConstantColour = OneMinusConstantColor,
SourceColour = SourceColor,
SecondSourceColour = SecondSourceColor,
OneMinusSourceColour = OneMinusSourceColor,
OneMinusSecondSourceColour = OneMinusSecondSourceColor,
DestinationColour = DestinationColor,
OneMinusDestinationColour = OneMinusDestinationColor
#endif
};
/**

58
src/Magnum/Test/BritishTest.cpp

@ -0,0 +1,58 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
2020, 2021, 2022, 2023 Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/TestSuite/Tester.h>
#include "Magnum/British.h"
/* Include all files with functionality wrapped in #ifdef Magnum_British_h
here. As all such code should be limited to enum aliases and typedefs, it
should be enough to verify it parses correctly. */
#include "Magnum/Math/Color.h"
#ifdef MAGNUM_TARGET_GL
#include "Magnum/GL/DefaultFramebuffer.h"
#include "Magnum/GL/Framebuffer.h"
#include "Magnum/GL/Renderer.h"
#endif
namespace Magnum { namespace Test { namespace {
struct BritishTest: TestSuite::Tester {
explicit BritishTest();
void cheers();
};
BritishTest::BritishTest() {
addTests({&BritishTest::cheers});
}
void BritishTest::cheers() {
Colour3 colour;
CORRADE_COMPARE(colour.r(), 0.0f);
}
}}}
CORRADE_TEST_MAIN(Magnum::Test::BritishTest)

7
src/Magnum/Test/CMakeLists.txt

@ -29,6 +29,13 @@ set(CMAKE_FOLDER "Magnum/Test")
find_package(Corrade REQUIRED PluginManager)
corrade_add_test(BritishTest BritishTest.cpp LIBRARIES Magnum)
# Just to have the GL headers pulled in correctly. Shouldn't be needed in most
# cases as the headers are self-contained in MagnumExternal, but some platforms
# such as iOS may disagree.
if(MAGNUM_TARGET_GL)
target_link_libraries(BritishTest PRIVATE MagnumGL)
endif()
corrade_add_test(ConverterUtilitiesTest ConverterUtilitiesTest.cpp LIBRARIES Magnum Corrade::PluginManager)
corrade_add_test(FileCallbackTest FileCallbackTest.cpp LIBRARIES Magnum)
corrade_add_test(ImageTest ImageTest.cpp LIBRARIES MagnumTestLib)

Loading…
Cancel
Save