
! script name: glfunc.d/glbackground
! 3dtopic: change the background color for opengl

!A
!A NAME:
!A
!A 	OpenGL Backround Color
!A
!A DESCRIPTION:
!A
!A 	This sets the background color for opengl
!A
!B INSTRUCTIONS:
!B
!B
!B

Stat=ChangeLabelStr("ScriptNameStatus","Function: change gl background")

DIM Destination$[256]
DIM Answer$[256]


Stat=WGLChangeLightParms
GOTO Leave

Set_red:!
Pen1= CurrentColor
stat= WGLGetPenRGB(Pen1,Red1,Green1,Blue1)

Stat=SetInputFormat("n4a1=",",C,")
Stat=SetEqualsValue(Red1)
Red1=GetValue("RED COMPONENT: ( 0.0 - 1.0 ),  Current color ",Answer$)
IF ExitScript(Destination$) THEN Leave
IF Answer$= "C" THEN 
	Stat= WGLSetBackGround
	Stat= SwitchActiveWindow(0)
	GOTO Set_red
END IF

Set_green:!
Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Green1)
Green1=GetValue("GREEN COMPONENT: ( 0.0 - 1.0 )")
IF ExitScript(Destination$) THEN Leave

Set_blue:!
Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Blue1)
Blue1=GetValue("BLUE COMPONENT: ( 0.0 - 1.0 )")
IF ExitScript(Destination$) THEN Leave

Stat= WGLSetBackGround(Red1,Green1,Blue1)
Stat= SwitchActiveWindow(0)
GOTO Set_red

Leave:!
Stat=SetInputFormat("n4","")
Stat=SetPickMask(WsPickGeometry)
IF NOT LEN(Destination$) THEN
	LOAD "typecontrol"
ELSE
	LOAD Destination$
END IF
END
