mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-03-23 05:58:40 +01:00
OpenGL is working on surface change, vulkan still no
This commit is contained in:
parent
dc885ca674
commit
37f73070a9
@ -317,7 +317,7 @@ void Java_org_citra_citra_1emu_NativeLibrary_surfaceChanged(JNIEnv* env,
|
||||
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (notify && system.IsPoweredOn()) {
|
||||
system.GPU().Renderer().NotifySurfaceChanged();
|
||||
system.GPU().Renderer().NotifySurfaceChanged(false);
|
||||
}
|
||||
|
||||
LOG_INFO(Frontend, "Surface changed");
|
||||
@ -325,16 +325,16 @@ void Java_org_citra_citra_1emu_NativeLibrary_surfaceChanged(JNIEnv* env,
|
||||
|
||||
void Java_org_citra_citra_1emu_NativeLibrary_enableSecondWindow(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,jobject surf) {
|
||||
s_secondary_surface = ANativeWindow_fromSurface(env, surf);
|
||||
secondary_enabled = true;
|
||||
bool notify = false;
|
||||
if (second_window) {
|
||||
notify = second_window->OnSurfaceChanged(s_secondary_surface);
|
||||
}
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (notify && system.IsPoweredOn()) {
|
||||
system.GPU().Renderer().NotifySurfaceChanged();
|
||||
}
|
||||
s_secondary_surface = ANativeWindow_fromSurface(env, surf);
|
||||
secondary_enabled = true;
|
||||
bool notify = false;
|
||||
if (second_window) {
|
||||
notify = second_window->OnSurfaceChanged(s_secondary_surface);
|
||||
}
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (notify && system.IsPoweredOn()) {
|
||||
system.GPU().Renderer().NotifySurfaceChanged(true);
|
||||
}
|
||||
|
||||
LOG_INFO(Frontend, "Secondary Surface changed");
|
||||
}
|
||||
@ -345,7 +345,13 @@ void Java_org_citra_citra_1emu_NativeLibrary_disableSecondWindow(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
|
||||
secondary_enabled = false;
|
||||
// how do I delete the window? TODO
|
||||
if (s_secondary_surface != nullptr) {
|
||||
ANativeWindow_release(s_secondary_surface);
|
||||
s_secondary_surface = nullptr;
|
||||
if (second_window) {
|
||||
second_window->OnSurfaceChanged(s_secondary_surface);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO(Frontend, "Secondary Surface Disabled");
|
||||
}
|
||||
|
@ -64,7 +64,8 @@ public:
|
||||
virtual void Sync() {}
|
||||
|
||||
/// This is called to notify the rendering backend of a surface change
|
||||
virtual void NotifySurfaceChanged() {}
|
||||
// if second == true then it is the second screen
|
||||
virtual void NotifySurfaceChanged(bool second) {}
|
||||
|
||||
/// Returns the resolution scale factor relative to the native 3DS screen resolution
|
||||
u32 GetResolutionScaleFactor();
|
||||
|
@ -1129,4 +1129,10 @@ bool RendererVulkan::TryRenderScreenshotWithHostMemory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void RendererVulkan::NotifySurfaceChanged(bool second) {
|
||||
if (second && second_window) second_window->NotifySurfaceChanged();
|
||||
if (!second) main_window.NotifySurfaceChanged();
|
||||
|
||||
}
|
||||
|
||||
} // namespace Vulkan
|
||||
|
@ -74,10 +74,7 @@ public:
|
||||
return &rasterizer;
|
||||
}
|
||||
|
||||
void NotifySurfaceChanged() override {
|
||||
main_window.NotifySurfaceChanged();
|
||||
if (second_window) second_window->NotifySurfaceChanged();
|
||||
}
|
||||
void NotifySurfaceChanged(bool second) override;
|
||||
|
||||
void SwapBuffers() override;
|
||||
void TryPresent(int timeout_ms, bool is_secondary) override {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user