summaryrefslogtreecommitdiff
path: root/chickadee/render/texture.scm
Commit message (Collapse)AuthorAgeFilesLines
* Rename 'render' subdirectory to 'graphics'.David Thompson2020-10-031-329/+0
|
* render: Make apply-* procedures public.David Thompson2019-11-191-0/+1
|
* render: texture: Remove debugging code I accidentally left in.David Thompson2019-11-141-3/+0
| | | | -_-
* render: texture: Add support for transparent color keys.David Thompson2019-11-141-9/+29
|
* render: Collect all managed GPU state into a single record type.David Thompson2019-11-061-24/+5
|
* render: texture: Include id when printing.David Thompson2019-10-291-1/+2
|
* doc: Improve texture documentation.David Thompson2019-05-131-1/+1
| | | | | * chickadee/render/texture.scm (list->texture-atlas): Tweak docstring. * doc/api.texi (Textures): Document more procedures.
* render: texture: Stop exporting texture-id.David Thompson2019-05-131-1/+0
| | | | * chickadee/render/texture.scm: Remove texture-id from exports list.
* texture: tileset: Fix rows/columns calculation.David Thompson2019-05-081-2/+2
| | | | | * chickadee/render/texture.scm (split-texture): Use ceiling instead of floor when computing number of rows and columns.
* render: texture: Fix error when splitting certain textures.David Thompson2019-01-061-4/+2
| | | | | | | | | | The split-texture procedure would throw an exception in the event that the image width/height could not be divided by tile width/height with 0 remainder. * chickadee/render/texture.scm (split-texture): Floor the results of dividing image dimensions by tile dimensions and ensure they are exact integers.
* render: texture: Fix bug in framebuffer texture coordinates.David Thompson2018-09-101-1/+1
| | | | | * chickadee/render/texture.scm (make-texture): Don't flip texture horizontally, only vertically.
* render: texture: Add flip? argument to make-texture.David Thompson2018-09-101-5/+11
| | | | * chickadee/render/texture.scm (make-texture): Add #:flip? keyword argument.
* render: Change texture origin to top-left.David Thompson2018-09-101-6/+1
| | | | | | | | | | | | | This is a pretty big change, but hopefully for the best as this aligns with graphics programs and the glTF standard that uses a top-left origin. We can keep using a lower-left origin for vertices, though. * chickadee/render/texture.scm (surface->texture): Stop flipping pixel rows. * chickadee/render/sprites.scm (draw-sprite-unbatched, sprite-batch-add!, draw-nine-patch*): Adjust texture y-coordinates. * chickadee/render/font.scm (parse-fnt): Stop inverting y coordinates. * chickadee/render/tiled.scm (load-tile-map): Stop inverting tile ids.
* render: texture: Define custom record type printer for texture atlas.David Thompson2018-01-291-0/+8
| | | | * chickadee/render/texture.scm (display-texture): New procedure.
* render: texture: Keep a rect for use with draw-sprite and friends.David Thompson2018-01-171-16/+29
| | | | | | | | | | Easier to calculate it once and hang onto it than to generate it each time draw-sprite is called. * chickadee/render/texture.scm (<texture>)[rect]: Delete field. [x y width height gl-tex-rect]: New fields. * chickadee/render/sprite.scm (draw-sprite*, draw-sprite, draw-nine-patch*): Use proper accessors for texture rects.
* render: texture: Fix split-texture.David Thompson2018-01-171-2/+2
| | | | | * chickadee/render/texture.scm (split-texture): Width and height variables need to contain exact numbers.
* render: Refactor sprite rendering.David Thompson2018-01-171-51/+44
| | | | | | | | | | | | | | | | | | | * chickadee/render/texture.scm (<texture-region>): Delete type. (<texture>)[width, height, gl-size]: Delete fields. [parent, rect, gl-rect]: Add fields. (texture-region?): Rewrite. (make-texture, null-texture): Use new texture constructor. (make-texture-region): Rewrite in terms of <texture> type. (list->texture-atlas, split-texture): Use new texture region constructor. * chickadee/render/sprite.scm (draw-sprite*): New procedure. (draw-sprite): Rewrite in terms of draw-sprite*. (draw-nine-patch*): New procedure. (draw-nine-patch): Rewrite in terms of draw-nine-patch*. * chickadee/render/font.scm (draw-text*): New procedure. (draw-text): Rewrite in terms of draw-text*. * doc/api.texi: Update draw-sprite, draw-nine-patch, and draw-text docs.
* render: texture: Fix bug in texture region coordinate calculation.David Thompson2017-10-171-1/+1
| | | | | * chickadee/render/texture.scm (make-texture-region): Fix broken texcoord width/height calculation.
* Third time's the charm for a bug fix?David Thompson2017-10-171-2/+1
|
* Fix build bug for real this time.David Thompson2017-10-171-6/+5
|
* render: texture: Fix strange parallel compilation issue.David Thompson2017-10-171-1/+0
| | | | | I have no damn clue why #:select causes this problem, but simply not using it fixes things!
* render: texture: Use texture regions in texture atlas.David Thompson2017-10-171-5/+6
| | | | | | | * chickadee/render/texture.scm (list->texture-atlas): Create texture regions. Switch from rects to 4-tuples. (texture-atlas, texture-atlas-ref): Update docstring. (split-texture): Create texture regions.
* render: texture: Add private gl-size field.David Thompson2017-10-171-4/+7
| | | | | * chickadee/render/texture.scm (<texture>)[gl-size]: New field. (null-texture, make-texture): Add gl-size argument.
* render: texture: Add texture region data type.David Thompson2017-10-171-0/+35
| | | | * chickadee/render/texture.scm (<texture-region>): New record type.
* texture: Export texture-atlas-texture.David Thompson2017-09-131-0/+1
|
* render: texture: Support using 32 texture units.David Thompson2017-03-311-7/+24
| | | | | | | | | | | | | | | * chickadee/render/texture.scm (make-apply-texture, texture-ref, texture-set!): New procedures. (*texture-states*): New variable. (apply-texture, *texture-state*): Delete. (make-texture): Use 'vector-set!' * chickadee/render/shader.scm: Export 'uniform-type'. (default-uniform-value): Remove 'sampler-2d' case. (extract-uniforms): Handle sampler-2d uniforms specially. * chickadee/render.scm (current-texture): Add 'i' argument. (with-texture): Add 'n' argument. (gpu-apply*): Set textures for all texture units. * .dir-locals.el: Update indentation rules for 'with-texture'.
* render: texture: Quick code style fix.David Thompson2017-01-191-1/+1
|
* render: texture: Allow texture creation with no pixel data.David Thompson2017-01-191-1/+2
| | | | This will be useful for creating framebuffers.
* render: texture: Add texture atlas record type.David Thompson2017-01-121-1/+72
|
* First commit!David Thompson2017-01-041-0/+191