GLES2

Check-in [26f6ad956d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:initial version
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:26f6ad956df002e5165c9242499cd1e33918d5ff
User & Date: arnulf 2013-08-12 12:25:50
Context
2013-08-12
12:26
fixes and new code check-in: 207683acc1 user: arnulf tags: trunk
12:25
initial version check-in: 26f6ad956d user: arnulf tags: trunk
2013-08-11
22:18
initial version check-in: 9ed5c93f90 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added t2.tcl.

















































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#lappend auto_path .
set  auto_path [concat [list .] $auto_path]
puts stderr "AP!$auto_path!"
package require gles2

set use_no_texture 1
if {[llength $argv] > 0} {
    switch [lindex $argv 0] {
    notexture {
        set use_no_texture 1
      }
    texture {
        set use_no_texture 0
      }
    default {
        puts stderr "bad texture flag value: [lindex $argv 0]"
	exit 1
      }
    }
}
#::gles2::builtin::getfontinfo "Hello" Vera.ttf 12 [list 1 0 0 1] 0
::gles2::builtin::maketexttexture "Hello" Vera.ttf 12 [list 1 0 0 1]
#::gles2::builtin::maketexttexture "APW" Vera.ttf 12 [list 1 0 0 1]

::gles2::builtin::setuprenderbuffer
::gles2::builtin::setupframebuffer
if {$use_no_texture} {
    ::gles2::builtin::compileshaders notexture
} else {
    ::gles2::builtin::compileshaders texture
}

::gles2::builtin::clearbuffer 0 104 55 255
if {0} {
set start_pos [list 0 0 0]
set end_pos [list 0.5 0.5 0]
set color [list 1 0 0 1]
set color2 [list 0 0 1 1]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color2]
::gles2::swapbuffers
#set ch [read stdin 1]
set end_pos [list 0.40 0.10 0]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color]
::gles2::swapbuffers
#set ch [read stdin 1]
set color [list 0 0 1 1]
set end_pos [list 0.3 0.0 0]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color]
::gles2::swapbuffers
#set ch [read stdin 1]
set end_pos [list 0.20 -0.10 0]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color]
::gles2::swapbuffers
#set ch [read stdin 1]
set end_pos [list 0.10 -0.20 0]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color]
::gles2::swapbuffers
set ch [read stdin 1]
}

if {0} {
set color [list 1 0 0 1]
set color2 [list 1 0 0 1]
set color3 [list 1 0 0 1]
set pos1 [list -0.5 -0.5 -0.5]
set pos2 [list -0.5 0.0 -0.5]
set pos3 [list -0.2 0.0 -0.5]
set pos4 [list -0.2 -0.5 -0.5]
::gles2::builtin::filltriangle [list $pos1 $color] [list $pos2 $color3] [list $pos3 $color]
::gles2::builtin::filltriangle [list $pos3 $color] [list $pos4 $color2] [list $pos1 $color]
#::gles2::swapbuffers
}

set color [list 1 1 0 1]
set start_pos [list -0.7 -0.2 0]
set end_pos [list -0.0 -0.2 0]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color]
set start_pos [list -0.7 -0.3 0]
set end_pos [list -0.0 -0.3 0]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color]
set color [list 1 0 1 1]
set color2 [list 1 0 1 1]
set color3 [list 1 0 1 1]
set pos1 [list -0.5 -0.5 0]
set pos2 [list -0.5 0.0 0]
set pos3 [list -0.0 0.0 0]
set pos4 [list -0.0 -0.5 0]

#set pos1 [list -0.519 -0.156 0]
#set pos2 [list -0.519 0.0 0]
set pos1 [list -0.259 -0.156 0]
set pos2 [list -0.259 0.0 0]
set pos3 [list -0.0 0.0 0]
set pos4 [list -0.0 -0.156 0]
puts stderr "pixel2coord![::gles2::builtin::pixel2coord 83 1]![::gles2::builtin::pixel2coord 25 0]!"
if {$use_no_texture} {
    ::gles2::builtin::fillrectangle [list $pos1 $color] [list $pos2 $color3] [list $pos3 $color] [list $pos4 $color2]
} else {
    ::gles2::builtin::filltexturerectangle [list $pos1 $color] [list $pos2 $color3] [list $pos3 $color] [list $pos4 $color3]
}
#::gles2::builtin::filltexturetriangle [list $pos1 $color] [list $pos2 $color3] [list $pos3 $color]
#::gles2::builtin::filltexturetriangle [list $pos3 $color] [list $pos4 $color3] [list $pos1 $color]
::gles2::swapbuffers
set ch [read stdin 1]

Added t3.tcl.







































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
#lappend auto_path .
set  auto_path [concat [list .] $auto_path]
puts stderr "AP!$auto_path!"
package require gles2

set use_no_texture 1
if {[llength $argv] > 0} {
    switch [lindex $argv 0] {
    notexture {
        set use_no_texture 1
      }
    texture {
        set use_no_texture 0
      }
    default {
        puts stderr "bad texture flag value: [lindex $argv 0]"
	exit 1
      }
    }
}
::gles2::builtin::maketexttexture "Hello" Vera.ttf 12 [list 1 0 0 1]

::gles2::builtin::setuprenderbuffer
::gles2::builtin::setupframebuffer
    ::gles2::builtin::compileshaders notexture

::gles2::builtin::clearbuffer 0 104 55 255

set pos1 [list -0.259 -0.156 0]
set pos2 [list -0.259 0.0 0]
set pos3 [list -0.0 0.0 0]
set pos4 [list -0.0 -0.156 0]
    ::gles2::builtin::fillrectangle [list $pos1 $color] [list $pos2 $color3] [list $pos3 $color] [list $pos4 $color2]
::gles2::swapbuffers
set ch [read stdin 1]

Added t4.tcl.













































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
#lappend auto_path .
set  auto_path [concat [list .] $auto_path]
puts stderr "AP!$auto_path!"
package require gles2

set use_no_texture 0
::gles2::builtin::maketexttexture "Hello" Vera.ttf 12 [list 1 0 0 1]
#::gles2::builtin::maketexttexture "APW" Vera.ttf 12 [list 1 0 0 1]

::gles2::builtin::setuprenderbuffer
::gles2::builtin::setupframebuffer
    ::gles2::builtin::compileshaders texture

::gles2::builtin::clearbuffer 0 104 55 255

set color [list 1 1 0 1]
set start_pos [list -0.7 -0.2 0]
set end_pos [list -0.0 -0.2 0]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color]
set start_pos [list -0.7 -0.3 0]
set end_pos [list -0.0 -0.3 0]
::gles2::builtin::drawline [list $start_pos $color] [list $end_pos $color]
set color [list 1 0 1 1]
set color2 [list 1 0 1 1]
set color3 [list 1 0 1 1]
set pos1 [list -0.5 -0.5 0]
set pos2 [list -0.5 0.0 0]
set pos3 [list -0.0 0.0 0]
set pos4 [list -0.0 -0.5 0]

set pos1 [list -0.259 -0.156 0]
set pos2 [list -0.259 0.0 0]
set pos3 [list -0.0 0.0 0]
set pos4 [list -0.0 -0.156 0]
puts stderr "pixel2coord![::gles2::builtin::pixel2coord 83 1]![::gles2::builtin::pixel2coord 25 0]!"
    ::gles2::builtin::filltexturerectangle [list $pos1 $color] [list $pos2 $color3] [list $pos3 $color] [list $pos4 $color3]
::gles2::swapbuffers
set ch [read stdin 1]