drawing problem

hi guys :)
i have a simple problem that i wanted to draw a circle and i found a function that allows me to draw but when i draw any shape .. all what i get is 'U' .. how to fix it ??
Perhaps you could try drawing a circle instead of a 'U'.


=P

Sorry for the vague answer, but your question is vague. You do not tell us what you're doing or how you're drawing. You're obviously doing something wrong if you're not getting the expected results -- but we're not psychic. We can't know what your mistake is when you don't give us any information.
Could you show us your code?
Hia! I can give you an example of some code that draws a circle, hopefully that helps!

1
2
3
4
5
6
7
8
9
void simplecircle(surface& sur, int midx, int midy, int radius){
    float step = 1/(2*radius*pi);
    sur.clear(0xffffffff);
    for(float theta = 0; theta < 2*pi; theta += step){
        float tx = (sin(theta) * radius)+midx;
        float ty = (cos(theta) * radius)+midy;
        sur.pixel(tx,ty)=0x0;
    }
}
Topic archived. No new replies allowed.