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 - jjamesdk

Pages: [1]
1
Graphics / Re: Extending sf::Vertex
« on: March 10, 2015, 01:42:51 pm »
Ahh! that may be it, I'll check it out. Thanks my friend :). C++ is a beast

2
Graphics / Re: Extending sf::Vertex
« on: March 10, 2015, 01:00:37 pm »
Heya, Thanks for the response

Well basically, I'm making a Flexible Grid system consisting of Nodes, that can contain other properties, such
as having a status of being occupied or not, having an Id, etc. I am using composition saying each Node has a Vertex (this is my custom Vertex, extending sf::Vertex). However, I need to have some kind of mapping back to the Node it's in with a key pair value for when I operate on it through the index in the sf::VertexArray. In example, say I have NodeId set to one, when this nodes vertex is getting appended I would also be setting it's nodeKey to NodeId. Then when iterating over the array I can say, if nodeKey == NodeId, do something. So ultimately I am adding a method for getting/setting nodeKey in this case.

See my github for a better idea
https://github.com/jjamesdk/MazeMania/wiki/Snapshots-throughout-the-SDLC

Thanks again

3
Graphics / Extending sf::Vertex
« on: March 10, 2015, 04:48:49 am »
Hi all,

I was attempting to extend sf::Vertex, by creating my own custom vertex class and inheriting from this. I am able to create the methods I want fine, and sf::VertexArray will append with my custom Vertex class. However, when I try to access my new methods from an index within my sf::VertexArray container, I only have access to to the existing sf::Vertex properties, such as position, color, and texCoords. The strange thing is I can access my new methods outside of the sf::VertexArray object, just not within it.

Am I going about this the wrong way? or was this just not intended to work this way?

- Thanks All

Pages: [1]