Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - muffintastic

Pages: [1]
1
Graphics / Re: Vertices and textures
« on: September 27, 2013, 10:35:52 pm »
Oh god I didn't see this before. Feel free to delete this topic. Thanks for humoring me guys.

2
Graphics / Re: Vertices and textures
« on: September 27, 2013, 07:44:13 pm »
Thanks for the fast response! So if I should create a class containing a VertexArray primitive grid and a texture, how do I attach the texture to the primitive grid? Do I create a sprite, set its primitive to the grid I defined, then texture the sprite and draw it?

Edit: I guess my question is: how do I draw a VertexArray with a texture passed into the render states?

3
Graphics / Vertices and textures
« on: September 27, 2013, 07:21:40 pm »
Hello,

I'm new to SFML and only have a year of experience with programming in general. I'd like to create a grid of sprites to make a graphical roguelike game. However, this is costly on resources, which led me to wanting to use Vertex and VertexArray. I have one large texture with all of my 40x40 sprite graphics. I would like to create a 20x12 grid of simple objects which store a position on this texture sheet, and then draw the whole grid every cycle. However, I don't understand how I would do this... since the vectors only offer position, color and texture position (What does this even do? What texture is it referring to?) I tried reading this but it confused me. Surely there is a simple way to do what I want to do? I want to be able to call a function like "map[tileX][tileY].set(xOnSpriteSheet,yOnSpriteSheet)".

Thank you in advance for your help, I appreciate it.

Pages: [1]
anything