|
|
@@ -0,0 +1,144 @@ |
|
|
|
diff --git a/modules/juce_opengl/juce_opengl.h b/modules/juce_opengl/juce_opengl.h
|
|
|
|
index 99bdaaad..a2579b3a 100644
|
|
|
|
--- a/modules/juce_opengl/juce_opengl.h
|
|
|
|
+++ b/modules/juce_opengl/juce_opengl.h
|
|
|
|
@@ -124,7 +124,7 @@
|
|
|
|
It's mandatory in OpenGL 3.0 to specify the GLSL version.
|
|
|
|
*/
|
|
|
|
#if JUCE_OPENGL3
|
|
|
|
- #if JUCE_OPENGL_ES || OPENGL_ES
|
|
|
|
+ #if JUCE_OPENGL_ES
|
|
|
|
#define JUCE_GLSL_VERSION "#version 300 es"
|
|
|
|
#else
|
|
|
|
#define JUCE_GLSL_VERSION "#version 150"
|
|
|
|
diff --git a/modules/juce_opengl/native/juce_MissingGLDefinitions.h b/modules/juce_opengl/native/juce_MissingGLDefinitions.h
|
|
|
|
index 00c6cf56..c23ec097 100644
|
|
|
|
--- a/modules/juce_opengl/native/juce_MissingGLDefinitions.h
|
|
|
|
+++ b/modules/juce_opengl/native/juce_MissingGLDefinitions.h
|
|
|
|
@@ -126,14 +126,6 @@ enum MissingOpenGLDefinitions
|
|
|
|
GL_DYNAMIC_DRAW = 0x88E8,
|
|
|
|
GL_STREAM_DRAW = 0x88E0,
|
|
|
|
|
|
|
|
- GL_GEOMETRY_SHADER = 0x8DD9,
|
|
|
|
- GL_LINE_STRIP_ADJACENCY = 0x000B,
|
|
|
|
- GL_INTERLEAVED_ATTRIBS = 0x8C8C,
|
|
|
|
- GL_STATIC_READ = 0x88E5,
|
|
|
|
- GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E,
|
|
|
|
- GL_RASTERIZER_DISCARD = 0x8C89,
|
|
|
|
- GL_MAP_READ_BIT = 0x0001,
|
|
|
|
-
|
|
|
|
WGL_NUMBER_PIXEL_FORMATS_ARB = 0x2000,
|
|
|
|
WGL_DRAW_TO_WINDOW_ARB = 0x2001,
|
|
|
|
WGL_ACCELERATION_ARB = 0x2003,
|
|
|
|
diff --git a/modules/juce_opengl/native/juce_OpenGL_linux_X11.h b/modules/juce_opengl/native/juce_OpenGL_linux_X11.h
|
|
|
|
index 203798b2..12190413 100644
|
|
|
|
--- a/modules/juce_opengl/native/juce_OpenGL_linux_X11.h
|
|
|
|
+++ b/modules/juce_opengl/native/juce_OpenGL_linux_X11.h
|
|
|
|
@@ -69,8 +69,8 @@ public:
|
|
|
|
|
|
|
|
GLint attribs[] =
|
|
|
|
{
|
|
|
|
- GLX_RENDER_TYPE, GLX_RGBA_BIT,
|
|
|
|
- GLX_DOUBLEBUFFER, True,
|
|
|
|
+ GLX_RGBA,
|
|
|
|
+ GLX_DOUBLEBUFFER,
|
|
|
|
GLX_RED_SIZE, cPixelFormat.redBits,
|
|
|
|
GLX_GREEN_SIZE, cPixelFormat.greenBits,
|
|
|
|
GLX_BLUE_SIZE, cPixelFormat.blueBits,
|
|
|
|
@@ -81,21 +81,13 @@ public:
|
|
|
|
GLX_ACCUM_GREEN_SIZE, cPixelFormat.accumulationBufferGreenBits,
|
|
|
|
GLX_ACCUM_BLUE_SIZE, cPixelFormat.accumulationBufferBlueBits,
|
|
|
|
GLX_ACCUM_ALPHA_SIZE, cPixelFormat.accumulationBufferAlphaBits,
|
|
|
|
- GLX_X_RENDERABLE, True,
|
|
|
|
None
|
|
|
|
};
|
|
|
|
|
|
|
|
- int countFbConfigs;
|
|
|
|
- fbConfig = glXChooseFBConfig (display, DefaultScreen (display), attribs, &countFbConfigs);
|
|
|
|
- if (fbConfig == nullptr)
|
|
|
|
+ bestVisual = glXChooseVisual (display, X11Symbols::getInstance()->xDefaultScreen (display), attribs);
|
|
|
|
+ if (bestVisual == nullptr)
|
|
|
|
return;
|
|
|
|
|
|
|
|
- bestVisual = glXGetVisualFromFBConfig (display, *fbConfig);
|
|
|
|
- if (bestVisual == nullptr) {
|
|
|
|
- X11Symbols::getInstance()->xFree (fbConfig);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
auto* peer = component.getPeer();
|
|
|
|
jassert (peer != nullptr);
|
|
|
|
|
|
|
|
@@ -156,9 +148,6 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (fbConfig != nullptr)
|
|
|
|
- X11Symbols::getInstance()->xFree (fbConfig);
|
|
|
|
-
|
|
|
|
if (bestVisual != nullptr)
|
|
|
|
X11Symbols::getInstance()->xFree (bestVisual);
|
|
|
|
}
|
|
|
|
@@ -166,18 +155,7 @@ public:
|
|
|
|
bool initialiseOnRenderThread (OpenGLContext& c)
|
|
|
|
{
|
|
|
|
XWindowSystemUtilities::ScopedXLock xLock;
|
|
|
|
- PFNGLXCREATECONTEXTATTRIBSARBPROC createContextAttribs;
|
|
|
|
- int attribs[] = {
|
|
|
|
- GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
|
|
|
|
- GLX_CONTEXT_MINOR_VERSION_ARB, 2,
|
|
|
|
- GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
|
|
|
|
- 0
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- createContextAttribs = (PFNGLXCREATECONTEXTATTRIBSARBPROC)
|
|
|
|
- OpenGLHelpers::getExtensionFunction("glXCreateContextAttribsARB");
|
|
|
|
-
|
|
|
|
- renderContext = createContextAttribs (display, *fbConfig, (GLXContext) contextToShareWith, GL_TRUE, attribs);
|
|
|
|
+ renderContext = glXCreateContext (display, bestVisual, (GLXContext) contextToShareWith, GL_TRUE);
|
|
|
|
c.makeActive();
|
|
|
|
context = &c;
|
|
|
|
|
|
|
|
@@ -273,7 +251,6 @@ private:
|
|
|
|
int swapFrames = 1;
|
|
|
|
Rectangle<int> bounds;
|
|
|
|
XVisualInfo* bestVisual = nullptr;
|
|
|
|
- GLXFBConfig* fbConfig = nullptr;
|
|
|
|
void* contextToShareWith;
|
|
|
|
|
|
|
|
OpenGLContext* context = nullptr;
|
|
|
|
diff --git a/modules/juce_opengl/native/juce_OpenGL_win32.h b/modules/juce_opengl/native/juce_OpenGL_win32.h
|
|
|
|
index f602d229..d8c892ce 100644
|
|
|
|
--- a/modules/juce_opengl/native/juce_OpenGL_win32.h
|
|
|
|
+++ b/modules/juce_opengl/native/juce_OpenGL_win32.h
|
|
|
|
@@ -290,8 +290,6 @@ private:
|
|
|
|
|
|
|
|
atts[n++] = WGL_DRAW_TO_WINDOW_ARB; atts[n++] = GL_TRUE;
|
|
|
|
atts[n++] = WGL_SUPPORT_OPENGL_ARB; atts[n++] = GL_TRUE;
|
|
|
|
- atts[n++] = WGL_CONTEXT_MAJOR_VERSION_ARB; atts[n++] = 3;
|
|
|
|
- atts[n++] = WGL_CONTEXT_MINOR_VERSION_ARB; atts[n++] = 2;
|
|
|
|
atts[n++] = WGL_DOUBLE_BUFFER_ARB; atts[n++] = GL_TRUE;
|
|
|
|
atts[n++] = WGL_PIXEL_TYPE_ARB; atts[n++] = WGL_TYPE_RGBA_ARB;
|
|
|
|
atts[n++] = WGL_ACCELERATION_ARB;
|
|
|
|
diff --git a/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp b/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp
|
|
|
|
index ad40fa64..97dc1f0b 100644
|
|
|
|
--- a/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp
|
|
|
|
+++ b/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp
|
|
|
|
@@ -83,7 +83,7 @@ void OpenGLHelpers::enableScissorTest (Rectangle<int> clip)
|
|
|
|
|
|
|
|
String OpenGLHelpers::translateVertexShaderToV3 (const String& code)
|
|
|
|
{
|
|
|
|
- #if JUCE_OPENGL3 || OPENGL_ES
|
|
|
|
+ #if JUCE_OPENGL3
|
|
|
|
if (OpenGLShaderProgram::getLanguageVersion() > 1.2)
|
|
|
|
{
|
|
|
|
String output;
|
|
|
|
@@ -119,7 +119,7 @@ String OpenGLHelpers::translateVertexShaderToV3 (const String& code)
|
|
|
|
|
|
|
|
String OpenGLHelpers::translateFragmentShaderToV3 (const String& code)
|
|
|
|
{
|
|
|
|
- #if JUCE_OPENGL3 || OPENGL_ES
|
|
|
|
+ #if JUCE_OPENGL3
|
|
|
|
if (OpenGLShaderProgram::getLanguageVersion() > 1.2)
|
|
|
|
return JUCE_GLSL_VERSION "\n"
|
|
|
|
"out " JUCE_MEDIUMP " vec4 fragColor;\n"
|