extend to support rendering to RenderTarget/OpenGL texture on Linux
This commit is contained in:
44
linux/include/polyvox_filament/filament_pb_texture.h
Normal file
44
linux/include/polyvox_filament/filament_pb_texture.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef FILAMENT_PB_TEXTURE_H
|
||||
#define FILAMENT_PB_TEXTURE_H
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib-object.h>
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <flutter_linux/fl_texture_gl.h>
|
||||
#include <flutter_linux/fl_texture.h>
|
||||
#include <flutter_linux/fl_pixel_buffer_texture.h>
|
||||
#include <flutter_linux/fl_texture_registrar.h>
|
||||
|
||||
|
||||
#ifdef FLUTTER_PLUGIN_IMPL
|
||||
#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define FLUTTER_PLUGIN_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define FILAMENT_PB_TEXTURE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), filament_pb_texture_get_type(), \
|
||||
FilamentPBTexture))
|
||||
|
||||
struct _FilamentPBTexture {
|
||||
FlPixelBufferTexture parent_instance;
|
||||
};
|
||||
|
||||
typedef struct _FilamentPBTexture FilamentPBTexture;
|
||||
typedef struct {
|
||||
FlPixelBufferTextureClass parent_instance;
|
||||
gboolean (*copy_pixels)(FlPixelBufferTexture* texture,
|
||||
const uint8_t** buffer,
|
||||
uint32_t* width,
|
||||
uint32_t* height,
|
||||
GError** error);
|
||||
|
||||
} FilamentPBTextureClass;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT FlTexture* create_filament_pb_texture(uint32_t width, uint32_t height, FlTextureRegistrar* registrar);
|
||||
|
||||
#endif
|
||||
48
linux/include/polyvox_filament/filament_texture.h
Normal file
48
linux/include/polyvox_filament/filament_texture.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef FILAMENT_TEXTURE_H
|
||||
#define FILAMENT_TEXTURE_H
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib-object.h>
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <flutter_linux/fl_texture_gl.h>
|
||||
#include <flutter_linux/fl_texture.h>
|
||||
#include <flutter_linux/fl_texture_registrar.h>
|
||||
|
||||
|
||||
#ifdef FLUTTER_PLUGIN_IMPL
|
||||
#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define FLUTTER_PLUGIN_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define FILAMENT_TEXTURE_GL(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), filament_texture_gl_get_type(), \
|
||||
FilamentTextureGL))
|
||||
|
||||
struct _FilamentTextureGL {
|
||||
FlTextureGL parent_instance;
|
||||
GLuint texture_id;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
};
|
||||
|
||||
typedef struct _FilamentTextureGL FilamentTextureGL;
|
||||
typedef struct {
|
||||
FlTextureGLClass parent_instance;
|
||||
gboolean (*populate)(FlTextureGL* texture,
|
||||
uint32_t* target,
|
||||
uint32_t* name,
|
||||
uint32_t* width,
|
||||
uint32_t* height,
|
||||
GError** error);
|
||||
|
||||
GLuint texture_id;
|
||||
} FilamentTextureGLClass;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT FlTexture* create_filament_texture(uint32_t width, uint32_t height, FlTextureRegistrar* registrar);
|
||||
|
||||
#endif
|
||||
@@ -2,6 +2,7 @@
|
||||
#define FLUTTER_PLUGIN_POLYVOX_FILAMENT_PLUGIN_H_
|
||||
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user