File: FMain.class

package info (click to toggle)
gambas3 3.20.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 77,208 kB
  • sloc: ansic: 197,232; cpp: 124,273; sh: 18,999; javascript: 7,761; sql: 5,399; makefile: 2,358; perl: 1,397; xml: 490; python: 335
file content (64 lines) | stat: -rw-r--r-- 1,833 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
' Gambas class file

Private $sExec As String

Private $aTutorial As String[][] = [
  ["Example1", ("1 - Setting Up An OpenGL Window")],
  ["Example2", ("2 - Your First Polygon")],
  ["Example3", ("3 - Adding Color")],
  ["Example4", ("4 - Rotation")],
  ["Example5", ("5 - 3D Shapes")],
  ["Example6", ("6 - Texture Mapping")],
  ["Example7", ("7 - Texture Filters, Lighting & Keyboard Control")],
  ["Example8", ("8 - Blending")],
  ["Example9", ("9 - Moving Bitmaps In 3D Space")],
  ["Example10", ("10 - Loading And Moving Through A 3D World")],
  ["Example11", ("11 - Flag Effect (Waving Texture)")],
  ["Example16", ("16 - Cool Looking Fog")],
  ["Example19", ("19 - Particle Engine")],
  ["Example25", ("25 - Morphing & Loading Objects From A File")],
  ["Example42", ("42 - Multiple Viewports")]]

Public Sub Form_Open()

  Dim aTutorial As String[]
  
  For Each aTutorial In $aTutorial
    cmbTutorial.Add(aTutorial[1])
  Next
  cmbTutorial_Click

End

Public Sub btnRun_Click()

  Dim sOutput As String

  If Not $sExec Then
    Shell "rm -rf /tmp/NeHeTutorial" Wait
    Shell "cp -R " & Shell$(System.Path &/ "share/gambas3/examples/OpenGL/NeHeTutorial") & " /tmp/NeHeTutorial" Wait
    Shell "cd /tmp/NeHeTutorial && gbc3 -agt && gba3" To sOutput
    $sExec = "/tmp/NeHeTutorial/NeHeTutorial.gambas"
    If Not Exist($sExec) Then
      Message.Error(("Unable to compile the NeHeTurotial example inside the <tt>/tmp</tt> directory."))
      $sExec = ""
      Return
    Endif
  Endif

  Exec [$sExec, $aTutorial[cmbTutorial.Index][0], $aTutorial[cmbTutorial.Index][1]]

End

Public Sub btnQuit_Click()

  Me.Close

End

Public Sub cmbTutorial_Click()

  txtCode.Text = File.Load(System.Path &/ "share/gambas3/examples/OpenGL/NeHeTutorial" &/ ".src" &/ $aTutorial[cmbTutorial.Index][0] & ".module")
  txtCode.Pos = 0

End