summaryrefslogtreecommitdiffstats
path: root/modules/ktx/register_types.cpp
diff options
context:
space:
mode:
authoracazuc <acazuc@acazuc.fr>2023-04-28 18:26:01 +0200
committeracazuc <acazuc@acazuc.fr>2023-08-19 10:27:29 +0200
commita00cf02241a1e7772ae1c44c63d95cae08bd53a0 (patch)
tree17beb0dda28acb90d494211f8cdcbd0e89fbd57d /modules/ktx/register_types.cpp
parentff5c884153d1c15bde3ee87aa295e52bec3a6340 (diff)
downloadredot-engine-a00cf02241a1e7772ae1c44c63d95cae08bd53a0.tar.gz
Add support for KTX & KTX2 image format
Add support glTF KHR_texture_basisu extension
Diffstat (limited to 'modules/ktx/register_types.cpp')
-rw-r--r--modules/ktx/register_types.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/modules/ktx/register_types.cpp b/modules/ktx/register_types.cpp
new file mode 100644
index 0000000000..1d48e05a90
--- /dev/null
+++ b/modules/ktx/register_types.cpp
@@ -0,0 +1,53 @@
+/**************************************************************************/
+/* register_types.cpp */
+/**************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/**************************************************************************/
+/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
+/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/**************************************************************************/
+
+#include "register_types.h"
+
+#include "texture_loader_ktx.h"
+
+static Ref<ResourceFormatKTX> resource_loader_ktx;
+
+void initialize_ktx_module(ModuleInitializationLevel p_level) {
+ if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
+ return;
+ }
+
+ resource_loader_ktx.instantiate();
+ ResourceLoader::add_resource_format_loader(resource_loader_ktx);
+}
+
+void uninitialize_ktx_module(ModuleInitializationLevel p_level) {
+ if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
+ return;
+ }
+
+ ResourceLoader::remove_resource_format_loader(resource_loader_ktx);
+ resource_loader_ktx.unref();
+}