summaryrefslogtreecommitdiffstats
path: root/modules/gdnative/videodecoder
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2019-06-11 15:43:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-11 11:53:26 +0100
commit3f335ce3d446372eeb9ed87f7e117099c4d2dd6a (patch)
tree669db7ddb21f328215a9c26e9bdaf2565db8c853 /modules/gdnative/videodecoder
parent9ffe57a10eecf79ab8df2f0497d0387383755df3 (diff)
downloadredot-engine-3f335ce3d446372eeb9ed87f7e117099c4d2dd6a.tar.gz
Texture refactor
-Texture renamed to Texture2D -TextureLayered as base now inherits 2Darray, cubemap and cubemap array -Removed all references to flags in textures (they will go in the shader) -Texture3D gone for now (will come back later done properly) -Create base rasterizer for RenderDevice, RasterizerRD
Diffstat (limited to 'modules/gdnative/videodecoder')
-rw-r--r--modules/gdnative/videodecoder/video_stream_gdnative.cpp10
-rw-r--r--modules/gdnative/videodecoder/video_stream_gdnative.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp
index dbe00cdf71..8dcafc1987 100644
--- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp
+++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp
@@ -132,7 +132,11 @@ bool VideoStreamPlaybackGDNative::open_file(const String &p_file) {
pcm_write_idx = -1;
samples_decoded = 0;
- texture->create((int)texture_size.width, (int)texture_size.height, Image::FORMAT_RGBA8, Texture::FLAG_FILTER | Texture::FLAG_VIDEO_SURFACE);
+ Ref<Image> img;
+ img.instance();
+ img->create((int)texture_size.width, false, (int)texture_size.height, Image::FORMAT_RGBA8);
+
+ texture->create_from_image(img);
}
return file_opened;
@@ -192,7 +196,7 @@ void VideoStreamPlaybackGDNative::update_texture() {
Ref<Image> img = memnew(Image(texture_size.width, texture_size.height, 0, Image::FORMAT_RGBA8, *pba));
- texture->set_data(img);
+ texture->update(img, true);
}
// ctor and dtor
@@ -283,7 +287,7 @@ void VideoStreamPlaybackGDNative::set_paused(bool p_paused) {
paused = p_paused;
}
-Ref<Texture> VideoStreamPlaybackGDNative::get_texture() const {
+Ref<Texture2D> VideoStreamPlaybackGDNative::get_texture() const {
return texture;
}
diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.h b/modules/gdnative/videodecoder/video_stream_gdnative.h
index bb0346efb4..024cdec196 100644
--- a/modules/gdnative/videodecoder/video_stream_gdnative.h
+++ b/modules/gdnative/videodecoder/video_stream_gdnative.h
@@ -168,7 +168,7 @@ public:
//virtual int mix(int16_t* p_buffer,int p_frames)=0;
- virtual Ref<Texture> get_texture() const;
+ virtual Ref<Texture2D> get_texture() const;
virtual void update(float p_delta);
virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata);