diff --git a/src/Platform/NaClApplication.cpp b/src/Platform/NaClApplication.cpp index 6e7509b2d..4b82e6e6f 100644 --- a/src/Platform/NaClApplication.cpp +++ b/src/Platform/NaClApplication.cpp @@ -49,8 +49,8 @@ void NaClApplication::createContext(NaClApplication::Configuration* configuratio PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8, PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24, PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8, - PP_GRAPHICS3DATTRIB_SAMPLES, 0, - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0, + PP_GRAPHICS3DATTRIB_SAMPLES, configuration->sampleCount(), + PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, configuration->sampleCount() > 1? 1 : 0, PP_GRAPHICS3DATTRIB_WIDTH, configuration->size().x(), PP_GRAPHICS3DATTRIB_HEIGHT, configuration->size().y(), PP_GRAPHICS3DATTRIB_NONE @@ -223,7 +223,7 @@ void NaClApplication::mouseLockCallback(void* applicationInstance, std::int32_t) instance->flags |= Flag::MouseLocked; } -NaClApplication::Configuration::Configuration(): _size(640, 480) {} +NaClApplication::Configuration::Configuration(): _size(640, 480), _sampleCount(0) {} NaClApplication::Configuration::~Configuration() = default; }} diff --git a/src/Platform/NaClApplication.h b/src/Platform/NaClApplication.h index f44ff896e..46419c989 100644 --- a/src/Platform/NaClApplication.h +++ b/src/Platform/NaClApplication.h @@ -271,8 +271,24 @@ class NaClApplication::Configuration { return this; } + /** @brief Sample count */ + inline Int sampleCount() const { return _sampleCount; } + + /** + * @brief Set sample count + * @return Pointer to self (for method chaining) + * + * Default is `0`, thus no multisampling. See also + * @ref Renderer::Feature "Renderer::Feature::Multisampling". + */ + inline Configuration* setSampleCount(Int count) { + _sampleCount = count; + return this; + } + private: Vector2i _size; + Int _sampleCount; }; /**