Search found 18 matches

by no_login_found
Thu Mar 01, 2018 5:58 pm
Forum: Support and Development
Topic: Is there something like Canvas:overwriteOldImageData() ?
Replies: 12
Views: 1592

Re: Is there something like Canvas:overwriteOldImageData() ?

raidho36 wrote:
Thu Mar 01, 2018 5:23 pm
Take a look at "shapes" section of this touchscreen library https://github.com/raidho36/love-multitouch it does exactly what you're doing, but without touching the GPU.
Ok, thanks for the link. However at the moment I want to go neither geometry path nor third-party lib path.
by no_login_found
Thu Mar 01, 2018 4:13 pm
Forum: Support and Development
Topic: Is there something like Canvas:overwriteOldImageData() ?
Replies: 12
Views: 1592

Re: Is there something like Canvas:overwriteOldImageData() ?

Checking which ui element is under the mouse. Approximately like it's described here https://en.wikibooks.org/wiki/OpenGL_Programming/Object_selection, but now my implementation is much more simple since I'm not using stencil buffer, just painting a rect with color=element id to another canvas. Prob...
by no_login_found
Thu Mar 01, 2018 3:34 pm
Forum: Support and Development
Topic: Scaling accuracy and spritebatches
Replies: 28
Views: 4075

Re: Scaling accuracy and spritebatches

You won't get a mixture of "double borders", whatever that may be, since Added the image and the app to illustrate border issues, including "double borders" (since 2 adjustent lines have ~border color) In this example spritebatch is drawn at different float coords near 0.5 (full set from 0 to 1 is ...
by no_login_found
Thu Mar 01, 2018 1:21 pm
Forum: Support and Development
Topic: Is there something like Canvas:overwriteOldImageData() ?
Replies: 12
Views: 1592

Re: Is there something like Canvas:overwriteOldImageData() ?

I was able to get pointers to missing opengl functions with wglGetProcAddress on win. Now it takes 10^-5 seconds to get pixel from PBO (not sure how inaccurate such small values are), with glReadPixels as soon as drawing is complete and reading from PBO only when needed. Probably it can be optimized...
by no_login_found
Thu Mar 01, 2018 12:24 pm
Forum: Support and Development
Topic: Scaling accuracy and spritebatches
Replies: 28
Views: 4075

Re: Scaling accuracy and spritebatches

The only acceptable way to draw tiles at non-int coordinates is to first draw them to a canvas with int coordinates, and then draw this canvas with any transforms you like. This way each border pixel will be interpolated from 2/4 different tiles exactly the same as pixels inside the tile are interpo...
by no_login_found
Mon Feb 26, 2018 9:51 pm
Forum: Support and Development
Topic: Is there something like Canvas:overwriteOldImageData() ?
Replies: 12
Views: 1592

Re: Is there something like Canvas:overwriteOldImageData() ?

Fortunately, I realized that now I need only 1 px and not every frame, so I can go with newImageData without huge overhead. However I did some tests to see what is slow and how slow it is: Reading 1px ---------------------- glReadPixels 8ms Canvas:newImageData 8ms Reading whole screen of pixels ----...
by no_login_found
Sun Feb 25, 2018 9:27 am
Forum: Support and Development
Topic: Is there something like Canvas:overwriteOldImageData() ?
Replies: 12
Views: 1592

Is there something like Canvas:overwriteOldImageData() ?

Canvas size=screen size
If I call Canvas:newImageData() each frame, it just goes over 2GB and crashes after several seconds.
If I follow it with collectgarbage(), it doesn't crash, but it's extremely slow.
How can I access canvas contents each frame without creating huge imagedata each frame?
by no_login_found
Tue Feb 06, 2018 7:42 pm
Forum: Support and Development
Topic: Garbage collector stops the game[or probably disk access]
Replies: 24
Views: 3289

Re: Garbage collector stops the game[or probably disk access]

It seems the issue happnened because by casting tonumber(ffi.cast("intptr_t", pointer)) you can get negative value (especially on 32bit machines), but when casting ffi.cast("pointer", number) you get null pointer from negative values. So, now I'm using the following code which uses ffi.cast only to ...
by no_login_found
Mon Feb 05, 2018 2:46 pm
Forum: Support and Development
Topic: Garbage collector stops the game[or probably disk access]
Replies: 24
Views: 3289

Re: Garbage collector stops the game[or probably disk access]

I can't confirm that synchronizing ffi.cast helps. Attached 2 files - the game with synchronized cast and the test project which tries to do what game does - allocate pointer in one thread, pass through channel, access it and free. The game with synchronized cast still crashes. The test project does...
by no_login_found
Sat Feb 03, 2018 3:20 pm
Forum: Support and Development
Topic: Garbage collector stops the game[or probably disk access]
Replies: 24
Views: 3289

Re: Garbage collector stops the game[or probably disk access]

I still can't make it run even on 64bit. It segfaults for no obvious reason. gdb shows meaningless things like love::Object::retain() or love:thread:sdl:Thread::thread_runner. If I collectgarbage("stop") for all threads, then it was able to survive enough to show something and create region files, b...