include/GizegoEngine.h
//DO NOT USE BY YOURSELF. This is gonna be called in the TileAtlas.
DO NOT USE BY YOURSELF. This is gonna be called in the TileAtlas.
DO NOT USE BY YOURSELF . This is gonna be called in the TileAtlas .
inline void Finalize(unsigned int t, unsigned int w, unsigned int h, unsigned int vbo)
		{
			for (unsigned int i = 0; i < m_anim.size(); i++)
			{ 
				glGenVertexArrays(1, &m_vao[i]);
				Bind(i);
				glVertexAttribPointer(0, 2, VERTEX_TYPE, GL_FALSE, sizeof(int) * 2, NULL);
				float tcs[12] =
				{
					(float)m_x[i] * t / w, (float)m_y[i] * t / h,
					(float)(t + m_x[i] * t) / w, (float)(t + m_y[i] * t) / h,
					(float)(t + m_x[i] * t) / w, (float)m_y[i] * t / h,
					(float)m_x[i] * t / w, (float)m_y[i] * t / h,
					(float)(t + m_x[i] * t) / w, (float)(t + m_y[i] * t) / h,
					(float)m_x[i] * t / w, (float)(t + m_y[i] * t) / h
				};
				glGenBuffers(1, &m_tbo[i]);
				glBindBuffer(GL_ARRAY_BUFFER, m_tbo[i]);
				glBufferData(GL_ARRAY_BUFFER, sizeof(tcs), tcs, GL_STATIC_DRAW);
				glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 2, NULL);
				glBindBuffer(GL_ARRAY_BUFFER, vbo);
			}
		}
inline void Finalize ( unsigned int t , unsigned int w , unsigned int h , unsigned int vbo ) { for ( unsigned int i = 0 ; i < m_anim . size ( ) ; i ++ ) { glGenVertexArrays ( 1 , & m_vao [ i ] ) ; Bind ( i ) ; glVertexAttribPointer ( 0 , 2 , VERTEX_TYPE , GL_FALSE , sizeof ( int ) * 2 , NULL ) ; float tcs [ 12 ] = { ( float ) m_x [ i ] * t / w , ( float ) m_y [ i ] * t / h , ( float ) ( t + m_x [ i ] * t ) / w , ( float ) ( t + m_y [ i ] * t ) / h , ( float ) ( t + m_x [ i ] * t ) / w , ( float ) m_y [ i ] * t / h , ( float ) m_x [ i ] * t / w , ( float ) m_y [ i ] * t / h , ( float ) ( t + m_x [ i ] * t ) / w , ( float ) ( t + m_y [ i ] * t ) / h , ( float ) m_x [ i ] * t / w , ( float ) ( t + m_y [ i ] * t ) / h } ; glGenBuffers ( 1 , & m_tbo [ i ] ) ; glBindBuffer ( GL_ARRAY_BUFFER , m_tbo [ i ] ) ; glBufferData ( GL_ARRAY_BUFFER , sizeof ( tcs ) , tcs , GL_STATIC_DRAW ) ; glVertexAttribPointer ( 1 , 2 , GL_FLOAT , GL_FALSE , sizeof ( float ) * 2 , NULL ) ; glBindBuffer ( GL_ARRAY_BUFFER , vbo ) ; } }
DO NOT USE BY YOURSELF.
DO NOT USE BY YOURSELF .