forked from wasabia/flutter_gl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
22,637 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
/pubspec.lock | ||
**/doc/api/ | ||
.dart_tool/ | ||
.packages | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: 8f1f9c10f04b8f106d78275e93ceead8ea837d8b | ||
channel: beta | ||
|
||
project_type: plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.0.1 | ||
|
||
* TODO: Describe initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TODO: Add your license here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# flutter_gl_macos | ||
|
||
A new flutter plugin project. | ||
|
||
## Getting Started | ||
|
||
This project is a starting point for a Flutter | ||
[plug-in package](https://flutter.dev/developing-packages/), | ||
a specialized package that includes platform-specific implementation code for | ||
Android and/or iOS. | ||
|
||
For help getting started with Flutter, view our | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
// class FlutterGlMacos { | ||
// static const MethodChannel _channel = MethodChannel('flutter_gl_macos'); | ||
|
||
// static Future<String?> get platformVersion async { | ||
// final String? version = await _channel.invokeMethod('getPlatformVersion'); | ||
// return version; | ||
// } | ||
// } | ||
|
||
|
||
import 'dart:async'; | ||
|
||
|
||
import 'package:flutter_gl_macos/openGL/OpenGL.dart'; | ||
import 'package:flutter_gl_platform_interface/flutter_gl_platform_interface.dart'; | ||
|
||
|
||
|
||
class FlutterGlMacos extends FlutterGlPlatform { | ||
late dynamic openGL; | ||
|
||
late List<int> egls; | ||
|
||
dynamic get gl => openGL.gl; | ||
|
||
// for web | ||
dynamic get element => openGL.element; | ||
|
||
FlutterGlMacos() { | ||
|
||
} | ||
|
||
Future<Map<String, dynamic>> initialize({Map<String, dynamic>? options}) async { | ||
Map<String, dynamic> _options = {}; | ||
|
||
_options.addAll(options ?? {}); | ||
|
||
final resp = await FlutterGlPlatform.instance.initialize(options: _options); | ||
textureId = resp["textureId"]; | ||
|
||
// used for web | ||
_options["divId"] = textureId.toString(); | ||
openGL = OpenGL().init(_options); | ||
|
||
return resp; | ||
} | ||
|
||
prepareContext() async { | ||
egls = await FlutterGlPlatform.instance.getEgl(this.textureId!); | ||
|
||
openGL.makeCurrent(egls); | ||
} | ||
|
||
Future<List<int>> getEgl(int textureId) async { | ||
var result = List<int>.from(await FlutterGlPlatform.instance.getEgl(textureId)); | ||
return result; | ||
} | ||
|
||
Future<bool> updateTexture(sourceTexture) { | ||
return FlutterGlPlatform.instance.updateTexture(sourceTexture); | ||
} | ||
|
||
dispose() { | ||
return FlutterGlPlatform.instance.dispose(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
class OpenGLBase { | ||
|
||
|
||
int get defaultFrameBuffer => 0; | ||
int get defaultTexture => 0; | ||
dynamic _gl; | ||
|
||
dynamic element; | ||
|
||
dynamic get gl => _gl; | ||
|
||
OpenGLBase(Map<String, dynamic> options) {} | ||
|
||
void initOpenGL(int width, int height, bool bool, List<int> egls) {} | ||
|
||
void glFlush() {} | ||
|
||
void dispose(){} | ||
|
||
void makeCurrent(List<int> egls) {} | ||
|
||
} |
Oops, something went wrong.