From 585e7890cdd416b77bd28c2ef853477b42c606ef Mon Sep 17 00:00:00 2001 From: Erik Biederstadt Date: Wed, 19 May 2021 11:57:59 -0600 Subject: [PATCH] 3DFileViewer: Move `Demos/GLTeapot` to `Applications/3DFileViewer` Also changes the category to `Graphics` --- Base/res/apps/3DFileViewer.af | 4 ++++ Base/res/apps/GLTeapot.af | 4 ---- .../{app-teapot.png => app-3d-file-viewer.png} | Bin .../{app-teapot.png => app-3d-file-viewer.png} | Bin Userland/Applications/3DFileViewer/CMakeLists.txt | 8 ++++++++ .../GLTeapot => Applications/3DFileViewer}/Common.h | 0 .../GLTeapot => Applications/3DFileViewer}/Mesh.cpp | 0 .../GLTeapot => Applications/3DFileViewer}/Mesh.h | 0 .../3DFileViewer}/MeshLoader.h | 0 .../3DFileViewer}/WavefrontOBJLoader.cpp | 0 .../3DFileViewer}/WavefrontOBJLoader.h | 0 .../GLTeapot => Applications/3DFileViewer}/main.cpp | 10 +++++----- Userland/Applications/CMakeLists.txt | 1 + Userland/Demos/CMakeLists.txt | 1 - Userland/Demos/GLTeapot/CMakeLists.txt | 8 -------- 15 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 Base/res/apps/3DFileViewer.af delete mode 100644 Base/res/apps/GLTeapot.af rename Base/res/icons/16x16/{app-teapot.png => app-3d-file-viewer.png} (100%) rename Base/res/icons/32x32/{app-teapot.png => app-3d-file-viewer.png} (100%) create mode 100644 Userland/Applications/3DFileViewer/CMakeLists.txt rename Userland/{Demos/GLTeapot => Applications/3DFileViewer}/Common.h (100%) rename Userland/{Demos/GLTeapot => Applications/3DFileViewer}/Mesh.cpp (100%) rename Userland/{Demos/GLTeapot => Applications/3DFileViewer}/Mesh.h (100%) rename Userland/{Demos/GLTeapot => Applications/3DFileViewer}/MeshLoader.h (100%) rename Userland/{Demos/GLTeapot => Applications/3DFileViewer}/WavefrontOBJLoader.cpp (100%) rename Userland/{Demos/GLTeapot => Applications/3DFileViewer}/WavefrontOBJLoader.h (100%) rename Userland/{Demos/GLTeapot => Applications/3DFileViewer}/main.cpp (94%) delete mode 100644 Userland/Demos/GLTeapot/CMakeLists.txt diff --git a/Base/res/apps/3DFileViewer.af b/Base/res/apps/3DFileViewer.af new file mode 100644 index 0000000000..6cf8f1181f --- /dev/null +++ b/Base/res/apps/3DFileViewer.af @@ -0,0 +1,4 @@ +[App] +Name=3D File Viewer +Executable=/bin/3DFileViewer +Category=Graphics diff --git a/Base/res/apps/GLTeapot.af b/Base/res/apps/GLTeapot.af deleted file mode 100644 index d1ab7ec9e6..0000000000 --- a/Base/res/apps/GLTeapot.af +++ /dev/null @@ -1,4 +0,0 @@ -[App] -Name=GLTeapot -Executable=/bin/GLTeapot -Category=Demos diff --git a/Base/res/icons/16x16/app-teapot.png b/Base/res/icons/16x16/app-3d-file-viewer.png similarity index 100% rename from Base/res/icons/16x16/app-teapot.png rename to Base/res/icons/16x16/app-3d-file-viewer.png diff --git a/Base/res/icons/32x32/app-teapot.png b/Base/res/icons/32x32/app-3d-file-viewer.png similarity index 100% rename from Base/res/icons/32x32/app-teapot.png rename to Base/res/icons/32x32/app-3d-file-viewer.png diff --git a/Userland/Applications/3DFileViewer/CMakeLists.txt b/Userland/Applications/3DFileViewer/CMakeLists.txt new file mode 100644 index 0000000000..a5aca6e9c1 --- /dev/null +++ b/Userland/Applications/3DFileViewer/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SOURCES + Mesh.cpp + WavefrontOBJLoader.cpp + main.cpp +) + +serenity_app(3DFileViewer ICON app-3d-file-viewer) +target_link_libraries(3DFileViewer LibGUI LibGL) diff --git a/Userland/Demos/GLTeapot/Common.h b/Userland/Applications/3DFileViewer/Common.h similarity index 100% rename from Userland/Demos/GLTeapot/Common.h rename to Userland/Applications/3DFileViewer/Common.h diff --git a/Userland/Demos/GLTeapot/Mesh.cpp b/Userland/Applications/3DFileViewer/Mesh.cpp similarity index 100% rename from Userland/Demos/GLTeapot/Mesh.cpp rename to Userland/Applications/3DFileViewer/Mesh.cpp diff --git a/Userland/Demos/GLTeapot/Mesh.h b/Userland/Applications/3DFileViewer/Mesh.h similarity index 100% rename from Userland/Demos/GLTeapot/Mesh.h rename to Userland/Applications/3DFileViewer/Mesh.h diff --git a/Userland/Demos/GLTeapot/MeshLoader.h b/Userland/Applications/3DFileViewer/MeshLoader.h similarity index 100% rename from Userland/Demos/GLTeapot/MeshLoader.h rename to Userland/Applications/3DFileViewer/MeshLoader.h diff --git a/Userland/Demos/GLTeapot/WavefrontOBJLoader.cpp b/Userland/Applications/3DFileViewer/WavefrontOBJLoader.cpp similarity index 100% rename from Userland/Demos/GLTeapot/WavefrontOBJLoader.cpp rename to Userland/Applications/3DFileViewer/WavefrontOBJLoader.cpp diff --git a/Userland/Demos/GLTeapot/WavefrontOBJLoader.h b/Userland/Applications/3DFileViewer/WavefrontOBJLoader.h similarity index 100% rename from Userland/Demos/GLTeapot/WavefrontOBJLoader.h rename to Userland/Applications/3DFileViewer/WavefrontOBJLoader.h diff --git a/Userland/Demos/GLTeapot/main.cpp b/Userland/Applications/3DFileViewer/main.cpp similarity index 94% rename from Userland/Demos/GLTeapot/main.cpp rename to Userland/Applications/3DFileViewer/main.cpp index e81f697431..eca71032eb 100644 --- a/Userland/Demos/GLTeapot/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -63,7 +63,7 @@ private: // Load the teapot m_mesh = m_mesh_loader->load("/res/gl/teapot.obj"); - dbgln("GLTeapot: teapot mesh has {} triangles.", m_mesh->triangle_count()); + dbgln("3DFileViewer: teapot mesh has {} triangles.", m_mesh->triangle_count()); } virtual void paint_event(GUI::PaintEvent&) override; @@ -113,7 +113,7 @@ bool GLContextWidget::load(const String& fname) { m_mesh = m_mesh_loader->load(fname); if (!m_mesh.is_null()) { - dbgln("GLTeapot: mesh has {} triangles.", m_mesh->triangle_count()); + dbgln("3DFileViewer: mesh has {} triangles.", m_mesh->triangle_count()); return true; } @@ -146,10 +146,10 @@ int main(int argc, char** argv) // Construct the main window auto window = GUI::Window::construct(); - auto app_icon = GUI::Icon::default_icon("app-teapot"); + auto app_icon = GUI::Icon::default_icon("app-3d-file-viewer"); window->set_icon(app_icon.bitmap_for_size(16)); - window->set_title("GLTeapot"); + window->set_title("3D File Viewer"); window->resize(640, 480); window->set_resizable(false); window->set_double_buffering_enabled(true); @@ -195,7 +195,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("&Help"); - help_menu.add_action(GUI::CommonActions::make_about_action("GLTeapot", app_icon, window)); + help_menu.add_action(GUI::CommonActions::make_about_action("3D File Viewer", app_icon, window)); window->set_menubar(move(menubar)); window->show(); diff --git a/Userland/Applications/CMakeLists.txt b/Userland/Applications/CMakeLists.txt index f2dd51efd3..9a9674c5f1 100644 --- a/Userland/Applications/CMakeLists.txt +++ b/Userland/Applications/CMakeLists.txt @@ -1,3 +1,4 @@ +add_subdirectory(3DFileViewer) add_subdirectory(About) add_subdirectory(AnalogClock) add_subdirectory(Browser) diff --git a/Userland/Demos/CMakeLists.txt b/Userland/Demos/CMakeLists.txt index cf3be6ef53..3fe8445740 100644 --- a/Userland/Demos/CMakeLists.txt +++ b/Userland/Demos/CMakeLists.txt @@ -2,7 +2,6 @@ add_subdirectory(CatDog) add_subdirectory(Cube) add_subdirectory(Eyes) add_subdirectory(Fire) -add_subdirectory(GLTeapot) add_subdirectory(LibGfxDemo) add_subdirectory(LibGfxScaleDemo) add_subdirectory(Mandelbrot) diff --git a/Userland/Demos/GLTeapot/CMakeLists.txt b/Userland/Demos/GLTeapot/CMakeLists.txt deleted file mode 100644 index ff6420a889..0000000000 --- a/Userland/Demos/GLTeapot/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(SOURCES - Mesh.cpp - WavefrontOBJLoader.cpp - main.cpp -) - -serenity_app(GLTeapot ICON app-teapot) -target_link_libraries(GLTeapot LibGUI LibGL)