Skip to content

keroyan/ImageLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

ImageLoader

Utilize stb_image and directx 9 & 11 to effortlessly load the image of your choice, made specifically for ImGui!

file support description
ImageLoaderDX9.h file load any image you want through file using stb_image
ImageLoaderDX11.h file, memory load any image you want through both file and memory using stb_image

Usage

DX9

static Texture t(pDevice);
static bool result = t.LoadTextureFromFile("C:\\test.png");
if (result)
{
     ImGui::Image(t.GetTexture(), ImVec2(512, 384));
}

DX11

From Memory

static Texture logo(pDevice);
static bool logo_result = logo.LoadTextureFromMemory(logo_bytes, logo_bytes_size);
if (logo_result)
{
     ImGui::Image(logo.GetTexture(), ImVec2(64, 64));
     // Note: You can get the actual size of the image using logo.GetWidth() and Logo.GetHeight()
}

From File

static Texture logo(pDevice);
static bool logo_result = logo.LoadTextureFromFile("test.png");
if (logo_result)
{
     ImGui::Image(logo.GetTexture(), ImVec2(64, 64));
     // Note: You can get the actual size of the image using logo.GetWidth() and Logo.GetHeight()
}

About

A texture loader using stb_image for directx9! can be used for ImGui!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages