… | |
… | |
2757 | |
2757 | |
2758 | void glRect (float x1, float y1, float x2, float y2) |
2758 | void glRect (float x1, float y1, float x2, float y2) |
2759 | CODE: |
2759 | CODE: |
2760 | glRectf (x1, y1, x2, y2); |
2760 | glRectf (x1, y1, x2, y2); |
2761 | |
2761 | |
|
|
2762 | void glRect_lineloop (float x1, float y1, float x2, float y2) |
|
|
2763 | CODE: |
|
|
2764 | glBegin (GL_LINE_LOOP); |
|
|
2765 | glVertex2f (x1, y1); |
|
|
2766 | glVertex2f (x2, y1); |
|
|
2767 | glVertex2f (x2, y2); |
|
|
2768 | glVertex2f (x1, y2); |
|
|
2769 | glEnd (); |
|
|
2770 | |
2762 | PROTOTYPES: ENABLE |
2771 | PROTOTYPES: ENABLE |
2763 | |
2772 | |
2764 | void glBegin (int mode) |
2773 | void glBegin (int mode) |
2765 | |
2774 | |
2766 | void glEnd () |
2775 | void glEnd () |
… | |
… | |
2918 | glEnd (); |
2927 | glEnd (); |
2919 | glDisable (GL_BLEND); |
2928 | glDisable (GL_BLEND); |
2920 | } |
2929 | } |
2921 | } |
2930 | } |
2922 | #if 0 |
2931 | #if 0 |
2923 | if ($ENV{CFPLUS_DEBUG} & 1) { |
2932 | // draw borders, for debugging |
2924 | glPushMatrix; |
2933 | glPushMatrix (); |
2925 | glColor 1, 1, 0, 1; |
2934 | glColor4f (1., 1., 0., 1.); |
2926 | glTranslate 0.375, 0.375; |
2935 | glTranslatef (.5, .5, 0.); |
2927 | glBegin GL_LINE_LOOP; |
2936 | glBegin (GL_LINE_LOOP); |
2928 | glVertex 0 , 0; |
2937 | glVertex2f (0 , 0); |
2929 | glVertex $self->{w} - 1, 0; |
2938 | glVertex2f (w - 1, 0); |
2930 | glVertex $self->{w} - 1, $self->{h} - 1; |
2939 | glVertex2f (w - 1, h - 1); |
2931 | glVertex 0 , $self->{h} - 1; |
2940 | glVertex2f (0 , h - 1); |
2932 | glEnd; |
2941 | glEnd (); |
2933 | glPopMatrix; |
2942 | glPopMatrix (); |
2934 | #CFPlus::UI::Label->new (w => $self->{w}, h => $self->{h}, text => $self, fontsize => 0)->_draw; |
|
|
2935 | } |
|
|
2936 | #endif |
2943 | #endif |
2937 | PUSHMARK (SP); |
2944 | PUSHMARK (SP); |
2938 | XPUSHs (self); |
2945 | XPUSHs (self); |
2939 | PUTBACK; |
2946 | PUTBACK; |
2940 | call_method ("_draw", G_VOID | G_DISCARD); |
2947 | call_method ("_draw", G_VOID | G_DISCARD); |