1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-13 00:04:19 +00:00

Cleaned up some minor stuff in the GL demo and PathStrokeType.

This commit is contained in:
jules 2014-01-12 15:50:16 +00:00
parent 1f454c1ca0
commit 5b25b303fb
3 changed files with 26 additions and 26 deletions

View file

@ -658,24 +658,20 @@ struct OpenGLDemoClasses
shader->use();
// Setup our projection uniform
if (OpenGLShaderProgram::Uniform* uni = uniforms->projectionMatrix)
openGLContext.extensions.glUniformMatrix4fv (uni->uniformID, 1, 0, getProjectionMatrix().mat);
if (uniforms->projectionMatrix != nullptr)
uniforms->projectionMatrix->setMatrix4 (getProjectionMatrix().mat, 1, 0);
// And the matrix for our model view
if (OpenGLShaderProgram::Uniform* uni = uniforms->viewMatrix)
openGLContext.extensions.glUniformMatrix4fv (uni->uniformID, 1, 0, getViewMatrix().mat);
if (uniforms->viewMatrix != nullptr)
uniforms->viewMatrix->setMatrix4 (getViewMatrix().mat, 1, 0);
if (OpenGLShaderProgram::Uniform* uni = uniforms->texture)
openGLContext.extensions.glUniform1i (uni->uniformID, 0);
if (uniforms->texture != nullptr)
uniforms->texture->set (0);
// Set the direction of our light source
if (OpenGLShaderProgram::Uniform* uni = uniforms->lightPosition)
openGLContext.extensions.glUniform4f (uni->uniformID, -15.0f, 10.0f, 15.0f, 0.0f);
if (uniforms->lightPosition != nullptr)
uniforms->lightPosition->set (-15.0f, 10.0f, 15.0f, 0.0f);
// Set our bouncing number
if (OpenGLShaderProgram::Uniform* uni = uniforms->bouncingNumber)
openGLContext.extensions.glUniform1f (uni->uniformID, bouncingNumber.getValue());
if (uniforms->bouncingNumber != nullptr)
uniforms->bouncingNumber->set (bouncingNumber.getValue());
shape->draw (openGLContext, *attributes);

View file

@ -22,12 +22,13 @@
==============================================================================
*/
PathStrokeType::PathStrokeType (const float strokeThickness,
const JointStyle jointStyle_,
const EndCapStyle endStyle_) noexcept
: thickness (strokeThickness),
jointStyle (jointStyle_),
endStyle (endStyle_)
PathStrokeType::PathStrokeType (float strokeThickness) noexcept
: thickness (strokeThickness), jointStyle (mitered), endStyle (butt)
{
}
PathStrokeType::PathStrokeType (float strokeThickness, JointStyle joint, EndCapStyle end) noexcept
: thickness (strokeThickness), jointStyle (joint), endStyle (end)
{
}

View file

@ -63,6 +63,9 @@ public:
};
//==============================================================================
/** Creates a stroke type with a given line-width, and default joint/end styles. */
explicit PathStrokeType (float strokeThickness) noexcept;
/** Creates a stroke type.
@param strokeThickness the width of the line to use
@ -70,14 +73,14 @@ public:
@param endStyle the type of end-caps to use for the ends of open paths.
*/
PathStrokeType (float strokeThickness,
JointStyle jointStyle = mitered,
JointStyle jointStyle,
EndCapStyle endStyle = butt) noexcept;
/** Createes a copy of another stroke type. */
PathStrokeType (const PathStrokeType& other) noexcept;
/** Creates a copy of another stroke type. */
PathStrokeType (const PathStrokeType&) noexcept;
/** Copies another stroke onto this one. */
PathStrokeType& operator= (const PathStrokeType& other) noexcept;
PathStrokeType& operator= (const PathStrokeType&) noexcept;
/** Destructor. */
~PathStrokeType() noexcept;
@ -184,10 +187,10 @@ public:
//==============================================================================
/** Compares the stroke thickness, joint and end styles of two stroke types. */
bool operator== (const PathStrokeType& other) const noexcept;
bool operator== (const PathStrokeType&) const noexcept;
/** Compares the stroke thickness, joint and end styles of two stroke types. */
bool operator!= (const PathStrokeType& other) const noexcept;
bool operator!= (const PathStrokeType&) const noexcept;
private:
//==============================================================================