Forráskód Böngészése

Added vector math library and updated the extensions overview

Björn Ritzl 6 éve
szülő
commit
cb3eb55789

BIN
docs/assets/Vector_Math_Library-Overview.pdf


+ 4 - 0
docs/en/en.json

@@ -516,6 +516,10 @@
                         "path": "/manuals/extensions-details",
                         "path": "/manuals/extensions-details",
                         "name": "Details"
                         "name": "Details"
                     },
                     },
+                    {
+                        "path": "/manuals/extensions-defold-sdk",
+                        "name": "Defold SDK"
+                    },
                     {
                     {
                         "path": "/manuals/extensions-best-practices",
                         "path": "/manuals/extensions-best-practices",
                         "name": "Best Practices"
                         "name": "Best Practices"

+ 31 - 0
docs/en/manuals/extensions-defold-sdk.md

@@ -0,0 +1,31 @@
+---
+title: Native extensions - Defold SDK
+brief: This manual describes how to work with the Defold SDK when creating native extensions.
+---
+
+# The Defold SDK
+
+The Defold SDK contains the required functionality to declare a native extension as well as interface with the low-level native platform layer on which the application runs and the high-level Lua layer in which the game logic is created.
+
+## Usage
+
+You use the Defold SDK by including the `dmsdk/sdk.h` header file:
+
+    #include <dmsdk/sdk.h>
+
+The header file is not publicly published but all of the available SDK functions are documented in our [API reference](/ref/dmExtension/). The SDK contains the following namespaces with functions:
+
+* [Align](/ref/dmAlign/) - Alignment macros. Use for compiler compatibility
+* [Array](/ref/dmArray/) - Templatized array with bounds checking.
+* [Buffer](/ref/dmBuffer/) - Buffer API for data buffers as the main way to communicate between systems. [Lua API](/ref/buffer/) for buffer creation also exists.
+* [Condition Variable](/ref/dmConditionVariable/) - API for platform independent mutex synchronization primitive.
+* [ConfigFile](/ref/dmConfigFile/) - Configuration file access functions. The configuration file is compiled version of the game.project file.
+* [Extension](/ref/dmExtension/) - Functions for creating and controlling engine native extension libraries.
+* [Graphics](/ref/dmGraphics/) - Platform specific native graphics functions.
+* [Hash](/ref/dmHash/) - Hash functions.
+* [Json](/ref/dmJson/) - API for platform independent parsing of json files.
+* [Log](/ref/dmLog/) - Logging functions.
+* [Mutex](/ref/dmMutex/) - API for platform independent mutex synchronization primitive
+* [Script](/ref/dmScript/) - Built-in scripting functions.
+* [Shared Library](/ref/sharedlibrary/) - Utility functions for shared library export/import
+* [Sony vector Math Library](//storage.googleapis.com/defold-doc/assets/Vector_Math_Library-Overview.pdf) - The Sony Vector Math library mainly provides functions used in 3-D graphics for 3-D and 4-D vector operations, matrix operations, and quaternion operations.

+ 0 - 8
docs/en/manuals/extensions-details.md

@@ -83,11 +83,3 @@ The main reason is that on iOS version < 8, multiple executable binaries in an .
 We don't make use of any exceptions in the engine.
 We don't make use of any exceptions in the engine.
 It isn't generally used in game engines, since the data is (mostly) known beforehand, during development.
 It isn't generally used in game engines, since the data is (mostly) known beforehand, during development.
 Removing the support for C++ exceptions decreases executable size and improves the runtime performance.
 Removing the support for C++ exceptions decreases executable size and improves the runtime performance.
-
-## Defold SDK
-
-With each (biweekly) release of Defold, we release a new Defold SDK.
-With it, we ship the libraries of the engine, and also a build manifest file,
-which is identical in structure and syntax as the [extension](/manuals/extensions-build-variants) and [app](/manuals/extensions-build-variants) manifests.
-
-(This sdk is not yet public)

+ 3 - 19
docs/en/manuals/extensions.md

@@ -57,8 +57,6 @@ name: "MyExtension"
 
 
 The extension consists of a single C++ file, *myextension.cpp* that is created in the "src" folder.
 The extension consists of a single C++ file, *myextension.cpp* that is created in the "src" folder.
 
 
-The Defold editor will not open *.cpp* files by default so if you double click the file the system editor set for that file type is used. You can use the built in text editor by right-clicking the file and selecting <kbd>Open With ▸ Text Editor</kbd>. Note that Defold has no support for C++ files so the editing experience is minimal.
-
 ![C++ file](images/extensions/cppfile.png)
 ![C++ file](images/extensions/cppfile.png)
 
 
 The extension source file contains the following code:
 The extension source file contains the following code:
@@ -71,7 +69,7 @@ The extension source file contains the following code:
 
 
 // include the Defold SDK
 // include the Defold SDK
 #include <dmsdk/sdk.h>
 #include <dmsdk/sdk.h>
-#include <malloc.h>
+#include <stdlib.h>
 
 
 static int Rot13(lua_State* L)
 static int Rot13(lua_State* L)
 {
 {
@@ -186,6 +184,7 @@ The following identifiers are defined by the builder on each respective platform
 * DM_PLATFORM_IOS
 * DM_PLATFORM_IOS
 * DM_PLATFORM_ANDROID
 * DM_PLATFORM_ANDROID
 * DM_PLATFORM_LINUX
 * DM_PLATFORM_LINUX
+* DM_PLATFORM_HTML5
 
 
 ## The ext.manifest file
 ## The ext.manifest file
 
 
@@ -216,6 +215,7 @@ platforms:
 
 
 ## Example extensions
 ## Example extensions
 
 
+* [Basic extension example](https://github.com/defold/template-native-extension) (the extension from this manual)
 * [Android extension example](https://github.com/defold/extension-android)
 * [Android extension example](https://github.com/defold/extension-android)
 * [HTML5 extension example](https://github.com/defold/extension-html5)
 * [HTML5 extension example](https://github.com/defold/extension-html5)
 * [MacOS, iOS and Android videoplayer extension](https://github.com/defold/extension-videoplayer)
 * [MacOS, iOS and Android videoplayer extension](https://github.com/defold/extension-videoplayer)
@@ -223,19 +223,3 @@ platforms:
 * [iOS and Android Admob extension](https://github.com/defold/extension-admob)
 * [iOS and Android Admob extension](https://github.com/defold/extension-admob)
 
 
 The [Defold community asset portal](https://www.defold.com/community/assets/) also contain community created extensions.
 The [Defold community asset portal](https://www.defold.com/community/assets/) also contain community created extensions.
-
-## Known issues
-
-The native extension feature is in an alpha state, meaning that that the APIs can still change. Furthermore, not all features are in place yet.
-
-Platforms
-: Android lacks support for *.aar* archives. All platforms currently create debug builds only.
-
-Languages
-: The Swift and Kotlin programming languages are currently not supported.
-
-Editor
-: The editor integration lacks build process indication. Error reporting is rudimentary.
-
-Debugging
-: Currently, when building on iOS, the *.dSYM* files are not included in the build result

BIN
docs/en/manuals/images/extensions/cppfile.png


BIN
docs/en/manuals/images/extensions/manifest.png


+ 1 - 3
gulpfile.js

@@ -308,7 +308,7 @@ function copyAssets () {
     pipe(gulp.dest('build/assets')).
     pipe(gulp.dest('build/assets')).
     pipe(preservetime())
     pipe(preservetime())
 
 
-  return gulp.src(['docs/**/*.{png,jpg,svg,gif,js,zip,js}']).
+  return gulp.src(['docs/**/*.{png,jpg,svg,gif,js,zip,js,pdf}']).
     pipe(gulp.dest('build')).
     pipe(gulp.dest('build')).
     pipe(preservetime())
     pipe(preservetime())
 }
 }
@@ -398,5 +398,3 @@ gulp.task('watch',
     )
     )
   )
   )
 )
 )
-
-