Update examples
This commit is contained in:
parent
2013bc4628
commit
7b91ce25fb
8 changed files with 32 additions and 36 deletions
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/gen2brain/raylib-go/raylib"
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
const numProcesses = 8
|
||||
|
@ -35,9 +35,9 @@ func main() {
|
|||
|
||||
rl.InitWindow(screenWidth, screenHeight, "raylib [textures] example - image processing")
|
||||
|
||||
image := rl.LoadImage("parrots.png") // Loaded in CPU memory (RAM)
|
||||
image := rl.LoadImage("parrots.png") // Loaded in CPU memory (RAM)
|
||||
rl.ImageFormat(image, rl.UncompressedR8g8b8a8) // Format image to RGBA 32bit (required for texture update)
|
||||
texture := rl.LoadTextureFromImage(image) // Image converted to texture, GPU memory (VRAM)
|
||||
texture := rl.LoadTextureFromImage(image) // Image converted to texture, GPU memory (VRAM)
|
||||
|
||||
currentProcess := None
|
||||
textureReload := false
|
||||
|
@ -98,8 +98,8 @@ func main() {
|
|||
break
|
||||
}
|
||||
|
||||
pixels := rl.GetImageData(image) // Get pixel data from image (RGBA 32bit)
|
||||
rl.UpdateTexture(texture, pixels) // Update texture with new image data
|
||||
pixels := rl.LoadImageColors(image) // Get pixel data from image (RGBA 32bit)
|
||||
rl.UpdateTexture(texture, pixels) // Update texture with new image data
|
||||
|
||||
textureReload = false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue