AS I writing code for OpenGL Program for BezerCurve with the help of Visual C++ as I am not able to compile this code so if any one having some solution and can guide me please help me…!
#include <stdafx.h>
#include <stdlib.h>
#include <gl/glut.h>
GLfloat ctrlpoints[4][3]={{-4.0,-4.0,0.0},
{-2.0,4.0,0.0},
{2.0,-4.0,0.0},
{4.0,4.0,0.0}};
void init(void)
{
glClearColor(0.0,0.0,0.0,0.0);
glShadeModel(GL_FLAT);
glMap1f(GL_MAP1_VERTEX_3,0.0,1.0,3,4,&ctrlpoints[0][0]);
glEnable(GL_MAP1_VERTEX_3);
}
void display(void)
{
int i;
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,1.0,1.0);
glBegin(GL_LINE_STRIP);
for(i=0;i<=30;i++)
glEvalCoord1f((GLfloat)i/30.0);
glEnd();
glPointSize(5.0);
glColor3f(1.0,1.0,0.0);
glBegin(GL_POINTS);
for(i=0;i<4;i++)
glVertex3fv(&ctrlpoints[i][0]);
glEnd();
glFlush();
}
void keyboard(unsigned char key,int x, int y)
{
switch (key)
{
case ‘s’:
exit(0);
break;
default:
break;
}
}
void reshape(int w,int h)
{
glViewport(0,0,(GLsizei)w,(GLsizei)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if(w <= h)
glOrtho(-5.0,-5.0,-5.0*(GLfloat)h/(GLfloat)w,5.0*(GLfloat)h/(GLfloat)w,-5.0,5.0);
else
glOrtho(-5.0*(GLfloat)h/(GLfloat)w,5.0*(GLfloat)h/(GLfloat)w,-5.0,5.0,-5.0,5.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
int main(int argc,char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(600,600);
glutInitWindowPosition(100, 100);
glutCreateWindow(“Hai friends…!”);
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop();
return 0;
}
1>------ Build started: Project: BezerCurve, Configuration: Release Win32 ------
1>Compiling…
1>BezerCurve.cpp
1>Linking…
1>Generating code
1>Finished generating code
1>Embedding manifest…
1>mt.exe : general error c10100b1: Failed to load file “…\Release\BezerCurve.exe”. The system cannot find the file specified.
1>Build log was saved at “file://e:\Tutorials\OpenGLR&D\BezerCurve\BezerCurve\BezerCurve\Release\BuildLog.htm”
1>BezerCurve - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========