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.


Messages - Superty

Pages: [1]
1
DotNet / Re: Getting an error on trying to run the example program
« on: December 08, 2012, 07:52:16 pm »
You were right, thanks!

2
DotNet / Re: Getting an error on trying to run the example program
« on: December 08, 2012, 06:29:18 pm »
I did forget to copy the files, but even after I did I still get the same error.

I'm using Visual Studio and C#

There're no line numbers, the error looks like this


If I try to break it shows this

3
DotNet / Getting an error on trying to run the example program
« on: December 08, 2012, 05:18:00 pm »
The sample:

using System;
using SFML.Audio;
using SFML.Window;
using SFML.Graphics;

namespace Example
{
    class Program
    {
        static void OnClose(object sender, EventArgs e)
        {
            // Close the window when OnClose event is received
            RenderWindow window = (RenderWindow)sender;
            window.Close();
        }

        static void Main(string[] args)
        {
            // Create the main window
            RenderWindow window = new RenderWindow(new VideoMode(800, 600), "SFML window");
            window.Closed += new EventHandler(OnClose);

            // Load a sprite to display
            Texture texture = new Texture("cute_image.jpg");
            Sprite sprite = new Sprite(texture);

            // Create a graphical string to display
            Font font = new Font("arial.ttf");
            Text text = new Text("Hello SFML.Net", font);

            // Load a music to play
            Music music = new Music("nice_music.ogg");
            music.Play();

            // Start the game loop
            while (window.IsOpen())
            {
                // Process events
                window.DispatchEvents();

                // Clear screen
                window.Clear();

                // Draw the sprite
                window.Draw(sprite);

                // Draw the string
                window.Draw(text);

                // Update the window
                window.Display();
            }
        }
    }
}
 


And the error is

An unhandled exception of type 'System.BadImageFormatException' occurred in mscorlib.dll

Additional information: Could not load file or assembly 'sfmlnet-window-2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Pages: [1]