libera/#clim - IRC Chatlog
Search
9:48:03
metsomedog
For drawing images ("tiles") in a grid, is there some built-in mcclim class recommended to use?
10:04:27
Brucio-61
do you mean using CLIM drawing routines for things lines and circles do draw images that are arranged in a grid or do you mean drawing existing bitmap images at grid-based positions?
10:05:42
metsomedog
Hmm, I was thinking to load some images, and draw equally sized images in a grid for a simple 2d game.
10:22:09
Brucio-61
using bitmap images like this is called "patterns" in CLIM. see http://bauhh.dyndns.org:8000/clim-spec/E-2.html#_1968 for constructing patterns from bitmap files
10:23:04
Brucio-61
6DRAW-PATTERN draws such a pattern to a medium (http://bauhh.dyndns.org:8000/clim-spec/14-5.html#_749)
10:28:13
metsomedog
Thanks I will have a look at those references and try getting something to render
10:45:16
jackdaniel
metsomedog: as Brucio-61 said patterns represent images, and rectangular-tile is a class that represents a pattern that repeats itself
10:47:34
metsomedog
What is a suitable "medium" for drawing onto? I'm trying to use clim-stream-pane right now
10:49:31
metsomedog
(interactor :interactor :scroll-bar nil))" leads to error "The value of CLIM-INTERNALS::PANE-TYPE is 'CLIM:CLIM-STREAM-PANE, which is not of type SYMBOL."
10:52:45
metsomedog
I found some opticl extension in bitmaps.lisp while grepping, any reason to use this over e.g. make-pattern-from-bitmap-file?
11:03:31
jackdaniel
the system update broke my display server and I had to play a detective with broken nvidia kernel modules
11:04:36
metsomedog
this is why i will never buy nvidia (tho i have had my fair share of crashes in amdgpu as well)
11:13:20
metsomedog
how should I "downscale" the image in make-pattern-from-bitmap-file/draw-design (say image is 800x600 and I want 80x60), and how should I draw it at some coordinate?
11:14:15
jackdaniel
principially you should use transform-region, but I think that a method for patterns is not implemented (but try it!)
11:16:18
jackdaniel
even if transform-region works I'd still recommend scaling the image manually with a program that knows anything about downscaling - there are many algorithms and some of them are better and some of them are worse
11:17:57
metsomedog
I'm testing mcclim vs sdl2 bindings for a simple roguelike game, basically never did graphics programming before so both are equally confusing
11:46:54
metsomedog
jackdaniel: if I have a huge tileset .png file with 12x12 sprites, is there some simple way to load some sprites from that file as "patterns"?
11:52:03
jackdaniel
short of copying these sprites I can't think of anything in CLIM that'd help you with that
11:53:30
jackdaniel
but sadly common lisp standard does not specify such a specimen (although ecl will have in the next release)
11:53:41
metsomedog
So I should export them to separate files using another application? I would think you could say "load this subset of pixels from the image into a variable" sort of thing?
11:53:56
Brucio-61
there is a (i think unexported) way of making patterns from arrays of pixel data, though. so if you can load the whole tileset as an array and make "slices" yourself, you should be able to make the patterns in question
11:54:20
jackdaniel
metsomedog: I mean that you could copy slices of the big array into smaller arrays
11:54:59
metsomedog
make-pattern-from-bitmap-file on the top-level png file and then slice afterwards?
11:55:39
jackdaniel
yeah. that wouldn't be like super portable (because you'll need to access the underlying pattern array)
11:58:54
metsomedog
so that would be the array from %rgba-pattern I guess, where each index corresponds to 1 pixel?
12:00:16
jackdaniel
CLIM is a specification, McCLIM is an implementation (like for example common lisp and sbcl), backend is local to the implementation
12:01:56
jackdaniel
but unless I'm horribly mistaken commercial vendors keep clim around to support existing clients, they are not doing anything new with it
12:02:30
metsomedog
as far as I can see mcclim is the only one being actively developed and extended
12:03:32
Brucio-61
another open source CLIM implementation is being developed by gilberth. it is unpublished as of now
12:04:21
jackdaniel
metsomedog: you may use the function clime:pattern-array to acces the array of the pattern
12:04:36
Brucio-61
once released, but you are right, that makes it not open source at this time, i guess
12:06:06
jackdaniel
perhaps we should change clim:make-pattern to create an image pattern when the argument DESIGNS is NIL