Rendering....
First of all my struct...
Code:
struct Quad
{
float x1;
float x2;
float y1;
float y2;
void RenderThis();
void createQuad(float inx1, float iny1, float inx2, float iny2);
};
(Render This)
Code:
void Quad::RenderThis()
{
glBegin(GL_QUADS);
glVertex2f(this->x1,this->y1);
glVertex2f(this->x2,this->y1);
glVertex2f(this->x2,this->y2);
glVertex2f(this->x1,this->y2);
glEnd();
}
createQuad(...)
Code:
void Quad::createQuad(float inx1, float iny1, float inx2, float iny2)
{
this->x1 = inx1;
this->x2 = inx2;
this->y1 = iny1;
this->y2 = iny2;
}
Now, in the while loop if someone does this in their code...
Code:
Quad* testsquare = new Quad;
testsquare->createQuad(-0.5f, 0.5f, 0.5f, -0.5f);
I want it to be rendered, I can't figure out though how to render the struct that the user defined the floats for using the createQuad void.
During the rendering process...(right before SwapBuffers(wind->hDC)... how would I set it so that if the user had Quad* testsquare = new Quad; in their code that it would render it?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement