mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
More OpenGL shader work.
This commit is contained in:
parent
78dc975ab9
commit
37d8a65407
6 changed files with 743 additions and 329 deletions
|
|
@ -66,9 +66,18 @@
|
|||
#include <GLES/gl.h>
|
||||
#endif
|
||||
|
||||
#if (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) && ! defined (JUCE_USE_OPENGL_SHADERS)
|
||||
#define JUCE_USE_OPENGL_SHADERS 1
|
||||
#endif
|
||||
|
||||
#ifndef JUCE_USE_OPENGL_FIXED_FUNCTION
|
||||
#define JUCE_USE_OPENGL_FIXED_FUNCTION 1
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
#include "opengl/juce_OpenGLRenderingTarget.h"
|
||||
#include "opengl/juce_OpenGLHelpers.h"
|
||||
|
||||
// START_AUTOINCLUDE opengl
|
||||
#ifndef __JUCE_DRAGGABLE3DORIENTATION_JUCEHEADER__
|
||||
|
|
|
|||
|
|
@ -101,11 +101,13 @@ public:
|
|||
return quaternion.getRotationMatrix();
|
||||
}
|
||||
|
||||
#if JUCE_USE_OPENGL_FIXED_FUNCTION
|
||||
/** Applies this rotation to the active OpenGL context's matrix. */
|
||||
void applyToOpenGLMatrix() const noexcept
|
||||
{
|
||||
getRotationMatrix().applyToOpenGL();
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
typedef Quaternion<GLfloat> QuaternionType;
|
||||
|
|
|
|||
|
|
@ -77,21 +77,16 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
#if JUCE_USE_OPENGL_FIXED_FUNCTION
|
||||
/** Multiplies the active OpenGL context's matrix by this one. */
|
||||
void applyToOpenGL() const noexcept
|
||||
{
|
||||
applyToGL (mat);
|
||||
OpenGLHelpers::applyMatrix (mat);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** The 4x4 matrix values. These are stored in the standard OpenGL order. */
|
||||
Type mat[16];
|
||||
|
||||
private:
|
||||
static void applyToGL (const GLfloat* const m) noexcept { glMultMatrixf (m); }
|
||||
|
||||
#if ! JUCE_OPENGL_ES
|
||||
static void applyToGL (const GLdouble* const m) noexcept { glMultMatrixd (m); }
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -112,6 +112,7 @@ void OpenGLHelpers::clear (const Colour& colour)
|
|||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
}
|
||||
|
||||
#if JUCE_USE_OPENGL_FIXED_FUNCTION
|
||||
void OpenGLHelpers::setColour (const Colour& colour)
|
||||
{
|
||||
glColor4f (colour.getFloatRed(), colour.getFloatGreen(),
|
||||
|
|
@ -158,6 +159,19 @@ void OpenGLHelpers::applyTransform (const AffineTransform& t)
|
|||
glMultMatrixf (m);
|
||||
}
|
||||
|
||||
void OpenGLHelpers::applyMatrix (const float matrixValues[16])
|
||||
{
|
||||
glMultMatrixf (matrixValues);
|
||||
}
|
||||
|
||||
#if ! JUCE_OPENGL_ES
|
||||
void OpenGLHelpers::applyMatrix (const double matrixValues[16])
|
||||
{
|
||||
glMultMatrixd (matrixValues);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void OpenGLHelpers::enableScissorTest (const Rectangle<int>& clip)
|
||||
{
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public:
|
|||
/** Clears the current context using the given colour. */
|
||||
static void clear (const Colour& colour);
|
||||
|
||||
#if JUCE_USE_OPENGL_FIXED_FUNCTION
|
||||
/** Sets the current colour using a JUCE colour. */
|
||||
static void setColour (const Colour& colour);
|
||||
|
||||
|
|
@ -57,6 +58,12 @@ public:
|
|||
|
||||
static void applyTransform (const AffineTransform& t);
|
||||
|
||||
static void applyMatrix (const float matrixValues[16]);
|
||||
#if ! JUCE_OPENGL_ES
|
||||
static void applyMatrix (const double matrixValues[16]);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void enableScissorTest (const Rectangle<int>& clip);
|
||||
|
||||
/** Draws a 2D quad with the specified corner points. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue