Forum

Share Struct Definitions

Is it possible to share Struct Definitions in your custom plugins or VVVV projects? At the moment I have them redefined around the place which doesn’t seem very extensible

you need to compile the structs (or classes) into a dll. Then you can add them as a reference to your plugins (with ctrl+j). In your plugin you can then add a line like

using VVVV.Nodes.BenymaStructs

just make sure this matches the namespace that was used for the structs

Ah yes, many thanks!

… no text …

hey velcrome, can you give me a more specific hint on this ? how did you make the dll ? any easy way from within vvvv ?

or is there any alternative way to share structs via cable ?

…got it.

just added an additional cs file containing the struct like

using System;

namespace CMS
{
	
		public struct XMLData
		{
 		    public string title;
  		 	public string author;
  			public string subject;
   			public int book_id;
		};
	
}

is there a way to share structs in shaders too?

@guest
Only way I could think of would be to declare them inside some file and include it in your shader, see PhongDirectional for reference:

- include <effects\PhongDirectional.fxh>

See ex9.hlsl.introduction

Functions and Includes