baca Opublikowano 19 Stycznia 2011 Udostępnij Opublikowano 19 Stycznia 2011 Czy ktoś by mi mógł przerobić ten kod żeby round rect obsłógiwał cztery kolory, każdy kolor z jednego rogu. </P><P>void Renderer::DrawRoundRect(float x1, float y1, float x2, float y2, float radius, DWORD color)</P><P>{</P><P> VewrtexBegin(PR_TRIANGLE_FAN); DrawVertex(x1+radius, y1, color); DrawVertex(x2-radius, y1, color); for(float t =M_PI* 1.5f; t < M_PI * 2; t+=0.1f){ float sx = x2 - radius + (float)cos(t) * radius; float sy = y1 + radius + (float)sin(t) * radius; DrawVertex(sx, sy); } DrawVertex(x2, y1+radius); DrawVertex(x2, y2-radius); for(float t =0; t < M_PI*0.5f; t+=0.1f){ float sx = x2 - radius + cos(t)*radius; float sy = y2 -radius + sin(t) * radius; DrawVertex (sx, sy); } DrawVertex(x2 -radius, y2); GL11.glVertex2f (x1 +radius, y2); for(float t =3.1415f * 0.5f; t < M_PI; t+=0.1f){ float sx = x1 + radius + cos(t) * radius; float sy = y2 - radius + sin(t) * radius; DrawVertex(sx, sy); } DrawVertex(x1, y2 - radius); DrawVertex(x1, y1 +radius); for(float t =M_PI; t <M_PI * 1.5f; t+=0.1f){ float sx = x1 + radius + cos(t) * radius; float sy = y1 + radius + sin(t) * radius; DrawVertex(sx, sy); } VertexEnd(); } </P><P> (z pamięci pisałem to mogą być błędy.) Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi
Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto
Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.
Zarejestruj nowe konto
Załóż nowe konto. To bardzo proste!
Zarejestruj sięZaloguj się
Posiadasz już konto? Zaloguj się poniżej.
Zaloguj się