mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
image, texture #562
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#562
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
Sorry for some beginner questions.
Can you provide any short examples for loading a image in IMGUI?
i.e. .... img = ... loadimage('.....');
texture = /////
tex_id = ...
ImGui::Image(tex_id,....)
What type is ImTextureID, is it possible to get from a gl::Texture2dRef or ?
Thanks!
imgui isn't an image library. It is up to you to have the raw texture data
already uploaded to the GPU and ready to use for imgui to reference. You
should find another library or write your own code to get texture data into
memory and upload to DirectX or OpenGL.
The imgui.h header has type of ImTextureID, which is void *. It's simply a
type agnostic way of passing around texture references until it hits your
renderer to use. Type cast it to the type you expect for the rendering
backend that you have.
On Wed, Mar 23, 2016 at 9:46 PM, Stream notifications@github.com wrote:
Also see
https://github.com/ocornut/imgui/issues/561
https://github.com/ocornut/imgui/issues/521
https://github.com/ocornut/imgui/issues/510
https://github.com/ocornut/imgui/issues/497
https://github.com/ocornut/imgui/issues/475
This is a commonly asked question so I am going to try clarifying this in the docs and FAQ.
could you give me a example for loading image in Imgui?
I have now written a tutorial to cover image file loading for common graphics API:
https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples