From owner-freebsd-current Wed Jan 24 9:50:35 2001 Delivered-To: freebsd-current@freebsd.org Received: from smtp.alcove.fr (smtp.alcove.fr [212.155.209.139]) by hub.freebsd.org (Postfix) with ESMTP id B31F137B400; Wed, 24 Jan 2001 09:50:15 -0800 (PST) Received: from nsouch by smtp.alcove.fr with local (Exim 3.12 #1 (Debian)) id 14LU3h-0004Nc-00; Wed, 24 Jan 2001 18:50:13 +0100 Date: Wed, 24 Jan 2001 18:50:13 +0100 From: Nicolas Souchu To: Maxim Sobolev Cc: current@FreeBSD.org, sos@FreeBSD.org Subject: Re: [RFC] New features for libvgl Message-ID: <20010124185013.G12375@ontario.alcove-int> References: <3A6C7FBF.251B4C89@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.4i In-Reply-To: <3A6C7FBF.251B4C89@FreeBSD.org>; from sobomax@FreeBSD.org on Mon, Jan 22, 2001 at 08:45:19PM +0200 Organization: =?iso-8859-1?Q?Alc=F4ve=2C_http:=2F=2Fwww=2Ealcove=2Efr?= Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Jan 22, 2001 at 08:45:19PM +0200, Maxim Sobolev wrote: > Hi folks, > > Now I'm in process of writing a libvgl driver for SDL (almost finished - I'm > testing it right now) and found that two handy features are currently missed > from the libvgl: ability to query video modes supported by the video hardware > and ability to install custom mouse eventhandler. So I extended libvgl > attaching patches with this message. I would like that someone review/comment > attached patches. Please also note that VGLListModes() part of these patches > are not optimal right now (it largely duplicates VGLInit()), so please > concentrate on concept rather than on implementation details. Isn't your list of modes redundant with the internal data structures of the VGA/VESA driver? Why do you list modes if it's not to query a specific one? This is how I query the console (note that I planned to add it to VGL): memset(&modeinfo, 0, sizeof(modeinfo)); switch(gt) { case GT_1BIT : modeinfo.vi_depth = 1; break; case GT_4BIT : modeinfo.vi_depth = 4; break; case GT_8BIT : modeinfo.vi_depth = 8; break; case GT_16BIT: modeinfo.vi_depth = 16; break; case GT_32BIT: modeinfo.vi_depth = 32; break; /* Unsupported mode depths */ case GT_15BIT: case GT_24BIT: default: return -1; } modeinfo.vi_width = tm->visible.x; modeinfo.vi_height = tm->visible.y; /* XXX should be added to libvgl */ if (ioctl(0, FBIO_FINDMODE, &modeinfo)) return -1; GGIDPRINT("Setting VGLlib mode %d (0x%x)\n", modeinfo.vi_mode, modeinfo.vi_mode); /* Terminate any current mode before initialising another */ if (priv->vgl_init_done) { priv->vgl_init_done = 0; VGLEnd(); } /* XXX should be in VGL */ if ((modeinfo.vi_mode >= M_B40x25) && (modeinfo.vi_mode <= M_VGA_M90x60) ) modenum = _IO('S', modeinfo.vi_mode); if ((modeinfo.vi_mode >= M_TEXT_80x25) && (modeinfo.vi_mode <= M_TEXT_13 2x60)) modenum = _IO('S', modeinfo.vi_mode); if ((modeinfo.vi_mode >= M_VESA_CG640x400) && (modeinfo.vi_mode <= M_VESA_FULL_1280)) modenum = _IO('V', modeinfo.vi_mode - M_VESA_BASE); if ((err = VGLInit(modenum)) != 0) { GGIDPRINT("display-vgl: setting mode 0x%x failed with error %d\n ", modeinfo.vi_mode, err); return GGI_EFATAL; } ++++++++++++++++++++++++ About the mouse stuff, what is the exact usage of MousePointerShow? It's not documented in the manpage. Nicholas -- Nicolas.Souchu@alcove.fr Alcôve - Open Source Software Engineer - http://www.alcove.fr To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message