Polyphase Game Engine
Loading...
Searching...
No Matches
TextureAtlasViewer.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include <cstdint>
6#include <string>
7#include "imgui.h"
8
9class Texture;
10class Image;
11
12class TextureAtlasViewer
13{
14public:
15 ~TextureAtlasViewer();
16
17 void DrawPanel();
18
19private:
20 // Loaded texture asset
21 Texture* mTexture = nullptr;
22 ImTextureID mImGuiTexId = 0;
23 uint32_t mAtlasWidth = 0;
24 uint32_t mAtlasHeight = 0;
25
26 // Atlas grid configuration
27 int32_t mTileWidth = 8;
28 int32_t mTileHeight = 8;
29
30 // Selection
31 int32_t mSelectedTileIndex = -1;
32 int32_t mHoveredTileIndex = -1;
33
34 // Manual tile index lookup
35 int32_t mLookupTileIndex = 0;
36
37 // Zoom
38 float mZoom = 2.0f;
39
40 void SetTexture(Texture* tex);
41 void ClearTexture();
42 void DrawControls();
43 void DrawAtlasImage();
44 void DrawTilePreview();
45};
46
47TextureAtlasViewer* GetTextureAtlasViewer();
48
49#endif
Definition Texture.h:10