Function:ss2lt
From S2PLOT
(Difference between revisions)
Current revision
ss2lt
Load a texture for future (generally repeated) use.
Prototype
unsigned int ss2lt(char *itexturefn);
Description
Load a texture for future (generally repeated) use. The texture file should be stored in the directory pointed to by environment variable S2PLOT_TEXPATH.
See Also
Textures | Important information on using textures in S2PLOT. |
ss2gt | Get a pointer to an identified texture. |
ss2pt | Reinstall a texture. |
s2latexture | Create a texture with LATEX commands. |
Code Example
#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
float x, y, z; /* Position */
float r, g, b; /* Colour */
float radius; /* Radius */
char *texture = "firetile2_pow2_rgb.tga";
/* Texture in directory pointed to by S2PLOT_TEXPATH */
int texid;
s2opend("/?",argc, argv); /* Open the display */
s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates */
s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0); /* Draw coordinate box */
x = 0.0; y = 0.0; z = 0.0; /* Set position */
r = 0.0; g = 0.0; b = 0.0; /* Set colour */
radius = 0.4;
texid = ss2lt(texture); /* Load for later use */
ns2spherex(x,y,z, radius, r,g,b, texid); /* Draw textured sphere */
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.