NEED HELP! OpenGL code for my exam doesn't work
Hello, I'm Dusan from Serbia. I have to hand this OpenGL code soon - and that's my exam on university, but this part doesn't work. I'm using .Net studio on Windows and Tao OpenGL wrapper:
void update_viewpoint(void)
{
double modelview[16];
double projection[16];
int viewport[4];
double m[3];
Gl::glGetDoublev(Gl::GL_MODELVIEW_MATRIX, modelview);
Gl::glGetDoublev(Gl::GL_PROJECTION_MATRIX, projection);
Gl::glGetIntegerv(Gl::GL_VIEWPORT, viewport);
Glu::gluUnProject(viewport[2] / 2, viewport[3] / 2, 0,
modelview, projection, viewport, m, m+1, m+2);
viewpoint[0]=m[0];
viewpoint[1]=m[1];
viewpoint[2]=m[2];
}
I'm getting this error:
e:\twisphere\Form1.h(232): error C2664: 'Tao::OpenGl::Glu::gluUnProject' : cannot convert parameter 4 from 'double [16]' to 'double __gc[]'
Appreciate any help.
void update_viewpoint(void)
{
double modelview[16];
double projection[16];
int viewport[4];
double m[3];
Gl::glGetDoublev(Gl::GL_MODELVIEW_MATRIX, modelview);
Gl::glGetDoublev(Gl::GL_PROJECTION_MATRIX, projection);
Gl::glGetIntegerv(Gl::GL_VIEWPORT, viewport);
Glu::gluUnProject(viewport[2] / 2, viewport[3] / 2, 0,
modelview, projection, viewport, m, m+1, m+2);
viewpoint[0]=m[0];
viewpoint[1]=m[1];
viewpoint[2]=m[2];
}
I'm getting this error:
e:\twisphere\Form1.h(232): error C2664: 'Tao::OpenGl::Glu::gluUnProject' : cannot convert parameter 4 from 'double [16]' to 'double __gc[]'
Appreciate any help.
Since you're using .NET, I'm assuming you're using C#. I know that arrays and pointers are treated differently, which is likely the cause of your problem. Unfortunately, I can't get any more specific than that since I have never used C#. In fact, I doubt you'll get a lot of help here regardless: notice the subtitle at the top: "The Macintosh Game Developer's Community." Some people here may have worked with C# before, whether it be at work or by developing Windows stuff along with their Mac stuff, but this community is mainly Mac based.
I'm with akb825. Are there other students who have working code who you could ask? Or other, more relevant forums? A quick Googling should do the trick.
(See OSC? I was nicer this time!
)
(See OSC? I was nicer this time!
)
My web site - Games, music, Python stuff
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| starting to work with openGL, need some help | smartalco | 1 | 2,345 |
Mar 26, 2007 08:21 PM Last Post: arekkusu |
|
| SDL/OpenGL Initialization Code | Nick | 15 | 6,554 |
Sep 7, 2005 07:28 AM Last Post: Nick |
|
| OpenGL code optimization | unknown | 38 | 11,570 |
Jul 28, 2005 10:22 PM Last Post: unknown |
|
| OpenGL Source Code Generator | Leisure Suit Lurie | 2 | 3,259 |
Jul 5, 2005 11:55 AM Last Post: Cochrane |
|
| bus error with opengl code | mnorton | 2 | 3,214 |
Jan 21, 2005 02:53 PM Last Post: ThemsAllTook |
|

