diff --git a/Makefile.common b/Makefile.common index 8bbcd4e68f..4565f1f57b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -720,7 +720,7 @@ endif ifeq ($(HAVE_GL_CONTEXT), 1) DEFINES += -DHAVE_OPENGL -DHAVE_GLSL OBJ += gfx/drivers/gl.o \ - gfx/drivers/gl_capabilities.o \ + $(LIBRETRO_COMM_DIR)/gfx/gl_capabilities.o \ gfx/drivers/gl_renderchains/render_chain_gl_legacy.o \ gfx/common/gl_common.o \ gfx/drivers_font/gl_raster_font.o \ diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 4679a7e973..03021eb6bb 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -37,7 +37,8 @@ #include #include -#include "gl_capabilities.h" +#include + #include "gl_renderchains/render_chain_gl.h" #include "../../configuration.h" diff --git a/gfx/drivers/gl_capabilities.h b/gfx/drivers/gl_capabilities.h deleted file mode 100644 index 61d26fdc7c..0000000000 --- a/gfx/drivers/gl_capabilities.h +++ /dev/null @@ -1,59 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2016 - Daniel De Matteis - * Copyright (C) 2012-2015 - Michael Lelli - * - * RetroArch 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 Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch 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 RetroArch. - * If not, see . - */ - -#ifndef _GL_CAPABILITIES_H -#define _GL_CAPABILITIES_H - -#include -#include - -enum gl_capability_enum -{ - GL_CAPS_NONE = 0, - GL_CAPS_EGLIMAGE, - GL_CAPS_SYNC, - GL_CAPS_MIPMAP, - GL_CAPS_VAO, - GL_CAPS_FBO, - GL_CAPS_ARGB8, - GL_CAPS_DEBUG, - GL_CAPS_PACKED_DEPTH_STENCIL, - GL_CAPS_ES2_COMPAT, - GL_CAPS_UNPACK_ROW_LENGTH, - GL_CAPS_FULL_NPOT_SUPPORT, - GL_CAPS_SRGB_FBO, - GL_CAPS_SRGB_FBO_ES3, - GL_CAPS_FP_FBO, - GL_CAPS_BGRA8888, - GL_CAPS_GLES3_SUPPORTED -}; - -RETRO_BEGIN_DECLS - -bool gl_check_error(char **error_string); - -bool gl_query_core_context_in_use(void); - -void gl_query_core_context_set(bool set); - -void gl_query_core_context_unset(void); - -bool gl_check_capability(enum gl_capability_enum enum_idx); - -RETRO_END_DECLS - -#endif diff --git a/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c b/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c index 4e8dafe896..b2df6fa4d0 100644 --- a/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c +++ b/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c @@ -37,7 +37,7 @@ #include #include -#include "../gl_capabilities.h" +#include #include "../../../driver.h" #include "../../../configuration.h" diff --git a/gfx/drivers/gl_capabilities.c b/libretro-common/gfx/gl_capabilities.c similarity index 85% rename from gfx/drivers/gl_capabilities.c rename to libretro-common/gfx/gl_capabilities.c index 88ab008a68..d62bfa691d 100644 --- a/gfx/drivers/gl_capabilities.c +++ b/libretro-common/gfx/gl_capabilities.c @@ -1,18 +1,23 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2016 - Daniel De Matteis - * Copyright (C) 2012-2015 - Michael Lelli +/* Copyright (C) 2010-2016 The RetroArch team * - * RetroArch 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 Found- - * ation, either version 3 of the License, or (at your option) any later version. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (gl_capabilities.c). + * --------------------------------------------------------------------------------------- * - * RetroArch 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. + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include @@ -24,10 +29,10 @@ #include -#include "gl_capabilities.h" +#include #ifdef RARCH_INTERNAL -#include "../video_driver.h" +#include "../../gfx/video_driver.h" #endif static bool gl_core_context = false; diff --git a/libretro-common/include/gfx/gl_capabilities.h b/libretro-common/include/gfx/gl_capabilities.h new file mode 100644 index 0000000000..2cf84cfcf5 --- /dev/null +++ b/libretro-common/include/gfx/gl_capabilities.h @@ -0,0 +1,64 @@ +/* Copyright (C) 2010-2016 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (gl_capabilities.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _GL_CAPABILITIES_H +#define _GL_CAPABILITIES_H + +#include +#include + +enum gl_capability_enum +{ + GL_CAPS_NONE = 0, + GL_CAPS_EGLIMAGE, + GL_CAPS_SYNC, + GL_CAPS_MIPMAP, + GL_CAPS_VAO, + GL_CAPS_FBO, + GL_CAPS_ARGB8, + GL_CAPS_DEBUG, + GL_CAPS_PACKED_DEPTH_STENCIL, + GL_CAPS_ES2_COMPAT, + GL_CAPS_UNPACK_ROW_LENGTH, + GL_CAPS_FULL_NPOT_SUPPORT, + GL_CAPS_SRGB_FBO, + GL_CAPS_SRGB_FBO_ES3, + GL_CAPS_FP_FBO, + GL_CAPS_BGRA8888, + GL_CAPS_GLES3_SUPPORTED +}; + +RETRO_BEGIN_DECLS + +bool gl_check_error(char **error_string); + +bool gl_query_core_context_in_use(void); + +void gl_query_core_context_set(bool set); + +void gl_query_core_context_unset(void); + +bool gl_check_capability(enum gl_capability_enum enum_idx); + +RETRO_END_DECLS + +#endif