Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Help setting up SFML  (Read 3475 times)

0 Members and 6 Guests are viewing this topic.

codicil793

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Help setting up SFML
« 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:


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
« Last Edit: April 06, 2014, 09:43:25 am by codicil793 »

eike

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Help setting up SFML
« Reply #1 on: April 05, 2014, 10:00:45 am »
For me it looks as your code is missing an event loop.


codicil793

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Help setting up SFML
« Reply #2 on: April 06, 2014, 03:14:06 am »
It only crashes if I instantiate a RenderWindow. A regular Window doesn't crash.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Help setting up SFML
« Reply #3 on: April 06, 2014, 03:16:40 am »
We can't help unless you provide some real crash information.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

codicil793

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Help setting up SFML
« Reply #4 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?

eike

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Help setting up SFML
« Reply #5 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.

codicil793

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Help setting up SFML
« Reply #6 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();

            }
        }
    }

}
 
« Last Edit: April 08, 2014, 08:28:04 am by codicil793 »

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: Help setting up SFML
« Reply #7 on: April 06, 2014, 06:26:47 pm »
Since you're using C# check the highlighted files and settings on the right side. :P



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. :)
I have many ideas but need the help of others to find way to make use of them.