السلام عليكم
لو سمحتوا انا عندي إشكاليه في رسم الدائره في open GL
هذا البرنامج ولكن يعملي error
ممكن تكملوا البرنامج وتفهموني خطأي
ممكن تعجلوا من فضلكم لأني احتاجه ضروري
وجزاكم الله كل خير
وهذا البرنامج
#include <GL/glut.h>
class screenpt
{
private:
GLint x,y;
public:
screenpt() {
x = y = 0;
}
void setCoords(GLint xCoordValue, GLint yCoordValue){
x = xCoordValue;
y = yCoordValue;
}
GLint getx() const {
return x;
}
GLint gety() const {
return y;
}
void incrementx() {
x++;
}
void decrementy() {
y--;
}
};
void setpixel (GLint xCoord , GLint yCoord)
{
glBegin(GL_POINTS);
glVertex2i(xCoord ,yCoord);
glEnd ();
}
/***************************************/
void circleMidpoint (GLint xc, GLint yc,GLint radius )
{
screenpt circpt;
GLint p = 1 - radius;
circpt.setCoords(0,radius);
void circlePlotPoints (GLint , GLint ,screenpt);
circlePlotPoints (xc , yc ,circpt);
while (circpt.getx() < circpt.gety()){
circpt.incrementx();
if (p <0)
p +=2 * circpt.getx() +1;
else {
circpt.decrementy();
p += 2 *(circpt.getx() - circpt.gety())+1;
}
circlePlotPoints(xc,yc,circpt);
}
}
/************************************************************/
void circelPlotPoints(GLint xc,GLint yc,screenpt circpt)
{
setpixel(xc + circpt.getx() , yc + circpt.gety());
setpixel(xc - circpt.getx() , yc + circpt.gety());
setpixel(xc + circpt.getx() , yc - circpt.gety());
setpixel(xc - circpt.getx() , yc - circpt.gety());
setpixel(xc + circpt.gety() , yc + circpt.getx());
setpixel(xc - circpt.gety() , yc + circpt.getx());
setpixel(xc - circpt.gety() , yc - circpt.getx());
setpixel(xc + circpt.gety() , yc - circpt.getx());
}