Hey,
I'm having a weird issue where draw refuses to work if I pass a RenderStates object. If I remove the RenderStates parameter from the .draw call, it works perfectly. However, whenever I create a RenderStates object and pass it to Draw, it's as if the draw never happens, nothing shows up.
This is the relevant code:
RenderStates state
= new RenderStates
();Transform trans
= new Transform
();trans
.Translate(2f,2f
);state
.Transform = trans
;window
.Clear();window
.Draw(shape, state
);window
.Display(); The shape object is a VertexArray, defined like this:
VertexArray shape
= new VertexArray
(PrimitiveType
.Lines);shape
.Append(new Vertex
(new Vector2f
(5,
100), Color
.Green));shape
.Append(new Vertex
(new Vector2f
(200,
100), Color
.Red));shape
.Append(new Vertex
(new Vector2f
(300,
50), Color
.Magenta));shape
.Append(new Vertex
(new Vector2f
(200,
25), Color
.Red)); I can find no tutorial or example showing that I need any more stuff to be added than this, but it seems I'm obviously missing something.
EDIT: While debugging, I'm noticing that the methods of the Transform isn't doing anything, that is, it's not changing the matrix. Do I need to manually initialize the matrix somehow?