Browse Source

[example] Clear aurora plugin

embedder_texture
Vitaliy Zarubin 1 year ago
parent
commit
96795f33f0
  1. 1
      example/aurora/rpm/ru.auroraos.flutter_example_packages.spec
  2. 42
      packages/embedder_texture/aurora/embedder_texture_plugin.cpp

1
example/aurora/rpm/ru.auroraos.flutter_example_packages.spec

@ -10,7 +10,6 @@ Source0: %{name}-%{version}.tar.zst
BuildRequires: cmake
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(glesv2)
BuildRequires: pkgconfig(flutter-embedder)
%description

42
packages/embedder_texture/aurora/embedder_texture_plugin.cpp

@ -5,10 +5,6 @@
#include <embedder_texture/embedder_texture_plugin.h>
#include <flutter/method-channel.h>
#include <flutter/platform-methods.h>
#include <sys/utsname.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
void EmbedderTexturePlugin::RegisterWithRegistrar(PluginRegistrar &registrar)
{
@ -36,42 +32,10 @@ void EmbedderTexturePlugin::onMethodCall(const MethodCall &call)
void EmbedderTexturePlugin::onCreate(const MethodCall &call)
{
auto width = call.GetArgument<Encodable::Float>("width");
auto height = call.GetArgument<Encodable::Float>("height");
static GLfloat pixels[] =
{
1, 0, 0,
0, 1, 0,
0, 0, 1,
1, 1, 1
};
glEnable(GL_TEXTURE_2D);
GLuint texture_id;
glGenTextures(1, &texture_id);
glBindTexture(GL_TEXTURE_2D, texture_id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_RGB, GL_FLOAT, pixels);
std::cout << "--------------------" << std::endl;
std::cout << glGetError() << std::endl;
std::cout << texture_id << std::endl;
std::cout << width << std::endl;
std::cout << height << std::endl;
std::cout << "++++++++++++++++++++" << std::endl;
if (texture_id != 0) {
call.TextureRegister(texture_id);
}
// auto width = call.GetArgument<Encodable::Float>("width");
// auto height = call.GetArgument<Encodable::Float>("height");
call.SendSuccessResponse(texture_id);
call.SendSuccessResponse(call.TextureRegister());
}
void EmbedderTexturePlugin::onRemove(const MethodCall &call)

Loading…
Cancel
Save