gtk gl
authoryu.dongliang <18588496441@163.com>
Sun, 16 Apr 2023 13:36:37 +0000 (21:36 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 16 Apr 2023 13:36:37 +0000 (21:36 +0800)
main.c
simp_gtk_gl.c

diff --git a/main.c b/main.c
index cdfcf009079890650cf0878ebc477665eefa92f7..1d61294181eaa1b3ab103d35e439c4da9ecbfb0e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -52,7 +52,7 @@ static void resize (GtkGLArea* self, gint width, gint height, gpointer user_data
        if (gdk_gl_context_get_use_es (context)) {
                printf("%s(),%d, gles\n", __func__, __LINE__);
        } else {
-               printf("%s(),%d, gl\n", __func__, __LINE__);
+               printf("%s(),%d, gl, width: %d, height: %d\n", __func__, __LINE__, width, height);
        }
 
 //     simp_avio_run(user_data);
index 3d4b087f9bb5d202742b9e602caadfc244fa69ff..16a6107cd1614fcff68c6a3852d5ddfff1acfb45 100644 (file)
@@ -227,14 +227,17 @@ static int _gtk_gl_run(simp_avio_t* io)
 
        glActiveTexture(GL_TEXTURE0);
        glBindTexture  (GL_TEXTURE_2D, gl->texture_y);
+       glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, SIMP_GL_WIDTH, SIMP_GL_HEIGHT, GL_RED, GL_UNSIGNED_BYTE, gl->y);
        glUniform1i    (gl->uniform_y, 0);
 
        glActiveTexture(GL_TEXTURE1);
        glBindTexture  (GL_TEXTURE_2D, gl->texture_u);
+       glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, SIMP_GL_WIDTH / 2, SIMP_GL_HEIGHT/ 2, GL_RED, GL_UNSIGNED_BYTE, gl->u);
        glUniform1i    (gl->uniform_u, 1);
 
        glActiveTexture(GL_TEXTURE2);
        glBindTexture  (GL_TEXTURE_2D, gl->texture_v);
+       glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, SIMP_GL_WIDTH / 2, SIMP_GL_HEIGHT/ 2, GL_RED, GL_UNSIGNED_BYTE, gl->v);
        glUniform1i    (gl->uniform_v, 2);
 
        // draw