(I'm not sure where to put this thread: it is not a programming-thread (the written program does compile) and i also think the hardware is working very well :-))
I'm having some problems with executing own-written OpenGL programs. Any program that I'm trying to run gives me an error that look's like this:
Code:
freeglut (./aaindex): ERROR: Internal error <Visual with necessary capabilities not found> in function fgOpenWindow
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 4 (X_DestroyWindow)
Resource id in failed request: 0x0
Serial number of failed request: 14
Current serial number in output stream: 17
(after compiling with "gcc -lglut -o aaindix aaindex.c")
Offcourse, the second part of this error isn't really important. The problem is the freeglut Error "visual with necessary capabilities not found".
I'm using a NVidia FX5700 Videocard under SUSE 9.3 Pro.
I googled this error and found some solving methods such as installing the NVidia-driver from their website instead of the SUSE-version and change to another bbp (16 instead of 24), but it didn't work. I also double checked my xorg.conf but it looks fine to me.
Programs like glxgears and tuxracer do run. Also 3D-acceleration is enabled.
Hereby the xorg.conf and aaindex.c (an example from the rebook openGL tutorial)
aaindex.c:
Code:
#include <GL/glut.h>
#include "stdlib.h"
#define RAMPSIZE 16
#define RAMP1START 32
#define RAMP2START 48
static float rotAngle = 0.;
void init(void)
{
int i;
for (i = 0; i < RAMPSIZE; i++) {
GLfloat shade;
shade = (GLfloat) i/(GLfloat) RAMPSIZE;
glutSetColor(RAMP1START+(GLint)i, 0., shade, 0.);
glutSetColor(RAMP2START+(GLint)i, 0., 0., shade);
}
glEnable (GL_LINE_SMOOTH);
glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
glLineWidth (1.5);
glClearIndex ((GLfloat) RAMP1START);
}
/* Draw 2 diagonal lines to form an X
*/
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glIndexi(RAMP1START);
glPushMatrix();
glRotatef(-rotAngle, 0.0, 0.0, 0.1);
glBegin (GL_LINES);
glVertex2f (-0.5, 0.5);
glVertex2f (0.5, -0.5);
glEnd ();
glPopMatrix();
glIndexi(RAMP2START);
glPushMatrix();
glRotatef(rotAngle, 0.0, 0.0, 0.1);
glBegin (GL_LINES);
glVertex2f (0.5, 0.5);
glVertex2f (-0.5, -0.5);
glEnd ();
glPopMatrix();
glFlush();
}
void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= h)
gluOrtho2D (-1.0, 1.0,
-1.0*(GLfloat)h/(GLfloat)w, 1.0*(GLfloat)h/(GLfloat)w);
else
gluOrtho2D (-1.0*(GLfloat)w/(GLfloat)h,
1.0*(GLfloat)w/(GLfloat)h, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 'r':
case 'R':
rotAngle += 20.;
if (rotAngle >= 360.) rotAngle = 0.;
glutPostRedisplay();
break;
case 27: /* Escape Key */
exit(0);
break;
default:
break;
}
}
/* Main Loop
* Open window with initial window size, title bar,
* color index display mode, and handle input events.
*/
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_INDEX);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
glutDisplayFunc (display);
glutMainLoop();
return 0;
}
xorg.conf
Code:
# /.../
# SaX generated X11 config file
# Created on: 2005-09-18T14:20:47+0200.
#
# Version: 7.1
# Contact: Marcus Schaefer <sax@suse.de>, 2002
#
# Automatically generated by [ISaX] (7.1)
# PLEASE DO NOT EDIT THIS FILE!
#
Section "Files"
FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/local"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/URW"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo"
FontPath "/usr/X11R6/lib/X11/fonts/PEX"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
FontPath "/usr/X11R6/lib/X11/fonts/latin2/misc:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/latin2/75dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/latin2/100dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/latin2/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/latin7/75dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/baekmuk:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/japanese:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/kwintv"
FontPath "/usr/X11R6/lib/X11/fonts/truetype"
FontPath "/usr/X11R6/lib/X11/fonts/uni:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/CID"
FontPath "/usr/X11R6/lib/X11/fonts/ucs/misc:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/ucs/75dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/ucs/100dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/hellas/misc:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/hellas/75dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/hellas/100dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/hellas/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/misc/sgi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/xtest"
FontPath "/opt/kde3/share/fonts"
InputDevices "/dev/ttyS0"
InputDevices "/dev/ttyS1"
InputDevices "/dev/ttyS2"
InputDevices "/dev/ttyS3"
InputDevices "/dev/ttyS4"
InputDevices "/dev/ttyS5"
InputDevices "/dev/ttyS6"
InputDevices "/dev/ttyS7"
InputDevices "/dev/ttyS8"
InputDevices "/dev/psaux"
InputDevices "/dev/logibm"
InputDevices "/dev/sunmouse"
InputDevices "/dev/atibm"
InputDevices "/dev/amigamouse"
InputDevices "/dev/atarimouse"
InputDevices "/dev/inportbm"
InputDevices "/dev/gpmdata"
InputDevices "/dev/mouse"
InputDevices "/dev/usbmouse"
InputDevices "/dev/adbmouse"
InputDevices "/dev/input/mice"
InputDevices "/dev/input/event0"
InputDevices "/dev/pointer0"
InputDevices "/dev/pointer1"
InputDevices "/dev/pointer2"
InputDevices "/dev/pointer3"
EndSection
Section "ServerFlags"
Option "AllowMouseOpenFail"
EndSection
Section "Module"
Load "freetype"
Load "type1"
Load "dbe"
Load "glx"
Load "extmod"
Load "v4l"
EndSection
Section "InputDevice"
Driver "kbd"
Identifier "Keyboard[0]"
Option "Protocol" "Standard"
Option "XkbLayout" "us"
Option "XkbModel" "pc104"
Option "XkbRules" "xfree86"
EndSection
Section "InputDevice"
Driver "mouse"
Identifier "Mouse[1]"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Name" "Logitech Optical Mouse"
Option "Protocol" "explorerps/2"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
EndSection
Section "Monitor"
DisplaySize 337 270
HorizSync 28-64
Identifier "Monitor[0]"
ModelName "1280X1024@60HZ"
VendorName "--> VESA"
VertRefresh 50-60
UseModes "Modes[0]"
EndSection
Section "Modes"
Identifier "Modes[0]"
Modeline "1280x1024" 105.15 1280 1376 1512 1712 1024 1025 1028 1059
Modeline "1280x960" 97.68 1280 1352 1488 1696 960 961 964 993
Modeline "1280x800" 80.58 1280 1344 1480 1680 800 801 804 827
Modeline "1152x864" 78.82 1152 1216 1336 1520 864 865 868 894
Modeline "1280x768" 77.37 1280 1344 1480 1680 768 769 772 794
Modeline "1024x768" 61.89 1024 1080 1184 1344 768 769 772 794
Modeline "800x600" 36.88 800 832 912 1024 600 601 604 621
Modeline "768x576" 33.74 768 792 872 976 576 577 580 596
Modeline "640x480" 23.06 640 656 720 800 480 481 484 497
EndSection
Section "Screen"
DefaultDepth 24
SubSection "Display"
Depth 15
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1024x768" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1024x768" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1024x768" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 32
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1024x768" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1024x768" "800x600" "768x576" "640x480"
EndSubSection
Device "Device[0]"
Identifier "Screen[0]"
Monitor "Monitor[0]"
EndSection
Section "Device"
BoardName "GeForce FX 5700"
BusID "1:0:0"
Driver "nvidia"
Identifier "Device[0]"
Screen 0
VendorName "NVidia"
EndSection
Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "Mouse[1]" "CorePointer"
Option "Clone" "off"
Option "Xinerama" "off"
Screen "Screen[0]"
EndSection
Section "DRI"
Group "video"
Mode 0660
EndSection
Section "Extensions"
EndSection