SGE Blib


Important!


void sge_FadedLine(SDL_Surface *dest, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r1, Uint8 g1, Uint8 b1, Uint8 r2, Uint8 g2, Uint8 b2)
Draws a horizontal line from (x1,y) to (x2,y) with its color faded from (r1,g1,b1) to (r2,g2,b2).


void sge_TexturedLine(SDL_Surface *dest, Sint16 x1, Sint16 x2, Sint16 y, SDL_Surface *source, Sint16 sx1, Sint16 sy1, Sint16 sx2, Sint16 sy2)
Draws a horizontal line from (x1,y) to (x2,y) on dest with the texture from the line (sx1,sy1) to (sx2,sy2) in src.


sge_Trigon
Draws a triangle.



sge_FilledTrigon
Draws a filled triangle. Note that if using sge_FilledTrigon() on a HW surface then the surface must be unlocked.



void sge_FadedTrigon(SDL_Surface *dest, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 c1, Uint32 c2, Uint32 c3)
Draws a gourand shaded triangle where c1, c2 and c3 are the colors of the three vertices.


void sge_TexturedTrigon(SDL_Surface *dest, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, SDL_Surface *source, Sint16 sx1, Sint16 sy1, Sint16 sx2, Sint16 sy2, Sint16 sx3, Sint16 sy3)
Draws a texture mapped triangle (p1,p2,p3) on dest with the texture from the triangle (sp1,sp2,sp3) on src.


void sge_TexturedRect(SDL_Surface *dest, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Sint16 x4, Sint16 y4, SDL_Surface *source, Sint16 sx1, Sint16 sy1, Sint16 sx2, Sint16 sy2, Sint16 sx3, Sint16 sy3, Sint16 sx4, Sint16 sy4)
Draws a texture mapped rectangle (p1,p2,p3,p4) on dest with the texture from the rectangle (sp1,sp2,sp3,sp4) on src.


sge_FilledPolygon
Draws a filled polygon. Takes the arrays x[] and y[] with n elements as an argument where (x[i], y[i]) is the i:th vertex in the polygon. The last vertex, (x[n-1], y[n-1]), is automatically connected to the first, (x[0], y[0]), to close the polygon. Manages to fill most nonconvex, convex and complex polygons correctly but might be confused by extremly complex polygons, so don't push your luck. Note that sge_FilledPolygon() and sge_AAFilledPolygon() (and sge_FilledPolygonAlpha() if using opaque alpha value) must be able to control surface locking.

Returns int:
Zero - Operation finished OK.
-1 - Polygon rejected because n<3 or negative coords in arrays (the polygon might be halfdrawn).
-2 - Unable to lock surface.



sge_FadedPolygon
As sge_FilledPolygon() but draws a gourand shaded polygon where (R[i], G[i], B[i]) is the color of the i:th vertex. Note that the shading is done on each y-line so some care is needed with the RGB values when working with complex polygons.





Copyright © 1999-2003 Anders Lindström
Last updated 030806