Skip to content

Commit

Permalink
texture: remove GO call in NewTextureFromRGBA
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Jul 13, 2023
1 parent 0c638f0 commit 210958b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Texture.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ func EnqueueNewTextureFromRgba(rgba image.Image, loadCb func(t *Texture)) {

// NewTextureFromRgba creates a new texture from image.Image and, when it is done, calls loadCallback(loadedTexture).
func NewTextureFromRgba(rgba image.Image, loadCallback func(*Texture)) {
go func() {
tex := imgui.NewTextureFromRgba(ImageToRgba(rgba))
loadCallback(&Texture{
tex,
})
}()
tex := imgui.NewTextureFromRgba(ImageToRgba(rgba))
loadCallback(&Texture{
tex,
})
}

// ToTexture converts imgui.Texture to Texture.
Expand Down

0 comments on commit 210958b

Please sign in to comment.