1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:27:43 +00:00

3DFileViewer: Clean up file handling

This unifies how 3DFileViewer handles the initial file when starting
the application and when opening files later on via the menu.

Errors are shown both for the initial load as well as when loading
files later on. An error during file load no longer clears the
existing model.

It also adds support for specifying the filename as a command-line
argument.

The opened file's name is shown in the titlebar.
This commit is contained in:
Gunnar Beutner 2021-05-20 21:50:53 +02:00 committed by Andreas Kling
parent 728e6dad73
commit 2a16c8bdb8
4 changed files with 49 additions and 46 deletions

View file

@ -7,6 +7,7 @@
#pragma once
#include <AK/String.h>
#include <LibCore/File.h>
#include "Common.h"
#include "Mesh.h"
@ -16,5 +17,5 @@ public:
MeshLoader() { }
virtual ~MeshLoader() { }
virtual RefPtr<Mesh> load(const String& fname) = 0;
virtual RefPtr<Mesh> load(Core::File& file) = 0;
};