Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2001 18:50:13 +0100
From:      Nicolas Souchu <nsouch@alcove.fr>
To:        Maxim Sobolev <sobomax@FreeBSD.org>
Cc:        current@FreeBSD.org, sos@FreeBSD.org
Subject:   Re: [RFC] New features for libvgl
Message-ID:  <20010124185013.G12375@ontario.alcove-int>
In-Reply-To: <3A6C7FBF.251B4C89@FreeBSD.org>; from sobomax@FreeBSD.org on Mon, Jan 22, 2001 at 08:45:19PM %2B0200
References:  <3A6C7FBF.251B4C89@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010124185013.G12375>