Solar2D (formerly Corona SDK)

repository·master·Indexed 25 days ago

https://github.com/coronalabs/corona

A free, open-source, cross-platform 2D game engine using Lua for scripting. Designed for rapid development of apps and games for mobile (iOS, Android), desktop (Mac, Windows, Linux), HTML5, and connected TVs. The repository includes various utilities and external libraries such as create-dmg for building macOS disk images, ios-sim for launching apps in the iOS Simulator, ANGLE for OpenGL ES 2.0 translation, and rcedit for modifying Windows EXE/DLL metadata.

Tokens
50.8K
Snippets
97
Records
330
Agent score
82%

What's inside Solar2D

  1. Overview of ALmixer

    master

    ALmixer (also known as SDL-OpenAL-Mixer) is a cross-platform audio library built on top of OpenAL. It provides a simplified API inspired by SDL_mixer for playing and managing sounds without requiring direct management of OpenAL sources, buffers, or buffer queuing.

    Key features include:

    • Unified Playback API: Unlike SDL_mixer, ALmixer does not distinguish between 'music' and 'sounds' at the API level. Instead, you specify via the load API whether a resource should be loaded as a stream or preloaded. This allows for multiple simultaneous streaming sources (e.g., music and speech).
    • OpenAL Integration: Every 'Channel' maps to an OpenAL source ID. You can retrieve these IDs to apply OpenAL 3D effects like position and Doppler directly.
    • Flexible Callbacks: Callbacks support a void* userdata (context) pointer, allowing you to pass custom data through callback functions.
    • Format Support: Utilizes SDL_sound to decode formats such as WAV, MP3, AAC, MP4, and OGG.
  2. Overview of the Corona.LiveServer Project Structure

    master

    The Corona.LiveServer project is a Microsoft Foundation Class (MFC) application. It is structured as a standard Visual C++ project with the following key components:

    • Main Application Logic: Defined in Corona.LiveServer.h and Corona.LiveServer.cpp via the CCoronaLiveServerApp class.
    • Main Dialog: The application's primary user interface is managed by the CCoronaLiveServerDlg class, defined in Corona.LiveServerDlg.h and Corona.LiveServerDlg.cpp. The dialog template is stored in Corona.LiveServer.rc.
    • Resources: Icons, bitmaps, and cursors are managed in Corona.LiveServer.rc and the res/ directory. Non-editable resources should be placed in res\CoronaLiveServer.rc2.
    • Networking: The application includes support for establishing communications over TCP/IP networks using Windows Sockets.
    • Build Configuration: The project uses Corona.LiveServer.vcxproj for build settings and StdAfx.h/StdAfx.cpp for precompiled headers (PCH).
  3. Overview of ANGLE

    master
    ANGLE (Almost Native Graphics Layer Engine) translates OpenGL ES 2.0 API calls to DirectX 9 or DirectX 11 API calls. This allows Windows users to run WebGL and other OpenGL ES 2.0 content seamlessly via hardware acceleration through Direct3D. It is a conformant implementation of the OpenGL ES 2.0 and EGL 1.4 specifications.
  4. Overview of libogg and libvorbis in Corona

    master

    Corona uses the libogg and libvorbis libraries on the Win32 platform to handle Ogg audio files:

    • libogg (v1.3.2): Used to decode the *.ogg container format.
    • libvorbis (v1.3.5): Used to decode the Ogg Vorbis audio data contained within the *.ogg file.

    Note that libvorbis depends on libogg and both library folders must be located side-by-side for successful compilation.

  5. Overview of Sundown Markdown-to-HTML Converter

    master
    Sundown is a high-performance Markdown-to-HTML converter written in C. It is designed to be lightweight with no third-party library dependencies. In the context of the Corona SDK/Solar2D, it is used by the Windows Corona Simulator to render server markdown responses within the HtmlMessageDialog.
  6. Understand Reachability limitations and behavior

    master

    The Reachability sample demonstrates how to use the System Configuration framework to monitor the network state of an iPhone or iPod touch.

    Key Limitations:

    • Connectivity vs. Interface: Reachability cannot guarantee that you can connect to a specific host. It only indicates if an interface is available that might allow a connection, and whether that interface is a Wireless Wide Area Network (WWAN) like EDGE or 3G.
    • DNS Dependency: Reachability must use DNS to resolve a hostname before determining reachability. During this resolution period, the API will return NotReachable. This may cause a visible delay on certain networks.
    • Peer-to-Peer: The SCNetworkReachability API does not currently detect support for GameKit Peer-to-Peer networking over Bluetooth.
  7. Use DotZLib features: Inflation, Deflation, and Streaming

    master

    The DotZLib library provides a .NET wrapper for ZLib1.dll with the following capabilities:

    • Memory Buffers: Support for inflating and deflating memory buffers.
    • Streaming: .NET streaming wrappers for gz streams.
    • Checksums: Wrappers for the checksum components of zlib.

    For implementation examples, refer to DotZLib/UnitTests.cs within the repository.

  8. Install ZLIB 1.2.3 via AS400 SAVF file

    master

    To install ZLIB using an AS400 save file (*SAVF), follow these steps:

    1. On the AS400: Create the library and a work save file:
      CRTLIB LIB(ZLIB) TYPE(PROD) TEXT('ZLIB compression API library')
      CRTSAVF FILE(ZLIB/ZLIBSAVF)
    2. On a PC: Unpack the save file image to a file named ZLIBSAVF and upload it to the AS400 using FTP in BINARY mode.
    3. On the AS400: Extract the objects into the library:
      RSTOBJ OBJ(*ALL) SAVLIB(ZLIB) DEV(*SAVF) SAVF(ZLIB/ZLIBSAVF) RSTLIB(ZLIB)
    4. Customize and Compile:
      • Edit the CL member ZLIB/TOOLS(COMPILE) to adjust parameters if necessary.
      • Compile the control program:
        CRTCLPGM PGM(ZLIB/COMPILE) SRCFILE(ZLIB/TOOLS) SRCMBR(COMPILE)
      • Execute the program to generate the service program:
        CALL PGM(ZLIB/COMPILE)