OpenGL - error

Miscellaneous Forums/Linux Discussion/OpenGL - error

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yes fullscreen logo on white background I have some experience with installing nvidia and ati drivers in linux.

I can run opengl, enemy territory etc, quake 4, and so on.
"Driver" is set to "nvidia" in the XF86config (Xorg) config file, not "nv".

I was using the sourcecode from http://www.blitzbasic.com/Community/posts.php?topic=42662 (I replaced the old stuff with the new ones (GLGraphics, etc)).

This works:
GLGraphics(800,600)
init()

While Not KeyDown(KEY_ESCAPE)
display()
Flip
Wend 
End

Function init()
glClearColor(0.0, 0.0, 0.0, 0.0)
glColor3f(0.0, 0.0, 1.0)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(45.0, 800/600, 0.1, 100.0)
End Function

Function display()
glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
glBegin(GL_TRIANGLES)
glVertex3f( 0.0, 1.0,-10.0)
glVertex3f(-1.0,-1.0,-10.0)
glVertex3f( 1.0,-1.0,-10.0)
glEnd()
End Function



This does not work in linux for me, it gave me the "major opcode GLX" error, but after replacing the GLgraphics line with "GLGraphics(GW,GH)" It now gives me a "appstub.linux signal handler 11" and the whole ide halts (although the same code works in win32):
' rem OPENGL spinnning cube by Bill Radford V1
Global GW:Int=800
Global GH:Int=600
Global angle:Float=0
Global mode = GL_QUADS
Global msg:String
GLGraphics(GW,GH,32)  ' |BGL_FULLSCREEN)
init()


Repeat 
	click_timer:-1
	If click_timer < 0 Then click_timer = 0
	
	If MouseDown(1) = 1 And click_timer = 0
		glmode = glmode + 1
		If glmode>6 Then glmode = 0
		Select glmode
			Case 0 mode = GL_QUADS ; msg$ = "GL_QUADS"
			Case 1 mode = GL_LINES ; msg$ = "GL_LINES"
			Case 2 mode = GL_POLYGON ; msg$ = "GL_POLYGON"
			Case 3 mode = GL_TRIANGLES ; msg$ = "GL_TRIANGLES"
			Case 4 mode = GL_LINE_STRIP ; msg$ = "GL_LINE_STRIP"
			Case 5 mode = GL_LINE_LOOP ; msg$ = "GL_LINE_LOOP"
			Case 6 mode = GL_POINTS ; msg$ = "GL_POINTS"

		End Select
		click_timer = 50
	EndIf
	
	frametimer(2)
	display(mode)
	
	idle_function()
	Flip
	

Until KeyDown(KEY_ESCAPE)
End

Function init()
	glClearColor(0.0, 0.0, 0.0, 0.0)
	glClearDepth(1.0)
	glEnable(GL_CULL_FACE)
	glMatrixMode(GL_PROJECTION)
	glLoadIdentity()
	gluPerspective(45.0, Float(GW)/Float(GH), 0.1, 100.0)
	glMatrixMode(GL_MODELVIEW)
	glLoadIdentity()
	
End Function

Function display(mode)
	glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
	glLoadIdentity()
	glTranslatef(0.0, 0.0, (Sin(angle)*10)-15)
	glRotatef(angle, 0.0, -1.0, 1.0)
	
	glBegin(mode)
		glColor3f(1.0,1.0,0.0) ' Front Face yellow
		glVertex3f(-1.0, -1.0, 1.0)
		glVertex3f( 1.0, -1.0, 1.0)
		glVertex3f( 1.0, 1.0, 1.0)
		glVertex3f(-1.0, 1.0, 1.0)

		glColor3f(0.0,1.0,0.0) ' Back Face Green
		glVertex3f(-1.0, -1.0, -1.0)
		glVertex3f(-1.0, 1.0, -1.0)
		glVertex3f( 1.0, 1.0, -1.0)
		glVertex3f( 1.0, -1.0, -1.0)

		glColor3f(1.0,0.0,0.0) ' Top Face Red
		glVertex3f(-1.0, 1.0, -1.0)
		glVertex3f(-1.0, 1.0, 1.0)
		glVertex3f( 1.0, 1.0, 1.0)
		glVertex3f( 1.0, 1.0, -1.0)

		glColor3f(0.0,0.0,1.0) ' Bottom Face Blue
		glVertex3f(-1.0, -1.0, -1.0)
		glVertex3f( 1.0, -1.0, -1.0)
		glVertex3f( 1.0, -1.0, 1.0)
		glVertex3f(-1.0, -1.0, 1.0)

		glColor3f(0.1,0.1,0.1) ' Right face Gray??
		glVertex3f( 1.0, -1.0, -1.0)
		glVertex3f( 1.0, 1.0, -1.0)
		glVertex3f( 1.0, 1.0, 1.0)
		glVertex3f( 1.0, -1.0, 1.0)

		glColor3f(1.0,1.0,1.0) ' Left Face White
		glVertex3f(-1.0, -1.0, -1.0)
		glVertex3f(-1.0, -1.0, 1.0)
		glVertex3f(-1.0, 1.0, 1.0)
		glVertex3f(-1.0, 1.0, -1.0)
	
		
	glEnd()
	
End Function

Function idle_function()
angle:+.1
If angle>360.0 angle=0.0
End Function


Function frametimer(msecs)
	now = MilliSecs()
	
	Repeat
		passed = MilliSecs()-now
		
	Until passed > msecs 

End Function