Commit face1cf98329be2800b1fae1714d3c457af28709
authorDelio Brignoli <brignoli.delio@gmail.com>
Sat, 16 Sep 2017 16:57:43 +0000 (17:57 +0100)
committerMichel Pollet <github.com@pollet.net>
Thu, 21 Sep 2017 05:44:16 +0000 (06:44 +0100)
- Take pixel size into account.
- Fix swapped coordinates passed to glVertex2f().

examples/parts/ssd1306_glut.c

index d2582085399625ca6a59667cace23989a00f673a..fcb62d917fd8b63d8fe75eeb82e3544903893e93 100644 (file)
@@ -178,10 +178,10 @@ ssd1306_gl_draw (ssd1306_t *part)
 
        glTranslatef (0, 0, 0);
        glBegin (GL_QUADS);
-       glVertex2f (part->rows, 0);
+       glVertex2f (0, part->rows*pix_size_g);
        glVertex2f (0, 0);
-       glVertex2f (0, part->columns);
-       glVertex2f (part->rows, part->columns);
+       glVertex2f (part->columns*pix_size_g, 0);
+       glVertex2f (part->columns*pix_size_g, part->rows*pix_size_g);
        glEnd ();
 
        // Draw pixels