Update C sources

This commit is contained in:
Milan Nikolic 2019-11-25 03:34:31 +01:00
parent 02424e2e10
commit bd6bf15356
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
53 changed files with 62247 additions and 9914 deletions

View file

@ -1,6 +1,8 @@
package main
import (
//"fmt"
"github.com/gen2brain/raylib-go/raylib"
)
@ -20,10 +22,12 @@ func main() {
texture := rl.LoadTextureFromImage(image) // Convert image to texture (VRAM)
mesh := rl.GenMeshHeightmap(*image, rl.NewVector3(16, 8, 16)) // Generate heightmap mesh (RAM and VRAM)
model := rl.LoadModelFromMesh(mesh) // Load model from generated mesh
model.Material.Maps[rl.MapDiffuse].Texture = texture // Set map diffuse texture
mapPosition := rl.NewVector3(-8.0, 0.0, -8.0) // Set model position
//fmt.Printf("%+v\n", mesh)
model := rl.LoadModelFromMesh(mesh) // Load model from generated mesh
//fmt.Printf("%+v\n", model)
model.Materials = make([]rl.Material, 1)
model.Materials[0].Maps[rl.MapDiffuse].Texture = texture // Set map diffuse texture
mapPosition := rl.NewVector3(-8.0, 0.0, -8.0) // Set model position
rl.UnloadImage(image) // Unload heightmap image from RAM, already uploaded to VRAM