Page 4 of 5
Re: Testing the new things in 0.9.0
Posted: Thu Sep 19, 2013 5:27 am
by slime
Santos wrote:I'm wondering, why do new Cursors have to be created from
CursorTypes rather than passing the CursorType to setCursor, since only one style of Cursor can be made from each CursorType?
The external API LÖVE exposes mirrors the one it makes use of internally (which in turn mostly mirrors the OSX/Windows/X11/etc. APIs). I suppose it could lazy-load system cursors and cache them, but there isn't a really great reason to do that in my opinion.
Re: Testing the new things in 0.9.0
Posted: Fri Sep 27, 2013 7:04 am
by Santos
I'm wondering, what are use cases for color masks?
I assume the effects which could be achieved with it would be somewhat limited since there are only so many permutations of the four color components, and couldn't the same effects also be achieved using shaders?
Also, why is the color mask state reset after ever frame, like coordinate transformations?
Re: Testing the new things in 0.9.0
Posted: Fri Sep 27, 2013 7:38 am
by raidho36
Color masks are just there, whether you can see use for them or not. They don't introduce extra overhead, so why don't have them. Someone might find a good use for them.
It does not necessairly have to. It's just after every love.draw ( ), love.graphics.present ( ) is called, which IIRC (could be wrong) also resets everything to configured identity. Internally on low level, this is not mandatory, but this is generally what you want one way or another.
Re: Testing the new things in 0.9.0
Posted: Fri Sep 27, 2013 6:45 pm
by slime
Santos wrote:I'm wondering, what are use cases for color masks?
I assume the effects which could be achieved with it would be somewhat limited since there are only so many permutations of the four color components, and couldn't the same effects also be achieved using shaders?
The color mask compliments shaders, without it every color component in the framebuffer is written to when you draw. It's usually used for pretty advanced techniques, like (re-)using different color components of a canvas for completely different things, or modifying the way things get blended into the active canvas.
You can also use it inside a stencil function to draw while you stencil (since all color components are normally disabled right before the stencil function is called.)
Santos wrote:Also, why is the color mask state reset after ever frame, like coordinate transformations?
It doesn't for me. Are you sure it does for you?
Raidho36 wrote:love.graphics.present ( ) is called, which IIRC (could be wrong) also resets everything to configured identity.
It doesn't - LÖVE resets the coordinate transformations every frame right before love.graphics.draw (when love.graphics.clear is called.)
Re: Testing the new things in 0.9.0
Posted: Fri Sep 27, 2013 7:13 pm
by jjmafiae
will löve get microphone input?
i need it for my game called 9891 (
9891)
for the multiplayer part in it.
Re: Testing the new things in 0.9.0
Posted: Fri Sep 27, 2013 7:27 pm
by slime
It'd be cool to eventually get microphone input support, but last I heard some implementations of the audio library LÖVE uses had a lot of issues with it.
https://bitbucket.org/rude/love/issue/1 ... hone-input
Re: Testing the new things in 0.9.0
Posted: Fri Sep 27, 2013 8:52 pm
by jjmafiae
so will it never be added?
Re: Testing the new things in 0.9.0
Posted: Sat Sep 28, 2013 4:41 am
by Santos
Using Boolsheet's latest build, this affects the drawn image:
Code: Select all
function love.load()
image = love.graphics.newImage('image.png')
end
function love.draw()
love.graphics.setColorMask(false, true, false)
love.graphics.draw(image)
end
and this does not:
Code: Select all
function love.load()
image = love.graphics.newImage('image.png')
end
function love.draw()
love.graphics.draw(image)
love.graphics.setColorMask(false, true, false)
end
Re: Testing the new things in 0.9.0
Posted: Sat Sep 28, 2013 4:51 am
by raidho36
Well duh, you're setting color mask after you completed the blitting.
Re: Testing the new things in 0.9.0
Posted: Sat Sep 28, 2013 5:02 am
by slime
love.graphics.setColorMask affects love.graphics.clear as well (which is called right before love.draw).
Here's what's happening.
Run loop in the first example:
Code: Select all
1. clear r,g,b,a of screen
2. disable r,b channels for future draws/clears
3. draw image's g,a channels
4. present screen, only the g,a channels have anything in them
5. clear screen's g,a channels
6. draw image's g,a channels
7. present screen
repeat 5-7
Run loop in the second example:
Code: Select all
1. clear r,g,b,a of screen
2. draw image's r,g,b,a channels
3. disable r,b channels for future draws/clears
4. present screen
5. clear screen's g,a channels, leaving the previously drawn r,b of the image still there
6. draw image's g,a channels
7. present screen, including the "old" r,b of the image as well as the new g,a of the image
repeat 5-7