Skip to content
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

copy go-gl/glfw to Ebitengine's internal directory #2546

Closed
2 of 10 tasks
hajimehoshi opened this issue Jan 17, 2023 · 2 comments
Closed
2 of 10 tasks

copy go-gl/glfw to Ebitengine's internal directory #2546

hajimehoshi opened this issue Jan 17, 2023 · 2 comments

Comments

@hajimehoshi
Copy link
Owner

hajimehoshi commented Jan 17, 2023

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • Xbox
  • Web Browsers

What feature would you like to be added?

We have already ported from GLFW to Go for Windows. We want to do the same thing for macOS and Linux.

Eliminating Cgo is not the goal of this issue (#1162, #2284)

Why is this needed?

This is nice to remove Cgo from macOS: #1162
This is a blocker for some features that requires to modify GLFW: #1305, #2476, #2511, #2258, #2260, #2289, #2475

@hajimehoshi hajimehoshi added this to the v2.6.0 milestone Jan 17, 2023
hajimehoshi added a commit that referenced this issue Jan 21, 2023
hajimehoshi added a commit that referenced this issue Jan 21, 2023
@hajimehoshi
Copy link
Owner Author

We can have a better fix for #2518 if we can modify GLFW.

TotallyGamerJet added a commit to TotallyGamerJet/ebiten that referenced this issue Feb 6, 2023
Many of the structs found in internal.h (internal_windows.go) contain defines such as GLFW_WIN32_WINDOW_STATE which gets replaced with a struct defined in win32platform_windows.go (win32_platform.h).

Originally, these structs where directly placed inside of internal_windows.go. However, to make it easier to add macOS and Linux these cannot be in this file.

This commit separates the windows specific structs into the respective windows file and updates the field to be named state.

Updates hajimehoshi#2546
hajimehoshi pushed a commit that referenced this issue Feb 7, 2023
…#2567)

Many of the structs found in internal.h (internal_windows.go) contain defines such as GLFW_WIN32_WINDOW_STATE
which gets replaced with a struct defined in win32platform_windows.go (win32_platform.h).

Originally, these structs where directly placed inside of internal_windows.go. However, to make it easier to add macOS
and Linux these cannot be in this file.

This commit separates the windows specific structs into the respective windows file and updates the field to be named
state.

Updates #2546
TotallyGamerJet added a commit to TotallyGamerJet/ebiten that referenced this issue Feb 9, 2023
context_windows.go is used for all the platforms. However, it used syscall.Syscall which behaves differently on macOS and Windows as well as windows.BytePtrToString which isn't available on Linux or macOS.

This commit replaces syscall.Syscall with purego.SyscallN and windows.BytePtrToString with a copied version called bytePtrToString.

Updates hajimehoshi#2546
hajimehoshi pushed a commit that referenced this issue Feb 9, 2023
…go (#2570)

context_windows.go is used for all the platforms. However, it used syscall.Syscall which behaves differently on macOS
and Windows as well as windows.BytePtrToString which isn't available on Linux or macOS.

This commit replaces syscall.Syscall with purego.SyscallN and windows.BytePtrToString with a copied version called
bytePtrToString.

Updates #2546
@hajimehoshi
Copy link
Owner Author

hajimehoshi commented May 9, 2023

This is a blocker for some features that requires to modify GLFW: #1305, #2476, #2511, #2258, #2260, #2289, #2475

In order to resolve them, just moving the GLFW source to the current internal/goglfw should be fine. As the next step, we can rewrite them into Go.

@hajimehoshi hajimehoshi changed the title internal/glfw: rewrite GLFW from C to Go for macOS and Linux copy go-gl/glfw to Ebitengine's internal directory Jul 5, 2023
hajimehoshi added a commit that referenced this issue Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant