OpenShaderDesigner 0.0.1
Loading...
Searching...
No Matches
Texture.h
1// =====================================================================================================================
2// OpenShaderDesigner, an open source software utility to create materials and shaders.
3// Copyright (C) 2024 Medusa Slockbower
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <https://www.gnu.org/licenses/>.
17// =====================================================================================================================
18
19#ifndef TEXTURE_H
20#define TEXTURE_H
21
22#include <glw/texture.h>
23
24#include "FileSystem/FileManager.h"
25
26namespace OpenShaderDesigner
27{
28
30{
31public:
32 using HandleType = glw::texture<glw::texture2D, glw::rgba8>;
33
34 Texture(const FileManager::Path& path);
35 Texture(const FileManager::Path& src, const FileManager::Path& dst);
36 ~Texture() override;
37
38 void Open() override;
39
40 static Asset* Create(const FileManager::Path& path);
41 static Asset* Load(const FileManager::Path& path);
42 static Asset* Import(const FileManager::Path& src, const FileManager::Path& dst);
43
44 HandleType* operator->() { return Handle_; }
45 const HandleType* operator->() const { return Handle_; }
46private:
47 HandleType* Handle_;
48};
49
51{
52public:
53 using HandleType = glw::texture<glw::texture2D, glw::rgba16>;
54
55 HDRTexture(const FileManager::Path& path);
56 HDRTexture(const FileManager::Path& src, const FileManager::Path& dst);
57 ~HDRTexture() override;
58
59 void Open() override;
60
61 static Asset* Create(const FileManager::Path& path);
62 static Asset* Load(const FileManager::Path& path);
63 static Asset* Import(const FileManager::Path& src, const FileManager::Path& dst);
64
65 HandleType* operator->() { return Handle_; }
66 const HandleType* operator->() const { return Handle_; }
67private:
68 HandleType* Handle_;
69};
70
71}
72
73#endif //TEXTURE_H
Definition FileManager.h:77
Definition Texture.h:51
Definition Texture.h:30