mirror of
https://github.com/IllusionMan1212/O2048.git
synced 2026-10-24 10:12:37 +00:00
zephr/game: fix few memory leaks (and introduced a big one). spawn particles when tiles merge
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user