Check-in [10867065c5]
Not logged in

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

Overview
Comment:Fixed Linux problem with FreetypeGL - need to init context first
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:10867065c556d46e0ae498df1a82a3c47c92c255
User & Date: bernd 2014-03-21 20:02:10
Context
2014-03-21
21:29
Work on boxes check-in: 1a914abaed user: bernd tags: trunk
20:02
Fixed Linux problem with FreetypeGL - need to init context first check-in: 10867065c5 user: bernd tags: trunk
19:39
Linux version updated check-in: f2ee538d66 user: bernd tags: trunk
Changes

Changes to ftgl-sample.fs.

1
2
3
4
5
6
7
8
9
10
11
\ freetype GL example

require gl-helper.fs
[IFUNDEF] android helper-init [THEN]

require ftgl-helper.fs

\ Demo Toplevel

also freetype-gl
also opengl



|







1
2
3
4
5
6
7
8
9
10
11
\ freetype GL example

require gl-helper.fs
ctx 0= [IF] window-init [THEN]

require ftgl-helper.fs

\ Demo Toplevel

also freetype-gl
also opengl

Changes to gles2/ftgl-sample.fs.

1
2
3
4
5
6
7
8
9
10
11
\ freetype GL example

require gl-helper.fs
[IFUNDEF] android helper-init [THEN]

require ftgl-helper.fs

\ Demo Toplevel

also freetype-gl
also opengl



|







1
2
3
4
5
6
7
8
9
10
11
\ freetype GL example

require gl-helper.fs
ctx 0= [IF] window-init [THEN]

require ftgl-helper.fs

\ Demo Toplevel

also freetype-gl
also opengl

Changes to gles2/widgets.fs.

1
2
3
4
5
6


7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
\ MINOS2 widget basis

\ A MINOS2 widget is composed of drawable elements, boxes and actors.
\ to make things easier, neither drawable elements nor boxes need an actor.

require gl-helper.fs


require ftgl-helper.fs
require mini-oof2.fs

get-current
also [IFDEF] android android [THEN]
also opengl
[IFUNDEF] android window-init [THEN]

vocabulary minos  also minos definitions

0 Value layer \ drawing layer

object class
    field: caller-w
................................................................................
    z-bias set-color+
    program glUseProgram  style-tex ;
: draw1> ( -- )  GL_TRIANGLES draw-elements v0 i0 ;

: <draw2 ( -- )  2 to layer s" " glyphs$ $! ;
: draw2> ( -- )  glyphs$ $@ load-glyph$ ;
: <draw3 ( -- )  3 to layer
    1-bias set-color+
    program glUseProgram  atlas-tex ;
: draw3> ( -- )  GL_TRIANGLES draw-elements v0 i0 ;

Variable style-i#

: load-style ( addr u -- n )  style-tex
    style-i# @ 8 /mod 128 * >r 128 * r> 2swap load-subtex 2drop
    style-i# @ 1 style-i# +! ;
: style: load-style Create , DOES> @ frame# ! ;

"button.png" style: button1
"button2.png" style: button2
"button3.png" style: button3

previous previous previous set-current






>
>






<







 







|
<
|













1
2
3
4
5
6
7
8
9
10
11
12
13
14

15
16
17
18
19
20
21
...
167
168
169
170
171
172
173
174

175
176
177
178
179
180
181
182
183
184
185
186
187
188
\ MINOS2 widget basis

\ A MINOS2 widget is composed of drawable elements, boxes and actors.
\ to make things easier, neither drawable elements nor boxes need an actor.

require gl-helper.fs
ctx 0= [IF] window-init [THEN]

require ftgl-helper.fs
require mini-oof2.fs

get-current
also [IFDEF] android android [THEN]
also opengl


vocabulary minos  also minos definitions

0 Value layer \ drawing layer

object class
    field: caller-w
................................................................................
    z-bias set-color+
    program glUseProgram  style-tex ;
: draw1> ( -- )  GL_TRIANGLES draw-elements v0 i0 ;

: <draw2 ( -- )  2 to layer s" " glyphs$ $! ;
: draw2> ( -- )  glyphs$ $@ load-glyph$ ;
: <draw3 ( -- )  3 to layer
    <render ;

: draw3> ( -- )  render> v0 i0 ;

Variable style-i#

: load-style ( addr u -- n )  style-tex
    style-i# @ 8 /mod 128 * >r 128 * r> 2swap load-subtex 2drop
    style-i# @ 1 style-i# +! ;
: style: load-style Create , DOES> @ frame# ! ;

"button.png" style: button1
"button2.png" style: button2
"button3.png" style: button3

previous previous previous set-current

Changes to opengl/linux.fs.

238
239
240
241
242
243
244
245

