displaydev.androidsdl

Android SDL display: Activity orientation from logical aspect, surface scale.

MCU-shaped contract: the app chooses orientation via panel size / rotation (logical width vs height). The Activity is locked to that aspect; tilting the phone does not change it — the user turns the device to match.

class displaydev.androidsdl.AndroidSDLDisplay(width=320, height=240, rotation=0, color_depth=16, title='SDL2 Display', scale=1.0, window_flags=4, render_flags=6, x=805240832, y=805240832, *, quiet=False)[source]

Bases: SDLDisplay

SDLDisplay for Android: aspect → Activity lock, no RenderCopyEx rotate.

show(_timer=None)[source]

Show the display.

fill_rect(x, y, w, h, c)[source]

Fill by uploading pixels into the display texture.

SDLDisplay fills with SDL_RenderFillRect on a render target, which the GPU queues. On a phone, an Adreno GPU sometimes lost the commands queued while the Activity was still settling after the turn to landscape, leaving a run of keys unpainted until they were touched. An upload is applied in order and never queued, so it can’t be lost.

init()[source]

Wait for drawable aspect, then apply MCU logical size for letterboxing.