SFML community forums

Help => General => Topic started by: codicil793 on April 05, 2014, 06:46:36 am

Title: Help setting up SFML
Post by: codicil793 on April 05, 2014, 06:46:36 am
I have looked at the tutorial, and looked at threads by people having similar issues, with no luck. I get this error when I run a single line program:

Code: [Select]
The thread 0x21f8 has exited with code 259 (0x103).
The thread 0xc90 has exited with code 259 (0x103).
The program '[9844] Project5.vshost.exe' has exited with code 255 (0xff).

This is the program that generates that error:

using System;
using System.Drawing;
using SFML.Graphics;
using SFML.Window;

namespace Project1
{
    public class SDL
    {

        public static void Main(string[] args)
        {
            RenderWindow rw = new RenderWindow(VideoMode.DesktopMode,"Test");
        }

    }
}

Previously, I was unable to run this at all, but since adding the files from the "extlibs" folder to my project it just crashes immediately after running.

Running it in VS2012 I get this:
(http://i.imgur.com/1tMv0Il.png)

I got this from the event log:
Code: [Select]
- System

  - Provider

   [ Name]  Application Error
 
  - EventID 1000

   [ Qualifiers]  0
 
   Level 2
 
   Task 100
 
   Keywords 0x80000000000000
 
  - TimeCreated

   [ SystemTime]  2014-04-06T07:36:32.000000000Z
 
   EventRecordID 6196
 
   Channel Application
 
   Computer Josh-PC
 
   Security
 

- EventData

   Project1.vshost.exe
   11.0.50727.1
   5011d445
   nvoglv32.DLL
   8.17.12.9616
   4f53cfb7
   c0000005
   00845643
   cc8
   01cf516abacb848d
   c:\users\josh\documents\visual studio 2012\Projects\Project1\Project1\bin\Debug\Project1.vshost.exe
   C:\Windows\system32\nvoglv32.DLL
   2bed7b7a-bd5e-11e3-b2dc-606c66427029
Title: Re: Help setting up SFML
Post by: eike on April 05, 2014, 10:00:45 am
For me it looks as your code is missing an event loop.

Title: Re: Help setting up SFML
Post by: codicil793 on April 06, 2014, 03:14:06 am
It only crashes if I instantiate a RenderWindow. A regular Window doesn't crash.
Title: Re: Help setting up SFML
Post by: zsbzsb on April 06, 2014, 03:16:40 am
We can't help unless you provide some real crash information.
Title: Re: Help setting up SFML
Post by: codicil793 on April 06, 2014, 10:01:23 am
I updated the OP with crash information. Is there any other useful information I can post? And how do I get it?
Title: Re: Help setting up SFML
Post by: eike on April 06, 2014, 02:21:52 pm
For me, without knowing Java, it looks as the render window gets created and a millisecond later destroyed. Do you have to create the window "static"?

Again, I think a message loop could help.
Title: Re: Help setting up SFML
Post by: codicil793 on April 06, 2014, 04:42:29 pm
I tried this which worked fine. Figure it would create and dispose of a window with no problem, guess I was wrong.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using SFML.Window;
using SFML.Graphics;

namespace Project5
{
    class Class1
    {
        static void Main(string[] AssemblyLoadEventArgs)
        {
            RenderWindow rw = new RenderWindow(VideoMode.DesktopMode, "kkkk");

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();

            System.Timers.Timer endTimer = new System.Timers.Timer(25000);
            endTimer.Elapsed += delegate(Object sender, System.Timers.ElapsedEventArgs args)
            {
                rw.Close();
            };
            endTimer.Start();

            RectangleShape r = new RectangleShape(new Vector2f(15,15));
            r.Transform.Translate(new Vector2f(15, 15));

            while (rw.IsOpen())
            {
                rw.DispatchEvents();
                rw.Draw(r);
                rw.Display();

            }
        }
    }

}
 
Title: Re: Help setting up SFML
Post by: StormWingDelta on April 06, 2014, 06:26:47 pm
Since you're using C# check the highlighted files and settings on the right side. :P

(http://i.imgur.com/ekbg2kq.png)

I had to add the SFML files to my project in order to get it to work than change the settings on those files to make it so it wouldn't crash loading up from the working directory. >_>  Hope this helps. :)