g3n / engine

Go 3D Game Engine (http://g3n.rocks)
https://discord.gg/NfaeVr8zDg
BSD 2-Clause "Simplified" License
2.79k stars 295 forks source link

App scene does not appear properly in MacOs #234

Open signalsaeed opened 3 years ago

signalsaeed commented 3 years ago

The app scene window in comes into the task bar (dock), but not shown as window in mac. it happens randomly. Do you have any Idea why the app scene behaves like this? and any fix?

danaugrs commented 3 years ago

Can you post a screenshot? It might be an issue with go-gl/glfw. Could you run the example in their readme and check if it has the same behavior?

signalsaeed commented 3 years ago

for the screenshot, I can say when the app scene appear randomly, I get following code in my terminal: 7:45:58.961403:I::OpenGL version: 4.1 INTEL-16.4.5 if the app scene does not pop out, above message does not appear on terminal and the only exec icon appear on deck. system:mac, Darwin 20.5.0

signalsaeed commented 3 years ago

@danaugrs I run the example in the go-gl/glfw and it works well. it is working with glfw v3.3 , however g3n is still on v3.2 is it possible to merge this PR or introduce a shortcut before its merge ;)

danaugrs commented 3 years ago

I had updated g3n to use glfw v3.3 in https://github.com/g3n/engine/commit/6938345 - I just closed the PR you mentioned and associated issue. I also recently updated g3n to use the very latest go-gl/glfw in https://github.com/g3n/engine/commit/de78e3c4204a605dd7bb204ab2c6551e9d7a8a41. Please try again with the latest version of g3n and let me know!

signalsaeed commented 3 years ago

Thank you @danaugrs . I will try it and let you know.

danaugrs commented 3 years ago

Any improvement @signalsaeed ?

signalsaeed commented 3 years ago

NO Unfortunately, the problem was not related to the glfw version. During my tries and errors, I found out that if I put my code in one function it works and if I spread the code through different files in go packages, it will have the same random app scene problem. the random appearing of the app scene, may be related to threading whereas with some threads, it appears and in some threads , it does not.

signalsaeed commented 3 years ago

I also should add that I am using a mesh file for the graphic part.

danaugrs commented 3 years ago

Interesting - unfortunately I can't debug/reproduce this as I don't have a Mac. If you put together a minimal reproducible example, Mac folks might be able to investigate further @mat007 @SamTov

signalsaeed commented 3 years ago

Yeah, I can manage a minimal reproducible piece of code to check what would be the problem as the issue draws my curiousness ;)

SamTov commented 3 years ago

Sure I can test it if you have some example code.

You're using an Intel Mac right @signalsaeed?

signalsaeed commented 3 years ago

@SamTov, sure I can prepare an example code that reproduce the problem.

I am using Intel mac.

signalsaeed commented 3 years ago

Dear @SamTov,

I uploaded a reproducible piece of code which randomly appear the app scene in my mac. link: https://drive.google.com/file/d/1wZwA5GYoBIE-3K7K-qi9E7IGF02UfVfe/view?usp=sharing please let me know if you need further information.

Noushed commented 3 years ago

Hi @SamTov, did you manage to reproduce the issue?

aymanbagabas commented 2 years ago

I can confirm adding this to main solves the issue here.

func init() {
    // This is needed to arrange that main() runs on main thread.
    // See documentation for functions that are only allowed to be called from the main thread.
    runtime.LockOSThread()
}