I may be forced to surrender and use something else. It is not worth my time to convert some 400,000 lines of code to C++
I’m lost on this. Is it even possible to use this without the player?
This works! I have it in a menu on the editor. I’m using message boxes to debug so I can see what is happening.
async void Gogo()
{
MessageBox.Show("ready to test?", "Test", (MessageBoxButtons)1);
Type app = typeof(HelloWorld.HelloWorld);
var ap = await window.Show(app, new ApplicationOptions("Data"));
Time.Sleep(5000); //display it for 5 seconds.
if (!Setup())
{
MessageBox.Show("Application could not setup", "error", (MessageBoxButtons)1);
window.Stop();
application.Dispose();
Time.Sleep(500);
Application.Exit();
}
}
So I now remove this process and try it with my own code.
I will NOT render.
protected bool Setup()
{
// allow for setting up resource gathering
foreach (string s in RepositoryClass.AxiomDirectories)
{
List<string> repositoryDirectoryList = RepositoryClass.Instance.RepositoryDirectoryList;
List<string> l = new List<string>();
foreach (string repository in repositoryDirectoryList)
{
l.Add(Path.Combine(repository, s));
}
ResourceManager.AddCommonArchive(l, "Folder");
}
object ret = Registry.GetValue(Config.WorldEditorBaseRegistryKey, "Disable Video Playback", false);
ret = ret == null || string.Equals(ret.ToString(), "False") ? false : (object)true;
disableVideoPlayback = (bool)ret;
MessageBox.Show("Going to dispose of the engine", "testing", (MessageBoxButtons)1);
window.Dispose();
//make new controls.
InitRenderControl();
window.UnderlyingPanel = new Panel { Dock = DockStyle.Fill };
window.Controls.Add(window.UnderlyingPanel);
window.UnderlyingPanel.Visible = false; // tried this both true and false
opts = new ApplicationOptions();
opts.ExternalWindow = window.UnderlyingPanel.Handle;
opts.DelayedStart = true;
opts.LimitFps = false;
opts.UseDirectX11 = true;
opts.ResizableWindow = true;
opts.AutoloadCoreData = true;
/Make new application
application = new Urho.Application(opts);
application.Run();
engine = application.Engine;
var cache = application.ResourceCache;
var helloText = new Text()
{
Value = "Hello World from UrhoSharp",
HorizontalAlignment = Urho.Gui.HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center
};
helloText.SetColor(new ColorEx(0f, 1f, 0f));
helloText.SetFont(font: cache.GetFont("Fonts/Anonymous Pro.ttf"), size: 30);
UI ui = new UI();
ui.Root.AddChild(helloText);
engine.RunFrame();
Time.Sleep(5000); //Display it for 5 seconds but nothing is displayed.
Debugger.Break(); // forced stop in testing
<snip>
return true;
}