diff --git a/assets/textures.go b/assets/textures.go index 1a1be54..c581a09 100755 --- a/assets/textures.go +++ b/assets/textures.go @@ -50,7 +50,7 @@ func LoadPNGTexture(file string) (Texture, error) { //NOTE: We only support 8-bit channels (32-bit colors) for now i := 0 - for y := 0; y < img.Bounds().Dy(); y++ { + for y := img.Bounds().Dy() - 1; y >= 0; y-- { for x := 0; x < img.Bounds().Dx(); x++ { c := color.NRGBAModel.Convert(img.At(x, y)).(color.NRGBA) diff --git a/main.go b/main.go index ea62f47..f1b1cbc 100755 --- a/main.go +++ b/main.go @@ -26,6 +26,7 @@ import ( //Flesh out the material system //Low Priority: +// Abstract keys enum away from sdl // Abstract UI // Proper Asset loading @@ -137,8 +138,10 @@ func (g *OurGame) Update() { } //Rotating cubes - modelMat.Rotate(10*timing.DT()*gglm.Deg2Rad, gglm.NewVec3(1, 1, 1).Normalize()) - simpleMat.SetUnifMat4("modelMat", &modelMat.Mat4) + if input.KeyDown(sdl.K_SPACE) { + modelMat.Rotate(10*timing.DT()*gglm.Deg2Rad, gglm.NewVec3(1, 1, 1).Normalize()) + simpleMat.SetUnifMat4("modelMat", &modelMat.Mat4) + } imgui.DragFloat3("Cam Pos", &camPos.Data) }