Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Test case for text widget |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
2afe3e3af74db7949e1dab28559ad8fe |
User & Date: | bernd 2013-11-27 22:22:10.743 |
Context
2013-11-27
| ||
22:31 | Freetype-gl*.fs properly linked check-in: 7cd8045508 user: bernd tags: trunk | |
22:22 | Test case for text widget check-in: 2afe3e3af7 user: bernd tags: trunk | |
00:21 | Uniform program for text and normal textures check-in: 2e267bcf9f user: bernd tags: trunk | |
Changes
Changes to freetype-gl/Makefile.am.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 | - + | ## flags are passed to the compiler for both C and C++, in addition to the ## language-specific options. AM_CPPFLAGS = $(EXAMPLE_CFLAGS) -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include/ -I/home/bernd/proj/freetype2-android/include lib_LTLIBRARIES = libfreetype-gl.la libfreetype_gl_la_SOURCES = texture-atlas.c texture-font.c vector.c include_HEADERS = freetype-gl.h |
Changes to freetype-gl/configure.ac.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - + - + | AC_CONFIG_HEADERS([config.h]) AC_PROG_CC AM_PROG_AR LT_INIT case $CC in *android*) |
Changes to gles2/ftgl-helper.fs.
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - + | ." Textur in Atlas: " atlas texture_atlas_t-id l@ . cr : atlas-tex atlas texture_atlas_t-id l@ dup to current-tex GL_TEXTURE_2D swap glBindTexture ; \ render font into vertex buffers 2 sfloats buffer: penxy |
︙ | |||
90 91 92 93 94 95 96 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | - - - - - - - - - - - - - - - - - - - - - + - + + - + + | I xc@+ swap >r xchar@xy r> I - +LOOP drop ; : load-glyphs ( -- ) font "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\0" >wide$ drop texture_font_load_glyphs drop ; |
Changes to gles2/ftgl-sample.fs.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | \ freetype GL example require gl-helper.fs |
︙ |
Changes to gles2/gl-helper.fs.
︙ | |||
263 264 265 266 267 268 269 270 271 272 273 274 275 276 | 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | + | } GL_FRAGMENT_SHADER shader: FragmentShader #precision uniform vec3 u_LightPos; // The position of the light in eye space. uniform sampler2D u_Texture; // The input texture. uniform float u_Ambient; // ambient lighting level uniform vec4 u_Coloradd; // color bias for texture varying vec3 v_Position; // Interpolated position for this fragment. varying vec4 v_Color; // This is the color from the vertex shader interpolated across the // triangle per fragment. varying vec3 v_Normal; // Interpolated normal for this fragment. varying vec2 v_TexCoordinate; // Interpolated texture coordinate per fragment. |
︙ | |||
289 290 291 292 293 294 295 | 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | - - + + + + + | // Add attenuation. diffuse = diffuse * (1.0 / (1.0 + (0.10 * distance))); // Add ambient lighting diffuse = (diffuse * ( 1.0 - u_Ambient )) + u_Ambient; |
︙ | |||
354 355 356 357 358 359 360 361 362 363 364 365 366 367 | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | + + + + + | : clear ( -- ) GL_DEPTH_BUFFER_BIT GL_COLOR_BUFFER_BIT or glClear ; : sf, ( float -- ) here 1 sfloats allot sf! ; : sf!+ ( float addr -- addr' ) dup sf! sfloat+ ; Create z-bias 0e sf, 0e sf, 0e sf, 0e sf, Create 1-bias 1e sf, 1e sf, 1e sf, 0e sf, Create unit-matrix 1.0e sf, 0.0e sf, 0.0e sf, 0.0e sf, 0.0e sf, 1.0e sf, 0.0e sf, 0.0e sf, 0.0e sf, 0.0e sf, 1.0e sf, 0.0e sf, 0.0e sf, 0.0e sf, 0.0e sf, 1.0e sf, unit-matrix 12 sfloats + Constant x-pos |
︙ | |||
381 382 383 384 385 386 387 388 389 390 391 392 393 394 | 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | + + | I 4 sfloats bounds DO I sf@ f. 1 sfloats +LOOP cr 4 sfloats +LOOP ; : set-matrix ( addr handle -- ) swap >r 1 false r> glUniformMatrix4fv ; : set-color+ ( addr -- ) Coloradd 1 rot glUniform4fv ; : >ortho { f: near f: far f: left f: right f: top f: bottom -- } ap-matrix near f2* right left f- f/ sf!+ 0e sf!+ 0e sf!+ 0e sf!+ 0e sf!+ near f2* top bottom f- f/ sf!+ 0e sf!+ 0e sf!+ right left f+ right left f- f/ sf!+ top bottom f+ top bottom f- f/ sf!+ |
︙ | |||
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | + + | GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc program glUseProgram program "u_MVPMatrix\0" drop glGetUniformLocation to MVPMatrix program "u_MVMatrix\0" drop glGetUniformLocation to MVMatrix program "u_LightPos\0" drop glGetUniformLocation to LightPos program "u_Texture\0" drop glGetUniformLocation to Texture program "u_Ambient\0" drop glGetUniformLocation to Ambient program "u_Coloradd\0" drop glGetUniformLocation to Coloradd GL_UNPACK_ALIGNMENT 1 glPixelStorei GL_TEXTURE0 glActiveTexture none-tex no-texture Texture 0 glUniform1i Ambient 1 ambient% glUniform1fv LightPos 0.0e 0.0e -0.3e glUniform3f z-bias set-color+ .01e 100e dpy-w @ dpy-h @ min s>f f2/ 100 fm* >ap ; : 2d-vertex ( index addr -- ) >r dup 2 GL_FLOAT 0 0 r> glVertexAttribPointer glEnableVertexAttribArray ; : 3d-vertex ( index addr -- ) >r |
︙ |
Added gles2/widgets-test.fs.
|
Added gles2/widgets.fs.