Browse Source

Platform: multisampling support in NaClApplication.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
ad8f35c89e
  1. 6
      src/Platform/NaClApplication.cpp
  2. 16
      src/Platform/NaClApplication.h

6
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;
}}

16
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;
};
/**

Loading…
Cancel
Save