Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
AG_INITVIDEOSDL(3)	    Library Functions Manual	    AG_INITVIDEOSDL(3)

NAME
       AG_InitVideoSDL -- agar SDL video initialization

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

DESCRIPTION
       If  Agar	 has been compiled with	SDL1 support (--with-sdl), the "sdlfb"
       and "sdlgl" driver modules become available, and	the GUI	system can  be
       attached	to an existing SDL display context.  If	Agar has been compiled
       with  SDL2 support (--with-sdl2), the "sdl2fb" and "sdl2gl" drivers be-
       come available.

       Note: When creating a new SDL display (as opposed to  attaching	to  an
       existing	 one),	you  can  call	AG_InitGraphics(3) with	the "<SDL>" or
       "<SDL2>"	argument instead of using AG_InitVideoSDL().

INITIALIZATION
       int AG_InitVideoSDL(SDL_Surface *display, Uint flags)

       int AG_SetVideoSurfaceSDL(SDL_Surface *display)

       int AG_ResizeDisplay(int	w, int h)

       void AG_SetVideoResizeCallback(void (*fn)(Uint w, Uint h)))

       The AG_InitVideoSDL() function initializes the GUI to attach to an  ex-
       isting	SDL  display  surface.	 If  the  specified  surface  has  the
       SDL_OPENGL flag then the	GL-capable driver  "sdlgl"  (or	 "sdl2gl")  is
       used.   Otherwise, the direct frame-buffer driver "sdlfb" (or "sdl2fb")
       is used instead.	 The AG_InitVideoSDL() function	accepts	the  following
       flags options:

       AG_VIDEO_HWSURFACE	Request	 a  hardware  frame buffer (SDL1 only,
				sets SDL_HWSURFACE).

       AG_VIDEO_ASYNCBLIT	Enable	asynchronous  blitting	updates	 (SDL1
				only, sets SDL_ASYNCBLIT).

       AG_VIDEO_ANYFORMAT	Disable	emulation of surface depth (SDL1 only,
				sets SDL_ANYFORMAT).

       AG_VIDEO_HWPALETTE	Exclusive  palette  access  (SDL1  only,  sets
				SDL_HWPALETTE).

       AG_VIDEO_DOUBLEBUF	Enable double-buffering	in frame  buffer  mode
				(SDL1 only).

       AG_VIDEO_FULLSCREEN	Start up application in	full-screen mode

       AG_VIDEO_RESIZABLE	If a window manager is available, request that
				the application	be resizable.  This is the de-
				fault with SDL2.

       AG_VIDEO_FIXED		If a window manager is available, request that
				the  window be non-resizable.  This is the de-
				fault with SDL1.

       AG_VIDEO_BORDERLESS	If a window manager is available, disable win-
				dow decorations.

       AG_VIDEO_NOFRAME		Alias for AG_VIDEO_BORDERLESS.

       AG_VIDEO_BGPOPUPMENU	Whenever the user right-clicks on an area  not
				covered	 by an Agar window, display a standard
				pop-up menu with the list of active windows.

       AG_VIDEO_OPENGL		Require	OpenGL mode.  If OpenGL	is not	avail-
				able, initialization will fail.

       AG_VIDEO_OPENGL_OR_SDL	Try  OpenGL mode if available, otherwise fall-
				back to	SDL frame-buffer mode.

       AG_VIDEO_OVERLAY		Run in OpenGL "overlay"	mode.  In  this	 mode,
				Agar  will  never clear	the background or swap
				GL buffers.   Before  rendering	 itself,  Agar
				will  also  save  the current OpenGL state and
				restore	it completely once rendering  is  com-
				plete.	 Internally,  this  option  causes the
				AG_DRIVER_SW_OVERLAY option  to	 be  set  (see
				AG_DriverSw(3)).

       The  AG_SetVideoSurfaceSDL() function can be used to reattach to	a dif-
       ferent (e.g., a newly resized) SDL display surface without reinitializ-
       ing the GUI.

       Note: The AG_InitVideoSDL() and AG_SetVideoSurfaceSDL()	functions  are
       only  available	if  Agar  has been compiled with SDL1 support (to find
       out, include "<agar/config/have_sdl.h>" and test	for HAVE_SDL).

       The AG_ResizeDisplay() function resizes the video display to the	speci-
       fied dimensions in  pixels.   AG_SetVideoResizeCallback()  registers  a
       callback	 function  which  will	be invoked whenever the	display	is re-
       sized.  Both of these functions are only	 applicable  to	 single-window
       drivers.

SEE ALSO
       AG_Core(3),  AG_DriverSDLFB(3),	AG_DriverSDLGL(3), AG_DriverSDL2FB(3),
       AG_DriverSDL2GL(3), AG_InitGraphics(3), AG_Intro(3)

       Simple DirectMedia Layer: https://libsdl.org/

HISTORY
       SDL1 support first appeared in Agar 1.0.	 The "sdlfb" and "sdlgl"  dri-
       ver  modules  first  appeared in	Agar 1.4.0.  The "sdl2fb" and "sdl2gl"
       driver modules appeared in Agar 1.7.0.

Agar 1.7		       December	21, 2022	    AG_INITVIDEOSDL(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=AG_InitVideoSDL&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help