The Device Kit: Constants and Defined Types for Graphics Card Drivers


The Device Kit: Constants and Defined Types for Graphics Card Drivers

This section lists the various constants and types that are defined for graphics card drivers. Explanations for all of them can be found in the preceding section, "Developing a Driver for a Graphics Card."


Constants


Control Operations

Declared in: <device/GraphicsCard.h>

Enumerated constant Enumerated constant
B_OPEN_GRAPHICS_CARD B_GET_INFO_FOR_CLONE
B_CLOSE_GRAPHICS_CARD B_GET_INFO_FOR_CLONE_SIZE
B_GET_GRAPHICS_CARD_INFO B_SET_CLONED_GRAPHICS_CARD
B_GET_GRAPHICS_CARD_HOOKS B_CLOSE_CLONED_GRAPHICS_CARD
B_SET_INDEXED_COLOR
B_GET_SCREEN_SPACES B_PROPOSE_FRAME_BUFFER
B_CONFIG_GRAPHICS_CARD B_SET_FRAME_BUFFER
B_GET_REFRESH_RATES B_SET_DISPLAY_AREA
B_SET_SCREEN_GAMMA B_MOVE_DISPLAY_AREA

These constants define the various control operations that the Application Server or the Game Kit can request a driver to perform.

See also: Main Control Operations


Hook Count

Declared in: <device/GraphicsCard.h>

Defined constant Value
B_HOOK_COUNT 48

This constant is the number of hook function pointers that a driver must provide. Most will be NULL pointers.

See also: Hook Functions


Info Flags

Declared in: <device/GraphicsCard.h>

Defined constant
B_CRT_CONTROL
B_GAMMA_CONTROL
B_FRAME_BUFFER_CONTROL

These flags report the driver's ability to control the CRT display, make gamma corrections, and permit nonstandard configurations of the frame buffer.

See also: B_GET_GRAPHICS_CARD_INFO


Defined Types


frame_buffer_info

Declared in: <device/GraphicsCard.h>

      typedef struct {
            short bits_per_pixel;
            short bytes_per_row;
            short width;
            short height;
            short display_width;
            short display_height;
            short display_x;
            short display_y;
         } frame_buffer_info 

This structure is used to pass information to the driver on how the frame buffer should be configured.

See also: the BWindowScreen class in the Game Kit, Control Operations for Manipulating the Frame Buffer above


graphics_card_config

Declared in: <device/GraphicsCard.h>

      typedef struct {
            ulong space;
            float refresh_rate;
            uchar h_position;
            uchar v_position;
            uchar h_size;
            uchar v_size;
         } graphics_card_config 

This structure is used to pass the driver a set of parameters describing how the graphics card should be configured.

See also: B_CONFIG_GRAPHICS_CARD


graphics_card_hook

Declared in: <device/GraphicsCard.h>

      typedef void (*graphics_card_hook)(void) 

This is the general type declaration for a hook function. Specific hook functions will in fact declare various sets of arguments and all return a long error code rather than void.

See also: Hook Functions


graphics_card_info

Declared in: <device/GraphicsCard.h>

      typedef struct {
            short version;
            short id;
            void *frame_buffer;
            char rgba_order[4];
            short flags;
            short bits_per_pixel;
            short bytes_per_row;
            short width;
            short height;
         } graphics_card_info 

Drivers use this structure to supply information about themselves and the current configuration of the frame buffer to the Application Server and to the BWindowScreen class in the Game Kit.

See also: B_GET_GRAPHICS_CARD_INFO


graphics_card_spec

Declared in: <device/GraphicsCard.h>

      typedef struct {
            void *screen_base;
            void *io_base;
            ulong vendor_id;
            ulong device_id;
            ulong _reserved1_;
            ulong _reserved2_;
         } graphics_card_spec 

This structure informs the driver about the graphics card and how it's mapped into the system.

See also: B_OPEN_GRAPHICS_CARD


indexed_color

Declared in: <device/GraphicsCard.h>

      typedef struct {
            long index;
            rgb_color color;
         } indexed_color 

This structure is used to set up the list of 256 colors in the B_COLOR_8_BIT color space. It locates a particular color at a particular index in the list.

See also: B_SET_INDEXED_COLOR


indexed_color_line

Declared in: <device/GraphicsCard.h>

      typedef struct {
            short x1;
            short y1;
            short x2;
            short y2;
            uchar color;
         } indexed_color_line 

This structure defines a colored line in the B_COLOR_8_BIT color space.

See also: Index 8: Drawing a Line Array with an 8-Bit Color


refresh_rate_info

Declared in: <device/GraphicsCard.h>

      typedef struct {
            float min;
            float max;
            float current;
         } refresh_rate_info 

Drivers use this structure to report the current refresh rate, and the maximum and minimum possible rates.

See also: B_GET_REFRESH_RATES


rgb_color_line

Declared in: <device/GraphicsCard.h>

      typedef struct {
            short x1;
            short y1;
            short x2;
            short y2;
            rgb_color color;
         } rgb_color_line 

This structure defines a colored line in the B_RGB_32_BIT color space.

See also: Index 9: Drawing a Line Array with a 32-Bit Color


screen_gamma

Declared in: <device/GraphicsCard.h>

      typedef struct {
            uchar red[256];
            uchar green[256];
            uchar blue[256];
         } screen_gamma 

This structure defines the table used to make gamma corrections for the screen display.

See also: B_SET_SCREEN_GAMMA






The Be Book, HTML Edition, for Developer Release 8 of the Be Operating System.

Copyright © 1996 Be, Inc. All rights reserved.

Be, the Be logo, BeBox, BeOS, BeWare, and GeekPort are trademarks of Be, Inc.

Last modified September 6, 1996.