This is my opengl initialisation:

Qt Code:
  1. void GlClass::initializeGL()
  2. {
  3. glEnable(GL_TEXTURE_3D);
  4. glShadeModel(GL_SMOOTH);
  5. glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
  6. glClearDepth(1.0f);
  7. glEnable(GL_DEPTH_TEST);
  8. glDepthFunc(GL_LEQUAL);
  9. glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
  10.  
  11. glGenTextures(1, &texture[0]);
  12. glBindTexture(GL_TEXTURE_3D, texture[0]);
  13.  
  14. /* Line 35 */
  15. glTexImage3D(GL_TEXTURE_3D, 0, GL_LUMINANCE, 32, 32, 32, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, tekstura);
  16.  
  17. glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  18. glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  19.  
  20. }
To copy to clipboard, switch view to plain text mode