Files
cup_edit/windows/opengl_texture_buffer.h
Nick Fisher 8b9e6a2b3a rename plugin from PolyvoxFilament to FlutterFilament
rename plugin from PolyvoxFilament to FlutterFilament
2023-10-26 14:08:20 +11:00

51 lines
1.2 KiB
C++

#pragma once
#ifndef _OPENGL_TEXTURE_BUFFER_H
#define _OPENGL_TEXTURE_BUFFER_H
#include <mutex>
#include <flutter/texture_registrar.h>
#include <flutter/method_channel.h>
#include <flutter/plugin_registrar_windows.h>
#include "GL/GL.h"
#include "GL/GLu.h"
#include "GL/wglext.h"
#include <Windows.h>
#include <wrl.h>
#include "flutter_texture_buffer.h"
typedef uint32_t GLuint;
namespace flutter_filament {
class OpenGLTextureBuffer : public FlutterTextureBuffer {
public:
OpenGLTextureBuffer(
flutter::PluginRegistrarWindows* pluginRegistrar,
flutter::TextureRegistrar* textureRegistrar,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result,
uint32_t width,
uint32_t height,
HGLRC context);
~OpenGLTextureBuffer();
GLuint glTextureId = 0;
std::unique_ptr<FlutterDesktopPixelBuffer> pixelBuffer;
std::unique_ptr<uint8_t> pixelData;
std::unique_ptr<flutter::TextureVariant> texture;
private:
flutter::PluginRegistrarWindows* _pluginRegistrar;
flutter::TextureRegistrar* _textureRegistrar;
uint32_t _width = 0;
uint32_t _height = 0;
HGLRC _context = NULL;
bool logged = false;
};
}
#endif // _OPENGL_TEXTURE_BUFFER_H