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

Pages: [1]
1
DotNet / Re: Issue with Render States after non texture draw
« on: February 12, 2013, 11:12:37 pm »
ahh ha, that was the issue, i needed to only include the vertices for that primitive being that it does not use a texture to render the state.

Thanks krzat.

2
DotNet / [RESOLVED] Issue with Render States after non texture draw
« on: February 11, 2013, 09:28:45 pm »
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]

Pages: [1]
anything