Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How Corona does cross-platform?
Started by lsoaresesilva7 Mar 15 2017 03:36 AM

- - - - -
5 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

lsoaresesilva7

[GLOBAL: userInfoPane.html]
lsoaresesilva7
  • Observer

  • 23 posts
  • Corona SDK

Hello, I've searched for this information but could not found any. I know that phonegap/cordova uses a webview to do cross-platform support and Xamarin uses mono. But how Corona does it cross-platform support?



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 22,306 posts
  • Corona Staff

Corona uses a language called Lua which is available more many different platforms. On top of that we use OpenGL a technology available almost everywhere to perform our screen updates. Then we have a native layer on top to make it all work on the various platforms that we support.

 

Our build process has been programmed to output .APK's for Android, .EXE's for Windows, .app's for macOS and iOS and so on.

 

Rob



[TOPIC: post.html]
#3

lsoaresesilva7

[GLOBAL: userInfoPane.html]
lsoaresesilva7
  • Observer

  • 23 posts
  • Corona SDK

Thanks Rob, so the code we write in Lua is somewhow "transpiled" to Java for Android and Object-c for iOS, to generate the binaries?



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 22,306 posts
  • Corona Staff

Lua isn't transcoded to other languages. Instead a Lua runtime processes the Lua bytecode and makes calls to native code to do the work. (this is a generalization), the display.newImageRect() function will make a call thru Lua's runtime bridge to code, written in C++ (other things could be in Objective C or Java) that calls the statements to generate a texture object from the passed file name. The texture gets passed back to the Lua side so you can manipulate it.

 

Rob



[TOPIC: post.html]
#5

lsoaresesilva7

[GLOBAL: userInfoPane.html]
lsoaresesilva7
  • Observer

  • 23 posts
  • Corona SDK

Rob, so every plataform Corona supports has natively a Lua VM/Interpreter or it is shipped with our application? Is there any documentation for this Lua's runtime so I can see how it does the cross-thing?



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 22,306 posts
  • Corona Staff

The lua engine is built in to each app you build. There might be some information in our Corona Enterprise documentation that could be helpful.

 

https://docs.coronalabs.com/native/index.html

 

Rob




[topic_controls]
[/topic_controls]