I have run into the following issue when attempting to draw vertex arrays of non and textured rendered states. The following code works with no issues.
m_CacheSize
= 0; m_RenderState
.Texture = tex
; m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(0,
0),
new Vector2f
(0,
0)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
0),
new Vector2f
(300,
0)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
300),
new Vector2f
(300,
300)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(0,
300),
new Vector2f
(0,
300)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
0),
new Vector2f
(0,
0)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(600,
0),
new Vector2f
(300,
0)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(600,
300),
new Vector2f
(300,
300)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
300),
new Vector2f
(0,
300)); window
.Draw(m_VertexCache, PrimitiveType
.Quads, m_RenderState
); When i put a filled rectangle prior in the vertex array, the alpha mode is ignored when drawing the second textured image. code as follows
m_CacheSize
= 0; // Set up for rectangle m_RenderState
.Texture = null; m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
300),
new Color
(255,
0,
0,
255)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(600,
300),
new Color
(255,
0,
0,
255)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(600,
600),
new Color
(0,
0,
0,
255)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
600),
new Color
(0,
0,
0,
255)); window
.Draw(m_VertexCache, PrimitiveType
.Quads, m_RenderState
); m_CacheSize
= 0; m_RenderState
.Texture = tex
; m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(0,
0),
new Vector2f
(0,
0)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
0),
new Vector2f
(300,
0)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
300),
new Vector2f
(300,
300)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(0,
300),
new Vector2f
(0,
300)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
0),
new Vector2f
(0,
0)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(600,
0),
new Vector2f
(300,
0)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(600,
300),
new Vector2f
(300,
300)); m_VertexCache
[m_CacheSize
++] = new Vertex
(new Vector2f
(300,
300),
new Vector2f
(0,
300)); window
.Draw(m_VertexCache, PrimitiveType
.Quads, m_RenderState
) Any suggestions or possible known issues there are? I have also included the source of this project as an attachment, you will need to make sure the libraries are in the same directory as the bin.
Im running on a windows 7 machine in 64 bit with an 6400 nvidia card.
Thanks
[attachment deleted by admin]