-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove CGO requirement from OSX builds #175
Comments
Have you considered gioui ? It uses shiny but the rendering engine is very advanced on comparison . There is even a working p5 package for gio. it seems a perfect match for oak perf will be much higher than our current platform compiles for web, desktop and mobile building a 2d game on top of gio is something others are also doing . You can also mix 2d and 3d . Seem their examples . and you get highly quality forms / widgets for data entry etc oak has all the higher level stuff already done . I found this repo because of the gamepad as I wanted to hook up gio to a gamepad btw :) |
Oak's drivers are extensible-- a gio driver is probably feasible to write. I don't know anything about comparable performance, but I'll take a shot at it. It will probably take me a bit of time, as even cloning gio's repository down to look at the code is apparently not straightforward (fails with As far as this issue goes, it wouldn't remove the cgo dependency (https://git.sr.ht/~eliasnaur/gio/tree/main/item/internal/cocoainit/cocoa_darwin.go), but I'm not sure if the dependency is possible to remove. |
Weird that your got a problem with git cloning.. Never had it myself. your right. there is be some CGO at the bottom. It's impossible to remove as at some point to bring up a canvas you have to call the Native OS level. In terms of perf, i can point point you to some similar 2D drawing apps: https://github.com/ajstarks/deck https://github.com/ajstarks/giocanvas Not sure if its your thing, but i would start with this example to get going: https://github.com/gioui/gio-example/blob/main/component/main.go there is a video component, RTL / LTR with multi language support happening too in the PR's so you will get those for your game if you want them eventually. |
@gedw99 And your description seems like you'd want to have both oak and gio components in your rendering logic, which is also a bad match-- gio components are immediate-mode, and oak components are retained-mode. It's going to be tricky to actualize that. But maybe there's something there for someone! |
Another approach -- you could build a |
wow that is great to see. Good old pong game too :) I could not work out how to run this as there is no main package. But anyway to address the other things... The flickering is odd. Never had that myself with GIo apps. I suspect its because its mixing the gio immediate mode with the oak retained mode. About updating a screen element.. You only do it in the Render loop. Everything is an Op. render.Stackable sounds doable but as you say, you would not have the Portability, Perf. I suspect in order to use Oak with GIO, you would need to go "all in" on Immediate mode and GIO. It would be a full port. Here is a game in gio that also has a server with websockets. It is a good reference point perhaps. https://git.sr.ht/~whereswaldon/pointstar
|
also have a look at the examples here: https://github.com/gioverse/chat/tree/main/example this repo is where alot of the challenges of binding to data and async aspects is shown. |
I've looked at enough examples for my liking at this time, but thank you. All of this seems to come from a perspective of understanding how gio works but not understanding how oak works-- for example, you can use oak's joystick library without using any other component of oak. If that's all you want, you're already there. Its my understanding that gio is not intended to work with applications that need to readily update everything on screen-- it can work with things that update individual components at predictable times, but the architecture assumes that things are not changing instead of assuming that they are changing. This is great for a lot of purposes, but not for most video games, where entities are actively changing. pointstar looks like a board game, which sounds like a good fit. This is all to say I do not think this discussed integration will work. Its possible it will, and others (you, even!) can take on the task of learning gio and oak well enough to write an integration of the two that suits your needs, but to me it:
So I'm not motivated to spend who knows how much time on an integration that, at the planning stages, looks dead in the water. If you believe you can make it work, just like the joystick package, all of oak's packages are designed to be usable without oak itself running; you can use any of them by themselves in your integration. If you want advice on how things in oak work to build this integration, you're welcome to ask questions. I'm not going to respond to further comments that seem to me like they are attempting to convince me to put more time into coding this myself. |
I did not realise you thought I expected you to code it yourself.
On Tue 30. Nov 2021 at 14:38, Patrick Stephen ***@***.***> wrote:
I've looked at enough examples for my liking at this time, but thank you.
All of this seems to come from a perspective of understanding how gio works
but not understanding how oak works-- for example, you can use oak's
joystick library without using any other component of oak. If that's all
you want, you're already there. Its my understanding that gio is not
intended to work with applications that need to readily update everything
on screen-- it can work with things that update individual components at
predictable times, but the architecture assumes that things are not
changing instead of assuming that they are changing. This is great for a
lot of purposes, but not for most video games, where entities are actively
changing. pointstar looks like a board game, which sounds like a good fit.
This is all to say I do not think this discussed integration will work.
Its possible it will, and others (you, even!) can take on the task of
learning gio and oak well enough to write an integration of the two that
suits your needs, but to me it:
1. doesn't look like it would produce high-fps games
2. would use immediate mode graphics, which I think is fundamentally
incompatible with most games
3. would take >10 hours of work
So I'm not motivated to spend who knows how much time on an integration
that, at the planning stages, looks dead in the water. If you believe you
can make it work, just like the joystick package, all of oak's packages are
designed to be usable without oak itself running; you can use any of them
by themselves in your integration. If you want advice on how things in oak
work to build this integration, you're welcome to ask questions.
I'm not going to respond to further comments that seem to me like they are
attempting to convince me to put more time into coding this myself.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#175 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMVPLFDJJG27IESVGDTCTDTUOTHVXANCNFSM5HBNVBVQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
|
good points. I appreciate the feedback.
I will see if i can get something working. I am currently working with rendering dynamic content on gio and it might be possible to shoe horn oak with gio. But yes i agree the problem is the dynamic nature.
|
I'm curious... What's the C dependency that's currently used or pulled in on macOS? 🤔 |
It's going to be under mtldriver's internal directories + the dependencies for metal within the mtldriver |
Thanks! |
No description provided.
The text was updated successfully, but these errors were encountered: