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
if(BUILD_MEDIA_LAYER_CORE)
add_subdirectory(gles)
add_subdirectory(core)
endif()

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
#include <unistd.h>
#include "media.h"
#include "audio/engine.h"
#include "../audio/engine.h"
// Window
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)
# Host Component
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_compile_definitions(media-layer-trampoline PRIVATE -DMEDIA_LAYER_TRAMPOLINE_HOST)
target_link_libraries(media-layer-trampoline reborn-util media-layer-core trampoline-headers)
target_compile_definitions(media-layer-trampoline PRIVATE MEDIA_LAYER_TRAMPOLINE_HOST)
# Install
install(TARGETS media-layer-trampoline DESTINATION "${MCPI_LIB_DIR}")
elseif(BUILD_ARM_COMPONENTS)
@ -22,7 +22,7 @@ elseif(BUILD_ARM_COMPONENTS)
trampoline-headers
rt
)
target_compile_definitions(media-layer-core PRIVATE -DMEDIA_LAYER_TRAMPOLINE_GUEST)
target_compile_definitions(media-layer-core PRIVATE MEDIA_LAYER_TRAMPOLINE_GUEST)
# Install
if(MCPI_USE_MEDIA_LAYER_TRAMPOLINE)
install(TARGETS media-layer-core DESTINATION "${MCPI_LIB_DIR}")