在开发插件的时候,为了显示自定义的图片,我们通过gs_texture_create创建了一个texture,但在创建的时候,如果要通过gs_texture_set_image更新这个texture,需要在创建的时候传入GS_DYNAMIC,否则调用gs_texture_set_image将无效。
tex_image = gs_texture_create(m_image.width(),m_image.height(),GS_RGBA,1,(const uint8_t **)&cImageBits,GS_DYNAMIC);
gs_texture_set_image(this-> tex_image,(const uint8_t *)cImageBits,m_width * 4,false);