ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation.

RAVE and DrawSprocket Integration

Q: How can I integrate RAVE and DrawSprocket in my application?

A: RAVE and DrawSprocket both perform single and double buffering, so it would be really nice to integrate them together. Unfortunately, there won't be any resources to do this in the near future.

The easiest way to do this is to only use DrawSprocket to choose and configure the display, and allow RAVE to handle all of the buffering issues. This also makes sense since the RAVE engine may be able to do the buffering and blitting entirely in hardware.

First, you should walk the list of all RAVE engines, and create a list of engines that your application will successfully run under. Once you've got the list of engines, the next step is to eliminate any GDevices from the list that won't support one of those engines. This can be done by iterating over the device list, and checking each device against all of the engines using QAEngineCheckDevice. If no engines support that device, you can remove it from the list by reserving a DrawSprocket context on that monitor. You'll never actually activate that context, so you can just call DSpGetFirstContext to get the first valid mode, and reserve the context using that information.

When you've finished walking the list of GDevices, call DrawSprocket to find a valid context. Since you are planning on using RAVE to do your rendering, you should reserve the context using a page count of 1, which tells DrawSprocket to not allocate any back buffers.

Once you've activated the context, you should test that one of the RAVE engines you've chosen will run on that device. Some 3D accelerators only work in certain video depths, so you need to test again using QAEngineCheckDevice after the mode switch has occurred. Most of the current accelerators will always work in thousands of colors.

You should be prepared to delete all of the RAVE context information and textures before releasing the DrawSprocket context or allowing DrawSprocket to change video modes. Any resolution change can reorganize memory on the graphics card, which will disturb the RAVE buffers and texture memory.

Alternatively, you can allow the user to choose any monitor and simply default to your own software engine if there isn't a decent 3D hardware solution that will work with that device.

[Apr 20 1998]

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.