-
-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- has a background thread to decode textures
- Loading branch information
1 parent
fbd2d7a
commit 8ee617b
Showing
8 changed files
with
582 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <filesystem> | ||
#include <imgui.h> | ||
|
||
namespace ImGui { | ||
|
||
namespace Core::TextureManager { | ||
struct Inner; | ||
} // namespace Core::TextureManager | ||
|
||
class RefCountedTexture { | ||
Core::TextureManager::Inner* inner; | ||
|
||
explicit RefCountedTexture(Core::TextureManager::Inner* inner); | ||
|
||
public: | ||
struct Image { | ||
ImTextureID im_id; | ||
u32 width; | ||
u32 height; | ||
}; | ||
|
||
static RefCountedTexture DecodePngTexture(std::vector<u8> data); | ||
|
||
static RefCountedTexture DecodePngFile(std::filesystem::path path); | ||
|
||
RefCountedTexture(); | ||
|
||
RefCountedTexture(const RefCountedTexture& other); | ||
RefCountedTexture(RefCountedTexture&& other) noexcept; | ||
RefCountedTexture& operator=(const RefCountedTexture& other); | ||
RefCountedTexture& operator=(RefCountedTexture&& other) noexcept; | ||
|
||
virtual ~RefCountedTexture(); | ||
|
||
[[nodiscard]] Image GetTexture() const; | ||
|
||
explicit(false) operator bool() const; | ||
}; | ||
|
||
}; // namespace ImGui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.