I’m reading the book for the second time, this time I’m experimenting with the results of each chapter. My question is in regards to the first air hockey project where there are two triangles for the table, one line for the player’s region boundary, and two points for the mallets.
I modified the project to have another set of vertexData for a border around the table. What I did was removed this code from onSurfaceCreated() ( all of the changes I did to the Renderer class )
glVertexAttribPointer(A_POSITION_LOCATION, POSITION_COMPONENT_COUNT, GL_FLOAT, false, 0, vertexData); glEnableVertexAttribArray(A_POSITION_LOCATION);
I moved this code to the onDrawFrame() method and duplicated it to draw a border before the table is being drawn. This seems to work fine in the running project but does my application now take a huge performance hit, or is it fine to do things like this even in larger applications?