246
247
248
249
250
251
252
: getwh ( -- )
	0 0 dpy-w @ dpy-h @ glViewport ;

:noname ; handler-class to DoNull \ doesn't exist
:noname ; handler-class to DoOne  \ doesn't exit, either
:noname  ic event look_chars $FF look_key comp_stat  XUtf8LookupString
    ?dup-IF  look_chars swap
    ELSE   look_key l@ x-key>ekey  THEN  unkeys

; handler-class to DoKeyPress
:noname ; handler-class to DoKeyRelease
:noname  0 *input action ! 1 *input pressure !
    e.time @ s>d *input starttime 2!  0. *input downtime 2!
    e.x l@ e.y l@ *input y0 ! *input x0 ! ; handler-class to DoButtonPress
:noname  1 *input action ! 0 *input pressure !
    e.time l@ s>d *input starttime 2@ d- *input downtime 2!







|
>







238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
: getwh ( -- )
	0 0 dpy-w @ dpy-h @ glViewport ;

:noname ; handler-class to DoNull \ doesn't exist
:noname ; handler-class to DoOne  \ doesn't exit, either
:noname  ic event look_chars $FF look_key comp_stat  XUtf8LookupString
    ?dup-IF  look_chars swap
    ELSE   look_key l@ x-key>ekey  THEN
    2dup "\e" str= IF  2drop -1 level# +!  ELSE  unkeys  THEN
; handler-class to DoKeyPress
:noname ; handler-class to DoKeyRelease
:noname  0 *input action ! 1 *input pressure !
    e.time @ s>d *input starttime 2!  0. *input downtime 2!
    e.x l@ e.y l@ *input y0 ! *input x0 ! ; handler-class to DoButtonPress
:noname  1 *input action ! 0 *input pressure !
    e.time l@ s>d *input starttime 2@ d- *input downtime 2!

Changes to widgets.fs.

1
2
3
4
5
6


7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
\ MINOS2 widget basis

\ A MINOS2 widget is composed of drawable elements, boxes and actors.
\ to make things easier, neither drawable elements nor boxes need an actor.

require gl-helper.fs


require ftgl-helper.fs
require mini-oof2.fs

get-current
also [IFDEF] android android [THEN]
also opengl
[IFUNDEF] android window-init [THEN]

vocabulary minos  also minos definitions

0 Value layer \ drawing layer

object class
    field: caller-w
................................................................................
    z-bias set-color+
    program glUseProgram  style-tex ;
: draw1> ( -- )  GL_TRIANGLES draw-elements v0 i0 ;

: <draw2 ( -- )  2 to layer s" " glyphs$ $! ;
: draw2> ( -- )  glyphs$ $@ load-glyph$ ;
: <draw3 ( -- )  3 to layer
    1-bias set-color+
    program glUseProgram  atlas-tex ;
: draw3> ( -- )  GL_TRIANGLES draw-elements v0 i0 ;

Variable style-i#

: load-style ( addr u -- n )  style-tex
    style-i# @ 8 /mod 128 * >r 128 * r> 2swap load-subtex 2drop
    style-i# @ 1 style-i# +! ;
: style: load-style Create , DOES> @ frame# ! ;

"button.png" style: button1
"button2.png" style: button2
"button3.png" style: button3

previous previous previous set-current






>
>






<







 







|
<
|













1
2
3
4
5
6
7
8
9
10
11
12
13
14

15
16
17
18
19
20
21
...
167
168
169
170
171
172
173
174

175
176
177
178
179
180
181
182
183
184
185
186
187
188
\ MINOS2 widget basis

\ A MINOS2 widget is composed of drawable elements, boxes and actors.
\ to make things easier, neither drawable elements nor boxes need an actor.

require gl-helper.fs
ctx 0= [IF] window-init [THEN]

require ftgl-helper.fs
require mini-oof2.fs

get-current
also [IFDEF] android android [THEN]
also opengl


vocabulary minos  also minos definitions

0 Value layer \ drawing layer

object class
    field: caller-w
................................................................................
    z-bias set-color+
    program glUseProgram  style-tex ;
: draw1> ( -- )  GL_TRIANGLES draw-elements v0 i0 ;

: <draw2 ( -- )  2 to layer s" " glyphs$ $! ;
: draw2> ( -- )  glyphs$ $@ load-glyph$ ;
: <draw3 ( -- )  3 to layer
    <render ;

: draw3> ( -- )  render> v0 i0 ;

Variable style-i#

: load-style ( addr u -- n )  style-tex
    style-i# @ 8 /mod 128 * >r 128 * r> 2swap load-subtex 2drop
    style-i# @ 1 style-i# +! ;
: style: load-style Create , DOES> @ frame# ! ;

"button.png" style: button1
"button2.png" style: button2
"button3.png" style: button3

previous previous previous set-current