The Game Kit: Global Functions, Constants, and Defined Types


Global Functions, Constants, and Defined Types

Library: libgame.so

The Game Kit has just one global function, set_mouse_position(). It should be called only by an application that has control of the screen through a BWindowScreen object. Otherwise, the kit borrows constants and types defined for graphics card drivers and by other parts of the BeOS. Those that are not documented for the Interface and Support Kits are listed here.


Global Functions


set_mouse_position()

Declared in: <game/WindowScreen.h>

      void set_mouse_position(int32 x, int32 y) 

Moves the cursor hot spot to (x, y) in the screen coordinate system, where x is a left-to-right index to a pixel column and y is a top-to-bottom index to a pixel row. The origin of the coordinate system is the left top pixel of the display area of the main screen.

This function should be called only while the application has a direct connection to the frame buffer through a BWindowScreen object.


Constants


Control Flags

Declared in: <add-ons/graphics/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. Only the last has any meaning for the Game Kit.

See also: CardInfo()


Defined Types


frame_buffer_info

Declared in: <add-ons/graphics/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 report the current configuration of the frame buffer.

See also: FrameBufferInfo()


graphics_card_hook

Declared in: <add-ons/graphics/GraphicsCard.h>

      typedef void (*graphics_card_hook)(void) 

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

See also: CardHookAt(), 37369: head1: Graphics Card Hook Functions


graphics_card_info

Declared in: <add-ons/graphics/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 the BWindowScreen class.

See also: CardInfo()






The Be Book, in lovely HTML, for BeOS Release 4.

Copyright © 1998 Be, Inc. All rights reserved.

Last modified December 20, 1997.