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

[gg] bg_color alpha on frame ignored #15755

Open
nicolasventer opened this issue Sep 14, 2022 · 3 comments
Open

[gg] bg_color alpha on frame ignored #15755

nicolasventer opened this issue Sep 14, 2022 · 3 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@nicolasventer
Copy link
Contributor

V version: Current V version: V 0.3.1 0b2841d, timestamp: 2022-09-14 10:32:09 +0300
OS: Windows 11

What did you do?

In a.v:

import gg
import gx
import rand

fn main() {
	gg.new_context(
		width: 600
		height: 400
		window_title: 'Follow cursor'
		bg_color: gx.rgba(0,0,0,50) // <-- alpha does not work
		frame_fn: on_frame
	).run()
}

fn on_frame(mut ctx &gg.Context) {
	ctx.begin()
	ctx.draw_circle_filled(rand.int() % ctx.height, rand.int() % ctx.width,
		10, gx.rgba(255, 0, 0, 255))
	ctx.end()
}

Execute: v run a.v

What did you expect to see?

I expect to see:

  • with alpha = 50: all drawn circles progressively disappear
  • with alpha = 0: all drawn circles permanantly remain

What did you see instead?

Whatever the value of alpha, all drawn circles immediately disappear

@nicolasventer nicolasventer added the Bug This tag is applied to issues which reports bugs. label Sep 14, 2022
@Larpon
Copy link
Contributor

Larpon commented Sep 15, 2022

I don't think alpha blended window backgrounds is really supported on any platform - so we should probably ignore the alpha channel altogether.

Thanks for the report

@nicolasventer
Copy link
Contributor Author

Ok thanks for the the reply.

Should I close the issue or let anyone else to close it ?

@Larpon
Copy link
Contributor

Larpon commented Sep 16, 2022

I'll let it be open - it should be fixed somehow IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

2 participants