Comments (12)
Added a couple of fixes, remaining issues I see:
- keyboard-test (osx key events either have runes or key directions, where other OSes always have both. Non trivial design decisions.)
- joystick-viz (not implemented)
- multi-window (not implemented)
- screenopts (not implemented)
- slide (scene flow halts, fixed in release/3.0.0-final and on this branch, going to prefer the former fix)
- sprite-demo (image / rendering nil panic, fixed in release/3.0.0-final)
- text-demo-1 (font not rendering, fixed in release/3.0.0-final)
Continuing to fix.
from oak.
We have limited Mac testing, so thanks for catching this, I'll look into it tomorrow.
from oak.
With limited checking, it seems like windowImpl.rgba
is nil sometimes, and we assume it isn't in all of its draw logic. Adding a check to windowImpl.Draw
in mtldriver
moves the panic to windowImpl.Publish
.
The logic for initializing some of the window components was only done after we got a size event back from the OS, which might not happen until after we start drawing. The commit above (on release/3.0.0-final and backported to a hotfix branch) initializes those values on window creation.
@prologic Would you mind checking that branch and confirming it works on your end as well? hotfix/mtldriver-init
from oak.
Ok, it looks like I assumed it was just one problem too quickly : ) I'll go through every example and verify that they operate correctly and add needed fixes to that PR.
from oak.
Ok, I'm going to leave joystick support for the existing issue (#87), but having run through all of the examples before and re-run through about half, including all those that previously failed, post fixes; give it another go, please @prologic, on release/3.0.0-final
.
Several examples were already fixed between the beta branch that is HEAD of master and release/3.0.0-final
, which is to be released shortly, pending final review, but in addition the standard osx rendering driver is more or less up to feature parity with the standard windows and linux drivers through this line of work.
from oak.
This is really cool! 🎉 Of the ones that were broken for me, now work! 👌 💯
Ii'll keep playing with this but I'm really happy 🤗
from oak.
Closing as the original problem is resolved.
from oak.
We have limited Mac testing, so thanks for catching this, I'll look into it tomorrow.
Let me know how I can help! I'm pretty good with Go, just too tired to look into it right now 😴
from oak.
This seems to have fixed a few cases I guess?
I was even able to run the complete playformer example (sort of) until I re-ran it and it crahsed immediately (race?):
(⎈ |local:default)
prologic@Jamess-iMac
Sun Sep 12 09:21:06
~/tmp/oak
(master) 0
$ go run examples/platformer-tutorial/6-complete/complete.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x40e3300]
goroutine 68 [running]:
image.(*RGBA).Bounds(0x0)
/usr/local/Cellar/go/1.17/libexec/src/image/image.go:98
image/draw.clip({0x41f6c70, 0x0}, 0xc00013d9a0, {0x41f5e20, 0xc000282040}, 0xc00013d960, {0x0, 0x0}, 0xc00013d980)
/usr/local/Cellar/go/1.17/libexec/src/image/draw/draw.go:85 +0x6f
image/draw.DrawMask({0x41f6c70, 0x0}, {{0x0, 0x0}, {0x280, 0x1e0}}, {0x41f5e20, 0xc000282040}, {0x0, 0x0}, ...)
/usr/local/Cellar/go/1.17/libexec/src/image/draw/draw.go:117 +0xa5
golang.org/x/image/draw.DrawMask(...)
/Users/prologic/go/pkg/mod/golang.org/x/[email protected]/draw/draw.go:31
golang.org/x/image/draw.Copy({0x41f6c70, 0x0}, {0x0, 0x0}, {0x41f5e20, 0xc000282040}, {{0x0, 0x0}, {0x280, 0x1e0}}, ...)
/Users/prologic/go/pkg/mod/golang.org/x/[email protected]/draw/scale.go:28 +0x1e5
golang.org/x/image/draw.nnInterpolator.Transform({}, {0x41f6c70, 0x0}, {0x3ff0000000000000, 0x0, 0x0, 0x0, 0x3ff0000000000000, 0x0}, {0x41f5e20, ...}, ...)
/Users/prologic/go/pkg/mod/golang.org/x/[email protected]/draw/impl.go:113 +0x158
github.com/oakmound/oak/v3/shiny/driver/mtldriver.(*windowImpl).Draw(0xc00068b5d0, {0x3ff0000000000000, 0x0, 0x0, 0x0, 0x3ff0000000000000, 0x0}, {0x41f7518, 0xc000280010}, {{0x0, ...}, ...}, ...)
/Users/prologic/tmp/oak/shiny/driver/mtldriver/window.go:132 +0xb6
github.com/oakmound/oak/v3/shiny/driver/internal/drawer.Scale({0x41f76b0, 0xc0001160f0}, {{0x1, 0x0}, {0x0, 0x0}}, {0x41f7518, 0xc000280010}, {{0x0, 0x0}, ...}, ...)
/Users/prologic/tmp/oak/shiny/driver/internal/drawer/drawer.go:30 +0x110
github.com/oakmound/oak/v3/shiny/driver/mtldriver.(*windowImpl).Scale(0xc0001160f0, {{0x0, 0x0}, {0x280, 0x1e0}}, {0x41f7518, 0xc000280010}, {{0x0, 0x0}, {0x280, ...}}, ...)
/Users/prologic/tmp/oak/shiny/driver/mtldriver/window.go:144 +0x78
github.com/oakmound/oak/v3.(*Window).publish(0xc000014800)
/Users/prologic/tmp/oak/drawLoop.go:62 +0x15c
github.com/oakmound/oak/v3.(*Window).drawLoop(0xc000014800)
/Users/prologic/tmp/oak/drawLoop.go:22 +0x125
created by github.com/oakmound/oak/v3.(*Window).lifecycleLoop
/Users/prologic/tmp/oak/lifecycle.go:36 +0x1c9
exit status 2
from oak.
Also the keys in the platformer example don't seem to work?
from oak.
Happy to test/confirm here! Thanks! 👌
from oak.
Sorry about all the work 🤗
from oak.
Related Issues (20)
- Q: respond to close window click on linux? HOT 7
- Issue found by Svace static analyzer HOT 4
- Add the ability to persist bindings between scenes
- All examples show a black screen on OSX HOT 6
- Document OS / Build Target Compatibility
- WASM+JS Controller Support
- WASM+JS Audio Support
- Remove CGO requirement from OSX builds HOT 13
- alg:ChooseX consider changing handling of 0 weight entries HOT 4
- Linux audio library does not compile on arm64
- Investigate adding CI to confirm JS builds of examples
- Should Wiki articles be moved to local readmes?
- JS does not support a Window Scale that is not 1
- Refactor Audio Interface to reduce number of OS streams
- Drop FOSSA? HOT 2
- Generic, type safe event handling with Go 1.18 HOT 1
- Add Debug / Trace logs around OS drivers
- Could you update the wiki, which still uses v3 as the example code?
- Replace CGO with PureGo and/or an embedded C compiler HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oak.