Advertisement

AS IDE - Beta

Started by May 18, 2006 12:59 AM
11 comments, last by gilad_novik 18 years, 5 months ago
Here are my updates:

I now have a working dll to be used as an IDE. Since AS interface is still changing, and I didn't want to limit the debugger to a specific version of AS, I decided not to use AS inside the code, but rather to use a callback mechanism.

When creating the debugger, you need to pass it an interface that wrap the actual calls.

class asDebugCallback
{
public:
virtual bool Compile(const char*)=0;
virtual int Execute()=0;
virtual void Abort()=0;
virtual void Suspend()=0;
};

Inside your actual code, you need to implement that interface, and call the actual functions by yourself (using the context interface). That way, you can use a different version of the script engine even with an older version of the debugger.

When creating the engine, you supply your interface.

class asDebugApplication
{
public:
virtual bool Start()=0;
virtual void Stop()=0;

virtual void Show()=0;
virtual void Hide()=0;
};

asDebugApplication* pApp=asDebugCreateApplication((asDebugCallback*)pMyCallback);
assert(pApp);
pApp->Show();
pApp->Start();

That's the general idea. I'm still testing it (for now there are no problems), and I'll upload it soon when it's ready for release.

If you have any comment about the way it works, please post them here.

Gilad
Now this sounds like a really useful thing for application developers that use AngelScript :)

I look forward to seeing how this turns out.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Here is the first release: http://gilad.gsetup.com/ASDebug.zip

Some notes:

In order to make it easier to bind to AS, there is a file called "ASDebugContext.h" which calls the actual context from AS. Check "MainDlg.h" to see how to implement it in your code ("MainDlg.h" is just the file from my test application. Don't try to compile it, it's there for reference only).

There are some notes inside "ASDebug.h", please verify it's clear enough for you.

I'll add some more functions to the interface soon, so you'll be able to customize the debug window.

Please note that currently the window is running in its own thread. Since I need to handle idle messages and translating of accelerator commands, I've decided to put everything in a seperate thread so you won't have to do it yourself in your code.

Since I'm terrible writing documents (and english is not my strong language), I'll be glad for any help writing some documents so I can create a webpage for the debugger.

Some technical notes: Everything was written using ATL/WTL. There are no known dependencies. Editor is based on Scintilla control.

Gilad

This topic is closed to new replies.

Advertisement