Hey, I'm trying to get SFML set up with Visual C# 2010. I'm getting this warning when I run some simple test code:
A call to PInvoke function 'sfmlnet-graphics!SFML.Graphics.RenderWindow::sfRenderWindow_Create' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
Here's the code, it's adapted from the example in the SFML dotnet documentation:
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 app = new RenderWindow(new VideoMode(800, 600), "SFML window");
app.Closed += new EventHandler(OnClose);
// Start the game loop
while (app.IsOpened())
{
// Process events
app.DispatchEvents();
// Clear screen
app.Clear();
// Update the window
app.Display();
}
}
}
}
If I turn off MDA warnings then everything runs fine, but I'm thinking that a stack imbalance is serious and that I should look into it. Any ideas?