Jump to content
  • Advertisement
Sign in to follow this  
Drakkcon

Getting .net SDL to work(*Fixed*)

This topic is 5033 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!