Project

General

Profile

« Previous | Next » 

Revision 463f1f9c

Added by Leszek Koltunski almost 7 years ago

Progress with Glow.

View differences:

src/main/java/org/distorted/examples/blur/BlurRenderer.java
98 98
    
99 99
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
100 100
     {
101
     if( (float)mObjHeight/mObjWidth > (float)height/width )
102
       {
103
       int w = (height*mObjWidth)/mObjHeight;
104
       float factor = (float)height/mObjHeight;
105
       mMove.set((width-w)/2,0,0);
106
       mScale.set(factor,factor,factor);
107
       }
108
     else
109
       {
110
       int h = (width*mObjHeight)/mObjWidth;
111
       float factor = (float)width/mObjWidth;
112
       mMove.set(0,(height-h)/2,0);
113
       mScale.set(factor,factor,factor);
114
       }
115

  
116
     mScreen.resize(width,height);
101
     float qw = (float)width /mObjWidth;
102
     float qh = (float)height/mObjHeight;
103
     float factor = 0.8f* (qw<qh ? qw:qh);
104
     int w = (int)(factor*mObjWidth);
105
     int h = (int)(factor*mObjHeight);
106

  
107
     mMove.set((width-w)/2 ,(height-h)/2, 0);
108
     mScale.set( factor,factor,factor );
109
     mScreen.resize(width, height);
117 110
     }
118 111

  
119 112
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff