Mercurial > sdl-ios-xcode
comparison src/video/SDL_renderer_gles.c @ 2964:0faae272a372
indent
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 02 Jan 2009 16:03:37 +0000 |
parents | 4eabc35fbb4a |
children | 82e60908fab1 |
comparison
equal
deleted
inserted
replaced
2963:ee331407574f | 2964:0faae272a372 |
---|---|
630 data->glColor4f((GLfloat) renderer->r * inv255f, | 630 data->glColor4f((GLfloat) renderer->r * inv255f, |
631 (GLfloat) renderer->g * inv255f, | 631 (GLfloat) renderer->g * inv255f, |
632 (GLfloat) renderer->b * inv255f, | 632 (GLfloat) renderer->b * inv255f, |
633 (GLfloat) renderer->a * inv255f); | 633 (GLfloat) renderer->a * inv255f); |
634 | 634 |
635 GLshort vertices[2]; | 635 GLshort vertices[2]; |
636 vertices[0] = x; | 636 vertices[0] = x; |
637 vertices[1] = y; | 637 vertices[1] = y; |
638 | 638 |
639 data->glVertexPointer(2, GL_SHORT, 0, vertices); | 639 data->glVertexPointer(2, GL_SHORT, 0, vertices); |
640 data->glEnableClientState(GL_VERTEX_ARRAY); | 640 data->glEnableClientState(GL_VERTEX_ARRAY); |
641 data->glDrawArrays(GL_POINTS, 0, 1); | 641 data->glDrawArrays(GL_POINTS, 0, 1); |
642 data->glDisableClientState(GL_VERTEX_ARRAY); | 642 data->glDisableClientState(GL_VERTEX_ARRAY); |
643 | 643 |
644 return 0; | 644 return 0; |
645 } | 645 } |
646 | 646 |
647 static int | 647 static int |
648 GLES_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) | 648 GLES_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) |
654 data->glColor4f((GLfloat) renderer->r * inv255f, | 654 data->glColor4f((GLfloat) renderer->r * inv255f, |
655 (GLfloat) renderer->g * inv255f, | 655 (GLfloat) renderer->g * inv255f, |
656 (GLfloat) renderer->b * inv255f, | 656 (GLfloat) renderer->b * inv255f, |
657 (GLfloat) renderer->a * inv255f); | 657 (GLfloat) renderer->a * inv255f); |
658 | 658 |
659 GLshort vertices[4]; | 659 GLshort vertices[4]; |
660 vertices[0] = x1; | 660 vertices[0] = x1; |
661 vertices[1] = y1; | 661 vertices[1] = y1; |
662 vertices[2] = x2; | 662 vertices[2] = x2; |
663 vertices[3] = y2; | 663 vertices[3] = y2; |
664 | 664 |
665 data->glVertexPointer(2, GL_SHORT, 0, vertices); | 665 data->glVertexPointer(2, GL_SHORT, 0, vertices); |
666 data->glEnableClientState(GL_VERTEX_ARRAY); | 666 data->glEnableClientState(GL_VERTEX_ARRAY); |
667 data->glDrawArrays(GL_LINES, 0, 2); | 667 data->glDrawArrays(GL_LINES, 0, 2); |
668 data->glDisableClientState(GL_VERTEX_ARRAY); | 668 data->glDisableClientState(GL_VERTEX_ARRAY); |
669 | 669 |
670 return 0; | 670 return 0; |
671 } | 671 } |
672 | 672 |
673 static int | 673 static int |
680 data->glColor4f((GLfloat) renderer->r * inv255f, | 680 data->glColor4f((GLfloat) renderer->r * inv255f, |
681 (GLfloat) renderer->g * inv255f, | 681 (GLfloat) renderer->g * inv255f, |
682 (GLfloat) renderer->b * inv255f, | 682 (GLfloat) renderer->b * inv255f, |
683 (GLfloat) renderer->a * inv255f); | 683 (GLfloat) renderer->a * inv255f); |
684 | 684 |
685 GLshort minx = rect->x; | 685 GLshort minx = rect->x; |
686 GLshort maxx = rect->x + rect->w; | 686 GLshort maxx = rect->x + rect->w; |
687 GLshort miny = rect->y; | 687 GLshort miny = rect->y; |
688 GLshort maxy = rect->y + rect->h; | 688 GLshort maxy = rect->y + rect->h; |
689 | 689 |
690 GLshort vertices[8]; | 690 GLshort vertices[8]; |
691 vertices[0] = minx; | 691 vertices[0] = minx; |
692 vertices[1] = miny; | 692 vertices[1] = miny; |
693 vertices[2] = maxx; | 693 vertices[2] = maxx; |
694 vertices[3] = miny; | 694 vertices[3] = miny; |
695 vertices[4] = minx; | 695 vertices[4] = minx; |
696 vertices[5] = maxy; | 696 vertices[5] = maxy; |
697 vertices[6] = maxx; | 697 vertices[6] = maxx; |
698 vertices[7] = maxy; | 698 vertices[7] = maxy; |
699 | 699 |
700 data->glVertexPointer(2, GL_SHORT, 0, vertices); | 700 data->glVertexPointer(2, GL_SHORT, 0, vertices); |
701 data->glEnableClientState(GL_VERTEX_ARRAY); | 701 data->glEnableClientState(GL_VERTEX_ARRAY); |
702 data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); | 702 data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); |
703 data->glDisableClientState(GL_VERTEX_ARRAY); | 703 data->glDisableClientState(GL_VERTEX_ARRAY); |
704 | 704 |
705 return 0; | 705 return 0; |
706 } | 706 } |
707 | 707 |
708 static int | 708 static int |