Comments (5)
Now the printed working directory is to the executable/resources.
Could you write the result? What are the results in init
and main
?
from ebiten.
I couldn't reproduce the issue
% go run .
init wd /Users/hajimehoshi/test/test
main wd /Users/hajimehoshi/test/test
ebit key F1
% neofetch
'c. [email protected]
,xNMM. -------------------------------------
.OMMMMo OS: macOS 14.2.1 23C71 arm64
OMMM0, Host: Mac15,6
.;loddo:' loolloddol;. Kernel: 23.2.0
cKMMMMMMMMMMNWMMMMMMMMMM0: Uptime: 46 days, 9 hours, 40 mins
.KMMMMMMMMMMMMMMMMMMMMMMMWd. Packages: 77 (brew)
XMMMMMMMMMMMMMMMMMMMMMMMX. Shell: zsh 5.9
;MMMMMMMMMMMMMMMMMMMMMMMM: Resolution: 1800x1169
:MMMMMMMMMMMMMMMMMMMMMMMM: DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX. WM: Quartz Compositor
kMMMMMMMMMMMMMMMMMMMMMMMMWd. WM Theme: Blue (Light)
.XMMMMMMMMMMMMMMMMMMMMMMMMMMk Terminal: tmux
.XMMMMMMMMMMMMMMMMMMMMMMMMK. CPU: Apple M3 Pro
kMMMMMMMMMMMMMMMMMMMMMMd GPU: Apple M3 Pro
;KMMMMMMMWXXWMMMMMMMk. Memory: 3434MiB / 18432MiB
.cooc,. .,coo:.
from ebiten.
Thanks for looking into it -- indeed,
go run .
works fine for me as well. My test app is named "res" and I hit the issue when I do
go build
./res
I simplified the test app above, but without the the ebiten import included my output is
init wd /Users/spaceblack/Documents/dev/go/res
and with it included my output is
init wd /Users/spaceblack/Documents/dev/go/res/resources
Been poking at the source -- I see
internal/glfw/cocoa_init_darwin_m has a function changeToResourcesDirectory but I'm not sure if it's getting triggered, I don't see what's calling glfwPlatformInit. If you have any pointers let me know and I'll look at it.
from ebiten.
I failed to reproduce this even with go build
.
Been poking at the source -- I see
internal/glfw/cocoa_init_darwin_m has a function changeToResourcesDirectory but I'm not sure if it's getting triggered, I don't see what's calling glfwPlatformInit. If you have any pointers let me know and I'll look at it.
This logic should be intentional, though this should not happen when the binary is not in a .app directory. I was wondering why this happens in your environment.
glfwPlatformInit
is called at:
ebiten/internal/glfw/init_unix.c
Line 296 in 34cdb20
from ebiten.
Thanks much for the help, unfortunately I don't know anything about macOS dev but after reading up on bundles, so far one thing has caught my eye:
CFBundle creates a main bundle whenever it possibly can, even for unbundled apps.
That has certainly been my experience. As long as there is an executable and a Resources folder present (actually I've been using "resources"; I thought macOS was case sensitive but in this case it seems to be ignored) then the parent is identified as a bundle. The go run . command does not return a main bundle with a Resources folder because it is compiled and run from a temp directory without a resources folder.
Of course, none of that explains why you (and presumably everyone else) is not having this issue occur. But based on my reading of the docs, what is happening on my system seems reasonable. Unfortunately I don't see any details around what "creates a bundle whenever it possibly can." All I can find are the rules around bundles, which would seem to exclude my case, and that one line, which is broadly inclusive but not specific enough for me to say I'm seeing what should be correct behavior.
I have another Mac I might try this on, otherwise I can't think of anything to do but try to find more info around how CFBundleGetMainBundle() is working.
from ebiten.
Related Issues (20)
- Kage: Compilation panic
- examples/gamepad: PS4 (Dualshock) bluetooth controller inputs not detected on Windows HOT 8
- MacOS Failure in Running 'Hello, World!' Tutorial Example HOT 1
- examples/flappy: Audio not working on Wasm/Firefox HOT 3
- `GOOS=js GOARCH=wasm go test ./...` fails HOT 3
- Kage: Use color argument as the source image color on `DrawRectShader` HOT 4
- input: handle remapped keys on x11 HOT 3
- ebiten: calling `ScreenSizeInFullscreen` panics on browsers HOT 3
- text/v2: Draw performances using DrawImage HOT 13
- ebitenutil: DebugPrint ignoring image origin HOT 5
- SetWindowSize() and Layout() sizes not matching at fractional display scale factors
- png.Encode panics when give *ebiten.Image as the argument HOT 2
- internal/graphicsdriver/metal/*: rename functions to follow Objective-C way
- .github/workflows: Wasm tests often fail with `websocket url timeout reached`
- shaderprecomp: add tests
- internal/graphicsdriver/directx, internal/graphicsdriver/metal: use precompiled shader for bulitin shaders
- shaderprecomp: implement for Android
- ebiten: add a new API to return the logical screen size (= the result of Layout) HOT 5
- Feature request: Ability to set the pixel density of the HTML canvas HOT 1
- Weird behaviour when LayoutF returns small sizes, e.g. 1.33,1.00 HOT 8
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 ebiten.