summaryrefslogtreecommitdiff
path: root/ConsoleApp/ModelCommands.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-05-07 03:50:42 +0200
committerTreeki <treeki@gmail.com>2011-05-07 03:50:42 +0200
commitb726fbe95fa850f1e51dbc6a4a76f701dbb1db6b (patch)
treedbeda734bb92f8e062bb44a1dc04763537a49c99 /ConsoleApp/ModelCommands.cs
parent30a400a14b2cda40bd87234b284d692dbe540736 (diff)
downloadnw4rtools-b726fbe95fa850f1e51dbc6a4a76f701dbb1db6b.tar.gz
nw4rtools-b726fbe95fa850f1e51dbc6a4a76f701dbb1db6b.zip
added render-model command to ConsoleApp
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";
+ }
+ }
}