~jammy-zhou/clutk/gles2-shaders.hacky

« back to all changes in this revision

Viewing changes to clutk/ctk-menu.c

  • Committer: Alexander Sack
  • Author(s): Jay Taoko
  • Date: 2010-07-05 22:15:15 UTC
  • mfrom: (259.1.15 clutk.gles-support)
  • Revision ID: jay.taoko@canonical.com-20100705221515-23olxpd9bkzff4s5
Replaced GLEW headers with OpenGL ES headers.
Compile on Marvel ARM board. 
Working test: tests/test-clutk-text


[modified]
  clutk/ctk-arb-asm-private.c                                                                               
  clutk/ctk-effect-blur.c
  clutk/ctk-effect-context.c
  clutk/ctk-effect-drop-shadow.c
  clutk/ctk-effect-glow.c
  clutk/ctk-gfx-private.c
  clutk/ctk-layer-actor.c
  clutk/ctk-layer.c
  clutk/ctk-main.c
  clutk/ctk-menu.c
  clutk/ctk-render-target.c
  clutk/ctk-utils.c
    - modified code to skip non OpenGL ES compatible calls
    - Effects are deactivated
    - Using the following headers on Marvell ARM board:
        <GLES2/gl2.h>
        <GLES2/gl2ext.h>

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
 
215
215
  priv->blurred_background_texture = 0;
216
216
  priv->refresh_background_texture = FALSE;
217
 
//   CHECKGL (glActiveTextureARB(GL_TEXTURE0) );
218
 
//   CHECKGL (glGenTextures (1, &priv->blurred_background_texture));
219
 
//   CHECKGL (glBindTexture (GL_TEXTURE_2D, priv->blurred_background_texture));
220
 
//   CHECKGL (glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL));
221
 
//   CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
222
 
//   CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
223
 
//   CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP));
224
 
//   CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP));
 
217
 
 
218
#ifndef WITH_GLES  
 
219
  CHECKGL (glGenTextures (1, &priv->blurred_background_texture));
 
220
  CHECKGL (glActiveTextureARB(GL_TEXTURE0) );
 
221
  CHECKGL (glBindTexture (GL_TEXTURE_2D, priv->blurred_background_texture));
 
222
  CHECKGL (glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL));
 
223
  CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
 
224
  CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
 
225
  CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP));
 
226
  CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP));
 
227
#endif
225
228
}
226
229
 
227
230
gboolean
438
441
 
439
442
      stage = clutter_actor_get_stage(actor);
440
443
      clutter_actor_get_size (CLUTTER_ACTOR(stage), &stage_width, &stage_height);
441
 
 
 
444
      
 
445
      CtkEffectContext* fxctx = ctk_effect_context_get_default_for_actor (actor);
 
446
      /* Get the current render target */
 
447
      CtkRenderTarget* top_rt = ctk_effect_context_peek_render_target(fxctx);
 
448
      
 
449
#ifndef WITH_GLES
442
450
      CHECKGL( glPixelStorei(GL_PACK_ALIGNMENT, 1) );
443
451
      CHECKGL( glPixelStorei(GL_PACK_ROW_LENGTH, 0) );
444
452
      CHECKGL( glPixelStorei(GL_PACK_IMAGE_HEIGHT, 0) );
465
473
      // Disable Scissoring
466
474
      CHECKGL (glDisable (GL_SCISSOR_TEST));
467
475
 
468
 
      CtkEffectContext* fxctx = ctk_effect_context_get_default_for_actor (actor);
469
 
 
470
 
      /* Get the current render target */
471
 
      CtkRenderTarget* top_rt = ctk_effect_context_peek_render_target(fxctx);
472
 
 
473
476
      /* reserve 2 render targets */
474
477
      CtkRenderTarget* rt0 = ctk_effect_context_grab_render_target (fxctx);
475
478
      CtkRenderTarget* rt1 = ctk_effect_context_grab_render_target (fxctx);
518
521
      /* Release the render target we use */
519
522
      ctk_effect_context_release_render_target (fxctx, rt0);
520
523
      ctk_effect_context_release_render_target (fxctx, rt1);
 
524
#endif
521
525
 
522
526
      /* Restore the previous render target */
523
527
      if(top_rt)