From 793ea5ff34edcdb95fd4dadd1f74140bd6fe3a7d Mon Sep 17 00:00:00 2001 From: XProger Date: Sat, 3 Mar 2018 14:35:14 +0300 Subject: [PATCH] #23 fix VAO --- src/mesh.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mesh.h b/src/mesh.h index 106c183..1c11d6a 100644 --- a/src/mesh.h +++ b/src/mesh.h @@ -68,10 +68,10 @@ struct MeshRange { struct Mesh { Index *iBuffer; VertexGPU *vBuffer; - #ifndef _PSP - GLuint ID[2]; - GLuint *VAO; - #endif +#ifndef _PSP + GLuint ID[2]; + GLuint *VAO; +#endif int iCount; int vCount; @@ -191,7 +191,7 @@ struct Mesh { void initRange(MeshRange &range) { #ifndef _PSP - if (Core::support.VAO) { + if (Core::support.VAO && VAO) { ASSERT(aIndex < aCount); range.aIndex = aIndex++; range.bind(VAO); @@ -219,10 +219,9 @@ struct Mesh { range.bind(VAO); #endif - if (range.aIndex == -1) { - bind(); + bind(); + if (range.aIndex == -1) range.setup(vBuffer); - }; Core::DIP(range.iStart, range.iCount, iBuffer); }