Closed cebarks closed 3 years ago
Question: does this work with canvases?
Question: does this work with canvases?
Canvas is just a go abstraction for a gl target i think? and this is implemented at the opengl level, so I'm not 100% sure, but I think it should.
Last question, you mention that setting this to a power of 2 enables the multisampling, is it just a no-op if it's set to not-a-power-of-2?
Last question, you mention that setting this to a power of 2 enables the multisampling, is it just a no-op if it's set to not-a-power-of-2?
Not sure honestly? Maybe would be worth having some vars in the package with various presets.
Yeah I think that would be a good idea, suggest some reasonable values and if someone wants to do something else, they can.
@dusk125 I added a check in NewWindow that will error out if you don't put in 0, 2, 4, 8, or 16.
Seeing as there's so much discussion about powers of two and only accepting them and erroring if not, why not just not let the user set an invalid value - accept an int and left shift 1
by that int, call it something like msaaLevel
.
Seeing as there's so much discussion about powers of two and only accepting them and erroring if not, why not just not let the user set an invalid value - accept an int and left shift
1
by that int, call it something likemsaaLevel
.
That would certainly clear up the power of two problem; however, I think having a specific set of values is clearer to someone who may not be as experienced.
That would certainly clear up the power of two problem; however, I think having a specific set of values is clearer to someone who may not be as experienced.
I don't think that's too much to ask of a user, nor too high a price to pay for the nicer API. I'm just one dude though, I can be out of touch. I was floating the idea to see if it had a wider appeal.
This PR adds a new WindowConfig value: SamplesMSAA.
When this is set to a power of 2, it will enable MSAA for the window.