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

Pages: [1]
1
Graphics / PreserveOpenGLStates
« on: March 12, 2012, 09:26:33 pm »
I'm not trying to use SFML with XNA, I'm trying to use SFML and OpenGL instead of XNA!!
I thought it would be easy but SFML is giving me a really hard time. I need to know specifically which states are preserved when calling RenderWindow.PreserveOpenGLStates()

2
Graphics / PreserveOpenGLStates
« on: March 12, 2012, 02:50:34 pm »
Can someone give me a list of states preserved by PreserveOpenGLStates()?
I tried looking this up in the C# documentation, but it wasn't mentioned.
I really want to use SFML for rendering, because I can't figure out how to render the way I need to using XNA, but SFML seems to be doing some weird coordinate system changes that prevents OpenGL rendering from working the way it does in C and C++ (animations are fucked up, and when rendering triangles all seem to be rendered in the same place).
I tried editing the Nehe example in the Tao distribution to ensure that this was in fact a problem with SFML, but the Tao examples all keep crashing my computer (even when I compile as 32bit, as I'm on a 64bit system).

I also tried disabling the states by calling App.PreserveOpenGLStates(false), but that made me unable to render anything at all (except the SFML image).

3
Graphics / Tao memory access violation
« on: March 10, 2012, 07:45:26 pm »
Thanks!

4
Graphics / Tao memory access violation
« on: March 10, 2012, 06:38:27 pm »
I'm not sure my vertex-arrays even have color components... how do I disable 'em?

5
Graphics / Tao memory access violation
« on: March 07, 2012, 05:12:57 pm »
Specifically, the error I'm getting is AccessViolationException;

Code: [Select]
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

6
Graphics / Tao memory access violation
« on: March 07, 2012, 05:01:34 pm »
Trying to draw with Tao gives me a memory access violation exception!

Code: [Select]
                   unsafe
                    {
                        fixed (Vector3* Ptr = &Sim.BodyMesh.TransformedVertices[0])
                            Gl.glVertexPointer(3, Gl.GL_FLOAT, (int)((int)Marshal.OffsetOf(typeof(Vector3), "m_Y") -
                                (int)Marshal.OffsetOf(typeof(Vector3), "m_X") - sizeof(float)), (IntPtr)Ptr);
                        fixed (Vector2* Ptr = &Sim.BodyMesh.TransformedTexVertices[0])
                            Gl.glTexCoordPointer(2, Gl.GL_FLOAT, (int)((int)Marshal.OffsetOf(typeof(Vector3), "m_X") -
                                (int)Marshal.OffsetOf(typeof(Vector3), "m_Y") - sizeof(float)), (IntPtr)Ptr);
                        Gl.glDrawElements(Gl.GL_TRIANGLES, Sim.BodyMesh.FaceCount * 3, Gl.GL_UNSIGNED_INT,
                            Sim.BodyMesh.FaceIndexes);
                    }


The exception occurs when I'm calling glDrawElements()... does anyone know why?
I was thinking of using OpenTK, but I found a post where Laurent wrote that it was difficult (impossible?) to use it with SFML. :(

Please help!

Pages: [1]
anything