Compare commits

..

20 Commits

Author SHA1 Message Date
Nick Fisher
4955837518 chore(release): publish packages
- thermion_dart@0.1.1+2
 - thermion_flutter@0.1.1+7
 - thermion_flutter_ffi@0.1.0+6
 - thermion_flutter_platform_interface@0.1.0+6
 - thermion_flutter_web@0.0.1+6
2024-06-26 00:12:32 +08:00
Nick Fisher
0e9cf76592 chore(release): publish packages
- thermion_dart@0.1.1-dev.0+2
 - thermion_flutter@0.1.1-dev.0+7
 - thermion_flutter_platform_interface@0.1.0-dev.0+6
 - thermion_flutter_web@0.0.1-dev.0+6
 - thermion_flutter_ffi@0.1.0-dev.0+6
2024-06-26 00:10:56 +08:00
Nick Fisher
368a341b76 docs: update custom native_toolchain ref for Windows 2024-06-26 01:59:06 +10:00
Nick Fisher
5cc41a9115 docs: update 2024-06-26 01:58:35 +10:00
Nick Fisher
368ce83380 rename thermion_filament namespace to thermion_flutter for Windows 2024-06-26 01:51:31 +10:00
Nick Fisher
683b79c9a0 fix: add ResourceBuffer header directly to Windows build so I don't have to fiddle around getting the CMake path right 2024-06-26 01:50:53 +10:00
Nick Fisher
81be5e25f7 fix: revert to std::thread (pthreads not easily available on Windows) 2024-06-26 01:50:22 +10:00
Nick Fisher
e8e1684694 fix: on Windows, pass static libs via -l rather than custom linkWith property so build.dart stays compatible between published & custom versions 2024-06-26 01:49:37 +10:00
Nick Fisher
d13ecde7b6 update Windows docs 2024-06-26 01:48:08 +10:00
Nick Fisher
08c3af405e Merge pull request #43 from nmfisher/develop
Develop
2024-06-25 21:16:31 +10:00
Nick Fisher
0571f3e653 docs: add Android & Windows pages 2024-06-25 19:04:18 +08:00
Nick Fisher
f351512a78 Merge pull request #42 from Hannnes1/license
Add root LICENSE file
2024-06-25 10:48:00 +10:00
Hannes Hultergård
315b898d7c Add root LICENSE file 2024-06-24 08:28:42 +02:00
Nick Fisher
c635bd3813 chore(release): publish packages
- thermion_dart@0.1.1+1
 - thermion_flutter@0.1.1+6
 - thermion_flutter_web@0.0.1+5
 - thermion_flutter_platform_interface@0.1.0+5
 - thermion_flutter_ffi@0.1.0+5
2024-06-22 10:29:41 +08:00
Nick Fisher
b4f9a5c2af docs: update with links to playground 2024-06-22 10:29:08 +08:00
Nick Fisher
0222ba2d6c chore(release): publish packages
- thermion_dart@0.1.1
2024-06-21 17:18:43 +08:00
Nick Fisher
a066df55f9 chore(release): publish packages
- thermion_dart@0.1.0+4
 - thermion_flutter_web@0.0.1+4
 - thermion_flutter_platform_interface@0.1.0+4
 - thermion_flutter@0.1.1+5
 - thermion_flutter_ffi@0.1.0+4
2024-06-21 16:52:19 +08:00
Nick Fisher
aa85dcfa20 fix: add dummy asset to build.dart on Linux builds so we can use the package on a Linux host 2024-06-21 16:52:10 +08:00
Nick Fisher
a3370a775f chore(release): publish packages
- thermion_dart@0.1.0+3
 - thermion_flutter_web@0.0.1+3
 - thermion_flutter@0.1.1+4
 - thermion_flutter_platform_interface@0.1.0+3
 - thermion_flutter_ffi@0.1.0+3
2024-06-21 16:21:02 +08:00
Nick Fisher
b889fddcfa fix: exit build.dart early on Linux builds so we can use the package on a Linux host 2024-06-21 16:20:42 +08:00
37 changed files with 671 additions and 59 deletions

View File

