package Ġdev . j atz uk . snow wall paper . opengl . programs Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . opengl . GLES 2 0 .* Ċ import Ġdev . j atz uk . snow wall paper . opengl . util . Shader Helper Ċ import Ġdev . j atz uk . snow wall paper . opengl . wall paper . OpenGL Wall paper Service Ċ Ċ abstract Ġclass ĠShader Program ( ĊĠĠĠ Ġcontext : ĠContext , ĊĠĠĠ Ġvertex Shader ResourceId : ĠInt , ĊĠĠĠ Ġfragment Shader ResourceId : ĠInt Ċ ) Ġ{ ĊĊĠĠĠ Ġprotected Ġval Ġprogram Ġ= ĠShader Helper . build Program ( ĊĠĠĠĠĠĠĠ ĠShader Helper . read Shader Code From Resource ( context , Ġvertex Shader ResourceId ), ĊĠĠĠĠĠĠĠ ĠShader Helper . read Shader Code From Resource ( context , Ġfragment Shader ResourceId ) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprotected Ġval Ġu Matrix Ġ= Ġ" u _ Matrix " ĊĠĠĠ Ġprotected Ġval Ġu Color Ġ= Ġ" u _ Color " ĊĠĠĠ Ġprotected Ġval Ġu Texture Unit Ġ= Ġ" u _ Texture Unit " ĊĠĠĠ Ġprotected Ġval Ġu Point Size Ġ= Ġ" u _ Point Size " ĊĊĠĠĠ Ġprivate Ġval Ġa Position Ġ= Ġ" a _ Position " ĊĠĠĠ Ġprotected Ġval Ġa Texture Ġ= Ġ" a _ Texture " ĊĊĠĠĠ Ġprivate Ġval Ġu Screen Width Ġ= Ġ" u _ Screen Width " ĊĠĠĠ Ġprivate Ġval Ġu Screen Height Ġ= Ġ" u _ Screen Height " ĊĊĠĠĠ Ġprivate Ġval Ġu Screen Width Location Ġ= ĠglGet UniformLocation ( program , Ġu Screen Width ) ĊĠĠĠ Ġprivate Ġval Ġu Screen Height Location Ġ= ĠglGet UniformLocation ( program , Ġu Screen Height ) ĊĊĠĠĠ Ġval Ġa Position Location Ġ= ĠglGet Attrib Location ( program , Ġa Position ) ĊĊĠĠĠ Ġfun Ġuse Program () Ġ{ ĊĠĠĠĠĠĠĠ Ġgl Use Program ( program ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprotected Ġfun Ġset Normalized Coordinates () Ġ{ ĊĠĠĠĠĠĠĠ Ġgl Uniform 1 f ( u Screen Width Location , ĠOpenGL Wall paper Service . width . toFloat ()) ĊĠĠĠĠĠĠĠ Ġgl Uniform 1 f ( u Screen Height Location , ĠOpenGL Wall paper Service . height . toFloat ()) ĊĠĠĠ Ġ} Ċ } Ċ