This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via a74fce450b62265d5dc4b80f43a89bfeb570e271 (commit) from 8701e8765185f90507ff6a02c03fcf0c22ae1e8f (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/a74fce450b62265d5dc4b80f43a89bfeb570e...
commit a74fce450b62265d5dc4b80f43a89bfeb570e271 Author: Cyril Hrubis metan@ucw.cz Date: Tue Oct 30 22:25:02 2012 +0100
tests: Remove pixeltests.
diff --git a/tests/SDL/Makefile b/tests/SDL/Makefile index 6985861..35a76e1 100644 --- a/tests/SDL/Makefile +++ b/tests/SDL/Makefile @@ -7,7 +7,7 @@ LDLIBS+=-lGP -L$(TOPDIR)/build/ -lGP_SDL -lSDL ifeq ($(HAVE_LIBSDL),yes) CSOURCES=$(shell echo *.c)
-APPS=pixeltest fonttest+APPS=fonttest symbolstest textaligntest blittest subcontext aatest mixpixeltest endif diff --git a/tests/SDL/pixeltest.c b/tests/SDL/pixeltest.c deleted file mode 100644 index 6d7ccf0..0000000 --- a/tests/SDL/pixeltest.c +++ /dev/null @@ -1,169 +0,0 @@ -/***************************************************************************** - * This file is part of gfxprim library. * - * * - * Gfxprim is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * Gfxprim is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with gfxprim; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - -#include <stdio.h> -#include <stdlib.h> -#include <SDL/SDL.h> - -#include "GP.h" -#include "GP_SDL.h" - -/* The surface used as a display (in fact it is a software surface). */ -SDL_Surface *display = NULL; -GP_Context context; - -/* Timer used for refreshing the display */ -SDL_TimerID timer; - -/* An event used for signaling that the timer was triggered. */ -SDL_UserEvent timer_event; - -/* Values for color pixels in display format. */ -GP_Pixel red_pixel, green_pixel, blue_pixel, white_pixel; - -Uint32 timer_callback(__attribute__((unused)) Uint32 interval, - __attribute__((unused)) void *param) -{ - timer_event.type = SDL_USEREVENT; - SDL_PushEvent((SDL_Event *) &timer_event); - return 30; -} - -void draw_pixel(void) -{ - GP_Pixel pixel; - int x = random() % 320; - int y = random() % 240; - - pixel = GP_GetPixel(&context, x, y); - - if (pixel == blue_pixel) { - GP_PutPixel(&context, x, y, green_pixel); - } - else if (pixel == red_pixel) { - GP_PutPixel(&context, x, y, white_pixel); - } - else { - if (x < 160) { - GP_PutPixel(&context, x, y, blue_pixel); - } else { - GP_PutPixel(&context, x, y, red_pixel); - } - } -} - -void draw_pixels(void) -{ - SDL_LockSurface(display); - - /* Draw some pixels (exact number is not important). */ - int i; - for (i = 0; i < 30; i++) - draw_pixel(); - - SDL_UnlockSurface(display); -} - -void event_loop(void) -{ - SDL_Event event; - - while (SDL_WaitEvent(&event) > 0) { - switch (event.type) { - case SDL_USEREVENT: - draw_pixels(); - SDL_Flip(display); - break; - case SDL_KEYDOWN: - case SDL_QUIT: - return; - } - } -} - -int main(int argc, char **argv) -{ - int display_bpp = 0; - - int i; - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-16") == 0) { - display_bpp = 16; - } else if (strcmp(argv[i], "-24") == 0) { - display_bpp = 24; - } - } - - /* Initialize SDL */ - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) { - fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError()); - return 1; - } - - /* Create a window with a software back surface */ - display = SDL_SetVideoMode(320, 240, display_bpp, SDL_SWSURFACE); - if (display == NULL) { - fprintf(stderr, "Could not open display: %sn", SDL_GetError()); - goto fail; - } - - - /* Print basic information about the surface */ - printf("Display surface properties:n"); - printf(" width: %4d, height: %4d, pitch: %4dn", - display->w, display->h, display->pitch); - printf(" bits per pixel: %2d, bytes per pixel: %2dn", - display->format->BitsPerPixel, display->format->BytesPerPixel); - - /* Set up a clipping rectangle to test proper clipping of pixels */ - SDL_Rect clip_rect = {10, 10, 300, 220}; - SDL_SetClipRect(display, &clip_rect); - - GP_SDL_ContextFromSurface(&context, display); - - /* Load pixel values compatible with the display. */ - red_pixel = GP_ColorToContextPixel(GP_COL_RED, &context); - green_pixel = GP_ColorToContextPixel(GP_COL_GREEN, &context); - blue_pixel = GP_ColorToContextPixel(GP_COL_BLUE, &context); - white_pixel = GP_ColorToContextPixel(GP_COL_WHITE, &context); - - /* Set up the refresh timer */ - timer = SDL_AddTimer(30, timer_callback, NULL); - if (timer == 0) { - fprintf(stderr, "Could not set up timer: %sn", SDL_GetError()); - goto fail; - } - - /* Enter the event loop */ - event_loop(); - - /* We're done */ - SDL_Quit(); - return 0; - -fail: - SDL_Quit(); - return 1; -}
-----------------------------------------------------------------------
Summary of changes: tests/SDL/Makefile | 2 +- tests/SDL/pixeltest.c | 169 ------------------------------------------------- 2 files changed, 1 insertions(+), 170 deletions(-) delete mode 100644 tests/SDL/pixeltest.c
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.