Search found 650 matches

by airstruck
Sun Jun 14, 2015 7:47 pm
Forum: Libraries and Tools
Topic: memoize.lua
Replies: 35
Views: 18144

Re: memoize.lua

I wanted a small memoize function that could support nil arguments and expose the cache. Here's what I came up with, maybe it will be useful for someone else: local function memoize (f) local cache = setmetatable({}, { __mode = 'k' }) local resultsKey = {} local nilKey = {} return function (...) loc...
by airstruck
Sat Jun 13, 2015 8:29 pm
Forum: Libraries and Tools
Topic: Aspect - an extremely minimal ECS module
Replies: 8
Views: 4780

Re: Aspect - an extremely minimal ECS module

Added support for entity ids, caching and ordered traversal. To set up caching for an entity list, call Aspect.cache( entities ) . To invalidate the cache, call Aspect.cache( entities ) again. If you want to stop using the cache at runtime for some reason, call Aspect.uncache( entities ) . This does...
by airstruck
Wed Jun 10, 2015 10:31 am
Forum: Support and Development
Topic: Reacting to files being dragged over the game window.
Replies: 6
Views: 3577

Re: Reacting to files being dragged over the game window.

LÖVE [wiki]0.10.0[/wiki] will have APIs for this, but 0.9 doesn't. Added love.filedropped and love.directorydropped event callback functions. Have you seen how FLTK handles this ? There's only one event for the actual dropping (same as the normal paste event) but there are special dnd events that f...
by airstruck
Mon Jun 08, 2015 6:13 pm
Forum: Libraries and Tools
Topic: Aspect - an extremely minimal ECS module
Replies: 8
Views: 4780

Re: Aspect - an extremely minimal ECS module

We lose a couple things, but mainly the ability to easily cache which entities get processed by which systems. Thanks for your input on this. I've been trying to decide whether caching is worth it. In this case it might be nice, because instead of caching entities, we could cache component lists (s...
by airstruck
Mon Jun 08, 2015 1:18 pm
Forum: Libraries and Tools
Topic: Aspect - an extremely minimal ECS module
Replies: 8
Views: 4780

Re: Aspect - an extremely minimal ECS module

Calling it an ECS module is almost misleading (it's almost too simple), but I really like the concise code and the functional approach to ECS. Thanks, I'm really trying to deconstruct ECS as much as possible with this. I'm trying not to put anything in the API that can be fairly reasonably done wit...
by airstruck
Sun Jun 07, 2015 4:09 pm
Forum: Libraries and Tools
Topic: Aspect - an extremely minimal ECS module
Replies: 8
Views: 4780

Aspect - an extremely minimal ECS module

Aspect is a minimal ECS with a focus on simplicity through small API and intuitive operation. local Aspect = require 'aspect' The Aspect API consists of two functions, Aspect.system and Aspect.each . Aspect.system (aspects, process) Creates a new system. The system will process entities with compon...
by airstruck
Thu Jun 04, 2015 11:21 pm
Forum: Support and Development
Topic: Opacity shader with or without textures
Replies: 9
Views: 3886

Re: Opacity shader with or without textures

Thanks for the quick replies. in 0.9 and newer, everything is textured Ahh, that's good, thanks for clearing that up. as far as I know there's nothing that would prevent you from compiling love. I might do that at some point (probably only if I want to make a pull request or something though). For n...
by airstruck
Thu Jun 04, 2015 8:47 pm
Forum: Support and Development
Topic: Opacity shader with or without textures
Replies: 9
Views: 3886

Re: Opacity shader with or without textures

Nixola wrote:I think you can safely update to 0.9
The problem is liblove wants libc6 >= 2.15, but under this version of Debian the repos have libc6 2.13. So far I'm too lazy to build libc, but I may try to build Love against 2.13. I'll test your suggestion on Android though.
by airstruck
Thu Jun 04, 2015 8:31 pm
Forum: Support and Development
Topic: Opacity shader with or without textures
Replies: 9
Views: 3886

Re: Opacity shader with or without textures

I don't think you need that "if" In 0.8.0, removing the "if" (treating everything as textured) cause untextured graphic primitives not to display at all. I wonder if this has changed in a later version. I'm using 0.8.0 on my Debian laptop because the libc in the repos is behind ...
by airstruck
Thu Jun 04, 2015 7:26 pm
Forum: Support and Development
Topic: Opacity shader with or without textures
Replies: 9
Views: 3886

Opacity shader with or without textures

I want to create a shader that will modify the global opacity of a scene, regardless of whether textures are used. Im not sure how to determine whether textures are present. I found a similar question here but there are no satisfying answers. For now I've settled for checking for the presence of tex...