Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as C++ by hellyeah ( 14 years ago )
//GLintPoint Class
class GLintPoint
{
public:
int x,y;
GLintPoint(int a, int b)
{x=a,y=b;}

};

void parametrizedHouse(GLintPoint peak,GLint width,GLint height)
{
GLint ChWidth = width/50;
GLint DoorWidth = width/10;
GLint DoorHeight= height/10;
GLint WindowW= width/10;
GLint WindowH= height/10;
//Skeleton of the House
glBegin(GL_LINE_LOOP);
glVertex2i((GLint)peak.x,peak.y);

GLintPoint secondPoint((GLint)peak.x+width/2, (GLint)peak.y-3*height/8);
glVertex2i(secondPoint.x,secondPoint.y);

GLintPoint thirdPoint((GLint)peak.x+width/2, (GLint)peak.y-height);
glVertex2i(thirdPoint.x,thirdPoint.y);

GLintPoint fourthPoint((GLint)peak.x-width/2,(GLint)peak.y-height);
glVertex2i(fourthPoint.x,fourthPoint.y);

GLintPoint fifthPoint((GLint)peak.x-width/2,(GLint)peak.y-3*height/8);
glVertex2i(fifthPoint.x,fifthPoint.y);
glEnd();
//Chimeney of the house
glBegin(GL_LINE_STRIP);
glVertex2i(((peak.x+fifthPoint.x)/2)-ChWidth, ((peak.y+fifthPoint.y)/2)-ChWidth);
glVertex2i(((peak.x+fifthPoint.x)/2)-ChWidth,peak.y);
glVertex2i(((peak.x+fifthPoint.x)/2)+ChWidth,peak.y);
glVertex2i(((peak.x+fifthPoint.x)/2)+ChWidth,((peak.y+fifthPoint.y)/2)+ChWidth);
glEnd();
//Door of the House
glBegin(GL_LINE_STRIP);
glVertex2i(((thirdPoint.x+fourthPoint.x)/2)-DoorWidth,fourthPoint.y);
glVertex2i(((thirdPoint.x+fourthPoint.x)/2)-DoorWidth,fifthPoint.y-DoorHeight);
glVertex2i(((thirdPoint.x+fourthPoint.x)/2)+DoorWidth,fifthPoint.y-DoorHeight);
glVertex2i(((thirdPoint.x+fourthPoint.x)/2)+DoorWidth,fourthPoint.y);
glEnd();
//Window of the House
glBegin(GL_LINE_LOOP);
glVertex2i(((thirdPoint.x+((thirdPoint.x+fourthPoint.x)/2)+DoorWidth)/2)-WindowW,fifthPoint.y-DoorHeight);
glVertex2i(((thirdPoint.x+((thirdPoint.x+fourthPoint.x)/2)+DoorWidth)/2)-WindowW,fifthPoint.y-DoorHeight+WindowH);
glVertex2i(((thirdPoint.x+((thirdPoint.x+fourthPoint.x)/2)+DoorWidth)/2)+WindowW,fifthPoint.y-DoorHeight+WindowH);
glVertex2i(((thirdPoint.x+((thirdPoint.x+fourthPoint.x)/2)+DoorWidth)/2)+WindowW,fifthPoint.y-DoorHeight);
glEnd();
glFlush();
}


xyz@xyz:~/comp304$ c++ GLintPoint.cpp 
GLintPoint.cpp:11: error: ‘GLint’ has not been declared
GLintPoint.cpp:11: error: ‘GLint’ has not been declared
GLintPoint.cpp: In function ‘void parametrizedHouse(GLintPoint, int, int)’:
GLintPoint.cpp:13: error: ‘GLint’ was not declared in this scope
GLintPoint.cpp:13: error: expected ‘;’ before ‘ChWidth’
GLintPoint.cpp:14: error: expected ‘;’ before ‘DoorWidth’
GLintPoint.cpp:15: error: expected ‘;’ before ‘DoorHeight’
GLintPoint.cpp:16: error: expected ‘;’ before ‘WindowW’
GLintPoint.cpp:17: error: expected ‘;’ before ‘WindowH’
GLintPoint.cpp:19: error: ‘GL_LINE_LOOP’ was not declared in this scope
GLintPoint.cpp:19: error: ‘glBegin’ was not declared in this scope
GLintPoint.cpp:20: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:20: error: ‘glVertex2i’ was not declared in this scope
GLintPoint.cpp:22: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:22: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:25: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:25: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:28: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:28: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:31: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:31: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:33: error: ‘glEnd’ was not declared in this scope
GLintPoint.cpp:35: error: ‘GL_LINE_STRIP’ was not declared in this scope
GLintPoint.cpp:36: error: ‘ChWidth’ was not declared in this scope
GLintPoint.cpp:43: error: ‘DoorWidth’ was not declared in this scope
GLintPoint.cpp:44: error: ‘DoorHeight’ was not declared in this scope
GLintPoint.cpp:50: error: ‘WindowW’ was not declared in this scope
GLintPoint.cpp:51: error: ‘WindowH’ was not declared in this scope
GLintPoint.cpp:55: error: ‘glFlush’ was not declared in this scope
xyz@xyz:~/comp304$ c++ GLintPoint.cpp 
GLintPoint.cpp:11: error: ‘GLint’ has not been declared
GLintPoint.cpp:11: error: ‘GLint’ has not been declared
GLintPoint.cpp: In function ‘void parametrizedHouse(GLintPoint, int, int)’:
GLintPoint.cpp:13: error: ‘GLint’ was not declared in this scope
GLintPoint.cpp:13: error: expected ‘;’ before ‘ChWidth’
GLintPoint.cpp:14: error: expected ‘;’ before ‘DoorWidth’
GLintPoint.cpp:15: error: expected ‘;’ before ‘DoorHeight’
GLintPoint.cpp:16: error: expected ‘;’ before ‘WindowW’
GLintPoint.cpp:17: error: expected ‘;’ before ‘WindowH’
GLintPoint.cpp:19: error: ‘GL_LINE_LOOP’ was not declared in this scope
GLintPoint.cpp:19: error: ‘glBegin’ was not declared in this scope
GLintPoint.cpp:20: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:20: error: ‘glVertex2i’ was not declared in this scope
GLintPoint.cpp:22: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:22: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:25: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:25: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:28: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:28: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:31: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:31: error: expected ‘)’ before ‘peak’
GLintPoint.cpp:33: error: ‘glEnd’ was not declared in this scope
GLintPoint.cpp:35: error: ‘GL_LINE_STRIP’ was not declared in this scope
GLintPoint.cpp:36: error: ‘ChWidth’ was not declared in this scope
GLintPoint.cpp:43: error: ‘DoorWidth’ was not declared in this scope
GLintPoint.cpp:44: error: ‘DoorHeight’ was not declared in this scope
GLintPoint.cpp:50: error: ‘WindowW’ was not declared in this scope
GLintPoint.cpp:51: error: ‘WindowH’ was not declared in this scope
GLintPoint.cpp:55: error: ‘glFlush’ was not declared in this scope
xyz@xyz:~/comp304$ /j

 

Revise this Paste

Parent: 18202
Children: 18204 18207
Your Name: Code Language: