From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- .../renderer_opengl/gl_resource_manager.h | 114 +++++++++++++++------ 1 file changed, 84 insertions(+), 30 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_resource_manager.h') diff --git a/src/video_core/renderer_opengl/gl_resource_manager.h b/src/video_core/renderer_opengl/gl_resource_manager.h index eb128966c..2f40eb646 100644 --- a/src/video_core/renderer_opengl/gl_resource_manager.h +++ b/src/video_core/renderer_opengl/gl_resource_manager.h @@ -16,19 +16,28 @@ class OGLTexture : private NonCopyable { public: OGLTexture() = default; - OGLTexture(OGLTexture&& o) { std::swap(handle, o.handle); } - ~OGLTexture() { Release(); } - OGLTexture& operator=(OGLTexture&& o) { std::swap(handle, o.handle); return *this; } + OGLTexture(OGLTexture&& o) { + std::swap(handle, o.handle); + } + ~OGLTexture() { + Release(); + } + OGLTexture& operator=(OGLTexture&& o) { + std::swap(handle, o.handle); + return *this; + } /// Creates a new internal OpenGL resource and stores the handle void Create() { - if (handle != 0) return; + if (handle != 0) + return; glGenTextures(1, &handle); } /// Deletes the internal OpenGL resource void Release() { - if (handle == 0) return; + if (handle == 0) + return; glDeleteTextures(1, &handle); OpenGLState::ResetTexture(handle); handle = 0; @@ -40,19 +49,28 @@ public: class OGLSampler : private NonCopyable { public: OGLSampler() = default; - OGLSampler(OGLSampler&& o) { std::swap(handle, o.handle); } - ~OGLSampler() { Release(); } - OGLSampler& operator=(OGLSampler&& o) { std::swap(handle, o.handle); return *this; } + OGLSampler(OGLSampler&& o) { + std::swap(handle, o.handle); + } + ~OGLSampler() { + Release(); + } + OGLSampler& operator=(OGLSampler&& o) { + std::swap(handle, o.handle); + return *this; + } /// Creates a new internal OpenGL resource and stores the handle void Create() { - if (handle != 0) return; + if (handle != 0) + return; glGenSamplers(1, &handle); } /// Deletes the internal OpenGL resource void Release() { - if (handle == 0) return; + if (handle == 0) + return; glDeleteSamplers(1, &handle); OpenGLState::ResetSampler(handle); handle = 0; @@ -64,19 +82,28 @@ public: class OGLShader : private NonCopyable { public: OGLShader() = default; - OGLShader(OGLShader&& o) { std::swap(handle, o.handle); } - ~OGLShader() { Release(); } - OGLShader& operator=(OGLShader&& o) { std::swap(handle, o.handle); return *this; } + OGLShader(OGLShader&& o) { + std::swap(handle, o.handle); + } + ~OGLShader() { + Release(); + } + OGLShader& operator=(OGLShader&& o) { + std::swap(handle, o.handle); + return *this; + } /// Creates a new internal OpenGL resource and stores the handle void Create(const char* vert_shader, const char* frag_shader) { - if (handle != 0) return; + if (handle != 0) + return; handle = GLShader::LoadProgram(vert_shader, frag_shader); } /// Deletes the internal OpenGL resource void Release() { - if (handle == 0) return; + if (handle == 0) + return; glDeleteProgram(handle); OpenGLState::ResetProgram(handle); handle = 0; @@ -88,19 +115,28 @@ public: class OGLBuffer : private NonCopyable { public: OGLBuffer() = default; - OGLBuffer(OGLBuffer&& o) { std::swap(handle, o.handle); } - ~OGLBuffer() { Release(); } - OGLBuffer& operator=(OGLBuffer&& o) { std::swap(handle, o.handle); return *this; } + OGLBuffer(OGLBuffer&& o) { + std::swap(handle, o.handle); + } + ~OGLBuffer() { + Release(); + } + OGLBuffer& operator=(OGLBuffer&& o) { + std::swap(handle, o.handle); + return *this; + } /// Creates a new internal OpenGL resource and stores the handle void Create() { - if (handle != 0) return; + if (handle != 0) + return; glGenBuffers(1, &handle); } /// Deletes the internal OpenGL resource void Release() { - if (handle == 0) return; + if (handle == 0) + return; glDeleteBuffers(1, &handle); OpenGLState::ResetBuffer(handle); handle = 0; @@ -112,19 +148,28 @@ public: class OGLVertexArray : private NonCopyable { public: OGLVertexArray() = default; - OGLVertexArray(OGLVertexArray&& o) { std::swap(handle, o.handle); } - ~OGLVertexArray() { Release(); } - OGLVertexArray& operator=(OGLVertexArray&& o) { std::swap(handle, o.handle); return *this; } + OGLVertexArray(OGLVertexArray&& o) { + std::swap(handle, o.handle); + } + ~OGLVertexArray() { + Release(); + } + OGLVertexArray& operator=(OGLVertexArray&& o) { + std::swap(handle, o.handle); + return *this; + } /// Creates a new internal OpenGL resource and stores the handle void Create() { - if (handle != 0) return; + if (handle != 0) + return; glGenVertexArrays(1, &handle); } /// Deletes the internal OpenGL resource void Release() { - if (handle == 0) return; + if (handle == 0) + return; glDeleteVertexArrays(1, &handle); OpenGLState::ResetVertexArray(handle); handle = 0; @@ -136,19 +181,28 @@ public: class OGLFramebuffer : private NonCopyable { public: OGLFramebuffer() = default; - OGLFramebuffer(OGLFramebuffer&& o) { std::swap(handle, o.handle); } - ~OGLFramebuffer() { Release(); } - OGLFramebuffer& operator=(OGLFramebuffer&& o) { std::swap(handle, o.handle); return *this; } + OGLFramebuffer(OGLFramebuffer&& o) { + std::swap(handle, o.handle); + } + ~OGLFramebuffer() { + Release(); + } + OGLFramebuffer& operator=(OGLFramebuffer&& o) { + std::swap(handle, o.handle); + return *this; + } /// Creates a new internal OpenGL resource and stores the handle void Create() { - if (handle != 0) return; + if (handle != 0) + return; glGenFramebuffers(1, &handle); } /// Deletes the internal OpenGL resource void Release() { - if (handle == 0) return; + if (handle == 0) + return; glDeleteFramebuffers(1, &handle); OpenGLState::ResetFramebuffer(handle); handle = 0; -- cgit v1.2.3