Giter Club home page Giter Club logo

Comments (12)

200sc avatar 200sc commented on May 28, 2024 2

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.

200sc avatar 200sc commented on May 28, 2024 1

We have limited Mac testing, so thanks for catching this, I'll look into it tomorrow.

from oak.

200sc avatar 200sc commented on May 28, 2024 1

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.

200sc avatar 200sc commented on May 28, 2024 1

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.

200sc avatar 200sc commented on May 28, 2024 1

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.

prologic avatar prologic commented on May 28, 2024 1

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.

200sc avatar 200sc commented on May 28, 2024 1

Closing as the original problem is resolved.

from oak.

prologic avatar prologic commented on May 28, 2024

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.

prologic avatar prologic commented on May 28, 2024

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.

prologic avatar prologic commented on May 28, 2024

Also the keys in the platformer example don't seem to work?

from oak.

prologic avatar prologic commented on May 28, 2024

Happy to test/confirm here! Thanks! 👌

from oak.

prologic avatar prologic commented on May 28, 2024

Sorry about all the work 🤗

from oak.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.