forked from MolotovCherry/virtual-display-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dart_vdd_example.dart
28 lines (23 loc) · 913 Bytes
/
dart_vdd_example.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import 'package:dart_vdd/dart_vdd.dart';
import 'package:dart_vdd/src/generated/frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
/// Can be run from package root using `dart --enable-experiment=native-assets
/// run .\example\dart_vdd_example.dart`
void main() async {
await RustLib.init(
// There is currently no way to accurately resolve the shared library in
// every szenario
externalLibrary: ExternalLibrary.open("../target/release/dart_vdd.dll"),
// This works with `dart build`
// externalLibrary: ExternalLibrary.open("dart_vdd.dll"),
);
final driver = VirtualDisplayDriver();
Future(() async {
await for (final monitors in driver.stream) {
print('monitors: $monitors');
}
});
driver.addMonitor(enabled: true, modes: [
Mode(width: 1920, height: 1080, refreshRates: Uint32List.fromList([60])),
]);
}