Search found 248 matches

by arampl
Sun Dec 07, 2014 4:55 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

Of course. I'm talking about their arrangement. Any one of them will reside in the rectangular region of the other one.
by arampl
Sun Dec 07, 2014 4:49 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

You simply test rectangular region + alpha.
It will not work on non-rectangular objects, like buttons inside ellipse in IWD2 interface, because rectangular regions for them will cross each other.
by arampl
Sun Dec 07, 2014 4:01 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

To detect button under mouse cursor I need to draw this first:
by arampl
Sun Dec 07, 2014 3:40 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

So just store the values in a table! Objects (sprites, widgets, anything, hundreds or more of them) in the table will be inserted, deleted, sorted. Possibly many times per frame. If I place corresponding color tuples in the table I will have to renumerate them to maintain connection with correspond...
by arampl
Sun Dec 07, 2014 1:30 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

glReadPixels & glColor(single value) will solve so many problems... This functions is so "base" functions of OpenGL... Of course I can live without them... P.S. :( I don't see why you would need this at all. You mean I can place all this stuff onto shader side? You just Genius! I feel enlightened n...
by arampl
Sun Dec 07, 2014 12:59 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

glReadPixels - because without canvas or getting screenshot we can't get pixel color

Getting screenshot 60 times per frame to read single pixel color is...

And canvas is not supported on every platform.
by arampl
Sun Dec 07, 2014 12:56 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

If we have setColor(single value) then instead of writing for k, v in ipairs(o) do love.graphics.setColor(math.floor(k / 2 ^ 16), math.floor(k / 2 ^ 8) % 2 ^ 8, k % 2 ^ 8, 255) ... we can just write for k, v in ipairs(o) do love.graphics.setColor(k) ... EDIT: Now imagine that we have thousand object...
by arampl
Sun Dec 07, 2014 12:21 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

o = {} -- table with our buttons -- fragment shader, only non-transparent pixels are allowed in the stencil mask_effect = love.graphics.newShader [[ vec4 effect (vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords) {if(Texel(texture, texture_coords).a == vec3(0.0)) discard; return ve...
by arampl
Sun Dec 07, 2014 12:07 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

glReadPixels & glColor(single value) will solve so many problems... This functions is so "base" functions of OpenGL... Of course I can live without them... P.S. :( Dude, you can do col = { 255, 0, 0 } love.graphics.setColor( col ) And if that wasnt possible you could still do love.graphics.setColor...