Comments (3)
I have now tested this with older SFML releases (the official stable ones on
the site) and it still doesn't work, but in a slightly different way (see
attachment). The windows version works. (with "stable" sfml versions, haven't
tested the ones from the git repo)
If I can be of help, please let me know. I am quite frustrated with the lack of
a C# gui that works with SFML, and am trying to move away from GTK.
Original comment by cpolymeris
on 8 Jul 2013 at 7:46
Attachments:
- [Screenshot - 07082013 - 03:42:43 AM.png](https://storage.googleapis.com/google-code-attachments/gwen-dotnet/issue-29/comment-1/Screenshot - 07082013 - 03:42:43 AM.png)
from gwen-dotnet.
I have been looking into this a bit and have discovered what might be the root
of the issue: SFML's RenderWindow.Draw(Vertex[], ...) function seems to be
broken or behaving in a non-intuitive way. In particular, the following code
outputs the attached drawing, the colorful rectangle (the correct one) being
the one drawn with VertexArray, and the weird triangle the one drawn with
Vertex[]:
using SFML.Graphics;
using SFML.Window;
public class TestProgram
{
private RenderWindow window;
static void Main()
{
RenderWindow window = new RenderWindow(new VideoMode(800, 600), "VA test");
window.SetVerticalSyncEnabled(true);
window.Closed += (sender, e) => window.Close();
Vertex v1 = new Vertex(new Vector2f(300, 100), Color.White);
Vertex v2 = new Vertex(new Vector2f(450, 100), Color.Green);
Vertex v3 = new Vertex(new Vector2f(450, 300), Color.Magenta);
Vertex v4 = new Vertex(new Vector2f(300, 300), Color.Yellow);
VertexArray vertexArray = new VertexArray(PrimitiveType.Quads, 4);
vertexArray.Append(v1);
vertexArray.Append(v2);
vertexArray.Append(v3);
vertexArray.Append(v4);
Vertex[] arrayOfVertices = new Vertex[64];
arrayOfVertices[0] = v1;
arrayOfVertices[1] = v2;
arrayOfVertices[2] = v3;
arrayOfVertices[3] = v4;
while (window.IsOpen())
{
window.DispatchEvents();
window.Clear();
window.Draw(vertexArray);
window.Draw(arrayOfVertices, 0, 4, PrimitiveType.Quads);
window.Display();
}
window.Dispose();
}
}
Original comment by cpolymeris
on 9 Jul 2013 at 7:04
Attachments:
- [Screenshot - 07082013 - 10:56:02 PM.png](https://storage.googleapis.com/google-code-attachments/gwen-dotnet/issue-29/comment-2/Screenshot - 07082013 - 10:56:02 PM.png)
from gwen-dotnet.
I could probably try to figure out what the SFML bug is (if there is one), but
I am too lazy. Instead I have just modified GWEN.Net to use VertexArray
instead. It might (or not) be less efficient than the original implementation,
but at least it works perfectly!
If someone else needs it, see attached patch. The font bug is also fixed.
Note that the original file has CR+LF line endings, while I am using LF. If
that causes issues for you, convert either the original file or my patch.
Original comment by cpolymeris
on 9 Jul 2013 at 5:10
Attachments:
from gwen-dotnet.
Related Issues (20)
- Add better constructors for controls HOT 1
- TextBox doesn't accept special characters on FI / Swe keyboard. HOT 4
- OpenTK Unit Tests broken. HOT 3
- Consider adding VerticalSplitter and HorizontalSplitter (source added) HOT 2
- Default skin not loaded HOT 4
- Add MultilineTextBox HOT 3
- 'SFML.LoadingFailedException' occurred in sfmlnet-graphics-2.dll HOT 5
- Patch for OpenTK renderer
- OpenTK render throwing System.Runtime.CompilerServices.ExtensionAttribute exception on mono
- Table layout only works with Labels
- Can't load fonts with SFML Renderer
- Resize arrow are avaible on MessageBox and don't works HOT 1
- Button clicks do not register when clicking on image set by Button.SetImage HOT 1
- Mutliselect Listbox Uses Wrong Texture Offset HOT 1
- UpdateColors inside of Label.cs overwrites custom draw color. HOT 1
- Textboxes cursor incorrectly positioned when using SFML Renderer HOT 1
- Incorrect text rendering
- Tooltip disabling is not working properly.
- Unable to Run Sample SFML
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gwen-dotnet.