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:
                        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;
        /* 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
                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.


Alcôve - Open Source Software Engineer - http://www.alcove.fr

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to