Advertisement Jump to content
Sign in to follow this  

Bezier Curve / SwapBuffers

This topic is 3844 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

Working on a tutorial that explains how to create a Bezier Curve. the last function for the source code is SwapBuffers() with g_HDC as its paramater. (OpenGL) Is there a header that im missing that defines this function? besides wingdi.h I did try using gl_Finish() insted of SwapBuffers() But no significant result i know the HDC is the device context and is a function in the winMain and LRESULT setupPixelFormat..etc But i really dont think getting SwapBuffers(g_HDC) to work will solve my problem Im getting a Blank Screen... heres their code..
float control[4][3] = { {1.0, -3.0, 0.0}, { 3.0, 2.5, 0.0 },
                        {8.0, -2.0, 0.0}, { 7.0, 2.0, 0.0 } };
void CGfxOpenGL::Initialize()
     glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // clear to "blackground"
     glShadeModel(GL_FLAT);         // using a smooth shading method

void CGfxOpenGL::Render()
     // clear the screen
     // centre the scene for the bezier curve
     glTranslatef(-5.0f, 0.0f, -10.0f);
     // set up bezier curve
     glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &control[0][0]);
     // setting color to white
     glColor3f(1.0, 1.0, 1.0);
     // draw the curve
          for (int i = 0; i <= 100; i++)
     // now we draw points at there coords
     glColor3f(1.0, 1.0, 1.0);
            for(int i = 0; i < 4; i++)
     glFinish(); // SwapBuffers(g_HDC) goes here

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!