Well i am making a game engine and this is one of its utilities it has. So yes it would be called by other things as regular function.
I changed the code a little:
UtilWindow.h:
Code:#ifndef __UTILWINDOW_H #define __UTILWINDOW_H class UtilWindow { public: Reshape(int width, int height); ~Reshape(); private: }; #endif
UtilWindow.cpp:
Code:#include <UtilWindow.h> #include <GL\glew.h> #include <GL\glut.h> UtilWindow::Reshape (int width, int height) { glViewport(0, 0, (GLsizei)width, (GLsizei)height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60, (GLfloat)width / (GLfloat)height, 1.0, 100.0); glMatrixMode(GL_MODELVIEW); }
The errors:
Code:1>------ Build started: Project: Aiedoo, Configuration: Debug Win32 ------ 1> UtilWindow.cpp 1>c:\program files\aiedoo\aiedoo\utility\utilwindow.h(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\program files\aiedoo\aiedoo\utility\utilwindow.h(7): warning C4183: 'Reshape': missing return type; assumed to be a member function returning 'int' 1>c:\program files\aiedoo\aiedoo\utility\utilwindow.h(8): error C2523: 'UtilWindow::~Reshape' : destructor tag mismatch 1>c:\program files\aiedoo\aiedoo\utility\utilwindow.cpp(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int




Reply With Quote