Some Renaming/Moving

This commit is contained in:
TheBrokenRail 2024-11-18 01:56:11 -05:00
parent bbae01a471
commit ecbbcef203
12 changed files with 17 additions and 18 deletions

View File

@ -21,7 +21,6 @@ endif()
# Add Core # Add Core
if(BUILD_MEDIA_LAYER_CORE) if(BUILD_MEDIA_LAYER_CORE)
add_subdirectory(gles)
add_subdirectory(core) add_subdirectory(core)
endif() endif()

View File

@ -3,11 +3,12 @@ project(media-layer-core)
# SDL Re-Implementation Using GLFW # SDL Re-Implementation Using GLFW
set(CORE_SRC set(CORE_SRC
src/base.cpp src/base.cpp
src/media.cpp src/window/media.cpp
src/cursor.cpp src/window/cursor.cpp
src/util.cpp src/window/util.cpp
src/events.cpp src/window/events.cpp
src/offscreen.cpp src/window/offscreen.cpp
src/window/gles.cpp
src/audio/api.cpp src/audio/api.cpp
src/audio/engine.cpp src/audio/engine.cpp
src/audio/file.cpp src/audio/file.cpp
@ -28,7 +29,6 @@ target_link_libraries(media-layer-core-real
PUBLIC PUBLIC
media-layer-headers media-layer-headers
reborn-util reborn-util
GLESv1_CM
dl dl
PRIVATE PRIVATE
"${OPENAL_LIBRARY}" "${OPENAL_LIBRARY}"

View File

@ -4,7 +4,7 @@
#include <libreborn/libreborn.h> #include <libreborn/libreborn.h>
#include "media.h" #include "window/media.h"
// SDL Is Replaced With GLFW // SDL Is Replaced With GLFW
@ -22,7 +22,7 @@ int media_SDL_PollEvent(SDL_Event *event) {
// Poll Event // Poll Event
int ret; int ret;
if (queue.size() > 0) { if (!queue.empty()) {
*event = queue[0]; *event = queue[0];
queue.erase(queue.begin()); queue.erase(queue.begin());
ret = 1; ret = 1;

View File

@ -4,6 +4,8 @@
#include <libreborn/libreborn.h> #include <libreborn/libreborn.h>
#include "media.h"
// Load GL Function // Load GL Function
unsigned int media_context_id = 0; unsigned int media_context_id = 0;
#define GL_FUNC(name, return_type, args) \ #define GL_FUNC(name, return_type, args) \
@ -13,6 +15,9 @@ unsigned int media_context_id = 0;
static unsigned int old_context = 0; \ static unsigned int old_context = 0; \
if (!func || old_context != media_context_id) { \ if (!func || old_context != media_context_id) { \
old_context = media_context_id; \ old_context = media_context_id; \
if (glfw_window == nullptr) { \
IMPOSSIBLE(); \
} \
func = (real_##name##_t) glfwGetProcAddress(#name); \ func = (real_##name##_t) glfwGetProcAddress(#name); \
if (!func) { \ if (!func) { \
ERR("Error Resolving OpenGL Function: " #name); \ ERR("Error Resolving OpenGL Function: " #name); \

View File

@ -2,7 +2,7 @@
#include <unistd.h> #include <unistd.h>
#include "media.h" #include "media.h"
#include "audio/engine.h" #include "../audio/engine.h"
// Window // Window
GLFWwindow *glfw_window = nullptr; GLFWwindow *glfw_window = nullptr;

View File

@ -1,5 +0,0 @@
project(media-layer-gles)
# Build
add_library(GLESv1_CM OBJECT src/passthrough.cpp)
target_link_libraries(GLESv1_CM PRIVATE glfw media-layer-headers reborn-util)

View File

@ -7,8 +7,8 @@ set(MEDIA_LAYER_TRAMPOLINE_SRC src/media-layer-core.cpp src/GLESv1_CM.cpp)
if(BUILD_NATIVE_COMPONENTS) if(BUILD_NATIVE_COMPONENTS)
# Host Component # Host Component
add_library(media-layer-trampoline src/host/host.cpp ${MEDIA_LAYER_TRAMPOLINE_SRC}) add_library(media-layer-trampoline src/host/host.cpp ${MEDIA_LAYER_TRAMPOLINE_SRC})
target_link_libraries(media-layer-trampoline reborn-util media-layer-core GLESv1_CM trampoline-headers) target_link_libraries(media-layer-trampoline reborn-util media-layer-core trampoline-headers)
target_compile_definitions(media-layer-trampoline PRIVATE -DMEDIA_LAYER_TRAMPOLINE_HOST) target_compile_definitions(media-layer-trampoline PRIVATE MEDIA_LAYER_TRAMPOLINE_HOST)
# Install # Install
install(TARGETS media-layer-trampoline DESTINATION "${MCPI_LIB_DIR}") install(TARGETS media-layer-trampoline DESTINATION "${MCPI_LIB_DIR}")
elseif(BUILD_ARM_COMPONENTS) elseif(BUILD_ARM_COMPONENTS)
@ -22,7 +22,7 @@ elseif(BUILD_ARM_COMPONENTS)
trampoline-headers trampoline-headers
rt rt
) )
target_compile_definitions(media-layer-core PRIVATE -DMEDIA_LAYER_TRAMPOLINE_GUEST) target_compile_definitions(media-layer-core PRIVATE MEDIA_LAYER_TRAMPOLINE_GUEST)
# Install # Install
if(MCPI_USE_MEDIA_LAYER_TRAMPOLINE) if(MCPI_USE_MEDIA_LAYER_TRAMPOLINE)
install(TARGETS media-layer-core DESTINATION "${MCPI_LIB_DIR}") install(TARGETS media-layer-core DESTINATION "${MCPI_LIB_DIR}")