From 822b2109e6d7194599c6295cc51f7f10265ea891 Mon Sep 17 00:00:00 2001 From: Nathaniel Schmidt Date: Wed, 28 Oct 2020 22:36:24 +1100 Subject: [PATCH 1/4] Added dev doc instructions elaborating on how to write and test coded extensions for Splashkit core. --- setting-up-splashkit-dev.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/setting-up-splashkit-dev.md b/setting-up-splashkit-dev.md index 73b8d3ab..879553fc 100644 --- a/setting-up-splashkit-dev.md +++ b/setting-up-splashkit-dev.md @@ -55,7 +55,7 @@ If you are reading this then you have probably already found the Splashkit-core * Install [VSCode](https://code.visualstudio.com/). * Install language tools (compilers / libs): - For C#, install the DotNet core sdk. - - For C++, install GNU Compiler Collection (GCC) - g++ and clang++ in MSYS2. + - For C++, install MinGW-W64: a Windows port of GNU Compiler Collection (GCC) - g++ and clang++ in MSYS2. - Run the following command in terminal: ``` pacman --disable-download-timeout -S mingw-w64-{x86_64,i686}-gcc mingw-w64-{i686,x86_64}-gdb @@ -104,4 +104,28 @@ If you are reading this then you have probably already found the Splashkit-core ``` coresdk/src/test ``` -Now you should be good to go. \ No newline at end of file +Now you should be good to go. + +## Developing and building extension and test code for Splashkit +Although concise instructions are contained above, further substantiation may be required for a beginner as to precisely how to write (and implement the appropriate test) code for the Splashkit backend and / or core SDK. This information is provided in the hope that one no will longer necessarily need to search the code to figure out how to do this by oneself. + +If you have gotten this far then it is assumed that you already know how to recursively Git clone your already-created fork of the splashkit-core repository on GitHub. Being keen to start working, you can do the following: + +1. From your cloned fork, you can add your new coded extensions into ```./coresdk```. + - If you are writing backend code such as a driver for a core module, you can add source and header files into ```coresdk/src/backend```. + - If you are writing a module or extension that will be used by other third-party applications using Splashkit, you can add it directly into ```coresdk/src/coresdk```. + - When writing the code, ensure that callable types, procedures and functions are placed directly into the Splashkit library namespace. You can do this in one of two ways: + - Utilise global access in your source file by typing + ```using namespace splashkit_lib;``` + - To be more flexable, identify which components of the file you want included by creating a splashkit_lib scope i.e. + ```namespace splashkit_lib + { + ... + }``` +2. Once you think you may have the code working, you can add the test code by placing it into coresdk/src/test. + - First, Create a ```test_``` file, where `````` is the name of the extension i.e. ```animations```. + - Ensure this file globally uses the splashkit_lib namespace. + - Within the same file, declare a ```run__test``` procedure (void function) and place in a sequence(s) to test your new code. + - Next, edit ```coresdk/src/test/test_main.cpp```, move to its declared ```setup_tests()``` procedure, call the ```add_test``` procedure and pass in + (a) the test's name as a string i.e. ```"animations"```; and (b) pass in the function running the test i.e. ```run_animation_test```. +3. Re-build the test project contained in ```./projects/cmake``` (See Windows build instructions for immediate help if unsure from the line staring with “Run the test program”, should work on any platform from that point) and you're done. \ No newline at end of file From 92e1b6437065367dcfb2d2a25b04414a7f61f9ba Mon Sep 17 00:00:00 2001 From: Nathaniel Schmidt Date: Wed, 28 Oct 2020 22:40:13 +1100 Subject: [PATCH 2/4] Fixing ordered list. --- setting-up-splashkit-dev.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setting-up-splashkit-dev.md b/setting-up-splashkit-dev.md index 879553fc..05ba2d08 100644 --- a/setting-up-splashkit-dev.md +++ b/setting-up-splashkit-dev.md @@ -112,20 +112,20 @@ Although concise instructions are contained above, further substantiation may be If you have gotten this far then it is assumed that you already know how to recursively Git clone your already-created fork of the splashkit-core repository on GitHub. Being keen to start working, you can do the following: 1. From your cloned fork, you can add your new coded extensions into ```./coresdk```. - - If you are writing backend code such as a driver for a core module, you can add source and header files into ```coresdk/src/backend```. - - If you are writing a module or extension that will be used by other third-party applications using Splashkit, you can add it directly into ```coresdk/src/coresdk```. - - When writing the code, ensure that callable types, procedures and functions are placed directly into the Splashkit library namespace. You can do this in one of two ways: - - Utilise global access in your source file by typing + - If you are writing backend code such as a driver for a core module, you can add source and header files into ```coresdk/src/backend```. + - If you are writing a module or extension that will be used by other third-party applications using Splashkit, you can add it directly into ```coresdk/src/coresdk```. + - When writing the code, ensure that callable types, procedures and functions are placed directly into the Splashkit library namespace. You can do this in one of two ways: + - Utilise global access in your source file by typing ```using namespace splashkit_lib;``` - - To be more flexable, identify which components of the file you want included by creating a splashkit_lib scope i.e. + - To be more flexable, identify which components of the file you want included by creating a splashkit_lib scope i.e. ```namespace splashkit_lib { ... }``` 2. Once you think you may have the code working, you can add the test code by placing it into coresdk/src/test. - - First, Create a ```test_``` file, where `````` is the name of the extension i.e. ```animations```. - - Ensure this file globally uses the splashkit_lib namespace. - - Within the same file, declare a ```run__test``` procedure (void function) and place in a sequence(s) to test your new code. - - Next, edit ```coresdk/src/test/test_main.cpp```, move to its declared ```setup_tests()``` procedure, call the ```add_test``` procedure and pass in + - First, Create a ```test_``` file, where `````` is the name of the extension i.e. ```animations```. + - Ensure this file globally uses the splashkit_lib namespace. + - Within the same file, declare a ```run__test``` procedure (void function) and place in a sequence(s) to test your new code. + - Next, edit ```coresdk/src/test/test_main.cpp```, move to its declared ```setup_tests()``` procedure, call the ```add_test``` procedure and pass in (a) the test's name as a string i.e. ```"animations"```; and (b) pass in the function running the test i.e. ```run_animation_test```. 3. Re-build the test project contained in ```./projects/cmake``` (See Windows build instructions for immediate help if unsure from the line staring with “Run the test program”, should work on any platform from that point) and you're done. \ No newline at end of file From 3e2a1e170e4e888eec263b25d22e4d43901966a0 Mon Sep 17 00:00:00 2001 From: Nathaniel Schmidt Date: Wed, 28 Oct 2020 22:42:15 +1100 Subject: [PATCH 3/4] Replaced an ordered list with unordered. --- setting-up-splashkit-dev.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setting-up-splashkit-dev.md b/setting-up-splashkit-dev.md index 05ba2d08..62c90074 100644 --- a/setting-up-splashkit-dev.md +++ b/setting-up-splashkit-dev.md @@ -111,7 +111,7 @@ Although concise instructions are contained above, further substantiation may be If you have gotten this far then it is assumed that you already know how to recursively Git clone your already-created fork of the splashkit-core repository on GitHub. Being keen to start working, you can do the following: -1. From your cloned fork, you can add your new coded extensions into ```./coresdk```. +- From your cloned fork, you can add your new coded extensions into ```./coresdk```. - If you are writing backend code such as a driver for a core module, you can add source and header files into ```coresdk/src/backend```. - If you are writing a module or extension that will be used by other third-party applications using Splashkit, you can add it directly into ```coresdk/src/coresdk```. - When writing the code, ensure that callable types, procedures and functions are placed directly into the Splashkit library namespace. You can do this in one of two ways: @@ -122,10 +122,10 @@ If you have gotten this far then it is assumed that you already know how to recu { ... }``` -2. Once you think you may have the code working, you can add the test code by placing it into coresdk/src/test. +- Once you think you may have the code working, you can add the test code by placing it into coresdk/src/test. - First, Create a ```test_``` file, where `````` is the name of the extension i.e. ```animations```. - Ensure this file globally uses the splashkit_lib namespace. - Within the same file, declare a ```run__test``` procedure (void function) and place in a sequence(s) to test your new code. - Next, edit ```coresdk/src/test/test_main.cpp```, move to its declared ```setup_tests()``` procedure, call the ```add_test``` procedure and pass in (a) the test's name as a string i.e. ```"animations"```; and (b) pass in the function running the test i.e. ```run_animation_test```. -3. Re-build the test project contained in ```./projects/cmake``` (See Windows build instructions for immediate help if unsure from the line staring with “Run the test program”, should work on any platform from that point) and you're done. \ No newline at end of file +- Re-build the test project contained in ```./projects/cmake``` (See Windows build instructions for immediate help if unsure from the10:40 PM 28/10/2020 line staring with “Run the test program”, should work on any platform from that point) and you're done. \ No newline at end of file From 88a44b2217d17072176e152d7c8362b181d96d1b Mon Sep 17 00:00:00 2001 From: Nathaniel Schmidt Date: Tue, 3 Nov 2020 18:04:50 +1100 Subject: [PATCH 4/4] Attempt to fix more markdown / indentation issues in root dev doc. --- setting-up-splashkit-dev.md | 103 +++++++++++++----------------------- 1 file changed, 37 insertions(+), 66 deletions(-) diff --git a/setting-up-splashkit-dev.md b/setting-up-splashkit-dev.md index 62c90074..164d9e69 100644 --- a/setting-up-splashkit-dev.md +++ b/setting-up-splashkit-dev.md @@ -40,70 +40,40 @@ If you are reading this then you have probably already found the Splashkit-core * Install [MSYS2](https://www.msys2.org/) subsystem and follow fairly self-explanatory installer instructions – use defaults if unsure, **DO NOT INSTALL TO DIRECTORY WITH SPACES!** * Install core Splashkit SDK - Go into MSYS2 terminal emulator and install [Git](https://git-scm.com/) over MSYS2 subsystem by typing : - ``` - pacman -S git --noconfirm --disable-download-timeout - ``` + `pacman -S git --noconfirm --disable-download-timeout` - Now clone and install Splashkit via install-scripts: - ``` - bash <(curl -s https://raw.githubusercontent.com/splashkit/skm/master/install-scripts/skm-install.sh) - ``` + ```bash <(curl -s https://raw.githubusercontent.com/splashkit/skm/master/install-scripts/skm-install.sh)` - Restart terminal, type - ``` - skm - ``` + `skm` in terminal after restarting to verify successful install. * Install [VSCode](https://code.visualstudio.com/). * Install language tools (compilers / libs): - For C#, install the DotNet core sdk. - - For C++, install MinGW-W64: a Windows port of GNU Compiler Collection (GCC) - g++ and clang++ in MSYS2. - - Run the following command in terminal: - ``` - pacman --disable-download-timeout -S mingw-w64-{x86_64,i686}-gcc mingw-w64-{i686,x86_64}-gdb - ``` - - Do not run compiler from main MSYS2 MSYS terminal, instead run from MSYS2 MinGW32 or MinGW64 terminals. + 8- For C++, install MinGW-W64: a Windows port of the GNU Compiler Collection (GCC) - g++ and clang++ in MSYS2. + - Run the following command in terminal: + `pacman --disable-download-timeout -S mingw-w64-{x86_64,i686}-gcc mingw-w64-{i686,x86_64}-gdb` + - Do not run compiler from main MSYS2 MSYS terminal, instead run from MSYS2 MinGW32 or MinGW64 terminals. * Install remaining tools to build Splashkit: - Install cmake: - ``` - pacman -S mingw-w64-x86_64-cmake - ``` + `pacman -S mingw-w64-x86_64-cmake` - install make: - ``` - pacman -S mingw-w64-x86_64-make - ``` + `pacman -S mingw-w64-x86_64-make` * Build the test project: - Go into the cloned directory of your Splashkit fork, open a MinGw-W64 MSYS2 shell and type: - ``` - cd projects/cmake - ``` - ``` - cmake -G "Unix Makefiles" . - ``` - ``` - make - ``` + `cd projects/cmake` + `cmake . -G "Unix Makefiles"` + `make` - Note: if the above does not work, try using the actual unix make and cmake installations, rather than the MinGw-specific ones; but do not try a combination of both. Remove packages with - ``` - pacman -Rs - ``` + `pacman -Rs ` and - ``` - pacman -S cmake make - ``` + `pacman -S cmake make` * Run the test program by executing - ``` - cd ../../bin - ``` - ``` - ./sktest - ``` + `cd ../../bin` + `./sktest` * Add features to code in - ``` - ./coresdk - ``` + `./coresdk` * Add test code into - ``` - coresdk/src/test - ``` + `coresdk/src/test` Now you should be good to go. ## Developing and building extension and test code for Splashkit @@ -111,21 +81,22 @@ Although concise instructions are contained above, further substantiation may be If you have gotten this far then it is assumed that you already know how to recursively Git clone your already-created fork of the splashkit-core repository on GitHub. Being keen to start working, you can do the following: -- From your cloned fork, you can add your new coded extensions into ```./coresdk```. - - If you are writing backend code such as a driver for a core module, you can add source and header files into ```coresdk/src/backend```. - - If you are writing a module or extension that will be used by other third-party applications using Splashkit, you can add it directly into ```coresdk/src/coresdk```. - - When writing the code, ensure that callable types, procedures and functions are placed directly into the Splashkit library namespace. You can do this in one of two ways: - - Utilise global access in your source file by typing - ```using namespace splashkit_lib;``` - - To be more flexable, identify which components of the file you want included by creating a splashkit_lib scope i.e. - ```namespace splashkit_lib - { - ... - }``` -- Once you think you may have the code working, you can add the test code by placing it into coresdk/src/test. - - First, Create a ```test_``` file, where `````` is the name of the extension i.e. ```animations```. - - Ensure this file globally uses the splashkit_lib namespace. - - Within the same file, declare a ```run__test``` procedure (void function) and place in a sequence(s) to test your new code. - - Next, edit ```coresdk/src/test/test_main.cpp```, move to its declared ```setup_tests()``` procedure, call the ```add_test``` procedure and pass in - (a) the test's name as a string i.e. ```"animations"```; and (b) pass in the function running the test i.e. ```run_animation_test```. -- Re-build the test project contained in ```./projects/cmake``` (See Windows build instructions for immediate help if unsure from the10:40 PM 28/10/2020 line staring with “Run the test program”, should work on any platform from that point) and you're done. \ No newline at end of file +- From your cloned fork, you can add your new coded extensions into `./coresdk`. + - If you are writing backend code such as a driver for a core module, you can add source and header files into `coresdk/src/backend`. + - If you are writing a module or extension that will be used by other third-party applications using Splashkit, you can add it directly into `coresdk/src/coresdk`. + - When writing the code, ensure that callable types, procedures and functions are placed directly into the Splashkit library namespace. You can do this in one of two ways: + - Utilise global access in your source file by typing + `using namespace splashkit_lib;` + - To be more flexable, identify which components of the file you want included by creating a splashkit_lib scope i.e. + `namespace splashkit_lib + { + ... + }` +- Once you think you may have the code working, you can add the test code by placing it into `coresdk/src/test`. + - First, Create a `test_` file, where `` is the name of the extension i.e. `animations`. + - Ensure this file globally uses the `splashkit_lib` namespace. + - Within the same file, declare a `run__test` procedure (void function) and place in a sequence(s) to test your new code. + - Next, edit `coresdk/src/test/test_main.cpp`, move to its declared `setup_tests()` procedure, call the `add_test` procedure and pass in + - (a) the test's name as a string i.e. `animations`; and + - (b) pass in the function running the test i.e. `run_animation_test`. +- Re-build the test project contained in `./projects/cmake` (See Windows build instructions for immediate help if unsure from the line starting with “Run the test program”, should work on any platform from that point) and you're done. \ No newline at end of file