Search found 90 matches

by Xii
Sun Dec 13, 2020 6:57 pm
Forum: Support and Development
Topic: [solved] How to get Texture from Quad
Replies: 16
Views: 3774

Re: How to get Texture from Quad

Thank you for your assistance pgimeno, the shader now draws the specified part. To render a part of a texture you give love.graphics.draw both the texture and the quad. No shaders are required to do that. If you only give love.graphics.draw a texture then LÖVE automatically uses a quad that spans th...
by Xii
Sun Dec 13, 2020 6:32 pm
Forum: Support and Development
Topic: [solved] How to get Texture from Quad
Replies: 16
Views: 3774

Re: How to get Texture from Quad

So what you're saying is, I need to edit the shader to draw only part of the texture?
by Xii
Sun Dec 13, 2020 6:14 pm
Forum: Support and Development
Topic: [solved] How to get Texture from Quad
Replies: 16
Views: 3774

[solved] How to get Texture from Quad

I have a shader, and when I create a new Image and a new Quad from that Image, then try to pass the Quad to the shader it errors with: "bad argument #3 to 'gl_send' (Texture expected, got Quad)". How do I get the Texture from the Quad? The wiki says nothing on Textures . I'm trying to rend...
by Xii
Wed Aug 26, 2020 6:28 am
Forum: Support and Development
Topic: Trying to get the real desktop size (in pixels) on macOS and Windows
Replies: 6
Views: 2960

Re: Trying to get the real desktop size (in pixels) on macOS and Windows

I don't want to ship any .bat file, and I don't want to require my users to execute .bat files. It's a poor workaround. Since a .bat file is just a list of Windows shell commands, can't you use os.execute(command) to do it from Lua code? (you'll have to check that love.system.getOS() == "Windo...
by Xii
Fri Aug 21, 2020 1:28 am
Forum: Support and Development
Topic: love.event.poll() and quit event
Replies: 3
Views: 848

Re: love.event.poll() and quit event

The value of a appears to be nil in this event. No idea what it's for...
by Xii
Fri Aug 21, 2020 1:19 am
Forum: Support and Development
Topic: Memory Profiling?
Replies: 27
Views: 13466

Re: Memory Profiling?

pgimeno wrote: Thu Aug 20, 2020 10:32 pm Memory allocated with FFI (via ffi.new or something like ffi.C.malloc) is like memory allocated by Löve: it doesn't count towards LuaJIT's garbage collection count
You are surely mistaken. C structs allocated with ffi.new definitely show up on my collectgarbage("count")
by Xii
Tue Aug 18, 2020 11:59 pm
Forum: Support and Development
Topic: Memory Profiling?
Replies: 27
Views: 13466

Re: Memory Profiling?

If you are using Lua tables to store game information, like npc.health=100 or map[pos]=tile_id or whatever, you can significantly reduce your memory consumption by using FFI. Here is an article detailing how to do that. Using FFI you can define compact memory structures for values that simply do not...
by Xii
Sun Aug 16, 2020 10:35 pm
Forum: Support and Development
Topic: Questions around love.run
Replies: 10
Views: 1925

Re: Questions around love.run

love.graphics.present says it "will halt the program until ready if necessary " (emphasis mine). Supposing that vsync is on, and love.update + love.draw took more time than the screen's refresh rate allows (that is, we missed the vsync), does love.graphics.present halt the program? (until...
by Xii
Fri Aug 14, 2020 6:22 pm
Forum: Support and Development
Topic: Questions around love.run
Replies: 10
Views: 1925

Re: Order of callbacks?

Ah yes, I think the whole process is outlined on the wiki at love.run . You can, in fact, specify a custom main loop and order of calls. I like that. Tangent question: love.graphics.present says it "will halt the program until ready" (when vsync is on). Does it halt all threads in the prog...
by Xii
Thu Aug 13, 2020 9:17 pm
Forum: Support and Development
Topic: Questions around love.run
Replies: 10
Views: 1925

Questions around love.run

In what order does the engine call the callbacks? update before draw , presumably, but what about mousepressed , focus , etc.? When are these triggered? What if the main thread is in the middle of executing a function? What if the main thread is in the middle of accessing data that is also accessed ...