Jump to content
  • Advertisement
Sign in to follow this  


This topic is 4412 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!