• Advertisement
Sign in to follow this  

Getting .net SDL to work(*Fixed*)

This topic is 4789 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I added all of the references I need to, and I'm 'using' all of the needed namespaces, but I can't get it to compile:
#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using SdlDotNet;

#endregion

namespace RefTest
{
    public class MainSource
    {
        public SdlCore core;
        public Surface screen;
        public Image bitmap;

        public static int Main()
        {
            bitmap = new Image("C:\\Documents and Settings\\Grant Williams\\My Documents\\My Pictures\\Wizardry 8 screen 1.bmp");
            screen = new Surface("Test");

            bitmap.draw(screen);

            return 0;
        }
    }
}


There's almost no documentation, how do I get this to work? [Edited by - Drakkcon on January 8, 2005 2:32:16 PM]

Share this post


Link to post
Share on other sites
Advertisement
I've been playing around with SdlDotNet the last couple of days, so perhaps I can help. For one thing, the Surface class has no empty constructor - instead you can create a render target like this:

screen = Video.Instance.SetVideoModeWindow( 800,600, 24, true );

Also have a look at the samples that comes with SdlDotNet - there are a couple of rendering examples that should get you started.

Share this post


Link to post
Share on other sites
Thanks! It works now, here's the fixed code:

#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using SdlDotNet;

#endregion

namespace RefTest
{
public class MainSource
{
public static int Main()
{
Video video = Video.Instance;
Surface screen = video.SetVideoModeWindow(640, 480, 16, true);


return 0;
}
}
}




The examples were useful too, I should get more in the habit of using them.
Rate++.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement