SFML community forums
Help => Graphics => Topic started by: madcat on September 11, 2014, 09:10:11 am
-
Hi,
I was wondering if there's a way to associate a repeated texture taken from a tilemap to a VertexArray.
I'm designing asteroids as non convex triangle based objects and I have a sort of texmap with different repeatable rock textures + some sticker-style graphics to overlay on my polygonal asteroids (extra craters, space base, smashed alien...)
I don't seem to find a straightforward way to do it....
is there a way to fix a textureRectangle when assigning the texture at the state level?
state.texture = ??
thx
-
Your question seems to be: "can you repeat texture rects instead of only being able to repeat the entire texture" and, after a quick scan of the docs, it doesn't look like that is possible.
-
Btw. that's how OpenGL works. You can ignore, clamp or repeat texture coordinates if they are lower than 0.0 or higher than 1.0 (normalized). You might want to tailor yourself a little shader to repeat sub textures.