简体   繁体   中英

SFML with C#, startup trouble

I want to use SFML with C# .NET. I've had to get SFML 2.0 since 1.6 apparently had some issues with AMD graphics cards. The issue is that the constructor of SFML.Window.Window enters an infinite loop.

My code:

using SFML;
using SFML.Window;
using SFML.Graphics;

namespace SFML
{
    class Program
    {
        static void Main(string[] args)
        {
            SFML.Window.Window window = new SFML.Window.Window(new VideoMode(800, 600), "Test widow");
        }
    }
}

It seems like nobody else on the internet has this issue, and I've tried it on another computer with the same result. Any help will be extremely appreciated.

Not sure you're creating the Window appropriately. Look at the examples from the Github source. If you're doing OpenGL, you'd use RenderWindow for instantiating your window object:

https://github.com/SFML/SFML.Net/blob/master/examples/opengl/OpenGL.cs

For 2D windows:

https://github.com/SFML/SFML.Net/blob/master/examples/window/Window.cs

Also note the inclusion of Tao bindings in those examples.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM