mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
OpenGL linux fix, and removed some deprecated GL calls.
This commit is contained in:
parent
d117e0adaa
commit
25c70643e3
7 changed files with 8 additions and 27 deletions
|
|
@ -63,7 +63,7 @@ public:
|
|||
glView.clear();
|
||||
}
|
||||
|
||||
void initialiseOnRenderThread() {}
|
||||
void initialiseOnRenderThread (OpenGLContext&) {}
|
||||
void shutdownOnRenderThread() {}
|
||||
|
||||
bool makeActive() const noexcept { return isInsideGLCallback; }
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public:
|
|||
[view release];
|
||||
}
|
||||
|
||||
void initialiseOnRenderThread() {}
|
||||
void initialiseOnRenderThread (OpenGLContext&) {}
|
||||
|
||||
void shutdownOnRenderThread()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -103,11 +103,11 @@ public:
|
|||
XFree (bestVisual);
|
||||
}
|
||||
|
||||
void initialiseOnRenderThread()
|
||||
void initialiseOnRenderThread (OpenGLContext& context)
|
||||
{
|
||||
ScopedXLock xlock;
|
||||
renderContext = glXCreateContext (display, bestVisual, (GLXContext) contextToShareWith, GL_TRUE);
|
||||
makeActive();
|
||||
context.makeActive();
|
||||
}
|
||||
|
||||
void shutdownOnRenderThread()
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public:
|
|||
renderContext = nil;
|
||||
}
|
||||
|
||||
void initialiseOnRenderThread() {}
|
||||
void initialiseOnRenderThread (OpenGLContext&) {}
|
||||
void shutdownOnRenderThread() { deactivateCurrentContext(); }
|
||||
|
||||
bool createdOk() const noexcept { return getRawContext() != nullptr; }
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public:
|
|||
releaseDC();
|
||||
}
|
||||
|
||||
void initialiseOnRenderThread() {}
|
||||
void initialiseOnRenderThread (OpenGLContext&) {}
|
||||
void shutdownOnRenderThread() { deactivateCurrentContext(); }
|
||||
|
||||
static void deactivateCurrentContext() { wglMakeCurrent (0, 0); }
|
||||
|
|
|
|||
|
|
@ -324,7 +324,8 @@ public:
|
|||
jassert (! cachedImageFrameBuffer.isValid());
|
||||
|
||||
context.makeActive();
|
||||
nativeContext->initialiseOnRenderThread();
|
||||
nativeContext->initialiseOnRenderThread (context);
|
||||
|
||||
glViewport (0, 0, component.getWidth(), component.getHeight());
|
||||
|
||||
context.extensions.initialise();
|
||||
|
|
|
|||
|
|
@ -1118,21 +1118,6 @@ public:
|
|||
target.makeActive();
|
||||
blendMode.resync();
|
||||
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();
|
||||
shaderQuadQueue.initialise();
|
||||
JUCE_CHECK_OPENGL_ERROR
|
||||
|
|
@ -1142,11 +1127,6 @@ public:
|
|||
{
|
||||
flush();
|
||||
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_ELEMENT_ARRAY_BUFFER, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue