From 5f6948351bcfa6b12074b7d6be9d7413f9c23bd6 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 19 Apr 2023 05:35:36 -0700 Subject: [PATCH] Feature: Move video-backend.c to a sensible place --- CMakeLists.txt | 5 ----- {src/platform => include/mgba/feature}/video-backend.h | 0 src/feature/CMakeLists.txt | 1 + src/{platform => feature}/video-backend.c | 2 +- src/platform/opengl/gl.h | 2 +- src/platform/opengl/gles2.h | 2 +- src/platform/qt/DisplayGL.h | 2 +- src/platform/qt/ShaderSelector.cpp | 2 +- 8 files changed, 6 insertions(+), 10 deletions(-) rename {src/platform => include/mgba/feature}/video-backend.h (100%) rename src/{platform => feature}/video-backend.c (94%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c80e2350e..4766eb521 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -747,11 +747,6 @@ elseif(BUILD_GLES2) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libgles2") endif() -if(USE_EPOXY OR BUILD_GL OR BUILD_GLES2) - # This file should probably go somewhere else - list(APPEND FEATURE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/video-backend.c) -endif() - if(WIN32 AND NOT (LIBMGBA_ONLY OR SKIP_LIBRARY OR USE_EPOXY)) message(FATAL_ERROR "Windows requires epoxy module!") endif() diff --git a/src/platform/video-backend.h b/include/mgba/feature/video-backend.h similarity index 100% rename from src/platform/video-backend.h rename to include/mgba/feature/video-backend.h diff --git a/src/feature/CMakeLists.txt b/src/feature/CMakeLists.txt index ffb469953..f18028ff0 100644 --- a/src/feature/CMakeLists.txt +++ b/src/feature/CMakeLists.txt @@ -3,6 +3,7 @@ set(SOURCE_FILES commandline.c thread-proxy.c updater.c + video-backend.c video-logger.c) set(GUI_FILES diff --git a/src/platform/video-backend.c b/src/feature/video-backend.c similarity index 94% rename from src/platform/video-backend.c rename to src/feature/video-backend.c index d8e5826ea..ffe916edc 100644 --- a/src/platform/video-backend.c +++ b/src/feature/video-backend.c @@ -3,7 +3,7 @@ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "video-backend.h" +#include void VideoBackendGetFrame(const struct VideoBackend* v, struct mRectangle* frame) { memset(frame, 0, sizeof(*frame)); diff --git a/src/platform/opengl/gl.h b/src/platform/opengl/gl.h index 5e4873b3d..28bb5249d 100644 --- a/src/platform/opengl/gl.h +++ b/src/platform/opengl/gl.h @@ -21,7 +21,7 @@ CXX_GUARD_START #include #endif -#include "platform/video-backend.h" +#include struct mGLContext { struct VideoBackend d; diff --git a/src/platform/opengl/gles2.h b/src/platform/opengl/gles2.h index c81e9d8e2..498cbdc86 100644 --- a/src/platform/opengl/gles2.h +++ b/src/platform/opengl/gles2.h @@ -24,7 +24,7 @@ CXX_GUARD_START #include #endif -#include "platform/video-backend.h" +#include union mGLES2UniformValue { GLfloat f; diff --git a/src/platform/qt/DisplayGL.h b/src/platform/qt/DisplayGL.h index c770ae76c..d94a68621 100644 --- a/src/platform/qt/DisplayGL.h +++ b/src/platform/qt/DisplayGL.h @@ -37,7 +37,7 @@ #include "CoreController.h" #include "VideoProxy.h" -#include "platform/video-backend.h" +#include class QOpenGLPaintDevice; class QOpenGLWidget; diff --git a/src/platform/qt/ShaderSelector.cpp b/src/platform/qt/ShaderSelector.cpp index 80a8fcd9d..885692edf 100644 --- a/src/platform/qt/ShaderSelector.cpp +++ b/src/platform/qt/ShaderSelector.cpp @@ -19,8 +19,8 @@ #include #include +#include #include -#include "platform/video-backend.h" #if defined(BUILD_GL) || defined(BUILD_GLES2)