Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack253-png committed Sep 21, 2024
1 parent 13b0642 commit 5b53017
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.primogemstudio.advancedfmk.flutter

data class FlutterComposeData(
var blurRadius: Int = 0,
var blurType: Int = 0,
var noise: Float = 0f
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FlutterInstance(assets: String?, val rect: FlutterRect, var width: Int, va
private val cleaner: Cleaner.Cleanable
val handle: Long = FlutterNative.createInstance(assets)
var pressed: Boolean = false
val composeData = FlutterComposeData()

init {
sendSizeEvent()
Expand Down Expand Up @@ -84,6 +85,9 @@ class FlutterInstance(assets: String?, val rect: FlutterRect, var width: Int, va
GlStateManager._colorMask(true, true, true, true)

POST_BLUR.setSamplerUniform("InputSampler", ITARGET)
POST_BLUR.setUniformValue("Radius", composeData.blurRadius)
POST_BLUR.setUniformValue("DigType", composeData.blurType)
POST_BLUR.setUniformValue("NoiseStrength", composeData.noise)
POST_BLUR.render(0f)
// -Dorg.lwjgl.glfw.libname=/usr/lib/libglfw.so
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public abstract class RenderSystemMixin {
private void flipFrame(DeltaTracker deltaTracker, boolean renderLevel, CallbackInfo ci) {
if (instance == null) {
instance = new FlutterInstance("/home/coder2/flutter/flutter_demo/build/linux/x64/release/bundle/data/flutter_assets", new FlutterRect(), 600, 800);
instance.getComposeData().setBlurType(1);
instance.getComposeData().setBlurRadius(8);
instance.getComposeData().setNoise(0.005f);
}
instance.pollEvents();
instance.renderToScreen();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.primogemstudio.advancedfmk.tests

import com.primogemstudio.advancedfmk.flutter.FlutterNative
import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.*
import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.kDown
import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.kHover
import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.kMove
import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.kUp
import com.primogemstudio.advancedfmk.flutter.FlutterSignalKind.None
import com.primogemstudio.advancedfmk.flutter.FlutterSignalKind.Scroll
import org.lwjgl.glfw.GLFW.*
Expand Down

0 comments on commit 5b53017

Please sign in to comment.