Hi, I am completely new to OpenGl (started few hours ago … ), I have written some example (exactlier, copied it from some book ), please can any one help me ??
Here is the code:
“demo.h”
#include <windows.h>
#include <GL/gl.h>
#pragma comment (lib, “OpenGL32.lib”)
#include <GL/glu.h>
#pragma comment (lib, “Glu32.lib”)
#include <GL/glaux.h>
#pragma comment( lib, “glaux.lib” )
class demo1
{
public:
demo1(void);
~demo1(void);
void CALLBACK resize(int, int);
void CALLBACK display(void);
};
“demo1.cpp”
#include “demo1.h”
demo1::demo1(void)
{
}
demo1::~demo1(void)
{
}
void demo1::resize(int width, int height)
{
//…
}
void demo1::display(void)
{
//…
}
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
auxInitPosition(0, 0, 500, 500);
//…
auxIdleFunc(demo1::display);
auxReshapeFunc(demo1::resize);
//...
glEnable(GL_ALPHA_TEST);
//...
}
The errors I get are at auxIdleFunc(demo1::display) and auxReshapeFunc(demo1::resize); (demo1.cpp(31) : error C3867: ‘demo1::display’: function call missing argument list; use ‘&demo1::display’ to create a pointer to member); if I put the ‘&’ I get ‘demo1.cpp(31) : error C2664: ‘auxIdleFunc’ : cannot convert parameter 1 from ‘void (__stdcall demo1::* )(void)’ to ‘AUXIDLEPROC’’.
Also if I comment those 2 functions I get some link error: ‘error LNK2019: unresolved external symbol _auxInitPosition@16 referenced in function _WinMain@16’.
I have searched on the Web & found something about adding some library references to the project, added them - still same link errors; then I found something about changing the type of project from ‘console’ to ‘windows’.
Currenly I use a Win32 Windows application under VS 2008.
Heeeelp me PLEASE !!!