Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
Plugin.cpp
1/*
2Copyright (C) 2016-2019,2025 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
18#include "aeongames/Plugin.hpp"
19#include "PngImage.h"
20
21extern "C"
22{
23 bool PngStartUp()
24 {
25 return AeonGames::RegisterImageDecoder ( "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a", AeonGames::DecodePNG );
26 }
27
28 void PngShutdown()
29 {
30 AeonGames::UnregisterImageDecoder ( "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a" );
31 }
32
33 PLUGIN PluginModuleInterface PMI =
34 {
35 "PNG image loader",
36 "Implements Portable Network Graphics image support",
37 PngStartUp,
38 PngShutdown
39 };
40}
Platform-specific macros, includes, and DLL export/import definitions.
Defines the plugin module interface for dynamically loaded plugins.
DLL bool RegisterImageDecoder(const std::string &aMagick, const std::function< bool(Texture &, size_t, const void *) > &aDecoder)
Registers an image decoder for a specific file magic identifier.
Definition Texture.cpp:26
DLL bool UnregisterImageDecoder(const std::string &aMagick)
Unregisters a previously registered image decoder.
Definition Texture.cpp:31
bool DecodePNG(Texture &aTexture, size_t aBufferSize, const void *aBuffer)
Decodes PNG image data from a memory buffer into a Texture.
Definition PngImage.cpp:61
Interface that every loadable plugin module must expose.
Definition Plugin.hpp:35