@@ -3,6 +3,208 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 2024-06-26
### Changes
---
Packages with breaking changes:
- [`thermion_dart` - `v0.1.1+2`](#thermion_dart---v0112)
- [`thermion_flutter` - `v0.1.1+7`](#thermion_flutter---v0117)
Packages with other changes:
- [`thermion_flutter_ffi` - `v0.1.0+6`](#thermion_flutter_ffi---v0106)
- [`thermion_flutter_platform_interface` - `v0.1.0+6`](#thermion_flutter_platform_interface---v0106)
- [`thermion_flutter_web` - `v0.0.1+6`](#thermion_flutter_web---v0016)
Packages graduated to a stable release (see pre-releases prior to the stable version for changelog entries):
- `thermion_dart` - `v0.1.1+2`
- `thermion_flutter` - `v0.1.1+7`
- `thermion_flutter_ffi` - `v0.1.0+6`
- `thermion_flutter_platform_interface` - `v0.1.0+6`
- `thermion_flutter_web` - `v0.0.1+6`
---
#### `thermion_dart` - `v0.1.1+2`
#### `thermion_flutter` - `v0.1.1+7`
#### `thermion_flutter_ffi` - `v0.1.0+6`
#### `thermion_flutter_platform_interface` - `v0.1.0+6`
#### `thermion_flutter_web` - `v0.0.1+6`
## 2024-06-26
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1-dev.0+2`](#thermion_dart---v011-dev02)
- [`thermion_flutter` - `v0.1.1-dev.0+7`](#thermion_flutter---v011-dev07)
- [`thermion_flutter_platform_interface` - `v0.1.0-dev.0+6`](#thermion_flutter_platform_interface---v010-dev06)
- [`thermion_flutter_web` - `v0.0.1-dev.0+6`](#thermion_flutter_web---v001-dev06)
- [`thermion_flutter_ffi` - `v0.1.0-dev.0+6`](#thermion_flutter_ffi---v010-dev06)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_platform_interface` - `v0.1.0-dev.0+6`
- `thermion_flutter_web` - `v0.0.1-dev.0+6`
- `thermion_flutter_ffi` - `v0.1.0-dev.0+6`
---
#### `thermion_dart` - `v0.1.1-dev.0+2`
- **FIX**: revert to std::thread (pthreads not easily available on Windows).
- **FIX**: on Windows, pass static libs via -l rather than custom linkWith property so build.dart stays compatible between published & custom versions.
#### `thermion_flutter` - `v0.1.1-dev.0+7`
- **FIX**: add ResourceBuffer header directly to Windows build so I don't have to fiddle around getting the CMake path right.
## 2024-06-22
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1+1`](#thermion_dart---v0111)
- [`thermion_flutter` - `v0.1.1+6`](#thermion_flutter---v0116)
- [`thermion_flutter_web` - `v0.0.1+5`](#thermion_flutter_web---v0015)
- [`thermion_flutter_platform_interface` - `v0.1.0+5`](#thermion_flutter_platform_interface---v0105)
- [`thermion_flutter_ffi` - `v0.1.0+5`](#thermion_flutter_ffi---v0105)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+5`
- `thermion_flutter_platform_interface` - `v0.1.0+5`
- `thermion_flutter_ffi` - `v0.1.0+5`
---
#### `thermion_dart` - `v0.1.1+1`
- **DOCS**: update with links to playground.
#### `thermion_flutter` - `v0.1.1+6`
- **DOCS**: update with links to playground.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1`](#thermion_dart---v011)
---
#### `thermion_dart` - `v0.1.1`
- Bump "thermion_dart" to `0.1.1`.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.0+4`](#thermion_dart---v0104)
- [`thermion_flutter_web` - `v0.0.1+4`](#thermion_flutter_web---v0014)
- [`thermion_flutter_platform_interface` - `v0.1.0+4`](#thermion_flutter_platform_interface---v0104)
- [`thermion_flutter` - `v0.1.1+5`](#thermion_flutter---v0115)
- [`thermion_flutter_ffi` - `v0.1.0+4`](#thermion_flutter_ffi---v0104)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+4`
- `thermion_flutter_platform_interface` - `v0.1.0+4`
- `thermion_flutter` - `v0.1.1+5`
- `thermion_flutter_ffi` - `v0.1.0+4`
---
#### `thermion_dart` - `v0.1.0+4`
- **FIX**: add dummy asset to build.dart on Linux builds so we can use the package on a Linux host.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.0+3`](#thermion_dart---v0103)
- [`thermion_flutter_web` - `v0.0.1+3`](#thermion_flutter_web---v0013)
- [`thermion_flutter` - `v0.1.1+4`](#thermion_flutter---v0114)
- [`thermion_flutter_platform_interface` - `v0.1.0+3`](#thermion_flutter_platform_interface---v0103)
- [`thermion_flutter_ffi` - `v0.1.0+3`](#thermion_flutter_ffi---v0103)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+3`
- `thermion_flutter` - `v0.1.1+4`
- `thermion_flutter_platform_interface` - `v0.1.0+3`
- `thermion_flutter_ffi` - `v0.1.0+3`
---
#### `thermion_dart` - `v0.1.0+3`
- **FIX**: exit build.dart early on Linux builds so we can use the package on a Linux host.
## 2024-06-21
### Changes

201
LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2024 Nick Fisher
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -4,6 +4,7 @@
<a href="https://docs.page/nmfisher/thermion/quickstart">Quickstart (Flutter)</a> •
<a href="https://docs.page/nmfisher/thermion">Documentation</a> •
<a href="https://docs.page/nmfisher/thermion/examples">Showcase</a> •
<a href="https://dartpad.thermion.dev/">Playground</a> •
<a href="https://discord.gg/h2VdDK3EAQ">Discord</a>
</p>

View File

@@ -7,10 +7,15 @@
"Getting Started",
[
["Overview", "/"],
["Quick Start", "/quickstart"]
["Quick Start", "/quickstart"],
["Playground", "https://dartpad.thermion.dev"]
]
],
["Misc.", [["Contributing", "/contributing"]]]
["Misc.", [
["Windows", "/windows"],
["Android", "/android"],
["Contributing", "/contributing"]
]]
]
}

View File

@@ -4,3 +4,7 @@ Thermion is an open source project and we welcome all contributions from every l
Please [join us on Discord](https://discord.gg/h2VdDK3EAQ) if you'd like some guidance or just want to chat.
##
We are now using [Melos](https://melos.invertase.dev/) to manage the repository. This lets us auto-generate changelogs & versioning from commit messages, so if you wish to submit a PR, please use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

View File

@@ -204,6 +204,8 @@ The cube still won't be visible until we add a light to the scene and tell Therm
$ flutter run -d macos
```
> You may experience a noticeable delay the very first time you run the project. Don't panic, it's not frozen! This is due to the build system downloading the prebuilt Filament binaries from Cloudflare, which can take some time (particularly on Windows). These binaries will be cached after first download, so subsequent runs will be much faster (though every time you run flutter clean, the binaries will be re-downloaded).
![Screenshot of Thermion Quickstart project](images/thermion_sample_project.png)
Your first Thermion project is complete!

View File

@@ -1,15 +1,29 @@
## Windows
## CMakeLists
You will need to disable the `/WX` compiler flag.
In your project, open the `windows/CMakeList.txt` file and find the following line:
`target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")`
Delete the `/WX`:
`target_compile_options(${TARGET} PRIVATE /W4 /wd"4100")`
## pubspec.yaml
On Windows, you will need to add a custom version of `native_toolchain_c` to your `dependency_overrides`. This is currently needed to link static libraries when building a DLL.
```
native_toolchain_c:
dependency_overrides:
native_toolchain_c:
git:
url: git@github.com:nmfisher/native.git
url: https://github.com/nmfisher/native.git
path: pkgs/native_toolchain_c
ref: 99020084c4687be4c58c7115a167088c0441d1de
ref: windows_dll_fix
```
This will eventually be fixed upstream in the `native_toolchain_c` package, so this should be a short-term/temporary issue only.

View File

@@ -1,3 +1,28 @@
## 0.1.1+2
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 0.1.1-dev.0+2
- **FIX**: revert to std::thread (pthreads not easily available on Windows).
- **FIX**: on Windows, pass static libs via -l rather than custom linkWith property so build.dart stays compatible between published & custom versions.
## 0.1.1+1
- **DOCS**: update with links to playground.
## 0.1.1
- Bump "thermion_dart" to `0.1.1`.
## 0.1.0+4
- **FIX**: add dummy asset to build.dart on Linux builds so we can use the package on a Linux host.
## 0.1.0+3
- **FIX**: exit build.dart early on Linux builds so we can use the package on a Linux host.
## 0.1.0+2
- **REFACTOR**: rearrange some stubs/imports for easier web WASM deployment.

View File

@@ -4,6 +4,7 @@
<a href="https://docs.page/nmfisher/flutter_filament/quickstart">Quickstart (Flutter)</a> •
<a href="https://docs.page/nmfisher/flutter_filament">Documentation</a> •
<a href="https://github.com/nmfisher/thermion/docs/examples/">Showcase</a> •
<a href="https://dartpad.thermion.dev/">Playground</a> •
<a href="https://discord.gg/h2VdDK3EAQ">Discord</a>
</p>

View File

@@ -22,6 +22,32 @@ void main(List<String> args) async {
var platform = config.targetOS.toString().toLowerCase();
// We don't support Linux (yet), so the native/Filament libraries won't be
// compiled/available. However, we still want to be able to run the Dart
// package itself on a Linux host(e.g. for dart_services backed), so if
// we detect that we're running on Linux, add some dummy native code
// assets and exit early.
if (platform == "linux") {
final linkMode = DynamicLoadingBundled();
final name = "thermion_dart.dart";
final libUri = config.outputDirectory
.resolve(config.targetOS.libraryFileName(name, linkMode));
output.addAssets(
[
NativeCodeAsset(
package: config.packageName,
name: name,
file: libUri,
linkMode: linkMode,
os: config.targetOS,
architecture: config.dryRun ? null : config.targetArchitecture,
)
],
linkInPackage: null,
);
return;
}
var libDir = config.dryRun ? "" : (await getLibDir(config, logger)).path;
final packageName = config.packageName;
@@ -36,7 +62,7 @@ void main(List<String> args) async {
"${config.packageRoot.toFilePath()}/native/include/material/image.c",
]);
final libs = [
var libs = [
"filament",
"backend",
"filameshio",
@@ -65,12 +91,12 @@ void main(List<String> args) async {
"basis_transcoder"
];
final linkWith = <String>[];
if (platform == "windows") {
linkWith.addAll(libs.map((lib) => "$libDir/$lib.lib"));
linkWith.addAll(["$libDir/bluevk.lib", "$libDir/bluegl.lib"]);
linkWith.addAll([
libDir = Directory(libDir).uri.toFilePath();
libs = libs.map((lib) => "${libDir}${lib}.lib").toList();
libs.addAll(["${libDir}bluevk.lib", "${libDir}bluegl.lib"]);
libs.addAll([
"gdi32.lib",
"user32.lib",
"shell32.lib",
@@ -81,7 +107,7 @@ void main(List<String> args) async {
} else {
libs.add("stdc++");
}
final flags = []; //"-fsanitize=address"];
final flags = []; //"-fsanitize=address"];
final defines = <String, String?>{};
var frameworks = [];
@@ -125,14 +151,12 @@ void main(List<String> args) async {
sources: sources,
includes: ['native/include', 'native/include/filament'],
defines: defines,
// UNCOMMENT THIS IF YOU ARE BUILDING WITH THE CUSTOM native_toolchain_c FORK FOR WINDOWS
// linkWith: linkWith,
flags: [
if (platform == "macos") '-mmacosx-version-min=13.0',
if (platform == "ios") '-mios-version-min=13.0',
...flags,
...frameworks,
if (platform != "windows") ...libs.map((lib) => "-l$lib"),
...libs.map((lib) => "-l$lib"),
"-L$libDir",
],
dartBuildFiles: ['hook/build.dart'],

View File

@@ -13,8 +13,6 @@ extern "C"
{
extern EMSCRIPTEN_KEEPALIVE EMSCRIPTEN_WEBGL_CONTEXT_HANDLE thermion_dart_web_create_gl_context();
}
#include <pthread.h>
#endif
#include "ThermionDartFFIApi.h"
@@ -38,19 +36,26 @@ public:
explicit RenderLoop()
{
srand(time(NULL));
#ifdef __EMSCRIPTEN__
pthread_attr_t attr;
pthread_attr_init(&attr);
#ifdef __EMSCRIPTEN__
emscripten_pthread_attr_settransferredcanvases(&attr, "canvas");
#endif
pthread_create(&t, &attr, &RenderLoop::startHelper, this);
#else
t = new std::thread([this]() {
start();
});
#endif
}
~RenderLoop()
{
_stop = true;
#ifdef __EMSCRIPTEN__
pthread_join(t, NULL);
#else
t->join();
#endif
Log("Render loop killed");
}
@@ -209,13 +214,17 @@ public:
std::mutex _access;
void (*_renderCallback)(void *const) = nullptr;
void *_renderCallbackOwner = nullptr;
pthread_t t;
std::condition_variable _cond;
std::deque<std::function<void()>> _tasks;
FilamentViewer* _viewer = nullptr;
#ifdef __EMSCRIPTEN__
pthread_t t;
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE _context;
int _frameNum = 0;
#else
std::thread *t = nullptr;
#endif
};

View File

@@ -1,6 +1,6 @@
name: thermion_dart
description: 3D rendering toolkit for Dart.
version: 0.1.0+2
version: 0.1.1+2
homepage: https://docs.page/nmfisher/thermion
repository: https://github.com/nmfisher/thermion

View File

@@ -1,3 +1,23 @@
## 0.1.1+7
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 0.1.1-dev.0+7
- **FIX**: add ResourceBuffer header directly to Windows build so I don't have to fiddle around getting the CMake path right.
## 0.1.1+6
- **DOCS**: update with links to playground.
## 0.1.1+5
- Update a dependency to the latest release.
## 0.1.1+4
- Update a dependency to the latest release.
## 0.1.1+3
- Update a dependency to the latest release.

View File

@@ -3,7 +3,8 @@
<p align="center">
<a href="https://docs.page/nmfisher/flutter_filament/quickstart">Quickstart (Flutter)</a> •
<a href="https://docs.page/nmfisher/flutter_filament">Documentation</a> •
<a href="https://github.com/nmfisher/thermion/docs/examples/">Showcase</a> •
<a href="https://github.com/nmfisher/thermion/docs/examples/">Showcase</a> •
<a href="https://dartpad.thermion.dev/">Playground</a> •
<a href="https://discord.gg/h2VdDK3EAQ">Discord</a>
</p>

View File

@@ -1,6 +1,6 @@
name: thermion_flutter
description: Flutter plugin for 3D rendering with the Thermion toolkit.
version: 0.1.1+3
version: 0.1.1+7
homepage: https://docs.page/nmfisher/thermion
repository: https://github.com/nmfisher/thermion
@@ -17,10 +17,10 @@ dependencies:
plugin_platform_interface: ^2.0.0
ffi: ^2.1.2
animation_tools_dart: ^0.0.4
thermion_dart: ^0.1.0+2
thermion_flutter_platform_interface: ^0.1.0+2
thermion_flutter_ffi: ^0.1.0+2
thermion_flutter_web: ^0.0.1+2
thermion_dart: ^0.1.1+2
thermion_flutter_platform_interface: ^0.1.0+6
thermion_flutter_ffi: ^0.1.0+6
thermion_flutter_web: ^0.0.1+6
logging: ^1.2.0
dev_dependencies:

View File

@@ -12,7 +12,7 @@
#pragma comment(lib, "dwmapi.lib")
#pragma comment(lib, "comctl32.lib")
namespace thermion_filament {
namespace thermion_flutter {
static constexpr auto kClassName = L"FLUTTER_FILAMENT_WINDOW";
static constexpr auto kWindowName = L"thermion_flutter_window";
@@ -354,4 +354,4 @@ void BackingWindow::Resize(int width, int height, int left, int top) {
}
HWND BackingWindow::GetHandle() { return _windowHandle; }
} // namespace thermion_filament
} // namespace thermion_flutter

View File

@@ -5,7 +5,7 @@
#include <flutter/plugin_registrar_windows.h>
#include <flutter/standard_method_codec.h>
namespace thermion_filament {
namespace thermion_flutter {
class BackingWindow {
public:

View File

@@ -7,7 +7,7 @@
#pragma comment(lib, "dwmapi.lib")
#pragma comment(lib, "comctl32.lib")
namespace thermion_filament {
namespace thermion_flutter {
FlutterEGLContext::FlutterEGLContext(
flutter::PluginRegistrarWindows* pluginRegistrar,

View File

@@ -12,7 +12,7 @@
#include "backend/platforms/PlatformEGL.h"
#include "flutter_render_context.h"
namespace thermion_filament {
namespace thermion_flutter {
class FlutterEGLContext : public FlutterRenderContext {
public:

View File

@@ -7,7 +7,7 @@
#include <thread>
namespace thermion_filament {
namespace thermion_flutter {
static void logEglError(const char *name) noexcept {
const char *err;
@@ -240,4 +240,4 @@ FlutterAngleTexture::FlutterAngleTexture(
result->Success(resultList);
}
} // namespace thermion_filament
} // namespace thermion_flutter

View File

@@ -26,7 +26,7 @@
typedef uint32_t GLuint;
namespace thermion_filament {
namespace thermion_flutter {
class FlutterAngleTexture : public FlutterTextureBuffer {
public:

View File

@@ -8,7 +8,7 @@
#include "flutter_texture_buffer.h"
namespace thermion_filament {
namespace thermion_flutter {
class FlutterRenderContext {
public:

View File

@@ -7,7 +7,7 @@
#include <flutter/texture_registrar.h>
namespace thermion_filament {
namespace thermion_flutter {
class FlutterTextureBuffer {
public:

View File

@@ -0,0 +1,44 @@
#ifndef RESOURCE_BUFFER_H
#define RESOURCE_BUFFER_H
#include <stdint.h>
#include <stdlib.h>
//
// A ResourceBuffer is a unified interface for working with
// binary assets across various platforms.
// This is simply:
// 1) a pointer to some data
// 2) the length of the data
// 3) an ID that can be passed back to the native platform to release the underlying asset when needed.
//
typedef struct ResourceBuffer
{
const void *const data;
const int32_t size;
const int32_t id;
#if defined(__cplusplus)
ResourceBuffer(void *const data, int32_t size, int32_t id) : data(data), size(size), id(id) {}
#endif
} ResourceBuffer;
typedef void (*LoadFilamentResourceIntoOutPointer)(const char *uri, ResourceBuffer *out);
typedef ResourceBuffer (*LoadFilamentResource)(const char *uri);
typedef ResourceBuffer (*LoadFilamentResourceFromOwner)(const char *const, void *const owner);
typedef void (*FreeFilamentResource)(ResourceBuffer);
typedef void (*FreeFilamentResourceFromOwner)(ResourceBuffer, void *const owner);
typedef struct ResourceLoaderWrapper
{
LoadFilamentResource loadResource;
FreeFilamentResource freeResource;
LoadFilamentResourceFromOwner loadFromOwner;
FreeFilamentResourceFromOwner freeFromOwner;
void *owner;
LoadFilamentResourceIntoOutPointer loadToOut;
} ResourceLoaderWrapper;
void *make_resource_loader(LoadFilamentResourceFromOwner loadFn, FreeFilamentResourceFromOwner freeFn, void *const owner);
#endif

View File

@@ -7,7 +7,7 @@
#include <thread>
namespace thermion_filament {
namespace thermion_flutter {
void _release_callback(void *releaseContext) {
// ((OpenGLTextureBuffer*)releaseContext)->unlock();
@@ -141,4 +141,4 @@ OpenGLTextureBuffer::~OpenGLTextureBuffer() {
wglMakeCurrent(NULL, NULL);
}
} // namespace thermion_filament
} // namespace thermion_flutter

View File

@@ -20,7 +20,7 @@
typedef uint32_t GLuint;
namespace thermion_filament {
namespace thermion_flutter {
class OpenGLTextureBuffer : public FlutterTextureBuffer {
public:

View File

@@ -10,7 +10,7 @@
#include "thermion_flutter_plugin.h"
namespace thermion_filament {
namespace thermion_flutter {
namespace test {
namespace {
@@ -40,4 +40,4 @@ TEST(ThermionFlutterPlugin, GetPlatformVersion) {
}
} // namespace test
} // namespace thermion_filament
} // namespace thermion_flutter

View File

@@ -35,7 +35,7 @@
#include "wgl_context.h"
#endif
namespace thermion_filament {
namespace thermion_flutter {
using namespace std::chrono_literals;
@@ -61,7 +61,6 @@ ThermionFlutterPlugin::ThermionFlutterPlugin(
// attach the method call handler for incoming messages
_channel->SetMethodCallHandler([=](const auto &call, auto result) {
std::cout << call.method_name() << std::endl;
this->HandleMethodCall(call, std::move(result));
});
}
@@ -275,4 +274,4 @@ void ThermionFlutterPlugin::HandleMethodCall(
}
}
} // namespace thermion_filament
} // namespace thermion_flutter

View File

@@ -14,7 +14,7 @@
#include "GL/GL.h"
#include "GL/GLu.h"
#include "ResourceBuffer.hpp"
#include "ResourceBuffer.h"
#if USE_ANGLE
#include "egl_context.h"
@@ -22,7 +22,7 @@
#include "wgl_context.h"
#endif
namespace thermion_filament {
namespace thermion_flutter {
class ThermionFlutterPlugin : public flutter::Plugin {
public:
@@ -66,6 +66,6 @@ public:
#endif
};
} // namespace thermion_filament
} // namespace thermion_flutter
#endif // FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_

View File

@@ -6,7 +6,7 @@
#include "flutter_texture_buffer.h"
namespace thermion_filament {
namespace thermion_flutter {
WGLContext::WGLContext(flutter::PluginRegistrarWindows *pluginRegistrar,
flutter::TextureRegistrar *textureRegistrar)
@@ -143,4 +143,4 @@ void WGLContext::CreateRenderingSurface(
void *WGLContext::GetSharedContext() { return (void *)_context; }
} // namespace thermion_filament
} // namespace thermion_flutter

View File

@@ -7,7 +7,7 @@
#if WGL_USE_BACKING_WINDOW
#include "backing_window.h"
#endif
namespace thermion_filament {
namespace thermion_flutter {
class WGLContext : public FlutterRenderContext {
public:

View File

@@ -1,3 +1,23 @@
## 0.1.0+6
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 0.1.0-dev.0+6
- Update a dependency to the latest release.
## 0.1.0+5
- Update a dependency to the latest release.
## 0.1.0+4
- Update a dependency to the latest release.
## 0.1.0+3
- Update a dependency to the latest release.
## 0.1.0+2
- **REFACTOR**: rearrange some stubs/imports for easier web WASM deployment.

View File

@@ -1,7 +1,7 @@
name: thermion_flutter_ffi
description: An FFI interface for the thermion_flutter plugin (all platforms except web).
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
version: 0.1.0+2
version: 0.1.0+6
environment:
sdk: ">=3.3.0 <4.0.0"
@@ -22,8 +22,8 @@ dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.1.0
thermion_flutter_platform_interface: ^0.1.0+2
thermion_dart: ^0.1.0+2
thermion_flutter_platform_interface: ^0.1.0+6
thermion_dart: ^0.1.1+2
dev_dependencies:
flutter_test:

View File

@@ -1,3 +1,23 @@
## 0.1.0+6
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 0.1.0-dev.0+6
- Update a dependency to the latest release.
## 0.1.0+5
- Update a dependency to the latest release.
## 0.1.0+4
- Update a dependency to the latest release.
## 0.1.0+3
- Update a dependency to the latest release.
## 0.1.0+2
- Update a dependency to the latest release.

View File

@@ -1,7 +1,7 @@
name: thermion_flutter_platform_interface
description: A common platform interface for the thermion_flutter plugin.
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
version: 0.1.0+2
version: 0.1.0+6
environment:
sdk: ">=3.3.0 <4.0.0"
@@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.1.0
thermion_dart: ^0.1.0+2
thermion_dart: ^0.1.1+2
dev_dependencies:
flutter_test:

View File

@@ -1,3 +1,23 @@
## 0.0.1+6
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 0.0.1-dev.0+6
- Update a dependency to the latest release.
## 0.0.1+5
- Update a dependency to the latest release.
## 0.0.1+4
- Update a dependency to the latest release.
## 0.0.1+3
- Update a dependency to the latest release.
## 0.0.1+2
- Update a dependency to the latest release.

View File

@@ -1,7 +1,7 @@
name: thermion_flutter_web
description: A web platform interface for the thermion_flutter plugin.
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
version: 0.0.1+2
version: 0.0.1+6
environment:
sdk: ">=3.3.0 <4.0.0"
@@ -20,8 +20,8 @@ dependencies:
sdk: flutter
plugin_platform_interface: ^2.1.0
web: ^0.5.1
thermion_dart: ^0.1.0+2
thermion_flutter_platform_interface: ^0.1.0+2
thermion_dart: ^0.1.1+2
thermion_flutter_platform_interface: ^0.1.0+6
flutter_web_plugins:
sdk: flutter