Browse Source

Platform: default to 32-bit RGBA framebuffer instead of 24-bit RGB.

macOS and Android is known to degrade 24-bit to 16-bit colors, this
prevents them from doing that.
pull/434/head
Vladimír Vondruš 6 years ago
parent
commit
e6dc5be1af
  1. 5
      doc/changelog.dox
  2. 2
      src/Magnum/Platform/AndroidApplication.cpp
  3. 2
      src/Magnum/Platform/AndroidApplication.h
  4. 2
      src/Magnum/Platform/EmscriptenApplication.cpp
  5. 2
      src/Magnum/Platform/EmscriptenApplication.h
  6. 2
      src/Magnum/Platform/GlfwApplication.cpp
  7. 2
      src/Magnum/Platform/GlfwApplication.h
  8. 2
      src/Magnum/Platform/Sdl2Application.cpp
  9. 2
      src/Magnum/Platform/Sdl2Application.h

5
doc/changelog.dox

@ -374,6 +374,11 @@ See also:
- Calling @ref Platform::Sdl2Application::exit() "Platform::*Application::exit()" - Calling @ref Platform::Sdl2Application::exit() "Platform::*Application::exit()"
directly in the application constructor will now make it exit right after directly in the application constructor will now make it exit right after
constructor finished, without any event processing (see [mosra/magnum#429](https://github.com/mosra/magnum/issues/429)) constructor finished, without any event processing (see [mosra/magnum#429](https://github.com/mosra/magnum/issues/429))
- @ref Platform::AndroidApplication, @ref Platform::EmscriptenApplication,
@ref Platform::GlfwApplication and @ref Platform::Sdl2Application now
default to 32-bit RGBA color buffer instead of 24-bit RGB, to avoid the
framebuffer degrading to 16-bit colors on some platforms (see
[mosra/magnum-integration#59](https://github.com/mosra/magnum-integration/issues/59))
@subsubsection changelog-latest-changes-trade Trade library @subsubsection changelog-latest-changes-trade Trade library

2
src/Magnum/Platform/AndroidApplication.cpp

@ -277,7 +277,7 @@ std::int32_t AndroidApplication::inputEvent(android_app* state, AInputEvent* eve
} }
AndroidApplication::GLConfiguration::GLConfiguration(): AndroidApplication::GLConfiguration::GLConfiguration():
_colorBufferSize{8, 8, 8, 0}, _depthBufferSize{24}, _stencilBufferSize{0} {} _colorBufferSize{8, 8, 8, 8}, _depthBufferSize{24}, _stencilBufferSize{0} {}
void AndroidApplication::exec(android_app* state, Containers::Pointer<AndroidApplication>(*instancer)(const Arguments&)) { void AndroidApplication::exec(android_app* state, Containers::Pointer<AndroidApplication>(*instancer)(const Arguments&)) {
state->onAppCmd = commandEvent; state->onAppCmd = commandEvent;

2
src/Magnum/Platform/AndroidApplication.h

@ -475,7 +475,7 @@ class AndroidApplication::GLConfiguration {
/** /**
* @brief Set color buffer size * @brief Set color buffer size
* *
* Default is @cpp {8, 8, 8, 0} @ce (8-bit-per-channel RGB, no alpha). * Default is @cpp {8, 8, 8, 8} @ce (8-bit-per-channel RGBA).
* @see @ref setDepthBufferSize(), @ref setStencilBufferSize() * @see @ref setDepthBufferSize(), @ref setStencilBufferSize()
*/ */
GLConfiguration& setColorBufferSize(const Vector4i& size) { GLConfiguration& setColorBufferSize(const Vector4i& size) {

2
src/Magnum/Platform/EmscriptenApplication.cpp

@ -692,7 +692,7 @@ void EmscriptenApplication::textInputEvent(TextInputEvent&) {}
#ifdef MAGNUM_TARGET_GL #ifdef MAGNUM_TARGET_GL
EmscriptenApplication::GLConfiguration::GLConfiguration(): EmscriptenApplication::GLConfiguration::GLConfiguration():
_colorBufferSize{8, 8, 8, 0}, _depthBufferSize{24}, _stencilBufferSize{0} {} _colorBufferSize{8, 8, 8, 8}, _depthBufferSize{24}, _stencilBufferSize{0} {}
#endif #endif
int EmscriptenApplication::exec() { int EmscriptenApplication::exec() {

2
src/Magnum/Platform/EmscriptenApplication.h

@ -1043,7 +1043,7 @@ class EmscriptenApplication::GLConfiguration {
/** /**
* @brief Set color buffer size * @brief Set color buffer size
* *
* Default is @cpp {8, 8, 8, 0} @ce (8-bit-per-channel RGB, no alpha). * Default is @cpp {8, 8, 8, 8} @ce (8-bit-per-channel RGBA).
* @see @ref setDepthBufferSize(), @ref setStencilBufferSize() * @see @ref setDepthBufferSize(), @ref setStencilBufferSize()
*/ */
GLConfiguration& setColorBufferSize(const Vector4i& size) { GLConfiguration& setColorBufferSize(const Vector4i& size) {

2
src/Magnum/Platform/GlfwApplication.cpp

@ -875,7 +875,7 @@ void GlfwApplication::stopTextInput() {
#ifdef MAGNUM_TARGET_GL #ifdef MAGNUM_TARGET_GL
GlfwApplication::GLConfiguration::GLConfiguration(): GlfwApplication::GLConfiguration::GLConfiguration():
_colorBufferSize{8, 8, 8, 0}, _depthBufferSize{24}, _stencilBufferSize{0}, _colorBufferSize{8, 8, 8, 8}, _depthBufferSize{24}, _stencilBufferSize{0},
_sampleCount{0}, _version{GL::Version::None}, _sampleCount{0}, _version{GL::Version::None},
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_flags{Flag::ForwardCompatible}, _flags{Flag::ForwardCompatible},

2
src/Magnum/Platform/GlfwApplication.h

@ -884,7 +884,7 @@ class GlfwApplication::GLConfiguration {
/** /**
* @brief Set color buffer size * @brief Set color buffer size
* *
* Default is @cpp {8, 8, 8, 0} @ce (8-bit-per-channel RGB, no alpha). * Default is @cpp {8, 8, 8, 8} @ce (8-bit-per-channel RGBA).
* @see @ref setDepthBufferSize(), @ref setStencilBufferSize() * @see @ref setDepthBufferSize(), @ref setStencilBufferSize()
*/ */
GLConfiguration& setColorBufferSize(const Vector4i& size) { GLConfiguration& setColorBufferSize(const Vector4i& size) {

2
src/Magnum/Platform/Sdl2Application.cpp

@ -1170,7 +1170,7 @@ void Sdl2Application::textEditingEvent(TextEditingEvent&) {}
#ifdef MAGNUM_TARGET_GL #ifdef MAGNUM_TARGET_GL
Sdl2Application::GLConfiguration::GLConfiguration(): Sdl2Application::GLConfiguration::GLConfiguration():
_colorBufferSize{8, 8, 8, 0}, _depthBufferSize{24}, _stencilBufferSize{0}, _colorBufferSize{8, 8, 8, 8}, _depthBufferSize{24}, _stencilBufferSize{0},
_sampleCount(0) _sampleCount(0)
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
, _version(GL::Version::None), , _version(GL::Version::None),

2
src/Magnum/Platform/Sdl2Application.h

@ -1369,7 +1369,7 @@ class Sdl2Application::GLConfiguration {
/** /**
* @brief Set color buffer size * @brief Set color buffer size
* *
* Default is @cpp {8, 8, 8, 0} @ce (8-bit-per-channel RGB, no alpha). * Default is @cpp {8, 8, 8, 8} @ce (8-bit-per-channel RGBA).
* @see @ref setDepthBufferSize(), @ref setStencilBufferSize() * @see @ref setDepthBufferSize(), @ref setStencilBufferSize()
*/ */
GLConfiguration& setColorBufferSize(const Vector4i& size) { GLConfiguration& setColorBufferSize(const Vector4i& size) {

Loading…
Cancel
Save