Do you like bass?

Wednesday, October 25, 2006

Plugin Template for Visual C#

Now it's ready!

It't time to write a mini-tutorial :-). In order to develop a plugin for Schranz Visuals Tool, you first will need to download the assembly project. It's the file called SVTPlugin.zip.

Once you build it, you will have the assembly ready to start to develop plugins. Now, it's time to start a new project. Before you start coding, you should use the plugin template. Download it here, It's the file called SchrazVTPlugin.zip. Just copy the zip file (yes, the zip file, you don't have to uncompress it) to your Visual Studio item template folder. It's usually located at "My Documents\Visual Studio 2005\Templates\Item templates".

Now, you're ready. Start a new blank library project. Add a reference to SVTPlugin.dll, Microsoft.DirectX, Microsoft.DirectX.Direct3D, System.Drawing and System.Windows.Forms. Add a new SchranzVT Plugin item (search into "user templates") and call it as you like. You should get something like this:


using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using System.Windows.Forms;
using System.Drawing;
using SVTPlugin;

namespace SchranzVT
{
public class myPlugin : SchranzVTPlugin
{
// Local variables go here
private string svtpName;
private string svtpAuthor;
private string svtpVersion;
private Device device;

// Constructor
public myPlugin()
{
// Assigns name, author and version
// This is used just for information
svtpName = "myPlugin";
svtpAuthor = "lazyUser";
svtpVersion = "6.9";

// Initializes directx device
device = null;

// Inits the plugin
this.init();
}

// Name
public string Name
{
get { return svtpName; }
set { svtpName = value; }
}

// Author
public string Author
{
get { return svtpAuthor; }
set { svtpAuthor = value; }
}

// Version
public string Version
{
get { return svtpVersion; }
set { svtpVersion = value; }
}

// Device
public Device dev
{
get { return device; }
set { device = value; }
}

// Makes some plugin initialization
public void init()
{
// Let's set name, author and version of this plugin
Name = svtpName;
Author = svtpAuthor;
Version = svtpVersion;

// Here goes your initialization code
}

// Go!
public void run()
{
// Let's make this plugin work!
device.BeginScene();

// Let's paint something

// Ends our scene
device.EndScene();
}
}
}


And now, you can code your directx effect. Forget about directX initialization, it will be done by the main program, you just need to paint :-). The run function is the main loop of the plugin.

I think I don't forget anything. Feel free to ask if you have any problem

Plugin Assembly released!

I've uploaded an initial version of the plugin assembly that is needed to develop plugins for Schranz VT.

This initial release includes a Visual C# project that creates a dll called SVTPlugin.dll that should be included as reference in all the plugin projects in order to compile them.

I expect to release a project template today and a test tool for the plugins.

Remember that this is an initial draft, so you're welcome to contribute with suggestions and comments :-)

Thursday, October 19, 2006

Plugin system

I didn't realize how difficult (or should I say "strange"?) could be to implement a plugin based application in C#.

After a day an a couple of hours trying to make it work, I've finished a draft of the plugin system. I'm going to clean the code and create a template for Visual C#. I hope a proof of concept version will be ready this weekend.

Tuesday, October 17, 2006

Development Environment

Let's set up our development environment.

For compiling Schranz Visuals Tool (SVT) you'll need Microsoft Visual C# Express. For spanish folks, you can find it here in spanish. If you don't speak spanish, you can find english version here.

Once you have VC# instaled, you need to install the DirectX SDK. It's a very big download (~500 MB), so you'll have to be patient ;-)

And when you've installed DirectX SDK, you'll be ready to start coding effects.

I hope to upload plugin project templates and tutorial for VC# soon.

Ready, go!

Welcome! I've had to create another blog for the development of Schranz Visuals Tool because my other blog is just for my thoughts and including all the Schranz VT stuff there would be a source of confusion :-)

This blog will be in english because the development of Schranz VT will be made in that language.

Enjoy conding and don't forget to join the team!