mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
opengle es now default some edge to edge srtuff
This commit is contained in:
@@ -717,7 +717,7 @@ struct EmulatorSettings {
|
||||
int frame_rate_limit = 60; // 30 or 60
|
||||
int system_memory_mib = 64; // 64 or 128
|
||||
std::string tcg_thread = "multi"; // "single" or "multi"
|
||||
std::string renderer = "vulkan"; // "vulkan" or "opengl"
|
||||
std::string renderer = "opengl"; // "vulkan" or "opengl"
|
||||
std::string filtering = "linear"; // "linear" or "nearest"
|
||||
bool use_dsp = false;
|
||||
bool hrtf = true;
|
||||
|
||||
@@ -67,7 +67,7 @@ static void xemu_settings_apply_defaults(void)
|
||||
g_config.input.keyboard_controller_scancode_map.rstick_down = 14;
|
||||
g_config.input.keyboard_controller_scancode_map.rtrigger = 18;
|
||||
|
||||
g_config.display.renderer = CONFIG_DISPLAY_RENDERER_VULKAN;
|
||||
g_config.display.renderer = CONFIG_DISPLAY_RENDERER_OPENGL;
|
||||
g_config.display.filtering = CONFIG_DISPLAY_FILTERING_LINEAR;
|
||||
g_config.display.quality.surface_scale = 1;
|
||||
g_config.display.window.fullscreen_on_startup = false;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.izzy2lost.x1box
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
|
||||
internal object EdgeToEdgeHelper {
|
||||
fun enable(activity: Activity) {
|
||||
WindowCompat.setDecorFitsSystemWindows(activity.window, false)
|
||||
}
|
||||
|
||||
fun applySystemBarPadding(view: View) {
|
||||
val initialLeft = view.paddingLeft
|
||||
val initialTop = view.paddingTop
|
||||
val initialRight = view.paddingRight
|
||||
val initialBottom = view.paddingBottom
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(view) { target, insets ->
|
||||
val bars = insets.getInsets(
|
||||
WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()
|
||||
)
|
||||
target.setPadding(
|
||||
initialLeft + bars.left,
|
||||
initialTop + bars.top,
|
||||
initialRight + bars.right,
|
||||
initialBottom + bars.bottom
|
||||
)
|
||||
insets
|
||||
}
|
||||
ViewCompat.requestApplyInsets(view)
|
||||
}
|
||||
}
|
||||
@@ -125,6 +125,8 @@ class GameLibraryActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_game_library)
|
||||
EdgeToEdgeHelper.enable(this)
|
||||
EdgeToEdgeHelper.applySystemBarPadding(findViewById(R.id.library_scroll))
|
||||
|
||||
if (tryRestartLastGameFromIntent()) {
|
||||
return
|
||||
|
||||
@@ -17,11 +17,13 @@ import android.widget.BaseAdapter
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.ListView
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import org.libsdl.app.SDLActivity
|
||||
import org.libsdl.app.SDLSurface
|
||||
import java.io.File
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
@@ -52,6 +54,15 @@ class MainActivity : SDLActivity(), InputManager.InputDeviceListener {
|
||||
private var startupSnapshotSlot: Int? = null
|
||||
private var startupSnapshotLoadScheduled = false
|
||||
|
||||
override fun createSDLSurface(context: Context): SDLSurface {
|
||||
return super.createSDLSurface(context).apply {
|
||||
layoutParams = RelativeLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val requestedSlot = intent?.getIntExtra(EXTRA_AUTO_LOAD_SNAPSHOT_SLOT, 0) ?: 0
|
||||
|
||||
@@ -78,6 +78,8 @@ class SettingsActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_settings)
|
||||
EdgeToEdgeHelper.enable(this)
|
||||
EdgeToEdgeHelper.applySystemBarPadding(findViewById(R.id.settings_scroll))
|
||||
|
||||
val toggleGraphicsApi = findViewById<MaterialButtonToggleGroup>(R.id.toggle_graphics_api)
|
||||
val toggleFiltering = findViewById<MaterialButtonToggleGroup>(R.id.toggle_filtering)
|
||||
@@ -109,7 +111,7 @@ class SettingsActivity : AppCompatActivity() {
|
||||
dropdownEepromVideoStandard = findViewById(R.id.dropdown_eeprom_video_standard)
|
||||
|
||||
// Load current values
|
||||
val renderer = prefs.getString("setting_renderer", "vulkan") ?: "vulkan"
|
||||
val renderer = prefs.getString("setting_renderer", "opengl") ?: "opengl"
|
||||
if (renderer == "opengl") {
|
||||
toggleGraphicsApi.check(R.id.btn_renderer_opengl)
|
||||
} else {
|
||||
|
||||
@@ -149,6 +149,8 @@ class SetupWizardActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_setup_wizard)
|
||||
EdgeToEdgeHelper.enable(this)
|
||||
EdgeToEdgeHelper.applySystemBarPadding(findViewById(R.id.setup_scroll))
|
||||
|
||||
val setupRoot: View = findViewById(R.id.setup_root)
|
||||
val setupCard: View = findViewById(R.id.setup_card)
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/setup_wizard_background"
|
||||
android:fitsSystemWindows="true">
|
||||
android:background="@drawable/setup_wizard_background">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/library_scroll"
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/setup_wizard_background"
|
||||
android:fitsSystemWindows="true">
|
||||
android:background="@drawable/setup_wizard_background">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/settings_scroll"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
android:id="@+id/setup_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/setup_wizard_background"
|
||||
android:fitsSystemWindows="true">
|
||||
android:background="@drawable/setup_wizard_background">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/setup_scroll"
|
||||
|
||||
@@ -267,16 +267,16 @@ void pgraph_clear_dirty_reg_map(PGRAPHState *pg)
|
||||
static CONFIG_DISPLAY_RENDERER get_default_renderer(void)
|
||||
{
|
||||
#ifdef __ANDROID__
|
||||
#ifdef CONFIG_VULKAN
|
||||
if (renderers[CONFIG_DISPLAY_RENDERER_VULKAN]) {
|
||||
return CONFIG_DISPLAY_RENDERER_VULKAN;
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_OPENGL
|
||||
if (renderers[CONFIG_DISPLAY_RENDERER_OPENGL]) {
|
||||
return CONFIG_DISPLAY_RENDERER_OPENGL;
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_VULKAN
|
||||
if (renderers[CONFIG_DISPLAY_RENDERER_VULKAN]) {
|
||||
return CONFIG_DISPLAY_RENDERER_VULKAN;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#ifdef CONFIG_OPENGL
|
||||
if (renderers[CONFIG_DISPLAY_RENDERER_OPENGL]) {
|
||||
|
||||
@@ -304,9 +304,17 @@ void sdl2_window_resize(struct sdl2_console *scon)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
/* Keep the Android activity surface full-screen. The guest framebuffer
|
||||
* size changes frequently (e.g. 640x480 boot surfaces), but shrinking the
|
||||
* SDL window to match it makes the app render into a corner-sized window.
|
||||
*/
|
||||
return;
|
||||
#else
|
||||
SDL_SetWindowSize(scon->real_window,
|
||||
surface_width(scon->surface),
|
||||
surface_height(scon->surface));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sdl2_redraw(struct sdl2_console *scon)
|
||||
|
||||
Reference in New Issue
Block a user