nokotan / opensiv3d Goto Github PK
View Code? Open in Web Editor NEWThis project forked from siv3d/opensiv3d
[NO LONGER MAINTAINED] Experimental port of OpenSiv3D to Web
Home Page: https://siv3d.kamenokosoft.com
License: MIT License
This project forked from siv3d/opensiv3d
[NO LONGER MAINTAINED] Experimental port of OpenSiv3D to Web
Home Page: https://siv3d.kamenokosoft.com
License: MIT License
追加する機能の内容 | Describe the solution you'd like
Commented by @Reputeless on Siv3D Slack
ブラウザの言語設定を取得する API って作れますか?
日本語設定でない人には英語のコンテンツを表示したいです。
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
日本語設定でない人には英語のコンテンツを表示したいです。
備考 | Additional context
Reported by @Reputeless
エラーの内容 | Describe the build error
再現方法 | To Reproduce
ビルド環境 | Develop environment (please complete the following information):
備考 | Additional context
再現コード
# include <Siv3D.hpp> // OpenSiv3D v0.6
void Main()
{
const Texture texture{ U"example/windmill2.png" };
while (System::Update())
{
}
}
expected:
319: [fail] ❌ BinaryReader: Failed to open the file `example/windmill2.png`
actual:
319: [fail] ❌ BinaryReader: Failed to open the file `/tmp/file`
追加する機能の内容 | Describe the solution you'd like
指定したキーをpreventDefault()したい
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
Google Chromeには機能のショートカットがありますが、ゲームでキーボード操作を実装する際にこれらの機能が邪魔になることがあります。
問題
WASDキーで移動、Ctrlキーでダッシュなどを実装する際、現在のページを保存するオプションが開かれゲームが中断される。
解決
Ctrlキー+SキーなどpreventDefault()できればこの問題が解決されます。
エラーの内容
ウィンドウの形状にかかわらず、ウィンドウサイズいっぱいに描画されます。
Uncaught TypeError: Options.setFramebufferSize is not a function
at doResize (OpenSiv3Dv0_6ForWebTest.html:21:1039)
at callRuntimeCallbacks (OpenSiv3Dv0_6ForWebTest.js:9:46906)
at postRun (OpenSiv3Dv0_6ForWebTest.js:9:35135)
at doRun (OpenSiv3Dv0_6ForWebTest.js:9:391619)
at OpenSiv3Dv0_6ForWebTest.js:9:391759
再現方法
Visual Studio 用のセットアップガイドに従ってインストールして、何も変更せずビルド、実行しました。
Debug, Release にかかわらず発生します。
発生環境
CShader_GLES3 で古いシェーダ linear_to_screen.frag
が使われています。
プロジェクトからも linear_to_screen.frag
を削除してください。
エラーの内容 | Describe the runtime error
アプリがクラッシュし、リロードループに入る
再現方法 | To Reproduce
発生環境(デスクトップの場合) | Desktop (please complete the following information):
備考 | Additional context
強化された Audio サンプルを実行したところ、
音声ファイルの長さや再生したときの再生スピードが実際と異なっていました。
デコード時や再生時のサンプリング周波数の設定がどこかで間違っている可能性があります。
分かりやすい再現方法:
example/windmill.mp3
example/test.mp3
の audio.lengthSec()
が実際よりも長いaudio.sampleRate()
で 44,100 Hz と表示されたり、実際の 2 倍速で再生されたりする予期しない動作の内容 | Describe the unexpected behavior
再現方法 | To Reproduce
発生環境(デスクトップの場合) | Desktop (please complete the following information):
発生環境(モバイルの場合) | Smartphone (please complete the following information):
備考 | Additional context
**エラーの内容 | Followed instructions on website, OpenSiv3D(0.6.4)Web does not build out of the box
再現方法 | To Reproduce
1>emcc : error : Siv3DScript: No such file or directory ("Siv3DScript" was expected to be an input file, based on the commandline arguments provided) 1>Done building project "openSiv3Dv0_6ForWebTest.vcxproj" -- FAILED.
ビルド環境 | Develop environment (please complete the following information):
備考 | Additional context
Also did a search, there is file that was installed that has that name. Closest is: libSiv3DScript.a, but that's of course a linux library. Is there a build step missing in your instructions?
エラーの内容 | Describe the runtime error
次の警告が表示される
no texture is bound in forward3d.frag
再現方法 | To Reproduce
発生環境(デスクトップの場合) | Desktop (please complete the following information):
発生環境(モバイルの場合) | Smartphone (please complete the following information):
備考 | Additional context
追加する機能の内容 | Describe the solution you'd like
現状 Web 版では、非 SIMD 対応版のみを提供しているが、これを SIMD 対応版のみの提供にする
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
備考 | Additional context
キーボードが使えない実行環境で、Camera2D/3D の操作のためのミニ UI や、代替操作手法を提示するために、現在の実行環境を取得できる関数があると便利です。
どういう情報の取得が可能か意見を聞きたいです。それに基づいて API を提案します。
目標: v0.6.x
予期しない動作の内容 | Describe the unexpected behavior
VS の Debug ビルドでアプリ実行時、ブラウザ画面上部にシーンに重なる赤いバー:
コンソールに出力されるエラーメッセージ:
mscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up.
再現方法 | To Reproduce
Visual Studio を使って Debug ビルドででデフォルトサンプルをビルド → 実行
発生環境(デスクトップの場合) | Desktop (please complete the following information):
備考 | Additional context
Release ビルドでは発生せず。
エラーの内容 | Describe the build error
wasm-ld: error: OpenSiv3D/lib/opus\libopus.a(opus_decoder.c.o): undefined symbol: __stack_chk_guard
再現方法 | To Reproduce
nokotan/OpenSiv3DForWeb-VSCode@73ba1bc6 をビルドする
ビルド環境 | Develop environment (please complete the following information):
備考 | Additional context
Reported by @TwoSquirrels
追加する機能の内容 | Describe the solution you'd like
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
System::Update やサウンドデコードなど、ライブラリ内部で非同期が絡む関数を呼び出す関数をすべて ASYNCIFY_ADD に加えなくてもよくなる
備考 | Additional context
Related: emscripten-core/emscripten#13150
https://nokotan.github.io/OpenSiv3DForWeb-VSCode/ を実行して、右下の全画面化ボタンを押した結果
おそらく OpenSiv3D for Web 新規ユーザのほとんどが「ビルド後の出力ファイルサイズが大きい」と思う。
出力ファイルを削減する方法が用意されていることを示すために、プロジェクトテンプレートに「OpenSiv3D(v0.6.5)Web-min」のようなものがあっても良いかもしれない。
具体的には下記の通り。
resources/enginefont/min/siv3d-min.woff
しか含まないこうした説明をプロジェクトテンプレートの説明や Main.cpp に含め、「OpenSiv3D(v0.6.5)Web-min」というプロジェクトテンプレートを追加で提供するという提案です。
すごく軽量(図形や英数字 only)なミニアプリを開発・公開するのがスムーズになる利点もあります。
予期しない動作の内容 | Describe the unexpected behavior
Siv3D チュートリアルの GET サンプル / POST サンプルともに期待した正常な結果が得られない。
再現方法 | To Reproduce
発生環境(デスクトップの場合) | Desktop (please complete the following information):
備考
ほかのプラットフォームでは発生せず
ScopedRenderStates(2D|3D)
に RasterizerState::WireframeCullNone
などを指定してもワイヤフレームで描画されず、普通に描画されます。
この問題によって、下の例やサンプル 36.13 複雑な 3D 形状を描く、サンプル 36.21 ワイヤフレームで描画するなどが正しく動きません。
# include <Siv3D.hpp>
void Main()
{
while (System::Update())
{
const ScopedRenderStates2D rasterizer{ RasterizerState::WireframeCullNone };
Shape2D::Heart(200, Scene::Center()).draw(Palette::Skyblue);
}
}
再現方法:
Siv3D Studio でデフォルトのサンプルプログラムを実行
Windows 11 / Chrome
期待される動作:
警告が出ない
実際の動作:
⚠️ TextToSpeech unavailable
という警告が出力される
解決案:
① 警告が出ないよう実装を改善
② Web 版の TextToSpeech 機能を一旦無効化する
補足:
警告の出ない環境が見つからない。
追加する機能の内容 | Describe the solution you'd like
WebAssembly Studio で使用している Siv3D.js に開発中のデグレが混じらないようにする
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
WebAssembly Studio OpenSiv3D for Web 0.6 テンプレートが常に安定的に使えるようにする
備考 | Additional context
予期しない動作の内容 | Describe the unexpected behavior
再現方法 | To Reproduce
発生環境(デスクトップの場合) | Desktop (please complete the following information):
発生環境(モバイルの場合) | Smartphone (please complete the following information):
備考 | Additional context
エラーの内容 | Describe the runtime error
unreachable が発生する
再現方法 | To Reproduce
SetMainLoop を使う
発生環境(デスクトップの場合) | Desktop (please complete the following information):
発生環境(モバイルの場合) | Smartphone (please complete the following information):
全ての環境
備考 | Additional context
Asyncify + SetMainLoop は同時に使えないため
次の項目の対応を予定
Windows(Power Shell)でemscriptenのactivateの際、
emsdk activate 2.0.5-upstream --system
と入力して実行すると、環境変数の
C:\Windows\System32
が消えてしまいます。多分--systemが悪さをしていると思いますが、一度検証していただけると助かります。(2.0.5-upstream以外でも検証していただけると幸いです。)
追加する機能の内容 | Describe the solution you'd like
Pointer Lock API を用いたマウスの固定及び移動量などの取得
その機能の追加によって解決する問題| Is your feature request related to a problem? Please describe.
Web版ではCursor::SetPos()
が使えない
(ブラウザでマウスカーソルの位置を設定することはできない?)ので、マウスでの操作を行う際(3Dゲームでの視点移動など)に、画面端でマウスの移動が止まってしまいそれ以上操作ができない(Discordでの質問 )
Pointer Lock APIを用いることでカーソルを固定しマウスの移動量を取得できるため上記問題を解決出来る。
備考 | Additional context
(個人的な意見になりますが)
ポインタのロックと移動量の取得はWeb版に限らずOpenSiv3D本体でも扱うと思うので、これらの機能を通常版でも扱えればいいなぁと思います。
追加する機能の内容 | Describe the solution you'd like
WebAssembly 自体のサポートがなかったり、そのブラウザで使えない WebAssembly の機能があったときに、
エラーメッセージを表示する
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
古いブラウザや IE を使っている人対策になる
備考 | Additional context
Related: #9
予期しない動作の内容 | Describe the unexpected behavior
スマホや iPad でシーンの下部 2〜5 % ほどが画面外にはみ出る
再現方法 | To Reproduce
発生環境(モバイルの場合) | Smartphone (please complete the following information):
備考 | Additional context
Reported by @Reputeless
エラーの内容 | Describe the build error
1>wasm-ld : error : unable to find library -lpng
1>emcc : error : 'C:/Users/tas9n/AppData/Local/Programs/Emscripten/upstream/bin\wasm-ld.exe -o C:/Users/tas9n/program/C++/OpenSiv3D/Web/OpenSiv3Dv0_6ForWeb1/Emscripten/Debug/OpenSiv3Dv0_6ForWeb1.wasm Emscripten/Debug/Main.o C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib\libSiv3DScript.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib\libSiv3D.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/opencv\libopencv_objdetect.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/opencv\libopencv_photo.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/opencv\libopencv_imgproc.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/opencv\libopencv_core.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/harfbuzz\libharfbuzz.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/freetype\libfreetype.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/turbojpeg\libturbojpeg.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/giflib\libgif.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/webp\libwebp.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/opus\libopusfile.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/opus\libopus.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/tiff\libtiff.a -lpng C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/zlib\libz.a C:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/SDL2\libSDL2.a -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/freetype -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/giflib -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/harfbuzz -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/opencv -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/turbojpeg -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/webp -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/opus -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/tiff -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/libpng -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/zlib -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib/SDL2 -LC:/Users/tas9n/AppData/Local/Programs/OpenSiv3D(0.6.5)Web/lib -LC:\Users\tas9n\AppData\Local\Programs\Emscripten\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten C:\Users\tas9n\AppData\Local\Programs\Emscripten\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libvorbis.a C:\Users\tas9n\AppData\Local\Programs\Emscripten\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libogg.a -lGL-webgl2-full_es3 -lal -lhtml5 -lstubs-debug -lc-debug -ldlmalloc -lcompiler_rt -lc++ -lc++abi -lsockets -lwebgpu_cpp -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -emscripten-cxx-exceptions-allowed=InitSiv3D -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export-if-defined=fflush --export-if-defined=emscripten_stack_get_base --export-if-defined=emscripten_stack_get_end --export-if-defined=emscripten_stack_set_limits --export-if-defined=emscripten_stack_get_free --export-if-defined=emscripten_stack_init --export-if-defined=stackSave --export-if-defined=stackRestore --export-if-defined=stackAlloc --export-if-defined=__wasm_call_ctors --export-if-defined=__errno_location --export-if-defined=getTempRet0 --export-if-defined=setTempRet0 --export-if-defined=__get_temp_ret --export-if-defined=__set_temp_ret --export-if-defined=__funcs_on_exit --export-if-defined=malloc --export-if-defined=free --export-if-defined=__cxa_is_pointer_type --export-if-defined=__cxa_can_catch --export-if-defined=setThrew --export-if-defined=ntohs --export-if-defined=htons --export-if-defined=__dl_seterr --export-if-defined=saveSetjmp --export-if-defined=emscripten_builtin_memalign --export-if-defined=memcpy --export-table -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=2147483648 --global-base=1024' failed (returned 1)
1>プロジェクト "OpenSiv3Dv0_6ForWeb1.vcxproj" のビルドが終了しました -- 失敗。
再現方法 | To Reproduce
公式サイト
https://siv3d.kamenokosoft.com/ja/building/overview
から手順通りEmscriptenのインストールからサンプルコードのビルドをしようとした際に以上のエラーが出ました。
ビルド環境 | Develop environment (please complete the following information):
備考 | Additional context
予期しない動作の内容 | Describe the unexpected behavior
再現方法 | To Reproduce
発生環境(デスクトップの場合) | Desktop (please complete the following information):
発生環境(モバイルの場合) | Smartphone (please complete the following information):
備考 | Additional context
OpenSiv3D のサンプルコード中の猫の絵文字 (
検証環境:
GLFW の初期化に失敗するのは WebGL 2.0 非サポートの場合のみだと思われるので、エラーメッセージを具体的にする。例:「Your browser does not support WebGL 2.」
エラーの内容 | Describe the runtime error
Web 最新版、Windows + Google Chrome, ウィンドウの任意のリサイズ Window::Resize(1280, 720); をすると灰色の画面のままです。
再現方法 | To Reproduce
再現コード: https://gist.github.com/Reputeless/62de5ce914b8ba8f4e8b470c998b359c
発生環境(デスクトップの場合) | Desktop (please complete the following information):
備考 | Additional context
他の環境では未検証です。
追加する機能の内容 | Describe the solution you'd like
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
備考 | Additional context
related: Siv3D#648
追加する機能の内容 | Describe the solution you'd like
ユーザーが何もしなくても(圧縮/サーバーの設定に知識がなくても)、ビルド時に自動的に gzip 圧縮をかけ、実行時にブラウザ側で自動的に展開する
Unity の Decompression Fallback と同等の機能
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
配信サイズの縮小
(本来であれば配信サーバで設定すべきところを、Siv3D および Siv3D Web 初心者でも恩恵を受けられるようにする)
備考 | Additional context
ビルド時に自動的に gzip 圧縮をかける
実行時にブラウザ側で自動的に展開する
F1
キーでライセンス情報のページを表示する機能自体は実装済みF1
キーを押したとき必ずライセンスを表示したいF1
キーのブラウザのデフォルトショートカットを無効化すると安定的にライセンスページが表示される
F1
キーショートカットをデフォルトで必ず無効化するのはどうか予期しない動作の内容 | Describe the unexpected behavior
SimpleGUI::TextBoxでTextEditStateのactiveがtrueでもボックスをユーザーがクリックしないと文字入力を受け付けない
(青く描画はされるがキーボードは反応しない)
再現方法 | To Reproduce
通常通りSimpleGUI::TextBoxでボックスを生成、常にactive=trueの状態にして起動
発生環境(デスクトップの場合) | Desktop (please complete the following information):
発生環境(モバイルの場合) | Smartphone (please complete the following information):
備考 | Additional context
予期しない動作の内容 | Describe the unexpected behavior
スマホ横持ちをしたときに、コントロールバー (ミュートボタン + フルスクリーンボタン) がスクリーン下部を大きく占有し、
その結果、Siv3D の描画面が小さくなりすぎる
発生環境(モバイルの場合) | Smartphone (please complete the following information):
備考 | Additional context
予期しない動作の内容 | Describe the unexpected behavior
関連: https://discord.com/channels/443310697397354506/998714158621147237/1038378601646673980
AsyncHTTPTask task;
について、task.isReady()
が true
を返したとき task.getResponse()
することで、それ以降 task.isReady()
は false
を返すようになるのが期待される動作ですが、Web 版では true
のままです。
Web 版で下記のサンプルはファイルダウンロードに成功しますが、Texture
の毎フレーム連続作成を行ってしまうためエラー終了します。
再現方法 | To Reproduce
# include <Siv3D.hpp>
void Main()
{
const URL url = U"https://raw.githubusercontent.com/Siv3D/siv3d.docs.images/master/logo/logo.png";
const FilePath saveFilePath = U"logo2.png";
Texture texture;
// ファイルの非同期ダウンロードを開始
AsyncHTTPTask task = SimpleHTTP::SaveAsync(url, saveFilePath);
while (System::Update())
{
// 非同期タスクが完了した
if (task.isReady())
{
Print << Scene::FrameCount();
// レスポンスが 200 (OK) なら
if (task.getResponse().isOK())
{
texture = Texture{ saveFilePath };
}
else
{
Print << U"Failed.";
}
}
if (texture)
{
texture.draw();
}
}
}
発生環境(デスクトップの場合) | Desktop (please complete the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.