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.


Topics - obi-wan shinobi

Pages: [1]
1
Graphics / SFML.Net 2.0 RC RenderWindow crash
« on: July 30, 2012, 02:39:38 am »
Setting up and using a RenderWindow works okay, but when the app closes, I get a error message.  In VS2010, while debugging, "Failed to share OpenGL context" flashes on the output window before it goes away.  Otherwise, I'll see that "Fault Module Name:   atioglxx.dll" shows up in the crash information window.  This problem doesn't occur when using a regular Window, just with a RenderWindow, and so far only in the SFML.Net 2.0 Release Candidate.  My video card is a Radeon HD5770 with the latest (version 12.6) drivers.

Here's the code I'm using so far:
using System;
using SFML;
using SFML.Graphics;
using SFML.Window;

public class Cmain
{
    static RenderWindow wnd;
    static bool running;
    static RectangleShape shp;
    static Text s2d;

    static void Main()
    {
        wnd = new RenderWindow(new VideoMode(800, 600),
            "Testing Window", Styles.Default);
       

        wnd.Closed += new EventHandler(wnd_Closed);
        //wnd.KeyPressed += new EventHandler<KeyEventArgs>(wnd_KeyPressed);
        wnd.SetVerticalSyncEnabled(true);
        int frames = 0;
        int time = Environment.TickCount;
        s2d = new Text();
        running = true;
        while (wnd.IsOpen())
        {
            wnd.DispatchEvents();
            wnd.Clear(Color.Black);
           
            shp = new RectangleShape(new Vector2f(320, 240));
            shp.Position = new Vector2f(100, 100);
            shp.FillColor = Color.Magenta;
            for(int a = 0; a < 300; a++)
                wnd.Draw(shp);
            s2d.DisplayedString = "Testing";
            s2d.Position = new Vector2f(200, 200);
            s2d.Color = Color.Cyan;
            wnd.Draw(s2d);
            wnd.Display();
            frames++;
        }
        Console.WriteLine("Frames rendered: {0}, time: {1}", frames, Environment.TickCount - time);
    }

    /*static void wnd_KeyPressed(object sender, KeyEventArgs e)
    {
        Window tmp = (Window)sender;
        if (e.Code == Keyboard.Key.Escape)
            tmp.Close();
    }*/


    static void wnd_Closed(object sender, EventArgs e)
    {
        //Window tmp = (Window)sender;
        //tmp.Close();
        wnd.Close();
        //wnd.Dispose();
    }
}

By the way, will SFML.Net be supported on Mac or Linux in a future release?

Pages: [1]
anything