From 076b11c903f88592fbd74f3af3989e71362912f8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 30 Sep 2013 19:44:59 +0300 Subject: move mgl files into render directory. --- src/CMakeLists.txt | 4 +- src/Makefile.am | 4 +- src/graphicsmanager.cpp | 2 +- src/mgl.cpp | 50 ------------- src/mgl.h | 136 ------------------------------------ src/render/mgl.cpp | 50 +++++++++++++ src/render/mgl.h | 136 ++++++++++++++++++++++++++++++++++++ src/resources/openglimagehelper.cpp | 2 +- 8 files changed, 192 insertions(+), 192 deletions(-) delete mode 100644 src/mgl.cpp delete mode 100644 src/mgl.h create mode 100644 src/render/mgl.cpp create mode 100644 src/render/mgl.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8ff69ade6..de76d6fe2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -671,8 +671,8 @@ SET(SRCS mapheights.h maplayer.cpp maplayer.h - mgl.cpp - mgl.h + render/mgl.cpp + render/mgl.h render/mobileopenglgraphics.cpp render/mobileopenglgraphics.h mouseinput.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 90925ef2d..185f92b25 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -684,8 +684,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ mapheights.h \ maplayer.cpp \ maplayer.h \ - mgl.cpp \ - mgl.h \ + render/mgl.cpp \ + render/mgl.h \ render/mobileopenglgraphics.cpp \ render/mobileopenglgraphics.h \ mouseinput.cpp \ diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index de3eb5986..a571c496f 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -40,9 +40,9 @@ #include "configuration.h" #include "logger.h" -#include "mgl.h" #include "render/graphics.h" +#include "render/mgl.h" #include "render/mobileopenglgraphics.h" #include "render/normalopenglgraphics.h" #include "render/renderers.h" diff --git a/src/mgl.cpp b/src/mgl.cpp deleted file mode 100644 index a3158bb9b..000000000 --- a/src/mgl.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "mgl.h" - -#ifdef USE_OPENGL - -#include "localconsts.h" - -#define defName(name) name##_t m##name = nullptr - -defName(glGenRenderbuffers); -defName(glBindRenderbuffer); -defName(glRenderbufferStorage); -defName(glGenFramebuffers); -defName(glBindFramebuffer); -defName(glFramebufferTexture2D); -defName(glFramebufferRenderbuffer); -defName(glDeleteFramebuffers); -defName(glDeleteRenderbuffers); -defName(glGetStringi); -defName(glGenSamplers); -defName(glDeleteSamplers); -defName(glBindSampler); -defName(glSamplerParameteri); -defName(glDebugMessageControl); -defName(glDebugMessageCallback); - -#ifdef WIN32 -defName(wglGetExtensionsString); -#endif - -#endif diff --git a/src/mgl.h b/src/mgl.h deleted file mode 100644 index 335ee48f1..000000000 --- a/src/mgl.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef MGL_H -#define MGL_H - -#include "main.h" -#ifdef USE_OPENGL - -#ifdef ANDROID -#include -#include -#define APIENTRY GL_APIENTRY -#else -#ifndef USE_SDL2 -#define GL_GLEXT_PROTOTYPES 1 -#endif -#include -#include -#endif - -#define GL_NUM_EXTENSIONS 0x821D -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 - -#ifndef GL_COMPRESSED_RGBA_ARB -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif -#ifndef GL_MAX_ELEMENTS_VERTICES -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#endif - -#ifndef GL_DEBUG_OUTPUT -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_OUTPUT 0x92E0 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#endif - -#define defNameE(name) extern name##_t m##name - -typedef void (APIENTRY *glGenRenderbuffers_t)(GLsizei, GLuint *); -typedef void (APIENTRY *glBindRenderbuffer_t)(GLenum target, - GLuint renderbuffer); -typedef void (APIENTRY *glRenderbufferStorage_t)(GLenum target, - GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRY *glGenFramebuffers_t)(GLsizei n, GLuint *framebuffers); -typedef void (APIENTRY *glBindFramebuffer_t)(GLenum target, - GLuint framebuffer); -typedef void (APIENTRY *glFramebufferTexture2D_t)(GLenum target, - GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRY *glFramebufferRenderbuffer_t)(GLenum target, - GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRY *glDeleteFramebuffers_t) (GLsizei, const GLuint *); -typedef void (APIENTRY *glDeleteRenderbuffers_t) (GLsizei, const GLuint *); -typedef const GLubyte *(APIENTRY *glGetStringi_t) (GLenum, GLuint); -typedef void (APIENTRY *glGenSamplers_t) (GLsizei count, GLuint *samplers); -typedef void (APIENTRY *glDeleteSamplers_t) - (GLsizei count, const GLuint * samplers); -typedef void (APIENTRY *glBindSampler_t) (GLuint unit, GLuint sampler); -typedef void (APIENTRY *glSamplerParameteri_t) - (GLuint sampler, GLenum pname, GLint param); -typedef void (APIENTRY *glDebugMessageControl_t) (GLenum source, GLenum type, - GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); - -// callback -typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id, - GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam); - -typedef void (APIENTRY *glDebugMessageCallback_t) (GLDEBUGPROC_t callback, - const void *userParam); - -defNameE(glGenRenderbuffers); -defNameE(glBindRenderbuffer); -defNameE(glRenderbufferStorage); -defNameE(glGenFramebuffers); -defNameE(glBindFramebuffer); -defNameE(glFramebufferTexture2D); -defNameE(glFramebufferRenderbuffer); -defNameE(glDeleteFramebuffers); -defNameE(glDeleteRenderbuffers); -defNameE(glGetStringi); -defNameE(glGenSamplers); -defNameE(glDeleteSamplers); -defNameE(glBindSampler); -defNameE(glSamplerParameteri); -defNameE(glDebugMessageControl); -defNameE(glDebugMessageCallback); - -#ifdef WIN32 -typedef const char* (APIENTRY * wglGetExtensionsString_t) (HDC hdc); - -defNameE(wglGetExtensionsString); -#else -#define CALLBACK -#endif - -#endif -#endif // MGL_H diff --git a/src/render/mgl.cpp b/src/render/mgl.cpp new file mode 100644 index 000000000..0fabb5d1b --- /dev/null +++ b/src/render/mgl.cpp @@ -0,0 +1,50 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2013 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "render/mgl.h" + +#ifdef USE_OPENGL + +#include "localconsts.h" + +#define defName(name) name##_t m##name = nullptr + +defName(glGenRenderbuffers); +defName(glBindRenderbuffer); +defName(glRenderbufferStorage); +defName(glGenFramebuffers); +defName(glBindFramebuffer); +defName(glFramebufferTexture2D); +defName(glFramebufferRenderbuffer); +defName(glDeleteFramebuffers); +defName(glDeleteRenderbuffers); +defName(glGetStringi); +defName(glGenSamplers); +defName(glDeleteSamplers); +defName(glBindSampler); +defName(glSamplerParameteri); +defName(glDebugMessageControl); +defName(glDebugMessageCallback); + +#ifdef WIN32 +defName(wglGetExtensionsString); +#endif + +#endif diff --git a/src/render/mgl.h b/src/render/mgl.h new file mode 100644 index 000000000..335ee48f1 --- /dev/null +++ b/src/render/mgl.h @@ -0,0 +1,136 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2013 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef MGL_H +#define MGL_H + +#include "main.h" +#ifdef USE_OPENGL + +#ifdef ANDROID +#include +#include +#define APIENTRY GL_APIENTRY +#else +#ifndef USE_SDL2 +#define GL_GLEXT_PROTOTYPES 1 +#endif +#include +#include +#endif + +#define GL_NUM_EXTENSIONS 0x821D +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 + +#ifndef GL_COMPRESSED_RGBA_ARB +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif +#ifndef GL_MAX_ELEMENTS_VERTICES +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#endif + +#ifndef GL_DEBUG_OUTPUT +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_OUTPUT 0x92E0 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#endif + +#define defNameE(name) extern name##_t m##name + +typedef void (APIENTRY *glGenRenderbuffers_t)(GLsizei, GLuint *); +typedef void (APIENTRY *glBindRenderbuffer_t)(GLenum target, + GLuint renderbuffer); +typedef void (APIENTRY *glRenderbufferStorage_t)(GLenum target, + GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRY *glGenFramebuffers_t)(GLsizei n, GLuint *framebuffers); +typedef void (APIENTRY *glBindFramebuffer_t)(GLenum target, + GLuint framebuffer); +typedef void (APIENTRY *glFramebufferTexture2D_t)(GLenum target, + GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRY *glFramebufferRenderbuffer_t)(GLenum target, + GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRY *glDeleteFramebuffers_t) (GLsizei, const GLuint *); +typedef void (APIENTRY *glDeleteRenderbuffers_t) (GLsizei, const GLuint *); +typedef const GLubyte *(APIENTRY *glGetStringi_t) (GLenum, GLuint); +typedef void (APIENTRY *glGenSamplers_t) (GLsizei count, GLuint *samplers); +typedef void (APIENTRY *glDeleteSamplers_t) + (GLsizei count, const GLuint * samplers); +typedef void (APIENTRY *glBindSampler_t) (GLuint unit, GLuint sampler); +typedef void (APIENTRY *glSamplerParameteri_t) + (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRY *glDebugMessageControl_t) (GLenum source, GLenum type, + GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); + +// callback +typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id, + GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam); + +typedef void (APIENTRY *glDebugMessageCallback_t) (GLDEBUGPROC_t callback, + const void *userParam); + +defNameE(glGenRenderbuffers); +defNameE(glBindRenderbuffer); +defNameE(glRenderbufferStorage); +defNameE(glGenFramebuffers); +defNameE(glBindFramebuffer); +defNameE(glFramebufferTexture2D); +defNameE(glFramebufferRenderbuffer); +defNameE(glDeleteFramebuffers); +defNameE(glDeleteRenderbuffers); +defNameE(glGetStringi); +defNameE(glGenSamplers); +defNameE(glDeleteSamplers); +defNameE(glBindSampler); +defNameE(glSamplerParameteri); +defNameE(glDebugMessageControl); +defNameE(glDebugMessageCallback); + +#ifdef WIN32 +typedef const char* (APIENTRY * wglGetExtensionsString_t) (HDC hdc); + +defNameE(wglGetExtensionsString); +#else +#define CALLBACK +#endif + +#endif +#endif // MGL_H diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp index a036a7e0e..458ee389d 100644 --- a/src/resources/openglimagehelper.cpp +++ b/src/resources/openglimagehelper.cpp @@ -26,8 +26,8 @@ #include "graphicsmanager.h" #include "logger.h" -#include "mgl.h" +#include "render/mgl.h" #include "render/mobileopenglgraphics.h" #include "render/normalopenglgraphics.h" #include "render/renderers.h" -- cgit v1.2.3-70-g09d2