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_INITGRAPHICS(3) FreeBSD Library Functions Manual AG_INITGRAPHICS(3)

AG_InitGraphicsagar GUI initialization

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

After having initialized the Agar-Core library with AG_InitCore(3), Agar-GUI applications must initialize the GUI system.

As of Agar 1.7.0, the standard drivers included in the distribution are:

AG_DriverCocoa(3)
(-d "cocoa") MacOS X with OpenGL. Multi-window.
AG_DriverDUMMY(3)
(-d "dummy") No-op (prints to the debug console).
AG_DriverGLX(3)
(-d "glx") X Windows with OpenGL. Multi-window.
AG_DriverSDLFB(3)
(-d "sdlfb") SDL1 with framebuffer. Single-window.
AG_DriverSDLGL(3)
(-d "sdlgl") SDL1 with OpenGL. Single-window.
AG_DriverSDL2FB(3)
(-d "sdl2fb") SDL2 with framebuffer. Single-window. Game controllers and joysticks are supported.
AG_DriverSDL2GL(3)
(-d "sdl2gl") SDL2 with OpenGL. Single-window. Game controllers and joysticks are supported.
AG_DriverSDL2MW(3)
(-d "sdl2mw") SDL2 with OpenGL. Multi-window. Game controllers and joysticks are supported.
AG_DriverWGL(3)
(-d "wgl") MS Windows with OpenGL. Multi-window.

int
(const char *drivers);


void
(void);


int
(Uint flags);


void
(void);

The () function initializes the Agar GUI system. If the drivers argument is NULL (the usual case), Agar selects the "best" driver available on the current platform. If drivers is non-NULL, it should be a comma-separated list of drivers in order of preference. Special selectors are available to include drivers based on capabilities. "<OpenGL>" selects any driver with support for OpenGL 1.1 or later. "<SDL>" any driver based on SDL1, "<SDL2>" any driver based on SDL2 and "<FB>" any driver based on a software framebuffer.

The full list of compiled-in drivers may be obtained by calling AG_ListDriverNames(3). Driver-specific parameters may be specified as a colon-separated list enclosed in parentheses. The available options are documented on the driver's respective manual page. Some examples:

sdlgl,sdlfb
<SDL>(width=640:height=480:depth=32)
<SDL2>(width=640:height=480)
<openGL>(stereo=1)

It is recommended that applications provide a way for the user to specify alternate drivers, for example agartest(1) accepts the [-d agar-driver] command-line arguments.

The () routine shuts down and releases all resources allocated by the Agar-GUI library.

Alternatively, the () function initializes the Agar GUI system, but does not create a driver instance upon initialization. The caller may invoke AG_DriverOpen(3) to create one or more driver instances. For example, an X11 application that can talk to multiple X11 servers might call () for each X11 connection.

AG_Core(3), AG_CustomEventLoop(3), AG_Driver(3), AG_EventLoop(3), AG_InitVideoSDL(3), AG_Intro(3)

An AG_InitVideo() function first appeared in Agar 1.0. It was replaced by AG_InitGraphics() in Agar 1.4.0.

February 18, 2023 Agar 1.7

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.