zephr/game: fix few memory leaks (and introduced a big one). spawn particles when tiles merge

This commit is contained in:
2024-01-27 04:05:00 +02:00
parent 98c3a0f8af
commit 292f0058d5
8 changed files with 194 additions and 24 deletions
+7
View File
@@ -1,14 +1,21 @@
package zephr
import "core:log"
import gl "vendor:OpenGL"
import stb "vendor:stb/image"
TextureId :: u32
load_texture :: proc(path: cstring) -> TextureId {
context.logger = logger
texture_id: TextureId
width, height, channels: i32
data := stb.load(path, &width, &height, &channels, 4) // RGBA
if data == nil {
log.errorf("Failed to load texture: \"%s\"", path)
}
defer stb.image_free(data)
format := gl.RGBA