Package ebiten provides graphics and input API to develop a 2D game. You can start the game by calling the function RunGame. In the API document, 'the main thread' means the goroutine in init(), main() and their callees without 'go' statement. It is assured that 'the main thread' runs on the OS main thread. There are some Ebitengine functions (e.g., DeviceScaleFactor) that must be called on the main thread under some conditions (typically, before ebiten.RunGame is called). `EBITENGINE_SCREENSHOT_KEY` environment variable specifies the key to take a screenshot. For example, if you run your game with `EBITENGINE_SCREENSHOT_KEY=q`, you can take a game screen's screenshot by pressing Q key. This works only on desktops. `EBITENGINE_INTERNAL_IMAGES_KEY` environment variable specifies the key to dump all the internal images. This is valid only when the build tag 'ebitenginedebug' is specified. This works only on desktops. `EBITENGINE_GRAPHICS_LIBRARY` environment variable specifies the graphics library. If the specified graphics library is not available, RunGame returns an error. This environment variable can also be set programmatically through os.Setenv before RunGame is called. This can take one of the following value: `EBITENGINE_DIRECTX` environment variable specifies various parameters for DirectX. You can specify multiple values separated by a comma. The default value is empty (i.e. no parameters). `ebitenginedebug` outputs a log of graphics commands. This is useful to know what happens in Ebitengine. In general, the number of graphics commands affects the performance of your game. `ebitenginewebgl1` forces to use WebGL 1 on browsers. `ebitenginesinglethread` disables Ebitengine's thread safety to unlock maximum performance. If you use this you will have to manage threads yourself. Functions like IsKeyPressed will no longer be concurrent-safe with this build tag. They must be called from the main thread or the same goroutine as the given game's callback functions like Update to RunGame.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package ebiten provides graphics and input API to develop a 2D game. You can start the game by calling the function RunGame. In the API document, 'the main thread' means the goroutine in init(), main() and their callees without 'go' statement. It is assured that 'the main thread' runs on the OS main thread. There are some Ebiten functions (e.g., DeviceScaleFactor) that must be called on the main thread under some conditions (typically, before ebiten.RunGame is called). `EBITEN_SCREENSHOT_KEY` environment variable specifies the key to take a screenshot. For example, if you run your game with `EBITEN_SCREENSHOT_KEY=q`, you can take a game screen's screenshot by pressing Q key. This works only on desktops. `EBITEN_INTERNAL_IMAGES_KEY` environment variable specifies the key to dump all the internal images. This is valid only when the build tag 'ebitendebug' is specified. This works only on desktops. `ebitendebug` outputs a log of graphics commands. This is useful to know what happens in Ebiten. In general, the number of graphics commands affects the performance of your game. `ebitengl` forces to use OpenGL in any environments. `ebitenwebgl1` forces to use WebGL 1 on browsers. `ebitensinglethread` disables Ebiten's thread safety to unlock maximum performance. If you use this you will have to manage threads yourself. Functions like IsKeyPressed will no longer be concurrent-safe with this build tag. They must be called from the main thread or the same goroutine as the given game's callback functions like Update to RunGame.
Package ebiten provides graphics and input API to develop a 2D game. You can start the game by calling the function RunGame. In the API document, 'the main thread' means the goroutine in init(), main() and their callees without 'go' statement. It is assured that 'the main thread' runs on the OS main thread. There are some Ebiten functions (e.g., DeviceScaleFactor) that must be called on the main thread under some conditions (typically, before ebiten.RunGame is called). `EBITEN_SCREENSHOT_KEY` environment variable specifies the key to take a screenshot. For example, if you run your game with `EBITEN_SCREENSHOT_KEY=q`, you can take a game screen's screenshot by pressing Q key. This works only on desktops. `EBITEN_INTERNAL_IMAGES_KEY` environment variable specifies the key to dump all the internal images. This is valid only when the build tag 'ebitendebug' is specified. This works only on desktops. `ebitendebug` outputs a log of graphics commands. This is useful to know what happens in Ebiten. In general, the number of graphics commands affects the performance of your game. `ebitengl` forces to use OpenGL in any environments. `ebitenwebgl1` forces to use WebGL 1 on browsers. `ebitensinglethread` disables Ebiten's thread safety to unlock maximum performance. If you use this you will have to manage threads yourself. Functions like IsKeyPressed will no longer be concurrent-safe with this build tag. They must be called from the main thread or the same goroutine as the given game's callback functions like Update to RunGame. `ebitenexternaldll` stops embedding DLL file in a Windows executable. `ebitenexternaldll` works only for Windows. The executable will require a DLL file at the working directory. Copy them from Ebiten repository's `internal/glfw`: The directory path can be obtained by Go commands. For example, on PowerShell: and on shell: Embedding a DLL and extracting it on the fly might be problematic on Windows since the application might be unexpectedly recognized as a virus by some virus checkers. `ebitenexternaldll` is useful for such cases. See #1832 for the discussion.
Package gfx provides generic interfaces to GPU-based rendering techniques. This package is not useful by itself but instead part of a larger picture as this package provides generic interfaces and data types to modern graphics rendering API's such as OpenGL, OpenGL ES, WebGL, Direct3D, etc. The coordinate system used by this package is the right-handed Z up coordinate system unless explicitly specified otherwise. Texture coordinates do not follow OpenGL convention where the origin (0, 0) is the bottom-left, instead the origin (0, 0) is the top-left because: Go's image package uses top-left as the origin. If we followed OpenGL convention we would have to flip the image or texture coordinates on the CPU before upload to the GPU or in each shader.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gfx provides generic interfaces to GPU-based rendering techniques. This package is not useful by itself but instead part of a larger picture as this package provides generic interfaces and data types to modern graphics rendering API's such as OpenGL, OpenGL ES, WebGL, Direct3D, etc. The coordinate system used by this package is the right-handed Z up coordinate system unless explicitly specified otherwise. Texture coordinates do not follow OpenGL convention where the origin (0, 0) is the bottom-left, instead the origin (0, 0) is the top-left because: Go's image package uses top-left as the origin. If we followed OpenGL convention we would have to flip the image or texture coordinates on the CPU before upload to the GPU or in each shader.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 3-like API. It supports: - macOS, Linux and Windows via OpenGL 4.3 backend, - iOS and Android via OpenGL ES 3.0 backend, - Modern Browsers (desktop and mobile) via WebGL 2.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/notsatvrn/glfw#ContextWatcher) interface. Recommended usage is with github.com/notsatvrn/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package noodle is a WebGL game engine, designed for low level access for fast and efficent 3D applications
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package unisrv implements http helpers for serving Unity WebGL application.
Package gfx provides generic interfaces to GPU-based rendering techniques. This package is not useful by itself but instead part of a larger picture as this package provides generic interfaces and data types to modern graphics rendering API's such as OpenGL, OpenGL ES, WebGL, Direct3D, etc. The coordinate system used by this package is the right-handed Z up coordinate system unless explicitly specified otherwise. Texture coordinates do not follow OpenGL convention where the origin (0, 0) is the bottom-left, instead the origin (0, 0) is the top-left because: Go's image package uses top-left as the origin. If we followed OpenGL convention we would have to flip the image or texture coordinates on the CPU before upload to the GPU or in each shader.
XGL is a cross-platform binding to OpenGL for Go, exposing an OpenGL ES-like API. The API is very similar to OpenGL ES, with a few important changes. - Addition of `GetBoundFramebuffer` function. - Functions which use pointers to arrays for returning data have versions for getting a single value. - All `Gen` functions are renamed to `Create`. - No `GetVertexAttribPointerv` or `ShaderBinary` functions. - Functions which fail if an argument doesn't have a specific value don't ask the user for that argument. ## Support Below is a table showing the versions of XGL and the minimum required GL versions for each platform. | XGL | OpenGL (Desktop) | OpenGL ES (Mobile) | WebGL (Browser) | | --- | ---------------- | ------------------ | --------------- | | 2.0 | 2.1 | 2.0 | 1.0 | Support for OpenGL ES 3.0 and 3.1 is planned. OpenGL ES 3.2 is not planned, due to WebGL not supporting it yet. ## Installation ``` go get -u github.com/notsatvrn/xgl/... GOARCH=js go get -u -d github.com/notsatvrn/xgl/... ``` ## Usage These bindings implement a [glfw.ContextWatcher](https://godoc.org/github.com/notsatvrn/glfw#ContextWatcher) interface. Recommended usage is with `github.com/notsatvrn/glfw` package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. ``` defer glfw.Terminate() ``` If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached. ``` window.MakeContextCurrent() gl.ContextWatcher.OnMakeCurrent(nil) glfw.DetachCurrentContext() gl.ContextWatcher.OnDetach() ```
Package noodle is a WebGL game engine, designed for low level access for fast and efficent 3D applications
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.