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

SG_TextureAgar-SG texture object

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

The SG_Texture object describes texture information which may be attached to SG_Object(3) nodes in a SG(3) scene. Materials have the following properties:

  • Texture image (one surface, or multiple blended surfaces).
  • Emissive, ambient, diffuse and specular color components.
  • Shininess (specular exponent).
  • Ties to fragment shader programs (see SG_Program(3)).

AG_Object(3) -> SG_Texture.

SG_Texture *
(SG_Node *parent, const char *name);


SG_TextureSurface *
(SG_Texture *tex, const AG_Surface *s);


SG_TextureSurface *
(SG_Texture *tex, AG_Surface *s);


void
(SG_Texture *tex, SG_TextureSurface *ts);


SG_TextureProgram *
(SG_Texture *tex, SG_Program *prog);


void
(SG_Texture *tex, SG_TextureProgram *tp);


int
(SG_Texture *tex);

The () function allocates, initializes, and attaches a SG_Texture object.

The () function inserts a copy of the given AG_Surface(3). The SG_TextureAddSurfaceNODUP() variant inserts a pointer to a surface which must remain valid as long as the SG_Texture exists. SG_TextureDelSurface() deletes the specified surface.

() inserts the specified fragment program (see SG_Program(3)), which will be used when rendering the texture. SG_TextureDelProgram() removes the specified fragment program.

The () function blends the input surfaces and generates the final texture surface.

For the SG_Texture object:

M_Color emissive
Light emitted by surface (Ke)
M_Color ambient
Ambient reflectance (Ka)
M_Color diffuse
Diffuse reflectance (Kd)
M_Color specular
Specular reflectance (Ks)
M_Real shininess
Specular exponent
AG_Surface *surfaces
Input surface(s)
Uint nSurfaces
Input surface count

M_Color(3), M_Real(3), SG(3), SG_Intro(3), SG_Light(3), SG_Program(3), SG_View(3)

The SG_Texture object 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.