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 b42a87dcb2eda0fafe87007fa07ec19b6398a732 (commit) via 7122d44b503fdf8c67ea49a43b10f8b75e809b36 (commit) via 3de5653e6ed7557d6da57722d06da74a24652eee (commit) via 8415a829b152c199267addf477236da77ca297f5 (commit) from ec2f0bf1e1633bd1b8e4eae76f6c99b4ffe067a5 (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/b42a87dcb2eda0fafe87007fa07ec19b6398a...
commit b42a87dcb2eda0fafe87007fa07ec19b6398a732 Author: Cyril Hrubis metan@ucw.cz Date: Mon Dec 3 19:24:30 2012 +0100
spiv: Add -h help option, yay!
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c index a569429..abe7395 100644 --- a/demos/spiv/spiv.c +++ b/demos/spiv/spiv.c @@ -565,6 +565,53 @@ static void init_caches(struct loader_params *params) // params->img_orig_cache = NULL; }
+static void print_help(void) +{ + printf("Usage: spiv [opts] imagesnn"); + printf("-Intshow image info (filename and size)nn"); + printf("-Pntshow loading progressnn"); + printf("-fntuse floyd-steinberg ditheringnn"); + printf("-s secntsleep interval in secondsnn"); + printf("-cntturns on bicubic resampling (experimental)nn"); + printf("-d levelntsets GFXprim debug levelnn"); + printf("-e pixel_typentturns on backend type emulationn"); + printf("tfor example -e G1 sets 1-bit grayscalenn"); + printf("-r anglentrotate display 90,180 or 270 degreesnn"); + printf("-bntpass backend init string to backend initn"); + printf("tpass -b help for more infonn"); + + printf("Keyboard control:nn"); + printf("I - toggle show infon"); + printf("P - toggle show progressn"); + printf("R - rotate by 90 degreesn"); + printf("] - change to next resampling methodn"); + printf("[ - change to prev resampling methodn"); + printf(" (current method is shown in infon"); + printf("L - toggle low pass filtern"); + printf("D - drop image cachen"); + printf("nEscn"); + printf("Entern"); + printf("Q - quit spivnn"); + printf("PgDown - move ten image forwardn"); + printf("PgUp - move ten image backwardn"); + printf("nRightn"); + printf("Upn"); + printf("Space - move to the next imagen"); + printf("nLeftn"); + printf("Downn"); + printf("BckSpc - move to the prev imagen"); + printf("n"); + + printf("Some cool options to try:nn"); + printf("spiv -e G1 -f imagesn"); + printf("truns spiv in 1-bit bitmap mode and turns on ditheringnn"); + printf("spiv -b 'X11:ROOT_WIN' imagesn"); + printf("truns spiv using X root window as backend windownn"); + printf("spiv -b 'X11:CREATE_ROOT' imagesn"); + printf("tSame as abowe but works in KDEn"); + +} + int main(int argc, char *argv[]) { GP_Context *context = NULL; @@ -588,7 +635,7 @@ int main(int argc, char *argv[]) .img_orig_cache = NULL, };
- while ((opt = getopt(argc, argv, "b:cd:e:fIPs:r:")) != -1) { + while ((opt = getopt(argc, argv, "b:cd:e:fhIPs:r:")) != -1) { switch (opt) { case 'I': params.show_info = 1; @@ -630,8 +677,14 @@ int main(int argc, char *argv[]) case 'b': backend_opts = optarg; break; + case 'h': + print_help(); + exit(0); + break; default: fprintf(stderr, "Invalid paramter '%c'n", opt); + print_help(); + return 1; } }
http://repo.or.cz/w/gfxprim.git/commit/7122d44b503fdf8c67ea49a43b10f8b75e809...
commit 7122d44b503fdf8c67ea49a43b10f8b75e809b36 Author: Cyril Hrubis metan@ucw.cz Date: Mon Dec 3 19:23:37 2012 +0100
backends: Add CREATE_ROOT to backend init docs.
diff --git a/libs/backends/GP_BackendInit.c b/libs/backends/GP_BackendInit.c index 31fd3bf..0b04407 100644 --- a/libs/backends/GP_BackendInit.c +++ b/libs/backends/GP_BackendInit.c @@ -134,9 +134,11 @@ static void backend_x11_help(FILE *help, const char *err)
fprintf(help, "X11 backendn" "--------------n" - "X11:WxH:[ROOT_WIN]nn" - "ROOT_WIN - starts the backend in the root windown" - " (w and h, if set, are ignored)n"); + "X11:[WxH]:[ROOT_WIN]:[CREATE_ROOT]nn" + "ROOT_WIN - starts the backend in the root windown" + " (w and h, if set, are ignored)n" + "CREATE_ROOT - starts the backend in newly createdn" + " root window (w and h, if set, are ignored)n"); }
static int x11_params_to_flags(const char *param, GP_Size *w, GP_Size *h,
http://repo.or.cz/w/gfxprim.git/commit/3de5653e6ed7557d6da57722d06da74a24652...
commit 3de5653e6ed7557d6da57722d06da74a24652eee Author: Cyril Hrubis metan@ucw.cz Date: Mon Dec 3 17:39:17 2012 +0100
doc: Add GP_ContextFromSurface() docs and example.
diff --git a/doc/backends.txt b/doc/backends.txt index a471652..86d5d51 100644 --- a/doc/backends.txt +++ b/doc/backends.txt @@ -1,19 +1,21 @@ Drawing Backends ----------------- +================
-Drawing backends provide means to draw into computer screen or into an window +Drawing backends provide means to draw into computer screen or into a window inside of running operating system. Instead of having one unified initialization interface each backend has it's specific function and semantics but once backend is initialized the backend structure provides unified API for controlling the drawing.
-So far there are three backends implemented, Linux mmaped frame-buffer, libSDL -and X11 backend. +So far there are backends for Linux mmaped frame-buffer, libSDL and X11.
For example usage see backend link:example_backend.html[example].
Initialization functions -~~~~~~~~~~~~~~~~~~~~~~~ +------------------------ + +Linux Framebuffer +~~~~~~~~~~~~~~~~~
[source,c] ------------------------------------------------------------------------------- @@ -28,6 +30,10 @@ If flag is set console KBD driver is used to feed keystrokes into the event queue, otherwise no events are generated and you are expected to initialize input event driver in order to get keystrokes and/or pointer events.
+ +SDL +~~~ + [source,c] ------------------------------------------------------------------------------- enum GP_BackendSDLFlags { @@ -40,10 +46,10 @@ GP_Backend *GP_BackendSDLInit(GP_Size w, GP_Size h, const char *caption); -------------------------------------------------------------------------------
-Initialize SDL as an backend driver. The backend is thread safe as all the +Initialize 'SDL' as an backend driver. The backend is thread safe as all the operations are guarded by locks.
-You can't initialize more than one backend at a time, which is inherited SDL +You can't initialize more than one backend at a time, which is inherited 'SDL' limitation. If you call the initialization for a second time, you will get a pointer to already running backend.
@@ -58,6 +64,26 @@ The caption is window caption. And finally flags may change the SDL to go to full-screen mode or make the window resizable.
+ +[source,c] +------------------------------------------------------------------------------- +#include <backends/GP_SDL_Context.h> + +int GP_ContextFromSurface(GP_Context *c, const SDL_Surface *surf); +------------------------------------------------------------------------------- + +This function allows you to mix 'SDL' and 'GFXprim' code. The functions +initializes the context from 'SDL' surface using the pixel buffer from surface +as pixel buffer for the context. + +Function returns zero on succes and non-zero on failure (There is no GFXprim +pixel type to match given surface). + +For example usage see 'SDL' glue link:example_SDL_glue.html[example]. + +X server +~~~~~~~~ + [source,c] ------------------------------------------------------------------------------- enum GP_BackendX11Flags { @@ -73,9 +99,9 @@ GP_Backend *GP_BackendX11Init(const char *display, int x, int y, enum GP_BackendX11Flags flags); -------------------------------------------------------------------------------
-Returns pointer to initialized X11 backend or in case of failure NULL. +Returns pointer to initialized X11 backend or in case of failure 'NULL'.
-When display is NULL default display is used (which is what you want most of the +When display is 'NULL' default display is used (which is what you want most of the time).
This backend feeds key events into global input queue. diff --git a/doc/example_SDL_glue.txt b/doc/example_SDL_glue.txt new file mode 100644 index 0000000..04ca2f9 --- /dev/null +++ b/doc/example_SDL_glue.txt @@ -0,0 +1,10 @@ +SDL Glue Example +---------------- + +You can easily mix SDL and GFXprim code using 'GP_ContextFromSurface()' +function. + +[source,c] +------------------------------------------------------------------ +include::../demos/c_simple/SDL_glue.c[] +------------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/8415a829b152c199267addf477236da77ca29...
commit 8415a829b152c199267addf477236da77ca297f5 Author: Cyril Hrubis metan@ucw.cz Date: Mon Dec 3 17:23:19 2012 +0100
libs,backends: Finally remove the obsolete SDL library.
It's functionality is replaced by exporting GP_ContextFromSurface() function from SDL backend.
diff --git a/demos/c_simple/Makefile b/demos/c_simple/Makefile index b30fc23..e64dda7 100644 --- a/demos/c_simple/Makefile +++ b/demos/c_simple/Makefile @@ -1,6 +1,14 @@ TOPDIR=../..
-CSOURCES=$(shell echo *.c) +include $(TOPDIR)/pre.mk + +SOURCES=$(shell echo *.c) + +ifneq ($(HAVE_LIBSDL),yes) +CSOURCES=$(filter-out SDL_glue.c,$(SOURCES)) +else +CSOURCES=$(SOURCES) +endif
INCLUDE= LDFLAGS+=-L$(TOPDIR)/build/ @@ -12,9 +20,12 @@ APPS=backend_example loaders_example loaders filters_symmetry gfx_koch fileview linetest randomshapetest fonttest loaders_register blittest textaligntest
+ifeq ($(HAVE_LIBSDL),yes) +APPS+=SDL_glue +endif + v4l2_show: LDLIBS+=-lGP_grabbers v4l2_grab: LDLIBS+=-lGP_grabbers
-include $(TOPDIR)/pre.mk include $(TOPDIR)/app.mk include $(TOPDIR)/post.mk diff --git a/libs/SDL/GP_SDL_Context.c b/demos/c_simple/SDL_glue.c similarity index 56% rename from libs/SDL/GP_SDL_Context.c rename to demos/c_simple/SDL_glue.c index cbe5ca4..3185b67 100644 --- a/libs/SDL/GP_SDL_Context.c +++ b/demos/c_simple/SDL_glue.c @@ -23,46 +23,94 @@ * * *****************************************************************************/
-#include "GP_Core.h" + /* + + This example shows how to mix SDL with GFXprim.
-#include "../../config.h" + */
-#ifdef HAVE_LIBSDL +#include <stdio.h> +#include <stdlib.h> +#include <SDL/SDL.h> +#include <GP.h> +#include <backends/GP_SDL_Context.h>
-#include "GP_SDL.h" +#define W 320 +#define H 240
-int GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf) +static SDL_Surface *display = NULL; +static GP_Context context; + +static GP_Pixel black_pixel, darkgray_pixel; + +void redraw_screen(void) { - if (surf == NULL || surf->pixels == NULL || context == NULL) - return 1; + SDL_LockSurface(display); + + GP_Fill(&context, black_pixel); + + GP_Line(&context, 0, 0, W-1, H-1, darkgray_pixel); + GP_Line(&context, 0, H-1, W-1, 0, darkgray_pixel); + + SDL_UnlockSurface(display); +} + +void event_loop(void) +{ + SDL_Event event; + + while (SDL_WaitEvent(&event) > 0) { + switch (event.type) {
- /* sanity checks on the SDL surface */ - if (surf->format->BytesPerPixel == 0 || surf->format->BytesPerPixel > 4) + case SDL_VIDEOEXPOSE: + redraw_screen(); + SDL_Flip(display); + break; + + case SDL_KEYDOWN: + switch (event.key.keysym.sym) { + case SDLK_ESCAPE: + return; + default: + break; + } + break; + + case SDL_QUIT: + return; + } + } +} + +int main(void) +{ + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) { + fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError()); return 1; + } + + display = SDL_SetVideoMode(W, H, 0, SDL_SWSURFACE); - enum GP_PixelType pixeltype = GP_PixelRGBMatch(surf->format->Rmask, - surf->format->Gmask, - surf->format->Bmask, - surf->format->Ashift, - surf->format->BitsPerPixel); + if (display == NULL) { + fprintf(stderr, "Could not open display: %sn", SDL_GetError()); + goto fail; + }
- if (pixeltype == GP_PIXEL_UNKNOWN) - return 1; + GP_ContextFromSurface(&context, display);
- /* basic structure and size */ - context->pixels = surf->pixels; - context->bpp = 8 * surf->format->BytesPerPixel; - context->pixel_type = pixeltype; - context->bytes_per_row = surf->pitch; - context->w = surf->w; - context->h = surf->h; + black_pixel = GP_ColorToContextPixel(GP_COL_BLACK, &context); + darkgray_pixel = GP_ColorToContextPixel(GP_COL_GRAY_DARK, &context);
- /* orientation */ - context->axes_swap = 0; - context->x_swap = 0; - context->y_swap = 0; + redraw_screen(); + SDL_Flip(display);
+ event_loop(); + + SDL_Quit(); return 0; + +fail: + SDL_Quit(); + return 1; }
-#endif /* HAVE_LIBSDL */ diff --git a/include/SDL/GP_SDL.h b/include/SDL/GP_SDL.h deleted file mode 100644 index d01bd1e..0000000 --- a/include/SDL/GP_SDL.h +++ /dev/null @@ -1,46 +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 * - * * - *****************************************************************************/ - -#ifndef GP_SDL_H -#define GP_SDL_H - -#include <SDL/SDL.h> - -#include "GP_SDL_Context.h" -#include "GP_SDL_VideoInit.h" - -#define GP_SDL_BYTES_PER_PIXEL(target) (target->format->BytesPerPixel) - -#define GP_SDL_BYTES_PER_LINE(target) (target->pitch) - -#define GP_SDL_PIXELS(target) ((uint8_t *)(target->pixels)) - -#define GP_SDL_PIXEL_ADDR(target, x, y) ( - GP_SDL_PIXELS(target) - + y * GP_SDL_BYTES_PER_LINE(target) - + x * GP_SDL_BYTES_PER_PIXEL(target) -) - -#endif /* GP_SDL_H */ diff --git a/include/SDL/GP_SDL_VideoInit.h b/include/SDL/GP_SDL_VideoInit.h deleted file mode 100644 index ad26c10..0000000 --- a/include/SDL/GP_SDL_VideoInit.h +++ /dev/null @@ -1,34 +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-2010 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - -#ifndef GP_SDL_VIDEOINIT_H -#define GP_SDL_VIDEOINIT_H - -#include "GP.h" - -int GP_SDL_VideoInit(GP_Context *context, int width, int height, - int argc, char **argv); - -#endif /* GP_SDL_VIDEOINIT_H */ diff --git a/include/SDL/README b/include/SDL/README deleted file mode 100644 index 37680b8..0000000 --- a/include/SDL/README +++ /dev/null @@ -1,2 +0,0 @@ -This code/interface is deprecated and will be removed after backends are -written. diff --git a/include/SDL/GP_SDL_Context.h b/include/backends/GP_SDL_Context.h similarity index 69% rename from include/SDL/GP_SDL_Context.h rename to include/backends/GP_SDL_Context.h index 5f27a4a..4ed5aad 100644 --- a/include/SDL/GP_SDL_Context.h +++ b/include/backends/GP_SDL_Context.h @@ -16,18 +16,34 @@ * 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-2010 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#ifndef GP_SDL_CONTEXT_H -#define GP_SDL_CONTEXT_H +#ifndef BACKENDS_GP_SDL_CONTEXT_H +#define BACKENDS_GP_SDL_CONTEXT_H
-#include "GP.h" +#include <SDL/SDL.h> +#include <core/GP_Context.h>
-int GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf); +/* + * This function lets you use GFXprim together with SDL. All you need to do + * is to initialize context from surface. The usage is as follows: + * + * ... + * + * GP_Context c; + * + * if (GP_ContextFromSurface(&c, surface)) { + * error("Failed to match PIXEL_TYPE for given surface"); + * exit(1); + * } + * + * ... + * + * Now you have initialized context that shares the pixel buffer with + * the SDL surface. + */ +int GP_ContextFromSurface(GP_Context *c, const SDL_Surface *surf);
-#endif /* GP_SDL_CONTEXT_H */ +#endif /* BACKENDS_GP_SDL_CONTEXT_H */ diff --git a/libs/Makefile b/libs/Makefile index 5fe3d19..6d4d023 100644 --- a/libs/Makefile +++ b/libs/Makefile @@ -1,3 +1,3 @@ TOPDIR=.. -SUBDIRS=core gfx text loaders filters input backends grabbers SDL +SUBDIRS=core gfx text loaders filters input backends grabbers include $(TOPDIR)/post.mk diff --git a/libs/SDL/GP_SDL_VideoInit.c b/libs/SDL/GP_SDL_VideoInit.c deleted file mode 100644 index b7462ff..0000000 --- a/libs/SDL/GP_SDL_VideoInit.c +++ /dev/null @@ -1,109 +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-2012 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - -#include "../../config.h" - -#ifdef HAVE_LIBSDL - -#include "GP.h" -#include "GP_SDL.h" - -#include <stdio.h> -#include <string.h> - -int GP_SDL_VideoInit(GP_Context *context, int width, int height, - int argc, char **argv) -{ - if (context == NULL) - return 1; - - /* switches that can be set on the command line */ - int display_bpp = 0; - int debug = 0; - - if (argc > 0) { - - if (argv == NULL) - return 1; - - /* extract settings from the command line */ - int i; - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "--8bpp") == 0) - display_bpp = 8; - else if (strcmp(argv[i], "--16bpp") == 0) - display_bpp = 16; - else if (strcmp(argv[i], "--24bpp") == 0) - display_bpp = 24; - else if (strcmp(argv[i], "--32bpp") == 0) - display_bpp = 32; - else if (strcmp(argv[i], "--debug") == 0) - debug = 1; - } - } - - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) { - if (debug) { - fprintf(stderr, "Error: Could not initialize SDL: %sn", - SDL_GetError()); - } - return 1; - } - - SDL_Surface *display = NULL; - display = SDL_SetVideoMode(width, height, display_bpp, SDL_SWSURFACE); - if (display == NULL) { - if (debug) { - fprintf(stderr, "Error: Unable to set video mode: %sn", - SDL_GetError()); - } - SDL_Quit(); - return 1; - } - - if (debug) { - printf("Display 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); - printf(" pixel bit masks: R=%x, G=%x, B=%x, A=%xn", - display->format->Rmask, display->format->Gmask, - display->format->Bmask, display->format->Amask); - } - - int retcode = GP_SDL_ContextFromSurface(context, display); - if (retcode != 0) { - if (debug) { - fprintf(stderr, "Error: Could not create context"); - } - SDL_Quit(); - return retcode; - } - - return 0; -} - -#endif /* HAVE_LIBSDL */ diff --git a/libs/SDL/Makefile b/libs/SDL/Makefile deleted file mode 100644 index 637277c..0000000 --- a/libs/SDL/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -TOPDIR=../.. -CSOURCES=$(shell ls *.c) -INCLUDE=core -LIBNAME=SDL -BUILDLIB=yes - -include $(TOPDIR)/pre.mk -include $(TOPDIR)/lib.mk -include $(TOPDIR)/post.mk diff --git a/libs/backends/GP_SDL.c b/libs/backends/GP_SDL.c index 2602a2d..0faff30 100644 --- a/libs/backends/GP_SDL.c +++ b/libs/backends/GP_SDL.c @@ -33,6 +33,8 @@ #include "GP_Backend.h" #include "GP_SDL.h"
+#include "GP_SDL_Context.h" + #include <SDL/SDL.h> #include <SDL/SDL_mutex.h>
@@ -97,7 +99,7 @@ static void sdl_wait(struct GP_Backend *self __attribute__((unused))) SDL_mutexV(mutex); }
-int context_from_surface(GP_Context *context, SDL_Surface *surf) +static int context_from_surface(GP_Context *context, const SDL_Surface *surf) { /* sanity checks on the SDL surface */ if (surf->format->BytesPerPixel == 0) { @@ -130,6 +132,11 @@ int context_from_surface(GP_Context *context, SDL_Surface *surf) return 0; }
+int GP_ContextFromSurface(GP_Context *c, const SDL_Surface *surf) +{ + return context_from_surface(c, surf); +} + static int sdl_set_attributes(struct GP_Backend *self __attribute__((unused)), uint32_t w, uint32_t h, const char *caption)
-----------------------------------------------------------------------
Summary of changes: demos/c_simple/Makefile | 15 +++- .../GP_SDL_Context.c => demos/c_simple/SDL_glue.c | 104 ++++++++++++++----- demos/spiv/spiv.c | 55 ++++++++++- doc/backends.txt | 44 ++++++-- doc/example_SDL_glue.txt | 10 ++ include/SDL/GP_SDL.h | 46 -------- include/SDL/GP_SDL_Context.h | 33 ------ include/SDL/GP_SDL_VideoInit.h | 34 ------ include/SDL/README | 2 - .../common.h => include/backends/GP_SDL_Context.h | 29 ++++- libs/Makefile | 2 +- libs/SDL/GP_SDL_VideoInit.c | 109 -------------------- libs/SDL/Makefile | 9 -- libs/backends/GP_BackendInit.c | 8 +- libs/backends/GP_SDL.c | 9 ++- 15 files changed, 225 insertions(+), 284 deletions(-) rename libs/SDL/GP_SDL_Context.c => demos/c_simple/SDL_glue.c (56%) create mode 100644 doc/example_SDL_glue.txt delete mode 100644 include/SDL/GP_SDL.h delete mode 100644 include/SDL/GP_SDL_Context.h delete mode 100644 include/SDL/GP_SDL_VideoInit.h delete mode 100644 include/SDL/README copy tests/gfx/common.h => include/backends/GP_SDL_Context.h (73%) delete mode 100644 libs/SDL/GP_SDL_VideoInit.c delete mode 100644 libs/SDL/Makefile
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.