Made it possible to disable the rendering subsystem with configure --disable-render
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2010 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "SDL_config.h"
24 #if !SDL_RENDER_DISABLED
27 #include "SDL_drawpoint.h"
31 SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color)
34 SDL_SetError("Passed NULL destination surface");
38 /* This function doesn't work on surfaces < 8 bpp */
39 if (dst->format->BitsPerPixel < 8) {
40 SDL_SetError("SDL_DrawPoint(): Unsupported surface format");
44 /* Perform clipping */
45 if (x < dst->clip_rect.x || y < dst->clip_rect.y ||
46 x >= (dst->clip_rect.x + dst->clip_rect.w) ||
47 y >= (dst->clip_rect.y + dst->clip_rect.h)) {
51 switch (dst->format->BytesPerPixel) {
53 DRAW_FASTSETPIXELXY1(x, y);
56 DRAW_FASTSETPIXELXY2(x, y);
62 DRAW_FASTSETPIXELXY4(x, y);
69 SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count,
78 SDL_SetError("Passed NULL destination surface");
82 /* This function doesn't work on surfaces < 8 bpp */
83 if (dst->format->BitsPerPixel < 8) {
84 SDL_SetError("SDL_DrawPoints(): Unsupported surface format");
88 minx = dst->clip_rect.x;
89 maxx = dst->clip_rect.x + dst->clip_rect.w - 1;
90 miny = dst->clip_rect.y;
91 maxy = dst->clip_rect.y + dst->clip_rect.h - 1;
93 for (i = 0; i < count; ++i) {
97 if (x < minx || x > maxx || y < miny || y > maxy) {
101 switch (dst->format->BytesPerPixel) {
103 DRAW_FASTSETPIXELXY1(x, y);
106 DRAW_FASTSETPIXELXY2(x, y);
112 DRAW_FASTSETPIXELXY4(x, y);
119 #endif /* !SDL_RENDER_DISABLED */
121 /* vi: set ts=4 sw=4 expandtab: */