New Mac/iOS/Windows App

Hi,
I’m starting a new project which is a graphical app for Mac, iOS and Windows. I would normally use Qt, thinking of trying using Rem Objects tools (Fire, Silver, Sugar). I’m hoping to be able to use Apple’s Metal on Mac/iOS and Microsoft’s DX12 on Windows.

Are there any examples of a multi-platform app like this? I would like to see how a project can be organized with shared code and how platform specific code is abstracted.

Thanks for any help!
Brett

Hi,

There’s a sample in
C:\Users\Public\Documents\RemObjects Samples\RemObjects Silver\Cross-Platform\Calculator

that shows a calculator that does just that. It has shared logic (the calculator class) and different guis for different platforms.

1 Like

Since we do have the samples in the Fire distro yet, i’m attaching the sample in question…

Calculator.zip (1.2 MB)

1 Like

Awesome, thank you!

1 Like

A follow-up:

Do I understand correctly that Silver compiles down to native code on all platforms whereas C# remains managed on all platforms?

Silver compiles down to native code on iOS/OSX. On Android and Java it compiles to jar/dalvik. When targetting .NET it generates a .NET executable.

Thanks for super fast reply!

Okay great. And is it possible to mix RemObjects C# source files and Silver files together on Windows?

The reason I ask is my app is heavy 3D with lots of DX12 I need to call and doing that with C# is likely going to be less painful than porting everything to Silver. But the core “engine” of my app I’m thinking to be in Silver.

Yes. Elements lets you combine all 3 languages in a single project.

Okay.

And sorry, realized one question above not answered yet:

If I use C# does it remain managed on all platforms? Or does it also compile down to native on iOS?

Is there a C# Calculator example for multiple platforms?

All three languages compile down to the same code. So whether you write C#, Silver or Oxygene code, it will be native on iOS/Mac.

Attaching.

Calculator.zip (1.2 MB)

Okay, thanks for the post. Interesting.

So the mono lib is only then used on Windows where it’s a .NET executable? But on Mac, iOS it’s native and Android Java with no mono?

Sorry to drag this out, want to confirm. I see the mono lib inside the bundle of Fire on Mac (which I think was built with C#), so want to be sure that I understand your reply.

Core Fire is build in C# and a native Mac app, but the compiler is not — it’s .NET based. That’s why Fire itself uses Mono to host the compiler and related lowlevel IDE infrastructure that depends on the compiler (such as Code Completion). Mac apps created with Elements — regardless of language — are pure native Mac apps.

Thanks for clearing this up!

1 Like

FWIW, we’re using this: http://docs.elementscompiler.com/Tools/Marzipan/ to interact between the native app and the hosted Mono inside it.