mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 15:17:02 -04:00
Try to fix empty surface...
This commit is contained in:
parent
db91668e97
commit
ec7c02e0f9
@ -10,7 +10,9 @@ import net.kdt.pojavlaunch.*;
|
|||||||
import org.lwjgl.glfw.*;
|
import org.lwjgl.glfw.*;
|
||||||
|
|
||||||
public class AWTCanvasView extends View {
|
public class AWTCanvasView extends View {
|
||||||
private TextPaint fpsPaint = new TextPaint(Color.LTGRAY);
|
private int mWidth, mHeight;
|
||||||
|
|
||||||
|
private TextPaint fpsPaint = new TextPaint(Color.WHITE);
|
||||||
private boolean attached = false;
|
private boolean attached = false;
|
||||||
|
|
||||||
// Temporary count fps https://stackoverflow.com/a/13729241
|
// Temporary count fps https://stackoverflow.com/a/13729241
|
||||||
@ -36,6 +38,14 @@ public class AWTCanvasView extends View {
|
|||||||
|
|
||||||
public AWTCanvasView(Context ctx, AttributeSet attrs) {
|
public AWTCanvasView(Context ctx, AttributeSet attrs) {
|
||||||
super(ctx, attrs);
|
super(ctx, attrs);
|
||||||
|
setWillNotDraw(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||||
|
mWidth = w;
|
||||||
|
mHeight = h;
|
||||||
|
// mRadius = (float) (Math.min(mWidth, mHeight) / 2 * 0.8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -46,8 +56,8 @@ public class AWTCanvasView extends View {
|
|||||||
attached = CallbackBridge.nativeAttachThreadToOther(true, MainActivity.isInputStackCall);
|
attached = CallbackBridge.nativeAttachThreadToOther(true, MainActivity.isInputStackCall);
|
||||||
}
|
}
|
||||||
if (attached) {
|
if (attached) {
|
||||||
JREUtils.renderAWTScreenFrame(canvas, getWidth(), getHeight());
|
JREUtils.renderAWTScreenFrame(canvas, mWidth, mHeight);
|
||||||
}
|
}
|
||||||
canvas.drawText("FPS: " + fps(), 10, 10, fpsPaint);
|
canvas.drawText("FPS: " + fps(), 100, 100, fpsPaint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
<net.kdt.pojavlaunch.AWTCanvasView
|
<net.kdt.pojavlaunch.AWTCanvasView
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/installmod_surfaceview"
|
android:id="@+id/installmod_surfaceview"/>
|
||||||
android:background="#000000"/>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user