mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-05 06:39:55 +00:00
Prevent OpenGL error when switching cursor image
This commit is contained in:
parent
39f9506446
commit
3f306de5e1
@ -390,6 +390,8 @@ std::optional<ctx_t> make_ctx(display_t::pointer display) {
|
||||
return ctx;
|
||||
}
|
||||
std::optional<rgb_t> import_source(display_t::pointer egl_display, const surface_descriptor_t &xrgb) {
|
||||
gl_drain_errors;
|
||||
|
||||
EGLAttrib img_attr_planes[13] {
|
||||
EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_XRGB8888,
|
||||
EGL_WIDTH, xrgb.width,
|
||||
@ -663,8 +665,7 @@ void sws_t::load_vram(cursor_t &img, int offset_x, int offset_y, int texture) {
|
||||
if(serial != img.serial) {
|
||||
serial = img.serial;
|
||||
|
||||
gl::ctx.TexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, img.width, img.height);
|
||||
gl::ctx.TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, img.width, img.height, GL_BGRA, GL_UNSIGNED_BYTE, img.data);
|
||||
gl::ctx.TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, img.width, img.height, 0, GL_BGRA, GL_UNSIGNED_BYTE, img.data);
|
||||
}
|
||||
|
||||
gl::ctx.Enable(GL_BLEND);
|
||||
|
Loading…
x
Reference in New Issue
Block a user