Skip to content
Li, Xizhi edited this page Jun 1, 2016 · 5 revisions

NPL C/C++ Architecture

This section covers cross-platform modules written in C/C++. These modules are exposed via NPL scripting API so that they are called via NPL.

C++ Modules

  • NPL Scripting Engine:
    • NPL state (or NPL virtual code environment): a single NPL thread, has its own memory allocators and manages all files it load.
      • NPL state can load NPL/Lua script or C++ dll.
      • Mono state: can load C# dll.
    • NPL Networking: Manage all local or remote NPL states via NPL HTTP/TCP connections.
  • ParaScripting API:
    • C++ --> NPL: exposing all functions to NPL scripting environment.
    • See all C++ bindings in NPL scripting reference
  • Graphics Engine:

All GUI objects must be created in the main NPL thread, which is the same as renderer thread.

  • Renderer: buffer, textures, draw 3d/2d api, fonts, etc.
    • DirectX fully supported renderer.
    • OpenGL renderer: a cross-platform renderer(limited functions used in our linux/android build)
  • 2D Engine: GUIBase is the base class to all C++ class
    • GUIRoot: root node of all GUI objects.
    • GUIContainer, GUIButton, GUIText, ...
Clone this wiki locally