sciter-sdk / rust-sciter

Rust bindings for Sciter
https://sciter.com
MIT License
806 stars 76 forks source link

Windowless example with sciter.lite does not work #146

Open LaineZ opened 4 months ago

LaineZ commented 4 months ago

Windowless example from this repository does not work (Sciter 4.4.9.3.)

loading sciter from "D:\\projects\\dubspell\\sciter-js-sdk-4.4.9.3\\bin.lite\\windows\\x64\\sciter.dll"
create window
create sciter instance
running...
mouse enter
thread 'main' panicked at C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\sciter-rs-0.5.58\src\windowless.rs:288:17:
assertion failed: !rgba.is_null()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `F:\rust-sciter\target\debug\windowless.exe D:\projects\dubspell\sciter-js-sdk-4.4.9.3\bin.lite\windows\x64\sciter.dll` (exit code: 101)

I found one forum topic about that (https://sciter.com/forums/topic/sciter-lite-is-broken/) but I can't understand what's mean "recompile project".

Same panic occurs at last version of Sciter (5.0.3.11)

loading sciter from "F:\\rust-sciter\\sciter-js-sdk-main\\sciter-js-sdk-main\\bin.lite\\windows\\x64\\sciter.dll"
create window
create sciter instance
running...
thread 'main' panicked at C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\sciter-rs-0.5.58\src\windowless.rs:288:17:
assertion failed: !rgba.is_null()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `F:\rust-sciter\target\debug\windowless.exe F:\rust-sciter\sciter-js-sdk-main\sciter-js-sdk-main\bin.lite\windows\x64\sciter.dll` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

OS: Windows 10

LaineZ commented 4 months ago

I found as a walkaround, before calling a RenderTo message you need specify a initial window size. like this

handle_message(scwnd, Message::Size { width: 800, height: 600 });