Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Filling a polygon with a texture?

This thread is locked; no one can reply to it. rss feed Print
Filling a polygon with a texture?
nshade
Member #4,372
February 2004

Is there a slick way of filling an area with a repeating texture. I could of sworn that al_draw_filled_rectangle did it, but I was mistaken. Maybe it's a fill command I'm thinking of?

EDIT

I just found this thread here:
https://www.allegro.cc/forums/thread/613849

It says you can't really do it without shaders..

Is there a tutorial about what shaders are and how to use them with Allegro. When I look up them up I get referred to some new language I'm supposed to learn or I have to talk to by graphics card directly. The Allegro docs are no help as it wants me to make an shader "object" and I don't understand what one of those even does.

If I have a texture "ALLEGRO_BITMAP *tex" that has an 8x8 pattern in it. How would I use tell a shader to use that in a box from x1,y1 to x2,y2?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

nshade
Member #4,372
February 2004

That's cool, but what is the allegro function I would use?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: