Không biết sử dụng hàm như này có đúng ko nữa
mà nó cứ báo lỗi Funtion call missing argument list;use '&Point:isplay' to create a pointer member
HTML Code:
glutDisplayFunc(p1.Display);
HTML Code:
#include<glut.h>
using namespace std;
class Point
{
float X, Y;
public:
void InPut(float, float);
void Display();
float GetX();
float GetY();
};
void Point::InPut(float X, float Y)
{
this->X = X;
this->Y = Y;
}
float Point::GetX()
{
return X;
}
float Point::GetY()
{
return Y;
}
void Point::Display()
{
glBegin(GL_POINTS);
glVertex2f(X, Y);
glEnd();
glFlush();
}
int main()
{
Point p1;
p1.InPut(0.5, 0.5);
glutCreateWindow("Ve Diem");
glutDisplayFunc(p1.Display);
glutMainLoop();
return 0;
}
Comment