Developers

 

How to Setup Visual Studio

Modules

For Developers

SLProject is separated into modules.

Each module consists of a .dll file on windows, a .typeinfo and an .ad file.

MakeTypes.exe processes c++ header files and creates a .typeinfo file containing all the c++ type information.

ParseMap.exe takes as input a .map file generated by the Visual Studio C++ linker and a .typeinfo file and generates an .ad file thats maps the type information to addresses in the .dll file.

This allows you at runtime to access c++ typeinformation, including information on classes, typedefs, templates, methods, baseclasses, derived classes, enums, namespaces, and global functions.

The syntax to access this information in a C++ program is like this:

const Type_Info& ti = typeid(MyClass);

Type* pType = ti.GetType();

Type* pType = typeof(MyClass); /* typeof is simply a #define for typeid(x).GetType() */

ClassType* pType = MyObject->GetType(); /* if MyObject is derived from Object */

ClassType* pType = GetType(MyObject); /* if MyObject is not derived from Object, however it needs to have a vtable, i.e. have virtual methods */

void* pObject = DynamicCast(ClassType* fromType, ClassType* toType);

void* pObject = newobj(ClassType*);

NamedType* pType = pD->LookupNamedType(StringIn name);

FunctionObject* fun = pD->m_procs.find("funcname")->second;

int32 result = int32_invoke_function_cdecl(ULONG_PTR address, byte* args, uint argslen);
Declarator* decl;

int result = decl->invoke_function<int>(byte* args, uint argslen);

String result = decl->invoke_function<String>(byte* args, uint argslen);

Dispatch* pDispatch = GetDispatch(NamespaceType*); /* (e.g ClassType*) */

...

 

String types

There are two string types: String and StringVariant.

String holds a refcounted pointer to a StringObject.

StringObject is an abstract base class for the template classes ImmutableString and MutableString.

MutableString is refcounted, and uses CopyOnWrite (COW) to reduce memory. The string data is not nullterminated, but is implemented as a vector.

These template classes can hold strings of

char8

char16

char32

You can pass pointers to these as char* (char8*) or wchar_t* (currently char16*)

You can mix char and wchar_t strings with comparison, append and insert methods.

 

StringVariant can hold either a StringObject, a char* null-terminated C string or wchar_t* null-terminated C string

StringVariant is usually used for in parameters, and for this reason there's a convenient typedef

typedef StringVariant StringIn;

 

This makes it possible to pass e.g

void func(StringIn str)

{

//...

}

 

func("Hello World");

without making a any memory allocations for a string object. Ideally, there should have been a way to do write something like:

func(S("Hello World"));

Which would make a static ImmutableString. I tried this with C++ templates using a char* as a template parameter, but constant strings have local storage instead of global, so it didn't work.

Modules

LFC (TODO Rename to Core ...?)

Draw (TODO Rename to Graphics)

Imaging (TODO Rename to BitmapC.. ?)

Expressive

GUI

Network (TODO)

X3D

XML

XPath (XQuery)

XSLT

LXML (TODO, rename to Web)

HTML

SVG

Media

MPEG4

PDF

ZIP

SQL

EcmaScript

Java VM

Debugging

 

Additional Modules:

VisionTraining

ImageEdit

 

How to Setup Visual Studio

todo...

C++ code samples

Hello world example:

 

int main()
{
  Gui::Button* button = new Gui::Button("Hello world");
  Gui::Window* window = new Gui::Window(button);
  window->Show();
  Application::get_Current()->MessageLoop();
  return 0;
}

TODO

(short list... and currently hard to understand..)

 

View x3d scene from different views

View depth buffer as bitmap

PhysX loaded as lazy so it is not absolutely required

BeginLog / SaveLogAsHtml()

Direct3D 9 support as well as Direct3D 10 to support XP

Look into ActionScript 2 VM spec

#defines are available as well as typeinfo

Locale

Support Linux

XML/CSS/SVG works again

GUI/SVG effects works

GetSourceFiles() / GetFileParts()

cpp AddType dynamically

XMLHttpRequest

NNTP

UUDecode

Xml Schema include

XPath shortcuts

SQL works again

Web Service / XML RPC / SOAP / WDSSL

Compile as java bytecode

ParseCOFFPE

Debug

MPEG4 BIFS/Java

XFORM

RDF/OWL

...