We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4036 - Allow SDLActivity subclasses to specify the Runnable which invokes SDL_main
Summary: Allow SDLActivity subclasses to specify the Runnable which invokes SDL_main
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: don't know
Hardware: All Android (All)
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-10 08:32 UTC by Cole Campbell
Modified: 2018-01-20 20:27 UTC (History)
0 users

See Also:


Attachments
This patch adds a new createSDLMainRunnable() method to SDLActivity. (1.62 KB, text/plain)
2018-01-10 08:32 UTC, Cole Campbell
Details
Makes SDLInputConnection and DummyEdit public classes (13.72 KB, patch)
2018-01-20 20:27 UTC, Cole Campbell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cole Campbell 2018-01-10 08:32:49 UTC
Created attachment 3129 [details]
This patch adds a new createSDLMainRunnable() method to SDLActivity.

Currently, SDL on Android expects to find SDL_main somewhere in native code. When using SDL in a Xamarin application, however, what we really want to do is write our entrypoint in managed code. The easiest way to do this is to allow subclasses of SDLActivity to provide their own Runnable to the SDL thread, as in the attached patch.
Comment 1 Cole Campbell 2018-01-20 20:27:35 UTC
Created attachment 3149 [details]
Makes SDLInputConnection and DummyEdit public classes

I've added an additional patch that expands on the same basic idea as the first one; it makes SDLInputConnection and DummyEdit into public classes so that they can be overridden from the Xamarin end if their functionality needs to be extended. (In my case, I need to change the type of software keyboard that's displayed.)