Browse Source

Added a few noexcepts to some GL functions

tags/2021-05-28
jules 9 years ago
parent
commit
c06db136bd
3 changed files with 7 additions and 7 deletions
  1. +3
    -3
      modules/juce_opengl/juce_opengl.cpp
  2. +2
    -2
      modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp
  3. +2
    -2
      modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.h

+ 3
- 3
modules/juce_opengl/juce_opengl.cpp View File

@@ -147,20 +147,20 @@ static void checkGLError (const char* file, const int line)
#define JUCE_CHECK_OPENGL_ERROR ;
#endif
static void clearGLError()
static void clearGLError() noexcept
{
while (glGetError() != GL_NO_ERROR) {}
}
struct OpenGLTargetSaver
{
OpenGLTargetSaver (const OpenGLContext& c)
OpenGLTargetSaver (const OpenGLContext& c) noexcept
: context (c), oldFramebuffer (OpenGLFrameBuffer::getCurrentFrameBufferTarget())
{
glGetIntegerv (GL_VIEWPORT, oldViewport);
}
~OpenGLTargetSaver()
~OpenGLTargetSaver() noexcept
{
context.extensions.glBindFramebuffer (GL_FRAMEBUFFER, oldFramebuffer);
glViewport (oldViewport[0], oldViewport[1], oldViewport[2], oldViewport[3]);


+ 2
- 2
modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp View File

@@ -274,12 +274,12 @@ bool OpenGLFrameBuffer::makeCurrentRenderingTarget()
return true;
}
GLuint OpenGLFrameBuffer::getFrameBufferID() const
GLuint OpenGLFrameBuffer::getFrameBufferID() const noexcept
{
return pimpl != nullptr ? pimpl->frameBufferID : 0;
}
GLuint OpenGLFrameBuffer::getCurrentFrameBufferTarget()
GLuint OpenGLFrameBuffer::getCurrentFrameBufferTarget() noexcept
{
GLint fb;
glGetIntegerv (GL_FRAMEBUFFER_BINDING, &fb);


+ 2
- 2
modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.h View File

@@ -95,10 +95,10 @@ public:
void releaseAsRenderingTarget();
/** Returns the ID of this framebuffer, or 0 if it isn't initialised. */
GLuint getFrameBufferID() const;
GLuint getFrameBufferID() const noexcept;
/** Returns the current frame buffer ID for the current context. */
static GLuint getCurrentFrameBufferTarget();
static GLuint getCurrentFrameBufferTarget() noexcept;
/** Clears the framebuffer with the specified colour. */
void clear (Colour colour);


Loading…
Cancel
Save