SFML / SFML

Simple and Fast Multimedia Library
https://www.sfml-dev.org/
zlib License
10.29k stars 1.73k forks source link

Embedding SFML windows within existing Swift (iOS) application. #1500

Open seivan opened 6 years ago

seivan commented 6 years ago

You should be able to use just a UIViewController and not rely on a full blown UIApplicationMain and UIApplicationDelegate

I need SFML to play along side the rest of an iOS application. For that purpose it would be nice if SFML could offer just a UIViewController to use. I could either use it as a rootViewController on a separate UIWindow I make, or set it as a childVC.

The issue I got is that I need to control the loop (by calling it through CADisplayLink) and more importantly choose when I want to present it or not. As it is now (unless I mistaken) SFML has its own main.mm that calls UIApplicationMain with its own UIApplicationDelegate.

All of those are great if you want SFML to work out of the box, and I am not asking to change those, only offer an option to get a UIViewController or even just a UIView instead. Everything that works today could also work with just those.

Your environment

seivan commented 6 years ago

Sorry my bad.

mantognini commented 6 years ago

Makes sense, it would be similar to the existing feature on macOS.

On Sat, 20 Oct 2018, 09:48 Lukas Dürrenberger, notifications@github.com wrote:

What do you mean?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SFML/SFML/issues/1500#issuecomment-431561960, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqU69HzPvFxpFuqx2QXK1AkKsSUYVtcks5umuNvgaJpZM4XusJm .

eXpl0it3r commented 6 years ago

@seivan Are you interested in providing an implementation for this?

seivan commented 6 years ago

Yeah I could take a stab but I want to emphasize that both approaches are useful so I rather provide an implementation as an alternative rather than a replacement. Meaning allowing the user pick which approach to take when setting things up.

Sent from an iPhone on the go.

On 26 Nov 2018, at 18:25, Lukas Dürrenberger notifications@github.com wrote:

@seivan Are you interested in providing an implementation for this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.