How to use Voodoo in a window
Normally this is only possible with Voodoo Rush cards, but the Quake Editor ED3D was doing it with a regular 3dfx card. 

How did ED3D do the trick? I found the following method working:


  • Initialize Glide.
  • You may want to switch off the 3d display with: grSstControl(GR_CONTROL_DEACTIVATE);
  • Render something using the 3dfx hardware.
  • Then: 
        GrLfbInfo_t     info; 
        char                 scrbuf[640*480*2];  // Where we want the screen to be stored
        // Lock the surface:
        if ( grLfbLock( GR_LFB_READ_ONLY,
               GR_BUFFER_FRONTBUFFER,
               GR_LFBWRITEMODE_ANY,
               GR_ORIGIN_ANY,
               FXFALSE,
                &info)) {
               FxU32        *rptr = info.lfbPtr; // Pointer to the 3dfx screen
               char            *scrbufptr = scrbuf;
               int                stride = info.strideInBytes>>2;
               int                y = 480

                while (--y) {
                       memcpy(scrbufptr, rptr, 640*2);
                        rptr += stride; 
                        scrbufptr += 640*2;
                        } 
                // Unlock the surface:
                grLfbUnlock( GR_LFB_READ_ONLY, GR_BUFFER_FRONTBUFFER );
                 } 



Now, in 'scrbuf' you have a 16bit 640x480 screen that is 3dfx-rendered. 

You can blit it to screen in VESA 640x480x64k mode, or reduce it in size and then blit it, or store it to a file, or whatever.



Working windowed example here. (DOS, needs VESA VBE 2.0, doesn't work on a Banshee)
Direct Draw windowed mode code snippet. (Untested.)

Last updated: Sep 97
Back
1