summaryrefslogtreecommitdiff
path: root/ConsoleApp/ModelCommands.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ConsoleApp/ModelCommands.cs')
-rw-r--r--ConsoleApp/ModelCommands.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/ConsoleApp/ModelCommands.cs b/ConsoleApp/ModelCommands.cs
index 9bbf1f3..4cd406c 100644
--- a/ConsoleApp/ModelCommands.cs
+++ b/ConsoleApp/ModelCommands.cs
@@ -114,5 +114,31 @@ namespace ConsoleApp {
+ " more settings will be added later.";
}
}
+
+
+
+ public class RenderModelCommand : ResFileCommand {
+ public RenderModelCommand() : base("render a model in a window using OpenGL") {
+ }
+
+ protected override void OperateOnFile(string[] args) {
+ if (args.Length != 1) {
+ Console.WriteLine("invalid syntax.\n" + GetHelp(null));
+ return;
+ }
+
+ using (var rwin = new RenderWindow()) {
+ rwin.Title = args[0];
+ rwin.SetModel(TargetFile, args[0]);
+ rwin.Run(1, 1);
+ }
+ }
+
+ public override string GetHelp(string[] args) {
+ return "syntax: render-model <brres-filename> <model-name>\n"
+ + " renders a model in a window using OpenGL.\n\n"
+ + " quite limited at the moment, will be improved later";
+ }
+ }
}