Originally Posted by
Matty_Alan
However... and i bet your all pretty sick of my questions by now, lol
If your using Glut, where would I put in the glDeleteBuffers? because i would have to break out of the main loop for that wouldn't I?
Not sure what you mean by "break out". If the program is just a GL program, all of it except for setup & initialization is inside the main loop (nb, I don't mean one long piece of spagetti). You only want to delete a buffer when you are done with the data. Eg, you have an object. Another object destroys it. Now you might as well delete the data for the destroyed object, since it will not be appearing again. I generally use global arrays to store the VBO indexes (they are just single ints, like pointers). Or more specifically arrays of structs with "VBO" members. That's how it is in the tutorial, I think, altho I don't delete anything because nothing disappears. In C++ I guess you would have arrays of objects.
You don't need to delete the remaining buffers after the main loop is over (ie, when the program is done).
Vis. "7D", this is only relevant if you are at least 3 meters tall. Everyone else has to google.
Vis, your indenting, well, you have the correct idea in post #16, but what I saw first when I opened Main.cpp was this:
Code:
/************* DISPLAY CALLBACK FUNCTION ************/
void Display_old(void)
{
glPushMatrix();
glClear(GL_COLOR_BUFFER_BIT);
gluLookAt(b, 0.0, a , 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
int a =0, b=0;
glBegin(GL_QUADS);
while(a < Shizzle.ArraySize)//(3*4))//Sides * (Dementions * Verticies in a quad)
{
glVertex3f(Shizzle.Array[a],Shizzle.Array[a+1],Shizzle.Array[a+2]);
a= a+3;
}
glEnd();
glutSwapBuffers();
glPopMatrix();
}
Tch! It does get slightly better but "slightly wack" seems to be the theme:
Code:
void Keys(int key, int x, int y)
{
if(key == GLUT_KEY_UP)
{a = a+.3;}
if(key == GLUT_KEY_DOWN)
{a = a-.3;}
if(key == GLUT_KEY_LEFT)
No, no. How about one of the following options:
Code:
void Keys(int key, int x, int y)
{
if(key == GLUT_KEY_UP)
{a = a+.3;} // not acceptable
if(key == GLUT_KEY_DOWN)
{a = a-.3;} // acceptable
if(key == GLUT_KEY_LEFT) b = b+.3; // also fine
Oh, here's a little GL tip: it uses floats internally. With C/C++, numbers like ".3" get treated as doubles and are then converted to floats at runtime if the assignment implies this. That's not GL, that's a general principle, but it does mean you are best off indicating floats to start with if you know that's what they are going to end as (0.3f). However, that's a very minor issue, lots of people appear to care less.