mirror of https://github.com/mgba-emu/mgba.git
Get RPi EGL port building again
This commit is contained in:
parent
8f241e2cfb
commit
2f39a57567
|
@ -18,12 +18,17 @@ file(GLOB PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-*.c)
|
|||
set(PLATFORM_LIBRARY "${SDL_LIBRARY};${SDLMAIN_LIBRARY}")
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/platform/sdl)
|
||||
|
||||
if(BUILD_RASPI AND BUILD_EGL)
|
||||
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/egl-main.c)
|
||||
set(OPENGL_LIBRARY "-lEGL -lGLESv2 -lbcm_host")
|
||||
set(OPENGL_INCLUDE_DIR "")
|
||||
if(BUILD_RASPI)
|
||||
add_definitions(-DBUILD_RASPI)
|
||||
elseif(BUILD_BBB OR BUILD_RASPI)
|
||||
set(EGL_MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/egl-main.c)
|
||||
set(EGL_LIBRARY "-lEGL -lGLESv2 -lbcm_host")
|
||||
add_executable(${BINARY_NAME}-rpi ${PLATFORM_SRC} ${EGL_MAIN_SRC})
|
||||
target_link_libraries(${BINARY_NAME}-rpi ${BINARY_NAME} ${PLATFORM_LIBRARY} ${EGL_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(BUILD_BBB OR BUILD_RASPI)
|
||||
enable_language(ASM)
|
||||
add_definitions(-DCOLOR_16_BIT -DCOLOR_5_6_5)
|
||||
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sw-main.c)
|
||||
else()
|
||||
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/gl-main.c)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "sdl-audio.h"
|
||||
#include "sdl-events.h"
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include <GLES2/gl2.h>
|
||||
#include <EGL/egl.h>
|
||||
|
||||
|
@ -76,7 +76,6 @@ int main(int argc, char** argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
struct GBAThread context;
|
||||
struct GBAVideoEGLRenderer renderer;
|
||||
|
||||
if (!_GBAEGLInit(&renderer)) {
|
||||
|
@ -84,16 +83,19 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
GBAVideoSoftwareRendererCreate(&renderer.d);
|
||||
|
||||
context.fd = fd;
|
||||
context.fname = fname;
|
||||
context.useDebugger = 0;
|
||||
context.renderer = &renderer.d.d;
|
||||
context.frameskip = 0;
|
||||
context.sync.videoFrameWait = 0;
|
||||
context.sync.audioWait = 1;
|
||||
context.startCallback = _GBASDLStart;
|
||||
context.cleanCallback = _GBASDLClean;
|
||||
context.userData = &renderer;
|
||||
struct GBAThread context = {
|
||||
.fd = fd,
|
||||
.fname = fname,
|
||||
.biosFd = -1,
|
||||
.useDebugger = 0,
|
||||
.renderer = &renderer.d.d,
|
||||
.frameskip = 0,
|
||||
.sync.videoFrameWait = 0,
|
||||
.sync.audioWait = 0,
|
||||
.startCallback = _GBASDLStart,
|
||||
.cleanCallback = _GBASDLClean,
|
||||
.userData = &renderer
|
||||
};
|
||||
GBAThreadStart(&context);
|
||||
|
||||
_GBAEGLRunloop(&context, &renderer);
|
Loading…
Reference in New Issue