Skip to content

Commit 048cdb5

Browse files
committed
Fix dynamic linking warning
Mark ImTextureData with IMGUI_API requiring ImVector to be exported as well; otherwise, MSVC outputs a warning on ImVector<ImTextureRect> updates.
1 parent df7050c commit 048cdb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

imgui.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -3503,7 +3503,7 @@ struct ImTextureRect
35033503
// Why does we store two identifiers: TexID and BackendUserData?
35043504
// - ImTextureID TexID = lower-level identifier stored in ImDrawCmd. ImDrawCmd can refer to textures not created by the backend, and for which there's no ImTextureData.
35053505
// - void* BackendUserData = higher-level opaque storage for backend own book-keeping. Some backends may have enough with TexID and not need both.
3506-
struct IMGUI_API ImTextureData
3506+
struct ImTextureData
35073507
{
35083508
ImTextureStatus Status; // ImTextureStatus_OK/_WantCreate/_WantUpdates/_WantDestroy
35093509
ImTextureFormat Format; // ImTextureFormat_RGBA32 (default) or ImTextureFormat_Alpha8
@@ -3526,7 +3526,7 @@ struct IMGUI_API ImTextureData
35263526
ImTextureData() { memset(this, 0, sizeof(*this)); }
35273527
~ImTextureData() { DestroyPixels(); }
35283528
void Create(ImTextureFormat format, int w, int h);
3529-
void DestroyPixels();
3529+
IMGUI_API void DestroyPixels();
35303530
unsigned char* GetPixels() { IM_ASSERT(Pixels != NULL); return Pixels; }
35313531
unsigned char* GetPixelsAt(int x, int y) { IM_ASSERT(Pixels != NULL); return Pixels + (x + y * Width) * BytesPerPixel; }
35323532
int GetSizeInBytes() const { return Width * Height * BytesPerPixel; }

0 commit comments

Comments
 (0)