Verständnissproblem bei Allegro



  • Hi !!
    Ich beschaeftige mich nun schon seit einiger Zeit mit C und will nun auch mal was buntes schaffen 🙂
    Für die Grafik verwende ich Allegro ..
    Nun gibts da diese simplen Zeichenfunktionen aus denen ich nicht ganz schlau werde ... betrifft die Ganzen do_Funktionen

    void do_ellipse(BITMAP *bmp, int x, int y, int rx, ry, int d, void (*proc)(BITMAP *bmp, int x, int y, int d));

    Calculates all the points in an ellipse around point (x, y) with radius rx and ry, calling the supplied function for each one. This will be passed a copy of the bmp parameter, the x and y position, and a copy of the d parameter, so it is suitable for use with putpixel().
    *

    Ich verstehe die Funtionsbeschreibung nicht (da fehlt mir scheinbar noch etwas C-Verstaendniss)

    Ich waere Dankbar wenn jemand ein simples Beispiel posten koennte, welche die Funktion do_line od. do_ellipse verwendet, damit ich das auch behirne

    Danke im vorraus
    Andi



  • sieh dir folgendes an, und es sollte klar werden ...

    do_circle(screen,SCREEN_W/2,SCREEN_H/2,SCREEN_H/2-10,rand()%15,test_funktion);

    void test_funktion(BITMAP *bmp,int x, int y, int color)
    {
    static int i=3;
    if(i%3==0)
    line(bmp,x,y,SCREEN_W/2,SCREEN_H/2,color);
    i++;
    }


Anmelden zum Antworten