Skip to content

Commit

Permalink
ssd1306: fix background painting
Browse files Browse the repository at this point in the history
- Take pixel size into account.
- Fix swapped coordinates passed to glVertex2f().
  • Loading branch information
dxxb authored and buserror committed Sep 21, 2017
1 parent d0f6399 commit face1cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/parts/ssd1306_glut.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit face1cf

Please sign in to comment.