Search found 248 matches

by arampl
Sat Dec 06, 2014 11:51 pm
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

Sigh. I'm not talking about how to do it. There are thousand ways in Lua to convert something to something. Not sure, but glColor3uiv / glColor4uiv can even be hardware accelerated. It's about speed optimization (plus code simplicity integrated as a side effect). Don't you agree that object picking ...
by arampl
Sat Dec 06, 2014 4:49 pm
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. :(
by arampl
Sat Dec 06, 2014 4:40 pm
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

bartbes wrote:So

Code: Select all

function setColor(r)
    return love.graphics.setColor(math.floor(r/16777216), math.floor(r/65536)%256, math.floor(r/256)%256, r%256)
end
And this is so much more useful because...
I'm doing exactly something like this and want to get rid of this calculations each frame.
by arampl
Sat Dec 06, 2014 4:36 pm
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

As of now I'm doing all the stuff with canvas and formulas for converting setColor(r,g,b) to some single value (obect's id).
Imho It will be much cleaner if we can just use setColor(obect id)...
In OpenGL + C it can be done flawlessly...
by arampl
Sat Dec 06, 2014 4:30 pm
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

Look at this, guys.

EDIT: stripped out comments for now...
by arampl
Sat Dec 06, 2014 4:15 pm
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

I'm talking about reading several pixels near mouse cursor. And it will be made each frame. So taking screenshot... Now I'm using canvas for reading pixels, but it is not supported everywhere, as I heard. And about glColor3uiv / glColor4uiv. I will prepare and show sample lua file here to explain w...
by arampl
Sat Dec 06, 2014 9:48 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Re: Wrappers for glReadPixel, glColor3uiv / glColor4uiv

I'm talking about reading several pixels near mouse cursor. And it will be made each frame. So taking screenshot... Now I'm using canvas for reading pixels, but it is not supported everywhere, as I heard. And about glColor3uiv / glColor4uiv. I will prepare and show sample lua file here to explain wh...
by arampl
Sat Dec 06, 2014 9:02 am
Forum: Support and Development
Topic: Wrappers for glReadPixel, glColor3uiv / glColor4uiv
Replies: 46
Views: 8501

Wrappers for glReadPixel, glColor3uiv / glColor4uiv

Hi all!

@devs: Please, implement those! Must have for object picking by color without using canvas and formulas for color to number conversion.
by arampl
Thu Oct 30, 2014 4:47 pm
Forum: General
Topic: How to make a game with LOVE?
Replies: 17
Views: 5944

Re: How to make a game with LOVE?

Never mind. Actually functions as a tables' keys can be very useful: fn1 = function(x) print(x) end fn2 = function(x) print("bar") end t[fn1] = "foo" t[fn2] = "foo" for i, v in pairs(t) do i(v) end (from http://stackoverflow.com/questions/14563773/can-lua-function-references-be-used-as-table-keys ) ...
by arampl
Thu Oct 30, 2014 4:21 am
Forum: General
Topic: How to make a game with LOVE?
Replies: 17
Views: 5944

Re: How to make a game with LOVE?

How to do this better way then?