• Martes 16 de Abril de 2024, 23:57

Autor Tema:  Error Createmenu  (Leído 1545 veces)

Perla_kiko

  • Miembro MUY activo
  • ***
  • Mensajes: 114
    • Ver Perfil
Error Createmenu
« en: Miércoles 10 de Mayo de 2006, 16:03 »
0
Hola me da el sigueinte error al crear un menu es tiempo de diseño, lo bueno es que en el ejemplo que me he bajado de internet me funciona y en el mio propio no. Yo tengo un dialogo en c++ que dentro tiene una llamada a OpenGL en cambio el ejemplo es un void main() puede ser esta la causa
Código: Text
  1.  
  2. error C2664: 'glutCreateMenu_ATEXIT_HACK' : cannot convert parameter 1 from 'void (int)' to 'void (__cdecl *)(int)'
  3.         None of the functions with this name in scope match the target type
  4.  
  5.  

Código: Text
  1.  
  2. int CGlView::InitGL(GLvoid)          
  3. {
  4.    GLfloat light_ambient[] = { 1.0, 1.0, 1.0, 0.1 };
  5.     GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 0.1 };
  6.     GLfloat light_specular[] = { 1.0, 1.0, 1.0,0.1 };
  7.     GLfloat light_position[] = { 1.0, 0.0, 0.0, 0.0 };
  8.  
  9.     glLightfv (GL_LIGHT0, GL_DIFFUSE, light_diffuse);
  10.     glLightfv (GL_LIGHT0, GL_POSITION, light_position);
  11.    
  12.     glEnable (GL_LIGHTING);
  13.     glEnable (GL_LIGHT0);
  14.     glDepthFunc(GL_LESS);
  15.     glEnable(GL_DEPTH_TEST);
  16. //Crear Menu
  17.   glutCreateMenu(controlTransf);
  18.     glutAddMenuEntry("Borrar Pantalla",1);
  19.     glutAddMenuEntry("Salir",2);
  20.     glutAttachMenu(GLUT_RIGHT_BUTTON);
  21.  
  22.   return TRUE;                    
  23. }
  24.  
Código: Text
  1.  
  2. void CGlView::controlTransf(int value)
  3. {
  4. if(value==1) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  5.     if(value==2) exit(0);
  6. }
  7.  
  8.  

Pq me falla