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

SG_ViewAgar-SG scene rendering widget

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

The SG_View widget renders a SG(3) scene graph from the point of view of a specified SG_Camera(3) node.

AG_Object(3) -> AG_Widget(3) -> SG_View.

SG_View *
(AG_Widget *parent, SG *sg, Uint flags);


void
(SG_View *view, const AG_Color *c);


void
(SG_View *view, AG_EventFn fn, const char *fmt, ...);


void
(SG_View *view, AG_EventFn fn, const char *fmt, ...);


void
(SG_View *view, AG_EventFn fn, const char *fmt, ...);


void
(SG_View *view, AG_EventFn fn, const char *fmt, ...);


void
(SG_View *view, AG_EventFn fn, const char *fmt, ...);

The () function allocates, initializes, and attaches a SG_View object. Acceptable flags options include:

SG_VIEW_HFILL
Expand horizontally in parent container.
SG_VIEW_VFILL
Expand vertically in parent container. Shorthand for SG_VIEW_HFILL | .
SG_VIEW_NO_LIGHTING
Disable lighting calculations.
SG_VIEW_NO_DEPTH_TESTS
Disable Z-buffering.
SG_VIEW_CAMERA_STATUS
Display active camera status as overlay.
SG_VIEW_EDIT
Allow edition commands.
SG_VIEW_BGFILL
Fill background with the specified color (see SG_ViewSetBgColor()).

() may fail returning NULL if there is no default camera (e.g., ‘Camera0’ node) in the scene.

() specifies a background color c (effective only if SG_VIEW_BGFILL is set).

The () functions are used to set up optional callback functions to invoke upon specific GUI events. SG_ViewKeydownFn() and SG_ViewKeyupFn() set callbacks for ‘key-down’ and ‘key-up’ events. SG_ViewButtondownFn(), SG_ViewButtonupFn() and SG_ViewMotionFn() set callbacks for ‘mouse-button-down’, ‘mouse-button-up’ and ‘mouse-motion’ events, respectively.

int
SG_ViewTransition(SG_View *view, SG *sg, SG_Camera *cam, Uint flags);


void
(SG_View *view, const AG_Color *c);


void
(SG_View *view, Uint ms);

The () function arranges for a transition to a new scene sg and camera cam. If the cam argument is NULL, the default camera is used. By default, the transition is immediate. The following flags are accepted:

SG_VIEW_TRANSFADE
Fade-out and fade-in to the new scene. The function will return immediately (caller can poll transProgress to determine completeness; see “STRUCTURE DATA”).

() may fail and return NULL if a camera could not be found or a transition is already in progress.

() sets a fill color for the SG_VIEW_TRANSFADE effect.

() configures the duration of the fade effect in milliseconds.

void
SG_ViewSetCamera(SG_View *view, SG_Camera *cam);


void
(SG_View *view, int x, int y, M_Vector3 *vOut);

The () function changes the current camera of the view.

The () function translates the given two-dimensional view (widget) coordinates x, y to 3D world coordinates in vOut, according to the active camera's position, orientation and projection. The returned point is coincident with the camera's near plane.

For the AG_SG_View object:

SG *sg
Pointer to the active SG(3) object (read-only; use SG_ViewTransition()).
SG *sgTrans
Transition in progress to this scene (read-only).
float transProgress
Progress of the scene transition (-1.0 = start, 0.0 = midway, +1.0 = done).
SG_Camera *cam
Active camera (read-only; use SG_ViewSetCamera()).
SG_Camera *camTrans
Transition in progress to this camera (read-only).

M_Matrix(3), M_Real(3), M_Vector(3), SG(3), SG_Camera(3), SG_Intro(3)

The SG_View widget first appeared in Agar 1.6.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.