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_GL(3) FreeBSD Library Functions Manual AG_GL(3)

AG_GLagar OpenGL specific routines

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

This manual page documents the OpenGL-specific functions exported by Agar. These functions are available if Agar was compiled with OpenGL support (i.e., HAVE_OPENGL is defined after including the headers above).

Those functions are mostly useful for implementing new OpenGL-based Agar drivers (see AG_Driver(3)). Some of these functions are also useful to simplify texture management when implementing OpenGL-specific Agar-GUI widgets.

void
(void *drv, AG_GL_Context *gl);


void
(void *drv, const AG_Rect *rect);


void
(void *drv);

The () function is to be invoked by OpenGL-specific Agar drivers to initialize the GL context for rendering Agar GUI elements. This involves setting the projection and view matrices as well as various OpenGL options. AG_GL_InitContext() saves the current OpenGL state so that it can be later restored. The gl argument should point to an uninitialized AG_GL_Context structure.

The () function configures the GL viewport. In addition to invoking glViewport(3), this function also updates internal resolution-dependent states.

The () routines frees Agar's internal OpenGL state (restoring the state previously saved in AG_GL_InitContext()).

Multiple-window drivers will typically create a single OpenGL context per window, but single-window drivers may initialize and destroy the GL state more than once (see the AG_DRIVER_SW_OVERLAY option in AG_DriverSw(3)).

void
(AG_Driver *drv, Uint *texName, AG_Surface *suSrc, AG_TexCoord *tc);


void
(AG_Driver *drv, Uint texName, AG_Surface *suSrc, AG_TexCoord *tc);


void
(AG_Driver *drv, Uint texName);


void
(AG_Driver *drv, Uint listName);


void
(AG_Driver *drv, AG_Widget *wid, AG_Surface *s, int x, int y);


void
(AG_Driver *drv, AG_Widget *widSrc, int surfName, AG_Rect *r, int x, int y);


void
(AG_Driver *drv, AG_Widget *wid, AG_Surface *s, float w, float h);


void
(AG_Driver *drv, AG_Widget *wid, int surfName, float w, float h);


void
(AG_Driver *drv, AG_Widget *wid, int surfName, float w, float h);


void
(AG_Driver *drv, AG_Widget *wid);


void
(AG_Driver *drv, AG_Widget *wid);


void
(AG_Driver *drv, AG_Widget *wid, AG_Surface **sDst);

The () operation converts the specified AG_Surface(3) to an OpenGL texture, returning the GL texture handle in texName. Texture coordinates are returned into tc if non-NULL (i.e., X/Y coordinates are 0.0 and width/height are computed from the original dimensions divided by the texture's power-of-two dimensions).

The () operation uploads a new surface as the specified texture ID. Similarly to AG_GL_UploadTexture(), texture coordinates are returned into tc if non-NULL.

The () operation arranges for the specified GL texture to be deleted as soon as possible. Unlike a direct call to glDeleteTextures(3), using the AG_GL_DeleteTexture() function is thread-safe.

Similarly, () arranges for the given GL display list to be deleted as soon as possible.

The remaining functions (), AG_GL_BlitSurfaceFrom(), etc. are generic OpenGL backends to the corresponding driver surface/texture operations (i.e., (), (), etc.) See AG_Driver(3) for details.

void
(AG_Driver *drv, AG_Rect r, AG_Color c);


void
(AG_Driver *drv, int x, int y, AG_Color c);


void
(AG_Driver *drv, int x, int y, Uint32 c);


void
(AG_Driver *drv, int x, int y, Uint8 r, Uint8 g, Uint8 b);


void
(AG_Driver *drv, int x, int y, AG_Color C, AG_AlphaFn fnSrc, AG_AlphaFn fnDst);


void
(AG_Driver *drv, int x1, int y1, int x2, int y2, AG_Color C);


void
(AG_Driver *drv, int x1, int x2, int y, AG_Color c);


void
(AG_Driver *drv, int x, int y1, int y2, AG_Color c);


void
(AG_Driver *drv, int x1, int y1, int x2, int y2, AG_Color c, AG_AlphaFn fnSrc, AG_AlphaFn fnDst);


void
(AG_Driver *drv, int x, int y, int h, AG_Color C[2]);


void
(AG_Driver *drv, int x, int y, int h, AG_Color C[2]);


void
(AG_Driver *drv, int x, int y, int h, AG_Color C[2]);


void
(AG_Driver *drv, int x, int y, int h, AG_Color C[2]);


void
(AG_Driver *drv, AG_Rect r, AG_Color c);


void
(AG_Driver *drv, AG_Rect r, int z, int radius, AG_Color C[3]);


void
(AG_Driver *drv, AG_Rect r, int z, int radius, AG_Color C[3]);


void
(AG_Driver *drv, int x, int y, int r, AG_Color C);


void
(AG_Driver *drv, int x, int y, int r, AG_Color C);


void
(AG_Driver *drv, AG_Rect r, AG_Color c);


void
(AG_Driver *drv, AG_Rect r, AG_Color c, AG_AlphaFn fnSrc, AG_AlphaFn fnDst);


void
(AG_Driver *drv, AG_Glyph *glyph);


void
(AG_Driver *drv, const AG_Glyph *glyph, int x, int y);

These functions are generic OpenGL backends to the corresponding driver surface/texture operations (e.g., (), (), etc); see AG_Driver(3) for details.

AG_Driver(3), AG_Intro(3), AG_Widget(3), AG_Window(3)

The AG_GL interface first appeared in Agar 1.4.0.

December 21, 2022 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.