I have another update regarding developing controls in c#. I was able to attach a OpenGL object to our user control and deploy it in IADS. I used the in-built example from SharpGL (a wrapper for .NET framework) of a rotating pyramid and attached it to an user control. One of the primary challenge was to include the associated dlls (which hosts the OpenGL llibrary). I used the folllowing code to unwrap the dll and then zip it up with the assembly that we create.
Inside the public Usercontrol1():
string resource1 = "SampleAxControlCSharpDotNet.SharpGL.dll";
string resource2 = "SampleAxControlCSharpDotNet.SharpGL.SceneGraph.dll";
string resource3 = "SampleAxControlCSharpDotNet.SharpGL.WinForms.dll";
EmbeddedAssembly.Load(resource1, "SharpGL.dll");
EmbeddedAssembly.Load(resource2, "SharpGL.WinForms.dll");
EmbeddedAssembly.Load(resource3, "SharpGL.SceneGraph.dll");
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
return EmbeddedAssembly.Get(args.Name);
}
Inside the Initialize function add the following:
private void InitializeComponent()
{
this.openGLControl1 = new SharpGL.OpenGLControl();
((System.ComponentModel.ISupportInitialize)(this.openGLControl1)).BeginInit();
this.SuspendLayout();
//
// openGLControl1
//
this.openGLControl1.BackColor = System.Drawing.SystemColors.Control;
this.openGLControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.openGLControl1.DrawFPS = true;
this.openGLControl1.FrameRate = 20;
this.openGLControl1.Location = new System.Drawing.Point(0, 0);
this.openGLControl1.OpenGLVersion = SharpGL.Version.OpenGLVersion.OpenGL2_1;
this.openGLControl1.RenderContextType = SharpGL.RenderContextType.FBO;
this.openGLControl1.RenderTrigger = SharpGL.RenderTrigger.TimerBased;
this.openGLControl1.Size = new System.Drawing.Size(908, 695);
this.openGLControl1.TabIndex = 0;
this.openGLControl1.OpenGLInitialized += new System.EventHandler(this.openGLControl_OpenGLInitialized);
this.openGLControl1.OpenGLDraw += new SharpGL.RenderEventHandler(this.openGLControl_OpenGLDraw);
this.openGLControl1.Resized += new System.EventHandler(this.openGLControl_Resized);
//
// UserControl1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.openGLControl1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(908, 695);
((System.ComponentModel.ISupportInitialize)(this.openGLControl1)).EndInit();
this.ResumeLayout(false);
}
In case if you have any questions please feel free to message me.