I'm trying to create a Revit Extension using SharpGL in WPF window and just can't get the FPS over 10. WPF & SharpGL work smooth together without Revit. This is the simple code
public class Class1 : IExternalCommand
{
public Result Execute(
ExternalCommandData commandData,
ref string message,
ElementSet elements)
{
System.Windows.Application app = new System.Windows.Application();
app.Run(new MainWindow());
return Result.Succeeded;
}
}
Revit Execute runs WPF's MainWindow, which draws nothing at 10FPS!
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void OpenGLControl_OpenGLDraw(object sender, OpenGLEventArgs args)
{
OpenGL gl = args.OpenGL;
gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);
}
}
Is there a way to smooth it up, or should I just stop using SharpGL and go with WPF?