severity 440137 normal
reassign 440137 libglu1-mesa
thanks

During the tests we carried out to find out what was the problem with
cultivation, we noticed that it seems to be related to the latest upgrade in
libglu. The attached proof-of-concept program works OK in previous versions
of Debian, but it doesn't teem to work in SID anymore, so we're convinced
that the problem itself is in glu. We've made a quick hack to Cultivation so
that at least the package is still usable, but this bug might also affect
other programs. Please have a look at it.

Please ask whatever else you need to know.

Greetings,
Miry
/*
  gcc -Wall -lglut -lGLU -lGL unproject.c -o unproject
 */

#include <GL/glut.h>

#include <stdio.h>
#include <stdlib.h>


void Display();
void Reshape(int w,int h);
void Mouse(int button,int state,int x,int y);

int main(int argc,char **argv) {
  glutInit(&argc,argv);
  //  glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB|GLUT_DEPTH);
  glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);
  //glutInitWindowSize(100,100);
  glutInitWindowSize(500,500);
  glutInitWindowPosition(100,100);
  glutCreateWindow( "Test" );
  glutDisplayFunc(Display);
  glutReshapeFunc(Reshape);
  glutMouseFunc(Mouse);

  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glEnable(GL_DEPTH_TEST);

  glutMainLoop();
  return 0;
}

GLdouble ox=0.0,oy=0.0,oz=0.0;
void Display() {
    
    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();
  gluLookAt(10.0,0.0,20.0,0.0,0.0,0.0,0.0,1.0,0.0);

  glPushMatrix();
  glRotatef(45,1.0,0.0,0.0);
  glutSolidTorus(4.0,5.0,20,20);
  glPopMatrix();

  glPushMatrix();
  glDepthMask(GL_FALSE);
  glTranslated(ox,oy,oz);
  glutSolidSphere(0.5,15,15);
  glDepthMask(GL_TRUE);
  glPopMatrix();
  glFlush();
  glutSwapBuffers();
}

void Reshape(int w,int h) {
  glViewport(0,0,w,h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0,(float)w/(float)h,5.0,30.0);
  glMatrixMode(GL_MODELVIEW);
}

void Mouse(int button,int state,int x,int y) {
  GLint viewport[4];
  GLdouble modelview[16],projection[16];
  GLfloat wx=x,wy,wz;

  if(state!=GLUT_DOWN)
    return;
  if(button==GLUT_RIGHT_BUTTON)
    exit(0);
  glGetIntegerv(GL_VIEWPORT,viewport);
  y=viewport[3]-y;
  wy=y;
  glGetDoublev(GL_MODELVIEW_MATRIX,modelview);
  glGetDoublev(GL_PROJECTION_MATRIX,projection);
  glReadPixels(x,y,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,&wz);
  gluUnProject(wx,wy,wz,modelview,projection,viewport,&ox,&oy,&oz);
  glutPostRedisplay();
}
_______________________________________________
Pkg-games-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-devel

Reply via email to