Revision 2e0258fe
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/main/RubikRenderer.java | ||
---|---|---|
38 | 38 |
|
39 | 39 |
public class RubikRenderer implements GLSurfaceView.Renderer, DistortedLibrary.ExceptionListener |
40 | 40 |
{ |
41 |
public static final float BRIGHTNESS = 0.30f; |
|
42 |
|
|
41 | 43 |
private RubikSurfaceView mView; |
42 | 44 |
private DistortedScreen mScreen; |
43 | 45 |
private Fps mFPS; |
... | ... | |
85 | 87 |
|
86 | 88 |
RubikRenderer(RubikSurfaceView v) |
87 | 89 |
{ |
88 |
final float BRIGHTNESS = 0.30f; |
|
89 |
|
|
90 | 90 |
mErrorShown = false; |
91 | 91 |
mView = v; |
92 | 92 |
mFPS = new Fps(); |
... | ... | |
112 | 112 |
@Override |
113 | 113 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
114 | 114 |
{ |
115 |
android.util.Log.e("main", "width="+width+" height="+height); |
|
116 |
|
|
117 | 115 |
mScreen.resize(width,height); |
118 | 116 |
mView.setScreenSize(width,height); |
119 | 117 |
mView.getPreRender().setScreenSize(width); |
src/main/java/org/distorted/tutorial/TutorialActivity.java | ||
---|---|---|
40 | 40 |
import org.distorted.states.RubikStatePlay; |
41 | 41 |
import org.distorted.states.StateList; |
42 | 42 |
|
43 |
import static org.distorted.main.RubikRenderer.BRIGHTNESS; |
|
44 |
|
|
43 | 45 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
44 | 46 |
|
45 | 47 |
public class TutorialActivity extends AppCompatActivity |
... | ... | |
131 | 133 |
paramsR.width = (int)(width*RATIO); |
132 | 134 |
viewR.setLayoutParams(paramsR); |
133 | 135 |
|
136 |
final int color = (int)(BRIGHTNESS*255); |
|
137 |
viewR.setBackgroundColor( (0xFF<<24)+(color<<16)+(color<<8)+color); |
|
138 |
|
|
134 | 139 |
if( mState==null ) mState = new TutorialState(); |
135 | 140 |
|
136 | 141 |
mState.createRightPane(this,width); |
src/main/java/org/distorted/tutorial/TutorialRenderer.java | ||
---|---|---|
64 | 64 |
@Override |
65 | 65 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
66 | 66 |
{ |
67 |
android.util.Log.e("tut", "width="+width+" height="+height); |
|
68 |
|
|
69 | 67 |
mScreen.resize(width,height); |
70 | 68 |
mView.setScreenSize(width,height); |
71 | 69 |
mView.getPreRender().setScreenSize(width); |
Also available in: Unified diff
Progress creating the Tutorial Activity.