Browse Source

OpenGL linux fix, and removed some deprecated GL calls.

tags/2021-05-28
jules 12 years ago
parent
commit
25c70643e3
7 changed files with 8 additions and 27 deletions
  1. +1
    -1
      modules/juce_opengl/native/juce_OpenGL_android.h
  2. +1
    -1
      modules/juce_opengl/native/juce_OpenGL_ios.h
  3. +2
    -2
      modules/juce_opengl/native/juce_OpenGL_linux.h
  4. +1
    -1
      modules/juce_opengl/native/juce_OpenGL_osx.h
  5. +1
    -1
      modules/juce_opengl/native/juce_OpenGL_win32.h
  6. +2
    -1
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp
  7. +0
    -20
      modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp

+ 1
- 1
modules/juce_opengl/native/juce_OpenGL_android.h View File

@@ -63,7 +63,7 @@ public:
glView.clear(); glView.clear();
} }
void initialiseOnRenderThread() {}
void initialiseOnRenderThread (OpenGLContext&) {}
void shutdownOnRenderThread() {} void shutdownOnRenderThread() {}
bool makeActive() const noexcept { return isInsideGLCallback; } bool makeActive() const noexcept { return isInsideGLCallback; }


+ 1
- 1
modules/juce_opengl/native/juce_OpenGL_ios.h View File

@@ -97,7 +97,7 @@ public:
[view release]; [view release];
} }
void initialiseOnRenderThread() {}
void initialiseOnRenderThread (OpenGLContext&) {}
void shutdownOnRenderThread() void shutdownOnRenderThread()
{ {


+ 2
- 2
modules/juce_opengl/native/juce_OpenGL_linux.h View File

@@ -103,11 +103,11 @@ public:
XFree (bestVisual); XFree (bestVisual);
} }
void initialiseOnRenderThread()
void initialiseOnRenderThread (OpenGLContext& context)
{ {
ScopedXLock xlock; ScopedXLock xlock;
renderContext = glXCreateContext (display, bestVisual, (GLXContext) contextToShareWith, GL_TRUE); renderContext = glXCreateContext (display, bestVisual, (GLXContext) contextToShareWith, GL_TRUE);
makeActive();
context.makeActive();
} }
void shutdownOnRenderThread() void shutdownOnRenderThread()


+ 1
- 1
modules/juce_opengl/native/juce_OpenGL_osx.h View File

@@ -81,7 +81,7 @@ public:
renderContext = nil; renderContext = nil;
} }
void initialiseOnRenderThread() {}
void initialiseOnRenderThread (OpenGLContext&) {}
void shutdownOnRenderThread() { deactivateCurrentContext(); } void shutdownOnRenderThread() { deactivateCurrentContext(); }
bool createdOk() const noexcept { return getRawContext() != nullptr; } bool createdOk() const noexcept { return getRawContext() != nullptr; }


+ 1
- 1
modules/juce_opengl/native/juce_OpenGL_win32.h View File

@@ -81,7 +81,7 @@ public:
releaseDC(); releaseDC();
} }
void initialiseOnRenderThread() {}
void initialiseOnRenderThread (OpenGLContext&) {}
void shutdownOnRenderThread() { deactivateCurrentContext(); } void shutdownOnRenderThread() { deactivateCurrentContext(); }
static void deactivateCurrentContext() { wglMakeCurrent (0, 0); } static void deactivateCurrentContext() { wglMakeCurrent (0, 0); }


+ 2
- 1
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -324,7 +324,8 @@ public:
jassert (! cachedImageFrameBuffer.isValid()); jassert (! cachedImageFrameBuffer.isValid());
context.makeActive(); context.makeActive();
nativeContext->initialiseOnRenderThread();
nativeContext->initialiseOnRenderThread (context);
glViewport (0, 0, component.getWidth(), component.getHeight()); glViewport (0, 0, component.getWidth(), component.getHeight());
context.extensions.initialise(); context.extensions.initialise();


+ 0
- 20
modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp View File

@@ -1118,21 +1118,6 @@ public:
target.makeActive(); target.makeActive();
blendMode.resync(); blendMode.resync();
JUCE_CHECK_OPENGL_ERROR JUCE_CHECK_OPENGL_ERROR
#ifdef GL_COLOR_ARRAY
glDisableClientState (GL_COLOR_ARRAY);
glDisableClientState (GL_NORMAL_ARRAY);
glDisableClientState (GL_VERTEX_ARRAY);
glDisableClientState (GL_INDEX_ARRAY);
for (int i = 3; --i >= 0;)
{
activeTextures.setActiveTexture (i);
glDisableClientState (GL_TEXTURE_COORD_ARRAY);
}
#endif
JUCE_CHECK_OPENGL_ERROR
activeTextures.clear(); activeTextures.clear();
shaderQuadQueue.initialise(); shaderQuadQueue.initialise();
JUCE_CHECK_OPENGL_ERROR JUCE_CHECK_OPENGL_ERROR
@@ -1142,11 +1127,6 @@ public:
{ {
flush(); flush();
target.context.extensions.glBindFramebuffer (GL_FRAMEBUFFER, previousFrameBufferTarget); target.context.extensions.glBindFramebuffer (GL_FRAMEBUFFER, previousFrameBufferTarget);
#if defined (GL_INDEX_ARRAY)
glDisableClientState (GL_INDEX_ARRAY);
#endif
target.context.extensions.glBindBuffer (GL_ARRAY_BUFFER, 0); target.context.extensions.glBindBuffer (GL_ARRAY_BUFFER, 0);
target.context.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0); target.context.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
} }


Loading…
Cancel
Save