Browse Source

Merge branch 'master' into compatibility

Vladimír Vondruš 13 years ago
parent
commit
f6e6bc642d
  1. 6
      src/DebugTools/ForceRenderer.h
  2. 6
      src/DebugTools/ShapeRenderer.h
  3. 2
      src/Platform/GlutApplication.cpp
  4. 6
      src/Platform/NaClApplication.cpp
  5. 16
      src/Platform/NaClApplication.h
  6. 2
      src/Platform/Sdl2Application.cpp
  7. 6
      src/Shaders/FlatShader.frag
  8. 2
      src/Shaders/FlatShader.h

6
src/DebugTools/ForceRenderer.h

@ -47,7 +47,7 @@ class ForceRendererOptions {
inline constexpr ForceRendererOptions(): _size(1.0f) {} inline constexpr ForceRendererOptions(): _size(1.0f) {}
/** @brief Color of rendered arrow */ /** @brief Color of rendered arrow */
inline constexpr Color3<> color() const { return _color; } inline constexpr Color4<> color() const { return _color; }
/** /**
* @brief Set color of rendered arrow * @brief Set color of rendered arrow
@ -55,7 +55,7 @@ class ForceRendererOptions {
* *
* Default is black. * Default is black.
*/ */
inline ForceRendererOptions* setColor(const Color3<>& color) { inline ForceRendererOptions* setColor(const Color4<>& color) {
_color = color; _color = color;
return this; return this;
} }
@ -75,7 +75,7 @@ class ForceRendererOptions {
} }
private: private:
Color3<> _color; Color4<> _color;
Float _size; Float _size;
}; };

6
src/DebugTools/ShapeRenderer.h

@ -60,7 +60,7 @@ class ShapeRendererOptions {
inline constexpr ShapeRendererOptions(): _pointSize(0.25f) {} inline constexpr ShapeRendererOptions(): _pointSize(0.25f) {}
/** @brief Color of rendered shape */ /** @brief Color of rendered shape */
inline constexpr Color3<> color() const { return _color; } inline constexpr Color4<> color() const { return _color; }
/** /**
* @brief Set color of rendered shape * @brief Set color of rendered shape
@ -68,7 +68,7 @@ class ShapeRendererOptions {
* *
* Default is black. * Default is black.
*/ */
inline ShapeRendererOptions* setColor(const Color3<>& color) { inline ShapeRendererOptions* setColor(const Color4<>& color) {
_color = color; _color = color;
return this; return this;
} }
@ -89,7 +89,7 @@ class ShapeRendererOptions {
} }
private: private:
Color3<> _color; Color4<> _color;
Float _pointSize; Float _pointSize;
}; };

2
src/Platform/GlutApplication.cpp

@ -96,7 +96,7 @@ void GlutApplication::staticMouseMoveEvent(int x, int y) {
instance->mouseMoveEvent(e); instance->mouseMoveEvent(e);
} }
GlutApplication::Configuration::Configuration(): _title("Magnum GLUT Application"), _size(800, 600) {} GlutApplication::Configuration::Configuration(): _title("Magnum GLUT Application"), _size(800, 600), _sampleCount(0) {}
GlutApplication::Configuration::~Configuration() = default; GlutApplication::Configuration::~Configuration() = default;
}} }}

6
src/Platform/NaClApplication.cpp

@ -49,8 +49,8 @@ void NaClApplication::createContext(NaClApplication::Configuration* configuratio
PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8, PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8,
PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24, PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24,
PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8, PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8,
PP_GRAPHICS3DATTRIB_SAMPLES, 0, PP_GRAPHICS3DATTRIB_SAMPLES, configuration->sampleCount(),
PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0, PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, configuration->sampleCount() > 1? 1 : 0,
PP_GRAPHICS3DATTRIB_WIDTH, configuration->size().x(), PP_GRAPHICS3DATTRIB_WIDTH, configuration->size().x(),
PP_GRAPHICS3DATTRIB_HEIGHT, configuration->size().y(), PP_GRAPHICS3DATTRIB_HEIGHT, configuration->size().y(),
PP_GRAPHICS3DATTRIB_NONE PP_GRAPHICS3DATTRIB_NONE
@ -223,7 +223,7 @@ void NaClApplication::mouseLockCallback(void* applicationInstance, std::int32_t)
instance->flags |= Flag::MouseLocked; instance->flags |= Flag::MouseLocked;
} }
NaClApplication::Configuration::Configuration(): _size(640, 480) {} NaClApplication::Configuration::Configuration(): _size(640, 480), _sampleCount(0) {}
NaClApplication::Configuration::~Configuration() = default; NaClApplication::Configuration::~Configuration() = default;
}} }}

16
src/Platform/NaClApplication.h

@ -271,8 +271,24 @@ class NaClApplication::Configuration {
return this; 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: private:
Vector2i _size; Vector2i _size;
Int _sampleCount;
}; };
/** /**

2
src/Platform/Sdl2Application.cpp

@ -167,7 +167,7 @@ void Sdl2Application::setMouseLocked(bool enabled) {
SDL_SetRelativeMouseMode(enabled ? SDL_TRUE : SDL_FALSE); SDL_SetRelativeMouseMode(enabled ? SDL_TRUE : SDL_FALSE);
} }
Sdl2Application::Configuration::Configuration(): _title("Magnum SDL2 Application"), _size(800, 600) {} Sdl2Application::Configuration::Configuration(): _title("Magnum SDL2 Application"), _size(800, 600), _sampleCount(0) {}
Sdl2Application::Configuration::~Configuration() = default; Sdl2Application::Configuration::~Configuration() = default;
Sdl2Application::InputEvent::Modifiers Sdl2Application::MouseEvent::modifiers() { Sdl2Application::InputEvent::Modifiers Sdl2Application::MouseEvent::modifiers() {

6
src/Shaders/FlatShader.frag

@ -27,9 +27,9 @@
#endif #endif
#ifdef EXPLICIT_UNIFORM_LOCATION #ifdef EXPLICIT_UNIFORM_LOCATION
layout(location = 1) uniform vec3 color; layout(location = 1) uniform vec4 color;
#else #else
uniform lowp vec3 color; uniform lowp vec4 color;
#endif #endif
#ifdef NEW_GLSL #ifdef NEW_GLSL
@ -37,5 +37,5 @@ out lowp vec4 fragmentColor;
#endif #endif
void main() { void main() {
fragmentColor = vec4(color, 1.0); fragmentColor = color;
} }

2
src/Shaders/FlatShader.h

@ -64,7 +64,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatShader: public
* @brief Set color * @brief Set color
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
*/ */
FlatShader<dimensions>* setColor(const Color3<>& color) { FlatShader<dimensions>* setColor(const Color4<>& color) {
setUniform(colorUniform, color); setUniform(colorUniform, color);
return this; return this;
} }

Loading…
Cancel
Save