comparison include/SDL_surface.h @ 3596:f638ded38b8a

Added SDL_RenderClear() as a fast method of clearing the screen to the drawing color. Renamed SDL_RenderPoint() and SDL_RenderLine() to SDL_RenderDrawPoint() and SDL_RenderDrawLine(). Added API for rectangle drawing (as opposed to filling) Added placeholder API functions for circles and ellipses ... I'm not sure whether these will stay. Optimized software line drawing quite a bit. Added support for Wu's anti-aliased line drawing, currently disabled by default.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 23 Dec 2009 01:55:00 +0000
parents b931bcfd94a0
children f7b03b6838cb
comparison
equal deleted inserted replaced
3595:b7c6828d4039 3596:f638ded38b8a
409 (SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); 409 (SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
410 410
411 /** 411 /**
412 * Blends a point with an RGBA value. 412 * Blends a point with an RGBA value.
413 * 413 *
414 * The color should be a pixel of the format used by the surface, and 414 * \return 0 on success, or -1 on error.
415 * can be generated by the SDL_MapRGB() function. 415 */
416 * 416 extern DECLSPEC int SDLCALL SDL_BlendPoint
417 * \return 0 on success, or -1 on error.
418 */
419 extern DECLSPEC int SDLCALL SDL_BlendDrawPoint
420 (SDL_Surface * dst, int x, int y, 417 (SDL_Surface * dst, int x, int y,
421 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 418 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
422 extern DECLSPEC int SDLCALL SDL_BlendPoints 419 extern DECLSPEC int SDLCALL SDL_BlendPoints
423 (SDL_Surface * dst, const SDL_Point * points, int count, 420 (SDL_Surface * dst, const SDL_Point * points, int count,
424 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 421 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
462 (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); 459 (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
463 extern DECLSPEC int SDLCALL SDL_DrawRects 460 extern DECLSPEC int SDLCALL SDL_DrawRects
464 (SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color); 461 (SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color);
465 462
466 /** 463 /**
467 * Blends the given rectangle with \c color. 464 * Blends an RGBA value into the outline of the given rectangle.
468 * 465 *
469 * If \c rect is NULL, the whole surface will have a blended outline of \c color. 466 * If \c rect is NULL, the whole surface will have a blended outline.
470 * 467 *
471 * \return 0 on success, or -1 on error. 468 * \return 0 on success, or -1 on error.
472 */ 469 */
473 extern DECLSPEC int SDLCALL SDL_BlendRect 470 extern DECLSPEC int SDLCALL SDL_BlendRect
474 (SDL_Surface * dst, const SDL_Rect * rect, 471 (SDL_Surface * dst, const SDL_Rect * rect,
493 (SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color); 490 (SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color);
494 491
495 /** 492 /**
496 * Blends an RGBA value into the given rectangle. 493 * Blends an RGBA value into the given rectangle.
497 * 494 *
498 * If \c rect is NULL, the whole surface will be blended with \c color. 495 * If \c rect is NULL, the whole surface will be blended with the color.
499 * 496 *
500 * \return This function returns 0 on success, or -1 on error. 497 * \return This function returns 0 on success, or -1 on error.
501 */ 498 */
502 extern DECLSPEC int SDLCALL SDL_BlendFillRect 499 extern DECLSPEC int SDLCALL SDL_BlendFillRect
503 (SDL_Surface * dst, const SDL_Rect * rect, 500 (SDL_Surface * dst, const SDL_Rect * rect,
504 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 501 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
505 extern DECLSPEC int SDLCALL SDL_BlendFillRects 502 extern DECLSPEC int SDLCALL SDL_BlendFillRects
506 (SDL_Surface * dst, const SDL_Rect ** rects, int count, 503 (SDL_Surface * dst, const SDL_Rect ** rects, int count,
507 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 504 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
505
506 #if 0
507 /**
508 * Draws the given circle with \c color.
509 *
510 * The color should be a pixel of the format used by the surface, and
511 * can be generated by the SDL_MapRGB() function.
512 *
513 * \return 0 on success, or -1 on error.
514 */
515 extern DECLSPEC int SDLCALL SDL_DrawCircle
516 (SDL_Surface * dst, int x, int y, int radius, Uint32 color);
517
518 /**
519 * Blends an RGBA value into the outline of the given circle.
520 *
521 * \return 0 on success, or -1 on error.
522 */
523 extern DECLSPEC int SDLCALL SDL_BlendCircle
524 (SDL_Surface * dst, int x, int y, int radius,
525 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
526
527 /**
528 * Fills the given circle with \c color.
529 *
530 * The color should be a pixel of the format used by the surface, and
531 * can be generated by the SDL_MapRGB() function.
532 *
533 * \return 0 on success, or -1 on error.
534 */
535 extern DECLSPEC int SDLCALL SDL_FillCircle
536 (SDL_Surface * dst, int x, int y, int radius, Uint32 color);
537
538 /**
539 * Blends an RGBA value into the given circle.
540 *
541 * \return This function returns 0 on success, or -1 on error.
542 */
543 extern DECLSPEC int SDLCALL SDL_BlendFillCircle
544 (SDL_Surface * dst, int x, int y, int radius,
545 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
546
547 /**
548 * Draws the given ellipse with \c color.
549 *
550 * The color should be a pixel of the format used by the surface, and
551 * can be generated by the SDL_MapRGB() function.
552 *
553 * \return 0 on success, or -1 on error.
554 */
555 extern DECLSPEC int SDLCALL SDL_DrawEllipse
556 (SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
557
558 /**
559 * Blends an RGBA value into the outline of the given ellipse.
560 *
561 * \return 0 on success, or -1 on error.
562 */
563 extern DECLSPEC int SDLCALL SDL_BlendEllipse
564 (SDL_Surface * dst, int x, int y, int w, int h,
565 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
566
567 /**
568 * Fills the given ellipse with \c color.
569 *
570 * The color should be a pixel of the format used by the surface, and
571 * can be generated by the SDL_MapRGB() function.
572 *
573 * \return 0 on success, or -1 on error.
574 */
575 extern DECLSPEC int SDLCALL SDL_FillEllipse
576 (SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
577
578 /**
579 * Blends an RGBA value into the given ellipse.
580 *
581 * \return This function returns 0 on success, or -1 on error.
582 */
583 extern DECLSPEC int SDLCALL SDL_BlendFillEllipse
584 (SDL_Surface * dst, int x, int y, int w, int h,
585 int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
586 #endif // 0
508 587
509 /** 588 /**
510 * Performs a fast blit from the source surface to the destination surface. 589 * Performs a fast blit from the source surface to the destination surface.
511 * 590 *
512 * This assumes that the source and destination rectangles are 591 * This assumes that the source and destination rectangles are