
'-----------------------------------------
' Показать лого
'-----------------------------------------
Declare Sub SetLogo1()   ' Пказать Лого

Sub SetLogo1() ' Пказать Лого
	Dim KeyEvent as wKeyEvent Ptr
	Dim As wNode mesh_bg
	Dim as wVector3f scale, pos1, pos2, tag1
	Dim As int32 z_cam = -250000
	'Dim s3 as wstring * 256
  Dim As int32 iExit
  	
  mesh_bg = wNodeCreateCube (1, FALSE, wCOLOR4s_WHITE)
  scale.x = 3000: scale.y= 2000: scale.z = 0.001f
  wNodeSetScale (mesh_bg, scale) 

  Dim As String LogoTexture1_Path = "./data/tex/logo1.jpg"
  CheckFilePath(LogoTexture1_Path)
  Dim As wTexture LogoTexture1
  LogoTexture1 = wTextureLoad(LogoTexture1_Path)
  
  
    Dim as wMaterial material
    For j As int32 = 0 to wNodeGetMaterialsCount(mesh_bg) - 1
       material = wNodeGetMaterial(mesh_bg, j)
       wMaterialSetFlag(material, wMF_LIGHTING, FALSE)
       wMaterialSetTexture(material, j, LogoTexture1)
    Next j
    pos1.x = 0: pos1.y = 0: pos1.z = z_cam
    wNodeSetPosition (mesh_bg, pos1)
	  'wSetNodeRotation(Camera, 0, 180, 0)
	
	pos1.x = 0: pos1.y = 0: pos1.z = 600
	wNodeSetPosition (Camera, pos1)
	tag1.x = 0: tag1.y = 0: tag1.z = 0
	wCameraSetTarget (Camera, tag1)
	
	Do while(wEngineRunning())
	  wSceneBegin(sceneColor)
		wSceneDrawAll()

    iExit = 0
		Do While wInputIsKeyEventAvailable
      KeyEvent = wInputReadKeyEvent
      Select case as const KeyEvent->key
        'Case wKC_RETURN, wKC_LCONTROL, wKC_RCONTROL, wKC_SPACE ', wKC_ESCAPE
        Case wKC_SPACE ', wKC_ESCAPE
      		if KeyEvent->direction = wKD_UP Then
      		  iExit = 1
      			Exit Do
      		EndIf
        Case Else
      End Select
		Loop
    				
  	If z_cam < -95500 Then 
  		z_cam += 2900
  	ElseIf  z_cam < -965 Then
  		z_cam += 100
  	ElseIf z_cam >= -965 Then
  	  z_cam = -965
  	EndIf

  	pos2 = wNodeGetAbsolutePosition (mesh_bg)
    pos1.x = pos2.x: pos1.y = pos2.y: pos1.z = z_cam
    wNodeSetPosition (mesh_bg, pos1)
    
    wSceneEnd()
    'wEngineCloseByEsc()
    If iExit = 1 Then Exit Do
	Loop
	
	If mesh_bg <> 0 Then 
		wNodeDestroy(mesh_bg): mesh_bg = 0
	EndIf

End Sub
