mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
Snapshot the refresh-experimental Android app (Gradle + JNI + Android-only
3rdparty) into platforms/android/. Delete its vendored PCSX2 core copy and
relocate the ~24 genuinely Android-specific core additions (Oboe audio, Android
stubs, EGL-Android GL context, NEON SPU2, GSGPUProfile, VU1Fingerprint, Android
HTTP downloader) into the root core, guarded by if(ANDROID) in
pcsx2/CMakeLists.txt and common/CMakeLists.txt.
The superseded arm64 JIT experiment (arm64/mac/* IR-VU backend, split
aVU0/aDMAC/aVTLB/aR5900COP*) is dropped: the root macOS arm64 JIT (127 unique
commits, newer) is the canonical recompiler.
Rewire the Android native build to a thin CMakeLists that sources the root
{common,pcsx2,3rdparty} instead of the deleted vendored copy.
NOT yet compiled against a real NDK -- build validation is CI's job.
See REFACTOR_STATUS.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
48 lines
1.8 KiB
C++
48 lines
1.8 KiB
C++
#include "GLContextEGLAndroid.h"
|
|
#include "common/Console.h"
|
|
#include <android/native_window.h>
|
|
|
|
GLContextEGLAndroid::GLContextEGLAndroid(const WindowInfo& wi) : GLContextEGL(wi) {}
|
|
GLContextEGLAndroid::~GLContextEGLAndroid() = default;
|
|
|
|
std::unique_ptr<GLContext> GLContextEGLAndroid::Create(const WindowInfo& wi, const Version* versions_to_try,
|
|
size_t num_versions_to_try)
|
|
{
|
|
std::unique_ptr<GLContextEGLAndroid> context = std::make_unique<GLContextEGLAndroid>(wi);
|
|
if (!context->Initialize(std::span<const Version>(versions_to_try, num_versions_to_try), nullptr))
|
|
return nullptr;
|
|
|
|
return context;
|
|
}
|
|
|
|
std::unique_ptr<GLContext> GLContextEGLAndroid::CreateSharedContext(const WindowInfo& wi, Error* error)
|
|
{
|
|
std::unique_ptr<GLContextEGLAndroid> context = std::make_unique<GLContextEGLAndroid>(wi);
|
|
context->m_display = m_display;
|
|
|
|
if (!context->CreateContextAndSurface(m_version, m_context, false))
|
|
return nullptr;
|
|
|
|
return context;
|
|
}
|
|
|
|
void GLContextEGLAndroid::ResizeSurface(u32 new_surface_width, u32 new_surface_height)
|
|
{
|
|
GLContextEGL::ResizeSurface(new_surface_width, new_surface_height);
|
|
}
|
|
|
|
EGLNativeWindowType GLContextEGLAndroid::GetNativeWindow(EGLConfig config)
|
|
{
|
|
EGLint native_visual_id = 0;
|
|
if (!eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &native_visual_id))
|
|
{
|
|
Console.Error("Failed to get native visual ID");
|
|
return 0;
|
|
}
|
|
|
|
ANativeWindow_setBuffersGeometry(static_cast<ANativeWindow*>(m_wi.window_handle), 0, 0, static_cast<int32_t>(native_visual_id));
|
|
m_wi.surface_width = ANativeWindow_getWidth(static_cast<ANativeWindow*>(m_wi.window_handle));
|
|
m_wi.surface_height = ANativeWindow_getHeight(static_cast<ANativeWindow*>(m_wi.window_handle));
|
|
return static_cast<EGLNativeWindowType>(m_wi.window_handle);
|
|
}
|