GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AG_DRIVERSW(3) FreeBSD Library Functions Manual AG_DRIVERSW(3)

AG_DriverSw
agar single-window driver class

#include <agar/core.h>
#include <agar/gui.h>

AG_DriverSw is a subclass of AG_Driver(3) for "single-window" drivers. This class of drivers includes dumb framebuffers and any other interface where Agar needs to implement a window manager internally.

AG_Driver(3) -> AG_DriverSw.

The AG_DriverSwClass structure describes a "single-window" graphics driver (i.e., a dumb framebuffer, or any other interface where Agar will need to provide its own window manager). AG_DriverSwClass inherits from AG_DriverClass and is defined as follows:
typedef struct ag_driver_sw_class {
	struct ag_driver_class _inherit;
	Uint flags;
	int  (*openVideo)(void *drv, Uint w, Uint h, int depth,
	                  Uint flags);
	int  (*openVideoContext)(void *drv, void *ctx, Uint flags);
	int  (*setVideoContext)(void *drv, void *ctx);
	void (*closeVideo)(void *drv);
	int  (*videoResize)(void *drv, Uint w, Uint h);
	int  (*videoCapture)(void *drv, AG_Surface **);
	void (*videoClear)(void *drv, AG_Color c);
} AG_DriverSwClass;

At this time, there are no flag options and flags should be initialized to 0.

The openVideo() operation opens a new graphics display of specified dimensions w, h in pixels, and depth in bits per pixel. The flags argument defines the various flags options passed by AG_InitVideo() (see AG_InitVideo(3) for a description of those options).

The openVideoContext() operation "attaches" Agar to an existing display context, passed as ctx. For example, drivers for the SDL library will accept a pointer to a SDL_Surface(3) as ctx. The flags argument specifies video options (see AG_InitVideo(3) for the list of options).

The closeVideo() operation should "close" or detach from a graphics display, releasing any resources previously allocated by openVideo() or openVideoContext().

The videoResize() operation resizes the video display to the specified geometry in pixels. It should return -1 if the display cannot be resized, or 0 on success.

videoCapture() captures the content of the video display to an AG_Surface(3). The function should return 0 on success or -1 on failure.

videoClear() clears the video background with the specified color c.

setVideoContext() changes the existing display context (assumes openVideoContext() has been called before). If the surface size has changed, Agar windows are clamped, moved or resized as appropriate.

For the AG_DriverSw (driver instance) object:
Uint flags
Option flags. Possible flags include:
Enables "overlay" mode, forcing the OpenGL state to be completely initialized and released at every rendering cycle.
Display a generic "window list" popup menu on right-click over empty background.
The driver is currently in full-screen mode (read-only).
Uint rNom
Nominal display refresh rate in ms.
int rCur
Effective display refresh rate in ms.
Uint winop
Modal window-manager operation in effect, may be set to AG_WINOP_NONE (normal operation), AG_WINOP_MOVE (a window is being moved) or AG_WINOP_[LRH]RESIZE (a window is being resized left/right/horizontally).

AG_Driver(3), AG_DriverMw(3), AG_InitGraphics(3), AG_Intro(3)

The AG_DriverSw class first appeared in Agar 1.4.0.
May 2, 2010 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.