Re: [AD] Windowed grabber?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 22 September 2002 21:05, Evert Glebbeek wrote:
> The second.

OK, patch attached. It's pretty trivial. It adds a new commandline 
option, "-windowed", which uses GFX_AUTODETECT_WINDOWED.

> IMHO, the grabber is a program that uses Allegro just as
> any other. It just has the good fortune of being distributed with
> Allegro and being maintained along side it, but that doesn't really
> give it the privilige to claim it's own section in allegro.cfg ;-)

It already has one, doesn't it?

> I also sortof like the way I have it working now, but that, I fear,
> is too platform specific.

Well, as long as you are using get_executable_name(), what's the 
problem?

Bye for now,
- -- 
Laurence Withers,  lwithers@xxxxxxxxxx
(GnuPG 04A646EA) http://www.lwithers.demon.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9jkKKUdhclgSmRuoRAtjMAKCduAuAZ0if+XPQbnojpQyXTNYbpgCeMAZg
GR0ZuuiRw1myp0q0Md2A7bg=
=J8ec
-----END PGP SIGNATURE-----
--- grabber.c.orig	Sun Sep 22 23:17:58 2002
+++ grabber.c	Sun Sep 22 23:17:00 2002
@@ -3144,6 +3144,7 @@
    int bpp = -1;
    int w = 640;
    int h = 480;
+   int card = GFX_AUTODETECT;
    char *s, tmp[256];
    char *fname = NULL;
    static int color_depths[] = { 32, 16, 15, 8, 0 };
@@ -3156,6 +3157,9 @@
 	 if (strcmp(argv[i]+1, "nosound") == 0) {
 	    no_sound = TRUE;
 	 }
+	 else if (strcmp(argv[i]+1, "windowed") == 0) {
+	    card = GFX_AUTODETECT_WINDOWED;
+	 }
 	 else if ((argv[i][1] == 'p') || (argv[i][1] == 'P')) {
 	    strcpy(password, argv[i]+2);
 	    entered_password = TRUE;
@@ -3203,13 +3207,13 @@
 
    if (bpp > 0) {
       set_color_depth(bpp);
-      ret = set_gfx_mode(GFX_AUTODETECT, w, h, 0, 0);
+      ret = set_gfx_mode(card, w, h, 0, 0);
    }
    else {
       for (i=0; color_depths[i]; i++) {
 	 bpp = color_depths[i];
 	 set_color_depth(bpp);
-	 ret = set_gfx_mode(GFX_AUTODETECT, w, h, 0, 0);
+	 ret = set_gfx_mode(card, w, h, 0, 0);
 	 if (ret == 0)
 	    break;
       }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/