Skip to content

Commit

Permalink
Merge pull request #234 from fgrosse/transparency
Browse files Browse the repository at this point in the history
Support glfw.TransparentFramebuffer window hint
  • Loading branch information
delp committed May 10, 2020
2 parents 9a9f831 + b5e4674 commit a3f5171
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
- Gamepad API?
- Gamepad API support
- Add `WindowConfig.TransparentFramebuffer` option to support window transparency onto the background
- Fixed Line intersects failing on lines passing through (0, 0)

## [v0.10.0-alpha] 2020-05-08
Expand Down
7 changes: 7 additions & 0 deletions pixelgl/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ type WindowConfig struct {
// implement proper full screen windows.
AlwaysOnTop bool

// TransparentFramebuffer specifies whether the window framebuffer will be
// transparent. If enabled and supported by the system, the window
// framebuffer alpha channel will be used to combine the framebuffer with
// the background. This does not affect window decorations.
TransparentFramebuffer bool

// VSync (vertical synchronization) synchronizes Window's framerate with the framerate of
// the monitor.
VSync bool
Expand Down Expand Up @@ -112,6 +118,7 @@ func NewWindow(cfg WindowConfig) (*Window, error) {
glfw.WindowHint(glfw.Decorated, bool2int[!cfg.Undecorated])
glfw.WindowHint(glfw.Floating, bool2int[cfg.AlwaysOnTop])
glfw.WindowHint(glfw.AutoIconify, bool2int[!cfg.NoIconify])
glfw.WindowHint(glfw.TransparentFramebuffer, bool2int[cfg.TransparentFramebuffer])

var share *glfw.Window
if currWin != nil {
Expand Down

0 comments on commit a3f5171

Please sign in to comment.